diff options
author | Philipp Oeser <info@graphics-engineer.com> | 2021-02-03 16:39:24 +0300 |
---|---|---|
committer | Philipp Oeser <info@graphics-engineer.com> | 2021-03-02 14:08:44 +0300 |
commit | b279fef85d1a561ceb71e2cdce458bd44b4d853a (patch) | |
tree | c62de6e0a676b2413a38b31d4f3c05f900c8a245 /source/blender/blenkernel | |
parent | 00f27a85689ba52d77924a7f7741f724caf831de (diff) |
Geometry Nodes: show "Show Texture in texture tab" button
This enables the quick access button [to show the relevant Texture in
the Properties Editor] for textures used in geometry nodes.
This goes in line to what we do for other textures:
- modifier textures have this button
- particle textures have this button
- brush textures will soon have it, too (see D9813)
When outside of the Properties Editor, the button will always show (if a
texture is actually assigned), but will be inactive if no suiting
Properties Editor to show the texture in can be found.
Note this also changes the behavior to not show the button if _no_
texture is assigned (as in: we are still showing the "New" button).
Previously it was always there (e.g. for modifier textures), even if it
would take us to an empty texture tab. (Sure, we could add a texture
there then, but imho it makes more sense to just start showing it once a
texture is already there)
For this to work with geometry nodes, the following chages were done:
- implement foreachTexLink for geonode modifiers
- new buttons_texture_user_node_property_add() that stores prop as well
as node
- also use NODE_ACTIVE_TEXTURE flag in geometry nodetrees
notes:
- this still uses the first suiting (as in: pinning does not interfere)
Properties Editor it finds, this should (maybe?) find the _closest_
Property Editor instead (see related feedback in D9813).
- this will already show the button for brush textures as well
(disabled), but there is another mandatory change in an upcomming commit
to make it work there as well (see D9813)
ref. T85278
Maniphest Tasks: T85278
Differential Revision: https://developer.blender.org/D10293
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/node.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/node.cc b/source/blender/blenkernel/intern/node.cc index 4d52a14b742..55cb0d5cce4 100644 --- a/source/blender/blenkernel/intern/node.cc +++ b/source/blender/blenkernel/intern/node.cc @@ -3555,7 +3555,8 @@ void nodeSetActive(bNodeTree *ntree, bNode *node) tnode->flag &= ~NODE_ACTIVE_ID; } } - if (node->typeinfo->nclass == NODE_CLASS_TEXTURE) { + if ((node->typeinfo->nclass == NODE_CLASS_TEXTURE) || + (node->typeinfo->type == GEO_NODE_ATTRIBUTE_SAMPLE_TEXTURE)) { tnode->flag &= ~NODE_ACTIVE_TEXTURE; } } @@ -3564,7 +3565,8 @@ void nodeSetActive(bNodeTree *ntree, bNode *node) if (node->id) { node->flag |= NODE_ACTIVE_ID; } - if (node->typeinfo->nclass == NODE_CLASS_TEXTURE) { + if ((node->typeinfo->nclass == NODE_CLASS_TEXTURE) || + (node->typeinfo->type == GEO_NODE_ATTRIBUTE_SAMPLE_TEXTURE)) { node->flag |= NODE_ACTIVE_TEXTURE; } } |