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

Method InvalidateMetadataValues

pxr/exec/exec/program.cpp:320–367  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

318}
319
320Exec_MetadataInvalidationResult
321Exec_Program::InvalidateMetadataValues(
322 TfSpan<const std::pair<SdfPath, TfToken>> invalidFields)
323{
324 TRACE_FUNCTION();
325
326 const size_t numInvalidFields = invalidFields.size();
327
328 VdfMaskedOutputVector leafInvalidationRequest;
329 leafInvalidationRequest.reserve(numInvalidFields);
330 TfBits compiledProperties(numInvalidFields);
331 _inputNodesRequiringInvalidation.reserve(
332 _inputNodesRequiringInvalidation.size() + numInvalidFields);
333
334 for (size_t i = 0; i < numInvalidFields; ++i) {
335 const auto it = _metadataInputNodes.find(invalidFields[i]);
336
337 // The corresponding metadata input may not have been compiled.
338 if (it == _metadataInputNodes.end()) {
339 continue;
340 }
341
342 Exec_MetadataInputNode *const node = it->second;
343
344 // Since this is an input node to the exec network, we need to make sure
345 // that executors are invalidated before the next round of evaluation.
346 _inputNodesRequiringInvalidation.push_back(node->GetId());
347
348 // Queue the input node's output(s) for leaf node invalidation.
349 leafInvalidationRequest.emplace_back(
350 node->GetOutput(), VdfMask::AllOnes(1));
351 }
352
353 // Find all the leaf nodes reachable from the input nodes.
354 //
355 // We won't ask the leaf node cache to incur the cost of performing
356 // incremental updates on the resulting cached traversal, because it is not
357 // guaranteed that we will repeatedly see the exact same authored value
358 // invalidation across rounds of structural change processing (in contrast
359 // to time invalidation).
360 const std::vector<const VdfNode *> &leafNodes = _leafNodeCache.FindNodes(
361 leafInvalidationRequest, /* updateIncrementally */ false);
362
363 return {
364 std::move(leafInvalidationRequest),
365 leafNodes
366 };
367}
368
369Exec_TimeChangeInvalidationResult
370Exec_Program::InvalidateTime(const EfTime &oldTime, const EfTime &newTime)

Callers 1

Calls 9

AllOnesFunction · 0.85
push_backMethod · 0.80
sizeMethod · 0.45
reserveMethod · 0.45
findMethod · 0.45
endMethod · 0.45
GetIdMethod · 0.45
emplace_backMethod · 0.45
GetOutputMethod · 0.45

Tested by

no test coverage detected