if performance is an issue, your best choice is C instead of Python. Deformers, as they often operate on a per-vertex math, tend to be rather slow in Python. sometimes it might be a case of slow wrappers, sometimes python is slow himself (stuff like unpacking, array shrinking really hurts it's performance when you would not intuitively expect it).


On 2011.01.26 16:37, hotchpotch wrote:
  I’m creating a basic deformer using the python api (Ma\ya 2009) - 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



--
Viktoras
www.neglostyti.com

--
http://groups.google.com/group/python_inside_maya

Reply via email to