📋 Metadata
- Author: Way2Close
- Date: 2018-04-28 14:41:36
- Type:
answer - Reply to: post_01357
- Replies (1): post_01359
💬 Content
Leafar:
Hi, I forgot something or I don´t know… how can I add a modifier with the settings that I want?? We could do this, couldn´t we?? Feeling a bit lost… I want to add a stack key for adding wireframe modifier and then bevel modifier.
I would just do it this way:
import bpy
# loop through selected objects
for obj in bpy.context.selected_objects:
bpy.context.scene.objects.active = obj
# add wireframe and bevel modifiers
obj.modifiers.new("MyWireframe", type = "WIREFRAME")
obj.modifiers.new("MyBevel", type = "BEVEL")
# change parameters
bpy.context.object.modifiers["MyBevel"].segments = 4
It works for a whole selection then and you can just add as many parameter changes as you want 
Just run it in PME as an external script and you are good to go.