2
$\begingroup$

I am trying to apply a UV mapped texture to an object and export it in the Collada format. The result is not what I designed in Blender. Here's the simplest procedure that shows what I did.

  1. Start with the blank file and add a cube mesh.
  2. Select texture viewport shading.
  3. Unwrap the cube mesh (Smart UV Project). enter image description here
  4. In UV/Image Editor, open random image.
  5. Position and scale islands so that the image is only on one side of the cube (that's how I want it).

The texture is now repeated on all sides of the cube in the viewport. enter image description here

From this point on, I have three choices.

Don't assign any material

  1. Export to Collada.
  2. Cube is grey when viewed in MeshLab. No material, no texture, nothing. And that's fine.

enter image description here

Assign the material

  1. Assign a new material to the cube (it did not have a material before). enter image description here
  2. Without changing any material properties, export to Collada. Or do make changes, the result is the same.
  3. Cube is black with texture applied and repeated.

enter image description here

Why is there any texture on the cube when the material doesn't have any textures by itself?

Assign the material and the texture

  1. Assign new material to the cube.
  2. Add new texture, set it as image, load the same image as texture as when doing UV mapping.
  3. Image Mapping > Extension, set to Clip.
  4. Mapping > Coordinates, set to UV.
  5. Mapping > Map, set to UVMap (only choice available). enter image description here
  6. Observe that none of the changes made make any difference in viewport (in render, however, they do).
  7. Export to Collada.
  8. Cube is black with texture applied and repeated (same as before).

Collada model represents what is viewed in the viewport, and none of the changes made in material/texture after making UV mapping get reflected on the exported model. How to get them exported?

Notes

  1. Using Blender 2.69 with Blender Render.
  2. When exporting to Collada:
    • Include UV Textures is checked.
    • Include Material Textures is checked.
$\endgroup$
2
$\begingroup$

If you read the Collada specification you will find that is uses a very complex way of doing materials. Basically materials and textures are treated separately.

"...Why is there any texture on the cube when the material doesn't have any textures by itself?..:" - Because any texture can be proyected onto any surface with Collada's sampler objects. When you applied the material, the texture was already set to wrap around your cube. Remember that the material is nothing but a set of properties for shading, and it may or may not include textures in them, but it's not mandatory as you can see.

"...How to get them exported?..." - I'm not sure I understood what you are trying to do. if you want the texture on just one face, unwrap that face only. If you still need to unwrap the whole thing, scale it to 0.25 or so, then offset it (those transforms will be ported to Collada).

So you need that your UV's keep the original 1:1 size, just adjust the texture, not the UV's. Remember that Collada is an exchange format, but it's not magical. You have to adjust your workflow to it.

$\endgroup$
2
$\begingroup$

As far as I know Collada (and most other export formats for that matter) concern themselves mostly with exporting geometry, UV's and some times animations and constraints, not materials or textures.

Materials are very tied to the rendering system they belong to and can't generally be easily exported between applications apart from some basic properties.

Whatever changes you make to your material and/or texture settings are not at all guarantied to be correctly exported, and will most often get lost, many of them are (as you already stated) not even supported as in the viewport as rendered preview (like the clipping setting).

Now I do not know Collada export very well, nor do I know MeshLab software, but if you want your texture to show up in one face alone I'd advise either to use a different material for that face, or to unrwap your mesh accordingly, having in mind that by default all textures will tile infinitely.

That probably means setting the UVs for the faces that should have no texture to 0,0 like for example scaling them down to one corner of the UV editor.

For any other more complex material properties it's probably better to do it in meshlab or whatever final destination application you will be using.

Also see .fbx export why there are no materials or textures?

$\endgroup$

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.