So i want to use drivers with option “scripted expression”? for example typing “frame” in var field gives me my propertie equal current frame. If i want for example cube1 locX be equal cube2 rotZ? what is syntaxis. I tryed wiki’s :
math.pi * 2 + 5.0
Blender.Get(“curframe”) # the current animation frame
math.sin(Blender.Get(“curframe”)) # the sine of the current frame
self.LocX * 10
but non of this dos not work for me with 2.6
Please help!
to set cube1 locx to the rotation of cube2 rotZ
enter for
the driver of cube1-locx (insert a single-driver … switch to fcurves->drivers)
a variable (±sign)
and select as object: cube2
and as part the transform: rotation-Z-axis
(check you have the right rotation-mode … XYZ-Euler … and not quaternions…)
then enter into the expression field:
var
press return, maybe enable debug to view the current values …
… you know the rotations are in radians …?
lol, yep! batFINGER, you are totally righty right.
I have some braindamage from my setting for the cyclic wobbling
of some very important body-parts - and those body-parts
dont wobble/jiggle in the full cycle of one walk-animation/run-animation,
they have only half of the cycle of the base-animation.
I understand how to set up scripted expressions using the gui, but how exactly do you set a Scripted Expression using python?
Edit:
Ah, I figured it out. For anyone else wondering, this is how you set a driver’s expression with python, assuming you are setting the very first driver element in the driver list: