Wed, Dec 25, 12:50 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: Camera woes


Josiah ( ) posted Thu, 14 November 2002 at 7:43 AM · edited Sat, 23 November 2024 at 1:38 AM

I include this;

scene.SetCurrentCamera(scene.Actor("Main Camera"))

at the top of my script after "scene = poser.Scene()"
in an attempt to have my script change cameras, but for some reason, it dosent work...

Also, does anyone know how I can get the parameter value
of a dial? for instance "DollyY"'s current value?

I have tried to increment the cameras position like this;

actor = scene.Actor("Dolly Camera")
v = actor.Parameter("DollyY")
w = actor.ParameterByCode(poser.kParmCodeYTRAN)
d = w + 0.01
v.SetValue(d)

but this method dosent return the var "w" with the right
type!
Is there a nother method to do this I am missing?

Thanks for any help or ideas!
josiah


ockham ( ) posted Thu, 14 November 2002 at 11:13 AM

actor = scene.Actor("Dolly Camera") v = actor.Parameter("DollyY") w = actor.ParameterByCode(poser.kParmCodeYTRAN) d = w + 0.01 v.SetValue(d) On this one, I can see what's wrong. In lines 2 and 3 you're getting two different ParmType variables, but you're not really getting a Value. You then modify the second ParmType and put the incremented value back in the first one. Here's how it should work. I use the method below for altering paramters constantly, though I haven't tried it with cameras. Note that the addition has to be done on the -value- of the parameter, not with the variable p that represents the parameter dial itself. actor = scene.Actor("Dolly Camera") p = actor.Parameter("DollyY") p.SetValue(p.Value() + 0.01)

My python page
My ShareCG freebies


ockham ( ) posted Thu, 14 November 2002 at 11:18 AM

On the first question, import poser scene = poser.Scene() scene.SetCurrentCamera(scene.Actor("Main Camera")) I just tried this (copied your line directly with Ctrl-C) and it works for me. The variables seem to be right, and the camera switches nicely. Not sure what's wrong in your version.....

My python page
My ShareCG freebies


Josiah ( ) posted Thu, 14 November 2002 at 3:13 PM

Thanks Ockham! Your help is invaluable! I found that I needed "scene.DrawAll()" to "update" the view. The camera was switching, I just didn't know it. The parameter change code you provided is exactly what I needed! Works fantastic! Thanks again for your time and help! josiah


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.