I have a blend file with hundreds of mesh objects as part of a kit bash pack.
I want to copy each mesh to its own file and turn those files into KPacks for Kit Ops addon.
To export each mesh into a new file I tried to use this code:
import bpy
base_path = "c:\\temp\\"
for idx, obj in enumerate(bpy.data.objects):
bpy.data.libraries.write(f'{base_path}obj_{idx}.blend', {obj}, fake_user=True)
The problem is that in the files created by the script, only the data blocks are copied, there are no meshes created.
How can I copy each mesh to a new file? It would be very tedious to do that manually for hundreds of files.
libraries.write(fp, use_fake_user=True)
to stop orphans. Seems over kill to add a collection for a one object file. If using collections would add multiple objects to collection then write collection to lib. $\endgroup$