+ if o.data.use_shadow:
+ self.use_shadow = True
+
+ for i in scene.view_layers[0].depsgraph.object_instances:
+ if i.is_instance and i.object.type=='MESH':
+ self.add_instance(i, bpy.data.objects[i.object.name], proto_map)
+
+ def add_instance(self, obj, proto_obj, proto_map):
+ prototype = proto_map.get(proto_obj)
+ if not prototype:
+ for p in proto_map.values():
+ if is_same_object(proto_obj, p.object):
+ prototype = p
+ break
+
+ if not prototype:
+ prototype = ObjectPrototype(proto_obj)
+ self.prototypes.append(prototype)
+
+ proto_map[proto_obj] = prototype
+
+ instance_list = self.instances
+ if proto_obj.material_slots and proto_obj.material_slots[0].material:
+ mat = proto_obj.material_slots[0].material
+ if mat.blend_method=='BLEND':
+ instance_list = self.blended_instances
+ if mat.image_based_lighting:
+ self.use_ibl = True
+ if mat.instancing:
+ prototype.use_array = True
+
+ instance = ObjectInstance(obj, prototype)
+ instance_list.append(instance)
+ prototype.instances.append(instance)