texture/mapping problem when restarting T3D
by Hreikin · in Torque 3D Beginner · 10/23/2014 (7:57 am) · 19 replies
Im fairly new to torque and still learning, so far i have managed to google my way out of problems, until now ! I downloaded some models (sketchup) i would like to use and exported them to DAE to use in torque, i copy the exported models/textures over to my game/art/shapes folder and then start torque. I import the models and all is well, they display all textures correctly (well windows/doors are slanted but they are there!).
My problem occurs when i save/quit and then come back to work on it some more later, some of the textures become unmapped and display "no material" (but never the doors/windows). i have tried re-mapping them following the doumentation, which works until i quit/restart torque again (i definitely saved) when the same textures become unmapped again
i also tried adding a prefix when loading the model into torque but that seemed to make more textures become unmapped than previously and even if i tried to remap/save them when i restart torque yet again they become unmapped.
here is my console.log
pastebin.com/36t0TV4V
which shows some errors in my materials.cs file and and 01.cs file as well as some others for the other 2 buildings i added, here is my materials.cs file for my first building
pastebin.com/20FWiT2E
here is my 01.cs file for my first building
pastebin.com/mseQsfTT
the images for the textures are in the same folder as the DAE file, is this right ? or do they need there own folder in the same one as the DAE file ?
here is a pic of what they look like each time i restart torque after trying to remap the textures

My problem occurs when i save/quit and then come back to work on it some more later, some of the textures become unmapped and display "no material" (but never the doors/windows). i have tried re-mapping them following the doumentation, which works until i quit/restart torque again (i definitely saved) when the same textures become unmapped again
i also tried adding a prefix when loading the model into torque but that seemed to make more textures become unmapped than previously and even if i tried to remap/save them when i restart torque yet again they become unmapped.
here is my console.log
pastebin.com/36t0TV4V
which shows some errors in my materials.cs file and and 01.cs file as well as some others for the other 2 buildings i added, here is my materials.cs file for my first building
pastebin.com/20FWiT2E
here is my 01.cs file for my first building
pastebin.com/mseQsfTT
the images for the textures are in the same folder as the DAE file, is this right ? or do they need there own folder in the same one as the DAE file ?
here is a pic of what they look like each time i restart torque after trying to remap the textures

About the author
#2
thanks for the link ill give it a run through tonight/this weekend
a suggestion from IRC was to try rename/remap all the textures in blender and then export again
10/23/2014 (9:07 am)
hi jamesthanks for the link ill give it a run through tonight/this weekend
a suggestion from IRC was to try rename/remap all the textures in blender and then export again
#3
Another solution is to select the shape with the error, switch to material editor and click on the texture fields to search for the texture you want to apply to the material, this way you can rewrite the texture paths inside the world editor.
10/23/2014 (9:30 am)
Textures have to go in the folder where the model expects them, you can open the .dae file with an editor and then you search for the filepaths, then you can see where the model expects the textures to be, if the are not there, you get the "no material" error. You can also open the model with a modeling program and rearrange the texture-paths.Another solution is to select the shape with the error, switch to material editor and click on the texture fields to search for the texture you want to apply to the material, this way you can rewrite the texture paths inside the world editor.
#4
i think your last suggestion is the one im trying from documentation about remapping materials, on a restart of torque they revert back to "no material"
on IRC they suggested that the texture files have weird names which wont help and to rename the files and then rename/remap the textures in blender
my problem seems to be when i quit and go back later, i know that i definitely saved the remapped texture and level but it just doesnt stick, interestingly if i only exit the level and then go back in, the textures are all there, only when i completely exit torque does it seem to reset, tbh im a little disheartened, been a long few days of failing but ill keep plugging away at it :S
10/23/2014 (10:00 am)
@Duion i did try opening the DAE file and finding the location it thinks they are and placing them there but got no luck, they still say "no material", i even tried remapping to new location but when torque is restarted it goes back to "no material"i think your last suggestion is the one im trying from documentation about remapping materials, on a restart of torque they revert back to "no material"
on IRC they suggested that the texture files have weird names which wont help and to rename the files and then rename/remap the textures in blender
my problem seems to be when i quit and go back later, i know that i definitely saved the remapped texture and level but it just doesnt stick, interestingly if i only exit the level and then go back in, the textures are all there, only when i completely exit torque does it seem to reset, tbh im a little disheartened, been a long few days of failing but ill keep plugging away at it :S
#5
The best solution I found is to load the model into a modeling program and give the material a unique name, then you open a materials.cs file or create one if there is none, you can place it anywhere and create a material datablock with that name you just given your model. If you don't know how to create a material datablock, just copy from another material and replace the names and paths for the textures, then it should work without problems.
10/23/2014 (11:13 am)
Torques material system is a big bugged sometimes. Torque creates a new material, if there is no existing in the system, this can create confusion sometimes. Also if you use the material editor to create new materials and remap them onto models it can generate problems.The best solution I found is to load the model into a modeling program and give the material a unique name, then you open a materials.cs file or create one if there is none, you can place it anywhere and create a material datablock with that name you just given your model. If you don't know how to create a material datablock, just copy from another material and replace the names and paths for the textures, then it should work without problems.
#6
10/23/2014 (5:00 pm)
There was an issue where changes to materials weren't being saved correctly - it may have cropped up again....
#7
10/23/2014 (5:12 pm)
@Hreikin: If you end up trying all of the suggested solutions here and still can't get it working, maybe give us a link to the models you downloaded. If you hadn't gotten it working, I wouldn't mind downloading one and stepping you through it. Cheers!
#8
@Richard thanks for the info, lets hope its just me doing something wrong and not a bug
@Jesse i started using different models because it was annoying me, i intend to try loading them in blender and remapping this weekend . . . but i dont have as much of a selection, there were like 28 now i have 8-10 :P if you dont mind giving it a try for that would be great ? here is the page i got them from:
3dwarehouse.sketchup.com/user.html?id=0631498512887266629319491
try any of the "Casa Medieval" ones, my steps are as follows:
1 = open sketchup and export as DAE
2 = copy exported folder to my projects /game/art/shapes folder
3 = open T3D and import the new model (it should look fine bar some slanted windows/doors)
4 = save and quit T3D
5 = open T3D, some textures on the model should display "no material" for me it is usually the one named "Madeira_tábua"
6 = remap the texture using material editor, save the texture and save the level then quit T3D
7 = open T3D the same textures should display "no material" again
if i add a prefix when importing the model to T3D it usually makes more textures display "no material"
10/23/2014 (6:33 pm)
@Duion im thinking the same, just need to watch a few blender vids first i think :D my skills are lacking@Richard thanks for the info, lets hope its just me doing something wrong and not a bug
@Jesse i started using different models because it was annoying me, i intend to try loading them in blender and remapping this weekend . . . but i dont have as much of a selection, there were like 28 now i have 8-10 :P if you dont mind giving it a try for that would be great ? here is the page i got them from:
3dwarehouse.sketchup.com/user.html?id=0631498512887266629319491
try any of the "Casa Medieval" ones, my steps are as follows:
1 = open sketchup and export as DAE
2 = copy exported folder to my projects /game/art/shapes folder
3 = open T3D and import the new model (it should look fine bar some slanted windows/doors)
4 = save and quit T3D
5 = open T3D, some textures on the model should display "no material" for me it is usually the one named "Madeira_tábua"
6 = remap the texture using material editor, save the texture and save the level then quit T3D
7 = open T3D the same textures should display "no material" again
if i add a prefix when importing the model to T3D it usually makes more textures display "no material"
#9
replace:
with:
(change the 'a' with the dash to a regular 'a' in 'tabua')
You see, it's tricky to use special characters in code.
10/23/2014 (8:35 pm)
Try this:replace:
singleton Material(_01_building1Madeira_ta'bua)
with:
singleton Material(_01_building1Madeira_tabua)
(change the 'a' with the dash to a regular 'a' in 'tabua')
You see, it's tricky to use special characters in code.
#10
So, to fix this:
Edit the name just as Nils has instructed above in Torque in your materials.cs file. Any of those special characters in any of the files will need to be changed; if you look at the console log you posted above you'll find that a lot of syntax errors occurred right after using special characters.
Just replacing those special characters in Torque may not be enough. I recommend opening the .DAE file in Blender (or Sketchup) and navigating to the Material located within the 3D mesh file. Also rename it within the source 3D application, and re-export the mesh now that it 'internally' knows that you have updated those names. Now the 3D mesh and Torque are on speaking terms :)
Open your /art/shapes/(name of your folder) and also be sure to delete the .cached.dts files because those will be loaded in with the old names if you don't empty them out. Those will be regenerated after you start up again, so you'll get newly cached models with your new mats.
Oh, one other small thing I noticed you might run into depending on which models you are using: Some of the materials may appear to map on, say, half of the mesh and other parts of the same material might appear 'invisible'. In these cases, just find the 'Double-sided' checkbox in Torque's material editor (it's at the bottom of the right pane where you choose the textures, under 'Advanced'). In most cases, that should fix it. Hope it helps, keep it up, you're doing great already! Being fair that's an easy mistake to make.
10/23/2014 (9:18 pm)
Nils is correct. I just downloaded and gave it a run with the building #24. It is called Sem-nome. I noticed that one of the mat names used special characters, since obviously the author's native language isn't English. So, to fix this:
Oh, one other small thing I noticed you might run into depending on which models you are using: Some of the materials may appear to map on, say, half of the mesh and other parts of the same material might appear 'invisible'. In these cases, just find the 'Double-sided' checkbox in Torque's material editor (it's at the bottom of the right pane where you choose the textures, under 'Advanced'). In most cases, that should fix it. Hope it helps, keep it up, you're doing great already! Being fair that's an easy mistake to make.
#11
@Jesse on a side note when you loaded the model into T3D did you get the slanted windows/doors ?
i kind of have a fix, if i replace the image with another it displays straight (got a door just need a couple of windows to fit too) however when i preview the initial image for the window/door in windows it displays straight, they only go slanted in T3D ? would double-sided possibly work here ?
thanks for all the help so far guys
10/24/2014 (4:00 am)
thanks for the great responses @Nils and @Jesse i took your suggestions of renaming the source file for the texture to remove accent and opening the skethup model and renaming the texture in there before exporting, iv only tried one but it worked, when i quit and go back the material is displayed correctly !@Jesse on a side note when you loaded the model into T3D did you get the slanted windows/doors ?
i kind of have a fix, if i replace the image with another it displays straight (got a door just need a couple of windows to fit too) however when i preview the initial image for the window/door in windows it displays straight, they only go slanted in T3D ? would double-sided possibly work here ?
thanks for all the help so far guys
#12
10/24/2014 (5:52 am)
It is possible double-sided could work, yes. The fact that you were able to replace the image and have it display correctly is a good sign(since it means that the UV mapping should be fine). I won't be able to take a look at it until later today, but in the meantime it can't hurt to try the double-sided checkbox :) You should see the change in the preview window of Torque immediately. Let me know if it bears further investigation after trying it out.
#13
EDIT: i tried using double sided but it didnt work, they still slant :(
10/24/2014 (6:06 am)
im not at that PC right now but ill give it a shot when i get home, ill let you know the results !EDIT: i tried using double sided but it didnt work, they still slant :(
#14
i tried to remove/rename/remap the textures in sketchup but when i insert two or models into T3D then restart T3D i end up losing the "Madeira_tabua" texture even tho i renamed the source texture to remove the accent, im probably doing something wrong no doubt, gonna give it another try tomorrow after work
i also tried remapping the textures in T3D Material Editor after import but they revert back to still missing a texture on restart of T3D
also the material prefix does the same as before, making it worse with more models missing textures :D
its probably me but if you have any suggestions let me know :)
10/24/2014 (3:16 pm)
when i rename/remap the textures do they have to have a different set of names for each different model ? i tried to remove/rename/remap the textures in sketchup but when i insert two or models into T3D then restart T3D i end up losing the "Madeira_tabua" texture even tho i renamed the source texture to remove the accent, im probably doing something wrong no doubt, gonna give it another try tomorrow after work
i also tried remapping the textures in T3D Material Editor after import but they revert back to still missing a texture on restart of T3D
also the material prefix does the same as before, making it worse with more models missing textures :D
its probably me but if you have any suggestions let me know :)
#15
Nah, two different models can share the same material. Just be sure the material name is consistent in the source of both models as well as within Torque. Also be sure after each run that you are going back into /art/shapes/(your folder name) and deleting the .cached.dts files if you are making changes. The best way is to remove the shapes entirely from T3D, make the necessary changes to the source models in the 3D app, then drop the models back into T3D's art/shapes/(your model name) folder. This way, the folder is empty and you aren't potentially dealing with old .cached.dts files. Then you can go into the material editor and be sure each material is pointing at the correct texture. Once you've assigned a texture to a material in Torque, you won't have to assign it again. That single mat should automatically appear in future models you add that use the same mat(granted that all the models share the same material name in the source file).
Example:
About the slanted textures, I'm not entirely sure yet what's causing that. I've opened the .DAE file in both Sketchup and Blender and they appear fine within the 3D apps. Also the UV's are working since other images display correctly. That's still a mystery for me at this point, no idea why Torque isn't mapping the material correctly as defined by the UV map in the model :/
10/24/2014 (4:02 pm)
Quote:when i rename/remap the textures do they have to have a different set of names for each different model ?
Nah, two different models can share the same material. Just be sure the material name is consistent in the source of both models as well as within Torque. Also be sure after each run that you are going back into /art/shapes/(your folder name) and deleting the .cached.dts files if you are making changes. The best way is to remove the shapes entirely from T3D, make the necessary changes to the source models in the 3D app, then drop the models back into T3D's art/shapes/(your model name) folder. This way, the folder is empty and you aren't potentially dealing with old .cached.dts files. Then you can go into the material editor and be sure each material is pointing at the correct texture. Once you've assigned a texture to a material in Torque, you won't have to assign it again. That single mat should automatically appear in future models you add that use the same mat(granted that all the models share the same material name in the source file).
Example:
- In the sem-nome building I downloaded, there is a texture called Muro_de_pedras. It doesn't have any special characters but I'm going to rename it anyway cause it's in Spanish and I speak English. So, Muro_de_pedras translates to Wall_of_stone.
- So, first thing I'd do is rename the actual image to Wall_of_stone.
- Then, I'd open up all the models and search their materials to see if they include Muro_de_pedras. If they do I'd rename the mats in all of them to Wall_of_stone.
- Next up, I'd create a folder in my T3D directory like art/shapes/buildings and drop all of those building models into that same folder.
- I'd create yet another folder inside of that 'buildings' folder named 'Materials'. In that folder, I'd include all of the materials from all of the building models. So now I've got a single folder that holds all the models and another single folder inside that to hold all the mats for all the buildings. This helps to prevent using the same material from different locations more than once which can lead to conflicts.
- In Torque, I'd just open up the EmptyRoom mission and plop in the sem-nome building. Then just set the materials up there.
- From now on, any building that uses Wall_of_stone(or any other mat I just setup for sem-nome) will automatically display that material when added as long as the material has already been named to Wall_of_stone in the 3D app.
About the slanted textures, I'm not entirely sure yet what's causing that. I've opened the .DAE file in both Sketchup and Blender and they appear fine within the 3D apps. Also the UV's are working since other images display correctly. That's still a mystery for me at this point, no idea why Torque isn't mapping the material correctly as defined by the UV map in the model :/
#16
i tend to delete the whole folder when replacing models for quickness/peace of mind, my memory likes to confuse me and this helps counteract it :P
this could be the cause of the problem, it is only from the 2nd model onwards that gets texture problems, when i export the model to DAE it creates a folder for textures and each individual model has one, i had a "buildings" folder with 28 "house01", "house02", etc folders, each one of those held the DAE and a folder for the textures, i will try it your way and report back.
10/25/2014 (9:06 am)
just renaming the texture source files now, think im gonna try loading them all in blender or sketchup individually and removing/remapping the textures later today/tomorrow morningQuote:Also be sure after each run that you are going back into /art/shapes/(your folder name) and deleting the .cached.dts files if you are making changes.
i tend to delete the whole folder when replacing models for quickness/peace of mind, my memory likes to confuse me and this helps counteract it :P
Quote:I'd create yet another folder inside of that 'buildings' folder named 'Materials'. In that folder, I'd include all of the materials from all of the building models. So now I've got a single folder that holds all the models and another single folder inside that to hold all the mats for all the buildings. This helps to prevent using the same material from different locations more than once which can lead to conflicts.
this could be the cause of the problem, it is only from the 2nd model onwards that gets texture problems, when i export the model to DAE it creates a folder for textures and each individual model has one, i had a "buildings" folder with 28 "house01", "house02", etc folders, each one of those held the DAE and a folder for the textures, i will try it your way and report back.
#17
Hope storing the mats together helps out. It's a practice I've gotten into that really helps with organization as well. If you have a folder of similar models that may share the same textures, with their 'Materials' folder inside that, you also end up with a new 'materials.cs' file inside there just for what's in that folder.
10/25/2014 (1:19 pm)
Remapping the slanted spots could definitely help. If you take a close look at the doors in the sem-nome model you can see the way the guy mapped them is kinda weird. The slant that we're seeing could be a direct result of this, since there is one big tri at the bottom right corner that is holding the image when loaded into Torque. The other slices at the top-left of the door aren't following suit, as if they weren't part of the UV (although it appears that they are in the 3D app). Personally I'd remodel the door altogether and remap it :)Hope storing the mats together helps out. It's a practice I've gotten into that really helps with organization as well. If you have a folder of similar models that may share the same textures, with their 'Materials' folder inside that, you also end up with a new 'materials.cs' file inside there just for what's in that folder.
#18
i will try this later on, if i can fix the "no materials" error then for now i can swap the door texture and it looks fine, and i can remove the windows texture and just add emissive/glow, it doesnt look right but for my first try/proof of concept im not too fussed :D
thanks for the help/guidance so far :)
EDIT: i have only just got round to this, will be remapping the textures tonight in blender, wish me luck :P
10/25/2014 (6:11 pm)
Quote:Personally I'd remodel the door altogether and remap it :)
i will try this later on, if i can fix the "no materials" error then for now i can swap the door texture and it looks fine, and i can remove the windows texture and just add emissive/glow, it doesnt look right but for my first try/proof of concept im not too fussed :D
thanks for the help/guidance so far :)
EDIT: i have only just got round to this, will be remapping the textures tonight in blender, wish me luck :P
#19
i still have the slanted door/window problem and i may have to remodel them all if i cant find a good replacement that doesnt slant
EDIT: i have a rubbish fix for the door but the windows look better, i found a replacement image which im happy with for now.
11/01/2014 (1:14 pm)
@Jesse storing the materials in a diff folder after remapping in blender worked, i have to remap in T3D as well but after a restart they are all still there ! thank you :)i still have the slanted door/window problem and i may have to remodel them all if i cant find a good replacement that doesnt slant
EDIT: i have a rubbish fix for the door but the windows look better, i found a replacement image which im happy with for now.
james burch
You know more about T3d than I do , but for a quickie , I think that textures go in a folder named /art . and if I may take a guess Id think that your wood texture needs to be in there .
But , here is something much better
www.garagegames.com/community/blogs/view/22825 .
There is a great preview to a guide being written !
Good Luck .
EDIT: Created a "Live Link" with the correct url , duh .