# Camera linking broken

**URL:** <https://discourse.slicer.org/t/camera-linking-broken/6951>\
**Category:** Support\
**Created:** [May 28, 2019, 6:54pm UTC](https://discourse.slicer.org/t/camera-linking-broken/6951 "2019-05-28T18:54:24Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![smrolfe](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/smrolfe/32/3659_2.png) [@smrolfe](https://discourse.slicer.org/u/smrolfe)\
**Post date:** [May 28, 2019, 6:54pm UTC](https://discourse.slicer.org/t/camera-linking-broken/6951/1 "2019-05-28T18:54:24Z")

</div>

I’m not able to get the dual 3D views to link correctly in the nightly version of Slicer. The link/unlink button links the zoom, but not rotation and translation.

I tested an older nightly from 4-17, and it was broken in this version also. Linking is working in Slicer 4.10.2.

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [May 29, 2019, 7:24pm UTC](https://discourse.slicer.org/t/camera-linking-broken/6951/2 "2019-05-29T19:24:39Z")

</div>

Hi @smrolfe -

I’ve been debugging this and hope to find a fix. In the mean time I noticed that while the camera view linkage doesn’t happen on normal mouse interaction events, it does happen when you use the mouse wheel to scroll in or out. You could use this as a workaround if it helps while a better fix is in the works.

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [May 29, 2019, 7:45pm UTC](https://discourse.slicer.org/t/camera-linking-broken/6951/3 "2019-05-29T19:45:11Z")

</div>

Proposed fix here: [https://github.com/Slicer/Slicer/pull/1145](https://github.com/Slicer/Slicer/pull/1145)

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [May 29, 2019, 9:33pm UTC](https://discourse.slicer.org/t/camera-linking-broken/6951/4 "2019-05-29T21:33:30Z")

</div>

It won’t fix all camera linking use cases, but I went ahead and committed the fix because I think it will address the SlicerMorph use case. @smrolfe can you try and let me know?

---

<div class="post-metadata">

**Author:** ![smrolfe](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/smrolfe/32/3659_2.png) [@smrolfe](https://discourse.slicer.org/u/smrolfe)\
**Post date:** [May 29, 2019, 10:35pm UTC](https://discourse.slicer.org/t/camera-linking-broken/6951/5 "2019-05-29T22:35:46Z")

</div>

Thanks @pieper, I’ll try this and report back.

---

<div class="post-metadata">

**Author:** ![smrolfe](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/smrolfe/32/3659_2.png) [@smrolfe](https://discourse.slicer.org/u/smrolfe)\
**Post date:** [May 30, 2019, 4:45pm UTC](https://discourse.slicer.org/t/camera-linking-broken/6951/6 "2019-05-30T16:45:55Z")

</div>

Hi @pieper, this fix works perfectly for me, thanks!

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [May 30, 2019, 5:06pm UTC](https://discourse.slicer.org/t/camera-linking-broken/6951/7 "2019-05-30T17:06:35Z")

</div>

That’s great @smrolfe 👍

Referring to @lassoan’s point in the pull request thread, I suspect there are still some issues loading/restoring scenes with linked 3D views, possibly because of some kind of race condition about when the observers are added. Let’s keep our eyes open for any lingering issues.

---

<div class="post-metadata">

**Author:** ![smrolfe](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/smrolfe/32/3659_2.png) [@smrolfe](https://discourse.slicer.org/u/smrolfe)\
**Post date:** [May 30, 2019, 5:48pm UTC](https://discourse.slicer.org/t/camera-linking-broken/6951/8 "2019-05-30T17:48:32Z")

</div>

Currently, linked views cannot be restored from an MRB scene file. I posted on this a while ago [here](https://discourse.slicer.org/t/loading-mrb-file-breaks-linked-views/5951).

This issue is related to the cameras loaded from the MRB scene file and I can manually fix it by deleting the extra cameras loaded with the scene file. Is there another use case where these cameras are needed?

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [May 30, 2019, 6:14pm UTC](https://discourse.slicer.org/t/camera-linking-broken/6951/9 "2019-05-30T18:14:59Z")

</div>

Thanks for pointing out the other issue - sorry it fell through the cracks. I haven’t looked lately, but in the past there were cases cameras were being created automatically as the scene is being read, and that could explain what we are seeing here. Do you think that issue is in the critical path for SlicerMorph?

---

<div class="post-metadata">

**Author:** ![smrolfe](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/smrolfe/32/3659_2.png) [@smrolfe](https://discourse.slicer.org/u/smrolfe)\
**Post date:** [May 30, 2019, 6:21pm UTC](https://discourse.slicer.org/t/camera-linking-broken/6951/10 "2019-05-30T18:21:33Z")

</div>

Thanks @pieper. We were interested in using MRB files to package our sample data, but we found a work-around. So it’s not a priority for us now.
