finish make library conformation working

This commit is contained in:
“christopheseux”
2022-12-30 23:36:09 +01:00
parent ab72a15a2c
commit 501cb460c8
19 changed files with 319 additions and 303 deletions
+2
View File
@@ -9,6 +9,8 @@ if 'bpy' in locals():
importlib.reload(gui)
importlib.reload(keymaps)
import bpy
def register():
operators.register()
keymaps.register()
+10 -2
View File
@@ -14,13 +14,21 @@ from bpy.types import (
from bpy_extras import asset_utils
from asset_library.common.bl_utils import get_object_libraries, get_addon_prefs
from asset_library.common.functions import get_active_library
def draw_context_menu(self, context):
layout = self.layout
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()
layout.operator("assetlib.open_blend_file", text="Open Blend File")#.filepath = asset.asset_data['filepath']
op = layout.operator("wm.link", text="Link")
op.filepath = str(filepath)
op = layout.operator("wm.append", text="Append")
op.filepath = str(filepath)
def draw_header(layout):
+2 -2
View File
@@ -36,9 +36,9 @@ class ASSETLIB_OT_open_blend_file(Operator):
def execute(self, context: Context) -> Set[str]:
lib = get_active_library()
print(lib, lib.data_type)
filepath = context.active_file.asset_data['filepath']
filepath = lib.get_active_asset_path()
open_blender_file(filepath)
return {'FINISHED'}
Binary file not shown.