remove narrow ui feature
- re-arranged UI in a way that gave far too much vert scrolling. - was added all over for simple things like making text="", layout engine should handle this. - Ton and Brecht are ok with removing this now. Ton would like to work on the layout engine to make it better support these cases.
This commit is contained in:
@@ -20,8 +20,6 @@
|
||||
import bpy
|
||||
from rna_prop_ui import PropertyPanel
|
||||
|
||||
narrowui = bpy.context.user_preferences.view.properties_width_check
|
||||
|
||||
|
||||
class LAMP_MT_sunsky_presets(bpy.types.Menu):
|
||||
bl_label = "Sun & Sky Presets"
|
||||
@@ -65,21 +63,14 @@ class DATA_PT_context_lamp(DataButtonsPanel, bpy.types.Panel):
|
||||
ob = context.object
|
||||
lamp = context.lamp
|
||||
space = context.space_data
|
||||
wide_ui = context.region.width > narrowui
|
||||
|
||||
if wide_ui:
|
||||
split = layout.split(percentage=0.65)
|
||||
if ob:
|
||||
split.template_ID(ob, "data")
|
||||
split.separator()
|
||||
elif lamp:
|
||||
split.template_ID(space, "pin_id")
|
||||
split.separator()
|
||||
else:
|
||||
if ob:
|
||||
layout.template_ID(ob, "data")
|
||||
elif lamp:
|
||||
layout.template_ID(space, "pin_id")
|
||||
split = layout.split(percentage=0.65)
|
||||
if ob:
|
||||
split.template_ID(ob, "data")
|
||||
split.separator()
|
||||
elif lamp:
|
||||
split.template_ID(space, "pin_id")
|
||||
split.separator()
|
||||
|
||||
|
||||
class DATA_PT_custom_props_lamp(DataButtonsPanel, PropertyPanel, bpy.types.Panel):
|
||||
@@ -105,12 +96,8 @@ class DATA_PT_lamp(DataButtonsPanel, bpy.types.Panel):
|
||||
layout = self.layout
|
||||
|
||||
lamp = context.lamp
|
||||
wide_ui = context.region.width > narrowui
|
||||
|
||||
if wide_ui:
|
||||
layout.prop(lamp, "type", expand=True)
|
||||
else:
|
||||
layout.prop(lamp, "type", text="")
|
||||
layout.prop(lamp, "type", expand=True)
|
||||
|
||||
split = layout.split()
|
||||
|
||||
@@ -136,8 +123,7 @@ class DATA_PT_lamp(DataButtonsPanel, bpy.types.Panel):
|
||||
col.prop(lamp, "distance")
|
||||
col.prop(lamp, "gamma")
|
||||
|
||||
if wide_ui:
|
||||
col = split.column()
|
||||
col = split.column()
|
||||
col.prop(lamp, "negative")
|
||||
col.prop(lamp, "layer", text="This Layer Only")
|
||||
col.prop(lamp, "specular")
|
||||
@@ -158,7 +144,6 @@ class DATA_PT_sunsky(DataButtonsPanel, bpy.types.Panel):
|
||||
layout = self.layout
|
||||
|
||||
lamp = context.lamp.sky
|
||||
wide_ui = context.region.width > narrowui
|
||||
|
||||
row = layout.row(align=True)
|
||||
row.prop(lamp, "use_sky")
|
||||
@@ -183,8 +168,7 @@ class DATA_PT_sunsky(DataButtonsPanel, bpy.types.Panel):
|
||||
sub.row().prop(lamp, "sky_color_space", expand=True)
|
||||
sub.prop(lamp, "sky_exposure", text="Exposure")
|
||||
|
||||
if wide_ui:
|
||||
col = split.column()
|
||||
col = split.column()
|
||||
col.active = lamp.use_sky
|
||||
col.label(text="Horizon:")
|
||||
sub = col.column()
|
||||
@@ -209,8 +193,7 @@ class DATA_PT_sunsky(DataButtonsPanel, bpy.types.Panel):
|
||||
col.prop(lamp, "sun_intensity", text="Sun")
|
||||
col.prop(lamp, "atmosphere_distance_factor", text="Distance")
|
||||
|
||||
if wide_ui:
|
||||
col = split.column()
|
||||
col = split.column()
|
||||
col.active = lamp.use_atmosphere
|
||||
col.label(text="Scattering:")
|
||||
sub = col.column(align=True)
|
||||
@@ -232,29 +215,8 @@ class DATA_PT_shadow(DataButtonsPanel, bpy.types.Panel):
|
||||
layout = self.layout
|
||||
|
||||
lamp = context.lamp
|
||||
wide_ui = context.region.width > narrowui
|
||||
|
||||
if wide_ui:
|
||||
layout.prop(lamp, "shadow_method", expand=True)
|
||||
else:
|
||||
layout.prop(lamp, "shadow_method", text="")
|
||||
|
||||
if lamp.shadow_method == 'NOSHADOW' and lamp.type == 'AREA':
|
||||
split = layout.split()
|
||||
|
||||
col= split.column()
|
||||
col.label(text="Form factor sampling:")
|
||||
|
||||
if wide_ui:
|
||||
sub=col.row(align=True)
|
||||
else:
|
||||
sub=col.column(align=True)
|
||||
|
||||
if lamp.shape == 'SQUARE':
|
||||
sub.prop(lamp, "shadow_ray_samples_x", text="Samples")
|
||||
elif lamp.shape == 'RECTANGLE':
|
||||
sub.prop(lamp, "shadow_ray_samples_x", text="Samples X")
|
||||
sub.prop(lamp, "shadow_ray_samples_y", text="Samples Y")
|
||||
layout.prop(lamp, "shadow_method", expand=True)
|
||||
|
||||
if lamp.shadow_method != 'NOSHADOW':
|
||||
split = layout.split()
|
||||
@@ -262,65 +224,55 @@ class DATA_PT_shadow(DataButtonsPanel, bpy.types.Panel):
|
||||
col = split.column()
|
||||
col.prop(lamp, "shadow_color", text="")
|
||||
|
||||
if wide_ui:
|
||||
col = split.column()
|
||||
col = split.column()
|
||||
col.prop(lamp, "shadow_layer", text="This Layer Only")
|
||||
col.prop(lamp, "only_shadow")
|
||||
|
||||
if lamp.shadow_method == 'RAY_SHADOW':
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col = layout.column()
|
||||
col.label(text="Sampling:")
|
||||
|
||||
col.row().prop(lamp, "shadow_ray_sampling_method", expand=True)
|
||||
|
||||
if lamp.type in ('POINT', 'SUN', 'SPOT'):
|
||||
if wide_ui:
|
||||
sub=col.row()
|
||||
else:
|
||||
sub=col.column()
|
||||
|
||||
sub.prop(lamp, "shadow_ray_samples", text="Samples")
|
||||
sub.prop(lamp, "shadow_soft_size", text="Soft Size")
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.prop(lamp, "shadow_soft_size", text="Soft Size")
|
||||
|
||||
col.prop(lamp, "shadow_ray_samples", text="Samples")
|
||||
if lamp.shadow_ray_sampling_method == 'ADAPTIVE_QMC':
|
||||
col.prop(lamp, "shadow_adaptive_threshold", text="Threshold")
|
||||
|
||||
col = split.column()
|
||||
|
||||
elif lamp.type == 'AREA':
|
||||
if wide_ui:
|
||||
sub=col.row(align=True)
|
||||
else:
|
||||
sub=col.column(align=True)
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
|
||||
if lamp.shape == 'SQUARE':
|
||||
sub.prop(lamp, "shadow_ray_samples_x", text="Samples")
|
||||
col.prop(lamp, "shadow_ray_samples_x", text="Samples")
|
||||
elif lamp.shape == 'RECTANGLE':
|
||||
sub.prop(lamp, "shadow_ray_samples_x", text="Samples X")
|
||||
sub.prop(lamp, "shadow_ray_samples_y", text="Samples Y")
|
||||
col.prop(lamp, "shadow_ray_samples_x", text="Samples X")
|
||||
col.prop(lamp, "shadow_ray_samples_y", text="Samples Y")
|
||||
|
||||
if wide_ui:
|
||||
col.row().prop(lamp, "shadow_ray_sampling_method", expand=True)
|
||||
else:
|
||||
col.prop(lamp, "shadow_ray_sampling_method", text="")
|
||||
|
||||
split = layout.split()
|
||||
col = split.column()
|
||||
|
||||
if lamp.shadow_ray_sampling_method == 'ADAPTIVE_QMC':
|
||||
col.prop(lamp, "shadow_adaptive_threshold", text="Threshold")
|
||||
if wide_ui:
|
||||
if lamp.shadow_ray_sampling_method == 'ADAPTIVE_QMC':
|
||||
col.prop(lamp, "shadow_adaptive_threshold", text="Threshold")
|
||||
col = split.column()
|
||||
|
||||
if lamp.type == 'AREA' and lamp.shadow_ray_sampling_method == 'CONSTANT_JITTERED':
|
||||
col = split.column()
|
||||
col = split.column()
|
||||
col.prop(lamp, "umbra")
|
||||
col.prop(lamp, "dither")
|
||||
col.prop(lamp, "jitter")
|
||||
|
||||
elif lamp.shadow_ray_sampling_method == 'CONSTANT_JITTERED':
|
||||
col = split.column()
|
||||
col.prop(lamp, "umbra")
|
||||
col.prop(lamp, "dither")
|
||||
col.prop(lamp, "jitter")
|
||||
else:
|
||||
col = split.column()
|
||||
|
||||
|
||||
elif lamp.shadow_method == 'BUFFER_SHADOW':
|
||||
col = layout.column()
|
||||
col.label(text="Buffer Type:")
|
||||
if wide_ui:
|
||||
col.row().prop(lamp, "shadow_buffer_type", expand=True)
|
||||
else:
|
||||
col.row().prop(lamp, "shadow_buffer_type", text="")
|
||||
col.row().prop(lamp, "shadow_buffer_type", expand=True)
|
||||
|
||||
if lamp.shadow_buffer_type in ('REGULAR', 'HALFWAY', 'DEEP'):
|
||||
split = layout.split()
|
||||
@@ -332,8 +284,7 @@ class DATA_PT_shadow(DataButtonsPanel, bpy.types.Panel):
|
||||
sub.prop(lamp, "shadow_buffer_soft", text="Soft")
|
||||
sub.prop(lamp, "shadow_buffer_bias", text="Bias")
|
||||
|
||||
if wide_ui:
|
||||
col = split.column()
|
||||
col = split.column()
|
||||
col.label(text="Sample Buffers:")
|
||||
col.prop(lamp, "shadow_sample_buffers", text="")
|
||||
sub = col.column(align=True)
|
||||
@@ -353,8 +304,7 @@ class DATA_PT_shadow(DataButtonsPanel, bpy.types.Panel):
|
||||
sub.active = not lamp.auto_clip_start
|
||||
sub.prop(lamp, "shadow_buffer_clip_start", text="Clip Start")
|
||||
|
||||
if wide_ui:
|
||||
col = split.column()
|
||||
col = split.column()
|
||||
col.prop(lamp, "auto_clip_end", text="Autoclip End")
|
||||
sub = col.column()
|
||||
sub.active = not lamp.auto_clip_end
|
||||
@@ -372,21 +322,16 @@ class DATA_PT_area(DataButtonsPanel, bpy.types.Panel):
|
||||
return (lamp and lamp.type == 'AREA') and (engine in __class__.COMPAT_ENGINES)
|
||||
|
||||
def draw(self, context):
|
||||
lamp = context.lamp
|
||||
wide_ui = context.region.width > narrowui
|
||||
|
||||
layout = self.layout
|
||||
|
||||
lamp = context.lamp
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
|
||||
if wide_ui:
|
||||
col.row().prop(lamp, "shape", expand=True)
|
||||
sub = col.row(align=True)
|
||||
else:
|
||||
col.prop(lamp, "shape", text="")
|
||||
sub = col.column(align=True)
|
||||
col.row().prop(lamp, "shape", expand=True)
|
||||
|
||||
sub = col.column(align=True)
|
||||
if (lamp.shape == 'SQUARE'):
|
||||
sub.prop(lamp, "size")
|
||||
elif (lamp.shape == 'RECTANGLE'):
|
||||
@@ -408,7 +353,6 @@ class DATA_PT_spot(DataButtonsPanel, bpy.types.Panel):
|
||||
layout = self.layout
|
||||
|
||||
lamp = context.lamp
|
||||
wide_ui = context.region.width > narrowui
|
||||
|
||||
split = layout.split()
|
||||
|
||||
@@ -419,10 +363,8 @@ class DATA_PT_spot(DataButtonsPanel, bpy.types.Panel):
|
||||
col.prop(lamp, "square")
|
||||
col.prop(lamp, "show_cone")
|
||||
|
||||
if wide_ui:
|
||||
col = split.column()
|
||||
else:
|
||||
col.separator()
|
||||
col = split.column()
|
||||
|
||||
col.prop(lamp, "halo")
|
||||
sub = col.column(align=True)
|
||||
sub.active = lamp.halo
|
||||
|
Reference in New Issue
Block a user