[Bf-blender-cvs] [5198489] render-layers: Temporary UI for layer/collections (for debug/testing)
Dalai Felinto
noreply at git.blender.org
Wed Dec 21 19:14:58 CET 2016
Commit: 51984897d80d7a59ff1a8ea84771d1d788cb769b
Author: Dalai Felinto
Date: Tue Dec 20 15:59:13 2016 +0100
Branches: render-layers
https://developer.blender.org/rB51984897d80d7a59ff1a8ea84771d1d788cb769b
Temporary UI for layer/collections (for debug/testing)
===================================================================
M release/scripts/startup/bl_ui/space_view3d.py
===================================================================
diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py
index 2739248..97baf85 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -3049,6 +3049,48 @@ class VIEW3D_PT_viewport_debug(Panel):
col.row(align=True).prop(view, "debug_background", expand=True)
+class VIEW3D_PT_layers_debug(Panel):
+ bl_space_type = 'VIEW_3D'
+ bl_region_type = 'UI'
+ bl_label = "Layers"
+ bl_options = {'DEFAULT_CLOSED'}
+
+ @classmethod
+ def poll(cls, context):
+ view = context.space_data
+ return (view and view.use_modern_viewport)
+
+ def draw(self, context):
+ layout = self.layout
+ view = context.space_data
+ scene = context.scene
+
+ for layer in scene.render_layers:
+ col = layout.column()
+ col.label(text=layer.name)
+
+ box = col.box()
+ for collection in layer.collections:
+ self._draw_layer_collection(box, collection)
+
+ def _draw_layer_collection(self, box, collection, depth=0):
+ row = box.row()
+ row.label(text="{0}{1}{2}".format(
+ " " * depth,
+ u'\u21b3 ' if depth else "",
+ collection.name))
+
+ row.prop(collection, "hide", text="", emboss=False)
+ row.prop(collection, "hide_select", text="", emboss=False)
+ row.prop(collection, "use_folded")
+
+ if collection.use_folded:
+ return
+
+ for nested_collection in collection.collections:
+ self._draw_layer_collection(box, nested_collection, depth + 1)
+
+
class VIEW3D_PT_grease_pencil(GreasePencilDataPanel, Panel):
bl_space_type = 'VIEW_3D'
bl_region_type = 'UI'
More information about the Bf-blender-cvs
mailing list