Maya MEL command to set focus to a particular tab in the Attribute Editor

StackOverflow https://stackoverflow.com/questions/16807977

  •  30-05-2022
  •  | 
  •  

سؤال

How can I do this? I've looked through the Maya documentation and all I can see that's related are the commands refreshAE and updateAE, but they don't do the job I need.

هل كانت مفيدة؟

المحلول

Here is one way of doing it. This proc is tested in Maya 2009 and 2013.

//  switch the tab by name string, note tab must be present 

global proc switchAEtoTab(string $name ){
    global string $gAETabLayoutName;
    string $tabs[] = `tabLayout -q -tabLabelIndex $gAETabLayoutName`;
    for ($i=0;$i<size($tabs);$i++){
       if ($tabs[$i]==$name)
          tabLayout -e -selectTabIndex ($i+1) $gAETabLayoutName; 
    }
}

Edit: updated script to contain the global name of the tab layout

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top