0

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?

SJK
  • 169
  • 1
  • 7
  • 1
    AFAIK scene.material_slots and scene.material have never existed by default. Related https://blender.stackexchange.com/questions/141179/how-to-populate-uilist-with-all-material-slot-in-scene-2-8/141207 – batFINGER Mar 20 '21 at 01: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 '21 at 01: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 '21 at 02:56
  • 1
    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)` – batFINGER Mar 20 '21 at 03:55

0 Answers0