Post #3421: len counts the amount of things that are in a certain group, in this case len is
π Metadata
- Author: noKeyframes
- Date: 2020-07-05 15:49:22
- Type:
answer - Quality Score: 7/10
- Reply to: post_03420
π·οΈ Tags
βοΈ Related PME Features
- 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]