In a blender add-on, I import a mesh and join it with an armature using automatic weight.
I use bpy.ops.object.parent_set(type='ARMATURE_AUTO', keep_transform=True)
for this.
However, I then need to add an additional mesh to the the main object and recalculate the weights for only a single bone (this to avoid weight painting for other bones influencing the additional mesh on poses)
In the post How to recalculate automatic weights for single bones?, it is described how to do this manually.
However, I'm unable to identify method to trigger this from python code.
Is there a suitable method for this in the blender API ? Or is there some way of triggering a select of a UI menu element from python code (for example some general function within the https://docs.blender.org/api/current/bpy.ops.html namespace)
bpy.ops.paint.weight_from_bones(type='AUTOMATIC')
. hope this helps $\endgroup$