World space deformer in python API?

World space deformer in python API?

Anonymous
Not applicable
511 Views
1 Reply
Message 1 of 2

World space deformer in python API?

Anonymous
Not applicable
I'm creating a basic deformer using the python api - the simplest way to get it working the way I want is to convert the in mesh to world space using the local_to_world matrix supplied in the
deform method inside the geom iteration loop. This all works fine - except that it really slows down the plugin. Is there any way of getting MItGeometry's .position function to return in worldSpace? The default is in local space - and the subsequent matrix mults to and from world space seems to add an silly amount of time.
For example on a 10k vertex mesh the plugin runs at 15fps if I set it up to use localSpace - but at 10fps using worldSpace - mainly because I have to convert every point position within the iter loop to worldSpace and back - whereas if I keep things in localSpace I can cull a large proportion of position values before doing the deformation calculations.


any help gratefully received
0 Likes
512 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
Try putting ".position( YourOpenMayaModule.MSpace.kWorld )", it should(tm) give you the world-space position.
0 Likes