fix [#31661] Custom properties do no respect min/max values

also renamed function added prev commit
This commit is contained in:
Campbell Barton
2012-10-26 10:54:02 +00:00
parent 0e6f8e3e25
commit 0e3de1df4b
5 changed files with 12 additions and 6 deletions

View 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'}