[GSoC 2008 - Accepted] OgreCollada

Threads related to Google Summer of Code
User avatar
xavier
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 9481
Joined: Fri Feb 18, 2005 2:03 am
Location: Dublin, CA, US
x 22

Re: [GSoC 2008 - Accepted] OgreCollada

Post by xavier »

OgreCollada is mostly inactive I think, but it is the most recent, yes.

I would imagine that if you wanted to take it over nanocell probably would be happy to give you admin rights on the project. As for FCollada patches, I wouldn't know where to send those -- is it hosted at SF now too?
Do you need help? What have you tried?

Image

Angels can fly because they take themselves lightly.
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Re: [GSoC 2008 - Accepted] OgreCollada

Post by jacmoe »

I would look to OpenCollada ->
http://code.google.com/p/opencollada/
It was registered september this year, and seems to be very active.
Could be a good alternative to FCollada.

I've always had mixed feelings towards Feeling Software (maybe pun intended? :P).
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
User avatar
xavier
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 9481
Joined: Fri Feb 18, 2005 2:03 am
Location: Dublin, CA, US
x 22

Re: [GSoC 2008 - Accepted] OgreCollada

Post by xavier »

jacmoe wrote:I would look to OpenCollada ->
http://code.google.com/p/opencollada/
It was registered september this year, and seems to be very active.
Could be a good alternative to FCollada.

I've always had mixed feelings towards Feeling Software (maybe pun intended? :P).
Even when I was using FCollada, I didn't like their attitude towards their COLLADA support -- it was essentially "well, we implemented support for the parts of COLLADA we needed, we don't care about the rest" (this came up when trying to import something exported from Sketchup, which uses a rarely-used feature in COLLADA, so OgreCollada couldn't work with it).
Do you need help? What have you tried?

Image

Angels can fly because they take themselves lightly.
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Re: [GSoC 2008 - Accepted] OgreCollada

Post by jacmoe »

Checked a bit, and one of the OpenCollada devs is also an Ogre4J developer (looks like the maintainer?) :)
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
User avatar
typist
Kobold
Posts: 36
Joined: Mon Apr 02, 2007 3:48 am
Location: Toronto, Canada

Re: [GSoC 2008 - Accepted] OgreCollada

Post by typist »

xavier wrote:OgreCollada is mostly inactive I think, but it is the most recent, yes.

I would imagine that if you wanted to take it over nanocell probably would be happy to give you admin rights on the project. As for FCollada patches, I wouldn't know where to send those -- is it hosted at SF now too?
Thanks for the very quick response! Also thank you for writing a great introductory book about OGRE-
it helped me learn OGRE quicker, will there be a second edition? No pressure, just asking! :)

About FCollada, yes I found it funny that they have effectively abandoned the open source port.
That's a shame, because this makes it hard for other open source projects coordinate with each
other. At least their license is liberal enough to permit modifications if one really wanted to go
ahead.

I think project should not grow cold otherwise it will become very difficult to update later on. I
suspect that's what happened to the other plugins that I tried. COLLADA spec moved on, OGRE moved
on, COLLADA DOM moved on, the tools themselves moved on, etc. So it is a mess trying to sort all
that out now. BTW, having them in the ogreaddons repository confused me because I assumed everything
worked smoothly when I downloaded them, only to realize much later that they are so behind - its not
worth pursuing them further.

I will wait a bit for nanocell to weigh in. If he is not interested in continuing development
further then maybe I might take it up, but as I have not handled development over SF yet, giving me
admin rights might not be such a good idea. :) With some help from you and nanocell I would be more
confident in taking it on, now that I brought some of it up-to-date with OGRE and VS2008. I would
be interested in making this port work nicely over Ubuntu, because it uses wxWidgets, which is a
windowing toolkit that I like.

Thanks
User avatar
typist
Kobold
Posts: 36
Joined: Mon Apr 02, 2007 3:48 am
Location: Toronto, Canada

Re: [GSoC 2008 - Accepted] OgreCollada

Post by typist »

jacmoe wrote:I would look to OpenCollada ->
http://code.google.com/p/opencollada/
It was registered september this year, and seems to be very active.
Could be a good alternative to FCollada.

I've always had mixed feelings towards Feeling Software (maybe pun intended? :P).
Thanks for the tip, I will examine opencollada in more detail later. A brief preliminary
examination of their port with OGRE shows that it is still in its infancy (at least that's what the
README file for OGRE says).
User avatar
xavier
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 9481
Joined: Fri Feb 18, 2005 2:03 am
Location: Dublin, CA, US
x 22

Re: [GSoC 2008 - Accepted] OgreCollada

Post by xavier »

typist wrote: Thanks for the very quick response! Also thank you for writing a great introductory book about OGRE-
it helped me learn OGRE quicker, will there be a second edition? No pressure, just asking! :)


Thank you for buying it :) I'm glad it helped. Unfortunately there doesn't seem to be any interest from any publishers in a second edition (which would include a lot more advanced topics).
I think project should not grow cold otherwise it will become very difficult to update later on. I
suspect that's what happened to the other plugins that I tried. COLLADA spec moved on, OGRE moved
on, COLLADA DOM moved on, the tools themselves moved on, etc. So it is a mess trying to sort all
that out now.
The biggest problem in general with all of the Ogre-COLLADA projects -- and myself and nanocell were no exception -- is that you run into a massive wall when it comes to skeletal animation; the COLLADA spec is just so general that it's almost impossible to tell how to convert the COLLADA representation to Ogre's animation system; I think nanocell made more progress on that part but I'm not entirely sure how far he got. Plus, there are also major stumbling blocks with material description; COLLADA simply is not expressive enough to map well to Ogre's material system (even with the shader-based effect support -- that is essentially nVidia-specific since it's really based around how CgFX works). It can be done, but it's a lot of work. ;)
I would be interested in making this port work nicely over Ubuntu, because it uses wxWidgets, which is a
windowing toolkit that I like.
I use wx as well in my tools (including the ColladaViewer) -- but it was nanocell that made it work on Linux...so I know it does work there, since that's what he was developing on. ;)
Do you need help? What have you tried?

Image

Angels can fly because they take themselves lightly.
User avatar
typist
Kobold
Posts: 36
Joined: Mon Apr 02, 2007 3:48 am
Location: Toronto, Canada

Re: [GSoC 2008 - Accepted] OgreCollada

Post by typist »

xavier wrote:
The biggest problem in general with all of the Ogre-COLLADA projects -- and myself and nanocell were no exception -- is that you run into a massive wall when it comes to skeletal animation; the COLLADA spec is just so general that it's almost impossible to tell how to convert the COLLADA representation to Ogre's animation system; I think nanocell made more progress on that part but I'm not entirely sure how far he got. Plus, there are also major stumbling blocks with material description; COLLADA simply is not expressive enough to map well to Ogre's material system (even with the shader-based effect support -- that is essentially nVidia-specific since it's really based around how CgFX works). It can be done, but it's a lot of work. ;)
This is excellent, because I am still learning about OGRE and COLLADA, so any potential pitfalls ahead would really help.
The way I see it is this: unfortunately we (open source community) may not have a choice when it comes to COLLADA.
It has very quickly become the defacto standard for commercial software, now that the major three: 3D Studio, Maya and XSI
are owned by Autodesk and they have thrown their weight behind COLLADA.

I think the exporter from Blender may need work on too, but the reality is we could be forced to support COLLADA.
I could be wrong, and if so I'd be happy to know.

Is there another format that competes on the same points that COLLADA does and is well supported by Blender and OGRE?
From what I understood, its the dotScene format but that is not universally supported is it?
User avatar
okki
Halfling
Posts: 90
Joined: Mon Jan 03, 2005 3:14 pm
Contact:

Re: [GSoC 2008 - Accepted] OgreCollada

Post by okki »

Just to clarify some stuff regarding COLLADA Open Source support - there are currently three open source and MIT licensed C++ libraries available for reading and writing COLLADA files.
  • the free version of FCOLLADA was abandoned in early 2008, beside being quite mature it had massive performance drawbacks due to it's DOM based approach. It's not auto-generated and therefor has no support for the 1.5 schema and is harder to maintain. Currently there is no active development going on for this project.
  • COLLADA DOM is another MIT license based implementation of a COLLADA reader, mostly auto-generated from the XSD but with an API that nearly resembles the plain XML file. It suffers from a in-memory (the name indicates it) DOM approach, too.
  • OpenCOLLADA is instead a SAX/stream based approach, a low level API that is auto-generated and a high level API that is hand-crafted. It's the basis for the OpenCOLLADA for 3ds Max and Maya plug ins, the latest Blender 2.5 trunk includes the OpenCOLLADA exporter/importer and there is ongoing support for some special topics like formulas and the kinematic model specification that was introduced in the COLLADA 1.5 specification through multiple universities.
We are supporting Ogre with an exemplary COLLADA to .mesh command line converter that called dae2ogre. It is not a plugin for Ogre but a standalone converter and we would love to see support for this important piece of a DCC pipeline by the Ogre community. As we are the maintainers of OpenCOLLADA and use it in our every day business we would encourage everybody to use and enhance this API, some of the techniques of OpenCOLLADA are explained in http://opencollada.org/OpenCOLLADA%20techniques.pdf
- ogre4j.org -
User avatar
typist
Kobold
Posts: 36
Joined: Mon Apr 02, 2007 3:48 am
Location: Toronto, Canada

Re: [GSoC 2008 - Accepted] OgreCollada

Post by typist »

okki wrote:
  • OpenCOLLADA is instead a SAX/stream based approach, a low level API that is auto-generated and a high level API that is hand-crafted. It's the basis for the OpenCOLLADA for 3ds Max and Maya plug ins, the latest Blender 2.5 trunk includes the OpenCOLLADA exporter/importer and there is ongoing support for some special topics like formulas and the kinematic model specification that was introduced in the COLLADA 1.5 specification through multiple universities.
We are supporting Ogre with an exemplary COLLADA to .mesh command line converter that called dae2ogre. It is not a plugin for Ogre but a standalone converter and we would love to see support for this important piece of a DCC pipeline by the Ogre community. As we are the maintainers of OpenCOLLADA and use it in our every day business we would encourage everybody to use and enhance this API, some of the techniques of OpenCOLLADA are explained in http://opencollada.org/OpenCOLLADA%20techniques.pdf
This thread keeps getting better all the time! :)

Thank you for clarifying these details. I will definitely look into the SAX-based approach more so now than before.
Unfortunately I am working on my thesis that has a time commitment so I cannot explore OpenCollada further at
this time, however, as OpenCollada is a fairly recent project, I would love to contribute once I can 'see' a place
for me to contribute, and after I finish my thesis commitment.

I did some heavy lifting, in terms of effort on my part as everything was new to me, to get FCollada to work and bring
the OgreCollada project in line with the latest OGRE version. I did not want my contribs to go to waste, which is why I
began responding to this thread.

From your description OpenCollada looks like the way to go, particularly if one is interested in making it a
plugin/addon for OGRE and considering that there is also support in Blender 2.5. Very nice. Thank you for your timely
response.

Best,

Mark.
User avatar
typist
Kobold
Posts: 36
Joined: Mon Apr 02, 2007 3:48 am
Location: Toronto, Canada

Re: [GSoC 2008 - Accepted] OgreCollada

Post by typist »

okki wrote:J As we are the maintainers of OpenCOLLADA and use it in our every day business we would encourage everybody to use and enhance this API, some of the techniques of OpenCOLLADA are explained in http://opencollada.org/OpenCOLLADA%20techniques.pdf
This are very impressive loading times in 3D Studio.

While I have not tested opencollada, I know for a fact that read/write of COLLADA files can take a long time in 3D
Studio even for relatively uncomplicated files. There is constant improvement in the COLLADA loaders for 3D Studio, so
one may need to install the updated COLLADA loader extensions/scripts after doing the default 3DStudio install.
Having the version numbers for each of the items: OpenCOllada, Feelings, Autodesk,etc. would make the table of
comparisons more meaningful.
User avatar
xavier
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 9481
Joined: Fri Feb 18, 2005 2:03 am
Location: Dublin, CA, US
x 22

Re: [GSoC 2008 - Accepted] OgreCollada

Post by xavier »

typist wrote: From what I understood, its the dotScene format but that is not universally supported is it?

COLLADA is a data interchange format. dotScene is a scene-description format. They solve two relatively orthogonal problems, altho some confusion is expected due to the existence of a scene graph in COLLADA documents as well.
Do you need help? What have you tried?

Image

Angels can fly because they take themselves lightly.
User avatar
bulkhead
Gnoblar
Posts: 20
Joined: Sat Feb 21, 2009 8:44 am

Re: [GSoC 2008 - Accepted] OgreCollada

Post by bulkhead »

Hi all,

Glad to see that this thread is alive after a long while. Thanks to typist for the ignition :wink:

I have been diverted to other part of my project for a while, and now I'm back to look into the COLLADA loader. I have also tried using the OgreCollada plugin (with FCollada version) on Ogre ver1.6.1. It works fine for a single model, but when I tried to export a scene with XRef from 3DS Max, 3 issues need to be resolved:

1. 3DS Max doesn't support *.dae file as XRef objects.
2. I would need to manually tweak the exported COLLADA scene (i.e. replace all .max URI with .dae, and add a line after instance_material for the texture mapping) to get it loaded using OgreCollada.
3. Only 1 instance of the external referenced model is loaded. Still trying to troubleshoot this issue.

That's the status of my OgreCollada at the moment.

But I'm really keen to find out more about the OpenCollada version of Ogre plugin. I have also tried out the 3DS Max importer/exporter using OpenCollada, and found that it is more promising (as it supports 3D models downloaded from Google 3D Warehouse), and better performance (in terms of loading time).

Is kex and team still actively working on the plugin? I'm not sure if it's a good idea and how feasible it is to adopt the OgreCollada plugin and just simply replace the FCollada parts with OpenCollada.

Any update or comment would be much appreciated.

Thanks :lol:
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Re: [GSoC 2008 - Accepted] OgreCollada

Post by jacmoe »

If you mean OpenCollada, just view the updates yourself:
http://code.google.com/p/opencollada/updates/list
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
User avatar
bulkhead
Gnoblar
Posts: 20
Joined: Sat Feb 21, 2009 8:44 am

Re: [GSoC 2008 - Accepted] OgreCollada

Post by bulkhead »

Hi jacmoe,

Nope, I'm referring to this instead:
Re: [GSoC 2008 - Accepted] OgreCollada
by kex » Wed May 27, 2009 10:46 am

Status of OgreCOLLADA
******************************
The code in svn trunk is the one from last year's GSoC. It is mainly written by xavier; nanocell added basic Skeletal Animation support. It uses FCOLLADA to parse files. That lib is not maintained anymore and has some drawbacks, like big memory consumption or no support for <library_nodes> (required e.g. to read files written by sketchup).

In the OgreCOLLADA private dev forum has been a small team (nanocell, radman, me) discussing further steps. We decided to switch to OpenCOLLADA mainly because it uses a SAX approach and thus needs by far less memory.
....
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Re: [GSoC 2008 - Accepted] OgreCollada

Post by jacmoe »

I don't think it got any further than just talk. :)
Nanocell quit because he got a job.
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
User avatar
bulkhead
Gnoblar
Posts: 20
Joined: Sat Feb 21, 2009 8:44 am

Re: [GSoC 2008 - Accepted] OgreCollada

Post by bulkhead »

Thanks jacmoe :wink:
In that case, I'll evaluate the feasibility and see how much effort it'll take to swap the two libraries, coz I left approx. 1 month to deliver this module for my project :P
User avatar
typist
Kobold
Posts: 36
Joined: Mon Apr 02, 2007 3:48 am
Location: Toronto, Canada

Re: [GSoC 2008 - Accepted] OgreCollada

Post by typist »

bulkhead wrote: Glad to see that this thread is alive after a long while. Thanks to typist for the ignition :wink:
You are welcome. I am glad to have found a fellow traveller! :)

I think it is critical to keep the lessons learned by previous OGRE + COLLADA pioneers alive, otherwise they risk getting lost forever because the effort needed to update them becomes too great. That seems to be the case for the other Collada plugins in the OGRE addons repository, by that I mean ColladaPlugin and ColladaPlugin2, I suspect one would need to put in a lot of effort to upgrade them.
bulkhead wrote: I have also tried using the OgreCollada plugin (with FCollada version) on Ogre ver1.6.1. It works fine for a single model
Can you be specific please? I, too, had the similar success but only with the COLLADA files that are present with the OgreCollada samples in that repository. When I exported a simple cube, or the monkey, Suzanne, from the present version of Blender I could not read them with OgreCollada. So I am presuming you mean you had success with the samples that are present in the OgreCollada repository?
bulkhead wrote: but when I tried to export a scene with XRef from 3DS Max, 3 issues need to be resolved:
1. 3DS Max doesn't support *.dae file as XRef objects.
2. I would need to manually tweak the exported COLLADA scene (i.e. replace all .max URI with .dae, and add a line after instance_material for the texture mapping) to get it loaded using OgreCollada.
3. Only 1 instance of the external referenced model is loaded. Still trying to troubleshoot this issue.
This means you had difficulty importing COLLADA from a recent export from 3D Studio. I suspect that 3D Studio, and Maya, have moved on with newer versions since OgreCollada was released. The newer versions of 3D Studio, circa 2009, might not be exporting it in the format that OgreCollada expects.

I know COLLADA exported from Blender 2.49, even if it is a simple cube, does not import correctly with OgreCollada, and I suspect that COLLADA exported from latest 3D Studio versions do not import as well. Can you confirm this?
bulkhead wrote: That's the status of my OgreCollada at the moment.
I also presume that you needed to tweak the source code to get it to work with the current OGRE version. If so what do you plan to do with those changes? And what platform are you working on? I got it to work on Windows Vista, but not Ubuntu 9.04. By that I mean, I got OgreCollada to compile on both platforms but for some reason I cannot view the sample COLLADA examples on Ubuntu 9.04 at the moment but I think it should be possible to get it to work, xavier confirmed this in an earlier post because nanocell was working on Ubuntu as his primary platform.

Many questions I know but it would be nice if we can combine our changes.
User avatar
bulkhead
Gnoblar
Posts: 20
Joined: Sat Feb 21, 2009 8:44 am

Re: [GSoC 2008 - Accepted] OgreCollada

Post by bulkhead »

Hi typist,

Yeah, indeed it's tough to work alone on this new format.
typist wrote:
Can you be specific please? I, too, had the similar success but only with the COLLADA files that are present with the OgreCollada samples in that repository. When I exported a simple cube, or the monkey, Suzanne, from the present version of Blender I could not read them with OgreCollada. So I am presuming you mean you had success with the samples that are present in the OgreCollada repository?
...
I know COLLADA exported from Blender 2.49, even if it is a simple cube, does not import correctly with OgreCollada, and I suspect that COLLADA exported from latest 3D Studio versions do not import as well. Can you confirm this?
I have not tried with Blender. So far, I have been testing my codes on Windows XP and 3DS Max 2009.

I obtained the OgreCollada codes from the svn: https://svn.clashofsteel.net:8445/OgreCollada/trunk and exported some simple models used in my project (e.g. cubes with texture to model houses and buildings) from 3DS Max using the ColladaMax ver3.05c from SourceForge. Since both of them are using FCollada, the exported COLLDA models can be viewed in OgreCollada Viewer. One thing to note is that when exporting from 3DS Max, you have to select the save as file type as COLLADA (*.DAE), instead of the Autodesk COLLADA (*.DAE).

So far viewing a single model is fine. The problem is when I tried to export a scene (with a few models referenced externally), 3DS Max doesn't support XRef of *.DAE type. So I have to manually modify the exported *.DAE file to correctly reference the respective COLLADA models.
typist wrote:
If so what do you plan to do with those changes?
Just like you, I'm also very new to this forum, and definitely my codes need to be reviewed by the knowledgeable folks. I'm thinking maybe we can post our changes to this thread, and let sinbad or other moderators to review them. What do you think?
User avatar
xavier
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 9481
Joined: Fri Feb 18, 2005 2:03 am
Location: Dublin, CA, US
x 22

Re: [GSoC 2008 - Accepted] OgreCollada

Post by xavier »

I don't think that forums are a good place for that, to be honest. A snippet here or there if you have a question about something you don't understand is fine, but it sounds like you intend to post whole libraries worth of code for review. Plus, you also assume that someone wants to review your code. ;)
Do you need help? What have you tried?

Image

Angels can fly because they take themselves lightly.
User avatar
typist
Kobold
Posts: 36
Joined: Mon Apr 02, 2007 3:48 am
Location: Toronto, Canada

Re: [GSoC 2008 - Accepted] OgreCollada

Post by typist »

xavier wrote:I don't think that forums are a good place for that, to be honest. A snippet here or there if you have a question about something you don't understand is fine, but it sounds like you intend to post whole libraries worth of code for review. Plus, you also assume that someone wants to review your code. ;)
I agree that the forums would not be the place for posting the changes, and you are also right that someone needs to review those changes. The question is who do we send the changes to and how to do we go about doing the code review?

What do you suggest we do? TIA. :)
Vectrex
Ogre Magi
Posts: 1266
Joined: Tue Aug 12, 2003 1:53 am
Location: Melbourne, Australia
x 1
Contact:

Re: [GSoC 2008 - Accepted] OgreCollada

Post by Vectrex »

Perhaps ask Sinbad to start an OgreAddons forum for it?
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Re: [GSoC 2008 - Accepted] OgreCollada

Post by jacmoe »

typist wrote:I agree that the forums would not be the place for posting the changes, and you are also right that someone needs to review those changes. The question is who do we send the changes to and how to do we go about doing the code review?
You could try and put it at Indefero. :)
Here -> http://www.indefero.net/plans.html
It's got a code review module, so it will be perfect for OgreCollada.
As long as it doesn't get any bigger than 25 MB, it's free.
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
User avatar
bulkhead
Gnoblar
Posts: 20
Joined: Sat Feb 21, 2009 8:44 am

Re: [GSoC 2008 - Accepted] OgreCollada

Post by bulkhead »

Hi all,

I encounter a problem with loading texture, and couldn't figure out what's the cause. Please help.

I was trying to integrate the OgreCollada to my application, and some textures are missing. After debugging for weeks, I noticed that the problem will happen if I initialize the resources in resources.cfg (by calling ResourceGroupManager::getSingleton().initialiseAllResourceGroups()) before I load the .dae files.

After tracing further, I found out that the problem lies in TextureUnitState::mTextureCoordSetIndex. ColladaMax exports the .dae object with texture coordinate set 1. When the .dae file is parsed, the TextureUnitState is created and setTextureCoordSet() is set correctly, but when trying to assign this material to a submesh using SubMesh::setMaterialName(), the texture coordinate set will be reseted to 0.

In the following codes, set1 will be equal to 1, but set2 will be 0.

Code: Select all

unsigned int set1 = pMtl->getTechnique(0)->getPass(0)->getTextureUnitState(0)->getTextureCoordSet();
pSubMesh->setMaterialName(pMtl->getName());

Ogre::MaterialPtr mtlPtr = Ogre::MaterialManager::getSingleton().getByName(pSubMesh->getMaterialName());
unsigned int set2 = mtlPtr->getTechnique(0)->getPass(0)->getTextureUnitState(0)->getTextureCoordSet();
Any idea what is missing? Thanks in advanced.
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 66
Contact:

Re: [GSoC 2008 - Accepted] OgreCollada

Post by sinbad »

The texture coordinate set should only be non-zero if the model contains more than one set of texture coordinates, which is usually only the case if you have alternate mappings such as lightmaps. Check that your meshes have genuinely got 2 UV sets - you can always change it in the material if you like but you need to ask why you have more than one UV set in your model if so.
Post Reply