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:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2013-09-02 20:05:51 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2013-09-02 20:05:51 +0400
commit107e6afd217af53508e3564c5a85add52e978227 (patch)
tree8ccf459776f71a7531ed45aee4e6fda93171ff58
parentdace5b9b8444f8fbc26891d36df09c30a86509dd (diff)
Related to #36632: cycles textured draw mode now shows the image from an image
texture node even if it's not active, in case there is no active texture node.
-rw-r--r--source/blender/nodes/shader/node_shader_util.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/source/blender/nodes/shader/node_shader_util.c b/source/blender/nodes/shader/node_shader_util.c
index f6ecb3e0b72..aed8a0224f1 100644
--- a/source/blender/nodes/shader/node_shader_util.c
+++ b/source/blender/nodes/shader/node_shader_util.c
@@ -195,25 +195,28 @@ static void data_from_gpu_stack_list(ListBase *sockets, bNodeStack **ns, GPUNode
bNode *nodeGetActiveTexture(bNodeTree *ntree)
{
/* this is the node we texture paint and draw in textured draw */
- bNode *node, *tnode;
+ bNode *node, *tnode, *inactivenode = NULL;
if (!ntree)
return NULL;
- for (node = ntree->nodes.first; node; node = node->next)
+ for (node = ntree->nodes.first; node; node = node->next) {
if (node->flag & NODE_ACTIVE_TEXTURE)
return node;
+ else if (!inactivenode && node->typeinfo->nclass == NODE_CLASS_TEXTURE)
+ inactivenode = node;
+ }
/* node active texture node in this tree, look inside groups */
for (node = ntree->nodes.first; node; node = node->next) {
if (node->type == NODE_GROUP) {
tnode = nodeGetActiveTexture((bNodeTree *)node->id);
- if (tnode)
+ if (tnode && ((tnode->flag & NODE_ACTIVE_TEXTURE) || !inactivenode))
return tnode;
}
}
- return NULL;
+ return inactivenode;
}
void ntreeExecGPUNodes(bNodeTreeExec *exec, GPUMaterial *mat, int do_outputs)