Shape

Object Hierarchy | Related C++ Class: CShape

Introduced

v7.0

Description

The Shape class represents primitive types for particle rendering. Shape objects are read-only and can be accessed with ICEAttribute properties such as ICEAttribute.DataArray.

Methods

IsEqual      
       

Properties

BranchSelected ReferenceID Type  
       

Examples

Python Example

#
# This example shows how to access the shape attribute data on a point cloud geometry.
#
from win32com.client import constants
xsi = Application
xsi.NewScene( )
# Create a graph test
grid = xsi.CreatePrim("Grid", "PointCloud", "", "")
xsi.ApplyOp("ICETree", "grid", "siNode", "", "", 0)
xsi.AddICENode("SetData", "grid.pointcloud.ICETree")
xsi.SetValue("grid.pointcloud.ICETree.SetData.PredefinedAttributeName", "Shape", "")
xsi.AddAttributeToSetDataICENode("grid.pointcloud.ICETree.SetData", "Shape", 32768, "siComponentDataContextComponent0D", "siComponentDataStructureSingle")
xsi.SetValue("grid.pointcloud.ICETree.SetData.shape", 5, "")
xsi.ConnectICENodes("grid.pointcloud.ICETree.port1", "grid.pointcloud.ICETree.SetData.set")
xsi.AddICENode("InstanceShapeNode.Preset", "grid.pointcloud.ICETree")
xsi.GetPresetModel("Man_Face", "Man_Face", "", "Face_Maker")
xsi.SetValue("grid.pointcloud.ICETree.ShapeInstancingNode.HierarchyMode", 1, "")
xsi.SetValue("grid.pointcloud.ICETree.ShapeInstancingNode.Reference", "Man_Face.Basic_Face", "")
xsi.ConnectICENodes("grid.pointcloud.ICETree.SetData.shape", "grid.pointcloud.ICETree.ShapeInstancingNode.shape")
# Iterate over the shape data
attrs = grid.ActivePrimitive.Geometry.ICEAttributes;
for attr in attrs:
	xsi.LogMessage( "***********************************************************" )
	xsi.LogMessage( "Name: " + attr.Name )
	xsi.LogMessage( "DataType: " + str(attr.DataType) )
	xsi.LogMessage( "StructType: " + str(attr.StructureType) )
	xsi.LogMessage( "ContextType: " + str(attr.ContextType) )
	xsi.LogMessage( "IsDefined: " + str(attr.IsDefined) )	
	xsi.LogMessage( "IsConstant: " + str(attr.IsConstant) )	
	xsi.LogMessage( "Readonly: " + str(attr.IsReadonly) )
	xsi.LogMessage( "Category: " + str(attr.AttributeCategory) )
	xsi.LogMessage( "Element count: " + str(attr.ElementCount) )	
	if attr.IsDefined == 0:
		continue
	dataType = attr.DataType;
	data = attr.DataArray;
	for elem in data:
		if dataType == constants.siICENodeDataShape:
			xsi.LogMessage( "Shape Type:" + str(elem.Type) + ", Reference ID:" + str(elem.ReferenceID) + ", Branch selected:" + str(elem.BranchSelected) )

See Also

Geometry.ICEAttributes ProjectItem.ICEAttributes