Game Development Community

texture/material will not show up with collada exporting from blender

by James Pulliam · in Torque 3D Beginner · 11/16/2012 (8:54 pm) · 13 replies

ok i have searched the forums on here and all over the net, have followed tutorial after tutorial, and still no luck.

i am trying to so a simple cube with a uv mapped texture and get it into torque. i use blender for my modeler. and after many many tries when exporting collada into torque it has no texture.

steps taken.

create cube
mark seams
select all, unwrap.
export uv layout
edit uv layout in psp
upload image into blender in uv panel
create a surface
create a material
set material to image/video
set cords to uv
save everything

now in blender it all looks fine and dandy.

i go to export collada, i check export uv and materials.

i export the collada into it's own folder, and double check, both collada and texture has been exported into that folder.

i then copy that folder and place it in the folder inside my projects folder in proper place.

i open game and find the collada. the import window comes up, the collada imports, but has no texture on it.

i see in the consule it says no corsponding materail exsists or sumthing like that.

i have also tried importing same cube into unity and same thing happens, so i am guessing it is something i am missig with the exporting or the assigning of the uv map. i have been going over and over this now for over a week, and at about the end of my patients with this so if someone could give me some advise on what the H. i am doing wrong.

#1
11/16/2012 (9:39 pm)
oh and to add on with this problem, i also play a game called second life, when i got to upload the same mesh into there, the texture does show up and is attached to the mesh. although the texture has to be uploaded seperately, in the upload preview the texture is on the mesh.
#2
11/16/2012 (11:35 pm)
The Open Asset Import Library Viewer can export to dae format (collada)
You can use it to verify your meshes and textures that are exported from
blender.If the problem is with the blender exporter, you can export
from blender in 3ds format if it supports it ( have not used blender
in many years so do not remember if it exports to 3ds) or another format
that embeds textures, then export from Assimp viewer to dae (collada).
The Assimp viewer and sdk are free to use and can be found with a simple
search via internet. This is one path. Another would be to search for
dae ( collada ) issues with export on the blender forums and the web.
I seem to recall some versions of the blender exporter have issues however do not remember if it was with dae ( collada ) or dts. 3DS Max
has issues with its native dae (collada) exporter and I had to go to the
Open Collada exporter for a working exporter, so it is not uncommon
to have exporter issues with any software that is used these days. This
is for static meshes.
#3
11/16/2012 (11:53 pm)
ok well still haven't solved the problem, but dake that was a big big help. i have been trying to find a program to view model it, it helps with the process of elimination.

and the texture is showing up fine in open asset library. so that kind of narrows it down to it is the import that is going wrong.

now i did read somewhere that torque has problems when the textures is on the diffuse layer, and from open asset, it states the texture is on the diffuse layer. however as most things i find out about this engine, that the solution isn't really explained too well, more of a touch and go.

but atleast i know i am exporting correctly. so that helps, now for the next headache to get it to go into torque correctly
#4
11/17/2012 (12:22 am)
this is where i was reading about the recommended solution, but sorry, this don't really tell me much

Materials

A major difference between a COLLADA and a DTS model is in the naming of materials. DTS files only support a single material name, which historically (TGE) has been used to reference the diffuse texture. For example, a DTS material that uses the texture wood.jpg would be called wood. When Torque loads this model, if there are no script Materials defined that mapTo wood, the engine looks for a JPG, PNG, or BMP file with that name in the same directory as the model.


However, in a modelling application (and in Torque3D!), a material encompasses much more than just the diffuse texture. When a model is exported to the COLLADA file format, the name of the material in the modelling app is stored in the <material> tag in the COLLADA file.


The default behavior of the dae2dts tool is to use the COLLADA <material> element name as the material name in the DTS file, which means the model will not display correctly in Torque unless materials.cs has been setup correctly. There are two approaches to solve this issue for dae2dts converted models:

1.Name the material in the 3D app the same as the diffuse texture file, or use the --diffuse option to do it automatically at conversion time. This is the recommended approach for engines that do not support scripted Materials (TGE, ShowToolPro).
2.Create a materials.cs file in the same directory as the model (or have the tool create it for you), and define a script Material object that maps to each COLLADA material name. This is the recommended approach if your engine supports scripted Materials as it will give you greater flexibility in naming your materials.


Further Reading

See the Torque COLLADA Loader documentation for more details about how Torque loads COLLADA files, and for which COLLADA features are supported.


TSShapeContructor allows you to modify the loaded COLLADA model in-memory before it is saved to DTS or DSQ. The TSShapeConstructor script can be created by hand, or by using the T3D Shape Editor tool (available in the T3D demo for non-T3D licensees). See TSShapeConstructor in the Torque 3D - Script Manual for more details.

when i force material update in import, it creates the tssshapeconstructor. but doesn't help me much when i don't know what to do in it, or if is even what i want to be editing.
#5
11/17/2012 (1:14 am)
did u try to reassign textures from material editor or from shape editor's material tab?

(i am absolute noob on art things.but material editor helps me to fix this type of problem with 3rd party models)
#6
11/17/2012 (2:05 am)
yes i looked through the material editor, problem is the texture for the cube which is what i am testing this with, is a mapped image. and so far i do not know how to create or import a mapped image in material editor.
#7
11/17/2012 (8:39 am)
The Torque T3D docs has a good step by step guide to creating a new
material and adding texture maps such as Diffuse, Normals map, and
Specular map. As well, located in the installation folder ( for my
installation: "C:\Torque\GarageGames-Torque3D-ebc6c9c\Templates\Full\game\art\shapes\cube" )you will find a cube
in dae format, a dds texture and a Material.cs file. You can open
the Material.cs file with a text editor to view the format that it adheres to and see how the setup goes. You can also open the cube
dae file with a text editor to investigate it's format. It is good
idea to become familar with this data. I am using windows, so I use
Wordpad to view the data ( notepad will work as well, however I have
become gun shy with notepad as I had issues with it adding odd characters to my code in Visual Studio some time ago when I was copying
and pasting from one file to another) Also you need to ensure that
your texture maps are a power of 2. This means that the dimensions of
the texture map both in the horizontal and the vertical are numbers
that are powers of 2. Example 256 X 512... this is a width of 256 pixels
and height of 512 pixels, thus they are valid power of 2 numbers. In case you do not remember the power of 2's, would be 2, then 2 times itself for 4, 4 times 2 for 8.... 128 times 2 for 256 and so on. Be aware that all video cards have an upper limit to the size of the texture it supports. This info is usually supplied by the manufacturer
or can be found using Direct X diagnostic tool.
Whatever 2d image editing software you are using will normally provide
the information about the texture you are currently viewing either from
a right click menu or the menu selections at top of window area. Since
the method differs so much from software to software can not give exact
method for this.
Take things slowly and be sure to fully understand each step in this
stuff, as it is mind boggling the amount of information that actually
is associated with 3d, games and art for games. If you are not sure
of something or do not understand post in forums. If you find you need
a more structered and assisted route, there are some great online
courses soem free, some paid. The Game Institute is offering all their
courses for $99.00 US dollars at the present time. I have been a student
there for several years ( online allows me to go at my own pace, that
and the cost of some of the other schools is too much for my meager
budget) Also I will point out that I am well past the 50 year old mark
so anyone who thinks age is a detering factor should re-think that.
I have recently taken the 3ds Max courses and they were great. You can
see some of the game stuff I have done at:

url\ http://innerste.cu.cc/ \url

Look in Portfolio section.

#8
11/17/2012 (11:54 am)
Are you using the most recent Blender - 2.64? They fixed some Collada export issues. I've been able to get shapes from Blender to Torque using a process that looks pretty much like yours, though I did have to reassign textures in the material editor after importing.

To clarify: when I imported the collada shape, there were no materials visible, though when I clicked on each material in the shape editor materials tab, I could see that they were mapped correctly. So I hit the button to edit them, and re-added the diffuse map, and added normal and spec maps.
#9
11/17/2012 (12:37 pm)

ok i got it working, thanks to daniel and to dale, both of you was a big help.

i do understand the power of 2 when it comes to textures and such, i am no stranger to 2d graphics, i am trying to expamd myself into the 3d world. it something i have been interested in for a long long time. just hard to find the right time and the right place to do it at.

i have thought about taking classes, but with my working schedule and tight budget, dunno if that is doable atm.

they way i got it to work was as daniel suggested, i imported the collada, and then went into the material editor. on the diffuse layer i edited by adding the uv mapped texture for the collada from the folder i stuck collada and uv map into. and it showed up fine. there is no other layers for texture at this moment, for this is just all a test to see how it all works.

my question with using material editor to assign the texures, is how well would that work, or what would i have to do, to get it to where i can transfer the object from one map to another.

as in lets say once i get this all down, and i am sure i will, well atleast the modeling part down. i make me up a lets say brigde, i get it all textured with the different layers of textures, i go into torque import the brigde, assign the textures to the different layers. and lets say it all goes well.

now how would i go about making it to where i could package that brigde and place it into a different map/level.
so like someone else could take that brigde and place it into their game without having to go in manually and assiging the textures.
#10
11/17/2012 (12:38 pm)
oh yeah and btw, dale your models look good, once i get this down, and learn a little more i will show ya some of my work, but better give me time. i am a quick learner when it comes to art, but it seems this is gonna take me a while
#11
11/17/2012 (5:12 pm)
You could make a copy of the test mesh giving it a different name,
also make copies of the texture with different name ( for test purposes
and verification of process) then load the test mesh into the Assimp viewer and re-export as dae ( collada ). Make a new test map with nothing in it such as from the empty room template and import as
normal, your test mesh. On the second note, you could make a pre-fab
from your test mesh and add to a new test map to verify that textures
have remained intact and that you will be able to use the object in any
additional maps or levels. If from the first test after exporting from
Assimp viewer, the dae is working as you expect, you can then just package the mesh and textures and pass along to someone else in an
archive file such as zip or rar.
#12
11/17/2012 (10:49 pm)
I had some texture problems lately too, importing from sketchup.. Two options sometimes worked..

1. Changing the references to the textures in the .dae file (opened with Notepad++) and then changing the actual texture names to corrospond.

That one didn't work many time though.

The one that has worked alot for me is simply giving the model's materials a prefix when you load it in, and changing the "LOD" to "SingleSize". I don't even know what this setting does lol but when I tried it, the textures started working alot of the time... Sometimes I still get the "No Texture".. Not sure why.
i49.tinypic.com/33vc0fk.png Also, I was having trouble bringing this screen up for some models, if this screen isn't coming up when you load a model, you just have to delete the cached version of the model in the models folder.
#13
11/18/2012 (2:19 am)
dale i took a look at that game institute web site, and i am intriged.

would really be nice of garage game offered something like that. a in depth learning coarse of their game engine for a price. i think that would help build the community up big time, the learning curve of the torque game engine is pretty steep for beginners.

i think alot of people would be willing to pay for the proper materials and tutorials coarses and such to learn this great game engine.

the torque game engine can do alot of things, but i have always said it not so much what the program/software can do, it more of what can you do with the program/software.

i feel garage games is getting much much better with the learning materials provided with engine, but i also feel it needs to be alot deeper, it still alot of touch and go.

and there is a whole lot to wrap one's head around when it comes to game development. not to mention training and teaching is a skill in it's own. but i do think some sort of coarse, even if it was for a price, as long as it was offered at a reasonable price, it would go along ways into getting the torque game engine/garage games community filled with game developers and hobbiests.