[Bf-blender-cvs] [a7d5cabd4e] master: Fix T49405: Crash when baking with adaptive subdivision

Mai Lavelle noreply at git.blender.org
Wed Jan 25 06:42:15 CET 2017


Commit: a7d5cabd4e86b7b750fadbd087b97f900009fb09
Author: Mai Lavelle
Date:   Wed Jan 25 00:35:20 2017 -0500
Branches: master
https://developer.blender.org/rBa7d5cabd4e86b7b750fadbd087b97f900009fb09

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