| 1003 | } |
| 1004 | |
| 1005 | void |
| 1006 | NodeCollection::getParallelRenderArgs(std::map<NodePtr, ParallelRenderArgsPtr>& argsMap) const |
| 1007 | { |
| 1008 | NodesList nodes = getNodes(); |
| 1009 | |
| 1010 | for (NodesList::iterator it = nodes.begin(); it != nodes.end(); ++it) { |
| 1011 | if ( !(*it)->isActivated() ) { |
| 1012 | continue; |
| 1013 | } |
| 1014 | ParallelRenderArgsPtr args = (*it)->getEffectInstance()->getParallelRenderArgsTLS(); |
| 1015 | if (args) { |
| 1016 | argsMap.insert( std::make_pair(*it, args) ); |
| 1017 | } |
| 1018 | |
| 1019 | if ( (*it)->isMultiInstance() ) { |
| 1020 | ///If the node has children, set the thread-local storage on them too, even if they do not render, it can be useful for expressions |
| 1021 | ///on parameters. |
| 1022 | NodesList children; |
| 1023 | (*it)->getChildrenMultiInstance(&children); |
| 1024 | for (NodesList::iterator it2 = children.begin(); it2 != children.end(); ++it2) { |
| 1025 | ParallelRenderArgsPtr childArgs = (*it2)->getEffectInstance()->getParallelRenderArgsTLS(); |
| 1026 | if (childArgs) { |
| 1027 | argsMap.insert( std::make_pair(*it2, childArgs) ); |
| 1028 | } |
| 1029 | } |
| 1030 | } |
| 1031 | |
| 1032 | //If the node has an attached stroke, that means it belongs to the roto paint tree, hence it is not in the project. |
| 1033 | RotoContextPtr rotoContext = (*it)->getRotoContext(); |
| 1034 | if (args && rotoContext) { |
| 1035 | for (NodesList::const_iterator it2 = args->rotoPaintNodes.begin(); it2 != args->rotoPaintNodes.end(); ++it2) { |
| 1036 | ParallelRenderArgsPtr args2 = (*it2)->getEffectInstance()->getParallelRenderArgsTLS(); |
| 1037 | if (args2) { |
| 1038 | argsMap.insert( std::make_pair(*it2, args2) ); |
| 1039 | } |
| 1040 | } |
| 1041 | } |
| 1042 | |
| 1043 | |
| 1044 | const NodeGroup* isGrp = (*it)->isEffectGroup(); |
| 1045 | if (isGrp) { |
| 1046 | isGrp->getParallelRenderArgs(argsMap); |
| 1047 | } |
| 1048 | |
| 1049 | const PrecompNode* isPrecomp = dynamic_cast<const PrecompNode*>( (*it)->getEffectInstance().get() ); |
| 1050 | if (isPrecomp) { |
| 1051 | isPrecomp->getPrecompApp()->getProject()->getParallelRenderArgs(argsMap); |
| 1052 | } |
| 1053 | } |
| 1054 | } |
| 1055 | |
| 1056 | struct NodeGroupPrivate |
| 1057 | { |
no test coverage detected