ICENodeContext is used for accessing/handling custom node graph data. Instances of this object can pass information to the C++ API callbacks that implement the custom node plug-in item.
#include <xsi_icenodecontext.h>
ICENodeContext | ( | ) |
Default constructor.
~ICENodeContext | ( | ) |
Default destructor.
ICENodeContext | ( | const CRef & | in_ref | ) |
Constructor.
in_ref | constant reference object. |
ICENodeContext | ( | const ICENodeContext & | in_obj | ) |
Copy constructor.
in_obj | constant class object. |
bool IsA | ( | siClassID | in_ClassID | ) | const [virtual] |
Returns true if a given class type is compatible with this API class.
in_ClassID | class type. |
Reimplemented from Context.
siClassID GetClassID | ( | ) | const [virtual] |
ICENodeContext& operator= | ( | const ICENodeContext & | in_obj | ) |
Creates an object from another object.
in_obj | constant class object. |
ICENodeContext& operator= | ( | const CRef & | in_ref | ) |
Creates an object from a reference object. The newly created object is set to empty if the input reference object is not compatible.
in_ref | constant class object. |
Reimplemented from Context.
CStatus GetGroupInstanceCount | ( | ULONG | in_grpUniqID, |
ULONG & | out_inst_count | ||
) | const |
Returns the number of instances for a given group.
in_grpUniqID | Group index to query |
out_inst_count | Number of instances |
ULONG GetEvaluationThreadCount | ( | ) | const |
Returns the number of threads used during the cb_ICENode_Evaluate Evaluate callback.
ULONG GetCurrentThreadIndex | ( | ) | const |
Returns the current evaluation thread index. If called from cb_ICENode_Evaluate Evaluate , the index ranges between 0 and GetEvaluationThreadCount()-1. Returns 0 if called from either the cb_ICENode_BeginEvaluate BeginEvaluate or cb_ICENode_EndEvaluate EndEvaluate callback.
ULONG GetNumberOfElementsToProcess | ( | ) | const |
Returns the total number of elements to process during the evaluation of an ICENode. Returns 0 if the operation fails. The return value can be set by the custom ICENode if an output port is set with the siICENodeContextElementGenerator context type.
CStatus PutNumberOfElementsToProcess | ( | ULONG | in_nElements | ) |
Sets the number of elements to generate for an element generator node. The new value will affect the current output port being evaluated.
in_nElements | Number of elements. The value is ignored if the current port has not been set with the siICENodeContextElementGenerator context type. |
XSIPLUGINCALLBACK CStatus MyICENodeGenerator_BeginEvaluate( ICENodeContext& in_ctxt ) { // Get some values from an input port CDataArrayLong inSize( in_ctxt, ID_Size ); // Total number of elements to generate ULONG nSize = inSize[ 0 ]; ULONG nElements = nSize * nSize; in_ctxt.PutNumberOfElementsToProcess( nElements ); return CStatus::OK; }
CStatus GetPortInfo | ( | ULONG | in_nPortID, |
siICENodeDataType & | out_type, | ||
siICENodeStructureType & | out_struct, | ||
siICENodeContextType & | out_context | ||
) | const |
Returns the resolved port types for the specified ICENodePort.
in_nPortID | Index of the port to query |
out_type | Data type for this port (see ICENodePort::GetDataType) |
out_struct | Structure for this port (see ICENodePort::GetStructureType) |
out_context | Context for this port (see ICENodePort::GetContextType) |
CStatus GetPortInfo | ( | ULONG | in_nPortID, |
siICENodeDataType & | out_type, | ||
siICENodeStructureType & | out_struct, | ||
siICENodeContextType & | out_context, | ||
CString & | out_customDataType | ||
) | const |
Returns the resolved port types for the specified ICENodePort. The method also returns the resolved custom data type identifier if the port type is set with siICENodeDataCustomType, otherwise the string returned is empty.
in_nPortID | Index of the port to query |
out_type | Data type for this port (see ICENodePort::GetDataType) |
out_struct | Structure for this port (see ICENodePort::GetStructureType) |
out_context | Context for this port (see ICENodePort::GetContextType) |
out_customDataType | The custom data type identifier for this port. |
ULONG GetEvaluatedOutputPortID | ( | ) | const |
Returns the unique identifier of the output port being evaluated.
CTime GetTime | ( | ) | const |
ULONG GetEvaluationPhaseIndex | ( | ) | const |
Returns the current evaluation phase index when the ICENode is configured for multi-phase evaluation. This method returns UINT_MAX
if the node threading mode is not set accordingly or the method is called during the last processing phase.
CStatus SetLastEvaluationPhase | ( | ) |
Sets the current evaluation phase as the last phase to process. This tells Softimage to pull the input port(s) data for the final processing phase. This method is enabled only when the node threading model is set to siICENodeMultiEvaluationPhase.
CStatus AddEvaluationPhaseInputPort | ( | ULONG | in_portid, |
const XSI::CLongArray & | in_portInstances = XSI::CLongArray() |
||
) |
Adds an input port to evaluate for the current evaluation phase. This method must be used in the context of a custom node with multi-evaluation processing and from the cb_ICENode_SubmitEvaluationPhaseInfo SubmitEvaluationPhaseInfo callback. The method is enabled only when the node threading model is set to siICENodeMultiEvaluationPhase.
AddEvaluationPhaseInputPort takes a port identifier, as specified with ICENodeDef::AddInputPort, and an optional array of port instance numbers. By default, all port instances are evaluated, but you can specify the port instance number(s) corrsponding to which port(s) you want to be evaluated in the in_portInstances
array. You can call AddEvaluationPhaseInputPort multiple times to specify multiple ports to evaluate. Ports are evaluated in the same order in which they are specified.
Here are some important rules to follow when specifying the input ports to pull:
in_portid | A unique identifier describing the input port. |
in_portInstances | A CLongArray containing the instance(s) of the port(s) to evaluate. |
CStatus SetAsElementDataVarying | ( | ) |
In ICE, the data flowing in an ICETree is constant by default. For instance, the element data of a particle cloud do not vary at each evaluation when it's constant. In this case, the data array of an input port will always be set with one single value. SetAsElementDataVarying can be used to force the element data to vary independently of the input data state.
A typical use of SetAsElementDataVarying is when a custom node needs to output data randomly regardless of the input data state. The CustomICENodes/netview_CustomICENodes GridWalker example uses constants for all inputs and calling SetAsElementDataVarying will allow the GridWalker
node to set the data for all particle elements.
CStatus SetAsTimeVarying | ( | ) |
Forces the node to evaluate frame by frame regardless of the overall graph state. You can use this function instead of connecting the CurrentFrameNode as input to the custom node.