# How can I access scene materials and material_slots in Blender 2,92 [duplicate]

I have a script, which works in version 2.90, in which I get a list of materials in the scene by accessing bpy.context.scene.material_slots and bpy.context.scene.materials. These don't seem to work in version 2.92. Did the location of the materials in the scene change and if so, how do I find them?

• AFAIK scene.material_slots and scene.material have never existed by default. Related blender.stackexchange.com/questions/141179/… Mar 20 at 1:05
• Thanks. I think I had based my code on that answer. Perhaps I did not apply it correctly and that is why my code worked in version 2.90 but not 2.92. I tried the example in that answer, and it does not seem to generate an error message in 2.92, but after a few minutes, Blender crashes. It happens consistently when I use it on an older (~7 years old) Windows 10 laptop.
– SJK
Mar 20 at 1:46
• I probably tried out the code you mentioned and then saved a startup.blend file with the custom properties, so when I changed startup.blend files, the properties disappeared. I have been trying to learn more about custom properties.
– SJK
Mar 20 at 2:56
• If you append an addon bl_info (see Text Editor > Templates > Python > Addon) at the top of script, could install it as an addon (+add innards to the unregister() method)` Mar 20 at 3:55