All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
instanceAdapter.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 PXR_USD_IMAGING_USD_IMAGING_INSTANCE_ADAPTER_H
25 #define PXR_USD_IMAGING_USD_IMAGING_INSTANCE_ADAPTER_H
26 
28 
29 #include "pxr/pxr.h"
30 #include "pxr/usdImaging/usdImaging/primAdapter.h"
31 
32 #include "pxr/base/tf/hashmap.h"
33 
34 #include <mutex>
35 
36 PXR_NAMESPACE_OPEN_SCOPE
37 
38 
92 {
93 public:
95 
97  virtual ~UsdImagingInstanceAdapter();
98 
99  virtual SdfPath Populate(
100  UsdPrim const& prim,
101  UsdImagingIndexProxy* index,
102  UsdImagingInstancerContext const* instancerContext = nullptr) override;
103 
104  virtual bool ShouldCullChildren() const override;
105 
106  virtual bool IsInstancerAdapter() const override;
107 
108  // ---------------------------------------------------------------------- //
110  // ---------------------------------------------------------------------- //
111 
112  virtual void TrackVariability(UsdPrim const& prim,
113  SdfPath const& cachePath,
114  HdDirtyBits* timeVaryingBits,
116  instancerContext = NULL) const override;
117 
118  virtual void UpdateForTime(UsdPrim const& prim,
119  SdfPath const& cachePath,
120  UsdTimeCode time,
121  HdDirtyBits requestedBits,
123  instancerContext = NULL) const override;
124 
125  // ---------------------------------------------------------------------- //
127  // ---------------------------------------------------------------------- //
128 
129  virtual HdDirtyBits ProcessPropertyChange(UsdPrim const& prim,
130  SdfPath const& cachePath,
131  TfToken const& propertyName)
132  override;
133 
134  virtual void ProcessPrimResync(SdfPath const& cachePath,
135  UsdImagingIndexProxy* index) override;
136 
137  virtual void ProcessPrimRemoval(SdfPath const& cachePath,
138  UsdImagingIndexProxy* index) override;
139 
140 
141  virtual void MarkDirty(UsdPrim const& prim,
142  SdfPath const& cachePath,
143  HdDirtyBits dirty,
144  UsdImagingIndexProxy* index) override;
145 
146  // As this adapter hijacks the adapter for the child prim
147  // We need to forward these messages on, in case the child
148  // adapter needs them
149  virtual void MarkRefineLevelDirty(UsdPrim const& prim,
150  SdfPath const& cachePath,
151  UsdImagingIndexProxy* index) override;
152 
153  virtual void MarkReprDirty(UsdPrim const& prim,
154  SdfPath const& cachePath,
155  UsdImagingIndexProxy* index) override;
156 
157  virtual void MarkCullStyleDirty(UsdPrim const& prim,
158  SdfPath const& cachePath,
159  UsdImagingIndexProxy* index) override;
160 
161  virtual void MarkRenderTagDirty(UsdPrim const& prim,
162  SdfPath const& cachePath,
163  UsdImagingIndexProxy* index) override;
164 
165  virtual void MarkTransformDirty(UsdPrim const& prim,
166  SdfPath const& cachePath,
167  UsdImagingIndexProxy* index) override;
168 
169  virtual void MarkVisibilityDirty(UsdPrim const& prim,
170  SdfPath const& cachePath,
171  UsdImagingIndexProxy* index) override;
172 
173  // ---------------------------------------------------------------------- //
175  // ---------------------------------------------------------------------- //
176 
177  std::vector<VtArray<TfToken>> GetInstanceCategories(
178  UsdPrim const& prim) override;
179 
180  GfMatrix4d GetInstancerTransform(UsdPrim const& instancerPrim,
181  SdfPath const& instancerPath,
182  UsdTimeCode time) const override;
183 
184  size_t SampleInstancerTransform(UsdPrim const& instancerPrim,
185  SdfPath const& instancerPath,
186  UsdTimeCode time,
187  size_t maxSampleCount,
188  float *sampleTimes,
189  GfMatrix4d *sampleValues) override;
190 
191  size_t SampleTransform(UsdPrim const& prim,
192  SdfPath const& cachePath,
193  UsdTimeCode time,
194  size_t maxNumSamples,
195  float *sampleTimes,
196  GfMatrix4d *sampleValues) override;
197 
198  size_t SamplePrimvar(UsdPrim const& usdPrim,
199  SdfPath const& cachePath,
200  TfToken const& key,
201  UsdTimeCode time,
202  size_t maxNumSamples,
203  float *sampleTimes,
204  VtValue *sampleValues) override;
205 
207  UsdPrim const& usdPrim,
208  SdfPath const& cachePath,
209  TfToken const& instanceInheritablePurpose) const override;
210 
211  PxOsdSubdivTags GetSubdivTags(UsdPrim const& usdPrim,
212  SdfPath const& cachePath,
213  UsdTimeCode time) const override;
214 
215  VtValue GetTopology(UsdPrim const& prim,
216  SdfPath const& cachePath,
217  UsdTimeCode time) const override;
218 
219  HdCullStyle GetCullStyle(UsdPrim const& prim,
220  SdfPath const& cachePath,
221  UsdTimeCode time) const override;
222 
223  GfRange3d GetExtent(UsdPrim const& usdPrim,
224  SdfPath const& cachePath,
225  UsdTimeCode time) const override;
226 
227  bool GetVisible(UsdPrim const& usdPrim,
228  SdfPath const& cachePath,
229  UsdTimeCode time) const override;
230 
231  bool GetDoubleSided(UsdPrim const& prim,
232  SdfPath const& cachePath,
233  UsdTimeCode time) const override;
234 
235  GfMatrix4d GetTransform(UsdPrim const& prim,
236  SdfPath const& cachePath,
237  UsdTimeCode time,
238  bool ignoreRootTransform = false) const override;
239 
240  SdfPath GetMaterialId(UsdPrim const& prim,
241  SdfPath const& cachePath,
242  UsdTimeCode time) const override;
243 
244  HdExtComputationInputDescriptorVector
245  GetExtComputationInputs(UsdPrim const& prim,
246  SdfPath const& cachePath,
247  const UsdImagingInstancerContext* instancerContext)
248  const override;
249 
250 
251  HdExtComputationOutputDescriptorVector
252  GetExtComputationOutputs(UsdPrim const& prim,
253  SdfPath const& cachePath,
254  const UsdImagingInstancerContext* instancerContext)
255  const override;
256 
257  HdExtComputationPrimvarDescriptorVector
258  GetExtComputationPrimvars(
259  UsdPrim const& prim,
260  SdfPath const& cachePath,
261  HdInterpolation interpolation,
262  const UsdImagingInstancerContext* instancerContext) const override;
263 
264  VtValue
265  GetExtComputationInput(
266  UsdPrim const& prim,
267  SdfPath const& cachePath,
268  TfToken const& name,
269  UsdTimeCode time,
270  const UsdImagingInstancerContext* instancerContext) const override;
271 
272  std::string
273  GetExtComputationKernel(
274  UsdPrim const& prim,
275  SdfPath const& cachePath,
276  const UsdImagingInstancerContext* instancerContext) const override;
277 
278 
279  VtValue Get(UsdPrim const& prim,
280  SdfPath const& cachePath,
281  TfToken const& key,
282  UsdTimeCode time) const override;
283 
284  // ---------------------------------------------------------------------- //
286  // ---------------------------------------------------------------------- //
287 
289  SdfPath const &parentInstancerPath,
290  SdfPath const &instancerPath,
291  UsdTimeCode time) const override;
292 
293  // ---------------------------------------------------------------------- //
295  // ---------------------------------------------------------------------- //
296 
297  virtual SdfPath GetScenePrimPath(
298  SdfPath const& cachePath,
299  int instanceIndex,
300  HdInstancerContext *instancerContext) const override;
301 
302  virtual bool PopulateSelection(
303  HdSelection::HighlightMode const& highlightMode,
304  SdfPath const &cachePath,
305  UsdPrim const &usdPrim,
306  int const hydraInstanceIndex,
307  VtIntArray const &parentInstanceIndices,
308  HdSelectionSharedPtr const &result) const override;
309 
310  // ---------------------------------------------------------------------- //
312  // ---------------------------------------------------------------------- //
313 
314  virtual HdVolumeFieldDescriptorVector
315  GetVolumeFieldDescriptors(UsdPrim const& usdPrim, SdfPath const &id,
316  UsdTimeCode time) const override;
317 
318 protected:
319  virtual void _RemovePrim(SdfPath const& cachePath,
320  UsdImagingIndexProxy* index) override final;
321 
322 private:
323 
324  SdfPath _Populate(UsdPrim const& prim,
325  UsdImagingIndexProxy* index,
326  UsdImagingInstancerContext const* instancerContext,
327  SdfPath const& parentProxyPath);
328 
329  struct _ProtoPrim;
330  struct _ProtoGroup;
331  struct _InstancerData;
332 
333  bool _IsChildPrim(UsdPrim const& prim,
334  SdfPath const& cachePath) const;
335 
336  // Returns true if the given prim serves as an instancer.
337  bool _PrimIsInstancer(UsdPrim const& prim) const;
338 
339  // Inserts prototype prims for the given \p usdPrim into the \p index.
340  // Any inserted gprims will be inserted under a special path combining
341  // \p instancerPath and \p protoName.
342  SdfPath
343  _InsertProtoPrim(UsdPrimRange::iterator *iter,
344  const TfToken& protoName,
345  SdfPath materialId,
346  TfToken drawMode,
347  TfToken inheritablePurpose,
348  SdfPath instancerPath,
349  UsdImagingPrimAdapterSharedPtr const& primAdapter,
350  UsdImagingPrimAdapterSharedPtr const& instancerAdapter,
351  UsdImagingIndexProxy* index,
352  bool *isLeafInstancer);
353 
354  // For a usd path, collects the instancers to resync.
355  void _ResyncPath(SdfPath const& cachePath,
356  UsdImagingIndexProxy* index,
357  bool reload);
358  // Removes and optionally reloads all instancer data, both locally and
359  // from the render index.
360  void _ResyncInstancer(SdfPath const& instancerPath,
361  UsdImagingIndexProxy* index, bool reload);
362 
363  // Computes per-frame data in the instancer map. This is primarily used
364  // during update to send new instance indices out to Hydra.
365  struct _ComputeInstanceMapFn;
366  VtIntArray _ComputeInstanceMap(UsdPrim const& instancerPrim,
367  _InstancerData const& instrData,
368  UsdTimeCode time) const;
369 
370  // Precomputes the instancer visibility data (as visible, invis, varying
371  // per-node), and returns whether the instance map is variable.
372  // Note: this function assumes the instancer data is already locked by
373  // the caller...
374  struct _ComputeInstanceMapVariabilityFn;
375  bool _ComputeInstanceMapVariability(UsdPrim const& instancerPrim,
376  _InstancerData const& instrData) const;
377 
378  // Gets the associated _ProtoPrim and instancer context for the given
379  // instancer and cache path.
380  _ProtoPrim const& _GetProtoPrim(SdfPath const& instancerPath,
381  SdfPath const& cachePath,
382  UsdImagingInstancerContext* ctx) const;
383 
384  // Gets the associated _ProtoPrim and instancerContext if cachePath is a
385  // child path and returns \c true, otherwise returns \c false.
386  bool _GetProtoPrimForChild(
387  UsdPrim const& usdPrim,
388  SdfPath const& cachePath,
389  _ProtoPrim const** proto,
390  UsdImagingInstancerContext* ctx) const;
391 
392  // Computes the transforms for all instances corresponding to the given
393  // instancer.
394  struct _ComputeInstanceTransformFn;
395  bool _ComputeInstanceTransforms(UsdPrim const& instancer,
396  VtMatrix4dArray* transforms,
397  UsdTimeCode time) const;
398 
399  // Gathers the authored transforms time samples given an instancer.
400  struct _GatherInstanceTransformTimeSamplesFn;
401  bool _GatherInstanceTransformsTimeSamples(UsdPrim const& instancer,
402  GfInterval interval,
403  std::vector<double>* outTimes)
404  const;
405 
406  // Gathers the specified primvar time samples given an instancer.
407  struct _GatherInstancePrimvarTimeSamplesFn;
408  bool _GatherInstancePrimvarTimeSamples(UsdPrim const& instancer,
409  TfToken const& key,
410  GfInterval interval,
411  std::vector<double>* outTimes)
412  const;
413 
414  // Returns true if any of the instances corresponding to the given
415  // instancer has a varying transform.
416  struct _IsInstanceTransformVaryingFn;
417  bool _IsInstanceTransformVarying(UsdPrim const& instancer) const;
418 
419  // Computes the value of a primvar for all instances corresponding to the
420  // given instancer. The templated version runs the templated functor,
421  // and the un-templated version does type dispatch.
422  template<typename T> struct _ComputeInheritedPrimvarFn;
423 
424  template<typename T>
425  bool _ComputeInheritedPrimvar(UsdPrim const& instancer,
426  TfToken const& primvarName,
427  VtValue *result,
428  UsdTimeCode time) const;
429 
430  bool _ComputeInheritedPrimvar(UsdPrim const& instancer,
431  TfToken const& primvarName,
432  SdfValueTypeName const& type,
433  VtValue *result,
434  UsdTimeCode time) const;
435 
436  // Returns true if any of the instances corresponding to the given
437  // instancer has varying inherited primvars.
438  struct _IsInstanceInheritedPrimvarVaryingFn;
439  bool _IsInstanceInheritedPrimvarVarying(UsdPrim const& instancer) const;
440 
441  struct _PopulateInstanceSelectionFn;
442  struct _GetScenePrimPathFn;
443 
444  // Helper functions for dealing with "actual" instances to be drawn.
445  //
446  // Suppose we have:
447  // /Root
448  // Instance_A (master: /__Prototype_1)
449  // Instance_B (master: /__Prototype_1)
450  // /__Prototype_1
451  // AnotherInstance_A (master: /__Prototype_2)
452  // /__Prototype_2
453  //
454  // /__Prototype_2 has only one associated instance in the Usd scenegraph:
455  // /__Prototype_1/AnotherInstance_A. However, imaging actually needs to draw
456  // two instances of /__Prototype_2, because AnotherInstance_A is a nested
457  // instance beneath /__Prototype_1, and there are two instances of
458  // /__Prototype_1.
459  //
460  // Each instance to be drawn is addressed by the chain of instances
461  // that caused it to be drawn. In the above example, the two instances
462  // of /__Prototype_2 to be drawn are:
463  //
464  // [ /Root/Instance_A, /__Prototype_1/AnotherInstance_A ],
465  // [ /Root/Instance_B, /__Prototype_1/AnotherInstance_A ]
466  //
467  // This "instance context" describes the chain of opinions that
468  // ultimately affect the final drawn instance. For example, the
469  // transform of each instance to draw is the combined transforms
470  // of the prims in each context.
471  template <typename Functor>
472  void _RunForAllInstancesToDraw(UsdPrim const& instancer, Functor* fn) const;
473  template <typename Functor>
474  bool _RunForAllInstancesToDrawImpl(UsdPrim const& instancer,
475  std::vector<UsdPrim>* instanceContext,
476  size_t* instanceIdx,
477  Functor* fn) const;
478 
479  typedef TfHashMap<SdfPath, size_t, SdfPath::Hash> _InstancerDrawCounts;
480  size_t _CountAllInstancesToDraw(UsdPrim const& instancer) const;
481  size_t _CountAllInstancesToDrawImpl(UsdPrim const& instancer,
482  _InstancerDrawCounts* drawCounts) const;
483 
484  // A proto prim represents a single adapter under a prototype root declared
485  // on the instancer.
486  struct _ProtoPrim {
487  _ProtoPrim() {}
488  // Each prim will become a prototype "child" under the instancer. This
489  // path is the path to the prim on the Usd Stage (the path to a single
490  // mesh, for example).
491  SdfPath path;
492  // The prim adapter for the actual prototype prim.
493  UsdImagingPrimAdapterSharedPtr adapter;
494  };
495 
496  // Indexed by prototype cachePath (each prim has one entry)
497  typedef TfHashMap<SdfPath, _ProtoPrim, SdfPath::Hash> _PrimMap;
498 
499  // All data associated with a given instancer prim. PrimMap could
500  // technically be split out to avoid two lookups, however it seems cleaner
501  // to keep everything bundled up under the instancer path.
502  struct _InstancerData {
503  _InstancerData() : numInstancesToDraw(0), refreshVariability(false) { }
504 
505  // The master prim path associated with this instancer.
506  SdfPath masterPath;
507 
508  // The USD material path associated with this instancer.
509  SdfPath materialUsdPath;
510 
511  // The drawmode associated with this instancer.
512  TfToken drawMode;
513 
514  // The purpose value associated with this instance that can be inherited
515  // by proto prims that need to inherit ancestor purpose.
516  TfToken inheritablePurpose;
517 
518  // Inherited primvar
519  struct PrimvarInfo {
520  TfToken name;
521  SdfValueTypeName type;
522  bool operator==(const PrimvarInfo& rhs) const;
523  bool operator<(const PrimvarInfo& rhs) const;
524  };
525  std::vector<PrimvarInfo> inheritedPrimvars;
526 
527  // Paths to Usd instance prims. Note that this is not necessarily
528  // equivalent to all the instances that will be drawn. See below.
529  std::vector<SdfPath> instancePaths;
530 
531  // Number of actual instances of this instancer that will be
532  // drawn. See comment on _RunForAllInstancesToDraw.
533  // XXX: This is mutable so that we can precache it in TrackVariability;
534  // it's inappropriate to track it in _Populate since not all instances
535  // will have been populated.
536  mutable size_t numInstancesToDraw;
537 
538  // Cached visibility. This vector contains an entry for each instance
539  // that will be drawn (i.e., visibility.size() == numInstancesToDraw).
540  enum Visibility {
541  Invisible, //< Invisible over all time
542  Visible, //< Visible over all time
543  Varying, //< Visibility varies over time
544  Unknown //< Visibility has not yet been checked
545  };
546  // XXX: This is mutable so that we can precache visibility per-instance
547  // in TrackVariability(). Can we replace this with some kind of usage
548  // of an inherited cache?
549  mutable std::vector<Visibility> visibility;
550 
551  // Map of all rprims for this instancer prim.
552  _PrimMap primMap;
553 
554  // This is a set of reference paths, where this instancer needs
555  // to deferer to another instancer. While refered to here as a child
556  // instancer, the actual relationship is more like a directed graph.
557  SdfPathSet childPointInstancers;
558 
559  // Nested (child) native instances.
560  SdfPathVector nestedInstances;
561 
562  // Parent native instances.
563  SdfPathVector parentInstances;
564 
565  // Flag indicating we've queued up the delegate to call TrackVariability
566  // on this instancer. We record this so we don't do it multiple times.
567  mutable bool refreshVariability;
568  };
569 
570  // Map from hydra instancer cache path to the various instancer state we
571  // need to answer adapter queries.
572  // Note: this map is modified in multithreaded code paths and must be
573  // locked.
574  typedef std::unordered_map<SdfPath, _InstancerData, SdfPath::Hash>
575  _InstancerDataMap;
576  _InstancerDataMap _instancerData;
577 
578  // Map from USD instance prim paths to the cache path of the hydra instancer
579  // they are assigned to (which will typically be the path to the first
580  // instance of this instance group we run across).
581  // XXX: consider to move this forwarding map into HdRenderIndex.
582  typedef TfHashMap<SdfPath, SdfPath, SdfPath::Hash>
583  _InstanceToInstancerMap;
584  _InstanceToInstancerMap _instanceToInstancerMap;
585 
586  // Hd and UsdImaging think of instancing in terms of an 'instancer' that
587  // specifies a list of 'prototype' prims that are shared per instance.
588  //
589  // For Usd scenegraph instancing, a master prim and its descendents
590  // roughly correspond to the instancer and prototype prims. However,
591  // Hd requires a different instancer and rprims for different combinations
592  // of inherited attributes (material binding, draw mode, etc).
593  // This means we cannot use the Usd master prim as the instancer, because
594  // we can't represent this in the case where multiple Usd instances share
595  // the same master but have different bindings.
596  //
597  // Instead, we use the first instance of a master with a given set of
598  // inherited attributes as our instancer. For example, if /A and /B are
599  // both instances of /__Prototype_1 but /A and /B have different material
600  // bindings authored on them, both /A and /B will be instancers,
601  // with their own set of rprims and instance indices.
602  //
603  // The below is a multimap from master path to the cache path of the
604  // hydra instancer. The data for the instancer is located in the
605  // _InstancerDataMap.
606  typedef TfHashMultiMap<SdfPath, SdfPath, SdfPath::Hash>
607  _MasterToInstancerMap;
608  _MasterToInstancerMap _masterToInstancerMap;
609 };
610 
611 
612 PXR_NAMESPACE_CLOSE_SCOPE
613 
614 #endif // PXR_USD_IMAGING_USD_IMAGING_INSTANCE_ADAPTER_H
bool GetVisible(UsdPrim const &usdPrim, SdfPath const &cachePath, UsdTimeCode time) const override
Returns true if the given prim is visible, taking into account inherited visibility values...
Tags for non-hierarchial subdiv surfaces.
Definition: subdivTags.h:41
virtual SdfPath Populate(UsdPrim const &prim, UsdImagingIndexProxy *index, UsdImagingInstancerContext const *instancerContext=nullptr) override
Called to populate the RenderIndex for this UsdPrim.
Basic type: 3-dimensional floating point range.
Definition: range3d.h:64
virtual void ProcessPrimResync(SdfPath const &cachePath, UsdImagingIndexProxy *index) override
When a PrimResync event occurs, the prim may have been deleted entirely, adapter plug-ins should over...
VT_API bool operator==(VtDictionary const &, VtDictionary const &)
Equality comparison.
HdCullStyle GetCullStyle(UsdPrim const &prim, SdfPath const &cachePath, UsdTimeCode time) const override
Gets the cullstyle of a specific path in the scene graph.
std::vector< VtArray< TfToken > > GetInstanceCategories(UsdPrim const &prim) override
Return an array of the categories used by each instance.
HighlightMode
Selection modes allow differentiation in selection highlight behavior.
Definition: selection.h:55
Represents a value type name, i.e.
Definition: valueTypeName.h:83
This proxy class exposes a subset of the private Delegate API to PrimAdapters.
Definition: indexProxy.h:47
virtual void ProcessPrimRemoval(SdfPath const &cachePath, UsdImagingIndexProxy *index) override
Removes all associated Rprims and dependencies from the render index without scheduling them for repo...
size_t SampleInstancerTransform(UsdPrim const &instancerPrim, SdfPath const &instancerPath, UsdTimeCode time, size_t maxSampleCount, float *sampleTimes, GfMatrix4d *sampleValues) override
Sample the instancer transform for the given prim.
GfMatrix4d GetTransform(UsdPrim const &prim, SdfPath const &cachePath, UsdTimeCode time, bool ignoreRootTransform=false) const override
Fetches the transform for the given prim at the given time from a pre-computed cache of prim transfor...
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:87
virtual void UpdateForTime(UsdPrim const &prim, SdfPath const &cachePath, UsdTimeCode time, HdDirtyBits requestedBits, UsdImagingInstancerContext const *instancerContext=NULL) const override
Populates the cache for the given prim, time and requestedBits.
GfMatrix4d GetInstancerTransform(UsdPrim const &instancerPrim, SdfPath const &instancerPath, UsdTimeCode time) const override
Get the instancer transform for the given prim.
Stores a 4x4 matrix of double elements.
Definition: matrix4d.h:88
Represent a time value, which may be either numeric, holding a double value, or a sentinel value UsdT...
Definition: timeCode.h:85
Base class for all PrimAdapters.
Definition: primAdapter.h:66
GfRange3d GetExtent(UsdPrim const &usdPrim, SdfPath const &cachePath, UsdTimeCode time) const override
Reads the extent from the given prim.
UsdPrim is the sole persistent scenegraph object on a UsdStage, and is the embodiment of a &quot;Prim&quot; as ...
Definition: prim.h:132
A basic mathematical interval class.
Definition: interval.h:50
bool GetDoubleSided(UsdPrim const &prim, SdfPath const &cachePath, UsdTimeCode time) const override
Reads double-sided from the given prim. If not authored, returns false.
VtValue GetTopology(UsdPrim const &prim, SdfPath const &cachePath, UsdTimeCode time) const override
Gets the topology object of a specific Usd prim.
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:288
VtValue Get(UsdPrim const &prim, SdfPath const &cachePath, TfToken const &key, UsdTimeCode time) const override
Gets the value of the parameter named key for the given prim (which has the given cache path) and giv...
TfToken GetPurpose(UsdPrim const &usdPrim, SdfPath const &cachePath, TfToken const &instanceInheritablePurpose) const override
Returns the purpose token for prim.
Delegate support for instanced prims.
PxOsdSubdivTags GetSubdivTags(UsdPrim const &usdPrim, SdfPath const &cachePath, UsdTimeCode time) const override
Get the subdiv tags for this prim.
size_t SampleTransform(UsdPrim const &prim, SdfPath const &cachePath, UsdTimeCode time, size_t maxNumSamples, float *sampleTimes, GfMatrix4d *sampleValues) override
Samples the transform for the given prim.
virtual void TrackVariability(UsdPrim const &prim, SdfPath const &cachePath, HdDirtyBits *timeVaryingBits, UsdImagingInstancerContext const *instancerContext=NULL) const override
For the given prim, variability is detected and stored in timeVaryingBits.
Object used by instancer prim adapters to pass along context about the instancer and instance prim to...
virtual HdDirtyBits ProcessPropertyChange(UsdPrim const &prim, SdfPath const &cachePath, TfToken const &propertyName) override
Returns a bit mask of attributes to be updated, or HdChangeTracker::AllDirty if the entire prim must ...
size_t SamplePrimvar(UsdPrim const &usdPrim, SdfPath const &cachePath, TfToken const &key, UsdTimeCode time, size_t maxNumSamples, float *sampleTimes, VtValue *sampleValues) override
Sample the primvar for the given prim.
A forward iterator into a UsdPrimRange.
Definition: primRange.h:140
Provides a container which may hold any type, and provides introspection and iteration over array typ...
Definition: value.h:168
virtual GfMatrix4d GetRelativeInstancerTransform(SdfPath const &parentInstancerPath, SdfPath const &instancerPath, UsdTimeCode time) const override
Returns the transform of protoInstancerPath relative to instancerPath.