Hi, I spent today the whole day figuring out a way to split my rigid body animation into two scenes.
The reason I wanted to split it is because each scene would be about 2000 frames, with lots of camera cuts, different backgrounds, etc. It feels wrong to have everything in one endless scene.
The problem was to have some continuity. There is no simple way to transfer the animation state from the end of scene A to the beginning of scene B, is there?
My hacky solution was:
- Go to the end of scene A
- Select all rigid bodies
- Do Apply Transformation on all rigid bodies, but DO NOT SAVE the project, as this breaks the original physics simulation (because it changes the default positions and rotations of the bodies).
- Now that the objects contain real location and translation, run a script that outputs locations and rotations of the rigid bodies.
- Reload the project.
- Use the exported location and rotation data from point 4 to position all rigid bodies to the right positions at the beginning of scene B.
- Continue animating scene B.
My “export” script looks like this:
import bpy
names = {
"Rock10.003": "Rock10.004",
"Rock16.000": "Rock16.003",
"Rock12.003": "Rock12.004",
"Rock13.002": "Rock13.003",
"Rock15.002": "Rock15.003",
...
}
print("objs = bpy.data.collections.get(\"Rocks.001\").objects")
for o in bpy.context.selected_objects:
print("obj = objs.get(\"%s\")" % names[o.name])
print("obj.location[0] =", o.location[0])
print("obj.location[1] =", o.location[1])
print("obj.location[2] =", o.location[2])
print("obj.rotation_euler[0] =", o.rotation_euler[0])
print("obj.rotation_euler[1] =", o.rotation_euler[1])
print("obj.rotation_euler[2] =", o.rotation_euler[2])
And it produces something like:
import bpy
objs = bpy.data.collections.get("Rocks.001").objects
obj = objs.get("Rock10.004")
obj.location[0] = -16.46969985961914
obj.location[1] = -9.503165245056152
obj.location[2] = 27.072675704956055
obj.rotation_euler[0] = 1.1707409620285034
obj.rotation_euler[1] = -0.10271362215280533
obj.rotation_euler[2] = -1.0867154598236084
obj = objs.get("Rock16.003")
obj.location[0] = -17.071537017822266
obj.location[1] = -9.204041481018066
obj.location[2] = 27.17542839050293
obj.rotation_euler[0] = 1.0363520383834839
obj.rotation_euler[1] = -0.20789748430252075
obj.rotation_euler[2] = -1.0412501096725464
...
- It would be great to have access to physics driven object locations and rotations. Normally objects do not show changing location and rotation, which I find odd. You see it move, but the values do not change.
- I realized that if you clone the scene, the rigid body settings are lost (I needed to recreate the Rigid Body World Collection and Constraint groups).
- In the Blender documentation it is mentioned that a common trick is to animate objects with keyframes and then turn on physics, which will take over. It would be excellent if this was also possible in the opposite direction: run physics, and then at some point continue by using keyframes. If you try by turning on Animated on an object it will jump to a position far from the last known animation state. Any solution to this?
- Maybe a solution to this would be to have a new option:
Object > Rigid Body > Clone Object with current transformations
. It would have saved my day
Anyone has struggled with cross-scene physics? Any tips?