I would like to apply all modifiers to an object with python.
for mod in ob.modifiers:
bpy.ops.object.modifier_apply(modifier = mod.name)
This works fine, unless for some reason the modifier is disabled, e.g.:
- A Boolean modifier with no object
- A Shrinkwrap modifier with no target
General Problem:
Other than knowing all of the possible attributes of every modifier and checking to make sure the modifier is valid, is there a way to bpy.ops.object.modifier_apply.poll()
while specifying which modifier I want to apply?
I see that the poll()
method expects
poll(self, *args)
.
Perhaps I can put something in for *args
which will help
Work Around: I can get the modified mesh object.to_mesh()