diff options
author | Lukas Toenne <lukas.toenne@googlemail.com> | 2013-05-29 19:14:11 +0400 |
---|---|---|
committer | Lukas Toenne <lukas.toenne@googlemail.com> | 2013-05-29 19:14:11 +0400 |
commit | ff42bfe242ca79d90d30742e07e2e2dc71447930 (patch) | |
tree | c4cdc377f3ed34ae29280cbb50497f6d2ff4dbfa /source/blender/editors/space_node | |
parent | e04965ee1c47abf497df836a20da729e863d6849 (diff) |
Remove the NODE_OPTIONS flag usage from node->typeinfo. This is a redundant flag which can be replaced by simply checking for nodetype->uifunc/uifuncbut callbacks (if these callbacks are defined the node
type generally supports options). Note that the node->flag still uses NODE_OPTIONS as a switch to toggle the display of such options!
Diffstat (limited to 'source/blender/editors/space_node')
-rw-r--r-- | source/blender/editors/space_node/node_draw.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_node/node_edit.c | 4 | ||||
-rw-r--r-- | source/blender/editors/space_node/node_templates.c | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/editors/space_node/node_draw.c b/source/blender/editors/space_node/node_draw.c index 2a3545847f2..0ed803a7521 100644 --- a/source/blender/editors/space_node/node_draw.c +++ b/source/blender/editors/space_node/node_draw.c @@ -402,7 +402,7 @@ static void node_update_basis(const bContext *C, bNodeTree *ntree, bNode *node) } /* buttons rect? */ - if ((node->flag & NODE_OPTIONS) && node->typeinfo->uifunc) { + if (node->typeinfo->uifunc && (node->flag & NODE_OPTIONS)) { dy -= NODE_DYS / 2; /* set this for uifunc() that don't use layout engine yet */ diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c index 6c7ccf6264b..aae7d632497 100644 --- a/source/blender/editors/space_node/node_edit.c +++ b/source/blender/editors/space_node/node_edit.c @@ -1411,7 +1411,7 @@ static void node_flag_toggle_exec(SpaceNode *snode, int toggle_flag) if (toggle_flag == NODE_PREVIEW && (node->typeinfo->flag & NODE_PREVIEW) == 0) continue; - if (toggle_flag == NODE_OPTIONS && (node->typeinfo->flag & NODE_OPTIONS) == 0) + if (toggle_flag == NODE_OPTIONS && !(node->typeinfo->uifunc || node->typeinfo->uifuncbut)) continue; if (node->flag & toggle_flag) @@ -1425,7 +1425,7 @@ static void node_flag_toggle_exec(SpaceNode *snode, int toggle_flag) if (toggle_flag == NODE_PREVIEW && (node->typeinfo->flag & NODE_PREVIEW) == 0) continue; - if (toggle_flag == NODE_OPTIONS && (node->typeinfo->flag & NODE_OPTIONS) == 0) + if (toggle_flag == NODE_OPTIONS && !(node->typeinfo->uifunc || node->typeinfo->uifuncbut)) continue; if ((tot_eq && tot_neq) || tot_eq == 0) diff --git a/source/blender/editors/space_node/node_templates.c b/source/blender/editors/space_node/node_templates.c index eaafb2b05d2..b74d1bf2ef8 100644 --- a/source/blender/editors/space_node/node_templates.c +++ b/source/blender/editors/space_node/node_templates.c @@ -207,7 +207,7 @@ static void node_socket_add_replace(const bContext *C, bNodeTree *ntree, bNode * break; if (node_from) - if (!(node_from->inputs.first == NULL && !(node_from->typeinfo->flag & NODE_OPTIONS))) + if (node_from->inputs.first || node_from->typeinfo->uifunc || node_from->typeinfo->uifuncbut) node_from = NULL; if (node_prev && node_prev->type == type && node_link_item_compare(node_prev, item)) { |