i found these two snippets of code that help me apply all modifiers or a single, specified, modifier on all selected objects. they save me a lot of time when applying modifiers to lots of objects in one go. they work fine in the python console. how do i go about running it as a script.
i tried adding the lines to a text file and using RUN SCRIPT from the text editor and it does not work. do i need to add something before the lines to pipe it to the python console.
here are the two different codes.
# applies all modifiers on selected objects.
bpy.ops.object.convert(target='MESH', keep_original=False)
and
# applies single, specified, modifier on selected objects.
if modifier.type != 'SUBSURF':
modifier.show_render=True
bpy.ops.object.convert(target='MESH', '''keep_original=True''')
i would like two different scripts for each code.
code copied from
http://wiki.blender.org/index.php/Doc:2.6/Manual/Extensions/Python/FAQ
spiritech
_________________
live with the world as it is today and tomorrow the world is yours
open the Scripting screen, click on "+ New" and paste your code
note that you need to import e.g. bpy, while you don't have to in console
then click "Run script"
you may also have a look at the api docs and wiki to see how you can turn this into an addon
_________________
I'm sitting, waiting, wishing, building Blender in superstition...