Forum: Poser Python Scripting


Subject: script to reverse pose of a character

dennisharoldsen opened this issue on May 15, 2007 · 7 posts


dennisharoldsen posted Tue, 15 May 2007 at 2:34 PM

thanks for the previous crucial help from nruddock and PhilC.

it would be nice to have a script to reverse the pose of a character.
i got the idea from the folowing script.
this is a script i downloaded.
sometimes it works but the result is not always what i expect.
i can send images to show this.

#------------------------------------------------------------

Swaptotal.py

Flip the symmetry of the whole figure with one button push.

Copyright (c) 2005 David G. Drumright (ockham)

#------------------------------------------------------------

import poser
scene = poser.Scene()

#-----------------------------------------------------------------------------

In currently selected figure, swap right and left.

#-----------------------------------------------------------------------------
try:
  TheFigure = scene.CurrentFigure()
except:
  exit

#-----------------------------------------------------------------------------
scene.SetFrame(0)

TheFigure.SwapTop()
TheFigure.SwapBottom()
MidlineList = ["BODY","Neck","Upper Neck","Head","Chest","Abdomen","Hip","Left Eye","Right Eye"]
for Name in MidlineList:
    try:
        OneActor = TheFigure.Actor(Name)
    except:
        pass
    try:
        TwistParm = OneActor.ParameterByCode(poser.kParmCodeYROT)
        TwistParm.SetValue(-TwistParm.Value())
    except:
        pass
    try:
        SideParm = OneActor.ParameterByCode(poser.kParmCodeZROT)
        SideParm.SetValue(-SideParm.Value())
    except:
        pass