< GeeXLab Reference Guide />

> Back to Reference Guide Index


gh_node library

Description

gh_node is the module that manages all kind of nodes in the scene. Every object, gpu program, texture, material in the scene is derived from the node. A scene can be seen as a tree of nodes.


Number of functions: 8

  1. gh_node.add_child (Lua - Python)
  2. gh_node.getid (Lua - Python)
  3. gh_node.get_child_by_index (Lua - Python)
  4. gh_node.get_name (Lua - Python)
  5. gh_node.get_num_children (Lua - Python)
  6. gh_node.kill (Lua - Python)
  7. gh_node.remove_child (Lua - Python)
  8. gh_node.set_name (Lua - Python)



add_child

Description

Adds a child to a parent.


Syntax

gh_node.add_child(
 parent,
 child
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample

    
gh_node.add_child(parent, child)
            


getid

Description

Gets the identifier (id) of a node from its name.


Syntax

node_id = gh_node.getid(
 name
)

Languages

Lua - Python


Parameters


Return Values


Code sample

    
gpu_program_id = gh_node.getid("PhongShader")
            


get_child_by_index

Description

Returns the node identifier of a child.


Syntax

child = gh_node.get_child_by_index(
 node,
 index
)

Languages

Lua - Python


Parameters


Return Values


Code sample

    
-- Gets the first child.
child = gh_node.get_child_by_index(node, 0)
            


get_name

Description

Sets the name of a node.


Syntax

name = gh_node.get_name(
 node
)

Languages

Lua - Python


Parameters


Return Values


Code sample

    
name = gh_node.getname(node)
            


get_num_children

Description

Gets the number of children of a particular node.


Syntax

num_children = gh_node.get_num_children(
 node
)

Languages

Lua - Python


Parameters


Return Values


Code sample

    
num_children = gh_node.get_num_children(node)
            


kill

Description

Kills (cleanup and free resources) a node.


Syntax

gh_node.kill(
 node
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample

    
gh_node.kill(node)
            


remove_child

Description

Removes a child from a parent.


Syntax

gh_node.remove_child(
 parent,
 child
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample

    
gh_node.remove_child(parent, child)
            


set_name

Description

Sets the name of a node.


Syntax

gh_node.set_name(
 node,
 name
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample

    
gh_node.setname(node, "myKoolNodeName")
            






GeeXLab Rootard Guide | Downloads | Contact | Newsletter