Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk® Maya® / MEL / Simple MEL scripting problem
  RSS 2.0 ATOM  

Simple MEL scripting problem
Rate this thread
 
64075
 
Permlink of this thread  
avatar
  • jeremy505
  • Posted: 01 February 2012 08:10 AM
  • Total Posts: 15
  • Joined: 01 March 2007 12:14 AM

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;



Attachment Attachment
Replies: 0
avatar
  • ldunham1
  • Posted: 01 February 2012 11:39 AM

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;


Lee Dunham | Character TD
ldunham.blogspot.com

Replies: 0
avatar
  • jeremy505
  • Posted: 02 February 2012 06:48 AM

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;


Attachment Attachment
Replies: 0
avatar
  • ldunham1
  • Posted: 02 February 2012 09:48 PM

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.



Lee Dunham | Character TD
ldunham.blogspot.com

Replies: 0