get/set component orientation for move/rotate/scale manip in custom shape

53 views
Skip to first unread message

benjamin ghys

unread,
Jan 25, 2024, 12:31:38 PMJan 25
to Python Programming for Autodesk Maya
Hello!

I'm currently working on a custom C++ shape in Maya that inherits from MPxSurfaceShape.
My goal is to align the transformation gizmo (move/rotate/scale) with the orientation of the individual components of my shape.

Current Behavior: The transformation gizmo aligns with the orientation of the object, not the individual component(s).
Desired Behavior: I want the gizmo to align based on the orientation of the components I'm transforming.

There doesn't seem to be any function I can override for this specifically.

I tried multiple things:
I have overridden vertexOffsetDirection and works when transforming along the normal.
Sadly not for components.
I check the ApiMeshShape example but it also doesn't align the gizmo to the component like the basic mesh type does in Maya.
I checked MPxGeometryIterator and set hasNomals to true, but there is no method for returning normals?
I added a MPxTransform class but also no help from there as it is only plugs.
I checked the rockingChair example too but couldn't find anything.

I wonder if it is actually possible.
Maybe someone here has more experience with custom shapes?

Many thanks
Benjamin
Reply all
Reply to author
Forward
0 new messages