3ds Max runs only on Windows, therefore the following documentation is for Windows only.
The project consists of two parts:
- A .NET Core project which handles all network interaction.
- MaxScripts which integrate the .NET project and create the user interface
This guide covers how to run maxScript and build .NET in Visual Studio Code. Template task.json and launch.json files are included in the repository.
These are not required, if only MAXScript files are changed.
- .NET Core SDK: Follow this link select Download .NET Core SDK and follow the instructions.
- AWS SDK for .NET is already included in the project file via NuGet. Therefore, building the project should automatically download the AWS SDK. If the Amazon.* namespaces are unavailable nevertheless, follow this link select Download MSI Installer and install the AWS Tools for Windows.
- Clone the repository.
- Open the repository as workspace in VS Code.
- In VS Code install the Language MaxScript extension (ctrl + shift + x).
- [Optional] Set a shortcut to run maxScripts by going to File->Preferences->Keyboard Shortcuts and set a shortcut for Tasks: Run Task.
Create the Windows Environment Variable ADSK_APPLICATION_PLUGINS
and set it to your repository.
The plugin should now be loaded on start-up.
To manually run the plugin:
- Start 3ds Max (to run scripts from VS Code 3ds Max has to be open)
- Open PluginPackage/PreStartupScripts/cesiumPlugin.ms.
- Run it with the Task Execute Script in 3ds Max.
- Open PluginPackage/Widgets/nameRequiredWidget.ms and run it. This creates a warning popup.
- Open PluginPackage/Widgets/mainWidget.ms and run it. This creates the Exporter popup window.
- Next open PluginPackage/PostStartupScripts/addMenus.ms and run it. This will add the menu item in 3ds Max under File->Export.
Running these files in a different order will create an error in 3ds Max.
To update the popup simply rerun the .ms
MaxScript file which creates it (for example mainWidget.ms
).
When you close and reopen 3ds Max it can happen that the previously created export menu item will get lost. In that case it will still appear in there but with the text Missing: exportButton'mxs docs
and without any functionality. To delete it open Customize->Customize User Interface.
The Customize User Interface Dialog
Open the Menus tab and delete it in the panel on the right under File->File-Export by selecting it and pressing delete on your keyboard or reset all menus by pressing the Reset button. Afterwards repeat the steps to run the plugin.
Press ctrl + shift + b. This builds the project for Release and places the binaries in the right folder (./PluginPackage/C#/).
The following guide helps in debugging the scripts.
Code can be debugged using the print "debug message"
command, or by creating a breakpoint using break()
. in the code.
The later one opens the MAXScript Debugger.
The MAXScript Debugger
While in the debugger enter ?
as command to see a list of available commands.
The MAXScript Debugger and the MAXScript Listener can also be opened via the Scripting menu in 3ds Max.
The MAXScript Listener
The MAXScript Listener shows errors and can be used to run maxScript snippets (similar to a python console). The content of a variable can be displayed by typing the name and pressing Enter.
- Open launch.json and change the arguments in brackets
<>
with the correct path. The first argument is the function name, the others are the function parameters. Instead of using arguments you can also change the main function in server.cs to do the desired task. But don't forget to change it back afterwards. - Go to the Debug Panel (ctrl + shift + d) and run in Debug Mode (F5).
- Pull down the latest master branch:
git pull origin master
. - Modify
PluginPackage/PackageContents.xml
and increment the minor version only:"AppVersion="1.0.0"
becomesAppVersion="1.1.0"
- Proofread and update CHANGES.md to capture any changes since last release.
- Commit and push these changes directly to master.
- Make sure the repository is clean
git clean -xdf
. This will delete all files not already in the repository. - Pack the content of the PluginPackage folder and name it
io-cesium-ion-vx.x.x.zip
(where x.x.x will be the version).
- Reset the User Interface in 3ds Max as described in Delete old menus.
- Close 3ds Max.
- Delete the token file at
%LOCALAPPDATA%/Autodesk/3dsMax/\<ReleaseNumber> - 64bit/ENU/plugcfg_ln/cesiumIonToken
. ReleaseNumber is usually the year of the release like 2020. - Delete all files named
cesiumion\<number>.fbx
andprogress\<number>.log
in%LOCALAPPDATA%/Autodesk/3dsMax/\<ReleaseNumber> - 64bit/ENU/temp/
- Unpack the created .zip file to
%ALLUSERSPROFILE%\Autodesk\ApplicationPlugins\
(e.g.C:\ProgramData\Autodesk\ApplicationPlugins
) or%APPDATA%\Autodesk\ApplicationPlugins\
(e.g.C:\Users\<username>\AppData\Roaming\Autodesk\ApplicationPlugins
).- The location of
PackageContents.xml
must be....\ApplicationPlugins\io-cesium-ion-vx.x.x\PackageContents.xml
. If this is not the case after unpacking, pack the release again accordingly.
- The location of
- Rename your repository or delete the path to your repository in the
ADSK_APPLICATION_PLUGINS
environment variable. - Start 3ds Max and open any model you would like to test.
- Use the plugin to export the model to Cesium ion. Be sure to try all the model type options.
- Try to force errors by interrupting the internet connection while uploading etc.
- After testing remove the previously copied
PluginPackage
folder and restore your repository name orADSK_APPLICATION_PLUGINS
environment variable.
- Test the plugin.
- Create and push a tag, e.g.,
git tag -a 1.1 -m '1.1 release'
git push origin 1.1
(do not usegit push --tags
)
- Publish the release zip file to GitHub
- Create new release.
- Select the tag you use pushed
- Enter
Cesium ion 3ds Max 1.x
for the title - In the description, include the date, list of highlights and permalink to CHANGES.md, which is in the format https://github.com/AnalyticalGraphicsInc/cesium-ion-3ds-max-plugin/blob/1.xx/CHANGES.md, where 1.xx is the version number.
- Attach the
io-cesium-ion-vx.x.x.zip
you generated during the build process. - Publish the release
- Tell the outreach team about the new release to have it included in the monthly release announcements/blog post and on social media.
- Update cesium.com with a link to the latest release zip.
- Complete the steps for release to github.
- Use VS Code Markdown PDF extension to create a PDF of the main
README.md
. - Add the generated
README.pdf
to the zip file. - Go to the app page on Autodesk App Store using this link. You will need to sign in using the
[email protected]
account (login details in LastPass). - Under Actions click Edit.
- Upload the new zip file under App File (remove any previous files).
- Update the version number.
- Update any text or screenshots as needed.
- Click continue to go to the next page, which contains information about pricing, versions and tags. Usually nothing to update here. Click continue again.
- Review the summary page. Click Preview to see how the app page will look on the app store. Go back and edit anything if needed, otherwise click continue. This will take you back to the page in step 4.
- On the left hand side, click the Submit button for send it to Autodesk for review and creating the installer.