@@ -141,7 +141,7 @@ private async void AssetStudioGUIForm_DragDrop(object sender, DragEventArgs e)
141141 private async void loadFile_Click ( object sender , EventArgs e )
142142 {
143143 openFileDialog1 . InitialDirectory = openDirectoryBackup ;
144- if ( openFileDialog1 . ShowDialog ( ) == DialogResult . OK )
144+ if ( openFileDialog1 . ShowDialog ( this ) == DialogResult . OK )
145145 {
146146 ResetForm ( ) ;
147147 openDirectoryBackup = Path . GetDirectoryName ( openFileDialog1 . FileNames [ 0 ] ) ;
@@ -167,7 +167,7 @@ private async void loadFolder_Click(object sender, EventArgs e)
167167
168168 private async void extractFileToolStripMenuItem_Click ( object sender , EventArgs e )
169169 {
170- if ( openFileDialog1 . ShowDialog ( ) == DialogResult . OK )
170+ if ( openFileDialog1 . ShowDialog ( this ) == DialogResult . OK )
171171 {
172172 var saveFolderDialog = new OpenFolderDialog ( ) ;
173173 saveFolderDialog . Title = "Select the save folder" ;
@@ -222,10 +222,6 @@ private async void BuildAssetStructures()
222222
223223 sceneTreeView . BeginUpdate ( ) ;
224224 sceneTreeView . Nodes . AddRange ( treeNodeCollection . ToArray ( ) ) ;
225- foreach ( var node in treeNodeCollection )
226- {
227- node . HideCheckBox ( ) ;
228- }
229225 sceneTreeView . EndUpdate ( ) ;
230226 treeNodeCollection . Clear ( ) ;
231227
@@ -461,7 +457,7 @@ private void displayAssetInfo_Check(object sender, EventArgs e)
461457 private void showExpOpt_Click ( object sender , EventArgs e )
462458 {
463459 var exportOpt = new ExportOptions ( ) ;
464- exportOpt . ShowDialog ( ) ;
460+ exportOpt . ShowDialog ( this ) ;
465461 }
466462
467463 private void assetListView_RetrieveVirtualItem ( object sender , RetrieveVirtualItemEventArgs e )
@@ -1384,25 +1380,32 @@ private void ExportMergeObjects(bool animation)
13841380 {
13851381 var gameObjects = new List < GameObject > ( ) ;
13861382 GetSelectedParentNode ( sceneTreeView . Nodes , gameObjects ) ;
1387- var saveFileDialog = new SaveFileDialog ( ) ;
1388- saveFileDialog . FileName = gameObjects [ 0 ] . m_Name + " (merge).fbx" ;
1389- saveFileDialog . AddExtension = false ;
1390- saveFileDialog . Filter = "Fbx file (*.fbx)|*.fbx" ;
1391- saveFileDialog . InitialDirectory = saveDirectoryBackup ;
1392- if ( saveFileDialog . ShowDialog ( ) == DialogResult . OK )
1393- {
1394- saveDirectoryBackup = Path . GetDirectoryName ( saveFileDialog . FileName ) ;
1395- var exportPath = saveFileDialog . FileName ;
1396- List < AssetItem > animationList = null ;
1397- if ( animation )
1383+ if ( gameObjects . Count > 0 )
1384+ {
1385+ var saveFileDialog = new SaveFileDialog ( ) ;
1386+ saveFileDialog . FileName = gameObjects [ 0 ] . m_Name + " (merge).fbx" ;
1387+ saveFileDialog . AddExtension = false ;
1388+ saveFileDialog . Filter = "Fbx file (*.fbx)|*.fbx" ;
1389+ saveFileDialog . InitialDirectory = saveDirectoryBackup ;
1390+ if ( saveFileDialog . ShowDialog ( this ) == DialogResult . OK )
13981391 {
1399- animationList = GetSelectedAssets ( ) . Where ( x => x . Type == ClassIDType . AnimationClip ) . ToList ( ) ;
1400- if ( animationList . Count == 0 )
1392+ saveDirectoryBackup = Path . GetDirectoryName ( saveFileDialog . FileName ) ;
1393+ var exportPath = saveFileDialog . FileName ;
1394+ List < AssetItem > animationList = null ;
1395+ if ( animation )
14011396 {
1402- animationList = null ;
1397+ animationList = GetSelectedAssets ( ) . Where ( x => x . Type == ClassIDType . AnimationClip ) . ToList ( ) ;
1398+ if ( animationList . Count == 0 )
1399+ {
1400+ animationList = null ;
1401+ }
14031402 }
1403+ ExportObjectsMergeWithAnimationClip ( exportPath , gameObjects , animationList ) ;
14041404 }
1405- ExportObjectsMergeWithAnimationClip ( exportPath , gameObjects , animationList ) ;
1405+ }
1406+ else
1407+ {
1408+ StatusStripUpdate ( "No Object selected for export." ) ;
14061409 }
14071410 }
14081411 }
0 commit comments