Apply Rotation moves mesh when Rigid Body World is active #41388
Windows x64, GTX 560
Broken: 2.71 and git latest
Short description of error
When an object is under the influence of a rigid body world, applying rotation to it can cause its rotation to change. There should be no visible change to the object.
The bug can be worked around by setting
bpy.context.scene.rigidbody_world.enabled = False.
Exact steps for others to reproduce the error
- Open appy_rotation.blend.
- Apply rotation to either mesh.
The object will rotate around its origin when the rotation is applied.
Problem is the way the rigid body cache data works on top of the object transform. The
apply transform operators (loc/rot/scale) only work reliably with static (non-animated/simulated) objects. This is because they actually apply the transform of the object to the vertex data, and then reset the transform to zero (identity to be precise). However, if the object is simulated or animated, the transform will be re-defined on the next occasion (frame change) by the animation system or rigidbody simulation.
You can see the same effect with keyframe animation: In the file below, apply the location to the cube, then go to the next frame and observe the sudden jump. The origin of the object is temporarily set to (0,0,0) by the operator, but then the animation system overrides it again. Same happens with the rigidbody cache (if you re-bake it it could work fine though).
There is no easy way to solve this really, resetting the origin basically invalidates all animation and simulation results.
Deleting a branch is permanent. Although the deleted branch may exist for a short time before cleaning up, in most cases it CANNOT be undone. Continue?