[Bf-blender-cvs] [672fbbfb4e] blender-v2.78b-release: Fix T49405: Crash when baking with adaptive subdivision

Mai Lavelle noreply at git.blender.org
Thu Jan 26 13:47:05 CET 2017


Commit: 672fbbfb4e9e66ab081393ae854f1cba0f2b350d
Author: Mai Lavelle
Date:   Wed Jan 25 00:35:20 2017 -0500
Branches: blender-v2.78b-release
https://developer.blender.org/rB672fbbfb4e9e66ab081393ae854f1cba0f2b350d

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.

===================================================================

M	intern/cycles/blender/blender_mesh.cpp

===================================================================

diff --git a/intern/cycles/blender/blender_mesh.cpp b/intern/cycles/blender/blender_mesh.cpp
index 66893d4d66..85117cfff7 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,




More information about the Bf-blender-cvs mailing list