Exemple #1
0
static void node_init_output_index(bNodeSocket *sock, int *index, ListBase *internal_links)
{
	if (internal_links) {
		bNodeLink *link;
		/* copy the stack index from internally connected input to skip the node */
		for (link = internal_links->first; link; link = link->next) {
			if (link->tosock == sock) {
				sock->stack_index = link->fromsock->stack_index;
				break;
			}
		}
		/* if not internally connected, assign a new stack index anyway to avoid bad stack access */
		if (!link) {
			if (node_exec_socket_use_stack(sock))
				sock->stack_index = (*index)++;
			else
				sock->stack_index = -1;
		}
	}
	else {
		if (node_exec_socket_use_stack(sock))
			sock->stack_index = (*index)++;
		else
			sock->stack_index = -1;
	}
}
Exemple #2
0
static void node_init_input_index(bNodeSocket *sock, int *index)
{
	if (sock->link && sock->link->fromsock) {
		sock->stack_index = sock->link->fromsock->stack_index;
	}
	else {
		if (node_exec_socket_use_stack(sock))
			sock->stack_index = (*index)++;
		else
			sock->stack_index = -1;
	}
}
Exemple #3
0
static void node_init_input_index(bNodeSocket *sock, int *index)
{
	/* Only consider existing link if from socket is valid! */
	if (sock->link && sock->link->fromsock && sock->link->fromsock->stack_index >= 0) {
		sock->stack_index = sock->link->fromsock->stack_index;
	}
	else {
		if (node_exec_socket_use_stack(sock))
			sock->stack_index = (*index)++;
		else
			sock->stack_index = -1;
	}
}