MaxStudio Posted September 15, 2011 Share Posted September 15, 2011 I've created some new plugin objects. The object info palette is becoming overwhelmed with options and variables. Is there anyway to create a sub-menu within the object info palette so that I can hide some options until they are needed? Thank You in advanced! Quote Link to comment
JBenghiat Posted September 15, 2011 Share Posted September 15, 2011 You can create a checkbox (boolean parameter) that will hide and show a section of parameters. Alternatively, you can make parameter visibility dependent on other parameter values. Check the function reference -- of the top of my head, the call is something like SetParameterVisibility. -Josh Quote Link to comment
MaxStudio Posted September 15, 2011 Author Share Posted September 15, 2011 Hey thanks Josh I'll check that out! Quote Link to comment
MaxStudio Posted September 15, 2011 Author Share Posted September 15, 2011 (edited) This is what i found: PROCEDURE SetParameterVisibility(inPlugin :HANDLE; inParameterName :STRING; inSetVisible :BOOLEAN); I would assume something like this would work: IF checkbox {boolean} THEN BEGIN SetParameterVisibility(inPlugin, PParmeter, TRUE); END; What is the inPlugin handle? I know how to give an object created, such as a rectangle, a handle, but how do i give the whole plugin object a handle? Edited September 15, 2011 by MaxStudio Quote Link to comment
MaxStudio Posted September 15, 2011 Author Share Posted September 15, 2011 Ok i've made a little more progress: IF checkbox {boolean} THEN BEGIN SetParameterVisibility(inPlugin, 'parameter', TRUE); END; Is the inplugin handle the object handle created at the beginning of the script, see below result : BOOLEAN; objname : STRING; oh,rh,wh : HANDLE; BEGIN { retrieve custom object information } result:= GetCustomObjectInfo(objname,oh,rh,wh); in this case would oh be the plugin handle? Quote Link to comment
MaxStudio Posted September 15, 2011 Author Share Posted September 15, 2011 OK finally got it working correctly oh is the handle ended becoming: SetParameterVisibility(oh, 'parameter', FALSE); IF checkbox THEN BEGIN SetParameterVisibility(oh, 'parameter', TRUE); END; Quote Link to comment
JBenghiat Posted September 15, 2011 Share Posted September 15, 2011 I assume you figured out to get the handle from GetCustomObjectInfo. To make your code even sleeker, try: SetParameterVisibility(oh, 'parameter', checkbox); -Josh Quote Link to comment
maarten. Posted September 19, 2011 Share Posted September 19, 2011 Or, hide all your parameter by giving them a prefix "__" in their name, that way you only have to show them in your code, not hide them. Quote Link to comment
Miguel Barrera Posted September 19, 2011 Share Posted September 19, 2011 If you want to be more creative, you can also use buttons, which will be the group titles, to toggle the visibility of parameters but it will require to turn on events and keep a log of each button state (opened and closed submenus). Quote Link to comment
MaxStudio Posted October 5, 2011 Author Share Posted October 5, 2011 Hey Josh, Thanks its always good to learn how to clean up bulky code! Quote Link to comment
MaxStudio Posted October 5, 2011 Author Share Posted October 5, 2011 maarten, can you give me an example of a parameter with the prefix. I don't understand exactly where I would place the "__" Thanks Quote Link to comment
MaxStudio Posted October 5, 2011 Author Share Posted October 5, 2011 Miguel, Do you have an example of the buttons you are talking about? Thanks Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.