Hello. When I replace a set of rigid bodies and joints to a new model skeleton, and then delete the old model skeleton, the target object of the rigid body constraint will be lost. This causes the rigid body to not be able to drive the new skeleton.
I made the following fixes so that when rebuilding a rigid body, the constraint targets are automatically updated to the new skeleton.
arm = relation.target
bone_name = relation.subtarget
to
# auto update target to new armature start
if relation.target is None:
relation.target = self.armature()
arm = relation.target
if relation.subtarget not in arm.pose.bones:
bone_name = ''
# relation.subtarget = ''
else:
bone_name = relation.subtarget
# auto update target to new armature end
Hello. When I replace a set of rigid bodies and joints to a new model skeleton, and then delete the old model skeleton, the target object of the rigid body constraint will be lost. This causes the rigid body to not be able to drive the new skeleton.
I made the following fixes so that when rebuilding a rigid body, the constraint targets are automatically updated to the new skeleton.
Just replace https://github.com/UuuNyaa/blender_mmd_tools/blob/main/mmd_tools/core/model.py#L969-L970
to
Then the problem is solved.