[Bf-blender-cvs] [adaf37f4d5d] sybren-usd: USD: Remove the "uv_" prefix from exported UV maps

Sybren A. Stüvel noreply at git.blender.org
Thu Jul 25 15:42:03 CEST 2019


Commit: adaf37f4d5da35b7ada286bdda9a1dfa5207639f
Author: Sybren A. Stüvel
Date:   Thu Jul 25 15:41:47 2019 +0200
Branches: sybren-usd
https://developer.blender.org/rBadaf37f4d5da35b7ada286bdda9a1dfa5207639f

USD: Remove the "uv_" prefix from exported UV maps

The primvar name is now the same as the UV Map name. This is to allow
the standard name "st" for texture coordinates by naming the UV Map as
such, without having to guess which UV Map is the "standard" one.

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

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

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

diff --git a/source/blender/usd/intern/usd_writer_mesh.cc b/source/blender/usd/intern/usd_writer_mesh.cc
index c50910ce8f9..f2ddbbd628f 100644
--- a/source/blender/usd/intern/usd_writer_mesh.cc
+++ b/source/blender/usd/intern/usd_writer_mesh.cc
@@ -99,8 +99,11 @@ void USDGenericMeshWriter::write_uv_maps(const Mesh *mesh, pxr::UsdGeomMesh usd_
       continue;
     }
 
-    // UV coordinates are stored in a Primvar on the Mesh, and can be referenced from materials.
-    pxr::TfToken primvar_name(pxr::TfMakeValidIdentifier(std::string("uv_") + layer->name));
+    /* UV coordinates are stored in a Primvar on the Mesh, and can be referenced from materials.
+     * The primvar name is the same as the UV Map name. This is to allow the standard name "st"
+     * for texture coordinates by naming the UV Map as such, without having to guess which UV Map
+     * is the "standard" one. */
+    pxr::TfToken primvar_name(pxr::TfMakeValidIdentifier(layer->name));
     pxr::UsdGeomPrimvar uv_coords_primvar = usd_mesh.CreatePrimvar(
         primvar_name, pxr::SdfValueTypeNames->TexCoord2fArray, pxr::UsdGeomTokens->faceVarying);



More information about the Bf-blender-cvs mailing list