Game Development Community

Collada Material Import Problem RESOLVED (THREED-1733)

by Aaron ward · in Torque 3D Professional · 04/23/2011 (3:03 pm) · 8 replies

Hi everyone

I am getting really annoyed with the T3D material editor. How come every time I import a collada object from sketchup the textures work fine but as soon as I save the mission and restart it they are all messed up?

I have tried setting prefixes, manually assigning materials but they never EVER stay where they should.
AAAAAAAAAAHHHHHHH!!!

I know its most likely my fault and that im doing something wrong but I don't have a clue what. I have been up hours reading the documentation but it doesn't explain it.

It's very frustrating, if anyone could shine some light on this subject I will be eternally grateful.

Problem:

When exporting models from Sketchup 8 any materials applied to the shape will be given generic names i.e. material_1 material_2 material_3

if you then import these to Torque and have imported many models using the same method the materials will clash in the material system.

Solution:

Edit the .dae file and rename all materials in this file; also rename the corresponding materials in the model folder.

Import the .dae in Torque by simply opening it in the editor

When importing give the file a unique prefix i.e. (plank01a)

Sometimes just giving the file a prefix can solve this problem but i have found that it still causes problems as the materials already mapped.




#1
04/23/2011 (4:07 pm)
@Aaron

I've entered a ticket for this. THREED-1733

Please email me (tom@sickheadgames.com) your collada file and textures along with some screenshots of what it looks like when its "right" and what it looks like when its "wrong".

With this we should be able to reproduce the problem and solve it for 1.1 final.
#2
04/23/2011 (4:12 pm)
Ooooh, can I send you some, too? I created a single multi-subobject textured shape in 3DS Max to test creating level geometry and it came out weird. The correct textures are in the correct places, but the mapping is strange to say the least....
#3
04/23/2011 (5:22 pm)
@tom

Sent :)
#4
04/24/2011 (2:33 pm)
@Richard - It sounds like a different issue... but sure... start a thread on it with some screenshots of the issue and we can look into it.
#5
04/29/2011 (6:30 pm)
Ok i've been looking into this and still haven't found a fix yet but I do think it has something to do with turning on DSO generation by commenting out #define TORQUE_NO_DSO_GENERATION in torqueConfig.h

I think because a materials.dso is generated that it is not possible to update the materials list properly or something because a file already exists with material information - which would be why when you update a material using the editor it messes up and reverts to the default material.

any feedback on this?

*edit - I tried changing a texture with DSO generation off and it still didn't update the material properties properly :@
#6
05/02/2011 (1:10 am)
Hi Aaron,

I have the files you sent, but I haven't been able to reproduce the problem. I import the building model and place it in a level, then restart Torque, and the correct textures are still in place.

If your level contains several models exported from Sketchup, I think you might have material name clashes (ie. the same material name is used in more than one model). Sketchup exports models with generic material names like "material_2", "material_3" etc, so it is a good idea to use the Collada Import Gui to add a unique prefix to the material names to avoid clashes.

When you restart Torque a warning message is generated in the console for any Materials that override an existing mapping. It would pay to check for this, and also to take a look at the generated materials.cs script for any model that is causing problems to make sure everything looks ok.

#7
05/14/2011 (1:43 pm)
Hey Chris,

I did use the prefix when importing but my materials still messed up. I think I fixed my problem though, I edited the .dae file and renamed the textures in there and also the textures in the corresponding model texture folder - then re imported the shape.

Wouldn't it be much easier to load the textures that the model says it should load instead of using the material system? it seems organised enough to not cause any problems because each shape has its own texture folder anyway and if I really wanted to use the same texture on a different model i would just edit the .dae file to point it there...

It would be nice to override this, I personally find the material system frustrating to work with but I know many people praise it also.

Thanks everyone for the feedback, I really appreciate it :)
#8
05/26/2011 (11:41 am)
Neither Chris or anyone on the QA team were able to reproduce this issue. We think that it may have actually been a duplicate of an issue reported by the art team and was fixed already, so it looks like this has been fixed.

Fixed in 1.1 Final.