Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/shader/nodes/node_shader_vector_rotate.cc
| Show All 11 Lines | |||||
| namespace blender::nodes::node_shader_vector_rotate_cc { | namespace blender::nodes::node_shader_vector_rotate_cc { | ||||
| static void sh_node_vector_rotate_declare(NodeDeclarationBuilder &b) | static void sh_node_vector_rotate_declare(NodeDeclarationBuilder &b) | ||||
| { | { | ||||
| b.is_function_node(); | b.is_function_node(); | ||||
| b.add_input<decl::Vector>(N_("Vector")).min(0.0f).max(1.0f).hide_value(); | b.add_input<decl::Vector>(N_("Vector")).min(0.0f).max(1.0f).hide_value(); | ||||
| b.add_input<decl::Vector>(N_("Center")); | b.add_input<decl::Vector>(N_("Center")); | ||||
| b.add_input<decl::Vector>(N_("Axis")).min(-1.0f).max(1.0f).default_value({0.0f, 0.0f, 1.0f}); | b.add_input<decl::Vector>(N_("Axis")) | ||||
| .min(-1.0f) | |||||
| .max(1.0f) | |||||
| .default_value({0.0f, 0.0f, 1.0f}) | |||||
| .make_available([](bNode &node) { node.custom1 = NODE_VECTOR_ROTATE_TYPE_AXIS; }); | |||||
| b.add_input<decl::Float>(N_("Angle")).subtype(PROP_ANGLE); | b.add_input<decl::Float>(N_("Angle")).subtype(PROP_ANGLE); | ||||
| b.add_input<decl::Vector>(N_("Rotation")).subtype(PROP_EULER); | b.add_input<decl::Vector>(N_("Rotation")).subtype(PROP_EULER).make_available([](bNode &node) { | ||||
| node.custom1 = NODE_VECTOR_ROTATE_TYPE_EULER_XYZ; | |||||
| }); | |||||
| b.add_output<decl::Vector>(N_("Vector")); | b.add_output<decl::Vector>(N_("Vector")); | ||||
| } | } | ||||
| static void node_shader_buts_vector_rotate(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) | static void node_shader_buts_vector_rotate(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) | ||||
| { | { | ||||
| uiItemR(layout, ptr, "rotation_type", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE); | uiItemR(layout, ptr, "rotation_type", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE); | ||||
| uiItemR(layout, ptr, "invert", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, 0); | uiItemR(layout, ptr, "invert", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, 0); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 185 Lines • Show Last 20 Lines | |||||