Home Technical Talk
The BRAWL² Tournament Challenge has been announced!

It starts May 12, and ends Sept 12. Let's see what you got!

https://polycount.com/discussion/237047/the-brawl²-tournament

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
    Offline / Send Message
    throttlekitty ngon master
    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
    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
    Offline / Send Message
    throttlekitty ngon master
    good luck with that.

    try dockControl
  • CreativeSheep
    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
    Offline / Send Message
    Deadly Nightshade polycounter lvl 10
    1. global proc dev_outlinerMenuItem(){
    2. global string $gMainWindowMenu;
    3. string $mayaWindowMenu[] = `menu -q -ia $gMainWindowMenu`;
    4. int $i = 0;
    5. while ($i < `size $mayaWindowMenu`){
    6. string $target = "MayaWindow|" + $gMainWindowMenu + "|" + $mayaWindowMenu[$i];
    7. if (`menuItem -q -l $target` == "Outliner")
    8. menuItem -e -c "dev_dockOutliner" $target;
    9. $i++;
    10. }
    11. }
    12.  
    13. global proc dev_dockOutliner(){
    14. if (!`window -q -exists dev_outlinerDockWindow`){
    15. window
    16. -widthHeight 300 1000
    17. -t ""
    18. dev_outlinerDockWindow;
    19. frameLayout -parent dev_outlinerDockWindow
    20. -mh 0
    21. -mw 0
    22. -bv on
    23. -lv off
    24. dev_outlinerDockFrame;
    25. }
    26.  
    27. if (!`dockControl -q -ex dev_outlinerDockControl`){
    28. dockControl -label "Outliner"
    29. -area right
    30. -allowedArea "right"
    31. -width 300
    32. -content dev_outlinerDockWindow
    33. dev_outlinerDockControl;
    34. } else {
    35. dockControl -e -vis 1 dev_outlinerDockControl;
    36. }
    37.  
    38. if (!`outlinerPanel -q -exists dev_dockedOutliner`){
    39. outlinerPanel -parent "dev_outlinerDockFrame" dev_dockedOutliner;
    40. } else {
    41. panel -e -parent "dev_outlinerDockFrame" dev_dockedOutliner;
    42. }
    43.  
    44. global int $dev_dockedOutlinerFix;
    45. if (!$dev_dockedOutlinerFix){
    46. $dev_dockedOutlinerFix = 1;
    47. scriptJob -cu true -pro -e "PostSceneRead" "dev_dockOutliner";
    48. scriptJob -cu true -pro -e "NewSceneOpened" "dev_dockOutliner";
    49. }
    50. }
    51. dev_dockOutliner;
    You are welcome!
  • CreativeSheep
    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
    Offline / Send Message
    CreativeSheep polycounter lvl 8
    1. string $out_win = "outliner1";
    2. dockControl -area "left"
    3. -content $out_win
    4. -allowedArea "right";

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

    ?
Sign In or Register to comment.