continue refacto

master
“christopheseux” 2022-12-28 00:09:57 +01:00
parent 575bbade7b
commit 74724423b4
5 changed files with 21 additions and 15 deletions

View File

@ -7,7 +7,8 @@ from asset_library.action import (
operators,
properties,
rename_pose,
render_preview,)
#render_preview
)
if 'bpy' in locals():
import importlib
@ -19,7 +20,7 @@ if 'bpy' in locals():
importlib.reload(operators)
importlib.reload(properties)
importlib.reload(rename_pose)
importlib.reload(render_preview)
#importlib.reload(render_preview)
def register():
operators.register()

View File

@ -73,8 +73,8 @@ from asset_library.action.functions import (
from asset_library.common.functions import (
#get_actionlib_dir,
get_asset_source,
get_catalog_path,
read_catalog,
#get_catalog_path,
#read_catalog,
#set_actionlib_dir,
resync_lib,
get_active_library,
@ -299,7 +299,7 @@ class ACTIONLIB_OT_apply_anim(Operator):
return {'FINISHED'}
"""
class ACTIONLIB_OT_publish(Operator):
bl_idname = "actionlib.publish"
bl_label = "Publish Library"
@ -444,6 +444,7 @@ class ACTIONLIB_OT_publish(Operator):
print('[>-] Publish Done.')
return {"FINISHED"}
"""
class ACTIONLIB_OT_create_anim_asset(Operator):
@ -1059,7 +1060,7 @@ class ACTIONLIB_OT_store_anim_pose(Operator):
classes = (
ACTIONLIB_OT_assign_action,
ACTIONLIB_OT_restore_previous_action,
ACTIONLIB_OT_publish,
#ACTIONLIB_OT_publish,
ACTIONLIB_OT_apply_anim,
ACTIONLIB_OT_replace_pose,
ACTIONLIB_OT_create_anim_asset,

View File

@ -1,5 +1,5 @@
from asset_library.common.functions import (read_catalog, write_catalog, norm_asset_datas)
from asset_library.common.functions import (norm_asset_datas,)
from asset_library.common.bl_utils import get_addon_prefs, load_datablocks
from asset_library.common.file_utils import read_file, write_file
from asset_library.common.template import Template
@ -317,6 +317,9 @@ class AssetLibraryAdapter(PropertyGroup):
"""Read the catalog file of the library target directory or of the specified directory"""
catalog_path = self.get_catalog_path(directory)
if not catalog_path.exists():
return {}
cat_data = {}
for line in catalog_path.read_text(encoding="utf-8").split('\n'):
@ -761,12 +764,12 @@ class AssetLibraryAdapter(PropertyGroup):
print(f'Saving Blend to {blend_path}')
#blend_path.parent.mkdir(exist_ok=True, parents=True)
blend_path.parent.mkdir(exist_ok=True, parents=True)
#bpy.ops.wm.save_as_mainfile(filepath=str(blend_path), compress=True)
bpy.ops.wm.save_as_mainfile(filepath=str(blend_path), compress=True)
#if write_cache:
# self.write_cache(cache)
if write_cache:
self.write_cache(cache)
self.write_catalog(catalog_data)

View File

@ -3,8 +3,9 @@ from asset_library.collection import (
gui,
operators,
keymaps,
build_collection_blends,
create_collection_library)
#build_collection_blends,
#create_collection_library,
)
if 'bpy' in locals():
import importlib
@ -12,8 +13,8 @@ if 'bpy' in locals():
importlib.reload(gui)
importlib.reload(operators)
importlib.reload(keymaps)
importlib.reload(build_collection_blends)
importlib.reload(create_collection_library)
#importlib.reload(build_collection_blends)
#importlib.reload(create_collection_library)
def register():