From b0bcdcdbef2e12acdcf19109e3ae77b2b1f1a25c Mon Sep 17 00:00:00 2001 From: Philipp Oeser Date: Fri, 25 Nov 2022 09:43:51 +0100 Subject: [PATCH] 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 --- .../blender/draw/engines/overlay/overlay_extra.cc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/source/blender/draw/engines/overlay/overlay_extra.cc b/source/blender/draw/engines/overlay/overlay_extra.cc index 27afe49a17b..cf9f5e2cbb2 100644 --- a/source/blender/draw/engines/overlay/overlay_extra.cc +++ b/source/blender/draw/engines/overlay/overlay_extra.cc @@ -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" @@ -1273,6 +1274,20 @@ static void OVERLAY_relationship_lines(OVERLAY_ExtraCallBuffers *cb, OVERLAY_extra_point(cb, center, relation_color); } } + for (GpencilModifierData *md = + static_cast(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->object_to_world, hmd->cent); + if (hmd->object) { + OVERLAY_extra_line_dashed(cb, hmd->object->object_to_world[3], center, relation_color); + } + OVERLAY_extra_point(cb, center, relation_color); + } + } if (ob->rigidbody_constraint) { Object *rbc_ob1 = ob->rigidbody_constraint->ob1;