diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-05-03 12:44:17 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-05-03 12:44:17 +0300 |
commit | bff15770a962ae931c1e891ed76fd195ce5b2994 (patch) | |
tree | a2e52e55dbd22f04ae8c5974f35397914bc3829f /source/blender/nodes | |
parent | 3dcc05c591ddda768d0870025be70ccd299f3df3 (diff) |
Fix T47424: Blender Internal material node 'mapping' not showing results of animation
Not very efficient solution -- it'll update mapping node on init ntree exec and will
not work for viewport GLSL shading perhaps, but it's as good as it could be within
current dependency graph.
The issue here is that manual edit of values will cause cached matrix re-evaluation.
but using animation does not use rna update callbacks hence no matrix update was
happening.
Diffstat (limited to 'source/blender/nodes')
-rw-r--r-- | source/blender/nodes/shader/nodes/node_shader_mapping.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/source/blender/nodes/shader/nodes/node_shader_mapping.c b/source/blender/nodes/shader/nodes/node_shader_mapping.c index cd398cc8264..2044f5390cc 100644 --- a/source/blender/nodes/shader/nodes/node_shader_mapping.c +++ b/source/blender/nodes/shader/nodes/node_shader_mapping.c @@ -42,6 +42,15 @@ static bNodeSocketTemplate sh_node_mapping_out[] = { { -1, 0, "" } }; +static void *node_shader_initexec_mapping(bNodeExecContext *UNUSED(context), + bNode *node, + bNodeInstanceKey UNUSED(key)) +{ + TexMapping *texmap = node->storage; + BKE_texture_mapping_init(texmap); + return NULL; +} + /* do the regular mapping options for blender textures */ static void node_shader_exec_mapping(void *UNUSED(data), int UNUSED(thread), bNode *node, bNodeExecData *UNUSED(execdata), bNodeStack **in, bNodeStack **out) { @@ -103,7 +112,7 @@ void register_node_type_sh_mapping(void) node_type_size(&ntype, 320, 160, 360); node_type_init(&ntype, node_shader_init_mapping); node_type_storage(&ntype, "TexMapping", node_free_standard_storage, node_copy_standard_storage); - node_type_exec(&ntype, NULL, NULL, node_shader_exec_mapping); + node_type_exec(&ntype, node_shader_initexec_mapping, NULL, node_shader_exec_mapping); node_type_gpu(&ntype, gpu_shader_mapping); nodeRegisterType(&ntype); |