20 .default_value({0.5f, 0.5f, 0.5f})
23 .
description(
"Vector, point, or normal which will be used for conversion between spaces");
53 return is_direction ?
"direction_transform_object_to_world" :
54 "point_transform_object_to_world";
56 return is_direction ?
"direction_transform_object_to_view" :
57 "point_transform_object_to_view";
65 return is_direction ?
"direction_transform_world_to_view" :
66 "point_transform_world_to_view";
68 return is_direction ?
"direction_transform_world_to_object" :
69 "point_transform_world_to_object";
77 return is_direction ?
"direction_transform_view_to_world" :
78 "point_transform_view_to_world";
80 return is_direction ?
"direction_transform_view_to_object" :
81 "point_transform_view_to_object";
99 inputlink =
in[0].link;
115 GPU_link(mat,
"invert_z", inputlink, &inputlink);
140 NodeItem res = empty();
142 std::string fromspace;
144 std::string category;
145 NodeItem
vector = get_input_value(
"Vector", NodeItem::Type::Vector3);
147 switch (nodeprop->convert_from) {
152 fromspace =
"object";
160 switch (nodeprop->convert_to) {
173 if (fromspace == tospace) {
177 switch (nodeprop->type) {
179 category =
"transformpoint";
182 category =
"transformnormal";
185 category =
"transformvector";
192 return create_node(category,
193 NodeItem::Type::Vector3,
194 {{
"in",
vector}, {
"fromspace", val(fromspace)}, {
"tospace", val(tospace)}});
208 ntype.
ui_name =
"Vector Transform";
210 "Convert a vector, point, or normal between world, camera, and object coordinate space";
213 ntype.
declare = file_ns::node_declare;
214 ntype.
draw_buttons = file_ns::node_shader_buts_vect_transform;
215 ntype.
initfunc = file_ns::node_shader_init_vect_transform;
218 ntype.
gpu_fn = file_ns::gpu_shader_vect_transform;
#define NODE_CLASS_OP_VECTOR
#define SH_NODE_VECT_TRANSFORM
#define BLI_assert_unreachable()
@ SHD_VECT_TRANSFORM_TYPE_VECTOR
@ SHD_VECT_TRANSFORM_TYPE_NORMAL
@ SHD_VECT_TRANSFORM_TYPE_POINT
@ SHD_VECT_TRANSFORM_SPACE_WORLD
@ SHD_VECT_TRANSFORM_SPACE_OBJECT
@ SHD_VECT_TRANSFORM_SPACE_CAMERA
bool GPU_link(GPUMaterial *mat, const char *name,...)
GPUNodeLink * GPU_uniform(const float *num)
@ UI_ITEM_R_SPLIT_EMPTY_NAME
void * MEM_callocN(size_t len, const char *str)
void node_register_type(bNodeType &ntype)
void node_type_storage(bNodeType &ntype, std::optional< StringRefNull > storagename, void(*freefunc)(bNode *node), void(*copyfunc)(bNodeTree *dest_ntree, bNode *dest_node, const bNode *src_node))
std::vector< ElementType, Eigen::aligned_allocator< ElementType > > vector
#define NODE_SHADER_MATERIALX_BEGIN
#define NODE_SHADER_MATERIALX_END
void sh_node_type_base(blender::bke::bNodeType *ntype, std::string idname, const std::optional< int16_t > legacy_type)
void node_free_standard_storage(bNode *node)
void node_copy_standard_storage(bNodeTree *, bNode *dest_node, const bNode *src_node)
NodeMaterialXFunction materialx_fn
std::string ui_description
void(* initfunc)(bNodeTree *ntree, bNode *node)
NodeGPUExecFunction gpu_fn
const char * enum_name_legacy
void(* draw_buttons)(uiLayout *, bContext *C, PointerRNA *ptr)
NodeDeclareFunction declare
void prop(PointerRNA *ptr, PropertyRNA *prop, int index, int value, eUI_Item_Flag flag, std::optional< blender::StringRef > name_opt, int icon, std::optional< blender::StringRef > placeholder=std::nullopt)