Skip to content

Commit cb514a6

Browse files
Changed default export path (#799)
* Changed to default the path. Unsure if mac works * Fixed Mac path
1 parent c28ce42 commit cb514a6

File tree

1 file changed

+26
-5
lines changed

1 file changed

+26
-5
lines changed

exporter/SynthesisFusionAddin/src/UI/ConfigCommand.py

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"""
44

55
from enum import Enum
6+
import platform
67
from ..general_imports import *
78
from ..configure import NOTIFIED, write_configuration
89
from ..Analytics.alert import showAnalyticsAlert
@@ -934,6 +935,7 @@ def notify(self, args):
934935
"""
935936
Instantiating all the event handlers
936937
"""
938+
937939
onExecute = ConfigureCommandExecuteHandler(
938940
json.dumps(
939941
previous, default=lambda o: o.__dict__, sort_keys=True, indent=1
@@ -1172,12 +1174,31 @@ def notify(self, args):
11721174
# defaultPath = self.fp
11731175
# defaultPath = os.getenv()
11741176

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"
11791196
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+
11811202

11821203
if savepath == False:
11831204
# save was canceled

0 commit comments

Comments
 (0)