Announcement

Collapse
No announcement yet.

Maxscript to zoom extents

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

  • Maxscript to zoom extents

    Hi Guys,
    I'm trying to use maxscript to zoom extents. When I use the command "max zoomext sel", it zooms properly, but leaves too much of a border around the selection. I'd like it to literally fit to the viewport.

    Anyone able to lend a hand?
    -- DJ

  • #2
    Answered my own question I suppose.

    Assuming it isn't going to leave things out of the viewport...
    Excuse the messy coding. I might clean it up and make a nice function out of it later

    Code:
    s = $.min as string
    r = s.count
    for i = 1 to r do
    	(
    	if (s[i] == "[") OR (s[i] == "o")OR (s[i] == "]") then
    		(
    		s = replace s i 1 ""
    		)
    	)
    print s
    
    tmp = filterString s ","
    c1 = [ (tmp[1] as float * .90),(tmp[2] as float * .90),(tmp[3] as float * .90)]
    
    
    
    s = $.max as string
    r = s.count
    for i = 1 to r do
    	(
    	if (s[i] == "[") OR (s[i] == "o")OR (s[i] == "]") then
    		(
    		s = replace s i 1 ""
    		)
    	)
    print s
    
    tmp = filterString s ","
    c2 = [ (tmp[1] as float * .90),(tmp[2] as float * .90),(tmp[3] as float * .90)]
    
    
    
    Viewport.ZoomToBounds false c1 c2

    Comment


    • #3
      I'm confused why you would need that?

      Do you need that as part of another script maybe?

      If not, if you have no object selected and try zoom selected then it zooms the extents of the scene.


      Sorry if that is so simple it's insulting, but sometimes I am trying to hard to make something complex that a don't realize there is a one or two button way of doing something. Thought this might be one of those moments.

      That still may even make the script easier.

      Sorry if I just annoyed.

      Comment


      • #4
        Isn't the "Z" key good enough ?

        Best regards,
        nikki Candelero
        .:: FREE Your MINDs, LIVE Your IDEAS ::.

        Comment


        • #5
          aye, go ahead DJ, i might rip that myself when you're done

          I have the same "taste" issue as DJ, for me often zoom extents (all or sel) is a tad too wide...

          Lele

          Comment


          • #6
            As StudioDIM said, the zoom extents is "a bit too wide for my tastes"

            Just trying to automate as much as possible!

            Cheers
            -- DJ

            Comment


            • #7
              I know this doesn't really fit "Vray" so much - but how about a script sticky? There are a lot of good scripts floating around this board.

              I am still trying to figure out that DR manager one. Is there a DR manager in 1.5?
              www.studio2a.co

              Comment

              Working...
              X