I have a .obj file that specifies a partially textured object. More specifically, not all vertices have UV coordinates (that is, I have more v entries than vt entries in my .obj).

The face entries f look like this.

f 2045/631 2164/742 2119/700
f 2119/700 2164/742 2165/743
f 2259/834 2120/701 2165/743
f 2165/743 2120/701 2119/700
f 2260 2261 2259
f 2259 2261 2120
f 2205 2262 2124

As you can see, some faces are textured, while others are not.

My model looks reasonable in MeshLab -- it has some faces with texture and some textureless faces.

However, when I import the .obj file into Blender, the faces that are supposed to be textureless have a texture, which is the entire texture map. Why is this happening, and how can I stop this behavior?

  • 1
    $\begingroup$ I think that is blender's way of "resetting" a uv map. I would grab all the untextured faces and set their uvs to be collapsed on a single point on whatever software you used to make the mesh. I can't think of any simple solution since the blender obj importer is fairly simple with not many options. $\endgroup$ Mar 28 '17 at 0:57
  • $\begingroup$ @SebastiánMestre Thanks! I see. Probably I will just set the untextured face's UV to (0, 0)? Let me try it now. $\endgroup$ Mar 28 '17 at 1:00
  • $\begingroup$ @SebastiánMestre This kinda works in the sense that the untextured faces are uniform now, but they are of a certain color, the color of the point where I set their UV to... It would be wonderful if there is a better solution, but your solution is really handy. Thanks mate! $\endgroup$ Mar 28 '17 at 1:12
  • 1
    $\begingroup$ No problem! i had the same problem a few months ago. A dirty fix for that new problem would be to have a few white pixels on your image and place the UVs there. Not very elegant and it adds some extra work but it's better than having half of your mesh be red (or whatever color the point where the uvs are is). I tend to keep the background of WiP textures white so it is not an extra step for me but "your mileage might vary" $\endgroup$ Mar 28 '17 at 1:24
  • $\begingroup$ @SebastiánMestre Maybe you could write a quick answer that I can mark accepted? Would love to help more people. :-D $\endgroup$ Mar 28 '17 at 1:28

My solution to this would be to move all the uv coordinates of the non uv-mapped faces to the very same point.

Having a few pixels set to the color that you want your mesh to be and putting your uvs there instead can be a way to get rid of unwanted colors.

  • $\begingroup$ Say, I want my untextured faces white. How many pixels need setting to white? Currently I am only setting one corner pixel white and set untextured vertices to that pixel. However, the untextured faces don't look like white... I'm wondering maybe I need to set more pixels white? $\endgroup$ Mar 28 '17 at 14:48
  • 1
    $\begingroup$ I think setting the 4 pixels on each corner of the image to be white should do it $\endgroup$ Mar 28 '17 at 18:31
  • $\begingroup$ And setting untextured vertices to be all at one corner? Why does this work? Intuitively, I think this is because the interpolation at the corner wraps around the other corners? But why 4 pixels? $\endgroup$ Mar 28 '17 at 18:36
  • 1
    $\begingroup$ Yep, that is exactly why. The uv coordinate (0,0) doesn't quite match up with the coordinate of the pixel at the corner, the pixel data is actually mapped half a pixel away from the corner on eaxh axis. So when it fetches that texture what it gets is the interpolated value for the color between the 4 corner pixels, instead of a single one $\endgroup$ Mar 28 '17 at 18:42
  • 1
    $\begingroup$ You can also set your uv coordinate to (1/width , 1/height) to make it match up with a single pixel $\endgroup$ Mar 28 '17 at 18:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.