Asset Pipeline: Use a weak ref for Asset Collection to improve performance #213

Merged
Nick Alberelli merged 3 commits from TinyNick/blender-studio-pipeline:fix/asset-collection-as-string into main 2024-01-25 17:06:04 +01:00
Showing only changes of commit 40473893f9 - Show all commits

View File

@ -167,7 +167,6 @@ class AssetPipeline(bpy.types.PropertyGroup):
) )
@staticmethod
@bpy.app.handlers.persistent @bpy.app.handlers.persistent
def set_asset_collection_name_post_file_load(_): def set_asset_collection_name_post_file_load(_):
# Version the PointerProperty to the StringProperty, and the left-over pointer. # Version the PointerProperty to the StringProperty, and the left-over pointer.
@ -197,7 +196,7 @@ def register():
bpy.types.ID.asset_id_surrender = bpy.props.BoolProperty( bpy.types.ID.asset_id_surrender = bpy.props.BoolProperty(
name="Surrender Ownership", default=False name="Surrender Ownership", default=False
) )
bpy.app.handlers.load_post.append(AssetPipeline.set_asset_collection_name_post_file_load) bpy.app.handlers.load_post.append(set_asset_collection_name_post_file_load)
def unregister(): def unregister():
@ -206,4 +205,4 @@ def unregister():
del bpy.types.Object.transfer_data_ownership del bpy.types.Object.transfer_data_ownership
del bpy.types.Scene.asset_pipeline del bpy.types.Scene.asset_pipeline
del bpy.types.ID.asset_id_owner del bpy.types.ID.asset_id_owner
bpy.app.handlers.load_post.remove(AssetPipeline.set_asset_collection_name_post_file_load) bpy.app.handlers.load_post.remove(set_asset_collection_name_post_file_load)