diff options
author | Charlie Jolly <charlie> | 2021-03-15 17:57:00 +0300 |
---|---|---|
committer | Charlie Jolly <mistajolly@gmail.com> | 2021-03-15 18:36:22 +0300 |
commit | 3fdef12162f68a7f89a6f868f927fe8755c7bd20 (patch) | |
tree | 02da72fff933fc15c92be67d1ad5aa9911b817b6 /source/blender/editors/space_node/space_node.c | |
parent | 1b29e84c18dc3ba2983d33d2398857add4cda70a (diff) |
Geometry Nodes: Support drag & drop object to create Object Info, Collection Info and Sample Texture nodes
See: {T86296}
Reviewed By: JacquesLucke
Differential Revision: https://developer.blender.org/D10648
Diffstat (limited to 'source/blender/editors/space_node/space_node.c')
-rw-r--r-- | source/blender/editors/space_node/space_node.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/source/blender/editors/space_node/space_node.c b/source/blender/editors/space_node/space_node.c index 289b7d9efa1..5d14919502e 100644 --- a/source/blender/editors/space_node/space_node.c +++ b/source/blender/editors/space_node/space_node.c @@ -667,6 +667,30 @@ static bool node_group_drop_poll(bContext *UNUSED(C), return WM_drag_is_ID_type(drag, ID_NT); } +static bool node_object_drop_poll(bContext *UNUSED(C), + wmDrag *drag, + const wmEvent *UNUSED(event), + const char **UNUSED(r_tooltip)) +{ + return WM_drag_is_ID_type(drag, ID_OB); +} + +static bool node_collection_drop_poll(bContext *UNUSED(C), + wmDrag *drag, + const wmEvent *UNUSED(event), + const char **UNUSED(r_tooltip)) +{ + return WM_drag_is_ID_type(drag, ID_GR); +} + +static bool node_texture_drop_poll(bContext *UNUSED(C), + wmDrag *drag, + const wmEvent *UNUSED(event), + const char **UNUSED(r_tooltip)) +{ + return WM_drag_is_ID_type(drag, ID_TE); +} + static bool node_ima_drop_poll(bContext *UNUSED(C), wmDrag *drag, const wmEvent *UNUSED(event), @@ -721,6 +745,21 @@ static void node_dropboxes(void) ListBase *lb = WM_dropboxmap_find("Node Editor", SPACE_NODE, RGN_TYPE_WINDOW); WM_dropbox_add(lb, + "NODE_OT_add_object", + node_object_drop_poll, + node_id_drop_copy, + WM_drag_free_imported_drag_ID); + WM_dropbox_add(lb, + "NODE_OT_add_collection", + node_collection_drop_poll, + node_id_drop_copy, + WM_drag_free_imported_drag_ID); + WM_dropbox_add(lb, + "NODE_OT_add_texture", + node_texture_drop_poll, + node_id_drop_copy, + WM_drag_free_imported_drag_ID); + WM_dropbox_add(lb, "NODE_OT_add_group", node_group_drop_poll, node_group_drop_copy, |