Tue, Oct 22, 3:40 AM CDT

Renderosity Forums / Poser - OFFICIAL



Welcome to the Poser - OFFICIAL Forum

Forum Coordinators: RedPhantom

Poser - OFFICIAL F.A.Q (Last Updated: 2024 Oct 22 3:39 am)



Subject: Please convert this Python script to work in Poser 8


R_Hatch ( ) posted Mon, 21 September 2009 at 5:17 AM · edited Tue, 22 October 2024 at 3:38 AM

Content Advisory! This message contains profanity

file_439779.txt

This is the type of thing that reminds me of why, despite the fact that I can write code when necessary, I really hate having to do so. I just don't have the patience to re-memorize every damn thing because the code/parameters have changed names with a new version of software/language. I don't think like a coder, I brute-force the code I need by looking it up. This is also why I hate using Python to code in, as it's a very strict language, and once again, I'm not a damn programmer.

Anyway, this script was my best friend in Poser 6, but Poser 8 has a totally asinine new way of naming every damn thing, so it no longer works. I would very much appreciate it if someone would convert it to Poser 8 Python. For reference, it's supposed to work like so:

Only for the current figure
Only for all body parts and props (magnets are not affected)
set all translations, rotations, morphs, and master parameters to zero
set all scales to 100%

(I don't actually care about it working for props)


PhilC ( ) posted Mon, 21 September 2009 at 7:15 AM

A large number of my scripts include tools to zero the figure or various aspects of it. One such is Wardrobe Wizard which is now included in Poser 8.

In Poser 8 open the Python script window.
Click the "Wardrobe Wizard" button.
Click the "Zero Figure" button.

OBJ2CR2 and Shoe Converter have more options including one to exclude magnets.

Rather than use the Name() method to define the parameter it may be better to use the poser.kParmCode because this takes language versions out of the equation.

Your script is set up to bypass any dial that is hidden. A number of figures, particularly V4 and M4 have a very large number of their dials hidden, presumably to prevent users from hurting themselves. Had you realized this?


ockham ( ) posted Mon, 21 September 2009 at 7:30 AM · edited Mon, 21 September 2009 at 7:31 AM

Given your specs, this should do.
Tested in P8, and it does work.

==================

import poser

scene = poser.Scene()
for actor in scene.CurrentFigure().Actors():
    if actor.IsProp() or actor.IsBodyPart():
        for param in actor.Parameters():
            if not param.Hidden():
                param.SetValue(0.0)
        actor.ParameterByCode(poser.kParmCodeASCALE).SetValue(1.0)
        actor.ParameterByCode(poser.kParmCodeXSCALE).SetValue(1.0)
        actor.ParameterByCode(poser.kParmCodeYSCALE).SetValue(1.0)
        actor.ParameterByCode(poser.kParmCodeZSCALE).SetValue(1.0)
scene.DrawAll()

My python page
My ShareCG freebies


Penguinisto ( ) posted Mon, 21 September 2009 at 8:33 AM

Heh - D|S has that option baked-in for any figure in a scene. :)

(BTW - language advisory? If it was in .NET maybe, but python is actually a good language...)


markschum ( ) posted Mon, 21 September 2009 at 10:40 AM

er, whats wrong with 'window>joint editor>zero figure'  ?


PhilC ( ) posted Mon, 21 September 2009 at 10:49 AM

It doesn't zero the translations or the morphs, plus IK's need to be turned off for it to work correctly.


MikeJ ( ) posted Mon, 21 September 2009 at 8:43 PM

Quote -

(BTW - language advisory? If it was in .NET maybe, but python is actually a good language...)

That's got to be about the funniest thing I've read all day. :laugh:



R_Hatch ( ) posted Tue, 22 September 2009 at 12:05 AM

Thanks Ockham and PhilC :) And thanks everyone else for the fun replies, too :D
Could you tell I was a bit frustrated? And btw, at least if it was .NET I probably
could have fixed it myself ;P


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.