<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Maratis forum - different materials on several instances of a mesh]]></title>
	<link rel="self" href="http://forum.maratis3d.com/extern.php?action=feed&amp;tid=874&amp;type=atom"/>
	<updated>2013-11-15T15:44:26Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.maratis3d.com/viewtopic.php?id=874</id>
		<entry>
			<title type="html"><![CDATA[Re: different materials on several instances of a mesh]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=5966#p5966"/>
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[Alinor]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=64</uri>
			</author>
			<updated>2013-11-15T15:44:26Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=5966#p5966</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: different materials on several instances of a mesh]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=5965#p5965"/>
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[anael]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=2</uri>
			</author>
			<updated>2013-11-15T10:48:55Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=5965#p5965</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[different materials on several instances of a mesh]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=5964#p5964"/>
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[Alinor]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=64</uri>
			</author>
			<updated>2013-11-14T21:07:10Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=5964#p5964</id>
		</entry>
</feed>
