Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2010-02-07 16:56:36 +0300
committerCampbell Barton <ideasman42@gmail.com>2010-02-07 16:56:36 +0300
commit6d38010cc5c5cfd703782c25aa5220abb2f01c2c (patch)
treea2171b5614aab75442624f63f5fe70d9cf79e327 /release/scripts/op/presets.py
parent7f64e230688618aff3c6916acdabd3a4421550e0 (diff)
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
Diffstat (limited to 'release/scripts/op/presets.py')
-rw-r--r--release/scripts/op/presets.py34
1 files changed, 33 insertions, 1 deletions
diff --git a/release/scripts/op/presets.py b/release/scripts/op/presets.py
index 76d84bc8b3d..feeb35d8659 100644
--- a/release/scripts/op/presets.py
+++ b/release/scripts/op/presets.py
@@ -49,7 +49,11 @@ class AddPresetBase(bpy.types.Operator):
file_preset = open(os.path.join(target_path, filename), 'w')
for rna_path in self.preset_values:
- file_preset.write("%s = %s\n" % (rna_path, eval(rna_path)))
+ value = eval(rna_path)
+ if type(value) == str:
+ value = "'%s'" % value
+
+ file_preset.write("%s = %s\n" % (rna_path, value))
file_preset.close()
@@ -125,6 +129,34 @@ class AddPresetCloth(AddPresetBase):
preset_subdir = "cloth"
+
+class AddPresetSunSky(AddPresetBase):
+ '''Add a Cloth Preset.'''
+ bl_idname = "lamp.sunsky_preset_add"
+ bl_label = "Add Sunsky Preset"
+ name = AddPresetBase.name
+
+ preset_values = [
+ "bpy.context.object.data.sky.atmosphere_turbidity",
+ "bpy.context.object.data.sky.sky_blend_type",
+ "bpy.context.object.data.sky.sky_blend",
+ "bpy.context.object.data.sky.horizon_brightness",
+ "bpy.context.object.data.sky.spread",
+ "bpy.context.object.data.sky.sky_color_space",
+ "bpy.context.object.data.sky.sky_exposure",
+ "bpy.context.object.data.sky.sun_brightness",
+ "bpy.context.object.data.sky.sun_size",
+ "bpy.context.object.data.sky.backscattered_light",
+ "bpy.context.object.data.sky.sun_intensity",
+ "bpy.context.object.data.sky.atmosphere_distance_factor",
+ "bpy.context.object.data.sky.atmosphere_inscattering",
+ "bpy.context.object.data.sky.atmosphere_extinction",
+ ]
+
+ preset_subdir = "sunsky"
+
+
bpy.types.register(AddPresetRender)
bpy.types.register(AddPresetSSS)
bpy.types.register(AddPresetCloth)
+bpy.types.register(AddPresetSunSky)