[Bf-blender-cvs] [ab9227fe003] refactor-mesh-remove-pointers: Fix alembic particle export

Hans Goudey noreply at git.blender.org
Thu Sep 1 05:43:01 CEST 2022


Commit: ab9227fe0033a73e249541a13aa63f4da94a4165
Author: Hans Goudey
Date:   Wed Aug 31 22:42:53 2022 -0500
Branches: refactor-mesh-remove-pointers
https://developer.blender.org/rBab9227fe0033a73e249541a13aa63f4da94a4165

Fix alembic particle export

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

M	source/blender/io/alembic/intern/abc_customdata.cc
M	source/blender/io/alembic/intern/abc_customdata.h

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

diff --git a/source/blender/io/alembic/intern/abc_customdata.cc b/source/blender/io/alembic/intern/abc_customdata.cc
index b63f63b7919..211ce9a45ff 100644
--- a/source/blender/io/alembic/intern/abc_customdata.cc
+++ b/source/blender/io/alembic/intern/abc_customdata.cc
@@ -246,9 +246,9 @@ void write_generated_coordinates(const OCompoundProperty &prop, CDStreamConfig &
   const float(*orcodata)[3] = static_cast<const float(*)[3]>(customdata);
 
   /* Convert 3D vertices from float[3] z=up to V3f y=up. */
-  std::vector<Imath::V3f> coords(config.verts.size());
+  std::vector<Imath::V3f> coords(mesh->totvert);
   float orco_yup[3];
-  for (int vertex_idx = 0; vertex_idx < config.verts.size(); vertex_idx++) {
+  for (int vertex_idx = 0; vertex_idx < mesh->totvert; vertex_idx++) {
     copy_yup_from_zup(orco_yup, orcodata[vertex_idx]);
     coords[vertex_idx].setValue(orco_yup[0], orco_yup[1], orco_yup[2]);
   }
diff --git a/source/blender/io/alembic/intern/abc_customdata.h b/source/blender/io/alembic/intern/abc_customdata.h
index 24fc05de263..d4b4fa8c33f 100644
--- a/source/blender/io/alembic/intern/abc_customdata.h
+++ b/source/blender/io/alembic/intern/abc_customdata.h
@@ -30,6 +30,8 @@ struct UVSample {
 };
 
 struct CDStreamConfig {
+
+  /* Only set for import. */
   MutableSpan<MVert> verts;
   MutableSpan<MPoly> polys;
   MutableSpan<MLoop> loops;



More information about the Bf-blender-cvs mailing list