< 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 ()
  2. gh_node.get_child_by_index ()
  3. gh_node.get_name ()
  4. gh_node.get_num_children ()
  5. gh_node.getid ()
  6. gh_node.kill ()
  7. gh_node.remove_child ()
  8. gh_node.set_name ()



add_child

Description

Adds a child to a parent.


Syntax

gh_node.add_child(
 parent_id,
 child_id
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


gh_node.add_child(parent_id, child_id)
			


get_child_by_index

Description

Returns the node identifier of a child.


Syntax

child_id = gh_node.get_child_by_index(
 node_id,
 index
)

Languages


Parameters


Return Values


Code sample


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


get_name

Description

Sets the name of a node.


Syntax

name = gh_node.get_name(
 node_id
)

Languages


Parameters


Return Values


Code sample


name = gh_node.getname(node_id)
			


get_num_children

Description

Gets the number of children of a particular node.


Syntax

num_children = gh_node.get_num_children(
 node_id
)

Languages


Parameters


Return Values


Code sample


num_children = gh_node.get_num_children(node_id)
			


getid

Description

Gets the identifier of a node from its name.


Syntax

node_id = gh_node.getid(
 name
)

Languages


Parameters


Return Values


Code sample


node_id = gh_node.getid("PhongShader")
			


kill

Description

Kills (cleanup and free resources) a node.


Syntax

gh_node.kill(
 node_id
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


gh_node.kill(node_id)
			


remove_child

Description

Removes a child from a parent.


Syntax

gh_node.remove_child(
 parent_id,
 child_id
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


gh_node.remove_child(parent_id, child_id)
			


set_name

Description

Sets the name of a node.


Syntax

gh_node.set_name(
 node_id,
 name
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


gh_node.setname(node_id, "myKoolNodeName")
			






GeeXLab Rootard Guide | Downloads | Contact | Newsletter