Customizing NI-mate Blender addon for Manuel Bastioni Lab


#1

I replaced:

self.receiver.run(bpy.data.objects, set_location, set_rotation)

with:

self.receiver.run(bpy.data.objects[context.scene.delicode_ni_mate_object].pose.bones, set_location, set_rotation)

and:

for key, value in self.original_locations.items():
bpy.data.objects[key].location = value.copy()
for key, value in self.original_rotations.items():
bpy.data.objects[key].rotation_quaternion = value.copy()

with:

for key, value in self.original_locations.items():
bpy.data.objects[context.scene.delicode_ni_mate_object].pose.bones[key].location = value.copy()
for key, value in self.original_rotations.items():
bpy.data.objects[context.scene.delicode_ni_mate_object].pose.bones[key].rotation_quaternion = value.copy()

I also added a object selection box on the panel for the context.scene.delicode_ni_mate_object variable.

I renamed the bone names in NI-mate to match the bone names for Manuel Bastioni Lab skeleton. It sort of works, the arms flap around all crazy. I did it with unmodified Blender addon using empties and that works perfect, no flapping. So I assume I need to handle pose.bones differently or something? Blender’s Python API documentation isn’t really that helpful.

If someone could point me in the right direction, that would be awesome!

Thanks,
Blake


#2

I kind of answered my own question.

I think the problem is because the MBL skeleton isn’t the same scale so the model is being stretched way out. When using just Basic format, it’s stretched, using Orientation, it flaps around and when using both it’s stretched out and flapping.

I might be able to select the MLB character in the panel, look up it’s bones’ locations, calculate distances and modify the output of NI mate in the Blender plugin, so that the output has the same scale and character position.