NVil Forum

General Category => Feature Requests => Topic started by: rubberDuck on March 28, 2013, 11:48:45 pm

Title: Use workplane space for ortographic cameras when workplane is active
Post by: rubberDuck on March 28, 2013, 11:48:45 pm
Currently when workplane is active, ortographic views (top, bottom, left, right, front, back) still align with the world space instead of the workplane space. Would it be possible to improve this in one of the future releases?

Thanks.
Title: Re: Use workplane space for ortographic cameras when workplane is active
Post by: rubberDuck on March 29, 2013, 12:39:59 am
Also, there doesn't seem to be any way to snap to workplane's points or lines. NVil detects them, but does not snap.

I think I should have posted this in the bugs section after all.
Title: Re: Use workplane space for ortographic cameras when workplane is active
Post by: IStonia on March 29, 2013, 01:13:53 am
Also, there doesn't seem to be any way to snap to workplane's points or lines. NVil detects them, but does not snap.

I think I should have posted this in the bugs section after all.

Are you sure? If you have the workplane visible, snapping enabled and grid-point/grid-line snapping is on, you should be able to do it.
Title: Re: Use workplane space for ortographic cameras when workplane is active
Post by: rubberDuck on March 29, 2013, 01:51:31 am
Hey IStonia. I'm positive, unless there's something I have not turned on for workplane to be active. But new objects are created in the workplane's space, so I think it's on.

Right now, NVil shows the snapping cross when I'm near the workplane's point or line, but it doesn't snap.
Title: Re: Use workplane space for ortographic cameras when workplane is active
Post by: IStonia on March 29, 2013, 02:18:44 am
I have just checked it and it works fine. I used grid-point snap to create a box. Can you show me in a video?
Title: Re: Use workplane space for ortographic cameras when workplane is active
Post by: rubberDuck on March 29, 2013, 02:46:05 am
Okay, here's the thing. I just fired up my workstation to record the video, but the snapping does work there just fine. It doesn't on my laptop though - a dated HP Pavillion dv9500. Could this be a hardware specific problem? Or maybe it has something to do with .NET framework version I have installed (3.5 SP1)?

P.S. On my laptop I can only snap to workplane's origin.
Title: Re: Use workplane space for ortographic cameras when workplane is active
Post by: rubberDuck on March 29, 2013, 02:50:48 am
Anyway, I'll try to record a video tomorrow.
Title: Re: Use workplane space for ortographic cameras when workplane is active
Post by: rubberDuck on March 29, 2013, 03:15:16 am
Okay, I think I found what's it all about.
Here's how to reproduce it:
1. Edit->Preferences: set Unit Setup to 0.01 as one millimetre
2. Edit->Preferences->Grid: set Workplane Grid interval to 25 meters.
3. Create an object, move it off origin, rotate it a bit and create a workplane (align to selection).
4. Enable snapping to grid points or lines and try to snap the object.

But, set the workplane grid interval to 100 mm and it works.

Also, try snapping to grid point when workplane grid interval is set to 2m 500mm. You can only snap to the origin and to the first points around the origin (sometimes to the second as well, depends from which side). Generally speaking, the farther from the workplane origin, the less likely the snapping will occur.

Very weird.
Title: Re: Use workplane space for ortographic cameras when workplane is active
Post by: steve on March 29, 2013, 05:18:38 am
Hi rubberDuck,

For the snapping, it sounds like a problem with "Scene scale".

Select:- "View-> "Scene scale". Change the "Scene Scale" to 100. Set the Workplane "Grid" interval to 25m and it should work OK.
Title: Re: Use workplane space for ortographic cameras when workplane is active
Post by: IStonia on March 29, 2013, 11:40:47 am
rubberDuck, what is the scene scale your are using?

Title: Re: Use workplane space for ortographic cameras when workplane is active
Post by: rubberDuck on March 29, 2013, 01:32:31 pm
Okay.
Right now I'm using units setup of 0.1 as millimetre (so one unit is one centimetre) and scene scale of 1. Grid intervals I have set to 10cm for floor and workplanes and 1cm for view grid. The snapping is okay unless I bump the intervals to 10 meters and up. So as long as I'm not told to model a sky scrapper or a Nimitz-class carrier, it's okay. :)

I tried increasing the scene scale and it seems to help, thank you. But how does it work? It doesn't scale models already present in the scene from what I've seen - they all remain of the same size.
Title: Re: Use workplane space for ortographic cameras when workplane is active
Post by: IStonia on March 30, 2013, 02:06:14 am
A scene scale is a definition of the size of the working space. In the real world you only need a little shed to repair your shovel, but you need a huge workshop for an aircraft. Scene scale is generic unit basis. If the scene scale is 1, a box of 1x1x1 should be not too big not too small in the scene. For scene scale of 100, the box size is 100x100x100.

There are some app internal values are scene scale sensitive. For example, soft selection range, subobject snapping tollerance in cut operations, object creation range(that's the problem you mentioned in this thread), etc.

You can set up scene scale with the help of some existing reference objects. Choose 'View > Reset View', the viewport camera's location will be set to a position where the camera's distance to world origin is defined by the scene scale value. If the the reference objects are too big or too small, you can adjust the scene scale 'View > Scene Scale' and do 'View > Reset View' again to recheck until you are happy with it.
There is also a quicker way. Once you have your reference objects in the scene, turn on 'View > Auto Scene Scale Enabled'. The app will adjust the scene scale automatically base on the objects in the scene once you turn it on. Then turn it off. Now do 'View > Reset View' and you will see the auto set scene scale should be quite right or not far from it, unless you reference objects are extremely too small or too big for the available scene scales and in this case you need to scale your objects.

Once the scene scale is set up, you can set up your grid setting. Make sure the floor plane and the workplane are not overly big or small.
Title: Re: Use workplane space for ortographic cameras when workplane is active
Post by: steve on March 30, 2013, 05:19:55 am
Hi IStonia,

Scene scale is generic unit basis.
If the scene scale is 1, a box of 1x1x1 should be not too big not too small in the scene. For scene scale of 100, the box size is 100x100x100.
Then your "Auto Scene scale" is broken.
The default Box of 1x1x1 will (if "Auto Scene Scale" is enabled) force the Scene Scale to 0.1. Only when a Box reaches 2.5 will the "Auto Scene scale" change to 1
A Box of 100x100x100 will give a "Auto Scene Scale" of 10. Only when the Box reaches 250x250x250 will "Auto scale scale" change to 100.







Title: Re: Use workplane space for ortographic cameras when workplane is active
Post by: IStonia on March 30, 2013, 05:32:06 am
I don't think it is broken. The auto scene scale is a result of the computation of the bounding box of all the scene objects. The result is approximate and you can fine tune from there.
Title: Re: Use workplane space for ortographic cameras when workplane is active
Post by: steve on March 30, 2013, 05:58:16 am
I don't think it is broken. The auto scene scale is a result of the computation of the bounding box of all the scene objects.
But the "Auto scene scale" output conflicts with what you have stated.
 
Quote from: IStonia
The result is approximate and you can fine tune from there.
Fine tune what?

Title: Re: Use workplane space for ortographic cameras when workplane is active
Post by: IStonia on March 30, 2013, 06:38:39 am
What I have stated is also approximate. When you have some objects in the scene, sometimes you can use scene scale 1 or 10 or 0.1 and it won't make much difference because of the broad tollerance. For example, soft selection range can reach over the scene size of the next up scene scale.

By 'Fine tune', I mean you can adjust the scene scale up or down after auto scale. When you import some objects and you have no idea what the best scene scale should be, you can use auto scale then manual scale for find out the best scene scale quickly. Most of the time you only need to adjust one level manually to the best scene scale you want.

Do you see any potential problem? Don't need to stick to a particular number, it is just an approximate guide.
Title: Re: Use workplane space for ortographic cameras when workplane is active
Post by: rubberDuck on April 01, 2013, 12:09:13 am
Thank you IStonia for your exhaustive explanation. :)
I would have never figured out by my own that my snapping problems might be caused by scene scale not being large enough. I always thought that the "Scale Scene" command scales all objects within the scene by a given multiplier, so I simply didn't even use it once and never planned to. :D

Okay, but back to the main question.
I see that there's a "Perpendicular to Workplane" command that can act as workplane's Top View. Still, NVil lacks other orthographic views for workplane space. In order to align those cameras properly I adopted a work-around (temporary, I hope) in which I rely on a dummy cube to align views to its selected faces using the "Align along subobject normal" command (http://youtu.be/wJFRsx6fmpI).

Will you consider adding a toggle to switch between alignment of ortho camera to world and workplane spaces?
Title: Re: Use workplane space for ortographic cameras when workplane is active
Post by: IStonia on April 01, 2013, 12:56:34 am
I see you have a clever work-around. Actually the workplane space camera alignment has been implemented and will be available in next update shortly.
Title: Re: Use workplane space for ortographic cameras when workplane is active
Post by: rubberDuck on April 01, 2013, 01:13:45 am
Heh yes, well I had to find some way to align those ortho views. Just imagine my joy when I found that command... :D
Quote
the workplane space camera alignment has been implemented and will be available in next update shortly.
IStonia, you're a bearer of good news. I can't wait for the update. 8)
Title: Re: Use workplane space for ortographic cameras when workplane is active
Post by: IStonia on April 01, 2013, 01:56:18 am
I am currently doing the subd cage. You can go to sleep and when you wake up you will see the new update, hopefully.
Title: Re: Use workplane space for ortographic cameras when workplane is active
Post by: IStonia on April 01, 2013, 08:02:10 am
Well, it's done.
Title: Re: Use workplane space for ortographic cameras when workplane is active
Post by: rubberDuck on April 02, 2013, 12:18:59 am
Fantastic update IStonia! Thank you very much. This makes working with workplanes a lot faster and more efficient. ;D

However, there are two things I'd like to address. ::)

The "Set View Navigation Space" works great, but has to be applied to each view separately. Imagine a user that has just switched to workplane space while being in perspective view. He still needs to go through all the orthographic views to set them to workplane space too. That's six times he has to enter the View->Set View Navigation Space menu or press the same shortcut key he has mapped to it.

The other thing is that when "Custom/Front/Back/... View" is enabled, orthographic views will still overwrite the perspective camera's position and rotation when user switches back to it. Also, orthographic views seem to propagate their own individual shading modes and grid visibility to perspective view, but switching between orthographic views works correctly.

http://youtu.be/qUnMltLzKKU
Title: Re: Use workplane space for ortographic cameras when workplane is active
Post by: IStonia on April 02, 2013, 10:48:20 am
The "Set View Navigation Space" works great, but has to be applied to each view separately. Imagine a user that has just switched to workplane space while being in perspective view. He still needs to go through all the orthographic views to set them to workplane space too. That's six times he has to enter the View->Set View Navigation Space menu or press the same shortcut key he has mapped to it.

It is fixed.


The other thing is that when "Custom/Front/Back/... View" is enabled, orthographic views will still overwrite the perspective camera's position and rotation when user switches back to it. Also, orthographic views seem to propagate their own individual shading modes and grid visibility to perspective view, but switching between orthographic views works correctly.

The 'Perspective/Orthographic' command is only used to switch between the camera's perspective and orthographic attribute and the camera's location and focus point remain unchanged. To achieve your result, you need to use the 'Snap View' command as I mentioned in previous post. You can also use the S viewport gadget, bottom left corner.
Title: Re: Use workplane space for ortographic cameras when workplane is active
Post by: rubberDuck on April 02, 2013, 04:51:39 pm
It is fixed.
Working great! Thanks! :D

The 'Perspective/Orthographic' command is only used to switch between the camera's perspective and orthographic attribute and the camera's location and focus point remain unchanged. To achieve your result, you need to use the 'Snap View' command as I mentioned in previous post. You can also use the S viewport gadget, bottom left corner.
Okay, I understand why this happens now.

But 'Snap View', while eliminating the problem with shading and grid settings inheritance, still forces you to rotate the camera back to the position in which perspective view was at the moment you left it. The camera upon leaving the orthographic view remains at the same position and rotation as the last ortho view you used of course. And this is the problem I have with NVil (a minor one). In other 3D packages, perspective camera's position and rotation is preserved even after you switch to and back again from orthographic views. It remains exactly the same as you left it. True, most programs utilise separate cameras, but  Silo  for example seems to be using one for everything* and perspective view position and rotation is preserved (http://youtu.be/326BXcFe-Tw).

But again, it's not a big deal. Just something that slows down the work a little. 8)

* - And even if Silo under-the-hood uses separate cameras bound to each view, the view positions are completely independent from each other. So there's no need to move/rotate the perspective view back to wherever you left it before switching to one of the six orthographic views.

Title: Re: Use workplane space for ortographic cameras when workplane is active
Post by: steve on April 02, 2013, 05:48:53 pm
Hi rubberDuck,

True, most programs utilise separate cameras, but  Silo  for example seems to be using one for everything* and perspective view position and rotation is preserved

When changing views in Silo, you are actually changing view-ports (Display-> Viewport Camera).

In NVIL, there are no commands available to change view-ports, it needs to be done from within multi-view(ports). There was the "Step Viewport Forward" and Step Viewport Backward" added, but that again only works in multi-view(Ports).

Title: Re: Use workplane space for ortographic cameras when workplane is active
Post by: IStonia on April 02, 2013, 06:25:02 pm
But 'Snap View', while eliminating the problem with shading and grid settings inheritance, still forces you to rotate the camera back to the position in which perspective view was at the moment you left it. The camera upon leaving the orthographic view remains at the same position and rotation as the last ortho view you used of course. And this is the problem I have with NVil (a minor one). In other 3D packages, perspective camera's position and rotation is preserved even after you switch to and back again from orthographic views. It remains exactly the same as you left it.

Do you have this option checked, Edit > Preference > Options > Custom/Front/Back... view has own camera settings?. If yes, When you switch from perspective view to Front/Back... views, the perspective view setting is remembered, so when you use 'Snap View' to switch back to perspective view from other directional views, you should get the exact same view as when you left the perspective view. And of course when you leave other directional views, their settings are also remembered so you will have them back when you switch back to them.
Title: Re: Use workplane space for ortographic cameras when workplane is active
Post by: steve on April 02, 2013, 07:23:57 pm
Ah, OK, I see now what you have done. You have added (an option for) multiple cameras for each view-port.
Title: Re: Use workplane space for ortographic cameras when workplane is active
Post by: rubberDuck on April 02, 2013, 07:34:45 pm
Quote
When changing views in Silo, you are actually changing view-ports (Display-> Viewport Camera).
Thanks for correcting me, Steve. :)

IStonia, yes but what if I'm on the right side of my model with the perspective view and want to temporarily snap to left orthographic view? Snapping aligns the camera to the closest orthographic view only. So in this situation I'd have to manually rotate perspective camera to roughly face the left side of the model and this would mean I'd have to rotate it back later to its former position.

P.S. "The Custom/Front/Back...view" options is enabled.
Title: Re: Use workplane space for ortographic cameras when workplane is active
Post by: IStonia on April 02, 2013, 07:42:53 pm
You can use the directional view command directly. For your example, while you are in Right view, you can change to Left view through 'viewport context menu > Left' command.

Only when you need to switch back to perspective view, you have to use the 'Snap View' command.
Title: Re: Use workplane space for ortographic cameras when workplane is active
Post by: steve on April 02, 2013, 07:43:00 pm
............yes but what if I'm on the right side of my model with the perspective view and want to temporarily snap to left orthographic view? .

Use the drop down menu (or set-up hotkeys/buttons) to change view to "Left". To change back to perspective(so the camera is still in same position) you currently use "Snap view" (Use either the bottom left of window gadget "S", or set-up an hotkey/button for "Snap view")
Title: Re: Use workplane space for ortographic cameras when workplane is active
Post by: rubberDuck on April 02, 2013, 08:03:47 pm
Only when you need to switch back to perspective view, you have to use the 'Snap View' command.
Aaah! I was using the following key binds:
'1' - Perspective/Orthographic
'2' - Front
'3' - Bottom
'4' - Top
(...) etc.
I replaced the "Perspective/Ortho" with "Snap" and it works like a charm. Problem solved. ;D
Thank you again for your help and patience! ;)