I need to add Edge Split to a whole lot of objects, I already have something:
import bpy
for i in bpy.context.selected_objects:
# Select object:
bpy.ops.object.select_name(name=i.name)
# Add modifier:
bpy.ops.object.modifier_add(type='EDGE_SPLIT')
But this adds as many edge split modifiers as there are objects selected.
Now the problem would be fixed, if I knew how to check if the object already has the given modifier.
Thanks that works, and another question, I need to apply transform (rotation and scale) to all the objects, but when I run bpy.ops.object.transform_apply(False, True, True), in the console/terminal I get:
Traceback (most recent call last):
File “/home/username/downloads/File.blend/add_edge_split.py”, line 8, in <module>
File “/home/crimson/software/blender-2.58a/2.58/scripts/modules/bpy/ops.py”, line 176, in call
C_dict, C_exec = class._parse_args(args)
File “/home/username/software/blender-2.58a/2.58/scripts/modules/bpy/ops.py”, line 133, in _parse_args
raise ValueError(“1 or 2 args execution context is supported”)
ValueError: 1 or 2 args execution context is supported