[Bf-blender-cvs] [be6bcaa8c13] blender-v3.1-release: Fix T93873: Wrong limits for color socket exposed to modifier

Hans Goudey noreply at git.blender.org
Mon Feb 21 19:01:48 CET 2022


Commit: be6bcaa8c13dfca98e56d81afd3d19ba226c2699
Author: Hans Goudey
Date:   Mon Feb 21 13:01:37 2022 -0500
Branches: blender-v3.1-release
https://developer.blender.org/rBbe6bcaa8c13dfca98e56d81afd3d19ba226c2699

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.

===================================================================

M	source/blender/modifiers/intern/MOD_nodes.cc

===================================================================

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]);
       }



More information about the Bf-blender-cvs mailing list