[Bf-blender-cvs] [8071afa7f2e] refactor-mesh-remove-pointers: Use const vertices for alembic hair export

Hans Goudey noreply at git.blender.org
Fri Sep 2 01:12:17 CEST 2022


Commit: 8071afa7f2e8c556ae205044c9fb4728c960013a
Author: Hans Goudey
Date:   Thu Sep 1 18:03:12 2022 -0500
Branches: refactor-mesh-remove-pointers
https://developer.blender.org/rB8071afa7f2e8c556ae205044c9fb4728c960013a

Use const vertices for alembic hair export

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

M	source/blender/blenkernel/BKE_particle.h
M	source/blender/blenkernel/intern/particle.c
M	source/blender/io/alembic/exporter/abc_writer_hair.cc

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

diff --git a/source/blender/blenkernel/BKE_particle.h b/source/blender/blenkernel/BKE_particle.h
index 5f8b2fafdd3..a797aef73f6 100644
--- a/source/blender/blenkernel/BKE_particle.h
+++ b/source/blender/blenkernel/BKE_particle.h
@@ -579,7 +579,7 @@ void psys_get_texture(struct ParticleSimulationData *sim,
  * Interpolate a location on a face based on face coordinates.
  */
 void psys_interpolate_face(struct Mesh *mesh,
-                           struct MVert *mvert,
+                           const struct MVert *mvert,
                            const float (*vert_normals)[3],
                            struct MFace *mface,
                            struct MTFace *tface,
diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c
index dbacd141e0e..8db83031e17 100644
--- a/source/blender/blenkernel/intern/particle.c
+++ b/source/blender/blenkernel/intern/particle.c
@@ -1665,7 +1665,7 @@ static void interpolate_pathcache(ParticleCacheKey *first, float t, ParticleCach
 /************************************************/
 
 void psys_interpolate_face(Mesh *mesh,
-                           MVert *mvert,
+                           const MVert *mvert,
                            const float (*vert_normals)[3],
                            MFace *mface,
                            MTFace *tface,
@@ -1677,7 +1677,7 @@ void psys_interpolate_face(Mesh *mesh,
                            float vtan[3],
                            float orco[3])
 {
-  float *v1 = 0, *v2 = 0, *v3 = 0, *v4 = 0;
+  const float *v1 = 0, *v2 = 0, *v3 = 0, *v4 = 0;
   float e1[3], e2[3], s1, s2, t1, t2;
   float *uv1, *uv2, *uv3, *uv4;
   float n1[3], n2[3], n3[3], n4[3];
diff --git a/source/blender/io/alembic/exporter/abc_writer_hair.cc b/source/blender/io/alembic/exporter/abc_writer_hair.cc
index 247b5783dd1..b06b973f764 100644
--- a/source/blender/io/alembic/exporter/abc_writer_hair.cc
+++ b/source/blender/io/alembic/exporter/abc_writer_hair.cc
@@ -122,7 +122,7 @@ void ABCHairWriter::write_hair_sample(const HierarchyContext &context,
 
   MTFace *mtface = (MTFace *)CustomData_get_layer(&mesh->fdata, CD_MTFACE);
   MFace *mface = (MFace *)CustomData_get_layer(&mesh->fdata, CD_MFACE);
-  MVert *mverts = BKE_mesh_vertices_for_write(mesh);
+  const MVert *mverts = BKE_mesh_vertices(mesh);
   const float(*vert_normals)[3] = BKE_mesh_vertex_normals_ensure(mesh);
 
   if ((!mtface || !mface) && !uv_warning_shown_) {
@@ -245,7 +245,7 @@ void ABCHairWriter::write_hair_child_sample(const HierarchyContext &context,
 
   MFace *mface = (MFace *)CustomData_get_layer(&mesh->fdata, CD_MFACE);
   MTFace *mtface = (MTFace *)CustomData_get_layer(&mesh->fdata, CD_MTFACE);
-  MVert *mverts = BKE_mesh_vertices_for_write(mesh);
+  const MVert *mverts = BKE_mesh_vertices(mesh);
   const float(*vert_normals)[3] = BKE_mesh_vertex_normals_ensure(mesh);
 
   ParticleSystem *psys = context.particle_system;



More information about the Bf-blender-cvs mailing list