Custom UI containing flyout buttons (3ds Max 2015)

Custom UI containing flyout buttons (3ds Max 2015)

Anonymous
Not applicable
930 Views
4 Replies
Message 1 of 5

Custom UI containing flyout buttons (3ds Max 2015)

Anonymous
Not applicable

Hi,

 

I have a custom toolbar containing macro buttons.  I want to modify it slightly to merge some of the macro buttons into a flyout button.  I can create a flyout button but the macros don't work when I select any of the buttons.  I copied the format of a CTB_PUSHBUTTON in the generated xml (.cuix file) and just replaced the type with CTB_MACROBUTTON.

 

  • I want to know if this is even possible?  
  • or do I have to stick with using push buttons for flyouts?  
    • If I do have to stick with push buttons, how do I get each button to execute my custom MaxScript logic?  I notice that existing ones reference a controlID, but I can't find what the existing IDs refer to.

 

I was reading this post about customising UIs where @Alfred.DeFlaminis indicated that it was possible to create custom flyouts.

 

Below is a cut-down version of my toolbar for demo purposes:

 

<Window name="EoinsCustomToolbar" type="T" rank="0" subRank="0" hidden="0" dPanel="0" tabbed="0" curTab="-1" cType="1" toolbarRows="1" toolbarType="16">
	<FRect left="668" top="453" right="1228" bottom="519" />
	<DRect left="2147483647" top="2147483647" right="-2147483648" bottom="-2147483648" />
	<DRectPref left="2147483647" top="2147483647" right="-2147483648" bottom="-2147483648" />
	<CurPos left="668" top="453" right="1228" bottom="519" floating="1" panelID="16" />
	<Items>
		<Item typeID="2" type="CTB_MACROBUTTON" width="0" height="0" controlID="0" macroTypeID="3" macroType="MB_TYPE_ACTION" actionTableID="647394" imageID="-1" imageName="" actionID="Non_Flyout_Macro" tip="" label="" />
		<Item typeID="0" type="CTB_MACROBUTTON" controlID="-1" helpID="0" orientation="31" captionVisibility="0" macroTypeID="3" macroType="MB_TYPE_ACTION" actionTableID="647394" actionID="DEFAULT_MACRO_TO_EXECUTE" iconFilePrefix="CustomToolbarIcons" iconImageIndex="3">
			<FlyOffCt flyInit="0" flyTimeout="300" flyDir="3">
				<Fly actionID="DEFAULT_MACRO_TO_EXECUTE" iconFilePrefix="CustomToolbarIcons" iconImageIndex="3" />
				<Fly actionID="ANOTHER_MACRO_TO_EXECUTE" iconFilePrefix="CustomToolbarIcons" iconImageIndex="30" />
				<Fly actionID="YET_ANOTHER_MACRO_TO_EXECUTE" iconFilePrefix="CustomToolbarIcons" iconImageIndex="4" />
			</FlyOffCt>
		</Item>
		<!-- Other Macro Buttons and Spacers -->
	</Items>
</Window>

 

Thanks,

Eóin

 

0 Likes
931 Views
4 Replies
Replies (4)
Message 2 of 5

Swordslayer
Advisor
Advisor

While custom flyouts are possible (v-ray uses them, for example), I wouldn't think it's as easy as modifying the config files. Looking at those, the FlyOffCt only specifies the initial index and icons for the items, the actions themselves are not handled there. My guess would be that pushing the button triggers 'pushing a button of this id together with the picked item'. You might try asking at the chaos group forum.

Message 3 of 5

Alfred.DeFlaminis
Alumni
Alumni

Hello @Anonymous and welcome to the community,

 

This may be one of those situations where I did more harm than good trying to find a workaround for a problem because I lack the programming expertise to know exactly *why* it worked for me.   If you scroll down a bit in that thread I do mention that officially it's not possible, but I think I was able to make it work specifically because of the exact tools that were in question.  The OP never did accept my answer as a solution in that thread you linked, so it's a bit of a loss.  

 

I'm not a programmer at all and I was trying to find something that might help for the OP of that thread.  I really dislike not giving *some* kind of answer so I tried to hack the config file and while it was working for me some people have PM'ed me that for other purposes it actually didn't work for them.  The problem might have been exactly what @Swordslayer is mentioning in his post.  

 

Because there is no official Maxscript support for flyouts, I am not sure about how to answer your question on Control ID's.  Since the tools from that original thread already had their control ID's it was easy to copy and paste them, but there isn't a list of them anywhere that I can find.  I'd bet that Chaosgroup is doing it via C++, .Net, or Python.  

 

I think the best thing I can do with this thread is move it to the Programming forum where someone with more programming chops than myself may be able to make a suggestion.  I am truly sorry if I led you down the wrong path here.  

 

Best Regards,

Message 4 of 5

Anonymous
Not applicable

Ok, thanks both for your responses.  I have gone with a more basic approach using Rollouts to get things working for now in MaxScript.  Going forward I will look into migrating this stuff over to Python using PySide.

Message 5 of 5

Alfred.DeFlaminis
Alumni
Alumni

Thank you for your grace and updated message @Anonymous.  Have a great weekend!

Best Regards,

0 Likes