4 answers · asked · Lesson: Rigging Facial Controls · Course: Short Film Character Production

Is using scripted expressions for drivers the best option?

I have heard that this means python has to run in the background which slows things down.

Isn't it better to just set it to one of the other options such as "Maximum Value"? (even if we only have one variable)

The graphs can be manipulated as well instead of only doing it with equations. 

  • crew
    Interesting, I'd not heard of this. Makes sense to me though. Maybe scripted expressions aren't 100% the best option but they certainly get the job done. I'd love to see you tackle this or another rig with the non-expression approach. If it means substantial rig speed up I'd be keen to learn it!
  • theluthier When setting up a "Driver" for the "Corrective Shapekey" that adds a smile when moving the "Mouth Corner Bone" on Piero's left side up and to right by 0.1 each as you describe it at the end of the video, I get an error message in Blender 2.90.0 (I can't remember having had that before or didn't I notice that?):

    Then I enabled the automatic execution of "Python Scripts" in Blender's "Preferences":

    This gave me a warning that Python is running slowly with that expression:

  • The "Corrective Shapekey" that makes Piero smile at work:

    After reloading my file the "Python Warning" concerning a "Slow Script Execution" is no longer there:

  • I've tried what jjaredowen proposed above using "Sum Values" and a "Generator Modifier" with a "Polynomial of Degree 1" :

    y = c*x¹ =cx 

    with "c" being a constant value and "x" being a variable that gets its input from mathematical operation executed on the "Driver Input Variables".

    The constant value "c" has to be set to "5" so that the sum of "varA" and "varB" (containing the movement of the "Mouth Corner Bone" in "Local X" and "Local Z") is multiplied by 5:

    1) Deformation ("Bone" movement by 0.1 in "Local X and Z") without "Generator Modifier" being active on the "Driver's" "f-Curve":

    2) Deformation ("Bone" movement by 0.1 in "Local X and Z") with "Generator Modifier" being active on the "Driver's" "f-Curve":

    I couldn't notice any difference in speed since in both setups with "Scripted Expression" as well as with "Sum Values" the "Custom Bone Shape" of the "Mouth Corner Bone" was lagging behind the mouse cursor.