[Closed] Accessing variables between Max instances??
Hi all.
Is it possible to have two instances of Max launched and ie. from Max A and script launched in MAX A access a global variable from MAX B?
What sort of data do you want to exchange?
There’s a way to exchange data via ini files via setIniSetting and getIniSetting. Or you could write a text file via openFile etc.
You could save out maxobjects via save selected and import in the other max instance. It can all be done with some clear naming conventions and load/save locations.
Maybe you can be more specific,
-Johan
The thing is that the script is basically a copy and paste for materials (or array of materials with a group of objects selected).
Was actually hoping that there is a way of defining a super global variable that would be accessible across max instances.
The problem with storing it to disk is that you never know what kind of material it will be with what parameters (don’t want to limit the script in any way).
I guess I could build a temporary material library, save all the materials there, save an ini file pairing material name with an object name, then load these two into another max and work from there, but you see it sounds pretty complicated – was hoping that maybe I’m missing a simple trick of some sort
PEN: could you elaborate on the COM idea?
why do you need the second instance of MAX? do you want to edit both scenes at the same time?
you could try to save a material library file and load it.
I haven’t tried that so I’m not sure it is possible via mxs though.
I already have it working within one max instance.
A friend of mine asked me if it could work between instances as well – he likes to have his project open in one max and use a second one as a resource viewer. I can see that copying a material from a different scene version to your currently open scene would be handy for him, instead of going through hoops to get a material from one scene to another.
Especially if he wants to copy materials of an entire group of objects (ie. a light fixture) which my script also does – but within the same max instance .
I guess i can make it work through temporary library file and ini file – just wanted to consult you guys before, so that I don’t miss a way simpler workflow
you can do the trick with material library to copy/paste materials across max instances but later your friend will ask you to copy controllers, or modifiers, or anything else. I don’t think that the using of more that one max instances at the same time is a good practice but I also had some friend and made for him a tool to copy/paste almost any properties and subanims from XRef Scene nodes to Current Scene nodes. It works. Just think about this possibility.