From be6bcaa8c13dfca98e56d81afd3d19ba226c2699 Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Mon, 21 Feb 2022 13:01:37 -0500 Subject: Fix T93873: Wrong limits for color socket exposed to modifier Limit the min and max of the IDProperty for the node group input from 0 to infinity, and the soft min and max between 0 and 1. Thanks to @PratikPB2123 for investigation. --- source/blender/modifiers/intern/MOD_nodes.cc | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source/blender/modifiers') diff --git a/source/blender/modifiers/intern/MOD_nodes.cc b/source/blender/modifiers/intern/MOD_nodes.cc index 1c755a7e2d9..a4b46b951a3 100644 --- a/source/blender/modifiers/intern/MOD_nodes.cc +++ b/source/blender/modifiers/intern/MOD_nodes.cc @@ -435,6 +435,10 @@ static IDProperty *id_property_create_from_socket(const bNodeSocket &socket) ui_data->base.rna_subtype = PROP_COLOR; ui_data->default_array = (double *)MEM_mallocN(sizeof(double[4]), __func__); ui_data->default_array_len = 4; + ui_data->min = 0.0; + ui_data->max = FLT_MAX; + ui_data->soft_min = 0.0; + ui_data->soft_max = 1.0; for (const int i : IndexRange(4)) { ui_data->default_array[i] = double(value->value[i]); } -- cgit v1.2.3