applying modifiers with Python

When I add modifiers to a Blender object in Python, they show up in the object’s modifier stack, but are not applied. How do I apply them(besides manually, that is)?

I figured out an elaborate workaround that involved selecting the object, going into and out of EditMode, and redrawing again. Is there an easier way??:confused:

From the Modifier Module docs example :


from Blender import *

ob = Object.Get('Cube') 

mods = ob.modifiers            
mod = mods.append(Modifier.Type.SUBSURF) 

<b>ob.makeDisplayList()</b> # Needed to apply the modifier
<b>Window.RedrawAll()</b>  # View the change

Mike

Mike,

Thanks! That’s much easier…how does one suggest API documentation additions? That was definately not intuitive.

RS

Rocketship, Iv updated the API and docs a bit (it had some errors) - so checkout the docs from
http://members.iinet.net.au/~cpbarton/ideasman/BPY_API/index.html

Just post on here and I’ll include them.

Modifiers API isnt the best but we its not that easy to translate into a pythonic way.