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
This commit is contained in:
Philipp Oeser 2022-11-25 09:43:51 +01:00 • committed by Philipp Oeser
parent f3a10a1543
commit 5940e9b792

View file

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