Forum: Poser Python Scripting


Subject: kValueOpTypeCodePYTHONCALLBACK doesn't seem to work

3dcheapskate opened this issue on Sep 22, 2021 ยท 13 posts


3dcheapskate posted Wed, 22 September 2021 at 11:09 PM

Ah, sorry - I've confused things by talking about a number of different, but related, problems in this thread.

1) I have two parameters, BigNumber and BigNumberModulo. I intend BigNumber to increase frame by frame with no limit (e.g. simply incrementing frame by frame 1, 2, 3, ... 359, 360, 361, ... 719, 720, 721, ... . I want BigNumberModulo to be (BigNumber % 360), i.e for the BigNumber sequence previously noted 1, 2, 3, ... 359, 360, 1, ... 359, 360, 1, ...

SetUpdateCallback() is called as a method of a specific parameter, in my case BigNumber, because I want to do the associated modulo calculation every time BigNumber changes. However, the return value of the callback appears to be set as the new value of BigNumber, so BigNumber itself is set to (BigNumber%360), whereas I wanted BigNumber to remain non-modulo and BigNumberModulo to be BigNumber%360.

This is NOT a real problem, it's just because of the arse-about-face I was thinking. :)

2) Completely separate from adp001s callback code, AddValueOperation() using kValueOpTypeCodePYTHONCALLBACK doesn't appear to do anything - if I simply run this piece of code (no callbacks or any of that stuff)...


...save the figure, and then inspect the CR2, then the DeltaAdd has been correctly added, but there's no sign of the PythonCallback. So it appears that AddValueOperation(poser.kValueOpTypeCodePYTHONCALLBACK) does nothing.

3) So if AddValueOperation() using kValueOpTypeCodePYTHONCALLBACK does nothing, then just setting the callback itself via Python might add the valueOpPythonCallback to the CR2, yes ? If I use my hacked version of adp001's callback (slightly changed now)...


...I can twiddle/set the BigNumber dial to any value I want (hmm... except that negative values seem to lock up/crash Poser) and the adjusted value of BigNumber (the one above the dial) is modulo 360. So I save a new CR2 and then inspect it, expecting to see a valueOpPythonCallback in the BigNumber section - there isn't one.

4) Why is the callback function called not once, but 261 times, every time I change BigNumber ?


adp001 posted at 5:34 PM Wed, 22 September 2021 - #4427868

...Great for many things, also to plant viruses and trojans (by the way: to call Poser a "Security Nightmare" is almost a trivialization for this reason).

Yes indeed, that's always worried 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.