7 #ifndef PXR_USD_IMAGING_USD_IMAGING_DATA_SOURCE_ATTRIBUTE_H
8 #define PXR_USD_IMAGING_USD_IMAGING_DATA_SOURCE_ATTRIBUTE_H
59 std::vector<HdSampledDataSource::Time> *outSampleTimes)
override
70 std::vector<double> timeSamples;
77 bool hasFirst, hasLast;
83 if (!hasFirst || first == ignore) {
84 first = interval.GetMin();
87 if (!hasLast || last == ignore ) {
88 last = interval.GetMax();
92 if (timeSamples.empty() || first < timeSamples.front()) {
93 timeSamples.insert(timeSamples.begin(),
first);
95 if (last > timeSamples.back()) {
96 timeSamples.insert(timeSamples.end(),
last);
101 outSampleTimes->resize(timeSamples.size());
102 for (
size_t i = 0; i < timeSamples.size(); ++i) {
103 (*outSampleTimes)[i] = timeSamples[i] - time.
GetValue();
106 return outSampleTimes->size() > 1;
154 HdSampledDataSourceHandle
164 HdSampledDataSourceHandle
191 stageGlobals->FlagAsAssetPathDependent(objPath);
202 sceneIndexPath, timeVaryingFlagLocator)
212 : _usdAttrQuery(usdAttrQuery)
213 , _stageGlobals(stageGlobals)
215 if (!timeVaryingFlagLocator.
IsEmpty()) {
216 if (_usdAttrQuery.ValueMightBeTimeVarying()) {
217 _stageGlobals.FlagAsTimeVarying(
218 sceneIndexPath, timeVaryingFlagLocator);
222 UsdImagingDataSourceAttribute_RecordObjectInStageGlobals<T>(
228 #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
**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())
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
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
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