diff options
author | Hans Goudey <h.goudey@me.com> | 2022-02-21 21:01:37 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-02-21 21:01:37 +0300 |
commit | be6bcaa8c13dfca98e56d81afd3d19ba226c2699 (patch) | |
tree | aa14a71cc3e5e058ec6a4353ccceabdf7dd3f3de /source/blender/modifiers | |
parent | b7171d1b822010f7ccc59631b2f2bda95ef6058a (diff) |
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.
Diffstat (limited to 'source/blender/modifiers')
-rw-r--r-- | source/blender/modifiers/intern/MOD_nodes.cc | 4 |
1 files changed, 4 insertions, 0 deletions
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]); } |