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

#include <GU_MotionClip.h>

+ Inheritance diagram for GU_MotionClipRO:

Classes

struct  EvaluationParms
 

Public Member Functions

 GU_MotionClipRO (const GU_Detail *gdp, UT_WorkBuffer &err_msg, bool can_evaluate=true, GU_MotionClipInfo *clipinfo=nullptr, bool compute_default_clipinfo=false, bool do_sort_samples=true, bool enable_locking=true)
 clipinfo will override the gdp's clipinfo detail attribute More...
 
virtual ~GU_MotionClipRO ()=default
 
virtual bool updateGdp (const GU_Detail *gdp)
 
void getTopology (fpreal &time, GU_Detail *dest, const GA_AttributeFilter *skip=nullptr)
 
bool hasTopology () const
 
void evaluate (fpreal time, GU_Detail *result, const GA_PointGroup *result_pts=nullptr, const GA_PointGroup *topology_pts=nullptr, const GA_AttributeFilter *extra_attribs_to_unpack=nullptr, GU_MotionClipEndBehavior left_end_behavior=GU_MotionClipEndBehavior::Clamp, GU_MotionClipEndBehavior right_end_behavior=GU_MotionClipEndBehavior::Clamp)
 
void evaluate (fpreal time, GU_Detail *result, const EvaluationParms &evaluation_parms, const GA_PointGroup *result_pts=nullptr, const GA_PointGroup *topology_pts=nullptr, UT_ArrayStringMap< bool > *is_anim_point_attrib=nullptr)
 
void evaluateNoLock (fpreal time, GU_Detail *result, const EvaluationParms &evaluation_parms, const GA_PointGroup *result_pts=nullptr, const GA_PointGroup *topology_pts=nullptr, UT_ArrayStringMap< bool > *is_anim_point_attrib=nullptr)
 
void setScaleInheritance (UT_ScaleInheritanceMode scale_inheritance)
 
void computeLocalTransforms (fpreal time, UT_Array< GU_AgentXformD > &result, bool constant_evaluation=false)
 
exint getJointIndex (const UT_StringHolder &joint_name) const
 
const GA_PointGroupgetJointGroup (GOP_Manager &gop, const UT_StringHolder &pattern) const
 
void getJointsInGroup (GOP_Manager &gop, const UT_StringHolder &pattern, UT_StringArray &joints_in_group) const
 
bool isInitialised () const
 
exint numJoints () const
 
const GU_MotionClipInfoclipInfo () const
 
const GU_DetailgetSample (fpreal time) const
 returns the sample at time, or nullptr if not found More...
 
const GU_DetailrestFrame () const
 
void getSortedFrameOrder (UT_Array< exint > &frame_order)
 
const UT_Array< fpreal > & getSampleTimes ()
 
bool canEvaluate () const
 

Protected Member Functions

void sortPrimitives (GU_Detail *gdp, bool clear_array)
 

Protected Attributes

const GU_DetailourGdp
 
GU_MotionClipDataIds ourDataIds
 

Friends

class GU_MotionClipRW
 
class GU_MotionClipBuilder
 

Detailed Description

Read-only animation clip represented in geometry as packed primitives.

The first packed geometry primitive contains the skeleton "topology" evaluated at the given rest frame and the remaining packed geometry primitives each represent a cached pose (ie. a KineFX skeleton), each containing a list of points with joint names and transforms. For each pose, the time primitive attribute represents where it should be in seconds.

Note that the joints in the pose packed primitives must exist in the topology packed primitive, but the converse is not necessarily true. The pose packed primitive may be missing particular joints from the topology packed primitive, in which case, interpolation will be done using adjacent pose packed primitives which do have data for the particular joint.

Definition at line 55 of file GU_MotionClip.h.

Constructor & Destructor Documentation

GU_MotionClipRO::GU_MotionClipRO ( const GU_Detail gdp,
UT_WorkBuffer err_msg,
bool  can_evaluate = true,
GU_MotionClipInfo clipinfo = nullptr,
bool  compute_default_clipinfo = false,
bool  do_sort_samples = true,
bool  enable_locking = true 
)

clipinfo will override the gdp's clipinfo detail attribute

virtual GU_MotionClipRO::~GU_MotionClipRO ( )
virtualdefault

Member Function Documentation

bool GU_MotionClipRO::canEvaluate ( ) const
inline

Definition at line 344 of file GU_MotionClip.h.

const GU_MotionClipInfo& GU_MotionClipRO::clipInfo ( ) const
inline

Definition at line 332 of file GU_MotionClip.h.

void GU_MotionClipRO::computeLocalTransforms ( fpreal  time,
UT_Array< GU_AgentXformD > &  result,
bool  constant_evaluation = false 
)
inline

This computes the local transforms of each joint at the given time. The ith element defines represents the ith joint in the topology detail. getJointIndex can be used to check this

Definition at line 289 of file GU_MotionClip.h.

void GU_MotionClipRO::evaluate ( fpreal  time,
GU_Detail result,
const GA_PointGroup result_pts = nullptr,
const GA_PointGroup topology_pts = nullptr,
const GA_AttributeFilter extra_attribs_to_unpack = nullptr,
GU_MotionClipEndBehavior  left_end_behavior = GU_MotionClipEndBehavior::Clamp,
GU_MotionClipEndBehavior  right_end_behavior = GU_MotionClipEndBehavior::Clamp 
)
inline

This will compute the frame at the given time, and then copy the P+transform attributes of the ith point in topologyPts into the ith point in resultPts.

It will also include whatever extra attribs you request as long as there is no current active GU_MotionClipBuilder

Precondition
resultPts and topologyPts must correspond to the same points in their respective geometries, in the same order.

Definition at line 166 of file GU_MotionClip.h.

void GU_MotionClipRO::evaluate ( fpreal  time,
GU_Detail result,
const EvaluationParms evaluation_parms,
const GA_PointGroup result_pts = nullptr,
const GA_PointGroup topology_pts = nullptr,
UT_ArrayStringMap< bool > *  is_anim_point_attrib = nullptr 
)
inline

This will compute the frame at the given time, and then copy the P+transform attributes of the ith point in topologyPts into the ith point in resultPts.

It will also include whatever extra attribs you request as long as there is no current active GU_MotionClipBuilder

The parameters used to define the interpolation must be set by in an EvaluationParms structure.

Precondition
resultPts and topologyPts must correspond to the same points in their respective geometries, in the same order.
is_anim_point_attribs returns whether each the requested point attribute exists on the animated poses. An entry must already exist for each attribtue in question.

Definition at line 207 of file GU_MotionClip.h.

void GU_MotionClipRO::evaluateNoLock ( fpreal  time,
GU_Detail result,
const EvaluationParms evaluation_parms,
const GA_PointGroup result_pts = nullptr,
const GA_PointGroup topology_pts = nullptr,
UT_ArrayStringMap< bool > *  is_anim_point_attrib = nullptr 
)
inline

Definition at line 241 of file GU_MotionClip.h.

const GA_PointGroup* GU_MotionClipRO::getJointGroup ( GOP_Manager gop,
const UT_StringHolder pattern 
) const

Returns a point group of the topology detail based on the given pattern

exint GU_MotionClipRO::getJointIndex ( const UT_StringHolder joint_name) const
inline

Returns the index of the given joint name within the topology detail

Definition at line 305 of file GU_MotionClip.h.

void GU_MotionClipRO::getJointsInGroup ( GOP_Manager gop,
const UT_StringHolder pattern,
UT_StringArray joints_in_group 
) const
const GU_Detail* GU_MotionClipRO::getSample ( fpreal  time) const

returns the sample at time, or nullptr if not found

const UT_Array<fpreal>& GU_MotionClipRO::getSampleTimes ( )
inline

Definition at line 340 of file GU_MotionClip.h.

void GU_MotionClipRO::getSortedFrameOrder ( UT_Array< exint > &  frame_order)
void GU_MotionClipRO::getTopology ( fpreal time,
GU_Detail dest,
const GA_AttributeFilter skip = nullptr 
)

Appends the unpacked toplogy geometry to dest

bool GU_MotionClipRO::hasTopology ( ) const
inline

Definition at line 154 of file GU_MotionClip.h.

bool GU_MotionClipRO::isInitialised ( ) const
inline

returns false if there was an error during initialization

Definition at line 322 of file GU_MotionClip.h.

exint GU_MotionClipRO::numJoints ( ) const
inline

Definition at line 327 of file GU_MotionClip.h.

const GU_Detail* GU_MotionClipRO::restFrame ( ) const
inline

Definition at line 336 of file GU_MotionClip.h.

void GU_MotionClipRO::setScaleInheritance ( UT_ScaleInheritanceMode  scale_inheritance)
inline

Definition at line 280 of file GU_MotionClip.h.

void GU_MotionClipRO::sortPrimitives ( GU_Detail gdp,
bool  clear_array 
)
protected
virtual bool GU_MotionClipRO::updateGdp ( const GU_Detail gdp)
virtual

Reimplemented in GU_MotionClipRW.

Friends And Related Function Documentation

friend class GU_MotionClipBuilder
friend

Definition at line 360 of file GU_MotionClip.h.

friend class GU_MotionClipRW
friend

Definition at line 359 of file GU_MotionClip.h.

Member Data Documentation

GU_MotionClipDataIds GU_MotionClipRO::ourDataIds
protected

Definition at line 354 of file GU_MotionClip.h.

const GU_Detail* GU_MotionClipRO::ourGdp
protected

Definition at line 349 of file GU_MotionClip.h.


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