Tue, Nov 26, 6:18 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: need info on how to change ytran of a figure in python having strange probs hel


nightfir ( ) posted Thu, 27 July 2006 at 6:15 PM · edited Sat, 23 November 2024 at 3:25 AM

I'm trying to change the ytran parameter of a figure  and it's not working quite right. Here is a sample script.

Scene = poser.Scene()

Fig = scene.Figure(“tshirt2”)

Act = fig.actor(“Body”)

Act.SetParameter ("yTran",10.0)

Now however instead of yTran getting set to 10.0 it gets set to 2060 or something to that effect. If I change yTran to xTran or zTran,  the same thing happens. If I change yTran to xRotate, yRotate, or zRotate, it's works fine. I just installed Poser SR3. So I don't know what I'm doing wrong.                                     

 

 


nruddock ( ) posted Thu, 27 July 2006 at 6:37 PM

The value you see on the dial is in the units you are using (centimeters ?), if you want them to show the values you are using in the script, you'll need to set "Poser Native Units" as the units.
The values in used in scripts for distances are always PNUs, for scales the range 0.0 to 1.0 is shown as 0% to 100%, morph dials show the value as set (no unit conversion).


nightfir ( ) posted Fri, 28 July 2006 at 9:33 AM · edited Fri, 28 July 2006 at 9:36 AM

Nruddock :

Hmmm that's weird. Everything else except for x, y, and z tran the values come out ok.  I am using inches as working units inside Poser instead of native Poser Units. I was just about to post a new topic about a possible bug in Poser SR3 and a fix. Here is the post:

Hi:

I think I found a possible bug in Poser 6 SR3. It involves using python to set yTran of a figure, etc. In a previous post I asked how you would go about writing a python script that would allow one to change the value of yTran for a figure as I was getting strange values in yTran, plus xTran, and zTran. No probs with xRotate, yRotate, zRotate. This is the script from the previous post in the python scripting forum:

 

scene = poser.Scene()

fig = scene.Figure("tshirt2")

act = fig.Actor("Body")

act.SetParameter("yTran",10.0)

 

Well I was not getting yTran set to 10. I was getting the value 1032.000003. I found out after a bit of work that Poser was taking the value 10.0 and dividing it by .00968992244452 which of course equals 1032.000003. Say what!!!!!!! Anyways I came up with a new script to fix the problem. It's as follows:

 

scene = poser.Scene()

fig = scene.Figure("tshirt2")

act = fig.Actor("Body")

adjust  = .00968992244452

a = 10.0

b = adjust * a

act.SetParameterByCode(poser.kParmCodeYTRAN).SetValue(b)

 

Now could someone test both scripts with their own figure, and of course changing "tshirt2" to the name of that figure, with the versions of Poser they have. Like 4, 5, 6 with whatever service release they may have. Then get back to me, and the rest of us via this post with the results.  I have no idea if it's Poser SR3, my machine, or what.

 

I have not yet removed Poser 6 SR3 and reinstalled Poser 6 SR2. I have to dig up my original Poser 6 cd, and then find what disk I put the Poser 6 SR2 update on. Which I'm not doing except as a last resort. I have no idea where the needed disks are. It's what I get for being disorganized. Me and my other half remodeled my computer room, and while moving stuff out,  tossed stuff into boxes, etc and then just put stuff back any old place after we were done. LOL.  It's what I get for being lazy.

.

.

I'll switch over to Poser units and try running the original script again and see what happens.

 

 

 


nruddock ( ) posted Fri, 28 July 2006 at 1:56 PM · edited Fri, 28 July 2006 at 1:58 PM

The number your getting is consistant with the conversion factor between inches and PNU (in Poser 6).

1 PNU = 103.2 inches

Ignore the dials, print the value of the parameter and you'll see that it's exactly the value you set it to.

Only the Trans dials are affected by unit conversion for display purposes, everything works on PNU internally.


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.