33 #include "RNA_prototypes.h"
52 bNodeTreePath *path = MEM_cnew<bNodeTreePath>(
"node tree path");
85 bNodeTreePath *path = MEM_cnew<bNodeTreePath>(
"node tree path");
162 length += strlen(path->display_name);
177 strcpy(value, path->display_name);
178 value += strlen(path->display_name);
181 sprintf(value,
"/%s", path->display_name);
182 value += strlen(path->display_name) + 1;
221 SpaceNode *snode = MEM_cnew<SpaceNode>(
"initnode");
239 ARegion *region = MEM_cnew<ARegion>(
"header for node");
246 region = MEM_cnew<ARegion>(
"buttons for node");
253 region = MEM_cnew<ARegion>(
"node tools");
262 region = MEM_cnew<ARegion>(
"main region for node");
274 region->
v2d.
min[0] = 1.0f;
275 region->
v2d.
min[1] = 1.0f;
277 region->
v2d.
max[0] = 32000.0f;
278 region->
v2d.
max[1] = 32000.0f;
310 snode->
runtime = MEM_new<SpaceNode_Runtime>(__func__);
320 if (
node->id ==
id) {
380 if (region && path) {
659 return (
ELEM(drag->
icon, 0, ICON_FILE_IMAGE, ICON_FILE_MOVIE));
691 else if (drag->
path[0]) {
703 "NODE_OT_add_object",
709 "NODE_OT_add_collection",
829 "selected_nodes",
"active_node",
"light",
"material",
"world",
nullptr};
910 if (snode->
id == old_id) {
918 snode->
from =
nullptr;
923 if (snode->
from == old_id) {
924 if (new_id ==
nullptr) {
927 snode->
from = new_id;
931 if ((
ID *)snode->
gpd == old_id) {
955 for (; path; path = path_next) {
956 path_next = path->
next;
976 const struct IDRemapper *mappings)
1020 SpaceType *
st = MEM_cnew<SpaceType>(
"spacetype node");
1043 art = MEM_cnew<ARegionType>(
"spacetype node region");
1057 art = MEM_cnew<ARegionType>(
"spacetype node region");
1068 art = MEM_cnew<ARegionType>(
"spacetype node region");
1079 art = MEM_cnew<ARegionType>(
"spacetype view3d tools region");
void CTX_data_dir_set(bContextDataResult *result, const char **dir)
struct SpaceNode * CTX_wm_space_node(const bContext *C)
bool CTX_data_equals(const char *member, const char *str)
void CTX_data_pointer_set(bContextDataResult *result, struct ID *id, StructRNA *type, void *data)
void CTX_data_id_pointer_set(bContextDataResult *result, struct ID *id)
bool CTX_data_dir(const char *member)
@ CTX_DATA_TYPE_COLLECTION
@ CTX_RESULT_MEMBER_NOT_FOUND
void CTX_data_list_add(bContextDataResult *result, struct ID *id, StructRNA *type, void *data)
void CTX_data_type_set(struct bContextDataResult *result, short type)
void id_us_min(struct ID *id)
void id_us_ensure_real(struct ID *id)
void id_us_plus(struct ID *id)
void BKE_id_remapper_iter(const struct IDRemapper *id_remapper, IDRemapperIterFunction func, void *user_data)
const bNodeInstanceKey NODE_INSTANCE_KEY_BASE
struct bNode * nodeGetActive(struct bNodeTree *ntree)
#define NODE_TREE_TYPES_BEGIN(ntype)
#define NODE_TREE_TYPES_END
bNodeInstanceKey BKE_node_instance_key(bNodeInstanceKey parent_key, const struct bNodeTree *ntree, const struct bNode *node)
struct ARegion * BKE_area_find_region_type(const struct ScrArea *area, int type)
void BKE_spacetype_register(struct SpaceType *st)
void BLI_kdtree_nd_() free(KDTree *tree)
void BLI_addhead(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
#define LISTBASE_FOREACH(type, var, list)
void void void void void BLI_duplicatelist(struct ListBase *dst, const struct ListBase *src) ATTR_NONNULL(1
#define LISTBASE_FOREACH_MUTABLE(type, var, list)
#define LISTBASE_FOREACH_BACKWARD(type, var, list)
BLI_INLINE void BLI_listbase_clear(struct ListBase *lb)
#define LISTBASE_FOREACH_INDEX(type, var, list, index_var)
void void BLI_freelistN(struct ListBase *listbase) ATTR_NONNULL(1)
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_remlink(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
int BLI_listbase_count(const struct ListBase *listbase) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
MINLINE void copy_v2_v2(float r[2], const float a[2])
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t maxncpy) ATTR_NONNULL()
@ SN_OVERLAY_SHOW_WIRE_COLORS
@ SN_OVERLAY_SHOW_OVERLAYS
bool ED_node_is_compositor(struct SpaceNode *snode)
void ED_node_set_tree_type(struct SpaceNode *snode, struct bNodeTreeType *typeinfo)
bool ED_node_is_texture(struct SpaceNode *snode)
bool ED_node_is_geometry(struct SpaceNode *snode)
bool ED_node_is_shader(struct SpaceNode *snode)
void ED_node_composite_job(const struct bContext *C, struct bNodeTree *nodetree, struct Scene *scene_owner)
void ED_area_tag_redraw(ScrArea *area)
void ED_region_header(const struct bContext *C, struct ARegion *region)
void ED_area_do_mgs_subscribe_for_tool_ui(const struct wmRegionMessageSubscribeParams *params)
int ED_region_generic_tools_region_snap_size(const struct ARegion *region, int size, int axis)
void ED_region_generic_tools_region_message_subscribe(const struct wmRegionMessageSubscribeParams *params)
void ED_region_panels(const struct bContext *C, struct ARegion *region)
void ED_region_panels_init(struct wmWindowManager *wm, struct ARegion *region)
void ED_region_tag_redraw(struct ARegion *region)
void ED_region_header_init(struct ARegion *region)
void ED_area_tag_refresh(ScrArea *area)
Read Guarded memory(de)allocation.
struct bNodeTreeType * rna_node_tree_type_from_enum(int value)
int rna_node_tree_idname_to_enum(const char *idname)
const EnumPropertyItem * RNA_enum_node_tree_types_itemf_impl(struct bContext *C, bool *r_free)
#define UI_SIDEBAR_PANEL_WIDTH
bool UI_but_active_drop_name(const struct bContext *C)
void UI_view2d_center_set(struct View2D *v2d, float x, float y)
void UI_view2d_region_reinit(struct View2D *v2d, short type, int winx, int winy)
void UI_view2d_region_to_view(const struct View2D *v2d, float x, float y, float *r_view_x, float *r_view_y) ATTR_NONNULL()
#define ND_TRANSFORM_DONE
#define ND_GPENCIL_EDITMODE
#define ND_SPACE_NODE_VIEW
void(* MEM_freeN)(void *vmemh)
void *(* MEM_dupallocN)(const void *vmemh)
static void area(int d1, int d2, int e1, int e2, float weights[2])
static void node_widgets()
static void node_space_subtype_item_extend(bContext *C, EnumPropertyItem **item, int *totitem)
void node_set_cursor(wmWindow &win, SpaceNode &snode, const float2 &cursor)
static void node_id_path_drop_copy(bContext *UNUSED(C), wmDrag *drag, wmDropBox *drop)
static void node_area_refresh(const struct bContext *C, ScrArea *area)
static void node_toolbar_region_draw(const bContext *C, ARegion *region)
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_main_region_init(wmWindowManager *wm, ARegion *region)
static void node_id_remap_cb(ID *old_id, ID *new_id, void *user_data)
static SpaceLink * node_create(const ScrArea *UNUSED(area), const Scene *UNUSED(scene))
static void node_id_remap(ScrArea *UNUSED(area), SpaceLink *slink, const struct IDRemapper *mappings)
void NODE_GGT_backdrop_corner_pin(wmGizmoGroupType *gzgt)
static bool node_collection_drop_poll(bContext *C, wmDrag *drag, const wmEvent *UNUSED(event))
static bool node_group_drop_poll(bContext *UNUSED(C), wmDrag *drag, const wmEvent *UNUSED(event))
static bool node_ima_drop_poll(bContext *UNUSED(C), wmDrag *drag, const wmEvent *UNUSED(event))
static int node_space_subtype_get(ScrArea *area)
void NODE_GGT_backdrop_crop(wmGizmoGroupType *gzgt)
static SpaceLink * node_duplicate(SpaceLink *sl)
static bool node_mask_drop_poll(bContext *UNUSED(C), wmDrag *drag, const wmEvent *UNUSED(event))
static void node_region_listener(const wmRegionListenerParams *params)
float2 space_node_group_offset(const SpaceNode &snode)
static void node_area_tag_recalc_auto_compositing(SpaceNode *snode, ScrArea *area)
static void node_free(SpaceLink *sl)
static void node_id_drop_copy(bContext *UNUSED(C), wmDrag *drag, wmDropBox *drop)
void node_operatortypes()
static void node_dropboxes()
void NODE_GGT_backdrop_transform(wmGizmoGroupType *gzgt)
void snode_set_context(const bContext &C)
void NODE_GGT_backdrop_sun_beams(wmGizmoGroupType *gzgt)
static void node_init(struct wmWindowManager *UNUSED(wm), ScrArea *area)
static void node_area_listener(const wmSpaceTypeListenerParams *params)
void node_keymap(wmKeyConfig *keyconf)
static int node_context(const bContext *C, const char *member, bContextDataResult *result)
void node_draw_space(const bContext &C, ARegion ®ion)
static void node_cursor(wmWindow *win, ScrArea *area, ARegion *region)
static void node_buttons_region_draw(const bContext *C, ARegion *region)
int node_render_changed_exec(bContext *C, wmOperator *UNUSED(op))
static void node_toolbar_region_init(wmWindowManager *wm, ARegion *region)
static bool node_object_drop_poll(bContext *C, wmDrag *drag, const wmEvent *UNUSED(event))
static void node_main_region_draw(const bContext *C, ARegion *region)
static bool any_node_uses_id(const bNodeTree *ntree, const ID *id)
static void node_group_drop_copy(bContext *UNUSED(C), wmDrag *drag, wmDropBox *drop)
static void node_buttons_region_init(wmWindowManager *wm, ARegion *region)
static void node_area_tag_tree_recalc(SpaceNode *snode, ScrArea *area)
static void node_space_subtype_set(ScrArea *area, int value)
T length(const vec_base< T, Size > &a)
vec_base< float, 2 > float2
static const pxr::TfToken st("st", pxr::TfToken::Immortal)
void RNA_string_set(PointerRNA *ptr, const char *name, const char *value)
void RNA_int_set(PointerRNA *ptr, const char *name, int value)
void RNA_struct_property_unset(PointerRNA *ptr, const char *identifier)
void RNA_enum_items_add(EnumPropertyItem **items, int *totitem, const EnumPropertyItem *item)
void ED_node_tree_push(SpaceNode *snode, bNodeTree *ntree, bNode *gnode)
void ED_node_cursor_location_set(SpaceNode *snode, const float value[2])
void ED_node_tree_path_get(SpaceNode *snode, char *value)
int ED_node_tree_depth(SpaceNode *snode)
void ED_node_set_active_viewer_key(SpaceNode *snode)
int ED_node_tree_path_length(SpaceNode *snode)
void ED_node_tree_pop(SpaceNode *snode)
bNodeTree * ED_node_tree_get(SpaceNode *snode, int level)
const char * node_context_dir[]
void ED_node_cursor_location_get(const SpaceNode *snode, float value[2])
void ED_node_tree_start(SpaceNode *snode, bNodeTree *ntree, ID *id, ID *from)
void(* draw)(const struct bContext *C, struct ARegion *region)
bool clip_gizmo_events_by_ui
void(* message_subscribe)(const wmRegionMessageSubscribeParams *params)
void(* cursor)(struct wmWindow *win, struct ScrArea *area, struct ARegion *region)
int(* snap_size)(const struct ARegion *region, int size, int axis)
void(* listener)(const wmRegionListenerParams *params)
void(* init)(struct wmWindowManager *wm, struct ARegion *region)
struct wmGizmoMap * gizmo_map
unsigned int session_uuid
SpaceNode_Runtime * runtime
struct bNodeTree * edittree
struct bNodeTree * nodetree
struct bNodeTree * nodetree
struct bNodeTreePath * next
struct bNodeTreePath * prev
bNodeInstanceKey parent_key
struct bNodeInstanceHash * previews
bNodeInstanceKey active_viewer_key
bool recalc_regular_compositing
std::unique_ptr< bNodeLinkDrag > linkdrag
bool recalc_auto_compositing
struct wmKeyConfig * defaultconf
struct wmEvent * eventstate
ID * WM_drag_get_local_ID_or_import_from_asset(const wmDrag *drag, int idcode)
void WM_drag_free_imported_drag_ID(Main *bmain, wmDrag *drag, wmDropBox *drop)
Free asset ID imported for canceled drop.
bool WM_drag_is_ID_type(const wmDrag *drag, int idcode)
ListBase * WM_dropboxmap_find(const char *idname, int spaceid, int regionid)
wmDropBox * WM_dropbox_add(ListBase *lb, const char *idname, bool(*poll)(bContext *, wmDrag *, const wmEvent *), void(*copy)(bContext *, wmDrag *, wmDropBox *), void(*cancel)(Main *, wmDrag *, wmDropBox *), WMDropboxTooltipFunc tooltip)
wmEventHandler_Dropbox * WM_event_add_dropbox_handler(ListBase *handlers, ListBase *dropboxes)
void WM_main_add_notifier(unsigned int type, void *reference)
wmEventHandler_Keymap * WM_event_add_keymap_handler_v2d_mask(ListBase *handlers, wmKeyMap *keymap)
wmEventHandler_Keymap * WM_event_add_keymap_handler(ListBase *handlers, wmKeyMap *keymap)
wmGizmoGroupTypeRef * WM_gizmogrouptype_append_and_link(wmGizmoMapType *gzmap_type, void(*wtfunc)(struct wmGizmoGroupType *))
wmGizmoMapType * WM_gizmomaptype_ensure(const struct wmGizmoMapType_Params *gzmap_params)
void WM_gizmomap_tag_refresh(wmGizmoMap *gzmap)
wmKeyMap * WM_keymap_ensure(wmKeyConfig *keyconf, const char *idname, int spaceid, int regionid)