Fix crash removing objects rigid body constraints
This commit is contained in:
parent
d1526da787
commit
e2672a433b
Notes:
blender-bot
2023-02-14 10:40:09 +01:00
Referenced by issue #40129, Script using text view crashes Blender
|
@ -935,10 +935,7 @@ void BKE_rigidbody_remove_object(Scene *scene, Object *ob)
|
|||
Object *obt = go->ob;
|
||||
if (obt && obt->rigidbody_constraint) {
|
||||
rbc = obt->rigidbody_constraint;
|
||||
if (rbc->ob1 == ob) {
|
||||
BKE_rigidbody_remove_constraint(scene, obt);
|
||||
}
|
||||
if (rbc->ob2 == ob) {
|
||||
if (ELEM(ob, rbc->ob1, rbc->ob2)) {
|
||||
BKE_rigidbody_remove_constraint(scene, obt);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue