Dockable Areas, UI

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Search this Thread Display Modes
  04 April 2013
Dockable Areas, UI

Just looking for some advice from anyone that's had experience with dockable UIs.

I'm trying to dock a window on the right BUT below the channelbox, and I havent been able to do this 'intentionally'. Using the dock control's area='right' places the window in the tab group along with anything else on the right (Attribute Editor, Channel Box, etc), and not below.

Although using another UI made entirely with QT (from a TD here at work), I was able to briefly dock his ui UNDER the channel box (by double clicking on the dotted area at the top of his window). But once I moved the dock to another area, it wouldn't go back to that place under the channel box. So it seems like maybe Maya's UI docking is still WIP, but it gave me the idea of placing UIs in other areas.

I queried the 'area', and 'parent' while that UI was docked under the channel box, and checked his code, but it wasn't any different to what I was specifying(only he was using QT and I was using standard maya/python UI code). There must be a way to dock UI elements relative to others, bottom of channelbox, left of timeslider, etc, etc.

If anyone has any thoughts on this, Id love to hear.

  04 April 2013
The out-of-the-box dockControl is designed to dock to the viewport (i.e. the model panel layout), not to arbitrary UI elements.

Free positioning can only be achieved by parenting your UI to an existing layout (by that I mean an actual ELF layout control). Basically that means querying the parent layout of the channel box and, if it is a suitable layout (e.g. not a rowLayout), make your UI the child of said layout.

If I'm not mistaken I'm taking a cue from the fact that the channelbox/input connections list is separated from the layers layout via a pane then you should be able to add your UI to the paneLayout that governs the channelBox etc.
Doing so in a dockable fashion, i.e. via dragging and dropping, is more complex and will probably involve drag/drop Callbacks on your UI.

Now I haven't dabbled with Qt ('Cute', not to be confused with QT, which is the accepted abbreviation/acronym for QuickTime), it may well be possible to to more advanced stuff with that, though with Qt (PyQt, PySide) comes the added hurdle of limited distribution (distributing a script/UI that relies on Qt is a nightmare unless you target Maya 2014 only).
  04 April 2013
Thanks Nyro, That explanation clears up a lot!

For the sake of backwards compatibility, sounds like Qt UIs might be good to avoid.
  04 April 2013
You [I]can[I] use Qt, but it's a huge hassle if you ask me.

You need to compile your stuff against specific versions and distribute PyQt with your script (which means you need to either guide the user step by step in how to install PyQt or you write an installer). Add ontop of that the limited distribution license granted by Riverbank for PyQt and ... bleh.
  04 April 2013
If you are writing tools for internal use, i would encourage PyQt, it's much better than writing UIs with the standard ELF controls.
  04 April 2013
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
Thread Closed share thread

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 03:48 AM.

Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.