diff options
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/space_node/space_node.c | 4 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_workspace.c | 13 | ||||
-rw-r--r-- | source/blender/windowmanager/WM_toolsystem.h | 6 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_toolsystem.c | 5 |
4 files changed, 24 insertions, 4 deletions
diff --git a/source/blender/editors/space_node/space_node.c b/source/blender/editors/space_node/space_node.c index 85820ec3e13..8af5fe1b3a1 100644 --- a/source/blender/editors/space_node/space_node.c +++ b/source/blender/editors/space_node/space_node.c @@ -1014,10 +1014,12 @@ void ED_spacetype_node(void) /* regions: toolbar */ art = MEM_callocN(sizeof(ARegionType), "spacetype view3d tools region"); art->regionid = RGN_TYPE_TOOLS; - art->prefsizex = 160; /* XXX */ + art->prefsizex = 58; /* XXX */ art->prefsizey = 50; /* XXX */ art->keymapflag = ED_KEYMAP_UI | ED_KEYMAP_FRAMES; art->listener = node_region_listener; + art->message_subscribe = ED_region_generic_tools_region_message_subscribe; + art->snap_size = ED_region_generic_tools_region_snap_size; art->init = node_toolbar_region_init; art->draw = node_toolbar_region_draw; BLI_addhead(&st->regiontypes, art); diff --git a/source/blender/makesrna/intern/rna_workspace.c b/source/blender/makesrna/intern/rna_workspace.c index 59b1086e17e..a79dc05e09b 100644 --- a/source/blender/makesrna/intern/rna_workspace.c +++ b/source/blender/makesrna/intern/rna_workspace.c @@ -132,6 +132,12 @@ static bToolRef *rna_WorkSpace_tools_from_space_image_mode( return rna_WorkSpace_tools_from_tkey(workspace, &(bToolKey){ .space_type = SPACE_IMAGE, .mode = mode}, create); } +static bToolRef *rna_WorkSpace_tools_from_space_node( + WorkSpace *workspace, bool create) +{ + return rna_WorkSpace_tools_from_tkey(workspace, &(bToolKey){ .space_type = SPACE_NODE, .mode = 0}, create); +} + const EnumPropertyItem *rna_WorkSpace_tools_mode_itemf( bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop), bool *UNUSED(r_free)) { @@ -301,6 +307,13 @@ static void rna_def_workspace_tools(BlenderRNA *brna, PropertyRNA *cprop) /* return type */ parm = RNA_def_pointer(func, "result", "WorkspaceTool", "", ""); RNA_def_function_return(func, parm); + + func = RNA_def_function(srna, "from_space_node", "rna_WorkSpace_tools_from_space_node"); + RNA_def_function_ui_description(func, ""); + RNA_def_boolean(func, "create", false, "Create", ""); + /* return type */ + parm = RNA_def_pointer(func, "result", "WorkspaceTool", "", ""); + RNA_def_function_return(func, parm); } static void rna_def_workspace(BlenderRNA *brna) diff --git a/source/blender/windowmanager/WM_toolsystem.h b/source/blender/windowmanager/WM_toolsystem.h index 7410bf4ab09..9b056ddcae6 100644 --- a/source/blender/windowmanager/WM_toolsystem.h +++ b/source/blender/windowmanager/WM_toolsystem.h @@ -46,9 +46,9 @@ struct WorkSpace; /* wm_toolsystem.c */ #define WM_TOOLSYSTEM_SPACE_MASK ( \ - (1 << SPACE_VIEW3D) | \ - (1 << SPACE_IMAGE) \ -) + (1 << SPACE_IMAGE) | \ + (1 << SPACE_NODE) | \ + (1 << SPACE_VIEW3D) ) /* Values that define a categoey of active tool. */ typedef struct bToolKey { int space_type; int mode; } bToolKey; diff --git a/source/blender/windowmanager/intern/wm_toolsystem.c b/source/blender/windowmanager/intern/wm_toolsystem.c index d1173fccff8..6857e057893 100644 --- a/source/blender/windowmanager/intern/wm_toolsystem.c +++ b/source/blender/windowmanager/intern/wm_toolsystem.c @@ -613,6 +613,11 @@ int WM_toolsystem_mode_from_spacetype( mode = sima->mode; break; } + case SPACE_NODE: + { + mode = 0; + break; + } } return mode; } |