[Bf-blender-cvs] [7b9a32a7745] temp-angavrilov: Constraints: add missing calls to initialize custom space.

Alexander Gavrilov noreply at git.blender.org
Fri Jul 15 13:30:32 CEST 2022


Commit: 7b9a32a774512ea9b1d55fdfbe33b817ae483d38
Author: Alexander Gavrilov
Date:   Fri Jun 3 16:28:09 2022 +0300
Branches: temp-angavrilov
https://developer.blender.org/rB7b9a32a774512ea9b1d55fdfbe33b817ae483d38

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

===================================================================

M	source/blender/blenkernel/intern/constraint.c
M	source/blender/draw/engines/overlay/overlay_extra.c
M	source/blender/editors/transform/transform_mode.c

===================================================================

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);



More information about the Bf-blender-cvs mailing list