powroupi / blender_mmd_tools

mmd_tools is a blender addon for importing Models and Motions of MikuMikuDance.
GNU General Public License v3.0
1.83k stars 277 forks source link

Minor update for Blender 2.8 #224

Closed nagadomi closed 5 years ago

nagadomi commented 5 years ago

This PR does not need to be merged immediately.

When a mesh has modifiers (e.g. Bevel modifier), vertex weights are not exported correctly. The mesh returned from obj.evaluated_get(bpy.context.evaluated_depsgraph_get()).to_mesh() seems to have lost vertex groups when the mesh has modifiers.

related: https://developer.blender.org/T65544 https://developer.blender.org/rB5dbda33462349a4ac78f08e8ed4ec7922ca7394f

I am not very confident about this change, but it seems to work in latest master branch of Blender.

powroupi commented 5 years ago

Thanks for the updates, I'll try it in the future. :smile:

Not sure if the following 2 lines are the same or not: :thinking:

return obj.evaluated_get(depsgraph).to_mesh(depsgraph=depsgraph, preserve_all_data_layers=True)
return obj.to_mesh(depsgraph=depsgraph, preserve_all_data_layers=True)
nagadomi commented 5 years ago

Without evaluated_get, modifiers(e.g. Mirror Modifier) are not applied.