Home Technical Talk

Creating context sensitive hotkeys with maxscript?

polycounter lvl 10
Offline / Send Message
Joltya polycounter lvl 10
Hey guys! Trying to optimize my hotkey use and consolidate the keys that I use. I've used Perna's smart create to make some of my own, but those only work in the subobject level. What I'd like to do is have keys that alter depending on if I'm working in spline, poly, or UV. For instance, it would be really nice if I could have my ring/loop selection tool be consistent when I'm working with the mesh or the UVs. Same with using champher on verts/corners. I'm not really smart enough to figure out how to get a script to identify what type of object I'm working on, so does anyone know what function I could use to get started on this?

Replies

  • Amsterdam Hilton Hotel
    Options
    Offline / Send Message
    Amsterdam Hilton Hotel insane polycounter
    This is one of those things that's a real pain in Max, pretty much every modifier has its own set of functions.

    I wrote my own contextual hotkeys as well, like you're doing, after reading Per's thread.

    What you can do is a switch case based on modifiers, like this:

    Case (classOf curObj) of
    		(
    			Edit_Poly:
    			(
    				Case subobjectlevel of
    				(
    					1: ()	--vertex
    					2: ()	--edge
     3: () --border 4: () --face 5: () --element ) ) Editable_Poly: ( Case subobjectlevel of ( 1: () 2: () 3: () 4: () 5: () ) ) )


    This lets you change context based on what modifier is selected. Using the maxscript listener and the online docs will help you figure out what you need to access in splines, UV unwrap, etc.
Sign In or Register to comment.