diff --git a/AssetStudioFBX/AssetStudioFBX.h b/AssetStudioFBX/AssetStudioFBX.h index fb3bb65..7fb7006 100644 --- a/AssetStudioFBX/AssetStudioFBX.h +++ b/AssetStudioFBX/AssetStudioFBX.h @@ -76,7 +76,7 @@ namespace AssetStudio { void SetJointsFromImportedMeshes(bool allBones); void ExportFrame(FbxNode* pParentNode, ImportedFrame^ frame); void ExportMesh(FbxNode* pFrameNode, ImportedMesh^ meshList, bool normals); - FbxNode* FindNodeByPath(String ^ path, bool recursive); + FbxNode* FindNodeByPath(String ^ path); FbxFileTexture* ExportTexture(ImportedTexture^ matTex); void ExportAnimations(bool eulerFilter, float filterValue, bool flatInbetween); void ExportKeyframedAnimation(ImportedKeyframedAnimation^ parser, FbxString& kTakeName, FbxAnimCurveFilterUnroll* eulerFilter, float filterPrecision, bool flatInbetween); diff --git a/AssetStudioFBX/AssetStudioFBXExporter.cpp b/AssetStudioFBX/AssetStudioFBXExporter.cpp index 332c70b..c3708b7 100644 --- a/AssetStudioFBX/AssetStudioFBXExporter.cpp +++ b/AssetStudioFBX/AssetStudioFBXExporter.cpp @@ -331,7 +331,7 @@ namespace AssetStudio for (int i = 0; i < boneList->Count; i++) { ImportedBone^ bone = boneList[i]; - FbxNode* lFrame = FindNodeByPath(bone->Path, false); + FbxNode* lFrame = FindNodeByPath(bone->Path); pBoneNodeList->Add(lFrame); } } @@ -616,7 +616,7 @@ namespace AssetStudio } } - FbxNode* Fbx::Exporter::FindNodeByPath(String ^ path, bool recursive) + FbxNode* Fbx::Exporter::FindNodeByPath(String ^ path) { array^ splitPath = path->Split('/'); FbxNode* lNode = pScene->GetRootNode(); @@ -627,19 +627,10 @@ namespace AssetStudio try { pNodeName = StringToCharArray(frameName); - FbxNode* foundNode; - if (recursive && i == 0) - { - foundNode = lNode->FindChild(pNodeName); - } - else - { - foundNode = lNode->FindChild(pNodeName, false); - } + FbxNode* foundNode = lNode->FindChild(pNodeName, false); if (foundNode == NULL) { - //throw gcnew Exception(gcnew String("Couldn't find path ") + path); - return NULL; + throw gcnew Exception(gcnew String("Couldn't find path ") + path); } lNode = foundNode; } @@ -766,7 +757,7 @@ namespace AssetStudio for (int j = 0; j < pAnimationList->Count; j++) { ImportedAnimationKeyframedTrack^ keyframeList = pAnimationList[j]; - FbxNode* pNode = FindNodeByPath(keyframeList->Path, true); + FbxNode* pNode = FindNodeByPath(keyframeList->Path); if (pNode != nullptr) { FbxAnimCurve* lCurveSX = pNode->LclScaling.GetCurve(lAnimLayer, FBXSDK_CURVENODE_COMPONENT_X, true); @@ -934,10 +925,10 @@ namespace AssetStudio { Marshal::FreeHGlobal((IntPtr)pMorphShapeName); } - if (frameIdx == morph->Channels[i]->Item3 - 1) - { - FbxProperty::Create(lBlendShape, FbxStringDT, rootGroupProp.GetName() + "|" + pShape->GetName()); - } + if (frameIdx == morph->Channels[i]->Item3 - 1) + { + FbxProperty::Create(lBlendShape, FbxStringDT, rootGroupProp.GetName() + "|" + pShape->GetName()); + } lBlendShapeChannel->AddTargetShape(pShape, keyframe->Weight); } else diff --git a/AssetStudioGUI/Properties/Settings.Designer.cs b/AssetStudioGUI/Properties/Settings.Designer.cs index 3481db6..4003fa0 100644 --- a/AssetStudioGUI/Properties/Settings.Designer.cs +++ b/AssetStudioGUI/Properties/Settings.Designer.cs @@ -157,7 +157,7 @@ namespace AssetStudioGUI.Properties { [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("False")] + [global::System.Configuration.DefaultSettingValueAttribute("True")] public bool allFrames { get { return ((bool)(this["allFrames"])); diff --git a/AssetStudioGUI/Properties/Settings.settings b/AssetStudioGUI/Properties/Settings.settings index 02aa915..e7958e3 100644 --- a/AssetStudioGUI/Properties/Settings.settings +++ b/AssetStudioGUI/Properties/Settings.settings @@ -36,7 +36,7 @@ 0.25 - False + True True diff --git a/AssetStudioGUI/app.config b/AssetStudioGUI/app.config index 099c4be..02ad31c 100644 --- a/AssetStudioGUI/app.config +++ b/AssetStudioGUI/app.config @@ -41,7 +41,7 @@ 0.25 - False + True True diff --git a/AssetStudioUtility/ModelConverter.cs b/AssetStudioUtility/ModelConverter.cs index e7b1e6a..a858d77 100644 --- a/AssetStudioUtility/ModelConverter.cs +++ b/AssetStudioUtility/ModelConverter.cs @@ -803,7 +803,8 @@ namespace AssetStudio return; } - var track = iAnim.FindTrack(GetPathFromHash(binding.path)); + var path = FixBonePath(GetPathFromHash(binding.path)); + var track = iAnim.FindTrack(path); switch (binding.attribute) { diff --git a/README.md b/README.md index 2c96091..c7c75e0 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ AssetStudio is a tool for exploring, extracting and exporting assets and assetbu ## Features * Support version: - * 2.5 - 2018.3 + * 2.5 - 2019.1 * Support asset types: * **Texture2D** : support convert to bmp, png or jpeg. export to containers: DDS, PVR and KTX * **Sprite** : bmp, png or jpeg