Make all features working

This commit is contained in:
“christopheseux”
2023-01-17 18:05:22 +01:00
parent 060aa80c9b
commit d1c17581ff
27 changed files with 2391 additions and 1400 deletions
+4 -4
View File
@@ -17,7 +17,7 @@ command, write_catalog)
@command
def bundle_library(source_directory, bundle_directory, template_description, thumbnail_template,
def bundle_library(source_directory, bundle_directory, template_info, thumbnail_template,
template=None, data_file=None):
field_pattern = r'{(\w+)}'
@@ -38,9 +38,9 @@ def bundle_library(source_directory, bundle_directory, template_description, thu
name = field_data.get('name', f.stem)
thumbnail = (f / thumbnail_template.format(name=name)).resolve()
asset_data = (f / template_description.format(name=name)).resolve()
asset_data = (f / template_info.format(name=name)).resolve()
catalogs = sorted([v for k,v in sorted(field_data.items()) if k.isdigit()])
catalogs = sorted([v for k,v in sorted(field_data.items()) if re.findall('cat[0-9]+', k)])
catalogs = [c.replace('_', ' ').title() for c in catalogs]
if not thumbnail.exists():
@@ -163,7 +163,7 @@ if __name__ == '__main__' :
bundle_library(
source_directory=args.source_directory,
bundle_directory=args.bundle_directory,
template_description=args.template_description,
template_info=args.template_info,
thumbnail_template=args.thumbnail_template,
template=args.template,
data_file=args.data_file)
+1 -1
View File
@@ -21,7 +21,7 @@ def draw_context_menu(layout):
#asset = context.active_file
layout.operator_context = "INVOKE_DEFAULT"
lib = get_active_library()
filepath = lib.adapter.get_active_asset_path()
filepath = lib.library_type.get_active_asset_path()
layout.operator("assetlib.open_blend_file", text="Open Blend File")#.filepath = asset.asset_data['filepath']
op = layout.operator("wm.link", text="Link")
+1 -1
View File
@@ -37,7 +37,7 @@ class ASSETLIB_OT_open_blend_file(Operator):
lib = get_active_library()
filepath = lib.get_active_asset_path()
filepath = lib.library_type.get_active_asset_path()
open_blender_file(filepath)