How to get the material of an object in Animation Nodes?

Hi,
there seems to be no Object Material Input node in animation nodes, so how can I assign the materials of 1000 objects to 1000 instanced objects individually (I have to link the materials to object instead of data, so Copy Material to Selected does not work)? Doing it by hand is no fun.

1 Like

In case it’s still relevant, you can get a material linked to an object with an object attribute input node in animation nodes. I’m using AN 2.1.4 with Blender 2.81 Alpha from buildbot, but it should be the same for Blender 2.80 I guess.

Instead of the name of the material, as in material_slots[“mat1”].material, you can also use the index of the material slot, like so: material_slots[0].material, for the first slot.