MCPcopy Create free account
hub / github.com/NatronGitHub/Natron / abortAnyEvaluation

Method abortAnyEvaluation

Engine/EffectInstance.cpp:5137–5181  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5135}
5136
5137void
5138EffectInstance::abortAnyEvaluation(bool keepOldestRender)
5139{
5140 /*
5141 Get recursively downstream all Output nodes and abort any render on them
5142 If an output node such as a viewer was doing playback, enable it to restart
5143 automatically playback when the abort finished
5144 */
5145 NodePtr node = getNode();
5146
5147 assert(node);
5148 std::list<OutputEffectInstance*> outputNodes;
5149 NodeGroup* isGroup = dynamic_cast<NodeGroup*>(this);
5150 if (isGroup) {
5151 NodesList inputOutputs;
5152 isGroup->getInputsOutputs(&inputOutputs, false);
5153 for (NodesList::iterator it = inputOutputs.begin(); it != inputOutputs.end(); ++it) {
5154 (*it)->hasOutputNodesConnected(&outputNodes);
5155 }
5156 } else {
5157 RotoDrawableItemPtr attachedStroke = getNode()->getAttachedRotoItem();
5158 if (attachedStroke) {
5159 ///For nodes internal to the rotopaint tree, check outputs of the rotopaint node instead
5160 RotoContextPtr context = attachedStroke->getContext();
5161 assert(context);
5162 if (context) {
5163 NodePtr rotonode = context->getNode();
5164 if (rotonode) {
5165 rotonode->hasOutputNodesConnected(&outputNodes);
5166 }
5167 }
5168 } else {
5169 node->hasOutputNodesConnected(&outputNodes);
5170 }
5171 }
5172 for (std::list<OutputEffectInstance*>::const_iterator it = outputNodes.begin(); it != outputNodes.end(); ++it) {
5173 //Abort and allow playback to restart but do not block, when this function returns any ongoing render may very
5174 //well not be finished
5175 if (keepOldestRender) {
5176 (*it)->getRenderEngine()->abortRenderingAutoRestart();
5177 } else {
5178 (*it)->getRenderEngine()->abortRenderingNoRestart(keepOldestRender);
5179 }
5180 }
5181}
5182
5183double
5184EffectInstance::getCurrentTime() const

Callers

nothing calls this directly

Calls 10

getInputsOutputsMethod · 0.80
getAttachedRotoItemMethod · 0.80
getNodeFunction · 0.70
beginMethod · 0.45
endMethod · 0.45
getContextMethod · 0.45
getNodeMethod · 0.45

Tested by

no test coverage detected