GLSL Hacker
FEATURES DOWNLOAD GALLERY BLOG LEARN



» 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



gh_node.getid

Description

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

Languages

Lua - Python

Parameters

  • name [STRING]: name of node.

    Return Values

  • node_id [INTEGER]: node identifier

    Code sample


    gpu_program_id = gh_node.getid("PhongShader")



    gh_node.set_name

    Description

    Sets the name of a node.

    Languages

    Lua - Python

    Parameters

  • node [INTEGER]: Node identifier.
  • name [STRING]: Name of the node.

    Return Values

    This function has no return value(s).

    Code sample


    gh_node.setname(node, "myKoolNodeName")



    gh_node.get_name

    Description

    Sets the name of a node.

    Languages

    Lua - Python

    Parameters

  • node [INTEGER]: Node identifier.

    Return Values

  • name [STRING]: Node name.

    Code sample


    name = gh_node.getname(node)



    gh_node.kill

    Description

    Kills (cleanup and free resources) a node.

    Languages

    Lua - Python

    Parameters

  • node [INTEGER]: Node identifier.

    Return Values

    This function has no return value(s).

    Code sample


    gh_node.kill(node)



    gh_node.get_num_children

    Description

    Gets the number of children of a particular node.

    Languages

    Lua - Python

    Parameters

  • node [INTEGER]: Node identifier.

    Return Values

  • num_children [INTEGER]: Number of children.

    Code sample


    num_children = gh_node.get_num_children(node)



    gh_node.get_child_by_index

    Description

    Returns the node identifier of a child.

    Languages

    Lua - Python

    Parameters

  • node [INTEGER]: Node identifier.
  • index [INTEGER]: Index of a children from 0 to gh_node.get_num_children()-1.

    Return Values

  • child [INTEGER]: Child identifier

    Code sample


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



    gh_node.add_child

    Description

    Adds a child to a parent.

    Languages

    Lua - Python

    Parameters

  • parent [INTEGER]: Parent node identifier.
  • child [INTEGER]: Child node identifier.

    Return Values

    This function has no return value(s).

    Code sample


    gh_node.add_child(parent, child)



    gh_node.remove_child

    Description

    Removes a child from a parent.

    Languages

    Lua - Python

    Parameters

  • parent [INTEGER]: Parent node identifier.
  • child [INTEGER]: Child node identifier.

    Return Values

    This function has no return value(s).

    Code sample


    gh_node.remove_child(parent, child)





    2013-2015 Geeks3D. All Rights Reserved.

    .:- G3D Network -:.