All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
primAdapter.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 USDIMAGING_PRIM_ADAPTER_H
25 #define USDIMAGING_PRIM_ADAPTER_H
26 
28 
29 #include "pxr/pxr.h"
30 #include "pxr/usdImaging/usdImaging/api.h"
31 #include "pxr/usdImaging/usdImaging/version.h"
32 #include "pxr/usdImaging/usdImaging/collectionCache.h"
33 #include "pxr/usdImaging/usdImaging/valueCache.h"
34 #include "pxr/usdImaging/usdImaging/inheritedCache.h"
35 
36 #include "pxr/imaging/hd/changeTracker.h"
37 #include "pxr/imaging/hd/texture.h"
38 #include "pxr/imaging/hd/selection.h"
39 #include "pxr/usd/usd/attribute.h"
40 #include "pxr/usd/usd/prim.h"
41 #include "pxr/usd/usd/timeCode.h"
42 
43 #include "pxr/usd/usdShade/shader.h"
44 
45 #include "pxr/base/tf/type.h"
46 
47 #include <boost/enable_shared_from_this.hpp>
48 #include <boost/shared_ptr.hpp>
49 
50 PXR_NAMESPACE_OPEN_SCOPE
51 
52 class UsdPrim;
53 
54 // Forward declaration for nested class.
55 class UsdImagingDelegate;
59 
60 typedef boost::shared_ptr<class UsdImagingPrimAdapter>
61  UsdImagingPrimAdapterSharedPtr;
62 
68  : public boost::enable_shared_from_this<UsdImagingPrimAdapter> {
69 public:
70 
71  // ---------------------------------------------------------------------- //
73  // ---------------------------------------------------------------------- //
74 
76  {}
77 
78  USDIMAGING_API
79  virtual ~UsdImagingPrimAdapter();
80 
84  virtual SdfPath Populate(UsdPrim const& prim,
85  UsdImagingIndexProxy* index,
86  UsdImagingInstancerContext const* instancerContext = NULL) = 0;
87 
88  // Indicates whether population traversal should be pruned based on
89  // prim-specific features (like whether it's imageable).
90  USDIMAGING_API
91  static bool ShouldCullSubtree(UsdPrim const& prim);
92 
93  // Indicates whether population traversal should be pruned based on
94  // adapter-specific features (like whether the adapter is an instance
95  // adapter, and wants to do its own population).
96  USDIMAGING_API
97  virtual bool ShouldCullChildren() const;
98 
99  // Indicates the adapter is a multiplexing adapter (e.g. PointInstancer),
100  // potentially managing its children. This flag is used in nested
101  // instancer cases to determine which adapter is assigned to which prim.
102  USDIMAGING_API
103  virtual bool IsInstancerAdapter() const;
104 
105  // Indicates whether this adapter can populate a master prim. By policy,
106  // you can't directly instance a gprim, but you can directly instance proxy
107  // objects (like cards). Note: masters don't have attributes, so an adapter
108  // opting in here needs to check if prims it's populating are master prims,
109  // and if so find a copy of the instancing prim.
110  USDIMAGING_API
111  virtual bool CanPopulateMaster() const;
112 
113  // ---------------------------------------------------------------------- //
115  // ---------------------------------------------------------------------- //
116 
122  virtual void TrackVariability(UsdPrim const& prim,
123  SdfPath const& cachePath,
124  HdDirtyBits* timeVaryingBits,
126  instancerContext = NULL) const = 0;
127 
132  virtual void UpdateForTime(UsdPrim const& prim,
133  SdfPath const& cachePath,
134  UsdTimeCode time,
135  HdDirtyBits requestedBits,
137  instancerContext = NULL) const = 0;
138 
139  // ---------------------------------------------------------------------- //
141  // ---------------------------------------------------------------------- //
142 
153  USDIMAGING_API
154  virtual HdDirtyBits ProcessPrimChange(UsdPrim const& prim,
155  SdfPath const& cachePath,
156  TfTokenVector const& changedFields);
157 
160  virtual HdDirtyBits ProcessPropertyChange(UsdPrim const& prim,
161  SdfPath const& cachePath,
162  TfToken const& propertyName) = 0;
163 
167  USDIMAGING_API
168  virtual void ProcessPrimResync(SdfPath const& cachePath,
169  UsdImagingIndexProxy* index);
170 
173  USDIMAGING_API
174  virtual void ProcessPrimRemoval(SdfPath const& cachePath,
175  UsdImagingIndexProxy* index);
176 
177 
178  virtual void MarkDirty(UsdPrim const& prim,
179  SdfPath const& cachePath,
180  HdDirtyBits dirty,
181  UsdImagingIndexProxy* index) = 0;
182 
183  USDIMAGING_API
184  virtual void MarkRefineLevelDirty(UsdPrim const& prim,
185  SdfPath const& cachePath,
186  UsdImagingIndexProxy* index);
187 
188  USDIMAGING_API
189  virtual void MarkReprDirty(UsdPrim const& prim,
190  SdfPath const& cachePath,
191  UsdImagingIndexProxy* index);
192 
193  USDIMAGING_API
194  virtual void MarkCullStyleDirty(UsdPrim const& prim,
195  SdfPath const& cachePath,
196  UsdImagingIndexProxy* index);
197 
198  USDIMAGING_API
199  virtual void MarkRenderTagDirty(UsdPrim const& prim,
200  SdfPath const& cachePath,
201  UsdImagingIndexProxy* index);
202 
203  USDIMAGING_API
204  virtual void MarkTransformDirty(UsdPrim const& prim,
205  SdfPath const& cachePath,
206  UsdImagingIndexProxy* index);
207 
208  USDIMAGING_API
209  virtual void MarkVisibilityDirty(UsdPrim const& prim,
210  SdfPath const& cachePath,
211  UsdImagingIndexProxy* index);
212 
213  USDIMAGING_API
214  virtual void MarkMaterialDirty(UsdPrim const& prim,
215  SdfPath const& cachePath,
216  UsdImagingIndexProxy* index);
217 
218  USDIMAGING_API
219  virtual void MarkWindowPolicyDirty(UsdPrim const& prim,
220  SdfPath const& cachePath,
221  UsdImagingIndexProxy* index);
222 
223  // ---------------------------------------------------------------------- //
225  // ---------------------------------------------------------------------- //
226  USDIMAGING_API
227  virtual void InvokeComputation(SdfPath const& computationPath,
228  HdExtComputationContext* context);
229 
230  // ---------------------------------------------------------------------- //
232  // ---------------------------------------------------------------------- //
233 
249  USDIMAGING_API
250  virtual SdfPath GetPathForInstanceIndex(SdfPath const &protoCachePath,
251  int protoIndex,
252  int *instanceCountForThisLevel,
253  int *instancerIndex,
254  SdfPath *masterCachePath = NULL,
255  SdfPathVector *
256  instanceContext = NULL);
257 
260  USDIMAGING_API
261  virtual SdfPath GetInstancer(SdfPath const &instancePath);
262 
264  USDIMAGING_API
265  virtual std::vector<VtArray<TfToken>>
266  GetInstanceCategories(UsdPrim const& prim);
267 
270  USDIMAGING_API
271  virtual size_t
272  SampleInstancerTransform(UsdPrim const& instancerPrim,
273  SdfPath const& instancerPath,
274  UsdTimeCode time,
275  size_t maxNumSamples,
276  float *sampleTimes,
277  GfMatrix4d *sampleValues);
278 
281  USDIMAGING_API
282  virtual size_t
283  SamplePrimvar(UsdPrim const& usdPrim,
284  SdfPath const& cachePath,
285  TfToken const& key,
286  UsdTimeCode time,
287  size_t maxNumSamples,
288  float *sampleTimes,
289  VtValue *sampleValues);
290 
292  USDIMAGING_API
293  virtual PxOsdSubdivTags GetSubdivTags(UsdPrim const& usdPrim,
294  SdfPath const& cachePath,
295  UsdTimeCode time) const;
296 
297  // ---------------------------------------------------------------------- //
299  // ---------------------------------------------------------------------- //
300 
301  // NOTE: This method is currently only used by PointInstancer
302  // style instances, and not instanceable-references.
303 
311  USDIMAGING_API
312  virtual SdfPath GetPathForInstanceIndex(SdfPath const &instancerCachePath,
313  SdfPath const &protoCachePath,
314  int protoIndex,
315  int *instanceCountForThisLevel,
316  int *instancerIndex,
317  SdfPath *masterCachePath,
318  SdfPathVector *instanceContext);
319 
323  USDIMAGING_API
324  virtual VtIntArray GetInstanceIndices(SdfPath const &instancerPath,
325  SdfPath const &protoRprimPath,
326  UsdTimeCode time);
327 
331  USDIMAGING_API
333  SdfPath const &instancerPath,
334  SdfPath const &protoInstancerPath,
335  UsdTimeCode time) const;
336 
337  // ---------------------------------------------------------------------- //
339  // ---------------------------------------------------------------------- //
340  USDIMAGING_API
341  virtual bool PopulateSelection(HdSelection::HighlightMode const& highlightMode,
342  SdfPath const &usdPath,
343  VtIntArray const &instanceIndices,
344  HdSelectionSharedPtr const &result);
345 
346  // ---------------------------------------------------------------------- //
348  // ---------------------------------------------------------------------- //
349 
350  USDIMAGING_API
351  virtual HdTextureResource::ID
352  GetTextureResourceID(UsdPrim const& usdPrim, SdfPath const &id,
353  UsdTimeCode time, size_t salt) const;
354 
355  USDIMAGING_API
356  virtual HdTextureResourceSharedPtr
357  GetTextureResource(UsdPrim const& usdPrim, SdfPath const &id,
358  UsdTimeCode time) const;
359 
360  // ---------------------------------------------------------------------- //
362  // ---------------------------------------------------------------------- //
363 
364  USDIMAGING_API
365  virtual HdVolumeFieldDescriptorVector
366  GetVolumeFieldDescriptors(UsdPrim const& usdPrim, SdfPath const &id,
367  UsdTimeCode time) const;
368 
369  // ---------------------------------------------------------------------- //
371  // ---------------------------------------------------------------------- //
372 
374  USDIMAGING_API
376 
378  USDIMAGING_API
379  void SetDelegate(UsdImagingDelegate* delegate);
380 
381  USDIMAGING_API
382  bool IsChildPath(SdfPath const& path) const;
383 
387  USDIMAGING_API
388  bool GetVisible(UsdPrim const& prim, UsdTimeCode time) const;
389 
392  USDIMAGING_API
393  TfToken GetPurpose(UsdPrim const& prim) const;
394 
398  USDIMAGING_API
399  GfMatrix4d GetTransform(UsdPrim const& prim, UsdTimeCode time,
400  bool ignoreRootTransform = false) const;
401 
403  USDIMAGING_API
404  virtual size_t
405  SampleTransform(UsdPrim const& prim,
406  SdfPath const& cachePath,
407  UsdTimeCode time,
408  size_t maxNumSamples,
409  float *sampleTimes,
410  GfMatrix4d *sampleValues);
411 
414  USDIMAGING_API
415  SdfPath GetMaterialUsdPath(UsdPrim const& prim) const;
416 
418  USDIMAGING_API
420  UsdImagingInstancerContext const* instancerContext);
421 
424  USDIMAGING_API
425  virtual SdfPathVector GetDependPaths(SdfPath const &path) const;
426 
429  USDIMAGING_API
430  TfToken GetModelDrawMode(UsdPrim const& prim);
431 
432  // ---------------------------------------------------------------------- //
434  // ---------------------------------------------------------------------- //
435 
437  virtual bool IsSupported(UsdImagingIndexProxy const* index) const {
438  return true;
439  }
440 
441 protected:
442  typedef UsdImagingValueCache::Key Keys;
443 
444  template <typename T>
445  T _Get(UsdPrim const& prim, TfToken const& attrToken,
446  UsdTimeCode time) const {
447  T value;
448  prim.GetAttribute(attrToken).Get<T>(&value, time);
449  return value;
450  }
451 
452  template <typename T>
453  void _GetPtr(UsdPrim const& prim, TfToken const& key, UsdTimeCode time,
454  T* out) const {
455  prim.GetAttribute(key).Get<T>(out, time);
456  }
457 
458  USDIMAGING_API
459  UsdImagingValueCache* _GetValueCache() const;
460 
461  USDIMAGING_API
462  UsdPrim _GetPrim(SdfPath const& usdPath) const;
463 
464  // Returns the prim adapter for the given \p prim, or an invalid pointer if
465  // no adapter exists. If \p prim is an instance and \p ignoreInstancing
466  // is \c true, the instancing adapter will be ignored and an adapter will
467  // be looked up based on \p prim's type.
468  USDIMAGING_API
469  const UsdImagingPrimAdapterSharedPtr&
470  _GetPrimAdapter(UsdPrim const& prim, bool ignoreInstancing = false) const;
471 
472  USDIMAGING_API
473  const UsdImagingPrimAdapterSharedPtr&
474  _GetAdapter(TfToken const& adapterKey) const;
475 
476  // XXX: Transitional API
477  // Returns the instance proxy prim path for a USD-instanced prim, given the
478  // instance chain leading to that prim. The paths are sorted from more to
479  // less local; the first path is the prim path (possibly in master), then
480  // instance paths (possibly in master); the last path is the prim or
481  // instance path in the scene.
482  USDIMAGING_API
483  SdfPath _GetPrimPathFromInstancerChain(
484  SdfPathVector const& instancerChain) const;
485 
486  USDIMAGING_API
487  UsdTimeCode _GetTimeWithOffset(float offset) const;
488 
489  // Converts \p cachePath to the path in the render index.
490  USDIMAGING_API
491  SdfPath _ConvertCachePathToIndexPath(SdfPath const& cachePath) const;
492 
493  // Converts \p indexPath to the path in the USD stage
494  USDIMAGING_API
495  SdfPath _ConvertIndexPathToCachePath(SdfPath const& indexPath) const;
496 
497  // Returns the rprim paths in the renderIndex rooted at \p indexPath.
498  USDIMAGING_API
499  SdfPathVector _GetRprimSubtree(SdfPath const& indexPath) const;
500 
501  // Returns the material binding purpose from the renderer delegate.
502  USDIMAGING_API
503  TfToken _GetMaterialBindingPurpose() const;
504 
505  // Returns the material context from the renderer delegate.
506  USDIMAGING_API
507  TfToken _GetMaterialNetworkSelector() const;
508 
509  // Returns true if render delegate wants primvars to be filtered based.
510  // This will filter the primvars based on the bound material primvar needs.
511  USDIMAGING_API
512  bool _IsPrimvarFilteringNeeded() const;
513 
514  // Returns the shader source type from the render delegate.
515  USDIMAGING_API
516  TfTokenVector _GetShaderSourceTypes() const;
517 
518  // Returns \c true if \p usdPath is included in the scene delegate's
519  // invised path list.
520  USDIMAGING_API
521  bool _IsInInvisedPaths(SdfPath const& usdPath) const;
522 
523  // Determines if an attribute is varying and if so, sets the given
524  // \p dirtyFlag in the \p dirtyFlags and increments a perf counter. Returns
525  // true if the attribute is varying.
526  //
527  // If \p exists is non-null, _IsVarying will store whether the attribute
528  // was found. If the attribute is not found, it counts as non-varying.
529  USDIMAGING_API
530  bool _IsVarying(UsdPrim prim, TfToken const& attrName,
531  HdDirtyBits dirtyFlag, TfToken const& perfToken,
532  HdDirtyBits* dirtyFlags, bool isInherited,
533  bool* exists = nullptr) const;
534 
535  // Determines if the prim's transform (CTM) is varying and if so, sets the
536  // given \p dirtyFlag in the \p dirtyFlags and increments a perf counter.
537  // Returns true if the prim's transform is varying.
538  USDIMAGING_API
539  bool _IsTransformVarying(UsdPrim prim,
540  HdDirtyBits dirtyFlag,
541  TfToken const& perfToken,
542  HdDirtyBits* dirtyFlags) const;
543 
544  // Convenience method for adding or updating a primvar descriptor.
545  // Role defaults to empty token (none).
546  USDIMAGING_API
547  void _MergePrimvar(
548  HdPrimvarDescriptorVector* vec,
549  TfToken const& name,
550  HdInterpolation interp,
551  TfToken const& role = TfToken()) const;
552 
553  // Convenience method for computing a primvar. THe primvar will only be
554  // added to the list in the valueCache if there is no primvar of the same
555  // name already present. Thus, "local" primvars should be merged before
556  // inherited primvars.
557  USDIMAGING_API
558  void _ComputeAndMergePrimvar(UsdPrim const& prim,
559  SdfPath const& cachePath,
560  UsdGeomPrimvar const& primvar,
561  UsdTimeCode time,
562  UsdImagingValueCache* valueCache,
563  HdInterpolation *interpOverride = nullptr)
564  const;
565 
566  // If a primvar is added or removed from the list of primvar descriptors,
567  // we need to do extra change processing. This returns true if:
568  // (the primvar is in the value cache) XOR (the primvar is on the usd prim)
569  USDIMAGING_API
570  bool _PrimvarChangeRequiresResync(UsdPrim const& prim,
571  SdfPath const& cachePath,
572  TfToken const& propertyName,
573  TfToken const& primvarName) const;
574 
575  virtual void _RemovePrim(SdfPath const& cachePath,
576  UsdImagingIndexProxy* index) = 0;
577 
578  USDIMAGING_API
579  UsdImaging_CollectionCache& _GetCollectionCache() const;
580 
581  USDIMAGING_API
582  UsdImaging_CoordSysBindingStrategy::value_type
583  _GetCoordSysBindings(UsdPrim const& prim) const;
584 
585  USDIMAGING_API
586  UsdImaging_InheritedPrimvarStrategy::value_type
587  _GetInheritedPrimvars(UsdPrim const& prim) const;
588 
589  USDIMAGING_API
590  GfInterval _GetCurrentTimeSamplingInterval();
591 
592  USDIMAGING_API
593  bool _DoesDelegateSupportCoordSys() const;
594 
595  // Conversion functions between usd and hydra enums.
596  USDIMAGING_API
597  static HdInterpolation _UsdToHdInterpolation(TfToken const& usdInterp);
598  USDIMAGING_API
599  static TfToken _UsdToHdRole(TfToken const& usdRole);
600 
601 private:
602 
603  UsdImagingDelegate* _delegate;
604 
605 };
606 
607 class UsdImagingPrimAdapterFactoryBase : public TfType::FactoryBase {
608 public:
609  virtual UsdImagingPrimAdapterSharedPtr New() const = 0;
610 };
611 
612 template <class T>
613 class UsdImagingPrimAdapterFactory : public UsdImagingPrimAdapterFactoryBase {
614 public:
615  virtual UsdImagingPrimAdapterSharedPtr New() const
616  {
617  return UsdImagingPrimAdapterSharedPtr(new T);
618  }
619 };
620 
621 
622 PXR_NAMESPACE_CLOSE_SCOPE
623 
624 #endif // USDIMAGING_PRIM_ADAPTER_H
USDIMAGING_API bool GetVisible(UsdPrim const &prim, UsdTimeCode time) const
Returns true if the given prim is visible, taking into account inherited visibility values...
Interface class that defines the execution environment for the client to run a computation.
Tags for non-hierarchial subdiv surfaces.
Definition: subdivTags.h:41
virtual void UpdateForTime(UsdPrim const &prim, SdfPath const &cachePath, UsdTimeCode time, HdDirtyBits requestedBits, UsdImagingInstancerContext const *instancerContext=NULL) const =0
Populates the cache for the given prim, time and requestedBits.
virtual USDIMAGING_API size_t SamplePrimvar(UsdPrim const &usdPrim, SdfPath const &cachePath, TfToken const &key, UsdTimeCode time, size_t maxNumSamples, float *sampleTimes, VtValue *sampleValues)
Sample the primvar for the given prim.
virtual USDIMAGING_API HdDirtyBits ProcessPrimChange(UsdPrim const &prim, SdfPath const &cachePath, TfTokenVector const &changedFields)
Returns a bit mask of attributes to be updated, or HdChangeTracker::AllDirty if the entire prim must ...
USDIMAGING_API GfMatrix4d GetTransform(UsdPrim const &prim, UsdTimeCode time, bool ignoreRootTransform=false) const
Fetches the transform for the given prim at the given time from a pre-computed cache of prim transfor...
virtual USDIMAGING_API PxOsdSubdivTags GetSubdivTags(UsdPrim const &usdPrim, SdfPath const &cachePath, UsdTimeCode time) const
Get the subdiv tags for this prim.
HighlightMode
Selection modes allow differentiation in selection highlight behavior.
Definition: selection.h:53
This proxy class exposes a subset of the private Delegate API to PrimAdapters.
Definition: indexProxy.h:47
USDIMAGING_API void SetDelegate(UsdImagingDelegate *delegate)
A thread-local XformCache provided by the delegate.
A heterogeneous value container without type erasure.
Definition: valueCache.h:56
virtual USDIMAGING_API void ProcessPrimRemoval(SdfPath const &cachePath, UsdImagingIndexProxy *index)
Removes all associated Rprims and dependencies from the render index without scheduling them for repo...
virtual SdfPath Populate(UsdPrim const &prim, UsdImagingIndexProxy *index, UsdImagingInstancerContext const *instancerContext=NULL)=0
Called to populate the RenderIndex for this UsdPrim.
Base class of all factory types.
Definition: type.h:79
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:89
Stores a 4x4 matrix of double elements.
Definition: matrix4d.h:88
virtual bool IsSupported(UsdImagingIndexProxy const *index) const
Returns true if the adapter can be populated into the target index.
Definition: primAdapter.h:437
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:67
USDIMAGING_API TfToken GetModelDrawMode(UsdPrim const &prim)
Gets the model:drawMode attribute for the given prim, walking up the namespace if necessary...
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
A basic mathematical interval class.
Definition: interval.h:50
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:287
virtual USDIMAGING_API SdfPathVector GetDependPaths(SdfPath const &path) const
Returns the depending rprim paths which don&#39;t exist in descendants.
bool Get(T *value, UsdTimeCode time=UsdTimeCode::Default()) const
Perform value resolution to fetch the value of this attribute at the requested UsdTimeCode time...
Definition: attribute.h:435
USDIMAGING_API TfToken GetPurpose(UsdPrim const &prim) const
Returns the purpose token for prim.
virtual void TrackVariability(UsdPrim const &prim, SdfPath const &cachePath, HdDirtyBits *timeVaryingBits, UsdImagingInstancerContext const *instancerContext=NULL) const =0
For the given prim, variability is detected and stored in timeVaryingBits.
virtual USDIMAGING_API size_t SampleTransform(UsdPrim const &prim, SdfPath const &cachePath, UsdTimeCode time, size_t maxNumSamples, float *sampleTimes, GfMatrix4d *sampleValues)
Samples the transform for the given prim.
USDIMAGING_API GfMatrix4d GetRootTransform() const
The root transform provided by the delegate.
virtual USDIMAGING_API SdfPath GetInstancer(SdfPath const &instancePath)
Returns the instancer path for given instancePath.
virtual USDIMAGING_API size_t SampleInstancerTransform(UsdPrim const &instancerPrim, SdfPath const &instancerPath, UsdTimeCode time, size_t maxNumSamples, float *sampleTimes, GfMatrix4d *sampleValues)
Sample the instancer transform for the given prim.
USDIMAGING_API SdfPath GetMaterialUsdPath(UsdPrim const &prim) const
Gets the material path for the given prim, walking up namespace if necessary.
USDIMAGING_API SdfPath GetInstancerCachePath(UsdPrim const &prim, UsdImagingInstancerContext const *instancerContext)
Gets the instancer cachePath for the given prim and instancerContext.
USD_API UsdAttribute GetAttribute(const TfToken &attrName) const
Return a UsdAttribute with the name attrName.
Object used by instancer prim adapters to pass along context about the instancer and instance prim to...
Schema wrapper for UsdAttribute for authoring and introspecting attributes that are primvars...
Definition: primvar.h:260
virtual USDIMAGING_API VtIntArray GetInstanceIndices(SdfPath const &instancerPath, SdfPath const &protoRprimPath, UsdTimeCode time)
Returns the instance index array for protoRprimPath, instanced by instancerPath.
virtual HdDirtyBits ProcessPropertyChange(UsdPrim const &prim, SdfPath const &cachePath, TfToken const &propertyName)=0
Returns a bit mask of attributes to be updated, or HdChangeTracker::AllDirty if the entire prim must ...
The primary translation layer between the Hydra (Hd) core and the Usd scene graph.
Definition: delegate.h:86
virtual USDIMAGING_API GfMatrix4d GetRelativeInstancerTransform(SdfPath const &instancerPath, SdfPath const &protoInstancerPath, UsdTimeCode time) const
Returns the transform of protoInstancerPath relative to instancerPath.
virtual USDIMAGING_API void ProcessPrimResync(SdfPath const &cachePath, UsdImagingIndexProxy *index)
When a PrimResync event occurs, the prim may have been deleted entirely, adapter plug-ins should over...
virtual USDIMAGING_API SdfPath GetPathForInstanceIndex(SdfPath const &protoCachePath, int protoIndex, int *instanceCountForThisLevel, int *instancerIndex, SdfPath *masterCachePath=NULL, SdfPathVector *instanceContext=NULL)
Returns the usd path of the original instancer prim corresponding to the given instanced protoCachePa...
Provides a container which may hold any type, and provides introspection and iteration over array typ...
Definition: value.h:182
virtual USDIMAGING_API std::vector< VtArray< TfToken > > GetInstanceCategories(UsdPrim const &prim)
Return an array of the categories used by each instance.