Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/shader/node_shader_util.c
| Show All 26 Lines | |||||
| #include "node_exec.h" | #include "node_exec.h" | ||||
| bool sh_node_poll_default(bNodeType *UNUSED(ntype), bNodeTree *ntree) | bool sh_node_poll_default(bNodeType *UNUSED(ntype), bNodeTree *ntree) | ||||
| { | { | ||||
| return STREQ(ntree->idname, "ShaderNodeTree"); | 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( | void sh_node_type_base( | ||||
| struct bNodeType *ntype, int type, const char *name, short nclass, short flag) | struct bNodeType *ntype, int type, const char *name, short nclass, short flag) | ||||
| { | { | ||||
| node_type_base(ntype, type, name, nclass, flag); | node_type_base(ntype, type, name, nclass, flag); | ||||
| ntype->poll = sh_node_poll_default; | ntype->poll = sh_node_poll_default; | ||||
| ntype->insert_link = node_insert_link_default; | ntype->insert_link = node_insert_link_default; | ||||
| ntype->update_internal_links = node_update_internal_links_default; | 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) | void nodestack_get_vec(float *in, short type_in, bNodeStack *ns) | ||||
| { | { | ||||
| const float *from = ns->vec; | const float *from = ns->vec; | ||||
| if (type_in == SOCK_FLOAT) { | if (type_in == SOCK_FLOAT) { | ||||
| if (ns->sockettype == SOCK_FLOAT) { | if (ns->sockettype == SOCK_FLOAT) { | ||||
| ▲ Show 20 Lines • Show All 261 Lines • Show Last 20 Lines | |||||