Blender  V2.93
ED_node.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2009 Blender Foundation.
17  * All rights reserved.
18  */
19 
24 #pragma once
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
30 struct ID;
31 struct Main;
32 struct Scene;
33 struct ScrArea;
34 struct Tex;
35 struct View2D;
36 struct bContext;
37 struct bNode;
38 struct bNodeSocket;
39 struct bNodeSocketType;
40 struct bNodeTree;
41 struct bNodeTreeType;
42 struct bNodeType;
43 
44 typedef enum {
45  NODE_TOP = 1,
47  NODE_LEFT = 4,
49 } NodeBorder;
50 
51 #define NODE_GRID_STEPS 5
52 
53 /* space_node.c */
54 
55 void ED_node_cursor_location_get(const struct SpaceNode *snode, float value[2]);
56 void ED_node_cursor_location_set(struct SpaceNode *snode, const float value[2]);
57 
58 int ED_node_tree_path_length(struct SpaceNode *snode);
59 void ED_node_tree_path_get(struct SpaceNode *snode, char *value);
60 void ED_node_tree_path_get_fixedbuf(struct SpaceNode *snode, char *value, int max_length);
61 
62 void ED_node_tree_start(struct SpaceNode *snode,
63  struct bNodeTree *ntree,
64  struct ID *id,
65  struct ID *from);
66 void ED_node_tree_push(struct SpaceNode *snode, struct bNodeTree *ntree, struct bNode *gnode);
67 void ED_node_tree_pop(struct SpaceNode *snode);
68 int ED_node_tree_depth(struct SpaceNode *snode);
69 struct bNodeTree *ED_node_tree_get(struct SpaceNode *snode, int level);
70 
71 void ED_node_set_active_viewer_key(struct SpaceNode *snode);
72 
73 /* drawnode.c */
74 void ED_node_init_butfuncs(void);
75 void ED_init_custom_node_type(struct bNodeType *ntype);
79 void ED_node_sample_set(const float col[4]);
81  struct View2D *v2d, const float cent[2], float size, NodeBorder border, unsigned int pos);
82 
83 /* node_draw.cc */
84 void ED_node_socket_draw(struct bNodeSocket *sock,
85  const struct rcti *rect,
86  const float color[4],
87  float scale);
88 void ED_node_tree_update(const struct bContext *C);
89 void ED_node_tag_update_id(struct ID *id);
90 void ED_node_tag_update_nodetree(struct Main *bmain, struct bNodeTree *ntree, struct bNode *node);
91 void ED_node_sort(struct bNodeTree *ntree);
92 float ED_node_grid_size(void);
93 
94 /* node_relationships.c */
95 void ED_node_link_intersect_test(struct ScrArea *area, int test);
96 void ED_node_link_insert(struct Main *bmain, struct ScrArea *area);
97 
98 /* node_edit.c */
99 void ED_node_set_tree_type(struct SpaceNode *snode, struct bNodeTreeType *typeinfo);
100 bool ED_node_is_compositor(struct SpaceNode *snode);
101 bool ED_node_is_shader(struct SpaceNode *snode);
102 bool ED_node_is_texture(struct SpaceNode *snode);
103 bool ED_node_is_geometry(struct SpaceNode *snode);
104 
105 void ED_node_shader_default(const struct bContext *C, struct ID *id);
106 void ED_node_composit_default(const struct bContext *C, struct Scene *scene);
107 void ED_node_texture_default(const struct bContext *C, struct Tex *tex);
109 void ED_node_select_all(ListBase *lb, int action);
111 void ED_node_set_active(struct Main *bmain,
112  struct bNodeTree *ntree,
113  struct bNode *node,
114  bool *r_active_texture_changed);
115 
116 void ED_node_composite_job(const struct bContext *C,
117  struct bNodeTree *nodetree,
118  struct Scene *scene_owner);
119 
120 /* node_ops.c */
121 void ED_operatormacros_node(void);
122 
123 /* node_view.c */
124 bool ED_space_node_get_position(struct Main *bmain,
125  struct SpaceNode *snode,
126  struct ARegion *region,
127  const int mval[2],
128  float fpos[2]);
129 bool ED_space_node_color_sample(struct Main *bmain,
130  struct SpaceNode *snode,
131  struct ARegion *region,
132  const int mval[2],
133  float r_col[3]);
134 
135 #ifdef __cplusplus
136 }
137 #endif
void ED_node_tree_update(const struct bContext *C)
void ED_node_draw_snap(struct View2D *v2d, const float cent[2], float size, NodeBorder border, unsigned int pos)
Definition: drawnode.c:4117
bool ED_node_is_compositor(struct SpaceNode *snode)
Definition: node_edit.c:449
void ED_node_sample_set(const float col[4])
Definition: drawnode.c:170
void ED_node_link_insert(struct Main *bmain, struct ScrArea *area)
void ED_node_tree_start(struct SpaceNode *snode, struct bNodeTree *ntree, struct ID *id, struct ID *from)
Definition: space_node.c:59
void ED_node_set_tree_type(struct SpaceNode *snode, struct bNodeTreeType *typeinfo)
Definition: node_edit.c:439
bool ED_node_is_texture(struct SpaceNode *snode)
Definition: node_edit.c:459
float ED_node_grid_size(void)
Definition: node_draw.cc:96
bool ED_space_node_color_sample(struct Main *bmain, struct SpaceNode *snode, struct ARegion *region, const int mval[2], float r_col[3])
Definition: node_view.c:475
void ED_node_tree_push(struct SpaceNode *snode, struct bNodeTree *ntree, struct bNode *gnode)
Definition: space_node.c:100
void ED_init_standard_node_socket_type(struct bNodeSocketType *stype)
Definition: drawnode.c:3526
int ED_node_tree_path_length(struct SpaceNode *snode)
Definition: space_node.c:174
void ED_init_node_socket_type_virtual(struct bNodeSocketType *stype)
Definition: drawnode.c:3542
void ED_node_post_apply_transform(struct bContext *C, struct bNodeTree *ntree)
void ED_node_shader_default(const struct bContext *C, struct ID *id)
void ED_node_tag_update_id(struct ID *id)
Definition: node_draw.cc:124
bool ED_node_is_geometry(struct SpaceNode *snode)
Definition: node_edit.c:464
void ED_init_custom_node_socket_type(struct bNodeSocketType *stype)
Definition: drawnode.c:3318
void ED_operatormacros_node(void)
Definition: node_ops.c:128
void ED_node_tree_path_get_fixedbuf(struct SpaceNode *snode, char *value, int max_length)
Definition: space_node.c:204
void ED_node_sort(struct bNodeTree *ntree)
Definition: node_draw.cc:253
void ED_node_cursor_location_set(struct SpaceNode *snode, const float value[2])
Definition: space_node.c:611
bool ED_node_is_shader(struct SpaceNode *snode)
Definition: node_edit.c:454
void ED_node_composit_default(const struct bContext *C, struct Scene *scene)
void ED_node_tree_path_get(struct SpaceNode *snode, char *value)
Definition: space_node.c:187
void ED_node_cursor_location_get(const struct SpaceNode *snode, float value[2])
bool ED_node_select_check(ListBase *lb)
Definition: node_edit.c:1359
void ED_node_texture_default(const struct bContext *C, struct Tex *tex)
int ED_node_tree_depth(struct SpaceNode *snode)
Definition: space_node.c:157
void ED_node_composite_job(const struct bContext *C, struct bNodeTree *nodetree, struct Scene *scene_owner)
struct bNodeTree * ED_node_tree_get(struct SpaceNode *snode, int level)
Definition: space_node.c:162
void ED_node_link_intersect_test(struct ScrArea *area, int test)
bool ED_space_node_get_position(struct Main *bmain, struct SpaceNode *snode, struct ARegion *region, const int mval[2], float fpos[2])
Definition: node_view.c:447
void ED_node_tag_update_nodetree(struct Main *bmain, struct bNodeTree *ntree, struct bNode *node)
Definition: node_draw.cc:164
NodeBorder
Definition: ED_node.h:44
@ NODE_LEFT
Definition: ED_node.h:47
@ NODE_RIGHT
Definition: ED_node.h:48
@ NODE_BOTTOM
Definition: ED_node.h:46
@ NODE_TOP
Definition: ED_node.h:45
void ED_node_set_active(struct Main *bmain, struct bNodeTree *ntree, struct bNode *node, bool *r_active_texture_changed)
Definition: node_edit.c:665
void ED_init_custom_node_type(struct bNodeType *ntype)
Definition: drawnode.c:3308
void ED_node_init_butfuncs(void)
Definition: drawnode.c:3261
void ED_node_socket_draw(struct bNodeSocket *sock, const struct rcti *rect, const float color[4], float scale)
void ED_node_tree_pop(struct SpaceNode *snode)
Definition: space_node.c:135
void ED_node_select_all(ListBase *lb, int action)
Definition: node_edit.c:1370
void ED_node_set_active_viewer_key(struct SpaceNode *snode)
Definition: space_node.c:225
#define C
Definition: RandGen.cpp:39
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
Definition: btDbvt.cpp:52
OperationNode * node
StackEntry * from
Scene scene
bNodeTree * ntree
uint pos
uint col
IconTextureDrawCall border
static void area(int d1, int d2, int e1, int e2, float weights[2])
Definition: DNA_ID.h:273
Definition: BKE_main.h:116
Defines a socket type.
Definition: BKE_node.h:143
struct bNodeTreeType * typeinfo
Defines a node type.
Definition: BKE_node.h:221