From 34e4bedcd8a79ddff1a9e7d77ea3f5a99071b61f Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Thu, 24 Aug 2023 15:28:07 +0200 Subject: [PATCH] Nodes: Move rotation socket out of experimental See #92967. Pull Request: https://projects.blender.org/blender/blender/pulls/111448 --- scripts/startup/bl_ui/space_userpref.py | 1 - source/blender/editors/space_node/node_edit.cc | 4 ---- .../space_node/node_geometry_attribute_search.cc | 4 ---- source/blender/makesdna/DNA_userdef_types.h | 3 ++- .../makesrna/intern/rna_node_tree_interface.cc | 4 ---- source/blender/makesrna/intern/rna_nodetree.cc | 8 +------- source/blender/makesrna/intern/rna_userdef.cc | 3 --- .../nodes/geometry/nodes/node_geo_tool_3d_cursor.cc | 11 +---------- 8 files changed, 4 insertions(+), 34 deletions(-) diff --git a/scripts/startup/bl_ui/space_userpref.py b/scripts/startup/bl_ui/space_userpref.py index 61da9625514..d8c6e8a6d6f 100644 --- a/scripts/startup/bl_ui/space_userpref.py +++ b/scripts/startup/bl_ui/space_userpref.py @@ -2464,7 +2464,6 @@ class USERPREF_PT_experimental_new_features(ExperimentalPanel, Panel): ("blender/blender/projects/10", "Pipeline, Assets & IO Project Page")), ({"property": "use_override_templates"}, ("blender/blender/issues/73318", "Milestone 4")), ({"property": "use_new_volume_nodes"}, ("blender/blender/issues/103248", "#103248")), - ({"property": "use_rotation_socket"}, ("/blender/blender/issues/92967", "#92967")), ({"property": "use_node_group_operators"}, ("/blender/blender/issues/101778", "#101778")), ({"property": "use_shader_node_previews"}, ("blender/blender/issues/110353", "#110353")), ), diff --git a/source/blender/editors/space_node/node_edit.cc b/source/blender/editors/space_node/node_edit.cc index cfaa85a9331..456b40e31ee 100644 --- a/source/blender/editors/space_node/node_edit.cc +++ b/source/blender/editors/space_node/node_edit.cc @@ -2400,10 +2400,6 @@ static bool socket_change_poll_type(void *userdata, bNodeSocketType *socket_type return false; } - if (!U.experimental.use_rotation_socket && socket_type->type == SOCK_ROTATION) { - return false; - } - return true; } diff --git a/source/blender/editors/space_node/node_geometry_attribute_search.cc b/source/blender/editors/space_node/node_geometry_attribute_search.cc index 6e10027e25f..fa05447d6d7 100644 --- a/source/blender/editors/space_node/node_geometry_attribute_search.cc +++ b/source/blender/editors/space_node/node_geometry_attribute_search.cc @@ -143,10 +143,6 @@ static void attribute_search_update_fn( */ static eCustomDataType data_type_in_attribute_input_node(const eCustomDataType type) { - if (!U.experimental.use_rotation_socket && type == CD_PROP_QUATERNION) { - /* Invalid type, no implicit conversions available. */ - return CD_PROP_BOOL; - } switch (type) { case CD_PROP_FLOAT: case CD_PROP_INT32: diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index 3842925b8f2..aff92efa3f4 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -714,10 +714,11 @@ typedef struct UserDef_Experimental { char use_grease_pencil_version3; char enable_overlay_next; char use_new_volume_nodes; - char use_rotation_socket; char use_node_group_operators; char use_shader_node_previews; char use_extension_repos; + + char _pad[1]; /** `makesdna` does not allow empty structs. */ } UserDef_Experimental; diff --git a/source/blender/makesrna/intern/rna_node_tree_interface.cc b/source/blender/makesrna/intern/rna_node_tree_interface.cc index 93405dcb3fe..b08dc80861c 100644 --- a/source/blender/makesrna/intern/rna_node_tree_interface.cc +++ b/source/blender/makesrna/intern/rna_node_tree_interface.cc @@ -339,10 +339,6 @@ static bool is_socket_type_supported(bNodeTreeType *ntreetype, bNodeSocketType * return false; } - if (!U.experimental.use_rotation_socket && socket_type->type == SOCK_ROTATION) { - return false; - } - return true; } diff --git a/source/blender/makesrna/intern/rna_nodetree.cc b/source/blender/makesrna/intern/rna_nodetree.cc index 1af4d4d7958..b584cc80b65 100644 --- a/source/blender/makesrna/intern/rna_nodetree.cc +++ b/source/blender/makesrna/intern/rna_nodetree.cc @@ -1931,9 +1931,6 @@ static const EnumPropertyItem *itemf_function_check( static bool switch_type_supported(const EnumPropertyItem *item) { - if (!U.experimental.use_rotation_socket && item->value == SOCK_ROTATION) { - return false; - } return ELEM(item->value, SOCK_FLOAT, SOCK_INT, @@ -2063,9 +2060,6 @@ static const EnumPropertyItem *rna_GeoNodeAccumulateField_type_itemf(bContext * static bool generic_attribute_type_supported(const EnumPropertyItem *item) { - if (!U.experimental.use_rotation_socket && item->value == CD_PROP_QUATERNION) { - return false; - } return ELEM(item->value, CD_PROP_FLOAT, CD_PROP_FLOAT2, @@ -2958,7 +2952,7 @@ static const EnumPropertyItem *rna_ShaderNodeMix_data_type_itemf(bContext * /*C* const auto rotation_supported_mix = [&](const EnumPropertyItem *item) -> bool { const eNodeSocketDatatype data_type = eNodeSocketDatatype(item->value); - if (U.experimental.use_rotation_socket && data_type == SOCK_ROTATION) { + if (data_type == SOCK_ROTATION) { const bNodeTree *tree = reinterpret_cast(ptr->owner_id); if (tree->type == NTREE_GEOMETRY) { return true; diff --git a/source/blender/makesrna/intern/rna_userdef.cc b/source/blender/makesrna/intern/rna_userdef.cc index b6b0d4285e7..50a2e75a6b0 100644 --- a/source/blender/makesrna/intern/rna_userdef.cc +++ b/source/blender/makesrna/intern/rna_userdef.cc @@ -6983,9 +6983,6 @@ static void rna_def_userdef_experimental(BlenderRNA *brna) RNA_def_property_ui_text( prop, "New Volume Nodes", "Enables visibility of the new Volume nodes in the UI"); - prop = RNA_def_property(srna, "use_rotation_socket", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_ui_text(prop, "Rotation Socket", "Enable the new rotation node socket type"); - prop = RNA_def_property(srna, "use_node_group_operators", PROP_BOOLEAN, PROP_NONE); RNA_def_property_ui_text( prop, "Node Group Operators", "Enable using geometry nodes as edit operators"); diff --git a/source/blender/nodes/geometry/nodes/node_geo_tool_3d_cursor.cc b/source/blender/nodes/geometry/nodes/node_geo_tool_3d_cursor.cc index 556374f5b07..5757966cd03 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_tool_3d_cursor.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_tool_3d_cursor.cc @@ -21,12 +21,6 @@ static void node_declare(NodeDeclarationBuilder &b) "The rotation of the scene's 3D cursor, in the local space of the modified object"); } -static void node_update(bNodeTree *tree, bNode *node) -{ - bNodeSocket *rotation_socket = static_cast(node->outputs.last); - bke::nodeSetSocketAvailability(tree, rotation_socket, U.experimental.use_rotation_socket); -} - static void node_geo_exec(GeoNodeExecParams params) { if (!check_tool_context_and_error(params)) { @@ -37,9 +31,7 @@ static void node_geo_exec(GeoNodeExecParams params) const float3 location_global(cursor.location); const math::Quaternion rotation_global(float4(cursor.rotation_quaternion)); params.set_output("Location", math::transform_point(world_to_object, location_global)); - if (U.experimental.use_rotation_socket) { - params.set_output("Rotation", math::to_quaternion(world_to_object) * rotation_global); - } + params.set_output("Rotation", math::to_quaternion(world_to_object) * rotation_global); } static void node_register() @@ -48,7 +40,6 @@ static void node_register() geo_node_type_base(&ntype, GEO_NODE_TOOL_3D_CURSOR, "3D Cursor", NODE_CLASS_INPUT); ntype.declare = node_declare; ntype.geometry_node_execute = node_geo_exec; - ntype.updatefunc = node_update; ntype.gather_add_node_search_ops = search_link_ops_for_for_tool_node; ntype.gather_link_search_ops = search_link_ops_for_tool_node; nodeRegisterType(&ntype);