blender-to-gmstudio / blender-to-smf

Import-Export of Blender model from/to SMF model format
MIT License
11 stars 2 forks source link

Apply modifiers before export #19

Closed bartteunis closed 3 years ago

bartteunis commented 3 years ago

How to do this? What about modifiers that come after the Armature modifier?

bartteunis commented 3 years ago

See Blender's FBX export: the context's depsgraph can be used to get an evaluated object of which the mesh has the modifiers applied. A couple of interesting links that relate to this: https://docs.blender.org/api/current/bpy.types.Depsgraph.html#dependency-graph-bpy-data-meshes-new-from-object https://code.blender.org/2016/12/dependency-graph-proposal/

Instead of a simple Mesh.copy a bpy.data.meshes.new_from_object should work to properly achieve this.

bartteunis commented 3 years ago

Fixed in 4c5e0837733a8e68e916d1b4c507be7e8c5632da