exporter .IGM material xml format

General News and accouncements regarding the Indigo render engine
mrCarnivore
Posts: 517
Joined: Sun Mar 04, 2007 6:20 am
Location: Stuttgart, Germany

Post by mrCarnivore » Thu Apr 12, 2007 6:49 pm

Very elaborate post. That should clear things up a bit.

But while I'm in the Announcement forum... do you really think it is necessary to have like 100 sticky posts in this forum? All the 0.6 test announcements for example should not be sticky any more imho.

zuegs
Posts: 380
Joined: Tue Jun 27, 2006 5:46 pm
Location: switzerland

Post by zuegs » Fri Apr 13, 2007 3:48 am

Thx radiance,

i can imaging "save" is easy to do but "load" :? :oops:
I NEED A XML PARSER FOR PYTHON WITH SOURCES !!! :roll: :)

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

Post by Whaat » Fri Apr 13, 2007 4:32 am

Hmmm...I know of a Ruby XML parser but it will take me a while to learn how to implement it. :? I wish I could code one myself. Maybe a code-monkey could post a generic XML parser algorithm in pseudo-code and the export writers could translate it into our respective scripting languages. Any takers?

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

Post by suvakas » Fri Apr 13, 2007 4:58 am

Well.. i did it with maxscript. It's not 100% functional yet, but the logic works. I'm using "<>" as delimiters while reading xml file and comparing the values i get with indigo material keywords. I store the keywords into variables in one function and when i reach to "/material" tag in file then I pass those collected keywords to another function that creates material accordingly. Nothing hard really.

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

Post by OnoSendai » Fri Apr 13, 2007 5:05 am

There will definitely be an XML parser for python (with src), as it is used a lot for web stuff.

zuegs
Posts: 380
Joined: Tue Jun 27, 2006 5:46 pm
Location: switzerland

Post by zuegs » Fri Apr 13, 2007 6:52 pm

THX very much radiance !!!! :D :D :D
I searched around for hours and only found stuff that uses external librarys that doesn't exist in Blender distribution. So thx a lot for this nice light-weight parser !

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

Re: exporter .IGM material xml format

Post by suvakas » Sat Apr 21, 2007 2:52 am

radiance wrote: -> textures must be pathless, eg not 'c:\dir\image.jpg' but 'image.jpg' instead!
I assume, that same goes to *.nk files too, right?
If the material has an nk, then that particular nk file gets exported and only the filename without path would be writen into xml code.

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

Post by Whaat » Thu May 03, 2007 5:01 am

suvakas,

Are you implementing Blend material load and save? If so how? The exporters should all do it the same way.

I don't think the nk files should be exported when you save an *.igm. It seems pointless.

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

Post by suvakas » Thu May 03, 2007 7:07 am

Yes, I do have blend material import/export.
I'm done with the whole *.igm thing actually. Maxigo has full *.igm support.

But what about blend materials? What do you exactly mean by "how" ?
I implemented "infinite" blend export/import. There can be any number of blend materials inside blend material.

[edit]
Ok. I just checked how i did it.
It's like this:

Mat 1
Mat 2

Blend:
<a_name>Mat 2</a_name>
<b_name>Mat 1</b_name

Eh.. i'm thinking here, that the actual order of materials that are used inside blend is not important at all as long as they are declared before blend material. The final order inside blend will be the same in all exporters since the <a_name> and <b_name> are the ones that are linking to actual materials. So I think you can't export it wrong in any way. Also my example is quite pointless :)


Do you want me to post an example igm?
Actually would be good to get some of your igm's too. To check any compatibility issues and etc.

About nk files. We need to decide how we are going to export those. Currently Maxigo exports nk's the same way as bitmaps. It exports the nk file into the material folder and writes its name (no path) into igm. Do you think it would be best to not include the actual nk file and leave it into Indigo folder?
I'm more towards including the nk file with material package. That way you can be 100% sure, that the material has all the files needed.

zuegs
Posts: 380
Joined: Tue Jun 27, 2006 5:46 pm
Location: switzerland

Post by zuegs » Thu May 03, 2007 7:30 am

@suvakas:
hope i can soon get my "*.igm" import/export for Blendigo working. I'am very interested in a complex sample igm file for test, something like a blend material of a nk-phong and a specular-medium. Can you PM me some or upload here? This will help a lot, thx :D

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

Post by Whaat » Thu May 03, 2007 8:10 am

suvakas wrote:But what about blend materials? What do you exactly mean by "how" ?
I mean: Do you include all the materials and blends and blends of blends and blends of blends...in the one *.igm file? Or, does the Blend material *.igm file just contain the XML code for that particular Blend material (alpha map, blend factor, a_name, b_name) and the user has to then load the a_name and b_name materials from separate *.igm files?

It sounds like you are using the first method. That method will not be easy for me to implement but I may give it a try. For my next release, I am not supporting Blend material *.igm but I will likely do it soon. Maybe I'm worried that I'll finally get it working and then Ono will change the Blend material to a Layered material that can have a_name....z_name :wink:
Do you want me to post an example igm?
Yeah, post some funky complex *.igm files (with and without Blend materials). I can do the same. Might as well use this forum to do it....

I still don't know what is the best way to handle nk files. I guess your way makes sense. I thought at first it would be hard to implement but now I think it would be fairly easy. :)

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

Post by suvakas » Thu May 03, 2007 10:13 am

Here are two blend materials i randomly created using 3ds Max procedural textures. "Random blend material" has blend inside blend. "Glass+stripes" is medium material blended with phong+nk.
I don't know how funky they are though 8)
Attachments
glass_with_stripes.jpg
glass_with_stripes.jpg (120.03 KiB) Viewed 8612 times
glass_with_stripes.zip
zip'ed igm
(52.49 KiB) Downloaded 412 times
random_blend_material.jpg
random_blend_material.jpg (118.15 KiB) Viewed 8613 times
random_blend_material.zip
zip'ed igm
(79.24 KiB) Downloaded 390 times

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

Post by Whaat » Fri May 04, 2007 2:22 am

suvakas:

Could you post a 3DS file of your material preview scene complete with lights, background, etc.? I found the scene in Blender format but it didn't have any lights. I want to use the exact same scene setup as you.

Thinking about importing your materials is giving me a headache. I will change my code in the future to be able to import blends and nested blends but for now, I won't support it. I would have re-write and re-test all of my .igm import code and I don't have time. I want to release the next version of SkIndigo within a week.

Whaat

User avatar
Kram1032
Posts: 6649
Joined: Tue Jan 23, 2007 3:55 am
Location: Austria near Vienna

Post by Kram1032 » Fri May 04, 2007 3:39 am

OMG :shock: 8) :shock: 8) :shock: 8)
they look SUCH cool :D

I like both, but especially the 2nd!

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

Post by suvakas » Fri May 04, 2007 5:55 am

Thanks Kram 8)

Here's the scene for you Whaat. Stronger light is 1350W and weaker is 100w.
I think you already have the grid texture so i didn't include it.

If you need any help implementing the blend materials, then feel free to ask. I remember, that i spent several hours thinking about how i should do the nested blends.
Attachments
material_preview_scene.zip
(229.08 KiB) Downloaded 385 times

Post Reply
42 posts

Who is online

Users browsing this forum: No registered users and 136 guests