C++ code for reading Indigo materials

A forum for exporter development discussion.
Post Reply
13 posts • Page 1 of 1
User avatar
OnoSendai
Developer
Posts: 6241
Joined: Sat May 20, 2006 6:16 pm
Location: Wellington, NZ
Contact:

C++ code for reading Indigo materials

Post by OnoSendai » Thu Mar 05, 2009 9:25 pm

Hi all,
I'd love to see some of the exporters for various modelling packages support importing Indigo materials, so that the MatDB can start becoming really useful.
But I realise that writing the code that can process a .igm file can be pretty difficult and time-consuming, especially when you have to cope with backwards compatibility in material XML specification.
So I'm releasing some C++ code that can parse Indigo materials, given the XML element. The XML parsing itself is done with TinyXML.

For the people that are working on an exporter that doesn't use C++, well, at least the code can provide a guideline of what needs to be done.

I've just been working on this over the last few days, so it's not fully tested yet.
However, this code should be pretty complete, and will be maintained in the future, as it's now also the code that Indigo uses to parse material XML.

Any feedback is welcome. Is this useful for exporter authors?
Attachments
indigo_utils_2.zip
(30.93 KiB) Downloaded 648 times
Last edited by OnoSendai on Sun Mar 08, 2009 3:23 pm, edited 1 time in total.

User avatar
fused
Developer
Posts: 3648
Joined: Fri Sep 22, 2006 7:19 am
Location: Berlin, Germany
3D Software: Cinema 4D

Re: C++ code for reading Indigo materials

Post by fused » Thu Mar 05, 2009 9:40 pm

OnoSendai wrote:Is this useful for exporter authors?
Yes!

User avatar
suvakas
3rd Place Winner
Posts: 2613
Joined: Mon Sep 04, 2006 11:08 pm
Location: Estonia
Contact:

Post by suvakas » Thu Mar 05, 2009 10:07 pm

Great idea !
Can't use it from Maxscript, but still..very good idea.

User avatar
CTZn
Posts: 7240
Joined: Thu Nov 16, 2006 4:34 pm
Location: Paris, France

Post by CTZn » Fri Mar 06, 2009 12:19 am

Nice move Ono !

This can certainly avoid some hassle and borrow some incertitudes (design wise), aye to the guidelines !
obsolete asset

User avatar
rgigante
Posts: 326
Joined: Wed Jun 28, 2006 6:46 am
Location: Italy

Post by rgigante » Fri Mar 06, 2009 2:18 am

:shock: A lot of great thing to study and apply!

Thanks, really really appreciated...(psss IT4XSI supports IGM since long ago :wink: )

R.

User avatar
Whaat
Developer
Posts: 1827
Joined: Fri Dec 22, 2006 6:15 am
Location: Canada
Contact:

Post by Whaat » Fri Mar 06, 2009 2:49 am

Great! Thanks Ono! This is sure to be extremely useful for all exporter writers. I just wished I had asked for this a long time ago... :) My material import code is almost done, I just need to spend about a week bug-fixing and testing it. :)

User avatar
fused
Developer
Posts: 3648
Joined: Fri Sep 22, 2006 7:19 am
Location: Berlin, Germany
3D Software: Cinema 4D

Post by fused » Fri Mar 06, 2009 12:31 pm

hey nik,

i dumped the old cindigo import code and completed the material import using your parser. still need to do the texture loading (yeah, i said itll be ready today, but i got heavily distracted by MGS4, Mirrors Edge and failblog.org ^^ ).
on the way i noticed that i really have to rewrite the material helper... im not sure if i can do that before 1.1 stable.

i also have a little problem here: it seems the gamma value in the RGB spectrum is missing!

User avatar
OnoSendai
Developer
Posts: 6241
Joined: Sat May 20, 2006 6:16 pm
Location: Wellington, NZ
Contact:

Post by OnoSendai » Fri Mar 06, 2009 2:01 pm

fused wrote: i also have a little problem here: it seems the gamma value in the RGB spectrum is missing!
Hi Fused,
sorry, what exactly do you mean by that?

User avatar
fused
Developer
Posts: 3648
Joined: Fri Sep 22, 2006 7:19 am
Location: Berlin, Germany
3D Software: Cinema 4D

Post by fused » Fri Mar 06, 2009 9:34 pm

OnoSendai wrote:Hi Fused,
sorry, what exactly do you mean by that?
i mean that there is no gamma variable in the IndigoRGBSpectrum but the xml rgb spectrum can hold rgb and gamma.

edit: i had a closer look at your source code and gamma is parsed and the color gets reverse gamma corrected... but im not sure if this is suitable :) (at least for my needs)

edit2: also i couldnt find a function for parsing mediums

User avatar
OnoSendai
Developer
Posts: 6241
Joined: Sat May 20, 2006 6:16 pm
Location: Wellington, NZ
Contact:

Post by OnoSendai » Sat Mar 07, 2009 11:54 am

Parsing media is not supported in the Indigo Utils yet, because strictly speaking they're not materials. However, since they are needed for .IGM import, I might add them in.

User avatar
fused
Developer
Posts: 3648
Joined: Fri Sep 22, 2006 7:19 am
Location: Berlin, Germany
3D Software: Cinema 4D

Post by fused » Sat Mar 07, 2009 1:42 pm

no problem, since they didnt change at all in the last material specs i still have the old code which is working ok for now.

User avatar
OnoSendai
Developer
Posts: 6241
Joined: Sat May 20, 2006 6:16 pm
Location: Wellington, NZ
Contact:

Post by OnoSendai » Sun Mar 08, 2009 3:24 pm

Updated to v2 with some backwards compatibility fixes.

User avatar
fused
Developer
Posts: 3648
Joined: Fri Sep 22, 2006 7:19 am
Location: Berlin, Germany
3D Software: Cinema 4D

Post by fused » Sat Mar 28, 2009 11:16 am

im having some problems with gcc and exceptions with the indigo utils.

without -fexceptions im getting errors on try {} catch {} and with on throw...
cant tell more about right now, but maybe sounds familiar for someone :)

Post Reply
13 posts • Page 1 of 1

Who is online

Users browsing this forum: No registered users and 6 guests