I work on some system that generates objects in spatial configurations using Blender. I have a few samples of objects (.blend) file (e.g., cube, cylinder, sphere) and they work fine on my system. I tried to create more objects like: bottle, cup, toy, etc, and I follow tutorials on youtube but I always get errors when using them with python. One of these common errors is:
AttributeError: ‘AreaLamp’ object has no attribute ‘vertices’
This is particularly related to some code that loops over objects in the scene and use the vertices information of each object in order to calculate the centroid. So I can estimate that there is a problem in accessing vertex information.
Despite the fact that I compare the new blender files attentively to those that work well in the system, I have the same parameters in both but they always raise errors.
I attach a link to a new object (Cone) that I created which raised this error: Cone
VS
an original .blend file for an object (Sphere) which works in my python system without any problem: Sphere
So what is missing that makes the (Cone) object raises this error? Why isn't the vertex information accessible?
mesh_objects_in_scene = [o for o in scene.objects if o.type == 'MESH']
If you are iterating over all objects in blend filebpy.data.objects
then an object need not be linked to scene IMO Please add code to q rather than rely on others downloading blend files. Did you write the code? $\endgroup$