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:
authorDalai Felinto <dfelinto@gmail.com>2016-01-15 18:00:56 +0300
committerDalai Felinto <dfelinto@gmail.com>2016-01-15 18:00:56 +0300
commit9a76354585e2cd2011267e79bd99ca59a06588f8 (patch)
treee775e7c44dc210ef9978b483930ade6a9b4d6fc5 /intern/cycles/blender/addon/version_update.py
parent9137a4401440d3f3206e989f49f3539079d685b8 (diff)
Cycles-Bake: Custom Baking passes
The combined pass is built with the contributions the user finds fit. It is useful for lightmap baking, as well as non-view dependent effects baking. The manual will be updated once we get closer to the 2.77 release. Meanwhile the new page can be found here: http://dalaifelinto.com/blender-manual/render/cycles/baking.html Reviewers: sergey, brecht Differential Revision: https://developer.blender.org/D1674
Diffstat (limited to 'intern/cycles/blender/addon/version_update.py')
-rw-r--r--intern/cycles/blender/addon/version_update.py63
1 files changed, 63 insertions, 0 deletions
diff --git a/intern/cycles/blender/addon/version_update.py b/intern/cycles/blender/addon/version_update.py
index eb6d5d957ad..d8b3f5bc672 100644
--- a/intern/cycles/blender/addon/version_update.py
+++ b/intern/cycles/blender/addon/version_update.py
@@ -113,6 +113,64 @@ def vector_curve_node_remap(node):
point.location.y = (point.location.y - 0.5) * 2.0
node.mapping.update()
+
+def custom_bake_remap(scene):
+ """
+ Remap bake types into the new types and set the flags accordingly
+ """
+ bake_lookup = (
+ 'COMBINED',
+ 'AO',
+ 'SHADOW',
+ 'NORMAL',
+ 'UV',
+ 'EMIT',
+ 'ENVIRONMENT',
+ 'DIFFUSE_DIRECT',
+ 'DIFFUSE_INDIRECT',
+ 'DIFFUSE_COLOR',
+ 'GLOSSY_DIRECT',
+ 'GLOSSY_INDIRECT',
+ 'GLOSSY_COLOR',
+ 'TRANSMISSION_DIRECT',
+ 'TRANSMISSION_INDIRECT',
+ 'TRANSMISSION_COLOR',
+ 'SUBSURFACE_DIRECT',
+ 'SUBSURFACE_INDIRECT',
+ 'SUBSURFACE_COLOR')
+
+ diffuse_direct_idx = bake_lookup.index('DIFFUSE_DIRECT')
+
+ cscene = scene.cycles
+
+ # Old bake type
+ bake_type_idx = cscene.get("bake_type")
+
+ if bake_type_idx is None:
+ cscene.bake_type = 'COMBINED'
+ return
+
+ # File doesn't need versioning
+ if bake_type_idx < diffuse_direct_idx:
+ return
+
+ # File needs versioning
+ bake_type = bake_lookup[bake_type_idx]
+ cscene.bake_type, end = bake_type.split('_')
+
+ if end == 'DIRECT':
+ scene.render.bake.use_pass_indirect = False
+ scene.render.bake.use_pass_color = False
+
+ elif end == 'INDIRECT':
+ scene.render.bake.use_pass_direct = False
+ scene.render.bake.use_pass_color = False
+
+ elif end == 'COLOR':
+ scene.render.bake.use_pass_direct = False
+ scene.render.bake.use_pass_indirect = False
+
+
@persistent
def do_versions(self):
# We don't modify startup file because it assumes to
@@ -156,3 +214,8 @@ def do_versions(self):
if bpy.data.version <= (2, 76, 5):
foreach_cycles_node(vector_curve_node_remap)
+
+ # Baking types changed
+ if bpy.data.version <= (2, 76, 6):
+ for scene in bpy.data.scenes:
+ custom_bake_remap(scene)