Vizard 7 » Reference » Global settings » Global settings
7.6

Global settings

You can setup a default Vizard environment by configuring the vizcore.cfg file.  This allows you to set the default resolution, window dimensions, GUI color theme, and more.  To set these default values, create a vizcore.cfg file in Vizards /bin directory.  Then add the configuration options you are interested in by following the example vizcore.cfg file below. If there is a vizcore.cfg file in the same directory as the script, Vizard will load this as well. If the same option is specified in both the global and local vizcore.cfg file, the local copy will take precedence.

 

You can also dynamically set and read options in your script using the viz.setOption(name,value) and viz.getOption(name[,default]) commands.

 

The viz.setOption() command will set the value of the specified option name. If the option does not exist, it will be created, otherwise it will override the existing value. If the value is None then the option will be removed.

#Set the AVI recorder to record at 29.97 frames per seconds
viz.setOption('viz.AVIRecorder.fps','29.97')

The viz.getOption() command will return the string value of the specified option name. If the option does not exist, the specified default value will be returned.

#Print the Vizard version number
print( viz.getOption('viz.version'))

Example vizcore.cfg

Here is a sample vizcore.cfg file that will perform the following for all scripts:

viz.antialias = 4
# Lines beginning with the '#' symbol will be treated as comments
viz.fullscreen = 1
viz.clearcolor = 0.5 0.5 0.5

Window initialization options

These options must be set before viz.go() is called.

Name

Description

Default value

viz.antialias

Specifies the full screen anti-alias sample number

0

viz.window.width

Initial non-fullscreen width of the window

800

viz.window.height

Initial non-fullscreen height of the window

600

viz.window.x

Initial x position of non-fullscreen window. Relative to upper left corner.

0

viz.window.y

Initial y position of non-fullscreen window. Relative to upper left corner.

0

viz.window.icon

Name of .ico file to use as icon for graphics window and published EXE.

 

viz.window.visible

Controls the visibility of the graphics window

1

viz.display.width

Resolution width of monitor to run Vizard simulation in

0

viz.display.height

Resolution height of monitor to run Vizard simulation in

0

viz.display.color

Color resolution of monitor to run Vizard simulation in

0

viz.display.frequency

Monitor refresh rate to run Vizard in

0

viz.display.alpha

Number of alpha bits to request when creating OpenGL context

0

viz.display.stencil

Number of stencil bits to request when creating OpenGL context

0

viz.display.swap_copy

When swapping buffers, copy contents of back buffer into front buffer, instead of exchanging contents (default).

0

viz.display.gpu_affinity

Enable/Disable nVidia GPU affinity option. If enabled and supported by your graphics driver, all rendering will be performed on the GPU associated with the monitor the graphics window is initially created on.

0

viz.display.swap_group Enable/Disable nVidia swap group option. If enabled, buffer swaps will be synchronized with all other Vizard windows running on the same machine. 0
viz.display.swap_barrier Enable/Disable nVidia swap barrier option. If enabled and swap group is also enabled, buffer swaps will be synchronized with all other Vizard windows assigned to the barrier group. 0

viz.hmd

Initialize in HMD mode

0

viz.fullscreen

Initialize in fullscreen mode

0

viz.fullscreen.monitor

The monitor to use for fullscreen operations. If 0, the entire combined monitor region will be used for fullscreen.

0

viz.fullscreen.width

The width to use for fullscreen mode. If 0, the monitor width will be used.

0

viz.fullscreen.height

The height to use for fullscreen mode. If 0, the monitor height will be used.

0

viz.fullscreen.x

The x position to use for fullscreen mode. Relative to upper left corner.

0

viz.fullscreen.y

The y position to use for fullscreen mode. Relative to upper left corner.

0

viz.prompt

Initialize with prompt window

0

viz.stereo

Default stereo mode if none is specified with viz.go()

0

viz.quadbuffer

Initialize in quad buffer stereo mode

0

viz.stencil

Initialize with stencil buffer

0

Global initialization options

These options must be set in vizcore.cfg file, before the script is executed.

viz.theme.border

Theme border color

0.25 0.35 0.45 1.0

viz.theme.text

Theme text color

1.0 1.0 1.0 1.0

viz.theme.back

Theme background color

0.58 0.68 0.78 1.0

viz.theme.lightBack

Theme light background color

0.68 0.75 0.83 1.0

viz.theme.darkBack

Theme dark background color

0.25 0.44 0.64 1.0

viz.theme.highBack

Theme highlight background color

0.25 0.44 0.64 1.0

viz.theme.highText

Theme highlight text color

1.0 0.78 0.34 1.0

viz.theme.check.down

Checkbox check texture

checkbox_down.gif

viz.theme.check.up

Checkbox uncheck texture

checkbox_up.gif

viz.theme.button.down

Button down texture

button_down_blue.gif

viz.theme.button.up

Button up texture

button_up_blue.gif

viz.theme.radio.down

Radio selected texture

radio_down.gif

viz.theme.radio.up

Radio unselected texture

radio_up.gif

viz.theme.slider.bar

Slider bar texture

back.jpg

viz.theme.slider.tick

Slider tick texture

tick.jpg

viz.logLevel

Output log level (LOG_ALWAYS, LOG_ERROR, LOG_WARN, LOG_NOTICE, LOG_INFO, LOG_DEBUG)

LOG_NOTICE

viz.resource.path

Semi-colon delimited string of directories to add to resource path.

 

viz.resource.loaderOption

File loader option string

 

viz.physics.engine

The default physics engine to load on startup.

physics_opal.dll

viz.sound3d.engine

The default sound 3d engine to load on startup.

sound3d_dx.dll

viz.vsync

Vertical sync mode

1

viz.ipd

Stereo IPD value

0.06

viz.fov

Field of View and aspect ratio. If aspect ratio is negative then it will be automatically computed based on window size.

40 -1

viz.clip

Near/Far clip plane. If either value is negative, the clip planes will be automatically computed.

-1 -1

viz.overlap

Stereo overlap

1.0

viz.screenDistance

Screen distance value for stereo modes.

1.0

viz.clearcolor

Window clear color

0 0 0

viz.stereoHUD

Controls whether HUD objects are rendered in stereo. 0 or 1

1

viz.clearDepth

Clear depth buffer when rendering screen objects.

1

viz.specularTexture

Enables/Disables specular highlights on all textured objects.

0

viz.lightModel.localViewer

Use local viewpoint for calculating specular highlights. Enabling this will fix problems with specular highlights not being consistent on CAVE edges.

0

viz.lightModel.twoSided

Enable/Disable two sided lighting calculations.

0

viz.lightModel.ambient

Set the global ambient color

0.2 0.2 0.2

viz.text.encoding

The encoding to use for text display. If AUTO, Vizard will check the script for a UTF8 BOM.

( AUTO, ASCII, UTF8)

AUTO

viz.text.font

The default font to use when creating text objects.

Arial

viz.text.bidirectional

Controls whether text will support displaying bidirectional UTF-8 characters.

0

viz.text.line_spacing

The default line spacing to use when creating text objects. The spacing is specified as a percentage of the character height.

0.0

viz.text.thickness

The default thickness to use when creating 3D text objects. The thickness is specified as a percentage of the character height.

0.1

viz.network.buffer_size

Size of buffer that will receive all network data.

65536

viz.network.port

Port used for sending/receiving network data.

4950

viz.network.port_in

Space delimited list of additional ports to receive network data on.

 

viz.splashscreen

Image file to use as a loading splash screen

 

viz.mouse.visible

Controls if the mouse cursor is visible.

1

viz.mouse.trap

Controls if the mouse cursor is trapped inside the Vizard graphics window.

0

viz.mouse.sensitivity

Mouse navigation sensitivity.

1 1

viz.cluster.master.clients

Space delimited list of clients to connect to in cluster. Cluster master application will take precedence over this option.

 

viz.cluster.master.port

Port to use for cluster communication.

8501

viz.cluster.master.sync

Enable/Disable synchronization of frames between cluster nodes.

1

viz.cluster.master.sync_gpu

Controls whether GPU processing is synchronized between cluster nodes. Only used if frame synchronization is also enabled.

0

viz.cluster.master.transmit_mouse

Enable/Disable transmitting mouse navigation to clients.

1

viz.cluster.master.buffer_flush_size

Number of bytes in cluster message buffer before sending to clients.

4096

viz.cluster.master.broadcast_address

The address to use for broadcasting sync signal to clients.

255.255.255.255

viz.cluster.master.abortOnLostConnection

Controls whether the cluster master will abort the simulation if the connection to a client is lost.

1

viz.cluster.connect_timeout

Timeout for connecting to master/clients (milliseconds)

15000

viz.cluster.sync_timeout

Timeout for syncing frame with other machines (milliseconds)

10000

viz.cluster.frame_timeout

Timeout for sending/receiving messages for a frame (milliseconds)

20000

python.optimize

Set the optimize flag to initialize the Python interpreter with. Can be one of the following values:

0 - No optimization (default value)

1 - Equivalent to -O option, ignores assert statements

2 - Equivalent to -OO option, doc strings will not be included in compiled pyo files.

0

 Miscellaneous options

These options must be set before the associated commands are executed.

viz.default_key.quit

Enable/Disable default key for quitting Vizard script

1

viz.default_key.display_html

Enable/Disable default key for toggling display of html help

1

viz.default_key.fullscreen

Enable/Disable default key for toggling fullscreen mode

1

viz.default_key.poly_mode

Enable/Disable default key for toggling through polygon mode

1

viz.default_key.framerate

Enable/Disable default key for toggling framerate display

1

viz.default_key.camera_reset

Enable/Disable default key for resetting camera handler

1

viz.default_key.capture_image

Enable/Disable default key for capturing screen to an image

1

viz.default_key.capture_video

Enable/Disable default key for recording screen to a video

1

viz.default_key.dock_window

Enable/Disable default key for toggling docking of script window within IDE

1

viz.default_key.interactive

Enable/Disable default key for activating interactive window of IDE

1

viz.AVIRecorder.maxWidth

Maximum width for recording AVI

640

viz.AVIRecorder.maxHeight

Maximum height for recording AVI

480

viz.AVIRecorder.fps

Frame rate for recording AVI

30

viz.AVIRecorder.drawCursor

Capture mouse cursor in AVI

0

viz.check_gl_errors

Controls whether Vizard performs fine grained OpenGL error checking.

0

viz.glFinish

Controls whether Vizard synchronizes with the GPU after swapping the frame buffer by calling glFinish().

0

viz.dwm_composition

Controls whether Desktop Window Manager (DWM) composition is allowed while the script is running.

1

viz.preload

Tells Vizard if it should preload all objects to the graphics card before rendering the first frame.

1

viz.hint

A combination of hint flags to apply on all the scenes before the first frame is rendered.

0

viz.node.op_mode

Specifies the default op mode to use when a node is created. Can be a combination of the following values:

4 - OP_TRAVERSE

8 - OP_OVERRIDE

16 - OP_ROOT

4

viz.model.optimize

Automatically optimize models after they are loaded.

0

viz.model.hint

A combination of hint flags to apply to all loaded models.

0

viz.model.cache

The default cache mode to use. Can be one of the following values:

0 - viz.CACHE_NONE

1 - viz.CACHE_COPY

2 - viz.CACHE_CLONE

0

viz.model.apply_collada_scale

Automatically apply embedded meter scale factor to loaded Collada models.

1

viz.model.apply_collada_node_name Apply the Collada node name to the Vizard node during load, instead of the node ID. 0

viz.texture.share

Tells Vizard if it should share the textures of a model after it is loaded. This helps save texture memory when loading models that reference the same image file.

1

viz.texture.hint

A combination of hint flags to apply to textures created with viz.addTexture command. Will not be applied to render/blank textures.

0

vizhtml.port The port vizhtml's HTTP server will communicate over. 8080

viznet.server.port

The port viznet servers will communicate over.

viz.NETWORK_PORT

viznet.server.port_in

The port for viznet servers to receive messages on. If not specified, it will inherit the value from the viznet.server.port option.

viznet.server.port

viznet.server.port_out

The port the viznet servers will send messages on. If not specified, it will inherit the value from the viznet.server.port option.

viznet.server.port

viznet.client.port

The port viznet clients will communicate over.

viz.NETWORK_PORT

viznet.client.port_in

The port for viznet clients to receive messages on. If not specified, it will inherit the value from the viznet.client.port option.

viznet.client.port

viznet.client.port_out

The port the viznet clients will send messages on. If not specified, it will inherit the value from the viznet.client.port option.

viznet.client.port

hd.version

Version of OpenHaptics plugin to use. Can be either 1 or 2. Must be set before hd module is imported.

2

viz.shader.normal_map_unit

The texture unit to use when generating tangent/binormal data for geometry.

0

viz.shader.tangent.name

The attribute name to use for tangent data.

Tangent

viz.shader.tangent.index

The attribute index to use for tangent data.

6

viz.shader.binormal.name

The attribute name to use for binormal data.

Binormal

viz.shader.binormal.index

The attribute index to use for binormal data.

7

viz.link.resetOriPriority

The priority to use for link reset ori operators.

-10

LiveCharacter.connectionWarnTimeout

Print warning if LiveCharacter has not received response from server after this many seconds.

2

LiveCharacter.connectionRetryTimeout

Retry connecting to LiveCharacter server if have not received update after this many seconds.

2

viz.publish.allow_capture_video Allows capturing video recordings within published EXEs. Disabled by default since end users could inadvertently trigger recording that could quickly fill up hard drive space. 0

viz.publish.crc

Controls whether published EXEs will perform CRC on the exe when running. Set to 0 if you need to disable the CRC check.

1

viz.publish.load_message

Message to display in popup box while publish EXE is loading. If set to an empty string, the popup box will not appear.

Vizard launching, please wait...

viz.publish.load_title

Title of popup box while publish EXE is loading. The title appears in the taskbar.  If set to an empty string, the popup box won't appear in the taskbar.

Vizard launching

viz.publish.persistent

Controls whether the contents of the published EXE will persist on the users drive after being unpacked. If enabled, you must also specify a unique name for the viz.publish.product option. The files will persist in a directory based on the specified company/product names:

 

 %TEMP%/<company>/<product>

 

When enabled, this option allows for much faster startup times of the published EXE, since it will only need to be unpacked once on the end users system, and subsequent executions will run form the existing directory.

0

viz.publish.persist_folder

The folder to unpack persistent EXEs to. Must begin with one of the following tags:

 

<temp> - Users temp folder

<appdata> - Users application data folder

<temp>/<company>/<product>

viz.publish.product

The product name to use for published EXEs

 

viz.publish.company

The company name to use for published EXEs

WorldViz

viz.prevent_screensaver

Controls whether Vizard should prevent the screen saver from starting while the script is running.

0

viz.max_frame_rate

The maximum framerate to allow Vizard to run at. If 0, then Vizard will run as fast as possible.

0

viz.html.allowEscape

Controls whether the Escape key will close the HTML window when it as focus.

1

viz.director.exit_timeout Number of seconds to wait for director functions to exit during shutdown. 2

sound3d.useViewRotation

Controls whether the viewpoint rotation is used for spatializing the sound.

1

sound3d.dx.algorithm

The algorithm used by the DirectX 3D sound plugin. Can be one of the following string values:

 

NO_VIRTUALIZATION

HRTF_FULL

HRTF_LIGHT

 

If no value is specified, a default algorithm will be selected based on the user preference in the Control Panel.

 

Information options

These options are read-only.

platform.bit Current Vizard platform bit number 32 or 64
platform.name Current Vizard platform name win32 or x64

viz.version

Current version of vizard

NA

viz.monitor.count

Number of monitors

NA

viz.monitor.width

Current width of monitor resolution.

NA

viz.monitor.height

Current height of monitor resolution.

NA

viz.monitor.refresh_rate

Current refresh rate of monitor

NA

viz.cluster

1 if running in cluster mode, otherwise 0

NA

viz.cluster.clients

Number of clients, when running in cluster mode.

NA

viz.publish

1 when running in published mode, otherwise 0.

NA

viz.publish.path

The path of the published exe, when running in published mode.

NA

gl.extensions

List of OpenGL extensions supported by graphics card. Extension names are separated with spaces.

NA

gl.version

OpenGL version supported by driver

NA

gl.vendor

OpenGL driver vendor. Typically maker of graphics card.

NA

gl.renderer

OpenGL renderer. Typically name of graphics card.

 

NA

gl.shading_language_version

OpenGL shading language version

NA

gl.max_texture_size

Maximum 2D texture dimension supported by driver

NA

gl.max_3d_texture_size

Maximum 3D texture dimension supported by driver

NA

gl.max_cube_map_texture_size

Maximum Cubemap texture dimension supported by driver

NA

gl.max_texture_units

Maximum fixed function texture units supported by driver

NA

gl.max_texture_image_units

Maximum fragment shader texture units supported by driver

NA

gl.max_vertex_texture_image_units

Maximum vertex shader textures units supported by driver

NA

gl.max_combined_texture_image_units

Maximum vertex and fragment shader texture units supported by driver

NA

gl.colorBits

Color buffer bit depth of created window

NA

gl.redBits

Red channel bit depth of created window

NA

gl.greenBits

Green channel bit depth of created window

NA

gl.blueBits

Blue channel bit depth of created window

NA

gl.alphaBits

Alpha channel bit depth of created window

NA

gl.depthBits

Depth buffer bit depth of created window

NA

gl.stencilBits

Stencil buffer bit depth of created window

NA

gl.stereo

1 if quad buffer stereo is supported by created window, otherwise 0

NA

gl.pixelFormatIndex

The selected pixel format index of the created window

NA

gl.multiSamples

Multi sampling level of created window

NA