Skip to content

Commit 2188011

Browse files
committed
Export animator with each AnimationClip individually
1 parent 13f37ec commit 2188011

File tree

2 files changed

+22
-7
lines changed

2 files changed

+22
-7
lines changed

AssetStudioFBXNative/AssetStudioFBXNative.vcxproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,16 @@
7575
<TargetExt>.dll</TargetExt>
7676
<OutDir>bin\$(Platform)\$(Configuration)\</OutDir>
7777
<IntDir>obj\$(Platform)\$(Configuration)\</IntDir>
78+
<IncludePath>C:\Program Files\Autodesk\FBX\FBX SDK\2020.2.1\include;$(IncludePath)</IncludePath>
79+
<LibraryPath>C:\Program Files\Autodesk\FBX\FBX SDK\2020.2.1\lib\vs2019\x86\release;$(LibraryPath)</LibraryPath>
7880
</PropertyGroup>
7981
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
8082
<LinkIncremental>false</LinkIncremental>
8183
<TargetExt>.dll</TargetExt>
8284
<OutDir>bin\$(Platform)\$(Configuration)\</OutDir>
8385
<IntDir>obj\$(Platform)\$(Configuration)\</IntDir>
86+
<IncludePath>C:\Program Files\Autodesk\FBX\FBX SDK\2020.2.1\include;$(IncludePath)</IncludePath>
87+
<LibraryPath>C:\Program Files\Autodesk\FBX\FBX SDK\2020.2.1\lib\vs2019\x86\release;$(LibraryPath)</LibraryPath>
8488
</PropertyGroup>
8589
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
8690
<LinkIncremental>true</LinkIncremental>

AssetStudioGUI/Studio.cs

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -850,26 +850,37 @@ public static void ExportAnimatorWithAnimationClip(AssetItem animator, List<Asse
850850
ThreadPool.QueueUserWorkItem(state =>
851851
{
852852
Progress.Reset();
853-
Logger.Info($"Exporting {animator.Text}");
854-
Logger.Debug($"Selected AnimationClip(s):\n\"{string.Join("\"\n\"", animationList.Select(x => x.Text))}\"");
853+
Logger.Info($"Exporting {animator.Text} with {animationList.Count} AnimationClip(s)...");
854+
855855
try
856856
{
857-
ExportAnimator(animator, exportPath, animationList);
857+
int current = 0;
858+
foreach (var clip in animationList)
859+
{
860+
var clipFolder = Path.Combine(exportPath, clip.Text);
861+
Directory.CreateDirectory(clipFolder);
862+
863+
Logger.Info($"Exporting clip: {clip.Text} to {clipFolder}");
864+
865+
ExportAnimator(animator, clipFolder, new List<AssetItem> { clip });
866+
Progress.Report(++current, animationList.Count);
867+
}
868+
858869
if (Properties.Settings.Default.openAfterExport)
859870
{
860871
OpenFolderInExplorer(exportPath);
861872
}
862-
Progress.Report(1, 1);
863-
Logger.Info($"Finished exporting {animator.Text}");
873+
874+
Logger.Info($"Finished exporting all clips for {animator.Text}");
864875
}
865876
catch (Exception ex)
866877
{
867-
Logger.Error($"Export Animator:{animator.Text} error", ex);
868-
Logger.Info("Error in export");
878+
Logger.Error($"Export Animator error for {animator.Text}", ex);
869879
}
870880
});
871881
}
872882

883+
873884
public static void ExportObjectsWithAnimationClip(string exportPath, TreeNodeCollection nodes, List<AssetItem> animationList = null)
874885
{
875886
ThreadPool.QueueUserWorkItem(state =>

0 commit comments

Comments
 (0)