Blender  V2.93
Functions | Variables
space_node.c File Reference
#include "DNA_gpencil_types.h"
#include "DNA_light_types.h"
#include "DNA_material_types.h"
#include "DNA_node_types.h"
#include "DNA_world_types.h"
#include "MEM_guardedalloc.h"
#include "BLI_blenlib.h"
#include "BLI_math.h"
#include "BKE_context.h"
#include "BKE_lib_id.h"
#include "BKE_node.h"
#include "BKE_screen.h"
#include "ED_node.h"
#include "ED_render.h"
#include "ED_screen.h"
#include "ED_space_api.h"
#include "UI_resources.h"
#include "UI_view2d.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "RNA_enum_types.h"
#include "WM_api.h"
#include "WM_types.h"
#include "node_intern.h"

Go to the source code of this file.

Functions

void ED_node_tree_start (SpaceNode *snode, bNodeTree *ntree, ID *id, ID *from)
 
void ED_node_tree_push (SpaceNode *snode, bNodeTree *ntree, bNode *gnode)
 
void ED_node_tree_pop (SpaceNode *snode)
 
int ED_node_tree_depth (SpaceNode *snode)
 
bNodeTreeED_node_tree_get (SpaceNode *snode, int level)
 
int ED_node_tree_path_length (SpaceNode *snode)
 
void ED_node_tree_path_get (SpaceNode *snode, char *value)
 
void ED_node_tree_path_get_fixedbuf (SpaceNode *snode, char *value, int max_length)
 
void ED_node_set_active_viewer_key (SpaceNode *snode)
 
void space_node_group_offset (SpaceNode *snode, float *x, float *y)
 
static SpaceLinknode_create (const ScrArea *UNUSED(area), const Scene *UNUSED(scene))
 
static void node_free (SpaceLink *sl)
 
static void node_init (struct wmWindowManager *UNUSED(wm), ScrArea *area)
 
static void node_area_listener (const wmSpaceTypeListenerParams *params)
 
static void node_area_refresh (const struct bContext *C, ScrArea *area)
 
static SpaceLinknode_duplicate (SpaceLink *sl)
 
static void node_buttons_region_init (wmWindowManager *wm, ARegion *region)
 
static void node_buttons_region_draw (const bContext *C, ARegion *region)
 
static void node_toolbar_region_init (wmWindowManager *wm, ARegion *region)
 
static void node_toolbar_region_draw (const bContext *C, ARegion *region)
 
void ED_node_cursor_location_get (const SpaceNode *snode, float value[2])
 
void ED_node_cursor_location_set (SpaceNode *snode, const float value[2])
 
static void node_cursor (wmWindow *win, ScrArea *area, ARegion *region)
 
static void node_main_region_init (wmWindowManager *wm, ARegion *region)
 
static void node_main_region_draw (const bContext *C, ARegion *region)
 
static bool node_group_drop_poll (bContext *UNUSED(C), wmDrag *drag, const wmEvent *UNUSED(event), const char **UNUSED(r_tooltip))
 
static bool node_object_drop_poll (bContext *UNUSED(C), wmDrag *drag, const wmEvent *UNUSED(event), const char **UNUSED(r_tooltip))
 
static bool node_collection_drop_poll (bContext *UNUSED(C), wmDrag *drag, const wmEvent *UNUSED(event), const char **UNUSED(r_tooltip))
 
static bool node_texture_drop_poll (bContext *UNUSED(C), wmDrag *drag, const wmEvent *UNUSED(event), const char **UNUSED(r_tooltip))
 
static bool node_ima_drop_poll (bContext *UNUSED(C), wmDrag *drag, const wmEvent *UNUSED(event), const char **UNUSED(r_tooltip))
 
static bool node_mask_drop_poll (bContext *UNUSED(C), wmDrag *drag, const wmEvent *UNUSED(event), const char **UNUSED(r_tooltip))
 
static void node_group_drop_copy (wmDrag *drag, wmDropBox *drop)
 
static void node_id_drop_copy (wmDrag *drag, wmDropBox *drop)
 
static void node_id_path_drop_copy (wmDrag *drag, wmDropBox *drop)
 
static void node_dropboxes (void)
 
static void node_header_region_init (wmWindowManager *UNUSED(wm), ARegion *region)
 
static void node_header_region_draw (const bContext *C, ARegion *region)
 
static void node_region_listener (const wmRegionListenerParams *params)
 
static int node_context (const bContext *C, const char *member, bContextDataResult *result)
 
static void node_widgets (void)
 
static void node_id_remap (ScrArea *UNUSED(area), SpaceLink *slink, ID *old_id, ID *new_id)
 
static int node_space_subtype_get (ScrArea *area)
 
static void node_space_subtype_set (ScrArea *area, int value)
 
static void node_space_subtype_item_extend (bContext *C, EnumPropertyItem **item, int *totitem)
 
void ED_spacetype_node (void)
 

Variables

const char * node_context_dir []
 

Function Documentation

◆ ED_node_cursor_location_get()

void ED_node_cursor_location_get ( const SpaceNode snode,
float  value[2] 
)

Definition at line 606 of file space_node.c.

References copy_v2_v2(), SpaceNode_Runtime::cursor, and SpaceNode::runtime.

◆ ED_node_cursor_location_set()

void ED_node_cursor_location_set ( SpaceNode snode,
const float  value[2] 
)

Definition at line 611 of file space_node.c.

References copy_v2_v2(), SpaceNode_Runtime::cursor, and SpaceNode::runtime.

◆ ED_node_set_active_viewer_key()

void ED_node_set_active_viewer_key ( SpaceNode snode)

◆ ED_node_tree_depth()

int ED_node_tree_depth ( SpaceNode snode)

Definition at line 157 of file space_node.c.

References BLI_listbase_count(), and SpaceNode::treepath.

◆ ED_node_tree_get()

bNodeTree* ED_node_tree_get ( SpaceNode snode,
int  level 
)

◆ ED_node_tree_path_get()

void ED_node_tree_path_get ( SpaceNode snode,
char *  value 
)

Definition at line 187 of file space_node.c.

References LISTBASE_FOREACH_INDEX, and SpaceNode::treepath.

◆ ED_node_tree_path_get_fixedbuf()

void ED_node_tree_path_get_fixedbuf ( SpaceNode snode,
char *  value,
int  max_length 
)

◆ ED_node_tree_path_length()

int ED_node_tree_path_length ( SpaceNode snode)

Definition at line 174 of file space_node.c.

References length(), LISTBASE_FOREACH_INDEX, and SpaceNode::treepath.

◆ ED_node_tree_pop()

void ED_node_tree_pop ( SpaceNode snode)

◆ ED_node_tree_push()

void ED_node_tree_push ( SpaceNode snode,
bNodeTree ntree,
bNode gnode 
)

◆ ED_node_tree_start()

void ED_node_tree_start ( SpaceNode snode,
bNodeTree ntree,
ID id,
ID from 
)

◆ ED_spacetype_node()

void ED_spacetype_node ( void  )

Definition at line 1037 of file space_node.c.

References BKE_spacetype_register(), BKE_ST_MAXNAME, BLI_addhead(), ARegionType::clip_gizmo_events_by_ui, SpaceType::context, SpaceType::create, ARegionType::cursor, ARegionType::draw, SpaceType::dropboxes, SpaceType::duplicate, ED_area_do_mgs_subscribe_for_tool_ui(), ED_KEYMAP_FRAMES, ED_KEYMAP_GIZMO, ED_KEYMAP_GPENCIL, ED_KEYMAP_HEADER, ED_KEYMAP_TOOL, ED_KEYMAP_UI, ED_KEYMAP_VIEW2D, ED_region_generic_tools_region_message_subscribe(), ED_region_generic_tools_region_snap_size(), ARegionType::event_cursor, SpaceType::free, SpaceType::gizmos, HEADERY, SpaceType::id_remap, ARegionType::init, SpaceType::init, SpaceType::keymap, ARegionType::keymapflag, ARegionType::listener, SpaceType::listener, MEM_callocN, ARegionType::message_subscribe, SpaceType::name, node_area_listener(), node_area_refresh(), node_buttons_region_draw(), node_buttons_region_init(), node_buttons_register(), node_context(), node_create(), node_cursor(), node_dropboxes(), node_duplicate(), node_free(), node_header_region_draw(), node_header_region_init(), node_id_remap(), node_init(), node_keymap(), node_main_region_draw(), node_main_region_init(), node_operatortypes(), node_region_listener(), node_space_subtype_get(), node_space_subtype_item_extend(), node_space_subtype_set(), node_toolbar_region_draw(), node_toolbar_region_init(), node_toolbar_register(), node_widgets(), SpaceType::operatortypes, ARegionType::prefsizex, ARegionType::prefsizey, SpaceType::refresh, ARegionType::regionid, SpaceType::regiontypes, RGN_TYPE_HEADER, RGN_TYPE_TOOLS, RGN_TYPE_UI, RGN_TYPE_WINDOW, ARegionType::snap_size, SPACE_NODE, SpaceType::space_subtype_get, SpaceType::space_subtype_item_extend, SpaceType::space_subtype_set, SpaceType::spaceid, and UI_SIDEBAR_PANEL_WIDTH.

Referenced by ED_spacetypes_init().

◆ node_area_listener()

static void node_area_listener ( const wmSpaceTypeListenerParams params)
static

◆ node_area_refresh()

static void node_area_refresh ( const struct bContext C,
ScrArea area 
)
static

◆ node_buttons_region_draw()

static void node_buttons_region_draw ( const bContext C,
ARegion region 
)
static

Definition at line 585 of file space_node.c.

References C, and ED_region_panels().

Referenced by ED_spacetype_node().

◆ node_buttons_region_init()

static void node_buttons_region_init ( wmWindowManager wm,
ARegion region 
)
static

◆ node_collection_drop_poll()

static bool node_collection_drop_poll ( bContext UNUSEDC,
wmDrag drag,
const wmEvent UNUSEDevent,
const char **  UNUSEDr_tooltip 
)
static

Definition at line 679 of file space_node.c.

References ID_GR, and WM_drag_is_ID_type().

Referenced by node_dropboxes().

◆ node_context()

static int node_context ( const bContext C,
const char *  member,
bContextDataResult result 
)
static

◆ node_create()

static SpaceLink* node_create ( const ScrArea UNUSEDarea,
const Scene UNUSEDscene 
)
static

◆ node_cursor()

static void node_cursor ( wmWindow win,
ScrArea area,
ARegion region 
)
static

◆ node_dropboxes()

static void node_dropboxes ( void  )
static

◆ node_duplicate()

static SpaceLink* node_duplicate ( SpaceLink sl)
static

◆ node_free()

static void node_free ( SpaceLink sl)
static

◆ node_group_drop_copy()

static void node_group_drop_copy ( wmDrag drag,
wmDropBox drop 
)
static

◆ node_group_drop_poll()

static bool node_group_drop_poll ( bContext UNUSEDC,
wmDrag drag,
const wmEvent UNUSEDevent,
const char **  UNUSEDr_tooltip 
)
static

Definition at line 663 of file space_node.c.

References ID_NT, and WM_drag_is_ID_type().

Referenced by node_dropboxes().

◆ node_header_region_draw()

static void node_header_region_draw ( const bContext C,
ARegion region 
)
static

Definition at line 788 of file space_node.c.

References C, ED_region_header(), and snode_set_context().

Referenced by ED_spacetype_node().

◆ node_header_region_init()

static void node_header_region_init ( wmWindowManager UNUSEDwm,
ARegion region 
)
static

Definition at line 783 of file space_node.c.

References ED_region_header_init().

Referenced by ED_spacetype_node().

◆ node_id_drop_copy()

static void node_id_drop_copy ( wmDrag drag,
wmDropBox drop 
)
static

◆ node_id_path_drop_copy()

static void node_id_path_drop_copy ( wmDrag drag,
wmDropBox drop 
)
static

◆ node_id_remap()

static void node_id_remap ( ScrArea UNUSEDarea,
SpaceLink slink,
ID old_id,
ID new_id 
)
static

◆ node_ima_drop_poll()

static bool node_ima_drop_poll ( bContext UNUSEDC,
wmDrag drag,
const wmEvent UNUSEDevent,
const char **  UNUSEDr_tooltip 
)
static

Definition at line 695 of file space_node.c.

References ELEM, wmDrag::icon, ID_IM, wmDrag::type, WM_drag_is_ID_type(), and WM_DRAG_PATH.

Referenced by node_dropboxes().

◆ node_init()

static void node_init ( struct wmWindowManager UNUSEDwm,
ScrArea area 
)
static

Definition at line 334 of file space_node.c.

References blender::compositor::area(), if(), MEM_callocN, NULL, and SpaceNode::runtime.

Referenced by ED_spacetype_node().

◆ node_main_region_draw()

static void node_main_region_draw ( const bContext C,
ARegion region 
)
static

Definition at line 656 of file space_node.c.

References C, and node_draw_space().

Referenced by ED_spacetype_node().

◆ node_main_region_init()

static void node_main_region_init ( wmWindowManager wm,
ARegion region 
)
static

◆ node_mask_drop_poll()

static bool node_mask_drop_poll ( bContext UNUSEDC,
wmDrag drag,
const wmEvent UNUSEDevent,
const char **  UNUSEDr_tooltip 
)
static

Definition at line 707 of file space_node.c.

References ID_MSK, and WM_drag_is_ID_type().

Referenced by node_dropboxes().

◆ node_object_drop_poll()

static bool node_object_drop_poll ( bContext UNUSEDC,
wmDrag drag,
const wmEvent UNUSEDevent,
const char **  UNUSEDr_tooltip 
)
static

Definition at line 671 of file space_node.c.

References ID_OB, and WM_drag_is_ID_type().

Referenced by node_dropboxes().

◆ node_region_listener()

static void node_region_listener ( const wmRegionListenerParams params)
static

◆ node_space_subtype_get()

static int node_space_subtype_get ( ScrArea area)
static

◆ node_space_subtype_item_extend()

static void node_space_subtype_item_extend ( bContext C,
EnumPropertyItem **  item,
int *  totitem 
)
static

Definition at line 1026 of file space_node.c.

References C, free(), MEM_freeN, RNA_enum_items_add(), and RNA_enum_node_tree_types_itemf_impl().

Referenced by ED_spacetype_node().

◆ node_space_subtype_set()

static void node_space_subtype_set ( ScrArea area,
int  value 
)
static

◆ node_texture_drop_poll()

static bool node_texture_drop_poll ( bContext UNUSEDC,
wmDrag drag,
const wmEvent UNUSEDevent,
const char **  UNUSEDr_tooltip 
)
static

Definition at line 687 of file space_node.c.

References ID_TE, and WM_drag_is_ID_type().

Referenced by node_dropboxes().

◆ node_toolbar_region_draw()

static void node_toolbar_region_draw ( const bContext C,
ARegion region 
)
static

Definition at line 601 of file space_node.c.

References C, and ED_region_panels().

Referenced by ED_spacetype_node().

◆ node_toolbar_region_init()

static void node_toolbar_region_init ( wmWindowManager wm,
ARegion region 
)
static

◆ node_widgets()

static void node_widgets ( void  )
static

◆ space_node_group_offset()

void space_node_group_offset ( SpaceNode snode,
float x,
float y 
)

Variable Documentation

◆ node_context_dir

const char* node_context_dir[]
Initial value:
= {
"selected_nodes", "active_node", "light", "material", "world", NULL}

Definition at line 870 of file space_node.c.

Referenced by node_context().