Hi everybody.
Let's say I have a bpy.types.Object containing a bpy.types.Mesh data field; how can I apply one of the modifiers associated with the object, in order to obtain a NEW bpy.types.Mesh, possibly contained within a NEW bpy.types.Object, thus leaving the original scene unchaged?
I'm interested in applying the EdgeSplit modifier right before exporting vertex data to my custom format; the reason why I want to do this is to have Blender automatically and transparently duplicate the vertices shared by two faces with very different orientations.
there is an operator to apply a single modifier, but i tend to use to_mesh(), which applies all modifiers and stores the result in a new mesh
| Code: |
| MeshObject.to_mesh(scene=bpy.context.scene, apply_modifiers=True, settings='PREVIEW') |
you can change the show_viewport (settings='PREVIEW') or show_render (settings='RENDER') properties of modifiers before calling to_mesh to control which to apply (False = won't be applied).
this is an example how i use this:
http://code.google.com/p/blender-cod/source/browse/blender_26/export_xmodel.py#185
_________________
I'm sitting, waiting, wishing, building Blender in superstition...