I can try to explain here. This is for one axis and can be repeated for each axis. I have one target object named “Target” and another object named “Inertia” that will be affected by the script.
Here is an example file if needed (Blender 2.71): https://www.dropbox.com/s/0ewu3azgn1lbtn3/AutoInertia%20Instructional%20File.blend
- Go to User Preferences > File > enable “Auto Run Python Scripts”
- Load AutoInertia.py into the text editor. Enable “Register” and run the script
- (at the bottom of the object panel) Add a custom property, preferably corresponding to the axis of motion you’ve chosen (I’ll choose x here). I named mine “x prop” and set the max to 1000 and min to -1000. These are actually max and min for speed.
- Add a single driver to “Inertia” for the chosen transform axis and open the graph editor. Switch it to Drivers mode
- Bring up the Properties menu in the graph editor and delete the default variable
- In the expression box, type
AutoInertia("Inertia", "Target", 0, 0.1, 0.5, "x prop")
The arguments for the driver script are:
AutoInertia(inertia_name, target_name, axis, mass, damp, velocity_property)
First argument = name of the object with inertia (in quotes).
Second argument = name of the target object (in quotes).
Third argument = axis of motion. x = 0, y = 1, z = 2.
Fourth argument = mass scalar. Goes from 0 to 1. 0 = fast and light motion, 1 = slow and heavy motion.
Fifth argument = dampening. Goes from 0 to 1. 0 = sustained, 1 = dampened.
Sixth argument = name of the custom property created earlier (in quotes).
- Play the animation (Alt-a) and drag the target object around.