[Bf-blender-cvs] [85ce4d957ce] blender2.8: UI: use split property layout for some panels
Campbell Barton
noreply at git.blender.org
Wed May 30 18:00:31 CEST 2018
Commit: 85ce4d957cee0de45b620d30af4061253ff8b18f
Author: Campbell Barton
Date: Wed May 30 17:47:48 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB85ce4d957cee0de45b620d30af4061253ff8b18f
UI: use split property layout for some panels
Object, render, scene properties now use split-property layout,
also cycles interface.
Patch by @billreynish w/ minor edits.
===================================================================
M intern/cycles/blender/addon/ui.py
M release/scripts/startup/bl_ui/properties_object.py
M release/scripts/startup/bl_ui/properties_render.py
M release/scripts/startup/bl_ui/properties_scene.py
===================================================================
diff --git a/intern/cycles/blender/addon/ui.py b/intern/cycles/blender/addon/ui.py
index 2900f47c7bd..db59063ade2 100644
--- a/intern/cycles/blender/addon/ui.py
+++ b/intern/cycles/blender/addon/ui.py
@@ -20,10 +20,10 @@ import bpy
from bpy_extras.node_utils import find_node_input, find_output_node
from bpy.types import (
- Panel,
- Menu,
- Operator,
- )
+ Panel,
+ Menu,
+ Operator,
+)
class CYCLES_MT_sampling_presets(Menu):
@@ -86,6 +86,7 @@ def use_sample_all_lights(context):
return cscene.sample_all_lights_direct or cscene.sample_all_lights_indirect
+
def show_device_active(context):
cscene = context.scene.cycles
if cscene.device != 'GPU':
@@ -145,6 +146,7 @@ class CYCLES_RENDER_PT_sampling(CyclesButtonsPanel, Panel):
def draw(self, context):
layout = self.layout
+ layout.use_property_split = False
scene = context.scene
cscene = scene.cycles
@@ -154,56 +156,52 @@ class CYCLES_RENDER_PT_sampling(CyclesButtonsPanel, Panel):
row.operator("render.cycles_sampling_preset_add", text="", icon="ZOOMIN")
row.operator("render.cycles_sampling_preset_add", text="", icon="ZOOMOUT").remove_active = True
- row = layout.row()
- sub = row.row()
- sub.prop(cscene, "progressive", text="")
- row.prop(cscene, "use_square_samples")
-
- split = layout.split()
-
- col = split.column()
- sub = col.column(align=True)
- sub.label("Settings:")
-
- seed_sub = sub.row(align=True)
- seed_sub.prop(cscene, "seed")
- seed_sub.prop(cscene, "use_animated_seed", text="", icon="TIME")
+ layout.use_property_split = True
- sub.prop(cscene, "sample_clamp_direct")
- sub.prop(cscene, "sample_clamp_indirect")
- sub.prop(cscene, "light_sampling_threshold")
+ layout.prop(cscene, "progressive")
if cscene.progressive == 'PATH' or use_branched_path(context) is False:
- col = split.column()
- sub = col.column(align=True)
- sub.label(text="Samples:")
- sub.prop(cscene, "samples", text="Render")
- sub.prop(cscene, "preview_samples", text="Preview")
+ col = layout.column(align=True)
+ col.prop(cscene, "samples", text="Render Samples")
+ col.prop(cscene, "preview_samples", text="Preview Samples")
+ col.prop(cscene, "use_square_samples") # Duplicate below.
else:
- sub.label(text="AA Samples:")
- sub.prop(cscene, "aa_samples", text="Render")
- sub.prop(cscene, "preview_aa_samples", text="Preview")
+ col = layout.column(align=True)
+ col.prop(cscene, "aa_samples", text="Render Samples")
+ col.prop(cscene, "preview_aa_samples", text="Preview Samples")
- col = split.column()
- sub = col.column(align=True)
- sub.label(text="Samples:")
- sub.prop(cscene, "diffuse_samples", text="Diffuse")
- sub.prop(cscene, "glossy_samples", text="Glossy")
- sub.prop(cscene, "transmission_samples", text="Transmission")
- sub.prop(cscene, "ao_samples", text="AO")
+ col = layout.column(align=True)
+ col.prop(cscene, "diffuse_samples", text="Diffuse Samples")
+ col.prop(cscene, "glossy_samples", text="Glossy Samples")
+ col.prop(cscene, "transmission_samples", text="Transmission Samples")
+ col.prop(cscene, "ao_samples", text="AO Samples")
- subsub = sub.row(align=True)
- subsub.active = use_sample_all_lights(context)
- subsub.prop(cscene, "mesh_light_samples", text="Mesh Light")
+ sub = col.row(align=True)
+ sub.active = use_sample_all_lights(context)
+ sub.prop(cscene, "mesh_light_samples", text="Mesh Light Samples")
- sub.prop(cscene, "subsurface_samples", text="Subsurface")
- sub.prop(cscene, "volume_samples", text="Volume")
+ col.prop(cscene, "subsurface_samples", text="Subsurface Samples")
+ col.prop(cscene, "volume_samples", text="Volume Samples")
+
+ col.prop(cscene, "use_square_samples") # Duplicate above.
col = layout.column(align=True)
col.prop(cscene, "sample_all_lights_direct")
col.prop(cscene, "sample_all_lights_indirect")
+ col = layout.column(align=True)
+ col.prop(cscene, "light_sampling_threshold", text="Light Threshold")
+
+ col = layout.column(align=True)
+ col.prop(cscene, "sample_clamp_direct")
+ col.prop(cscene, "sample_clamp_indirect")
+
+ row = layout.row(align=True)
+ row.prop(cscene, "seed")
+ row.prop(cscene, "use_animated_seed", text="", icon="TIME")
+
layout.row().prop(cscene, "sampling_pattern", text="Pattern")
+
draw_samples_info(layout, context)
@@ -213,56 +211,48 @@ class CYCLES_RENDER_PT_geometry(CyclesButtonsPanel, Panel):
def draw(self, context):
layout = self.layout
+ layout.use_property_split = True
scene = context.scene
cscene = scene.cycles
ccscene = scene.cycles_curves
- row = layout.row()
- row.label("Volume Sampling:")
- row = layout.row()
- row.prop(cscene, "volume_step_size")
- row.prop(cscene, "volume_max_steps")
+ col = layout.column(align=True)
+ col.prop(cscene, "volume_step_size", text="Volume Step Size")
+ col.prop(cscene, "volume_max_steps", text="Volume Max Steps")
- layout.separator()
+ col.separator()
if cscene.feature_set == 'EXPERIMENTAL':
- layout.label("Subdivision Rate:")
- split = layout.split()
- col = split.column()
+ col = layout.column()
sub = col.column(align=True)
- sub.prop(cscene, "dicing_rate", text="Render")
- sub.prop(cscene, "preview_dicing_rate", text="Preview")
+ sub.prop(cscene, "dicing_rate", text="Dicing Rate Render")
+ sub.prop(cscene, "preview_dicing_rate", text="Dicing Rate Preview")
- col = split.column()
col.prop(cscene, "offscreen_dicing_scale", text="Offscreen Scale")
col.prop(cscene, "max_subdivisions")
- layout.prop(cscene, "dicing_camera")
+ col.prop(cscene, "dicing_camera")
- layout.separator()
+ col.separator()
- layout.label("Hair:")
- layout.prop(ccscene, "use_curves", text="Use Hair")
+ layout.prop(ccscene, "use_curves", text="Hair Rendering")
col = layout.column()
col.active = ccscene.use_curves
- col.prop(ccscene, "primitive", text="Primitive")
+ col.prop(ccscene, "minimum_width", text="Min Pixels")
+ col.prop(ccscene, "maximum_width", text="Max Extension")
col.prop(ccscene, "shape", text="Shape")
-
if not (ccscene.primitive in {'CURVE_SEGMENTS', 'LINE_SEGMENTS'} and ccscene.shape == 'RIBBONS'):
col.prop(ccscene, "cull_backfacing", text="Cull back-faces")
+ col.prop(ccscene, "primitive", text="Primitive")
if ccscene.primitive == 'TRIANGLES' and ccscene.shape == 'THICK':
col.prop(ccscene, "resolution", text="Resolution")
elif ccscene.primitive == 'CURVE_SEGMENTS':
col.prop(ccscene, "subdivisions", text="Curve subdivisions")
- row = col.row()
- row.prop(ccscene, "minimum_width", text="Min Pixels")
- row.prop(ccscene, "maximum_width", text="Max Extension")
-
class CYCLES_RENDER_PT_light_paths(CyclesButtonsPanel, Panel):
bl_label = "Light Paths"
@@ -270,6 +260,7 @@ class CYCLES_RENDER_PT_light_paths(CyclesButtonsPanel, Panel):
def draw(self, context):
layout = self.layout
+ layout.use_property_split = True
scene = context.scene
cscene = scene.cycles
@@ -279,31 +270,18 @@ class CYCLES_RENDER_PT_light_paths(CyclesButtonsPanel, Panel):
row.operator("render.cycles_integrator_preset_add", text="", icon="ZOOMIN")
row.operator("render.cycles_integrator_preset_add", text="", icon="ZOOMOUT").remove_active = True
- split = layout.split()
-
- col = split.column()
-
- sub = col.column(align=True)
- sub.label("Transparency:")
- sub.prop(cscene, "transparent_max_bounces", text="Max")
-
- col.separator()
+ col = layout.column(align=True)
+ col.prop(cscene, "max_bounces", text="Max Bounces")
+ col.prop(cscene, "transparent_max_bounces", text="Transparency")
+ col.prop(cscene, "diffuse_bounces", text="Diffuse")
+ col.prop(cscene, "glossy_bounces", text="Glossy")
+ col.prop(cscene, "transmission_bounces", text="Transmission")
+ col.prop(cscene, "volume_bounces", text="Volume")
+ col = layout.column()
+ col.prop(cscene, "blur_glossy")
col.prop(cscene, "caustics_reflective")
col.prop(cscene, "caustics_refractive")
- col.prop(cscene, "blur_glossy")
-
- col = split.column()
-
- sub = col.column(align=True)
- sub.label(text="Bounces:")
- sub.prop(cscene, "max_bounces", text="Max")
-
- sub = col.column(align=True)
- sub.prop(cscene, "diffuse_bounces", text="Diffuse")
- sub.prop(cscene, "glossy_bounces", text="Glossy")
- sub.prop(cscene, "transmission_bounces", text="Transmission")
- sub.prop(cscene, "volume_bounces", text="Volume")
class CYCLES_RENDER_PT_motion_blur(CyclesButtonsPanel, Panel):
@@ -317,6 +295,7 @@ class CYCLES_RENDER_PT_motion_blur(CyclesButtonsPanel, Panel):
def draw(self, context):
layout = self.layout
+ layout.use_property_split = True
scene = context.scene
cscene = scene.cycles
@@ -349,31 +328,35 @@ class CYCLES_RENDER_PT_motion_blur(CyclesButtonsPanel, Panel):
class CYCLES_RENDER_PT_film(CyclesButtonsPanel, Panel):
bl_label = "Film"
+ bl_options = {'DEFAULT_CLOSED'}
def draw(self, context):
layout = self.layout
-
+
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list