2022-02-11 09:07:11 +11:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
|
* Copyright 2008 Blender Foundation. All rights reserved. */
|
2011-02-27 20:29:51 +00:00
|
|
|
|
2019-02-18 08:08:12 +11:00
|
|
|
/** \file
|
|
|
|
|
* \ingroup spnode
|
2011-02-27 20:29:51 +00:00
|
|
|
*/
|
|
|
|
|
|
2012-02-17 18:59:41 +00:00
|
|
|
#pragma once
|
2008-12-13 18:09:49 +00:00
|
|
|
|
2022-02-15 10:27:03 -06:00
|
|
|
#include "BLI_math_vector.h"
|
|
|
|
|
#include "BLI_math_vector.hh"
|
2021-11-12 12:12:27 -06:00
|
|
|
#include "BLI_vector.hh"
|
2022-12-02 13:20:40 -06:00
|
|
|
#include "BLI_vector_set.hh"
|
2021-11-12 12:12:27 -06:00
|
|
|
|
2021-12-03 11:31:25 -05:00
|
|
|
#include "BKE_node.h"
|
2011-09-05 21:01:50 +00:00
|
|
|
|
2021-12-03 11:31:25 -05:00
|
|
|
#include "UI_interface.h"
|
|
|
|
|
#include "UI_interface.hh"
|
|
|
|
|
#include "UI_view2d.h"
|
2008-12-13 18:09:49 +00:00
|
|
|
|
2008-12-24 10:33:10 +00:00
|
|
|
struct ARegion;
|
2009-08-19 00:55:30 +00:00
|
|
|
struct ARegionType;
|
2019-01-28 21:08:24 +11:00
|
|
|
struct Main;
|
2021-02-18 14:14:17 +11:00
|
|
|
struct NodeInsertOfsData;
|
2008-12-24 10:33:10 +00:00
|
|
|
struct View2D;
|
|
|
|
|
struct bContext;
|
2011-03-13 22:07:55 +00:00
|
|
|
struct bNode;
|
|
|
|
|
struct bNodeLink;
|
2019-01-28 21:08:24 +11:00
|
|
|
struct bNodeSocket;
|
2020-04-16 15:09:49 +02:00
|
|
|
struct wmGizmoGroupType;
|
Holiday coding log :)
Nice formatted version (pictures soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.66/Usability
Short list of main changes:
- Transparent region option (over main region), added code to blend in/out such panels.
- Min size window now 640 x 480
- Fixed DPI for ui - lots of cleanup and changes everywhere. Icon image need correct size still, layer-in-use icon needs remake.
- Macbook retina support, use command line --no-native-pixels to disable it
- Timeline Marker label was drawing wrong
- Trackpad and magic mouse: supports zoom (hold ctrl)
- Fix for splash position: removed ghost function and made window size update after creation immediate
- Fast undo buffer save now adds UI as well. Could be checked for regular file save even...
Quit.blend and temp file saving use this now.
- Dixed filename in window on reading quit.blend or temp saves, and they now add a warning in window title: "(Recovered)"
- New Userpref option "Keep Session" - this always saves quit.blend, and loads on start.
This allows keeping UI and data without actual saves, until you actually save.
When you load startup.blend and quit, it recognises the quit.blend as a startup (no file name in header)
- Added 3D view copy/paste buffers (selected objects). Shortcuts ctrl-c, ctrl-v (OSX, cmd-c, cmd-v).
Coded partial file saving for it. Could be used for other purposes. Todo: use OS clipboards.
- User preferences (themes, keymaps, user settings) now can be saved as a separate file.
Old option is called "Save Startup File" the new one "Save User Settings".
To visualise this difference, the 'save startup file' button has been removed from user preferences window. That option is available as CTRL+U and in File menu still.
- OSX: fixed bug that stopped giving mouse events outside window.
This also fixes "Continuous Grab" for OSX. (error since 2009)
2012-12-12 18:58:11 +00:00
|
|
|
struct wmKeyConfig;
|
2019-01-28 21:08:24 +11:00
|
|
|
struct wmWindow;
|
2011-03-13 22:07:55 +00:00
|
|
|
|
2022-01-20 15:10:28 -06:00
|
|
|
/* Outside of blender namespace to avoid Python documentation build error with `ctypes`. */
|
2022-05-18 19:24:08 +10:00
|
|
|
extern "C" {
|
2022-01-20 15:10:28 -06:00
|
|
|
extern const char *node_context_dir[];
|
2022-05-18 19:24:08 +10:00
|
|
|
};
|
2022-01-20 15:10:28 -06:00
|
|
|
|
2022-01-20 10:36:56 -06:00
|
|
|
namespace blender::ed::space_node {
|
|
|
|
|
|
2022-11-01 16:09:49 +01:00
|
|
|
struct AssetItemTree;
|
|
|
|
|
|
2021-12-03 11:31:25 -05:00
|
|
|
/** Temporary data used in node link drag modal operator. */
|
2021-11-18 11:46:44 -05:00
|
|
|
struct bNodeLinkDrag {
|
2021-11-19 15:36:32 -05:00
|
|
|
/** Links dragged by the operator. */
|
2022-01-20 10:36:56 -06:00
|
|
|
Vector<bNodeLink *> links;
|
2021-12-15 09:51:57 -06:00
|
|
|
eNodeSocketInOut in_out;
|
|
|
|
|
|
|
|
|
|
/** Draw handler for the "+" icon when dragging a link in empty space. */
|
|
|
|
|
void *draw_handle;
|
2021-03-02 23:09:38 +01:00
|
|
|
|
2021-04-15 10:00:25 +02:00
|
|
|
/** Temporarily stores the last picked link from multi-input socket operator. */
|
2021-12-15 09:51:57 -06:00
|
|
|
bNodeLink *last_picked_multi_input_socket_link;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Temporarily stores the last hovered socket for multi-input socket operator.
|
|
|
|
|
* Store it to recalculate sorting after it is no longer hovered.
|
|
|
|
|
*/
|
|
|
|
|
bNode *last_node_hovered_while_dragging_a_link;
|
2021-03-15 15:41:41 +01:00
|
|
|
|
2021-12-15 09:51:57 -06:00
|
|
|
/* The cursor position, used for drawing a + icon when dragging a node link. */
|
|
|
|
|
std::array<int, 2> cursor;
|
|
|
|
|
|
|
|
|
|
/** The node the drag started at. */
|
|
|
|
|
bNode *start_node;
|
|
|
|
|
/** The socket the drag started at. */
|
|
|
|
|
bNodeSocket *start_socket;
|
|
|
|
|
/** The number of links connected to the #start_socket when the drag started. */
|
|
|
|
|
int start_link_count;
|
2021-06-16 18:17:07 +01:00
|
|
|
|
|
|
|
|
/* Data for edge panning */
|
|
|
|
|
View2DEdgePanData pan_data;
|
2021-11-18 11:46:44 -05:00
|
|
|
};
|
2008-12-28 00:08:34 +00:00
|
|
|
|
2021-11-18 11:46:44 -05:00
|
|
|
struct SpaceNode_Runtime {
|
2021-01-19 16:43:08 -06:00
|
|
|
float aspect;
|
|
|
|
|
|
|
|
|
|
/** Mouse position for drawing socket-less links and adding nodes. */
|
2022-01-20 10:36:56 -06:00
|
|
|
float2 cursor;
|
2021-01-19 16:43:08 -06:00
|
|
|
|
2022-05-06 17:56:59 +10:00
|
|
|
/**
|
|
|
|
|
* Indicates that the compositing tree in the space needs to be re-evaluated using the
|
2022-05-05 17:33:10 +10:00
|
|
|
* auto-compositing pipeline.
|
2022-05-06 17:56:59 +10:00
|
|
|
* Takes priority over the regular compositing.
|
|
|
|
|
*/
|
2022-05-05 17:33:10 +10:00
|
|
|
bool recalc_auto_compositing;
|
|
|
|
|
|
2022-05-06 17:56:59 +10:00
|
|
|
/**
|
|
|
|
|
* Indicates that the compositing int the space tree needs to be re-evaluated using
|
|
|
|
|
* regular compositing pipeline.
|
|
|
|
|
*/
|
2022-05-05 17:33:10 +10:00
|
|
|
bool recalc_regular_compositing;
|
2021-01-19 16:43:08 -06:00
|
|
|
|
|
|
|
|
/** Temporary data for modal linking operator. */
|
2021-11-19 15:36:32 -05:00
|
|
|
std::unique_ptr<bNodeLinkDrag> linkdrag;
|
2021-01-19 16:43:08 -06:00
|
|
|
|
|
|
|
|
/* XXX hack for translate_attach op-macros to pass data from transform op to insert_offset op */
|
|
|
|
|
/** Temporary data for node insert offset (in UI called Auto-offset). */
|
|
|
|
|
struct NodeInsertOfsData *iofsd;
|
2022-11-01 16:09:49 +01:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Temporary data for node add menu in order to provide longer-term storage for context pointers.
|
|
|
|
|
* Recreated every time the root menu is opened. In the future this will be replaced with an "all
|
|
|
|
|
* libraries" cache in the asset system itself.
|
|
|
|
|
*
|
|
|
|
|
* Stored with a shared pointer so that it can be forward declared.
|
|
|
|
|
*/
|
|
|
|
|
std::shared_ptr<AssetItemTree> assets_for_menu;
|
2021-11-18 11:46:44 -05:00
|
|
|
};
|
2021-01-19 16:43:08 -06:00
|
|
|
|
2021-12-05 16:45:41 -05:00
|
|
|
enum NodeResizeDirection {
|
|
|
|
|
NODE_RESIZE_NONE = 0,
|
|
|
|
|
NODE_RESIZE_TOP = (1 << 0),
|
|
|
|
|
NODE_RESIZE_BOTTOM = (1 << 1),
|
|
|
|
|
NODE_RESIZE_RIGHT = (1 << 2),
|
|
|
|
|
NODE_RESIZE_LEFT = (1 << 3),
|
|
|
|
|
};
|
|
|
|
|
ENUM_OPERATORS(NodeResizeDirection, NODE_RESIZE_LEFT);
|
|
|
|
|
|
2022-05-06 17:56:59 +10:00
|
|
|
/* Nodes draw without DPI - the view zoom is flexible. */
|
2022-02-03 15:34:01 -06:00
|
|
|
#define HIDDEN_RAD (0.75f * U.widget_unit)
|
|
|
|
|
#define BASIS_RAD (0.2f * U.widget_unit)
|
|
|
|
|
#define NODE_DYS (U.widget_unit / 2)
|
|
|
|
|
#define NODE_DY U.widget_unit
|
|
|
|
|
#define NODE_SOCKDY (0.1f * U.widget_unit)
|
|
|
|
|
#define NODE_WIDTH(node) (node.width * UI_DPI_FAC)
|
|
|
|
|
#define NODE_HEIGHT(node) (node.height * UI_DPI_FAC)
|
|
|
|
|
#define NODE_MARGIN_X (1.2f * U.widget_unit)
|
|
|
|
|
#define NODE_SOCKSIZE (0.25f * U.widget_unit)
|
2022-02-28 18:05:12 -05:00
|
|
|
#define NODE_SOCKSIZE_DRAW_MULIPLIER 2.25f
|
|
|
|
|
#define NODE_SOCK_OUTLINE_SCALE 1.0f
|
2022-02-03 15:34:01 -06:00
|
|
|
#define NODE_MULTI_INPUT_LINK_GAP (0.25f * U.widget_unit)
|
|
|
|
|
#define NODE_RESIZE_MARGIN (0.20f * U.widget_unit)
|
|
|
|
|
#define NODE_LINK_RESOL 12
|
|
|
|
|
|
|
|
|
|
/* space_node.cc */
|
|
|
|
|
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* Transform between View2Ds in the tree path.
|
|
|
|
|
*/
|
2022-01-20 10:36:56 -06:00
|
|
|
float2 space_node_group_offset(const SpaceNode &snode);
|
2013-03-18 16:34:57 +00:00
|
|
|
|
2021-12-03 11:05:59 -05:00
|
|
|
int node_get_resize_cursor(NodeResizeDirection directions);
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* Usual convention here would be #node_socket_get_color(),
|
|
|
|
|
* but that's already used (for setting a color property socket).
|
|
|
|
|
*/
|
2021-12-03 16:25:17 -05:00
|
|
|
void node_socket_color_get(const bContext &C,
|
|
|
|
|
const bNodeTree &ntree,
|
|
|
|
|
PointerRNA &node_ptr,
|
|
|
|
|
const bNodeSocket &sock,
|
2020-04-16 15:09:49 +02:00
|
|
|
float r_color[4]);
|
2022-02-03 15:34:01 -06:00
|
|
|
|
|
|
|
|
/* node_draw.cc */
|
|
|
|
|
|
2021-12-03 16:25:17 -05:00
|
|
|
void node_draw_space(const bContext &C, ARegion ®ion);
|
2008-12-24 10:33:10 +00:00
|
|
|
|
2022-09-02 16:38:08 -05:00
|
|
|
void node_socket_add_tooltip(const bNodeTree &ntree,
|
|
|
|
|
const bNode &node,
|
|
|
|
|
const bNodeSocket &sock,
|
|
|
|
|
uiLayout &layout);
|
UI: Add support for showing socket descriptions in tooltips
Currently, hovering over a socket itself shows no tooltip at all, while
hovering over its value field shows "Default value", which is not helpful.
This patch therefore implements socket tooltips following the proposal at
https://blender.community/c/rightclickselect/2Qgbbc/.
A lot of the basic functionality was already implemented for Geometry Nodes,
where hovering over the socket itself shows introspection info.
This patch extends this by:
- Supporting dynamic tooltips on labels, which is important for good tooltip
coverage in a socket's region of the node.
- Adding a function to setting a dynamic tooltip for an entire uiLayout, which
avoids needing to set it manually for a wide variety of socket types.
- Hiding the property label field in a tooltip when dynamic tooltip is also
provided. If really needed, this label can be restored through the dynamic
tooltip, but in all current cases the label is actually pointless anyways
since the dynamic tooltip gives more accurate and specific information.
- Adding dynamic tooltips to a socket's UI layout row if it has a description
configured, both in the Node Editor as well as in the Material Properties.
Note that the patch does not add any actual tooltip content yet, just the
infrastructure to show them. By default, sockets without a description still
show the old "Default value" tooltip.
For an example of how to add socket descriptions, check the Cylinder node
in the Geometry Nodes.
Differential Revision: https://developer.blender.org/D9967
2022-04-11 02:02:12 +02:00
|
|
|
|
2022-01-18 13:07:18 -06:00
|
|
|
/**
|
|
|
|
|
* Sort nodes by selection: unselected nodes first, then selected,
|
|
|
|
|
* then the active node at the very end. Relative order is kept intact.
|
|
|
|
|
*/
|
2022-01-18 13:32:36 -06:00
|
|
|
void node_sort(bNodeTree &ntree);
|
2022-01-18 13:07:18 -06:00
|
|
|
|
2022-01-20 10:36:56 -06:00
|
|
|
void node_set_cursor(wmWindow &win, SpaceNode &snode, const float2 &cursor);
|
Holiday coding log :)
Nice formatted version (pictures soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.66/Usability
Short list of main changes:
- Transparent region option (over main region), added code to blend in/out such panels.
- Min size window now 640 x 480
- Fixed DPI for ui - lots of cleanup and changes everywhere. Icon image need correct size still, layer-in-use icon needs remake.
- Macbook retina support, use command line --no-native-pixels to disable it
- Timeline Marker label was drawing wrong
- Trackpad and magic mouse: supports zoom (hold ctrl)
- Fix for splash position: removed ghost function and made window size update after creation immediate
- Fast undo buffer save now adds UI as well. Could be checked for regular file save even...
Quit.blend and temp file saving use this now.
- Dixed filename in window on reading quit.blend or temp saves, and they now add a warning in window title: "(Recovered)"
- New Userpref option "Keep Session" - this always saves quit.blend, and loads on start.
This allows keeping UI and data without actual saves, until you actually save.
When you load startup.blend and quit, it recognises the quit.blend as a startup (no file name in header)
- Added 3D view copy/paste buffers (selected objects). Shortcuts ctrl-c, ctrl-v (OSX, cmd-c, cmd-v).
Coded partial file saving for it. Could be used for other purposes. Todo: use OS clipboards.
- User preferences (themes, keymaps, user settings) now can be saved as a separate file.
Old option is called "Save Startup File" the new one "Save User Settings".
To visualise this difference, the 'save startup file' button has been removed from user preferences window. That option is available as CTRL+U and in File menu still.
- OSX: fixed bug that stopped giving mouse events outside window.
This also fixes "Continuous Grab" for OSX. (error since 2009)
2012-12-12 18:58:11 +00:00
|
|
|
/* DPI scaled coords */
|
2022-01-20 10:36:56 -06:00
|
|
|
float2 node_to_view(const bNode &node, const float2 &co);
|
2021-12-03 16:25:17 -05:00
|
|
|
void node_to_updated_rect(const bNode &node, rctf &r_rect);
|
2022-01-20 10:36:56 -06:00
|
|
|
float2 node_from_view(const bNode &node, const float2 &co);
|
2012-05-22 14:13:33 +00:00
|
|
|
|
2022-02-03 15:34:01 -06:00
|
|
|
/* node_ops.cc */
|
|
|
|
|
|
2022-01-05 21:44:03 -05:00
|
|
|
void node_operatortypes();
|
2021-11-18 11:46:44 -05:00
|
|
|
void node_keymap(wmKeyConfig *keyconf);
|
2008-12-28 00:08:34 +00:00
|
|
|
|
2022-02-03 15:34:01 -06:00
|
|
|
/* node_select.cc */
|
|
|
|
|
|
2022-05-18 14:25:05 +10:00
|
|
|
rctf node_frame_rect_inside(const bNode &node);
|
2022-09-02 16:38:08 -05:00
|
|
|
bool node_or_socket_isect_event(const bContext &C, const wmEvent &event);
|
2022-05-18 14:25:05 +10:00
|
|
|
|
2022-12-20 17:14:34 -06:00
|
|
|
void node_deselect_all(bNodeTree &node_tree);
|
2021-12-03 16:25:17 -05:00
|
|
|
void node_socket_select(bNode *node, bNodeSocket &sock);
|
2022-01-07 11:38:08 +11:00
|
|
|
void node_socket_deselect(bNode *node, bNodeSocket &sock, bool deselect_node);
|
2022-12-20 17:14:34 -06:00
|
|
|
void node_deselect_all_input_sockets(bNodeTree &node_tree, bool deselect_nodes);
|
|
|
|
|
void node_deselect_all_output_sockets(bNodeTree &node_tree, bool deselect_nodes);
|
2021-12-03 16:25:17 -05:00
|
|
|
void node_select_single(bContext &C, bNode &node);
|
2021-11-18 11:46:44 -05:00
|
|
|
|
|
|
|
|
void NODE_OT_select(wmOperatorType *ot);
|
|
|
|
|
void NODE_OT_select_all(wmOperatorType *ot);
|
|
|
|
|
void NODE_OT_select_linked_to(wmOperatorType *ot);
|
|
|
|
|
void NODE_OT_select_linked_from(wmOperatorType *ot);
|
|
|
|
|
void NODE_OT_select_box(wmOperatorType *ot);
|
|
|
|
|
void NODE_OT_select_circle(wmOperatorType *ot);
|
|
|
|
|
void NODE_OT_select_lasso(wmOperatorType *ot);
|
|
|
|
|
void NODE_OT_select_grouped(wmOperatorType *ot);
|
|
|
|
|
void NODE_OT_select_same_type_step(wmOperatorType *ot);
|
|
|
|
|
void NODE_OT_find_node(wmOperatorType *ot);
|
2008-12-28 00:08:34 +00:00
|
|
|
|
2022-02-03 15:34:01 -06:00
|
|
|
/* node_view.cc */
|
|
|
|
|
|
2021-12-03 16:25:17 -05:00
|
|
|
bool space_node_view_flag(
|
|
|
|
|
bContext &C, SpaceNode &snode, ARegion ®ion, int node_flag, int smooth_viewtx);
|
2013-03-27 17:22:12 +00:00
|
|
|
|
2021-11-18 11:46:44 -05:00
|
|
|
void NODE_OT_view_all(wmOperatorType *ot);
|
|
|
|
|
void NODE_OT_view_selected(wmOperatorType *ot);
|
2011-12-18 12:51:50 +00:00
|
|
|
|
2021-11-18 11:46:44 -05:00
|
|
|
void NODE_OT_backimage_move(wmOperatorType *ot);
|
|
|
|
|
void NODE_OT_backimage_zoom(wmOperatorType *ot);
|
|
|
|
|
void NODE_OT_backimage_fit(wmOperatorType *ot);
|
|
|
|
|
void NODE_OT_backimage_sample(wmOperatorType *ot);
|
2012-08-02 21:52:09 +00:00
|
|
|
|
2022-02-03 15:34:01 -06:00
|
|
|
/* drawnode.cc */
|
|
|
|
|
|
|
|
|
|
NodeResizeDirection node_get_resize_direction(const bNode *node, int x, int y);
|
|
|
|
|
|
2021-12-03 16:25:17 -05:00
|
|
|
void nodelink_batch_start(SpaceNode &snode);
|
|
|
|
|
void nodelink_batch_end(SpaceNode &snode);
|
|
|
|
|
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* \note this is used for fake links in groups too.
|
|
|
|
|
*/
|
2021-12-03 16:25:17 -05:00
|
|
|
void node_draw_link(const bContext &C,
|
|
|
|
|
const View2D &v2d,
|
|
|
|
|
const SpaceNode &snode,
|
2022-02-28 15:52:00 -05:00
|
|
|
const bNodeLink &link,
|
|
|
|
|
bool selected);
|
2022-09-01 19:46:19 +02:00
|
|
|
void node_draw_link_dragged(const bContext &C,
|
|
|
|
|
const View2D &v2d,
|
|
|
|
|
const SpaceNode &snode,
|
|
|
|
|
const bNodeLink &link);
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* Don't do shadows if th_col3 is -1.
|
|
|
|
|
*/
|
2021-12-03 16:25:17 -05:00
|
|
|
void node_draw_link_bezier(const bContext &C,
|
|
|
|
|
const View2D &v2d,
|
|
|
|
|
const SpaceNode &snode,
|
|
|
|
|
const bNodeLink &link,
|
2018-04-05 15:41:17 +02:00
|
|
|
int th_col1,
|
|
|
|
|
int th_col2,
|
2022-02-28 15:52:00 -05:00
|
|
|
int th_col3,
|
|
|
|
|
bool selected);
|
2022-09-02 15:43:53 -05:00
|
|
|
|
|
|
|
|
void node_link_bezier_points_evaluated(const bNodeLink &link,
|
|
|
|
|
std::array<float2, NODE_LINK_RESOL + 1> &coords);
|
2022-09-02 15:25:34 -05:00
|
|
|
|
2022-09-03 14:52:27 -05:00
|
|
|
std::optional<float2> link_path_intersection(const bNodeLink &link, Span<float2> path);
|
|
|
|
|
|
2021-12-03 16:25:17 -05:00
|
|
|
void draw_nodespace_back_pix(const bContext &C,
|
|
|
|
|
ARegion ®ion,
|
|
|
|
|
SpaceNode &snode,
|
2013-04-24 16:36:50 +00:00
|
|
|
bNodeInstanceKey parent_key);
|
2012-08-01 19:11:17 +00:00
|
|
|
|
2022-02-03 15:34:01 -06:00
|
|
|
/* node_add.cc */
|
2022-01-18 13:07:18 -06:00
|
|
|
|
2022-08-01 16:32:43 -05:00
|
|
|
bNode *add_node(const bContext &C, StringRef idname, const float2 &location);
|
|
|
|
|
bNode *add_static_node(const bContext &C, int type, const float2 &location);
|
|
|
|
|
|
2021-11-18 11:46:44 -05:00
|
|
|
void NODE_OT_add_reroute(wmOperatorType *ot);
|
2022-09-19 11:57:10 -05:00
|
|
|
void NODE_OT_add_search(wmOperatorType *ot);
|
2021-11-18 11:46:44 -05:00
|
|
|
void NODE_OT_add_group(wmOperatorType *ot);
|
2022-11-01 16:09:49 +01:00
|
|
|
void NODE_OT_add_group_asset(wmOperatorType *ot);
|
2021-11-18 11:46:44 -05:00
|
|
|
void NODE_OT_add_object(wmOperatorType *ot);
|
|
|
|
|
void NODE_OT_add_collection(wmOperatorType *ot);
|
|
|
|
|
void NODE_OT_add_file(wmOperatorType *ot);
|
|
|
|
|
void NODE_OT_add_mask(wmOperatorType *ot);
|
|
|
|
|
void NODE_OT_new_node_tree(wmOperatorType *ot);
|
2012-08-01 19:11:17 +00:00
|
|
|
|
2022-02-03 15:34:01 -06:00
|
|
|
/* node_group.cc */
|
|
|
|
|
|
2021-11-18 11:46:44 -05:00
|
|
|
const char *node_group_idname(bContext *C);
|
|
|
|
|
void NODE_OT_group_make(wmOperatorType *ot);
|
|
|
|
|
void NODE_OT_group_insert(wmOperatorType *ot);
|
|
|
|
|
void NODE_OT_group_ungroup(wmOperatorType *ot);
|
|
|
|
|
void NODE_OT_group_separate(wmOperatorType *ot);
|
|
|
|
|
void NODE_OT_group_edit(wmOperatorType *ot);
|
2012-08-01 19:11:17 +00:00
|
|
|
|
2022-02-03 15:34:01 -06:00
|
|
|
/* node_relationships.cc */
|
|
|
|
|
|
2022-10-14 14:07:55 -05:00
|
|
|
void update_multi_input_indices_for_removed_links(bNode &node);
|
|
|
|
|
|
2021-11-18 11:46:44 -05:00
|
|
|
void NODE_OT_link(wmOperatorType *ot);
|
|
|
|
|
void NODE_OT_link_make(wmOperatorType *ot);
|
|
|
|
|
void NODE_OT_links_cut(wmOperatorType *ot);
|
|
|
|
|
void NODE_OT_links_detach(wmOperatorType *ot);
|
|
|
|
|
void NODE_OT_links_mute(wmOperatorType *ot);
|
2012-08-01 19:11:17 +00:00
|
|
|
|
2021-11-18 11:46:44 -05:00
|
|
|
void NODE_OT_parent_set(wmOperatorType *ot);
|
|
|
|
|
void NODE_OT_join(wmOperatorType *ot);
|
|
|
|
|
void NODE_OT_attach(wmOperatorType *ot);
|
|
|
|
|
void NODE_OT_detach(wmOperatorType *ot);
|
2012-08-01 19:11:17 +00:00
|
|
|
|
2021-11-18 11:46:44 -05:00
|
|
|
void NODE_OT_link_viewer(wmOperatorType *ot);
|
2012-08-01 19:11:17 +00:00
|
|
|
|
2021-11-18 11:46:44 -05:00
|
|
|
void NODE_OT_insert_offset(wmOperatorType *ot);
|
2015-08-01 17:39:48 +02:00
|
|
|
|
2022-02-03 15:34:01 -06:00
|
|
|
/* node_edit.cc */
|
|
|
|
|
|
|
|
|
|
float2 node_link_calculate_multi_input_position(const float2 &socket_position,
|
|
|
|
|
int index,
|
|
|
|
|
int total_inputs);
|
|
|
|
|
|
|
|
|
|
float node_socket_calculate_height(const bNodeSocket &socket);
|
|
|
|
|
|
2021-12-03 16:25:17 -05:00
|
|
|
void snode_set_context(const bContext &C);
|
2021-11-18 11:46:44 -05:00
|
|
|
|
|
|
|
|
bool composite_node_active(bContext *C);
|
2021-12-09 00:55:11 +11:00
|
|
|
/** Operator poll callback. */
|
2021-11-18 11:46:44 -05:00
|
|
|
bool composite_node_editable(bContext *C);
|
|
|
|
|
|
|
|
|
|
bool node_has_hidden_sockets(bNode *node);
|
|
|
|
|
void node_set_hidden_sockets(SpaceNode *snode, bNode *node, int set);
|
|
|
|
|
int node_render_changed_exec(bContext *, wmOperator *);
|
2021-12-09 00:55:11 +11:00
|
|
|
/** Type is #SOCK_IN and/or #SOCK_OUT. */
|
2021-12-03 16:25:17 -05:00
|
|
|
bool node_find_indicated_socket(SpaceNode &snode,
|
|
|
|
|
bNode **nodep,
|
|
|
|
|
bNodeSocket **sockp,
|
2022-01-20 10:36:56 -06:00
|
|
|
const float2 &cursor,
|
2021-12-03 16:25:17 -05:00
|
|
|
eNodeSocketInOut in_out);
|
|
|
|
|
float node_link_dim_factor(const View2D &v2d, const bNodeLink &link);
|
|
|
|
|
bool node_link_is_hidden_or_dimmed(const View2D &v2d, const bNodeLink &link);
|
2021-11-18 11:46:44 -05:00
|
|
|
|
|
|
|
|
void NODE_OT_duplicate(wmOperatorType *ot);
|
|
|
|
|
void NODE_OT_delete(wmOperatorType *ot);
|
|
|
|
|
void NODE_OT_delete_reconnect(wmOperatorType *ot);
|
|
|
|
|
void NODE_OT_resize(wmOperatorType *ot);
|
|
|
|
|
|
|
|
|
|
void NODE_OT_mute_toggle(wmOperatorType *ot);
|
|
|
|
|
void NODE_OT_hide_toggle(wmOperatorType *ot);
|
|
|
|
|
void NODE_OT_hide_socket_toggle(wmOperatorType *ot);
|
|
|
|
|
void NODE_OT_preview_toggle(wmOperatorType *ot);
|
|
|
|
|
void NODE_OT_options_toggle(wmOperatorType *ot);
|
|
|
|
|
void NODE_OT_node_copy_color(wmOperatorType *ot);
|
Geometry Nodes: viewport preview
This adds support for showing geometry passed to the Viewer in the 3d
viewport (instead of just in the spreadsheet). The "viewer geometry"
bypasses the group output. So it is not necessary to change the final
output of the node group to be able to see the intermediate geometry.
**Activation and deactivation of a viewer node**
* A viewer node is activated by clicking on it.
* Ctrl+shift+click on any node/socket connects it to the viewer and
makes it active.
* Ctrl+shift+click in empty space deactivates the active viewer.
* When the active viewer is not visible anymore (e.g. another object
is selected, or the current node group is exit), it is deactivated.
* Clicking on the icon in the header of the Viewer node toggles whether
its active or not.
**Pinning**
* The spreadsheet still allows pinning the active viewer as before.
When pinned, the spreadsheet still references the viewer node even
when it becomes inactive.
* The viewport does not support pinning at the moment. It always shows
the active viewer.
**Attribute**
* When a field is linked to the second input of the viewer node it is
displayed as an overlay in the viewport.
* When possible the correct domain for the attribute is determined
automatically. This does not work in all cases. It falls back to the
face corner domain on meshes and the point domain on curves. When
necessary, the domain can be picked manually.
* The spreadsheet now only shows the "Viewer" column for the domain
that is selected in the Viewer node.
* Instance attributes are visualized as a constant color per instance.
**Viewport Options**
* The attribute overlay opacity can be controlled with the "Viewer Node"
setting in the overlays popover.
* A viewport can be configured not to show intermediate viewer-geometry
by disabling the "Viewer Node" option in the "View" menu.
**Implementation Details**
* The "spreadsheet context path" was generalized to a "viewer path" that
is used in more places now.
* The viewer node itself determines the attribute domain, evaluates the
field and stores the result in a `.viewer` attribute.
* A new "viewer attribute' overlay displays the data from the `.viewer`
attribute.
* The ground truth for the active viewer node is stored in the workspace
now. Node editors, spreadsheets and viewports retrieve the active
viewer from there unless they are pinned.
* The depsgraph object iterator has a new "viewer path" setting. When set,
the viewed geometry of the corresponding object is part of the iterator
instead of the final evaluated geometry.
* To support the instance attribute overlay `DupliObject` was extended
to contain the information necessary for drawing the overlay.
* The ctrl+shift+click operator has been refactored so that it can make
existing links to viewers active again.
* The auto-domain-detection in the Viewer node works by checking the
"preferred domain" for every field input. If there is not exactly one
preferred domain, the fallback is used.
Known limitations:
* Loose edges of meshes don't have the attribute overlay. This could be
added separately if necessary.
* Some attributes are hard to visualize as a color directly. For example,
the values might have to be normalized or some should be drawn as arrays.
For now, we encourage users to build node groups that generate appropriate
viewer-geometry. We might include some of that functionality in future versions.
Support for displaying attribute values as text in the viewport is planned as well.
* There seems to be an issue with the attribute overlay for pointclouds on
nvidia gpus, to be investigated.
Differential Revision: https://developer.blender.org/D15954
2022-09-28 17:54:59 +02:00
|
|
|
void NODE_OT_deactivate_viewer(wmOperatorType *ot);
|
2021-11-18 11:46:44 -05:00
|
|
|
|
|
|
|
|
void NODE_OT_read_viewlayers(wmOperatorType *ot);
|
|
|
|
|
void NODE_OT_render_changed(wmOperatorType *ot);
|
|
|
|
|
|
|
|
|
|
void NODE_OT_output_file_add_socket(wmOperatorType *ot);
|
|
|
|
|
void NODE_OT_output_file_remove_active_socket(wmOperatorType *ot);
|
|
|
|
|
void NODE_OT_output_file_move_active_socket(wmOperatorType *ot);
|
|
|
|
|
|
|
|
|
|
void NODE_OT_switch_view_update(wmOperatorType *ot);
|
2015-04-06 10:40:12 -03:00
|
|
|
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* \note clipboard_cut is a simple macro of copy + delete.
|
|
|
|
|
*/
|
2021-11-18 11:46:44 -05:00
|
|
|
void NODE_OT_clipboard_copy(wmOperatorType *ot);
|
|
|
|
|
void NODE_OT_clipboard_paste(wmOperatorType *ot);
|
2012-08-02 09:52:37 +00:00
|
|
|
|
2021-11-18 11:46:44 -05:00
|
|
|
void NODE_OT_tree_socket_add(wmOperatorType *ot);
|
|
|
|
|
void NODE_OT_tree_socket_remove(wmOperatorType *ot);
|
|
|
|
|
void NODE_OT_tree_socket_change_type(wmOperatorType *ot);
|
|
|
|
|
void NODE_OT_tree_socket_move(wmOperatorType *ot);
|
2013-03-18 16:34:57 +00:00
|
|
|
|
2021-11-18 11:46:44 -05:00
|
|
|
void NODE_OT_shader_script_update(wmOperatorType *ot);
|
2012-11-03 14:32:26 +00:00
|
|
|
|
2021-11-18 11:46:44 -05:00
|
|
|
void NODE_OT_viewer_border(wmOperatorType *ot);
|
|
|
|
|
void NODE_OT_clear_viewer_border(wmOperatorType *ot);
|
2013-03-07 17:47:30 +00:00
|
|
|
|
2022-02-03 15:34:01 -06:00
|
|
|
void NODE_OT_cryptomatte_layer_add(wmOperatorType *ot);
|
|
|
|
|
void NODE_OT_cryptomatte_layer_remove(wmOperatorType *ot);
|
|
|
|
|
|
|
|
|
|
/* node_gizmo.cc */
|
|
|
|
|
|
2021-11-18 11:46:44 -05:00
|
|
|
void NODE_GGT_backdrop_transform(wmGizmoGroupType *gzgt);
|
|
|
|
|
void NODE_GGT_backdrop_crop(wmGizmoGroupType *gzgt);
|
|
|
|
|
void NODE_GGT_backdrop_sun_beams(wmGizmoGroupType *gzgt);
|
|
|
|
|
void NODE_GGT_backdrop_corner_pin(wmGizmoGroupType *gzgt);
|
2017-05-29 22:06:59 +10:00
|
|
|
|
2022-02-03 15:34:01 -06:00
|
|
|
/* node_geometry_attribute_search.cc */
|
2017-05-29 22:06:59 +10:00
|
|
|
|
2021-12-03 16:25:17 -05:00
|
|
|
void node_geometry_add_attribute_search_button(const bContext &C,
|
|
|
|
|
const bNode &node,
|
|
|
|
|
PointerRNA &socket_ptr,
|
|
|
|
|
uiLayout &layout);
|
2021-03-02 13:01:33 -06:00
|
|
|
|
2022-02-03 15:34:01 -06:00
|
|
|
/* node_context_path.c */
|
2008-12-13 18:09:49 +00:00
|
|
|
|
2021-10-26 11:05:01 -05:00
|
|
|
Vector<ui::ContextPathItem> context_path_for_space_node(const bContext &C);
|
2021-12-03 11:31:25 -05:00
|
|
|
|
2022-02-03 15:34:01 -06:00
|
|
|
/* link_drag_search.cc */
|
|
|
|
|
|
2021-12-15 09:51:57 -06:00
|
|
|
void invoke_node_link_drag_add_menu(bContext &C,
|
|
|
|
|
bNode &node,
|
|
|
|
|
bNodeSocket &socket,
|
|
|
|
|
const float2 &cursor);
|
|
|
|
|
|
2022-09-19 11:57:10 -05:00
|
|
|
/* add_node_search.cc */
|
|
|
|
|
|
|
|
|
|
void invoke_add_node_search_menu(bContext &C, const float2 &cursor, bool use_transform);
|
|
|
|
|
|
2022-11-01 16:09:49 +01:00
|
|
|
/* add_menu_assets.cc */
|
|
|
|
|
|
|
|
|
|
MenuType add_catalog_assets_menu_type();
|
|
|
|
|
MenuType add_root_catalogs_menu_type();
|
|
|
|
|
|
2021-12-15 09:51:57 -06:00
|
|
|
} // namespace blender::ed::space_node
|