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:
Diffstat (limited to 'source/blender/editors/space_node')
-rw-r--r--source/blender/editors/space_node/node_draw.cc16
-rw-r--r--source/blender/editors/space_node/node_edit.cc6
2 files changed, 20 insertions, 2 deletions
diff --git a/source/blender/editors/space_node/node_draw.cc b/source/blender/editors/space_node/node_draw.cc
index 68cfd1c9ef0..88ab7617932 100644
--- a/source/blender/editors/space_node/node_draw.cc
+++ b/source/blender/editors/space_node/node_draw.cc
@@ -2579,8 +2579,20 @@ static void reroute_node_draw(
const int x = BLI_rctf_cent_x(&node.totr) - (width / 2);
const int y = node.totr.ymax;
- uiBut *label_but = uiDefBut(
- &block, UI_BTYPE_LABEL, 0, showname, x, y, width, (short)NODE_DY, nullptr, 0, 0, 0, 0, nullptr);
+ uiBut *label_but = uiDefBut(&block,
+ UI_BTYPE_LABEL,
+ 0,
+ showname,
+ x,
+ y,
+ width,
+ (short)NODE_DY,
+ nullptr,
+ 0,
+ 0,
+ 0,
+ 0,
+ nullptr);
UI_but_drawflag_disable(label_but, UI_BUT_TEXT_LEFT);
}
diff --git a/source/blender/editors/space_node/node_edit.cc b/source/blender/editors/space_node/node_edit.cc
index 956bb581ee6..9d83f977fe0 100644
--- a/source/blender/editors/space_node/node_edit.cc
+++ b/source/blender/editors/space_node/node_edit.cc
@@ -1268,6 +1268,7 @@ static int node_duplicate_exec(bContext *C, wmOperator *op)
SpaceNode *snode = CTX_wm_space_node(C);
bNodeTree *ntree = snode->edittree;
const bool keep_inputs = RNA_boolean_get(op->ptr, "keep_inputs");
+ bool changed = false;
ED_preview_kill_jobs(CTX_wm_manager(C), bmain);
@@ -1280,6 +1281,7 @@ static int node_duplicate_exec(bContext *C, wmOperator *op)
bNode *new_node = blender::bke::node_copy_with_mapping(
ntree, *node, LIB_ID_COPY_DEFAULT, true, socket_map);
node_map.add_new(node, new_node);
+ changed = true;
}
/* make sure we don't copy new nodes again! */
@@ -1288,6 +1290,10 @@ static int node_duplicate_exec(bContext *C, wmOperator *op)
}
}
+ if (!changed) {
+ return OPERATOR_CANCELLED;
+ }
+
/* Copy links between selected nodes. */
bNodeLink *lastlink = (bNodeLink *)ntree->links.last;
LISTBASE_FOREACH (bNodeLink *, link, &ntree->links) {