diff options
author | Sybren A. Stüvel <sybren@stuvel.eu> | 2018-06-28 16:20:55 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@stuvel.eu> | 2018-06-28 16:32:19 +0300 |
commit | 747843516f3c1e3f3f576464d97f2e82981cc436 (patch) | |
tree | 4f19d91e4a5b572581d46f4a75e9184dc8a6127c /source/blender | |
parent | 2b4c7600b763f252a0e7f54d80cd8e3005871f5e (diff) |
Draw relationship lines for rigid body constraints
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/draw/modes/object_mode.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/source/blender/draw/modes/object_mode.c b/source/blender/draw/modes/object_mode.c index 887a1cb7721..288a7f80e1e 100644 --- a/source/blender/draw/modes/object_mode.c +++ b/source/blender/draw/modes/object_mode.c @@ -35,6 +35,7 @@ #include "DNA_object_force_types.h" #include "DNA_lightprobe_types.h" #include "DNA_particle_types.h" +#include "DNA_rigidbody_types.h" #include "DNA_view3d_types.h" #include "DNA_world_types.h" @@ -1939,6 +1940,19 @@ static void DRW_shgroup_relationship_lines(OBJECT_StorageList *stl, Object *ob) DRW_shgroup_call_dynamic_add(stl->g_data->relationship_lines, ob->obmat[3]); } } + + if (ob->rigidbody_constraint) { + Object *rbc_ob1 = ob->rigidbody_constraint->ob1; + Object *rbc_ob2 = ob->rigidbody_constraint->ob2; + if (rbc_ob1 && DRW_check_object_visible_within_active_context(rbc_ob1)) { + DRW_shgroup_call_dynamic_add(stl->g_data->relationship_lines, rbc_ob1->obmat[3]); + DRW_shgroup_call_dynamic_add(stl->g_data->relationship_lines, ob->obmat[3]); + } + if (rbc_ob2 && DRW_check_object_visible_within_active_context(rbc_ob2)) { + DRW_shgroup_call_dynamic_add(stl->g_data->relationship_lines, rbc_ob2->obmat[3]); + DRW_shgroup_call_dynamic_add(stl->g_data->relationship_lines, ob->obmat[3]); + } + } } static void DRW_shgroup_object_center(OBJECT_StorageList *stl, Object *ob, ViewLayer *view_layer, View3D *v3d) |