HDK
|
A rig for the agent primitive. More...
#include <GU_AgentRig.h>
Classes | |
class | const_iterator |
Public Types | |
typedef UT_StringMap< exint > | NameMapType |
typedef NameMapType::const_iterator | NameMapConstIter |
typedef NameMapType::iterator | NameMapIter |
typedef fpreal32 | FloatType |
typedef GU_AgentXformT< FloatType > | Xform |
typedef UT_Matrix4T< FloatType > | Matrix4 |
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_StringHolder & | transformName (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_IntArray & | roots () 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 Xform & | restLocalTransform (exint i) const |
Returns the rest local transform for the specified joint. More... | |
const Matrix4 & | restWorldTransform (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_StringHolder & | channelName (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_StringHolder & | name () 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_IntrusiveRefCounter & | operator= (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... | |
A rig for the agent primitive.
Definition at line 38 of file GU_AgentRig.h.
typedef fpreal32 GU_AgentRig::FloatType |
Definition at line 44 of file GU_AgentRig.h.
typedef UT_Matrix4T<FloatType> GU_AgentRig::Matrix4 |
Definition at line 46 of file GU_AgentRig.h.
Definition at line 42 of file GU_AgentRig.h.
Definition at line 43 of file GU_AgentRig.h.
typedef UT_StringMap<exint> GU_AgentRig::NameMapType |
Definition at line 41 of file GU_AgentRig.h.
typedef GU_AgentXformT<FloatType> GU_AgentRig::Xform |
Definition at line 45 of file GU_AgentRig.h.
GU_AgentRig::~GU_AgentRig | ( | ) |
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 |
|
static |
Creates a copy of the rig. The copy will not be marked as an external reference.
|
static |
|
inline |
Returns the number of channels.
Definition at line 215 of file GU_AgentRig.h.
|
inline |
Returns the default value of the specified channel.
Definition at line 275 of file GU_AgentRig.h.
|
inline |
Returns the name of the specified channel.
Definition at line 217 of file GU_AgentRig.h.
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.
Return the number of children for the given transform.
Definition at line 110 of file GU_AgentRig.h.
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
arraychildren:
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.
|
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.
|
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 |
|
inline |
Unique ID of the rig.
Definition at line 78 of file GU_AgentRig.h.
|
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.
|
inline |
The name of the rig (or filename, if loaded from disk).
Definition at line 82 of file GU_AgentRig.h.
Return the parent of the given transform (or -1 for the root)
Definition at line 107 of file GU_AgentRig.h.
Returns the rest local transform for the specified joint.
Definition at line 128 of file GU_AgentRig.h.
Returns the rest world transform for the specified joint.
Definition at line 131 of file GU_AgentRig.h.
|
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.
|
inline |
The name of the rig (or filename, if loaded from disk).
Definition at line 84 of file GU_AgentRig.h.
Updates the rest transforms for the rig (in local space).
|
inline |
Return number of transforms.
Definition at line 101 of file GU_AgentRig.h.
|
inline |
Return the name of the given transform.
Definition at line 104 of file GU_AgentRig.h.