33 #define GU_AGENT_LAYER_DEFAULT "default"
34 #define GU_AGENT_LAYER_COLLISION "collision"
75 : myBlendMode(blend_mode), myWeight(weight), myParent(parent)
114 static bool hasAgentPackedPrimitives(
129 {
return loadFrom(prim, options, map); }
134 {
return loadFrom(prim, options, map); }
138 { updateFrom(prim, options); }
154 fpreal &wmax)
const override;
172 bool inclusive)
const override;
179 loadDefinitionIfNeeded();
180 return *myDefinition;
235 StringType intrinsicCurrentLayerName(const
GU_PrimPacked *prim) const;
236 void intrinsicSetCurrentLayerByName(
GU_PrimPacked *prim, const StringType &
name);
237 StringType intrinsicCollisionLayerName(const
GU_PrimPacked *prim) const;
238 void intrinsicSetCollisionLayerByName(
GU_PrimPacked *prim, const StringType &name);
252 {
return numClips(); }
255 const char* clipName(
exint i)
const;
257 {
return clipName(i); }
266 {
return myState.myClipTimes(i); }
268 {
return clipTime(i); }
276 {
return myState.myClipWeights(i); }
278 {
return clipWeight(i); }
285 const char* clipTransformGroupName(
exint i)
const;
287 {
return clipTransformGroupName(i); }
295 {
return myState.myClipLayerIds(i); }
297 {
return clipLayerId(i); }
305 {
return myState.myClipLayers.entries(); }
311 bool interpolate_samples =
true)
const
312 {
return computeTransforms(xforms,
314 interpolate_samples); }
317 bool interpolate_samples =
true)
const
318 {
return computeTransforms(xforms,
320 interpolate_samples); }
323 bool interpolate_samples =
true)
const
324 {
return computeWorldTransformInternal(xform, i, interpolate_samples); }
327 bool interpolate_samples =
true)
const
328 {
return computeLocalTransformInternal(xform, i, interpolate_samples); }
332 { setTransforms(xforms,
true); }
335 { setTransforms(xforms,
false); }
337 void setWorldTransform(
const Matrix4Type &xform,
exint i);
339 void setLocalTransform(
const Matrix4Type &xform,
exint i);
344 {
return hasCustomTransforms(); }
347 {
return getRig() ? getRig()->transformCount() : 0; }
349 {
return transformCount(); }
351 const char* transformName(
exint i)
const;
353 {
return transformName(i); }
357 exint transformsArraySize()
const;
359 {
return transformsArraySize(); }
361 { transformsArray(data, n,
true); }
364 { setTransformsFromArray(data, n,
367 { transformsArray(data, n,
371 { setTransformsFromArray(data, n,
376 {
return getRig() ? getRig()->channelCount() : 0; }
379 bool computeChannelValues(FloatArrayConstPtr &
values,
380 bool interpolate_samples =
true)
const;
388 {
return myHasCustomChannelValues; }
394 {
return channelCount(); }
401 {
return hasCustomChannelValues(); }
435 {
return numClipLayers(); }
446 void loadDefinition()
const;
453 template <
typename T>
455 template <
typename T>
461 bool computeTransforms(Matrix4ArrayConstPtr &matrices,
463 bool interpolate_samples =
true,
464 bool acquire_xform_lock =
true)
const;
468 bool computeWorldTransformInternal(Matrix4Type &xform,
470 bool interpolate_samples,
471 bool acquire_xform_lock =
true)
const;
475 bool computeLocalTransformInternal(Matrix4Type &xform,
477 bool interpolate_samples,
478 bool acquire_xform_lock =
true)
const;
481 void setTransforms(
const Matrix4Array &xforms,
484 bool world_space)
const;
492 void convertCachedTransforms(
bool world_space)
const;
514 : myDefinition(definition),
515 myTransforms(transforms),
516 myChannelValues(channel_values)
520 DelayLoadData(
const DelayLoadData &
src)
521 : myDefinition(src.myDefinition),
522 myTransforms(src.myTransforms),
523 myChannelValues(src.myChannelValues),
524 myClipNames(src.myClipNames),
525 myClipXformGroupNames(src.myClipXformGroupNames),
526 myCurrentLayerNames(src.myCurrentLayerNames),
527 myCollisionLayerNames(src.myCollisionLayerNames)
532 bool isLoaded()
const
534 return !myDefinition && !myTransforms && !myChannelValues;
537 int64 getMemoryUsage(
bool inclusive)
const;
567 mutable FloatArrayPtr myCachedChannelValues;
568 mutable Matrix4ArrayPtr myCachedTransforms;
573 mutable bool myHasCustomChannelValues;
575 mutable bool myHasCustomXforms;
580 mutable XformLock myXformLock;
UT_Int64Array myClipLayerIds
UT_StringHolder StringType
UT_Lockable< tbb::spin_mutex > UT_TBBSpinLock
virtual void getVelocityRange(UT_Vector3 &min, UT_Vector3 &max) const =0
void setLocalTransformsFromArray(GU_PrimPacked *prim, const FloatType *data, exint n)
GLenum GLuint GLenum GLsizei const GLchar * buf
UT_JSONValueMap stores a map/dictionary of UT_JSONValue objects.
const char * intrinsicTransformName(const GU_PrimPacked *prim, exint i) const
Used to pass options and map offset values during saving.
OIIO_UTIL_API bool copy(string_view from, string_view to, std::string &err)
SIM_API const UT_StringHolder agent
#define SYS_DEPRECATED_HDK_REPLACE(__V__, __R__)
void setWorldTransformsFromArray(GU_PrimPacked *prim, const FloatType *data, exint n)
UT_SharedPtr< Matrix4Array > Matrix4ArrayPtr
exint intrinsicTransformsArraySize(const GU_PrimPacked *prim) const
GU_AgentClipPtrArray myClips
virtual bool getBounds(UT_BoundingBox &box) const =0
Get the bounding box for the geometry (not including transforms)
bool hasCustomTransforms() const
Class which writes ASCII or binary JSON streams.
exint transformCount() const
Number of transforms in the rig.
bool intrinsicHasCustomChannelValues(const GU_PrimPacked *) const
UT_SharedPtr< GA_SharedDataHandle > GA_SharedDataHandlePtr
UT_Array< ClipLayer > myClipLayers
exint intrinsicTransformCount(const GU_PrimPacked *prim) const
exint GA_Size
Defines the bit width for index and offset types in GA.
UT_SharedPtr< FloatArray > FloatArrayPtr
fpreal intrinsicClipTime(const GU_PrimPacked *prim, exint i) const
#define GA_INVALID_OFFSET
GLenum GLuint GLint GLint layer
std::unique_ptr< T, Deleter > UT_UniquePtr
A smart pointer for unique ownership of dynamically allocated objects.
virtual bool getRenderingBounds(UT_BoundingBox &box) const =0
GU_PackedImpl & operator=(const GU_PackedImpl &src)=default
exint intrinsicNumClips(const GU_PrimPacked *prim) const
fpreal intrinsicClipWeight(const GU_PrimPacked *prim, exint i) const
GU_AgentTransformGroupArray myClipXformGroups
UT_IntrusivePtr< const GU_AgentLayer > GU_AgentLayerConstPtr
void localTransformsArray(const GU_PrimPacked *prim, FloatType *data, exint n) const
const char * intrinsicClipTransformGroupName(const GU_PrimPacked *prim, exint i) const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
virtual void clearData()=0
void setWorldTransforms(const Matrix4Array &xforms)
Override the world transforms for this agent.
virtual int64 getMemoryUsage(bool inclusive) const =0
Report memory usage (includes all shared memory)
const char * intrinsicClipName(const GU_PrimPacked *prim, exint i) const
virtual void countMemory(UT_MemoryCounter &counter, bool inclusive) const =0
void update(GU_PrimPacked *prim, const UT_Options &options) override
virtual GU_PackedFactory * getFactory() const =0
Get the factory associated with this procedural.
UT_Fpreal64Array myClipTimes
virtual GU_ConstDetailHandle getPackedDetail(GU_PackedContext *context=0) const
bool computeLocalTransform(Matrix4Type &xform, exint i, bool interpolate_samples=true) const
Get a specific local transform for the agent.
bool supportsJSONLoad() const override
UT_Matrix4T< FloatType > Matrix4Type
GLuint const GLchar * name
void worldTransformsArray(const GU_PrimPacked *prim, FloatType *data, exint n) const
const GU_AgentRigConstPtr & getRig() const
GA_API const UT_StringHolder transform
UT_SharedPtr< const FloatArray > FloatArrayConstPtr
exint intrinsicChannelCount(const GU_PrimPacked *) const
fpreal clipTime(exint i) const
virtual bool isValid() const =0
Test whether the deferred load primitive data is valid.
exint entries() const
Alias of size(). size() is preferred.
exint intrinsicNumClipLayers(const GU_PrimPacked *prim) const
SYS_FORCE_INLINE const GU_AgentDefinition & definition() const
bool computeWorldTransforms(Matrix4ArrayConstPtr &xforms, bool interpolate_samples=true) const
UT_UniqueLock< UT_Lockable< tbb::spin_mutex > > Scope
bool hasCustomChannelValues() const
A map of string to various well defined value types.
virtual GU_PackedImpl * copy() const =0
Create a copy of this resolver.
GLenum GLsizei GLsizei GLint * values
fpreal clipWeight(exint i) const
bool unpack(GU_Detail &destgdp, const GU_PrimPacked *prim) const
bool computeWorldTransform(Matrix4Type &xform, exint i, bool interpolate_samples=true) const
Get a specific world transform for the agent.
virtual bool saveSharedData(UT_JSONWriter &w, GA_SaveMap &map, GA_GeometryIndex *geo_index) const
virtual bool unpackWithStyler(GU_Detail &destgdp, STY_StylerGroup &prim_styler_group, const STY_Styler &parent_styler, const GU_PrimPacked *prim) const
GLubyte GLubyte GLubyte GLubyte w
bool computeLocalTransforms(Matrix4ArrayConstPtr &xforms, bool interpolate_samples=true) const
Get the local transforms for this agent.
exint numClipLayers() const
bool load(GU_PrimPacked *prim, const UT_Options &options, const GA_LoadMap &map) override
UT_SharedPtr< const Matrix4Array > Matrix4ArrayConstPtr
UT_Array< FloatType > FloatArray
virtual bool loadSharedData(int load_data_type, const GA_SharedLoadData *item)
bool intrinsicHasCustomTransforms(const GU_PrimPacked *) const
ClipLayer(BlendMode blend_mode, fpreal64 weight=0.0, int64 parent=-1)
UT_Array< Matrix4Type > Matrix4Array
virtual bool save(UT_Options &options, const GA_SaveMap &map) const =0
Copy the resolver data into the UT_Options for saving.
exint channelCount() const
Number of transforms in the rig.
static GA_PrimitiveTypeId typeId()
Get the type ID for the GU_Agent primitive type.
bool loadFromJSON(GU_PrimPacked *prim, const UT_JSONValueMap &options, const GA_LoadMap &map) override
void setLocalTransforms(const Matrix4Array &xforms)
Override the local transforms for this agent.
exint intrinsicClipLayerId(const GU_PrimPacked *prim, exint i) const
UT_Fpreal64Array myClipWeights
exint clipLayerId(exint i) const
virtual void getWidthRange(fpreal &wmin, fpreal &wmax) const =0