Skip to content

Commit 5ec7c76

Browse files
#4313 Improved naming of textures
1 parent 900516a commit 5ec7c76

File tree

1 file changed

+16
-29
lines changed

1 file changed

+16
-29
lines changed

indra/newview/llmaterialeditor.cpp

Lines changed: 16 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1333,22 +1333,22 @@ const std::string LLMaterialEditor::buildMaterialDescription()
13331333
desc << mNormalName;
13341334
}
13351335

1336-
// trim last char if it's a ',' in case there is no normal texture
1337-
// present and the code above inserts one
1338-
// (no need to check for string length - always has initial string)
1339-
std::string::iterator iter = desc.str().end() - 1;
1340-
if (*iter == ',')
1341-
{
1342-
desc.str().erase(iter);
1343-
}
1344-
13451336
// sanitize the material description so that it's compatible with the inventory
13461337
// note: split this up because clang doesn't like operating directly on the
13471338
// str() - error: lvalue reference to type 'basic_string<...>' cannot bind to a
13481339
// temporary of type 'basic_string<...>'
13491340
std::string inv_desc = desc.str();
13501341
LLInventoryObject::correctInventoryName(inv_desc);
13511342

1343+
// trim last char if it's a ',' in case there is no normal texture
1344+
// present and the code above inserts one
1345+
// (no need to check for string length - always has initial string)
1346+
std::string::iterator iter = inv_desc.end() - 1;
1347+
if (*iter == ',')
1348+
{
1349+
inv_desc.erase(iter);
1350+
}
1351+
13521352
return inv_desc;
13531353
}
13541354

@@ -2685,10 +2685,8 @@ const std::string LLMaterialEditor::getImageNameFromUri(std::string image_uri, c
26852685
// so we can include everything
26862686
if (stripped_uri.length() > 0)
26872687
{
2688-
// example "DamagedHelmet: base layer"
2688+
// example "base layer"
26892689
return STRINGIZE(
2690-
mMaterialNameShort <<
2691-
": " <<
26922690
stripped_uri <<
26932691
" (" <<
26942692
texture_type <<
@@ -2697,28 +2695,17 @@ const std::string LLMaterialEditor::getImageNameFromUri(std::string image_uri, c
26972695
}
26982696
else
26992697
// uri doesn't include the type (because the uri is empty)
2700-
// so we must reorganize the string a bit to include the name
2701-
// and an explicit name type
2698+
// include an explicit name type
27022699
{
2703-
// example "DamagedHelmet: (Emissive)"
2704-
return STRINGIZE(
2705-
mMaterialNameShort <<
2706-
" (" <<
2707-
texture_type <<
2708-
")"
2709-
);
2700+
// example "Emissive"
2701+
return texture_type;
27102702
}
27112703
}
27122704
else
2713-
// uri includes the type so just use it directly with the
2714-
// name of the material
2705+
// uri includes the type so just use it directly
27152706
{
2716-
return STRINGIZE(
2717-
// example: AlienBust: normal_layer
2718-
mMaterialNameShort <<
2719-
": " <<
2720-
stripped_uri
2721-
);
2707+
// example: "normal_layer"
2708+
return stripped_uri;
27222709
}
27232710
}
27242711

0 commit comments

Comments
 (0)