Blendigo for v1.0
Thanks for your reply, Kram1032.
You're right about that disadvantage. So we have to think which of OB or ME is better to use in each situation that you are facing. Using OB is not always good, but sometimes it is important and even much better than using ME. I think it is case-by-case.
As you mentioned, using OB doesn't make it possible to use multiple materials in a single mesh, and when I have to do such a kind of thing, like making a charactor, I will also use ME. (the current version of Blendigo seems to be unavailable for that usage of multiple materials, though.)
You're right about that disadvantage. So we have to think which of OB or ME is better to use in each situation that you are facing. Using OB is not always good, but sometimes it is important and even much better than using ME. I think it is case-by-case.
As you mentioned, using OB doesn't make it possible to use multiple materials in a single mesh, and when I have to do such a kind of thing, like making a charactor, I will also use ME. (the current version of Blendigo seems to be unavailable for that usage of multiple materials, though.)
- afecelis
- Posts: 749
- Joined: Tue Aug 01, 2006 4:14 am
- Location: Colombia
- 3D Software: Blender
- Contact:
Many thanks for the thorough explanation hans! 
Now I get the point, useful specially when planning to do a lot of instances. Interesting approach. Good thing there are many others testing and suggesting new stuff for the better sake of the script.
On a side note, current blendigo does export multiple materials fine.
regards,
Alvaro

Now I get the point, useful specially when planning to do a lot of instances. Interesting approach. Good thing there are many others testing and suggesting new stuff for the better sake of the script.
On a side note, current blendigo does export multiple materials fine.
regards,
Alvaro
AMD Ryzen 7 1800 @3.6ghz, 32GB ddr4 3200 mhz Ram, Nvidia RTX 3060 12GB, Win10, Blender/Sketchup/Modo/Cinema4d
Oh, really? I'm sorry. I looked into the script codes when I tried to modify it, though. Any codes related to the process to read materials' information from Blender that I found were all written like "mat0 = mesh.materials[0]", so I thought it would use only the first material of them in a mesh because of the code "materials[0]". I have to look into it more. Thanks for your indication of my mistake.afecelis wrote:On a side note, current blendigo does export multiple materials fine.
- afecelis
- Posts: 749
- Joined: Tue Aug 01, 2006 4:14 am
- Location: Colombia
- 3D Software: Blender
- Contact:
hehehe, now you made me doubt, lol 
Will do a quick multi-material scene and confirm.
EDITED: just did a cornell box with multiple materials on it and they were exported just fine
phewh!

Will do a quick multi-material scene and confirm.
EDITED: just did a cornell box with multiple materials on it and they were exported just fine

Last edited by afecelis on Mon Jan 21, 2008 7:27 am, edited 1 time in total.
AMD Ryzen 7 1800 @3.6ghz, 32GB ddr4 3200 mhz Ram, Nvidia RTX 3060 12GB, Win10, Blender/Sketchup/Modo/Cinema4d
Sounds like linking to OB is useful for instance only. I have not used OB before but the way Indigo works is that it redefines the material before the next reference to the instance comes up. (for anyone that might not know) Check out the instance testscene that comes with Indigo.
I have not thought about it, but maybe this problem can be sorted some other way? So that there can be support for mutliple mats on instances...it seems you would have to search through the mesh and examine its materials, and put them in a list for materials that can/should be redefined next time an instance is found and right before the <model> tags are printed.
This would allow instances to have the same type of multiple materials on them, but also allow you to switch colors. Since you still cannot alter the mesh data.
EDIT: But I am still not sure where these new materials would be stored and how to tell when to redfine the original...
I have not thought about it, but maybe this problem can be sorted some other way? So that there can be support for mutliple mats on instances...it seems you would have to search through the mesh and examine its materials, and put them in a list for materials that can/should be redefined next time an instance is found and right before the <model> tags are printed.
This would allow instances to have the same type of multiple materials on them, but also allow you to switch colors. Since you still cannot alter the mesh data.
EDIT: But I am still not sure where these new materials would be stored and how to tell when to redfine the original...
Content contained in my posts is for informational purposes only and is used at your own risk.
Thanks all.
To make a multi-material scene means to use BLENDED type for "Indigo mat:"?
To make a multi-material scene means to use BLENDED type for "Indigo mat:"?
Oh, thank you so much. I'm looking forward for the next version.SmartDen wrote:@Hans
Thanx for explanation. I'll take over your code in the blendigo
I'm sorry if I have a misunderstanding (because my English is bad), but to follow your instruction, do I have to edit the xml file that is exported with Blendigo?Wedge wrote:I have not thought about it, but maybe this problem can be sorted some other way? So that there can be support for mutliple mats on instances...it seems you would have to search through the mesh and examine its materials, and put them in a list for materials that can/should be redefined next time an instance is found and right before the <model> tags are printed.
This would allow instances to have the same type of multiple materials on them, but also allow you to switch colors. Since you still cannot alter the mesh data.
Hi Hans, I am not sure how Blendigo works with instances.
But looking at how Indigo allows you to work with instances you can:
*have a multi material mesh instanced
*change the colors of the materials (but not which faces they are applied to, since this requires you to edit the mesh)
So for example you have a red and blue box you instance. You want to change the colors to green and yellow on the instanced box.
In the xml you would:
1. declare <material> Red and Blue
2. write <mesh> of box and first <model> tag (this is for the red and blue box)
3. Now you want to redefine red and blue material to green and yellow (you cannot change the name of the material, since this is still called red and blue in the <mesh> section) So you redefine red and blue materials and change colors:
4. Lastly you have your instance of the box <model> tags (that refer to the same materials but now they have been redefined to different colors)
Note that now red and blue is no longer red and blue, it has been redefined to green and yellow. So any other meshes that refer to red and blue will be green and yellow instead. Until red and blue are redefined back to red and blue.
So this seems tricky to me on how to handle this in an exporter. Even if this was done quick and dirty by printing out new <material> tags before every <model> tag still there needs to be a way to store the newly intended materials and a way to find out when to redefine them. I would help out more but right now I am busy with other things. I hope that was easier to understand.
But looking at how Indigo allows you to work with instances you can:
*have a multi material mesh instanced
*change the colors of the materials (but not which faces they are applied to, since this requires you to edit the mesh)
So for example you have a red and blue box you instance. You want to change the colors to green and yellow on the instanced box.
In the xml you would:
1. declare <material> Red and Blue
Code: Select all
<material>
<name>red</name>
<diffuse>
<albedo_spectrum>
<rgb>
<rgb>1 0 0</rgb>
<gamma>2.2</gamma>
</rgb>
</albedo_spectrum>
</diffuse>
</material>
<material>
<name>blue</name>
<diffuse>
<albedo_spectrum>
<rgb>
<rgb>0 0 1</rgb>
<gamma>2.2</gamma>
</rgb>
</albedo_spectrum>
</diffuse>
</material>
3. Now you want to redefine red and blue material to green and yellow (you cannot change the name of the material, since this is still called red and blue in the <mesh> section) So you redefine red and blue materials and change colors:
Code: Select all
<material>
<name>red</name>
<diffuse>
<albedo_spectrum>
<rgb>
<rgb>0 1 0</rgb>
<gamma>2.2</gamma>
</rgb>
</albedo_spectrum>
</diffuse>
</material>
<material>
<name>blue</name>
<diffuse>
<albedo_spectrum>
<rgb>
<rgb>1 1 0</rgb>
<gamma>2.2</gamma>
</rgb>
</albedo_spectrum>
</diffuse>
</material>
Note that now red and blue is no longer red and blue, it has been redefined to green and yellow. So any other meshes that refer to red and blue will be green and yellow instead. Until red and blue are redefined back to red and blue.
So this seems tricky to me on how to handle this in an exporter. Even if this was done quick and dirty by printing out new <material> tags before every <model> tag still there needs to be a way to store the newly intended materials and a way to find out when to redefine them. I would help out more but right now I am busy with other things. I hope that was easier to understand.
Content contained in my posts is for informational purposes only and is used at your own risk.
Thanks for your kind explanation, Wedge.
Looking at the xml codes, it seems that the mesh has only one material at a time because it has been redefined to green and yellow as you stated. It would be the same thing as saying that the red and blue materails in the xml are not defined. I haven't understood how I should take the advantage.
By the way, I'm still wondering if the multi-material object can be created with BLENDED type in Blendigo...
Looking at the xml codes, it seems that the mesh has only one material at a time because it has been redefined to green and yellow as you stated. It would be the same thing as saying that the red and blue materails in the xml are not defined. I haven't understood how I should take the advantage.
By the way, I'm still wondering if the multi-material object can be created with BLENDED type in Blendigo...
No, no. Everything is going fine with Blendigo. I have no trouble for using BLENDED type, sorry for the confusion. Also I confirmed it works well. Yeah, no problem.
What I wanted to say is that Blendigo would only use the first material even if a mesh has multiple materials in Blender. To show how the mesh has multiple materials, here is an image that is showing a mesh has just 5 materials in Blender.

I already confirmed Blendigo can blend materials but it would be different from what I wanted to say, so I wanted to know the way of how to blend materials with Blendigo.
(In addition, you would have already forgotten this, but I also said OB has the disadvantage that Kram1032 mentioned. However I found it was wrong and OB can have multiple materials in a single mesh as well as ME.)
What I wanted to say is that Blendigo would only use the first material even if a mesh has multiple materials in Blender. To show how the mesh has multiple materials, here is an image that is showing a mesh has just 5 materials in Blender.

I already confirmed Blendigo can blend materials but it would be different from what I wanted to say, so I wanted to know the way of how to blend materials with Blendigo.
(In addition, you would have already forgotten this, but I also said OB has the disadvantage that Kram1032 mentioned. However I found it was wrong and OB can have multiple materials in a single mesh as well as ME.)
Nope, Indigo will use every material on the object, that is assigned to parts of the mesh.
If you don't tell Indigo (or actually also Blender), which part of the mesh is supposed to have which material, it wont render.
Blended also is a way. The advantage of it is, that you're not limited to tris or quads but can smoothly _blend_ them.
The disadvantage is that it's slower with rendering.
Indigo's material definitions always are based on the mesh, not on the object. Just open an igs/xml and look at where the material is placed
If you don't tell Indigo (or actually also Blender), which part of the mesh is supposed to have which material, it wont render.
Blended also is a way. The advantage of it is, that you're not limited to tris or quads but can smoothly _blend_ them.
The disadvantage is that it's slower with rendering.
Indigo's material definitions always are based on the mesh, not on the object. Just open an igs/xml and look at where the material is placed

All right, I don't know about Indigo so much, so I have to learn more with the igs/xml files, looking at the tags for materials, meshes and more
Oh, I first knew that it is slower to use BLENDED type, thank you for your useful information
And I have to say lots of thanks to SmartDen for taking into account my minority requirement about using OB and thanks to everyone for answering kindly.


And I have to say lots of thanks to SmartDen for taking into account my minority requirement about using OB and thanks to everyone for answering kindly.
- ViennaLinux
- Posts: 191
- Joined: Thu Jul 26, 2007 9:26 am
- Location: Vienna/Austria
- Contact:
Any ideas why I am getting MemoryError when i try to export a complex scene.
Please have a look at my posting here: http://www.indigorenderer.com/joomla/fo ... 4730#44730
Please have a look at my posting here: http://www.indigorenderer.com/joomla/fo ... 4730#44730
Core2duo e6600 @ 3.1GHz watercooled at default VCore ^^
Who is online
Users browsing this forum: No registered users and 3 guests