How can I "apply all modifiers" of certain geometries automatically?

I have very many SurfCircles (200+), and selecting each and press “Apply” for all Hooks I defined is far too much work.
Is there any sample code showing how this could be done automatically?

Very many thanks for your help.

the most efficient way may be to call to_mesh() with a python script and apply all modifiers for a new mesh datablock, maybe remove the original. Depends on what you wanna do…

Can you describe your workflow from start to finish?

Hi!

I create many SurfCircles, and connect many of their vertices to other geometry via Hook-Modifiers. When this other geometry moves, the SurfCircle-vertices move with them (which changes the shape of the SurfCircles). Now I would like to further edit the SurfCircles, but in edit-mode only the old/original vertex-positions are shown (pre Hooking and Moving them). So, before being able to make further edits, I have to press “Apply” for all those Hook- Modifiers. Ideally I had a Python Script, which looks for all SurfCircles, and, for each one, goes through all its Hook-Modifiers and “Applies” them (thus moving the vertices to their new positions).

Many Regards!
and thanks for your help.

Well, that’s pretty easy task to solve. Here, run this one:

import bpy
selected = bpy.context.selected_objects
for ob in selected:
	bpy.context.scene.objects.active = ob
	bpy.ops.object.modifier_apply(apply_as='DATA',modifier='SimpleDeform')

Just select all objects with modifiers, change ‘SimpleDeform’ to actual modifiers name in script, run it, and voila!

enable these two buttons and you will be able to edit the shape that you usually see in object mode only: