docking

87 views
Skip to first unread message

Christopher.

unread,
Oct 3, 2015, 1:13:19 PM10/3/15
to Python Programming for Autodesk Maya
When docking a panel, in this case, the outliner.  Most of the code I find start with outlinerWindow, yet the docs only mention outlinerEditor & outlinerPanel ?

Christopher.

unread,
Oct 3, 2015, 1:36:36 PM10/3/15
to Python Programming for Autodesk Maya
I put the outlinerEditor in a variable; as such;

string $panel = 'outlinerEditor';
dockControl $panel
;

Arvid Schneider

unread,
Oct 3, 2015, 2:34:19 PM10/3/15
to python_in...@googlegroups.com
That again, is a really annoying thing in maya. 
When it's docked it's a panel. When it's floating it's a window.
When you want to hook up code to either one, for instance a custom right click menu entry, it only lives so long until you close it. When you change viewport to single view, the outliner object is deleted, and so is your custom stuff. 
So you need a callback to hook up you code..I didn't find a great way yet to hack something into it. 
Any help is welcome!


Arvid Schneider
Look Develpopment | Lighting TD | Show TD
www.arvidschneider.com


On Oct 3, 2015, at 19:13, Christopher. <crestchr...@gmail.com> wrote:

When docking a panel, in this case, the outliner.  Most of the code I find start with outlinerWindow, yet the docs only mention outlinerEditor & outlinerPanel ?

--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/59bc6a61-61bf-4711-ba76-be47ff563c1a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Justin Israel

unread,
Oct 3, 2015, 3:56:51 PM10/3/15
to python_in...@googlegroups.com
Yea I have found that same kind of outcome when trying to mess with built-in UI elements in Maya. I think mine was trying to hook into viewport behavior and also finding that things reset each time the view layout changes and rebuilds them. Pretty sure the only real way to tackle it is to install an event filter on the entire app and try to catch the desired changes.

Crest Christopher

unread,
Oct 3, 2015, 3:58:36 PM10/3/15
to python_in...@googlegroups.com
Arvid - You bring up a point, to which I should have surfaced. 

Arvid Schneider wrote:
You received this message because you are subscribed to a topic in the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/python_inside_maya/bXgyvDvHhrE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/5BAB3AF8-0AE8-4DE3-89EA-0FB0CA732F3E%40gmail.com.

Crest Christopher

unread,
Oct 3, 2015, 4:02:25 PM10/3/15
to python_in...@googlegroups.com
I assume an event filter would save the U.I changes ?

I was hoping when writing the code I could use the outlineEditor command to manipulate the outliner window, unfortunately, no.

Justin Israel wrote:
You received this message because you are subscribed to a topic in the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/python_inside_maya/bXgyvDvHhrE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA3AWhxYeJviLD-M-M3rnszH57pTTWux52ov7qEx4bY9Bg%40mail.gmail.com.

Justin Israel

unread,
Oct 3, 2015, 4:22:49 PM10/3/15
to python_in...@googlegroups.com


On Sun, 4 Oct 2015 9:02 AM Crest Christopher <crestchr...@gmail.com> wrote:

I assume an event filter would save the U.I changes ?

I'm not sure what happens specifically with the Outliner when it changes from docked to floating. Maybe it is the same Qt instance and just wrapped differently. Maybe it is always destroyed and recreated. An event filter would only let you watch for when objects are created and to see if it's an Outliner. In which case if it were an Outliner, you would then be able to install your custom behavior.
Not saying this specifically applies to your needs here.. but was just confirming some past experience with Arvid

To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/56103445.1000903%40gmail.com.

Arvid Schneider

unread,
Oct 3, 2015, 4:23:38 PM10/3/15
to python_in...@googlegroups.com
Unfortunately it's not that simple :/
As Justin suggested to install a QEvent on Maya's MainWindow would to the trick I guess. You can query the active window, or under pointer, but it's all messy and just a hack. 
A possibility would be to change the outliner.mel file (not sure the proper name) but that would be probably just for local fixes. 


Arvid Schneider
Look Develpopment | Lighting TD | Show TD
www.arvidschneider.com

Crest Christopher

unread,
Oct 3, 2015, 4:54:19 PM10/3/15
to python_in...@googlegroups.com
I'm perplexed on what is the best direction to follow ?

Arvid Schneider wrote:

Justin Israel

unread,
Oct 3, 2015, 4:58:37 PM10/3/15
to python_in...@googlegroups.com


On Sun, 4 Oct 2015 9:54 AM Crest Christopher <crestchr...@gmail.com> wrote:

I'm perplexed on what is the best direction to follow ?

What is the exact problem that you want to solve?

To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/5610406F.1090508%40gmail.com.

Crest Christopher

unread,
Oct 3, 2015, 5:07:54 PM10/3/15
to python_in...@googlegroups.com
I want to dock the outliner, but as Arvid mentioned; it will only save per session; upon restarting Maya, all is lost.  You have to continuously run the same code to dock the outliner.  ;-(



Justin Israel wrote:

For more options, visit https://groups.google.com/d/optout.

--
––––•(-•    Christopher      •-)•––––


Justin Israel

unread,
Oct 4, 2015, 3:44:33 AM10/4/15
to Python Programming for Autodesk Maya


On Sunday, October 4, 2015 at 10:07:54 AM UTC+13, Christopher. wrote:
I want to dock the outliner, but as Arvid mentioned; it will only save per session; upon restarting Maya, all is lost.  You have to continuously run the same code to dock the outliner.  ;-(

Could you just set up the behavior you want in a startup script, and/or as a scriptJob that triggers when a scene is opened?

@Arvid, I did a quick test, and it seems I can locate the Outliner panel regardless of its dock state:

def print_outliners():
panels = cmds.lsUI(panels=True, long=True)
outs = [p for p in panels if cmds.outlinerPanel(p, q=True, exists=True)]
print outs
win = cmds.window()
cmds.frameLayout( labelVisible=False )
panel = cmds.outlinerPanel()
cmds.showWindow(win)
dc = cmds.dockControl(area="left", content=win, label="Outliner", width=200)
print_outliners()
# [u'outlinerPanel1', u'outlinerPanel2']
# Float the custom outliner
print_outliners()
# [u'outlinerPanel1', u'outlinerPanel2']

Justin
 



Justin Israel wrote:

To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.


--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.

To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.


--
You received this message because you are subscribed to a topic in the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/python_inside_maya/bXgyvDvHhrE/unsubscribe.

To unsubscribe from this group and all its topics, send an email to python_inside_maya+unsub...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.

To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.


--
You received this message because you are subscribed to a topic in the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/python_inside_maya/bXgyvDvHhrE/unsubscribe.

To unsubscribe from this group and all its topics, send an email to python_inside_maya+unsub...@googlegroups.com.


--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.

To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.


--
You received this message because you are subscribed to a topic in the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/python_inside_maya/bXgyvDvHhrE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to python_inside_maya+unsub...@googlegroups.com.

--
––––•(-•    Christopher      •-)•––––


Arvid Schneider

unread,
Oct 4, 2015, 5:37:32 AM10/4/15
to python_in...@googlegroups.com
As far as my tests go the outliner is only initiated at startup when the outliner is in the saved start up layout. 
So when maya starts in single viewport layout, with no outliner visible, it's not initialized hence no userSetup would work. 
My work-around always was to force open the outliner and install the scripts. 
But as mentioned before, when closing it again the object gets deleted. 

Justin, that looks promising  I will give it a go too. Then it would just be querying the panels, wrapping them to qt, and install stuff. 

Arvid 


Arvid Schneider
Look Develpopment | Lighting TD | Show TD
www.arvidschneider.com
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/343b8445-5e28-4912-bb75-73004d51259f%40googlegroups.com.

Crest Christopher

unread,
Oct 4, 2015, 11:58:48 AM10/4/15
to python_in...@googlegroups.com
I assume, don't use MEL to dock the outliner. 

This script you posted Justin should go in a Startup script or script Job ? Start up script sounds familiar as I have another script to which I always wanted to start when Maya starts but what is this Start-up script file that I should look for ? Script Job I'm UN-familar with ?

Justin Israel wrote:
To unsubscribe from this group and all its topics, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/343b8445-5e28-4912-bb75-73004d51259f%40googlegroups.com.

Crest Christopher

unread,
Oct 4, 2015, 12:30:55 PM10/4/15
to python_in...@googlegroups.com
Is this script one in the same as your question, Justin ?

Justin Israel wrote:
To unsubscribe from this group and all its topics, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/343b8445-5e28-4912-bb75-73004d51259f%40googlegroups.com.

Justin Israel

unread,
Oct 4, 2015, 2:58:51 PM10/4/15
to python_in...@googlegroups.com

The code that I posted was actually more of a test directed at Arvid, to illustrate that I was still seeing the ability to resolve Outliner panels regardless of their dock state. I am not sure what the exact solution is for you; of you were trying to modify the default Outliner, or create and dock a brand new ones.

ScriptJob is in the commands docs, so just look that up.





Justin Israel wrote:

To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.


--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.

To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.


--
You received this message because you are subscribed to a topic in the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/python_inside_maya/bXgyvDvHhrE/unsubscribe.

To unsubscribe from this group and all its topics, send an email to python_inside_m...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.

To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.


--
You received this message because you are subscribed to a topic in the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/python_inside_maya/bXgyvDvHhrE/unsubscribe.

To unsubscribe from this group and all its topics, send an email to python_inside_m...@googlegroups.com.


--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.

To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.


--
You received this message because you are subscribed to a topic in the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/python_inside_maya/bXgyvDvHhrE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA0NyHniSW%2BYbFXoDRtbxxwuGvRjxSDknhT705t39UzwWw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
––––•(-•    Christopher      •-)•––––


--
You received this message because you are subscribed to a topic in the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/python_inside_maya/bXgyvDvHhrE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to python_inside_m...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/56115431.80906%40gmail.com.

Christopher.

unread,
Oct 17, 2015, 12:16:30 PM10/17/15
to Python Programming for Autodesk Maya
If as you all probably know, Maya closes clean, as in, not crashing, even after saving your custom layout, it remains the same the next time you start.

Recently Maya crashed on me, and my custom layout is gone, any solution to this ?


On Saturday, October 3, 2015 at 1:13:19 PM UTC-4, Christopher. wrote:

Chris Lesage

unread,
Oct 17, 2015, 12:36:52 PM10/17/15
to python_in...@googlegroups.com
Hey Christopher,

After you've made your custom layout, click File -> Save Preferences. No need to wait until Maya closes to save your prefs.


--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.

Christopher.

unread,
Oct 17, 2015, 8:57:39 PM10/17/15
to Python Programming for Autodesk Maya
I may not have done that after customizing the U.I, will do next time, now I must start from scratch !


On Saturday, October 17, 2015 at 12:36:52 PM UTC-4, Chris Lesage wrote:
Hey Christopher,

After you've made your custom layout, click File -> Save Preferences. No need to wait until Maya closes to save your prefs.

On Sat, Oct 17, 2015 at 12:16 PM, Christopher. <crestchr...@gmail.com> wrote:
If as you all probably know, Maya closes clean, as in, not crashing, even after saving your custom layout, it remains the same the next time you start.

Recently Maya crashed on me, and my custom layout is gone, any solution to this ?

On Saturday, October 3, 2015 at 1:13:19 PM UTC-4, Christopher. wrote:
When docking a panel, in this case, the outliner.  Most of the code I find start with outlinerWindow, yet the docs only mention outlinerEditor & outlinerPanel ?

--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.

Christopher.

unread,
Oct 17, 2015, 11:10:23 PM10/17/15
to Python Programming for Autodesk Maya
Saving preferences didn't help, this time I closed Maya clean and my custom UI was not restored even after saving the current layout ?
Reply all
Reply to author
Forward
0 new messages