fix [#31661] Custom properties do no respect min/max values
[blender.git] / release / scripts / startup / bl_operators / wm.py
index ac72b39a04d34621b5d051fe3c0632c4152a4890..5cc041476c96a1758b358c79129a9360477263f8 100644 (file)
@@ -1124,9 +1124,15 @@ class WM_OT_properties_add(Operator):
 
             return prop_new
 
-        property = unique_name(item.keys())
+        prop = unique_name(item.keys())
+
+        item[prop] = 1.0
+
+        # not essential, but without this we get [#31661]
+        prop_ui = rna_idprop_ui_prop_get(item, prop)
+        prop_ui["soft_min"] = prop_ui["min"] = 0.0
+        prop_ui["soft_max"] = prop_ui["max"] = 1.0
 
-        item[property] = 1.0
         return {'FINISHED'}