
Left: Skeletal mesh deformation without correction. In this example, a shape key is used to improve the deformation at the elbow of a rudimentary arm. Shape keys can also be used to tweak and refine a rig, for example to suggest muscle formations.

Shape Key Drivers Improved Mesh Deformation įix intersection problems that happen when using armatures and weight painting, especially at joints. There are more custom function examples available in Blender’s Text EditorĬustom functions, using them only makes sense for complex computations. Observe the effect when scrubbing the timeline. driver_namespace = squareĪdd a driver with a Scripted Expression such as square(frame). Import bpy def square ( val ): """Returns the square of the given value""" return val * val # Add function to driver_namespace. These can be inspected via the Python Console: The Driver Namespace has a list of built-in functions for use in driver expressions, value 2).Īdding the function to the Driver Namespace allows it to be used from driver expressions. (sin( )*4) : multiplies the result of sin(frame/8) by 4 for a bigger circle.Ġ + : is used to control the offset to the orbit center point.Īdd a driver to the Y Location property with the expression 0 + (cos(frame / 8) * 4).Įxperiment with the variables to control the size and center of the orbit.Ĭreate a custom function to get the square of a value (i.e. Set the Driver Type to Scripted Expression.Īdd the expression 0 + (sin(frame / 8) * 4), where:įrame/8 : is the current frame of the animation, divided by 8 to slow the orbit down. In this example, the current frame is used as the variable that induces the motion.įrame is a Simple Expression that corresponds to
Using trigonometry, circular motion can be defined in 2D using the sine and cosine functions. The object’s position will change when scrubbing the timeline. Orbit an object’s position around a point with a custom Scripted Expression. Open the Sidebar region and select the Drivers tab.Ĭonfigure the driver to be the Averaged Value of a Transform Channel of the first object.Įxperiment with moving the first object and notice how it affects the Y rotation of the second object. Open the Drivers Editor and select the Y Euler Rotation property in the channels region. Starting from a simple setup with two objects:Īdd a Driver to the Rotation Y property of the second object via the context menu or with Ctrl- D. In this example, the Y rotation of Object 2 will be driven by the X position of Object 1.

Transform Driver Ĭontrol a property with an object’s transform. It is useful to have open the Drivers Editor. When adding multiple Drivers or for more advanced configurations,

Simple Drivers can be configured from the pop-over that appears when adding a new Driver.
