From 217a7993e9cd14359abb61d90ed5ffe0b7fedf08 Mon Sep 17 00:00:00 2001 From: Perfare Date: Thu, 6 Aug 2020 12:56:47 +0800 Subject: [PATCH] fixed bug --- AssetStudioFBXWrapper/FbxExporterContext.cs | 9 +++++++-- AssetStudioGUI/Studio.cs | 4 ++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/AssetStudioFBXWrapper/FbxExporterContext.cs b/AssetStudioFBXWrapper/FbxExporterContext.cs index 375569e..24e24b5 100644 --- a/AssetStudioFBXWrapper/FbxExporterContext.cs +++ b/AssetStudioFBXWrapper/FbxExporterContext.cs @@ -210,8 +210,13 @@ namespace AssetStudio.FbxInterop private void ExportMesh(ImportedFrame rootFrame, List materialList, List textureList, IntPtr frameNode, ImportedMesh importedMesh, bool exportSkins) { var boneList = importedMesh.BoneList; - var totalBoneCount = boneList.Count; - var hasBones = exportSkins && boneList != null && totalBoneCount > 0; + var totalBoneCount = 0; + var hasBones = false; + if (exportSkins && boneList?.Count > 0) + { + totalBoneCount = boneList.Count; + hasBones = true; + } var pClusterArray = IntPtr.Zero; diff --git a/AssetStudioGUI/Studio.cs b/AssetStudioGUI/Studio.cs index cf0ea4d..af3f2a9 100644 --- a/AssetStudioGUI/Studio.cs +++ b/AssetStudioGUI/Studio.cs @@ -76,7 +76,7 @@ namespace AssetStudioGUI return 0; } - private static int ExtractStreamFile(string extractPath,StreamFile[] fileList) + private static int ExtractStreamFile(string extractPath, StreamFile[] fileList) { int extractedCount = 0; foreach (var file in fileList) @@ -328,7 +328,7 @@ namespace AssetStudioGUI { key = -1 - type.m_ScriptTypeIndex; } - items.Add(key, new TypeTreeItem(key, type.m_Nodes)); + items[key] = new TypeTreeItem(key, type.m_Nodes); } typeMap.Add(assetsFile.unityVersion, items); }