Asset Pipeline: Add Support for Asset Catalogs #185

Merged
Nick Alberelli merged 7 commits from TinyNick/blender-studio-pipeline:feature/asset-pipeline-set-catalog into main 2024-01-09 23:28:34 +01:00
Showing only changes of commit d04db2db95 - Show all commits

View File

@ -151,8 +151,11 @@ def sync_execute_pull(self, context):
def sync_execute_push(self, context): def sync_execute_push(self, context):
_catalog_id = None
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
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)
@ -174,5 +177,10 @@ def sync_execute_push(self, context):
self.report({'ERROR'}, error_msg) self.report({'ERROR'}, error_msg)
return {'CANCELLED'} return {'CANCELLED'}
asset_pipe = context.scene.asset_pipeline
asset_col = asset_pipe.asset_collection
if _catalog_id != '':
asset_col.asset_data.catalog_id = _catalog_id
bpy.ops.wm.save_as_mainfile(filepath=file_path) bpy.ops.wm.save_as_mainfile(filepath=file_path)
bpy.ops.wm.open_mainfile(filepath=self._current_file.__str__()) bpy.ops.wm.open_mainfile(filepath=self._current_file.__str__())