Fix #32022, #43188, #100373, Armature modifier - Preserve volume + Scale #108134

Merged
Nathan Vegdahl merged 13 commits from himisa/blender:main into main 2023-06-06 12:32:00 +02:00
1 changed files with 13 additions and 1 deletions
Showing only changes of commit a3aea691bf - Show all commits

View File

@ -352,7 +352,13 @@ void RB_body_delete(rbRigidBody *object)
* but since we delete everything when the world is rebult, we need to do it manually here */
for (int i = body->getNumConstraintRefs() - 1; i >= 0; i--) {
btTypedConstraint *con = body->getConstraintRef(i);
body->removeConstraintRef(con);
if (con->isEnabled()) {
con->getRigidBodyA().removeConstraintRef(con);
con->getRigidBodyB().removeConstraintRef(con);
con->setEnabled(false);
}
}
delete body;
@ -1119,6 +1125,12 @@ rbConstraint *RB_constraint_new_motor(float pivot[3],
void RB_constraint_delete(rbConstraint *con)
{
btTypedConstraint *constraint = reinterpret_cast<btTypedConstraint *>(con);
if (constraint->isEnabled()) {
constraint->getRigidBodyA().removeConstraintRef(constraint);
constraint->getRigidBodyB().removeConstraintRef(constraint);
}
delete constraint;
}