Geometry Nodes: Only set soft range for modifier properties

Similar to the corresponding properties on node sockets, only adjust
the soft range. Because group nodes only have soft limits, groups
should generally be able to accept these inputs anyway. The benefit
of only using a soft range is that it allows choosing a more user-
friendly default range while keeping flexibility.
This commit is contained in:
Hans Goudey 2023-01-13 12:49:53 -06:00
parent ef68a37e5d
commit cb92ff7b2d
Notes: blender-bot 2023-02-14 03:29:37 +01:00
Referenced by issue #97596, Inconsistent Behavior of Value Clamping in Modifier Panel and Group Input.
1 changed files with 6 additions and 6 deletions

View File

@ -442,8 +442,8 @@ id_property_create_from_socket(const bNodeSocket &socket)
auto property = bke::idprop::create(socket.identifier, value->value);
IDPropertyUIDataFloat *ui_data = (IDPropertyUIDataFloat *)IDP_ui_data_ensure(property.get());
ui_data->base.rna_subtype = value->subtype;
ui_data->min = ui_data->soft_min = double(value->min);
ui_data->max = ui_data->soft_max = double(value->max);
ui_data->soft_min = double(value->min);
ui_data->soft_max = double(value->max);
ui_data->default_value = value->value;
return property;
}
@ -453,8 +453,8 @@ id_property_create_from_socket(const bNodeSocket &socket)
auto property = bke::idprop::create(socket.identifier, value->value);
IDPropertyUIDataInt *ui_data = (IDPropertyUIDataInt *)IDP_ui_data_ensure(property.get());
ui_data->base.rna_subtype = value->subtype;
ui_data->min = ui_data->soft_min = value->min;
ui_data->max = ui_data->soft_max = value->max;
ui_data->soft_min = value->min;
ui_data->soft_max = value->max;
ui_data->default_value = value->value;
return property;
}
@ -465,8 +465,8 @@ id_property_create_from_socket(const bNodeSocket &socket)
socket.identifier, Span<float>{value->value[0], value->value[1], value->value[2]});
IDPropertyUIDataFloat *ui_data = (IDPropertyUIDataFloat *)IDP_ui_data_ensure(property.get());
ui_data->base.rna_subtype = value->subtype;
ui_data->min = ui_data->soft_min = double(value->min);
ui_data->max = ui_data->soft_max = double(value->max);
ui_data->soft_min = double(value->min);
ui_data->soft_max = double(value->max);
ui_data->default_array = (double *)MEM_mallocN(sizeof(double[3]), "mod_prop_default");
ui_data->default_array_len = 3;
for (const int i : IndexRange(3)) {