diff options
author | Hans Goudey <h.goudey@me.com> | 2021-12-15 23:27:38 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2021-12-15 23:27:38 +0300 |
commit | 43875e8dd1d76ee783b0d44e5199acfc650a07fb (patch) | |
tree | b937ca05242ba30d4575ddf72997c43e89523aad /source/blender/editors/space_node/space_node.cc | |
parent | b32f5a922f05989ff129c3d266ebbed14b751e2a (diff) |
Cleanup: Remove no-op node preview function calls
This patch removes no-op node editor preview code (`PR_NODE_RENDER`)
and most calls to `BKE_node_preview_init_tree`. The only remaining call is
in the compositor.
- Shader nodes previews don't seem to do anything.
- In-node previews for the texture node system doesn't work either.
This is a first step to refactoring to remove `preview_xsize`,
`preview_ysize`, and `prvr` from nodes in DNA, aligned with
the general goal of removing runtime/derived data from data
structs.
Differential Revision: https://developer.blender.org/D13578
Diffstat (limited to 'source/blender/editors/space_node/space_node.cc')
-rw-r--r-- | source/blender/editors/space_node/space_node.cc | 28 |
1 files changed, 1 insertions, 27 deletions
diff --git a/source/blender/editors/space_node/space_node.cc b/source/blender/editors/space_node/space_node.cc index f3b95ca2024..4cc0bed1928 100644 --- a/source/blender/editors/space_node/space_node.cc +++ b/source/blender/editors/space_node/space_node.cc @@ -482,27 +482,7 @@ static void node_area_refresh(const struct bContext *C, ScrArea *area) snode_set_context(*C); if (snode->nodetree) { - if (snode->nodetree->type == NTREE_SHADER) { - if (GS(snode->id->name) == ID_MA) { - Material *ma = (Material *)snode->id; - if (ma->use_nodes) { - ED_preview_shader_job(C, area, snode->id, nullptr, nullptr, 100, 100, PR_NODE_RENDER); - } - } - else if (GS(snode->id->name) == ID_LA) { - Light *la = (Light *)snode->id; - if (la->use_nodes) { - ED_preview_shader_job(C, area, snode->id, nullptr, nullptr, 100, 100, PR_NODE_RENDER); - } - } - else if (GS(snode->id->name) == ID_WO) { - World *wo = (World *)snode->id; - if (wo->use_nodes) { - ED_preview_shader_job(C, area, snode->id, nullptr, nullptr, 100, 100, PR_NODE_RENDER); - } - } - } - else if (snode->nodetree->type == NTREE_COMPOSIT) { + if (snode->nodetree->type == NTREE_COMPOSIT) { Scene *scene = (Scene *)snode->id; if (scene->use_nodes) { /* recalc is set on 3d view changes for auto compo */ @@ -515,12 +495,6 @@ static void node_area_refresh(const struct bContext *C, ScrArea *area) } } } - else if (snode->nodetree->type == NTREE_TEXTURE) { - Tex *tex = (Tex *)snode->id; - if (tex->use_nodes) { - ED_preview_shader_job(C, area, snode->id, nullptr, nullptr, 100, 100, PR_NODE_RENDER); - } - } } } |