Can't import model with color

Discussion in 'Software and Applications' started by Demyx, Jan 29, 2014.

  1. Demyx
    Demyx New Member
    Hi all,

    I have a little problem right now. I'm using Blender 2.6.2, and I'm trying to export a model I was given so that it will display in color for the sandstone option.

    It has UV texture mapping, however, every time I save it to .STL or .VRML 97 (not VRML 1!) it either uploads without the color or, when zipped, gives me an error.

    The only other thing I should mention is that the model seems to be 'linked' to several textures, including some unneeded ones too that belong to other models in the folder. I've tried a few online tutorials, following them step by step but for one reason or another I can't seem to link it to just the one texture. If I move/rename the texture then regardless of where the model is saved, I lose the texture completely. Similarly, even when I redirect Blender to the correct file - It just flat out will not let me apply it.

    I don't know a huge deal about Blender, as I'm only just starting to understand the basics. But if anyone could help me with this, it would be much appreciated.
  2. mkroeker
    mkroeker Well-Known Member
    1. STL format can not contain color or texture information.
    2. Make sure that you use one of the supported file formats for your texture - GIF, PNG or JPEG, but not BMP or TIFF.
    3. VRML97/VRML2/X3D files are plain text files. You can open them in a text editor and look for the ImageTexture entries that contain the names of your texture files - make sure these are the expected files, and that the names do not contain any folder or windows drive letter information.
    4. Preview the VRML97 file with a VRML viewer such as view3dscene
  3. Demyx
    Demyx New Member

    Thanks very much for your response.

    I've saved it in VRML97, but unfortunately the texture still disappears when I open it in view3dscene (which is a very handy little program - Thank you for suggesting it).

    Here's what my file reads when opened (as close to relevance):

    material DEF MA_Grey_snowleo-_png Material
    diffuseColor 0.4 0.3 0.4
    ambientIntensity 0.1678767
    specularColor 0.1213408 0.363608 0.3282908
    emissiveColor 0.0 0.0 0.0
    shininess 0.0012551
    transparency 0.0

    There's no links to the computer drive, and the texture file (snowleo-.png) is in the same folder as the model. The .OBJ which also resides there seems to have no trouble accessing the texture, so I don't believe the texture file is corrupt.

    However, there doesn't seem to be any sign of 'ImageTexture' anywhere in the text file - Should I add it manually? If so, whereabouts would I place it?

    If it matters any, I tell Blender not to compress the VRML97 file when saving.
  4. mkroeker
    mkroeker Well-Known Member
    Blender appears to have retained only the name of your file, using it as the label for a uniform grayish color. I guess there are some "texture-baking" options in blender that need to be applied for textured models to be exported correctly.
    You could try replacing everything from "diffuseColor" to "transparency" with just

    texture ImageTexture { url "snowleo-.png" }

    but the orientation of your texture might be incorrect.
  5. Demyx
    Demyx New Member
    Unfortunately that didn't work either!

    But thanks very much for all your help. After what you just wrote, I had a look online, and it does appear that Blender requires them to be Baked for VRML exports. Looks like I'll have to find a tutorial on that.

    Once again, many thanks!