HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GU_AgentRig Class Reference

A rig for the agent primitive. More...

#include <GU_AgentRig.h>

+ Inheritance diagram for GU_AgentRig:

Classes

class  const_iterator
 

Public Types

typedef UT_StringMap< exintNameMapType
 
typedef NameMapType::const_iterator NameMapConstIter
 
typedef NameMapType::iterator NameMapIter
 
typedef fpreal32 FloatType
 

Public Member Functions

 ~GU_AgentRig ()
 
bool construct (const UT_StringArray &names, const UT_IntArray &child_counts, const UT_IntArray &children)
 
int64 getMemoryUsage (bool inclusive) const
 
- Public Member Functions inherited from UT_IntrusiveRefCounter< GU_AgentRig >
SYS_FORCE_INLINE UT_IntrusiveRefCounter ()
 Default constructor: Sets counter to 0. More...
 
SYS_FORCE_INLINE UT_IntrusiveRefCounter (const UT_IntrusiveRefCounter &)
 Copy constructor: Sets counter to 0. More...
 
UT_IntrusiveRefCounteroperator= (const UT_IntrusiveRefCounter &)
 Assignment operator: Does not modify counter. More...
 
SYS_FORCE_INLINE uint32 use_count () const
 Return current counter. More...
 

Static Public Member Functions

static GU_AgentRigPtr addRig (const UT_StringHolder &name)
 
static GU_AgentRigPtr addRigFromFile (const UT_StringHolder &filename, UT_StringArray &errors)
 
static GU_AgentRigPtr addRigCopy (const GU_AgentRig &src)
 
const UT_StringHoldername () const
 
void setName (const UT_StringHolder &name)
 
bool isFile () const
 Return whether the rig was loaded from disk. More...
 
void clearIsFile ()
 Clear the flag marking that the rig references a file on disk. More...
 
void clear ()
 Clear the rig. More...
 
bool checkValid () const
 Check validity of rig. More...
 
exint transformCount () const
 Return number of transforms. More...
 
const UT_StringHoldertransformName (exint i) const
 Return the name of the given transform. More...
 
exint parentIndex (exint i) const
 Return the parent of the given transform (or -1 for the root) More...
 
exint childCount (exint i) const
 Return the number of children for the given transform. More...
 
exint childIndex (exint transform, exint child) const
 Return the Nth child for the given transform. More...
 
const UT_IntArrayroots () const
 Return the root transform(s) of the rig. More...
 
exint findTransform (const UT_StringRef &name) const
 Find a transform by name. Returns -1 for an invalid name. More...
 
bool save (UT_JSONWriter &w) const
 Save a rig. More...
 
bool load (UT_JSONParser &p, UT_StringArray &errors)
 Load a rig. More...
 
void dump () const
 Dump to stdout for debugging. More...
 
bool addChannels (const UT_StringArray &names, const UT_Array< FloatType > &default_values, const UT_IntArray &transforms, UT_StringArray &errors)
 
void addChannel (const UT_StringHolder &name, FloatType default_value, exint xform_idx)
 Adds or replaces a channel in the rig. More...
 
exint channelCount () const
 Returns the number of channels. More...
 
const UT_StringHolderchannelName (exint i) const
 Returns the name of the specified channel. More...
 
FloatType channelDefaultValue (exint i) const
 Returns the default value of the specified channel. More...
 
exint channelTransform (exint i) const
 Returns the transform index associated with the channel, or -1. More...
 
exint findChannel (const UT_StringRef &name) const
 

Additional Inherited Members

- Protected Member Functions inherited from UT_IntrusiveRefCounter< GU_AgentRig >
SYS_FORCE_INLINE ~UT_IntrusiveRefCounter ()
 Destructor: Only derived classes can destruct this. More...
 

Detailed Description

A rig for the agent primitive.

Examples:
SOP/SOP_BouncyAgent.C.

Definition at line 34 of file GU_AgentRig.h.

Member Typedef Documentation

Definition at line 40 of file GU_AgentRig.h.

Definition at line 39 of file GU_AgentRig.h.

Definition at line 37 of file GU_AgentRig.h.

Constructor & Destructor Documentation

GU_AgentRig::~GU_AgentRig ( )

Member Function Documentation

void GU_AgentRig::addChannel ( const UT_StringHolder name,
FloatType  default_value,
exint  xform_idx 
)

Adds or replaces a channel in the rig.

bool GU_AgentRig::addChannels ( const UT_StringArray names,
const UT_Array< FloatType > &  default_values,
const UT_IntArray transforms,
UT_StringArray errors 
)

Adds a list of channels to the rig. Agents can store a list of values for these channels (e.g. for driving blendshapes), and these channels can be sampled from any GU_AgentClip.

static GU_AgentRigPtr GU_AgentRig::addRig ( const UT_StringHolder name)
static
static GU_AgentRigPtr GU_AgentRig::addRigCopy ( const GU_AgentRig src)
static

Creates a copy of the rig. The copy will not be marked as an external reference.

static GU_AgentRigPtr GU_AgentRig::addRigFromFile ( const UT_StringHolder filename,
UT_StringArray errors 
)
static
exint GU_AgentRig::channelCount ( ) const
inline

Returns the number of channels.

Definition at line 201 of file GU_AgentRig.h.

GU_AgentRig::FloatType GU_AgentRig::channelDefaultValue ( exint  i) const
inline

Returns the default value of the specified channel.

Definition at line 256 of file GU_AgentRig.h.

const UT_StringHolder& GU_AgentRig::channelName ( exint  i) const
inline

Returns the name of the specified channel.

Definition at line 203 of file GU_AgentRig.h.

exint GU_AgentRig::channelTransform ( exint  i) const
inline

Returns the transform index associated with the channel, or -1.

Definition at line 262 of file GU_AgentRig.h.

bool GU_AgentRig::checkValid ( ) const

Check validity of rig.

exint GU_AgentRig::childCount ( exint  i) const
inline

Return the number of children for the given transform.

Definition at line 105 of file GU_AgentRig.h.

exint GU_AgentRig::childIndex ( exint  transform,
exint  child 
) const
inline

Return the Nth child for the given transform.

Definition at line 110 of file GU_AgentRig.h.

void GU_AgentRig::clear ( )

Clear the rig.

void GU_AgentRig::clearIsFile ( )

Clear the flag marking that the rig references a file on disk.

bool GU_AgentRig::construct ( const UT_StringArray names,
const UT_IntArray child_counts,
const UT_IntArray children 
)

Construct using flat arrays.

  • names: The array of names for each transform (one per transform)
  • child_counts: An array of child counts for each transform Should have the same number of entries as the names array
  • children: An array of children. This is the concatenation of all the child indices for each transform. There should be sum(child_counts) entries in this array.
void GU_AgentRig::dump ( ) const

Dump to stdout for debugging.

exint GU_AgentRig::findChannel ( const UT_StringRef name) const
inline

Returns the index of the channel with the specified name, or -1 if it does not exist.

Definition at line 249 of file GU_AgentRig.h.

exint GU_AgentRig::findTransform ( const UT_StringRef name) const
inline

Find a transform by name. Returns -1 for an invalid name.

Definition at line 240 of file GU_AgentRig.h.

int64 GU_AgentRig::getMemoryUsage ( bool  inclusive) const
bool GU_AgentRig::isFile ( ) const
inline

Return whether the rig was loaded from disk.

Definition at line 84 of file GU_AgentRig.h.

bool GU_AgentRig::load ( UT_JSONParser p,
UT_StringArray errors 
)

Load a rig.

const UT_StringHolder& GU_AgentRig::name ( void  ) const
inline

The name of the rig (or filename, if loaded from disk).

Definition at line 77 of file GU_AgentRig.h.

exint GU_AgentRig::parentIndex ( exint  i) const
inline

Return the parent of the given transform (or -1 for the root)

Definition at line 102 of file GU_AgentRig.h.

const UT_IntArray& GU_AgentRig::roots ( ) const
inline

Return the root transform(s) of the rig.

Definition at line 116 of file GU_AgentRig.h.

bool GU_AgentRig::save ( UT_JSONWriter w) const

Save a rig.

void GU_AgentRig::setName ( const UT_StringHolder name)
inline

The name of the rig (or filename, if loaded from disk).

Definition at line 79 of file GU_AgentRig.h.

exint GU_AgentRig::transformCount ( ) const
inline

Return number of transforms.

Definition at line 96 of file GU_AgentRig.h.

const UT_StringHolder& GU_AgentRig::transformName ( exint  i) const
inline

Return the name of the given transform.

Examples:
SOP/SOP_BouncyAgent.C.

Definition at line 99 of file GU_AgentRig.h.


The documentation for this class was generated from the following file: