Blender V2.61 - r43446
|
#include <math.h>
#include <stdio.h>
#include <string.h>
#include "MEM_guardedalloc.h"
#include "DNA_node_types.h"
#include "DNA_lamp_types.h"
#include "DNA_material_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "DNA_space_types.h"
#include "DNA_screen_types.h"
#include "DNA_world_types.h"
#include "BLI_math.h"
#include "BLI_blenlib.h"
#include "BLI_threads.h"
#include "BLI_utildefines.h"
#include "BKE_context.h"
#include "BKE_depsgraph.h"
#include "BKE_main.h"
#include "BKE_node.h"
#include "BIF_gl.h"
#include "BIF_glutil.h"
#include "WM_api.h"
#include "WM_types.h"
#include "ED_node.h"
#include "ED_gpencil.h"
#include "UI_interface.h"
#include "UI_interface_icons.h"
#include "UI_resources.h"
#include "UI_view2d.h"
#include "RNA_access.h"
#include "NOD_composite.h"
#include "NOD_shader.h"
#include "intern/node_util.h"
#include "node_intern.h"
Go to the source code of this file.
Classes | |
struct | NodeUpdateCalldata |
Defines | |
#define | NODE_GROUP_FRAME 120 |
Typedefs | |
typedef struct NodeUpdateCalldata | NodeUpdateCalldata |
Functions | |
void | ui_dropshadow (rctf *rct, float radius, float aspect, int select) |
void | ED_node_tree_update (SpaceNode *snode, Scene *scene) |
void | ED_node_changed_update (ID *id, bNode *node) |
static int | has_nodetree (bNodeTree *ntree, bNodeTree *lookup) |
static void | node_generic_update_cb (void *calldata, ID *owner_id, bNodeTree *ntree) |
void | ED_node_generic_update (Main *bmain, bNodeTree *ntree, bNode *node) |
static void | do_node_internal_buttons (bContext *C, void *node_v, int event) |
static void | node_scaling_widget (int color_id, float aspect, float xmin, float ymin, float xmax, float ymax) |
static void | node_uiblocks_init (const bContext *C, bNodeTree *ntree) |
static void | node_update_basis (const bContext *C, bNodeTree *ntree, bNode *node) |
static void | node_update_hidden (bNode *node) |
void | node_update_default (const bContext *C, bNodeTree *ntree, bNode *node) |
static int | node_get_colorid (bNode *node) |
static void | node_draw_mute_line (View2D *v2d, SpaceNode *snode, bNode *node) |
static void | node_circle_draw (float x, float y, float size, char *col) |
void | node_socket_circle_draw (bNodeTree *UNUSED(ntree), bNodeSocket *sock, float size) |
static void | node_draw_preview (bNodePreview *preview, rctf *prv) |
static void | node_toggle_button_cb (struct bContext *C, void *node_argv, void *op_argv) |
static void | node_draw_basis (const bContext *C, ARegion *ar, SpaceNode *snode, bNodeTree *ntree, bNode *node) |
static void | node_draw_hidden (const bContext *C, ARegion *ar, SpaceNode *snode, bNode *node) |
void | node_draw_default (const bContext *C, ARegion *ar, SpaceNode *snode, bNodeTree *ntree, bNode *node) |
static void | node_update (const bContext *C, bNodeTree *ntree, bNode *node) |
void | node_update_nodetree (const bContext *C, bNodeTree *ntree, float offsetx, float offsety) |
static void | node_draw (const bContext *C, ARegion *ar, SpaceNode *snode, bNodeTree *ntree, bNode *node) |
void | node_draw_nodetree (const bContext *C, ARegion *ar, SpaceNode *snode, bNodeTree *ntree) |
void | drawnodespace (const bContext *C, ARegion *ar, View2D *v2d) |
Definition in file node_draw.c.
#define NODE_GROUP_FRAME 120 |
Definition at line 81 of file node_draw.c.
typedef struct NodeUpdateCalldata NodeUpdateCalldata |
static void do_node_internal_buttons | ( | bContext * | C, |
void * | node_v, | ||
int | event | ||
) | [static] |
Definition at line 168 of file node_draw.c.
References B_NODE_EXEC, CTX_wm_space_node(), ED_node_changed_update(), and SpaceNode::id.
Referenced by node_uiblocks_init().
Definition at line 930 of file node_draw.c.
References SpaceNode::aspect, RenderData::color_mgt_flag, CTX_data_scene(), CTX_wm_space_node(), View2D::cur, draw_gpencil_view2d(), draw_nodespace_back_pix(), ListBase::first, bNode::flag, bNode::id, bNodeLinkDrag::link, SpaceNode::linkdrag, bNode::next, bNodeLinkDrag::next, node_draw_group(), node_draw_link(), node_draw_nodetree(), NODE_GROUP_EDIT, node_uiblocks_init(), node_update_nodetree(), bNodeTree::nodes, SpaceNode::nodetree, Scene::r, R_COLOR_MANAGEMENT, snode_set_context(), TH_BACK, UI_ThemeClearColor(), UI_view2d_constant_grid_draw(), UI_view2d_scrollers_calc(), UI_view2d_scrollers_draw(), UI_view2d_scrollers_free(), UI_view2d_view_ortho(), UI_view2d_view_restore(), ARegion::v2d, V2D_ARG_DUMMY, V2D_GRID_CLAMP, ARegion::winx, rctf::xmax, and rctf::xmin.
Referenced by node_main_area_draw().
Definition at line 95 of file node_draw.c.
References DAG_id_tag_update(), GS, bNode::id, ID_LA, ID_MA, ID_WO, ID::name, NC_LAMP, NC_MATERIAL, NC_SCENE, NC_TEXTURE, NC_WORLD, ND_LIGHTING_DRAW, ND_NODES, ND_SHADING_DRAW, ND_WORLD_DRAW, node_tree_from_ID(), node_tree_get_editgroup(), nodeUpdate(), nodeUpdateID(), NTREE_COMPOSIT, NTREE_SHADER, NTREE_TEXTURE, and WM_main_add_notifier().
Referenced by do_node_internal_buttons(), ED_node_link_insert(), node_duplicate_exec(), node_generic_update_cb(), and texture_changed().
Definition at line 155 of file node_draw.c.
References bNodeTreeType::foreach_nodetree, NodeUpdateCalldata::node, node_generic_update_cb(), NodeUpdateCalldata::ntree, NTREE_TEXTURE, ntreeGetType(), ntreeTexCheckCyclics(), and bNodeTree::type.
Referenced by ED_node_set_active(), ED_object_assign_active_image(), node_normal_cb(), node_socket_add_replace(), node_socket_disconnect(), and node_socket_remove().
Definition at line 87 of file node_draw.c.
References bNodeTree::id, SpaceNode::nodetree, snode_set_context(), and ID::us.
Referenced by new_node_tree_exec().
Definition at line 129 of file node_draw.c.
References ListBase::first, bNode::id, bNode::next, CompBuf::node, NODE_GROUP, bNodeTree::nodes, and bNode::type.
Referenced by node_generic_update_cb().
static void node_circle_draw | ( | float | x, |
float | y, | ||
float | size, | ||
char * | col | ||
) | [static] |
Definition at line 467 of file node_draw.c.
Referenced by node_socket_circle_draw().
static void node_draw | ( | const bContext * | C, |
ARegion * | ar, | ||
SpaceNode * | snode, | ||
bNodeTree * | ntree, | ||
bNode * | node | ||
) | [static] |
Definition at line 901 of file node_draw.c.
References bNodeType::drawfunc, and bNode::typeinfo.
Referenced by node_draw_nodetree().
static void node_draw_basis | ( | const bContext * | C, |
ARegion * | ar, | ||
SpaceNode * | snode, | ||
bNodeTree * | ntree, | ||
bNode * | node | ||
) | [static] |
Definition at line 577 of file node_draw.c.
References SpaceNode::aspect, B_REDR, BASIS_RAD, BLI_lock_thread(), BLI_rctf_is_empty(), BLI_strncpy(), BLI_unlock_thread(), bNode::block, bNodeSocketType::buttonfunc, View2D::cur, ListBase::first, bNodeSocket::flag, bNodeType::flag, bNode::flag, bNode::id, bNode::inputs, LABEL, bNodeSocket::link, LOCK_PREVIEW, bNodeSocket::locx, bNodeSocket::locy, bNodeSocket::name, bNodeSocket::next, NODE_ACTIVE, node_draw_mute_line(), node_draw_preview(), NODE_DY, NODE_DYS, node_get_colorid(), NODE_GROUP, NODE_MUTED, NODE_PREVIEW, node_scaling_widget(), node_socket_circle_draw(), NODE_SOCKSIZE, node_toggle_button_cb(), nodeLabel(), nodeShaderSynchronizeID(), nodeSocketIsHidden(), NTREE_SHADER, ntreeGetSocketType(), NULL, bNode::outputs, bNode::preview, bNode::prvr, bNodePreview::rect, RNA_NodeSocket, RNA_pointer_create(), SELECT, SOCK_HIDE_VALUE, TH_NODE, TH_REDALERT, TH_TEXT, TH_TEXT_HI, TOGBUT, bNode::totr, SpaceNode::treetype, bNodeSocket::type, bNode::type, bNode::typeinfo, UI_CNR_BOTTOM_LEFT, UI_CNR_TOP_LEFT, UI_CNR_TOP_RIGHT, UI_DrawTriIcon(), ui_dropshadow(), UI_EMBOSS, UI_EMBOSSN, UI_GetStringWidth(), UI_ThemeClearColor(), UI_ThemeColor(), UI_ThemeColor4(), UI_ThemeColorBlend(), UI_ThemeColorBlendShade(), UI_ThemeColorShade(), UI_ThemeColorShadeAlpha(), UI_UNIT_X, UI_UNIT_Y, uiBlockSetEmboss(), uiButSetFunc(), uiDefBut(), uiDefIconBut(), uiDrawBlock(), uiDrawBox(), uiEndBlock(), uiRoundBox(), uiSetRoundBox(), ARegion::v2d, bNode::width, rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.
Referenced by node_draw_default().
void node_draw_default | ( | const bContext * | C, |
ARegion * | ar, | ||
SpaceNode * | snode, | ||
bNodeTree * | ntree, | ||
bNode * | node | ||
) |
Definition at line 871 of file node_draw.c.
References bNode::flag, node_draw_basis(), node_draw_hidden(), and NODE_HIDDEN.
Referenced by ED_init_node_butfuncs(), and node_draw_group().
static void node_draw_hidden | ( | const bContext * | C, |
ARegion * | ar, | ||
SpaceNode * | snode, | ||
bNode * | node | ||
) | [static] |
Definition at line 770 of file node_draw.c.
References SpaceNode::aspect, B_REDR, BLI_strncpy(), bNode::block, UserDef::dpi, fdrawline(), ListBase::first, bNode::flag, bNode::inputs, LABEL, bNode::miniwidth, bNodeSocket::next, NODE_ACTIVE, node_draw_mute_line(), NODE_DY, node_get_colorid(), NODE_MUTED, node_socket_circle_draw(), NODE_SOCKSIZE, node_toggle_button_cb(), nodeLabel(), nodeSocketIsHidden(), SpaceNode::nodetree, NULL, bNode::outputs, SELECT, TH_REDALERT, TH_TEXT, TH_TEXT_HI, TOGBUT, bNode::totr, U, UI_CNR_ALL, UI_DrawTriIcon(), ui_dropshadow(), UI_EMBOSS, UI_EMBOSSN, UI_ThemeColor(), UI_ThemeColorBlend(), UI_ThemeColorBlendShade(), UI_ThemeColorShade(), UI_ThemeColorShadeAlpha(), UI_UNIT_X, uiBlockSetEmboss(), uiButSetFunc(), uiDefBut(), uiDrawBlock(), uiDrawBox(), uiEndBlock(), uiRoundBox(), uiSetRoundBox(), ARegion::v2d, rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.
Referenced by node_draw_default().
Definition at line 432 of file node_draw.c.
References BLI_freelistN(), SpaceNode::edittree, ListBase::first, bNodeLink::fromnode, bNodeLink::fromsock, i, LinkInOutsMuteNode::in, link(), MEM_freeN(), bNodeType::mutelinksfunc, LinkInOutsMuteNode::next, node_draw_link_bezier(), NULL, LinkInOutsMuteNode::num_outs, LinkInOutsMuteNode::outs, TH_REDALERT, TH_WIRE, bNodeLink::tonode, bNodeLink::tosock, and bNode::typeinfo.
Referenced by node_draw_basis(), and node_draw_hidden().
Definition at line 907 of file node_draw.c.
References ListBase::first, link(), bNodeTree::links, bNode::next, bNodeLink::next, node_draw(), node_draw_link(), bNodeTree::nodes, bNode::nr, NULL, and ARegion::v2d.
Referenced by drawnodespace(), and node_draw_group().
static void node_draw_preview | ( | bNodePreview * | preview, |
rctf * | prv | ||
) | [static] |
Definition at line 512 of file node_draw.c.
References fdrawbox(), glaDrawPixelsTex(), bNodePreview::rect, TH_BACK, UI_ThemeColorShadeAlpha(), rctf::xmax, rctf::xmin, bNodePreview::xsize, rctf::ymax, rctf::ymin, and bNodePreview::ysize.
Referenced by node_draw_basis().
Definition at line 148 of file node_draw.c.
References ED_node_changed_update(), has_nodetree(), NodeUpdateCalldata::node, and NodeUpdateCalldata::ntree.
Referenced by ED_node_generic_update().
static int node_get_colorid | ( | bNode * | node | ) | [static] |
Definition at line 410 of file node_draw.c.
References ELEM3, bNode::flag, bNodeType::nclass, NODE_CLASS_CONVERTOR, NODE_CLASS_GROUP, NODE_CLASS_INPUT, NODE_CLASS_OP_COLOR, NODE_CLASS_OP_FILTER, NODE_CLASS_OP_VECTOR, NODE_CLASS_OUTPUT, NODE_DO_OUTPUT, TH_NODE, TH_NODE_CONVERTOR, TH_NODE_GROUP, TH_NODE_IN_OUT, TH_NODE_OPERATOR, and bNode::typeinfo.
Referenced by node_draw_basis(), and node_draw_hidden().
static void node_scaling_widget | ( | int | color_id, |
float | aspect, | ||
float | xmin, | ||
float | ymin, | ||
float | xmax, | ||
float | ymax | ||
) | [static] |
Definition at line 178 of file node_draw.c.
References fdrawline(), and UI_ThemeColorShade().
Referenced by node_draw_basis().
void node_socket_circle_draw | ( | bNodeTree * | UNUSEDntree, |
bNodeSocket * | sock, | ||
float | size | ||
) |
Definition at line 503 of file node_draw.c.
References bNodeSocket::locx, bNodeSocket::locy, node_circle_draw(), ntreeGetSocketType(), bNodeSocket::type, and bNodeSocketType::ui_color.
Referenced by draw_group_socket(), node_draw_basis(), and node_draw_hidden().
static void node_toggle_button_cb | ( | struct bContext * | C, |
void * | node_argv, | ||
void * | op_argv | ||
) | [static] |
Definition at line 566 of file node_draw.c.
References node_select_single(), NULL, WM_OP_INVOKE_DEFAULT, and WM_operator_name_call().
Referenced by node_draw_basis(), and node_draw_hidden().
Definition at line 195 of file node_draw.c.
References BLI_snprintf(), CTX_wm_region(), do_node_internal_buttons(), ListBase::first, bNode::next, bNodeTree::nodes, UI_BLOCK_CLIP_EVENTS, UI_EMBOSS, uiBeginBlock(), uiBlockSetFlag(), and uiBlockSetHandleFunc().
Referenced by drawnodespace().
Definition at line 879 of file node_draw.c.
References bNodeType::drawupdatefunc, and bNode::typeinfo.
Referenced by node_update_nodetree().
Definition at line 214 of file node_draw.c.
References BLI_lock_thread(), BLI_unlock_thread(), bNode::block, bNode::butr, ListBase::first, bNode::flag, bNodeTree::id, bNode::inputs, LOCK_PREVIEW, bNodeSocket::locx, bNodeSocket::locy, MIN2, bNodeSocket::next, NODE_DY, NODE_DYS, NODE_OPTIONS, NODE_PREVIEW, NODE_SOCKSIZE, nodeSocketIsHidden(), nodeSpaceCoords(), NULL, bNode::outputs, bNode::preview, bNode::prvr, bNodePreview::rect, RNA_Node, RNA_pointer_create(), SWAP, bNode::totr, bNode::typeinfo, UI_GetStyle(), UI_LAYOUT_PANEL, UI_LAYOUT_VERTICAL, uiBlockEndAlign(), uiBlockLayout(), uiBlockLayoutResolve(), uiExplicitBoundsBlock(), bNodeType::uifunc, bNode::width, rctf::xmax, rctf::xmin, bNodePreview::xsize, rctf::ymax, rctf::ymin, and bNodePreview::ysize.
Referenced by node_update_default().
Definition at line 402 of file node_draw.c.
References bNode::flag, NODE_HIDDEN, node_update_basis(), and node_update_hidden().
Referenced by ED_init_node_butfuncs(), and node_update_group().
static void node_update_hidden | ( | bNode * | node | ) | [static] |
Definition at line 342 of file node_draw.c.
References bNode::block, cos(), ListBase::first, HIDDEN_RAD, bNode::inputs, bNodeSocket::locx, bNodeSocket::locy, M_PI, MAX2, bNode::miniwidth, bNodeSocket::next, NODE_DY, NODE_SOCKSIZE, nodeSocketIsHidden(), nodeSpaceCoords(), bNode::outputs, sin(), bNode::totr, uiExplicitBoundsBlock(), rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.
Referenced by node_update_default().
Definition at line 885 of file node_draw.c.
References ListBase::first, bNode::locx, bNode::locy, bNode::next, node_update(), and bNodeTree::nodes.
Referenced by drawnodespace(), and node_update_group().
void ui_dropshadow | ( | rctf * | rct, |
float | radius, | ||
float | aspect, | ||
int | select | ||
) |