Constraints: add missing calls to initialize custom space.

Add calls to a few locations that look like they may need to
initialize the Custom Space matrix, i.e. generally any place
that computes target matrices.

Differential Revision: https://developer.blender.org/D9732
This commit is contained in:
Alexander Gavrilov 2022-06-03 16:28:09 +03:00
parent 054a169be0
commit e6855507a5
3 changed files with 8 additions and 0 deletions

View File

@ -6259,6 +6259,9 @@ void BKE_constraint_target_matrix_get(struct Depsgraph *depsgraph,
}
}
/* Initialize the custom space for use in calculating the matrices. */
BKE_constraint_custom_object_space_init(cob, con);
/* get targets - we only need the first one though (and there should only be one) */
cti->get_constraint_targets(con, &targets);

View File

@ -1315,6 +1315,8 @@ static void OVERLAY_relationship_lines(OVERLAY_ExtraCallBuffers *cb,
if ((curcon->ui_expand_flag & (1 << 0)) && BKE_constraint_targets_get(curcon, &targets)) {
bConstraintTarget *ct;
BKE_constraint_custom_object_space_init(cob, curcon);
for (ct = targets.first; ct; ct = ct->next) {
/* calculate target's matrix */
if (cti->get_target_matrix) {

View File

@ -292,6 +292,9 @@ void constraintTransLim(const TransInfo *t, TransData *td)
continue;
}
/* Initialize the custom space for use in calculating the matrices. */
BKE_constraint_custom_object_space_init(&cob, con);
/* get constraint targets if needed */
BKE_constraint_targets_for_solving_get(t->depsgraph, con, &cob, &targets, ctime);