Asset Pipeline: Store Asset Catalog in String #230

Merged
Nick Alberelli merged 6 commits from TinyNick/blender-studio-pipeline:fix/asset-catalog into main 2024-02-15 22:54:08 +01:00
2 changed files with 6 additions and 6 deletions
Showing only changes of commit aa9328289d - Show all commits

View File

@ -25,7 +25,7 @@ from .sync import (
sync_execute_push, sync_execute_push,
) )
from .asset_catalog import get_asset_cat_enum_items from .asset_catalog import get_asset_catalog_items, get_asset_id
class ASSETPIPE_OT_create_new_asset(bpy.types.Operator): class ASSETPIPE_OT_create_new_asset(bpy.types.Operator):
@ -434,7 +434,7 @@ class ASSETPIPE_OT_publish_new_version(bpy.types.Operator):
f"Only '{constants.REVIEW_PUBLISH_KEY}' Publish is supported when a version is staged", f"Only '{constants.REVIEW_PUBLISH_KEY}' Publish is supported when a version is staged",
) )
return {'CANCELLED'} return {'CANCELLED'}
catalog_id = context.scene.asset_pipeline.asset_catalog_id catalog_id = get_asset_id(context.scene.asset_pipeline.asset_catalog_id)
create_next_published_file( create_next_published_file(
current_file=Path(bpy.data.filepath), current_file=Path(bpy.data.filepath),
publish_type=self.publish_types, publish_type=self.publish_types,
@ -476,7 +476,7 @@ class ASSETPIPE_OT_publish_staged_as_active(bpy.types.Operator):
staged_file = find_latest_publish(current_file, publish_type=constants.STAGED_PUBLISH_KEY) staged_file = find_latest_publish(current_file, publish_type=constants.STAGED_PUBLISH_KEY)
# Delete Staged File # Delete Staged File
staged_file.unlink() staged_file.unlink()
catalog_id = context.scene.asset_pipeline.asset_catalog_id catalog_id = get_asset_id(context.scene.asset_pipeline.asset_catalog_id)
create_next_published_file(current_file=current_file, catalog_id=catalog_id) create_next_published_file(current_file=current_file, catalog_id=catalog_id)
return {'FINISHED'} return {'FINISHED'}
@ -960,7 +960,7 @@ class ASSETPIPE_OT_refresh_asset_cat(bpy.types.Operator):
bl_description = """Refresh Asset Catalogs""" bl_description = """Refresh Asset Catalogs"""
def execute(self, context: bpy.types.Context): def execute(self, context: bpy.types.Context):
get_asset_cat_enum_items() get_asset_catalog_items(reload=True)
self.report({'INFO'}, "Asset Catalogs Refreshed!") self.report({'INFO'}, "Asset Catalogs Refreshed!")
return {'FINISHED'} return {'FINISHED'}

View File

@ -16,7 +16,7 @@ from .merge.shared_ids import get_shared_id_icon
from . import constants, config from . import constants, config
from .hooks import Hooks from .hooks import Hooks
from .merge.task_layer import draw_task_layer_selection from .merge.task_layer import draw_task_layer_selection
from .asset_catalog import get_asset_id
def sync_poll(cls, context): def sync_poll(cls, context):
if any([img.is_dirty for img in bpy.data.images]): if any([img.is_dirty for img in bpy.data.images]):
@ -155,7 +155,7 @@ def sync_execute_push(self, context):
hooks_instance = Hooks() hooks_instance = Hooks()
hooks_instance.load_hooks(context) hooks_instance.load_hooks(context)
temp_file_path = create_temp_file_backup(self, context) temp_file_path = create_temp_file_backup(self, context)
_catalog_id = context.scene.asset_pipeline.asset_catalog_id _catalog_id = get_asset_id(context.scene.asset_pipeline.asset_catalog_id)
file_path = self._sync_target.__str__() file_path = self._sync_target.__str__()
bpy.ops.wm.open_mainfile(filepath=file_path) bpy.ops.wm.open_mainfile(filepath=file_path)