Moving objects
In SAMSON, you can move objects using:
Only the following nodes can be moved:
- structural nodes that have atoms
- certain types of labels
- lights
- meshes
Other types of nodes either do not have positions in the viewport (e.g. conformations, files, etc.), or they are automatically moved based on nodes on which they depend (e.g. visual models that depend on atoms or on other structural nodes).
Interactive tutorial in SAMSON (Help > Tutorials): "Move objects in the Viewport".
What you will learn from this tutorial:
- About the Move editors.
- How to move objects using move editors.
What is not covered in this tutorial:
For how to move objects with the help of Python Scripting, please, refer to the Python Scripting Guide.
Examples of the usage of move editors:
Let's first see some examples of what you can do with Move editors in SAMSON.
Let's now see how to use Move editors in SAMSON.
Move editors#
The move editors in SAMSON provide you with precise control over positions and orientations of molecules.
To move - rotate and translate - a selection you can use one of the several move editors provided with SAMSON by default:
- Displacer - a simple move editor to move objects in the camera plane.
- Local move editor - translate and rotate along principal axis of the selection.
- Global move editor - translate and rotate along global XYZ axis.
You can find these editors in the left-side menu of the viewport.
In SAMSON, to move an object (e.g., an atom, a molecule, a mesh, a label, etc) first you need to select it (1).
- Please refer to the Selecting section to learn how to select objects.
The displacer editor#
Shortcut: D
This displacer move editor allows you to displace nodes in the plane of the screen (the camera plane). You can either displace currently selected nodes by pressing on them and dragging or press on another node and drag it. In the latter case, the selection is based on the current Selection filter. This editor is particularly useful when performing interactive simulations.
You can move object with or without snapping. You can modify the snapping preference in the editor's quick access menu in the top-left corner of the Viewport, or in the Preferences (Interace > Preferences > Editors > Snapping).
The local move editor#
Shortcut: M
The local move editor allows you to translate and rotate the selected objects along its principal axes:
- Use the central translation widget (the cross with arrows) to move objects in the plane of the camera.
- Use the side translation widgets (straight arrows and planes) to move objects along the principal axes of the selected objects.
- Use the side rotation widgets (curved arrows) to rotate objects around the principal axes of the selected objects.
- Use the trackball (the sphere) widget to rotate objects freely.
The colors of the translation and rotation widgets indicate the principal axes:
- light blue: first principal axis (local X axis)
- mid blue: second principal axis (local Y axis)
- dark blue: third principal axis (local Z axis)
You can move object with or without snapping. You can modify the snapping preference in the editor's quick access menu in the top-left corner of the Viewport, or in the Preferences (Interace > Preferences > Editors > Snapping).
You can provide the precise translation and rotation parameters as follows:
- right-click on the move editor's widgets
- press Ctrl/Cmd and left-click on the move editor's widgets
You can also align objects along global axes by right-clicking on the move editor's widgets.
The Local Move editor (M) makes it easier to edit dihedral angles: click on the half of the bond corresponding to the fragment that you want to rotate, and edit the angle using the widget that appears:
The global move editor#
Shortcut: K
The global move editor allows you to translate and rotate the selected objects along global X, Y, Z axes:
- Use the central translation widget (the cross with arrows) to move objects in the plane of the camera.
- Use the side translation widgets (straight arrows and planes) to move objects along the axes of the global reference frame (X, Y, and Z).
- Use the side rotation widgets (curved arrows) to rotation objects along the axes of the global reference frame (X, Y, and Z).
- Use the trackball widget (the sphere) to rotate objects freely.
The colors of the translation and rotation widgets indicate the global axes:
- red: X axis
- green: Y axis
- blue: Z axis
You can move object with or without snapping. You can modify the snapping preference in the editor's quick access menu in the top-left corner of the Viewport, or in the Preferences (Interace > Preferences > Editors > Snapping).
You can provide the precise translation and rotation parameters as follows:
- right-click on the move editor's widgets
- press Ctrl/Cmd and left-click on the move editor's widgets
You can also align objects along global axes by right-clicking on the move editor's widgets.
Moving objects using move editors#
In this section, you will learn how to use move editors on an example of the local move editor (shortcut: M). The local move editor allows for translating and rotating based on the principal axes of the selection and using the trackball.
Prerequisites: Please refer to the Selecting section to learn how to select objects in SAMSON.
Load a molecule from a file or from assets (1). Select a part of the molecule - use the rectangle selection editor (2) to select a group of atoms.
- See the Building with available assets section.
- Shortcut: R
To move the selected atoms in the camera plane:
- Press with the left mouse button on the central translation widget (the cross with arrows).
- While pressing, move the mouse to translate in the desired direction. The editor should display the positional shift. If you would like to cancel, just click Esc, and the position will be restored.
- Release the mouse to apply the displacement.
Note
The move operations are undoable, so you can always undo them by clicking Edit > Undo (1).
- , : Ctrl+Z, : Cmd+Z
You can enable translational snapping in the top-left corner of the viewport to snap the translation to this value. Set the translational snapping to e.g. 0.5Å, and translate the selection.
To rotate around an axis:
- Press with the left mouse button on a side rotation widget (a curved arrow).
- While pressing, move the mouse to rotate the selection in the desired direction. The editor should display the positional shift. If you would like to cancel, just click Esc, and the position will be restored.
- Release the mouse to apply the displacement.
You can enable rotational snapping in the top-left corner of the viewport to snap the rotation to this value. Set the rotational snapping to e.g. 10°, and rotate the selection.
To rotate using the trackball (on a sphere):
- Press with the left mouse button on the trackball (the sphere).
- While pressing, move the mouse to rotate in the desired direction. The editor should display the positional shift. If you would like to cancel, just click Esc, and the position will be restored.
- Release the mouse to apply the displacement.