Forum Moderators: Lobo3433, Staff Forum Coordinators: Anim8dtoon
Poser Python Scripting F.A.Q (Last Updated: 2026 Apr 22 10:09 am)
I've noticed that the Poser 11 sample callback "randomHeadVerts.py" (under C:\Program Files\Poser Software\Poser 11\Runtime\Python\poserScripts\SampleCallbacks) creates its own list of 1000 random numbers first because it says random.random() seems slow, but that wouldn't have anything to do with the parser error I'm seeing, would it ?
I also noticed that I'm setting the callback on xTran and explicitly changing xTran in the callback before returning the original value of xTran, which doesn't make a lot of sense - but again, that wouldn't be causing the parser error problem I see.
I've tried setting the callback on a different parameter, and using an explicit floating point value instead of random(), but the problem's the same.
The 3Dcheapskate (also available in DAZ and HiveWire3D flavours) occasionally posts sensible stuff. Usually by accident.
And it usually uses Poser 11, with units set to inches. Except when it's using Poser 6 or PP2014, or when its units are set to PNU.
You return "parm" as a result of the function. But "parm" is not a floating point value. "parm" is the parameter object that has generated the event. "value" is the floating point value you may manipulate and return as new value to display.
The wired error message is a result of the code that called your function. Probably that is a Python function by itself.

I think my brain is trying to tell me that it's no longer going to cooperate with me, and will do everything in its power to make me look foolish ! :)
(and I'd forgotten that when the computer tells me what the problem is, that's often designed specifically to mislead me :)
The 3Dcheapskate (also available in DAZ and HiveWire3D flavours) occasionally posts sensible stuff. Usually by accident.
And it usually uses Poser 11, with units set to inches. Except when it's using Poser 6 or PP2014, or when its units are set to PNU.
I think my brain is trying to tell me that it's no longer going to cooperate with me, and will do everything in its power to make me look foolish ! :)
:) :) :)
Okay, I've tried again.
Am I missing something obvious here ?
The following script should, I believe, cause myUpdateCallback() to be called any time that the xTran dial on the BODY is changed, which will in turn cause the yRotate dial on the BODY parameter to be incremented.
However, if I change the xTran dial the yRotate value actually increases by between 3 and 5, which indicates to me that the callback is called that many times.
In addition, the same thing happens if I change yTran, zTran, xRotate, zRotate, Scale, etc. This script works on just about any figure - I tested it with La Femme.

The same code as inline text:
def myUpdateCallback(parm,value):
ac = poser.Scene().ActorByInternalName("BODY")
yrotval=ac.Parameter("yRotate").Value()
ac.SetParameter("yRotate",yrotval+1)
return value
#
def setup():
print "setup()..."
ac = poser.Scene().ActorByInternalName("BODY")
parm = ac.Parameter("xTran")
parm.SetUpdateCallback(myUpdateCallback)
print "...done."
setup()
The 3Dcheapskate (also available in DAZ and HiveWire3D flavours) occasionally posts sensible stuff. Usually by accident.
And it usually uses Poser 11, with units set to inches. Except when it's using Poser 6 or PP2014, or when its units are set to PNU.
New thread created for that last post...
The 3Dcheapskate (also available in DAZ and HiveWire3D flavours) occasionally posts sensible stuff. Usually by accident.
And it usually uses Poser 11, with units set to inches. Except when it's using Poser 6 or PP2014, or when its units are set to PNU.
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.
(Note: This is a follow-on from my adp001's suggestion to use Python in my "Creating a new master parameter that works modulo 360 - can it be done ?" thread and my subsequent "kValueOpTypeCodePYTHONCALLBACK doesn't seem to work" thread)
I realized that if I can't do the modulo 360 bit using valueOps, and have to resort to Python, then why not forget about doing the other maths using valueOps and do everything in Python ?
As a test I just tried to set a random x translation in a callback, but although the three lines work okay in the non-callback part of the script they cause a parser error in the callback.
(also, when I added the "import random" I realized that this script worked without the "import poser" which I understood was wessential for using any of the PoserPython calls)
The 3Dcheapskate (also available in DAZ and HiveWire3D flavours) occasionally posts sensible stuff. Usually by accident.
And it usually uses Poser 11, with units set to inches. Except when it's using Poser 6 or PP2014, or when its units are set to PNU.