diff options
author | Julian Eisel <julian@blender.org> | 2020-04-16 16:09:49 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2020-04-16 16:29:19 +0300 |
commit | 675d42dfc33d6c791d9e5da31dcc00930519a127 (patch) | |
tree | b8ee5d3dfe6a3580e4565196fcdbc5a3d86c9e76 /source/blender/editors/include | |
parent | 737a4309e8b48e5384487345d17dbb7de88e8bb9 (diff) |
UI: Draw real node sockets for node input buttons
For buttons representing node inputs (e.g. in the material properties)
rather than drawing some generic socket icon, the actual sockets are
drawn now. That includes color, shape and the selection outline.
This should make it easier to understand what these buttons relate to.
Screenshots: {F8469252}, {F8469248} (The left alignment will be done in
a follow-up commit.)
Differential Revision: https://developer.blender.org/D7409
Reviewed by: Brecht Van Lommel, Clément Foucault, William Reynish
Diffstat (limited to 'source/blender/editors/include')
-rw-r--r-- | source/blender/editors/include/ED_node.h | 5 | ||||
-rw-r--r-- | source/blender/editors/include/UI_interface.h | 3 |
2 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/editors/include/ED_node.h b/source/blender/editors/include/ED_node.h index 7a1f64b61d4..dfdd809dbd1 100644 --- a/source/blender/editors/include/ED_node.h +++ b/source/blender/editors/include/ED_node.h @@ -37,6 +37,7 @@ struct Tex; struct View2D; struct bContext; struct bNode; +struct bNodeSocket; struct bNodeSocketType; struct bNodeTree; struct bNodeTree; @@ -79,6 +80,10 @@ void ED_node_draw_snap( struct View2D *v2d, const float cent[2], float size, NodeBorder border, unsigned int pos); /* node_draw.c */ +void ED_node_socket_draw(struct bNodeSocket *sock, + const struct rcti *rect, + const float color[4], + float scale); void ED_node_tree_update(const struct bContext *C); void ED_node_tag_update_id(struct ID *id); void ED_node_tag_update_nodetree(struct Main *bmain, struct bNodeTree *ntree, struct bNode *node); diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index 774cf8c509f..4716e7f0972 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -1585,6 +1585,8 @@ int UI_searchbox_size_x(void); /* check if a string is in an existing search box */ int UI_search_items_find_index(uiSearchItems *items, const char *name); +void UI_but_node_link_set(uiBut *but, struct bNodeSocket *socket, const float draw_color[4]); + void UI_block_func_handle_set(uiBlock *block, uiBlockHandleFunc func, void *arg); void UI_block_func_butmenu_set(uiBlock *block, uiMenuHandleFunc func, void *arg); void UI_block_func_set(uiBlock *block, uiButHandleFunc func, void *arg1, void *arg2); @@ -2088,6 +2090,7 @@ void uiTemplateList(uiLayout *layout, bool sort_reverse, bool sort_lock); void uiTemplateNodeLink(uiLayout *layout, + struct bContext *C, struct bNodeTree *ntree, struct bNode *node, struct bNodeSocket *input); |