mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 08:24:53 +01:00
Fixes long library names
This commit is contained in:
parent
73614e08a8
commit
a8b93ec8fe
3 changed files with 18 additions and 3 deletions
|
|
@ -61,5 +61,10 @@ class BlendAnimationLoader(plugin.AssetLoader):
|
|||
|
||||
bpy.data.objects.remove(container)
|
||||
|
||||
library = bpy.data.libraries.get(bpy.path.basename(libpath))
|
||||
filepath = bpy.path.basename(libpath)
|
||||
# Blender has a limit of 63 characters for any data name.
|
||||
# If the filepath is longer, it will be truncated.
|
||||
if len(filepath) > 63:
|
||||
filepath = filepath[:63]
|
||||
library = bpy.data.libraries.get(filepath)
|
||||
bpy.data.libraries.remove(library)
|
||||
|
|
|
|||
|
|
@ -106,7 +106,12 @@ class BlendLoader(plugin.AssetLoader):
|
|||
bpy.context.scene.collection.objects.link(obj)
|
||||
|
||||
# Remove the library from the blend file
|
||||
library = bpy.data.libraries.get(bpy.path.basename(libpath))
|
||||
filepath = bpy.path.basename(libpath)
|
||||
# Blender has a limit of 63 characters for any data name.
|
||||
# If the filepath is longer, it will be truncated.
|
||||
if len(filepath) > 63:
|
||||
filepath = filepath[:63]
|
||||
library = bpy.data.libraries.get(filepath)
|
||||
bpy.data.libraries.remove(library)
|
||||
|
||||
return container, members
|
||||
|
|
|
|||
|
|
@ -60,7 +60,12 @@ class BlendSceneLoader(plugin.AssetLoader):
|
|||
bpy.context.scene.collection.children.link(container)
|
||||
|
||||
# Remove the library from the blend file
|
||||
library = bpy.data.libraries.get(bpy.path.basename(libpath))
|
||||
filepath = bpy.path.basename(libpath)
|
||||
# Blender has a limit of 63 characters for any data name.
|
||||
# If the filepath is longer, it will be truncated.
|
||||
if len(filepath) > 63:
|
||||
filepath = filepath[:63]
|
||||
library = bpy.data.libraries.get(filepath)
|
||||
bpy.data.libraries.remove(library)
|
||||
|
||||
return container, members
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue