Blender  V3.3
Namespaces | Macros | Functions | Variables
drawnode.cc File Reference

lower level node drawing for nodes (boarders, headers etc), also node layout. More...

#include "BLI_system.h"
#include "BLI_threads.h"
#include "DNA_node_types.h"
#include "DNA_object_types.h"
#include "DNA_screen_types.h"
#include "DNA_space_types.h"
#include "DNA_userdef_types.h"
#include "BKE_context.h"
#include "BKE_curve.h"
#include "BKE_image.h"
#include "BKE_main.h"
#include "BKE_node.h"
#include "BKE_node_runtime.hh"
#include "BKE_node_tree_update.h"
#include "BKE_scene.h"
#include "BKE_tracking.h"
#include "BLF_api.h"
#include "BLT_translation.h"
#include "BIF_glutil.h"
#include "GPU_batch.h"
#include "GPU_batch_presets.h"
#include "GPU_framebuffer.h"
#include "GPU_immediate.h"
#include "GPU_matrix.h"
#include "GPU_platform.h"
#include "GPU_shader_shared.h"
#include "GPU_state.h"
#include "GPU_uniform_buffer.h"
#include "DRW_engine.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "RNA_prototypes.h"
#include "ED_node.h"
#include "ED_space_api.h"
#include "WM_api.h"
#include "WM_types.h"
#include "UI_resources.h"
#include "UI_view2d.h"
#include "IMB_colormanagement.h"
#include "IMB_imbuf_types.h"
#include "NOD_composite.h"
#include "NOD_geometry.h"
#include "NOD_node_declaration.hh"
#include "NOD_shader.h"
#include "NOD_texture.h"
#include "node_intern.hh"

Go to the source code of this file.

Namespaces

 blender
 
 blender::ed
 
 blender::ed::space_node
 

Macros

#define DEFAULT_FLAGS   UI_ITEM_R_SPLIT_EMPTY_NAME
 
#define SAMPLE_FLT_ISNONE   FLT_MAX
 
#define NODELINK_GROUP_SIZE   256
 
#define LINK_RESOL   24
 
#define LINK_WIDTH   (2.5f * UI_DPI_FAC)
 
#define ARROW_SIZE   (7 * UI_DPI_FAC)
 

Functions

static void blender::ed::space_node::node_socket_button_label (bContext *UNUSED(C), uiLayout *layout, PointerRNA *UNUSED(ptr), PointerRNA *UNUSED(node_ptr), const char *text)
 
static void blender::ed::space_node::node_buts_value (uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
 
static void blender::ed::space_node::node_buts_rgb (uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
 
static void blender::ed::space_node::node_buts_mix_rgb (uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
 
static void blender::ed::space_node::node_buts_time (uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
 
static void blender::ed::space_node::node_buts_colorramp (uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
 
static void blender::ed::space_node::node_buts_curvevec (uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
 
static void blender::ed::space_node::node_buts_curvefloat (uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
 
void ED_node_sample_set (const float col[4])
 
static void blender::ed::space_node::node_buts_curvecol (uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
 
static void blender::ed::space_node::node_buts_normal (uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
 
static void blender::ed::space_node::node_buts_texture (uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
 
static void blender::ed::space_node::node_buts_math (uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
 
static void blender::ed::space_node::node_buts_combsep_color (uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
 
NodeResizeDirection blender::ed::space_node::node_get_resize_direction (const bNode *node, const int x, const int y)
 
static void blender::ed::space_node::node_draw_buttons_group (uiLayout *layout, bContext *C, PointerRNA *ptr)
 
static void blender::ed::space_node::node_buts_frame_ex (uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
 
static void blender::ed::space_node::node_common_set_butfunc (bNodeType *ntype)
 
static void blender::ed::space_node::node_buts_image_user (uiLayout *layout, bContext *C, PointerRNA *ptr, PointerRNA *imaptr, PointerRNA *iuserptr, const bool show_layer_selection, const bool show_color_management)
 
static void blender::ed::space_node::node_shader_buts_tex_image (uiLayout *layout, bContext *C, PointerRNA *ptr)
 
static void blender::ed::space_node::node_shader_buts_tex_image_ex (uiLayout *layout, bContext *C, PointerRNA *ptr)
 
static void blender::ed::space_node::node_shader_buts_tex_environment (uiLayout *layout, bContext *C, PointerRNA *ptr)
 
static void blender::ed::space_node::node_shader_buts_tex_environment_ex (uiLayout *layout, bContext *C, PointerRNA *ptr)
 
static void blender::ed::space_node::node_shader_buts_displacement (uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
 
static void blender::ed::space_node::node_shader_buts_glossy (uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
 
static void blender::ed::space_node::node_buts_output_shader (uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
 
static void blender::ed::space_node::node_shader_set_butfunc (bNodeType *ntype)
 
static void blender::ed::space_node::node_buts_image_views (uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr, PointerRNA *imaptr)
 
static void blender::ed::space_node::node_composit_buts_image (uiLayout *layout, bContext *C, PointerRNA *ptr)
 
static void blender::ed::space_node::node_composit_buts_image_ex (uiLayout *layout, bContext *C, PointerRNA *ptr)
 
static void blender::ed::space_node::node_composit_buts_huecorrect (uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
 
static void blender::ed::space_node::node_composit_buts_ycc (uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
 
static void blender::ed::space_node::node_composit_buts_combsep_color (uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
 
static void blender::ed::space_node::node_composit_backdrop_viewer (SpaceNode *snode, ImBuf *backdrop, bNode *node, int x, int y)
 
static void blender::ed::space_node::node_composit_backdrop_boxmask (SpaceNode *snode, ImBuf *backdrop, bNode *node, int x, int y)
 
static void blender::ed::space_node::node_composit_backdrop_ellipsemask (SpaceNode *snode, ImBuf *backdrop, bNode *node, int x, int y)
 
static void blender::ed::space_node::node_composit_buts_cryptomatte_legacy (uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
 
static void blender::ed::space_node::node_composit_buts_cryptomatte_legacy_ex (uiLayout *layout, bContext *UNUSED(C), PointerRNA *UNUSED(ptr))
 
static void blender::ed::space_node::node_composit_buts_cryptomatte (uiLayout *layout, bContext *C, PointerRNA *ptr)
 
static void blender::ed::space_node::node_composit_set_butfunc (bNodeType *ntype)
 
static void blender::ed::space_node::node_texture_buts_bricks (uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
 
static void blender::ed::space_node::node_texture_buts_proc (uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
 
static void blender::ed::space_node::node_texture_buts_image (uiLayout *layout, bContext *C, PointerRNA *ptr)
 
static void blender::ed::space_node::node_texture_buts_image_ex (uiLayout *layout, bContext *C, PointerRNA *ptr)
 
static void blender::ed::space_node::node_texture_buts_output (uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
 
static void blender::ed::space_node::node_texture_buts_combsep_color (uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
 
static void blender::ed::space_node::node_texture_set_butfunc (bNodeType *ntype)
 
void ED_node_init_butfuncs ()
 
void ED_init_custom_node_type (bNodeType *UNUSED(ntype))
 
void ED_init_custom_node_socket_type (bNodeSocketType *stype)
 
static void blender::ed::space_node::std_node_socket_draw_color (bContext *UNUSED(C), PointerRNA *ptr, PointerRNA *UNUSED(node_ptr), float *r_color)
 
static void blender::ed::space_node::std_node_socket_interface_draw_color (bContext *UNUSED(C), PointerRNA *ptr, float *r_color)
 
static void blender::ed::space_node::node_file_output_socket_draw (bContext *C, uiLayout *layout, PointerRNA *ptr, PointerRNA *node_ptr)
 
static bool blender::ed::space_node::socket_needs_attribute_search (bNode &node, bNodeSocket &socket)
 
static void blender::ed::space_node::std_node_socket_draw (bContext *C, uiLayout *layout, PointerRNA *ptr, PointerRNA *node_ptr, const char *text)
 
static void blender::ed::space_node::std_node_socket_interface_draw (bContext *UNUSED(C), uiLayout *layout, PointerRNA *ptr)
 
static void blender::ed::space_node::node_socket_virtual_draw_color (bContext *UNUSED(C), PointerRNA *UNUSED(ptr), PointerRNA *UNUSED(node_ptr), float *r_color)
 
void ED_init_standard_node_socket_type (bNodeSocketType *stype)
 
void ED_init_node_socket_type_virtual (bNodeSocketType *stype)
 
void blender::ed::space_node::draw_nodespace_back_pix (const bContext &C, ARegion &region, SpaceNode &snode, bNodeInstanceKey parent_key)
 
bool blender::ed::space_node::node_link_bezier_handles (const View2D *v2d, const SpaceNode *snode, const bNodeLink &link, float vec[4][2])
 
bool blender::ed::space_node::node_link_bezier_points (const View2D *v2d, const SpaceNode *snode, const bNodeLink &link, float coord_array[][2], const int resol)
 
static void blender::ed::space_node::nodelink_batch_reset ()
 
static void blender::ed::space_node::set_nodelink_vertex (GPUVertBuf *vbo, uint uv_id, uint pos_id, uint exp_id, uint v, const uchar uv[2], const float pos[2], const float exp[2])
 
static void blender::ed::space_node::nodelink_batch_init ()
 
static char blender::ed::space_node::nodelink_get_color_id (int th_col)
 
static void blender::ed::space_node::nodelink_batch_draw (const SpaceNode &snode)
 
void blender::ed::space_node::nodelink_batch_start (SpaceNode &UNUSED(snode))
 
void blender::ed::space_node::nodelink_batch_end (SpaceNode &snode)
 
static void blender::ed::space_node::nodelink_batch_add_link (const SpaceNode &snode, const float2 &p0, const float2 &p1, const float2 &p2, const float2 &p3, int th_col1, int th_col2, int th_col3, const float start_color[4], const float end_color[4], bool drawarrow, bool drawmuted, float dim_factor, float thickness, float dash_factor, float dash_alpha)
 
void blender::ed::space_node::node_draw_link_bezier (const bContext &C, const View2D &v2d, const SpaceNode &snode, const bNodeLink &link, const int th_col1, const int th_col2, const int th_col3, const bool selected)
 
void blender::ed::space_node::node_draw_link (const bContext &C, const View2D &v2d, const SpaceNode &snode, const bNodeLink &link, const bool selected)
 
void ED_node_draw_snap (View2D *v2d, const float cent[2], float size, NodeBorder border, uint pos)
 
Init Draw Callbacks For All Tree Types

Only called on node initialization, once.

static void blender::ed::space_node::node_property_update_default (Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr)
 
static void blender::ed::space_node::node_socket_template_properties_update (bNodeType *ntype, bNodeSocketTemplate *stemp)
 
static void blender::ed::space_node::node_template_properties_update (bNodeType *ntype)
 
static void blender::ed::space_node::node_socket_undefined_draw (bContext *UNUSED(C), uiLayout *layout, PointerRNA *UNUSED(ptr), PointerRNA *UNUSED(node_ptr), const char *UNUSED(text))
 
static void blender::ed::space_node::node_socket_undefined_draw_color (bContext *UNUSED(C), PointerRNA *UNUSED(ptr), PointerRNA *UNUSED(node_ptr), float *r_color)
 
static void blender::ed::space_node::node_socket_undefined_interface_draw (bContext *UNUSED(C), uiLayout *layout, PointerRNA *UNUSED(ptr))
 
static void blender::ed::space_node::node_socket_undefined_interface_draw_color (bContext *UNUSED(C), PointerRNA *UNUSED(ptr), float *r_color)
 

Variables

static float _sample_col [4] = {SAMPLE_FLT_ISNONE}
 
static const float blender::ed::space_node::virtual_node_socket_color [4] = {0.2, 0.2, 0.2, 1.0}
 
static const float blender::ed::space_node::std_node_socket_colors [][4]
 
static float blender::ed::space_node::arrow_verts [3][2] = {{-1.0f, 1.0f}, {0.0f, 0.0f}, {-1.0f, -1.0f}}
 
static float blender::ed::space_node::arrow_expand_axis [3][2] = {{0.7071f, 0.7071f}, {M_SQRT2, 0.0f}, {0.7071f, -0.7071f}}
 
static float blender::ed::space_node::mute_verts [3][2] = {{0.7071f, 1.0f}, {0.7071f, 0.0f}, {0.7071f, -1.0f}}
 
static float blender::ed::space_node::mute_expand_axis [3][2] = {{1.0f, 0.0f}, {1.0f, 0.0f}, {1.0f, -0.0f}}
 
struct {
   GPUBatch *   blender::ed::space_node::batch
 
   GPUBatch *   blender::ed::space_node::batch_single
 
   GPUVertBuf *   blender::ed::space_node::inst_vbo
 
   uint   blender::ed::space_node::p0_id
 
   uint   blender::ed::space_node::p1_id
 
   uint   blender::ed::space_node::p2_id
 
   uint   blender::ed::space_node::p3_id
 
   uint   blender::ed::space_node::colid_id
 
   uint   blender::ed::space_node::muted_id
 
   uint   blender::ed::space_node::start_color_id
 
   uint   blender::ed::space_node::end_color_id
 
   uint   blender::ed::space_node::dim_factor_id
 
   uint   blender::ed::space_node::thickness_id
 
   uint   blender::ed::space_node::dash_factor_id
 
   uint   blender::ed::space_node::dash_alpha_id
 
   GPUVertBufRaw   blender::ed::space_node::p0_step
 
   GPUVertBufRaw   blender::ed::space_node::p1_step
 
   GPUVertBufRaw   blender::ed::space_node::p2_step
 
   GPUVertBufRaw   blender::ed::space_node::p3_step
 
   GPUVertBufRaw   blender::ed::space_node::colid_step
 
   GPUVertBufRaw   blender::ed::space_node::muted_step
 
   GPUVertBufRaw   blender::ed::space_node::start_color_step
 
   GPUVertBufRaw   blender::ed::space_node::end_color_step
 
   GPUVertBufRaw   blender::ed::space_node::dim_factor_step
 
   GPUVertBufRaw   blender::ed::space_node::thickness_step
 
   GPUVertBufRaw   blender::ed::space_node::dash_factor_step
 
   GPUVertBufRaw   blender::ed::space_node::dash_alpha_step
 
   uint   blender::ed::space_node::count
 
   bool   blender::ed::space_node::enabled
 
blender::ed::space_node::g_batch_link
 

Detailed Description

lower level node drawing for nodes (boarders, headers etc), also node layout.

Definition in file drawnode.cc.

Macro Definition Documentation

◆ ARROW_SIZE

#define ARROW_SIZE   (7 * UI_DPI_FAC)

Definition at line 1688 of file drawnode.cc.

◆ DEFAULT_FLAGS

#define DEFAULT_FLAGS   UI_ITEM_R_SPLIT_EMPTY_NAME

Definition at line 71 of file drawnode.cc.

◆ LINK_RESOL

#define LINK_RESOL   24

Definition at line 1686 of file drawnode.cc.

◆ LINK_WIDTH

#define LINK_WIDTH   (2.5f * UI_DPI_FAC)

Definition at line 1687 of file drawnode.cc.

◆ NODELINK_GROUP_SIZE

#define NODELINK_GROUP_SIZE   256

Definition at line 1685 of file drawnode.cc.

◆ SAMPLE_FLT_ISNONE

#define SAMPLE_FLT_ISNONE   FLT_MAX

Definition at line 151 of file drawnode.cc.

Function Documentation

◆ ED_init_custom_node_socket_type()

void ED_init_custom_node_socket_type ( bNodeSocketType stype)

◆ ED_init_custom_node_type()

void ED_init_custom_node_type ( bNodeType UNUSEDntype)

Definition at line 1175 of file drawnode.cc.

◆ ED_init_node_socket_type_virtual()

void ED_init_node_socket_type_virtual ( bNodeSocketType stype)

◆ ED_init_standard_node_socket_type()

void ED_init_standard_node_socket_type ( bNodeSocketType stype)

◆ ED_node_draw_snap()

void ED_node_draw_snap ( View2D v2d,
const float  cent[2],
float  size,
NodeBorder  border,
uint  pos 
)

◆ ED_node_init_butfuncs()

void ED_node_init_butfuncs ( void  )

◆ ED_node_sample_set()

void ED_node_sample_set ( const float  col[4])

Variable Documentation

◆ _sample_col

float _sample_col[4] = {SAMPLE_FLT_ISNONE}
static