Sat, Jun 15, 8:47 PM CDT

Renderosity Forums / Poser Python Scripting



Welcome to the Poser Python Scripting Forum

Forum Moderators: Staff

Poser Python Scripting F.A.Q (Last Updated: 2024 Apr 26 1:10 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: Zero rotation method


Allstereo ( ) posted Sun, 10 November 2013 at 8:44 AM · edited Fri, 31 May 2024 at 12:47 PM

Hello all,

After checking in the Poser Python manual and the Renderosity forums, I didn't see a method to put all rotations to zero as this can be done in the Joint Editor. Perharps there is another way to do that. 

Any comment on this matter are welcome

Allstereo


EnglishBob ( ) posted Sun, 10 November 2013 at 10:35 AM

You mean a single method to zero the entire figure in one fell swoop?

I've done it by looping around all actors and zeroing each one, but that's all I can offer. It gives equivalent results to the joint editor button, as far as I can tell.


structure ( ) posted Tue, 12 November 2013 at 10:38 PM
Forum Coordinator

same as bob - i use the following

 

import poser

scene = poser.Scene()
fig = scene.CurrentFigure()
parts = fig.Actors()

Zero Rot and Trans

for part in parts:
    if part.IsBodyPart():
        for Parm in part.Parameters():
            if Parm.InternalName() == part.ParameterByCode(poser.kParmCodeXROT).InternalName():
                Parm.SetValue(0.0)
            if Parm.InternalName() == part.ParameterByCode(poser.kParmCodeYROT).InternalName():
                Parm.SetValue(0.0)
            if Parm.InternalName() == part.ParameterByCode(poser.kParmCodeZROT).InternalName():
                Parm.SetValue(0.0)
            if Parm.InternalName() == part.ParameterByCode(poser.kParmCodeXTRAN).InternalName():
                Parm.SetValue(0.0)
            if Parm.InternalName() == part.ParameterByCode(poser.kParmCodeYTRAN).InternalName():
                Parm.SetValue(0.0)
            if Parm.InternalName() == part.ParameterByCode(poser.kParmCodeZTRAN).InternalName():
                Parm.SetValue(0.0)
scene.DrawAll()

Locked Out


Allstereo ( ) posted Thu, 14 November 2013 at 7:18 AM · edited Thu, 14 November 2013 at 7:27 AM

Hello EnglishBob and Structure,

Thank you for your feedback. Just to put you in context, I need the "zero rotation  method" to implant a way for finding the global scaling of actors (Smooth as welll as propagating) using the World Matrix method. I will release soon tutorials and related Python scripts about Poser Matrix methods. Now, I am waiting Smith Micro response about an issue with the WorldMatrix method. If no response, I will upload the tutorials and script in the next week with a note about the issue.

Structure: Can I have your permission to insert the code in a script testing the global scaling of actor with the World Matrix method?  I will give full credit to your work. The script will be included with the other scripts related to Matrixmethod.

Allstereo


structure ( ) posted Thu, 14 November 2013 at 11:13 AM · edited Thu, 14 November 2013 at 11:15 AM
Forum Coordinator

Allstereo hi, the code was something I found on the internet sometime ago, it may have even be posted here when I was learning basic poser python as the answer to a question I had, I cannot take credit for it, but I am sure since it was posted publicly that whoever authoured it ( I do apologise that I cannot remember, there is a good reason for that ) will not mind it being used.

Locked Out


Allstereo ( ) posted Fri, 22 November 2013 at 11:43 PM

Hello all,

I have released my tutorial of PoserMatrix method. I have not included a script to remove the rotations at this time. I will probably write a script that we manage all the scaling effect of Poser using both the WorldMatrix and the ScaleMatrix method.

Allstereo


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.