I have a addon for Blender where I'm using custom properties and I would like to delete any custom property that isn't API defined.
In my project I have an enumerator that acts like a dropdown menu to choose between different property groups(where the user can set multiple properties), with an on Change function that resets properties.
I need to do this in a dynamical ways and properties have other name and values. Is there any way to just access API defined properties or manually added properties? That would be enough.
I found out that if have a property that isn't API defined I get the following error: Error message Here are my properties: Custom Properties API defined + manually added one
This is my function:
def fun_clear_none_selected():
# Getting props from selected object
get_array_object = bpy.context.object.keys()
properties = []
# Filling data from get_array_object to properties to be able to access it
for item in get_array_object:
properties.append(item)
# Permanent property
properties.remove('toolTipTextKey')
# Resetting unused properties
for name in properties:
bpy.context.object.property_unset(name)