Skip to content

Commit

Permalink
Remove number suffix from 'color' and 'opacity' primvars
Browse files Browse the repository at this point in the history
This is in line with the previous texcoord primvar change.
  • Loading branch information
pablode committed Jul 13, 2024
1 parent 011d66b commit b347951
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
4 changes: 2 additions & 2 deletions docs/Structure_Mapping.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,10 @@ Depending on material parameters and available accessors, guc creates following

Name | Description
--- | ---
colorN | Vertex color set N
color[N] | Vertex color set N
displayColor | Display color (constant or per-vertex)
displayOpacity | Display opacity (constant or per-vertex)
opacityN | Vertex opacity set N
opacity[N] | Vertex opacity set N
st[N] | Texture coordinate set N
tangents | Three-component tangent vectors
bitangentSigns | Bitangent handedness
Expand Down
16 changes: 12 additions & 4 deletions src/libguc/src/naming.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,22 @@ namespace guc
// Furthermore, 'color' maps directly to the COLOR_ glTF attribute name and goes well
// with the already existing 'displayColor' primvar. It's just not for the 'display'
// purpose, but rather part of the actual data used for shading.
std::string colorSetBaseName = "color";
return colorSetBaseName + std::to_string(index);
std::string name = "color";
if (index == 0)
{
return name;
}
return name + std::to_string(index);
}

std::string makeOpacitySetName(int index)
{
std::string opacitySetBaseName = "opacity";
return opacitySetBaseName + std::to_string(index);
std::string name = "opacity";
if (index == 0)
{
return name;
}
return name + std::to_string(index);
}

const static std::unordered_set<std::string> MTLX_TYPE_NAME_SET = {
Expand Down

0 comments on commit b347951

Please sign in to comment.