diff options
| author | Maxim Nikolenko <maximnproductengine@lindenlab.com> | 2025-07-02 19:31:26 +0300 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-02 19:31:26 +0300 | 
| commit | 55a79ec56ba955955736b9ffa2e7d470712f871b (patch) | |
| tree | 20ccc99c0b34d226769378159538757e7ab64847 /indra/newview | |
| parent | b79feb60f55efe93ce08609e9c2916d1938dad9e (diff) | |
#4313 Improved naming of textures
Diffstat (limited to 'indra/newview')
| -rw-r--r-- | indra/newview/llmaterialeditor.cpp | 45 | 
1 files changed, 16 insertions, 29 deletions
diff --git a/indra/newview/llmaterialeditor.cpp b/indra/newview/llmaterialeditor.cpp index 378f5fdf91..5b3ac53d51 100644 --- a/indra/newview/llmaterialeditor.cpp +++ b/indra/newview/llmaterialeditor.cpp @@ -1333,15 +1333,6 @@ 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 @@ -1349,6 +1340,15 @@ const std::string LLMaterialEditor::buildMaterialDescription()      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;  } @@ -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 << @@ -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;      }  }  | 
