# How to get instanced object from particle system at location?

I need to check which object is instanced at a certain location. The particle system spawns a collection of objects either as is or with the “Use Count” feature.

At the moment I found a way to get the locations with animation nodes, but couldn’t find a way to find out which of the collection objects is being spawned at that location.

Mabye there is a way to do it in python?

Thanks for the help!

This question is asociated with another question of mine: How to get same hair particles from collection in second particle system/ or how to delete instanced particles without converting them to real meshes?

Found a python solution to get all the instances in the depsgraph. By filtering with "is_instance" you can get the names of the instance object that corespond with the source objects.

import bpy

context = bpy.context

dg = context.evaluated_depsgraph_get()

counter = 0
for i in dg.object_instances:
obj = i.object
print(obj.name)
if not i.is_instance:
print(f"Object {obj.name} at {i.matrix_world}")
else:
print(f"Instance of {obj.name} at {i.matrix_world}")
counter += 1
print(f"Len of instanced objects: {counter}")