fixed bugs

This commit is contained in:
Perfare 2019-04-18 11:07:51 +08:00
parent 8946a4fba5
commit edb6256fc9
7 changed files with 16 additions and 24 deletions

View File

@ -76,7 +76,7 @@ namespace AssetStudio {
void SetJointsFromImportedMeshes(bool allBones); void SetJointsFromImportedMeshes(bool allBones);
void ExportFrame(FbxNode* pParentNode, ImportedFrame^ frame); void ExportFrame(FbxNode* pParentNode, ImportedFrame^ frame);
void ExportMesh(FbxNode* pFrameNode, ImportedMesh^ meshList, bool normals); void ExportMesh(FbxNode* pFrameNode, ImportedMesh^ meshList, bool normals);
FbxNode* FindNodeByPath(String ^ path, bool recursive); FbxNode* FindNodeByPath(String ^ path);
FbxFileTexture* ExportTexture(ImportedTexture^ matTex); FbxFileTexture* ExportTexture(ImportedTexture^ matTex);
void ExportAnimations(bool eulerFilter, float filterValue, bool flatInbetween); void ExportAnimations(bool eulerFilter, float filterValue, bool flatInbetween);
void ExportKeyframedAnimation(ImportedKeyframedAnimation^ parser, FbxString& kTakeName, FbxAnimCurveFilterUnroll* eulerFilter, float filterPrecision, bool flatInbetween); void ExportKeyframedAnimation(ImportedKeyframedAnimation^ parser, FbxString& kTakeName, FbxAnimCurveFilterUnroll* eulerFilter, float filterPrecision, bool flatInbetween);

View File

@ -331,7 +331,7 @@ namespace AssetStudio
for (int i = 0; i < boneList->Count; i++) for (int i = 0; i < boneList->Count; i++)
{ {
ImportedBone^ bone = boneList[i]; ImportedBone^ bone = boneList[i];
FbxNode* lFrame = FindNodeByPath(bone->Path, false); FbxNode* lFrame = FindNodeByPath(bone->Path);
pBoneNodeList->Add(lFrame); pBoneNodeList->Add(lFrame);
} }
} }
@ -616,7 +616,7 @@ namespace AssetStudio
} }
} }
FbxNode* Fbx::Exporter::FindNodeByPath(String ^ path, bool recursive) FbxNode* Fbx::Exporter::FindNodeByPath(String ^ path)
{ {
array<String^>^ splitPath = path->Split('/'); array<String^>^ splitPath = path->Split('/');
FbxNode* lNode = pScene->GetRootNode(); FbxNode* lNode = pScene->GetRootNode();
@ -627,19 +627,10 @@ namespace AssetStudio
try try
{ {
pNodeName = StringToCharArray(frameName); pNodeName = StringToCharArray(frameName);
FbxNode* foundNode; FbxNode* foundNode = lNode->FindChild(pNodeName, false);
if (recursive && i == 0)
{
foundNode = lNode->FindChild(pNodeName);
}
else
{
foundNode = lNode->FindChild(pNodeName, false);
}
if (foundNode == NULL) if (foundNode == NULL)
{ {
//throw gcnew Exception(gcnew String("Couldn't find path ") + path); throw gcnew Exception(gcnew String("Couldn't find path ") + path);
return NULL;
} }
lNode = foundNode; lNode = foundNode;
} }
@ -766,7 +757,7 @@ namespace AssetStudio
for (int j = 0; j < pAnimationList->Count; j++) for (int j = 0; j < pAnimationList->Count; j++)
{ {
ImportedAnimationKeyframedTrack^ keyframeList = pAnimationList[j]; ImportedAnimationKeyframedTrack^ keyframeList = pAnimationList[j];
FbxNode* pNode = FindNodeByPath(keyframeList->Path, true); FbxNode* pNode = FindNodeByPath(keyframeList->Path);
if (pNode != nullptr) if (pNode != nullptr)
{ {
FbxAnimCurve* lCurveSX = pNode->LclScaling.GetCurve(lAnimLayer, FBXSDK_CURVENODE_COMPONENT_X, true); FbxAnimCurve* lCurveSX = pNode->LclScaling.GetCurve(lAnimLayer, FBXSDK_CURVENODE_COMPONENT_X, true);
@ -934,10 +925,10 @@ namespace AssetStudio
{ {
Marshal::FreeHGlobal((IntPtr)pMorphShapeName); Marshal::FreeHGlobal((IntPtr)pMorphShapeName);
} }
if (frameIdx == morph->Channels[i]->Item3 - 1) if (frameIdx == morph->Channels[i]->Item3 - 1)
{ {
FbxProperty::Create(lBlendShape, FbxStringDT, rootGroupProp.GetName() + "|" + pShape->GetName()); FbxProperty::Create(lBlendShape, FbxStringDT, rootGroupProp.GetName() + "|" + pShape->GetName());
} }
lBlendShapeChannel->AddTargetShape(pShape, keyframe->Weight); lBlendShapeChannel->AddTargetShape(pShape, keyframe->Weight);
} }
else else

View File

@ -157,7 +157,7 @@ namespace AssetStudioGUI.Properties {
[global::System.Configuration.UserScopedSettingAttribute()] [global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("False")] [global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool allFrames { public bool allFrames {
get { get {
return ((bool)(this["allFrames"])); return ((bool)(this["allFrames"]));

View File

@ -36,7 +36,7 @@
<Value Profile="(Default)">0.25</Value> <Value Profile="(Default)">0.25</Value>
</Setting> </Setting>
<Setting Name="allFrames" Type="System.Boolean" Scope="User"> <Setting Name="allFrames" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value> <Value Profile="(Default)">True</Value>
</Setting> </Setting>
<Setting Name="allBones" Type="System.Boolean" Scope="User"> <Setting Name="allBones" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value> <Value Profile="(Default)">True</Value>

View File

@ -41,7 +41,7 @@
<value>0.25</value> <value>0.25</value>
</setting> </setting>
<setting name="allFrames" serializeAs="String"> <setting name="allFrames" serializeAs="String">
<value>False</value> <value>True</value>
</setting> </setting>
<setting name="allBones" serializeAs="String"> <setting name="allBones" serializeAs="String">
<value>True</value> <value>True</value>

View File

@ -803,7 +803,8 @@ namespace AssetStudio
return; return;
} }
var track = iAnim.FindTrack(GetPathFromHash(binding.path)); var path = FixBonePath(GetPathFromHash(binding.path));
var track = iAnim.FindTrack(path);
switch (binding.attribute) switch (binding.attribute)
{ {

View File

@ -7,7 +7,7 @@ AssetStudio is a tool for exploring, extracting and exporting assets and assetbu
## Features ## Features
* Support version: * Support version:
* 2.5 - 2018.3 * 2.5 - 2019.1
* Support asset types: * Support asset types:
* **Texture2D** : support convert to bmp, png or jpeg. export to containers: DDS, PVR and KTX * **Texture2D** : support convert to bmp, png or jpeg. export to containers: DDS, PVR and KTX
* **Sprite** : bmp, png or jpeg * **Sprite** : bmp, png or jpeg