start renaming adapter -> library_type
This commit is contained in:
+15
-13
@@ -920,7 +920,7 @@ class ACTIONLIB_OT_store_anim_pose(Operator):
|
||||
)
|
||||
|
||||
## Define Tags
|
||||
tags = [t.strip() for t in self.tags.split(',')]
|
||||
tags = [t.strip() for t in self.tags.split(',') if t]
|
||||
tag_range = f'f{self.frame_start}'
|
||||
is_single_frame = True
|
||||
if self.action_type == 'ANIM':
|
||||
@@ -1025,10 +1025,10 @@ class ACTIONLIB_OT_store_anim_pose(Operator):
|
||||
|
||||
self.action_to_asset(asset_action)
|
||||
|
||||
#lib.adapter.new_asset()
|
||||
|
||||
#Saving the preview
|
||||
|
||||
self.render_preview(img_path, video_path)
|
||||
|
||||
with context.temp_override(id=asset_action):
|
||||
bpy.ops.ed.lib_id_load_custom_preview(
|
||||
filepath=str(img_path)
|
||||
@@ -1036,15 +1036,17 @@ class ACTIONLIB_OT_store_anim_pose(Operator):
|
||||
|
||||
lib.adapter.write_asset(asset=asset_action, asset_path=asset_path)
|
||||
|
||||
# asset_description = lib.adapter.get_asset_description(dict(
|
||||
# author=prefs.author,
|
||||
# assets=[dict(
|
||||
# name=asset_action.name,
|
||||
# description=self.description,
|
||||
# catalog=self.catalog,
|
||||
# tags=self.tags.split(',')
|
||||
# )]), asset_path
|
||||
# )
|
||||
|
||||
asset_data = lib.adapter.get_asset_data(asset_action)
|
||||
|
||||
diff = [dict(asset_data,
|
||||
image=str(img_path),
|
||||
filepath=str(asset_path),
|
||||
type='ACTION',
|
||||
library_id=lib.id,
|
||||
catalog=self.catalog,
|
||||
operation='ADD'
|
||||
)]
|
||||
# lib.adapter.write_description_file(asset_description, asset_path)
|
||||
|
||||
# Restore action and cleanup
|
||||
@@ -1057,7 +1059,7 @@ class ACTIONLIB_OT_store_anim_pose(Operator):
|
||||
# TODO Write a proper method for this
|
||||
diff_path = Path(bpy.app.tempdir, 'diff.json')
|
||||
|
||||
diff = [dict(a, operation='ADD') for a in lib.adapter.norm_cache([asset_description])]
|
||||
#diff = [dict(a, operation='ADD') for a in [asset_description])]
|
||||
diff_path.write_text(json.dumps(diff, indent=4))
|
||||
|
||||
bpy.ops.assetlib.bundle(name=lib.name, diff=str(diff_path), blocking=True)
|
||||
|
||||
Reference in New Issue
Block a user