Notifications
Clear all

[Closed] XML Menu Sytem

 PEN

So just wondering if I’m missing anything here and need some input. I have a system already that updates my menus with items so that I can go from one version of max to another and I don’t have to worry about over writting the existing menus. Also for clients and productions I set up a system that auto loads menus and adds them to the main menu bar or other menus.
It really isn’t all that robust as it is a single script that I need to edit. What I would like is a system that reads from a file the setup that is to be applied.

Here is the format that I’m thinking of using, it is an xml file that will describe what you want it to do.

Any suggestions on what else I might want to consider? Just so you know this is xml that would have to be created by hand and not really ment for a non-programmer or just any old person in a given production.


 <menuMan>
 	
 	<!-- Create a quad menu or add items and menues to an existing quad -->
 	<quadMenu name="theQuad">
 		<quad1 name="">
 			<!-- An action that will call one of several commands. -->
 			<action type="deleteAll" />
 			<action type="deleteItem" name="theItemToDelete" />
 			<!-- This really wouldn't be that good an idea as each time that it is run it will delete the first item. -->
 			<action type="deleteItem" index="1" /> 
 			
 			<menuItem type="macro" name="testName" category="testCategory" position="-1"/>
 			<menu name="&Tools"  position="-1"/>
 		</quad1>
 		<quad2 name="" />
 		<quad3 name="" />
 		<quad4 name="" />
 	</quadMenu>	
 	
 	<!-- Create a new menu with an item -->
 	<menu name="PEN Tools">
 		<menuItem type="macro" name="testName" category="testCategory" position="-1"/>
 	</menu>
 	
 	<!-- Add a menu to the main menu bar -->
 	<menu name="Main Menu Bar">
 		<menu name="PEN Tools" position="-1"/>
 	</menu>
 	
 	<!-- This will just create a menu system with nested menus and items or update an existing menu system. -->
 	<menu name="theMenu">
 		<menuItem type="macro" name="testName" category="testCategory" position="-1"/>
 		<menuItem type="seperator"  position="-1"/>
 		
 		<menu name="theSubMenu">
 			<menuItem type="macro" name="testName" category="testCategory" position="-1"/>
 			<menuItem type="seperator"  position="-1"/>
 			<quadMenu name="theQuad" />
 		</menu>
 	</menu>
 	
 </menuMan>
 
7 Replies
 PEN

I have never actualy tried creating tool bars with Max script, is this possible?

I vaguely remember doing this via the SDK when i was still at Bioware…so i believe you can do it there.

But in maxscript, I believe you can only do it by editting the .mnu files directly in the UI folder.

I could be wrong…its been a while

 PEN

That is interesting actualy. Thanks for the idea, just hard to decifer what all the information is in reference to. It is the .cui file that I’m looking for. And I didn’t know that you could set the tab property to 1 and get the old tabbed button bar back. And since it is just an INI file then it should be fairly easy to manipulate once I sort out what it is I need to get and edit.

Hi Pen! Interesting idea, I’d be interested in seeing the final application.

Having said that, I took a quick scan over your xml and while it is all reasonable, I’d question this section:

 	<quadMenu name="theQuad">
		 <quad1 name="">
			 <!-- An action that will call one of several commands. -->
			 <action type="deleteAll" />
			 <action type="deleteItem" name="theItemToDelete" />
			 <!-- This really wouldn't be that good an idea as each time that it is run it will delete the first item. -->
			 <action type="deleteItem" index="1" /> 
			 
			 <menuItem type="macro" name="testName" category="testCategory" position="-1"/>
			 <menu name="&Tools"  position="-1"/>
		 </quad1>
		 <quad2 name="" />
		 <quad3 name="" />
		 <quad4 name="" />
	 </quadMenu>	

While there is nothing wrong with your approach, I’d question the need to “number” the quad sub elements. It quite reasonable to simple name them “<quad …>”.

I’ve noticed that many of you items have postion properties, I might suggest you do the same for the “quad” nodes. I’d also tend to want to add an “order” property to the “action” nodes so that you is quite clear in what order items should be executed and it will make updating these items eaiser (ie appending a new action to the list). This will mean you are no longer depended on the order of the items themselves in the document, but their “order” properties.

Just some ideas

Shane

 PEN

I have already changed the quads and added an index property. Quad menus have 4 sub quads running counter clockwise from lower right.

As do for an order property for the actions that could be done. Not sure that advantage over just using thier order in the xml. If I were to do that I would have to have an order for everything as I would want to know that an action is run before or after menus have been built. I’ll keep it in mind and see where it all takes me.

Once done I will most likely hand it out for free. I’ll post betas as I get to them.

We’ve stuck with the tabs for the past few releases… It’s an easy way to make everything visible to a new artist starting here.

We also have a complete default UI, including Quads, which has most everything in an organized logical order which is the a starting point for artists to customize with.

With each new version a few sr. animators adjust the standard UI, usually an ordeal as they’ve customized diffferent directions between releases, but the end result is a strong, useful standard UI for the way we work.

I’ve looked into the CUI files, but they’re pretty funky and I didn’t put the time in to decode each column and number… Some documentation on that would be great…

Good luck

Kramsurfer that looks really cool. I think I might have to steal it

Pen, I was thinking more from an “automated” xml process, where you don’t always have control over the order of the elements. If you are building the document manually, it may not make any difference

Shane