Mel Script not working in maya 2016


#1

Hello Everyone ,

Previously I was using this script selected outliner for the this site http://coopdesign.org/aac/outlinerSelected.mel in maya 2015 and was working fine…but when i shifted to maya 2016 and above its is not working anymore …any idea what could be wrong.
Below is the mel script
// outlinerSelected.mel v1.0 (6 Jun 2000)//
// MEL script for Maya
//
// by Bryan Ewert
// http://www.ewertb.com
// bryan@ewertb.com
//
// H2O Entertainment Corporation
// Vancouver, Canada
// http://www.h2oent.com

global proc outlinerSelected()
{
string $select[] = ls -sl;

if (size $select)
{
// Create our selectionConnection - as ‘connectionList’ type
$sc = selectionConnection -lst;

  // Add current selection to selectionConnection
  for ($node in $select) 
  { 
        selectionConnection -e -select $node $sc;
  } 

  // Create window layout to hold Outliner
  $win = `window -rtf 1 -title "Outliner (Custom)" -iconName "Outliner*"`;
     string $frame = `frameLayout -lv 0`;

  // Create an unparented outlinerEditor
  string $oped = `outlinerEditor -showSetMembers true -unParent`;

  // Attach our custom selectionConnection
  outlinerEditor -e -mlc $sc -slc "modelList" $oped;

  // Parent the outlinerEditor to this window
  outlinerEditor -e -parent $frame $oped;

  // Create scriptJob to delete selectionConnection when no longer needed
  scriptJob -uiDeleted $win ( "deleteUI " + $sc );
  
  showWindow $win;

}
else
warning ( “Nothing selected! Custom Outliner not created.” );
}


#2

Can you tell us what exactly does not work? Do you get an error message?


#3

[Hi haggi previously after running outlinerSelected() it used to create a separate outliner like window with just selected objects …

But right now it just says

outlinerSelected();
mayaHasRenderSetup;
// Result: 1 //
OutlinerEdMenu outlinerEditor98;
// Result: scriptEditorPanel1Window|scriptEditorPanel1|formLayout87|formLayout89|paneLayout2|paneLayout3|tabLayout2|formLayout90|cmdScrollFieldExecuter1 //](http://forums.cgsociety.org/member.php?u=78755)


#4

Hello everyone …i still am not able to figure out how it works…any help plz


#5

Apparently the frameLayout labelVisible (lv) and window works a little different in 2016.

You must specify a window size.

Ex, change the $win line to something like this:

$win =window -title “Outliner (Custom)” -iconName “Outliner*” -h 400 -w 240;