Skip to content
Alessandro Febretti edited this page Jul 2, 2014 · 13 revisions

Last revision: v4.2 - 2 August 2013

In addition to running python code, the omegalib interactive console supports quick commands that perform some utility functions at runtime. All quick commands start with a colon symbol, like :q or :r. All omegalib modules (classes derived from EngineModule) can expose quick commands. If you are running a python script from orun you will have some default quick commands available: for a list see the Python Reference Page.

User-defined quick commands

Users can add quick commands from python. Quick commands defined this way are similar to shell aliases that can be created in linux. for more information read the Quick command reference

Using quick commands from a script

It is possible to use quick commands from within a script file, using the queueCommand omegalib function. For example, the following is a valid script:

	from omega import *
	queueCommand(':? SceneNode set') # print all SceneNode methods beginning with 'set'

Extending quick commands

If you are implementing your own omegalib module, you can expose additional quick commands. Quick commands are useful to allow runtime control for your modules, without the need to expose full python commands. To add quick commands to your module or application in C++, you have to implement the EngineModule::handleCommand method. When the user types a command starting with a colon, all modules implementing handleCommand will receive a copy of the command. See src/apps/orun/orun.cpp for an example of how quick commands are implemented.

Quick Commands List

Here is a list of the quick commands supported by various omegalib modules and applications.

command description
orun
:? [prefix] [topic] prints help reference for objects and classes. Use this to quickly look up the methods offered by a specific class or object. The command also accepts a prefix argument, to limit results that start with a specified string. The command :? . returns the name of all global variables currently used by the script. A few examples of the command are :? ., :? SceneNode, :? Entity get.
:r <script> Run the specified script
:r! <script>
:ln Print the scene node tree
:lo List all allocated objects
:w Turn the wand drawable object on / off. Works only when a motion-captured wand object is available
:check_update windows only looks for an updates version of omegalib and if one is found shows a download link. Updates are automatically checked each day when orun starts.
omegalib
:c [ls] Turn on-screen console on/off (same as TAB key). Optionally specify l or s, to toggle the console log and statistics window respectively.
:s Print a summary of performance statistics
:debug <on/off> Turn debug mode on and off. When debug mode is enabled, omegalib modules may output more information to the console. or change some visual properties (i.e. display bounding boxes for objects). The behavior depends on each module handling this command.
:freefly Wand camera controller Enable/ Disable freefly mode.
omegaToolkit
:interactor-move [on/off] Enables or disables object moving with interactors (supported by wand interactor only)
:interactor-rotate [on/off] Enables or disables object rotating with interactors (supported by wand interactor only)
:interactor-scale [on/off] Enables or disables object scaling with interactors (supported by wand interactor only)
cyclops
:shaderInfo Print a list of currently loaded shaders.
omegaOsg
:autonearfar [on/off] experimental Enable auto calculation of the near and far clipping planes.
:depthpart [on <z>/off/near/far] Controls depth partitioning. When turned on, z specifies the Z plane that divides the near and far partition. The global near and far z planes are controlled with the setNearFarZ python command. Use the near and far options to display the near and far partitions only (for debug).