Please login or register.

Login with username, password and session length
Advanced search  

News:

IRC channel - server: waelisch.de  channel: #wme (read more)

Author Topic: blender export no texture  (Read 4640 times)

0 Members and 1 Guest are viewing this topic.

fireside

  • Supporter
  • Regular poster
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 211
    • View Profile
blender export no texture
« on: October 17, 2007, 12:30:39 AM »

I'm doing a test export from blender to direct x.  The model is fine as long as I uncheck flip z, but there is no texture.  I'm experimenting with another engine also (irrlicht) and that one shows the texture. 
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: blender export no texture
« Reply #1 on: October 17, 2007, 04:16:51 PM »

How does the generated X file reference the textures? With or without path? WME assumes the textures are in the same directory where the model is. Also, is it a static model or does it use bones?
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

raychaser

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 16
    • View Profile
Re: blender export no texture
« Reply #2 on: October 17, 2007, 04:59:46 PM »

Hi guys,

This is actually a bug with the blender export script. fireside, open your script and scroll down to the material section. I think you'll find that all the materials have the same name

I've got this and a couple of other things fixed already. I'm hopefully going to release a fixed version of this script in the next day or two. I'll post it here when I'm done. In the meantime just give your materials in the .x file different names and that should solve it,

addendum: I should mention that this is only in the case of multiple textures mapped to a single mesh. In any case if you again open the .x file and scroll down to the materials section you should see the filename for the texture. Just make sure it points to the right place and that the file exists. Remember that if there is no "c:\*****\****" in front of it and it is only "image.jpg" then the image needs to be in the same folder as the .x file (of course you probably already knew that but I mention it for completeness)
« Last Edit: October 17, 2007, 05:05:57 PM by raychaser »
Logged

fireside

  • Supporter
  • Regular poster
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 211
    • View Profile
Re: blender export no texture
« Reply #3 on: October 17, 2007, 06:26:13 PM »

Code: [Select]
  Material Material {
    0.800000; 0.800000; 0.800000;1.0;;
    0.500000;
    1.000000; 1.000000; 1.000000;;
    0.0; 0.0; 0.0;;
  }  //End of Material
  Material Mat1 {
    1.0; 1.0; 1.0; 1.0;;
    1.0;
    1.0; 1.0; 1.0;;
    0.0; 0.0; 0.0;;
  TextureFilename {    "brownSpots.jpg";  }
  }  // End of Material
    }  //End of MeshMaterialList

This is the material section.  I put the file brownSpots.jpg (it was a texture from an old mushroom of mine all right?) in the same file.  It was a reworked teapot with the new x file in the path.  I put the jpg with the x file in wme.   I've tried two textures so far and it hasn't named them the same.  I've been only experimenting with a static model so far.
« Last Edit: October 17, 2007, 06:31:36 PM by fireside »
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: blender export no texture
« Reply #4 on: October 18, 2007, 09:41:57 AM »

Can you try converting it to skinned model? Like, for example, just including one bone and assigning all vertices to it for starters. If I remember correctly someone was having material problems when exporting boneless models from Blender.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

fireside

  • Supporter
  • Regular poster
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 211
    • View Profile
Re: blender export no texture
« Reply #5 on: October 18, 2007, 02:53:47 PM »

Ok, I'll give it a try.
Logged

fireside

  • Supporter
  • Regular poster
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 211
    • View Profile
Re: blender export no texture
« Reply #6 on: October 18, 2007, 03:21:26 PM »

same results.  Here's the whole file, it's just a box with one bone and one action:
Code: [Select]
xof 0303txt 0032


template VertexDuplicationIndices {
 <b8d65549-d7c9-4995-89cf-53a9a8b031e3>
 DWORD nIndices;
 DWORD nOriginalVertices;
 array DWORD indices[nIndices];
}
template XSkinMeshHeader {
 <3cf169ce-ff7c-44ab-93c0-f78f62d172e2>
 WORD nMaxSkinWeightsPerVertex;
 WORD nMaxSkinWeightsPerFace;
 WORD nBones;
}
template SkinWeights {
 <6f0d123b-bad2-4167-a0d0-80224f25fabb>
 STRING transformNodeName;
 DWORD nWeights;
 array DWORD vertexIndices[nWeights];
 array float weights[nWeights];
 Matrix4x4 matrixOffset;
}

Frame RootFrame {

  FrameTransformMatrix {
    1.000000,0.000000,0.000000,0.000000,
    0.000000,0.000000,-1.000000,0.000000,
    0.000000,1.000000,0.000000,0.000000,
    0.000000,0.000000,0.000000,1.000000;;
  }
Frame Cube {

  FrameTransformMatrix {
    1.000000,0.000000,0.000000,0.000000,
    0.000000,1.000000,0.000000,0.000000,
    0.000000,0.000000,1.000000,0.000000,
    0.021700,0.749200,0.000000,1.000000;;
  }
Mesh {
24;
1.000000; 1.000000; -1.000000;,
1.000000; -1.000000; -1.000000;,
-1.000000; -1.000000; -1.000000;,
-1.000000; 1.000000; -1.000000;,
1.000000; 1.000000; 1.000000;,
-1.000000; 1.000000; 1.000000;,
-1.000000; -1.000000; 1.000000;,
1.000000; -1.000000; 1.000000;,
1.000000; 1.000000; -1.000000;,
1.000000; 1.000000; 1.000000;,
1.000000; -1.000000; 1.000000;,
1.000000; -1.000000; -1.000000;,
1.000000; -1.000000; -1.000000;,
1.000000; -1.000000; 1.000000;,
-1.000000; -1.000000; 1.000000;,
-1.000000; -1.000000; -1.000000;,
-1.000000; -1.000000; -1.000000;,
-1.000000; -1.000000; 1.000000;,
-1.000000; 1.000000; 1.000000;,
-1.000000; 1.000000; -1.000000;,
1.000000; 1.000000; 1.000000;,
1.000000; 1.000000; -1.000000;,
-1.000000; 1.000000; -1.000000;,
-1.000000; 1.000000; 1.000000;;
6;
4; 0, 1, 2, 3;,
4; 4, 5, 6, 7;,
4; 8, 9, 10, 11;,
4; 12, 13, 14, 15;,
4; 16, 17, 18, 19;,
4; 20, 21, 22, 23;;
  MeshMaterialList {
    2;
    6;
    1,
    1,
    1,
    1,
    1,
    1;;
  Material Material {
    0.800000; 0.800000; 0.800000;1.0;;
    0.500000;
    1.000000; 1.000000; 1.000000;;
    0.0; 0.0; 0.0;;
  }  //End of Material
  Material Mat1 {
    1.0; 1.0; 1.0; 1.0;;
    1.0;
    1.0; 1.0; 1.0;;
    0.0; 0.0; 0.0;;
  TextureFilename {    "brownSpots.jpg";  }
  }  // End of Material
    }  //End of MeshMaterialList
  MeshNormals {
24;
    0.577349; 0.577349; -0.577349;,
    0.577349; -0.577349; -0.577349;,
    -0.577349; -0.577349; -0.577349;,
    -0.577349; 0.577349; -0.577349;,
    0.577349; 0.577349; 0.577349;,
    -0.577349; 0.577349; 0.577349;,
    -0.577349; -0.577349; 0.577349;,
    0.577349; -0.577349; 0.577349;,
    0.577349; 0.577349; -0.577349;,
    0.577349; 0.577349; 0.577349;,
    0.577349; -0.577349; 0.577349;,
    0.577349; -0.577349; -0.577349;,
    0.577349; -0.577349; -0.577349;,
    0.577349; -0.577349; 0.577349;,
    -0.577349; -0.577349; 0.577349;,
    -0.577349; -0.577349; -0.577349;,
    -0.577349; -0.577349; -0.577349;,
    -0.577349; -0.577349; 0.577349;,
    -0.577349; 0.577349; 0.577349;,
    -0.577349; 0.577349; -0.577349;,
    0.577349; 0.577349; 0.577349;,
    0.577349; 0.577349; -0.577349;,
    -0.577349; 0.577349; -0.577349;,
    -0.577349; 0.577349; 0.577349;;
6;
4; 0, 1, 2, 3;,
4; 4, 5, 6, 7;,
4; 8, 9, 10, 11;,
4; 12, 13, 14, 15;,
4; 16, 17, 18, 19;,
4; 20, 21, 22, 23;;
}  //End of MeshNormals
MeshTextureCoords {
24;
0.000000;-1.000000;,
0.000000;0.000000;,
1.000000;0.000000;,
1.000000;-1.000000;,
0.000000;-1.000000;,
0.000000;0.000000;,
1.000000;0.000000;,
1.000000;-1.000000;,
0.000000;-1.000000;,
0.000000;0.000000;,
1.000000;0.000000;,
1.000000;-1.000000;,
0.000000;-1.000000;,
0.000000;0.000000;,
1.000000;0.000000;,
1.000000;-1.000000;,
0.000000;-1.000000;,
0.000000;0.000000;,
1.000000;0.000000;,
1.000000;-1.000000;,
0.000000;-1.000000;,
0.000000;0.000000;,
1.000000;0.000000;,
1.000000;-1.000000;;
}  //End of MeshTextureCoords
 }
}
}

Logged

fireside

  • Supporter
  • Regular poster
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 211
    • View Profile
Re: blender export no texture
« Reply #7 on: October 21, 2007, 03:13:37 AM »

I upgraded to Blender 2.45 and the texture is showing up now.  I'm not positive if I did something different or it's the upgrade.  Anyway, it's a start.
Logged
 

Page created in 0.044 seconds with 20 queries.