$0+

Time Warp Effects for Rigid Body Animations in Blender 3D: Action to Constraint Add-on

I want this!

Time Warp Effects for Rigid Body Animations in Blender 3D: Action to Constraint Add-on

$0+

Video Tutorial


Textual Description

After you have baked a rigid-body simulation in blender, this add-on will allow you to easily manipulate the timing of the animation in interesting ways. For example you could start the animation in real time, then switch to a matrix-style bullet time effect and in the end of the animation go back to real time again. Or you could even go backward in time. Or go forth and back in time multiple times. Whatever you want to do.

In order to give you this control the Add-on will place an empty object in your scene, which acts like the playhead in your timeline. That is you can scrub through your baked rigid-body simulation by moving the empty-object in your scene instead of moving the playhead in your timeline. You can then animate the location of this empty (by adding keyframes or by using F-Curve modifiers or however you like). Where the empty moves faster the animation will play faster, where the empty moves slower the animation will play slower. Where the empty is not moving, the animation will stay still (but you can still animate the camera). Where the empty moves backward the animation will play backward.

You do not need to put all objects under the control of this empty. For example you can still have a camera object which is animated completely independently of this empty. Thus you can still animate the camera movement even at moments where you have your rigid body simulation frozen in time.


How to install and enable the Add-on

1) download the python-file action_to_constraint_version_1_1.py to any location on your computer

2) in blender open the user preferences

3) on the left of the user preferences go to the Add-ons tab

4) on the upper right click on the install button

5) in the window that pops-up select the python file action_to_constraint_version_1_1.py

6) Now the Add-on is installed but it is not enabled yet. Therefore it has no effect yet. To actually enable it check the checkbox next to the Action to Constraint Add-on in the preferences window.


How to use the Add-on

1) make a rigid body simulation

2) select all of the rigid bodies and in the menu of the 3D-View click

Object > Rigid Body > Bake to Keyframes

Usually you can probably accept the default settings in the menu that pops up and press OK.

(This step would not need my add-on.)

(Note that baking to the rigid body cache is not sufficient. You have to actually bake to keyframes.)

3) with all of the rigid-bodies selected click

Object > Constraints > Linked Action to Action Constraint

(This option is only available if you have installed and enabled my Add-on)

4) Often you can just accept the default settings in the menu that pops up and press OK.

5) Move the newly added empty to convince yourself that it is working. The rigid bodies should now be moving accordingly while you are moving the empty. As if you were scrubbing through the animation with the playhead in the timeline.

(If you had "Limit Target Transforms" checked in the previous step then only the correct axis of the empty is unlocked. So for example you don't even need to press X after pressing G. Also there is a Limit Location constraint on the empty so the empty stops automatically at the locations corresponding to the first and last frame of your animation, if you try to move it further along the x-axis. Or more precisely it stops at the location corresponding to the action range start and end frame you have selected.)

6) animate the empty to control the timing of the animation. You can also animate the camera and other objects in the scene independently of the empty.

(If you had "add keyframes" checked in step 4 then there are already two keyframes on the empty. Those two keyframes are set up in a way such that by default the whole rigid body simulation is played back at the normal speed. You can than add more keyframes, move the two existing keyframes and/or add F-Curve modifiers to the empty's animation.)


Technical background/How the add-on achieves this effect

The Add-on achieves this effect by unlinking the action data-blocks of each object (=rigid body) and instead adding a so called Action Constraint to each object. For this Action Constraint the add-on will then select the unlinked action data block. (Therefore the name Linked Action to Action Constraint)

In theory you could do this manually without the help of my Add-on. However that would be extremely tedious to add an action constraint to each individual rigid body manually. While you could add the action constraint to only one object first and then copy that constraint to all of the others with Object > Constraints > Copy Constraints to Selected Objects, this would still not select the correct action data block for each object inside the action constraint. Therefore you would still be forced to click on each individual object manually and in the constraints tab of the properties editor select the correct action data block that belongs to this object. If you have like a thousand rigid-bodies you would need to do this a thousand times! To avoid this hassle I wrote this Add-on which will do all the work for you.


More use cases and Limitations

The Add-on works for rigid-body simulations that have been baked to keyframes. It also works for manually created keyframe animations of location/rotation and scale of objects, even if they are not the result of a rigid body simulation.

The add-on does not support animation of bones currently, although that would likely be possible somehow but I did not find time to implement it. Also for bones it would likely be not too hard to set up the action constraints manually without the help of an add-on. Because bones that belong to the same armature object also share the same action data block. Therefore you don't have to manually select the correct action data block in each bone's action constraint. You set up the action constraint for one of the bones and then copy it to the others with Pose>Constraints>Copy Constraints to Selected Bones.

The add-on will probably never support animations of other parameters like shape-key values. (except if they are controlled indirectly by the location/rotation or scale of a different object via a driver and you control this other objects animation with my add-on.) The add-on will also not support controlling soft-body-, cloth-, fluid- or smoke-simulations. This is just not possible with action-constraints.


Blender Version

So far I have only tested the Add-on in Blender Version 2.82a.

If you want to use a different blender version please leave a comment on my Youtube video telling me in which blender version you would like to use the add-on. I can try it if it works. and if there is a problem I can try to fix the code in my script such that it hopefully works in the blender version you need also.

$
I want this!

Matrix-Style Bullet-Time Effects and more Time-Warping Effects for your Rigid Body Simulations in Blender 3D

Size
16.3 KB
Copy product URL