mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2026-05-12 21:31:43 +00:00
chore: update default root bone name to empty string and do not specify if matching default name
This commit is contained in:
@@ -132,5 +132,7 @@ typedef DistinctMapper<VertexMergerPos> VertexMerger;
|
||||
|
||||
namespace xmodel
|
||||
{
|
||||
constexpr auto DEFAULT_XMODEL_ROOT_BONE_NAME = "";
|
||||
|
||||
std::string GetJsonFileNameForAssetName(const std::string& assetName);
|
||||
}
|
||||
} // namespace xmodel
|
||||
|
||||
@@ -163,7 +163,7 @@ namespace
|
||||
assert(common.m_vertex_bone_weights.size() == common.m_vertices.size());
|
||||
|
||||
XModelBone rootBone{
|
||||
.name = jXModel.rootBoneName.value_or("root"),
|
||||
.name = jXModel.rootBoneName.value_or(xmodel::DEFAULT_XMODEL_ROOT_BONE_NAME),
|
||||
.parentIndex = std::nullopt,
|
||||
.scale = {1.0f, 1.0f, 1.0f},
|
||||
.globalOffset = {0.0f, 0.0f, 0.0f},
|
||||
|
||||
@@ -797,8 +797,11 @@ namespace
|
||||
|
||||
if (!model.boneNames || model.boneNames[0] >= context.m_zone.m_script_strings.Count() || model.numRootBones == 0)
|
||||
return;
|
||||
|
||||
const auto& rootBoneName = context.m_zone.m_script_strings[model.boneNames[0]];
|
||||
|
||||
jXModel.rootBoneName = context.m_zone.m_script_strings[model.boneNames[0]];
|
||||
if (rootBoneName != xmodel::DEFAULT_XMODEL_ROOT_BONE_NAME)
|
||||
jXModel.rootBoneName = rootBoneName;
|
||||
}
|
||||
|
||||
void CreateJsonXModel(AssetDumpingContext& context, JsonXModel& jXModel, const XModel& model)
|
||||
|
||||
Reference in New Issue
Block a user