|
3 | 3 | """
|
4 | 4 |
|
5 | 5 | from enum import Enum
|
| 6 | +import platform |
6 | 7 | from ..general_imports import *
|
7 | 8 | from ..configure import NOTIFIED, write_configuration
|
8 | 9 | from ..Analytics.alert import showAnalyticsAlert
|
@@ -934,6 +935,7 @@ def notify(self, args):
|
934 | 935 | """
|
935 | 936 | Instantiating all the event handlers
|
936 | 937 | """
|
| 938 | + |
937 | 939 | onExecute = ConfigureCommandExecuteHandler(
|
938 | 940 | json.dumps(
|
939 | 941 | previous, default=lambda o: o.__dict__, sort_keys=True, indent=1
|
@@ -1172,12 +1174,31 @@ def notify(self, args):
|
1172 | 1174 | # defaultPath = self.fp
|
1173 | 1175 | # defaultPath = os.getenv()
|
1174 | 1176 |
|
1175 |
| - if mode == 5: |
1176 |
| - savepath = FileDialogConfig.SaveFileDialog( |
1177 |
| - defaultPath=self.fp, ext="Synthesis File (*.synth)" |
1178 |
| - ) |
| 1177 | + # if mode == 5: |
| 1178 | + # savepath = FileDialogConfig.SaveFileDialog( |
| 1179 | + # defaultPath=self.fp, ext="Synthesis File (*.synth)" |
| 1180 | + # ) |
| 1181 | + # else: |
| 1182 | + # savepath = FileDialogConfig.SaveFileDialog(defaultPath=self.fp) |
| 1183 | + |
| 1184 | + processedFileName = gm.app.activeDocument.name.replace(' ', '_') |
| 1185 | + dropdownExportMode = INPUTS_ROOT.itemById("mode") |
| 1186 | + if dropdownExportMode.selectedItem.index == 0: |
| 1187 | + isRobot = True |
| 1188 | + elif dropdownExportMode.selectedItem.index == 1: |
| 1189 | + isRobot = False |
| 1190 | + |
| 1191 | + if platform.system() == "Windows": |
| 1192 | + if isRobot: |
| 1193 | + savepath = os.getenv("APPDATA") + "\\Autodesk\\Synthesis\\Mira\\" + processedFileName + ".mira" |
| 1194 | + else: |
| 1195 | + savepath = os.getenv("APPDATA") + "\\Autodesk\\Synthesis\\Mira\\Fields\\" + processedFileName + ".mira" |
1179 | 1196 | else:
|
1180 |
| - savepath = FileDialogConfig.SaveFileDialog(defaultPath=self.fp) |
| 1197 | + if isRobot: |
| 1198 | + savepath = "~/.config/Autodesk/Synthesis/Mira/" + processedFileName + ".mira" |
| 1199 | + else: |
| 1200 | + savepath = "~/.config/Autodesk/Synthesis/Mira/Fields" + processedFileName + ".mira" |
| 1201 | + |
1181 | 1202 |
|
1182 | 1203 | if savepath == False:
|
1183 | 1204 | # save was canceled
|
|
0 commit comments