Home Technical Talk

Maxscript keyboard shortcuts?

polycounter lvl 18
Offline / Send Message
Rick Stirling polycounter lvl 18
Anyone know if its possible to assign a keyboards shortcut to a button in a maxscript?

I've got one that copies a vert weight, and then pastes it to another vert. Adding a shortcut for copy and one for paste would save me ages.

Replies

  • FatAssasin
    Offline / Send Message
    FatAssasin polycounter lvl 18
    You can do something following:

    Let's say this is the script with the rollout and the button that you want to press:

    <font class="small">Code:</font><hr /><pre>rollout testRlt "Test Rollout"
    (
    button testBtn "Press Me"
    on testBtn pressed do (print "Button pressed")
    )
    testFltr = newRolloutFloater "Test Floater" 150 60
    addRollout testRlt testFltr</pre><hr />

    You would make a new macroscript that basically just says something like this:

    <font class="small">Code:</font><hr /><pre>testRlt.testBtn.pressed()</pre><hr />

    Then assign that one to a hot key. You'd have to make a seperate macroscript for each button. And you might have to declare the main rollout as global in the original script. Also, the rollout would have to be open for the other button pressing scripts to work.

    Hope that helps.
  • monster
    Offline / Send Message
    monster polycounter
    When I need to make a keyboard shortcut quickly I just select the text from the listener or script window and drag and drop it onto a tool bar.

    Then if you go to Customize User Interface/Keyboard and look in the "Drag and Drop" Category you'll find the script you just dropped.

    It's pretty handy.

    Lately I just have a toolbar called "Temp" and I just drag and drop scripts to it all the time. I don't even bother with the hotkeys anymore.
Sign In or Register to comment.