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
 
typedef GU_AgentXformT< FloatTypeXform
 
typedef UT_Matrix4T< FloatTypeMatrix4
 

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
 
exint getUniqueId () const
 Unique ID of the rig. More...
 
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...
 
const XformrestLocalTransform (exint i) const
 Returns the rest local transform for the specified joint. More...
 
const Matrix4restWorldTransform (exint i) const
 Returns the rest world transform for the specified joint. More...
 
bool setRestLocalTransforms (const UT_Array< Xform > &xforms)
 Updates the rest transforms for the rig (in local space). 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
 
const UT_StringHoldername () const
 
void setName (const UT_StringHolder &name)
 
- Public Member Functions inherited from UT_IntrusiveRefCounter< GU_AgentRig >
SYS_FORCE_INLINE UT_IntrusiveRefCounter () noexcept
 Default constructor: Sets counter to 0. More...
 
SYS_FORCE_INLINE UT_IntrusiveRefCounter (const UT_IntrusiveRefCounter &) noexcept
 Copy constructor: Sets counter to 0. More...
 
UT_IntrusiveRefCounteroperator= (const UT_IntrusiveRefCounter &) noexcept
 Assignment operator: Does not modify counter. More...
 
SYS_FORCE_INLINE uint32 use_count () const noexcept
 Return current counter. More...
 
SYS_FORCE_INLINE bool conditionalAddRef () noexcept
 

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)
 

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 38 of file GU_AgentRig.h.

Member Typedef Documentation

Definition at line 44 of file GU_AgentRig.h.

Definition at line 46 of file GU_AgentRig.h.

Definition at line 43 of file GU_AgentRig.h.

Definition at line 41 of file GU_AgentRig.h.

Definition at line 45 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 215 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 275 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 217 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 281 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 110 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 115 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 268 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 259 of file GU_AgentRig.h.

int64 GU_AgentRig::getMemoryUsage ( bool  inclusive) const
exint GU_AgentRig::getUniqueId ( ) const
inline

Unique ID of the rig.

Definition at line 78 of file GU_AgentRig.h.

bool GU_AgentRig::isFile ( ) const
inline

Return whether the rig was loaded from disk.

Definition at line 89 of file GU_AgentRig.h.

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

Load a rig.

const UT_StringHolder& GU_AgentRig::name ( ) const
inline

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

Definition at line 82 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 107 of file GU_AgentRig.h.

const Xform& GU_AgentRig::restLocalTransform ( exint  i) const
inline

Returns the rest local transform for the specified joint.

Definition at line 128 of file GU_AgentRig.h.

const Matrix4& GU_AgentRig::restWorldTransform ( exint  i) const
inline

Returns the rest world transform for the specified joint.

Definition at line 131 of file GU_AgentRig.h.

const UT_IntArray& GU_AgentRig::roots ( ) const
inline

Return the root transform(s) of the rig.

Definition at line 121 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 84 of file GU_AgentRig.h.

bool GU_AgentRig::setRestLocalTransforms ( const UT_Array< Xform > &  xforms)

Updates the rest transforms for the rig (in local space).

exint GU_AgentRig::transformCount ( ) const
inline

Return number of transforms.

Definition at line 101 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 104 of file GU_AgentRig.h.


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