Prototype animation export

This commit is contained in:
Perfare
2018-04-07 07:51:33 +08:00
parent 4bcbdbc57d
commit 0b111d5f79
33 changed files with 3700 additions and 45 deletions
+53 -1
View File
@@ -1025,10 +1025,20 @@ namespace AssetStudio
}
else
{
StatusStripUpdate("Unsupported sprite for preview");
StatusStripUpdate("Unsupported sprite for preview.");
}
break;
}
case ClassIDReference.Animator:
{
StatusStripUpdate("Can be exported as a FBX file.");
break;
}
case ClassIDReference.AnimationClip:
{
StatusStripUpdate("Select AnimationClip with selecting Animator to export");
break;
}
default:
{
var str = asset.ViewStruct();
@@ -1523,6 +1533,12 @@ namespace AssetStudio
exportedCount++;
}
break;
case ClassIDReference.Animator:
if (ExportAnimator(asset, exportpath))
{
exportedCount++;
}
break;
default:
if (ExportRawFile(asset, exportpath))
{
@@ -1853,5 +1869,41 @@ namespace AssetStudio
glControl1.Invalidate();
}
}
private void ExportAnimatorwithAnimationClip_Click(object sender, EventArgs e)
{
AssetPreloadData animator = null;
List<AssetPreloadData> animationList = new List<AssetPreloadData>();
for (int i = 0; i < assetListView.SelectedIndices.Count; i++)
{
var index = assetListView.SelectedIndices[i];
var asset = (AssetPreloadData)assetListView.Items[index];
if (asset.Type2 == 95) //Animator
{
animator = asset;
}
else if (asset.Type2 == 74) //AnimationClip
{
animationList.Add(asset);
}
}
if (animator != null)
{
var saveFolderDialog1 = new OpenFolderDialog();
if (saveFolderDialog1.ShowDialog(this) == DialogResult.OK)
{
var savePath = saveFolderDialog1.Folder;
string exportpath = savePath + "\\Animator\\";
SetProgressBarValue(0);
SetProgressBarMaximum(1);
ThreadPool.QueueUserWorkItem(state =>
{
StatusStripUpdate(ExportAnimator(animator, animationList, exportpath) ? "Successfully exported" : "Nothing exported.");
ProgressBarPerformStep();
});
}
}
}
}
}