mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 09:21:46 +00:00
Reset proposed property fields after adding custom property #5539
This commit is contained in:
@@ -94,6 +94,7 @@ def add_proposed_prop(
|
||||
) -> Union[None, str]:
|
||||
props = pset.get_pset_props(obj_name, obj_type)
|
||||
res = pset.add_proposed_property(name, pset.cast_string_to_primitive(value), props)
|
||||
pset.reset_proposed_property_fields(props)
|
||||
return res
|
||||
|
||||
|
||||
|
||||
@@ -327,3 +327,10 @@ class Pset(bonsai.core.tool.Pset):
|
||||
return value
|
||||
except:
|
||||
return value
|
||||
|
||||
@classmethod
|
||||
def reset_proposed_property_fields(cls, props: bpy.types.PropertyGroup) -> None:
|
||||
reset_props = ("prop_name", "prop_value")
|
||||
bl_rna_props = props.bl_rna.properties
|
||||
for prop_name in reset_props:
|
||||
setattr(props, prop_name, bl_rna_props[prop_name].default)
|
||||
|
||||
Reference in New Issue
Block a user