[Bf-blender-cvs] [d09a46c2ac3] blender2.8: UI: tweak and fixes for cycles sampling panel, remove unneeded decorators.
Brecht Van Lommel
noreply at git.blender.org
Tue Oct 16 17:15:07 CEST 2018
Commit: d09a46c2ac3d4ca3e5130fbdc41c7b97fe3b48ad
Author: Brecht Van Lommel
Date: Tue Oct 16 17:11:37 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBd09a46c2ac3d4ca3e5130fbdc41c7b97fe3b48ad
UI: tweak and fixes for cycles sampling panel, remove unneeded decorators.
===================================================================
M intern/cycles/blender/addon/ui.py
===================================================================
diff --git a/intern/cycles/blender/addon/ui.py b/intern/cycles/blender/addon/ui.py
index b59045cb94a..2b8702bd5ba 100644
--- a/intern/cycles/blender/addon/ui.py
+++ b/intern/cycles/blender/addon/ui.py
@@ -155,6 +155,7 @@ class CYCLES_RENDER_PT_sampling(CyclesButtonsPanel, Panel):
cscene = scene.cycles
layout.use_property_split = True
+ layout.use_property_decorate = False
layout.prop(cscene, "progressive")
@@ -162,51 +163,54 @@ class CYCLES_RENDER_PT_sampling(CyclesButtonsPanel, Panel):
col = layout.column(align=True)
col.prop(cscene, "samples", text="Render")
col.prop(cscene, "preview_samples", text="Viewport")
- col.separator()
- col.prop(cscene, "use_square_samples") # Duplicate below.
+ draw_samples_info(layout, context)
+ else:
+ col = layout.column(align=True)
+ col.prop(cscene, "aa_samples", text="Render")
+ col.prop(cscene, "preview_aa_samples", text="Viewport")
-class CYCLES_RENDER_PT_sampling_aa_samples(CyclesButtonsPanel, Panel):
- bl_label = "AA Samples"
- bl_parent_id = "CYCLES_RENDER_PT_sampling"
- @classmethod
- def poll(self, context):
- scene = context.scene
- cscene = scene.cycles
- if cscene.progressive == 'PATH' or use_branched_path(context) is False:
- return False
- else:
- return True
+class CYCLES_RENDER_PT_sampling_light(CyclesButtonsPanel, Panel):
+ bl_label = "Light"
+ bl_parent_id = "CYCLES_RENDER_PT_sampling"
+ bl_options = {'DEFAULT_CLOSED'}
def draw(self, context):
layout = self.layout
layout.use_property_split = True
+ layout.use_property_decorate = False
scene = context.scene
cscene = scene.cycles
col = layout.column(align=True)
- col.prop(cscene, "aa_samples", text="Render")
- col.prop(cscene, "preview_aa_samples", text="Preview")
+ col.prop(cscene, "light_sampling_threshold", text="Light Threshold")
+
+ if cscene.progressive != 'PATH' and use_branched_path(context):
+ 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, "sample_clamp_direct")
+ col.prop(cscene, "sample_clamp_indirect")
-class CYCLES_RENDER_PT_sampling_samples(CyclesButtonsPanel, Panel):
- bl_label = "Samples"
+class CYCLES_RENDER_PT_sampling_sub_samples(CyclesButtonsPanel, Panel):
+ bl_label = "Sub Samples"
bl_parent_id = "CYCLES_RENDER_PT_sampling"
@classmethod
def poll(self, context):
scene = context.scene
cscene = scene.cycles
- if cscene.progressive == 'PATH' or use_branched_path(context) is False:
- return False
- else:
- return True
+ return cscene.progressive != 'PATH' and use_branched_path(context)
def draw(self, context):
layout = self.layout
layout.use_property_split = True
+ layout.use_property_decorate = False
scene = context.scene
cscene = scene.cycles
@@ -222,12 +226,22 @@ class CYCLES_RENDER_PT_sampling_samples(CyclesButtonsPanel, Panel):
sub.prop(cscene, "mesh_light_samples", text="Mesh Light")
col.prop(cscene, "subsurface_samples", text="Subsurface")
col.prop(cscene, "volume_samples", text="Volume")
- col.separator()
- 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")
+ draw_samples_info(layout, context)
+
+
+class CYCLES_RENDER_PT_sampling_advanced(CyclesButtonsPanel, Panel):
+ bl_label = "Advanced"
+ bl_parent_id = "CYCLES_RENDER_PT_sampling"
+ bl_options = {'DEFAULT_CLOSED'}
+
+ def draw(self, context):
+ layout = self.layout
+ layout.use_property_split = True
+ layout.use_property_decorate = False
+
+ scene = context.scene
+ cscene = scene.cycles
row = layout.row(align=True)
row.prop(cscene, "seed")
@@ -235,27 +249,63 @@ class CYCLES_RENDER_PT_sampling_samples(CyclesButtonsPanel, Panel):
layout.prop(cscene, "sampling_pattern", text="Pattern")
+ layout.prop(cscene, "use_square_samples")
-class CYCLES_RENDER_PT_sampling_light(CyclesButtonsPanel, Panel):
- bl_label = "Light"
- bl_parent_id = "CYCLES_RENDER_PT_sampling"
- bl_options = {'DEFAULT_CLOSED'}
- def draw(self, context):
- layout = self.layout
- layout.use_property_split = True
+class CYCLES_RENDER_PT_sampling_total(CyclesButtonsPanel, Panel):
+ bl_label = "Total Samples"
+ bl_parent_id = "CYCLES_RENDER_PT_sampling"
+ @classmethod
+ def poll(self, context):
scene = context.scene
cscene = scene.cycles
- col = layout.column(align=True)
- col.prop(cscene, "light_sampling_threshold", text="Light Threshold")
+ if cscene.use_square_samples:
+ return True
- col = layout.column(align=True)
- col.prop(cscene, "sample_clamp_direct")
- col.prop(cscene, "sample_clamp_indirect")
+ return cscene.progressive != 'PATH' and use_branched_path(context)
- draw_samples_info(layout, context)
+ def draw(self, context):
+ layout = self.layout
+ cscene = context.scene.cycles
+ integrator = cscene.progressive
+
+ # Calculate sample values
+ if integrator == 'PATH':
+ aa = cscene.samples
+ if cscene.use_square_samples:
+ aa = aa * aa
+ else:
+ aa = cscene.aa_samples
+ d = cscene.diffuse_samples
+ g = cscene.glossy_samples
+ t = cscene.transmission_samples
+ ao = cscene.ao_samples
+ ml = cscene.mesh_light_samples
+ sss = cscene.subsurface_samples
+ vol = cscene.volume_samples
+
+ if cscene.use_square_samples:
+ aa = aa * aa
+ d = d * d
+ g = g * g
+ t = t * t
+ ao = ao * ao
+ ml = ml * ml
+ sss = sss * sss
+ vol = vol * vol
+
+ col = layout.column(align=True)
+ col.scale_y = 0.6
+ if integrator == 'PATH':
+ col.label(text="%s AA" % aa)
+ else:
+ col.label(text="%s AA, %s Diffuse, %s Glossy, %s Transmission" %
+ (aa, d * aa, g * aa, t * aa))
+ col.separator()
+ col.label(text="%s AO, %s Mesh Light, %s Subsurface, %s Volume" %
+ (ao * aa, ml * aa, sss * aa, vol * aa))
class CYCLES_RENDER_PT_geometry(CyclesButtonsPanel, Panel):
@@ -277,6 +327,7 @@ class CYCLES_RENDER_PT_geometry_subdivision(CyclesButtonsPanel, Panel):
def draw(self, context):
layout = self.layout
layout.use_property_split = True
+ layout.use_property_decorate = False
scene = context.scene
cscene = scene.cycles
@@ -301,6 +352,7 @@ class CYCLES_RENDER_PT_geometry_volume(CyclesButtonsPanel, Panel):
def draw(self, context):
layout = self.layout
layout.use_property_split = True
+ layout.use_property_decorate = False
scene = context.scene
cscene = scene.cycles
@@ -314,7 +366,6 @@ class CYCLES_RENDER_PT_geometry_volume(CyclesButtonsPanel, Panel):
class CYCLES_RENDER_PT_geometry_hair(CyclesButtonsPanel, Panel):
bl_label = "Hair"
bl_parent_id = "CYCLES_RENDER_PT_geometry"
- bl_options = {'DEFAULT_CLOSED'}
def draw_header(self, context):
layout = self.layout
@@ -327,6 +378,7 @@ class CYCLES_RENDER_PT_geometry_hair(CyclesButtonsPanel, Panel):
def draw(self, context):
layout = self.layout
layout.use_property_split = True
+ layout.use_property_decorate = False
scene = context.scene
cscene = scene.cycles
@@ -366,6 +418,7 @@ class CYCLES_RENDER_PT_light_paths_max_bounces(CyclesButtonsPanel, Panel):
def draw(self, context):
layout = self.layout
layout.use_property_split = True
+ layout.use_property_decorate = False
scene = context.scene
cscene = scene.cycles
@@ -389,6 +442,7 @@ class CYCLES_RENDER_PT_light_paths_caustics(CyclesButtonsPanel, Panel):
def draw(self, context):
layout = self.layout
layout.use_property_split = True
+ layout.use_property_decorate = False
scene = context.scene
cscene = scene.cycles
@@ -411,6 +465,7 @@ class CYCLES_RENDER_PT_motion_blur(CyclesButtonsPanel, Panel):
def draw(self, context):
layout = self.layout
layout.use_property_split = True
+ layout.use_property_decorate = False
scene = context.scene
cscene = scene.cycles
@@ -435,6 +490,7 @@ class CYCLES_RENDER_PT_motion_blur_curve(CyclesButtonsPanel, Panel):
def draw(self, context):
layout = self.layout
layout.use_property_split = True
+ layout.use_property_decorate = False
scene = context.scene
cscene = scene.cycles
@@ -462,6 +518,7 @@ class CYCLES_RENDER_PT_film(CyclesButtonsPanel, Panel):
def draw(self, context):
layout = self.layout
layout.use_property_split = True
+ layout.use_property_decorate = False
scene = context.scene
cscene = scene.cycles
@@ -485,6 +542,7 @@ class CYCLES_RENDER_PT_film_transparency(CyclesButtonsPanel, Panel):
def draw(self, context):
layout = self.layout
layout.use_property_split = True
+ layout.use_property_decorate = False
scene = context.scene
cscene = scene.cycles
@@ -506,6 +564,7 @@ class CYCLES_RENDER_PT_film_pixel_filter(CyclesButtonsPanel, Panel):
def draw(self, context):
layout = self.layout
layout.use_property_split = True
+ layout.use_property_decorate = False
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list