Exporting mesh w/ partial modifiers

Warning! Python Newbie at work!

Hey, I’m trying to write a blender exporter. I’ve been looking at other exporters for tips, but I’ve hit a snag:

I want the exporter to be able to export meshes with some (not all!) of the modifiers applied, based on modifier type and/or name.

I can’t use the Mesh.getFromObject(cage = 1), since this applies ALL modifiers.
I don’t want to directly modify the object’s ModSeq, as it changes the original mesh.
I originally thought about copying the ModSeq, modifying it, and creating a new mesh using the new ModSeq, but a) blender complained when I tried to copy the Seq, and b) even if I could’ve copied the Seq, I don’t know how to apply it to the mesh.

So now I’m down to creating a temporary object, modifying IT’S ModSeq, then applying getFromObject to get a second temporary mesh. :confused: Which seems to be an inelegant solution.

Is there a better way to do this? Thanks!

just turn off the modifier’s REALTIME option before you call getFromObject(), and turn it back on after your done.


mods = obj.modifiers 
for mod in mods: 
    if mod.type == Modifier.Types.ARMATURE: 
        mod[Modifier.Settings.REALTIME] = 0

the above would just turn off the realtime or the gl display of the modifier without modifying the stack.

:smiley: Thank you! It works perfectly.

Shame on me for not exploring the modifier API more thoroughly. xD