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 / Making a UI button repeatable?
  RSS 2.0 ATOM  

Making a UI button repeatable?
Rate this thread
 
42618
 
Permlink of this thread  
avatar
  • Reeks
  • Posted: 28 April 2010 09:21 PM
  • Total Posts: 3
  • Joined: 19 February 2008 08:52 PM

While building a UI for common commands I’ve become stumped at replicating the “repeatable” effect we see in shelf buttons. 

Does anyone have any advice for making a [button] repeatable ?  (G key of course)

button 
    
-parent $buttonForm 
    
-height 20
    
-label "New Lambert"
    
-command "createAndAssignShader lambert \"\"";

When that was a shelf button, hitting “G” after its first application would apply a NEW lambert to each object selected.
Now that I have it as a text button in a UI as above, each successive “G” adds the SAME lambert

I realise I could use a shelfbutton in the ui dock, but that defeats the purpose somewhat.
Any advice MUCH appreciated, and of course thanks in advance



Replies: 0