Framing camera rotation around selected object + centering view

Next
 From:  pior (PIOR_O)
11112.1 
Hello all, Michael,

Does MOI have any alternative to the Reset All command for recentering the view ? I am specifically looking for way to reframe the current view according to the currently selected object, but without the "zoom to fit" effect that Reset All does. Like so :



Being able to frame like so (without zooming) would add a lot of stability to interactions in the 3D viewport, and would also benefit work done in a 2D view. The way things are currently means that the user needs to always un-zoom after each Reset All, which can get quite tiring very fast.

(Note that since I am using a heavily customized UI there is a possibility that I am missing some obvious button doing exactly what I am after.)

Thanks !
Attachments:

  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:  vic
11112.2 In reply to 11112.1 
The next script will help you.

MoveTargetToObjectsV2 – Rhino-like command; moves a viewport target's position to the center of the bounding box of selected objects.

Alt+Q script:var objs = moi.geometryDatabase.getSelectedObjects(); if ( objs.length > 0 ) { moi.ui.mainWindow.viewpanel.getViewport('3D').targetPt = objs.getBoundingBox().center; }
  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
11112.3 In reply to 11112.2 
Or also the one from here:
http://moi3d.com/forum/index.php?webtag=MOI&msg=5392.4

- 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:  pior (PIOR_O)
11112.4 
Hello both ! Well, that's perfect (and so much more relaxing than having to unzoom each time !). Thanks :)
I see that the code for the two versions is very similar. Is one more robust than the other ?

Also, I think this would be great to have by default, as a button. I feel like people might very much enjoy this even though it may not feel like an obvious necessity at first. As a matter of fact I've used MOI for years now with feeling like it was a dealbreaker not to have this ; but because of the specific thing I was working on yesterday (involving some tricky inspection of parts and dimensions) it really became obvious how disorienting the frame+zoom was.
  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
11112.5 In reply to 11112.4 
Hi pior,

re:
> I see that the code for the two versions is very similar. Is one more robust than the other

One version operates only on the 3D viewport, the other one operates on the active view including if it's an ortho view.

- 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
 From:  pior (PIOR_O)
11112.6 In reply to 11112.5 
Excellent, thanks makes sense. 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
 

Reply to All Reply to All