Home Coding, Scripting, Shaders

Maxscript gizmo access

afb3d
polycounter lvl 3
Offline / Send Message
afb3d polycounter lvl 3
Hi all,

Isit possible access show transform gizmo through code? So instead of it toggling you can turn it on/off  on command.

Searched the reference and found tmGizmos but I'm not seeing anything that will do that. Unless there's a smart way to use the use gizmo check?

Thanks

Replies

  • monster
    Offline / Send Message
    monster polycounter
    You can use preferences.useTransformGizmos = true or false to set the transform gizmo's visibility.  tmGizmos.useGizmo = true or false also works.

    After running that command use redrawViews() to make sure the viewport updates, if needed.
  • afb3d
    Offline / Send Message
    afb3d polycounter lvl 3
    Thank you @monster I'll give this a shot today within my script and let you know how it goes. 

    Funnily I did try tmGizmos.usegizmo = true/false but didn't know about redrawviews so assumed nothing was happening  :/
  • afb3d
    Offline / Send Message
    afb3d polycounter lvl 3
    ah so i tried it and yes they both work but they still show the disabled gizmo which literally just gets in the way.  That's the guy im truly after (see below). Seems to be the only option that hides it all together. Searching high and low >.<



    I believe a combination of tmGizmos.useGizmo = false + somehow accessing the axis tripod to be off would do the trick.

    I did do some digging within the 3dsmax.ini and found showaxisicon = 1. I saved a separate version and in max toggled the "show transform gizmo" on/off.......updated the ini inside notepad++ and did a comparison to see whats actually changing under the hood and thats the only thing that changes....

    which then led me to max showaxisicon BUT ITS STILL A TOGGLE blurgh.......


  • afb3d
  • Swordslayer
    Offline / Send Message
    Swordslayer interpolator
    You can query the current state of the action item:

    (
        local maiUITable = for i = 1 to actionMan.numActionTables where (actionMan.getActionTable i).name == "Main UI" do exit with actionMan.getActionTable i
        local axisShowItem = for i = 1 to maiUITable.numActionItems where (item = maiUITable.getActionItem i; item.getMenuText &aiMenuText; aiMenuText == "Show Transform Gi&zmo") do exit with item

        /* ... */
        if axisShowItem.isChecked then max showAxisIcon -- hide the gizmo
    )
  • afb3d
    Offline / Send Message
    afb3d polycounter lvl 3
    Thanks @Swordslayer . Cant seem to see your code?

    {edit}

    Thanks
  • afb3d
    Offline / Send Message
    afb3d polycounter lvl 3
    ok so @Swordslayer your code broke my brain but i managed to use it lol so im grateful for your input and help :) 


Sign In or Register to comment.