Home Technical Talk

Hotkey to swap from View to Local (max)

polycounter lvl 13
Offline / Send Message
[HP] polycounter lvl 13
Hey guys,

On the reference coordinate system (How the pivot is placed for rotation, etc) I find myself swamping from view to local, local to view, quite a lot.
Does anyone know a way to make a hotkey to swap from this two items?

Cheers!

Edit:
ok, I turned MAXScript listener, and apparently the commands are:
toolMode.coordsys #view
toolMode.coordsys #local


Does anyone know how to apply each one of this to a hotkey? I have no scripting experience at all.

Replies

  • PolyHertz
    Offline / Send Message
    PolyHertz polycount lvl 666
    here ya go:
    macroScript axisToggle
    category: "GregsScripts"
        (
        maniptype = toolMode.commandmode as string
        varAxis = getRefCoordSys() as string
        
        if varAxis == "world" or varAxis == "hybrid" then
            (toolMode.coordsys #local)
            else()
        if varAxis == "local" then
            (toolMode.coordsys #view)
        )
    
  • [HP]
    Offline / Send Message
    [HP] polycounter lvl 13
    That was fast! :D

    Thank you very much!
  • d1ver
    Offline / Send Message
    d1ver polycounter lvl 14
    Hey man, select the part of the code you want to make a hotkey of and then drag and drop it on your toolbar. a button will appear. then go to Customize User Interface and in "category" choose DragAndDrop. Voila. Find you script there and assign a hotkey. You can also rename it along the way. Kinda anal way but I don't know any other =)

    But are you sure that a hotkey is what you want? If you press alt+RightMouseButton in right upper quad you'll get all of the options to change coordinate systems. It takes me no then more a second to use it. So if you're not swaping them 10 times per minute I suggeest you use this.

    But if you still want the script then you'll need some code to toggle from view to local. It'll be much comfier then having two hotkeys. If thats the case just drop a line and I think I'll be able to figure this out.

    edit:aaah)too late) good job, PolyHertz!
  • [HP]
    Offline / Send Message
    [HP] polycounter lvl 13
    That info will be useful for future d1ver, thank you.
  • PixelGoat
    Offline / Send Message
    PixelGoat polycounter lvl 12
    "compile error: nested macroscript definitions are not permitted" is what I get when trying to add that script to the toolbar :/
    What gives?
  • PolyHertz
    Offline / Send Message
    PolyHertz polycount lvl 666
    PixelGoat: That's because when adding a script to the toolbar max will try and add the info automatically. So just drop the script without the macroscript or catagory text, ie:
        maniptype = toolMode.commandmode as string
        varAxis = getRefCoordSys() as string
        
        if varAxis == "world" or varAxis == "hybrid" then
            (toolMode.coordsys #local)
            else()
        if varAxis == "local" then
            (toolMode.coordsys #view)
    
    
  • PixelGoat
    Offline / Send Message
    PixelGoat polycounter lvl 12
    how stupid of me :) Thanks! ;)
  • Hellfire
    Offline / Send Message
    Hellfire polycounter lvl 14
    @PolyHertz
    Thank you for this awesome script.
    This saves a lot of time
Sign In or Register to comment.