Mon, Nov 25, 4:02 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: Poser Python Public Service Announcement: A Warning


Cage ( ) posted Sat, 22 March 2014 at 10:12 AM · edited Mon, 25 November 2024 at 3:59 PM

I have a warning for my fellow Python scripters.  Be careful, when zipping through an actor's parameter dials and setting them.  If you have a script, for instance, to zero all rotations, translations, morphs, etc, and you just treat the default case as setting to zero... you can run into trouble.

Poser allows us to set certain internal dials that aren't supposed to be set.  These dials have no listed parameter codes, in the manual, but we can set them, intentionally or accidentally.

[quote]

    fig.Memorize()
    scales = [poser.kParmCodeXSCALE ... poser.kParmCodeASCALE]
    never_ever_set_these_internal_dials = [17,18,19,20,21,22,31,32,33,34,35,36] #Offset,TranB,_joint,_twist,_smoo parameters should not be set!
    for figact in fig.Actors():
        if not figact.IsBodyPart():
            continue        
        for parm in figact.Parameters():
            if parm.TypeCode() in never_ever_set_these_internal_dials:
                continue #Setting these can screw up your figure if the script crashes.
            if parm.IsMorphTarget() or parm.IsValueParameter():
                continue
            if parm.TypeCode() in scales:
                parm.SetValue(1.0)
            else:
                parm.SetValue(0.0)

.....

fig.Reset()

[/quote]

I had a script crash during testing, and I was unable to recover the figure settings after the crash.  The script had set the Offset, TranB, _joint, _twist, and _smoo internal cr2 dials to zero.  These dials had not been memorized by the script call to Memorize(), and could not be reset.  The figure went kablooie.

So be careful about how you set the paramter dials, is all.  These dials don't have TypeCode listings, but they will reveal their TypeCode values, so they can be screened when running any parameter-setting script.  The codes are:

never_ever_set_these_internal_dials = [17,18,19,20,21,22,31,32,33,34,35,36]

Because, you know.  The figure can go kablooie.  :scared:

===========================sigline======================================================

Cage can be an opinionated jerk who posts without thinking.  He apologizes for this.  He's honestly not trying to be a turkeyhead.

Cage had some freebies, compatible with Poser 11 and below.  His Python scripts were saved at archive.org, along with the rest of the Morphography site, where they were hosted.


structure ( ) posted Sat, 22 March 2014 at 10:19 AM
Forum Coordinator

appreciate the warning - thanks

Locked Out


gishzida ( ) posted Sat, 22 March 2014 at 9:17 PM

Cage...

the links in your tag line point to a "default" apache / centos web server with no content or web pages... Not sure if Phandom3d has dumped the page by accident or there is something else wrong...

regards!

joel

a.k.a. gishzida


Cage ( ) posted Sat, 22 March 2014 at 10:07 PM

file_503016.txt

Yeah, thanks, gishzida.  :laugh:  My site went down months ago, and I have been in mourning over the community's loss of Phantom3D, so I haven't set up a new site anywhere.

Well, that's partially true.  Actually, I haven't gotten around to it.  I have an offer to host my site, but I and the new host haven't gotten together yet to set the thing up.  One of these days, hopefully.

Last time I tried to edit my sigline, Rosity got mad at me.  :lol:  I think it was during the long period when they were modifying the site, and my difficulties may have related to that.  :unsure:

===========================sigline======================================================

Cage can be an opinionated jerk who posts without thinking.  He apologizes for this.  He's honestly not trying to be a turkeyhead.

Cage had some freebies, compatible with Poser 11 and below.  His Python scripts were saved at archive.org, along with the rest of the Morphography site, where they were hosted.


3dcheapskate ( ) posted Wed, 02 April 2014 at 8:10 AM

I think you must have missed the relevant page in the PoserPython manual (page 13½ for Poser 6)...

kParmCodeKABAM
kParmCodeKABLOOIE
kParmCodeKABOOM
kParmCodeKERPLUNK
kParmCodeKERPLONK
kParmCodeKERSPLAT
...etc...

:blink:


The 3Dcheapskate* occasionally posts sensible stuff. Usually by accident.
And it usually uses Poser 11, with units set to inches. Except when it's using Poser 6 or PP2014, or when its units are set to PNU.

*also available in ShareCG, DAZ, and HiveWire3D flavours (the DeviantArt and CGBytes flavour have been discontinued).



Cage ( ) posted Wed, 02 April 2014 at 2:28 PM

Quote - I think you must have missed the relevant page in the PoserPython manual (page 13½ for Poser 6)...

kParmCodeKABAM
kParmCodeKABLOOIE
kParmCodeKABOOM
kParmCodeKERPLUNK
kParmCodeKERPLONK
kParmCodeKERSPLAT
...etc...

:blink:

 

Ah, you see.  There's the problem.  I never had Poser 6, which was released during a period when I couldn't afford to upgrade.  I've had all the other versions since Poser 4, but I've never seen that relevant section in the Poser Python docs.  The Poser Python docs tend to be... hmm.  Not quite thorough and up-to-date, most of the time.  Full of holes, like my old canvas Converse sneakers.  :lol: 

===========================sigline======================================================

Cage can be an opinionated jerk who posts without thinking.  He apologizes for this.  He's honestly not trying to be a turkeyhead.

Cage had some freebies, compatible with Poser 11 and below.  His Python scripts were saved at archive.org, along with the rest of the Morphography site, where they were hosted.


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.