Skip to content

Commit

Permalink
Preserve material name if it starts with an underscore
Browse files Browse the repository at this point in the history
  • Loading branch information
pablode committed Apr 4, 2024
1 parent ebe6abb commit 3ed3f2a
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/libguc/src/naming.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,20 @@ namespace guc
baseName = mx::createValidName(baseName);
baseName = TfMakeValidIdentifier(baseName);

if (baseName.empty() || baseName[0] == '_') // HdStorm has problems with underscore prefixes
// Remove underscore prefix to prevent compile errors in HdStorm
if (!baseName.empty() && baseName[0] == '_')
{
size_t i;
for (i = 0; i < baseName.length(); i++)
{
if (baseName[i] != '_') {
break;
}
}
baseName = baseName.substr(i);
}

if (baseName.empty())
{
baseName = DEFAULT_MATERIAL_NAME;
}
Expand Down

0 comments on commit 3ed3f2a

Please sign in to comment.