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

#include <APEXA_SceneInvoke.h>

Classes

struct  Output
 

Public Member Functions

 APEXA_SceneInvoke (bool reuse_cached_scene=false)
 
 ~APEXA_SceneInvoke ()
 
 UT_NON_COPYABLE (APEXA_SceneInvoke)
 
bool updateSourceGeometry (const GU_Detail &detail, UT_StringHolder &error, bool preload_animation_clips=false)
 
void clearOutputs ()
 Clear the outputs. More...
 
const UT_Array< Output > & getOutputs () const
 Returns the registered outputs, with their evaluated results if evaluateOutput() has been called. More...
 
exint addOutput (const UT_StringHolder &path, const UT_Optional< UT_StringHolder > &key, bool copies_geo=false, bool track_output=false)
 
void addCharacterShapeOutputs (bool track_outputs=false)
 
UT_Array< OutputfindCharacterShapeOutputs (bool include_invisible_chars=false) const
 
UT_Array< OutputfindCharacterGeometryOutputs (const UT_StringHolder &output_name, bool include_invisible_chars=false) const
 
UT_StringArray findOutputPaths () const
 
bool findSkinningInputsForShape (const Output &deform_shape_output, Output &rest_shape_output, Output &rest_skel_output, Output &anim_skel_output) const
 
bool findAnimSkelInputForShape (const Output &deform_shape_output, Output &anim_skel_output) const
 
void updateEvaluationTime (apex::Float frame, bool evaluate_tracked_ouputs=true)
 
bool evaluateOutput (exint output_idx, UT_StringHolder &error)
 Evaluate the specified output at the scene's current time. Returns false if any errors occurred. More...
 
bool setActiveClip (const UT_StringHolder &clip_path, UT_StringHolder &error)
 
UT_StringHolder getActiveClipPath () const
 Returns the resolved active clip path on the scene. More...
 
UT_StringArray getClipPaths () const
 Returns a list of the available clips in the scene. More...
 
bool setCharacterGeoInput (const UT_StringHolder &character_path, const UT_StringHolder &geo_name, const GU_ConstDetailHandle &geo)
 
void setAnimationCachingMode (APEXA_AnimationCachingMode mode)
 Sets the animation cache mode. More...
 
APEXA_AnimationCachingMode animationCachingMode () const
 Returns the animation caching mode. More...
 
APEXA_Scene * getScene ()
 

Static Public Member Functions

static bool isCharacterSceneItemName (const UT_StringRef &name)
 
static bool hasAnimation (const GU_ConstDetailHandle &scene_gdh)
 

Detailed Description

Definition at line 26 of file APEXA_SceneInvoke.h.

Constructor & Destructor Documentation

APEXA_SceneInvoke::APEXA_SceneInvoke ( bool  reuse_cached_scene = false)
APEXA_SceneInvoke::~APEXA_SceneInvoke ( )

Member Function Documentation

void APEXA_SceneInvoke::addCharacterShapeOutputs ( bool  track_outputs = false)

Adds the default output shapes for each character to the list of outputs that can be evaluated.

Parameters
track_outputsIf true, all character shape outputs will be tracked and can be evaluated in parallel.
exint APEXA_SceneInvoke::addOutput ( const UT_StringHolder path,
const UT_Optional< UT_StringHolder > &  key,
bool  copies_geo = false,
bool  track_output = false 
)

Registers a specific output for evaluation, and returns its index into getOutputs().

Parameters
copies_geoIf enabled, a replaceWith call will be run the copies any geometries out of the scene instead of grabbing the detail handle. This can improve the efficiency of the APEX graph when the output geometry receives preserve requests.
track_outputIf enabled, the output will be tracked and can be evaluated in parallel.
APEXA_AnimationCachingMode APEXA_SceneInvoke::animationCachingMode ( ) const
inline

Returns the animation caching mode.

Definition at line 166 of file APEXA_SceneInvoke.h.

void APEXA_SceneInvoke::clearOutputs ( )

Clear the outputs.

bool APEXA_SceneInvoke::evaluateOutput ( exint  output_idx,
UT_StringHolder error 
)

Evaluate the specified output at the scene's current time. Returns false if any errors occurred.

bool APEXA_SceneInvoke::findAnimSkelInputForShape ( const Output deform_shape_output,
Output anim_skel_output 
) const

Analyzes the graph to determine if the output shape is only deformed by a bonedeform SOP. If successful, returns the path for the animated skeleton. This can succeed even when the rest_skel and rest_shape aren't connected directly to an input from the bonedeform.

UT_Array<Output> APEXA_SceneInvoke::findCharacterGeometryOutputs ( const UT_StringHolder output_name,
bool  include_invisible_chars = false 
) const

Returns the named geometry outputs for each character.

Parameters
output_name
include_invisible_charsIf enabled, includes characters which are currently hidden in the selection sets.
UT_Array<Output> APEXA_SceneInvoke::findCharacterShapeOutputs ( bool  include_invisible_chars = false) const

Returns the default output shapes for each character. This can be used instead of addCharacterShapeOutputs() if additional processing / validation is needed before registering outputs.

Parameters
include_invisible_charsIf enabled, includes characters which are currently hidden in the selection sets.
UT_StringArray APEXA_SceneInvoke::findOutputPaths ( ) const

Returns a list of the available output paths in the scene, e.g. /electra.char/Base.rig/output

bool APEXA_SceneInvoke::findSkinningInputsForShape ( const Output deform_shape_output,
Output rest_shape_output,
Output rest_skel_output,
Output anim_skel_output 
) const

Analyzes the graph to determine if the output shape is only deformed by a bonedeform SOP. If successful, returns the paths which should be evaluated to obtain the rest geometry, rest skeleton, and animated skeleton. This assumes that the rest_shape and rest_skel are connected directly to an input from the bonedeform.

UT_StringHolder APEXA_SceneInvoke::getActiveClipPath ( ) const

Returns the resolved active clip path on the scene.

UT_StringArray APEXA_SceneInvoke::getClipPaths ( ) const

Returns a list of the available clips in the scene.

const UT_Array<Output>& APEXA_SceneInvoke::getOutputs ( ) const
inline

Returns the registered outputs, with their evaluated results if evaluateOutput() has been called.

Definition at line 75 of file APEXA_SceneInvoke.h.

APEXA_Scene* APEXA_SceneInvoke::getScene ( )
inline

Definition at line 168 of file APEXA_SceneInvoke.h.

static bool APEXA_SceneInvoke::hasAnimation ( const GU_ConstDetailHandle scene_gdh)
static

Returns whether there are any channel primitives in the scene. This can be used to only load / evaluate the scene when animation is present.

static bool APEXA_SceneInvoke::isCharacterSceneItemName ( const UT_StringRef name)
static

Returns whether the name of a packed primitive is likely an item in a packed character scene, e.g. "*.char" This can be used to identify geometry that should be interpreted as a character scene.

bool APEXA_SceneInvoke::setActiveClip ( const UT_StringHolder clip_path,
UT_StringHolder error 
)

Set the active animation clip.

Parameters
clip_pathPath to the clip to activate or empty string to use the default one from the scene..
errorOutputs any error messages if the active clip could not be set.
Returns
true if successful, false otherwise
void APEXA_SceneInvoke::setAnimationCachingMode ( APEXA_AnimationCachingMode  mode)

Sets the animation cache mode.

bool APEXA_SceneInvoke::setCharacterGeoInput ( const UT_StringHolder character_path,
const UT_StringHolder geo_name,
const GU_ConstDetailHandle geo 
)

Override a character geometry input with a new geometry. This can be used to inject external animated geometries. Call updateEvaluationTime() to force a refresh().

void APEXA_SceneInvoke::updateEvaluationTime ( apex::Float  frame,
bool  evaluate_tracked_ouputs = true 
)

Update the scene to the specified time, clearing any cached output results.

Parameters
evaluate_tracked_outputsIf true, the tracked outputs will be evaluated in parallel.
bool APEXA_SceneInvoke::updateSourceGeometry ( const GU_Detail detail,
UT_StringHolder error,
bool  preload_animation_clips = false 
)

Update the source geometry for the scene. Returns true if the scene was reloaded. The outputs are also cleared if the scene changed.

APEXA_SceneInvoke::UT_NON_COPYABLE ( APEXA_SceneInvoke  )

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