sunsky presets
* Mountain: low turbidity, well-defined sun, blue-ish (high sun energy) * Desert: high turbidity (dust), big, diluted sun, red-ish * Classic: average turbidity (water vapor), small, diluted sun. also fixed a bug with saving string presets
This commit is contained in:
@@ -23,6 +23,13 @@ from rna_prop_ui import PropertyPanel
|
||||
narrowui = 180
|
||||
|
||||
|
||||
class LAMP_MT_sunsky_presets(bpy.types.Menu):
|
||||
bl_label = "Render Presets"
|
||||
preset_subdir = "sunsky"
|
||||
preset_operator = "script.python_file_run"
|
||||
draw = bpy.types.Menu.draw_preset
|
||||
|
||||
|
||||
class DataButtonsPanel(bpy.types.Panel):
|
||||
bl_space_type = 'PROPERTIES'
|
||||
bl_region_type = 'WINDOW'
|
||||
@@ -129,16 +136,19 @@ class DATA_PT_sunsky(DataButtonsPanel):
|
||||
lamp = context.lamp.sky
|
||||
wide_ui = context.region.width > narrowui
|
||||
|
||||
layout.prop(lamp, "sky")
|
||||
row = layout.row(align=True)
|
||||
row.prop(lamp, "use_sky")
|
||||
row.menu("LAMP_MT_sunsky_presets", text="Presets")
|
||||
row.operator("lamp.sunsky_preset_add", text="Add")
|
||||
|
||||
row = layout.row()
|
||||
row.active = lamp.sky or lamp.atmosphere
|
||||
row.active = lamp.use_sky or lamp.use_atmosphere
|
||||
row.prop(lamp, "atmosphere_turbidity", text="Turbidity")
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.active = lamp.sky
|
||||
col.active = lamp.use_sky
|
||||
col.label(text="Blending:")
|
||||
sub = col.column()
|
||||
sub.prop(lamp, "sky_blend_type", text="")
|
||||
@@ -151,7 +161,7 @@ class DATA_PT_sunsky(DataButtonsPanel):
|
||||
|
||||
if wide_ui:
|
||||
col = split.column()
|
||||
col.active = lamp.sky
|
||||
col.active = lamp.use_sky
|
||||
col.label(text="Horizon:")
|
||||
sub = col.column()
|
||||
sub.prop(lamp, "horizon_brightness", text="Brightness")
|
||||
@@ -165,19 +175,19 @@ class DATA_PT_sunsky(DataButtonsPanel):
|
||||
|
||||
layout.separator()
|
||||
|
||||
layout.prop(lamp, "atmosphere")
|
||||
layout.prop(lamp, "use_atmosphere")
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.active = lamp.atmosphere
|
||||
col.active = lamp.use_atmosphere
|
||||
col.label(text="Intensity:")
|
||||
col.prop(lamp, "sun_intensity", text="Sun")
|
||||
col.prop(lamp, "atmosphere_distance_factor", text="Distance")
|
||||
|
||||
if wide_ui:
|
||||
col = split.column()
|
||||
col.active = lamp.atmosphere
|
||||
col.active = lamp.use_atmosphere
|
||||
col.label(text="Scattering:")
|
||||
sub = col.column(align=True)
|
||||
sub.prop(lamp, "atmosphere_inscattering", slider=True, text="Inscattering")
|
||||
@@ -381,6 +391,8 @@ class DATA_PT_falloff_curve(DataButtonsPanel):
|
||||
self.layout.template_curve_mapping(lamp, "falloff_curve")
|
||||
|
||||
|
||||
bpy.types.register(LAMP_MT_sunsky_presets)
|
||||
|
||||
bpy.types.register(DATA_PT_context_lamp)
|
||||
bpy.types.register(DATA_PT_preview)
|
||||
bpy.types.register(DATA_PT_lamp)
|
||||
|
Reference in New Issue
Block a user