Ejemplo n.º 1
0
/* XXX Group nodes must set use_tree_data to false, since their trees can be shared by multiple nodes.
 * If use_tree_data is true, the ntree->execdata pointer is checked to avoid multiple execution of top-level trees.
 */
void ntreeCompositEndExecTree(bNodeTreeExec *exec, int use_tree_data)
{
	if (exec) {
		bNodeTree *ntree= exec->nodetree;
		bNode *node;
		bNodeStack *ns;
		
		for (node= exec->nodetree->nodes.first; node; node= node->next) {
			bNodeSocket *sock;
			
			for (sock= node->outputs.first; sock; sock= sock->next) {
				ns = node_get_socket_stack(exec->stack, sock);
				if (ns && ns->data) {
					sock->cache= ns->data;
					ns->data= NULL;
				}
			}
			if (node->type==CMP_NODE_CURVE_RGB)
				curvemapping_premultiply(node->storage, 1);
			
			node->need_exec= 0;
		}
	
		ntree_exec_end(exec);
		
		if (use_tree_data) {
			/* XXX clear nodetree backpointer to exec data, same problem as noted in ntreeBeginExecTree */
			ntree->execdata = NULL;
		}
	}
}
Ejemplo n.º 2
0
void ntreeShaderEndExecTree_internal(bNodeTreeExec *exec)
{
	bNodeThreadStack *nts;
	int a;
	
	if (exec->threadstack) {
		for (a = 0; a < BLENDER_MAX_THREADS; a++) {
			for (nts = exec->threadstack[a].first; nts; nts = nts->next)
				if (nts->stack) MEM_freeN(nts->stack);
			BLI_freelistN(&exec->threadstack[a]);
		}
		
		MEM_freeN(exec->threadstack);
		exec->threadstack = NULL;
	}
	
	ntree_exec_end(exec);
}
void ntreeTexEndExecTree_internal(bNodeTreeExec *exec)
{
	bNodeThreadStack *nts;
	int a;
	
	if (exec->threadstack) {
		tex_free_delegates(exec);
		
		for (a = 0; a < exec->tot_thread; a++) {
			for (nts = exec->threadstack[a].first; nts; nts = nts->next)
				if (nts->stack) MEM_freeN(nts->stack);
			BLI_freelistN(&exec->threadstack[a]);
		}
		
		MEM_freeN(exec->threadstack);
		exec->threadstack = NULL;
	}
	
	ntree_exec_end(exec);
}