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?

  • 1
    $\begingroup$ AFAIK scene.material_slots and scene.material have never existed by default. Related blender.stackexchange.com/questions/141179/… $\endgroup$
    – batFINGER
    Mar 20 at 1:05
  • $\begingroup$ 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. $\endgroup$
    – SJK
    Mar 20 at 1:46
  • $\begingroup$ 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. $\endgroup$
    – SJK
    Mar 20 at 2:56
  • 1
    $\begingroup$ 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)` $\endgroup$
    – batFINGER
    Mar 20 at 3:55

Browse other questions tagged or ask your own question.