summaryrefslogtreecommitdiff
path: root/indra/llprimitive
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2024-01-08 23:38:28 +0200
committerAndrey Lihatskiy <alihatskiy@productengine.com>2024-01-08 23:38:28 +0200
commite2de27c84e20e2392ac4716d0bf7d0c0d7c0454f (patch)
tree97a90df09beddedfd28c8eb502effa7e40075e88 /indra/llprimitive
parente4a1feb83079965fbebd356aa694adf100fb7ee3 (diff)
parent77395eddc911e0801e50fd693f7bbaee8046aa95 (diff)
Merge branch 'main' into DRTVWR-600-maint-A
# Conflicts: # indra/newview/llmaterialeditor.cpp
Diffstat (limited to 'indra/llprimitive')
-rw-r--r--indra/llprimitive/lldaeloader.cpp3
-rw-r--r--indra/llprimitive/llgltfmaterial.cpp25
-rw-r--r--indra/llprimitive/llmodel.cpp3
3 files changed, 29 insertions, 2 deletions
diff --git a/indra/llprimitive/lldaeloader.cpp b/indra/llprimitive/lldaeloader.cpp
index 46e1cb4922..2e4b013b77 100644
--- a/indra/llprimitive/lldaeloader.cpp
+++ b/indra/llprimitive/lldaeloader.cpp
@@ -2584,7 +2584,8 @@ bool LLDAELoader::loadModelsFromDomMesh(domMesh* mesh, std::vector<LLModel*>& mo
next->mLabel = model_name + (char)((int)'a' + next->mSubmodelID) + lod_suffix[mLod];
next->getVolumeFaces() = remainder;
next->mNormalizedScale = ret->mNormalizedScale;
-
+ next->mNormalizedTranslation = ret->mNormalizedTranslation;
+
if ( ret->mMaterialList.size() > LL_SCULPT_MESH_MAX_FACES)
{
next->mMaterialList.assign(ret->mMaterialList.begin() + LL_SCULPT_MESH_MAX_FACES, ret->mMaterialList.end());
diff --git a/indra/llprimitive/llgltfmaterial.cpp b/indra/llprimitive/llgltfmaterial.cpp
index e9d3350ee9..12af568b7e 100644
--- a/indra/llprimitive/llgltfmaterial.cpp
+++ b/indra/llprimitive/llgltfmaterial.cpp
@@ -760,24 +760,44 @@ void LLGLTFMaterial::applyOverrideLLSD(const LLSD& data)
if (bc.isDefined())
{
mBaseColor.setValue(bc);
+ if (mBaseColor == getDefaultBaseColor())
+ {
+ // HACK -- nudge by epsilon if we receive a default value (indicates override to default)
+ mBaseColor.mV[3] -= FLT_EPSILON;
+ }
}
const LLSD& ec = data["ec"];
if (ec.isDefined())
{
mEmissiveColor.setValue(ec);
+ if (mEmissiveColor == getDefaultEmissiveColor())
+ {
+ // HACK -- nudge by epsilon if we receive a default value (indicates override to default)
+ mEmissiveColor.mV[0] += FLT_EPSILON;
+ }
}
const LLSD& mf = data["mf"];
if (mf.isReal())
{
mMetallicFactor = mf.asReal();
+ if (mMetallicFactor == getDefaultMetallicFactor())
+ {
+ // HACK -- nudge by epsilon if we receive a default value (indicates override to default)
+ mMetallicFactor -= FLT_EPSILON;
+ }
}
const LLSD& rf = data["rf"];
if (rf.isReal())
{
mRoughnessFactor = rf.asReal();
+ if (mRoughnessFactor == getDefaultRoughnessFactor())
+ {
+ // HACK -- nudge by epsilon if we receive a default value (indicates override to default)
+ mRoughnessFactor -= FLT_EPSILON;
+ }
}
const LLSD& am = data["am"];
@@ -791,6 +811,11 @@ void LLGLTFMaterial::applyOverrideLLSD(const LLSD& data)
if (ac.isReal())
{
mAlphaCutoff = ac.asReal();
+ if (mAlphaCutoff == getDefaultAlphaCutoff())
+ {
+ // HACK -- nudge by epsilon if we receive a default value (indicates override to default)
+ mAlphaCutoff -= FLT_EPSILON;
+ }
}
const LLSD& ds = data["ds"];
diff --git a/indra/llprimitive/llmodel.cpp b/indra/llprimitive/llmodel.cpp
index ee493968de..99a5697a84 100644
--- a/indra/llprimitive/llmodel.cpp
+++ b/indra/llprimitive/llmodel.cpp
@@ -52,7 +52,8 @@ const int MODEL_NAMES_LENGTH = sizeof(model_names) / sizeof(std::string);
LLModel::LLModel(LLVolumeParams& params, F32 detail)
: LLVolume(params, detail),
- mNormalizedScale(1,1,1),
+ mNormalizedScale(1,1,1),
+ mNormalizedTranslation(0, 0, 0),
mPelvisOffset( 0.0f ),
mStatus(NO_ERRORS),
mSubmodelID(0)