[Bf-blender-cvs] [1ab6b3c99b9] cycles_procedural_api: tag attributes as modified, and remove any stale normal data

Kévin Dietrich noreply at git.blender.org
Sun Dec 6 06:26:26 CET 2020


Commit: 1ab6b3c99b905d713d0caf864c2e62379d3dfab0
Author: Kévin Dietrich
Date:   Wed Dec 2 13:21:00 2020 +0100
Branches: cycles_procedural_api
https://developer.blender.org/rB1ab6b3c99b905d713d0caf864c2e62379d3dfab0

tag attributes as modified, and remove any stale normal data

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

M	intern/cycles/render/alembic.cpp

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

diff --git a/intern/cycles/render/alembic.cpp b/intern/cycles/render/alembic.cpp
index 28f75cfbaec..294987a5836 100644
--- a/intern/cycles/render/alembic.cpp
+++ b/intern/cycles/render/alembic.cpp
@@ -901,7 +901,7 @@ void AlembicProcedural::read_mesh(Scene *scene,
     smooth.reserve(triangle_data->size());
     shader.reserve(triangle_data->size());
 
-    for (int i = 0; i < triangle_data->size(); ++i) {
+    for (size_t i = 0; i < triangle_data->size(); ++i) {
       int3 tri = (*triangle_data)[i];
       triangles.push_back_reserved(tri.x);
       triangles.push_back_reserved(tri.y);
@@ -931,9 +931,14 @@ void AlembicProcedural::read_mesh(Scene *scene,
     }
     assert(attr);
 
+    attr->modified = true;
     memcpy(attr->data(), attr_data->data(), attr_data->size());
   }
 
+  // TODO: proper normals support
+  mesh->attributes.remove(ATTR_STD_FACE_NORMAL);
+  mesh->attributes.remove(ATTR_STD_VERTEX_NORMAL);
+
   /* we don't yet support arbitrary attributes, for now add vertex
    * coordinates as generated coordinates if requested */
   if (mesh->need_attribute(scene, ATTR_STD_GENERATED)) {
@@ -942,9 +947,6 @@ void AlembicProcedural::read_mesh(Scene *scene,
         attr->data_float3(), mesh->get_verts().data(), sizeof(float3) * mesh->get_verts().size());
   }
 
-  /* TODO: read normals from the archive if present */
-  mesh->add_face_normals();
-
   if (mesh->is_modified()) {
     bool need_rebuild = mesh->triangles_is_modified();
     mesh->tag_update(scene, need_rebuild);



More information about the Bf-blender-cvs mailing list