| 1680 | } |
| 1681 | |
| 1682 | void |
| 1683 | AppInstance::startWritersRenderingFromNames(bool enableRenderStats, |
| 1684 | bool doBlockingRender, |
| 1685 | const std::list<std::string>& writers, |
| 1686 | const std::list<std::pair<int, std::pair<int, int> > >& frameRanges) |
| 1687 | { |
| 1688 | std::list<RenderWork> renderers; |
| 1689 | |
| 1690 | if ( !writers.empty() ) { |
| 1691 | for (std::list<std::string>::const_iterator it = writers.begin(); it != writers.end(); ++it) { |
| 1692 | const std::string& writerName = *it; |
| 1693 | NodePtr node = getNodeByFullySpecifiedName(writerName); |
| 1694 | |
| 1695 | if (!node) { |
| 1696 | std::string exc(writerName); |
| 1697 | exc.append( tr(" does not belong to the project file. Please enter a valid Write node script-name.").toStdString() ); |
| 1698 | throw std::invalid_argument(exc); |
| 1699 | } else { |
| 1700 | if ( !node->isOutputNode() ) { |
| 1701 | std::string exc(writerName); |
| 1702 | exc.append( tr(" is not an output node! It cannot render anything.").toStdString() ); |
| 1703 | throw std::invalid_argument(exc); |
| 1704 | } |
| 1705 | ViewerInstance* isViewer = node->isEffectViewer(); |
| 1706 | if (isViewer) { |
| 1707 | throw std::invalid_argument("Internal issue with the project loader...viewers should have been evicted from the project."); |
| 1708 | } |
| 1709 | |
| 1710 | if (node->isNodeDisabled() || !node->isActivated()) { |
| 1711 | continue; |
| 1712 | } |
| 1713 | OutputEffectInstance* effect = dynamic_cast<OutputEffectInstance*>( node->getEffectInstance().get() ); |
| 1714 | assert(effect); |
| 1715 | |
| 1716 | for (std::list<std::pair<int, std::pair<int, int> > >::const_iterator it2 = frameRanges.begin(); it2 != frameRanges.end(); ++it2) { |
| 1717 | RenderWork w(effect, it2->second.first, it2->second.second, it2->first, enableRenderStats); |
| 1718 | renderers.push_back(w); |
| 1719 | } |
| 1720 | |
| 1721 | if ( frameRanges.empty() ) { |
| 1722 | RenderWork r(effect, std::numeric_limits<int>::min(), std::numeric_limits<int>::max(), std::numeric_limits<int>::min(), enableRenderStats); |
| 1723 | renderers.push_back(r); |
| 1724 | } |
| 1725 | } |
| 1726 | } |
| 1727 | } else { |
| 1728 | //start rendering for all writers found in the project |
| 1729 | std::list<OutputEffectInstance*> writers; |
| 1730 | getProject()->getWriters(&writers); |
| 1731 | |
| 1732 | for (std::list<OutputEffectInstance*>::const_iterator it2 = writers.begin(); it2 != writers.end(); ++it2) { |
| 1733 | assert(*it2); |
| 1734 | if (*it2) { |
| 1735 | |
| 1736 | if ((*it2)->getNode()->isNodeDisabled() || !(*it2)->getNode()->isActivated()) { |
| 1737 | continue; |
| 1738 | } |
| 1739 |
no test coverage detected