This class represents the primitive of an X3DObject used for simulating hair in Softimage and can be accessed with X3DObject::GetActivePrimitive.
HairPrimitive provides access to the CRenderHairAccessor object which allows you to extract the render hair data from the primitive.
using namespace XSI; Application app; Model root = app.GetActiveSceneRoot(); X3DObject myCube; root.AddGeometry( L"Cube", L"MeshSurface",L"myCube",myCube); CValueArray args(1); CValue outArg; args[0] = myCube; app.ExecuteCommand( L"ApplyHairOp", args, outArg ) ; X3DObject myHair = myCube.FindChild( L"Hair", L"", CStringArray() ); HairPrimitive myHairPrim = myHair.GetActivePrimitive(); bool bHair = myHairPrim.IsValid() && myHairPrim.IsA( siHairPrimitiveID ) == true; app.LogMessage( L"Found Hair object: " + CValue(bHair).GetAsTest() );
#include <xsi_hairprimitive.h>
Public Member Functions |
|
HairPrimitive () | |
~HairPrimitive () | |
HairPrimitive (const CRef &in_ref) | |
HairPrimitive (const HairPrimitive &in_obj) | |
bool | IsA (siClassID in_ClassID) const |
siClassID | GetClassID () const |
HairPrimitive & | operator= (const HairPrimitive &in_obj) |
HairPrimitive & | operator= (const CRef &in_ref) |
CRenderHairAccessor | GetRenderHairAccessor (LONG in_nRequestedHairCount, LONG in_nChunksize=10000, double in_time=DBL_MAX) const |
HairPrimitive | ( | ) |
Default constructor.
~HairPrimitive | ( | ) |
Default destructor.
HairPrimitive | ( | const CRef & | in_ref | ) |
Constructor.
in_ref | constant reference object. |
HairPrimitive | ( | const HairPrimitive & | 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 Primitive.
siClassID GetClassID | ( | ) | const [virtual] |
HairPrimitive& operator= | ( | const HairPrimitive & | in_obj | ) |
Creates an object from another object. The newly created object is set to empty if the input object is not compatible.
in_obj | constant class object. |
HairPrimitive& 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 Primitive.
CRenderHairAccessor GetRenderHairAccessor | ( | LONG | in_nRequestedHairCount, |
LONG | in_nChunksize =
10000 , |
||
double | in_time =
DBL_MAX |
||
) | const |
Returns a render hair accessor for this primitive. The render hair accessor generates a renderable representation of a groomed hair primitive. The render hair is iterated over in chunks, rather than all at once, to avoid problems with excessive memory consumption.
in_nRequestedHairCount | Maximum number of hairs desired. The actual number can be less depending on cut and density map settings. |
in_nChunksize | Number of hairs to generate on each iteration. By default the chunk size is set to 10000. |
in_time | Time (in frames) at which to get the accessor. The default value is DBL_MAX which means the current time in frames. |