Hello
!
It seems it’s been an issue over the years - naming material slots:
I reckon there has not been any movement on this? I have a scenario where it would be incredibly useful to be able to name or add metadata to slots so I tried to make this possible on my own.
As it sadly seems to be impossible to add properties to MaterialSlot directly I ended up storing a collection property with entries for each slot on the object.
This becomes tricky (and hacky!) when trying to keep slots and their meta in sync, as the user can of course add, remove and shift slot positions.
What I ended up doing is create operators for all these actions and overriding a bunch of blender UI operators (i.e. CYCLES_PT_context_material, EEVEE_MATERIAL_PT_context_material) and make them call my operator which then calls the original op (i.e. bpy.ops.object.material_slot_remove()).
But yes, this feels pretty terrible as there’s obviously many ways this can break: users without the addon doing stuff on a file or other scripts acting on the slots. And I suppose things will fall apart with every new blender version.
So I’m wondering if someone has an idea on how to solve this in a better fashion?
Is there some way to reference into the meta data rather than per index?
Thanks a lot in advance!
seb