1- using System ;
1+ using System ;
22using System . Collections . Generic ;
33using System . IO ;
44using System . Linq ;
@@ -81,7 +81,7 @@ protected override async Task ExecuteProcessBulkAsync(bool all = false)
8181 {
8282 return ;
8383 }
84-
84+
8585 if ( _archiveManager . ProjectArchive is not FileSystemArchive projectArchive )
8686 {
8787 _loggerService . Error ( "No project loaded!" ) ;
@@ -198,12 +198,12 @@ protected override async Task LoadFilesAsync()
198198 Items . Add ( vm ) ;
199199 }
200200 }
201-
202- ProcessAllCommand . NotifyCanExecuteChanged ( ) ;
203-
201+
202+ ProcessAllCommand . NotifyCanExecuteChanged ( ) ;
203+
204204
205205 _progressService . IsIndeterminate = false ;
206-
206+
207207 HasItems = Items . Any ( ) ;
208208 }
209209
@@ -270,8 +270,9 @@ private void InitOpusCollectionEditor(CallbackArguments args, OpusExportArgs opu
270270 switch ( args . PropertyName )
271271 {
272272 case nameof ( OpusExportArgs . SelectedForExport ) :
273- opusExportArgs . SelectedForExport =
274- new List < uint > ( result . Cast < CollectionItemViewModel < uint > > ( ) . Select ( _ => _ . Model ) ) ;
273+ opusExportArgs . SelectedForExport = result . Cast < CollectionItemViewModel < uint > > ( )
274+ . Select ( _ => _ . Model )
275+ . ToList ( ) ;
275276 _notificationService . Success ( $ "Selected opus items were added.") ;
276277 break ;
277278 default :
@@ -284,7 +285,7 @@ private void InitOpusCollectionEditor(CallbackArguments args, OpusExportArgs opu
284285 private void InitMeshCollectionEditor ( CallbackArguments args , MeshExportArgs meshExportArgs )
285286 {
286287 var fetchExtension = ERedExtension . mesh ;
287- List < FileEntry > selectedEntries = new ( ) ;
288+ List < FileEntry > selectedEntries = [ ] ;
288289 switch ( args . PropertyName )
289290 {
290291 case nameof ( MeshExportArgs . MultiMeshMeshes ) :
@@ -327,48 +328,61 @@ private void InitMeshCollectionEditor(CallbackArguments args, MeshExportArgs mes
327328 switch ( args . PropertyName )
328329 {
329330 case nameof ( MeshExportArgs . MultiMeshMeshes ) :
330- meshExportArgs . MultiMeshMeshes =
331- result . Cast < CollectionItemViewModel < FileEntry > > ( ) . Select ( _ => _ . Model ) . ToList ( ) ;
332- if ( meshExportArgs . MultiMeshMeshes . Count != 0 )
331+ var meshes = result . Cast < CollectionItemViewModel < FileEntry > > ( )
332+ . Select ( _ => _ . Model )
333+ . ToList ( ) ;
334+
335+ meshExportArgs . MultiMeshMeshes . Clear ( ) ;
336+ if ( meshes . Count != 0 )
333337 {
334- _notificationService . Success ( $ "Selected Meshes were added to MultiMesh arguments." ) ;
338+ meshExportArgs . MultiMeshMeshes . AddRange ( meshes ) ;
335339 meshExportArgs . meshExportType = MeshExportType . Multimesh ;
340+
341+ _notificationService . Success ( $ "Changed selection of Meshes in MultiMesh.") ;
336342 }
337343 else
338344 {
339- _notificationService . Success ( "MultiMesh arguments were cleared ." ) ;
345+ _notificationService . Success ( "Cleared MultiMesh ." ) ;
340346 }
341347
342348 break ;
343349
344350 case nameof ( MeshExportArgs . MultiMeshRigs ) :
345- meshExportArgs . MultiMeshRigs =
346- result . Cast < CollectionItemViewModel < FileEntry > > ( ) . Select ( _ => _ . Model ) . ToList ( ) ;
347- if ( meshExportArgs . MultiMeshRigs . Count != 0 )
351+ var rigs = result . Cast < CollectionItemViewModel < FileEntry > > ( )
352+ . Select ( _ => _ . Model )
353+ . ToList ( ) ;
354+
355+ meshExportArgs . MultiMeshRigs . Clear ( ) ;
356+ if ( rigs . Count != 0 )
348357 {
349- _notificationService . Success ( $ "Selected Rigs were added to MultiMesh arguments." ) ;
358+ meshExportArgs . MultiMeshRigs . AddRange ( rigs ) ;
350359 meshExportArgs . meshExportType = MeshExportType . Multimesh ;
360+
361+ _notificationService . Success ( $ "Changed selection of Rigs in MultiMesh.") ;
351362 }
352363 else
353364 {
354- _notificationService . Success ( $ "Selected Rigs were cleared .") ;
365+ _notificationService . Success ( $ "Cleared Rigs.") ;
355366 }
356367
357368 break ;
358369
359370 case nameof ( MeshExportArgs . Rig ) :
360- meshExportArgs . Rig . Clear ( ) ;
371+ var rig = result . Cast < CollectionItemViewModel < FileEntry > > ( )
372+ . Select ( _ => _ . Model )
373+ . FirstOrDefault ( ) ;
361374
362- var rig = result . Cast < CollectionItemViewModel < FileEntry > > ( ) . Select ( _ => _ . Model ) . FirstOrDefault ( ) ;
375+ meshExportArgs . Rig . Clear ( ) ;
363376 if ( rig is not null )
364377 {
365378 meshExportArgs . Rig . Add ( rig ) ;
366- _notificationService . Success ( $ "Selected Rig was added to WithRig arguments: { rig . Name } ") ;
367379 meshExportArgs . meshExportType = MeshExportType . WithRig ;
380+
381+ _notificationService . Success ( $ "Selected WithRig \" { rig . Name } \" .") ;
368382 }
369383 else
370384 {
371- _notificationService . Success ( $ "Selected Rig was cleared ") ;
385+ _notificationService . Success ( $ "Cleared WithRig. ") ;
372386 }
373387
374388 break ;
0 commit comments