Commit: 52c4adc4dfe36ae138cc256679d5fc1de893d055
Author: Dalai Felinto
Date:   Wed Dec 21 18:32:55 2016 +0100
Branches: render-layers
https://developer.blender.org/rB52c4adc4dfe36ae138cc256679d5fc1de893d055

Debug UI revamp

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

M       release/scripts/startup/bl_ui/space_view3d.py
M       source/blender/makesrna/intern/rna_scene.c

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

diff --git a/release/scripts/startup/bl_ui/space_view3d.py 
b/release/scripts/startup/bl_ui/space_view3d.py
index 97baf85..44b0b30 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -3071,10 +3071,11 @@ class VIEW3D_PT_layers_debug(Panel):
 
             box = col.box()
             for collection in layer.collections:
-                self._draw_layer_collection(box, collection)
+                self._draw_layer_collection(box, collection, True)
 
-    def _draw_layer_collection(self, box, collection, depth=0):
+    def _draw_layer_collection(self, box, collection, is_active, depth=0):
         row = box.row()
+        row.active = is_active
         row.label(text="{0}{1}{2}".format(
             "  " * depth,
             u'\u21b3 ' if depth else "",
@@ -3082,13 +3083,20 @@ class VIEW3D_PT_layers_debug(Panel):
 
         row.prop(collection, "hide", text="", emboss=False)
         row.prop(collection, "hide_select", text="", emboss=False)
-        row.prop(collection, "use_folded")
 
-        if collection.use_folded:
+        nested_collections = collection.collections
+        if nested_collections:
+            row.prop(collection, "is_unfolded", text="", emboss=False)
+        else:
+            row.label(icon='BLANK1')
+            return
+
+        if not collection.is_unfolded:
             return
 
-        for nested_collection in collection.collections:
-            self._draw_layer_collection(box, nested_collection, depth + 1)
+        is_active &= not collection.hide
+        for nested_collection in nested_collections:
+            self._draw_layer_collection(box, nested_collection, is_active, 
depth + 1)
 
 
 class VIEW3D_PT_grease_pencil(GreasePencilDataPanel, Panel):
diff --git a/source/blender/makesrna/intern/rna_scene.c 
b/source/blender/makesrna/intern/rna_scene.c
index 22f1c21..30ef07a 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -5356,8 +5356,9 @@ static void rna_def_layer_collection(BlenderRNA *brna)
        RNA_def_property_ui_text(prop, "Hide Selectable", "Restrict selection");
        RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, NULL);
 
-       prop = RNA_def_property(srna, "use_folded", PROP_BOOLEAN, PROP_NONE);
-       RNA_def_property_boolean_sdna(prop, NULL, "flag", COLLECTION_FOLDED);
+       prop = RNA_def_property(srna, "is_unfolded", PROP_BOOLEAN, PROP_NONE);
+       RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", 
COLLECTION_FOLDED);
+       RNA_def_property_ui_icon(prop, ICON_RIGHTARROW, 1);
        RNA_def_property_ui_text(prop, "Folded", "Folded collection");
        RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, NULL);

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to