Commit: 4fa478c724903ee3d4a4cb6aaf05775a7c46ad01
Author: Michael Kowalski
Date:   Wed Oct 26 19:58:28 2022 -0400
Branches: universal-scene-description
https://developer.blender.org/rB4fa478c724903ee3d4a4cb6aaf05775a7c46ad01

USD Export: handle meshes in edit mode.

Small change to ensure Edit mode meshes are committed during the
export process.  Without this change, meshes may be empty in the
USD.  This update was authored by Charles Wardlaw.

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

M       source/blender/io/usd/intern/usd_writer_mesh.cc

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

diff --git a/source/blender/io/usd/intern/usd_writer_mesh.cc 
b/source/blender/io/usd/intern/usd_writer_mesh.cc
index fca7ab08e30..3d2aacb2d42 100644
--- a/source/blender/io/usd/intern/usd_writer_mesh.cc
+++ b/source/blender/io/usd/intern/usd_writer_mesh.cc
@@ -19,6 +19,7 @@
 #include "BKE_material.h"
 #include "BKE_mesh.h"
 #include "BKE_mesh_runtime.h"
+#include "BKE_mesh_wrapper.h"
 #include "BKE_modifier.h"
 #include "BKE_object.h"
 
@@ -26,7 +27,6 @@
 #include "bmesh_tools.h"
 
 #include "DEG_depsgraph.h"
-
 #include "DNA_layer_types.h"
 #include "DNA_mesh_types.h"
 #include "DNA_meshdata_types.h"
@@ -504,6 +504,8 @@ void USDGenericMeshWriter::write_mesh(HierarchyContext 
&context, Mesh *mesh)
   write_visibility(context, timecode, usd_mesh);
 
   USDMeshData usd_mesh_data;
+  /* ensure data exists if currently in edit mode */
+  BKE_mesh_wrapper_ensure_mdata(mesh);
   get_geometry_data(mesh, usd_mesh_data);
 
   if (usd_export_context_.export_params.export_vertices) {

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to