Home Technical Talk

Dock Question - MEL

CreativeSheep
polycounter lvl 8
Offline / Send Message
CreativeSheep polycounter lvl 8
I have a question, I'm trying to dock the outliner panel in Maya; most of the syntax I find online mention; outlinerWindow, but the docs only mention outlinerEditor & outlinerPanel which do I use when it comes to docking a panel ?

Please don't direct me to a page with code for any MEL or Python questions I have now or in the future. I want to learn RAW it may be frustrating, but it's the method I prefer. :)

Replies

  • throttlekitty
    Options
    Offline / Send Message
    I think you query the name of the window and set that to a variable using the getPanel command. The actual name (think of it like an ID) can vary between scenes and whether or not it's docked or torn off.

    I know you want to learn it raw, the examples at the bottom of this one are... kind of minimal (lol), so no worries about spoiling yourself.
  • CreativeSheep
    Options
    Offline / Send Message
    CreativeSheep polycounter lvl 8
    throttlekitty - that helps, what is the command to dock the panel ?

    By the way, you just have to give the name of the command in bold, I have some local docs I prefer to use, instead, as I said, I want to keep things RAW :)
  • throttlekitty
    Options
    Offline / Send Message
    good luck with that.

    try dockControl
  • CreativeSheep
    Options
    Offline / Send Message
    CreativeSheep polycounter lvl 8
    good luck with that.

    try dockControl

    dockControl, docks the outliner, yes, not as the official outliner is there not another command for docking torn away windows ?
  • Deadly Nightshade
    Options
    Offline / Send Message
    Deadly Nightshade polycounter lvl 10
    global proc dev_outlinerMenuItem(){
    	global string $gMainWindowMenu;
    	string $mayaWindowMenu[] = `menu -q -ia $gMainWindowMenu`;
    	int $i = 0;
    	while ($i < `size $mayaWindowMenu`){
    		string $target = "MayaWindow|" + $gMainWindowMenu + "|" + $mayaWindowMenu[$i];
    		if (`menuItem -q -l $target` == "Outliner")
    			menuItem -e -c "dev_dockOutliner" $target;
    		$i++;
    	}
    }
    
    global proc dev_dockOutliner(){
    	if (!`window -q -exists dev_outlinerDockWindow`){
    		window
    			-widthHeight 300 1000
    			-t ""
    			dev_outlinerDockWindow;
    		frameLayout -parent dev_outlinerDockWindow
    					-mh 0
    					-mw 0
    					-bv on
    					-lv off
    					dev_outlinerDockFrame;
    	}
    
    	if (!`dockControl -q -ex dev_outlinerDockControl`){
    		dockControl -label "Outliner"
    					-area right
    					-allowedArea "right"
    					-width 300
    					-content dev_outlinerDockWindow
    					dev_outlinerDockControl;
    	} else {
    		dockControl -e -vis 1 dev_outlinerDockControl;
    	}
    
    	if (!`outlinerPanel -q -exists dev_dockedOutliner`){
    		outlinerPanel -parent "dev_outlinerDockFrame" dev_dockedOutliner;
    	} else {
    		panel -e -parent "dev_outlinerDockFrame" dev_dockedOutliner;
    	}
    
    	global int $dev_dockedOutlinerFix;
    	if (!$dev_dockedOutlinerFix){
    		$dev_dockedOutlinerFix = 1;
    		scriptJob -cu true -pro -e "PostSceneRead" "dev_dockOutliner";
    		scriptJob -cu true -pro -e "NewSceneOpened" "dev_dockOutliner";
    	}
    }
    dev_dockOutliner;
    
    You are welcome!
  • CreativeSheep
    Options
    Offline / Send Message
    CreativeSheep polycounter lvl 8
    Whoa, too much code. I asked if there was another command other then dockControl because when I docked the outliner as a docked control, it was not identical to the vanilla outliner and I was wondering why is there a flag in dockControl that must be used ?

    Why does MEL require the use of ticks for some things ?
  • CreativeSheep
    Options
    Offline / Send Message
    CreativeSheep polycounter lvl 8
    string $out_win = "outliner1";
    dockControl -area "left"
    -content $out_win
    -allowedArea "right";
    

    It docked an outliner, but not the vanilla outliner ?
  • CreativeSheep
    Options
    Offline / Send Message
    CreativeSheep polycounter lvl 8
    string $out_win = "outlinerPanel1"
    dockControl -content $out_win -area "left" allowedArea "left"
    //-content $out_win -allowedArea "left";
    

    ?
Sign In or Register to comment.