Sat, Feb 1, 5:04 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 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: Requesting method for zeroing deformerPropChan Parameters


an0malaus ( ) posted Thu, 13 January 2005 at 12:26 AM ยท edited Sun, 03 November 2024 at 1:15 AM

I'm trying to find a way to reset the morphs, value parameters and deformer channel parameters in a figure's body parts before I choose which deformers I will create a morph from. I'm running P5 on a Mac, btw. I have looked at Ockham's zeroMorphs.py script (and added non-Tkinter except clauses with the appropriate nested actor and parameter for loops), but it completely ignores all the deformerPropChan parameters. There doesn't seem to be an equivalent for the deformer channels to the actor methods IsMorphTarget() and IsValueParameter(). I've looked at the InternalName() of these parameters and the only thing that springs to mind to distinguish them from the Transform parameters, which I don't want to touch, is that they all have either a colon (magnet parented to another figure) or the word "Mag" in them. Anyone have any suggestions before I kludge this?



My ShareCG Stuff

Verbosity: Profusely promulgating Graham's number epics of complete and utter verbiage by the metric monkey barrel.


an0malaus ( ) posted Thu, 13 January 2005 at 12:43 AM

Ha, I think I've just answered my own question :-) There is a parameter method TypeCode() which seems to consistently return a value of 49 for deformerPropChan Parameters. This value appears uniquely different from any of the typecodes returned for the standard Transform parameters (scale, xROT, yTRAN, etc). There's no obvious kParmCode for this and I haven't seen any way to do a reverse lookup starting with the value, so I'll just plug the number in. This might be a useful augmentation of Ockham's original zeroMorphs.py script.



My ShareCG Stuff

Verbosity: Profusely promulgating Graham's number epics of complete and utter verbiage by the metric monkey barrel.


ockham ( ) posted Thu, 13 January 2005 at 12:40 PM

Interesting find. For distinguishing mag and wave parms, I'd used string.count to locate the 'Mag' or 'Base', which was definitely clumsy. Wonder if TypeCode holds any more goodies?

My python page
My ShareCG freebies


an0malaus ( ) posted Thu, 13 January 2005 at 10:12 PM

From memory, the standard Transform TypeCodes seemed to go up to about 36 or so. It seemed a good indication to me that a consistent 49 on all the deformerPropChan parameters was not just - Unknown or Unassigned. I also noted that the x,y,z values of parameters that comprise a tuple all returned the same code. I once trawled through the resource fork of Poser 4 when I was running Mac OS 9 looking for strings to flesh out my knowledge of the CR2, etc. file formats. I found some interesting things like deltaMulDelta and deltaDivDelta in addition to the standard deltaAddDelta used in JCM/ERC. It might be worth having a look for other kParmCode strings.



My ShareCG Stuff

Verbosity: Profusely promulgating Graham's number epics of complete and utter verbiage by the metric monkey barrel.


an0malaus ( ) posted Thu, 13 January 2005 at 10:43 PM

Here is the list I've extracted from the P5 Mac OS X binary. kParmCodeXROT kParmCodeYROT kParmCodeZROT kParmCodeXTRAN kParmCodeYTRAN kParmCodeZTRAN kParmCodeXSCALE kParmCodeYSCALE kParmCodeZSCALE kParmCodeASCALE kParmCodeFOCAL kParmCodeHITHER kParmCodeYON kParmCodeTAPERX kParmCodeTAPERY kParmCodeTAPERZ kParmCodeKDRED kParmCodeKDGREEN kParmCodeKDBLUE kParmCodeKDINTENSITY kParmCodeDEPTHMAPSIZE kParmCodeDEPTHMAPSTRENGTH kParmCodeTARGET kParmCodeGEOMCHAN kParmCodeCENTER kParmCodeCURVE kParmCodeGRASP kParmCodeTGRASP kParmCodeSPREAD kParmCodeWAVEAMPLITUDE kParmCodeWAVEFREQUENCY kParmCodeWAVELENGTH kParmCodeWAVESTRETCH kParmCodeWAVESINUSOIDAL kParmCodeWAVESQUARE kParmCodeWAVETRIANGULAR kParmCodeWAVETURBULENCE kParmCodeLITEFALLOFFSTART kParmCodeLITEFALLOFFEND kParmCodeLITEATTENSTART kParmCodeWAVEPHASE kParmCodeWAVEAMPLITUDENOISE kParmCodeWAVEOFFSET kParmCodeVALUE kParmCodePOINTAT kParmCodeLITEATTENEND kParmCodeHAIRDYNAMICS kParmCodeDYNAMICPARENT kParmCodeCLOTHDYNAMICS I'm just coding a script to see if I can verify whether there are any allocation holes in the list or whether this is the full enumerated type.



My ShareCG Stuff

Verbosity: Profusely promulgating Graham's number epics of complete and utter verbiage by the metric monkey barrel.


ockham ( ) posted Thu, 13 January 2005 at 11:27 PM

file_169347.jpg

Here's a list taken the other way around, by reading TypeCode of all the lights, cameras and figure parts I could think of. I couldn't get any action from the seemingly missing numbers like 16 and 58.

My python page
My ShareCG freebies


an0malaus ( ) posted Fri, 14 January 2005 at 12:05 AM

That's great Ockham, P5's decided to play silly buggers again on me, but I think the additional info from the strings extracted from the binary implies that: kParmCodeGEOMCHAN = 43 kParmCodeCENTER = 44 kParmCodeCURVE =45 kParmCodeHAIRDYNAMICS = 68 kParmCodeDYNAMICPARENT = 69 kParmCodeCLOTHDYNAMICS = 70 I thought it should be possible to just print these constants if the poser library has been imported. Unfortunately not. It may be that the string is used as a dictionary lookup for a method, but without access to the python interface declarations, it's impossible to tell. It's also possible that the last three fill the missing gap at 37, 38, 39.



My ShareCG Stuff

Verbosity: Profusely promulgating Graham's number epics of complete and utter verbiage by the metric monkey barrel.


ockham ( ) posted Fri, 14 January 2005 at 12:22 PM

I see what you mean. The same print statement that works fine for the "older" codes gives a not-defined error for these. So these probably couldn't be used in a real program either.

My python page
My ShareCG freebies


an0malaus ( ) posted Wed, 19 January 2005 at 8:22 PM

Ockham, I just stumbled on what I had been doing wrong in trying to print the kParmCode constants. I needed to prefix them with "poser." as in: import poser print "kParmCodeGEOMCHAN = ", str(poser.kParmCodeGEOMCHAN) the output listed above should read (as printed by Python): kParmCodeGEOMCHAN = 43 kParmCodeCENTER = 44 kParmCodeCURVE = 45 kParmCodeHAIRDYNAMICS = 90 kParmCodeDYNAMICPARENT = 92 kParmCodeCLOTHDYNAMICS = 91 Cheers!



My ShareCG Stuff

Verbosity: Profusely promulgating Graham's number epics of complete and utter verbiage by the metric monkey barrel.


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.