Fix (unreported) Cycles not rendering correctly modified curves/surfaces/texts.
authorBastien Montagne <montagne29@wanadoo.fr>
Wed, 28 Nov 2018 15:23:39 +0000 (16:23 +0100)
committerBastien Montagne <montagne29@wanadoo.fr>
Wed, 28 Nov 2018 15:25:15 +0000 (16:25 +0100)
Meshes from evaluated objects may already have modifiers applied, but
that's not the case for curves, we need to do that when converting them
to meshes.

intern/cycles/blender/blender_mesh.cpp

index b97c250adf678b45c1691e927ef49b686b153899..b27de775c546a453b6c4de83a7071e6ee1e3f45d 100644 (file)
@@ -1061,9 +1061,12 @@ Mesh *BlenderSync::sync_mesh(BL::Depsgraph& b_depsgraph,
                 * updating meshes here will end up having derived mesh referencing
                 * freed data from the blender side.
                 */
-               if(preview && b_ob.type() != BL::Object::type_MESH)
+               if(preview && b_ob.type() != BL::Object::type_MESH) {
                        b_ob.update_from_editmode(b_data);
+               }
 
+               /* For some reason, meshes do not need this... */
+               bool apply_modifiers = (b_ob.type() != BL::Object::type_MESH);
                bool need_undeformed = mesh->need_attribute(scene, ATTR_STD_GENERATED);
 
                mesh->subdivision_type = object_subdivision_type(b_ob, preview, experimental);
@@ -1078,7 +1081,7 @@ Mesh *BlenderSync::sync_mesh(BL::Depsgraph& b_depsgraph,
                BL::Mesh b_mesh = object_to_mesh(b_data,
                                                 b_ob,
                                                 b_depsgraph,
-                                                false,
+                                                apply_modifiers,
                                                 need_undeformed,
                                                 mesh->subdivision_type);