[Bf-blender-cvs] [bbba919338a] cycles_procedural_api: correct name of primary uvs

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


Commit: bbba919338aed065ae91fe325e424b4a5f54b87f
Author: Kévin Dietrich
Date:   Fri Dec 4 18:54:23 2020 +0100
Branches: cycles_procedural_api
https://developer.blender.org/rBbbba919338aed065ae91fe325e424b4a5f54b87f

correct name of primary uvs

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

M	intern/cycles/render/alembic.cpp

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

diff --git a/intern/cycles/render/alembic.cpp b/intern/cycles/render/alembic.cpp
index 44ae71af44c..8a53c5a226c 100644
--- a/intern/cycles/render/alembic.cpp
+++ b/intern/cycles/render/alembic.cpp
@@ -213,7 +213,16 @@ static void add_uvs(const IV2fGeomParam &uvs, CachedData &cached_data, Progress
     time_sampling = *time_sampling_ptr;
   }
 
-  CachedData::CachedAttribute &attr = cached_data.add_attribute(ustring(uvs.getName()),
+  std::string name = Alembic::Abc::GetSourceName(uvs.getMetaData());
+
+  /* According to the convention, primary UVs should have had their name
+   * set using Alembic::Abc::SetSourceName, but you can't expect everyone
+   * to follow it! :) */
+  if (name.empty()) {
+    name = uvs.getName();
+  }
+
+  CachedData::CachedAttribute &attr = cached_data.add_attribute(ustring(name),
                                                                 time_sampling);
   attr.std = ATTR_STD_UV;



More information about the Bf-blender-cvs mailing list