Nodes: Move rotation socket out of experimental

See #92967.

Pull Request: https://projects.blender.org/blender/blender/pulls/111448
This commit is contained in:
Hans Goudey
2023-08-24 15:28:07 +02:00
committed by Hans Goudey
parent 2cb5f83940
commit 34e4bedcd8
8 changed files with 4 additions and 34 deletions

View File

@@ -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")),
),

View File

@@ -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;
}

View File

@@ -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:

View File

@@ -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;

View File

@@ -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;
}

View File

@@ -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<const bNodeTree *>(ptr->owner_id);
if (tree->type == NTREE_GEOMETRY) {
return true;

View File

@@ -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");

View File

@@ -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<bNodeSocket *>(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);