Skip to content

Plugin Camera Position Setter

Hiromichi Yokoyama edited this page Aug 26, 2026 · 1 revision

Plugin: Camera Position Setter

Camera Position Setter gives the 3D viewport a numeric control panel. Instead of nudging the molecule with the mouse until it looks right, you type the camera position, focal point, and view-up vector directly — or jump to a standard crystallographic axis with one click, and save the result as a named viewpoint you can return to in any session.

Repository moleditpy_camera_position_setter
Author HiroYokoyama
Supported OS Windows, macOS, Linux, WSL
Supported Python >=3.9, <3.15
Menu location View ▸ Camera Position Setter...
Extra dependencies none beyond MoleditPy's own PyVista, PyQt6, NumPy

See Official Plugins for the full catalogue.


1. Why type coordinates

Mouse orbiting is fine for looking around, but it cannot answer "show me this exactly the way I showed it last week." Three jobs need numbers:

  • Reproducibility — a figure for a paper, redrawn months later at the same angle.
  • Comparison — two conformers, two tautomers, or an optimized and a starting geometry, all photographed from one identical viewpoint.
  • Crystallographic convention — looking straight down an axis, not approximately down it.

The window is non-modal: leave it open and keep working in the editor.


2. Standard views

Nine one-click buttons under Standard Views:

Button Looks from
+X (Right) / -X (Left) along the X axis, Z up
+Y (Back) / -Y (Front) along the Y axis, Z up
+Z (Top) / -Z (Bottom) down the Z axis, Y up
Iso (+X+Y+Z) / Iso (+X-Y+Z) the two front isometric corners, Z up
Fit to Screen MoleditPy's own reset-and-fit

Each keeps the current focal point and distance and only changes the direction you view from, so clicking through +X → +Y → +Z spins around whatever you were already looking at rather than jumping back to the origin.


3. Target centering

Button Centers on
Center on Molecule the centroid of every atom with 3D coordinates
Center on Selected Atoms the centroid of the atoms selected in the 3D viewport

Both move the focal point and the camera by the same vector, so the view direction and distance survive — the molecule slides to the middle of the screen without rotating or rescaling.

Which selection counts

Center on Selected Atoms reads the 3D viewport selection — the atoms you click in the 3D view, which MoleditPy marks with red numbered labels. This is the same selection its own 3D dialogs preselect from.

The 2D sketch selection is deliberately not used. Selecting atoms on the 2D canvas has no bearing on where the 3D camera should point, and mixing the two would pull the focal point toward atoms you cannot see in the viewport.

Before v1.2.0 this button read the 2D selection only, which meant it silently did nothing when you had picked atoms in the 3D view. If the button appears to do nothing, check you are on v1.2.0 or later.


4. Numerical coordinates

Field Meaning
Camera Position where the camera sits, in Å
Focal Point (Target) the point it looks at
View-Up Vector which way is up on screen
Dist distance from camera to focal point
FOV field of view in degrees (perspective only)
Projection Perspective, or Parallel (Orthographic)

Dist is a derived field that works both ways: it updates as you edit the position, and editing it slides the camera along its current view direction, keeping the angle. That makes it the zoom control when you want an exact distance rather than a percentage.

Parallel (Orthographic) removes perspective convergence entirely — parallel bonds stay parallel on screen. This is usually what you want for a structural figure, and it makes FOV inactive.


5. Orbital step nudge

Rotation in exact increments, chosen from 5°, 15°, 45°, or 90°:

Control Axis
Yaw ± around the view-up vector
Pitch ± around the screen-horizontal axis
Roll ± around the viewing direction
Zoom In / Out ±10% of the current distance

Because the step is exact, four 90° yaws return you precisely where you started — useful for photographing a molecule from four sides with no drift.


6. Viewpoint bookmarks

Save Current View... stores the full camera state under a name. The save dialog offers two independent scopes, and you can tick either or both:

Scope Stored in Lives
Global Presets MoleditPy's settings across every session and every file
Current Project the .pmeprj project file with that one project, and travels with it

A viewpoint saved to both shows as [Global+Project] in the list. Use Global for habitual angles you want everywhere, and Project for "the angle this particular figure was made at", which is worth keeping next to the structure it belongs to.

The Show Viewpoints filter narrows the list to one scope, and the buttons below act on the selection: Apply Selected (or double-click), Overwrite Selected with the current camera, Rename..., Delete, and Clear Filtered — which deletes exactly what the filter is currently showing, so you can drop all project bookmarks without touching your global ones.

Project bookmarks are cleared on File ▸ New and reloaded when you open a project.


7. Clipboard and transitions

Copy (JSON) puts the camera state on the clipboard as readable JSON:

{
  "position": [0.0, -15.0, 0.0],
  "focal_point": [0.0, 0.0, 0.0],
  "view_up": [0.0, 0.0, 1.0],
  "view_angle": 30.0,
  "parallel": false
}

Paste accepts that back, and also accepts PyVista's own [position, focal_point, view_up] list — so a plotter.camera_position printed from a script pastes straight in, and a viewpoint you like can be pasted into a script.

Two switches at the bottom:

  • Live Preview — the viewport follows every spinbox edit as you make it. Turn it off to compose a viewpoint numerically and apply it in one go with Apply to View.
  • Smooth Transition — moves to a new viewpoint over a short cosine-eased animation instead of cutting. Helpful when presenting, since the audience keeps track of the orientation. Nudge and zoom always apply instantly regardless, so repeated clicks stay responsive.

Read from View pulls the viewport's current camera back into the boxes — the starting point for tweaking an angle you found with the mouse.


8. See also


This page documents Camera Position Setter v1.2.0, and was written on 2026-08-26. See REGISTRY/plugins.json for the current version.

Clone this wiki locally