MCPcopy Create free account
hub / github.com/MrKepzie/Natron / getParallelRenderArgs

Method getParallelRenderArgs

Engine/NodeGroup.cpp:1003–1052  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

renderRoIInternalMethod · 0.80

Calls 12

getEffectInstanceMethod · 0.80
isMultiInstanceMethod · 0.80
getProjectMethod · 0.80
getPrecompAppMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
isActivatedMethod · 0.45
insertMethod · 0.45
getRotoContextMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected