modifier_apply Causes Crash?

Hi all,

I have a strange situation. As part of a larger project, I need to copy an object and mesh, and apply all modifiers on the copy except Armature modifiers. Below is a little chunk of code that should do this, but keeps crashing Blender:

import bpy

Object =["Cube"]
Object2 = Object.copy()
Mesh = = Mesh = Object2
for Modifier in [Modifier for Modifier in Object2.modifiers if Modifier.type != "ARMATURE"]:
    print("Crash happens after this...")
    print("And before this...")


The thing I don’t understand is, when I follow these same steps in a console window, they work as expected.

Here’s a link to a little test file I setup. Open it up and just click Run Script to test it.

I’m using Blender 2.52 r30120 with 32-bit Windows XP.

If anyone has any insight as to why this is happening, or any ways to get around it, please let me know. :slight_smile:

Edit: Just tested r30230, which is the most recent at this writing. Same problem.