Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/shader/nodes/node_shader_tex_pointdensity.cc
| Show All 17 Lines | |||||
| */ | */ | ||||
| #include "node_shader_util.hh" | #include "node_shader_util.hh" | ||||
| #include "RE_texture.h" | #include "RE_texture.h" | ||||
| /* **************** OUTPUT ******************** */ | /* **************** OUTPUT ******************** */ | ||||
| namespace blender::nodes::node_shader_tex_pointdensity_cc { | |||||
| static bNodeSocketTemplate sh_node_tex_pointdensity_in[] = { | static bNodeSocketTemplate sh_node_tex_pointdensity_in[] = { | ||||
| {SOCK_VECTOR, N_("Vector"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_NONE, SOCK_HIDE_VALUE}, | {SOCK_VECTOR, N_("Vector"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_NONE, SOCK_HIDE_VALUE}, | ||||
| {-1, ""}, | {-1, ""}, | ||||
| }; | }; | ||||
| static bNodeSocketTemplate sh_node_tex_pointdensity_out[] = { | static bNodeSocketTemplate sh_node_tex_pointdensity_out[] = { | ||||
| {SOCK_RGBA, N_("Color"), 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f}, | {SOCK_RGBA, N_("Color"), 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f}, | ||||
| {SOCK_FLOAT, N_("Density"), 0.0f, 0.0f, 0.0f, 0.0f, -10000.0f, 10000.0f}, | {SOCK_FLOAT, N_("Density"), 0.0f, 0.0f, 0.0f, 0.0f, -10000.0f, 10000.0f}, | ||||
| Show All 26 Lines | static void node_shader_copy_tex_pointdensity(bNodeTree *UNUSED(dest_ntree), | ||||
| const bNode *src_node) | const bNode *src_node) | ||||
| { | { | ||||
| dest_node->storage = MEM_dupallocN(src_node->storage); | dest_node->storage = MEM_dupallocN(src_node->storage); | ||||
| NodeShaderTexPointDensity *point_density = (NodeShaderTexPointDensity *)dest_node->storage; | NodeShaderTexPointDensity *point_density = (NodeShaderTexPointDensity *)dest_node->storage; | ||||
| PointDensity *pd = &point_density->pd; | PointDensity *pd = &point_density->pd; | ||||
| memset(pd, 0, sizeof(*pd)); | memset(pd, 0, sizeof(*pd)); | ||||
| } | } | ||||
| } // namespace blender::nodes::node_shader_tex_pointdensity_cc | |||||
| /* node type definition */ | /* node type definition */ | ||||
| void register_node_type_sh_tex_pointdensity(void) | void register_node_type_sh_tex_pointdensity(void) | ||||
| { | { | ||||
| namespace file_ns = blender::nodes::node_shader_tex_pointdensity_cc; | |||||
| static bNodeType ntype; | static bNodeType ntype; | ||||
| sh_node_type_base(&ntype, SH_NODE_TEX_POINTDENSITY, "Point Density", NODE_CLASS_TEXTURE, 0); | sh_node_type_base(&ntype, SH_NODE_TEX_POINTDENSITY, "Point Density", NODE_CLASS_TEXTURE, 0); | ||||
| node_type_socket_templates(&ntype, sh_node_tex_pointdensity_in, sh_node_tex_pointdensity_out); | node_type_socket_templates( | ||||
| node_type_init(&ntype, node_shader_init_tex_pointdensity); | &ntype, file_ns::sh_node_tex_pointdensity_in, file_ns::sh_node_tex_pointdensity_out); | ||||
| node_type_init(&ntype, file_ns::node_shader_init_tex_pointdensity); | |||||
| node_type_storage(&ntype, | node_type_storage(&ntype, | ||||
| "NodeShaderTexPointDensity", | "NodeShaderTexPointDensity", | ||||
| node_shader_free_tex_pointdensity, | file_ns::node_shader_free_tex_pointdensity, | ||||
| node_shader_copy_tex_pointdensity); | file_ns::node_shader_copy_tex_pointdensity); | ||||
| nodeRegisterType(&ntype); | nodeRegisterType(&ntype); | ||||
| } | } | ||||