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
path: root/intern
diff options
context:
space:
mode:
authorMai Lavelle <mai.lavelle@gmail.com>2017-01-25 08:35:20 +0300
committerMai Lavelle <mai.lavelle@gmail.com>2017-01-25 08:40:45 +0300
commita7d5cabd4e86b7b750fadbd087b97f900009fb09 (patch)
treef26102c8f894736559012109393e51bf99d4272e /intern
parent57f937ad5a263195d241ceb67bf9ca2d04b80fd7 (diff)
Fix T49405: Crash when baking with adaptive subdivision
Blenders baking system currently doesn't support the topology used by adaptive subdivision and primitive ids will be wrong or out of range leading to crashes. Updating the baking system to support other topologies would be a bit involved, so for now we simply disable subdivision while baking to avoid crashes.
Diffstat (limited to 'intern')
-rw-r--r--intern/cycles/blender/blender_mesh.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/intern/cycles/blender/blender_mesh.cpp b/intern/cycles/blender/blender_mesh.cpp
index 66893d4d668..85117cfff7b 100644
--- a/intern/cycles/blender/blender_mesh.cpp
+++ b/intern/cycles/blender/blender_mesh.cpp
@@ -927,6 +927,13 @@ Mesh *BlenderSync::sync_mesh(BL::Object& b_ob,
mesh->subdivision_type = object_subdivision_type(b_ob, preview, experimental);
+ /* Disable adaptive subdivision while baking as the baking system
+ * currently doesnt support the topology and will crash.
+ */
+ if(scene->bake_manager->get_baking()) {
+ mesh->subdivision_type = Mesh::SUBDIVISION_NONE;
+ }
+
BL::Mesh b_mesh = object_to_mesh(b_data,
b_ob,
b_scene,