MCPcopy Create free account
hub / github.com/PixarAnimationStudios/OpenUSD / SetTime

Method SetTime

pxr/exec/exec/runtime.cpp:81–111  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

79}
80
81std::tuple<bool, EfTime>
82Exec_Runtime::SetTime(const EfTimeInputNode &timeNode, const EfTime &time)
83{
84 const VdfOutput &timeOutput = *timeNode.GetOutput();
85 const VdfMask timeMask = VdfMask::AllOnes(1);
86
87 // Retrieve the old time vector from the executor data manager.
88 //
89 // If there isn't already a time value stored in the executor data manager,
90 // perform first time initialization and return. In this case, we don't
91 // consider time as having changed.
92 const VdfVector *const oldTimeVector = _executor->GetOutputValue(
93 timeOutput, timeMask);
94 if (!oldTimeVector) {
95 _executor->SetOutputValue(
96 timeOutput, VdfTypedVector<EfTime>(time), timeMask);
97 return {false, EfTime()};
98 }
99
100 // Get the old time value from the vector. If there is no change in time,
101 // we can return without setting the new time value.
102 const EfTime oldTime = oldTimeVector->GetReadAccessor<EfTime>()[0];
103 if (oldTime == time) {
104 return {false, oldTime};
105 }
106
107 // Set the new time value and return.
108 _executor->SetOutputValue(
109 timeOutput, VdfTypedVector<EfTime>(time), timeMask);
110 return {true, oldTime};
111}
112
113void
114Exec_Runtime::InvalidateTopologicalState()

Callers 1

_ChangeTimeMethod · 0.45

Calls 5

AllOnesFunction · 0.85
EfTimeClass · 0.70
GetOutputMethod · 0.45
GetOutputValueMethod · 0.45
SetOutputValueMethod · 0.45

Tested by

no test coverage detected