Supported merge GameObject to export

This commit is contained in:
Perfare
2019-07-17 12:51:00 +08:00
parent 738b084440
commit e9e8390bbc
6 changed files with 164 additions and 54 deletions

View File

@ -1723,7 +1723,6 @@ namespace AssetStudioGUI
jumpToSceneHierarchyToolStripMenuItem.Visible = false;
showOriginalFileToolStripMenuItem.Visible = false;
exportAnimatorwithselectedAnimationClipMenuItem.Visible = false;
exportobjectswithselectedAnimationClipMenuItem.Visible = false;
if (assetListView.SelectedIndices.Count == 1)
{
@ -1737,10 +1736,6 @@ namespace AssetStudioGUI
{
exportAnimatorwithselectedAnimationClipMenuItem.Visible = true;
}
else if (selectedAssets.All(x => x.Type == ClassIDType.AnimationClip))
{
exportobjectswithselectedAnimationClipMenuItem.Visible = true;
}
}
contextMenuStrip1.Show(assetListView, e.X, e.Y);
@ -1828,6 +1823,43 @@ namespace AssetStudioGUI
}
}
private void exportSelectedObjectsmergeToolStripMenuItem_Click(object sender, EventArgs e)
{
if (sceneTreeView.Nodes.Count > 0)
{
var gameObjects = new List<GameObject>();
GetSelectedParentNode(sceneTreeView.Nodes, gameObjects);
var saveFileDialog = new SaveFileDialog();
saveFileDialog.FileName = gameObjects[0].m_Name + " (merge).fbx";
saveFileDialog.AddExtension = false;
saveFileDialog.Filter = "Fbx file (*.fbx)|*.fbx";
if (saveFileDialog.ShowDialog() == DialogResult.OK)
{
var exportPath = saveFileDialog.FileName;
ExportObjectsMergeWithAnimationClip(exportPath, openAfterExport.Checked, gameObjects);
}
}
}
private void exportSelectedObjectsmergeWithAnimationClipToolStripMenuItem_Click(object sender, EventArgs e)
{
if (sceneTreeView.Nodes.Count > 0)
{
var gameObjects = new List<GameObject>();
GetSelectedParentNode(sceneTreeView.Nodes, gameObjects);
var saveFileDialog = new SaveFileDialog();
saveFileDialog.FileName = gameObjects[0].m_Name + " (merge).fbx";
saveFileDialog.AddExtension = false;
saveFileDialog.Filter = "Fbx file (*.fbx)|*.fbx";
if (saveFileDialog.ShowDialog() == DialogResult.OK)
{
var exportPath = saveFileDialog.FileName;
var animationList = GetSelectedAssets().Where(x => x.Type == ClassIDType.AnimationClip).ToList();
ExportObjectsMergeWithAnimationClip(exportPath, openAfterExport.Checked, gameObjects, animationList.Count == 0 ? null : animationList);
}
}
}
private void jumpToSceneHierarchyToolStripMenuItem_Click(object sender, EventArgs e)
{
var selectasset = (AssetItem)assetListView.Items[assetListView.SelectedIndices[0]];