2

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?

batFINGER
  • 84,216
  • 10
  • 108
  • 233

1 Answers1

4

The only way to do this is by using scripting, there are three important points to take into consideration when making this:

  1. Make sure not to add the modifier if it was already added in a previous execution.
  2. Output the input object and plug it into the attribute output node, making sure you are not editing a modifier before it gets added.
  3. 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

Node Tree

Omar Emara
  • 22,639
  • 5
  • 55
  • 103