24 #ifndef PXR_USD_IMAGING_USD_IMAGING_DATA_SOURCE_ATTRIBUTE_H
25 #define PXR_USD_IMAGING_USD_IMAGING_DATA_SOURCE_ATTRIBUTE_H
74 std::vector<HdSampledDataSource::Time> *outSampleTimes)
override
85 std::vector<double> timeSamples;
89 if (timeSamples.empty() || timeSamples[0] > interval.GetMin()) {
90 timeSamples.insert(timeSamples.begin(), interval.GetMin());
92 if (timeSamples.back() < interval.GetMax()) {
93 timeSamples.push_back(interval.GetMax());
98 outSampleTimes->resize(timeSamples.size());
99 for (
size_t i = 0; i < timeSamples.size(); ++i) {
100 (*outSampleTimes)[i] = timeSamples[i] - time.
GetValue();
149 HdSampledDataSourceHandle
159 HdSampledDataSourceHandle
186 stageGlobals->FlagAsAssetPathDependent(objPath);
197 sceneIndexPath, timeVaryingFlagLocator)
207 : _usdAttrQuery(usdAttrQuery)
208 , _stageGlobals(stageGlobals)
210 if (!timeVaryingFlagLocator.
IsEmpty()) {
211 if (_usdAttrQuery.ValueMightBeTimeVarying()) {
212 _stageGlobals.FlagAsTimeVarying(
213 sceneIndexPath, timeVaryingFlagLocator);
217 UsdImagingDataSourceAttribute_RecordObjectInStageGlobals<T>(
223 #endif // PXR_USD_IMAGING_USD_IMAGING_DATA_SOURCE_ATTRIBUTE_H
bool Get(T *value, UsdTimeCode time=UsdTimeCode::Default()) const
T GetTypedValue(HdSampledDataSource::Time shutterOffset) override
GT_API const UT_StringHolder time
**But if you need a result
virtual UsdTimeCode GetTime() const =0
Returns the current time represented in this instance.
static SDF_API const SdfPath & EmptyPath()
The empty path value, equivalent to SdfPath().
USD_API bool ValueMightBeTimeVarying() const
bool GetContributingSampleTimesForInterval(HdSampledDataSource::Time startTime, HdSampledDataSource::Time endTime, std::vector< HdSampledDataSource::Time > *outSampleTimes) override
HD_DECLARE_DATASOURCE(UsdImagingDataSourceAttribute< T >)
USDIMAGING_API HdSampledDataSourceHandle UsdImagingDataSourceAttributeNew(const UsdAttribute &usdAttr, const UsdImagingDataSourceStageGlobals &stageGlobals, const SdfPath &sceneIndexPath=SdfPath::EmptyPath(), const HdDataSourceLocator &timeVaryingFlagLocator=HdDataSourceLocator::EmptyLocator())
USD_API bool GetTimeSamplesInInterval(const GfInterval &interval, std::vector< double > *times) const
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
void UsdImagingDataSourceAttribute_RecordObjectInStageGlobals< SdfAssetPath >(const UsdImagingDataSourceStageGlobals *stageGlobals, const SdfPath &objPath)
void UsdImagingDataSourceAttribute_RecordObjectInStageGlobals(const UsdImagingDataSourceStageGlobals *stageGlobals, const SdfPath &objPath)
#define PXR_NAMESPACE_CLOSE_SCOPE
static HD_API const HdDataSourceLocator & EmptyLocator()
USD_API const UsdAttribute & GetAttribute() const
Return the attribute associated with this query.
VtValue GetValue(HdSampledDataSource::Time shutterOffset) override