diff options
author | Joshua Leung <aligorith@gmail.com> | 2018-06-10 17:38:44 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2018-06-10 17:49:38 +0300 |
commit | 912931964723cb69dafd4adebe3daf093e3e78c1 (patch) | |
tree | f1ca45ec2ad8072521dcced256b6738272cda79a /source | |
parent | ca16c74e8705d91d043ec1223a2968a7217d34b7 (diff) |
Experimental Tweak: Only show relationship lines between objects when either the parent/child object is selected
As in Pose Mode, the idea here it to try to reduce viewport complexity
without requiring users to turn off the overlay completely all the time.
For example, a background prop (e.g. a tree with a tyre hanging off it,
or a branch with hand-placed leaves) won't be cluttering the viewport with
its relationship lines all the time, when you're trying to do something else.
When you really do need to see these lines, you can still select the object
in question, and you'll see the lines for which objects are its children
or what its parent is. And to see all lines, you can still always select all
objects.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/draw/modes/object_mode.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/source/blender/draw/modes/object_mode.c b/source/blender/draw/modes/object_mode.c index e563af4c3b1..c616a19bab0 100644 --- a/source/blender/draw/modes/object_mode.c +++ b/source/blender/draw/modes/object_mode.c @@ -1895,8 +1895,13 @@ static void DRW_shgroup_lightprobe(OBJECT_StorageList *stl, OBJECT_PassList *psl static void DRW_shgroup_relationship_lines(OBJECT_StorageList *stl, Object *ob) { if (ob->parent && DRW_check_object_visible_within_active_context(ob->parent)) { - DRW_shgroup_call_dynamic_add(stl->g_data->relationship_lines, ob->parent->obmat[3]); - DRW_shgroup_call_dynamic_add(stl->g_data->relationship_lines, ob->obmat[3]); + /* Only draw relationship lines when object or its parent are selected + * as a way of reducing visual clutter. + */ + if ((ob->base_flag & BASE_SELECTED) || (ob->parent->base_flag & BASE_SELECTED)) { + DRW_shgroup_call_dynamic_add(stl->g_data->relationship_lines, ob->parent->obmat[3]); + DRW_shgroup_call_dynamic_add(stl->g_data->relationship_lines, ob->obmat[3]); + } } } |