-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
20 changed files
with
319 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
.vs/ | ||
.vscode/ | ||
/build/ | ||
build/ | ||
dist/ | ||
*.log | ||
.DS_Store | ||
*.pkg | ||
*.exe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import os | ||
|
||
|
||
def makeDirectories(directory: str | os.PathLike[str]) -> str | os.PathLike[str]: | ||
"""Ensures than an input directory exists and attempts to create it if it doesn't.""" | ||
os.makedirs(directory, exist_ok=True) | ||
return directory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,37 @@ | ||
import os | ||
import platform | ||
from pathlib import Path | ||
|
||
from src.GlobalManager import GlobalManager | ||
from src.Types import OperatingSystemString | ||
from src.Util import makeDirectories | ||
|
||
APP_NAME = "Synthesis" | ||
APP_TITLE = "Synthesis Robot Exporter" | ||
DESCRIPTION = "Exports files from Fusion into the Synthesis Format" | ||
INTERNAL_ID = "Synthesis" | ||
ADDIN_PATH = os.path.dirname(os.path.realpath(__file__)) | ||
IS_RELEASE = str(Path(os.path.abspath(__file__)).parent.parent.parent.parent).split(os.sep)[-1] == "ApplicationPlugins" | ||
|
||
SYSTEM = platform.system() | ||
SYSTEM: OperatingSystemString = platform.system() | ||
assert SYSTEM != "Linux" | ||
|
||
if SYSTEM == "Windows": | ||
SUPPORT_PATH = makeDirectories(os.path.expandvars(r"%appdata%\Autodesk\Synthesis")) | ||
else: | ||
assert SYSTEM == "Darwin" | ||
SUPPORT_PATH = makeDirectories(f"{os.path.expanduser('~')}/.config/Autodesk/Synthesis") | ||
|
||
gm = GlobalManager() | ||
|
||
__all__ = ["APP_NAME", "APP_TITLE", "DESCRIPTION", "INTERNAL_ID", "ADDIN_PATH", "SYSTEM", "gm"] | ||
__all__ = [ | ||
"APP_NAME", | ||
"APP_TITLE", | ||
"DESCRIPTION", | ||
"INTERNAL_ID", | ||
"ADDIN_PATH", | ||
"IS_RELEASE", | ||
"SYSTEM", | ||
"SUPPORT_PATH", | ||
"gm", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
FUSION_ADDIN_LOCATION=~/Library/Application\ Support/Autodesk/ApplicationPlugins/ | ||
|
||
if [ ! -d "$FUSION_ADDIN_LOCATION" ]; then | ||
mkdir -p "$FUSION_ADDIN_LOCATION" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
|
||
FUSION_ADDIN_LOCATION=~/Library/Application\ Support/Autodesk/ApplicationPlugins/ | ||
EXPORTER_SOURCE_DIR=../../../exporter/SynthesisFusionAddin/ | ||
|
||
mkdir -p tmp/ | ||
cp -r synthesis.bundle tmp/ | ||
rsync -av ../synthesis.bundle tmp/ | ||
cp -r "$EXPORTER_SOURCE_DIR"/* tmp/synthesis.bundle/Contents/ | ||
|
||
pkgbuild --root tmp/ --identifier com.Autodesk.Synthesis --scripts Scripts/ --version 2.0.0 --install-location "$FUSION_ADDIN_LOCATION" SynthesisExporter.pkg | ||
productbuild --distribution distribution.xml --package-path . SynthesisExporterInstaller.pkg | ||
|
||
rm SynthesisExporter.pkg | ||
rm -r tmp/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<installer-gui-script minSpecVersion="1"> | ||
<title>Synthesis Exporter Installer</title> | ||
<choices-outline> | ||
<line choice="default"> | ||
<line choice="install"/> | ||
</line> | ||
</choices-outline> | ||
<choice id="default"/> | ||
<choice id="install" title="Install MyApp" description="Installs MyApp"> | ||
<pkg-ref id="com.Autodesk.Synthesis"/> | ||
</choice> | ||
<pkg-ref id="com.Autodesk.Synthesis" version="2.0.0" auth="root">#SynthesisExporter.pkg</pkg-ref> | ||
</installer-gui-script> |
46 changes: 46 additions & 0 deletions
46
installer/exporter/OSX/synthesis.bundle/Contents/Info.plist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>CFBundleDevelopmentRegion</key> | ||
<string>English</string> | ||
<key>CFBundleGetInfoString</key> | ||
<string>Synthesis addin for Fusion.</string> | ||
<key>CFBundleIdentifier</key> | ||
<string>Synthesis Exporter for Autodesk Fusion 360</string> | ||
<key>CFBundleShortVersionString</key> | ||
<string>2.0.0</string> | ||
<key>IFMajorVersion</key> | ||
<integer>1</integer> | ||
<key>IFMinorVersion</key> | ||
<integer>0</integer> | ||
<key>IFPkgFlagAllowBackRev</key> | ||
<false/> | ||
<key>IFPkgFlagAuthorizationAction</key> | ||
<string>AdminAuthorization</string> | ||
<key>IFPkgFlagBackgroundAlignment</key> | ||
<string>topleft</string> | ||
<key>IFPkgFlagBackgroundScaling</key> | ||
<string>none</string> | ||
<key>IFPkgFlagDefaultLocation</key> | ||
<string>/</string> | ||
<key>IFPkgFlagFollowLinks</key> | ||
<true/> | ||
<key>IFPkgFlagInstallFat</key> | ||
<false/> | ||
<key>IFPkgFlagIsRequired</key> | ||
<false/> | ||
<key>IFPkgFlagOverwritePermissions</key> | ||
<false/> | ||
<key>IFPkgFlagRelocatable</key> | ||
<false/> | ||
<key>IFPkgFlagRestartAction</key> | ||
<string>NoRestart</string> | ||
<key>IFPkgFlagRootVolumeOnly</key> | ||
<false/> | ||
<key>IFPkgFlagUpdateInstalledLanguages</key> | ||
<false/> | ||
<key>IFPkgFormatVersion</key> | ||
<real>0.1000000014901161</real> | ||
</dict> | ||
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Synthesis Exporter Installers | ||
|
||
This `readme` is for developers of Synthesis or those looking to build the installers themselves, if you are just looking for how to install our Fusion Exporter please navigate to [`/installer/`](../). | ||
|
||
## Windows | ||
|
||
The windows installer has the following prerequisites: | ||
- Python `3.9` or newer and pip. | ||
- And that's it! | ||
|
||
### To Build: | ||
|
||
Once you have verified that python and pip are installed on your computer: | ||
- Open a powershell window and navigate to [`/installer/exporter/Windows/`] | ||
- Run `./build.bat` in powershell. | ||
- After some time you should see `installer.exe` in your current directory. | ||
- And that's it! You have now built the Synthesis Exporter Installer for Windows! | ||
- You can then run the `.exe` from file explorer or alternatively, for debugging purposes, run `./installer.exe` from the terminal. | ||
|
||
## MacOS | ||
|
||
The Mac installer has zero prerequisites. Hooray! | ||
|
||
### To Build: | ||
|
||
- Navigate to [`/installer/exporter/OSX/`](./OSX/). | ||
- Run `./build.sh` in your terminal. | ||
- You should then find `SynthesisExporterInstaller.pkg` in your current directory. | ||
- And that's it! You now have built the Synthesis Exporter Installer for MacOS! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
@echo off | ||
setlocal enabledelayedexpansion | ||
setlocal | ||
|
||
python -m pip install -r requirements.txt --user | ||
|
||
set "EXPORTER_SOURCE_DIR=..\..\..\exporter\SynthesisFusionAddin\" | ||
|
||
mkdir tmp\synthesis.bundle\Contents\ | ||
xcopy ..\synthesis.bundle .\tmp\synthesis.bundle | ||
xcopy /e /i "%EXPORTER_SOURCE_DIR%" tmp\synthesis.bundle\Contents | ||
tar -a -c -f SynthesisExporter.zip -C tmp synthesis.bundle\* | ||
|
||
@REM Find and run pyinstaller, this is a workaround that allows you to call pip packages as scripts without | ||
@REM them being added to the system PATH. | ||
for /f "delims=" %%i in ('pip show pyinstaller') do ( | ||
echo %%i | findstr /b /c:"Location:" >nul | ||
if not errorlevel 1 ( | ||
set "location_line=%%i" | ||
) | ||
) | ||
|
||
set "executable=!location_line:Location: =!" | ||
for %%a in ("%executable%") do set "executable=%%~dpa" | ||
set "executable=%executable%Scripts\pyinstaller.exe " | ||
set executable=%executable:~0,-1% | ||
|
||
%executable% --onefile --add-data "SynthesisExporter.zip;." installer.py | ||
|
||
move .\dist\installer.exe . | ||
rmdir /s /q tmp | ||
rmdir /s /q build | ||
rmdir /s /q dist | ||
del SynthesisExporter.zip | ||
del installer.spec | ||
|
||
endlocal |
Oops, something went wrong.