Quick Links
> Homepage
|-- Overview
|-- Download
|-- Screenshots
|-- Community

> Code Sample Pack

> Reference Guide

> Changelog

> Overview of GLSL Hacker
> Live Coding
> Hack your first GLSL Code
> Moon3D


GLSL Hacker Articles

> Compute shaders on Radeon
> Distance functions in GLSL
> GLSL Interpolation Qualifiers
> Tessellation Spacing Modes
> Normal Visualizer with GS
> 3D Surface Plots
> Normal Mapping
> Circle and Disc in GLSL
> PhysX 3 Flag Demo
> GLSL Hacker on Raspberry Pi
GLSL Hacker

Reference Guide
XML Nodes



Back to homepage
Back to Developer's Guide Index

<script> XML Node


XML Node Summary
<script
  name=""
  filename=""
  absolute_path="0"
  run_mode="ZOMBIE"
  language="LUA"
  >
  <raw_data />
</script>


<script>

Description
Allows to load and execute scripts (Lua or Python) especially written to interact with scene's nodes using the Lua/python host API.

script element has 5 attributes and 1 sub-element(s)

Attributes
  • name [STRING]: name of this XML node.
  • filename [STRING]: location of the script file relative to the main XML script. Conventions: Lua script files extension: *.lua and Python script files extension: *.py
  • absolute_path [INTEGER]: absolute path (1) or not (0) of the script filename. - Default value = 0
  • run_mode [ENUM]: specifies the working mode of the script - Default value = ZOMBIE - Values = INIT: the script is executed once at the scene initialization. FRAME: the script is executed every frame. ZOMBIE: the script is executed manually (hotkey for example). SIZE: the script is executed when the window's size changes. DRAG_N_DROP: the script is executed after a drag n drop occured. TERMINATE: the script is executed at the end of the demo.
  • language [ENUM]: specifies the language use in the script: PYTHON or LUA - Default value = LUA

Code sample :

<script name="init_scene" run_mode="INIT" filename="init.lua" LANGUAGE="LUA" />

<script name="update_scene" run_mode="FRAME" LANGUAGE="LUA" >
<raw_data><![CDATA[
elapsed = gh_utils.get_elapsed_time(ID)
]]></raw_data>
</script>

<script name="resize_scene" run_mode="SIZE" LANGUAGE="LUA" >
<raw_data><![CDATA[
width, height = gh_window.get_size(ID)
]]></raw_data>
</script>


<raw_data>

Description
Allows to integrate the source code of a script directly in the XML code without requiring an external file.

raw_data element has 0 attributes and 0 sub-element(s)

(C)2012-2013 Geeks3D