Game Development Community

Materials Problems

by Michael S · in Torque 3D Beginner · 04/15/2013 (11:50 am) · 17 replies

My materials are getting messed up every time I reload the level, and changing them in the material editor doesn't work, as it doesn't stick. I think I need to make the materials.cs myself for all the models I have already, and than just use an exporter for .dts which works fine, but I didn't think of it till I experienced problems. So basically, my question is about making the materials.cs work. I read through some of the docs about this but didn't quite understand.

I have several textures on each of my models, and need to know how to make them all work.
So if anyone can point me in the right direction, that would be wonderful!

#1
04/15/2013 (12:02 pm)
Thats a bug I had, too. Sometimes the material data gets messed up.

You can check the materials.cs file manually, if there are dublicated entrys or delete the whole material, so a new one gets created, on next reload.

Another thing is you have to update the material attachment in the shape/object also. For example if you have a ground cover and changed the name of the material, you have to attach it in the properties panel of the ground cover again.

Or maybe you just forgot to hit the save button, in the material editor every change has to be saved and if you have more materials on one object you need to select them in the drop-down menu and change them also and hit save of course.
#2
04/15/2013 (12:10 pm)
Trust me, I hit save lol
I pretty much have ocd when it comes to the save button, I hit it at least 7 times before closing the material editor / changing the material or something..
I wonder if deleting the materials.cs would work, because I have several models doing this, why would they all need two to be generated? I think I just need to figure out the material.cs stuff so I can manually fix it and continue working, I think I need an example, so I can probably make one with that exporter I mentioned, and take a look. After I go to the store I will try deleting and the example material.cs and post here if I fix it.
#3
04/15/2013 (12:31 pm)
I noticed, that for every material in the modeling app torque creates a new material, so for "model 1" he creates "material 1" and for "model 2", "material 2", so if you later attach "material 2" to "model 1" there can be problems, because the imported model file says: use "material 1", but torque says, use "material 2"
Sometimes if you import "model 1" twice he creates "material 1" for the first time and for the second time torque creates something like "material 1_mat" and if you attach the model to "material 1" and this one is empty you get material editor, because he wants to use "material 1_mat" and thats where the settings stored.
If I find out when and why Torque does this I will tell you, I am happy that I got mine working, was a tough job telling torque to use one material for more objects. It is important that you give names to the materials in the modeling app, which are individual and you can remember, this helps avoid confusion.
#4
04/15/2013 (2:09 pm)
Hey all,

I have noticed that in a number of instances where this problem arises... it has to do with assigning multiple materials to an object but NOT changing the name of the materials. So, you have 10 different materials using default_01 as a material name.

Another issue.... (I would say 9 times out of 10) You need to maintain directory status. What I mean is if the collada model was imported from game/art/shapes/trees/whatever_model.DAE then the materials generally are looked for in that same directory. (I know this because it's a common issue with my packs.) People drag the folders where ever in their directory structure and the materials list does not get read correctly. So you get the orange "missing texture" map. You can get around this thing many times by performing a delete DSOs when you add new art to your levels in order to reset everything. Or alternately, import the model as a static mesh, remap the materials and save. Unfortunately, there is no 'proper way' to account for all the variations in directories between all developers... Not a bug really, just a limit of the engine.

Ron
#5
04/16/2013 (8:00 am)
Okay, I have some new information. I know how to solve my problem for the most part, but what prevents me from doing it is this
http://gyazo.com/d7c023b35a17b2ee8af3d10511a7a0f8.png?1366124175

That is on most of the models, and is causing problems. How can I make the models use something other than default..
Any help is appreciated, and so are the tips / heads up already posted here!
#6
04/16/2013 (6:27 pm)
Any ideas?
#7
04/16/2013 (7:02 pm)
That's a drop down menu, you can open it and chose.
#8
04/17/2013 (5:30 am)
To bad there is nothing to choose :(
http://gyazo.com/395438c05b2be4ad9808d79899924f78.png?1366201675
#9
04/17/2013 (5:47 am)
Try the second menu, or open the list of all materials and chose one from that, or create a new and chose that.
#10
04/17/2013 (7:35 am)
No, I am talking about the piece near SZ_Rock2.dae
As you can see, their is nothing to choose. It needs to be named something other than default, such as the models name, however I don't know if I can or how to change it.
#11
04/17/2013 (7:48 am)
To name a material, type a name and click the save button.

Sorry - make that "type a name, hit enter and then click the save button." In the editor it is common for the system to fail to see changes unless you hit enter after making them. So it is a good habit to always hit enter after changing any text field in the editor.
#12
04/17/2013 (7:54 am)
That's why you should create a new material, if there is nothing to chose, that's the button next to the save disk on the left and one button further, you can open and browse all materials also you can create a new one there also and select that to use.
#13
04/17/2013 (11:06 am)
Okay. I will post a more specific image lol
http://gyazo.com/003cb807db2b3b601b7086df652b49a3.png?1366221804
A new material doesn't work..
#14
04/17/2013 (1:32 pm)
That's not specific
#15
04/17/2013 (1:38 pm)
Okay. That image shows the "Default" thing I was talking about right?
My original problem is that the material does not stay the same when I change it by making a new one, or opening one, it changes. I decided I should make it stay with script, I figured out how to do that, it worked on one, until I realized that all the models have the materials assigned to "Default"
How can I make the models assign the materials to something else?

@Richard That will actually prove useful, as I couldn't get the name to stick, on a few I pressed enter just for the hell of it and it worked, I didn't make the connection though. Got it now though :D
#16
04/19/2013 (7:49 am)
Is it possible to change this?
#17
04/19/2013 (9:08 am)
Is it possible to understand this?