7 #ifndef PXR_USD_IMAGING_USD_IMAGING_DATA_SOURCE_ATTRIBUTE_H
8 #define PXR_USD_IMAGING_USD_IMAGING_DATA_SOURCE_ATTRIBUTE_H
74 std::vector<HdSampledDataSource::Time> *outSampleTimes)
override
89 std::vector<double> timeSamples;
96 bool hasFirst, hasLast;
102 if (!hasFirst || first == ignore) {
103 first = interval.GetMin();
106 if (!hasLast || last == ignore ) {
107 last = interval.GetMax();
111 if (timeSamples.empty() || first < timeSamples.front()) {
112 timeSamples.insert(timeSamples.begin(),
first);
114 if (last > timeSamples.back()) {
115 timeSamples.insert(timeSamples.end(),
last);
120 outSampleTimes->resize(timeSamples.size());
121 for (
size_t i = 0; i < timeSamples.size(); ++i) {
122 (*outSampleTimes)[i] = timeSamples[i] - time.
GetValue();
125 return outSampleTimes->size() > 1;
173 HdSampledDataSourceHandle
183 HdSampledDataSourceHandle
210 stageGlobals->FlagAsAssetPathDependent(objPath);
221 sceneIndexPath, timeVaryingFlagLocator)
231 : _usdAttrQuery(usdAttrQuery)
232 , _stageGlobals(stageGlobals)
234 if (!timeVaryingFlagLocator.
IsEmpty()) {
235 if (_usdAttrQuery.ValueMightBeTimeVarying()) {
236 _stageGlobals.FlagAsTimeVarying(
237 sceneIndexPath, timeVaryingFlagLocator);
241 UsdImagingDataSourceAttribute_RecordObjectInStageGlobals<T>(
247 #endif // PXR_USD_IMAGING_USD_IMAGING_DATA_SOURCE_ATTRIBUTE_H
UsdAttributeQuery _usdAttrQuery
bool Get(T *value, UsdTimeCode time=UsdTimeCode::Default()) const
T GetTypedValue(HdSampledDataSource::Time shutterOffset) override
GT_API const UT_StringHolder time
#define PXR_NAMESPACE_OPEN_SCOPE
**But if you need a result
virtual UsdTimeCode GetTime() const =0
Returns the current time represented in this instance.
const UsdImagingDataSourceStageGlobals & _stageGlobals
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
void ignore(T const &) VULKAN_HPP_NOEXCEPT
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())
bool GetFallbackValue(T *value) const
UsdImagingDataSourceAttribute(const UsdAttribute &usdAttr, const UsdImagingDataSourceStageGlobals &stageGlobals, const SdfPath &sceneIndexPath=SdfPath::EmptyPath(), const HdDataSourceLocator &timeVaryingFlagLocator=HdDataSourceLocator::EmptyLocator())
__hostdev__ uint64_t last(uint32_t i) const
USD_API bool GetTimeSamplesInInterval(const GfInterval &interval, std::vector< double > *times) const
void UsdImagingDataSourceAttribute_RecordObjectInStageGlobals< SdfAssetPath >(const UsdImagingDataSourceStageGlobals *stageGlobals, const SdfPath &objPath)
void UsdImagingDataSourceAttribute_RecordObjectInStageGlobals(const UsdImagingDataSourceStageGlobals *stageGlobals, const SdfPath &objPath)
#define PXR_NAMESPACE_CLOSE_SCOPE
USD_API bool GetBracketingTimeSamples(double desiredTime, double *lower, double *upper, bool *hasTimeSamples) const
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