diff options
author | Jacques Lucke <jacques@blender.org> | 2020-04-20 16:17:36 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2020-04-20 16:17:36 +0300 |
commit | b78f2675d7e573685f6c78e42ca4462d90238e37 (patch) | |
tree | 92595ce1a5943c8881a805948e2074ba6dcf4a90 /source/blender/nodes/shader/node_shader_util.c | |
parent | 9f7bea6e83966dbe4e8393bd6ec811f9c54da178 (diff) |
Simulations: Use some shader nodes in simulation node trees
Reviewers: brecht
Differential Revision: https://developer.blender.org/D7422
Diffstat (limited to 'source/blender/nodes/shader/node_shader_util.c')
-rw-r--r-- | source/blender/nodes/shader/node_shader_util.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/nodes/shader/node_shader_util.c b/source/blender/nodes/shader/node_shader_util.c index 93d03720058..4464a61c48c 100644 --- a/source/blender/nodes/shader/node_shader_util.c +++ b/source/blender/nodes/shader/node_shader_util.c @@ -32,6 +32,11 @@ bool sh_node_poll_default(bNodeType *UNUSED(ntype), bNodeTree *ntree) return STREQ(ntree->idname, "ShaderNodeTree"); } +static bool sh_fn_poll_default(bNodeType *UNUSED(ntype), bNodeTree *ntree) +{ + return STREQ(ntree->idname, "ShaderNodeTree") || STREQ(ntree->idname, "SimulationNodeTree"); +} + void sh_node_type_base( struct bNodeType *ntype, int type, const char *name, short nclass, short flag) { @@ -42,6 +47,12 @@ void sh_node_type_base( ntype->update_internal_links = node_update_internal_links_default; } +void sh_fn_node_type_base(bNodeType *ntype, int type, const char *name, short nclass, short flag) +{ + sh_node_type_base(ntype, type, name, nclass, flag); + ntype->poll = sh_fn_poll_default; +} + /* ****** */ void nodestack_get_vec(float *in, short type_in, bNodeStack *ns) |