mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-04-19 15:52:53 +00:00
Merge pull request #340 from Laupetin/fix/regressions-from-obj-compiling-refactor
fix: regressions from obj compiling refactor
This commit is contained in:
commit
a759f3d82b
@ -38,7 +38,12 @@ public:
|
|||||||
for (const auto scrString : existingAsset->m_used_script_strings)
|
for (const auto scrString : existingAsset->m_used_script_strings)
|
||||||
m_zone.m_script_strings.AddOrGetScriptString(existingAsset->m_zone->m_script_strings.CValue(scrString));
|
m_zone.m_script_strings.AddOrGetScriptString(existingAsset->m_zone->m_script_strings.CValue(scrString));
|
||||||
|
|
||||||
return AssetCreationResult::Success(context.AddAsset(std::move(registration)));
|
auto* newAsset = context.AddAsset(std::move(registration));
|
||||||
|
|
||||||
|
// Make sure we remember this asset came from another zone
|
||||||
|
newAsset->m_zone = existingAsset->m_zone;
|
||||||
|
|
||||||
|
return AssetCreationResult::Success(newAsset);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -238,5 +238,7 @@ AssetCreationResult InfoStringLoaderAttachmentUnique::CreateAsset(const std::str
|
|||||||
return AssetCreationResult::Failure();
|
return AssetCreationResult::Failure();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CalculateAttachmentUniqueFields(assetName, *attachmentUniqueFull);
|
||||||
|
|
||||||
return AssetCreationResult::Success(context.AddAsset(std::move(registration)));
|
return AssetCreationResult::Success(context.AddAsset(std::move(registration)));
|
||||||
}
|
}
|
||||||
|
@ -252,7 +252,8 @@ namespace
|
|||||||
info.radiusSquared = halfSizeEigen.squaredNorm();
|
info.radiusSquared = halfSizeEigen.squaredNorm();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ApplyCommonBonesToXModel(const JsonXModelLod& jLod, XModel& xmodel, unsigned lodNumber, const XModelCommon& common)
|
bool ApplyCommonBonesToXModel(
|
||||||
|
const JsonXModelLod& jLod, XModel& xmodel, unsigned lodNumber, const XModelCommon& common, AssetRegistration<AssetXModel>& registration)
|
||||||
{
|
{
|
||||||
if (common.m_bones.empty())
|
if (common.m_bones.empty())
|
||||||
return true;
|
return true;
|
||||||
@ -305,6 +306,7 @@ namespace
|
|||||||
{
|
{
|
||||||
const auto& bone = common.m_bones[boneIndex];
|
const auto& bone = common.m_bones[boneIndex];
|
||||||
xmodel.boneNames[boneIndex] = m_script_strings.AddOrGetScriptString(bone.name);
|
xmodel.boneNames[boneIndex] = m_script_strings.AddOrGetScriptString(bone.name);
|
||||||
|
registration.AddScriptString(xmodel.boneNames[boneIndex]);
|
||||||
xmodel.partClassification[boneIndex] = static_cast<unsigned char>(m_part_classification_state.GetPartClassificationForBoneName(bone.name));
|
xmodel.partClassification[boneIndex] = static_cast<unsigned char>(m_part_classification_state.GetPartClassificationForBoneName(bone.name));
|
||||||
|
|
||||||
ApplyBasePose(xmodel.baseMat[boneIndex], bone);
|
ApplyBasePose(xmodel.baseMat[boneIndex], bone);
|
||||||
@ -656,7 +658,7 @@ namespace
|
|||||||
|
|
||||||
if (lodNumber == 0u)
|
if (lodNumber == 0u)
|
||||||
{
|
{
|
||||||
if (!ApplyCommonBonesToXModel(jLod, xmodel, lodNumber, *common))
|
if (!ApplyCommonBonesToXModel(jLod, xmodel, lodNumber, *common, registration))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user