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?

  • $\begingroup$ try pressing I over the Eye Icon of the Modifier $\endgroup$ – HenrikD Nov 8 '17 at 10:35
  • $\begingroup$ sorry I dont know Animation Nodes but that would be the way I would try to do it $\endgroup$ – HenrikD Nov 8 '17 at 10:37
  • $\begingroup$ No that´s not the case. Needs to be added dinamically $\endgroup$ – Jorge Losilla Martínez Nov 8 '17 at 10:41
  • $\begingroup$ but it would be not effectively there if you hide it. That was my thought $\endgroup$ – HenrikD Nov 8 '17 at 10:51

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

  • $\begingroup$ Great!!! This was what I was looking for. $\endgroup$ – Jorge Losilla Martínez Nov 8 '17 at 13:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.