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
175 : _usdAttrQuery(usdAttr)
176 , _stageGlobals(stageGlobals)
178 if (!timeVaryingFlagLocator.
IsEmpty()) {
181 sceneIndexPath, timeVaryingFlagLocator);
192 : _usdAttrQuery(usdAttrQuery)
193 , _stageGlobals(stageGlobals)
195 if (!timeVaryingFlagLocator.
IsEmpty()) {
198 sceneIndexPath, timeVaryingFlagLocator);
205 #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
#define PXR_NAMESPACE_CLOSE_SCOPE
virtual void FlagAsTimeVarying(const SdfPath &primPath, const HdDataSourceLocator &locator) const =0
Flags the given primPath as time varying at the given locator.
static HD_API const HdDataSourceLocator & EmptyLocator()
VtValue GetValue(HdSampledDataSource::Time shutterOffset) override