Yeah. I understood Maya.Cmds has a lot of caveats. Oh, and i found a huge bug on maya.cmds . Well, i found several ones, including that crossProduct or dotProduct (don't remember which one) in MEL casts to INT any value passed if you pass the value itself, not a variable..., funny thing. The workaround,set a variable, pass it instead. LOL).
The big bug is this one: XFORM command works on component space instead of world Space, ignoring completely worldSpace flag. worldSpace gets ignored several times. In this case, if you use xform on any component or group of components, it ignores the flag.And it is surprising, could be easier this way, but what i had to do is generate an inverse matrix (using normal python, not numPy (i have my reasons)) from the last step of the extrude position, and apply it to the new transformation matrix, so it converts the tranfsormation matrix (world space) itself into a relative transf. matrix, just for this step in the curve. So it contains JUST the transformation between the step before extruding, and the new position. Sucks... But now it works. I can see the elements following the path of the curve. So xform works. Doesn't collapse things, but i can't give it worlspace transformations... which sucks anyway... Oh! And something else. As i am using the normal vector given by pointOnCurve to construct the Frenet matrix (NBTP) from the bezier curve, it swaps sometimes, so it makes huge twists on the tube i generate. This is related to the also known f** Gimbal Lock for animators. Those twists are related to the fact that it is constructed using euler maths, not quaternions. This sucks too, bezier allways gives those problems. A workaround for this is to use the up vector of the world, projected into the plane generated by the tangent vector, which is always correct.This way, the normal is always perpendicular to tangent, and is allways pointing to the same direction or near it. This removes those twists and works perfectly. :-) Thanks everybody, hope this is useful for somebody! -- Lidia 2015-02-28 19:23 GMT+01:00 Marcus Ottosson <[email protected]>: > It almost sounds like you’d be better off *not* using maya.cmds but > rather the Python API; it’ll probably give you an easier time with matrices > and arbitrary transformations of vertices. I’m not terribly acquainted with > it however, and won’t be able to give you much practical advice. :S > > Maybe this would help? > > - Maya Python Plug-in Learning Path > > <http://help.autodesk.com/cloudhelp/2015/ENU/Maya-SDK/files/GUID-856DDB26-93E7-493D-A1D4-60C4CBA38B9C.htm> > > Otherwise, maybe there’s someone else on the list with more experience in > this area. Good luck! > > Best, > Marcus > > > -- > 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/CAFRtmOCo2quq-ib%3DtUR-X2UKz5d31VDETfV%2BvczmqVP1Xw%2BO3g%40mail.gmail.com > <https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOCo2quq-ib%3DtUR-X2UKz5d31VDETfV%2BvczmqVP1Xw%2BO3g%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > 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/CAAB1%3D8xBHvgk%3Dj7S0NmE_tMT0%3D3yW99FtL%3DkwYVU6jZKCX-2jg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
