Exporting wrl color in blender

Discussion in 'Software and Applications' started by sublimate, Jul 1, 2010.

  1. sublimate
    sublimate New Member
    I can export the "A" and the wrl file has the image information, but when i export the "R" (using the same material) the wrl file doesn't include the image. What am i doing wrong? Using Blender 2.49.
     

    Attached Files:

  2. Youknowwho4eva
    Youknowwho4eva Shapeways Employee Community Team
    Open the WRL with notepad. Go down to where it will say something like
    material DEF MA_Material Material {
    diffuseColor 1.0 1.0 1.0
    ambientIntensity 0.0666667
    specularColor 0.0004008 0.0004008 0.0004008
    emissiveColor 0.0 0.0 0.0
    shininess 0.2011719
    transparency 0.0

    Following that will be
    }
    }

    In between them put this

    }
    texture ImageTexture { url "yourfile.jpg" }
    }

    replacing yourfile, with your texture file.
     
  3. stannum
    stannum Well-Known Member
    In Blender, the best way is to delete the materials, but keep the UV mapping. Press F9, you should see "UV Texture ... New" with one named "UVTex" below (you can change this default name and use multiple maps but then you have to make sure the right one is active). That is what matters for image based .wrl and Shapeways.

    To clean up the render materials: delete them in F9 where it says 1 Mat 1, it should say 0 Mat 0, so press the button Delete that's below. And F5 buttons should show no materials linked, if you did it right. Then exporter will work without any manual tweaks about materials.

    These're the lines I got when exporting your .blend, which is wrong:

    Code:
    ...
    appearance Appearance {
     material DEF MA_Material Material {
       diffuseColor 1.0 1.0 1.0
       ambientIntensity 0.1666667
       specularColor 0.0008008 0.0008008 0.0008008
       emissiveColor  0.0 0.0 0.0
       shininess 0.9980469
       transparency 0.0
     }
    }
    ...
    appearance Appearance {
     material USE MA_Material
     texture DEF charmpic5_jpg ImageTexture {
      url "charmpic5.jpg"
     }
    }
    ...
    With your .blend I think it works for one object because it puts a material definition in one object and a reference to it (instead of the full material def again) plus the image in the other object, and Shapeways ignores that reference.

    Youknowwho4eva suggests to fix it by hand, but if you do it right in Blender it should show:

    Code:
    ...
    appearance Appearance {
     texture DEF charmpic5_jpg ImageTexture {
      url "charmpic5.jpg"
     }
    }
    ...
    appearance Appearance {
     texture DEF charmpic5_jpg ImageTexture {
      url "charmpic5.jpg"
     }
    }
    ...
    I tried exporting it to verify, but it failed. Only one letter has image (the other has empty appearance block)... which leads us to another thing you've to do: select the R, enter edit mode and select vertices, select the image in image window so the vertices are associated to it.

    So summing up: no render materials linked (in F9, 0 Mat 0), right UV texture active (F9 again, one UV Texture at least, it'll be created when you unwrap if needed), all faces associated to images (image area shows right one while you select things in edit mode).
     
  4. sublimate
    sublimate New Member
    Got it working. Thanks for the help.