If you’re looking to render your MCG creations on a networked instance of 3dsMax, or if you’re a technical director looking to deploy your procedural MCG tools to a set of artists in your studio, or if you’re like me and you’ve accumulated a few hundred MCG tools and compounds and are looking to organize your “working set” of tools on a machine, you’ve come to the right place.
In this tutorial, we’ll be looking at how to deploy your MCG tools and compounds so they can be accessed and evaluated by multiple machines running 3dsMax. Specifically, we’ll be covering three ways to achieving this deployment:
- Network file path deployment
- Source control system deployment (Git, Perforce, etc)
- What I do
1. Network File Path Deployment
The first alternative we’ll be describing is the network file path approach. Here, we’ll be hosting our MCG files in the following network location: \\\\MY-SERVER\\mcg-deployment\\ and we’ll be reading them in an instance of 3dsMax running on the machine \\\\MY-RENDERER.
1. Start by creating a “Tools” and a “Compounds” directory on the deployment machine. The shared network location should have the following structure
\\\\MY-SERVER\\
mcg-deployment\\
Tools\\
Compounds\\
(!) Important: When you share this folder, make sure you give read permissions to the accounts and machines which will be accessing this network location.
2. Copy the .maxtool files you want to deploy into the folder \\\\MY-SERVER\\mcg-deployment\\Tools\\. You can organize your .maxtool files into subfolders under this directory.
3. Copy the .maxcompound files you want to deploy into the folder \\\\MY-SERVER\\mcg-deployment\\Compounds\\. You can organize these .maxcompound files into subfolders under this directory.
4. To know which .maxcompound files to copy for a given .maxtool, create an MCG package of the .maxtool file you want to deploy using "File > Package Max Creation Graph" in the Max Creation Graph Editor. Temporarily install this .mcg package on your local machine by selecting "Scripting > Install Max Creation Graph (.mcg) Package".
Once the MCG package is installed, go to your local machine’s MCG installation directory: C:\\Users\\<username>\\Autodesk\\3ds Max 2016\\Max Creation Graph\\Tools\\Downloads. In this directory, if we had installed the package my_geo.mcg, we would observe the following file structure:
C:\\Users\\<username>\\Autodesk\\3ds Max 2016\\Max Creation Graph\\Tools\\Downloads\\
my_geo.maxtool
my_geo.ms
my_geo.txt
my_geo\\
Compounds\\
*.maxcompound
Cut the file my_geo.maxtool, and paste it in the deployment machine’s Tools directory: \\\\MY-SERVER\\mcg-deployment\\Tools\\my_geo\\. The structure of the deployment machine’s shared folder should now look like this:
\\\\MY-SERVER\\
mcg-deployment\\
Tools\\
my_geo\\
my_geo.maxtool
Compounds\\
Likewise, cut all the .maxcompound files nested under your local machine’s directory: C:\\Users\\<username>\\Autodesk\\3ds Max 2016\\Max Creation Graph\\Tools\\Downloads\\my_geo\\Compounds\\*.maxcompound and paste them in the deployment machine’s directory: \\\\MY-SERVER\\mcg-deployment\\Compounds\\my_geo\\. The structure of the deployment machine’s shared folder should now look like this:
\\\\MY-SERVER\\
mcg-deployment\\
Tools\\
my_geo\\
my_geo.maxtool
Compounds\\
my_geo\\
*.maxcompound
To remove your temporary MCG package installation on your local machine, simply delete the files and folders in C:\\Users\\<username>\\Autodesk\\3ds Max 2016\\Max Creation Graph\\Tools\\Downloads whose names match the tool you installed. In our example, we would make sure to delete the files my_geo.maxtool, my_geo.ms, my_geo.txt and the my_geo\\ folder.
5. Next, access the \\\\MY-RENDERER machine, and open the file C:\\Users\\<username>\\AppData\\Local\\Autodesk\\3dsMax\\2016\\2016 - 64bit\\ENU\\3dsmax.ini in any text editor.
We’ll be using this .ini file to make sure the instance of 3dsMax running on \\\\MY-RENDERER will be able to fetch the .maxcompound and .maxtool files hosted on \\\\MY-SERVER. To do this, add the following lines at the bottom of the .ini file, then save your changes.
[MCG Compound Directories]
path1=\\\\MY-SERVER\\mcg-deployment\\Compounds
[MCG Tools Directories]
path1=\\\\MY-SERVER\\mcg-deployment\\Tools
You can also specify the paths using IP addresses instead of hostnames. In this case, if \\\\MY-SERVER had the IP address 5.5.5.5, you could specify your paths in the following way:
[MCG Compound Directories]
path1=\\\\5.5.5.5\\mcg-deployment\\Compounds
[MCG Tools Directories]
path1=\\\\5.5.5.5\\mcg-deployment\\Tools
You can specify more than one path in the [MCG Compounds Directories] and [MCG Tools Directories]. The only requirement is to ensure that the path keys be unique within each category, i.e. core, anim, experimental. For example, the paths below illustrate a hypothetical animation deployment:
[MCG Compound Directories]
core=\\\\DEV-HOST\\mcg-workspace\\Compounds\\core
anim=\\\\DEV-HOST\\mcg-workspace\\Compounds\\animation
experimental=\\\\RD-HOST\\experiments\\
[MCG Tools Directories]
anim=\\\\DEV-HOST\\mcg-workspace\\Tools\\anim
experimental=\\\\RD-HOST\\experiments\\
Note that you don’t need the same number of entries across the two categories. In fact, based on your personal preference, you can have the same folder contain both .maxcompound and .maxtool file types. As we describe below, the .maxcompound files encountered in these paths will be loaded first, followed by the .maxtool files.
6. Now that the .ini file is configured, the next time you start 3dsMax on \\\\MY-RENDERER, 3dsMax will load and evaluate the .maxcompound files in the following locations:
- The local 3dsMax installation directory on \\\\MY-RENDERER.
C:\\Program Files\\Autodesk\\3ds Max 2016\\MaxCreationGraph\\Compounds - The local user directory on \\\\MY-RENDERER.
C:\\Users\\<username>\\Autodesk\\3ds Max 2016\\Max Creation Graph\\Compounds - The paths listed under [MCG Compound Directories] in the \\\\MY-RENDERER’s .ini file.
\\\\MY-SERVER\\mcg-deployment\\Compounds
Keep in mind that any duplicate compounds encountered in this process will not be re-evaluated. You can also trigger this process manually by selecting "Operators > Reload Operators" from the Max Creation Graph Editor window.
7. Once all the compounds are loaded, 3dsMax will perform another pass to load and evaluate all the .maxtool files, based on their appearance in the following locations:
- The local 3dsMax installation directory on \\\\MY-RENDERER
C:\\Program Files\\Autodesk\\3ds Max 2016\\MaxCreationGraph\\Tools - The local user directory on \\\\MY-RENDERER
C:\\Users\\<username>\\Autodesk\\3ds Max 2016\\Max Creation Graph\\Tools - The paths listed under [MCG Tools Directories] in the \\\\MY-RENDERER’s .ini file.
\\\\MY-SERVER\\mcg-deployment\\Tools
Note that the number of .maxtool and .maxcompound files loaded and evaluated by 3dsMax when the application boots up will impact your startup time, so you might consider implementing separate tools in your favorite scripting language to selectively manage your tool deployment, and to configure the .ini files to your liking.
2. Source Control System Deployment
As another deployment alternative, consider using a version control system like Git or Perforce to synchronize your working tools and their compounds onto different machines. Explaining the detailed use of any given source control system is outside the scope of this tutorial, however the basic approach is to treat your MCG tools and compounds as a regular codebase.
Using this scheme, when you need to deploy your MCG tools, it’s a matter of ensuring your other machines are correctly synchronized with the latest version of the repository containing your .maxtool files and their dependent .maxcompound files.
In fact, regardless of which deployment method you choose, I strongly recommend you manage your tools and your compounds using a version control system. The .maxtool and .maxcompound files are actually XML representations of the source graph’s connectivity, and in the case of .maxtools, they also contain the custom UI MaxScript definitions. As such, changes made to these graphs can be easily parsed by common version control systems, and are not saved as binary files.
3. What I Do
Now, to give you a concrete insight into how I personally maintain my MCG tools and compounds: I use two Git repositories, one for my .maxtool files, called “mcg-tools” and one for all my .maxcompound files, called “mcg-compounds”. These repositories contain nested folders which are named and organized to my liking.
To make sure I always have access to the compounds I’ve created so far when I boot 3dsMax, and to make sure no compounds go missing, I keep my local mcg-compounds repository inside the directory C:\\Users\\<username>\\Autodesk\\3ds Max 2016\\Max Creation Graph\\Compounds\\. As we described previously, this path is automatically checked when 3dsMax is opened (and when the operators are reloaded). The advantage of using this directory is that I don’t need to change any settings in 3dsMax’s .ini file.
The reason why I maintain a separate mcg-tools repository is because I want to place my tools outside of Max’s default loading paths (i.e. on my Desktop). This might seem counterintuitive, however this has the advantage of minimizing 3dsMax’s startup time by avoiding the need to evaluate 100 different maxtools and to build 100 different plugin instances. Generally, I’m only working on one or two .maxtool files at a time, so the overhead of manually opening and evaluating these files in the Max Creation Graph Editor is an acceptable tradeoff for me.
When I want quick feedback about a tool, I’ll package it as an .mcg file and I’ll send it to one of my awesome coworkers, which they install by going to "Scripting > Install Max Creation Graph (.mcg) Package". This manual MCG package distribution and installation works well if you want to share your standalone tools with a client or with one or two teammates, however it does not scale for large and iterative deployments.
When I need to deploy my tools to a new machine, I first make sure my two master repositories are up-to-date, and I simply clone my mcg-compounds repository into the machine’s C:\\Users\\<username>\\Autodesk\\3ds Max 2016\\Max Creation Graph\\Compounds\\ directory (or if it already has a version of it, I pull the latest changes). Once that’s done, I copy the .maxtool files I want to distribute into the directory C:\\Users\\ashtonm\\Autodesk\\3ds Max 2016\\Max Creation Graph\\Tools.
Conclusion
To conclude, there is no clear-cut “best” way to deploy MCG tools and compounds; each method presented above has its tradeoffs. If anything, I hope this post has given you a deeper insight into how 3dsMax handles MCG files, and how to tailor your own MCG workflows to deploy your tools and compounds efficiently. Thanks for reading, and if you have any questions or comments, feel free to post below!