mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 05:14:40 +01:00
Merge pull request #5866 from ynput/bugfix/blender-blend-layout-loading
Blender: Fix loading of blend layouts
This commit is contained in:
commit
68fd280131
1 changed files with 5 additions and 1 deletions
|
|
@ -32,7 +32,7 @@ class BlendLoader(plugin.AssetLoader):
|
|||
empties = [obj for obj in objects if obj.type == 'EMPTY']
|
||||
|
||||
for empty in empties:
|
||||
if empty.get(AVALON_PROPERTY):
|
||||
if empty.get(AVALON_PROPERTY) and empty.parent is None:
|
||||
return empty
|
||||
|
||||
return None
|
||||
|
|
@ -90,6 +90,7 @@ class BlendLoader(plugin.AssetLoader):
|
|||
members.append(data)
|
||||
|
||||
container = self._get_asset_container(data_to.objects)
|
||||
print(container)
|
||||
assert container, "No asset group found"
|
||||
|
||||
container.name = group_name
|
||||
|
|
@ -100,8 +101,11 @@ class BlendLoader(plugin.AssetLoader):
|
|||
|
||||
# Link all the container children to the collection
|
||||
for obj in container.children_recursive:
|
||||
print(obj)
|
||||
bpy.context.scene.collection.objects.link(obj)
|
||||
|
||||
print("")
|
||||
|
||||
# Remove the library from the blend file
|
||||
library = bpy.data.libraries.get(bpy.path.basename(libpath))
|
||||
bpy.data.libraries.remove(library)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue