[Bf-blender-cvs] [6c9c7819aaa] refactor-mesh-remove-pointers: Move empty mesh check in cycles

Hans Goudey noreply at git.blender.org
Fri Sep 2 16:09:13 CEST 2022


Commit: 6c9c7819aaa7c06a0e75b3338aa7c60edc6ba59c
Author: Hans Goudey
Date:   Fri Sep 2 08:28:59 2022 -0500
Branches: refactor-mesh-remove-pointers
https://developer.blender.org/rB6c9c7819aaa7c06a0e75b3338aa7c60edc6ba59c

Move empty mesh check in cycles

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

M	intern/cycles/blender/mesh.cpp

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

diff --git a/intern/cycles/blender/mesh.cpp b/intern/cycles/blender/mesh.cpp
index 01ce771b466..aca286a79d8 100644
--- a/intern/cycles/blender/mesh.cpp
+++ b/intern/cycles/blender/mesh.cpp
@@ -1297,16 +1297,16 @@ void BlenderSync::sync_mesh_motion(BL::Depsgraph b_depsgraph,
     b_mesh = object_to_mesh(b_data, b_ob_info, b_depsgraph, false, Mesh::SUBDIVISION_NONE);
   }
 
-  const int b_verts_num = b_mesh.vertices.length();
-  if (b_verts_num == 0) {
-    free_object_to_mesh(b_data, b_ob_info, b_mesh);
-    return;
-  }
-
   const std::string ob_name = b_ob_info.real_object.name();
 
   /* TODO(sergey): Perform preliminary check for number of vertices. */
   if (b_mesh) {
+    const int b_verts_num = b_mesh.vertices.length();
+    if (b_verts_num == 0) {
+      free_object_to_mesh(b_data, b_ob_info, b_mesh);
+      return;
+    }
+
     /* Export deformed coordinates. */
     /* Find attributes. */
     Attribute *attr_mP = mesh->attributes.find(ATTR_STD_MOTION_VERTEX_POSITION);



More information about the Bf-blender-cvs mailing list