Forum Coordinators: RedPhantom
Poser - OFFICIAL F.A.Q (Last Updated: 2025 Jan 09 3:46 am)
I think you need to use a different parameter code.
kParmCodeXROT
kParmCodeYROT
kParmCodeZROT
===========================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.
No dice, at least not yet. Altered the code to:
import poser
import random
scene=poser.Scene()
scene.SetFrame(23)
scene.SelectFigure(scene.Figure('Terri'))
actor = scene.Actor('Left Shin')
parm = actor.ParameterByCode(poser.kParmCodeBEND)
parm.SetValue(88)
but got the error -
in
parm = actor.ParameterByCode(poser.kParmCodeBEND)
AttributeError: 'module' object has no attribute 'kParmCodeBEND'
Aren't there some simple examples online? I've found a few sites claiming to be intros to Poser Python, but they are "Hello World" programs. I want to manipulate Poser, not figure out how to say "Hello World" ;)
My fault. Bend is not a valid code. YTRAN, ZTRAN and XTRAN are what I need to use. So the following code works -
import poser
import random
scene=poser.Scene()
scene.SetFrame(23)
MyFig = scene.Figure('Terri')
ChangeParm = MyFig.Actor("Left Shin").ParameterByCode(poser.kParmCodeYTRAN)
ChangeParm.SetValue(5)
I'm used to working with Bend values, so I just have to figure out appropriate YTRAN values instead. The next step is to add some randomness to the parameter changes to make movements look more natural.
In the folder where you poser.exe is installed, there should be a PoserPython Methods Manual.pdf, which lists all of the parameter codes near the top. Each listing has a short explanation of what function the code invokes. The list isn't necessarily the easiest to scan quickly, but it can be very helpful. After a bit of trial and error, it's fairly easy to pick up the process, and you're doing well so far. :thumbupboth:
===========================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.
Hello,
Here is the code that I used to get the value and set the value of a parameter
#Define the actor
actor = scene.Actor("External name")
#Read value of actor
actor.ParameterByCode(poser.kParmCodeYROT).Value()
#Set value of actor to 80
actor.ParameterByCode(poser.kParmCodeYROT).SetValue(80)
Allstereo
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'm new to Poser Python. I am trying to perform a simple task - put a value into a figure's parameter (for example, bend the shin to a certain angle). But I keep getting an error message when I run my script. Can someone take a quick look and see if my syntax is incorrect?
My example:
import poser
import random
scene=poser.Scene()
scene.SetFrame(23)
scene.SelectFigure(scene.Figure('Roxie'))
actor = scene.Actor('Left Shin')
parm = actor.ParameterByCode(poser.ParmCodeBEND)
parm.SetValue(88)
When I run the above script, I get the following error:
Traceback (most recent call last):
* File "C:UsersPublicDocumentsPoser Pro 2014 ContentMy Pythonkicking1.py", line 7, in *
* parm = actor.ParameterByCode(poser.ParmCodeBEND)*
AttributeError: 'module' object has no attribute 'ParmCodeBEND'