tebop opened this issue on Oct 30, 2007 · 56 posts
diolma posted Sun, 04 November 2007 at 5:33 PM
"Now a question, for G2 figures is it possible to add the waist into the mix? I have not done that much playing around with python so I'm not sure."
Not having the G2 figures, I don't know their set-up.
Is the waist a separate part between the chest and the abdomen?
If so, then yes, it can be done, with a litte tweaking...
In the "Sanity Check" add an extra line:
* # - Sanity check...
try:
Figure = scene.CurrentFigure()
aChest = Figure.Actor( "Chest" )
aAbdomen = Figure.Actor( "Abdomen" )
*** aWaist = Figure.Actor( "Waist")
**(Make sure that "Waist" is spelled exactly as it is in the Properties panel for the figure)
Then in def doActor(), after the bit that gets the "ParameterByCode" for the chest and the abdomen, add 3 lines doing exactly the same thing for the waist. eg:
* :
:
abdYR = aAbdomen.ParameterByCode(poser.kParmCodeYROT )
abdZR = aAbdomen.ParameterByCode(poser.kParmCodeZROT )
** waistXR = aWaist.ParameterByCode(poser.kParmCodeXROT)
waistYR = aWaist.ParameterBy**............ (you get the pattern..)**
** etc..
Finally, instead of
* v = (abdXR.Value() + chestXR.Value()) * 0.5
abdXR.SetValue( v )
chestXR.SetValue( v )
use
** v = (abdXR.Value() + chestXR.Value() + waistXR) * 0.33333
** * abdXR.SetValue( v )
chestXR.SetValue( v )
*** waistXR.SetValue( v )
**
and similarly for waistYR and waistZR
(Those XR, YR, ZR suffices are my shorthand for XRotation, YRotation etc)
Hope that helps:-)
PS. For better accuracy you might want to use
** v = (abdXR.Value() + chestXR.Value() + waistXR) / 3.0
** but there'll still be some small discrepancies. Shouldn't be big enough to be noticable tho..
Cheers,
Diolma