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>2022-06-03 16:28:09 +0300
committerAlexander Gavrilov <angavrilov@gmail.com>2022-07-20 14:18:17 +0300
commite6855507a5a0c1611eef98b23acfbd009ec49eb4 (patch)
tree65ef235a5880ac70fb7a083c80a986629d02a184
parent054a169be04850c9356917904e04cdf24a73e04c (diff)
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
-rw-r--r--source/blender/blenkernel/intern/constraint.c3
-rw-r--r--source/blender/draw/engines/overlay/overlay_extra.c2
-rw-r--r--source/blender/editors/transform/transform_mode.c3
3 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c
index 8400d610a32..c32a6c6c515 100644
--- a/source/blender/blenkernel/intern/constraint.c
+++ b/source/blender/blenkernel/intern/constraint.c
@@ -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);
diff --git a/source/blender/draw/engines/overlay/overlay_extra.c b/source/blender/draw/engines/overlay/overlay_extra.c
index 9d478310104..738ea5dd8e7 100644
--- a/source/blender/draw/engines/overlay/overlay_extra.c
+++ b/source/blender/draw/engines/overlay/overlay_extra.c
@@ -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) {
diff --git a/source/blender/editors/transform/transform_mode.c b/source/blender/editors/transform/transform_mode.c
index 5ba0f08ee1c..356828f513f 100644
--- a/source/blender/editors/transform/transform_mode.c
+++ b/source/blender/editors/transform/transform_mode.c
@@ -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);