Community
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Transfer Scripts to New Versions

Transfer Scripts to New Versions

When installing a new version, that would be extremely useful if we could transfer all third-party scripts, plugins, and modifiers to a new version of 3DS Max, without having to manually install them.

 

Some users, like me, use lots of third-party scripts and plugins, which can take up to one day of work to be re-installed and all set. Saving the UI and the hotkeys do help, but it doesn't prevent the users from having to re-install everything in the new version.

29 Comments
ronilson3d
Explorer

Eu tbm concordo, ideia muito boa, e uito trabalhoso ficar reinstalando e configurando tudo do zero em uma nova versão do Max 

shawnolson
Autodesk

This idea is far more challenging than it seems on the surface because of these reasons:

  • Very often, plugins for one version of Max do not work in other versions and will cause startup errors.
  • Although MAXScript is generally forward compatible, many MAXScripts (especially packaged tools) often have installation/setup processes that require many files from many folders--and there is no way for us to know all the dependencies in scripts.
  • MAXScript files can actually load C++ plugins... which goes back to the problems above.

I personally cannot see a safe way to transfer these files with the expectation that no problems will arise. It will generally only work in the specific case of the scripts all being fully contained MAXScript with no external dependencies or compiled plugins.

 

That being said, we do now use a new mechanism for deploying scripts and plugins called the Autodesk Application Plug-in Package format. We are encouraging developers and users to use this for their scripts and plugins. If you package your scripts with this method, future Max installs will automatically load any plugin that doesn't specify a min/max version that excludes those new installs.

attilaszabo
Alumni

Hi @FredericoCM , if you have scripts that you know and expect to work across 3ds Max versions, please feel free to store them in specific location and then set the User Script and User Startup script paths to that location using the Configure User and System paths dialog.

Other than that, as Shaw said, you can create a package out of your scripts and copy the package to C:\ProgramData\Autodesk\ApplicationPlugins\<name of your package>\ folder.

 

Please let us know if these answers are not satisfactory and we'd love to hear more details about your use case.

 

Thanks,

 

FredericoCM
Enthusiast

Thanks for replying, @shawnolson  and @attilaszabo!

So, If I got that right, I should be able to create a package for each script I currently use, and after that, considering these scripts are going to be compatible with future versions of Max, I would be able to automatically install all of them in future versions. Is it correct? Also, there is no need to edit any of these scripts, right?

 

Also, besides the documentation on Packaging Plug-ins, are there any tutorials available on this subject? This feature looks really interesting, but as I'm not familiar with scripting, it looks somehow challenging to me.

 

But anyway, I'll follow the documentation and see if I can create a package.  I'll come back with the results then 🙂

attilaszabo
Alumni

HI @FredericoCM , you can put all your scripts in one package.
Here's an example PackageContent.xml file which specifies a pre-stratup script, a post-startup script and a macro script

<?xml version="1.0" encoding="utf-8"?>
<ApplicationPackage SchemaVersion="1.0"
    ProductType="Application"
    AutodeskProduct="3ds Max"

    Name="Test Script Package"
    Description="Testing packaging of scripts"
    AppVersion="1.0.0"
    FriendlyVersion="1.0.0"
    Author="User"
    ProductCode="{bd7b2a0d-bd72-43fa-91fc-f352a8de5016}"
    UpgradeCode="{88cda472-83bc-4d9c-ad9a-912f82d74951}">

    <RuntimeRequirements OS="Win64" Platform="3ds Max" SeriesMin="2015" SeriesMax="2022" />

    <CompanyDetails Name="User" />

    <Components Description="pre-start-up scripts parts">
        <RuntimeRequirements OS="Win64" Platform="3ds Max" SeriesMin="2015" SeriesMax="2022"  />
        <ComponentEntry ModuleName="./Scripts/pre-startup.ms" />
    </Components>
    <Components Description="post-start-up scripts parts">
        <RuntimeRequirements OS="Win64" Platform="3ds Max" SeriesMin="2015" SeriesMax="2022"/>
        <ComponentEntry ModuleName="./Scripts/post-startup.ms" />
    </Components>
    <Components Description="macroscripts parts">
        <RuntimeRequirements OS="Win64" Platform="3ds Max" SeriesMin="2015"  SeriesMax="2022"/>
        <ComponentEntry ModuleName="./Scripts/Macro.mcr" />
    </Components>
</ApplicationPackage>

The SeriesMax element needs to be specified for the package to load.

To make this package load in the next major version of 3ds Max, you just need to change the SeriesMax values.
We'll look into not making the SeriesMax value mandatory for script components in the future, but only for binary plugin components.
For security reasons, the best is to list explicitly all scripts that are part of the package. This avoids situations where somehow PackageContents.xml is modified without your knowledge and a new component is added, and then loaded by 3ds Max.

 

I hope this helps. Let us know how your experiment with package your scripts is working out. I'm looking forward to hearing your feedback.

 

Thanks

 

MysticLtd
Advocate

A GUI based tool to create such XML files would be a great help.

FredericoCM
Enthusiast

@attilaszabo thank you for the example! It'll definitely help me. I'll give it another try this Sunday and see what I get 🙂

FredericoCM
Enthusiast

@MysticLtd yeah, that would be great

attilaszabo
Alumni

Thanks for your idea @MysticLtd. We'll consider it.

FredericoCM
Enthusiast

@attilaszabo I think I managed to understand how it works. I started trying to pack one single script, which was Meshtools. So, following both your example and the documentation, I ended up getting this:

 

<?xml version="1.0" encoding="utf-8"?>
<ApplicationPackage SchemaVersion="1.0"
    ProductType="Application"
    AutodeskProduct="3ds Max"

    Name="Meshtools"
    Description="Testing this package"
    AppVersion="1.0.0"
    FriendlyVersion="1.0.0"
    Author=" Laszlo Sebo"
    ProductCode="{038aec37-84d8-47a7-a732-0ac0e34bdd94}"
    UpgradeCode="{71288a82-6407-4543-add2-9259d08ac486}">

    <RuntimeRequirements OS="Win64" Platform="3ds Max" SeriesMin="2014" SeriesMax="2022" />

    <CompanyDetails Name=" Laszlo Sebo" />

    <Components Description="plugins parts">
        <RuntimeRequirements OS="Win64" Platform="3ds Max" SeriesMin="2014" SeriesMax="2022"  />
        <ComponentEntry ModuleName="./Scripts/Meshtools_2_x_removal.ms" />
    </Components>
	<Components Description="plugins parts">
        <RuntimeRequirements OS="Win64" Platform="3ds Max" SeriesMin="2014" SeriesMax="2022"  />
        <ComponentEntry ModuleName="./Scripts/Meshtools-Functions.ms" />
    </Components>
    <Components Description="macroscripts parts">
        <RuntimeRequirements OS="Win64" Platform="3ds Max" SeriesMin="2014" SeriesMax="2022"/>
        <ComponentEntry ModuleName="./Scripts/Meshtools-Macroscripts.mcr" />
    </Components>
    <Components Description="light icon paths parts">
        <RuntimeRequirements OS="Win64" Platform="3ds Max" SeriesMin="2014" SeriesMax="2022" />
        <ComponentEntry AppName="lighticons" Version="1.0.0" ModuleName="./icons/Light" />
    </Components>
    <Components Description="dark icon paths parts">
        <RuntimeRequirements OS="Win64" Platform="3ds Max" SeriesMin="2014" SeriesMax="2022" />
        <ComponentEntry AppName="darkicons" Version="1.0.0" ModuleName="./icons/Dark" />
    </Components>
</ApplicationPackage>

 


I picked Meshtools because it requires different files to be placed in different folders so that I could get a better idea of how it works. Even though I didn't test it yet, I'm already happy for being able to have a better understanding of this process and to manage to write that out. But let me know if you find something wrong.

What I'm trying to achieve now is to create a single package with all the scripts I use, following that same logic. However, I noticed that some of these scripts come in .mzp files. So in this case, what should the "Components Description" be? Should I stick with "plugins parts"? In this case, would 3DS Max be able to correctly extract each .mzp file without messing up the files and folders from different scripts?

attilaszabo
Alumni

Hi @FredericoCM ,
You have to put scripts (.ms extension) in a component that has one of these descriptions:

"pre-start-up scripts parts"

"post-start-up scripts parts"

"macroscripts parts"

 

"plugins part" is for binary plugins and it won't work for loading scripts.

 

Attila

FredericoCM
Enthusiast

@attilaszabo all right. In this case, how do I know which scripts should be labeled as pre-start-up and which should be post-start-up?

Regarding the .mzp files, should they also be labeled as pre/post-start-up, just like the .ms files?

attilaszabo
Alumni

@FredericoCM , to decide which scripts should be pre and which should be post startup, look at where they are loaded from now.

Any script that is a startup script, should be a pre-startup script (yeah, strange naming).

Any script that is not in the user's startup script folder should probably be a post-startup script.

 

The plugin package format does not support mzp files. You would need to unzip those and decide whether they are pre or post scripts.

 

I hope this helps

FredericoCM
Enthusiast

@attilaszabo thanks! So, this is how my Components section looks like now:

 

<Components Description="post-start-up scripts parts	">
        <RuntimeRequirements OS="Win64" Platform="3ds Max" SeriesMin="2014" SeriesMax="2022"  />
        <ComponentEntry ModuleName="./Scripts/Meshtools_2_x_removal.ms" />
    </Components>
	<Components Description="post-start-up scripts parts	">
        <RuntimeRequirements OS="Win64" Platform="3ds Max" SeriesMin="2014" SeriesMax="2022"  />
        <ComponentEntry ModuleName="./Scripts/Meshtools-Functions.ms" />
    </Components>
    <Components Description="macroscripts parts">
        <RuntimeRequirements OS="Win64" Platform="3ds Max" SeriesMin="2014" SeriesMax="2022"/>
        <ComponentEntry ModuleName="./Scripts/Meshtools-Macroscripts.mcr" />
    </Components>
    <Components Description="light icon paths parts">
        <RuntimeRequirements OS="Win64" Platform="3ds Max" SeriesMin="2014" SeriesMax="2022" />
        <ComponentEntry AppName="lighticons" Version="1.0.0" ModuleName="./icons/Light" />
    </Components>
    <Components Description="dark icon paths parts">
        <RuntimeRequirements OS="Win64" Platform="3ds Max" SeriesMin="2014" SeriesMax="2022" />
        <ComponentEntry AppName="darkicons" Version="1.0.0" ModuleName="./icons/Dark" />
    </Components>


As any of the .ms files of this plugin were located at the \scripts\Startup folder, I labeled them as post-start-up. If everything is correct, I will move on to packing all my scripts into one package.

Regarding the .mzp files, maybe that would be easier to simply install them separately using the Run Script command until Autodesk figures out how to deal with them in the plugin package 😄

FredericoCM
Enthusiast

@attilaszabo I think I managed to pack all my scripts together 😄

In fact, most of them, as I left a few .mzp files to be installed separately. This is how my .XML looks like:

 

<?xml version="1.0" encoding="utf-8"?>
<ApplicationPackage SchemaVersion="1.0"
    ProductType="Application"
    AutodeskProduct="3ds Max"

    Name="Frederico - Package"
    Description="Scripts and Plugins I use"
    AppVersion="1.0.0"
    FriendlyVersion="1.0.0"
    Author="Frederico"
    ProductCode="{038aec37-84d8-47a7-a732-0ac0e34bdd94}"
    UpgradeCode="{71288a82-6407-4543-add2-9259d08ac486}">

    <RuntimeRequirements OS="Win64" Platform="3ds Max" SeriesMin="2014" SeriesMax="2022" />

    <CompanyDetails Name="Frederico" />

    <Components Description="pre-start-up scripts parts">
        <RuntimeRequirements OS="Win64" Platform="3ds Max" SeriesMin="2014" SeriesMax="2022"  />
        <ComponentEntry ModuleName="./Scripts/arrow.ms" />
    </Components>
    <Components Description="pre-start-up scripts parts">
        <RuntimeRequirements OS="Win64" Platform="3ds Max" SeriesMin="2014" SeriesMax="2022"  />
        <ComponentEntry ModuleName="./Scripts/simplehelix.ms" />
    </Components>
	<Components Description="post-start-up scripts parts">
        <RuntimeRequirements OS="Win64" Platform="3ds Max" SeriesMin="2014" SeriesMax="2022"  />
        <ComponentEntry ModuleName="./Scripts/CreateHoles.mse" />
    </Components>
	<Components Description="post-start-up scripts parts">
        <RuntimeRequirements OS="Win64" Platform="3ds Max" SeriesMin="2014" SeriesMax="2022"  />
        <ComponentEntry ModuleName="./Scripts/InfoDisplay.ms" />
    </Components>
	<Components Description="post-start-up scripts parts">
        <RuntimeRequirements OS="Win64" Platform="3ds Max" SeriesMin="2014" SeriesMax="2022"  />
        <ComponentEntry ModuleName="./Scripts/miauumeasureandselect_0.ms" />
    <Components Description="post-start-up scripts parts">
        <RuntimeRequirements OS="Win64" Platform="3ds Max" SeriesMin="2014" SeriesMax="2022"  />
        <ComponentEntry ModuleName="./Scripts/Meshtools_2_x_removal.ms" />
    </Components>
	<Components Description="post-start-up scripts parts	">
        <RuntimeRequirements OS="Win64" Platform="3ds Max" SeriesMin="2014" SeriesMax="2022"  />
        <ComponentEntry ModuleName="./Scripts/Meshtools-Functions.ms" />
    </Components>
    <Components Description="macroscripts parts">
        <RuntimeRequirements OS="Win64" Platform="3ds Max" SeriesMin="2014" SeriesMax="2022"/>
        <ComponentEntry ModuleName="./Scripts/Meshtools-Macroscripts.mcr" />
    </Components>
	<Components Description="post-start-up scripts parts	">
        <RuntimeRequirements OS="Win64" Platform="3ds Max" SeriesMin="2014" SeriesMax="2022"  />
        <ComponentEntry ModuleName="./Scripts/Zorb-Modifier Modifier 2.mse" />
    </Components>
    <Components Description="macroscripts parts">
        <RuntimeRequirements OS="Win64" Platform="3ds Max" SeriesMin="2014" SeriesMax="2022"/>
        <ComponentEntry ModuleName="./Scripts/Zorb-Modifier Modifier 2.mcr" />
    </Components>
	<Components Description="post-start-up scripts parts	">
        <RuntimeRequirements OS="Win64" Platform="3ds Max" SeriesMin="2014" SeriesMax="2022"  />
        <ComponentEntry ModuleName="./Scripts/merlinScripts_MrClean.mse" />
    </Components>
	<Components Description="post-start-up scripts parts	">
        <RuntimeRequirements OS="Win64" Platform="3ds Max" SeriesMin="2014" SeriesMax="2022"  />
        <ComponentEntry ModuleName="./Scripts/merlinScripts_VRayPropertiesChecker.mse" />
    </Components>
	<Components Description="post-start-up scripts parts	">
        <RuntimeRequirements OS="Win64" Platform="3ds Max" SeriesMin="2014" SeriesMax="2022"  />
        <ComponentEntry ModuleName="./Scripts/merlinScripts_MrCleanLoader.ms" />
    </Components>
	<Components Description="post-start-up scripts parts	">
        <RuntimeRequirements OS="Win64" Platform="3ds Max" SeriesMin="2014" SeriesMax="2022"  />
        <ComponentEntry ModuleName="./Scripts/uniconnector_v3.96.ms" />
    </Components>
	<Components Description="post-start-up scripts parts	">
        <RuntimeRequirements OS="Win64" Platform="3ds Max" SeriesMin="2014" SeriesMax="2022"  />
        <ComponentEntry ModuleName="./Scripts/wireColourTools.ms" />
    </Components>
    <Components Description="macroscripts parts">
        <RuntimeRequirements OS="Win64" Platform="3ds Max" SeriesMin="2014" SeriesMax="2022"/>
        <ComponentEntry ModuleName="./Scripts/wireColourTools_Macro.mcr" />
    </Components>
    <Components Description="macroscripts parts">
        <RuntimeRequirements OS="Win64" Platform="3ds Max" SeriesMin="2014" SeriesMax="2022"/>
        <ComponentEntry ModuleName="./Scripts/jjtools2013_basepivot_tsn_jc.mcr" />
    </Components>
    <Components Description="macroscripts parts">
        <RuntimeRequirements OS="Win64" Platform="3ds Max" SeriesMin="2014" SeriesMax="2022"/>
        <ComponentEntry ModuleName="./Scripts/crosscutss.mcr" />
    </Components>
    <Components Description="macroscripts parts">
        <RuntimeRequirements OS="Win64" Platform="3ds Max" SeriesMin="2014" SeriesMax="2022"/>
        <ComponentEntry ModuleName="./Scripts/turntoinstance.mcr" />
    </Components>
    <Components Description="macroscripts parts">
        <RuntimeRequirements OS="Win64" Platform="3ds Max" SeriesMin="2014" SeriesMax="2022"/>
        <ComponentEntry ModuleName="./Scripts/ShivaTools_VertexCleaner.mcr" />
    </Components>
    <Components Description="light icon paths parts">
        <RuntimeRequirements OS="Win64" Platform="3ds Max" SeriesMin="2014" SeriesMax="2022" />
        <ComponentEntry AppName="lighticons" Version="1.0.0" ModuleName="./icons/Light" />
    </Components>
    <Components Description="dark icon paths parts">
        <RuntimeRequirements OS="Win64" Platform="3ds Max" SeriesMin="2014" SeriesMax="2022" />
        <ComponentEntry AppName="darkicons" Version="1.0.0" ModuleName="./icons/Dark" />
    </Components>
</ApplicationPackage>


I've already placed my package folder, containing this .XML file + all the scripts, macros, icons, etc into "C:\ProgramData\Autodesk\ApplicationPlugins\".

Now, there's something else I'd like to know. Each of the scripts inside my plugins folder is organized into sub-folders. So, I have a sub-folder for the InfoDisplay script, another one for the TurnToInstance script, and so on. But I have only one .XML file (the one I pasted above), which is located in my plugin package root folder. Given that, when I finally load my package in a new version of 3DS Max, is it going to search for each sub-folder inside my plugin package, in other to find all the .ms, .mse files, macros, and icons? Or should I place everything mixed together in the root folder, without any sub-folders?

attilaszabo
Alumni

Hi @FredericoCM ,

 

You can keep your scripts organized in subfolders (ex. .\Scripts\InfoDisplay). We recommend you list each script to be loaded in the PackageContents.xml file, so it's clear for you and 3ds Max what should be loaded and what shouldn't be.
In your PackageContents.xml, you can list each component type only once, and then in that section list all the files of that type. For example, you can have one component for macros, and inside it list all macro files as below:

<Components Description="macroscripts parts">
        <RuntimeRequirements OS="Win64" Platform="3ds Max" SeriesMin="2014" SeriesMax="2022"/>
        <ComponentEntry ModuleName="./Scripts/turntoinstance.mcr" />
        <ComponentEntry ModuleName="./Scripts/jjtools2013_basepivot_tsn_jc.mcr" />
        ...
</Components>

 

FredericoCM
Enthusiast

@attilaszabo thanks! I've just fixed all my components. One more thing: I noticed that one of my plugins (Mr. Clean) uses a .txt file to store file locations. In this case, how could I load this .txt from the PackageContents.xml? I mean: under which Components Description should this text file be placed?

So, once the PackageContents.xml is all set, and my Plugin Package folder structure corresponds to this .xml file, all I have to do is to place my Plugin Package folder in "C:\ProgramData\Autodesk\ApplicationPlugins\", and 3DS Max would automatically load everything next time I open the program. Is it correct?

attilaszabo
Alumni

It sounds like that .txt file is used by a plugin or script, so it needs to be found and loaded by it, and not by 3ds Max or by the Plugin Package loader. So just make sure that the txt file can be found by Mr. Clean.

 

Once you have your PackageContents.xml and the files it describes, just copy them all to a sub-folder of C:\ProgramData\Autodesk\Application plugins. So for example, the plugin package might look like this in the end on disk.

C:\ProgramData\Autodesk\ApplicationPlugins\FredericosScripts\PackageContents.xml

C:\ProgramData\Autodesk\ApplicationPlugins\FredericosScripts\Scripts\<all the script go in this folder or in subfolders. they all need to be listed in PackageContents.xml>

You might want to keep the PackageContents.xml simple at first and see if it works, i.e. if Max loads the scripts is describes. Then keep adding more scripts to it and test at every step.

 

Let us know how it goes!

FredericoCM
Enthusiast

@attilaszabo I've just tested it on Max 2020, and I've got a few problems:

Regarding specifically to UnChamfer Pro, 3DS Max wasn't able to find its .ms files, even though everything is all right in the .xml document (which corresponds exactlçy to the folder structure of the plugin package). This is one of those plugins that require the user to manually copy and paste files into 3DS Max folders. I still didn't check to see if other plugins of the same kind had this issue, as I didn't get any other error messages.

Also, I realized that every time I start 3DS Max, it installs all the scripts over again, which leads to many annoying GUI windows popping out. So, I end up having to close all these windows every time I run 3DS Max.

Do you know if there's any solution to these problems?

attilaszabo
Alumni

Hi @FredericoCM , I'd need more detailed information on these issues in order to attempt to help.

For example, could you show me where the UnChamfer files are supposed to installed, and then also show the PackageContents.xml for it? Also, what are the error messages you are encountering?

>every time I start 3DS Max, it installs all the scripts over again

Is this related to UnChamfer or some other scripts? What exactly do you mean that "it installs the scripts again"?

If the scripts are in a plugin package, they are installed there. If they are executed more than once by 3ds Max, you might also have the same scripts loaded and executed from a different location than the plugin package.

If you could use 3ds Max 2022 Update 1, you could look into the Max.log file to see all the scripts Max loads, and that perhaps would help. Max.log is located in "C:\Users\<username>\AppData\Local\Autodesk\3dsMax\2022 - 64bit\ENU\Network\Max.log"

Can't find what you're looking for? Ask the community or share your knowledge.

Submit Idea  

Autodesk Design & Make Report