Pre-op script
Testing shows that uniquely named vertex groups are retained when joining mesh objects. Instead of doing this manually (boring) can speed it up with a script.
Running script below will give each mesh object in selected objects a vertex group named after the object containing all verts with weight set to 1.
Have commented out the join operator, uncommenting will do it all in one, by running script when selection matches that for join. (ie adds selected to active)
import bpy
context = bpy.context
obs = [o for o in context.selected_objects if o.type == 'MESH']
for o in obs:
vg = o.vertex_groups.new(name=o.name)
vg.add(range(len(o.data.vertices)), 1.0, 'REPLACE')
run the operator
#bpy.ops.object.join()
It occurs that as well as adding vert group, renaming existing groups by for example prefixing object name would stop groups of same name merging
Add this in loop before making new group.
for vg in o.vertex_groups:
vg.name = f"{o.name}_{vg.name}"
Deja Vu
Creating a batch version of a script that renames Vertex Groups
Thanks for the advice, though I will be trying the script below first
– Felina Faerlaingal Jun 24 '20 at 13:43