1

Okay so, to be exact

Every model is made up of triangles right? then when you add a texture to the model, the texture wraps around the model and becomes textured Now what I want to do is get each triangle and get the texture applied to each triangle and then set it to the average of the texture colors

so let's say there's a triangle which has red and yellow texture now what will happen is that the orange and yellow will convert into the average of both of them and then turn into a material so if I load in the model without the texture, i'll still see that there's some representation of a texture

of course, I could assign the color to each triangle individually but that'd be a really long and painful process considering that the meshes are made up of thousands of faces and more

note: forgot to say earlier, im planning on exporting it as .OBJ

enter image description here

EDllT
  • 23
  • 3

1 Answers1

0

It is not what did you ask for, but might be helpful. Add-on Bake to Vertex Color takes image texture with UV map coordinates and creates (bake) colors into vertex color (you can find it under Data Properties > Vertex Color. It doesn't take an average, but certain pixel under vertex.

enter image description here

enter image description here

enter image description here

Note:

  • To generate average color usually ends with a braun color :)
  • There can be also stored color per face instead vertex, but I'm not experienced with that.
vklidu
  • 36,165
  • 1
  • 61
  • 135
  • This is very similar to what I wanted but instead of vertex color, is it possible to make it something like materials? since vertex colors don't pass through when exported as .obj – EDllT Feb 12 '21 at 11:51
  • Do you need OBJ? Or you can export as PLY with vertex color and with MeshLab export as OBJ with vertex color https://blender.stackexchange.com/a/200782/2214 BTW – vklidu Feb 12 '21 at 14:26
  • 1
    If OBJ cant export vertex color I would say Face color would be the same, it means you would have to generate material per face = with object consist of 100 faces you will export object with 100 materials? It doesn't sounds good ... – vklidu Feb 12 '21 at 14:29
  • Here is a script that bakes Normals to "per-face vertex color" https://blender.stackexchange.com/a/27752/2214 so probably someone can modify it for UV image? I asked for you https://blender.stackexchange.com/questions/211578/per-face-vertex-color-from-image-texture – vklidu Feb 12 '21 at 18:56
  • well, the materials don't need to be 100% accurate They should just be like colored enough to be able to represent the following model also, the models that I have consist of 1.7k faces only – EDllT Feb 13 '21 at 00:02
  • But you don't want to use a image texture right? So there is only to use per-face vertex color or assign material per face ... in your case 1.7k materials that I even know if that is possible. Any of this solution is not about accuracy. I'm thinking if it isn't a naming confusion between us. – vklidu Feb 14 '21 at 16:15