HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GU_Agent.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: GU_Agent.h (GU Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __GU_Agent__
12 #define __GU_Agent__
13 
14 #include "GU_API.h"
15 #include "GU_AgentClip.h"
16 #include "GU_AgentDefinition.h"
17 #include "GU_PackedImpl.h"
18 
19 #include <GA/GA_PrimitiveTypeId.h>
20 
21 #include <UT/UT_Array.h>
22 #include <UT/UT_BitArray.h>
23 #include <UT/UT_Map.h>
24 #include <UT/UT_UniquePtr.h>
25 #include <UT/UT_SharedPtr.h>
26 #include <UT/UT_SmallArray.h>
27 #include <UT/UT_StringHolder.h>
28 #include <UT/UT_TBBSpinLock.h>
29 #include <UT/UT_VectorTypes.h>
30 #include <SYS/SYS_Types.h>
31 
32 
33 #define GU_AGENT_LAYER_DEFAULT "default"
34 #define GU_AGENT_LAYER_COLLISION "collision"
35 
36 
37 class UT_Options;
38 
39 
40 /// A packed agent
41 ///
42 /// The agent is composed of multiple named layers. Each layer consists of
43 /// zero or more shapes.
44 ///
45 /// All agents must have a default layer. This is the layer used when a
46 /// specific layer isn't found. Example layers might be: "default", "low-res",
47 /// "medium-res", "high-quality", "collision".
48 ///
49 /// The packed agent conforms to the GU_PackedImpl API, but also provides
50 /// access to the layers/shapes.
52 {
53 public:
63 
64  enum BlendMode
65  {
68  NUM_BLEND_MODES
69  };
70 
71  struct ClipLayer
72  {
73  ClipLayer(BlendMode blend_mode, fpreal64 weight = 0.0,
74  int64 parent = -1)
75  : myBlendMode(blend_mode), myWeight(weight), myParent(parent)
76  {
77  }
78 
82  };
83 
84  /// State of the primitive
85  struct GU_API State
86  {
87  int64 getMemoryUsage(bool inclusive) const;
88  void clear();
89 
95 
97  };
98 
99  GU_Agent();
100  GU_Agent(const GU_Agent &src);
101  ~GU_Agent() override;
102 
103  /// Register the packed primitive type
104  static void install(GA_PrimitiveFactory *pfact);
105 
106  /// Get the type ID for the GU_Agent primitive type.
108  {
109  return theTypeId;
110  }
111 
112  /// Convenience method to create a packed agent primitive
113  static GU_PrimPacked *agent(GU_Detail &dest,
114  GA_Offset ptoff = GA_INVALID_OFFSET);
115 
116 
117  static bool hasAgentPackedPrimitives(
118  const GU_Detail &gdp);
119 
120  /// @{
121  /// API defined on GU_PackedImpl
122  GU_PackedFactory *getFactory() const override;
123  GU_Agent *copy() const override;
124  bool isValid() const override;
125  void clearData() override;
126 
127  bool supportsJSONLoad() const override
128  { return true; }
129  bool load(GU_PrimPacked *prim,
130  const UT_Options &options,
131  const GA_LoadMap &map) override
132  { return loadFrom(prim, options, map); }
134  GU_PrimPacked *prim,
135  const UT_JSONValueMap &options,
136  const GA_LoadMap &map) override
137  { return loadFrom(prim, options, map); }
138 
139  void update(GU_PrimPacked *prim,
140  const UT_Options &options) override
141  { updateFrom(prim, options); }
142  bool saveSharedData(
143  UT_JSONWriter &w,
144  GA_SaveMap &map,
145  GA_GeometryIndex *geo_index) const override;
146  bool loadSharedData(int load_data_type,
147  const GA_SharedLoadData *item) override;
148  bool save(UT_Options &options,
149  const GA_SaveMap &map) const override;
150  bool getBounds(UT_BoundingBox &box) const override;
151  bool getRenderingBounds(UT_BoundingBox &box) const override;
152  void getVelocityRange(
153  UT_Vector3 &vmin,
154  UT_Vector3 &vmax) const override;
155  void getWidthRange(
156  fpreal &wmin,
157  fpreal &wmax) const override;
158  bool unpack(GU_Detail &destgdp,
159  const UT_Matrix4D *transform) const override;
160  bool unpackWithStyler(
161  GU_Detail &destgdp,
162  STY_StylerGroup &prim_styler_group,
163  const STY_Styler &parent_styler,
164  const GU_PrimPacked *prim) const override;
165  GU_ConstDetailHandle getPackedDetail(
166  GU_PackedContext *context = 0) const override;
167 
168  /// Report memory usage (includes all shared memory)
169  int64 getMemoryUsage(bool inclusive) const override;
170 
171  /// Count memory usage using a UT_MemoryCounter in order to count
172  /// shared memory correctly.
173  void countMemory(
174  UT_MemoryCounter &counter,
175  bool inclusive) const override;
176  /// @}
177 
178  /// Return the agent's definition (which contains e.g. available clips and
179  /// layers).
181  {
182  loadDefinitionIfNeeded();
183  return *myDefinition;
184  }
185 
186  void setDefinition(GU_PrimPacked *prim,
187  const GU_AgentDefinitionConstPtr &definition);
188 
189  /// Rig Accessor
190  /// @{
191  const GU_AgentRigConstPtr &getRig() const { return definition().rig(); }
192  /// @}
193 
194  /// Return the list of the agent's current layers.
195  const UT_Array<GU_AgentLayerConstPtr> &getCurrentLayers() const;
196  /// Sets the agent's display layers.
197  void setCurrentLayers(GU_PrimPacked *prim,
198  const UT_Array<GU_AgentLayerConstPtr> &layers);
199 
200  /// Return the current layer. This may be a NULL pointer.
201  SYS_DEPRECATED_HDK_REPLACE(19.0, getCurrentLayers)
202  const GU_AgentLayer *getCurrentLayer() const;
203  /// Sets the agent's display layer.
204  SYS_DEPRECATED_HDK_REPLACE(19.0, setCurrentLayers)
205  void setCurrentLayer(GU_PrimPacked *prim,
207 
208  /// Return the list of the agent's collision layers.
209  const UT_Array<GU_AgentLayerConstPtr> &getCollisionLayers() const;
210  /// Sets the agent's collision layers.
211  void setCollisionLayers(GU_PrimPacked *prim,
212  const UT_Array<GU_AgentLayerConstPtr> &layers);
213 
214  /// Return the current collision layer. This may be a NULL pointer.
215  SYS_DEPRECATED_HDK_REPLACE(19.0, getCollisionLayers)
216  const GU_AgentLayer *getCollisionLayer() const;
217  /// Sets the agent's collision layer.
218  SYS_DEPRECATED_HDK_REPLACE(19.0, setCollisionLayers)
219  void setCollisionLayer(GU_PrimPacked *prim,
220  const GU_AgentLayerConstPtr &layer);
221 
222  /// @{
223  /// Display layer accesssors for intrinsics.
224  exint intrinsicNumCurrentLayers(const GU_PrimPacked *prim) const;
225  void intrinsicCurrentLayerNames(const GU_PrimPacked *prim, UT_StringArray &names) const;
226  void intrinsicSetCurrentLayerNames(GU_PrimPacked *prim, const UT_StringArray &names);
227  /// @}
228 
229  /// @{
230  /// Collision layer accessors for intrinsics.
231  exint intrinsicNumCollisionLayers(const GU_PrimPacked *prim) const;
232  void intrinsicCollisionLayerNames(const GU_PrimPacked *prim, UT_StringArray &names) const;
233  void intrinsicSetCollisionLayerNames(GU_PrimPacked *prim, const UT_StringArray &names);
234  /// @}
235 
236  /// @{
237  /// Deprecated single-layer accessors for intrinsics.
238  StringType intrinsicCurrentLayerName(const GU_PrimPacked *prim) const;
239  void intrinsicSetCurrentLayerByName(GU_PrimPacked *prim, const StringType &name);
240  StringType intrinsicCollisionLayerName(const GU_PrimPacked *prim) const;
241  void intrinsicSetCollisionLayerByName(GU_PrimPacked *prim, const StringType &name);
242  /// @}
243 
244  /// Array of clips used for transform evaluation
245  /// @{
246  const GU_AgentClipPtrArray& clips() const;
247  void setClips(GU_PrimPacked *prim, const GU_AgentClipPtrArray& clips);
248  void setClipsByNames(GU_PrimPacked *prim, const UT_StringArray& clip_names);
249  /// @}
250 
251  /// Return the number of clips used for transform evaluation
252  exint numClips() const
253  { return clips().entries(); }
255  { return numClips(); }
256 
257  /// Names of the clips used for transform evaluation
258  const char* clipName(exint i) const;
259  const char* intrinsicClipName(const GU_PrimPacked *prim, exint i) const
260  { return clipName(i); }
261 
262  /// Set a clip by name
263  void setClipByName(GU_PrimPacked *prim, exint i, const char *clip_name);
264 
265  /// Array of times in seconds to evaluate the clips.
266  /// Indices in [0,numClips()-1] inclusively.
267  /// @{
269  { return myState.myClipTimes(i); }
271  { return clipTime(i); }
272  void setClipTime(GU_PrimPacked *prim, exint i, fpreal seconds);
273  /// @}
274 
275  /// Array of weights to evaluate the corresponding clips. Assumes they are
276  /// normalized.
277  /// @{
279  { return myState.myClipWeights(i); }
281  { return clipWeight(i); }
282  void setClipWeight(GU_PrimPacked *prim, exint i, fpreal weight);
283  /// @}
284 
285  /// The subset of transforms in the rig that each clip should be applied
286  /// to.
287  /// @{
288  const char* clipTransformGroupName(exint i) const;
289  const char* intrinsicClipTransformGroupName(const GU_PrimPacked *prim, exint i) const
290  { return clipTransformGroupName(i); }
291  void setClipTransformGroupByName(GU_PrimPacked *prim, exint i, const char *name);
292  void setClipTransformGroup(GU_PrimPacked *prim, exint i, const GU_AgentTransformGroupConstPtr &grp);
293  /// @}
294 
295  /// The layer that each clip belongs to.
296  /// @{
298  { return myState.myClipLayerIds(i); }
300  { return clipLayerId(i); }
301  void setClipLayerId(GU_PrimPacked *prim, exint i, exint layer_id);
302  /// @}
303 
304  /// List of clip layers and their blend modes.
305  /// @{
306  void setClipLayers(GU_PrimPacked *prim, const UT_Array<ClipLayer> &clip_layers);
308  { return myState.myClipLayers.entries(); }
309  /// @}
310 
311  /// Get the world transforms for this agent. Disabling interpolation can
312  /// improve performance if the clip time falls between two samples.
314  bool interpolate_samples = true) const
315  { return computeTransforms(xforms,
316  /* world_space */ true,
317  interpolate_samples); }
318  /// Get the local transforms for this agent.
320  bool interpolate_samples = true) const
321  { return computeTransforms(xforms,
322  /* world_space */ false,
323  interpolate_samples); }
324  /// Get a specific world transform for the agent.
326  bool interpolate_samples = true) const
327  { return computeWorldTransformInternal(xform, i, interpolate_samples); }
328  /// Get a specific local transform for the agent.
330  bool interpolate_samples = true) const
331  { return computeLocalTransformInternal(xform, i, interpolate_samples); }
332 
333  /// Override the world transforms for this agent.
334  void setWorldTransforms(const Matrix4Array &xforms)
335  { setTransforms(xforms, /* world_space */ true); }
336  /// Override the local transforms for this agent.
337  void setLocalTransforms(const Matrix4Array &xforms)
338  { setTransforms(xforms, /* world_space */ false); }
339  /// Override a specific world transform for this agent.
340  void setWorldTransform(const Matrix4Type &xform, exint i);
341  /// Override a specific local transform for this agent.
342  void setLocalTransform(const Matrix4Type &xform, exint i);
343  /// Returns whether the agent's transforms have been overridden from the
344  /// blended clips.
345  bool hasCustomTransforms() const { return myHasCustomXforms; }
347  { return hasCustomTransforms(); }
348  /// Number of transforms in the rig.
350  { return getRig() ? getRig()->transformCount() : 0; }
352  { return transformCount(); }
353  /// Return the name of the given transform.
354  const char* transformName(exint i) const;
355  const char* intrinsicTransformName(const GU_PrimPacked *prim, exint i) const
356  { return transformName(i); }
357 
358  /// Functions for the 'agentworldtransforms' and 'agentlocaltransforms'
359  /// intrinsics to manipulate the transforms as an array of floats.
360  exint transformsArraySize() const;
362  { return transformsArraySize(); }
364  { transformsArray(data, n, /* world_space */ true); }
366  exint n)
367  { setTransformsFromArray(data, n,
368  /* world_space */ true); }
370  { transformsArray(data, n,
371  /* world_space */ false); }
373  exint n)
374  { setTransformsFromArray(data, n,
375  /* world_space */ false); }
376 
377  /// Number of transforms in the rig.
379  { return getRig() ? getRig()->channelCount() : 0; }
380 
381  /// Computes the agent's channel values from its clips.
382  bool computeChannelValues(FloatArrayConstPtr &values,
383  bool interpolate_samples = true) const;
384 
385  /// Override a specific channel value for this agent.
386  void setChannelValue(FloatType value, exint i);
387 
388  /// Returns whether the agent's channel values have been overridden from
389  /// the blended clips.
391  { return myHasCustomChannelValues; }
392 
393  /// Functions for the 'agentchannelnames', 'agentchannelvalues', and
394  /// 'agenthascustomchannelvalues' intrinsics.
395  /// @{
397  { return channelCount(); }
398  const StringType& intrinsicChannelName(const GU_PrimPacked *, exint i) const;
399  void intrinsicChannelValuesArray(const GU_PrimPacked *,
400  FloatType *data, exint n) const;
401  void intrinsicSetChannelValuesFromArray(GU_PrimPacked *,
402  const FloatType *data, exint n);
404  { return hasCustomChannelValues(); }
405  /// @}
406 
407  /// Functions for the 'agentrigparents' intrinsic.
408  exint intrinsicParentIndex(const GU_PrimPacked *prim, exint i) const;
409  /// Functions for the 'agentlayers' intrinsic.
410  exint intrinsicNumLayers(const GU_PrimPacked *prim) const;
411  const char* intrinsicLayerName(const GU_PrimPacked *prim, exint i) const;
412 
413  /// Used by the 'agentcliptimes', 'agentclipnames', and 'agentclipweights'
414  /// intrinsics to grow or shrink the number of clips.
415  void intrinsicSetNumClips(GU_PrimPacked *prim, GA_Size n);
416 
417  /// Functions for the 'agentclipcatalog' intrinsic.
418  exint intrinsicCatalogNumClips(const GU_PrimPacked *prim) const;
419  const char* intrinsicCatalogClipName(const GU_PrimPacked *prim, exint i) const;
420  const char* intrinsicClipCatalogFilenames(const GU_PrimPacked *prim, exint i) const;
421 
422  /// Functions for the 'agentshapelibrary' intrinsic.
423  exint intrinsicNumShapes(const GU_PrimPacked *prim) const;
424  void intrinsicShapeNames(const GU_PrimPacked *prim, UT_StringArray &values) const;
425 
426  /// Functions for the 'agenttransformgroups' intrinsic.
427  /// @{
428  exint intrinsicNumTransformGroups(const GU_PrimPacked *prim) const;
429  const char* intrinsicTransformGroupName(const GU_PrimPacked *prim, exint i) const;
430  /// @}
431 
432  /// Functions for the clip layer intrinsics.
433  /// @{
434  const char* intrinsicClipLayerMode(const GU_PrimPacked *prim, exint i) const;
435  exint intrinsicClipLayerParent(const GU_PrimPacked *prim, exint i) const;
436  fpreal intrinsicClipLayerWeight(const GU_PrimPacked *prim, exint i) const;
438  { return numClipLayers(); }
439  /// @}
440 
441  /// The 'agentmetadata' intrinsic. See GU_AgentDefinition::metadata().
442  UT_OptionsHolder intrinsicMetadata(const GU_PrimPacked *prim) const;
443 
444 private:
445  GU_Agent& operator=(const GU_Agent& copy); // DISALLOWED
446 
447 private:
448  void dirtyBlendedTransforms(GU_PrimPacked *prim);
449  void loadDefinition() const;
450  SYS_FORCE_INLINE void loadDefinitionIfNeeded() const
451  {
452  if (!myDefinition)
453  loadDefinition();
454  }
455 
456  template <typename T>
457  bool loadFrom(GU_PrimPacked *prim, const T &options, const GA_LoadMap &map);
458  template <typename T>
459  void updateFrom(GU_PrimPacked *prim, const T &options);
460 
461  /// Get the agent's current transforms, in local or world space.
462  /// Disabling interpolation can improve performance if the clip time falls
463  /// between two samples.
464  bool computeTransforms(Matrix4ArrayConstPtr &matrices,
465  bool world_space,
466  bool interpolate_samples = true,
467  bool acquire_xform_lock = true) const;
468 
469  /// Internal version of computeWorldTransform(), which allows controlling
470  /// whether myXformLock needs to be acquired.
471  bool computeWorldTransformInternal(Matrix4Type &xform,
472  exint i,
473  bool interpolate_samples,
474  bool acquire_xform_lock = true) const;
475 
476  /// Internal version of computeLocalTransform(), which allows controlling
477  /// whether myXformLock needs to be acquired.
478  bool computeLocalTransformInternal(Matrix4Type &xform,
479  exint i,
480  bool interpolate_samples,
481  bool acquire_xform_lock = true) const;
482 
483  /// Override the current transforms of the agent.
484  void setTransforms(const Matrix4Array &xforms,
485  bool world_space);
486  void transformsArray(FloatType *buf, exint n,
487  bool world_space) const;
488  void setTransformsFromArray(const FloatType *data, exint n,
489  bool world_space);
490 
491  /// Resize the clip arrays to n elements.
492  void changeNumClips(GU_PrimPacked *prim, exint n, bool fill_valid_clips = false);
493 
494  /// Convert the cached transforms from local to world space (or vice versa).
495  void convertCachedTransforms(bool world_space) const;
496 
497  /// Internal method to set a single current / collision layer for the
498  /// agent.
499  void setLayer(GU_PrimPacked *prim,
502  /// Internal method to set the current / collision layers for the agent.
503  void setLayers(GU_PrimPacked *prim,
505  const UT_Array<GU_AgentLayerConstPtr> &new_layers);
506  /// Internal method to set the agent's current / collision layers by name,
507  /// for use with intrinsics.
508  void setLayerNames(GU_PrimPacked *prim,
510  const UT_StringArray &names);
511 
512  struct DelayLoadData
513  {
514  DelayLoadData(const GA_SharedDataHandlePtr &definition,
515  const GA_SharedDataHandlePtr &transforms,
516  const GA_SharedDataHandlePtr &channel_values)
517  : myDefinition(definition),
518  myTransforms(transforms),
519  myChannelValues(channel_values)
520  {
521  }
522 
523  DelayLoadData(const DelayLoadData &src)
524  : myDefinition(src.myDefinition),
525  myTransforms(src.myTransforms),
526  myChannelValues(src.myChannelValues),
527  myClipNames(src.myClipNames),
528  myClipXformGroupNames(src.myClipXformGroupNames),
529  myCurrentLayerNames(src.myCurrentLayerNames),
530  myCollisionLayerNames(src.myCollisionLayerNames)
531  {
532  }
533 
534  /// Return whether the shared data has been loaded.
535  bool isLoaded() const
536  {
537  return !myDefinition && !myTransforms && !myChannelValues;
538  }
539 
540  int64 getMemoryUsage(bool inclusive) const;
541 
542  UT_Lock myLock;
543  /// Shared agent definition.
544  GA_SharedDataHandlePtr myDefinition;
545  /// Shared transforms.
546  GA_SharedDataHandlePtr myTransforms;
547  /// Cached channel values.
548  GA_SharedDataHandlePtr myChannelValues;
549  /// Names of the clips that this agent will use after the shared
550  /// definition has been loaded.
551  UT_StringArray myClipNames;
552  /// Names of the transform groups that this agent will use after the
553  /// shared definition has been loaded.
554  UT_StringArray myClipXformGroupNames;
555 
556  /// Names of the layers to be resolved after the shared definition has
557  /// been loaded.
558  UT_StringArray myCurrentLayerNames;
559  UT_StringArray myCollisionLayerNames;
560  };
561 
562  GU_AgentDefinitionConstPtr myDefinition;
563 
564  static constexpr size_t LAYER_CAPACITY = sizeof(GU_AgentLayerConstPtr);
567 
568  State myState;
569 
570  mutable FloatArrayPtr myCachedChannelValues;
571  mutable Matrix4ArrayPtr myCachedTransforms;
572  /// Tracks which entries of myCachedTransforms are in local or world space.
573  mutable UT_BitArray myWorldSpace;
574 
575  /// Whether or not myCachedChannelValues matches the clip intrinsics.
576  mutable bool myHasCustomChannelValues;
577  /// Whether or not myCachedTransforms matches the clip intrinsics.
578  mutable bool myHasCustomXforms;
579 
580  using XformLock = UT_TBBSpinLock;
581  using XformLockScope = UT_TBBSpinLock::Scope;
582  /// Lock for myCachedTransforms and myCachedChannelValues.
583  mutable XformLock myXformLock;
584 
585  mutable UT_UniquePtr<DelayLoadData> myDelayLoadData;
586 
587  static GA_PrimitiveTypeId theTypeId;
588 };
589 
590 #endif
UT_Int64Array myClipLayerIds
Definition: GU_Agent.h:94
UT_StringHolder StringType
Definition: GU_Agent.h:54
UT_Lockable< tbb::spin_mutex > UT_TBBSpinLock
void setLocalTransformsFromArray(GU_PrimPacked *prim, const FloatType *data, exint n)
Definition: GU_Agent.h:372
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glcorearb.h:2540
ApexArray< Matrix4 > Matrix4Array
Definition: APEX_Include.h:99
UT_JSONValueMap stores a map/dictionary of UT_JSONValue objects.
const char * intrinsicTransformName(const GU_PrimPacked *prim, exint i) const
Definition: GU_Agent.h:355
Used to pass options and map offset values during saving.
Definition: GA_SaveMap.h:48
fpreal64 myWeight
Definition: GU_Agent.h:80
OIIO_UTIL_API bool copy(string_view from, string_view to, std::string &err)
SIM_API const UT_StringHolder agent
GLsizei const GLfloat * value
Definition: glcorearb.h:824
State of the primitive.
Definition: GU_Agent.h:85
#define SYS_DEPRECATED_HDK_REPLACE(__V__, __R__)
void setWorldTransformsFromArray(GU_PrimPacked *prim, const FloatType *data, exint n)
Definition: GU_Agent.h:365
UT_SharedPtr< Matrix4Array > Matrix4ArrayPtr
Definition: GU_Agent.h:61
exint intrinsicTransformsArraySize(const GU_PrimPacked *prim) const
Definition: GU_Agent.h:361
int64 exint
Definition: SYS_Types.h:125
fpreal32 FloatType
Definition: GU_Agent.h:55
GU_AgentClipPtrArray myClips
Definition: GU_Agent.h:90
bool hasCustomTransforms() const
Definition: GU_Agent.h:345
Class which writes ASCII or binary JSON streams.
Definition: UT_JSONWriter.h:37
exint transformCount() const
Number of transforms in the rig.
Definition: GU_Agent.h:349
bool intrinsicHasCustomChannelValues(const GU_PrimPacked *) const
Definition: GU_Agent.h:403
UT_SharedPtr< GA_SharedDataHandle > GA_SharedDataHandlePtr
float fpreal32
Definition: SYS_Types.h:200
UT_Array< ClipLayer > myClipLayers
Definition: GU_Agent.h:96
exint intrinsicTransformCount(const GU_PrimPacked *prim) const
Definition: GU_Agent.h:351
exint GA_Size
Defines the bit width for index and offset types in GA.
Definition: GA_Types.h:236
UT_SharedPtr< FloatArray > FloatArrayPtr
Definition: GU_Agent.h:57
fpreal intrinsicClipTime(const GU_PrimPacked *prim, exint i) const
Definition: GU_Agent.h:270
#define GA_INVALID_OFFSET
Definition: GA_Types.h:687
BlendMode myBlendMode
Definition: GU_Agent.h:79
GLenum GLuint GLint GLint layer
Definition: glcorearb.h:1299
std::unique_ptr< T, Deleter > UT_UniquePtr
A smart pointer for unique ownership of dynamically allocated objects.
Definition: UT_UniquePtr.h:39
exint intrinsicNumClips(const GU_PrimPacked *prim) const
Definition: GU_Agent.h:254
double fpreal64
Definition: SYS_Types.h:201
GA_Size GA_Offset
Definition: GA_Types.h:646
fpreal intrinsicClipWeight(const GU_PrimPacked *prim, exint i) const
Definition: GU_Agent.h:280
GU_AgentTransformGroupArray myClipXformGroups
Definition: GU_Agent.h:93
GLdouble n
Definition: glcorearb.h:2008
UT_IntrusivePtr< const GU_AgentLayer > GU_AgentLayerConstPtr
Definition: GU_AgentLayer.h:28
void localTransformsArray(const GU_PrimPacked *prim, FloatType *data, exint n) const
Definition: GU_Agent.h:369
const char * intrinsicClipTransformGroupName(const GU_PrimPacked *prim, exint i) const
Definition: GU_Agent.h:289
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
Definition: UT_SharedPtr.h:36
void setWorldTransforms(const Matrix4Array &xforms)
Override the world transforms for this agent.
Definition: GU_Agent.h:334
#define SYS_FORCE_INLINE
Definition: SYS_Inline.h:45
const char * intrinsicClipName(const GU_PrimPacked *prim, exint i) const
Definition: GU_Agent.h:259
void update(GU_PrimPacked *prim, const UT_Options &options) override
Definition: GU_Agent.h:139
UT_Fpreal64Array myClipTimes
Definition: GU_Agent.h:91
bool computeLocalTransform(Matrix4Type &xform, exint i, bool interpolate_samples=true) const
Get a specific local transform for the agent.
Definition: GU_Agent.h:329
bool supportsJSONLoad() const override
Definition: GU_Agent.h:127
long long int64
Definition: SYS_Types.h:116
Options during loading.
Definition: GA_LoadMap.h:42
UT_Matrix4T< FloatType > Matrix4Type
Definition: GU_Agent.h:59
#define GU_API
Definition: GU_API.h:14
GLuint const GLchar * name
Definition: glcorearb.h:786
void worldTransformsArray(const GU_PrimPacked *prim, FloatType *data, exint n) const
Definition: GU_Agent.h:363
const GU_AgentRigConstPtr & getRig() const
Definition: GU_Agent.h:191
GA_API const UT_StringHolder transform
UT_SharedPtr< const FloatArray > FloatArrayConstPtr
Definition: GU_Agent.h:58
exint intrinsicChannelCount(const GU_PrimPacked *) const
Definition: GU_Agent.h:396
fpreal clipTime(exint i) const
Definition: GU_Agent.h:268
exint entries() const
Alias of size(). size() is preferred.
Definition: UT_Array.h:655
exint intrinsicNumClipLayers(const GU_PrimPacked *prim) const
Definition: GU_Agent.h:437
SYS_FORCE_INLINE const GU_AgentDefinition & definition() const
Definition: GU_Agent.h:180
bool computeWorldTransforms(Matrix4ArrayConstPtr &xforms, bool interpolate_samples=true) const
Definition: GU_Agent.h:313
UT_UniqueLock< UT_Lockable< tbb::spin_mutex > > Scope
Definition: UT_Lockable.h:30
bool hasCustomChannelValues() const
Definition: GU_Agent.h:390
A map of string to various well defined value types.
Definition: UT_Options.h:84
GLenum GLsizei GLsizei GLint * values
Definition: glcorearb.h:1602
fpreal clipWeight(exint i) const
Definition: GU_Agent.h:278
fpreal64 fpreal
Definition: SYS_Types.h:278
LeafData & operator=(const LeafData &)=delete
bool computeWorldTransform(Matrix4Type &xform, exint i, bool interpolate_samples=true) const
Get a specific world transform for the agent.
Definition: GU_Agent.h:325
GLubyte GLubyte GLubyte GLubyte w
Definition: glcorearb.h:857
bool computeLocalTransforms(Matrix4ArrayConstPtr &xforms, bool interpolate_samples=true) const
Get the local transforms for this agent.
Definition: GU_Agent.h:319
exint numClipLayers() const
Definition: GU_Agent.h:307
bool load(GU_PrimPacked *prim, const UT_Options &options, const GA_LoadMap &map) override
Definition: GU_Agent.h:129
UT_SharedPtr< const Matrix4Array > Matrix4ArrayConstPtr
Definition: GU_Agent.h:62
UT_Array< FloatType > FloatArray
Definition: GU_Agent.h:56
bool intrinsicHasCustomTransforms(const GU_PrimPacked *) const
Definition: GU_Agent.h:346
ClipLayer(BlendMode blend_mode, fpreal64 weight=0.0, int64 parent=-1)
Definition: GU_Agent.h:73
UT_Array< Matrix4Type > Matrix4Array
Definition: GU_Agent.h:60
exint channelCount() const
Number of transforms in the rig.
Definition: GU_Agent.h:378
static GA_PrimitiveTypeId typeId()
Get the type ID for the GU_Agent primitive type.
Definition: GU_Agent.h:107
Definition: format.h:1821
bool loadFromJSON(GU_PrimPacked *prim, const UT_JSONValueMap &options, const GA_LoadMap &map) override
Definition: GU_Agent.h:133
void setLocalTransforms(const Matrix4Array &xforms)
Override the local transforms for this agent.
Definition: GU_Agent.h:337
exint intrinsicClipLayerId(const GU_PrimPacked *prim, exint i) const
Definition: GU_Agent.h:299
UT_Fpreal64Array myClipWeights
Definition: GU_Agent.h:92
exint clipLayerId(exint i) const
Definition: GU_Agent.h:297
GLenum src
Definition: glcorearb.h:1793