-
Notifications
You must be signed in to change notification settings - Fork 26
Python Reference
Last revision: ver. 4.2-alpha6 - 28 August 2013
omegalib exposes most of its API to Python, so the vast majority of omegalib applications are developed as python scripts. Using python instead of C++ to develop your omegalib application offers several advantages:
- You can port your application to different systems without recompiling. For instance you can develop a script on your laptop, then copy it to CAVE2 and just launch it. Configuration files will do the rest.
- You can modify your application at runtime using the interactive python console
- If you need integration with C++ or need access to advanced omegalib functionality, you can write C++ code as an omegalib module and import it into your python script.
omegalib uses its own python interpreter to run python scripts. The interpreter executable is called orun
, and is built with omegalib when you enable python support.
To run python omegalib programs, you need the orun
application. orun is part of the standard omegalib distribution.
You have two ways to start a script using orun:
- Though the command line using a command in the form:
orun -s <filepath.py>
- After starting orun, typing:
:r <applicationName>
. This is an example of a quick command. For more information on quick commands check the QuickCommands page.
To stop an orun program, press esc, type oexit()
or :q
or press control-C (on linux) at the orun console, or run orun -K
on another terminal.
[[module omega | Python-Reference#module-omega]]
contains all the core functionality of omegalib like scene graph management and event handling. It also offers a few utility functions to manage verious aspects of an omegalib application. omega is always imported by default in omegalib applications, so you do not need to write any import
statement to access its classes and functions.
omegaToolkit is a utility module for omegalib. It exposes some non-core functionalities such as
- a 2D / 3D graphical user interface
- a set of object manipulator techniques based on mouse / touch, 3d wands and kinect tracking
General | ||
omegaToolkit Functions | ToolkitUtils | PortholeService |
GUI | ||
Container3dSettings | UiModule | WidgetFactory |
Widget | Container | Button |
Label | Image | Slider |
Menu System | ||
MenuManager | Menu | MenuItem |
Cyclops is a utility library that sits on top of omegalib and OpenSceneGraph. It is designed to speed-up development of simple graphical applications, without having to deal with the low-level details of osg. In a sense, cyclops is the GLUT
library of omegalib. Some of cyclops features are:
- Support for loading scenes defined in a simple xml format
- Easy creation of primitive shapes, like planes, spheres, cubes and so on
- Out-of-the-box support for soft shadows
- An expandable shaders and effects library
Core | ||
cyclops misc functions | SceneManager | ModelLoader |
ModelInfo | Light | ShadowSettings |
SkyBox | ModelGeometry | RigidBody |
Entities | ||
Entity | SphereShape | PlaneShape |
BoxShape | CylinderShape | LineSet |
StaticObject | AnimatedObject | Text3D |
Materials and Shading | ||
ProgramAsset | Uniform | Uniforms |
Material |