Announcement

Collapse
No announcement yet.

Can this be scripted?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Can this be scripted?

    I have never done any scripting so if any of you script "gurus" can give some feedback I'd be greatfull. Needless to say I've been asking Autodesk for this for the last 10 years ad never get any answer. I just want to see if this is in fact a big problem for some reasons that I can't understand.

    1.It's about switching max views from top to back, left right etc... When you press "T" you are in top view, press "R" and you are in righ view and that's OK as long as you're using the Home Grid. The moment you switch to User Grid, shortcuts don't work and I have to select with mouse from the viewport menu like Views/Grid/Front etc...which is just too many clicks.
    Is it possible to tell max that, once I'm in the User Grid mode, when I pres "R" I want to go into Grid/Right view. In other words viewports shortcuts R,T,L,B,K are applicable to the current Grid activation?

    2. Is it possible to script this:
    -Switching to any non-orthografic view will toggle only 3D snap=ON
    -Switching to any orthographic view will allow any snap toggle

    Thanks for your input
    Zoran

  • #2
    No easy way to move around the grid views, pretty lame, makes grids next to useless. I guess one way would be to create 6 cameras around then grid then switch to user view from a camera named "top", "left" etc.

    For the force 3D snap it could be done with a call back that checks what the current view type is and sets the snap accordingly, this won't work with grid views though since they all return the same view name. Might slow down max too because the call back is thrown at just about every action in the viewport.
    Eric Boer
    Dev

    Comment


    • #3
      It would be possible I believe, but I'm afraid I don't understand the problem. When you're in user grid hotkeys don't work? Let me know and I'll see if I can remedy your problem.
      Colin Senner

      Comment


      • #4
        Thanks RErender for your quick reply

        Originally posted by RErender View Post
        For the force 3D snap it could be done with a call back that checks what the current view type is and sets the snap accordingly, this won't work with grid views though since they all return the same view name. Might slow down max too because the call back is thrown at just about every action in the viewport.
        Funny how max works? I'd expect something simple along these lines
        -user Grid object activated
        -if viewport=camera or perspective or user view
        -turn 3D snap=ON

        Regards

        Zoran

        Comment


        • #5
          Originally posted by MoonDoggie View Post
          It would be possible I believe, but I'm afraid I don't understand the problem. When you're in user grid hotkeys don't work? Let me know and I'll see if I can remedy your problem.
          MoonDoggie, Thanks for your reply.

          Simpler version'd be:

          1.Can I have hot-keys for user-grid views (preferable the same as for orthographic views)

          2.Turn 3D snap=ON every time I'm in user, camera or perspective view

          Thanks and regards

          Zoran

          Comment


          • #6
            Got this figured out moondoggie? Sure would be useful.
            Eric Boer
            Dev

            Comment


            • #7
              hotkeys to grid

              hi zoran

              i have made something similar, there are just some hotkeys to grid, so you can assign custom grids to selected objects. take a look

              EVERMOTION FORUM

              i have searched the maxscript help, but i dint find anything for directly access the grid,left,top,right. etc like the pulldown menu from maxviewport. neverthe less
              there are some commands for normal view to user grid, and you have access to rotate the viewport via maxscript.

              max command:

              "max vpt grid" ... Sets active viewport to Grid
              <boolean>viewport.rotate <quat> [center:<Point3>] ... Performs a rotate of the current viewport

              snapMode.active ... Get/Set whether snap is active as a Boolean value.
              snapMode.type ... Get/Set the current snap type as a name. Possible names are #2D, #2_5D, #3D.

              so if you want you can access the nornmal view and then rotate the viewport 90° to get thr right grid-left_top...etc. combined with the snapmode settings you could manage it to get the hotkeys you want.

              try it!

              Comment


              • #8
                I guess since rotating a user grid is not part of my daily routine I still don't understand but pico is on the right track, it's easy enough to do. More explanation for my thick skull and I'll write it up quick.
                Colin Senner

                Comment


                • #9
                  If you create a grid and rotate it or whatever, most common in arcviz is say if a building or a pool or whatever is rotated off off north/south. So say the pool area is rotated at 45 deg from North. So create a grid, rotate it 45 degrees and then set it active, now all your transforms are aligned to the grid, for instance now if you create a box it is created at 45 deg. Not too much trouble working at 45 from the top but normal front and side views are a pain. You can view from front.grid but the only way to get there is to drill way down into the viewport menu every time and shortcuts are not directly available, for some reason Max returns all the grid views, front, back etc. are just returned as "grid".

                  For the snap there is already a script that works in the normal views, I assumed Zoranm wanted it for grid views. Pretty sure it's on scriptspot.

                  I was actually thinking this morning of something along the lines of what Pico offered, I was thinking I'd need to get the grid orientation and work out the math for the views but that sounds good to just start at the grid top view and rotate from there.
                  Last edited by RErender; 05-06-2008, 09:04 AM.
                  Eric Boer
                  Dev

                  Comment


                  • #10
                    I was never able to find a way to switch to grid views via script.. only to the main primary grid view.. via the 'max vpt grid' which isn't terribly helpful. I Guess you could do some transforms on the viewpoint via script to get to the other views, but i've never gotten around to trying.

                    heres my little toy to help with grids, oldie, but i still use it http://www.scriptspot.com/3ds-max/grid-by-name
                    Dave Buchhofer. // Vsaiwrk

                    Comment


                    • #11
                      Pico:
                      Thanks a lot for your input. I tested your script and it works great but what I need is something which alignes to a face. Never the less I'll still use it.

                      dbuchhofer:

                      Thanks mate, your script worked like a charm. I can do my view changes much faster now

                      It'd still be nice to use shortcuts though

                      Regards and thanks a lot to all. Now I know that it's not as easy as I thought originally.

                      Zoran

                      Zoran

                      Comment

                      Working...
                      X