Log In
New Account
Home My Page Projects Blender 2.x BF release
Summary Activity Tracker SCM Files

Blender 2.6 Bug Tracker: Browse

[#25252] X3D Export does not specify ImageTexture to go with provided TextureCoordinate data

Date:
2010-12-16 21:02
Priority:
3
State:
Closed
Submitted by:
John Coady (jdc)
Assigned to:
Campbell Barton (campbellbarton)
Category:
Import/Export
Status:
Fixed / Closed
Relates to:
Duplicates:
Patches:
 
Summary:
X3D Export does not specify ImageTexture to go with provided TextureCoordinate data
Detailed description
I performed an Export to X3D of a blend file from within blender. The resulting X3D file provided TextureCoordinate and texCoordIndex data for a number of shapes but it did not provide the corresponding ImageTexture to go with the shape. For instance Export to X3D provided the following for an object in a blend scene.

<Transform DEF="basic_head" translation="2.261384 1.403721 -1.451316" scale="1.000000 1.000000 1.000000" rotation="-1.000000 0.000000 0.000000 2.035401">
<Shape>
<Appearance>
<Material DEF="MA_head_001" diffuseColor="0.8 0.591 0.465" specularColor="0.001 0.001 0.001" emissiveColor="0.0 0.0 0.0"
ambientIntensity="0.333" shininess="0.293" transparency="0.0" />
</Appearance>
<IndexedFaceSet solid="true" creaseAngle="0.524"
texCoordIndex="0, 1, 2, 3, -1, 4, 5, 6, 7, -1, 8, 9, 10, 11, -1,
coordIndex="1 17 3 2 -1, 4 18 1 2 -1, 3 17 15 5 -1, 16 18 4 6 -1,
<Coordinate DEF="coord_basic_head"
point="0.000000 -0.237473 0.048861, 0.000000 -0.247780 0.136251, 0.000000 -0.233152 0.240777,
<TextureCoordinate point="0.498 0.766, 0.522 0.768, 0.564 0.816, 0.498 0.836, 0.431 0.816, 0.473 0.768, 0.498 0.766, 0.498 0.836, 0.564 0.816,
</IndexedFaceSet>
</Shape>
</Transform>

But the ImageTexture in the Appearance node for the Shape is missing, even though the texCoordIndex and TextureCoordinate data is provided in the IndexedFaceSet for the Shape. Blender Export to X3D should be providing the ImageTexture if there is one available, something like this.

<Transform DEF="basic_head" translation="2.261384 1.403721 -1.451316" scale="1.000000 1.000000 1.000000" rotation="-1.000000 0.000000 0.000000 2.035401">
<Shape>
<Appearance>
<Material DEF="MA_head_001" diffuseColor="0.8 0.591 0.465" specularColor="0.001 0.001 0.001" emissiveColor="0.0 0.0 0.0"
ambientIntensity="0.333" shininess="0.293" transparency="0.0" />
<ImageTexture url='"../textures/07_face.jpg"'/>
</Appearance>
<IndexedFaceSet solid="true" creaseAngle="0.524"
texCoordIndex="0, 1, 2, 3, -1, 4, 5, 6, 7, -1, 8, 9, 10, 11, -1,
coordIndex="1 17 3 2 -1, 4 18 1 2 -1, 3 17 15 5 -1, 16 18 4 6 -1,
<Coordinate DEF="coord_basic_head"
point="0.000000 -0.237473 0.048861, 0.000000 -0.247780 0.136251, 0.000000 -0.233152 0.240777,
<TextureCoordinate point="0.498 0.766, 0.522 0.768, 0.564 0.816, 0.498 0.836, 0.431 0.816, 0.473 0.768, 0.498 0.766, 0.498 0.836, 0.564 0.816,
</IndexedFaceSet>
</Shape>
</Transform>

Attached is the blend file to recreate this bug. It was taken from the "Blender Foundations" book in chapter 9. When you export this blend file from the latest version of blender 2.55.1 you will see that many of the IndexedFaceSet nodes contain texture information but there is no corresponding texture file specified in the corresponding Appearance node.

I am using Blender Version 2.55.1 r33646

Followup

Message
  • Date: 2010-12-17 19:52
  • Sender: Campbell Barton
  • No file is attached, tagged as needing more info.

    At the moment x3d wont use material textures, only image textures assigned to each face while UV mapping. expect this is the problem.
  • Date: 2010-12-21 23:06
  • Sender: John Coady
  • When you are doing uv texturing like in this video

    http://www.youtube.com/watch?v=FI859_0-rrU

    an image is loaded for the texture and mapping coordinates is set to UV. When you do this, and then perform Export to X3D, the TextureCoordinate and texCoordIndex show up in the X3D file but the image that was loaded into the texture does not show up in the X3D file. The image to use for UV mapping should show up as ImageTexture in the X3D file under the Appearance node.

    <Appearance>
    <Material DEF="MA_head_001" diffuseColor="0.8 0.591 0.465" specularColor="0.001 0.001 0.001" emissiveColor="0.0 0.0 0.0"
    ambientIntensity="0.333" shininess="0.293" transparency="0.0" />
    <ImageTexture url='"../textures/07_face.jpg"'/>
    </Appearance>
  • Date: 2010-12-22 01:39
  • Sender: Campbell Barton
  • While it may seem an obvious problem there is too much chance for misinterpretation or differences in small details.

    Please include a blend file, even a cube which shows the problem, otherwise I may spend more time to redo the bug then fix it.
  • Date: 2010-12-22 06:14
  • Sender: John Coady
  • OK, I have attached a boxtex.blend file to demonstrate the problem. Also attached is the file d6.jpg which is the image being uv mapped. I performed an Export to x3d resulting in the file boxtex.x3d . This file does not contain the ImageTexture node. The file boxtex2.x3d is what I am expecting.
 

Attached Files:

Name Date Download
boxtex2.x3d 2010-12-22 06:14 Download
boxtex.x3d 2010-12-22 06:14 Download
d6.jpg 2010-12-22 06:14 Download
boxtex.blend 2010-12-22 06:14 Download

Changes:

Field Old Value Date By
StatusNew2010-12-22 11:45campbellbarton
status_idOpen2010-12-22 11:45campbellbarton
close_dateNone2010-12-22 11:45campbellbarton
summaryX3D Export does not specify ImageTexture to go with provided TextureCoordinate data *NEED MORE INFO*2010-12-22 11:45campbellbarton
File Added14203: boxtex.blend2010-12-22 06:14jdc
File Added14204: d6.jpg2010-12-22 06:14jdc
File Added14205: boxtex.x3d2010-12-22 06:14jdc
File Added14206: boxtex2.x3d2010-12-22 06:14jdc
summaryX3D Export does not specify ImageTexture to go with provided TextureCoordinate data2010-12-17 19:52campbellbarton
assigned_tonone2010-12-16 22:39campbellbarton