3dcheapskate opened this issue on Sep 25, 2021 ยท 16 posts
3dcheapskate posted Sat, 25 September 2021 at 10:36 PM
(This is a rewording of this post, but as a separate, appropriately titled thread)
I've created a very simple script which should, I believe, cause myUpdateCallback() to be called whenever the xTran dial on the BODY is changed - myUpdateCallback() simply increments the yRotate dial on the BODY. So as long as I've selected a figure which has an xTran parameter on its BODY, e.g. La Femme or just about anything, when I run the script (and the same figure is selected when I change the dial) then its yRotate should increase by 1 any time I change its xTran, either by manually setting the value of the dial or clicking the left/right arrow to the side of the dial, any of which should do a single update.
However, after running the script, when I change the xTran dial as stated the yRotate value actually increases by between 3 and 5, which indicates to me that the callback is called that many times.
In addition, and just as puzzling , the yRotate value also increases by between 3 and 5 if I change any of the other parameters, e.g. yTran, zTran, xRotate, zRotate, Scale, etc.
Here's the script (between the two horizontal lines below). It appears that the post editor ignores tabs so I've copied from Notepad++ after using Edit > Blank Operations > Tab To Space. So if you cut and paste it you'll have to do the reverse, Edit > Blank Operations > Space to Tab (Leading) for it to work as Python.
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()
And here's a screenshot of that same script just in case:
The (Poser 11) PoserPython manual says this...
...which I (mis?)understand to mean that a callback that's set using this method (remember it's a parameter method) is only called when that particular parameter is updated.
So my questions are:
1) Is my statement of what I expect to happen after I run this script correct ?
2) If it is, then why doesn't it work like that ?
The 3Dcheapskate* 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.
*also available in ShareCG, DAZ, and HiveWire3D flavours (the DeviantArt and CGBytes flavour have been discontinued).