Export by nodes

This commit is contained in:
Razmoth
2023-05-11 20:42:38 +04:00
parent 7411939a8f
commit 006a87938c
3 changed files with 100 additions and 1 deletions

View File

@@ -1578,6 +1578,41 @@ namespace AssetStudioGUI
}
}
private void exportSelectedNodessplitToolStripMenuItem_Click(object sender, EventArgs e)
{
ExportNodes(false);
}
private void exportSelectedNodessplitSelectedAnimationClipsToolStripMenuItem_Click(object sender, EventArgs e)
{
ExportNodes(true);
}
private void ExportNodes(bool animation)
{
if (sceneTreeView.Nodes.Count > 0)
{
var saveFolderDialog = new OpenFolderDialog();
saveFolderDialog.InitialFolder = saveDirectoryBackup;
if (saveFolderDialog.ShowDialog(this) == DialogResult.OK)
{
saveDirectoryBackup = saveFolderDialog.Folder;
var exportPath = Path.Combine(saveFolderDialog.Folder, "GameObject") + Path.DirectorySeparatorChar;
var roots = sceneTreeView.Nodes.Cast<TreeNode>().Where(x => x.Level == 0 && x.Checked).ToList();
List<AssetItem> animationList = null;
if (animation)
{
animationList = GetSelectedAssets().Where(x => x.Type == ClassIDType.AnimationClip).ToList();
if (animationList.Count == 0)
{
animationList = null;
}
}
ExportNodesWithAnimationClip(exportPath, roots, animationList);
}
}
}
private void goToSceneHierarchyToolStripMenuItem_Click(object sender, EventArgs e)
{
var selectasset = (AssetItem)assetListView.Items[assetListView.SelectedIndices[0]];