Outerra forum

Anteworld - Outerra Game => Modding: Importer, Tools & Utilities => Topic started by: Hybodo on December 26, 2013, 12:45:42 am

Title: Blender Help - Exporting A Model With Textures?
Post by: Hybodo on December 26, 2013, 12:45:42 am
So I was gifted Outerra by a wonderful friend of mine. I imported a simple vehicle model as a test bed the other day, and scripted it to drive around and such. The original model that I had driving around never had any textures, so I went back into blender and slapped some textures on there, re-exported as Collada (.dae) and imported it into Outerra. The textures however, do not appear. Clearly there's a step or two I'm missing, I've never done this before. Any help?
Title: Re: Blender Help - Exporting A Model With Textures?
Post by: ZeosPantera on December 26, 2013, 12:46:54 am
NAME NAMES YOU BASTARD.. I bought it for him. Me.. I am the best.
Title: Re: Blender Help - Exporting A Model With Textures?
Post by: Hybodo on December 26, 2013, 01:39:28 am
The exact error I'm getting is: "WARNING: Cannot compute the correct tangents for mesh "X"! (missing/wrong UVs)

I used dds textures when I applied them in blender. I unwrapped part of the wheel and opened an image (dds) in the UV editor figuring that'd work.
Title: Re: Blender Help - Exporting A Model With Textures?
Post by: necro on December 26, 2013, 02:25:28 am

Your question is hard to answer. Because this could have several reasons. Texture export out of the box works only until you are using materials for blender render, not cycles. Second, this can only work with .dds textures. Third, i guess you have to make your texture paths relative not absolute.


Your error is actually just a warning. So this is not the reason for not having a texture. This only means, that you've forgotten to unwrap all faces of your mesh.


The easiest way is to copy the texture in your object folder  and name them in your .matlib file.


The object folder might be something like C:\Users\%your_name_here%\Outerra\packages\necro\VikingHouse1. In this folder all information about your model will be stored. Just copy your texture file there and change the line with "tex_diffuse". In my example the line looks like
Code: [Select]
"tex_diffuse" : "wood_diff.dds"

The described method works always and you have 100% control about your material(s).
Title: Re: Blender Help - Exporting A Model With Textures?
Post by: PytonPago on December 26, 2013, 02:43:32 am
The exact error I'm getting is: "WARNING: Cannot compute the correct tangents for mesh "X"! (missing/wrong UVs)

I used dds textures when I applied them in blender. I unwrapped part of the wheel and opened an image (dds) in the UV editor figuring that'd work.

 .... you use the clasical or FBX importer ? ... cause the classical one needs the textures in a certain format : http://xtrac.outerraworld.com/trac.fcgi/wiki/Importer (http://xtrac.outerraworld.com/trac.fcgi/wiki/Importer)

Also i think there was something like by 4 dividable pixel size of the texture being needed. (cant find that post right now but i know i have written a bunch of such texture needs to a guy some time ago - try to check my posts around a half year ago i think)

But the FBX should do it alright even from classic texture formats.  ???

And P.S.:

NAME NAMES YOU BASTARD.. I bought it for him. Me.. I am the best.

Bumper stickers, Zeos ! You need to do some bumper stickers ... :D
Title: Re: Blender Help - Exporting A Model With Textures?
Post by: PytonPago on December 26, 2013, 02:58:45 am
Ah ... here was that texture size limit mentioned:

http://forum.outerra.com/index.php?topic=2232.msg24219#msg24219 (http://forum.outerra.com/index.php?topic=2232.msg24219#msg24219)

(look for discussion somewhere to the end of that post)
Title: Re: Blender Help - Exporting A Model With Textures?
Post by: Hybodo on December 27, 2013, 03:10:21 am
Okay so maybe I'm jumping into this a little too head-on. I'm going to give you a rundown of everything I've done so far to get my model into the game.

I've read:

Your question is hard to answer. Because this could have several reasons. Texture export out of the box works only until you are using materials for blender render, not cycles. Second, this can only work with .dds textures. Third, i guess you have to make your texture paths relative not absolute.


Your error is actually just a warning. So this is not the reason for not having a texture. This only means, that you've forgotten to unwrap all faces of your mesh.


The easiest way is to copy the texture in your object folder  and name them in your .matlib file.


The object folder might be something like C:\Users\%your_name_here%\Outerra\packages\necro\VikingHouse1. In this folder all information about your model will be stored. Just copy your texture file there and change the line with "tex_diffuse". In my example the line looks like
Code: [Select]
"tex_diffuse" : "wood_diff.dds"

The described method works always and you have 100% control about your material(s).
My (.matlib) file is empty when I open it after I've got my vehicle moving around ingame.

And this:
The exact error I'm getting is: "WARNING: Cannot compute the correct tangents for mesh "X"! (missing/wrong UVs)

I used dds textures when I applied them in blender. I unwrapped part of the wheel and opened an image (dds) in the UV editor figuring that'd work.

 .... you use the clasical or FBX importer ? ... cause the classical one needs the textures in a certain format : http://xtrac.outerraworld.com/trac.fcgi/wiki/Importer (http://xtrac.outerraworld.com/trac.fcgi/wiki/Importer)

Also i think there was something like by 4 dividable pixel size of the texture being needed. (cant find that post right now but i know i have written a bunch of such texture needs to a guy some time ago - try to check my posts around a half year ago i think)

But the FBX should do it alright even from classic texture formats.  ???

And P.S.:

NAME NAMES YOU BASTARD.. I bought it for him. Me.. I am the best.

Bumper stickers, Zeos ! You need to do some bumper stickers ... :D

However I'm still having no luck, so clearly I'm doing something wrong! Here's what I'm currently doing, feel free to explain anything I've done wrong or could be doing better, since this is my first time doing anything like this.

#1
Well I've got my model in blender here:(https://lh5.googleusercontent.com/JkNRMJpHkN4ZjHE8LeG6ztzLhDZ4k0WBpQjwRL9c_n631jH-eCVBKZWMzhftM64hc4Vv237XppNpVHrnpfZ22M8Yd-wGTRwlSKvCyGLM2vQGZNJvWJBQYx8Z8A)

#2
Here is how I textured the wheels. I unwrapped the wheels in the UV Editor (Projected from view). The image opened in the UV Editor is infact a .dds file. That's the file that's supposed to be (.dds) right? I grabbed the image online and converted it to a (.dds) in photoshop, and it's exported as a (DXT1). Oddly it opens in Blender as a (.jpg), is this where my problem could be occuring? Maybe this is entirely not how to texture things, I don't really know this was just a guess, I've never textured anything before!:(https://lh5.googleusercontent.com/-u2V1KAS97DMZrKDSaQChZHm7wMdCuonUFc5yn5vHMFKz1dZeEW-QMTPPTc4EMJp0qtXL7AaJCuv5pqJYkuSF3BAUAQvAOaNiBRt2BqZsNhbmefjQ1WtW5mxNQ)

#3
From there I have each of the four wheels parented to the main body of the vehicle. I then export as Collada (.dae) and open Outerra. Once I'm in outerra I hit escape and go to the Object Menu. From there I go to the import tab and select my (.dae) file.:(https://lh3.googleusercontent.com/dDAVQTSzop3XDwr-lqp31mDFuHWTEi_VJRR8z7lGdNbocNLd2hYQIJ61Q73EJW5j7CHTgHr-RGeizcEkrSfqQaVGF43jYKLhkfOOZUi4lAHbxZkG3ZsiO4Qncg)

#4
Here are my configuration settings:(https://lh6.googleusercontent.com/bmztnynXZ4WhO8FHwVQXqM4ojFuWCtPU0vW_Ry_KqDpnLw8QlQjukSzu8QnExuMkhLinWRsKYIBPkhfw9mpjwDVI0Bnawg9Z4MHN6uWoi7DpM256x9NeS5ggMg)

#5
Once I press import I get the errors "WARNING: Cannot compute the correct tangents for mesh "X"! (missing/wrong UVs)".
I can drive the car around after some (.js) editing but the textures are not there. Come to my rescue guys! Teach me your ways!
Title: Re: Blender Help - Exporting A Model With Textures?
Post by: SpaceFlight on December 27, 2013, 07:28:59 am
I don't know much about texturing or modeling, but did you try the FBX importer (Ctrl-F7)?
Title: Re: Blender Help - Exporting A Model With Textures?
Post by: Hybodo on December 27, 2013, 11:56:37 am
I don't know much about texturing or modeling, but did you try the FBX importer (Ctrl-F7)?

I tried using the FBX importer but I can't seem to get it to import properly, I don't know what happens after I create the package, the model doesn't seem to be in the model list, or in the vehicle list.

Either way I think I want to figure out how to use the standard importer properly, before I move onto learning the FBX one as well. Thanks for the recommendation though, I hadn't tried using it prior to your post. (I didn't even know the FBX importer existed, still learning.)
Title: Re: Blender Help - Exporting A Model With Textures?
Post by: PytonPago on December 29, 2013, 04:52:30 pm
I think now i know what is wrong there  - blender has two ways of aplying UVs. One is just for UV from mesh creation and other an actual texture application as a texture. The first one shows on UV-view but in the model edit screen, it doesnt show in render (alt + z) because the render uses actually applied textures. To apply it, you have to have an material chosen for the mesh and go to texture application tool. But best shown - look to the end of the video :

www.youtube.com/watch?v=l-Zkt3uAeO0 (http://www.youtube.com/watch?v=l-Zkt3uAeO0#ws)

So - after making the first kind UV and loading it into the UV screen :
1 . select the UVs faces
2 . head to the "texture tool" right aside the "material tool" (you have to be in edit mode like in pic.)
3 . choose in the menu to take an image and find it there (the DDS one)
4 . its vital to choose the UV option in mapping menu !!!

Afterwards, you should see the dds texture be applied to the model even after hitting (alt + z) - in render view that is.

Once you see it in render mode, you should save the project as a normal blender file too - happens that you need to change things and forget about it, making all the steps anew.

(http://m2.aimg.sk/forig/f_453175429_e003da01ea08d69f0db4b0db127ef514.png)

Also, when exporting to collada, you have to check the "export UVs" option :

(http://m1.aimg.sk/forig/f_453175224_e3373f236d1206208bc4e816c1ad2f9f.png)

 ... normally it stores the texture anew where you saved the colada (but i had issues whyte this so better dont move the original one around folders till you got the model in OT rightly). and OT then does apply them and saves them inside the OT model directory. Obviously, if you try it multiple times ower whyte the same model, OT may not specify the dds texture in matlib - just write it inside.

P.S.: sorry it takes me so long, but had to learn it myself in last days aside other things  ... have to finish my importing vids for ya ... will make the best to have them out by tomorrow for you folks.