Thanks for your help. Now everything works. Damn, I feel ashamed I've wasted so much time to figure out a mistake so trivial...
About the multiplication: yeah that's cool. Fortunately OpenMaya has a fairly good interface for its numerical types. Bye, Giulio Il giorno venerdì 24 novembre 2017 02:22:58 UTC+1, Angelo ha scritto: > > Also, to multiply a point, you can simply just cast an MPoint and multply > that directly into your MMatrix variable: mat. Maya supports MPoint to > MMatrix multiplication. > > om.MPoint() * om.MMatrix() will work. > > On Thu, Nov 23, 2017 at 7:19 PM, Angelo Sta. Catalina < > [email protected] <javascript:>> wrote: > >> Oh. I see a problem. In your initialize method, you shouldn't use >> om.MFnTypedAttribute to create a matrix attribute. Use >> om.MFnMatrixAttribute. >> >> mAttr = om.MFnMatrixAttribute() >> >> Node.aMatrix = mAttr.create('matrix', 'mat') >> >> Try doing that. >> >> On Thu, Nov 23, 2017 at 7:01 PM, Giulio Martella <[email protected] >> <javascript:>> wrote: >> >>> Nope, the "print mat" instruction should have printed the identity >>> matrix in that case; the thing printed is a matrix filled with values very >>> near to zero, not the identity for sure. >>> What I'm trying to accomplish is far more complex than this barebone >>> plugin I've written just to explain my problem easily. However, to be >>> precise, I need to read a matrix and then multiply it by a point. So long, >>> I've obtained only matrices filled with zeroes, resulting in zeroing also >>> the point I was multiplying. >>> >>> -- >>> Giulio >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Python Programming for Autodesk Maya" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to [email protected] >>> <javascript:>. >>> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/python_inside_maya/07f1e123-75e2-46b3-a339-6c99b850a8d7%40googlegroups.com >>> . >>> For more options, visit https://groups.google.com/d/optout. >>> >> >> > -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/1151d22a-f55b-4eb1-b90d-d518ac36fa3b%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
