NVIDIA Iray API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
mi::IShader_connections Class Referenceabstract

A shared interface for all shader, shader graph, shader graph class, and compound shader class interfaces that allow connections to their input parameters or on their contained shader or shader graph nodes. More...

Inheritance diagram for mi::IShader_connections:
Inheritance graph
[legend]

Public Member Functions

virtual Sint32  add_connection (const char *target_selector, const char *source_selector)=0
  Adds a shader graph connection to a target selector from a source selector. More...
 
virtual Sint32  remove_connection (const char *target_selector)=0
  Removes a shader connection to a target selector from a source selector. More...
 
virtual Uint32  get_connection_length (const char *target_name) const =0
  Returns the number of connections that the target parameter has. More...
 
virtual const IString get_connection_target_selector (const char *target_name, Uint32 connection_number) const =0
  Returns the sequence of optional array selectors and struct field selectors for the connection target of the given number, or NULL if the connection is for the full parameter. More...
 
virtual const IString get_connection_source_selector (const char *target_name, Uint32 connection_number) const =0
  Returns the source selector for the connection target of the given number. More...
 

Additional Inherited Members

- Public Types inherited from mi::base::Interface_declare< 0x1c944e21, 0x839a, 0x4d61, 0xad, 0x81, 0x17, 0xb4, 0x16, 0x10, 0x19, 0xe7 >
typedef Interface_declare< id1,
id2, id3, id4, id5, id6, id7,
id8, id9, id10, id11,
IInterface
Self
  Own type. More...
 
typedef Uuid_t< id1, id2, id3,
id4, id5, id6, id7, id8, id9,
id10, id11 > 
IID
  Declares the interface ID (IID) of this interface. More...
 
- Static Public Member Functions inherited from mi::base::Interface_declare< 0x1c944e21, 0x839a, 0x4d61, 0xad, 0x81, 0x17, 0xb4, 0x16, 0x10, 0x19, 0xe7 >
static bool  compare_iid (const Uuid &iid)
  Compares the interface ID iid against the interface ID of this interface and of its ancestors. More...
 

Detailed Description

A shared interface for all shader, shader graph, shader graph class, and compound shader class interfaces that allow connections to their input parameters or on their contained shader or shader graph nodes.

Note
MetaSL is deprecated. Support for MetaSL might be removed in future releases. Use MDL instead.

Shader connections are directed from a source parameter to a target parameter. Connections can be made from and to individual array members or struct fields of a parameter. The usual array bracket notation and dot field access notation is used in a combined parameter selector, for example, "vector_params[4].x".

Parameter names can be individual input or output parameter names of the current object, but they can also be prefixed, separated by a dot, with a name of another node. In general, applicable parameter names are all own parameters and all parameters of all nodes visible to me that have the right data flow direction.

Applicable parameter names depend in detail on whether this interface has been obtained from an instance object (mi::IShader, mi::IShader_graph) or a class object (mi::IShader_graph_class, mi::ICompound_shader_class). For detailed information on how to use this interface with a particular instance object, it is best to refer to the apropos documentation mi::IShader, mi::IShader_graph, mi::IShader_graph_class, or mi::ICompound_shader_class.

Member Function Documentation

virtual Sint32 mi::IShader_connections::add_connection ( const char *  target_selector,
const char *  source_selector 
)
pure virtual

Adds a shader graph connection to a target selector from a source selector.

Parameters
target_selector The target selector composed of an optional node name followed by a dot, an input or output parameter name, followed by a sequence of optional array selectors and struct field selectors.
source_selector The source selector composed of an optional node name followed by a dot, an input or output parameter name, followed by a sequence of optional array selectors and struct field selectors.
Returns
  • 0: Success.
  • -1: The target_selector is NULL.
  • -2: The source_selector is NULL.
  • -3: The target_selector does not identify a valid input parameter.
  • -4: The source_selector does not identify a valid node or DB element.
  • -5: The source_selector does not identify an mi::IShader, mi::IShader_class, or mi::IShader_graph_class.
  • -6: The target_selector does not identify a valid node.
  • -7: Internal error.
virtual Uint32 mi::IShader_connections::get_connection_length ( const char *  target_name) const
pure virtual

Returns the number of connections that the target parameter has.

Parameters
target_name Name of an input parameter, if this is an instance object, or an output parameter, if this is a class object.
Returns
The number of connections that the target parameter has.
virtual const IString* mi::IShader_connections::get_connection_source_selector ( const char *  target_name,
Uint32  connection_number 
) const
pure virtual

Returns the source selector for the connection target of the given number.

Parameters
target_name Name of an input parameter, if this is an instance object, or an output parameter, if this is a class object.
connection_number Number of the connection between zero and get_connection_length()-1.
Returns
Source parameter name including an optional node name, plus a sequence of optional array selectors and struct field selectors, or NULL if target_name does not exist or if connection_number is out of range.
virtual const IString* mi::IShader_connections::get_connection_target_selector ( const char *  target_name,
Uint32  connection_number 
) const
pure virtual

Returns the sequence of optional array selectors and struct field selectors for the connection target of the given number, or NULL if the connection is for the full parameter.

The target member name is not included in the result.

Parameters
target_name Name of an input parameter, if this is an instance object, or an output parameter, if this is a class object.
connection_number Number of the connection between zero and get_connection_length()-1.
Returns
Sequence of optional array selectors and struct field selectors or NULL if the connection is for the full parameter, if target_name does not exist, or if connection_number is out of range.
virtual Sint32 mi::IShader_connections::remove_connection ( const char *  target_selector)
pure virtual

Removes a shader connection to a target selector from a source selector.

Parameters
target_selector The target selector composed of an optional node name followed by a dot, an input or output parameter name, followed by a sequence of optional array selectors and struct field selectors.
Returns
  • 0: Success.
  • -1: The target_selector is NULL.
  • -2: The target_selector does not identify a valid input parameter.
  • -3: The target_selector does not identify a valid node.
  • -4: The target_selector does not identify an mi::IShader.
  • -5: The target_selector does not identify a valid node.
  • -6: Internal error.