# Accessing the currently active camera in a cpp plugin

**URL:** https://discourse.paraview.org/t/accessing-the-currently-active-camera-in-a-cpp-plugin/17438
**Category:** Development
**Created:** [February 11, 2026, 12:26am UTC](https://discourse.paraview.org/t/accessing-the-currently-active-camera-in-a-cpp-plugin/17438 "2026-02-11T00:26:03Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Caldera\_99](https://discourse.paraview.org/user_avatar/discourse.paraview.org/caldera_99/32/17474_2.png) [@Caldera\_99](https://discourse.paraview.org/u/Caldera_99)
#### Post date: [February 11, 2026, 12:26am UTC](https://discourse.paraview.org/t/accessing-the-currently-active-camera-in-a-cpp-plugin/17438/1 "2026-02-11T00:26:03Z")

</div>

Hello,

I am currently trying to develop a small plugin that exposes some camera controls I often need.

As a starting off point I copied and compiled the SourceToolbar example. After modifying some of the buttons to get a feel for working with qt and paraview plugins I wanted to access the camera.

I found the vtkCamera, but no way to access the current instance of the currently active view. Is there any already existing code I could copy or some kind of pipeline I could follow?

Edit: I am currently working with Paraview Version 6.0

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [February 11, 2026, 8:53am UTC](https://discourse.paraview.org/t/accessing-the-currently-active-camera-in-a-cpp-plugin/17438/2 "2026-02-11T08:53:29Z")

</div>

> [@Caldera\_99](#):
>
> the currently active view. Is there any already existing code I could copy or some kind of pipeline I could follow?

`pqActiveObjects::activeView( )`

[https://www.paraview.org/paraview-docs/v5.13.2/cxx/classpqActiveObjects.html#a643a031a63c8cce671b203a8d1a3c580](https://www.paraview.org/paraview-docs/v5.13.2/cxx/classpqActiveObjects.html#a643a031a63c8cce671b203a8d1a3c580)

---

<div class="post-metadata">

### Author: ![Caldera\_99](https://discourse.paraview.org/user_avatar/discourse.paraview.org/caldera_99/32/17474_2.png) [@Caldera\_99](https://discourse.paraview.org/u/Caldera_99)
#### Post date: [February 11, 2026, 11:35am UTC](https://discourse.paraview.org/t/accessing-the-currently-active-camera-in-a-cpp-plugin/17438/3 "2026-02-11T11:35:58Z")

</div>

Thank you! I have it working now

For those with similar problems, this is jow I access the camera right now:

```cpp
pqView* view = pqActiveObjects::instance().activeView();

pqRenderView* renderView = qobject_cast<pqRenderView*>(view);
vtkView* clientView = renderView->getClientSideView();
vtkPVRenderView* pvRenderView = vtkPVRenderView::SafeDownCast(clientView);

vtkCamera* camera = pvRenderView->GetActiveCamera();

```
