www.quadsoftware.com
FAQ FAQ†† Search Search†† Memberlist Memberlist†† Usergroups Usergroups
Register††::† Log in Log in to check your private messages


Post new topic††Reply to topic
†Help with COLLADA and textures ę†View previous topic :: View next topic†Ľ†
Author Message
mkolb
PostPosted: Thu Sep 06, 2007 9:16 am† †Post subject: Help with COLLADA and textures Reply with quote



Joined: 21 Aug 2007
Posts: 12

Hi all,

I tried to place some geometrical objects in COLLADA format in my scene.
The geometrical data gets loaded properly, but the texture is never assigned. I saw there are some materials in the repository, but they don't take textures into account as far as i could see.
The texture name is saved in the COLLADA file itself, so why doesn't it get assigned or how can I assign that texture?
Thanks in advance!!
Regards
Back to top
View user's profile Send private message
ALicu
PostPosted: Thu Sep 06, 2007 12:06 pm† †Post subject: Reply with quote



Joined: 12 Feb 2007
Posts: 1327

Hello, for the textures to be assigned we need to write a special material in the COLLADA file using for example OpenGL technique. The problem is that no current modeling application will read that material. They can claim COLLADA compatibility but they don't have to read all the possible features.
One solution for this is to setup the material manual in the modeling application you are using. In 3DS Max, for example, we've user composite material to represent masked textures. COLLADA cannot represent composite material so we had to setup it manually (the mapping is saved as unitary mapping so you can play with tiling to match it as in Grome).

Let me know what program are you using to read COLLADA and we will try to help you.

Regards,
Adrian L.
Back to top
View user's profile Send private message
mkolb
PostPosted: Thu Sep 06, 2007 12:18 pm† †Post subject: Reply with quote



Joined: 21 Aug 2007
Posts: 12

COLLADA is just a work-around for me, since I don't want to write an import plugin, because there are already some in the pipeline as you told me earlier (obj, 3ds, and the likes).
I have obj which I arrange in Blender, those obj are converted to COLLADA using MeshLab, an open source tool for viewing and converting models.
And as I understood MeshLab does export which it has imported before (e.g if the mesh had vertex normals, MeshLab will export them as the option is wanted) and those .obj had material information.
Back to top
View user's profile Send private message
mkolb
PostPosted: Mon Sep 10, 2007 7:29 am† †Post subject: Reply with quote



Joined: 21 Aug 2007
Posts: 12

The information I've gathered so far:
I can export COLLADA with a texture name and a material assigned from Blender. However anytime I have to remove the source_data attribute from the file in order to prevent a crash in Grome and just the "use uv image" flag in Blender creates a visible result in Grome.
After having removed the attribute it works just fine in Grome, but I can just see the correct material/texture assigned in the Package Browser, if I just want to browse the resources.
But if I want to spawn geometrical objects, the same object which looked good before doesn't get assigned the texture anymore. Why is that?
I supposed if it works if I just browse the object it should also work if I spawn the same object?
I don't know if I made myself clear here, so please ask if something is unclear.

Thanks in advance!
Regards
Back to top
View user's profile Send private message
ALicu
PostPosted: Tue Sep 11, 2007 7:33 am† †Post subject: Reply with quote



Joined: 12 Feb 2007
Posts: 1327

Hello, just to be sure. Are you saying that you can see the texture assigned in Package Browser but not after you spawn the object? Also, please make sure the textures are in the correct path as written in the collada file. Can you send me a small object with its texture? (you can email it to licu @ quadsoftware.com)

Regards,
Adrian L.
Back to top
View user's profile Send private message
mkolb
PostPosted: Tue Sep 11, 2007 10:18 am† †Post subject: Reply with quote



Joined: 21 Aug 2007
Posts: 12

Exactly, if I browse my geometrical objects in the package browser, the texture gets assigned properly, so that's ok.
But if I want to spawn an geometrical object and the package browser opens, to select the object to spawn, every object doesn't get a texture assigned and also those objects which are spawned then don't look correct.
I looked into the collada file, there the texture is saved in a relative path(pointing to folder you won't have), so it won't be correct for you unless you correct by hand. Nevertheless I've sent it to you.
Thanks in advance!
Regards.
Back to top
View user's profile Send private message
ALicu
PostPosted: Wed Sep 12, 2007 1:37 pm† †Post subject: Reply with quote



Joined: 12 Feb 2007
Posts: 1327

Hello,

Iíve taken the file you sent me and applied the coherency test on it (there is a program somewhere at collada.org that does coherency tests on dae files). It seems that Blender doesnít respect a lot of rules when writing collada files. Iíve then taken the specification document and some valid dae files and compare them with your file and end up with the following modifications to be made:

- I donít think that the material name your file has is valid (i*Stadt1*3FAC15A4*mate). I may be wrong though. Iíve changed the material and effects names just to be sure it is working.
- Effect diffuse must link through a sampler / surface to the image, not directly to the texture
- The material in your file is not linked to the effect (it has something like instance_effect url="#", where after # the effect id should follow but it is missing).
- The id of the effect must be present on the effect tag and not on the technique.
- The name of the image file in init_from must be:
<init_from>file:///haus6.tga</init_from>
file:/// must be used to identify a correct URI.

So, Iíve modified your file by hand and now it is working fine. I've sent you the file by email. You can use a text-compare tool to see the modifications Iíve made between your old file and this one.

My opinion is that Blender support for COLLADA export is poor (I know they are using a script written by hand and not official collada libraries to write the files). Please check the exported dae files with coherency test tool to see if they are correct.

Regards,
Adrian L.
Back to top
View user's profile Send private message
ALicu
PostPosted: Wed Sep 12, 2007 2:06 pm† †Post subject: Reply with quote



Joined: 12 Feb 2007
Posts: 1327

Hi, and another thing. The COLLADA plugin reads only Blinn materials. Seems that Blender is using Phong. So I've modified the plugin to read phong too.
Please download a new version of the plugin from:

http://www.quadsoftware.com/storage/ColladaStorage.rar

Just unrar the file in Plugins directory in the Grome installation folder overwritting the old one. This addition will be present in the next patch of Grome but for
now you can manually install it in this way.

Regards,
Adrian Licu
Back to top
View user's profile Send private message
mkolb
PostPosted: Thu Sep 20, 2007 7:51 am† †Post subject: Reply with quote



Joined: 21 Aug 2007
Posts: 12

Just a small addition to the previous talk, I downloaded the new latest COLLADA Exporter for Blender, changed the material names to meaningful vaues and checked the flag "Use UV Image Mats".
The exported meshes work fine in Grome.
Just for those who also use resp. want to use Blender and Grome together.
Regards
Back to top
View user's profile Send private message
ALicu
PostPosted: Thu Sep 20, 2007 7:54 am† †Post subject: Reply with quote



Joined: 12 Feb 2007
Posts: 1327

Hi, thank you for let us know that. I hope COLLADA gets more and more used and the support is getting better.
Back to top
View user's profile Send private message
Display posts from previous:
Post new topic††Reply to topic Page 1 of 1

Jump to:†



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Based on a template by Dustin Baccetti
Powered by phpBB © 2001, 2005 phpBB Group