PDA

View Full Version : a way to fix this UI layout?


cgbeige
10-18-2010, 07:14 PM
I have some rather ugly rendering issues in Maya 2010 and earlier. It seems like I can't get a minimum width between checkboxes that is less than something huge:

http://grab.by/grabs/7c5c2c7a8acbed4d42e4892c2a4189c3.png

Here's the part of my code that has the columns and stuff in it:



columnLayout;

//BUILD BUTTON TOOLS//

separator -style "none" -height 2;

rowColumnLayout
-numberOfColumns 4
-width 250
-cs 2 2;

checkBox -label "VFB" -ann "Use V-Ray Framebuffer" vraytunercheckbox;
checkBox -label "LWF" -ann "Enable Linear Workflow" vraytunercheckbox2;
checkBox -label "GI" -ann "Enable Global Illumination" vraytunercheckbox3;
checkBox -label "Clamp" -ann "Enable " vraytunercheckbox4;

setParent ..;
setParent ..;

rowColumnLayout
-numberOfColumns 2
-cs 2 2
buttons;

button
-label "Show VFB"
-width 124
-height 20
-annotation "Only works after you've enabled VFB in options and render once. Not supported in OS X and Linux for <Maya 2011."
-command "vray showVFB"
;

button
-label "Render Options"
-width 124
-height 20
-command "unifiedRenderGlobalsWindow"
;

button
-label "Attach Camera"
-width 124
-height 20
-command "connectCamExp()"
-annotation "Connects Physical Camera sliders to camera's V-Ray attributes that you create first. Select your camera and hit the button."
;

button
-label "Render"
-width 124
-height 20
-command "RedoPreviousRender"
;

setParent ..;
separator -style "none" -h 2;
setParent ..;


//BUILD SLIDERS AND COLLAPSIBLE FRAMES//

//DMC Globals
frameLayout -collapsable true -label "Global DMC Quality Control" -width 250;
columnLayout;
text -align left -label "DMC Adaptive Amount (0.1 slow, 0.85 bad):";
floatSliderGrp -precision 2 -field 1 -min 0 -max 1 vraytunerslider1;

NaughtyNathan
10-18-2010, 10:00 PM
I think the problem is that you are using rowColumnLayout and it's a useless pile of crap.
Try putting all your checkboxes into a rowLayout instead and then you can set the specific columnWidths for each column. e.g.

rowLayout -nc 4 -cw4 60 60 60 60;:nathaN

cgbeige
10-19-2010, 03:49 AM
nice - that works. Thanks, I'll avoid rowcolumn in the future.

while I've got you - is there a way for a MEL panel to auto-resize to fit content? When I collapse frames, there's an empty space and the window doesn't resize. I'm hoping I don't have to use Qt to do something like this.

JayG
10-21-2010, 12:42 AM
I think the problem is that you are using rowColumnLayout and it's a useless pile of crap.

Amen brother!

NaughtyNathan
10-21-2010, 10:26 AM
...while I've got you - is there a way for a MEL panel to auto-resize to fit content? When I collapse frames, there's an empty space and the window doesn't resize. I'm hoping I don't have to use Qt to do something like this.

sorry Dave, didn't notice this reply before now... I have several tools that take the form of a photoshop-style "palette" with different sections contained in their own collapsable frameLayout. I'm not sure about 2011 as I've only just started trying to convert our tools to 2011 and I'm already drowning in a sea of UI issues and bugs, but in 2010 and below I've not found any reliable way to auto-resize.

The way I currently do it is to assign a "resizePalette" command to each frameLayout collapse/expand callback. This function automatically resizes the palette window based on which frames are open and which are collapsed, and what their reported -height is (so I don't have to hard-code any pixel heights into the function).

:nathaN

cgbeige
10-22-2010, 06:06 AM
awesome - thanks. I'll look into that.

petemolinero
10-24-2010, 07:53 PM
I think the problem is that you are using rowColumnLayout and it's a useless pile of crap.
Try putting all your checkboxes into a rowLayout instead and then you can set the specific columnWidths for each column.


Another good option is formLayout (http://accad.osu.edu/~aprice/courses/694/gui.html#form)!

nessus
10-26-2010, 12:17 AM
Another good option is formLayout (http://accad.osu.edu/~aprice/courses/694/gui.html#form)!

Agree. formLayout is the way to go as far as building complex Maya layouts concerns, it respects control/sub-layout within it with relativities to each other - this means your contents in the UI "auto-resize" as long as you code properly :)

You can also use PyQT for fancier UI elements.

NateH
10-26-2010, 12:51 AM
Agree. formLayout is the way to go as far as building complex Maya layouts concerns, it respects control/sub-layout within it with relativities to each other - this means your contents in the UI "auto-resize" as long as you code properly :)

You can also use PyQT for fancier UI elements.

Yeah formLayout is almost always the way to go if you are using elf.

PyQt is win:
http://dl.dropbox.com/u/1633130/Photos/pyqt_maya.png
Tree controls that don't suck, icon support just about everywhere, custom control inside of tree controls, Proxy sort filter, Better layout management, etc...

ewerybody
10-26-2010, 11:10 AM
be aware! In standard Maya ELF UI formLayout is nice indeed! But it needs a lot of setup! I've seen many cases of simple stacking done with formLayout. That could be done with columnLayout with a fraction of the code.

longing for 2011 and Qt.... PySide (http://www.pyside.org/) is out as well! Anybody used it yet?

ginodauri
10-26-2010, 12:35 PM
I do not work with columnLayout,rowLayout etc , only formLAyout.
This is because autoresizing.
But formlayout is slow to setup and really slow to tweak if you use it by "default".
Better way is to write your procedures to control formLayout.
For example i have procedures that act like row/columnlayout but with resizing.

Example would be:
form=formLayout();
#ui elements
myColumnLayout(form)

This more efficient way than default.

ewerybody
10-26-2010, 02:05 PM
you can use -adj 1 on columnLayouts (http://download.autodesk.com/us/maya/2009help/Commands/columnLayout.html#flagadjustableColumn). So your elements will resize automatically as well.

ginodauri
10-27-2010, 09:17 PM
Ok , but adj is only for horizontal resizing , i'm talking about vertical and horizontal and that is only possible with formLayout and paneLayout.In 90 % i use these two , only for something really simple i would use columnLayout etc.

CGTalk Moderation
10-27-2010, 09:17 PM
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.