Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Goudey <h.goudey@me.com>2021-12-06 00:45:41 +0300
committerHans Goudey <h.goudey@me.com>2021-12-06 00:45:41 +0300
commit338c1060d5d7b6a8bd3ec5632f543738de4c103c (patch)
treeb8ca72de9e4381dca31f681e604c2469e3a5a74e /source/blender/blenkernel/BKE_node.h
parent0578921063fbb081239439062215f2538a31af4b (diff)
Cleanup: Remove unnecessary node type callbacks for drawing
Currently there are a few callbacks on `bNodeType` that do the same thing for every node type except reroutes and frame nodes. Having a callback for basic things complicates code and makes it harder to understand, and reroutes and frames are special cases in larger way. Arguably frame nodes shouldn't even be drawn like regular nodes, given that it adds a case of O(N^2) looping through all nodes. "Unrolling" the callbacks makes it easier to see what's happening, and therefore easier to optimize. Differential Revision: https://developer.blender.org/D13463
Diffstat (limited to 'source/blender/blenkernel/BKE_node.h')
-rw-r--r--source/blender/blenkernel/BKE_node.h21
1 files changed, 0 insertions, 21 deletions
diff --git a/source/blender/blenkernel/BKE_node.h b/source/blender/blenkernel/BKE_node.h
index 85699e4c28d..0584a8c811f 100644
--- a/source/blender/blenkernel/BKE_node.h
+++ b/source/blender/blenkernel/BKE_node.h
@@ -25,7 +25,6 @@
#include "BLI_compiler_compat.h"
#include "BLI_ghash.h"
-#include "BLI_utildefines.h"
#include "DNA_listBase.h"
@@ -223,16 +222,6 @@ typedef int (*NodeGPUExecFunction)(struct GPUMaterial *mat,
struct GPUNodeStack *in,
struct GPUNodeStack *out);
-typedef 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),
-} NodeResizeDirection;
-
-ENUM_OPERATORS(NodeResizeDirection, NODE_RESIZE_LEFT);
-
/**
* \brief Defines a node type.
*
@@ -265,10 +254,6 @@ typedef struct bNodeType {
struct bNodeTree *ntree,
struct bNode *node,
bNodeInstanceKey key);
- /* Updates the node geometry attributes according to internal state before actual drawing */
- void (*draw_nodetype_prepare)(const struct bContext *C,
- struct bNodeTree *ntree,
- struct bNode *node);
/* Draw the option buttons on the node */
void (*draw_buttons)(struct uiLayout *, struct bContext *C, struct PointerRNA *ptr);
@@ -284,12 +269,6 @@ typedef struct bNodeType {
* \note Used as a fallback when #bNode.label isn't set.
*/
void (*labelfunc)(struct bNodeTree *ntree, struct bNode *node, char *label, int maxlen);
- /** Optional custom resize handle polling. */
- NodeResizeDirection (*resize_area_func)(const struct bNode *node, int x, int y);
- /** Optional selection area polling. */
- int (*select_area_func)(struct bNode *node, int x, int y);
- /** Optional tweak area polling (for grabbing). */
- int (*tweak_area_func)(struct bNode *node, int x, int y);
/** Called when the node is updated in the editor. */
void (*updatefunc)(struct bNodeTree *ntree, struct bNode *node);