Blendigo for v1.0

Announcements, requests and support regarding the Blender Indigo export script
User avatar
Hans
Posts: 14
Joined: Thu Jan 11, 2007 3:58 am
Location: Japan
Contact:

Post by Hans » Mon Jan 21, 2008 1:35 am

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.)

User avatar
afecelis
Posts: 749
Joined: Tue Aug 01, 2006 4:14 am
Location: Colombia
3D Software: Blender
Contact:

Post by afecelis » Mon Jan 21, 2008 2:44 am

Many thanks for the thorough explanation hans! :D
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

User avatar
Hans
Posts: 14
Joined: Thu Jan 11, 2007 3:58 am
Location: Japan
Contact:

Post by Hans » Mon Jan 21, 2008 3:51 am

afecelis wrote:On a side note, current blendigo does export multiple materials fine.
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.

User avatar
afecelis
Posts: 749
Joined: Tue Aug 01, 2006 4:14 am
Location: Colombia
3D Software: Blender
Contact:

Post by afecelis » Mon Jan 21, 2008 7:15 am

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!
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

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

Post by Kram1032 » Mon Jan 21, 2008 7:27 am

Why?
It's not mat[0]=object.materials[0] :P
I already exported multimaterialobjects. Worked just fine :)
Why should anyone remove that?

User avatar
SmartDen
Developer
Posts: 999
Joined: Fri Oct 13, 2006 10:58 pm
Location: Canary Islands
Contact:

Post by SmartDen » Mon Jan 21, 2008 10:33 am

i didn't that :) so i suppose it still work ;)

@Hans
Thanx for explanation. I'll take over your code in the blendigo

Wedge
Posts: 441
Joined: Sun Jan 14, 2007 11:33 am
Location: East Coast, USA

Post by Wedge » Mon Jan 21, 2008 10:49 am

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...
Content contained in my posts is for informational purposes only and is used at your own risk.

User avatar
Hans
Posts: 14
Joined: Thu Jan 11, 2007 3:58 am
Location: Japan
Contact:

Post by Hans » Mon Jan 21, 2008 1:36 pm

Thanks all.

To make a multi-material scene means to use BLENDED type for "Indigo mat:"?
SmartDen wrote:@Hans
Thanx for explanation. I'll take over your code in the blendigo
Oh, thank you so much. I'm looking forward for the next version.
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.
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
Posts: 441
Joined: Sun Jan 14, 2007 11:33 am
Location: East Coast, USA

Post by Wedge » Mon Jan 21, 2008 3:15 pm

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

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>
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:

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>
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.
Content contained in my posts is for informational purposes only and is used at your own risk.

User avatar
Hans
Posts: 14
Joined: Thu Jan 11, 2007 3:58 am
Location: Japan
Contact:

Post by Hans » Mon Jan 21, 2008 9:20 pm

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...

User avatar
SmartDen
Developer
Posts: 999
Joined: Fri Oct 13, 2006 10:58 pm
Location: Canary Islands
Contact:

Post by SmartDen » Mon Jan 21, 2008 10:50 pm

i don't understand why do you have troubles with creating multi-material objects? what's your problem?!

User avatar
Hans
Posts: 14
Joined: Thu Jan 11, 2007 3:58 am
Location: Japan
Contact:

Post by Hans » Tue Jan 22, 2008 12:27 am

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.
Image
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.)

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

Post by Kram1032 » Tue Jan 22, 2008 5:26 am

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 ;)

User avatar
Hans
Posts: 14
Joined: Thu Jan 11, 2007 3:58 am
Location: Japan
Contact:

Post by Hans » Tue Jan 22, 2008 7:42 pm

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 :D

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.

User avatar
ViennaLinux
Posts: 191
Joined: Thu Jul 26, 2007 9:26 am
Location: Vienna/Austria
Contact:

Post by ViennaLinux » Wed Jan 23, 2008 11:53 am

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
Core2duo e6600 @ 3.1GHz watercooled at default VCore ^^

Post Reply
177 posts

Who is online

Users browsing this forum: No registered users and 39 guests