Sat, Nov 30, 3:03 PM CST

Renderosity Forums / Poser Python Scripting



Welcome to the Poser Python Scripting Forum

Forum Moderators: Staff

Poser Python Scripting F.A.Q (Last Updated: 2024 Sep 18 2:50 am)

We now have a ProPack Section in the Poser FreeStuff.
Check out the new Poser Python Wish List thread. If you have an idea for a script, jot it down and maybe someone can write it. If you're looking to write a script, check out this thread for useful suggestions.

Also, check out the official Python site for interpreters, sample code, applications, cool links and debuggers. This is THE central site for Python.

You can now attach text files to your posts to pass around scripts. Just attach the script as a txt file like you would a jpg or gif. Since the forum will use a random name for the file in the link, you should give instructions on what the file name should be and where to install it. Its a good idea to usually put that info right in the script file as well.

Checkout the Renderosity MarketPlace - Your source for digital art content!



Subject: script to reverse pose of a character


dennisharoldsen ( ) posted Tue, 15 May 2007 at 2:34 PM · edited Tue, 26 November 2024 at 7:29 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


PhilC ( ) posted Tue, 15 May 2007 at 2:51 PM

Rotoscoper has that and a number of other posing options.


svdl ( ) posted Tue, 15 May 2007 at 3:07 PM · edited Tue, 15 May 2007 at 3:08 PM

file_377652.doc

I can understand why it doesn't always work: the MidlineList is not valid for all figures (this one is valid for Victoria 2 and Michael 2, and will probably work on Posette, Dork and the Millenium 3 figures). It also won't work on non-English versions of Poser.

I've rewritten the script to swap all figures, independent of Poser language and body part names. See attached file. Save as SwapFigure.py.

The pen is mightier than the sword. But if you literally want to have some impact, use a typewriter

My gallery   My freestuff


dennisharoldsen ( ) posted Tue, 15 May 2007 at 4:43 PM

PhilC

thank you.

i have done lots of research to understand poserpython.
you are one of the few who does.
Rotoscoper  sounds very capable and i going to check it out.
i am looking at learning more about poserpython.
it is dramatically under-doucumented.
is the python code in Rotoscoper visible?
maybe we can talk.


dennisharoldsen ( ) posted Tue, 15 May 2007 at 4:50 PM

file_377669.jpg

svdl

thank you.

your code is quicker and more reliable.
however, the result is still varied.
i am sending my test results as a jpg.
it shows an initial pose that is changed and changed again.
i am trying to understand poserpython but it is a challenge.
you know that better than i do.

 


jonnybode ( ) posted Fri, 18 May 2007 at 12:51 PM

Hi Dennis!

Excuse me if this is a silly question, when I swap a pose i go to "Figure/Symmetry/Swap right and left", I guess you are after something more?

Im just curoius what the result of your script shall be?

Regards / Jonny



jonnybode ( ) posted Sat, 30 June 2007 at 3:48 AM

.



Privacy Notice

This site uses cookies to deliver the best experience. Our own cookies make user accounts and other features possible. Third-party cookies are used to display relevant ads and to analyze how Renderosity is used. By using our site, you acknowledge that you have read and understood our Terms of Service, including our Cookie Policy and our Privacy Policy.