MasterFlu Posted May 18, 2012 Share Posted May 18, 2012 Hi. i have got a question. when i add an object to my world i have to export it as .x file. but when i compile it in XNA i get the following mistake: Fehler 1 Missing Asset ...\WP7\3D World Studio\Test3DW\Test3DW\Test3DWContent\sonstiges\brick". ...\WP7\3D World Studio\Test3DW\Test3DW\Test3DWContent\sonstiges\box_wood_open.x Test3DW and here is the mistake in the .x. the following is only a part of the whole .X Material material_2 { 1.0;1.0;1.0;1.0;; 11.3137; 1.0;1.0;1.0;; 0.0;0.0;0.0;; TextureFilename { "brick."; } } What do i have to add behind brick. ? I i tried .xml or .jpg but both doesn´t work. Hope someone can help. I thought the XNA 3dw Contentpipline takes away the work with the x files. when i only use boxes/Solids, all works fine, but when i use my own models it doesn´t work. Thanks MasterFlu Quote Link to comment Share on other sites More sharing options...
Pixel Perfect Posted May 18, 2012 Share Posted May 18, 2012 Presumably the bit you need to add is the extension of the texture used on the exported object, so it's whatever texture came with the model you imported in the first place. I'm not sure why the texture filename is missing the extension in the exported file, other than from my memory of the 3DWS file format Josh disgards the extensions so maybe that's what's happened here, I'm not sure. Quote Intel Core i5 2.66 GHz, Asus P7P55D, 8Gb DDR3 RAM, GTX460 1Gb DDR5, Windows 7 (x64), LE Editor, GMax, 3DWS, UU3D Pro, Texture Maker Pro, Shader Map Pro. Development language: C/C++ Link to comment Share on other sites More sharing options...
MasterFlu Posted May 18, 2012 Author Share Posted May 18, 2012 i tried it with the texture name. but then i get a nullreference exception. if i use a modell out of 3dws like the indoorframe1 i get the same error like mentioned above. usually i am doing sth. wrong. so i´ll write how i did it: In 3dws on the right side in object categorie i choose house, under object i choose indoorframe1, under Texture Category i choose buildings and the i choose my own wood texture. then i export the object as .X file, because XNA wants this. In the .X file appears the brick. "error". when i write an other texture which exists and is in the same folder i get a nullreference exception at this line of code in the draw method(): for (int i = 0; i < level.Models.Length; i++) { Vector3 rotation = level.Models[i].rotation; rotation *= MathHelper.Pi / 180f; Matrix worldMatrix = Matrix.CreateFromAxisAngle(Vector3.Up, -MathHelper.PiOver2); worldMatrix *= Matrix.CreateFromYawPitchRoll(rotation.Y, rotation.X, -rotation.Z); worldMatrix.Translation = level.Models[i].position; foreach (ModelMesh mesh in Models[i].Meshes) { foreach (Effect effect in mesh.Effects) { effect.Parameters["World"].SetValue(worldMatrix); effect.Parameters["View"].SetValue(View); effect.Parameters["Projection"].SetValue(Projection); } mesh.Draw(); } } Quote Link to comment Share on other sites More sharing options...
Pixel Perfect Posted May 18, 2012 Share Posted May 18, 2012 What is the brick texture file and extension in 3DWS? Are you trying to use the proprietary texture formats that 3DWS uses which no one else supports. Is the texture file being exported along with the X file? Sorry, but I'm not familiar with XNA although I can pretty much see what the code is doing. However, the X file must reference a full and valid texture filename and one supported by XNA. Quote Intel Core i5 2.66 GHz, Asus P7P55D, 8Gb DDR3 RAM, GTX460 1Gb DDR5, Windows 7 (x64), LE Editor, GMax, 3DWS, UU3D Pro, Texture Maker Pro, Shader Map Pro. Development language: C/C++ Link to comment Share on other sites More sharing options...
MasterFlu Posted May 18, 2012 Author Share Posted May 18, 2012 I solved the problem with the brick. but now when i export the model as .X file and start xna it gives me a NullReferenceException. Hope here is someone who can help me with this. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.