Forum: Poser Python Scripting


Subject: What is the mystery frame incrementer?

HartyBart opened this issue on Aug 12, 2021 ยท 13 posts


structure posted Wed, 06 October 2021 at 5:00 PM Forum Coordinator

ok first you have no value for h

multiplying a tuple  (ka) will loop the tuple between the 2 numbers x times

e.g.

print( 10 * (36, 30) )

results in the output 

(36, 30, 36, 30, 36, 30, 36, 30, 36, 30, 36, 30, 36, 30, 36, 30, 36, 30, 36, 30)

trying to add the h 

results in an error

>>> ka = (10, 349)

>>> h  = 90

>>> print (ka * 10 + h)

Traceback (most recent call last):

  File "<pyshell#2>", line 1, in <module>

    print (ka * 10 + h)

TypeError: can only concatenate tuple (not "int") to tuple

>>> 

to make a turn at the end of each 10 frames doesn't need a complicated formula 

class anim:
    def createAnim(self, parm, frame):
        for i in range(0, 4):
            frame += 10
            scene.SetFrame(frame)
            parm.SetValue(parm.Value() + 90)
            scene.DrawAll()

Locked Out