External meshes with external materials

Come here for help & support.
Post Reply
3 posts • Page 1 of 1
halaszlo
Posts: 8
Joined: Fri Aug 15, 2014 8:54 pm

External meshes with external materials

Post by halaszlo » Mon Aug 18, 2014 4:10 pm

Hi guys,
Can I define for an external mesh that which external material to use?
My example code is the following:

Code: Select all

	<include>
			<pathname>../Assets/Objects/Shared_IGMAT_001001/Material1.igm</pathname>
	</include>

	<include>
			<pathname>../Assets/Objects/Shared_IGMAT_001001/Material2.igm</pathname>
	</include>	

	<mesh>
		<external>
			<path>../Assets/Objects/Shared_IGMESH_001001/Mesh1.igmesh</path>
		</external>
		<scale>1.0</scale>
		<normal_smoothing>false</normal_smoothing>
		<name>Mesh1</name>
	</mesh>
	
	<model>
		<scale>1.0</scale>
		<mesh_name>Mesh1</mesh_name>
		<rotation><matrix>1.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 1.0</matrix></rotation>
		<pos>0.0 -0.560000479221344 0.0</pos>
		
	</model>
	
	<model>
		<scale>1.0</scale>
		<mesh_name>Mesh1</mesh_name>
		<rotation><matrix>1.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 1.0</matrix></rotation>
		<pos>1.0 -0.560000479221344 0.0</pos>
	</model>
So I have 2 material included and 2 model from the same external mesh.
How can I say for the models which material to use?
It seems to me that it is declared in the mesh, igmesh file itself and I can not modify it.

User avatar
galinette
1st Place Winner
Posts: 923
Joined: Sat Jan 09, 2010 1:39 am
Location: Nantes, France
Contact:

Re: External meshes with external materials

Post by galinette » Mon Aug 18, 2014 6:19 pm

Indeed, material names are stored in the igmesh. But you can by creating material aliases, this will create a material of the same name than the mesh material, but which points on another material defined elsewhere in the igs.

Code: Select all

<alias_material>
   <current_name>Leather</current_name>
   <new_name>previewmaterial</new_name>
</alias_material>
Eclat-Digital Research
http://www.eclat-digital.com

halaszlo
Posts: 8
Joined: Fri Aug 15, 2014 8:54 pm

Re: External meshes with external materials

Post by halaszlo » Mon Aug 18, 2014 7:24 pm

Thank you very much!!
It works fine! :)

Post Reply
3 posts • Page 1 of 1

Who is online

Users browsing this forum: Majestic-12 [Bot] and 5 guests