refactor: moved get_datablock_from_uuid to bl_datablock

This commit is contained in:
Swann
2020-10-01 22:51:48 +02:00
parent 824d4d6a83
commit 8f9d5aabf9
5 changed files with 20 additions and 21 deletions

View File

@ -81,19 +81,6 @@ def resolve_from_id(id, optionnal_type=None):
return None
def get_datablock_from_uuid(uuid, default, ignore=[]):
if not uuid:
return default
for category in dir(bpy.data):
root = getattr(bpy.data, category)
if isinstance(root, Iterable) and category not in ignore:
for item in root:
if getattr(item, 'uuid', None) == uuid:
return item
return default
def get_preferences():
return bpy.context.preferences.addons[__package__].preferences