Forum: Poser Python Scripting


Subject: Simple code that works in normal script causing parser error in callback

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


3dcheapskate posted Sat, 25 September 2021 at 2:27 AM

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