[Closed] macroscript quad menu names?
My question. I have following kind of beginning in my macroscripts:
macroscript PP_Skin_wrap_add
category:“PP”
tooltip:“PP Skin wrap add”
icon:#(“Maxscript”, 1)
(
I have quite many small commands like this (not shown here completely…) which i use from right click menu. I used to have “buttontext:” also defined for buttons. This made the quad menus to show this short text which i had for toolbar buttons. I deleted the “buttontext” definition from script, and yet 3ds max shows all the old buttontexts in quadmenus? (in this case, it showed “skin wrap”)
I tried many things to get rid of this – I removed the menu. Then i deleted scripts from macroscript folder and finally restarted max. Then, when i added the scripts again, i still got the buttontext names?
Only way i managed to go around this, was to change the macroscript and category names (propably just the category?)
I guess this information goes somewhere in max ini files or into registry? it’s not a big problem, just very annoying. It would be nice to hear if someone else has had similar problems, and has found a solution for this problem!
MacroScripts are automatically stored in the form Category-Name.mcr in the Ui\Macroscripts, and in Max 9, in the user’s alternative Macroscripts location, something like
C:\Documents and Settings\YOURNAME\Local Settings\Application Data\Autodesk\3dsmax\9 – 32bit\enu\UI\usermacros\
In this case in Max 9, scripts in the usermacros folder override scripts in the default 3ds max 9\Ui\Macroscripts folder.
To completely remove a macroscript, simply locate the MCR file with the category and name matching your definition and delete it.
Here I am assuming that your source code is NOT placed in a plugin or startup folder and is thus only executed when you press Ctrl+E. It would be a big mistake to store an .MS file containing a MacroScript definition in an auto-loading path.
Do a search for the category-name.mcr form of your script and figure out where it was stored. Chances are there is another definition of your macro overriding the one you are changing. Normally, changing the source code and reevaluating it should change the name on the QuadMenu.
Bobo:
I have put my .mcr files into UI\macroscript folder manually. All my files have PP_ prefix, so i can find them quickly. I’m in max 8 SP3
Most of my scripts are very simple like one below. This is PP_convert_to_poly.mcr, located in \3dsmax8\UI\MacroScripts:
macroscript PP_Convert_to_poly
category:“PP”
toolTip:“PP Convert to poly”
icon:#(“Maxscript”, 1)
(
for a in selection do
(
convertToPoly a
)
)
-
I see it in my group called PP in customize, and i have just dragged it to my quad menu. This is the way i have used macro scripts so far…
-
Now everything is ok. (since i named all the files…) but i have to see if i have accidentally cut n pasted my scripts into some other location too.
-
Thanks!
That’s what I am talking about – DON’T COPY .MCR files manually anywhere. NEVER. EVER.
Max is in charge of creating them and placing them where they belong.
*Create one big .MS file in a folder that is not evaluated on startup.
*Write all MacroScript definitions in that file.
*Save.
*Press Ctrl+E
–> At this point, Max will create .MCR files from each MacroScript definition automatically and save them under the name “PP-WhateverTheNameIs.mcr” into the correct directory. You don’t have to know where it is, but in general until Max 9 it was Ui/Macroscripts, since Max 9 in is the usermacros path I mentioned.
If someday you decide to edit a script’s code, open the big .MS file with all definitions, make your changes, save under a new name or put in a version control system or whatever you do to back up your sources. Press Ctrl+E and all macros in the MS file will be updated where they should, creating new .MCR files in the correct folder automagically, and hopefully updating all existing ones.
When you put your own .MCR files in a system folder, you risk having duplicates of the same code with different file names. There is no way to know which version of the script will be loaded last, thus it could happen that an older version could override your new code.
If you leave the management to Max, this problem does not exist anymore.
If you change the category or script name, you will have two independent copies of the script – either in the same category but with different name, or with the same name in two different categories, or completely different ones. In this case you could delete the obsolete ones manually by following the automatic category-name.mcr pattern to locate them.
As you can see, you don’t have to prefix your MacroScripts with PP_, since the automatically created .MCR files will start with PP- if you used PP as category.
You get the picture?
“You get the picture?”
-
Ummm… i think yes
-
Bobo, you should make Autodesk put something like this into max script manual! Maybe there was a starter tutorial for dummies, but i must have skipped it! Anyway, this will help a lot – i’m sure. So far i didn’t have any problems, that’s why i haven’t worried too much about the way i have added macroscripts
-
Big thanks!
I put it in there 4 releases ago!
Read the topic “MacroScripts for New Users”