Fix T43611: Collision shape of rigid bodies changes inadvertently
The issue was caused by the fix for T34108, which modified DNA in order to get a fallback box collision shape. Not sue why it's needed, we can just get box shape directly, without modifying user's settings.
This commit is contained in:
parent
25412d8ae2
commit
6971bd9a4f
Notes:
blender-bot
2023-02-14 09:33:10 +01:00
Referenced by issue #43611, Collision shape of rigid bodies changes inadvertently Referenced by issue #43491, Crash during autocompletion in PyConsole (Linux Library Compatibility)
|
@ -438,6 +438,10 @@ static void rigidbody_validate_sim_shape(Object *ob, bool rebuild)
|
|||
new_shape = rigidbody_get_shape_trimesh_from_mesh(ob);
|
||||
break;
|
||||
}
|
||||
/* use box shape if we can't fall back to old shape */
|
||||
if (new_shape == NULL && rbo->physics_shape == NULL) {
|
||||
new_shape = RB_shape_new_box(size[0], size[1], size[2]);
|
||||
}
|
||||
/* assign new collision shape if creation was successful */
|
||||
if (new_shape) {
|
||||
if (rbo->physics_shape)
|
||||
|
@ -445,11 +449,6 @@ static void rigidbody_validate_sim_shape(Object *ob, bool rebuild)
|
|||
rbo->physics_shape = new_shape;
|
||||
RB_shape_set_margin(rbo->physics_shape, RBO_GET_MARGIN(rbo));
|
||||
}
|
||||
/* use box shape if we can't fall back to old shape */
|
||||
else if (rbo->physics_shape == NULL) {
|
||||
rbo->shape = RB_SHAPE_BOX;
|
||||
rigidbody_validate_sim_shape(ob, true);
|
||||
}
|
||||
}
|
||||
|
||||
/* --------------------- */
|
||||
|
|
Loading…
Reference in New Issue