![]() |
Murl Engine Lua Addon API
Version 1.0 beta
|
The IInstance graph node interface.
This interface provides a means to instantiate zero, one, or more sub-graphs in the current scene graph. The source object (i.e. graph template) can either be a Resource::IGraph object from the resource collection set via GetGraphResourceTarget(), or an already instantiated Graph::ITemplate node referenced via GetTemplateNodeTarget().
Get the constant Graph::INode interface. This method returns a constant pointer to the node's Graph::INode interface, to be able to query common node properties such as active state, visibility or ID.
Murl.Graph.INode GetNodeInterface()
Get a constant Graph::IGraphResourceTarget container. This method returns a constant pointer to a Graph::IGraphResourceTarget container, which allows to query the graph resources referenced by a node implementing this interface.
Murl.Graph.IGenericResourceTarget.ResourceIGraph GetGraphResourceTarget()
Get the constant Graph::ITemplateNodeTarget container. This method returns a constant pointer to the node's Graph::ITemplateNodeTarget container, which allows to query the template graph node used for instantiaton.
Murl.Graph.IGenericNodeTarget.GraphITemplate GetTemplateNodeTarget()
Set the number of replications. This method sets the number of times the referenced graph resource should be instantiated. By default, this value is set to 1; it is also possible to set it to zero to not instantiate any graphs at all, useful e.g. when the instance node itself is used from within a parameterized sub-graph.
Boolean SetNumberOfReplications(Integer numberOfReplications)
numberOfReplications | The number of replications of the graph to create. |
Get the number of replications.
Integer GetNumberOfReplications()
Return the replication at a given position. This returns a mutable pointer to this node's replication at a given index.
Murl.Graph.INode GetReplicationNode(Integer index)
index | The zero-based index of the replication. |
Add a user-defined instance parameter. It is possible to parameterize a graph instance by adding individual parameter name/value pairs, which are then evaluated during creation of the given sub-graph. If a node attribute from the given graph resource contains an identifier name enclosed in curly braces, e.g. "{myVariable}", that sequence is replaced by the value of the parameter with the given name if present, otherwise a default value is used that can be defined in the graph resource (or an empty string if that default value is also not present).
Boolean AddParameter(String name, String value)
name | The parameter name. |
value | The parameter value. |
Get the total number of user-defined instance parameters.
Integer GetNumberOfParameters()
Get the name of a user-defined instance parameter at a given index.
String GetParameterName(Integer index)
index | The zero-based index of the parameter to query. |
Get the value of a user-defined instance parameter at a given index.
String GetParameterValue(Integer index)
index | The zero-based index of the parameter to query. |