Refactor: remove unused argument to BKE_constraint_remove_ex()
Remove the `bool clear_dep` argument of `BKE_constraint_remove_ex()`, as it was always `true` on every call anyway. No functional changes.
This commit is contained in:
@@ -236,10 +236,7 @@ struct bConstraint *BKE_constraint_add_for_pose(struct Object *ob,
|
||||
const char *name,
|
||||
short type);
|
||||
|
||||
bool BKE_constraint_remove_ex(ListBase *list,
|
||||
struct Object *ob,
|
||||
struct bConstraint *con,
|
||||
bool clear_dep);
|
||||
bool BKE_constraint_remove_ex(ListBase *list, struct Object *ob, struct bConstraint *con);
|
||||
/**
|
||||
* Remove the specified constraint from the given constraint stack.
|
||||
*/
|
||||
|
||||
@@ -5615,12 +5615,12 @@ bool BKE_constraint_remove(ListBase *list, bConstraint *con)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool BKE_constraint_remove_ex(ListBase *list, Object *ob, bConstraint *con, bool clear_dep)
|
||||
bool BKE_constraint_remove_ex(ListBase *list, Object *ob, bConstraint *con)
|
||||
{
|
||||
const short type = con->type;
|
||||
if (BKE_constraint_remove(list, con)) {
|
||||
/* ITASC needs to be rebuilt once a constraint is removed #26920. */
|
||||
if (clear_dep && ELEM(type, CONSTRAINT_TYPE_KINEMATIC, CONSTRAINT_TYPE_SPLINEIK)) {
|
||||
if (ELEM(type, CONSTRAINT_TYPE_KINEMATIC, CONSTRAINT_TYPE_SPLINEIK)) {
|
||||
BIK_clear_data(ob->pose);
|
||||
}
|
||||
return true;
|
||||
@@ -5680,7 +5680,7 @@ bool BKE_constraint_apply_and_remove_for_object(Depsgraph *depsgraph,
|
||||
return false;
|
||||
}
|
||||
|
||||
return BKE_constraint_remove_ex(constraints, ob, con, true);
|
||||
return BKE_constraint_remove_ex(constraints, ob, con);
|
||||
}
|
||||
|
||||
bool BKE_constraint_apply_for_pose(
|
||||
@@ -5743,7 +5743,7 @@ bool BKE_constraint_apply_and_remove_for_pose(Depsgraph *depsgraph,
|
||||
return false;
|
||||
}
|
||||
|
||||
return BKE_constraint_remove_ex(constraints, ob, con, true);
|
||||
return BKE_constraint_remove_ex(constraints, ob, con);
|
||||
}
|
||||
|
||||
void BKE_constraint_panel_expand(bConstraint *con)
|
||||
|
||||
@@ -1450,7 +1450,7 @@ static int constraint_delete_exec(bContext *C, wmOperator *op)
|
||||
STRNCPY(name, con->name);
|
||||
|
||||
/* free the constraint */
|
||||
if (BKE_constraint_remove_ex(lb, ob, con, true)) {
|
||||
if (BKE_constraint_remove_ex(lb, ob, con)) {
|
||||
/* Needed to set the flags on pose-bones correctly. */
|
||||
ED_object_constraint_update(bmain, ob);
|
||||
|
||||
|
||||
@@ -2294,7 +2294,7 @@ static void constraint_fn(int event, TreeElement *te, TreeStoreElem * /*tselem*/
|
||||
lb = &ob->constraints;
|
||||
}
|
||||
|
||||
if (BKE_constraint_remove_ex(lb, ob, constraint, true)) {
|
||||
if (BKE_constraint_remove_ex(lb, ob, constraint)) {
|
||||
/* there's no active constraint now, so make sure this is the case */
|
||||
BKE_constraints_active_set(&ob->constraints, nullptr);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user