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

higher level node drawing for the node editor. More...

#include <iomanip>
#include "MEM_guardedalloc.h"
#include "DNA_light_types.h"
#include "DNA_linestyle_types.h"
#include "DNA_material_types.h"
#include "DNA_node_types.h"
#include "DNA_screen_types.h"
#include "DNA_space_types.h"
#include "DNA_text_types.h"
#include "DNA_texture_types.h"
#include "DNA_world_types.h"
#include "BLI_array.hh"
#include "BLI_map.hh"
#include "BLI_set.hh"
#include "BLI_span.hh"
#include "BLI_string_ref.hh"
#include "BLI_vector.hh"
#include "BLT_translation.h"
#include "BKE_context.h"
#include "BKE_idtype.h"
#include "BKE_lib_id.h"
#include "BKE_main.h"
#include "BKE_node.h"
#include "BKE_object.h"
#include "DEG_depsgraph.h"
#include "BLF_api.h"
#include "BIF_glutil.h"
#include "GPU_framebuffer.h"
#include "GPU_immediate.h"
#include "GPU_immediate_util.h"
#include "GPU_matrix.h"
#include "GPU_state.h"
#include "GPU_viewport.h"
#include "WM_api.h"
#include "WM_types.h"
#include "ED_gpencil.h"
#include "ED_node.h"
#include "ED_screen.h"
#include "ED_space_api.h"
#include "UI_interface.hh"
#include "UI_resources.h"
#include "UI_view2d.h"
#include "RNA_access.h"
#include "RNA_prototypes.h"
#include "NOD_geometry_nodes_eval_log.hh"
#include "NOD_node_declaration.hh"
#include "NOD_socket_declarations_geometry.hh"
#include "FN_field.hh"
#include "FN_field_cpp_type.hh"
#include "node_intern.hh"

Go to the source code of this file.

Classes

struct  blender::ed::space_node::SocketTooltipData
 
struct  blender::ed::space_node::NodeErrorsTooltipData
 
struct  blender::ed::space_node::NodeExtraInfoRow
 
struct  blender::ed::space_node::NamedAttributeTooltipArg
 

Namespaces

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

Macros

#define NODE_HEADER_ICON_SIZE   (0.8f * U.widget_unit)
 
#define USE_DRAW_TOT_UPDATE
 

Functions

void ui_draw_dropshadow (const rctf *rct, float radius, float aspect, float alpha, int select)
 
float ED_node_grid_size ()
 
void ED_node_tree_update (const bContext *C)
 
static bNodeTreenode_tree_from_ID (ID *id)
 
void ED_node_tag_update_id (ID *id)
 
static bool blender::ed::space_node::compare_nodes (const bNode *a, const bNode *b)
 
void blender::ed::space_node::node_sort (bNodeTree &ntree)
 
static Array< uiBlock * > blender::ed::space_node::node_uiblocks_init (const bContext &C, Span< bNode * > nodes)
 
float2 blender::ed::space_node::node_to_view (const bNode &node, const float2 &co)
 
void blender::ed::space_node::node_to_updated_rect (const bNode &node, rctf &r_rect)
 
float2 blender::ed::space_node::node_from_view (const bNode &node, const float2 &co)
 
static void blender::ed::space_node::node_update_basis (const bContext &C, bNodeTree &ntree, bNode &node, uiBlock &block)
 
static void blender::ed::space_node::node_update_hidden (bNode &node, uiBlock &block)
 
static int blender::ed::space_node::node_get_colorid (const bNode &node)
 
static void blender::ed::space_node::node_draw_mute_line (const bContext &C, const View2D &v2d, const SpaceNode &snode, const bNode &node)
 
static void blender::ed::space_node::node_socket_draw (const bNodeSocket &sock, const float color[4], const float color_outline[4], float size, int locx, int locy, uint pos_id, uint col_id, uint shape_id, uint size_id, uint outline_col_id)
 
static void blender::ed::space_node::node_socket_draw_multi_input (const float color[4], const float color_outline[4], const float width, const float height, const int locx, const int locy)
 
static void blender::ed::space_node::node_socket_outline_color_get (const bool selected, const int socket_type, float r_outline_color[4])
 
void blender::ed::space_node::node_socket_color_get (const bContext &C, const bNodeTree &ntree, PointerRNA &node_ptr, const bNodeSocket &sock, float r_color[4])
 
static void blender::ed::space_node::create_inspection_string_for_generic_value (const GPointer value, std::stringstream &ss)
 
static void blender::ed::space_node::create_inspection_string_for_gfield (const geo_log::GFieldValueLog &value_log, std::stringstream &ss)
 
static void blender::ed::space_node::create_inspection_string_for_geometry (const geo_log::GeometryValueLog &value_log, std::stringstream &ss, const nodes::decl::Geometry *geometry)
 
static std::optional< std::string > blender::ed::space_node::create_socket_inspection_string (bContext *C, bNode &node, bNodeSocket &socket)
 
static bool blender::ed::space_node::node_socket_has_tooltip (bNodeTree *ntree, bNodeSocket *socket)
 
static char * blender::ed::space_node::node_socket_get_tooltip (bContext *C, bNodeTree *ntree, bNode *node, bNodeSocket *socket)
 
void blender::ed::space_node::node_socket_add_tooltip (bNodeTree *ntree, bNode *node, bNodeSocket *sock, uiLayout *layout)
 
static void blender::ed::space_node::node_socket_draw_nested (const bContext &C, bNodeTree &ntree, PointerRNA &node_ptr, uiBlock &block, bNodeSocket &sock, const uint pos_id, const uint col_id, const uint shape_id, const uint size_id, const uint outline_col_id, const float size, const bool selected)
 
void ED_node_socket_draw (bNodeSocket *sock, const rcti *rect, const float color[4], float scale)
 
static void blender::ed::space_node::node_draw_preview_background (rctf *rect)
 
static void blender::ed::space_node::node_draw_preview (bNodePreview *preview, rctf *prv)
 
static void blender::ed::space_node::node_toggle_button_cb (struct bContext *C, void *node_argv, void *op_argv)
 
static void blender::ed::space_node::node_draw_shadow (const SpaceNode &snode, const bNode &node, const float radius, const float alpha)
 
static void blender::ed::space_node::node_draw_sockets (const View2D &v2d, const bContext &C, bNodeTree &ntree, bNode &node, uiBlock &block, const bool draw_outputs, const bool select_all)
 
static int blender::ed::space_node::node_error_type_to_icon (const geo_log::NodeWarningType type)
 
static uint8_t blender::ed::space_node::node_error_type_priority (const geo_log::NodeWarningType type)
 
static geo_log::NodeWarningType blender::ed::space_node::node_error_highest_priority (Span< geo_log::NodeWarning > warnings)
 
static char * blender::ed::space_node::node_errors_tooltip_fn (bContext *UNUSED(C), void *argN, const char *UNUSED(tip))
 
static void blender::ed::space_node::node_add_error_message_button (const bContext &C, bNode &node, uiBlock &block, const rctf &rect, float &icon_offset)
 
static void blender::ed::space_node::get_exec_time_other_nodes (const bNode &node, const SpaceNode &snode, std::chrono::microseconds &exec_time, int &node_count)
 
static std::chrono::microseconds blender::ed::space_node::node_get_execution_time (const bNodeTree &ntree, const bNode &node, const SpaceNode &snode, int &node_count)
 
static std::string blender::ed::space_node::node_get_execution_time_label (const SpaceNode &snode, const bNode &node)
 
static char * blender::ed::space_node::named_attribute_tooltip (bContext *UNUSED(C), void *argN, const char *UNUSED(tip))
 
static NodeExtraInfoRow blender::ed::space_node::row_from_used_named_attribute (const Map< std::string, eNamedAttrUsage > &usage_by_attribute_name)
 
static std::optional< NodeExtraInfoRowblender::ed::space_node::node_get_accessed_attributes_row (const SpaceNode &snode, const bNode &node)
 
static Vector< NodeExtraInfoRowblender::ed::space_node::node_get_extra_info (const SpaceNode &snode, const bNode &node)
 
static void blender::ed::space_node::node_draw_extra_info_row (const bNode &node, uiBlock &block, const rctf &rect, const int row, const NodeExtraInfoRow &extra_info_row)
 
static void blender::ed::space_node::node_draw_extra_info_panel (const SpaceNode &snode, const bNode &node, uiBlock &block)
 
static void blender::ed::space_node::node_draw_basis (const bContext &C, const View2D &v2d, const SpaceNode &snode, bNodeTree &ntree, bNode &node, uiBlock &block, bNodeInstanceKey key)
 
static void blender::ed::space_node::node_draw_hidden (const bContext &C, const View2D &v2d, const SpaceNode &snode, bNodeTree &ntree, bNode &node, uiBlock &block)
 
int blender::ed::space_node::node_get_resize_cursor (NodeResizeDirection directions)
 
void blender::ed::space_node::node_set_cursor (wmWindow &win, SpaceNode &snode, const float2 &cursor)
 
static void blender::ed::space_node::count_multi_input_socket_links (bNodeTree &ntree, SpaceNode &snode)
 
static void blender::ed::space_node::frame_node_prepare_for_draw (bNode &node, Span< bNode * > nodes)
 
static void blender::ed::space_node::reroute_node_prepare_for_draw (bNode &node)
 
static void blender::ed::space_node::node_update_nodetree (const bContext &C, bNodeTree &ntree, Span< bNode * > nodes, Span< uiBlock * > blocks)
 
static void blender::ed::space_node::frame_node_draw_label (const bNodeTree &ntree, const bNode &node, const SpaceNode &snode)
 
static void blender::ed::space_node::frame_node_draw (const bContext &C, const ARegion &region, const SpaceNode &snode, bNodeTree &ntree, bNode &node, uiBlock &block)
 
static void blender::ed::space_node::reroute_node_draw (const bContext &C, ARegion &region, bNodeTree &ntree, bNode &node, uiBlock &block)
 
static void blender::ed::space_node::node_draw (const bContext &C, ARegion &region, const SpaceNode &snode, bNodeTree &ntree, bNode &node, uiBlock &block, bNodeInstanceKey key)
 
static void blender::ed::space_node::node_draw_nodetree (const bContext &C, ARegion &region, SpaceNode &snode, bNodeTree &ntree, Span< bNode * > nodes, Span< uiBlock * > blocks, bNodeInstanceKey parent_key)
 
static void blender::ed::space_node::draw_tree_path (const bContext &C, ARegion &region)
 
static void blender::ed::space_node::snode_setup_v2d (SpaceNode &snode, ARegion &region, const float2 &center)
 
static void blender::ed::space_node::draw_nodetree (const bContext &C, ARegion &region, bNodeTree &ntree, bNodeInstanceKey parent_key)
 
static void blender::ed::space_node::draw_background_color (const SpaceNode &snode)
 
void blender::ed::space_node::node_draw_space (const bContext &C, ARegion &region)
 

Variables

static const float blender::ed::space_node::virtual_node_socket_outline_color [4] = {0.5, 0.5, 0.5, 1.0}
 

Detailed Description

higher level node drawing for the node editor.

Definition in file node_draw.cc.

Macro Definition Documentation

◆ NODE_HEADER_ICON_SIZE

#define NODE_HEADER_ICON_SIZE   (0.8f * U.widget_unit)

Definition at line 1601 of file node_draw.cc.

◆ USE_DRAW_TOT_UPDATE

#define USE_DRAW_TOT_UPDATE

Definition at line 2914 of file node_draw.cc.

Function Documentation

◆ ED_node_grid_size()

float ED_node_grid_size ( void  )

Definition at line 87 of file node_draw.cc.

Referenced by initSnapSpatial().

◆ ED_node_socket_draw()

void ED_node_socket_draw ( bNodeSocket sock,
const rcti rect,
const float  color[4],
float  scale 
)

◆ ED_node_tag_update_id()

void ED_node_tag_update_id ( ID id)

◆ ED_node_tree_update()

void ED_node_tree_update ( const bContext C)

◆ node_tree_from_ID()

static bNodeTree* node_tree_from_ID ( ID id)
static

Definition at line 105 of file node_draw.cc.

References GS, id, ID_NT, ID::name, and ntreeFromID().

Referenced by ED_node_tag_update_id().

◆ ui_draw_dropshadow()

void ui_draw_dropshadow ( const rctf rct,
float  radius,
float  aspect,
float  alpha,
int  select 
)