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

Method deactivate

Engine/Node.cpp:2779–3026  ·  view source on GitHub ↗

After this call this node still knows the link to the old inputs/outputs but no other node knows this node.*/

Source from the content-addressed store, hash-verified

2777/*After this call this node still knows the link to the old inputs/outputs
2778 but no other node knows this node.*/
2779void
2780Node::deactivate(const std::list<NodePtr> & outputsToDisconnect,
2781 bool disconnectAll,
2782 bool reconnect,
2783 bool hideGui,
2784 bool triggerRender,
2785 bool unslaveKnobs)
2786{
2787
2788 if ( !_imp->effect || !isActivated() ) {
2789 return;
2790 }
2791 //first tell the gui to clear any persistent message linked to this node
2792 clearPersistentMessage(false);
2793
2794
2795
2796 bool beingDestroyed;
2797 {
2798 QMutexLocker k(&_imp->isBeingDestroyedMutex);
2799 beingDestroyed = _imp->isBeingDestroyed;
2800 }
2801
2802
2803 ///kill any thread it could have started
2804 ///Commented-out: If we were to undo the deactivate we don't want all threads to be
2805 ///exited, just exit them when the effect is really deleted instead
2806 //quitAnyProcessing();
2807 if (!beingDestroyed) {
2808 _imp->effect->abortAnyEvaluation(false /*keepOldestRender*/);
2809 _imp->abortPreview_non_blocking();
2810 }
2811
2812 NodeCollectionPtr parentCol = getGroup();
2813
2814
2815 if (unslaveKnobs) {
2816 ///For all knobs that have listeners, invalidate expressions
2817 NodeGroup* isParentGroup = dynamic_cast<NodeGroup*>( parentCol.get() );
2818 KnobsVec knobs = _imp->effect->getKnobs_mt_safe();
2819 for (U32 i = 0; i < knobs.size(); ++i) {
2820 KnobI::ListenerDimsMap listeners;
2821 knobs[i]->getListeners(listeners);
2822 for (KnobI::ListenerDimsMap::iterator it = listeners.begin(); it != listeners.end(); ++it) {
2823 KnobIPtr listener = it->first.lock();
2824 if (!listener) {
2825 continue;
2826 }
2827 KnobHolder* holder = listener->getHolder();
2828 if (!holder) {
2829 continue;
2830 }
2831 if ( ( holder == _imp->effect.get() ) || (holder == isParentGroup) ) {
2832 continue;
2833 }
2834
2835 EffectInstance* isEffect = dynamic_cast<EffectInstance*>(holder);
2836 if (!isEffect) {

Callers 1

deactivateNodesMethod · 0.45

Calls 15

ignore_resultFunction · 0.85
getAppFunction · 0.85
getKnobs_mt_safeMethod · 0.80
getListenersMethod · 0.80
getMasterMethod · 0.80
unSlaveMethod · 0.80
emptyMethod · 0.80
toStdStringMethod · 0.80
setExpressionInvalidMethod · 0.80
disconnectOutputMethod · 0.80
getInputIndexMethod · 0.80

Tested by

no test coverage detected