Thanks paul, I realize two difference with my call and your call with heat wave.
Mistake 1:
MDoubleArray/MFloatArray: A list of the old values. The same size as the influence objects
Solution:
This return the old value to be used for undo. I'm not suppose to past it the old values. I thought it was an undo support by passing the old values, so the undo could work. Now that I read the help docs again, I see that I just simply missed it. Suppose, it would of overwritten my values is I passed it a MDoubleArray/MFloatArray... but didn't check it since its not important.
Mistake 2:
MIntArray: Tried both a python list and MIntArray. The same size as the influence objects
MDoubleArray/MFloatArray: A tuple of the new values. The same size as the influence objects
MDoubleArray/MFloatArray: A tuple of the new values. The same size as the influence objects
Solution:
I thought it was good enough sending lists/tuples as arguments. Maya really wants a MIntArray and a MDoubleArray/MFloatArray as arguments. I have seen it before where it have worked with lists/tuples. But, not with this. Once I passed it the correct type for both it worked fine.
Thanks,
-brian
www.meljunky.com
-------- Original Message --------
Subject: [Maya-Python] Re: MFnSkinCluster.setWeights doesn't work from
multiple weights at once.
From: Paul Molodowitch <[email protected]>
Date: Sun, October 11, 2009 6:39 pm
To: [email protected]
Hmm... I wish I could help, as I could swear I got an error similar to
this at one point. I have a fuzzy memory that the message was a
little misleading - one of the other arguments was actually of the
incorrect type, or somesuch (I'm guessing it complains about the 4th
arg not being an int because it just tries all the different
call-signatures in some arbitrary order - if it doesn't match any, it
just gives the error message for whatever the last call-signature it
happened to try was...?).
Anyway, when I made that call, i used:
mfnSkin.setWeights(an_MDagPath,
a_component_MObject,
an_MIntArray,
an_MDoubleArray,
False,
another_MDoubleArray)
(If you're curious, you can take a look at some code that makes such a
call at: http://github.com/elrond79/pmHeatWeight)
Definitely worth using this version of the call if you can get it to
work, as the time savings are VERY big over the single-influence
version.
- Paul
--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/python_inside_maya
-~----------~----~----~----~------~----~------~--~---
