Add error trying to add non-numeric custom quantity set value

Example - https://i.imgur.com/NUFN1sR.png
This commit is contained in:
Andrej730
2024-11-15 12:41:01 +05:00
parent 8e4e12ba21
commit a29b1072e4
+3
View File
@@ -355,6 +355,9 @@ class Pset(bonsai.core.tool.Pset):
def add_proposed_property(cls, name: str, value: Any, props: bpy.types.PropertyGroup) -> Union[None, str]:
if props.properties.get(name):
return f"Property '{name}' already exists."
if props.active_pset_type == "QTO":
if not isinstance(value, (float, int)):
return f"Quantity sets support only numeric values. Provided value: '{value}' ({type(value).__name__})."
prop = props.properties.add()
prop.name = name
metadata = prop.metadata