Set Zoom to 100% ?

Next
 From:  NightCabbage
3913.1 
Hiya

I'm just wondering, is there any way that I can set the zoom in a viewport to be 100%?

(eg. 1 pixel per unit)

This would be extremely handy for what I'm doing :)

Thanks!
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
3913.2 In reply to 3913.1 
Hi NightCabbage, no there's not any way I can think of to do that currently.

In a perspective 3D viewport, there isn't even a constant relationship of pixels to units due to perspective foreshortening. Things that are far away may have a large number of units fit within the same screen pixel size of something that is a smaller unit size but closer to the eye point.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  NightCabbage
3913.3 
Sorry, I should have specified that I just meant for the orthographic viewports (Top, in particular, for this instance).

Hmmm that's a bummer!

So there's not even any way to script it, or any clever trick I can do?
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
 From:  Michael Gibson
3913.4 In reply to 3913.3 
Hi NightCabbage - the pixel dimensions of the viewport are not currently accessible to scripts, so you'll need to find some other way of getting that info - maybe try a screen capture utility and see what size image it grabs from a viewport window or if you have Visual Studio installed use Spy++ from there to find the pixel width and height of the viewport's window.

Then plug in the smaller of the width and height into this script, putting that number in place of where it says 482 currently:

script: /* Set top viewport zoom to 1 pixel = 1 unit */ var viewport_pixel_size = 482; var vp = moi.ui.mainWindow.viewpanel.getViewport('Top'); vp.fieldOfViewAngle = viewport_pixel_size;

Set that script up on a shortcut key and then when you trigger it, it should zoom the top viewport to be 1 pixel = 1 unit.

Note that if you do anything that changes the viewport size like sizing the main window or switching from split view to a maximized top view, that it will no longer be 1 pixel = 1 unit after that.

Hope this helps!

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All