49 #include "RNA_prototypes.h"
106 const int total_inputs)
138 int recalc_flags = 0;
331 if (
G.is_rendering) {
348 CompoJob *cj = MEM_cnew<CompoJob>(
"compo job");
354 cj->
ntree = nodetree;
439 if (snode !=
nullptr && root_ntree !=
nullptr) {
539 shader->
locx = 10.0f;
540 shader->
locy = 300.0f;
547 printf(
"ED_node_shader_default called on wrong ID type.\n");
557 printf(
"error in composite initialize\n");
590 printf(
"error in texture initialize\n");
626 if (!treetype || (treetype->
poll && !treetype->
poll(&
C, treetype))) {
663 if (r_active_texture_changed) {
664 *r_active_texture_changed =
false;
671 bool do_update =
false;
696 if (node_iter->type ==
node->type) {
715 if (ma->texpaintslot) {
718 for (
int i = 0; i < ma->tot_slots; i++) {
719 if (ma->texpaintslot[i].ima ==
image) {
720 ma->paint_active_slot = i;
761 if (r_active_texture_changed) {
762 *r_active_texture_changed =
true;
780 if (was_output == 0) {
789 if (was_output == 0) {
801 else if (do_update) {
809 BIF_preview_changed(-1);
810 allqueue(REDRAWBUTSSHADING, 1);
811 allqueue(REDRAWIPO, 0);
850 static bool edit_node_poll(
bContext *C)
886 static void edit_node_properties_get(
929 const bNode &node_the_socket_belongs_to,
933 if (
node == &node_the_socket_belongs_to) {
939 const float socket_hitbox_radius =
NODE_SOCKSIZE - 0.1f *
U.widget_unit;
1015 switch (event->
type) {
1025 float *pwidth = &
node->width;
1027 float widthmin =
node->typeinfo->minwidth;
1028 float widthmax =
node->typeinfo->maxwidth;
1032 *pwidth = oldwidth + dx;
1033 CLAMP(*pwidth, widthmin, widthmax);
1036 float locmax = nsw->
oldlocx + oldwidth;
1039 CLAMP(
node->locx, locmax - widthmax, locmax - widthmin);
1040 *pwidth = locmax -
node->locx;
1052 CLAMP(
node->locy, locmin + heightmin, locmin + heightmax);
1053 node->height =
node->locy - locmin;
1057 CLAMP(
node->height, heightmin, heightmax);
1119 if (
node ==
nullptr) {
1145 ot->
name =
"Resize Node";
1193 if (sock->
link ==
nullptr) {
1209 rctf multi_socket_rect;
1218 socket.
locy - node_socket_height,
1219 socket.
locy + node_socket_height);
1307 const float min_endpoint_distance =
std::min(
1313 if (min_endpoint_distance == 0.0f) {
1317 return std::clamp(1.0f - min_endpoint_distance / viewport_width * 10.0f, 0.05f, 1.0f);
1339 for (parent =
node->parent; parent; parent = parent->
parent) {
1360 bool changed =
false;
1377 if (
node == lastnode) {
1392 if (link->tonode && (link->tonode->flag &
NODE_SELECT) &&
1393 (keep_inputs || (link->fromnode && (link->fromnode->flag &
NODE_SELECT)))) {
1394 bNodeLink *newlink = MEM_cnew<bNodeLink>(
"bNodeLink");
1395 newlink->
flag = link->flag;
1403 if (link->fromnode && (link->fromnode->flag &
NODE_SELECT)) {
1409 newlink->
fromnode = link->fromnode;
1410 newlink->
fromsock = link->fromsock;
1417 if (link == lastlink) {
1433 if (
node == lastnode) {
1450 if (
node == lastnode) {
1462 ot->
name =
"Duplicate Nodes";
1474 ot->
srna,
"keep_inputs",
false,
"Keep Inputs",
"Keep the input links to duplicated nodes");
1534 if (
id ==
nullptr) {
1553 ot->
name =
"Read View Layers";
1554 ot->
idname =
"NODE_OT_read_viewlayers";
1555 ot->
description =
"Read all render layers of all used scenes";
1574 if (node_iter->id == (
ID *)sce) {
1605 ot->
name =
"Render Changed Layer";
1606 ot->
idname =
"NODE_OT_render_changed";
1607 ot->
description =
"Render current scene, when input node's layer has been changed";
1625 int tot_eq = 0, tot_neq = 0;
1639 !(
node->typeinfo->draw_buttons ||
node->typeinfo->draw_buttons_ex)) {
1643 if (
node->flag & toggle_flag) {
1658 !(
node->typeinfo->draw_buttons ||
node->typeinfo->draw_buttons_ex)) {
1662 if ((tot_eq && tot_neq) || tot_eq == 0) {
1663 node->flag |= toggle_flag;
1666 node->flag &= ~toggle_flag;
1677 if ((snode ==
nullptr) || (snode->
edittree ==
nullptr)) {
1693 ot->
idname =
"NODE_OT_hide_toggle";
1708 if ((snode ==
nullptr) || (snode->
edittree ==
nullptr)) {
1724 ot->
name =
"Toggle Node Preview";
1725 ot->
description =
"Toggle preview display for selected nodes";
1726 ot->
idname =
"NODE_OT_preview_toggle";
1741 if ((snode ==
nullptr) || (snode->
edittree ==
nullptr)) {
1755 ot->
name =
"Toggle Node Options";
1756 ot->
description =
"Toggle option buttons display for selected nodes";
1757 ot->
idname =
"NODE_OT_options_toggle";
1772 if ((snode ==
nullptr) || (snode->
edittree ==
nullptr)) {
1779 bool hidden =
false;
1805 ot->
name =
"Toggle Hidden Node Sockets";
1807 ot->
idname =
"NODE_OT_hide_socket_toggle";
1845 ot->
name =
"Toggle Node Mute";
1847 ot->
idname =
"NODE_OT_mute_toggle";
1932 ot->
name =
"Update Views";
1934 ot->
idname =
"NODE_OT_switch_view_update";
1972 ot->
name =
"Delete with Reconnect";
1973 ot->
description =
"Delete nodes; will reconnect nodes as if deletion was muted";
1974 ot->
idname =
"NODE_OT_delete_reconnect";
2003 else if (snode && snode->
edittree) {
2023 ot->
name =
"Add File Node Socket";
2025 ot->
idname =
"NODE_OT_output_file_add_socket";
2035 ot->
srna,
"file_path",
"Image",
MAX_NAME,
"File Path",
"Subpath of the output file");
2055 else if (snode && snode->
edittree) {
2076 ot->
name =
"Remove File Node Socket";
2077 ot->
description =
"Remove active input from a file output node";
2078 ot->
idname =
"NODE_OT_output_file_remove_active_socket";
2103 else if (snode && snode->
edittree) {
2120 if (direction == 1) {
2147 {1,
"UP", 0,
"Up",
""}, {2,
"DOWN", 0,
"Down",
""}, {0,
nullptr, 0,
nullptr,
nullptr}};
2150 ot->
name =
"Move File Node Socket";
2151 ot->
description =
"Move the active input of a file output node up or down the list";
2152 ot->
idname =
"NODE_OT_output_file_move_active_socket";
2203 ot->
idname =
"NODE_OT_node_copy_color";
2251 if (new_node->parent) {
2252 if (node_map.
contains(new_node->parent)) {
2253 new_node->parent = node_map.
lookup(new_node->parent);
2266 bNodeLink *newlink = MEM_cnew<bNodeLink>(__func__);
2267 newlink->
flag = link->flag;
2283 ot->
name =
"Copy to Clipboard";
2285 ot->
idname =
"NODE_OT_clipboard_copy";
2322 if (is_clipboard_valid ==
false) {
2325 "Some nodes references could not be restored, will be left empty");
2329 bool all_nodes_valid =
true;
2331 const char *disabled_hint =
nullptr;
2332 if (!
node->typeinfo->poll_instance ||
2333 !
node->typeinfo->poll_instance(
node,
ntree, &disabled_hint)) {
2334 all_nodes_valid =
false;
2335 if (disabled_hint) {
2338 "Cannot add node %s into node tree %s:\n %s",
2346 "Cannot add node %s into node tree %s",
2352 if (!all_nodes_valid) {
2362 float center[2] = {0.0f, 0.0f};
2385 if (new_node->parent) {
2386 if (node_map.
contains(new_node->parent)) {
2387 new_node->parent = node_map.
lookup(new_node->parent);
2394 node_map.
lookup(link->fromnode),
2395 socket_map.
lookup(link->fromsock),
2396 node_map.
lookup(link->tonode),
2397 socket_map.
lookup(link->tosock));
2411 ot->
name =
"Paste from Clipboard";
2412 ot->
description =
"Pastes nodes from the clipboard to the active node tree";
2413 ot->
idname =
"NODE_OT_clipboard_paste";
2432 if (socket->flag &
SELECT) {
2450 const char *default_name = (in_out ==
SOCK_IN) ?
"Input" :
"Output";
2468 socket_iter->flag &= ~
SELECT;
2483 ot->
name =
"Add Node Tree Interface Socket";
2484 ot->
description =
"Add an input or output socket to the current node tree";
2485 ot->
idname =
"NODE_OT_tree_socket_add";
2511 if (iosock ==
nullptr) {
2534 ot->
name =
"Remove Node Tree Interface Socket";
2535 ot->
description =
"Remove an input or output socket to the current node tree";
2536 ot->
idname =
"NODE_OT_tree_socket_remove";
2565 if (iosock ==
nullptr) {
2570 if (iosock->
typeinfo == socket_type) {
2583 socket_iter->flag &= ~
SELECT;
2633 ot->
name =
"Change Node Tree Interface Socket Type";
2634 ot->
description =
"Change the type of a socket of the current node tree";
2635 ot->
idname =
"NODE_OT_tree_socket_change_type";
2658 {1,
"UP", 0,
"Up",
""},
2659 {2,
"DOWN", 0,
"Down",
""},
2660 {0,
nullptr, 0,
nullptr,
nullptr},
2674 if (iosock ==
nullptr) {
2678 switch (direction) {
2714 ot->
name =
"Move Node Tree Socket";
2715 ot->
description =
"Move a socket up or down in the current node tree's sockets stack";
2716 ot->
idname =
"NODE_OT_tree_socket_move";
2742 if (!(
type &&
type->update_script_node)) {
2786 if (ngroup && !ngroup->
done) {
2819 else if (snode && snode->
edittree) {
2826 type->update_script_node(engine, ntree_base,
node);
2866 ot->
name =
"Script Node Update";
2867 ot->
description =
"Update shader script node with new sockets and options from the script";
2868 ot->
idname =
"NODE_OT_shader_script_update";
2889 int backdrop_height,
2893 float bufx = backdrop_width * snode->
zoom;
2894 float bufy = backdrop_height * snode->
zoom;
2896 *fx = (bufx > 0.0f ? ((
float)
x - 0.5f * region->
winx - snode->
xof) / bufx + 0.5f : 0.0f);
2897 *fy = (bufy > 0.0f ? ((
float)
y - 0.5f * region->
winy - snode->
yof) / bufy + 0.5f : 0.0f);
2936 if (rectf.
xmin == 0.0f && rectf.
ymin == 0.0f && rectf.
xmax == 1.0f && rectf.
ymax == 1.0f) {
2959 ot->
name =
"Viewer Region";
2960 ot->
description =
"Set the boundaries for viewer operations";
2961 ot->
idname =
"NODE_OT_viewer_border";
2992 ot->
name =
"Clear Viewer Region";
2993 ot->
description =
"Clear the boundaries for viewer operations";
2994 ot->
idname =
"NODE_OT_clear_viewer_border";
3021 else if (snode && snode->
edittree) {
3040 ot->
name =
"Add Cryptomatte Socket";
3041 ot->
description =
"Add a new input layer to a Cryptomatte node";
3042 ot->
idname =
"NODE_OT_cryptomatte_layer_add";
3069 else if (snode && snode->
edittree) {
3090 ot->
name =
"Remove Cryptomatte Socket";
3092 ot->
idname =
"NODE_OT_cryptomatte_layer_remove";
typedef float(TangentPoint)[2]
@ BKE_CB_EVT_COMPOSITE_PRE
@ BKE_CB_EVT_COMPOSITE_CANCEL
@ BKE_CB_EVT_COMPOSITE_POST
void BKE_callback_exec_id(struct Main *bmain, struct ID *id, eCbEvent evt)
struct Scene * CTX_data_scene(const bContext *C)
PointerRNA CTX_data_pointer_get(const bContext *C, const char *member)
struct SpaceNode * CTX_wm_space_node(const bContext *C)
struct wmWindowManager * CTX_wm_manager(const bContext *C)
PointerRNA CTX_data_pointer_get_type(const bContext *C, const char *member, StructRNA *type)
struct ViewLayer * CTX_data_view_layer(const bContext *C)
struct Object * CTX_data_active_object(const bContext *C)
struct ARegion * CTX_wm_region(const bContext *C)
struct Main * CTX_data_main(const bContext *C)
struct wmWindow * CTX_wm_window(const bContext *C)
void BKE_image_release_ibuf(struct Image *ima, struct ImBuf *ibuf, void *lock)
struct ImBuf * BKE_image_acquire_ibuf(struct Image *ima, struct ImageUser *iuser, void **r_lock)
void BKE_image_backup_render(struct Scene *scene, struct Image *ima, bool free_current_slot)
struct Image * BKE_image_ensure_viewer(struct Main *bmain, int type, const char *name)
@ LIB_ID_CREATE_NO_USER_REFCOUNT
General operations, lookup, etc. for materials.
struct Material * BKE_material_default_surface(void)
struct Material * BKE_material_default_volume(void)
void BKE_node_clipboard_init(const struct bNodeTree *ntree)
const struct ListBase * BKE_node_clipboard_get_links(void)
#define CMP_NODE_COMPOSITE
void BKE_node_clipboard_add_node(struct bNode *node)
#define CMP_NODE_SPLITVIEWER
bool nodeLinkIsHidden(const struct bNodeLink *link)
void nodeInternalRelink(struct bNodeTree *ntree, struct bNode *node)
#define CMP_NODE_CRYPTOMATTE
struct bNodeTreeType * ntreeTypeFind(const char *idname)
void nodeModifySocketType(struct bNodeTree *ntree, struct bNode *node, struct bNodeSocket *sock, const char *idname)
bool ntreeHasTree(const struct bNodeTree *ntree, const struct bNodeTree *lookup)
const struct ListBase * BKE_node_clipboard_get_nodes(void)
void ntreeRemoveSocketInterface(struct bNodeTree *ntree, struct bNodeSocket *sock)
void nodeAttachNode(struct bNode *node, struct bNode *parent)
struct bNode * nodeFindNodebyName(struct bNodeTree *ntree, const char *name)
struct bNode * nodeGetActive(struct bNodeTree *ntree)
int nodeSocketIsHidden(const struct bNodeSocket *sock)
void nodeRemoveNode(struct Main *bmain, struct bNodeTree *ntree, struct bNode *node, bool do_id_user)
int BKE_node_clipboard_get_type(void)
void BKE_node_clipboard_add_link(struct bNodeLink *link)
#define CMP_NODE_CRYPTOMATTE_LEGACY
#define SH_NODE_OUTPUT_MATERIAL
#define CMP_NODE_OUTPUT_FILE
#define FOREACH_NODETREE_END
struct bNodeLink * nodeAddLink(struct bNodeTree *ntree, struct bNode *fromnode, struct bNodeSocket *fromsock, struct bNode *tonode, struct bNodeSocket *tosock)
#define SH_NODE_BACKGROUND
struct bNodeSocket * nodeFindSocket(const struct bNode *node, eNodeSocketInOut in_out, const char *identifier)
struct bNodeTree * ntreeCopyTree(struct Main *bmain, const struct bNodeTree *ntree)
void ntreeLocalMerge(struct Main *bmain, struct bNodeTree *localtree, struct bNodeTree *ntree)
void nodeSetSelected(struct bNode *node, bool select)
#define FOREACH_NODETREE_BEGIN(bmain, _nodetree, _id)
#define CMP_CRYPTOMATTE_SRC_RENDER
struct bNodeTree * ntreeAddTree(struct Main *bmain, const char *name, const char *idname)
struct bNodeSocket * ntreeAddSocketInterface(struct bNodeTree *ntree, eNodeSocketInOut in_out, const char *idname, const char *name)
struct bNode * nodeAddStaticNode(const struct bContext *C, struct bNodeTree *ntree, int type)
#define CMP_NODE_R_LAYERS
bool BKE_node_clipboard_validate(void)
int nodeCountSocketLinks(const struct bNodeTree *ntree, const struct bNodeSocket *sock)
void BKE_node_clipboard_clear(void)
struct bNodeSocket * ntreeInsertSocketInterface(struct bNodeTree *ntree, eNodeSocketInOut in_out, const char *idname, struct bNodeSocket *next_sock, const char *name)
void nodeDetachNode(struct bNode *node)
#define SH_NODE_OUTPUT_LIGHT
void nodeSetActive(struct bNodeTree *ntree, struct bNode *node)
#define SH_NODE_OUTPUT_LINESTYLE
void BKE_ntree_update_tag_interface(struct bNodeTree *ntree)
void BKE_ntree_update_main_tree(struct Main *bmain, struct bNodeTree *ntree, struct NodeTreeUpdateExtraParams *params)
void BKE_ntree_update_tag_active_output_changed(struct bNodeTree *ntree)
void BKE_ntree_update_tag_node_mute(struct bNodeTree *ntree, struct bNode *node)
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
void BKE_report(ReportList *reports, eReportType type, const char *message)
bool BKE_scene_multiview_is_render_view_active(const struct RenderData *rd, const struct SceneRenderView *srv)
BLI_INLINE bool BLI_listbase_is_empty(const struct ListBase *lb)
void BLI_addhead(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
#define LISTBASE_FOREACH(type, var, list)
#define LISTBASE_FOREACH_MUTABLE(type, var, list)
#define LISTBASE_FOREACH_BACKWARD(type, var, list)
void BLI_insertlinkafter(struct ListBase *listbase, void *vprevlink, void *vnewlink) ATTR_NONNULL(1)
#define LISTBASE_FOREACH_INDEX(type, var, list, index_var)
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_remlink(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_insertlinkbefore(struct ListBase *listbase, void *vnextlink, void *vnewlink) ATTR_NONNULL(1)
void * BLI_findlink(const struct ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
MINLINE float max_ff(float a, float b)
MINLINE float min_ff(float a, float b)
MINLINE int max_ii(int a, int b)
MINLINE void mul_v2_fl(float r[2], float f)
MINLINE void copy_v3_v3(float r[3], const float a[3])
BLI_INLINE float BLI_rctf_cent_y(const struct rctf *rct)
BLI_INLINE float BLI_rctf_cent_x(const struct rctf *rct)
float BLI_rctf_length_x(const rctf *rect, float x)
void BLI_rctf_init(struct rctf *rect, float xmin, float xmax, float ymin, float ymax)
bool BLI_rctf_isect_pt(const struct rctf *rect, float x, float y)
BLI_INLINE float BLI_rctf_size_x(const struct rctf *rct)
bool BLI_rctf_inside_rctf(const rctf *rct_a, const rctf *rct_b)
void BLI_rctf_init_pt_radius(struct rctf *rect, const float xy[2], float size)
float BLI_rctf_length_y(const rctf *rect, float y)
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t maxncpy) ATTR_NONNULL()
void DEG_evaluate_on_refresh(Depsgraph *graph)
Depsgraph * DEG_graph_new(struct Main *bmain, struct Scene *scene, struct ViewLayer *view_layer, eEvaluationMode mode)
struct Depsgraph Depsgraph
void DEG_graph_free(Depsgraph *graph)
void DEG_id_tag_update(struct ID *id, int flag)
void DEG_graph_build_for_compositor_preview(struct Depsgraph *graph, struct bNodeTree *nodetree)
void DEG_relations_tag_update(struct Main *bmain)
struct ID * DEG_get_evaluated_id(const struct Depsgraph *depsgraph, struct ID *id)
@ ID_RECALC_COPY_ON_WRITE
#define NODE_CUSTOM_COLOR
#define NODE_UPDATE_OPERATOR
#define NODE_ACTIVE_TEXTURE
#define NTREE_VIEWER_BORDER
#define NODE_DO_OUTPUT_RECALC
#define NTREE_QUALITY_HIGH
#define R_NO_FRAME_UPDATE
void ED_space_image_set(struct Main *bmain, struct SpaceImage *sima, struct Image *ima, bool automatic)
void ED_node_tree_start(struct SpaceNode *snode, struct bNodeTree *ntree, struct ID *id, struct ID *from)
void ED_preview_kill_jobs(struct wmWindowManager *wm, struct Main *bmain)
bool ED_operator_node_active(struct bContext *C)
bool ED_operator_node_editable(struct bContext *C)
void ED_region_tag_redraw(struct ARegion *region)
void ED_spreadsheet_context_paths_set_geometry_node(struct Main *bmain, struct SpaceNode *snode, struct bNode *node)
NSNotificationCenter * center
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
void GPU_material_free(struct ListBase *gpumaterial)
Contains defines and structs used throughout the imbuf module.
Read Guarded memory(de)allocation.
struct bNodeTreeType * ntreeType_Shader
in reality light always falls off quadratically Particle Retrieve the data of the particle that spawned the object for example to give variation to multiple instances of an object Point Retrieve information about points in a point cloud Retrieve the edges of an object as it appears to Cycles topology will always appear triangulated Convert a blackbody temperature to an RGB value Normal Generate a perturbed normal from an RGB normal map image Typically used for faking highly detailed surfaces SH_NODE_SCRIPT
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to used to fine tune the interpolation of the input Camera Retrieve information about the camera and how it relates to the current shading point s position Clamp a value between a minimum and a maximum Vector Perform vector math operation Invert a producing a negative Combine Generate a color from its and blue Hue Saturation Apply a color transformation in the HSV color model Specular Similar to the Principled BSDF node but uses the specular workflow instead of which functions by specifying the so the result may not be physically accurate SH_NODE_OUTPUT_WORLD
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to used to fine tune the interpolation of the input Camera Retrieve information about the camera and how it relates to the current shading point s position CLAMP
struct bNodeTreeType * ntreeType_Texture
struct bNodeSocketType * rna_node_socket_type_from_enum(int value)
const EnumPropertyItem * rna_node_socket_type_itemf(void *data, bool(*poll)(void *data, struct bNodeSocketType *), bool *r_free)
void UI_view2d_region_to_view(const struct View2D *v2d, float x, float y, float *r_view_x, float *r_view_y) ATTR_NONNULL()
int main(int argc, char *argv[])
ValueIterator values() const
const Value & lookup(const Key &key) const
void add_new(const Key &key, const Value &value)
bool contains(const Key &key) const
depth_tx normal_tx diffuse_light_tx specular_light_tx volume_light_tx environment_tx ambient_occlusion_tx aov_value_tx in_weight_img image(1, GPU_R32F, Qualifier::WRITE, ImageType::FLOAT_2D_ARRAY, "out_weight_img") .image(3
RenderEngine * RE_engine_create(RenderEngineType *type)
RenderEngineType * RE_engines_find(const char *idname)
void RE_engine_free(RenderEngine *engine)
ccl_global KernelShaderEvalInput ccl_global float * output
ccl_gpu_kernel_postfix ccl_global float int int int int float bool int offset
void(* MEM_freeN)(void *vmemh)
bNode * node_copy_with_mapping(bNodeTree *dst_tree, const bNode &node_src, const int flag, const bool unique_name, Map< const bNodeSocket *, bNodeSocket * > &socket_map)
static void area(int d1, int d2, int e1, int e2, float weights[2])
void NODE_OT_delete(wmOperatorType *ot)
static int viewer_border_exec(bContext *C, wmOperator *op)
void NODE_OT_cryptomatte_layer_add(wmOperatorType *ot)
static int node_preview_toggle_exec(bContext *C, wmOperator *UNUSED(op))
static void send_notifiers_after_tree_change(ID *id, bNodeTree *ntree)
float node_socket_calculate_height(const bNodeSocket &socket)
void NODE_OT_read_viewlayers(wmOperatorType *ot)
void node_sort(bNodeTree &ntree)
static void node_duplicate_reparent_recursive(const Map< const bNode *, bNode * > &node_map, bNode *node)
void NODE_OT_clipboard_copy(wmOperatorType *ot)
int node_get_resize_cursor(NodeResizeDirection directions)
static void node_flag_toggle_exec(SpaceNode *snode, int toggle_flag)
void NODE_OT_tree_socket_add(wmOperatorType *ot)
static int node_copy_color_exec(bContext *C, wmOperator *UNUSED(op))
static int node_clipboard_copy_exec(bContext *C, wmOperator *UNUSED(op))
static bool node_shader_script_update_poll(bContext *C)
static void node_resize_exit(bContext *C, wmOperator *op, bool cancel)
static void node_resize_cancel(bContext *C, wmOperator *op)
static int ntree_socket_change_type_exec(bContext *C, wmOperator *op)
static void compo_redrawjob(void *cjv)
void NODE_OT_node_copy_color(wmOperatorType *ot)
bool composite_node_editable(bContext *C)
void NODE_OT_viewer_border(wmOperatorType *ot)
void NODE_OT_tree_socket_move(wmOperatorType *ot)
static int node_socket_toggle_exec(bContext *C, wmOperator *UNUSED(op))
static int node_duplicate_exec(bContext *C, wmOperator *op)
static int node_delete_exec(bContext *C, wmOperator *UNUSED(op))
void NODE_OT_tree_socket_remove(wmOperatorType *ot)
static int node_resize_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static int ntree_socket_move_exec(bContext *C, wmOperator *op)
float2 node_link_calculate_multi_input_position(const float2 &socket_position, const int index, const int total_inputs)
void NODE_OT_resize(wmOperatorType *ot)
void NODE_OT_clipboard_paste(wmOperatorType *ot)
void NODE_OT_render_changed(wmOperatorType *ot)
static int ntree_socket_add_exec(bContext *C, wmOperator *op)
static bool socket_change_poll_type(void *userdata, bNodeSocketType *socket_type)
static void compo_freejob(void *cjv)
static int node_switch_view_exec(bContext *C, wmOperator *UNUSED(op))
void NODE_OT_delete_reconnect(wmOperatorType *ot)
void NODE_OT_shader_script_update(wmOperatorType *ot)
void node_select_all(ListBase *lb, int action)
static bool node_switch_view_poll(bContext *C)
void node_deselect_all(SpaceNode &snode)
void NODE_OT_hide_socket_toggle(wmOperatorType *ot)
static bool node_shader_script_update_text_recursive(RenderEngine *engine, RenderEngineType *type, bNodeTree *ntree, Text *text)
static bool node_select_check(const ListBase *lb)
void node_set_hidden_sockets(SpaceNode *snode, bNode *node, int set)
static int clear_viewer_border_exec(bContext *C, wmOperator *UNUSED(op))
float node_link_dim_factor(const View2D &v2d, const bNodeLink &link)
static void compo_canceljob(void *cjv)
static int compo_breakjob(void *cjv)
void NODE_OT_output_file_remove_active_socket(wmOperatorType *ot)
static int node_clipboard_paste_exec(bContext *C, wmOperator *op)
static int node_output_file_move_active_socket_exec(bContext *C, wmOperator *op)
NodeResizeDirection node_get_resize_direction(const bNode *node, const int x, const int y)
static void viewer_border_corner_to_backdrop(SpaceNode *snode, ARegion *region, int x, int y, int backdrop_width, int backdrop_height, float *fx, float *fy)
bool node_link_is_hidden_or_dimmed(const View2D &v2d, const bNodeLink &link)
static void compo_updatejob(void *UNUSED(cjv))
static int node_resize_modal(bContext *C, wmOperator *op, const wmEvent *event)
static void compo_progressjob(void *cjv, float progress)
static int compo_get_recalc_flags(const bContext *C)
bool node_find_indicated_socket(SpaceNode &snode, bNode **nodep, bNodeSocket **sockp, const float2 &cursor, const eNodeSocketInOut in_out)
static int node_options_toggle_exec(bContext *C, wmOperator *UNUSED(op))
void NODE_OT_preview_toggle(wmOperatorType *ot)
void NODE_OT_clear_viewer_border(wmOperatorType *ot)
static int node_shader_script_update_exec(bContext *C, wmOperator *op)
static void compo_tag_output_nodes(bNodeTree *nodetree, int recalc_flags)
static void node_resize_init(bContext *C, wmOperator *op, const float cursor[2], const bNode *node, NodeResizeDirection dir)
static int node_cryptomatte_add_socket_exec(bContext *C, wmOperator *UNUSED(op))
static const EnumPropertyItem move_direction_items[]
static int ntree_socket_remove_exec(bContext *C, wmOperator *op)
static bool socket_is_occluded(const bNodeSocket &sock, const bNode &node_the_socket_belongs_to, const SpaceNode &snode)
static int node_hide_toggle_exec(bContext *C, wmOperator *UNUSED(op))
static const EnumPropertyItem * socket_change_type_itemf(bContext *C, PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), bool *r_free)
void snode_set_context(const bContext &C)
void NODE_OT_duplicate(wmOperatorType *ot)
bool node_has_hidden_sockets(bNode *node)
void NODE_OT_output_file_add_socket(wmOperatorType *ot)
void NODE_OT_options_toggle(wmOperatorType *ot)
static int node_cryptomatte_remove_socket_exec(bContext *C, wmOperator *UNUSED(op))
static bNodeSocket * ntree_get_active_interface_socket(ListBase *lb)
static void compo_startjob(void *cjv, short *stop, short *do_update, float *progress)
static void compo_statsdrawjob(void *cjv, const char *UNUSED(str))
bool composite_node_active(bContext *C)
static int node_output_file_add_socket_exec(bContext *C, wmOperator *op)
void NODE_OT_switch_view_update(wmOperatorType *ot)
static void compo_initjob(void *cjv)
static void compo_completejob(void *cjv)
int node_render_changed_exec(bContext *C, wmOperator *UNUSED(op))
static int node_delete_reconnect_exec(bContext *C, wmOperator *UNUSED(op))
static bool cursor_isect_multi_input_socket(const float cursor[2], const bNodeSocket &socket)
void NODE_OT_hide_toggle(wmOperatorType *ot)
static int node_output_file_remove_active_socket_exec(bContext *C, wmOperator *UNUSED(op))
void NODE_OT_cryptomatte_layer_remove(wmOperatorType *ot)
void NODE_OT_tree_socket_change_type(wmOperatorType *ot)
void NODE_OT_output_file_move_active_socket(wmOperatorType *ot)
void NODE_OT_mute_toggle(wmOperatorType *ot)
static int node_read_viewlayers_exec(bContext *C, wmOperator *UNUSED(op))
static int node_mute_exec(bContext *C, wmOperator *UNUSED(op))
T clamp(const T &a, const T &min, const T &max)
vec_base< float, 2 > float2
static const pxr::TfToken out("out", pxr::TfToken::Immortal)
int ntreeCompositCryptomatteRemoveSocket(bNodeTree *ntree, bNode *node)
bNodeSocket * ntreeCompositCryptomatteAddSocket(bNodeTree *ntree, bNode *node)
int ntreeCompositOutputFileRemoveActiveSocket(bNodeTree *ntree, bNode *node)
bNodeSocket * ntreeCompositOutputFileAddSocket(bNodeTree *ntree, bNode *node, const char *name, const ImageFormatData *im_format)
void ntreeCompositTagRender(Scene *scene)
bNodeTreeType * ntreeType_Composite
void ntreeCompositExecTree(Scene *scene, bNodeTree *ntree, RenderData *rd, int rendering, int do_preview, const char *view_name)
bool ED_node_is_compositor(struct SpaceNode *snode)
void ED_node_post_apply_transform(bContext *UNUSED(C), bNodeTree *UNUSED(ntree))
void ED_node_texture_default(const bContext *C, Tex *tex)
bool ED_node_is_texture(struct SpaceNode *snode)
bool ED_node_is_geometry(struct SpaceNode *snode)
void ED_node_set_tree_type(SpaceNode *snode, bNodeTreeType *typeinfo)
void ED_node_set_active(Main *bmain, SpaceNode *snode, bNodeTree *ntree, bNode *node, bool *r_active_texture_changed)
bool ED_node_is_shader(struct SpaceNode *snode)
void ED_node_composite_job(const bContext *C, struct bNodeTree *nodetree, Scene *scene_owner)
void ED_node_composit_default(const bContext *C, struct Scene *sce)
void ED_node_shader_default(const bContext *C, ID *id)
void ED_node_tree_propagate_change(const bContext *C, Main *bmain, bNodeTree *root_ntree)
bNodeTreeType * ntreeType_Geometry
#define NODE_MULTI_INPUT_LINK_GAP
#define NODE_SOCKSIZE_DRAW_MULIPLIER
bool RE_ReadRenderResult(Scene *scene, Scene *scenode)
void RNA_string_set(PointerRNA *ptr, const char *name, const char *value)
void RNA_id_pointer_create(ID *id, PointerRNA *r_ptr)
void RNA_int_set(PointerRNA *ptr, const char *name, int value)
void RNA_string_get(PointerRNA *ptr, const char *name, char *value)
int RNA_int_get(PointerRNA *ptr, const char *name)
bool RNA_struct_property_is_set(PointerRNA *ptr, const char *identifier)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
void RNA_enum_set(PointerRNA *ptr, const char *name, int value)
int RNA_enum_get(PointerRNA *ptr, const char *name)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, bool default_value, const char *ui_name, const char *ui_description)
PropertyRNA * RNA_def_string(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, int maxlen, const char *ui_name, const char *ui_description)
PropertyRNA * RNA_def_int(StructOrFunctionRNA *cont_, const char *identifier, int default_value, int hardmin, int hardmax, const char *ui_name, const char *ui_description, int softmin, int softmax)
void RNA_def_enum_funcs(PropertyRNA *prop, EnumPropertyItemFunc itemfunc)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, int default_value, const char *ui_name, const char *ui_description)
const EnumPropertyItem rna_enum_node_socket_in_out_items[]
const EnumPropertyItem DummyRNA_DEFAULT_items[]
const EnumPropertyItem DummyRNA_NULL_items[]
struct bNodeTree * nodetree
struct bNodeTree * nodetree
struct ImageFormatData im_format
struct ReportList * reports
struct bNodeTree * nodetree
struct bNodeTree * edittree
struct bNodeTree * nodetree
struct bNodeTree * nodetree
struct bNodeTree * nodetree
int multi_input_socket_index
struct bNodeSocket * next
struct bNodeSocket * prev
struct bNodeSocketType * typeinfo
bool(* poll)(const struct bContext *C, struct bNodeTreeType *ntreetype)
void(* get_from_context)(const struct bContext *C, struct bNodeTreeType *ntreetype, struct bNodeTree **r_ntree, struct ID **r_id, struct ID **r_from)
bool(* valid_socket_type)(struct bNodeTreeType *ntreetype, struct bNodeSocketType *socket_type)
void(* progress)(void *, float progress)
int(* test_break)(void *)
void(* update_draw)(void *)
struct bNodeTreeType * typeinfo
void(* stats_draw)(void *, const char *str)
Depsgraph * compositor_depsgraph
int(* invoke)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
int(* modal)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
bool(* poll)(struct bContext *) ATTR_WARN_UNUSED_RESULT
void(* cancel)(struct bContext *, struct wmOperator *)
int(* exec)(struct bContext *, struct wmOperator *) ATTR_WARN_UNUSED_RESULT
struct ReportList * reports
void WM_cursor_modal_set(wmWindow *win, int val)
void WM_cursor_modal_restore(wmWindow *win)
void WM_event_drag_start_mval(const wmEvent *event, const ARegion *region, int r_mval[2])
wmEventHandler_Op * WM_event_add_modal_handler(bContext *C, wmOperator *op)
void WM_main_add_notifier(unsigned int type, void *reference)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
int WM_operator_name_call(bContext *C, const char *opstring, wmOperatorCallContext context, PointerRNA *properties, const wmEvent *event)
void WM_gesture_box_cancel(bContext *C, wmOperator *op)
int WM_gesture_box_invoke(bContext *C, wmOperator *op, const wmEvent *event)
int WM_gesture_box_modal(bContext *C, wmOperator *op, const wmEvent *event)
void WM_jobs_start(wmWindowManager *wm, wmJob *wm_job)
void WM_jobs_callbacks_ex(wmJob *wm_job, wm_jobs_start_callback startjob, void(*initjob)(void *), void(*update)(void *), void(*endjob)(void *), void(*completed)(void *), void(*canceled)(void *))
void WM_jobs_customdata_set(wmJob *wm_job, void *customdata, void(*free)(void *))
void WM_jobs_timer(wmJob *wm_job, double timestep, unsigned int note, unsigned int endnote)
wmJob * WM_jobs_get(wmWindowManager *wm, wmWindow *win, const void *owner, const char *name, int flag, int job_type)
void WM_operator_properties_border_to_rcti(struct wmOperator *op, rcti *rect)
void WM_operator_properties_gesture_box(wmOperatorType *ot)
int WM_menu_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
void WM_operator_properties_create(PointerRNA *ptr, const char *opstring)
void WM_operator_properties_free(PointerRNA *ptr)
bScreen * WM_window_get_active_screen(const wmWindow *win)