fix(ugc): metal look only from the client's material types

LU Toolbox's metallic table also has colors the client's Materials.xml types
shinyPlastic, such as 131, the grey of many baseplates, so whole baseplates went
into S88_Metal_Model. Metal now comes from the Materials.xml types (shinySteel)
and the settings' colors only; the table still gives colors.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Aaron Kimbrell
2026-09-30 03:43:30 -05:00
parent 5265da7b2e
commit 19b6443fb4
6 changed files with 14 additions and 17 deletions

View File

@@ -171,10 +171,6 @@ namespace UgcPalette {
return Transparent().contains(id);
}
bool IsMetallic(uint32_t id) {
return Metallic().contains(id);
}
std::optional<glm::vec3> Glow(uint32_t id) {
const auto it = GlowColors().find(id);
return it != GlowColors().end() ? std::optional(it->second) : std::nullopt;

View File

@@ -18,7 +18,6 @@ namespace UgcPalette {
std::optional<glm::vec3> Linear(uint32_t id, bool icon = false);
bool IsTransparent(uint32_t id);
bool IsMetallic(uint32_t id);
// The glow color (linear) of a glowing material, nullopt for the others
std::optional<glm::vec3> Glow(uint32_t id);

View File

@@ -204,7 +204,6 @@ namespace UgcModel {
eLook LookOf(uint32_t id, const UgcBricks::Material& material, const LookRules& rules) {
if (const auto color = rules.colors.find(id); color != rules.colors.end()) return color->second;
if (rules.paletteGlow && UgcPalette::Glow(id)) return eLook::GLOW;
if (rules.paletteMetallic && UgcPalette::IsMetallic(id)) return eLook::METAL;
const auto type = rules.materialTypes.find(material.type);
return type != rules.materialTypes.end() ? type->second : eLook::PLASTIC;
}

View File

@@ -81,15 +81,15 @@ namespace UgcModel {
};
/**
* Which colors have which look, from the client's data: a Materials.xml MaterialType (brickdb.zip) and LU Toolbox's
* metallic and glow colors (UgcPalette), and colors named in the settings. A named color wins, then glow over metal;
* transparent bricks are plastic unless their color is glitter.
* Which colors have which look, from the client's data: a Materials.xml MaterialType (brickdb.zip), LU Toolbox's
* glow colors (UgcPalette) and colors named in the settings. A named color wins, then glow; transparent bricks are
* plastic unless their color is glitter. LU Toolbox's metallic table is not a look: it has colors the client types
* shinyPlastic (131, 139, 179, 183, 184, ...), plastic in the client's data.
*/
struct LookRules {
std::map<uint32_t, eLook> colors; // LEGO color ids given a look by the settings (brushed_colors, glitter_colors)
std::map<std::string, eLook> materialTypes{ { "shinySteel", eLook::METAL }, { "brushedSteel", eLook::BRUSHED }, { "matteSteel", eLook::BRUSHED },
{ "glitter", eLook::GLITTER } };
bool paletteMetallic{ true }; // LU Toolbox's Metallic colors (UgcPalette::IsMetallic) are METAL
bool paletteGlow{ true }; // its glow colors (UgcPalette::Glow) are GLOW
};