Hey John,
As is common with writing native Maya UI code, the solution is a bit hard
to spot. Your layout lacks an attachment definition for the widgets in the
rowLayout. So it means that while your createNodePanel is being placed into
the 1st horizontal cell, it is not having any constraints being applied to
its height. You can add a rowLayout edit at the end of your definitions to
configure how the specific widgets should be constrained. In my example I
have removed the column layouts, since they didn't make much different
here. And I have also included a commented-out alternative, using the
paneLayout, which gives you a splitter control between the two widgets:
import maya.cmds as cmdsclass TextureUploaderUI(object):
def __init__(self):
self.winName = "PSD_In"
if cmds.window(self.winName, exists=True):
cmds.deleteUI(self.winName, window=True)
self.window = cmds.window(self.winName, title="Texture Upload")
mainLayout = cmds.rowLayout(numberOfColumns=2, columnWidth=[(1, 200),
(2, 500)])
# mainLayout = cmds.paneLayout(configuration='vertical2')
cmds.scriptedPanel(type="createNodePanel", label="Select Material")
cmds.setParent(mainLayout)
cmds.scriptedPanel(type="nodeEditorPanel", label="Texture Editor")
cmds.setParent(mainLayout)
cmds.rowLayout(mainLayout, e=True, rowAttach=(1, "both", 0))
# cmds.paneLayout(mainLayout, e=True, paneSize=(1, 15, 100))
cmds.showWindow(self.window)
TextureUploaderUI()
-- justin
On Sunday, May 25, 2014 10:38:04 AM UTC+12, John Pepper wrote:
>
> Hello, everyone
>
> I'm kind of new here, and I'm learning scripting in Maya. I'm trying to
> create a UI with the Create Node Menu on the left and the Node Editor on
> the right. For the most part, I have the script done, but the problem is
> how it turns out - the menus are really small and I can't seem to fix them.
> Can anyone help me with this. Here's the script:
>
> import maya.cmds as cmds
> class TextureUploaderUI(object):
> def __init__(self):
> self.winName = "PSD_In"
>
> if cmds.window(self.winName, exists=True):
> cmds.deleteUI(self.winName, window=True)
> self.window = cmds.window(self.winName, title="Texture Upload",
> resizeToFitChildren=True)
> mainLayout = cmds.rowLayout(numberOfColumns=2, columnWidth = [(1,
> 100), (2, 500)] )
> col1Layout = cmds.columnLayout(adj=True, rowSpacing=10,
> columnWidth=250)
> cmds.scriptedPanel(type="createNodePanel", label="Select Material")
> cmds.setParent(mainLayout)
> col2Layout = cmds.columnLayout(adj=True)
> cmds.scriptedPanel(type="nodeEditorPanel", label="Texture Editor")
> cmds.setParent(mainLayout)
> #cmds.formLayout(form, e=True, af=[(p,s,0) for s in
> ("top","bottom","left","right")])
> #commandBTN = cmds.button(label="Create!", c=self.makeSpans)
>
> cmds.showWindow(self.window)
>
> TextureUploaderUI()
>
>
> Run it in Maya and see for yourself. Thanks.
>
>
>
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/python_inside_maya/073f9025-df59-43da-b0af-955bf97d04c0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.