| 2630 | } |
| 2631 | |
| 2632 | void |
| 2633 | Node::setEffect(const EffectInstancePtr& effect) |
| 2634 | { |
| 2635 | ////Only called by the main-thread |
| 2636 | assert( QThread::currentThread() == qApp->thread() ); |
| 2637 | _imp->effect = effect; |
| 2638 | _imp->effect->initializeData(); |
| 2639 | |
| 2640 | |
| 2641 | #ifdef NATRON_ENABLE_IO_META_NODES |
| 2642 | NodePtr thisShared = shared_from_this(); |
| 2643 | NodePtr ioContainer = _imp->ioContainer.lock(); |
| 2644 | if (ioContainer) { |
| 2645 | ReadNode* isReader = dynamic_cast<ReadNode*>( ioContainer->getEffectInstance().get() ); |
| 2646 | if (isReader) { |
| 2647 | isReader->setEmbeddedReader(thisShared); |
| 2648 | } else { |
| 2649 | WriteNode* isWriter = dynamic_cast<WriteNode*>( ioContainer->getEffectInstance().get() ); |
| 2650 | assert(isWriter); |
| 2651 | if (isWriter) { |
| 2652 | isWriter->setEmbeddedWriter(thisShared); |
| 2653 | } |
| 2654 | } |
| 2655 | } |
| 2656 | #endif |
| 2657 | } |
| 2658 | |
| 2659 | EffectInstancePtr |
| 2660 | Node::getEffectInstance() const |
no test coverage detected