Developer

API Reference

ITRIGMLDOCUMENT_GetElementByGuid()

deprecated
Items marked as deprecated have been replaced by a more powerful, alternative feature. Deprecated interfaces include a reference to the replacement interface, which should be used for all new application development. Deprecated features are still supported for backward compatibility, but should be avoided when developing new applications.
Brew Release
Brew MP 1.0.2
Description
Returns the element whose GUID matches the guid parameter.
The returned interface pointer is NOT AddRef'd; the caller should not Release it.
Parameters
  • po
    []:
    A pointer to an ITrigmlDocument object.
  • guid
    []:
    The GUID of the element.

Interface
ITRIGMLDOCUMENT
Prototype
   ITrigmlElement* ITRIGMLDOCUMENT_GetElementByGuid(ITrigmlDocument* po, uint32 guid)
Return
   A pointer to the element identified by the id parameter.
   NULL if no such element exists.
Side Effect
None
Comment
Every TrigML element is assigned a Globally Unique IDentifier when it is created. These numbers are intended to be unique during the lifetime of a particular TrigML document (in the unlikely event that 32 bits worth of GUIDs are exhausted, TrigPlayer will start re-assigning unused GUIDs).
The GUIDs assigned to your elements are at the discretion of the player and should not be relied upon to be consistent between different executions of the same content. However, it is useful to be able to fetch an element by its GUID when writing a Lua library for use with TrigPlayer, because every Lua table representing a TrigML element will return that element's GUID when indexed with the key "_gid". (Use ILUA_GetTable() when querying the GUID, not ILUA_RawGet()).
_root always has GUID 0, but it is faster to call ITRIGMLDOCUMENT_GetRoot() to access the root element. MAX_UINT32 is never used as a GUID.
  • Follow