Forum Moderators: Staff
Poser Python Scripting F.A.Q (Last Updated: 2024 Dec 02 3:16 pm)
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
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
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.
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