Thu, Jan 9, 6:02 AM 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 Dec 02 3:16 pm)

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: How do I change 'CurrentFigure'?


timarender ( ) posted Sat, 20 April 2013 at 10:01 AM · edited Tue, 26 November 2024 at 7:58 AM

I have some Figures in a scene. I want to create Pose files (pz2) for each Figure, based on their pose at Frame 10. Then I want to load that figure's Pose file into Frame 2.

But. 'SaveLibraryPose' and 'LoadLibraryPose' only operate on the 'CurrentFigure'. Although I can itinerate through the Figures, I cannot find a way to change the 'CurrentFigure'.

I hope I am missing something obvious.  I have commented out (#) some lines which I though might be related. Here is the basic code:

for actors in scene.Figures():
    #a= actors.Name()
    #actor = scene.CurrentFigure()
    scene.SetFrame(10)
    scene.SaveLibraryPose(pose1)
    scene.SetFrame(2)    
    scene.LoadLibraryPose(pose1)


markschum ( ) posted Tue, 23 April 2013 at 1:17 PM

current figure is the current selected figure in Poser.

 

you want scene.SelectFigure(scene.Figure("Victoria4")) or some variation.

You can iterate through scene.Figures() if you want.


markschum ( ) posted Tue, 23 April 2013 at 1:28 PM · edited Tue, 23 April 2013 at 1:29 PM

something like this will work

 

import poser

scn = poser.Scene()

figs = scn.Figures()

for fig in figs()

    nam = fig.Name()

    scn.SelectFigure(fig)

    scn.SetFrame(10)

    etc.

 

Not: you can just cut and paste in the keyframe editor. select all frame 10 and copy it and paste to frame 2. No need to save and load pose files.


timarender ( ) posted Tue, 23 April 2013 at 1:49 PM

Ah! Many thanks. I had not discovered "SelectFigure" before. That is perfect. Thank you again!

I appreciate it is generally easier to use the Keyframe editor; however my Scene has over 50 Figures and I want to try various combinations and permutations; so need to repeat the process many times. In addition, with so many Figures, Poser tend to slow down and the Keyframe Editor window can sometimes feel a little unresponsive.


markschum ( ) posted Tue, 23 April 2013 at 5:08 PM

I assume you have found the Python methods manual pdf file.  It should be on the poser help menu and it is in the Poser program folder.


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.