# Can a image be render on planes through scripting?

Setup: Blender 2.82

I have multiple images that i take from a CNN and i want to put on planes

I tried like this:

mat = bpy.data.materials.new(name='test')
mat.use_nodes = True
bsdf = mat.node_tree.nodes["Principled BSDF"]

bpy.context.active_object.name = 'plane'
plane = bpy.context.object

if plane.data.materials:
plane.data.materials[0] = mat
else:
plane.data.materials.append(mat)


How can the image be loaded from an numpy array of pixels ?

Additionally to this, does the image added to the plane needs to respect some format?

• That's because it's called ShaderNodeTexImage. – Robert Gützkow Apr 9 at 14:58
• Thanks for noticing, i updated the question – cUser Apr 9 at 15:14