[Bf-blender-cvs] [91293196472] blender2.8: Experimental Tweak: Only show relationship lines between objects when either the parent/child object is selected

Joshua Leung noreply at git.blender.org
Sun Jun 10 16:54:16 CEST 2018


Commit: 912931964723cb69dafd4adebe3daf093e3e78c1
Author: Joshua Leung
Date:   Mon Jun 11 02:38:44 2018 +1200
Branches: blender2.8
https://developer.blender.org/rB912931964723cb69dafd4adebe3daf093e3e78c1

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.

===================================================================

M	source/blender/draw/modes/object_mode.c

===================================================================

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]);
+		}
 	}
 }



More information about the Bf-blender-cvs mailing list