Post #3421: len counts the amount of things that are in a certain group, in this case len is

πŸ“‹ Metadata

🏷️ Tags

scripting beginner solved

  • Python Scripting
  • Macro Editor

πŸ’¬ Content

len counts the amount of things that are in a certain group, in this case len is counting the amount of current modifiers in the specific object. I’m using len to get the last slot of the modifiers that’s why the -1, since the slots start at 0 im getting the numbers of modifiers and subtracting 1 to get it.

If you have 2 modifiers you can use C.object.modifiers[0] or C.object.modifiers[1] to access each of them, and if you add a third modifier you would be able to access it with C.object.modifiers[2] or C.object.modifiers[len(C.object.modifiers)-1]


πŸ”— View on Blender Artists