I’m trying to port over a plugin from 3D Studio Max to Maya. It is a collection of physics primitives - sphere, capsule, cylinder, box - they can be positioned relative to a joint such that they are animated with the skeleton. We use these to allow artists to define low-resolution physics representations of the joints for limb-level collision detection in our engine. The primitives appear in Max as a non-scalable, not editable geometry, with parameters for radius, width, length, height etc. They are visually distinct as well, being bright red, green or orange depending on a drop down - an indication of their priority in game.
So far I have implemented a MPxGeometryOverride on an MPxLocatorNode, following the footPrintNode_GeometryOverride sdk sample, but what I am struggling with is a way to prevent the locator from inheriting the scale from the parent joint. I recognize there is an ‘inherit transform’ checkbox on the transform, but I want to inherit translation AND rotation, while still allowing the transform to be moved relative to the parent joint. This prevents me simply from connecting a joint’s translation and orientation to the primitive’s transform’s translation and orientation, as it won’t allow the artist to position the primitive with some relative offset.
Is there some way, when drawing the MPxGeometryOverride, to strip the scale when rendering? As far as I can tell all I can do is provide the mesh via MPxGeometryOverride::populateGeometry. How can I get an instance’s transform and provide a modified matrix that removes the scale?
Maybe I am approaching all this wrong, and there is different class I should be implementing? Any direction here would help.
Many thanks,
S