New materials added appear white (no textures) bug
by Arden · in Torque X 2D · 10/03/2010 (4:08 pm) · 6 replies
Hey guys,
I've been looking at ways to fix this problem for a couple of days to no avail. Looks like a Torque X bug. Simply said, the problem is that when I create a new material and put it into the scene, it appears as white (no textures). Usually, when adding new materials, Visual C will pop a dialog window to update itself. This doesn't happen anymore, so it seems to be related.
Any idea as to why this may be happening, and what I can do to fix it?
Thanks
I've been looking at ways to fix this problem for a couple of days to no avail. Looks like a Torque X bug. Simply said, the problem is that when I create a new material and put it into the scene, it appears as white (no textures). Usually, when adding new materials, Visual C will pop a dialog window to update itself. This doesn't happen anymore, so it seems to be related.
Any idea as to why this may be happening, and what I can do to fix it?
Thanks
#2
Follwing your directives, here is what I did:
1) In the solution: Game/images/ add new item (added all graphic files)
2) In the editor: create a new material from one of the files just added in VS. It shows up ok in the editor.
3) Drag a material onto the scene.
4) Save scene (no prompt in VC at this point).
5) build and run in debug.
Result: new material shows up as a white square.
Any clue as to what else I might be doing wrong?
10/03/2010 (5:06 pm)
Hey Aaron! Thx for the reply, very useful. However it doesn't seem to fix it for the current issue though. Follwing your directives, here is what I did:
1) In the solution: Game/images/ add new item (added all graphic files)
2) In the editor: create a new material from one of the files just added in VS. It shows up ok in the editor.
3) Drag a material onto the scene.
4) Save scene (no prompt in VC at this point).
5) build and run in debug.
Result: new material shows up as a white square.
Any clue as to what else I might be doing wrong?
#3
All the images show up in the C# tree now? And they are in the same location that the editor uses?
"Game/images/" <- Do you mean "data/images/" ? (TX2D uses data/images/)
Double check the TextureFilename path of the white images in the .txscene file (just double click the .txscene file, its located in the levels folder in C#) Make sure to close the .txscene after you are done, leaving it open causes issues.
If it's not a bad path somewhere, then I haven't a clue. Good Luck :-)
10/03/2010 (5:34 pm)
Arden, I have never tried preloading all the images into C# (as in your step 1). However I don't see why that would be a problem. All the images show up in the C# tree now? And they are in the same location that the editor uses?
"Game/images/" <- Do you mean "data/images/" ? (TX2D uses data/images/)
Double check the TextureFilename path of the white images in the .txscene file (just double click the .txscene file, its located in the levels folder in C#) Make sure to close the .txscene after you are done, leaving it open causes issues.
If it's not a bad path somewhere, then I haven't a clue. Good Luck :-)
#4
Thanks for your help!
10/03/2010 (8:08 pm)
Thanks. I was able to fix the problem by recreating the projet and re-adding the cs files and assets. I'll still be watching for what happened and post a definite solution here if I find the specific cause. Thanks for your help!
#5
The definite solution was already posted. Here, I made some images illustrating what you need to do:
First, make sure all your data exists in the data directory. Everything inside the data directory will be under the Content (data) section of your project.
Next, I am missing data/images/background/night.png. So, I will navigate to Content (data)/images/background and tell Visual Studio to Show All Files. This will show all the files that are currently not in the Content (data) section.
After I have done that, I right click on night.png and select Include In Project. night.png will now be compiled in with my project and its texture will not be white anymore.
So, there you go. Eventually, the builder will stop adding new materials to your project automatically, so you will have to manually add them using the method I have just shown you.
10/04/2010 (11:48 pm)
EDIT: The images are a bit too wide for the forums. Manually visit them to see the full image.The definite solution was already posted. Here, I made some images illustrating what you need to do:
First, make sure all your data exists in the data directory. Everything inside the data directory will be under the Content (data) section of your project.
Next, I am missing data/images/background/night.png. So, I will navigate to Content (data)/images/background and tell Visual Studio to Show All Files. This will show all the files that are currently not in the Content (data) section.
After I have done that, I right click on night.png and select Include In Project. night.png will now be compiled in with my project and its texture will not be white anymore.
So, there you go. Eventually, the builder will stop adding new materials to your project automatically, so you will have to manually add them using the method I have just shown you.
#6
It's weird that the builder eventually stops adding new materials automatically to the project tough. Does anyone know how that can be fixed? It would come in handy, especially when you have a couple of Level designers / artists working in the editor.
10/06/2010 (1:29 pm)
Hey Thanks John! It's good to know. This indeed fixes this issue :)It's weird that the builder eventually stops adding new materials automatically to the project tough. Does anyone know how that can be fixed? It would come in handy, especially when you have a couple of Level designers / artists working in the editor.
Torque 3D Owner Aaron Scovel
In C# click "Add->Existing Item..." on your images folder. It will open up the images folder and you will see all your files there, just select them and press add.
To prevent this issue in the future:
After you add a new material in TX2D it will add the file to the images folder (via TX2D prompt), you MUST also press "Save Scene" after adding the new materials or C# wont prompt to include these files (via C# prompt) into the project.