Mel Script not working in maya 2016


Hello Everyone ,

Previously I was using this script selected outliner for the this site 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
// H2O Entertainment Corporation
// Vancouver, Canada

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;

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


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


[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

// Result: 1 //
OutlinerEdMenu outlinerEditor98;
// Result: scriptEditorPanel1Window|scriptEditorPanel1|formLayout87|formLayout89|paneLayout2|paneLayout3|tabLayout2|formLayout90|cmdScrollFieldExecuter1 //](


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


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;