To add modifiers dynamically, I know that one can modify values of existing modifier via attribute output node. Can this node be used to create modifiers or does it need some sort of scripting?
The only way to do this is by using scripting, there are three important points to take into consideration when making this:
- Make sure not to add the modifier if it was already added in a previous execution.
- Output the input object and plug it into the attribute output node, making sure you are not editing a modifier before it gets added.
- The modifier name should never be an empty text because then blender will automatically add a name and our first test will fail, so we should set a fallback value.
Making sure we got those three points right, we can write a code like this:
modifierName = modifierName if modifierName != "" else "Fallback" if not modifierName in object.modifiers: object.modifiers.new(modifierName, 'ARRAY') outObject = object