Skip to content

#4313 Improved naming of textures #4326

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 16 additions & 29 deletions indra/newview/llmaterialeditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1333,22 +1333,22 @@ const std::string LLMaterialEditor::buildMaterialDescription()
desc << mNormalName;
}

// trim last char if it's a ',' in case there is no normal texture
// present and the code above inserts one
// (no need to check for string length - always has initial string)
std::string::iterator iter = desc.str().end() - 1;
if (*iter == ',')
{
desc.str().erase(iter);
}

// sanitize the material description so that it's compatible with the inventory
// note: split this up because clang doesn't like operating directly on the
// str() - error: lvalue reference to type 'basic_string<...>' cannot bind to a
// temporary of type 'basic_string<...>'
std::string inv_desc = desc.str();
LLInventoryObject::correctInventoryName(inv_desc);

// trim last char if it's a ',' in case there is no normal texture
// present and the code above inserts one
// (no need to check for string length - always has initial string)
std::string::iterator iter = inv_desc.end() - 1;
if (*iter == ',')
{
inv_desc.erase(iter);
}

return inv_desc;
}

Expand Down Expand Up @@ -2685,10 +2685,8 @@ const std::string LLMaterialEditor::getImageNameFromUri(std::string image_uri, c
// so we can include everything
if (stripped_uri.length() > 0)
{
// example "DamagedHelmet: base layer"
// example "base layer"
return STRINGIZE(
mMaterialNameShort <<
": " <<
stripped_uri <<
" (" <<
texture_type <<
Expand All @@ -2697,28 +2695,17 @@ const std::string LLMaterialEditor::getImageNameFromUri(std::string image_uri, c
}
else
// uri doesn't include the type (because the uri is empty)
// so we must reorganize the string a bit to include the name
// and an explicit name type
// include an explicit name type
{
// example "DamagedHelmet: (Emissive)"
return STRINGIZE(
mMaterialNameShort <<
" (" <<
texture_type <<
")"
);
// example "Emissive"
return texture_type;
}
}
else
// uri includes the type so just use it directly with the
// name of the material
// uri includes the type so just use it directly
{
return STRINGIZE(
// example: AlienBust: normal_layer
mMaterialNameShort <<
": " <<
stripped_uri
);
// example: "normal_layer"
return stripped_uri;
}
}

Expand Down