fix/workaround for glitch with node editing active texture bug - where a node texture in a group could get stuck and the buttons UI wouldnt update to other active nodes.

Files saved with this error will still give problems, toggling group edit will fix.
This commit is contained in:
2012-07-24 12:35:41 +00:00
parent dee1d86e65
commit c67e910df6
2 changed files with 20 additions and 2 deletions

View File

@@ -796,8 +796,15 @@ void snode_make_group_editable(SpaceNode *snode, bNode *gnode)
bNode *node;
/* make sure nothing has group editing on */
for (node = snode->nodetree->nodes.first; node; node = node->next)
for (node = snode->nodetree->nodes.first; node; node = node->next) {
nodeGroupEditClear(node);
/* while we're here, clear texture active */
if (node->typeinfo->nclass == NODE_CLASS_TEXTURE) {
/* this is not 100% sure to be reliable, see comment on the flag */
node->flag &= ~NODE_ACTIVE_TEXTURE;
}
}
if (gnode == NULL) {
/* with NULL argument we do a toggle */
@@ -809,8 +816,14 @@ void snode_make_group_editable(SpaceNode *snode, bNode *gnode)
snode->edittree = nodeGroupEditSet(gnode, 1);
/* deselect all other nodes, so we can also do grabbing of entire subtree */
for (node = snode->nodetree->nodes.first; node; node = node->next)
for (node = snode->nodetree->nodes.first; node; node = node->next) {
node_deselect(node);
if (node->typeinfo->nclass == NODE_CLASS_TEXTURE) {
/* this is not 100% sure to be reliable, see comment on the flag */
node->flag &= ~NODE_ACTIVE_TEXTURE;
}
}
node_select(gnode);
}
else

View File

@@ -211,6 +211,11 @@ typedef struct bNode {
/* automatic flag for nodes included in transforms */
#define NODE_TRANSFORM (1<<13)
/* node is active texture */
/* note: take care with this flag since its possible it gets
* `stuck` inside/outside the active group - which makes buttons
* window texture not update, we try to avoid it by clearing the
* flag when toggling group editing - Campbell */
#define NODE_ACTIVE_TEXTURE (1<<14)
/* use a custom color for the node */
#define NODE_CUSTOM_COLOR (1<<15)