workspaceControl in 2017

900 views
Skip to first unread message

Mark Jackson

unread,
Oct 6, 2016, 5:24:36 AM10/6/16
to python_inside_maya
Hi all,

I'm trying to switch some of our base toolset so that the main UI (cmds built) now docks correctly in the same tab as the channelBox rather than docking to the right side of the main Maya UI. The ChannelBox is now a workspaceControl so I havce to call the UI through that as below, it's a bit of a pain to switch the ui over but I hate the fact that the right dockControl space is now the entire length of the Maya UI, and outside of everything else.

So I did the following to make the UI tab into the workspace of the channelBox:



element=mel.eval('getUIComponentDockControl("Channel Box / Layer Editor", false);')  
windowcall='myUIFunc'
cmds.workspaceControl(animUI.workspaceCnt, label="Red9_Animation", 
                                      uiScript=windowcall, 
                                      tabToControl=(element, -1), 
                                      initialWidth=355, 
                                      initialHeight=720,
                                      retain=False,
                                      loadImmediately=False)  

cmds.workspaceControl(animUI.workspaceCnt, e=True,vis=True)  # ensure we set visible
cmds.workspaceControl(animUI.workspaceCnt, e=True, mw=355)  # set minimumWidth
cmds.workspaceControl(animUI.workspaceCnt, e=True,  r=True)  # raise

Now that all works but I'll be damned if I can find a way to control and lock the width of this UI. If I go to the modelling tab and then my tab the ui is the correct width, presumably because I set the minimumWidth flag. 

However, if I go to the attributeEditor tab, then mine the ui remains the width of the attributeEditor. There's width query flags in the workspaceControl, but no edit.

So the question is, how the hell do you set a base width that is respected for these?

cheers

Mark



-------------------------------------
Mark Jackson
CEO / Technical Director
red9consultancy.com

Justin Israel

unread,
Oct 6, 2016, 7:15:49 AM10/6/16
to python_inside_maya
I haven't seen Maya 2017 yet so I don't know if the details of what has changed. But I just recently needed to integrate a custom editor into the tabbed attribute editor dock location, in 2016. I went through the Qt route, which gave me direct communication with the Qdockwidgets and ability to respond to events and signals. And the width is controlled via the size hints of the docked child widget. This meant I didn't need to deal with the limited Maya cmds wrappers. 

Not sure if this info helps but thought I would share. 


cheers

Mark



-------------------------------------
Mark Jackson
CEO / Technical Director
red9consultancy.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/CAGQH2FHLSBZcEEF6jdf%2BBJht-3rXGAGjBeo0hNYKcuUwuvczuQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Mark Jackson

unread,
Oct 6, 2016, 9:58:17 AM10/6/16
to python_inside_maya
Unfortunately I'm trying to keep this UI in cmds so that for the openSource build of the tools I don't have to get into managing PySide builds, that said I suspect this may only be fixable in QT..

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA2S3oQxPPoDFkV-4eZxFq8BLLJniCS3zZ3NAviQfK1vKw%40mail.gmail.com.

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



--

Marcus Ottosson

unread,
Oct 6, 2016, 10:16:17 AM10/6/16
to python_in...@googlegroups.com

managing PySide builds

That should be a problem, Maya ships with PySide since quite a while back.

Andrew Hazelden

unread,
Oct 6, 2016, 2:28:50 PM10/6/16
to Python Programming for Autodesk Maya
Hi MarkJ.

I wanted to comment about your minimum width setting in the code sample you provided. According to the workspaceControl documentation that should be a boolean value so your code that sets the value to "mw=355" wouldn't function as expected. You should probably add an entry to the initial workspaceControl code of "minimumWidth=True", at the same time you define the "initialWidth=355, " setting to get the results you are after.

minimumWidth(mw)     boolean     create query edit
Sets the minimum width of control to the initial width. This should be used along with initial width flag.

Regards,
Andrew Hazelden

Marcus Ottosson

unread,
Oct 6, 2016, 3:25:03 PM10/6/16
to python_in...@googlegroups.com

That should be a problem

Oh! Haha, I meant to say “shouldn’t“. How rude and sarcastic it made me sound just now. Sorry about that. :)


--
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.

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



--
Marcus Ottosson
konstr...@gmail.com

Mark Jackson

unread,
Oct 7, 2016, 3:58:47 AM10/7/16
to python_inside_maya
Thanks Andrew, yeah thats true, I missed that in the docs, just tried it though and the same thing happens, really wasn't wanting to add in QT calls in this module if I could help it but it looks like there's no other options as it stands.

cheers

Mark



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



--
Marcus Ottosson
konstr...@gmail.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.

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



--
Reply all
Reply to author
Forward
0 new messages