HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GU_AgentClip.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_AgentClip.h (GU Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __GU_AgentClip__
12 #define __GU_AgentClip__
13 
14 #include "GU_API.h"
15 
16 #include "GU_AgentRig.h"
17 
18 #include <UT/UT_Array.h>
19 #include <UT/UT_Assert.h>
20 #include <UT/UT_IntrusivePtr.h>
21 #include <UT/UT_Lock.h>
22 #include <UT/UT_Matrix3.h>
23 #include <UT/UT_Matrix4.h>
24 #include <UT/UT_Quaternion.h>
25 #include <UT/UT_SharedPtr.h>
26 #include <UT/UT_StringArray.h>
27 #include <UT/UT_StringHolder.h>
28 #include <UT/UT_StringMap.h>
29 #include <UT/UT_SymMatrix3.h>
30 #include <UT/UT_ValArray.h>
31 #include <UT/UT_Vector3.h>
32 #include <UT/UT_VectorTypes.h>
33 #include <SYS/SYS_Inline.h>
34 #include <SYS/SYS_Math.h>
35 #include <SYS/SYS_Types.h>
36 
37 class CL_Clip;
39 class UT_BitArray;
40 class UT_StringArray;
41 
42 /// A factored transform geared for animation blending.
43 template <typename T>
45 {
46 public:
48 
50  GU_AgentXformT() = default;
51 
53  : myStretch(scale)
54  , myRotate(0, 0, 0, 0)
55  , myTranslate(0, 0, 0)
56  {
57  }
58 
59  const UT_SymMatrix3T<T>& stretch() const { return myStretch; }
60  const UT_QuaternionT<T>& rotate() const { return myRotate; }
61  const UT_Vector3T<T>& translate() const { return myTranslate; }
62 
63  void zero()
64  {
65  myStretch.zero();
66  myRotate.assign(0, 0, 0, 0);
67  myTranslate.assign(0, 0, 0);
68  }
69  void identity()
70  {
71  myStretch.identity();
72  myRotate.identity();
73  myTranslate.assign(0, 0, 0);
74  }
75 
76  /// Set the transform, in SRT/XYZ transform order.
77  /// The rotations are given in radians.
79  T tx, T ty, T tz,
80  T rx, T ry, T rz,
81  T sx, T sy, T sz)
82  {
84  myStretch.setScale(sx, sy, sz);
85  myRotate.updateFromEuler(UT_Vector3T<T>(rx, ry, rz), xord);
86  myTranslate.assign(tx, ty, tz);
87  }
88 
89  /// Set the transform, in SRT transform order.
90  /// The rotations are specified by a quaternion.
92  const UT_Vector3T<T> &t, const UT_QuaternionT<T> &r,
93  const UT_Vector3T<T> &s)
94  {
95  myStretch.setScale(s);
96  myRotate = r;
97  myTranslate = t;
98  }
99 
100  template <typename S>
102  S& tx, S& ty, S& tz,
103  S& rx, S& ry, S& rz,
104  S& sx, S& sy, S& sz) const
105  {
106  tx = myTranslate[0];
107  ty = myTranslate[1];
108  tz = myTranslate[2];
109 
111  UT_Vector3D r = myRotate.computeRotations(xord);
112  rx = r[0];
113  ry = r[1];
114  rz = r[2];
115 
116  sx = myStretch(0, 0);
117  sy = myStretch(1, 1);
118  sz = myStretch(2, 2);
119  }
120 
121  /// Set this to a linear interpolation of the two given transforms:
122  /// *this = a + t*(b - a)
123  void setLerp(const type& a, const type& b, T t)
124  {
125  myStretch.lerp(a.myStretch, b.myStretch, t);
126 
127  if (dot(a.myRotate, b.myRotate) >= 0)
128  myRotate.lerp(a.myRotate, b.myRotate, t);
129  else
130  myRotate.lerp(a.myRotate, -b.myRotate, t);
131  // NOTE: We don't normalize myRotate since this is already handled when
132  // we call UT_QuaternionT::getRotationMatrix().
133 
134  myTranslate = SYSlerp(a.myTranslate, b.myTranslate, t);
135  }
136 
137  void addScaled(T s, const type& xform)
138  {
139  myStretch += xform.myStretch * s;
140  if (dot(myRotate, xform.myRotate) >= 0)
141  myRotate += xform.myRotate * s;
142  else
143  myRotate += xform.myRotate * -s;
144  myTranslate += xform.myTranslate * s;
145  }
146 
147  /// Perform an additive blend with the specified percentage.
148  void concat(T t, const type& xform)
149  {
150  myRotate.normalize();
151 
152  myTranslate += myRotate.rotate(xform.myTranslate * t);
153 
154  UT_QuaternionT<T> additive_r = xform.myRotate;
155  additive_r.normalize();
156  UT_QuaternionT<T> new_r = myRotate * additive_r;
157 
158  if (dot(myRotate, new_r) < 0)
159  new_r.negate();
160 
161  myRotate.lerp(myRotate, new_r, t);
162  }
163 
165  {
166  // Set m to the transform myStretch*myRotate*myTranslate
167  if (!myStretch.isIdentity())
168  {
169  UT_Matrix3T<T> sr;
170  myRotate.getRotationMatrix(sr);
171  sr.leftMult(myStretch);
172  m = sr;
173  }
174  else
175  myRotate.getTransformMatrix(m);
176 
177  m.setTranslates(myTranslate);
178  }
179 
180 private:
181  UT_SymMatrix3T<T> myStretch;
182  UT_QuaternionT<T> myRotate;
183  UT_Vector3T<T> myTranslate;
184 };
188 
189 // Declare as POD for UT_Array optimizations.
191 
193 typedef UT_IntrusivePtr<GU_AgentClip> GU_AgentClipPtr;
195 typedef UT_Array<GU_AgentClipConstPtr> GU_AgentClipPtrArray;
196 
197 
198 /// An agent motion clip
199 ///
200 /// It is represented as array of samples, where each sample has
201 /// transformsPerSample() number of transforms. These transforms can be "local"
202 /// (corresponding to the transform hierarchy of rig()), or "world" where they
203 /// are multiplied all the way up to a root node in the rig.
204 class GU_API GU_AgentClip : public UT_IntrusiveRefCounter<GU_AgentClip>
205 {
206 public:
207 
217 
218  /// Create an empty clip
219  static GU_AgentClipPtr addClip(
220  const UT_StringHolder &name,
221  const GU_AgentRigConstPtr &rig);
222 
223  /// Create a clip by loading a clip file from disk.
224  static GU_AgentClipPtr addClipFromFile(
225  const UT_StringHolder &name,
226  const UT_StringHolder &filename,
227  const GU_AgentRigConstPtr& rig,
228  bool delay_load,
229  UT_StringArray& errors);
230 
231  /// Create a clone of a clip, referencing the specified rig.
232  /// 'copy_external_ref' should be disabled if the new clip will be
233  /// further modified.
234  static GU_AgentClipPtr addClipCopy(const GU_AgentClip &src,
235  const GU_AgentRigConstPtr &rig,
236  bool copy_external_ref);
237 
238  /// Compute the world transforms 'matrices' from the local 'xforms'
239  /// corresponding to the transforms in 'rig'.
240  static void computeWorldTransforms(
241  const GU_AgentRig& rig,
242  const XformArray& xforms,
243  Matrix4Array& matrices);
244 
245  /// Compute the local transforms 'matrices' from the local 'xforms'
246  /// corresponding to the transforms in 'rig'.
247  static void computeLocalTransforms(
248  const GU_AgentRig& rig,
249  const XformArray& xforms,
250  Matrix4Array& matrices);
251 
252  /// Given the local transforms 'xforms' corresponding to 'rig', convert
253  /// them to world transforms in-place.
254  /// The optional 'in_world_space' array can be used to specify if some
255  /// transforms in 'xforms' are already in world space.
256  static void computeWorldTransforms(
257  const GU_AgentRig& rig,
258  const UT_BitArray *in_world_space,
259  Matrix4Array& xforms);
260 
261  /// Given the world transforms 'xforms' corresponding to 'rig', convert
262  /// them to local transforms in-place.
263  /// The optional 'in_world_space' array can be used to specify if only some
264  /// transforms in 'xforms' are currently in world space.
265  static void computeLocalTransforms(
266  const GU_AgentRig& rig,
267  const UT_BitArray *in_world_space,
268  Matrix4Array& xforms);
269 
270  /// Replaces whitespace, special characters, etc with underscores.
271  static void forceValidName(UT_String &clipname)
272  { clipname.forceValidVariableName(".-"); }
273 
274 private:
275  GU_AgentClip(const UT_StringHolder &name,
276  const UT_StringHolder &filename,
277  const GU_AgentRigConstPtr &rig)
278  : myName(name)
279  , myFileName(filename)
280  , myIsFile(filename.isstring())
281  , myIsLoaded(!filename.isstring())
282  , myHasLoadErrors(false)
283  , myNumXformTracks(0)
284  , myRig(rig)
285  , myStart(0)
286  , mySampleRate(24.0)
287  {
288  }
289 
290 public:
291 
292  ~GU_AgentClip();
293 
294  int64 getMemoryUsage(bool inclusive) const;
295 
296  /// Set this clip to have the specified number of samples, filled with
297  /// identity transforms.
298  ///
299  /// @pre num_samples must be larger than 0.
300  void init(exint num_samples);
301 
302  /// Load from clip.
303  void load(const CL_Clip &clip);
304 
305  /// Copy from another agent clip, and inherit the external reference if
306  /// there is one. If the rigs are different, identity matrices will be used
307  /// for the additional joints.
308  void load(const GU_AgentClip &clip);
309 
310  /// Return the number of transform tracks of the clip that was loaded into
311  /// this clip.
312  // This is currently only used for consistency checks.
313  int numTransformTracks() const
314  { ensureLoaded(); return myNumXformTracks; }
315 
316  /// Save to clip
317  void save(CL_Clip &clip,
318  bool worldspace = false) const;
319 
320  /// Name of the clip.
321  /// @{
322  const UT_StringHolder& name() const
323  { return myName; }
325  { myName = name; }
326  /// @}
327 
328  /// Returns whether the clip references a file on disk.
329  bool isFile() const
330  { return myIsFile; }
331  /// Returns the name of the file referenced by the clip.
332  const UT_StringHolder& fileName() const
333  { UT_ASSERT(isFile()); return myFileName; }
334  /// Clears the external file reference. The clip's contents will also be
335  /// loaded from disk if necessary.
336  void clearIsFile();
337 
338  /// Returns whether the clip's contents have been loaded from disk.
339  bool isLoaded() const
340  { UT_ASSERT(isFile()); return myIsLoaded; }
341  /// Returns whether there were errors when loading the clip from disk.
342  bool hasLoadErrors() const
343  { return myHasLoadErrors; }
344  /// Explicitly loads the clip from disk.
345  bool loadFromFile(
346  UT_StringArray *errors = nullptr) const;
347 
348  const GU_AgentRig& rig() const
349  { return *myRig; }
350 
351  /// Number of transforms in each sample
353  {
354  ensureLoaded();
355  if (myLocalTransforms.entries() < 1)
356  return 0;
357  return myLocalTransforms(0).entries();
358  }
359 
360  /// Number of samples in this clip
362  {
363  ensureLoaded();
364  return myLocalTransforms.entries();
365  }
366 
367  /// Start time of this clip in seconds
368  /// @{
369  fpreal start() const
370  { ensureLoaded(); return myStart; }
372  { ensureLoaded(); myStart = t; }
373  /// @}
374 
375  /// Length of the clip, in seconds.
376  fpreal length() const
377  {
378  return sampleCount() / sampleRate();
379  }
380 
381  /// Sample rate of this clip
382  /// @{
384  { ensureLoaded(); return mySampleRate; }
385  void setSampleRate(fpreal sample_rate)
386  {
387  ensureLoaded();
388  mySampleRate = sample_rate;
389  }
390  /// @}
391 
392  /// Directly set the local transforms for this clip (as an alternative to
393  /// using GU_AgentClip::load()).
394  ///
395  /// @param samples An array of local transform samples
396  ///
397  /// @pre samples (and each sample within) must be at least length 1
398  /// @pre Each entry in samples must be the same length
399  /// @post sampleCount() == samples.entries()
400  /// @post transformsPerSample() == samples.last().entries()
401  void setLocalTransforms(
403 
404  /// Edit the transforms for a specific sample in the clip.
405  void setLocalTransforms(exint sample_i,
406  const XformArray &xforms);
407 
408  const XformArray& localTransforms(exint sample_i) const
409  {
410  ensureLoaded();
411  return myLocalTransforms(sample_i);
412  }
413  Matrix4ArrayConstPtr worldTransforms(exint sample_i) const
414  {
415  ensureLoaded();
416  return myWorldTransforms(sample_i);
417  }
418 
419  /// Samples a transform in the clip at a specific time.
420  void sampleTransform(exint i, fpreal seconds,
421  bool worldspace,
422  Matrix4 &xform_sample) const;
423 
424  /// Add an extra channel into the clip (as an alternative to
425  /// GU_AgentClip::load()).
426  /// If a channel with the same name already exists, its data is replaced
427  /// with the new samples.
428  ///
429  /// @param name Unique name of the channel.
430  /// @param samples Float array with length sampleCount().
431  void addChannel(const UT_StringHolder &name,
432  const FloatType *samples);
433 
434  /// Finds a channel by name. Returns -1 if the channel does not exist.
435  exint findChannel(const UT_StringRef &name) const;
436  /// Samples a channel in the clip at a specific time.
437  /// The channel indices from GU_AgentRig are valid indices for the clip's
438  /// channels.
439  /// For transforms, use GU_AgentClip::sampleTransform().
440  FloatType sampleChannel(exint channel_index,
441  fpreal seconds) const;
442  /// Returns the number of non-transform channels in the clip. This value
443  /// will be >= GU_AgentRig::channelCount().
444  exint channelCount() const;
445  /// Returns the name of the specified channel.
446  const UT_StringHolder &channelName(exint i) const;
447  /// Builds a list of all channel names in the clip (channels defined by
448  /// GU_AgentRig, plus any spare channels).
449  UT_StringArray channelNames() const;
450 
451  /// Add a scaled version of our local transforms using the given clip time.
452  /// If the time in seconds exceeds the length of our clip, then it is
453  /// wrapped around.
454  void addScaledLocalTransforms(
455  XformArray& dst,
456  fpreal scale,
457  fpreal seconds) const;
458  /// Variant of addScaledLocalTransforms that only affects a subset of the
459  /// joints.
460  ///
461  /// @param inv_total_weight Inverse of the total blend weight at each joint.
462  void addScaledLocalTransforms(
463  XformArray &dst,
464  const UT_BitArray &joints,
465  fpreal scale,
466  const UT_Array<fpreal> &inv_total_weights,
467  fpreal seconds) const;
468  /// Perform an additive blend with the specified percentage.
469  void concatLocalTransforms(
470  XformArray &dst,
471  const GU_AgentTransformGroup &xform_grp,
472  fpreal percent,
473  fpreal seconds) const;
474  void addScaledLocalTransform(
475  Xform& xform,
476  exint i,
477  fpreal scale,
478  fpreal seconds) const;
479 
480  /// Adds a scaled version of the channel values given a clip time. Only the
481  /// channels defined on GU_AgentRig are included.
482  void addScaledChannelValues(
483  FloatArray &dst,
484  const UT_BitArray &channels,
485  fpreal scale,
486  const UT_Array<fpreal> &inv_total_weights,
487  fpreal seconds) const;
488 
490  {
491  ensureLoaded();
492  return (seconds - myStart) * mySampleRate;
493  }
494  inline fpreal secondsFromSample(fpreal sample) const
495  {
496  ensureLoaded();
497  return myStart + (sample / mySampleRate);
498  }
500  {
501  return (exint)
502  SYSrint(sampleFromSeconds(seconds));
503  }
505  {
506  fpreal len = sampleCount();
507  fpreal s = SYSfmod(
508  sampleFromSeconds(seconds),
509  len);
510  if (s >= 0)
511  return s;
512  else
513  return s + len;
514  }
515 
516 private:
517  /// Called before any clip data is accessed to ensure that the clip has
518  /// been loaded from disk.
519  SYS_FORCE_INLINE void ensureLoaded() const
520  {
521  if (!myIsLoaded)
522  loadFromFile();
523  }
524 
525  /// Removes the clip from the agent clip file cache.
526  void removeFromFileCache();
527 
528  /// Given a sample time in seconds, find the two samples that we need to
529  /// interpolate between.
530  void getSamples(fpreal scale, fpreal seconds,
531  exint& sample_a, fpreal& weight_a,
532  exint& sample_b, fpreal& weight_b) const;
533 
534  /// Initialize myChannelValueSamples with the channels defined on
535  /// GU_AgentRig.
536  void initChannels(exint num_samples);
537 
538  /// Build myWorldTransforms from myLocalTransforms.
539  void computeWorldSpaceSamples();
540 
541  UT_StringHolder myName;
542  UT_StringHolder myFileName;
543  bool myIsFile;
544  /// Tracks whether the clip's contents have been loaded from disk.
545  bool myIsLoaded;
546  /// Records whether there were any errors when the clip was delay-loaded.
547  bool myHasLoadErrors;
548  int myNumXformTracks; // put here for the same ABI
549  GU_AgentRigConstPtr myRig;
550  fpreal myStart;
551  fpreal mySampleRate;
552 
553  /// The local transforms for the rig, at each sample.
554  UT_Array<XformArray> myLocalTransforms;
555  /// The world transforms for the rig, at each sample.
556  UT_Array<Matrix4ArrayPtr> myWorldTransforms;
557 
558  /// The (non-transform) channel values in the clip, at each sample.
559  /// Channels are ordered beginning with the channels defined on
560  /// GU_AgentRig.
561  UT_Array<FloatArrayPtr> myChannelValueSamples;
562  /// List of spare channels not defined on GU_AgentRig. These are stored at
563  /// the end of myChannelValueSamples[i].
564  UT_StringArray mySpareChannelNames;
565  /// Index into myChannelValueSamples[i] for each channel in
566  /// mySpareChannelNames.
567  UT_StringMap<int> mySpareChannelIndex;
568 
569  /// Lock for delayed loading of the clip data.
570  mutable UT_Lock myDelayLoadLock;
571 };
572 
573 inline exint
575 {
576  ensureLoaded();
577 
578  // First, see if this channel is defined on the rig.
579  exint i = myRig->findChannel(name);
580  if (i >= 0)
581  return i;
582 
583  // Otherwise, it would need to be a spare channel.
584  auto it = mySpareChannelIndex.find(name);
585  return it != mySpareChannelIndex.end() ? it->second : -1;
586 }
587 
588 inline const UT_StringHolder &
590 {
591  ensureLoaded();
592 
593  // Grab the channel name from the rig, unless it is a spare channel.
594  if (i < myRig->channelCount())
595  return myRig->channelName(i);
596  else
597  return mySpareChannelNames[i - myRig->channelCount()];
598 }
599 
600 inline exint
602 {
603  ensureLoaded();
604  return myRig->channelCount() + mySpareChannelNames.entries();
605 }
606 
607 #endif
GLdouble s
Definition: glew.h:1390
GU_AgentXformT< float > GU_AgentXformF
Definition: GU_AgentClip.h:185
fpreal sampleFromSeconds(fpreal seconds) const
Definition: GU_AgentClip.h:489
void leftMult(const UT_SymMatrix3T< S > &m)
Multiply given symmetric matrix on the left.
Definition: UT_Matrix3.h:340
GT_API const UT_StringHolder filename
GLenum src
Definition: glew.h:2410
GU_AgentXformT(T scale)
Definition: GU_AgentClip.h:52
int numTransformTracks() const
Definition: GU_AgentClip.h:313
GLuint const GLchar * name
Definition: glew.h:1814
GU_AgentXformT< double > GU_AgentXformD
Definition: GU_AgentClip.h:186
IMF_EXPORT int & sampleCount(char *base, int xStride, int yStride, int x, int y)
*get result *(waiting if necessary)*A common idiom is to fire a bunch of sub tasks at the and then *wait for them to all complete We provide a helper class
Definition: thread.h:643
SYS_FORCE_INLINE GU_AgentXformT()=default
GLenum GLenum GLenum GLenum GLenum scale
Definition: glew.h:13880
GLboolean GLboolean GLboolean GLboolean a
Definition: glew.h:9477
static void forceValidName(UT_String &clipname)
Replaces whitespace, special characters, etc with underscores.
Definition: GU_AgentClip.h:271
exint findChannel(const UT_StringRef &name) const
Finds a channel by name. Returns -1 if the channel does not exist.
Definition: GU_AgentClip.h:574
void setLerp(const type &a, const type &b, T t)
Definition: GU_AgentClip.h:123
GU_AgentXformT< T > type
Definition: GU_AgentClip.h:47
void getTransform(S &tx, S &ty, S &tz, S &rx, S &ry, S &rz, S &sx, S &sy, S &sz) const
Definition: GU_AgentClip.h:101
Generic symmetric 3x3 matrix.
Definition: UT_SymMatrix3.h:27
const GLdouble * m
Definition: glew.h:9124
fpreal wrappedSampleFromSeconds(fpreal seconds) const
Definition: GU_AgentClip.h:504
void setStart(fpreal t)
Definition: GU_AgentClip.h:371
void setTransform(T tx, T ty, T tz, T rx, T ry, T rz, T sx, T sy, T sz)
Definition: GU_AgentClip.h:78
const UT_Vector3T< T > & translate() const
Definition: GU_AgentClip.h:61
UT_Matrix2T< T > SYSlerp(const UT_Matrix2T< T > &v1, const UT_Matrix2T< T > &v2, S t)
Definition: UT_Matrix2.h:604
Matrix4ArrayConstPtr worldTransforms(exint sample_i) const
Definition: GU_AgentClip.h:413
3D Vector class.
A reference counter base class for use with UT_IntrusivePtr.
const GU_AgentRig & rig() const
Definition: GU_AgentClip.h:348
fpreal start() const
Definition: GU_AgentClip.h:369
UT_Matrix4T< FloatType > Matrix4
Definition: GU_AgentClip.h:213
UT_SharedPtr< FloatArray > FloatArrayPtr
Definition: GU_AgentClip.h:210
long long int64
Definition: SYS_Types.h:111
UT_Array< Matrix4 > Matrix4Array
Definition: GU_AgentClip.h:214
A rig for the agent primitive.
Definition: GU_AgentRig.h:34
GU_AgentXformT< fpreal > GU_AgentXformR
Definition: GU_AgentClip.h:187
const UT_SymMatrix3T< T > & stretch() const
Definition: GU_AgentClip.h:59
void getMatrix4(UT_Matrix4T< T > &m) const
Definition: GU_AgentClip.h:164
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
Definition: UT_SharedPtr.h:28
int64 exint
Definition: SYS_Types.h:120
A factored transform geared for animation blending.
Definition: GU_AgentClip.h:44
fpreal64 dot(const CE_VectorT< T > &a, const CE_VectorT< T > &b)
Definition: CE_Vector.h:218
void concat(T t, const type &xform)
Perform an additive blend with the specified percentage.
Definition: GU_AgentClip.h:148
#define SYS_FORCE_INLINE
Definition: SYS_Inline.h:45
void setName(const UT_StringHolder &name)
Definition: GU_AgentClip.h:324
int int forceValidVariableName(const char *safechars=NULL)
GLenum GLenum dst
Definition: glew.h:2410
#define SYS_DECLARE_IS_POD(T)
Declare a type as POD.
bool isFile() const
Returns whether the clip references a file on disk.
Definition: GU_AgentClip.h:329
Wrapper around hboost::intrusive_ptr.
UT_Array< FloatType > FloatArray
Definition: GU_AgentClip.h:209
GU_AgentXformT< FloatType > Xform
Definition: GU_AgentClip.h:211
#define GU_API
Definition: GU_API.h:14
exint channelCount() const
Definition: GU_AgentClip.h:601
const XformArray & localTransforms(exint sample_i) const
Definition: GU_AgentClip.h:408
UT_SharedPtr< const Matrix4Array > Matrix4ArrayConstPtr
Definition: GU_AgentClip.h:216
fpreal32 SYSrint(fpreal32 val)
Definition: SYS_Floor.h:163
void setTranslates(const UT_Vector3T< S > &translates)
Definition: UT_Matrix4.h:1335
const UT_StringHolder & channelName(exint i) const
Returns the name of the specified channel.
Definition: GU_AgentClip.h:589
void setTransform(const UT_Vector3T< T > &t, const UT_QuaternionT< T > &r, const UT_Vector3T< T > &s)
Definition: GU_AgentClip.h:91
exint entries() const
Alias of size(). size() is preferred.
Definition: UT_Array.h:453
void setSampleRate(fpreal sample_rate)
Definition: GU_AgentClip.h:385
GLdouble GLdouble GLdouble b
Definition: glew.h:9122
UT_Array< Xform > XformArray
Definition: GU_AgentClip.h:212
const UT_StringHolder & name() const
Definition: GU_AgentClip.h:322
double fpreal
Definition: SYS_Types.h:276
Quaternion class.
Definition: UT_Quaternion.h:51
fpreal32 FloatType
Definition: GU_AgentClip.h:208
IMATH_INTERNAL_NAMESPACE_HEADER_ENTER T clip(const T &p, const Box< T > &box)
Definition: ImathBoxAlgo.h:89
fpreal length() const
Length of the clip, in seconds.
Definition: GU_AgentClip.h:376
GLdouble GLdouble GLdouble r
Definition: glew.h:1406
exint nearestSampleFromSeconds(fpreal seconds) const
Definition: GU_AgentClip.h:499
UT_SharedPtr< Matrix4Array > Matrix4ArrayPtr
Definition: GU_AgentClip.h:215
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:135
const UT_StringHolder & fileName() const
Returns the name of the file referenced by the clip.
Definition: GU_AgentClip.h:332
#define const
Definition: zconf.h:214
void addScaled(T s, const type &xform)
Definition: GU_AgentClip.h:137
fpreal sampleRate() const
Definition: GU_AgentClip.h:383
bool hasLoadErrors() const
Returns whether there were errors when loading the clip from disk.
Definition: GU_AgentClip.h:342
GLfloat seconds
Definition: wglew.h:950
fpreal secondsFromSample(fpreal sample) const
Definition: GU_AgentClip.h:494
GLsizei samples
Definition: glew.h:2998
exint transformsPerSample() const
Number of transforms in each sample.
Definition: GU_AgentClip.h:352
float fpreal32
Definition: SYS_Types.h:195
GLdouble GLdouble t
Definition: glew.h:1398
bool isLoaded() const
Returns whether the clip's contents have been loaded from disk.
Definition: GU_AgentClip.h:339
ImageBuf OIIO_API channels(const ImageBuf &src, int nchannels, cspan< int > channelorder, cspan< float > channelvalues={}, cspan< std::string > newchannelnames={}, bool shuffle_channel_names=false, int nthreads=0)
exint sampleCount() const
Number of samples in this clip.
Definition: GU_AgentClip.h:361
const UT_QuaternionT< T > & rotate() const
Definition: GU_AgentClip.h:60
GLenum GLsizei len
Definition: glew.h:7752