I'm a new Blender user and just started trying python. I want to apply Mark freestyle edge to all objects in a collection with code instead of doing it manually.
If I have objects selected in object mode & used the code below it works:
import bpy for obj in bpy.context.selected_objects: bpy.ops.object.mode_set(mode='EDIT') bpy.ops.mesh.select_all(action='SELECT') bpy.ops.mesh.mark_freestyle_edge(clear=False)
I'll like to do the same but without having to select objects first. I found this but I can't combine them into one script.
import bpy col = bpy.data.collections.get("Collection_name") if col: for obj in col.objects: obj.select_set(state=True)