TkOptiX - Tkinter based GUI

Mouse and keys actions

You can manipulate camera, objects and lights from Tkinter GUI:

  • camera is selected by default, double-click an object/light to select it, double click again to select a primitive within the object, double-click in empty area or double-right-click to select camera

  • use plotoptix.TkOptiX.select() method if an object or light is not in the view or it is hard to be selected

  • select parent mesh to apply transformations to all children as well

With camera selected:

  • rotate eye around the target: hold and drag left mouse button

  • rotate target around the eye (pan/tilt): hold and drag right mouse button

  • zoom out/in (change field of view): hold shift + left mouse button and drag up/down

  • move eye backward/forward (dolly): hold shift + right mouse button and drag up/down

  • change focus distance in depth of field cameras: hold ctrl + left mouse button and drag up/down

  • change aperture radius in depth of field cameras: hold ctrl + right mouse button and drag up/down

  • focus at an object: hold ctrl + double-click left mouse button

  • select an object: double-click left mouse button

With a light or an object / primitive selected:

  • rotate around camera XY (right, up) coordinates: hold and drag left mouse button

  • rotate around camera XZ (right, forward) coordinates: hold ctrl and drag left mouse button

  • move in camera XY (right, up) coordinates: hold shift and drag left mouse button

  • move in camera XZ (right, forward) coordinates: hold and drag right mouse button

  • move in the normal direction (parallelogram light only): shift + right mouse button and drag up/down

  • scale up/down: hold ctrl + shift + left mouse button and drag up/down

  • select camera: double-click left mouse button in empty area or double-right-click anywhere

API reference

TkOptiX.get_rt_size() Tuple[int, int][source]

Get size of ray-tracing output image.

Get fixed dimensions of the output image or None if the image is fit to the GUI window size.

Returns

out – Output image size or None if set auto-fit mode.

Return type

tuple (int, int)

See also

plotoptix.NpOptiX.get_size()

TkOptiX.set_rt_size(size: Tuple[int, int]) None[source]

Set fixed / free size of ray-tracing output image.

Set fixed dimensions of the output image or allow automatic fit to the GUI window size. Fixed size image updates are slower, but allow ray tracing of any size. Default mode is fit to the GUI window size.

Parameters

size (tuple (int, int)) – Output image size or None to set auto-fit mode.

TkOptiX.select(name: Optional[str] = None, index: int = -1)[source]

Select geometry, light or camera.

Select object for manual manipulations (rotations, shifts, etc). Geometry or light is selected by its name. If name is not provided, then active camera is selected. Optional index allows selection of a primitive within the geometry.

Parameters
  • name (string, optional) – Name of the geometry or light to select. If None then active camera is selected.

  • index (int, optional) – Primitive index to select. Entire geometry is selected if index is out of primitives range.

TkOptiX.show() None[source]

Start raytracing thread and open the GUI window.

Convenience method to call plotoptix.NpOptiX.start().

Actions provided with on_initialization parameter of TkOptiX constructor are executed by this method on the main thread, before the ratracing thread is started and GUI window open.

TkOptiX.close() None[source]

Stop the raytracing thread, release resources.

Raytracing cannot be restarted after this method is called.