Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/shader/nodes/node_shader_uvmap.cc
| Show All 17 Lines | |||||
| */ | */ | ||||
| #include "node_shader_util.hh" | #include "node_shader_util.hh" | ||||
| #include "DNA_customdata_types.h" | #include "DNA_customdata_types.h" | ||||
| /* **************** OUTPUT ******************** */ | /* **************** OUTPUT ******************** */ | ||||
| namespace blender::nodes::node_shader_uvmap_cc { | |||||
| static bNodeSocketTemplate sh_node_uvmap_out[] = { | static bNodeSocketTemplate sh_node_uvmap_out[] = { | ||||
| {SOCK_VECTOR, N_("UV"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, | {SOCK_VECTOR, N_("UV"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, | ||||
| {-1, ""}, | {-1, ""}, | ||||
| }; | }; | ||||
| static void node_shader_init_uvmap(bNodeTree *UNUSED(ntree), bNode *node) | static void node_shader_init_uvmap(bNodeTree *UNUSED(ntree), bNode *node) | ||||
| { | { | ||||
| NodeShaderUVMap *attr = (NodeShaderUVMap *)MEM_callocN(sizeof(NodeShaderUVMap), | NodeShaderUVMap *attr = (NodeShaderUVMap *)MEM_callocN(sizeof(NodeShaderUVMap), | ||||
| Show All 12 Lines | static int node_shader_gpu_uvmap(GPUMaterial *mat, | ||||
| GPU_stack_link(mat, node, "node_uvmap", in, out, mtface); | GPU_stack_link(mat, node, "node_uvmap", in, out, mtface); | ||||
| node_shader_gpu_bump_tex_coord(mat, node, &out[0].link); | node_shader_gpu_bump_tex_coord(mat, node, &out[0].link); | ||||
| return 1; | return 1; | ||||
| } | } | ||||
| } // namespace blender::nodes::node_shader_uvmap_cc | |||||
| /* node type definition */ | /* node type definition */ | ||||
| void register_node_type_sh_uvmap(void) | void register_node_type_sh_uvmap(void) | ||||
| { | { | ||||
| namespace file_ns = blender::nodes::node_shader_uvmap_cc; | |||||
| static bNodeType ntype; | static bNodeType ntype; | ||||
| sh_node_type_base(&ntype, SH_NODE_UVMAP, "UV Map", NODE_CLASS_INPUT, 0); | sh_node_type_base(&ntype, SH_NODE_UVMAP, "UV Map", NODE_CLASS_INPUT, 0); | ||||
| node_type_socket_templates(&ntype, nullptr, sh_node_uvmap_out); | node_type_socket_templates(&ntype, nullptr, file_ns::sh_node_uvmap_out); | ||||
| node_type_size_preset(&ntype, NODE_SIZE_MIDDLE); | node_type_size_preset(&ntype, NODE_SIZE_MIDDLE); | ||||
| node_type_init(&ntype, node_shader_init_uvmap); | node_type_init(&ntype, file_ns::node_shader_init_uvmap); | ||||
| node_type_storage( | node_type_storage( | ||||
| &ntype, "NodeShaderUVMap", node_free_standard_storage, node_copy_standard_storage); | &ntype, "NodeShaderUVMap", node_free_standard_storage, node_copy_standard_storage); | ||||
| node_type_gpu(&ntype, node_shader_gpu_uvmap); | node_type_gpu(&ntype, file_ns::node_shader_gpu_uvmap); | ||||
| nodeRegisterType(&ntype); | nodeRegisterType(&ntype); | ||||
| } | } | ||||