[Bf-blender-cvs] [5940e9b7927] blender-v3.3-release: Fix: missing greasepencil hook modifier relationship lines

Philipp Oeser noreply at git.blender.org
Thu Jan 12 14:07:18 CET 2023


Commit: 5940e9b7927bfa2c739c20c8537bf0873d3e6efd
Author: Philipp Oeser
Date:   Fri Nov 25 09:43:51 2022 +0100
Branches: blender-v3.3-release
https://developer.blender.org/rB5940e9b7927bfa2c739c20c8537bf0873d3e6efd

Fix: missing greasepencil hook modifier relationship lines

Overlay relationship lines were missing between the object having the
modifier and the target object.

To make this consistent with other objects types, now draw relationship
lines for greasepencil and hooks now, too.

Spotted while looking into T102741.

Maniphest Tasks: T102741

Differential Revision: https://developer.blender.org/D16609

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

M	source/blender/draw/engines/overlay/overlay_extra.c

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

diff --git a/source/blender/draw/engines/overlay/overlay_extra.c b/source/blender/draw/engines/overlay/overlay_extra.c
index 4354777986c..5470b782060 100644
--- a/source/blender/draw/engines/overlay/overlay_extra.c
+++ b/source/blender/draw/engines/overlay/overlay_extra.c
@@ -27,6 +27,7 @@
 #include "DNA_constraint_types.h"
 #include "DNA_curve_types.h"
 #include "DNA_fluid_types.h"
+#include "DNA_gpencil_modifier_types.h"
 #include "DNA_lightprobe_types.h"
 #include "DNA_mesh_types.h"
 #include "DNA_meta_types.h"
@@ -1268,6 +1269,17 @@ static void OVERLAY_relationship_lines(OVERLAY_ExtraCallBuffers *cb,
       OVERLAY_extra_point(cb, center, relation_color);
     }
   }
+  for (GpencilModifierData *md = ob->greasepencil_modifiers.first; md; md = md->next) {
+    if (md->type == eGpencilModifierType_Hook) {
+      HookGpencilModifierData *hmd = (HookGpencilModifierData *)md;
+      float center[3];
+      mul_v3_m4v3(center, ob->obmat, hmd->cent);
+      if (hmd->object) {
+        OVERLAY_extra_line_dashed(cb, hmd->object->obmat[3], center, relation_color);
+      }
+      OVERLAY_extra_point(cb, center, relation_color);
+    }
+  }
 
   if (ob->rigidbody_constraint) {
     Object *rbc_ob1 = ob->rigidbody_constraint->ob1;



More information about the Bf-blender-cvs mailing list