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 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);

View File

@ -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<String^>^ 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

View File

@ -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"]));

View File

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

View File

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

View File

@ -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)
{

View File

@ -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