diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-05-14 17:25:15 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-05-14 17:25:15 +0300 |
commit | 51325025ec6d48fa878f2d6e312cfed72661fb3c (patch) | |
tree | 59f2ac9fa404a4fd2cd7b00be5f174a33317ca79 /intern/cycles/blender/addon/ui.py | |
parent | 67dd6243f2c0a0780721f9fecd63f2526b18b87f (diff) | |
parent | 0a60c7d8eebeda18a66229cf5f4de0f37d2522d2 (diff) |
Merge branch 'master' into gooseberry
Conflicts:
build_files/scons/tools/Blender.py
source/blender/blenkernel/intern/mesh.c
source/blender/blenkernel/intern/object.c
source/blender/blenkernel/intern/particle_system.c
source/blender/editors/interface/interface_handlers.c
Diffstat (limited to 'intern/cycles/blender/addon/ui.py')
-rw-r--r-- | intern/cycles/blender/addon/ui.py | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/intern/cycles/blender/addon/ui.py b/intern/cycles/blender/addon/ui.py index 5147a10215e..2f729307e2f 100644 --- a/intern/cycles/blender/addon/ui.py +++ b/intern/cycles/blender/addon/ui.py @@ -55,8 +55,15 @@ def use_cpu(context): return (device_type == 'NONE' or cscene.device == 'CPU') +def use_branched_path(context): + cscene = context.scene.cycles + device_type = context.user_preferences.system.compute_device_type + + return (cscene.progressive == 'BRANCHED_PATH' and device_type != 'OPENCL') + -def draw_samples_info(layout, cscene): +def draw_samples_info(layout, context): + cscene = context.scene.cycles integrator = cscene.progressive # Calculate sample values @@ -86,7 +93,7 @@ def draw_samples_info(layout, cscene): # Draw interface # Do not draw for progressive, when Square Samples are disabled - if (integrator == 'BRANCHED_PATH') or (cscene.use_square_samples and integrator == 'PATH'): + if use_branched_path(context) or (cscene.use_square_samples and integrator == 'PATH'): col = layout.column(align=True) col.scale_y = 0.6 col.label("Total Samples:") @@ -110,6 +117,7 @@ class CyclesRender_PT_sampling(CyclesButtonsPanel, Panel): scene = context.scene cscene = scene.cycles + device_type = context.user_preferences.system.compute_device_type row = layout.row(align=True) row.menu("CYCLES_MT_sampling_presets", text=bpy.types.CYCLES_MT_sampling_presets.bl_label) @@ -117,7 +125,9 @@ class CyclesRender_PT_sampling(CyclesButtonsPanel, Panel): row.operator("render.cycles_sampling_preset_add", text="", icon="ZOOMOUT").remove_active = True row = layout.row() - row.prop(cscene, "progressive", text="") + sub = row.row() + sub.active = device_type != 'OPENCL' + sub.prop(cscene, "progressive", text="") row.prop(cscene, "use_square_samples") split = layout.split() @@ -129,7 +139,7 @@ class CyclesRender_PT_sampling(CyclesButtonsPanel, Panel): sub.prop(cscene, "sample_clamp_direct") sub.prop(cscene, "sample_clamp_indirect") - if cscene.progressive == 'PATH': + if cscene.progressive == 'PATH' or use_branched_path(context) == False: col = split.column() sub = col.column(align=True) sub.label(text="Samples:") @@ -163,7 +173,7 @@ class CyclesRender_PT_sampling(CyclesButtonsPanel, Panel): layout.row().prop(cscene, "use_layer_samples") break - draw_samples_info(layout, cscene) + draw_samples_info(layout, context) class CyclesRender_PT_volume_sampling(CyclesButtonsPanel, Panel): @@ -797,7 +807,7 @@ class CyclesLamp_PT_lamp(CyclesButtonsPanel, Panel): if not (lamp.type == 'AREA' and clamp.is_portal): sub = col.column(align=True) - if cscene.progressive == 'BRANCHED_PATH': + if use_branched_path(context): sub.prop(clamp, "samples") sub.prop(clamp, "max_bounces") @@ -1006,7 +1016,7 @@ class CyclesWorld_PT_settings(CyclesButtonsPanel, Panel): sub = col.column(align=True) sub.active = cworld.sample_as_light sub.prop(cworld, "sample_map_resolution") - if cscene.progressive == 'BRANCHED_PATH': + if use_branched_path(context): sub.prop(cworld, "samples") col = split.column() @@ -1108,7 +1118,7 @@ class CyclesMaterial_PT_settings(CyclesButtonsPanel, Panel): sub = col.column() sub.active = use_cpu(context) sub.prop(cmat, "volume_sampling", text="") - col.prop(cmat, "volume_interpolation", text="") + sub.prop(cmat, "volume_interpolation", text="") col.prop(cmat, "homogeneous_volume", text="Homogeneous") layout.separator() |