Forum: Poser Python Scripting


Subject: Callback created using parm.SetUpdateCallback() not behaving as expected

3dcheapskate opened this issue on Sep 25, 2021 ยท 16 posts


3dcheapskate posted Thu, 30 September 2021 at 12:21 PM

(I've also asked over there on the Hivewire Poser Scripting forum), where I've also uploaded the latest version of this script if anybody wants to download and confirm that I'm not talking rubbish.

I've now detailed the problem in the comments of the script itself, which I've cut-and-pasted below from Notepad++ for good measure (the double line spacing must be the CR/LF)...



# This script sets up a simple update callback on the yRotate dial of the currently selected actor


# My understanding of what SHOULD happen: 

# - 1) This callback should be called ONLY if the natural* (lower) value of the yRotate dial on the currently selected actor is changed.

# - 2) Each time this callback runs it should increment the keyed* (upper) value of the yRotate dial.

#

# *using the terminology under the heading "Dependant Parameter Dials" on page 222 of the Poser 11 Reference Manual


# What ACTUALLY happens:

# - 1) The callback seems to be called if ANY dial is changed. Or if a different body part is selected, or if you change rooms, etc...

# - 2) The callback seems to be called multiple times, usually between 1 and 5, when any of these things happen


def cheapskatesYRotateCallback(parm,value):

    global cheapskatescount

    cheapskatescount=cheapskatescount+1

    return cheapskatescount


print "Setting up the yRotate callback..."

global cheapskatescount

cheapskatescount=0

poser.Scene().CurrentActor().Parameter("yRotate").SetUpdateCallback(cheapskatesYRotateCallback)

print "...done."




I would really appreciate it if somebody other than me could try running this script to confirm that I'm not talking rubbish !

(I'd also appreciate it even more if somebody can make it do what I want it to ! :0)


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).