[Bf-blender-cvs] [962af13b18d] master: UI: Properties hierarchical nesting

William Reynish noreply at git.blender.org
Thu Feb 28 21:53:16 CET 2019


Commit: 962af13b18d9a6747dad4513896fe118bd780996
Author: William Reynish
Date:   Thu Feb 28 21:53:14 2019 +0100
Branches: master
https://developer.blender.org/rB962af13b18d9a6747dad4513896fe118bd780996

UI: Properties hierarchical nesting

Make hierarchy more clear and consistent in Render, Object and Particles

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

M	release/scripts/startup/bl_ui/properties_object.py
M	release/scripts/startup/bl_ui/properties_particle.py
M	release/scripts/startup/bl_ui/properties_render.py

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

diff --git a/release/scripts/startup/bl_ui/properties_object.py b/release/scripts/startup/bl_ui/properties_object.py
index e87127c1274..24df32c1e94 100644
--- a/release/scripts/startup/bl_ui/properties_object.py
+++ b/release/scripts/startup/bl_ui/properties_object.py
@@ -257,19 +257,33 @@ class OBJECT_PT_display(ObjectButtonsPanel, Panel):
             col.active = is_dupli
         col.prop(obj, "display_type", text="Display As")
 
-        split = flow.split(factor=0.6)
-        split.prop(obj, "show_bounds", text="Bounds")
-        row = split.row()
-        row.active = obj.show_bounds or (obj.display_type == 'BOUNDS')
-        row.prop(obj, "display_bounds_type", text="")
-
         if is_geometry or is_empty_image or is_gpencil:
             # Only useful with object having faces/materials...
             col = flow.column()
             col.prop(obj, "color")
 
 
-class OBJECT_PT_duplication(ObjectButtonsPanel, Panel):
+class OBJECT_PT_display_bounds(ObjectButtonsPanel, Panel):
+    bl_label = "Boundary"
+    bl_parent_id = "OBJECT_PT_display"
+    bl_options = {'DEFAULT_CLOSED'}
+
+    def draw_header(self, context):
+
+        obj = context.object
+
+        self.layout.prop(obj, "show_bounds", text="")
+
+    def draw(self, context):
+        layout = self.layout
+        obj = context.object
+        layout.use_property_split = True
+
+        layout.active = obj.show_bounds or (obj.display_type == 'BOUNDS')
+        layout.prop(obj, "display_bounds_type", text="Shape")
+
+
+class OBJECT_PT_instancing(ObjectButtonsPanel, Panel):
     bl_label = "Instancing"
     bl_options = {'DEFAULT_CLOSED'}
 
@@ -287,13 +301,6 @@ class OBJECT_PT_duplication(ObjectButtonsPanel, Panel):
         if ob.instance_type == 'VERTS':
             layout.prop(ob, "use_instance_vertices_rotation", text="Rotation")
 
-        elif ob.instance_type == 'FACES':
-            col = flow.column()
-            col.prop(ob, "use_instance_faces_scale", text="Scale")
-            sub = col.column()
-            sub.active = ob.use_instance_faces_scale
-            sub.prop(ob, "instance_faces_scale", text="Inherit Scale")
-
         elif ob.instance_type == 'COLLECTION':
             col = flow.column()
             col.prop(ob, "instance_collection", text="Collection")
@@ -310,6 +317,29 @@ from .properties_animviz import (
 )
 
 
+class OBJECT_PT_instancing_size(ObjectButtonsPanel, Panel):
+    bl_label = "Size"
+    bl_parent_id = "OBJECT_PT_instancing"
+
+    @classmethod
+    def poll(cls, context):
+        ob = context.object
+        return ob.instance_type == 'FACES'
+
+    def draw_header(self, context):
+
+        ob = context.object
+        self.layout.prop(ob, "use_instance_faces_scale", text="")
+
+    def draw(self, context):
+        layout = self.layout
+        ob = context.object
+        layout.use_property_split = True
+
+        layout.active = ob.use_instance_faces_scale
+        layout.prop(ob, "instance_faces_scale", text="Inherit Scale")
+
+
 class OBJECT_PT_motion_paths(MotionPathButtonsPanel, Panel):
     #bl_label = "Object Motion Paths"
     bl_context = "object"
@@ -362,10 +392,12 @@ classes = (
     OBJECT_PT_relations,
     COLLECTION_MT_specials,
     OBJECT_PT_collections,
-    OBJECT_PT_duplication,
+    OBJECT_PT_instancing,
+    OBJECT_PT_instancing_size,
     OBJECT_PT_motion_paths,
     OBJECT_PT_motion_paths_display,
     OBJECT_PT_display,
+    OBJECT_PT_display_bounds,
     OBJECT_PT_custom_props,
 )
 
diff --git a/release/scripts/startup/bl_ui/properties_particle.py b/release/scripts/startup/bl_ui/properties_particle.py
index e129b592c5d..4f774d63940 100644
--- a/release/scripts/startup/bl_ui/properties_particle.py
+++ b/release/scripts/startup/bl_ui/properties_particle.py
@@ -1773,17 +1773,35 @@ class PARTICLE_PT_children_clumping(ParticleButtonsPanel, Panel):
         else:
             sub.prop(part, "clump_factor", slider=True)
             sub.prop(part, "clump_shape", slider=True)
-        sub = col.column(align=True)
-        sub.prop(part, "use_clump_noise")
-        subsub = sub.column()
-        subsub.enabled = part.use_clump_noise
-        subsub.prop(part, "clump_noise_size")
 
         if part.child_type == 'SIMPLE':
-            sub.prop(part, "twist")
-            sub.prop(part, "use_twist_curve")
+            col.prop(part, "twist")
+            col.prop(part, "use_twist_curve")
             if part.use_twist_curve:
-                sub.template_curve_mapping(part, "twist_curve")
+                col.template_curve_mapping(part, "twist_curve")
+
+
+class PARTICLE_PT_children_clumping_noise(ParticleButtonsPanel, Panel):
+    bl_label = "Clump Noise"
+    bl_parent_id = "PARTICLE_PT_children_clumping"
+    bl_options = {'DEFAULT_CLOSED'}
+    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
+
+    def draw_header(self, context):
+
+        part = particle_get_settings(context)
+
+        self.layout.prop(part, "use_clump_noise", text="")
+
+    def draw(self, context):
+        layout = self.layout
+
+        part = particle_get_settings(context)
+
+        layout.use_property_split = True
+        layout.enabled = part.use_clump_noise
+
+        layout.prop(part, "clump_noise_size")
 
 
 class PARTICLE_PT_children_roughness(ParticleButtonsPanel, Panel):
@@ -2176,6 +2194,7 @@ classes = (
     PARTICLE_PT_children,
     PARTICLE_PT_children_parting,
     PARTICLE_PT_children_clumping,
+    PARTICLE_PT_children_clumping_noise,
     PARTICLE_PT_children_roughness,
     PARTICLE_PT_children_kink,
     PARTICLE_PT_hair_shape,
diff --git a/release/scripts/startup/bl_ui/properties_render.py b/release/scripts/startup/bl_ui/properties_render.py
index 14d67d75e73..8588a0ffbb8 100644
--- a/release/scripts/startup/bl_ui/properties_render.py
+++ b/release/scripts/startup/bl_ui/properties_render.py
@@ -495,17 +495,34 @@ class RENDER_PT_eevee_film(RenderButtonsPanel, Panel):
         props = scene.eevee
         rd = scene.render
 
-        split = layout.split()
-        split.prop(props, "use_overscan")
-        row = split.row()
-        row.active = props.use_overscan
-        row.prop(props, "overscan_size", text="")
-
         col = layout.column()
         col.prop(rd, "filter_size")
         col.prop(rd, "alpha_mode", text="Alpha")
 
 
+class RENDER_PT_eevee_film_overscan(RenderButtonsPanel, Panel):
+    bl_label = "Overscan"
+    bl_parent_id = "RENDER_PT_eevee_film"
+    bl_options = {'DEFAULT_CLOSED'}
+    COMPAT_ENGINES = {'BLENDER_EEVEE'}
+
+    def draw_header(self, context):
+
+        scene = context.scene
+        props = scene.eevee
+
+        self.layout.prop(props, "use_overscan", text="")
+
+    def draw(self, context):
+        layout = self.layout
+        layout.use_property_split = True
+        scene = context.scene
+        props = scene.eevee
+
+        layout.active = props.use_overscan
+        layout.prop(props, "overscan_size", text="Size")
+
+
 class RENDER_PT_eevee_hair(RenderButtonsPanel, Panel):
     bl_label = "Hair"
     bl_options = {'DEFAULT_CLOSED'}
@@ -688,6 +705,7 @@ classes = (
     RENDER_PT_eevee_indirect_lighting,
     RENDER_PT_eevee_indirect_lighting_display,
     RENDER_PT_eevee_film,
+    RENDER_PT_eevee_film_overscan,
     RENDER_PT_opengl_lighting,
     RENDER_PT_opengl_color,
     RENDER_PT_opengl_options,



More information about the Bf-blender-cvs mailing list