Community
3ds Max Forum
Welcome to Autodesk’s 3ds Max Forums. Share your knowledge, ask questions, and explore popular 3ds Max topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Can I Hotkey A Custom Script?

8 REPLIES 8
SOLVED
Reply
Message 1 of 9
The-Digital-Shaman
576 Views, 8 Replies

Can I Hotkey A Custom Script?

Hi,

 

Since I found Macro Recorder in the Scripting Listener, I would like to create scripts and assign hotkeys to them.

Is this possible? How one would go about it?

 

Also, Can I preview code for actions (commands) directly in the HotKey Editor?

 

 

Many thanks,

DS

8 REPLIES 8
Message 2 of 9

Hi,

 

There is a video here, everything explained in the video is pretty much how it's done, except for the Hotkey editor has moved now to it's own dedicated editor window under the Customise dropdown menu. https://www.youtube.com/watch?v=_7NGvK5z6jo

As for previewing code in the Hotkey Editor itself, not exactly sure what you mean here, but there is no Maxscript Viewer built into it, if that's what you mean? Although you can quite easily view the code in the macro recorder, or Maxscript Editor under the Scripting dropdown menu.

Regards,


Darawork
AutoDesk User
Windows 10/11, 3DS Max 2022/24, Revit 2022, AutoCad 2024, Dell Precision 5810/20, ASUS DIY, nVidia Quadro P5000/RTX 5000/GTX760

Hi all! A quick tutorial for how to set an hokey for a script. The video about maxscript .ms and .mse files: https://www.youtube.com/watch?v=U2KgYYJ6yiI&t=36s If you have any question or request please comment :) WWW.DPVFX.NET
Message 3 of 9

Thank you for the reply!

I am about to watch the tutorial.

 

Attached to this post you will find recorded Hotkey Editor from Maya, where i show previewing code and custom hotkeyed scripts.

 

 

Message 4 of 9

Ahh,

 

Cool. But, Nope, unfortunately that looks like a Maya only functionality... far too nice for us lowly Max users.

Regards,

Darawork
AutoDesk User
Windows 10/11, 3DS Max 2022/24, Revit 2022, AutoCad 2024, Dell Precision 5810/20, ASUS DIY, nVidia Quadro P5000/RTX 5000/GTX760

Message 5 of 9

I watched the tutorial.

Thanks! Shortcuts and hotkeys can be assigned to custom scripts.

 

My custom script (switch to Border component mode and Cap) does work when activated from toolbar (shelf), but not from hotkey.

 

Do you know why that may be?

 

I recorded what is going on.

 

This is the code btw:

 

macroScript DSCap
category:"Custom"
internalCategory:"Custom"
tooltip:"DS Cap"
ButtonText:"DS Cap"
autoUndoEnabled:false
Icon:#("UVWUnwrapSelection",28)

(
subobjectLevel = 3
$.EditablePoly.capHoles #Edge
)

Message 6 of 9

Btw, what the hell with the icons? What am I doing wrong when trying to change them?

 

 

Message 7 of 9

Hi,

You might have to restart Max so as to refresh the customisation completely, as a lot of these things are loaded during the program start up. 

Another thing to look out for is a possible clash of a pre-existing Hotkey definition. [O] is usually a Shortcut for Orthographic viewport projection (you can switch from Actions to Hotkeys to see any pre-existing definitions in place).

Regards,

Darawork
AutoDesk User
Windows 10/11, 3DS Max 2022/24, Revit 2022, AutoCad 2024, Dell Precision 5810/20, ASUS DIY, nVidia Quadro P5000/RTX 5000/GTX760

Message 8 of 9

Yeah, Icons only refresh on relaunch of Max too.
Your Maxscript looks correct to me.

Regards,

Darawork
AutoDesk User
Windows 10/11, 3DS Max 2022/24, Revit 2022, AutoCad 2024, Dell Precision 5810/20, ASUS DIY, nVidia Quadro P5000/RTX 5000/GTX760

Message 9 of 9

"Another thing to look out for is a possible clash of a pre-existing Hotkey definition. [O] is usually a Shortcut for Orthographic viewport projection (you can switch from Actions to Hotkeys to see any pre-existing definitions in place)."

 

That one thing Max has better imo.

 

Manually one has to remove a hotkey from already assigned action/command.

 

Maya is more like Photoshop. It asks if you want to change already assigned shortcut, but its already one foot in door to do it. Sometimes accidentally changing assigned shortcuts (with help of a certain bug, but nvm).

 

 

It works, thanks!

Restarting Max helped for both, changing icon and the hotkey.

 

Yeah, Maya got a few things better.

No need to juggling with files this much or at all. More is being done within Maya.

No need to create a new script file for each new command used in Hotkey editor.

No need to restart Maya, unless we have a code in an external file, which we want to source.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report