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
parent cdc73cb840
commit 1f30e7c183
Notes: blender-bot 2023-02-14 07:39:46 +01:00
Referenced by issue #88449: Blender LTS: Maintenance Task 2.93
Referenced by issue #88449, Blender LTS: Maintenance Task 2.93
Referenced by issue #102741, GPencil: Uniform Fallof in Hook modifier doing nothing
1 changed files with 12 additions and 0 deletions

View File

@ -42,6 +42,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"
@ -1290,6 +1291,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;