1
$\begingroup$

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

$\endgroup$
4
  • $\begingroup$ Hi, no idea :D but i just want to ask for what reason you want to achive this? $\endgroup$
    – Fowl
    Feb 12, 2021 at 7:35
  • $\begingroup$ it's for a personal project of importing individual parts without textures $\endgroup$
    – EDllT
    Feb 12, 2021 at 7:41
  • $\begingroup$ Would be enough for you to convert image texture into vertex / face color? Like here blender.stackexchange.com/a/41677/2214 $\endgroup$
    – vklidu
    Feb 12, 2021 at 8:19
  • $\begingroup$ blender.stackexchange.com/a/157784/2214 $\endgroup$
    – vklidu
    Feb 12, 2021 at 8:21

1 Answer 1

0
$\begingroup$

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.
$\endgroup$
6
  • $\begingroup$ 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 $\endgroup$
    – EDllT
    Feb 12, 2021 at 11:51
  • $\begingroup$ Do you need OBJ? Or you can export as PLY with vertex color and with MeshLab export as OBJ with vertex color blender.stackexchange.com/a/200782/2214 BTW $\endgroup$
    – vklidu
    Feb 12, 2021 at 14:26
  • 1
    $\begingroup$ 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 ... $\endgroup$
    – vklidu
    Feb 12, 2021 at 14:29
  • $\begingroup$ Here is a script that bakes Normals to "per-face vertex color" blender.stackexchange.com/a/27752/2214 so probably someone can modify it for UV image? I asked for you blender.stackexchange.com/questions/211578/… $\endgroup$
    – vklidu
    Feb 12, 2021 at 18:56
  • $\begingroup$ 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 $\endgroup$
    – EDllT
    Feb 13, 2021 at 0:02

You must log in to answer this question.

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