Page MenuHome

Improve NDOF navigation
Open, NormalPublic

Description

Recently there have been multiple users noticing NDOF (space-navigator) isn't working as they would expect.

See:

It seems most other software (including Space-navgator driver demo) works differently to Blender's defaults, making it seem as if something is broken.

This design task is collect these differences and update Blender to fit typical NDOF useage for other 3D software,
or - if there are good reasons to keep Blender working as-is, to support these features as preferences.


Key Differences

This list is based on user feedback may need updating, add comments if it misses anything.

  • Constraining Motion

    Blender: doesn't allow panning by default, instead modifier keys need to be pressed to pan for example.

    Other Software: doesn't constrain motion, similar to always being in walk-mode (without having to enter/exit walk mode).

    Open Topic: Would we orbit around the center of view (as with MMB orbit), or the view-point origin (as with walk mode). I'd assume we would default to orbiting around the view center.
  • Orbit Origin

    Blender: Orbits around the view center.

    Other Software: orbits the selection center.

    Note: Is this the case for most/all other 3D software with NDOF support?
  • Ability to transform objects

    Blender just doesn't support this at the moment, adding it to this list for completeness.

Details

Type
Design

Event Timeline

Campbell Barton (campbellbarton) lowered the priority of this task from Needs Triage by Developer to Normal.Jul 24 2019, 9:57 AM
Campbell Barton (campbellbarton) changed Type from Bug to Design.

Hi! I added 3Dconnexion support back in 2010/2011 and we got the same kinds of responses. Some people think everything is backwards, to others it feels right. Blender added options to customize direction/feel soon after that.

I've got several NDOF models & can help test.

Hey Mike, good to hear from you.

When I test my NDOF device it seems to work fine, so my impression is we might need to add preferences or change defaults.

I'm guessing free-navigation by default would be one of the main changes which could make it work as users coming from other software expect.

Since orbiting and zooming is easy enough with a mouse, that's the main reason to use NDOF.

Was there a reason it was done this way to begin with?

Hey lads.. i just got into blender and i also got one of these 3d connexion 3d-mouses and i had the same issue... so i started to look for an answer but did not find one. then i solved it.. i think.. all you need to do is change the transform view into any other example orbit view with zoom and it works... its a workaround cos you cant bind the movements.. ndof view navigate at orbit and view rotation trackball..

https://imgur.com/a/bgPsRMl

Hey lads.. i just got into blender and i also got one of these 3d connexion 3d-mouses and i had the same issue... so i started to look for an answer but did not find one. then i solved it.. i think.. all you need to do is change the transform view into any other example orbit view with zoom and it works... its a workaround cos you cant bind the movements.. ndof view navigate at orbit and view rotation trackball..
https://imgur.com/a/bgPsRMl

Here it´s not working. I would like that will be as smooth as in cinema or maya.

I would like that will be as smooth as in cinema or maya.

Can you clarify what you mean?

Is the motion slow or jirky, is this relating to redraw speed, or the way motion is interpreted? (not moving in the direcitons you expect)

J A (lazy) added a comment.EditedAug 14 2019, 7:28 PM

Hey mates.. i took a closer look at it and here's what i got..

There's nothing wrong with my workaround cos you get all axis and you can paint while moving.
In other programs including the trainer app the object is "in your hand" if you yaw rotate the object rotates. same as hitting r, z, in the object mode
In blender the object stays still and you move around it.
I dont know if this type of mode is available in blender, if not.. there's an intresting problem to solve =)

Actually i would like it to work like this...

nothing selected = free move
object selected = rotate mode and confirmation asks rotation stay/rotation old

Thanks.

Here it is a bit jerky, the rotational movements are reversed and doesn't move through the selection.

As suggestion; better than moving through the selection, it would be to move through a fixed point like in Catia. The middle mouse button is used to create a new center point of rotation. This option gives you more freedom to work.

A good example of proper NDOF device operation is in 3D Coat. Using a device such as 3DConnexion in that environment performs exactly as it would in the training examples/viewer application included with the drivers.

The issue I experience in Blender is that when the settings are corrected to perform like it does in the driver examples, you must hold shift to pan. Ideally you would be able to navigate without the use of modifier keys.

Another key thing to note is that in 3D Coat and the Viewer application, the device will create a pivot point for rotation in the scene:
In 3D Coat, a pivot is created wherever the cursor lies on an object's surface, and remains persistent even when the cursor moves away from the object, only updating when it returns to a surface.
In the Viewer application, it appears to update periodically to a surface or a point in space. This point appears to be at a predefined distance.

The system 3D Coat uses would be perfectly adequate, although preference options around how the pivot point should perform may be a worthy inclusion.

Hi everyone, i spent the complete day yesterday trying to fix the inverted axis issue when you try to edit under your model, if i am on top of the model everything work as expected but going under orbit is inverted making it impossible to work.

My navigation style is free&turntable, someone on blender artists told me to use trackball instead but it is unusable since it is moving erratically with very low precision, i tried adjusting every possible setting but it is a no go.

Then i saw another thread on stack exchange mentioning using orbit with turntable but you need to press a keyboard key to pan so this is defeating the purpose of having a 3d mouse!

I come from 3ds max and i didn't have any issue there so for us migrating to blender it's counter productive having to fight for this to work!

Another guy on stack exchange said the following code could easily fix this issue so i paste it here so a programmer can validate if it is indeed a fix:

At the declarations in the viewmove procedure add:

float firstvec[3], newvec[3], dvec[3];
float oldquat[4], q1[4], si, phi, dist0;
int firsttime=1;
short mvalball[2], mval[2], mvalo[2];
int reverse; //<----------------------------add this line and down
reverse=1;
if (G.vd->persmat[2][1] < 0)
reverse*=-1;

Then in the turntable declaration add:

QuatMul(G.vd->viewquat, q1, oldquat);

/* rotate around z-axis (mouse x moves) */

phi= 2*(mval[0]-mvalball[0])*reverse; //<-----add the “*reverse”
phi/= (float)curarea->winx;
si= sin(phi);
q1[0]= cos(phi);
q1[1]= q1[2]= 0.0;
q1[3]= si;

Many of us are having RSI issue and many more will eventually get RSI issues so i think that this will help people if it get the required attention.

Thank for considering my post.

Hi all, I'm actually quite happy with the behavior of orbit mode in general save for the necessity of using a modifier key in that mode and the resulting inability to pan / rotate simultaneously. Patched up view3d_edit.c locally to see if I could get it working, and it came off just fine from my perspective:

Given lines 1434-1447 of view3d_edit.c, in the ndof_orbit_zoom_invoke function:

else if ((U.ndof_flag & NDOF_MODE_ORBIT) || ED_view3d_offset_lock_check(v3d, rv3d)) {
  const bool has_rotation = NDOF_HAS_ROTATE;
  const bool has_zoom = (ndof->tvec[2] != 0.0f);

  if (has_zoom) {
    view3d_ndof_pan_zoom(ndof, vod->sa, vod->ar, false, has_zoom);
    xform_flag |= HAS_TRANSLATE;
  }

  if (has_rotation) {
    view3d_ndof_orbit(ndof, vod->sa, vod->ar, vod, true);
    xform_flag |= HAS_ROTATE;
  }
}

I just changed it as follows, et voila, works gloriously:

else if ((U.ndof_flag & NDOF_MODE_ORBIT) || ED_view3d_offset_lock_check(v3d, rv3d)) {
  const bool has_rotation = NDOF_HAS_ROTATE;
  const bool has_translate = NDOF_HAS_TRANSLATE;
  const bool has_zoom = (ndof->tvec[2] != 0.0f);
  
  if (has_zoom || has_translate) {
    view3d_ndof_pan_zoom(ndof, vod->sa, vod->ar, has_translate, has_zoom);
    xform_flag |= HAS_TRANSLATE;
  }

  if (has_rotation) {
    view3d_ndof_orbit(ndof, vod->sa, vod->ar, vod, true);
    xform_flag |= HAS_ROTATE;
  }
}

Hi all, I'm actually quite happy with the behavior of orbit mode in general save for the necessity of using a modifier key in that mode and the resulting inability to pan / rotate simultaneously. Patched up view3d_edit.c locally to see if I could get it working, and it came off just fine from my perspective:
Given lines 1434-1447 of view3d_edit.c, in the ndof_orbit_zoom_invoke function:

else if ((U.ndof_flag & NDOF_MODE_ORBIT) || ED_view3d_offset_lock_check(v3d, rv3d)) {
  const bool has_rotation = NDOF_HAS_ROTATE;
  const bool has_zoom = (ndof->tvec[2] != 0.0f);
  if (has_zoom) {
    view3d_ndof_pan_zoom(ndof, vod->sa, vod->ar, false, has_zoom);
    xform_flag |= HAS_TRANSLATE;
  }
  if (has_rotation) {
    view3d_ndof_orbit(ndof, vod->sa, vod->ar, vod, true);
    xform_flag |= HAS_ROTATE;
  }
}

I just changed it as follows, et voila, works gloriously:

else if ((U.ndof_flag & NDOF_MODE_ORBIT) || ED_view3d_offset_lock_check(v3d, rv3d)) {
  const bool has_rotation = NDOF_HAS_ROTATE;
  const bool has_translate = NDOF_HAS_TRANSLATE;
  const bool has_zoom = (ndof->tvec[2] != 0.0f);
  if (has_zoom || has_translate) {
    view3d_ndof_pan_zoom(ndof, vod->sa, vod->ar, has_translate, has_zoom);
    xform_flag |= HAS_TRANSLATE;
  }
  if (has_rotation) {
    view3d_ndof_orbit(ndof, vod->sa, vod->ar, vod, true);
    xform_flag |= HAS_ROTATE;
  }
}

Hello.. thx for this patch. tryed it myself, pan works now in orbit mode, but if it is there any for example rotation detected, pan stops instantly.

Hmm. I'm not able to reproduce the pan failure whilst rotating - I find it works more or less as I expected. For instance, with the patch as written above and in Orbit mode, I held my SpaceMouse in a more-or-less-constant rotation, and then slowly panned downwards (-Z). The results were as expected - the viewport camera continued to spin around the selection, while the view slowly moved downwards simultaneously. What you're describing sounds like you may have your SpaceMouse set up in "Dominant" mode, which is a value managed by the 3DConnexion setup application, not Blender. Open that up while you have the Blender window active, then go to "Advanced" and make sure "Dominant" is not checked. Failing that, I admit it is difficult to really get a sense of the pan+rotation movement if you're panning along an axis perpendicular to the axis of rotation (e.g. when panning left/right while rotating left/right), but as best I can tell it *does* work. For clarity, these are the settings I'm using for my SpaceMouse: Mode: Orbit + Turntable; No Orbit axes inverted; No pan axes inverted; Zoom not inverted; Helicopter mode on; Lock horizon off. In my 3DConnexion settings for Blender, I have all axes active, though My z-axis rotation and pan up/down axes are reversed there. Under the navigation header, Pan / Zoom and Rotation are both checked, Dominant is unchecked. My Zoom Direction is set to Up / Down.

Hi all, I'm actually quite happy with the behavior of orbit mode in general save for the necessity of using a modifier key in that mode and the resulting inability to pan / rotate simultaneously. Patched up view3d_edit.c locally to see if I could get it working, and it came off just fine from my perspective:
Given lines 1434-1447 of view3d_edit.c, in the ndof_orbit_zoom_invoke function:

else if ((U.ndof_flag & NDOF_MODE_ORBIT) || ED_view3d_offset_lock_check(v3d, rv3d)) {
  const bool has_rotation = NDOF_HAS_ROTATE;
  const bool has_zoom = (ndof->tvec[2] != 0.0f);
  if (has_zoom) {
    view3d_ndof_pan_zoom(ndof, vod->sa, vod->ar, false, has_zoom);
    xform_flag |= HAS_TRANSLATE;
  }
  if (has_rotation) {
    view3d_ndof_orbit(ndof, vod->sa, vod->ar, vod, true);
    xform_flag |= HAS_ROTATE;
  }
}

I just changed it as follows, et voila, works gloriously:

else if ((U.ndof_flag & NDOF_MODE_ORBIT) || ED_view3d_offset_lock_check(v3d, rv3d)) {
  const bool has_rotation = NDOF_HAS_ROTATE;
  const bool has_translate = NDOF_HAS_TRANSLATE;
  const bool has_zoom = (ndof->tvec[2] != 0.0f);
  if (has_zoom || has_translate) {
    view3d_ndof_pan_zoom(ndof, vod->sa, vod->ar, has_translate, has_zoom);
    xform_flag |= HAS_TRANSLATE;
  }
  if (has_rotation) {
    view3d_ndof_orbit(ndof, vod->sa, vod->ar, vod, true);
    xform_flag |= HAS_ROTATE;
  }
}

Hello.. thx for this patch. tryed it myself, pan works now in orbit mode, but if it is there any for example rotation detected, pan stops instantly.

I tried this, had the same problem as Raffael Ley. And no the Dominant is not checked for the space mouse. I found a change to that seems to fix the problem.
It involves switching the order of the view3d_ndof_pan_zoom() call and the view3d_ndof_orbit() call in Jeremy Hollands modification.
i.e.

else if ((U.ndof_flag & NDOF_MODE_ORBIT) || ED_view3d_offset_lock_check(v3d, rv3d)) {
    const bool has_rotation = NDOF_HAS_ROTATE;
    const bool has_translate = NDOF_HAS_TRANSLATE;   
    const bool has_zoom = (ndof->tvec[2] != 0.0f);

    if (has_rotation) {                            
      view3d_ndof_orbit(ndof, vod->sa, vod->ar, vod, true);
      xform_flag |= HAS_ROTATE;
    }

    if (has_zoom || has_translate) {                    
      view3d_ndof_pan_zoom(ndof, vod->sa, vod->ar, has_translate, has_zoom);
      xform_flag |= HAS_TRANSLATE;
    }
  }

Settings are important:
Preferences->Input->NDOF->NDOF view navigate=Orbit
Preferences->Input->NDOF->NDOF view rotation=Trackball
Preferences->Navigation->orbit method=Trackball
Preferences->Navigation->orbit around selection=checked
Preferences->Navigation->View Navigation=fly
I find I have to reverse all pan/zoon and rotation controls on space mouse