@@ -469,6 +469,12 @@ public enum LODExportType {
469
469
[ SerializeField ]
470
470
string convertToModelSavePath ;
471
471
472
+ [ SerializeField ]
473
+ private List < string > exportModelSavePaths = new List < string > ( ) ;
474
+
475
+ public int selectedExportModelPath = 0 ;
476
+ private int maxStoredSavePaths = 5 ;
477
+
472
478
// List of names in order that they appear in option list
473
479
[ SerializeField ]
474
480
private List < string > dccOptionNames = new List < string > ( ) ;
@@ -485,6 +491,7 @@ protected override void LoadDefaults()
485
491
HideSendToUnityMenu = true ;
486
492
ExportFormatSelection = 0 ;
487
493
convertToModelSavePath = kDefaultSavePath ;
494
+ exportModelSavePaths = new List < string > ( ) { kDefaultSavePath } ;
488
495
IntegrationSavePath = DefaultIntegrationSavePath ;
489
496
dccOptionPaths = null ;
490
497
dccOptionNames = null ;
@@ -978,17 +985,57 @@ public static string GetRelativeSavePath() {
978
985
return NormalizePath ( relativePath , isRelative : true ) ;
979
986
}
980
987
988
+ public static string [ ] GetRelativeSavePaths ( ) {
989
+ var exportSavePaths = instance . exportModelSavePaths ;
990
+ if ( exportSavePaths . Count == 0 ) {
991
+ exportSavePaths . Add ( kDefaultSavePath ) ;
992
+ }
993
+ string [ ] relSavePaths = new string [ exportSavePaths . Count ] ;
994
+ for ( int i = 0 ; i < relSavePaths . Length ; i ++ ) {
995
+ relSavePaths [ i ] = string . Format ( "Assets\\ {0}" , exportSavePaths [ i ] == "." ? "" : NormalizePath ( exportSavePaths [ i ] , isRelative : true ) . Replace ( "/" , "\\ " ) ) ;
996
+ }
997
+ return relSavePaths ;
998
+ }
999
+
1000
+ public static void AddExportModelSavePath ( string savePath ) {
1001
+ savePath = ConvertToAssetRelativePath ( savePath ) ;
1002
+ var exportSavePaths = instance . exportModelSavePaths ;
1003
+ if ( exportSavePaths . Contains ( savePath ) ) {
1004
+ // move to first place if it isn't already
1005
+ if ( exportSavePaths [ 0 ] == savePath ) {
1006
+ return ;
1007
+ }
1008
+ exportSavePaths . Remove ( savePath ) ;
1009
+ }
1010
+
1011
+ if ( exportSavePaths . Count >= instance . maxStoredSavePaths ) {
1012
+ // remove last used path
1013
+ exportSavePaths . RemoveAt ( exportSavePaths . Count - 1 ) ;
1014
+ }
1015
+
1016
+ exportSavePaths . Insert ( 0 , savePath ) ;
1017
+ instance . selectedExportModelPath = 0 ;
1018
+ }
1019
+
1020
+ public static string GetAbsoluteSavePath ( string relativePath ) {
1021
+ var absolutePath = Path . Combine ( Application . dataPath , relativePath ) ;
1022
+ return NormalizePath ( absolutePath , isRelative : false ,
1023
+ separator : Path . DirectorySeparatorChar ) ;
1024
+ }
1025
+
981
1026
/// <summary>
982
1027
/// The path where Convert To Model will save the new fbx and prefab.
983
1028
/// This is an absolute path, with platform separators.
984
1029
/// </summary>
985
1030
public static string GetAbsoluteSavePath ( ) {
986
- var relativePath = GetRelativeSavePath ( ) ;
987
- var absolutePath = Path . Combine ( Application . dataPath , relativePath ) ;
988
- return NormalizePath ( absolutePath , isRelative : false ,
989
- separator : Path . DirectorySeparatorChar ) ;
1031
+ return GetAbsoluteSavePath ( GetRelativeSavePath ( ) ) ;
990
1032
}
991
1033
1034
+ public static string GetExportModelAbsoluteSavePath ( ) {
1035
+ return GetAbsoluteSavePath ( instance . exportModelSavePaths [ instance . selectedExportModelPath ] ) ;
1036
+ }
1037
+
1038
+
992
1039
/// <summary>
993
1040
/// Set the path where Convert To Model will save the new fbx and prefab.
994
1041
/// This is interpreted as being relative to the Application.dataPath
0 commit comments