Blender V5.0
node_edit.cc File Reference
#include <algorithm>
#include <optional>
#include "MEM_guardedalloc.h"
#include "DNA_material_types.h"
#include "DNA_node_types.h"
#include "DNA_text_types.h"
#include "DNA_world_types.h"
#include "BKE_callbacks.hh"
#include "BKE_context.hh"
#include "BKE_global.hh"
#include "BKE_image.hh"
#include "BKE_lib_id.hh"
#include "BKE_main.hh"
#include "BKE_main_invariants.hh"
#include "BKE_material.hh"
#include "BKE_node.hh"
#include "BKE_node_legacy_types.hh"
#include "BKE_node_runtime.hh"
#include "BKE_node_tree_update.hh"
#include "BKE_report.hh"
#include "BKE_scene.hh"
#include "BKE_scene_runtime.hh"
#include "BKE_screen.hh"
#include "BLI_listbase.h"
#include "BLI_math_vector.h"
#include "BLI_math_vector.hh"
#include "BLI_string.h"
#include "BLI_string_utf8.h"
#include "BLI_utildefines.h"
#include "BLT_translation.hh"
#include "DEG_depsgraph.hh"
#include "DEG_depsgraph_build.hh"
#include "DEG_depsgraph_debug.hh"
#include "DEG_depsgraph_query.hh"
#include "NOD_shader_nodes_inline.hh"
#include "RE_engine.h"
#include "RE_pipeline.h"
#include "ED_image.hh"
#include "ED_node.hh"
#include "ED_render.hh"
#include "ED_screen.hh"
#include "ED_viewer_path.hh"
#include "RNA_access.hh"
#include "RNA_define.hh"
#include "RNA_prototypes.hh"
#include "WM_api.hh"
#include "WM_types.hh"
#include "UI_view2d.hh"
#include "GPU_capabilities.hh"
#include "GPU_material.hh"
#include "IMB_imbuf_types.hh"
#include "NOD_composite.hh"
#include "NOD_geometry.hh"
#include "NOD_shader.h"
#include "NOD_socket.hh"
#include "NOD_texture.h"
#include "node_intern.hh"
#include "COM_compositor.hh"
#include "COM_context.hh"
#include "COM_profiler.hh"

Go to the source code of this file.

Classes

struct  blender::ed::space_node::CompoJob
struct  blender::ed::space_node::NodeSizeWidget

Namespaces

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

Macros

#define USE_ESC_COMPO

Functions

void blender::ed::space_node::snode_set_context (const bContext &C)
Composite Job Manager
float blender::ed::space_node::node_socket_calculate_height (const bNodeSocket &socket)
float2 blender::ed::space_node::node_link_calculate_multi_input_position (const float2 &socket_position, const int index, const int total_inputs)
static bool blender::ed::space_node::compo_breakjob (void *cjv)
static void blender::ed::space_node::compo_statsdrawjob (void *cjv, const char *)
static void blender::ed::space_node::compo_redrawjob (void *cjv)
static void blender::ed::space_node::compo_freejob (void *cjv)
static void blender::ed::space_node::compo_initjob (void *cjv)
static void blender::ed::space_node::compo_updatejob (void *)
static void blender::ed::space_node::compo_progressjob (void *cjv, float progress)
static void blender::ed::space_node::compo_startjob (void *cjv, wmJobWorkerStatus *worker_status)
static void blender::ed::space_node::compo_canceljob (void *cjv)
static void blender::ed::space_node::compo_completejob (void *cjv)
Composite Job C API
static bool is_compositing_possible (const bContext *C)
static blender::compositor::OutputTypes get_compositor_needed_outputs (const bContext *C)
void ED_node_composite_job (const bContext *C, bNodeTree *nodetree, Scene *scene_owner)
Composite Poll & Utility Functions
bool blender::ed::space_node::composite_node_active (bContext *C)
bool blender::ed::space_node::composite_node_editable (bContext *C)
Node Editor Public API Functions
void ED_node_set_tree_type (SpaceNode *snode, blender::bke::bNodeTreeType *typeinfo)
bool ED_node_is_compositor (const SpaceNode *snode)
bool ED_node_is_shader (SpaceNode *snode)
bool ED_node_is_texture (SpaceNode *snode)
bool ED_node_is_geometry (const SpaceNode *snode)
bool ED_node_supports_preview (SpaceNode *snode)
void ED_node_shader_default (const bContext *C, Main *bmain, ID *id)
void ED_node_composit_default (const bContext *C, Scene *sce)
void ED_node_composit_default_init (const bContext *C, bNodeTree *ntree)
void ED_node_texture_default (const bContext *C, Tex *tex)
void ED_node_set_active (Main *bmain, SpaceNode *snode, bNodeTree *ntree, bNode *node, bool *r_active_texture_changed)
void ED_node_post_apply_transform (bContext *, bNodeTree *)
Node Generic
static bool blender::ed::space_node::socket_is_occluded (const float2 &location, const bNode &node_the_socket_belongs_to, const Span< bNode * > sorted_nodes)
Node Hidden Sockets
bool blender::ed::space_node::node_has_hidden_sockets (bNode *node)
void blender::ed::space_node::node_set_hidden_sockets (bNode *node, int set)
bool blender::ed::space_node::node_is_previewable (const SpaceNode &snode, const bNodeTree &ntree, const bNode &node)
static bool blender::ed::space_node::cursor_isect_multi_input_socket (const float2 &cursor, const bNodeSocket &socket)
bNodeSocketblender::ed::space_node::node_find_indicated_socket (SpaceNode &snode, ARegion &region, const float2 &cursor, const eNodeSocketInOut in_out)
Node Link Dimming
float blender::ed::space_node::node_link_dim_factor (const View2D &v2d, const bNodeLink &link)
bool blender::ed::space_node::node_link_is_hidden_or_dimmed (const View2D &v2d, const bNodeLink &link)
Node Duplicate Operator
static void blender::ed::space_node::node_duplicate_reparent_recursive (bNodeTree *ntree, const Map< bNode *, bNode * > &node_map, bNode *node)
void blender::ed::space_node::remap_node_pairing (bNodeTree &dst_tree, const Map< const bNode *, bNode * > &node_map)
static wmOperatorStatus blender::ed::space_node::node_duplicate_exec (bContext *C, wmOperator *op)
void blender::ed::space_node::NODE_OT_duplicate (wmOperatorType *ot)
static wmOperatorStatus blender::ed::space_node::node_read_viewlayers_exec (bContext *C, wmOperator *)
void blender::ed::space_node::NODE_OT_read_viewlayers (wmOperatorType *ot)
wmOperatorStatus blender::ed::space_node::node_render_changed_exec (bContext *C, wmOperator *)
void blender::ed::space_node::NODE_OT_render_changed (wmOperatorType *ot)
Node Collapse Operator
static void blender::ed::space_node::node_flag_toggle_exec (SpaceNode *snode, int toggle_flag, const bool tag_update=false)
static wmOperatorStatus blender::ed::space_node::node_collapse_toggle_exec (bContext *C, wmOperator *)
void blender::ed::space_node::NODE_OT_collapse_toggle (wmOperatorType *ot)
static wmOperatorStatus blender::ed::space_node::node_preview_toggle_exec (bContext *C, wmOperator *)
static bool blender::ed::space_node::node_previewable (bContext *C)
void blender::ed::space_node::NODE_OT_preview_toggle (wmOperatorType *ot)
static wmOperatorStatus blender::ed::space_node::node_activate_viewer_exec (bContext *C, wmOperator *)
void blender::ed::space_node::NODE_OT_activate_viewer (wmOperatorType *ot)
static wmOperatorStatus blender::ed::space_node::test_inline_shader_nodes_exec (bContext *C, wmOperator *)
void blender::ed::space_node::NODE_OT_test_inlining_shader_nodes (wmOperatorType *ot)
static wmOperatorStatus blender::ed::space_node::node_deactivate_viewer_exec (bContext *C, wmOperator *)
void blender::ed::space_node::NODE_OT_deactivate_viewer (wmOperatorType *ot)
static wmOperatorStatus blender::ed::space_node::node_toggle_viewer_exec (bContext *C, wmOperator *)
void blender::ed::space_node::NODE_OT_toggle_viewer (wmOperatorType *ot)
static wmOperatorStatus blender::ed::space_node::node_options_toggle_exec (bContext *C, wmOperator *)
void blender::ed::space_node::NODE_OT_options_toggle (wmOperatorType *ot)
static wmOperatorStatus blender::ed::space_node::node_socket_toggle_exec (bContext *C, wmOperator *)
void blender::ed::space_node::NODE_OT_hide_socket_toggle (wmOperatorType *ot)
Node Mute Operator
static wmOperatorStatus blender::ed::space_node::node_mute_exec (bContext *C, wmOperator *)
void blender::ed::space_node::NODE_OT_mute_toggle (wmOperatorType *ot)
Node Delete Operator
static wmOperatorStatus blender::ed::space_node::node_delete_exec (bContext *C, wmOperator *)
void blender::ed::space_node::NODE_OT_delete (wmOperatorType *ot)
Node Delete with Reconnect Operator
static wmOperatorStatus blender::ed::space_node::node_delete_reconnect_exec (bContext *C, wmOperator *)
void blender::ed::space_node::NODE_OT_delete_reconnect (wmOperatorType *ot)
Node Copy Node Color Operator
static wmOperatorStatus blender::ed::space_node::node_copy_color_exec (bContext *C, wmOperator *)
void blender::ed::space_node::NODE_OT_node_copy_color (wmOperatorType *ot)
Node Shader Script Update
static bool blender::ed::space_node::node_shader_script_update_poll (bContext *C)
static wmOperatorStatus blender::ed::space_node::node_shader_script_update_exec (bContext *C, wmOperator *op)
void blender::ed::space_node::NODE_OT_shader_script_update (wmOperatorType *ot)
Node Viewer Border
static void blender::ed::space_node::viewer_border_corner_to_backdrop (SpaceNode *snode, ARegion *region, int x, int y, int backdrop_width, int backdrop_height, float *fx, float *fy)
static wmOperatorStatus blender::ed::space_node::viewer_border_exec (bContext *C, wmOperator *op)
void blender::ed::space_node::NODE_OT_viewer_border (wmOperatorType *ot)
static wmOperatorStatus blender::ed::space_node::clear_viewer_border_exec (bContext *C, wmOperator *)
void blender::ed::space_node::NODE_OT_clear_viewer_border (wmOperatorType *ot)
Cryptomatte Add Socket
static wmOperatorStatus blender::ed::space_node::node_cryptomatte_add_socket_exec (bContext *C, wmOperator *)
void blender::ed::space_node::NODE_OT_cryptomatte_layer_add (wmOperatorType *ot)
Cryptomatte Remove Socket
static wmOperatorStatus blender::ed::space_node::node_cryptomatte_remove_socket_exec (bContext *C, wmOperator *)
void blender::ed::space_node::NODE_OT_cryptomatte_layer_remove (wmOperatorType *ot)

Node Size Widget Operator

enum class  blender::ed::space_node::NodeResizeAction : int { blender::ed::space_node::Begin = 0 , blender::ed::space_node::Cancel = 1 , blender::ed::space_node::SnapInvertOn = 2 , blender::ed::space_node::SnapInvertOff = 3 }
static void blender::ed::space_node::node_resize_init (bContext *C, wmOperator *op, const float2 &cursor, const bNode *node, NodeResizeDirection dir)
static void blender::ed::space_node::node_resize_exit (bContext *C, wmOperator *op, bool cancel)
wmKeyMapblender::ed::space_node::node_resize_modal_keymap (wmKeyConfig *keyconf)
static float blender::ed::space_node::nearest_node_grid_coord (float co)
static wmOperatorStatus blender::ed::space_node::node_resize_modal (bContext *C, wmOperator *op, const wmEvent *event)
static wmOperatorStatus blender::ed::space_node::node_resize_invoke (bContext *C, wmOperator *op, const wmEvent *event)
static void blender::ed::space_node::node_resize_cancel (bContext *C, wmOperator *op)
void blender::ed::space_node::NODE_OT_resize (wmOperatorType *ot)

Macro Definition Documentation

◆ USE_ESC_COMPO

#define USE_ESC_COMPO

Definition at line 87 of file node_edit.cc.

Referenced by blender::ed::space_node::compo_breakjob().

Function Documentation

◆ ED_node_composit_default()

void ED_node_composit_default ( const bContext * C,
Scene * scene )

Assumes nothing being done in ntree yet, sets the default in/out node. Called from compositing buttons or header.

Definition at line 581 of file node_edit.cc.

References BKE_ntree_update_after_single_tree_change(), C, Scene::compositing_node_group, CTX_data_main(), DATA_, ED_node_composit_default_init(), G, G_DEBUG, blender::bke::node_tree_add_tree(), ntreeType_Composite, and printf.

◆ ED_node_composit_default_init()

◆ ED_node_composite_job()

◆ ED_node_is_compositor()

◆ ED_node_is_geometry()

◆ ED_node_is_shader()

◆ ED_node_is_texture()

◆ ED_node_post_apply_transform()

void ED_node_post_apply_transform ( bContext * C,
bNodeTree * ntree )

◆ ED_node_set_active()

◆ ED_node_set_tree_type()

◆ ED_node_shader_default()

◆ ED_node_supports_preview()

bool ED_node_supports_preview ( SpaceNode * snode)

◆ ED_node_texture_default()

void ED_node_texture_default ( const bContext * C,
Tex * tex )

◆ get_compositor_needed_outputs()

◆ is_compositing_possible()