I'm tying to write a little spript that adds a material modifier to all selected objects and sets its ID.
After stealing ideas from Lele's One liner thread, the macro recorder and a little bit chat gpt I got this:

Which works very good, if there is only one object selected. When I select multible objects i get:

Needless to say I dont really have a clue of what Im doing here.
I can't be far off but im kinda stuck now and I need this to work, I have to set material id's for >100k objects.
for some reason the forum doesent like if i write code in here even in the [ Code ] tag. I allways get a 403 error... so I posted images. Sorry for that
After stealing ideas from Lele's One liner thread, the macro recorder and a little bit chat gpt I got this:
Which works very good, if there is only one object selected. When I select multible objects i get:
Needless to say I dont really have a clue of what Im doing here.
I can't be far off but im kinda stuck now and I need this to work, I have to set material id's for >100k objects.
for some reason the forum doesent like if i write code in here even in the [ Code ] tag. I allways get a 403 error... so I posted images. Sorry for that

Comment