Armature Constraint: don't calculate the unneeded ct->matrix for solve.
This constraint requires full bone data to evaluate, so it can't use the generic single target matrix system. Calculating it is thus useless waste of CPU time.
This commit is contained in:
@@ -2422,7 +2422,8 @@ static void armdef_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *targ
|
||||
copy_v3_v3(input_co, cob->matrix[3]);
|
||||
}
|
||||
|
||||
/* Process all targets. */
|
||||
/* Process all targets. This can't use ct->matrix, as armdef_get_tarmat is not
|
||||
* called in solve for efficiency because the constraint needs bone data anyway. */
|
||||
for (bConstraintTarget *ct = targets->first; ct; ct = ct->next) {
|
||||
if (ct->weight <= 0.0f) {
|
||||
continue;
|
||||
@@ -5617,6 +5618,11 @@ void BKE_constraint_targets_for_solving_get(struct Depsgraph *depsgraph,
|
||||
*/
|
||||
cti->get_constraint_targets(con, targets);
|
||||
|
||||
/* The Armature constraint doesn't need ct->matrix for evaluate at all. */
|
||||
if (ELEM(cti->type, CONSTRAINT_TYPE_ARMATURE)) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* set matrices
|
||||
* - calculate if possible, otherwise just initialize as identity matrix
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user