This link specifies how to add a new tag to an asset present in current file.
After adding a new asset library, I want to add a tag to the assets present in that library.
asset_libraries = bpy.context.preferences.filepaths.asset_libraries
for asset_library in asset_libraries:
library_name = asset_library.name
library_path = Path(asset_library.path)
blend_files = [fp for fp in library_path.glob("**/*.blend") if fp.is_file()]
for blend_file in blend_files:
with bpy.data.libraries.load(str(blend_file)) as (file_contents, data_to):
print('file_content objects : ', file_contents.objects)
The above code prints an array of strings, i.e., all object names.
I want access to the object itself, in order to add a new tag to it.
Any help or direction would be great. Thanks!