Blender V2.61 - r43446
|
#include <string.h>
#include "DNA_action_types.h"
#include "DNA_anim_types.h"
#include "DNA_node_types.h"
#include "BLI_listbase.h"
#include "BLI_string.h"
#include "BLI_utildefines.h"
#include "BKE_action.h"
#include "BKE_animsys.h"
#include "BKE_global.h"
#include "BKE_library.h"
#include "BKE_main.h"
#include "BLI_math.h"
#include "BKE_node.h"
#include "BKE_utildefines.h"
#include "RNA_access.h"
#include "RNA_types.h"
#include "MEM_guardedalloc.h"
#include "node_common.h"
#include "node_exec.h"
#include "NOD_socket.h"
Go to the source code of this file.
Definition in file node_common.c.
static void convert_socket_value | ( | bNodeSocket * | from, |
bNodeSocket * | to | ||
) | [static] |
Definition at line 269 of file node_common.c.
References copy_v3_v3(), copy_v4_v4(), bNodeSocket::default_value, SOCK_BOOLEAN, SOCK_FLOAT, SOCK_INT, SOCK_RGBA, SOCK_VECTOR, bNodeSocket::type, bNodeSocketValueBoolean::value, bNodeSocketValueFloat::value, bNodeSocketValueVector::value, bNodeSocketValueInt::value, and bNodeSocketValueRGBA::value.
Referenced by node_group_ungroup().
static void copy_socket_value | ( | bNodeSocket * | from, |
bNodeSocket * | to | ||
) | [static] |
Definition at line 384 of file node_common.c.
References bNodeSocket::default_value, SOCK_BOOLEAN, SOCK_FLOAT, SOCK_INT, SOCK_RGBA, SOCK_VECTOR, and bNodeSocket::type.
Referenced by node_group_expose_all_sockets(), and node_group_expose_socket().
static bNodeSocket* group_verify_socket | ( | bNodeTree * | ntree, |
ListBase * | lb, | ||
int | in_out, | ||
bNodeSocket * | gsock | ||
) | [static] |
Definition at line 707 of file node_common.c.
References BLI_remlink(), BLI_strncpy(), ListBase::first, bNodeSocket::flag, bNodeSocket::groupsock, bNodeSocket::limit, bNodeSocket::name, bNodeSocket::next, node_group_add_extern_socket(), NULL, bNodeSocket::own_index, SOCK_IN, SOCK_INTERNAL, and bNodeSocket::type.
Referenced by group_verify_socket_list().
static void group_verify_socket_list | ( | bNodeTree * | ntree, |
bNode * | node, | ||
ListBase * | lb, | ||
int | in_out, | ||
ListBase * | glb | ||
) | [static] |
Definition at line 739 of file node_common.c.
References BLI_addtail(), ListBase::first, bNodeSocket::flag, group_verify_socket(), bNodeSocket::new_sock, bNodeSocket::next, nodeRemoveSocket(), NULL, and SOCK_DYNAMIC.
Referenced by node_group_verify().
static void loop_sync | ( | bNodeTree * | ntree, |
int | sync_in_out | ||
) | [static] |
Definition at line 860 of file node_common.c.
References BLI_addtail(), BLI_insertlinkbefore(), BLI_remlink(), BLI_strncpy(), ListBase::first, bNodeSocket::flag, GET_INT_FROM_POINTER, bNodeTree::inputs, bNodeSocket::name, bNodeSocket::next, node_group_expose_socket(), node_group_remove_socket(), NULL, bNodeTree::outputs, bNodeSocket::own_index, SET_INT_IN_POINTER, SOCK_DYNAMIC, SOCK_IN, SOCK_INTERNAL, and bNodeSocket::storage.
Referenced by node_loop_update_tree().
void node_forloop_init | ( | bNodeTree * | ntree, |
bNode * | node, | ||
bNodeTemplate * | ntemp | ||
) |
Definition at line 833 of file node_common.c.
References ListBase::first, bNode::id, bNodeTree::inputs, bNode::inputs, bNodeSocket::next, bNodeTemplate::ngroup, node_group_add_extern_socket(), nodeAddInputFloat(), bNode::outputs, bNodeTree::outputs, PROP_UNSIGNED, SOCK_IN, and SOCK_OUT.
void node_forloop_init_tree | ( | bNodeTree * | ntree | ) |
Definition at line 853 of file node_common.c.
References bNodeSocket::flag, node_group_add_socket(), SOCK_FLOAT, SOCK_IN, and SOCK_INTERNAL.
bNodeTemplate node_forloop_template | ( | bNode * | node | ) | [read] |
Definition at line 825 of file node_common.c.
References bNode::id, bNodeTemplate::ngroup, NODE_FORLOOP, and bNodeTemplate::type.
bNodeSocket* node_group_add_extern_socket | ( | bNodeTree * | UNUSEDntree, |
ListBase * | lb, | ||
int | in_out, | ||
bNodeSocket * | gsock | ||
) |
Definition at line 81 of file node_common.c.
References BLI_addtail(), bNodeSocket::default_value, bNodeSocket::flag, bNodeSocket::groupsock, bNodeSocket::limit, bNodeSocket::link, MEM_callocN(), MEM_dupallocN(), bNodeSocket::new_sock, bNodeSocket::next, NULL, bNodeSocket::own_index, bNodeSocket::prev, SOCK_DYNAMIC, SOCK_IN, and SOCK_INTERNAL.
Referenced by group_verify_socket(), node_forloop_init(), node_group_init(), node_group_make_from_selected(), and node_whileloop_init().
bNodeSocket* node_group_add_socket | ( | bNodeTree * | ngroup, |
const char * | name, | ||
int | type, | ||
int | in_out | ||
) | [read] |
Definition at line 571 of file node_common.c.
References BLI_addtail(), BLI_strncpy(), bNodeTree::cur_index, bNodeSocket::default_value, bNodeSocket::flag, bNodeTree::inputs, bNodeSocket::limit, bNodeSocket::link, MEM_callocN(), bNodeSocket::name, bNodeSocket::new_sock, bNodeSocket::next, NTREE_UPDATE_GROUP_IN, NTREE_UPDATE_GROUP_OUT, ntreeGetSocketType(), NULL, bNodeTree::outputs, bNodeSocket::own_index, bNodeSocket::prev, SOCK_DYNAMIC, SOCK_IN, bNodeTemplate::type, bNodeSocket::type, bNodeTree::update, and bNodeSocketType::value_structsize.
Referenced by node_forloop_init_tree(), node_group_expose_all_sockets(), node_group_expose_socket(), node_group_socket_add_exec(), and node_whileloop_init_tree().
void node_group_edit_clear | ( | bNode * | node | ) |
Definition at line 800 of file node_common.c.
References ListBase::first, bNode::flag, bNode::id, if(), NODE_GROUP_EDIT, nodeGroupEditClear(), and bNodeTree::nodes.
Referenced by register_node_type_cmp_group(), register_node_type_sh_group(), and register_node_type_tex_group().
Definition at line 774 of file node_common.c.
References bNode::flag, bNode::id, NODE_GROUP_EDIT, and NULL.
Referenced by register_node_type_cmp_group(), register_node_type_sh_group(), and register_node_type_tex_group().
Definition at line 782 of file node_common.c.
References bNode::flag, bNode::id, bNodeTree::id, if(), ID::lib, NODE_GROUP_EDIT, ntreeMakeLocal(), and NULL.
Referenced by register_node_type_cmp_group(), register_node_type_sh_group(), and register_node_type_tex_group().
void node_group_expose_all_sockets | ( | bNodeTree * | ngroup | ) |
Definition at line 608 of file node_common.c.
References copy_socket_value(), ListBase::first, bNode::inputs, bNodeSocket::link, bNodeSocket::name, bNodeSocket::next, bNode::next, node_group_add_socket(), nodeAddLink(), nodeCountSocketLinks(), bNodeTree::nodes, nodeSocketIsHidden(), NULL, bNode::outputs, SOCK_IN, SOCK_OUT, and bNodeSocket::type.
Referenced by lib_verify_nodetree().
bNodeSocket* node_group_expose_socket | ( | bNodeTree * | ngroup, |
bNodeSocket * | sock, | ||
int | in_out | ||
) | [read] |
Definition at line 598 of file node_common.c.
References copy_socket_value(), bNodeSocket::name, node_group_add_socket(), and bNodeSocket::type.
Referenced by loop_sync(), node_group_link(), node_group_make_from_selected(), and node_link_modal().
bNodeSocket* node_group_find_input | ( | bNode * | gnode, |
bNodeSocket * | gsock | ||
) | [read] |
Definition at line 63 of file node_common.c.
References ListBase::first, bNodeSocket::groupsock, bNode::inputs, bNodeSocket::next, and NULL.
Referenced by node_group_ungroup().
bNodeSocket* node_group_find_output | ( | bNode * | gnode, |
bNodeSocket * | gsock | ||
) | [read] |
Definition at line 72 of file node_common.c.
References ListBase::first, bNodeSocket::groupsock, bNodeSocket::next, NULL, and bNode::outputs.
Referenced by node_group_make_from_selected().
void node_group_init | ( | bNodeTree * | ntree, |
bNode * | node, | ||
bNodeTemplate * | ntemp | ||
) |
Definition at line 691 of file node_common.c.
References ListBase::first, bNode::id, if(), bNodeTree::inputs, bNode::inputs, bNodeSocket::next, bNodeTemplate::ngroup, node_group_add_extern_socket(), bNode::outputs, bNodeTree::outputs, SOCK_IN, and SOCK_OUT.
Referenced by register_node_type_cmp_group(), register_node_type_sh_group(), and register_node_type_tex_group().
const char* node_group_label | ( | bNode * | node | ) |
Definition at line 659 of file node_common.c.
References bNode::id, and ID::name.
Referenced by register_node_type_cmp_group(), register_node_type_sh_group(), and register_node_type_tex_group().
void node_group_link | ( | bNodeTree * | ntree, |
bNodeSocket * | sock, | ||
int | in_out | ||
) |
Definition at line 812 of file node_common.c.
References node_group_expose_socket().
Definition at line 112 of file node_common.c.
References bNodeTree::adt, BKE_animdata_separate_by_basepath(), BLI_addtail(), BLI_freelinkN(), BLI_genericNodeN(), BLI_remlink(), LinkData::data, DO_MINMAX2, bNode::done, ListBase::first, bNode::flag, bNodeLink::fromnode, bNodeLink::fromsock, bNodeTree::id, INIT_MINMAX2, bNode::inputs, bNodeSocket::link, link(), bNodeTree::links, bNode::locx, bNode::locy, max, MEM_freeN(), min, bNodeSocket::next, LinkData::next, bNodeLink::next, bNode::next, bNodeTemplate::ngroup, NODE_GROUP, node_group_add_extern_socket(), node_group_expose_socket(), node_group_find_output(), NODE_SELECT, nodeAddLink(), nodeAddNode(), bNodeTree::nodes, NTREE_UPDATE, NTREE_UPDATE_LINKS, NTREE_UPDATE_NODES, ntreeAddTree(), ntreeFreeCache(), ntreeUpdateTree(), NULL, bNode::outputs, bNodeTree::outputs, RNA_Node, RNA_path_from_ID_to_struct(), RNA_pointer_create(), SOCK_IN, SOCK_OUT, bNodeLink::tonode, bNodeLink::tosock, bNodeTemplate::type, bNodeTree::type, bNode::type, and bNodeTree::update.
Referenced by node_group_make_exec().
void node_group_remove_socket | ( | bNodeTree * | ngroup, |
bNodeSocket * | gsock, | ||
int | in_out | ||
) |
Definition at line 637 of file node_common.c.
References BLI_remlink(), bNodeSocket::default_value, bNodeTree::inputs, MEM_freeN(), nodeRemSocketLinks(), NTREE_UPDATE_GROUP_IN, NTREE_UPDATE_GROUP_OUT, bNodeTree::outputs, SOCK_IN, SOCK_OUT, and bNodeTree::update.
Referenced by loop_sync(), and node_group_socket_remove_exec().
bNodeTemplate node_group_template | ( | bNode * | node | ) | [read] |
Definition at line 683 of file node_common.c.
References bNode::id, bNodeTemplate::ngroup, NODE_GROUP, and bNodeTemplate::type.
Referenced by register_node_type_cmp_group(), register_node_type_sh_group(), and register_node_type_tex_group().
Definition at line 422 of file node_common.c.
References AnimData::action, bNodeTree::adt, BKE_animdata_separate_by_basepath(), BLI_addtail(), BLI_freelinkN(), BLI_genericNodeN(), BLI_remlink(), convert_socket_value(), copy_action(), LinkData::data, ListBase::first, bNode::flag, free_libblock(), bNodeLink::fromnode, bNodeLink::fromsock, G, bNodeSocket::groupsock, bNodeTree::id, bNode::id, bNode::inputs, bNodeSocket::link, link(), bNodeTree::links, bNode::locx, bNode::locy, MEM_freeN(), bNode::new_node, bNodeSocket::new_sock, LinkData::next, bNodeSocket::next, bNodeLink::next, bNode::next, bNodeTemplate::ngroup, node_group_find_input(), NODE_SELECT, nodeFreeNode(), nodeRemLink(), bNodeTree::nodes, NTREE_UPDATE_LINKS, NTREE_UPDATE_NODES, ntreeCopyTree(), ntreeUpdateTree(), NULL, RNA_Node, RNA_path_from_ID_to_struct(), RNA_pointer_create(), bNodeLink::tonode, bNodeLink::tosock, and bNodeTree::update.
Referenced by node_group_ungroup_exec().
int node_group_valid | ( | bNodeTree * | ntree, |
bNodeTemplate * | ntemp | ||
) |
Definition at line 664 of file node_common.c.
References ListBase::first, bNode::next, bNodeTemplate::ngroup, nodeMakeTemplate(), bNodeTree::nodes, and nodeValid().
Referenced by register_node_type_cmp_group(), register_node_type_sh_group(), and register_node_type_tex_group().
Definition at line 764 of file node_common.c.
References group_verify_socket_list(), bNode::id, bNodeTree::inputs, bNode::inputs, bNodeTemplate::ngroup, bNode::outputs, bNodeTree::outputs, SOCK_IN, and SOCK_OUT.
Referenced by register_node_type_cmp_group(), register_node_type_sh_group(), and register_node_type_tex_group().
void node_loop_update_tree | ( | bNodeTree * | ngroup | ) |
Definition at line 930 of file node_common.c.
References loop_sync(), NTREE_UPDATE_GROUP_IN, NTREE_UPDATE_GROUP_OUT, SOCK_IN, SOCK_OUT, and bNodeTree::update.
void node_whileloop_init | ( | bNodeTree * | ntree, |
bNode * | node, | ||
bNodeTemplate * | ntemp | ||
) |
Definition at line 939 of file node_common.c.
References bNode::custom1, ListBase::first, bNode::id, bNodeTree::inputs, bNode::inputs, bNodeSocket::next, bNodeTemplate::ngroup, node_group_add_extern_socket(), nodeAddInputFloat(), bNode::outputs, bNodeTree::outputs, PROP_NONE, SOCK_IN, and SOCK_OUT.
void node_whileloop_init_tree | ( | bNodeTree * | ntree | ) |
Definition at line 962 of file node_common.c.
References bNodeSocket::flag, node_group_add_socket(), SOCK_FLOAT, SOCK_INTERNAL, and SOCK_OUT.
bNodeTemplate node_whileloop_template | ( | bNode * | node | ) | [read] |
Definition at line 969 of file node_common.c.
References bNode::id, bNodeTemplate::ngroup, NODE_WHILELOOP, and bNodeTemplate::type.
void register_node_type_frame | ( | bNodeTreeType * | ttype | ) |
Definition at line 979 of file node_common.c.
References MEM_callocN(), bNodeType::needs_free, NODE_BACKGROUND, NODE_CLASS_LAYOUT, NODE_FRAME, NODE_NEW_SHADING, NODE_OLD_SHADING, node_type_base(), node_type_compatibility(), node_type_size(), and nodeRegisterType().
Referenced by registerCompositNodes(), registerShaderNodes(), and registerTextureNodes().