diff --git a/src/bonsai/bonsai/bim/helper.py b/src/bonsai/bonsai/bim/helper.py index 3b3dd502e4..e76b512de3 100644 --- a/src/bonsai/bonsai/bim/helper.py +++ b/src/bonsai/bonsai/bim/helper.py @@ -428,7 +428,11 @@ def get_enum_items( else: annotations_data = data - prop = annotations_data.__annotations__[prop_name] + try: + annotations = annotations_data.__annotations__ + except AttributeError: + annotations = type(annotations_data).__annotations__ + prop = annotations[prop_name] items = prop.keywords.get("items") if items is None: return diff --git a/src/bonsai/bonsai/tool/blender.py b/src/bonsai/bonsai/tool/blender.py index 97b161a11b..09bfcf29cc 100644 --- a/src/bonsai/bonsai/tool/blender.py +++ b/src/bonsai/bonsai/tool/blender.py @@ -742,7 +742,11 @@ class Blender(bonsai.core.tool.Blender): # Yes, accessing items through annotations is a bit hacky # but it's the only way to get the dynamic enum items # besides providing them to get_enum_safe explicitly. - prop_keywords = props.__annotations__[prop_name].keywords + try: + annotations = props.__annotations__ + except AttributeError: + annotations = type(props).__annotations__ + prop_keywords = annotations[prop_name].keywords items = prop_keywords.get("items") if items is None: return None