# Deactivating the drag rotation interaction in an LScene

**URL:** https://discourse.julialang.org/t/deactivating-the-drag-rotation-interaction-in-an-lscene/106174
**Category:** Visualization
**Tags:** makie, glmakie
**Created:** [November 14, 2023, 1:06am UTC](https://discourse.julialang.org/t/deactivating-the-drag-rotation-interaction-in-an-lscene/106174 "2023-11-14T01:06:41Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![airpmb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/airpmb/32/7826_2.png) [@airpmb](https://discourse.julialang.org/u/airpmb)
#### Post date: [November 14, 2023, 1:06am UTC](https://discourse.julialang.org/t/deactivating-the-drag-rotation-interaction-in-an-lscene/106174/1 "2023-11-14T01:06:41Z")

</div>

How can I temporarily deactivate (and later reactivate) the rotation interaction (`:dragrotate`) for an `LScene`? The `deactivate_interaction!` and `activate_interaction!` methods seem only to be defined on `Axis` and `Axis3`.

Somehow `:dragrotate` is being registered in the first place (I guess it must be in `initialize_block!(ax::Axis3)` since that’s the only place it’s called with `:dragrotate`), but I can’t see how to access the `Axis3` that underlies the `LScene` in order to call `deactivate_interaction!(::Axis3, ::Symbol)`.

---

<div class="post-metadata">

### Author: ![ffreyer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ffreyer/32/21569_2.png) [@ffreyer](https://discourse.julialang.org/u/ffreyer)
#### Post date: [November 14, 2023, 12:51pm UTC](https://discourse.julialang.org/t/deactivating-the-drag-rotation-interaction-in-an-lscene/106174/2 "2023-11-14T12:51:32Z")

</div>

This should work with the default camera

```julia
cc = cameracontrols(lscene.scene)
cc.attributes[:rotation_button][] = false

```

---

<div class="post-metadata">

### Author: ![airpmb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/airpmb/32/7826_2.png) [@airpmb](https://discourse.julialang.org/u/airpmb)
#### Post date: [November 14, 2023, 4:04pm UTC](https://discourse.julialang.org/t/deactivating-the-drag-rotation-interaction-in-an-lscene/106174/3 "2023-11-14T16:04:25Z")

</div>

> [@ffreyer](#):
>
> This should work with the default camera

Thanks - yeah I subsequently figured out that the interactions for `LScene` don’t seem to use the registration API that is used elsewhere. It’s not clear to me why that is but I think I can move forward for now.

Also after some more digging I see that the existing interaction that’s set up in `add_rotation!` is using the `Observables.on(f, camera::Camera, observables::AbstractObservable...)` method that I wasn’t aware of before. So it looks like `disconnect!(c::Camera)` can be used to remove all the camera callbacks - though I’m not sure how one would selectively remove just the relevant ones, and it looks like there are some callbacks in the `steering_nodes` that definitely shouldn’t be removed. For example, one of them seems to fire when the window size is changed and without it the rendered scene ends up getting squished with a resize.
