All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
clipsAPI.h
Go to the documentation of this file.
1 //
2 // Copyright 2016 Pixar
3 //
4 // Licensed under the Apache License, Version 2.0 (the "Apache License")
5 // with the following modification; you may not use this file except in
6 // compliance with the Apache License and the following modification to it:
7 // Section 6. Trademarks. is deleted and replaced with:
8 //
9 // 6. Trademarks. This License does not grant permission to use the trade
10 // names, trademarks, service marks, or product names of the Licensor
11 // and its affiliates, except as required to comply with Section 4(c) of
12 // the License and to reproduce the content of the NOTICE file.
13 //
14 // You may obtain a copy of the Apache License at
15 //
16 // http://www.apache.org/licenses/LICENSE-2.0
17 //
18 // Unless required by applicable law or agreed to in writing, software
19 // distributed under the Apache License with the above modification is
20 // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
21 // KIND, either express or implied. See the Apache License for the specific
22 // language governing permissions and limitations under the Apache License.
23 //
24 #ifndef USD_GENERATED_CLIPSAPI_H
25 #define USD_GENERATED_CLIPSAPI_H
26 
28 
29 #include "pxr/pxr.h"
30 #include "pxr/usd/usd/api.h"
31 #include "pxr/usd/usd/apiSchemaBase.h"
32 #include "pxr/usd/usd/prim.h"
33 #include "pxr/usd/usd/stage.h"
34 #include "pxr/usd/usd/tokens.h"
35 
36 #include "pxr/base/vt/value.h"
37 
38 #include "pxr/base/gf/vec3d.h"
39 #include "pxr/base/gf/vec3f.h"
40 #include "pxr/base/gf/matrix4d.h"
41 
42 #include "pxr/base/tf/token.h"
43 #include "pxr/base/tf/type.h"
44 
45 PXR_NAMESPACE_OPEN_SCOPE
46 
47 class SdfAssetPath;
48 
49 // -------------------------------------------------------------------------- //
50 // CLIPSAPI //
51 // -------------------------------------------------------------------------- //
52 
106 {
107 public:
112 
117  explicit UsdClipsAPI(const UsdPrim& prim=UsdPrim())
118  : UsdAPISchemaBase(prim)
119  {
120  }
121 
125  explicit UsdClipsAPI(const UsdSchemaBase& schemaObj)
126  : UsdAPISchemaBase(schemaObj)
127  {
128  }
129 
131  USD_API
132  virtual ~UsdClipsAPI();
133 
137  USD_API
138  static const TfTokenVector &
139  GetSchemaAttributeNames(bool includeInherited=true);
140 
150  USD_API
151  static UsdClipsAPI
152  Get(const UsdStagePtr &stage, const SdfPath &path);
153 
154 
155 protected:
159  USD_API
160  UsdSchemaType _GetSchemaType() const override;
161 
162 private:
163  // needs to invoke _GetStaticTfType.
164  friend class UsdSchemaRegistry;
165  USD_API
166  static const TfType &_GetStaticTfType();
167 
168  static bool _IsTypedSchema();
169 
170  // override SchemaBase virtuals.
171  USD_API
172  const TfType &_GetTfType() const override;
173 
174 public:
175  // ===================================================================== //
176  // Feel free to add custom code below this line, it will be preserved by
177  // the code generator.
178  //
179  // Just remember to:
180  // - Close the class declaration with };
181  // - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
182  // - Close the include guard with #endif
183  // ===================================================================== //
184  // --(BEGIN CUSTOM CODE)--
185  //
186 
187  // --------------------------------------------------------------------- //
195  // --------------------------------------------------------------------- //
196 
206  USD_API
207  bool GetClips(VtDictionary* clips) const;
208 
211  USD_API
212  bool SetClips(const VtDictionary& clips);
213 
229  USD_API
230  bool GetClipSets(SdfStringListOp* clipSets) const;
231 
234  USD_API
235  bool SetClipSets(const SdfStringListOp& clipSets);
236 
240  USD_API
241  bool GetClipAssetPaths(VtArray<SdfAssetPath>* assetPaths,
242  const std::string& clipSet) const;
246  USD_API
247  bool GetClipAssetPaths(VtArray<SdfAssetPath>* assetPaths) const;
248 
251  USD_API
252  bool SetClipAssetPaths(const VtArray<SdfAssetPath>& assetPaths,
253  const std::string& clipSet);
257  USD_API
258  bool SetClipAssetPaths(const VtArray<SdfAssetPath>& assetPaths);
259 
269  USD_API
270  bool GetClipPrimPath(std::string* primPath,
271  const std::string& clipSet) const;
275  USD_API
276  bool GetClipPrimPath(std::string* primPath) const;
277 
280  USD_API
281  bool SetClipPrimPath(const std::string& primPath,
282  const std::string& clipSet);
286  USD_API
287  bool SetClipPrimPath(const std::string& primPath);
288 
294  USD_API
295  bool GetClipActive(VtVec2dArray* activeClips,
296  const std::string& clipSet) const;
300  USD_API
301  bool GetClipActive(VtVec2dArray* activeClips) const;
302 
305  USD_API
306  bool SetClipActive(const VtVec2dArray& activeClips,
307  const std::string& clipSet);
311  USD_API
312  bool SetClipActive(const VtVec2dArray& activeClips);
313 
324  USD_API
325  bool GetClipTimes(VtVec2dArray* clipTimes,
326  const std::string& clipSet) const;
330  USD_API
331  bool GetClipTimes(VtVec2dArray* clipTimes) const;
332 
335  USD_API
336  bool SetClipTimes(const VtVec2dArray& clipTimes,
337  const std::string& clipSet);
341  USD_API
342  bool SetClipTimes(const VtVec2dArray& clipTimes);
343 
356  USD_API
357  bool GetClipManifestAssetPath(SdfAssetPath* manifestAssetPath,
358  const std::string& clipSet) const;
362  USD_API
363  bool GetClipManifestAssetPath(SdfAssetPath* manifestAssetPath) const;
364 
367  USD_API
368  bool SetClipManifestAssetPath(const SdfAssetPath& manifestAssetPath,
369  const std::string& clipSet);
373  USD_API
374  bool SetClipManifestAssetPath(const SdfAssetPath& manifestAssetPath);
375 
406  USD_API
407  bool GetClipTemplateAssetPath(std::string* clipTemplateAssetPath,
408  const std::string& clipSet) const;
412  USD_API
413  bool GetClipTemplateAssetPath(std::string* clipTemplateAssetPath) const;
414 
417  USD_API
418  bool SetClipTemplateAssetPath(const std::string& clipTemplateAssetPath,
419  const std::string& clipSet);
423  USD_API
424  bool SetClipTemplateAssetPath(const std::string& clipTemplateAssetPath);
425 
429  USD_API
430  bool GetClipTemplateStride(double* clipTemplateStride,
431  const std::string& clipSet) const;
435  USD_API
436  bool GetClipTemplateStride(double* clipTemplateStride) const;
437 
440  USD_API
441  bool SetClipTemplateActiveOffset(const double clipTemplateActiveOffset,
442  const std::string& clipSet);
443 
447  USD_API
448  bool SetClipTemplateActiveOffset(const double clipTemplateActiveOffset);
449 
452  USD_API
453  bool GetClipTemplateActiveOffset(double* clipTemplateActiveOffset,
454  const std::string& clipSet) const;
455 
459  USD_API
460  bool GetClipTemplateActiveOffset(double* clipTemplateActiveOffset) const;
461 
464  USD_API
465  bool SetClipTemplateStride(const double clipTemplateStride,
466  const std::string& clipSet);
470  USD_API
471  bool SetClipTemplateStride(const double clipTemplateStride);
472 
477  USD_API
478  bool GetClipTemplateStartTime(double* clipTemplateStartTime,
479  const std::string& clipSet) const;
483  USD_API
484  bool GetClipTemplateStartTime(double* clipTemplateStartTime) const;
485 
488  USD_API
489  bool SetClipTemplateStartTime(const double clipTemplateStartTime,
490  const std::string& clipSet);
494  USD_API
495  bool SetClipTemplateStartTime(const double clipTemplateStartTime);
496 
501  USD_API
502  bool GetClipTemplateEndTime(double* clipTemplateEndTime,
503  const std::string& clipSet) const;
507  USD_API
508  bool GetClipTemplateEndTime(double* clipTemplateEndTime) const;
509 
512  USD_API
513  bool SetClipTemplateEndTime(const double clipTemplateEndTime,
514  const std::string& clipSet);
518  USD_API
519  bool SetClipTemplateEndTime(const double clipTemplateEndTime);
520 
527  USD_API
528  static bool IsAuthoringLegacyClipMetadata();
529 
531 
532 };
533 
535 #define USDCLIPS_INFO_KEYS \
536  (active) \
537  (assetPaths) \
538  (manifestAssetPath) \
539  (primPath) \
540  (templateAssetPath) \
541  (templateEndTime) \
542  (templateStartTime) \
543  (templateStride) \
544  (templateActiveOffset) \
545  (times) \
546 
547 TF_DECLARE_PUBLIC_TOKENS(UsdClipsAPIInfoKeys, USD_API, USDCLIPS_INFO_KEYS);
567 
569 #define USDCLIPS_SET_NAMES \
570  ((default_, "default")) \
571 
572 TF_DECLARE_PUBLIC_TOKENS(UsdClipsAPISetNames, USD_API, USDCLIPS_SET_NAMES);
581 
582 PXR_NAMESPACE_CLOSE_SCOPE
583 
584 #endif
USD_API bool SetClipTemplateStride(const double clipTemplateStride, const std::string &clipSet)
Set the template stride for the clip set named clipSet.
USD_API bool SetClipPrimPath(const std::string &primPath, const std::string &clipSet)
Set the clip prim path for the clip set named clipSet.
static USD_API UsdClipsAPI Get(const UsdStagePtr &stage, const SdfPath &path)
Return a UsdClipsAPI holding the prim adhering to this schema at path on stage.
USD_API bool GetClipTemplateStartTime(double *clipTemplateStartTime, const std::string &clipSet) const
A double which indicates the start of the range USD will use to search for asset paths for the clip s...
USD_API bool GetClipAssetPaths(VtArray< SdfAssetPath > *assetPaths, const std::string &clipSet) const
List of asset paths to the clips in the clip set named clipSet.
USD_API bool GetClipActive(VtVec2dArray *activeClips, const std::string &clipSet) const
List of pairs (time, clip index) indicating the time on the stage at which the clip in the clip set n...
UsdClipsAPI is an API schema that provides an interface to a prim&#39;s clip metadata.
Definition: clipsAPI.h:105
A map with string keys and VtValue values.
Definition: dictionary.h:61
The base class for all API schemas.
USD_API bool SetClipTemplateAssetPath(const std::string &clipTemplateAssetPath, const std::string &clipSet)
Set the clip template asset path for the clip set named clipSet.
USD_API bool GetClipTemplateEndTime(double *clipTemplateEndTime, const std::string &clipSet) const
A double which indicates the end of the range USD will use to to search for asset paths for the clip ...
USD_API bool SetClipTimes(const VtVec2dArray &clipTimes, const std::string &clipSet)
Set the clip times metadata for this prim.
UsdClipsAPI(const UsdPrim &prim=UsdPrim())
Construct a UsdClipsAPI on UsdPrim prim .
Definition: clipsAPI.h:117
UsdClipsAPI(const UsdSchemaBase &schemaObj)
Construct a UsdClipsAPI on the prim held by schemaObj .
Definition: clipsAPI.h:125
Non-applied API schema.
#define TF_DECLARE_PUBLIC_TOKENS(...)
Macro to define public tokens.
Definition: staticTokens.h:118
USD_API UsdSchemaType _GetSchemaType() const override
Returns the type of schema this class belongs to.
UsdSchemaType
An enum representing which type of schema a given schema class belongs to.
Definition: common.h:149
UsdPrim is the sole persistent scenegraph object on a UsdStage, and is the embodiment of a &quot;Prim&quot; as ...
Definition: prim.h:131
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:438
Represents an arbitrary dimensional rectangular container class.
Definition: array.h:193
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:287
USD_API bool GetClipPrimPath(std::string *primPath, const std::string &clipSet) const
Path to the prim in the clips in the clip set named clipSet from which time samples will be read...
virtual USD_API ~UsdClipsAPI()
Destructor.
USD_API bool GetClips(VtDictionary *clips) const
Dictionary that contains the definition of the clip sets on this prim.
USD_API bool GetClipTemplateActiveOffset(double *clipTemplateActiveOffset, const std::string &clipSet) const
A double representing the offset value used by USD when determining the active period for each clip...
USD_API bool SetClipManifestAssetPath(const SdfAssetPath &manifestAssetPath, const std::string &clipSet)
Set the clip manifest asset path for this prim.
USD_API bool SetClipTemplateActiveOffset(const double clipTemplateActiveOffset, const std::string &clipSet)
Set the clip template offset for the clip set named clipSet.
USD_API bool GetClipTimes(VtVec2dArray *clipTimes, const std::string &clipSet) const
List of pairs (stage time, clip time) indicating the time in the active clip in the clip set named cl...
USD_API bool GetClipTemplateStride(double *clipTemplateStride, const std::string &clipSet) const
A double representing the increment value USD will use when searching for asset paths for the clip se...
USD_API bool SetClipAssetPaths(const VtArray< SdfAssetPath > &assetPaths, const std::string &clipSet)
Set the clip asset paths for the clip set named clipSet.
Contains an asset path and an optional resolved path.
Definition: assetPath.h:43
USD_API bool SetClipActive(const VtVec2dArray &activeClips, const std::string &clipSet)
Set the active clip metadata for the clip set named clipSet.
TfType represents a dynamic runtime type.
Definition: type.h:70
Singleton registry that provides access to prim and property definition information for registered Us...
static USD_API const TfTokenVector & GetSchemaAttributeNames(bool includeInherited=true)
Return a vector of names of all pre-declared attributes for this schema class and all its ancestor cl...
USD_API bool GetClipTemplateAssetPath(std::string *clipTemplateAssetPath, const std::string &clipSet) const
A template string representing a set of assets to be used as clips for the clip set named clipSet...
static const UsdSchemaType schemaType
Compile time constant representing what kind of schema this class is.
Definition: clipsAPI.h:111
USD_API bool SetClips(const VtDictionary &clips)
Set the clips dictionary for this prim.
USD_API bool SetClipSets(const SdfStringListOp &clipSets)
Set the clip sets list op for this prim.
The base class for all schema types in Usd.
Definition: schemaBase.h:56
USD_API bool SetClipTemplateStartTime(const double clipTemplateStartTime, const std::string &clipSet)
Set the template start time for the clip set named clipSet.
USD_API bool GetClipSets(SdfStringListOp *clipSets) const
ListOp that may be used to affect how opinions from clip sets are applied during value resolution...
static USD_API bool IsAuthoringLegacyClipMetadata()
Return true if the setter functions that do not take a clip set author values to legacy metadata fiel...
USD_API bool GetClipManifestAssetPath(SdfAssetPath *manifestAssetPath, const std::string &clipSet) const
Asset path for the clip manifest for the clip set named clipSet.
USD_API bool SetClipTemplateEndTime(const double clipTemplateEndTime, const std::string &clipSet)
Set the template end time for the clipset named clipSet.