diff options
Diffstat (limited to 'release/ui/buttons_data_lamp.py')
-rw-r--r-- | release/ui/buttons_data_lamp.py | 151 |
1 files changed, 70 insertions, 81 deletions
diff --git a/release/ui/buttons_data_lamp.py b/release/ui/buttons_data_lamp.py index d7ade3ecccf..da2701a43f2 100644 --- a/release/ui/buttons_data_lamp.py +++ b/release/ui/buttons_data_lamp.py @@ -21,26 +21,23 @@ class DATA_PT_lamp(DataButtonsPanel): if not lamp: return - layout.row() - layout.itemR(lamp, "type", expand=True) + row = layout.row() + row.itemR(lamp, "type", expand=True) - layout.split(number=2) + split = layout.split() - sub = layout.sub(0) - sub.column() + sub = split.column() sub.itemR(lamp, "energy") sub.itemR(lamp, "distance") sub.itemR(lamp, "negative") sub.itemR(lamp, "color") - sub = layout.sub(1) - sub.column() + sub = split.column() sub.itemR(lamp, "layer", text="This Layer Only") sub.itemR(lamp, "specular") sub.itemR(lamp, "diffuse") - if (lamp.type in ('POINT', 'SPOT')): - sub.column() + if lamp.type in ('POINT', 'SPOT'): sub.itemR(lamp, "falloff_type") sub.itemR(lamp, "sphere") @@ -48,7 +45,7 @@ class DATA_PT_lamp(DataButtonsPanel): sub.itemR(lamp, "linear_attenuation") sub.itemR(lamp, "quadratic_attenuation") - if (lamp.type == 'AREA'): + if lamp.type == 'AREA': sub.column() sub.itemR(lamp, "gamma") sub.itemR(lamp, "shape") @@ -74,33 +71,31 @@ class DATA_PT_sunsky(DataButtonsPanel): if not lamp: return - layout.row() - layout.itemR(lamp, "sky") - layout.itemR(lamp, "atmosphere") + row = layout.row() + row.itemR(lamp, "sky") + row.itemR(lamp, "atmosphere") - if (lamp.sky or lamp.atmosphere): - layout.row() + if lamp.sky or lamp.atmosphere: layout.itemR(lamp, "atmosphere_turbidity", text="Turbidity") - layout.split(number=2) + split = layout.split() - if (lamp.sky): - sub = layout.sub(0) - sub.column() + col = split.column() + if lamp.sky: + sub = col.column() sub.itemR(lamp, "sky_blend_type", text="Blend Type") sub.itemR(lamp, "sky_blend") sub.itemR(lamp, "sky_color_space", text="Color Space") sub.itemR(lamp, "sky_exposure") - sub.column() + sub = col.column() sub.itemR(lamp, "horizon_brightness", text="Hor Bright") sub.itemR(lamp, "spread", text="Hor Spread") sub.itemR(lamp, "sun_brightness", text="Sun Bright") sub.itemR(lamp, "sun_size") sub.itemR(lamp, "backscattered_light", text="Back Light") - if (lamp.atmosphere): - sub = layout.sub(1) - sub.column() + sub = split.column() + if lamp.atmosphere: sub.itemR(lamp, "sun_intensity", text="Sun Intens") sub.itemR(lamp, "atmosphere_inscattering", text="Inscattering") sub.itemR(lamp, "atmosphere_extinction", text="Extinction") @@ -122,75 +117,71 @@ class DATA_PT_shadow(DataButtonsPanel): if not lamp: return - layout.row() layout.itemR(lamp, "shadow_method", expand=True) - if (lamp.shadow_method in ('BUFFER_SHADOW', 'RAY_SHADOW')): + if lamp.shadow_method in ('BUFFER_SHADOW', 'RAY_SHADOW'): - layout.split(number=2) + split = layout.split() - sub = layout.sub(0) - sub.column() - sub.itemL(text="Options:") + sub = split.column() sub.itemR(lamp, "only_shadow") sub.itemR(lamp, "shadow_layer") - sub = layout.sub(1) - sub.column() + sub = split.column() sub.itemR(lamp, "shadow_color") - if (lamp.shadow_method == 'RAY_SHADOW'): + if lamp.shadow_method == 'RAY_SHADOW': - layout.column() - layout.itemL(text="Sampling:") - layout.itemR(lamp, "shadow_ray_sampling_method", expand=True) + col = layout.column() + col.itemL(text="Sampling:") + col.row().itemR(lamp, "shadow_ray_sampling_method", expand=True) - if (lamp.type in ('POINT', 'SUN', 'SPOT') and lamp.shadow_ray_sampling_method in ('CONSTANT_QMC', 'ADAPTIVE_QMC')): - layout.column_flow() - layout.itemR(lamp, "shadow_soft_size", text="Soft Size") - layout.itemR(lamp, "shadow_ray_samples", text="Samples") - if (lamp.shadow_ray_sampling_method == 'ADAPTIVE_QMC'): - layout.itemR(lamp, "shadow_adaptive_threshold", text="Threshold") + if lamp.type in ('POINT', 'SUN', 'SPOT') and lamp.shadow_ray_sampling_method in ('CONSTANT_QMC', 'ADAPTIVE_QMC'): + flow = layout.column_flow() + flow.itemR(lamp, "shadow_soft_size", text="Soft Size") + flow.itemR(lamp, "shadow_ray_samples", text="Samples") + if lamp.shadow_ray_sampling_method == 'ADAPTIVE_QMC': + flow.itemR(lamp, "shadow_adaptive_threshold", text="Threshold") - if (lamp.type == 'AREA'): - layout.column_flow() - layout.itemR(lamp, "shadow_ray_samples_x", text="Samples") - if (lamp.shadow_ray_sampling_method == 'ADAPTIVE_QMC'): - layout.itemR(lamp, "shadow_adaptive_threshold", text="Threshold") - if (lamp.shadow_ray_sampling_method == 'CONSTANT_JITTERED'): - layout.itemR(lamp, "umbra") - layout.itemR(lamp, "dither") - layout.itemR(lamp, "jitter") - - if (lamp.shadow_method == 'BUFFER_SHADOW'): - layout.column() - layout.itemL(text="Buffer Type:") - layout.itemR(lamp, "shadow_buffer_type", expand=True) + if lamp.type == 'AREA': + flow = layout.column_flow() + flow.itemR(lamp, "shadow_ray_samples_x", text="Samples") + if lamp.shadow_ray_sampling_method == 'ADAPTIVE_QMC': + flow.itemR(lamp, "shadow_adaptive_threshold", text="Threshold") + if lamp.shadow_ray_sampling_method == 'CONSTANT_JITTERED': + flow.itemR(lamp, "umbra") + flow.itemR(lamp, "dither") + flow.itemR(lamp, "jitter") + + if lamp.shadow_method == 'BUFFER_SHADOW': + col = layout.column() + col.itemL(text="Buffer Type:") + col.row().itemR(lamp, "shadow_buffer_type", expand=True) - if (lamp.shadow_buffer_type in ('REGULAR', 'HALFWAY')): - layout.column_flow() - layout.itemL(text="Sample Buffers:") - layout.itemR(lamp, "shadow_sample_buffers", expand=True) - layout.itemL(text="Filter Type:") - layout.itemR(lamp, "shadow_filter_type", expand=True) - layout.column_flow() - layout.itemR(lamp, "shadow_buffer_size", text="Size") - layout.itemR(lamp, "shadow_buffer_samples", text="Samples") - layout.itemR(lamp, "shadow_buffer_bias", text="Bias") - layout.itemR(lamp, "shadow_buffer_soft", text="Soft") + if lamp.shadow_buffer_type in ('REGULAR', 'HALFWAY'): + flow = layout.column_flow() + flow.itemL(text="Sample Buffers:") + flow.row().itemR(lamp, "shadow_sample_buffers", expand=True) + flow.itemL(text="Filter Type:") + flow.row().itemR(lamp, "shadow_filter_type", expand=True) + flow = layout.column_flow() + flow.itemR(lamp, "shadow_buffer_size", text="Size") + flow.itemR(lamp, "shadow_buffer_samples", text="Samples") + flow.itemR(lamp, "shadow_buffer_bias", text="Bias") + flow.itemR(lamp, "shadow_buffer_soft", text="Soft") if (lamp.shadow_buffer_type == 'IRREGULAR'): - layout.row() - layout.itemR(lamp, "shadow_buffer_bias", text="Bias") + row = layout.row() + row.itemR(lamp, "shadow_buffer_bias", text="Bias") - layout.row() - layout.itemR(lamp, "auto_clip_start", text="Autoclip Start") + row = layout.row() + row.itemR(lamp, "auto_clip_start", text="Autoclip Start") if not (lamp.auto_clip_start): - layout.itemR(lamp, "shadow_buffer_clip_start", text="Clip Start") - layout.row() - layout.itemR(lamp, "auto_clip_end", text="Autoclip End") + row.itemR(lamp, "shadow_buffer_clip_start", text="Clip Start") + row = layout.row() + row.itemR(lamp, "auto_clip_end", text="Autoclip End") if not (lamp.auto_clip_end): - layout.itemR(lamp, "shadow_buffer_clip_end", text=" Clip End") + row.itemR(lamp, "shadow_buffer_clip_end", text=" Clip End") class DATA_PT_spot(DataButtonsPanel): __idname__ = "DATA_PT_spot" @@ -208,20 +199,18 @@ class DATA_PT_spot(DataButtonsPanel): if not lamp: return - layout.split(number=2) + split = layout.split() - sub = layout.sub(0) - sub.column() + sub = split.column() sub.itemR(lamp, "square") sub.itemR(lamp, "spot_size") sub.itemR(lamp, "spot_blend") - sub = layout.sub(1) - sub.column() + sub = split.column() sub.itemR(lamp, "halo") - if (lamp.halo): + if lamp.halo: sub.itemR(lamp, "halo_intensity") - if (lamp.shadow_method == 'BUFFER_SHADOW'): + if lamp.shadow_method == 'BUFFER_SHADOW': sub.itemR(lamp, "halo_step") bpy.types.register(DATA_PT_lamp) |