0
$\begingroup$

Setup : Blender 2.82

I want to achieve something similar to what was represented below but through a python script.

If each cube here represents a pixel, what is the fastest way to change its color so it looks exactly like the 2d image?

  1. I wonder if it is possible to put there an actual RGB photo and not just a number?
  2. I am also curios if i can map on a face of an cube a full image like a feature map from a tensorflow model ?

Here is the code that i have atm for creating cubes at different location in different collections

def createCubes(x,y,z, name):
  collection = bpy.data.collections.new(name= name) 
  bpy.context.scene.collection.children.link(collection) 
  k = 0
  l = 0
  for i in range(0,int(z)):
      for j in range(0, int(x)):
        bpy.ops.mesh.primitive_cube_add(location=(k, y,  l ))
        bpy.context.active_object.name = 'cube'
        cube = bpy.context.object
        for ob in cube.users_collection[:]: 
            ob.objects.unlink(cube)
        collection.objects.link(cube) 
        k= k+3
      l = l + 3
      k = 0
$\endgroup$

1 Answer 1

-1
$\begingroup$

you have to use opencv a python library for image processing so that you can map a full image.

$\endgroup$
1
  • $\begingroup$ Could you give an example of use? $\endgroup$ Commented Apr 5, 2020 at 10:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .