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:
authorJoshua Leung <aligorith@gmail.com>2009-11-20 07:19:57 +0300
committerJoshua Leung <aligorith@gmail.com>2009-11-20 07:19:57 +0300
commite6d382bd5353e526c21d3f3f021560fd58d07c41 (patch)
tree43d51f9c7b9df4c16b281a0a09510cbc35c4c6d1 /source/blender/blenkernel/intern/node.c
parent3d1e618864422cacfd73442f2847bbe68d96fada (diff)
Node Editor: Various usability and code tidyups
* Fixed a nasty bug which meant that it was impossible to set an active node. Was caused by ntreeCopyTree() getting called when compo updates were done and clearing the active flags. The active flag clearing is only really needed for the "internal_select" case which is only used for duplicating selected nodes (from Shift-D duplicate). * Recoded click-selection code. Was a mess of old code, bad exceptions from the old code half ported, duplicate operators, unnecessary flags/modes. * Fixed bug #19927: compositing node groups can't be access via "tab" or ungrouped via "alt+g". Was probably related to the active group not being able to be set. * Made resizing nodes work again. Again, this was due to the active node bug. * Made adding a new group with Ctrl-G correctly update the views
Diffstat (limited to 'source/blender/blenkernel/intern/node.c')
-rw-r--r--source/blender/blenkernel/intern/node.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c
index 1b0f1f28d2c..4c378d25a8c 100644
--- a/source/blender/blenkernel/intern/node.c
+++ b/source/blender/blenkernel/intern/node.c
@@ -1072,6 +1072,11 @@ bNodeTree *ntreeAddTree(int type)
return ntree;
}
+/* Warning: this function gets called during some rather unexpected times
+ * - internal_select is only 1 when used for duplicating selected nodes (i.e. Shift-D duplicate operator)
+ * - this gets called when executing compositing updates (for threaded previews)
+ * - when the nodetree datablock needs to be copied (i.e. when users get copied)
+ */
bNodeTree *ntreeCopyTree(bNodeTree *ntree, int internal_select)
{
bNodeTree *newtree;
@@ -1103,10 +1108,9 @@ bNodeTree *ntreeCopyTree(bNodeTree *ntree, int internal_select)
if(internal_select==0 || (node->flag & NODE_SELECT)) {
nnode= nodeCopyNode(newtree, node, internal_select); /* sets node->new */
if(internal_select) {
- node->flag &= ~NODE_SELECT;
+ node->flag &= ~(NODE_SELECT|NODE_ACTIVE);
nnode->flag |= NODE_SELECT;
}
- node->flag &= ~NODE_ACTIVE;
/* deselect original sockets */
for(sock= node->inputs.first; sock; sock= sock->next) {