<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Maratis forum - different materials on several instances of a mesh]]></title>
		<link>http://forum.maratis3d.com/viewtopic.php?id=874</link>
		<description><![CDATA[The most recent posts in different materials on several instances of a mesh.]]></description>
		<lastBuildDate>Fri, 15 Nov 2013 15:44:26 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: different materials on several instances of a mesh]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=5966#p5966</link>
			<description><![CDATA[<p>okay, thanks for your quick answer <img src="http://forum.maratis3d.com/img/smilies/wink.png" width="15" height="15" alt="wink" /></p>]]></description>
			<author><![CDATA[dummy@example.com (Alinor)]]></author>
			<pubDate>Fri, 15 Nov 2013 15:44:26 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=5966#p5966</guid>
		</item>
		<item>
			<title><![CDATA[Re: different materials on several instances of a mesh]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=5965#p5965</link>
			<description><![CDATA[<p>Hi,</p><p>there is no mechanism right now to apply different materials to a mesh instance,<br />it should be added, but right now you have to duplicate the mesh, for example by creating meshRefs manually :</p><div class="codebox"><pre><code>getGlobalFilename(filename, workingDir, &quot;meshs/point.mesh&quot;);

for(i=0; i&lt;nbPoint; i++)
{
    MMeshRef * meshRef = MMeshRef::getNew(NULL, filename);
    level-&gt;getMeshManager()-&gt;addRef(meshRef); // manually add the mesh ref to the level
    meshRef-&gt;update(); // actually load the mesh
    ent = scene-&gt;addNewEntity(meshRef);
    // change the material here
}</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (anael)]]></author>
			<pubDate>Fri, 15 Nov 2013 10:48:55 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=5965#p5965</guid>
		</item>
		<item>
			<title><![CDATA[different materials on several instances of a mesh]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=5964#p5964</link>
			<description><![CDATA[<p>Hi Maratis users,</p><p>I don&#039;t remember if the subject was already covered, but what is the simple way to assign different materials on several instance of the same mesh ?</p><p>for example here, all of the instance of the mesh &quot;point&quot; created in the scene should have differents materials.</p><div class="codebox"><pre><code>getGlobalFilename(filename, workingDir, &quot;meshs/point.mesh&quot;);
ptMesh = level-&gt;loadMesh(filename);

_points.resize(nbPoint);

for(i=0; i&lt;nbPoint; i++){
        ent = scene-&gt;addNewEntity(ptMesh);
    ent-&gt;createPhysicsProperties();
}</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (Alinor)]]></author>
			<pubDate>Thu, 14 Nov 2013 21:07:10 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=5964#p5964</guid>
		</item>
	</channel>
</rss>
