Simple MEL scripting problem

Simple MEL scripting problem

Anonymous
Not applicable
419 Views
3 Replies
Message 1 of 4

Simple MEL scripting problem

Anonymous
Not applicable
I hope this is the right place for this... but anyway...

I'm building myself a simple floating window ui with icontextbuttons of tools I frequently use.
For the most part, it's going well. For some reason though, the row height is set to 50 pixels and I cannot for the life of me figure out why. The test image I'm using is 64x64 and the width of the column is fine but it keeps clipping off the bottom 14 pixels of my image. Below is a small version of my script (to shorten the post).

Thanks for any and all help in advance!


if (`window -exists jeremysTools`)
deleteUI jeremysTools;
window -title "jeremysTools" jeremysTools;

rowColumnLayout
-numberOfColumns 3
-columnWidth 1 64
-columnWidth 2 64
-columnWidth 3 64;

iconTextButton -image "C:/Users/jeremy505/Desktop/test.bmp" -h 64 -w 64 -command AppendToPolygonTool -rpt 1;
iconTextButton -image ".bmp" -h 64 -w 64 -command HypershadeWindow;


showWindow jeremysTools;

0 Likes
420 Views
3 Replies
Replies (3)
Message 2 of 4

lee.dunham
Collaborator
Collaborator
hmm works fine here on 2011 sp1.
Could perhaps try gridLayout,
gridLayout -numberOfColumns 3 -cw 64 -ch 64 ;

or symbolButtons?
symbolButton -image "C:/Users/jeremy505/Desktop/test.bmp" -h 64 -w 64 -command AppendToPolygonTool;
0 Likes
Message 3 of 4

Anonymous
Not applicable
tried both of those and neither seemed to fix the problem 😕
did a bit more work on the icons just so you can see the problem more clearly.
the bmp's are 64x64 and the icon sizes are 64x50...

heres a full version of the script with some of the commands taken out to save space.

if (`window -exists jeremysTools`)
deleteUI jeremysTools;
window -title "jeremysTools" jeremysTools;

rowColumnLayout
-numberOfColumns 3
-columnWidth 1 64
-columnWidth 2 64
-columnWidth 3 64;

iconTextButton -image "G:/3D/toolsProgramsPlugins/jeremysToolbar/hypershade.bmp" -h 64 -command HypershadeWindow;
iconTextButton -image "G:/3D/toolsProgramsPlugins/jeremysToolbar/uvtexteditor.bmp" -h 64 -command TextureViewWindow;

showWindow jeremysTools;

0 Likes
Message 4 of 4

lee.dunham
Collaborator
Collaborator
Try using the -marginHeight flag on the iconTextButton, the -rowHeight and -columnSpacing or -rowSpacing flags on the rowColumnLayout, see if that helps.

you could also try just one iconTextButton alone, just to see if the problem lays with the rowColumnLayout or the iconTextButton itself.

if the icon isnt cropped on the single button, try using a columnLayout with multiple rowLayouts as children instead of the one rowColumnLayout.
0 Likes