CustomICENodes
 
 
 

Custom ICENode Examples

This addon shows various self-installing custom ICENodes.

BBoxGenerator
This sample demonstrates how to use the single-threading model for implementing a custom ICENode. The node reads all the points of a geometry at once and write the min and max point value on the output.

CloudGeneratorFromDataFile
The example demonstrates the use of an element generator custom node (i.e. CloudGeneratorFromDataFile) and the built-in StringFilePathSequence node for generating a particle cloud from a sequence of files. The CloudGeneratorFromDataFile custom node generates the particles by reading the 'pointposition' values from the data files provided by the StringFilePathSequence node. Other cloud attributes such as size and color are set by the SetAttributeValueFromDataFile custom node. The data files are generated with the mycache plugin example by exporting the pointposition, size and color attribute values from a demo scene.

CustomGoalDeformer
The CustomGoalDeformer sample demonstrates the use of the multi-phase evaluation approach for implementing a goal particle deformer. The ICENode reads the source particle points in the first phase and performs the final blending operation using the goal points in the last evaluation phase.

CustomPassThrough
This example demonstrates how to handle port polymorphism programmatically in a custom node.

CustomVector3ToScalar
This is a simple example of an ICENode. The node reads a vector3 input value, extracts the XYZ components and write each one to individual output ports. This sample node is demonstrated with the CustomVector3ToScalar.scn scene which contains an ICENode graph that performs a twist operation on a cube.

ElementGenerator
This sample demonstrates how to implement an element generator ICENode typically used for generating particles. The ElementGenerator.scn contains an instance of the ElementGenerator node and creates a 2D particle grid whose size is specified with the node's Size input port.

GridWalker
This sample demonstrates how to use the custom type support for storing binary data values in ICE with custom ICENodes. The GridWalker sample moves particle points randomly on a grid and keeps the state of each particle in a data structure stored as binary data in the ICE graph. The structure is updated at each frame with a new particle state.

PointGeneratorFromGeometry
The sample demonstrates how to use the CICEGeometry class for accessing geometry data within a custom ICE node. This is demonstrated by the PointGeneratorFromGeometry node which generates particles on a set of geometry surfaces by using different sampling methods.

PortStateObserver
This sample demonstrates how to determine if the state of the data and the geometry objects connected to a custom node have changed. The CICEPortState class is used in this demo to query for the states of any connected input data, whereas the CICEGeometry class is used to determine if the state of connected geometries have changed.

Quake2Loaders
This sample demonstrates how to create custom nodes to read geometry from files and create geometry using ICE Modeling.
The MD2Loader node reads a Quake2 MD2 model file and returns the geometry at a given frame.
The BSPLoader node reads a Quake2 BSP map file, and returns the geometry based on a given position.
The 2 loaders returns singleton arrays for the vertices, polygonal description, uvs, normals.
The BSP loader also returns arrays for materials and materialIDs.

RandomGridGenerator
This sample demonstrates how to generate a particle cloud geometry with random points using the MATH::CRandom class of the C++ SDK.

Vector3Union
This sample demonstrates how to create an array of CVector3f objects by combining the similar objects of 2 input CVector3f arrays in multi-threading. The sample scene Vector3Union.scn demonstrates how to generates particles from the union of 2 point position vectors output by GetClosestPoints nodes.

YPosFilter
The YPosFilter sample demonstrates how to remove elements from a node index set to achieve a filtering operation in an ICE graph. The YPosFilter.scn uses the ICENode sample to remove all point elements of a cone whose Y components are below 0.0. You can watch the resulting effect by translating the cone in the Y direction.

Example Files

Location
Files
BBoxGenerator.cpp
CustomMultiPhaseGoal.cpp
CustomPassThrough.cpp
CustomVector3ToScalar.cpp
ElementGenerator.cpp
GridWalker.cpp
CloudGeneratorFromDataFile.cpp
SetAttributeValueNode.cpp
SetAttributeValuesNode.cpp
DataFileParser.cpp
DataFileParser.h
PointGeneratorFromGeometry.cpp
PortStateObserver.cpp
RandomGridGenerator.cpp
YPosFilter.cpp
Vector3UnionNode.cpp
PortStateObserver_LogChanges.vbs

Running the Example

To run the CustomPassThrough example

  • Load the Data\Project\Scenes\CustomPassThrough.scn file.
  • Start the animation, the particle points are moving toward a cube.

To run the CustomVector3ToScalar example

  • Load the Data\Project\Scenes\CustomVector3ToScalar.scn file.
  • Select the cube and open an ICE view.
  • Select the Multiple node in the ICE view.
  • Play with the value2 parameter slider and watch the cube being twisted along the Y axis.

To run the CustomGoalDeformer example

  • Load the Data\Project\Scenes\CustomGoalDeformer.scn file.
  • Start the animation and watch the particle points of a sphere being blended with the points of a cube.

To run the BBoxGenerator example

  • Load the Data\Project\Scenes\BBoxGenerator.scn file.
  • Select the cube and open its property page.
  • Play with the timeline and watch the sphere's Min and Max bounding box values logged in the history window.

To run the CloudGeneratorFromDataFile example

  • From the CloudGeneratorFromDataFile Demo menu located in the main menu bar, click Generate Simulation Data Files to generate the set of dat files used by this demo (you only need to do that once).
  • From the same menu, click Load Demo Scene 1 to load the PointCloudGeneratorFromFile1.scn scene. The scene has an ICE tree containing a CloudGeneratorFromDataFile node to generate the particle points and two SetAttributeValueFromDataFile nodes for setting the color and size attributes on the generated particles. SetAttributeValueFromDataFile is a generic node used for setting one single attribute, it is typically used to build graphs programmatically when an arbitrary number of attributes need to be imported.
  • Start the animation and watch the particles being generated from the values saved in the simulation data files.
  • The Load Demo Scene 2 2 menu item loads the PointCloudGeneratorFromFile2.scn scene. This scene is similar to PointCloudGeneratorFromFile1.scn but uses a different node (SetAttributeValuesFromDataFile) for setting the size and color attributes. Contrary to SetAttributeValueFromDataFile, SetAttributeValuesFromDataFile is pretty much hardcoded for setting the color and size attributes from a single node but can be expanded easily to support more attributes.

To run the ElementGenerator example

  • Load the Data\Project\Scenes\ElementGenerator.scn file.
  • Select the PointCloud primitive and open an ICE view.
  • Select the ElementGenerator node in the ICE view.
  • Play with the Size parameter slider and watch the number of elements being changed on the particle grid.

To run the GridWalker example

  • Load the Data\Project\Scenes\GridWalker.scn file.
  • Hit the time line play button and watch the particles moving around on a grid in a random fashion.

To run the PointGeneratorFromGeometry example

  • Load the Data\Project\Scenes\PointGeneratorFromGeometry.scn file.
  • Select the pointcloud primitive and open an ICE view.
  • Double-click on the Point Generator compound node in the ICE view.
  • Select one of the sampling methods from the PPG and watch the particles being generated on the geometries. The Number of random points parameter can be used with the Random Points sampling method to specify the number of particles to generate per triangle.

To run the PortStateObserver example

  • From the PortStateObserver menu located in the main menu bar, click Log Changes. The PortStateObserver.scn scene is loaded and information about the states of the data and geometry objects connected to the PortStateObserver custom node is accumulated and logged in the scripting history.

To run the RandomGridGenerator example

  • Load the Data\Project\Scenes\RandomGridGenerator.scn file.
  • Select the PointCloud primitive and open an ICE view.
  • Select the RandomGridGenerator node in the ICE view.
  • Play with the Size and Seed parameter sliders and watch the particle grid elements changing.

To run the Vector3Union example

  • Load the Data\Project\Scenes\Vector3Union.scn file.
  • Play with the time line and watch the red particles being generated from the points output by the "Vector3 Union" node.

To run the YPosFilter example

  • Load the Data\Project\Scenes\YPosFilter.scn file.
  • Interactively translates the cone position along the Y axis and watch the vertices being scaled down as you move the cone up or down.

Building the Examples

Use the following instructions to build the ICENode samples.

To build the CustomGoalDeformer example on Windows

  1. Open a Softimage command prompt, and type devenv to start Visual Studio .NET.

    Starting Visual Studio .NET from a Softimage command prompt ensures that environment variables such as XSISDK_ROOT are set (otherwise you'll get build and link errors).

    Tip To load the CustomMultiPhaseGoal project from the command line, type:

    devenv cppsrc_custom_goal_deformer\CustomMultiPhaseGoal.vcproj
    
  2. In Visual Studio .NET, open the project file .vcproj.
  3. Select a configuration (Release or Debug) and build the DLL.

To build the CustomGoalDeformer example on Linux

  1. In a shell (tcsh) window, type:

    source $XSI_HOME/.xsi_<xsi_version>
    
  2. Change directories to

    cppsrc_custom_goal_deformer
    
  3. To remove all intermediate files before building the example, run this command:

    gmake clean
    
  4. To compile the example, run this command:

    gmake
    

To build the CustomPassThrough example on Windows

  1. Open a Softimage command prompt, and type devenv to start Visual Studio .NET.

    Starting Visual Studio .NET from a Softimage command prompt ensures that environment variables such as XSISDK_ROOT are set (otherwise you'll get build and link errors).

    Tip To load the CustomPassThrough project from the command line, type:

    devenv cppsrc_custom_passthrough\CustomPassThrough.vcproj
    
  2. In Visual Studio .NET, open the project file .vcproj.
  3. Select a configuration (Release or Debug) and build the DLL.

To build the CustomPassThrough example on Linux

  1. In a shell (tcsh) window, type:

    source $XSI_HOME/.xsi_<xsi_version>
    
  2. Change directories to

    cppsrc_custom_passthrough
    
  3. To remove all intermediate files before building the example, run this command:

    gmake clean
    
  4. To compile the example, run this command:

    gmake
    

To build the CustomVector3ToScalar example on Windows

  1. Open a Softimage command prompt, and type devenv to start Visual Studio .NET.

    Starting Visual Studio .NET from a Softimage command prompt ensures that environment variables such as XSISDK_ROOT are set (otherwise you'll get build and link errors).

    Tip To load the CustomVector3ToScalar project from the command line, type:

    devenv cppsrc_customvector3toscalar\CustomVector3ToScalar.vcproj
    
  2. In Visual Studio .NET, open the project file .vcproj.
  3. Select a configuration (Release or Debug) and build the DLL.

To build the CustomVector3ToScalar example on Linux

  1. In a shell (tcsh) window, type:

    source $XSI_HOME/.xsi_<xsi_version>
    
  2. Change directories to

    cppsrc_customvector3toscalar
    
  3. To remove all intermediate files before building the example, run this command:

    gmake clean
    
  4. To compile the example, run this command:

    gmake
    

To build the BBoxGenerator example on Windows

  1. Open a Softimage command prompt, and type devenv to start Visual Studio .NET.

    Starting Visual Studio .NET from a Softimage command prompt ensures that environment variables such as XSISDK_ROOT are set (otherwise you'll get build and link errors).

    Tip To load the BBoxGenerator project from the command line, type:

    devenv cppsrc_bboxgenerator\BBoxGenerator.vcproj
    
  2. In Visual Studio .NET, open the project file .vcproj.
  3. Select a configuration (Release or Debug) and build the DLL.

To build the BBoxGenerator example on Linux

  1. In a shell (tcsh) window, type:

    source $XSI_HOME/.xsi_<xsi_version>
    
  2. Change directories to

    cppsrc_bboxgenerator
    
  3. To remove all intermediate files before building the example, run this command:

    gmake clean
    
  4. To compile the example, run this command:

    gmake
    

To build the CloudGeneratorFromDataFile example on Windows

  1. Open a Softimage command prompt, and type devenv to start Visual Studio .NET.

    Starting Visual Studio .NET from a Softimage command prompt ensures that environment variables such as XSISDK_ROOT are set (otherwise you'll get build and link errors).

    Tip To load the CloudGeneratorFromDataFile project from the command line, type:

    devenv cppsrc_pointcloud_generator_from_file\CloudGeneratorFromDataFile.vcproj
    
  2. In Visual Studio .NET, open the project file .vcproj.
  3. Select a configuration (Release or Debug) and build the DLL.

To build the CloudGeneratorFromDataFile example on Linux

  1. In a shell (tcsh) window, type:

    source $XSI_HOME/.xsi_<xsi_version>
    
  2. Change directories to

    cppsrc_pointcloud_generator_from_file
    
  3. To remove all intermediate files before building the example, run this command:

    gmake clean
    
  4. To compile the example, run this command:

    gmake
    

To build the ElementGenerator example on Windows

  1. Open a Softimage command prompt, and type devenv to start Visual Studio .NET.

    Starting Visual Studio .NET from a Softimage command prompt ensures that environment variables such as XSISDK_ROOT are set (otherwise you'll get build and link errors).

    Tip To load the ElementGenerator project from the command line, type:

    devenv cppsrc_elementgenerator\ElementGenerator.vcproj
    
  2. In Visual Studio .NET, open the project file .vcproj.
  3. Select a configuration (Release or Debug) and build the DLL.

To build the ElementGenerator example on Linux

  1. In a shell (tcsh) window, type:

    source $XSI_HOME/.xsi_<xsi_version>
    
  2. Change directories to

    cppsrc_elementgenerator
    
  3. To remove all intermediate files before building the example, run this command:

    gmake clean
    
  4. To compile the example, run this command:

    gmake
    

To build the GridWalker example on Windows

  1. Open a Softimage command prompt, and type devenv to start Visual Studio .NET.

    Starting Visual Studio .NET from a Softimage command prompt ensures that environment variables such as XSISDK_ROOT are set (otherwise you'll get build and link errors).

    Tip To load the GridWalker project from the command line, type:

    devenv cppsrc_gridwalker\GridWalker.vcproj
    
  2. In Visual Studio .NET, open the project file .vcproj.
  3. Select a configuration (Release or Debug) and build the DLL.

To build the GridWalker example on Linux

  1. In a shell (tcsh) window, type:

    source $XSI_HOME/.xsi_<xsi_version>
    
  2. Change directories to

    cppsrc_gridwalker
    
  3. To remove all intermediate files before building the example, run this command:

    gmake clean
    
  4. To compile the example, run this command:

    gmake
    

To build the PointGeneratorFromGeometry example on Windows

  1. Open an Softimage command prompt, and type devenv to start Visual Studio .NET.

    Starting Visual Studio .NET from an Softimage command prompt ensures that environment variables such as XSISDK_ROOT are set (otherwise you'll get build and link errors).

    Tip To load the PointGeneratorFromGeometry project from the command line, type:

    devenv cppsrc_pointgenerator\PointGeneratorFromGeometry.vcproj
    
  2. In Visual Studio .NET, open the project file .vcproj.
  3. Select a configuration (Release or Debug) and build the DLL.

To build the PointGeneratorFromGeometry example on Linux

  1. In a shell (tcsh) window, type:

    source $XSI_HOME/.xsi_<xsi_version>
    
  2. Change directories to

    cppsrc_pointgenerator
    
  3. To remove all intermediate files before building the example, run this command:

    gmake clean
    
  4. To compile the example, run this command:

    gmake
    

To build the PortStateObserver example on Windows

  1. Open an Softimage command prompt, and type devenv to start Visual Studio .NET.

    Starting Visual Studio .NET from an Softimage command prompt ensures that environment variables such as XSISDK_ROOT are set (otherwise you'll get build and link errors).

    Tip To load the PortStateObserver project from the command line, type:

    devenv cppsrc_port_state_observer\PortStateObserver.vcproj
    
  2. In Visual Studio .NET, open the project file .vcproj.
  3. Select a configuration (Release or Debug) and build the DLL.

To build the PortStateObserver example on Linux

  1. In a shell (tcsh) window, type:

    source $XSI_HOME/.xsi_<xsi_version>
    
  2. Change directories to

    cppsrc_port_state_observer
    
  3. To remove all intermediate files before building the example, run this command:

    gmake clean
    
  4. To compile the example, run this command:

    gmake
    

To build the RandomGridGenerator example on Windows

  1. Open an XSI command prompt, and type devenv to start Visual Studio .NET.

    Starting Visual Studio .NET from an XSI command prompt ensures that environment variables such as XSISDK_ROOT are set (otherwise you'll get build and link errors).

    Tip To load the RandomGridGenerator project from the command line, type:

    devenv cppsrc_randomgridgenerator\RandomGridGenerator.vcproj
    
  2. In Visual Studio .NET, open the project file .vcproj.
  3. Select a configuration (Release or Debug) and build the DLL.

To build the RandomGridGenerator example on Linux

  1. In a shell (tcsh) window, type:

    source $XSI_HOME/.xsi_<xsi_version>
    
  2. Change directories to

    cppsrc_randomgridgenerator
    
  3. To remove all intermediate files before building the example, run this command:

    gmake clean
    
  4. To compile the example, run this command:

    gmake
    

To build the Vector3Union example on Windows

  1. Open a Softimage command prompt, and type devenv to start Visual Studio .NET.

    Starting Visual Studio .NET from a Softimage command prompt ensures that environment variables such as XSISDK_ROOT are set (otherwise you'll get build and link errors).

    Tip To load the Vector3Union project from the command line, type:

    devenv cppsrc_vector3_union\Vector3Union.vcproj
    
  2. In Visual Studio .NET, open the project file .vcproj.
  3. Select a configuration (Release or Debug) and build the DLL.

To build the Vector3Union example on Linux

  1. In a shell (tcsh) window, type:

    source $XSI_HOME/.xsi_<xsi_version>
    
  2. Change directories to

    cppsrc_vector3_union
    
  3. To remove all intermediate files before building the example, run this command:

    gmake clean
    
  4. To compile the example, run this command:

    gmake
    

To build the YPosFilter example on Windows

  1. Open a Softimage command prompt, and type devenv to start Visual Studio .NET.

    Starting Visual Studio .NET from a Softimage command prompt ensures that environment variables such as XSISDK_ROOT are set (otherwise you'll get build and link errors).

    Tip To load the YPosFilter project from the command line, type:

    devenv cppsrc_yposfilter\YPosFilter.vcproj
    
  2. In Visual Studio .NET, open the project file .vcproj.
  3. Select a configuration (Release or Debug) and build the DLL.

To build the YPosFilter example on Linux

  1. In a shell (tcsh) window, type:

    source $XSI_HOME/.xsi_<xsi_version>
    
  2. Change directories to

    cppsrc_yposfilter
    
  3. To remove all intermediate files before building the example, run this command:

    gmake clean
    
  4. To compile the example, run this command:

    gmake
    

Keywords

This example uses the following keywords:

ICENode ICENodeContext C++