|
|
|
Tell us what you think of the site.
|
Autodesk Media & Entertainment User Community
|
Autodesk® 3ds Max®
|
|
Autodesk® Maya®
|
|
Autodesk® Softimage®
|
|
Autodesk® MotionBuilder®
|
|
Autodesk® Mudbox™
|
|
Autodesk® ImageModeler™
|
|
Autodesk® Sketchbook® Pro
|
|
Autodesk® Smoke on Mac®
|
| GUI scripting - Hiding certain tabs in a tabGroup?
|
|
|
Alright, so I’ve been looking into control layouts and all that GUI goodness.
I did find myself most of the commands that I need, however im a little stuck with the visibility of tabs in a tab group - how do I edit them to be visible or not?
I DID find a -vis flag for the tabGroup, but that toggles the whole thing, not just specific tabs.
So, how do i do it? Do I have to use the -vis flag of the control layout within the tab?
Just so you know what I want to do:
I want a window with tabs and a menu; from the menu, I want the user to be able to toggle between advanced and beginners options, which toggles the according tabs to be visible (if advanced is chosen) or invisible (if beginners chosen).
I could use frameLayout, but this seems to be a bit more elegant.
Any ideas?
AutoWalk script out on CreativeCrash!
http://www.creativecrash.com/may...gins/animation/c/autowalk
Jeeves Simple Biped Rig:
http://www.creativecrash.com/maya/downloads/character-rigs/c/jeeves
Dload, test & share! Feedback very much appreciated!
|
|
|
|
|
**Update**
I did find the -tabsVisible flag, but this, again, seems to only work for all tabs except one(when I add the flag as -tabsVisible $tab1 false it gives an error while parsing arguments, and when I just use -tabsVisible false it hides all tabs and display it as a normal window).
Author: J.D.
|
| Replied: 02 November 2011 09:26 PM
|
|
|
|
|
you’ll need to make it re-create the ui depending on mode, one for beginners and another for advanced. not the entire ui, mind, just the layout the tabs are in.
adding tabs aren’t a problem, its deleting them.
Lee Dunham | Character TD
ldunham.blogspot.com
|
|
|
|
window -widthHeight 200 150;
string $menuBarLayout = `menuBarLayout`;
menu -label "View";
menuItem -rb true -c setMode_beginner -label "Basic..";
menuItem -rb false -c setMode_adv -label "Advanced..";
setParent..;
setParent..;
string $form = `formLayout`;
string $tabGroup = `tabLayout -innerMarginWidth 5 -innerMarginHeight 5 -p $form`;
formLayout -edit
-attachForm $tabGroup "top" 0
-attachForm $tabGroup "left" 0
-attachForm $tabGroup "bottom" 0
-attachForm $tabGroup "right" 0
$form;
//Add tabs to the window; fill the "layout" into strings
string $footTab = `rowColumnLayout -numberOfColumns 2`;
button; button; button;
setParent ..;
string $hipTab = `rowColumnLayout -numberOfColumns 2`;
button; button; button;
setParent ..;
string $spineTab = `rowColumnLayout -numberOfColumns 2`;
button; button; button;
setParent ..;
tabLayout -edit
//Rename the tabs;
-tabLabel $footTab "Foot Ctrls"
-tabLabel $hipTab "Hip Ctrl"
-tabLabel $spineTab "Spine Ctrl"
$tabGroup;
showWindow;
So, what you’re saying is I whoop out an -edit flag (in the proc to modify this I mean) on the rowColumnLayout of each $xTab and...do what exactly? Just rewrite it? kill the whole layout?
can even do that with the edit flag? or do I actually have to kick out the whole layout? and if so..how do I do that?
Damn this is confusing o_o..
oh, and mucho thx for your help, dude :D
AutoWalk script out on CreativeCrash!
http://www.creativecrash.com/may...gins/animation/c/autowalk
Jeeves Simple Biped Rig:
http://www.creativecrash.com/maya/downloads/character-rigs/c/jeeves
Dload, test & share! Feedback very much appreciated!
|
|
|
|
proc setMode_adv ()
{
//Declare Vars used:
int $gVar_optionsMode;
string $tabGroup;
string $footTab;
string $hipTab;
string $spineTab;
//----
//Set the optionsMode to advanced (1)
$gVar_optionsMode = 1;
print "Adv Mode on";
//add layouts again
string $footTab = `rowColumnLayout -e -numberOfColumns 2 "footTab"`;
textField -tx "footAdvanced";
setParent $footTab;
string $hipTab = `rowColumnLayout -e -numberOfColumns 2 "hipTab"`;
textField -tx "hipAdvanced";
setParent $hipTab;
string $spineTab = `rowColumnLayout -e -numberOfColumns 2 "spineTab"`;
textField -tx "spineAdvanced";
setParent $spineTab;
tabLayout -edit
//Rename the tabs;
-tabLabel $footTab "Foot Ctrls (adv)"
-tabLabel $hipTab "Hip Ctrl (adv)"
-tabLabel $spineTab "Spine Ctrl (adv)" $tabGroup;
}
Im getting closer to solving this.
Above code almost does what I want. However, it somehow adds the txt field of the hip to the foot tab, the txtfield of the spine to the hip and the txt field for the foot doesnt get created at all. The variables at the top are declared in the same script, yet it tells me that on the last line, where it says “$tabGroup” is not found.
thx for any help u can give me on this. :/
AutoWalk script out on CreativeCrash!
http://www.creativecrash.com/may...gins/animation/c/autowalk
Jeeves Simple Biped Rig:
http://www.creativecrash.com/maya/downloads/character-rigs/c/jeeves
Dload, test & share! Feedback very much appreciated!
|
|
|
|
|
|