Page MenuHome

Locking view to object not working
Closed, ResolvedPublic


System Information
macOS 10.12.3 (16D32)
MacBook Pro (Retina, 15-inch, Early 2013)
NVIDIA GeForce GT 650M 1024 MB
Intel HD Graphics 4000 1536 MB

Blender Version
Broken: 2.78a
Worked: 2.49b

Short description of error
View locking against an object does not work in 2.78a. I happened to have 2.49b on my system as well so I did it there for a sanity check and it works fine. Per the 2.78 manual it should still work the way it used to:

Lock to Object
Lock to Object lets you define an object in the Object Data ID as the center of the view. In that case, the view can be rotated around or zoomed towards that central object, but not on translation, unless you translate that itself object. (This option is not available in a camera view).

Exact steps for others to reproduce the error
Open a new Blender file
Open Properties panel in 3D view
Under View->Lock to Object
Select the Cube
Translate your view (you should not be able to, but you can)

Event Timeline

When view is locked to object, view is centered to origin of choosen object.
Then, user is free to add an offset if it is less pertinent to see origin than a specific part of the model.
If created offset is not wanted, user can press Home Key to recenter view to origin of object.
Lock to Object is working because if object is moved, view follows it.

It is intended behaviour.

I did not find exact commit.
But I remember same reaction for locking to 3D Cursor. T45301

So this undocumented change should have happened at 2.75 or 2.74.

Please note, in my steps the object is never moved, on the view is translated. Thus not locked according to manual or previous version of blender.

Attached is a movie showing the behavior.

On a whim I connected a mouse up to my laptop. Using a mouse, the view locking works as expected. Using the trackpad the view locking does not work in 2.78a (but does work in 2.49b).

In the manual description noted, view to object is not locked in view translation, only object translation.
"..... the view can be rotated around or zoomed towards that central object, but not on translation,...."

"but not on translation,"

The translation is locked only when you use the manipulator.
Seems to work accordingly for me.

Am I understanding what you said correctly?

Did you see my video and my subsequent notes? It works if I use a MOUSE, but it does NOT work properly with the MacBook Pro's TRACKPAD.

Bastien Montagne (mont29) changed the task status from Unknown Status to Invalid.Feb 1 2017, 10:54 AM
Bastien Montagne (mont29) claimed this task.

As said, this is expected behavior (and missing update in manual, which is not so uncommon unfortunately). Thanks for the report anyway.


It works as described in the manual when done with a mouse. It does not work when using a trackpad.

Are you saying that the expected behavior is for it to work as described when using a mouse but to NOT work when using a trackpad?

Bastien Montagne (mont29) changed the task status from Invalid to Unknown Status.Feb 1 2017, 2:52 PM
Bastien Montagne (mont29) lowered the priority of this task from 90 to 30.

@John Nyquist (nyquist) d’ont know what to say… only have a touchpad here, but there should be absolutely no difference between mouse and touchpad… or this might be an OSX specific issue, iirc we did have several weird problems with Apple’s own fancy hardware in the past. Maybe @Brecht Van Lommel (brecht) can help here?

Also, did you try the latest build from our buildbot?

FWIW it works in2.49b. I have not tried latest build from buildbot. I am traveling until Tue so I will try it next week. Since there is a work around this is low priority but I am happy to help resolve it upon return, just let me know how I can assist. BTW I agree that it seems reasonable to expect either approach to work.

The Apple trackpad sends different events like MOUSEPAN, and it may be that the code handling those is not the same. However testing with 2.78a, I could not find any difference between behavior of the mouse and trackpad.

Which operations exactly are you comparing? Shift + hold middle mouse button and shift + two finger trackpad pan?

For both mouse and tracked I can pan / rotate / zoom the view, to look at some specific part of the object. Then if I move the object (from the same 3D view or another one), the view remains locked to that (part of the) object. That may be different than 2.49, but it's by design as far as I know.

I am traveling without my laptop until Tuesday but I can assure you the behavior is different with mouse than trackpad. The mouse functions as expected.

Brecht, thank you for your patience I'm back home now.

Yes, I am comparing Shift + hold middle mouse button and shift + two finger trackpad pan with 2.78a.

  • When I use the mouse it works in 2.78a exactly the same as in 2.49b.
  • When I use the trackpad it acts like the object is not locked in 2.78a and works the same as the mouse in 2.49b.

This is using the built-in trackpad on the laptop.

Bastien Montagne (mont29) raised the priority of this task from 30 to Normal.Feb 18 2017, 2:44 PM

Then, the bug is with the mouse handling. not the trackpad one. Once again, you cannot compare that behavior with 2.49, nowadays you are allowed to pan (move) the view even when locked to an object (it is slightly different from regular view panning though, since center, pivot point of the view remains on the locked object).

And we need some OSX dev or user to be able to at least confirm that mouse behavior. For now, the issue reported can't be reproduced so far, and has been moved to the BF Blender: Unconfirmed project.
If 2 other people aren't able to redo the bug after 2 weeks, it will be closed.

Let's forget about 2.49, it seems to be distracting to the conversation instead of helping.

With 2.78b when I connect a mouse to my computer (and use the mouse) I get the expected behavior and I see the warning at the top that the view offset is locked.

When I use the trackpad, the locking does not work, it behaves as if the locking were not enabled.

To make sure I had a clean environment:

  • I created a new user account on my machine
  • I downloaded the latest blender from (2.78b)
  • I locked the view to the cube

The "View offset is locked" message is shown for two operations:

  • View Pan with shift/control + scroll
  • View Dolly with shift + control + middle mouse drag

Are those the operations you're doing?

The inconsistency between view panning with the scroll wheel and holding down the middle mouse button could be fixed.

I unified the view panning code now so it behaves the same with scrolling and dragging the middle mouse button (and the trackpad). If there's other inconsistencies we'll need to know the specific operation done.

So far I see no evidence that there is a bug with the trackpad handling, as explained above it is intentional that you can still navigate with object locking. A bug would be if e.g. moving the object would not keep the view locked to the same part of the object.

Great, thanks for improving the consistency! I remember Ton mentioning the importance of ui consistency in his 2015 conference keynote, it is appreciated.