Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Gavrilov <angavrilov@gmail.com>2019-05-15 21:49:27 +0300
committerAlexander Gavrilov <angavrilov@gmail.com>2019-05-15 22:35:14 +0300
commit198c00f4ed09f8b9c7273c40f93c7f2630f14624 (patch)
tree93663bf0b83f86df5c46ec77b17e79cd32c5146f /source/blender/blenkernel
parentf9784ea6afa70d4105901af5c00e6da09e6f7f98 (diff)
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.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r--source/blender/blenkernel/intern/constraint.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c
index 218dfbd7b14..c680e15763d 100644
--- a/source/blender/blenkernel/intern/constraint.c
+++ b/source/blender/blenkernel/intern/constraint.c
@@ -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
*/