<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Maratis forum - access to the mesh bones]]></title>
	<link rel="self" href="http://forum.maratis3d.com/extern.php?action=feed&amp;tid=117&amp;type=atom"/>
	<updated>2011-08-21T18:21:37Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.maratis3d.com/viewtopic.php?id=117</id>
		<entry>
			<title type="html"><![CDATA[Re: access to the mesh bones]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=483#p483"/>
			<content type="html"><![CDATA[<p>this time it&#039;s works perfectly, thanks a lot&nbsp; <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>2011-08-21T18:21:37Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=483#p483</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: access to the mesh bones]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=480#p480"/>
			<content type="html"><![CDATA[<p>Ok, I understood, I forget that when there is no animations,<br />the armature is not updated.</p><p>Just call this after you finish moving your bones and it should work : </p><p>armature-&gt;processBonesLinking();<br />armature-&gt;updateBonesSkinMatrix();</p><p>So, to summary here is a code to rotate a bone :</p><div class="codebox"><pre><code>if(mesh)
{
       MArmature * armature = mesh-&gt;getArmature();
       if(armature)
       {
           MOBone * bone = armature-&gt;getBone(0); // be sure the bone exist
           bone-&gt;addAxisAngleRotation(MVector3(1, 0, 0), 10);
            
           armature-&gt;processBonesLinking();
           armature-&gt;updateBonesSkinMatrix();
       }
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[anael]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=2</uri>
			</author>
			<updated>2011-08-21T17:20:06Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=480#p480</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: access to the mesh bones]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=478#p478"/>
			<content type="html"><![CDATA[<p>there isn&#039;t further reaction ...</p><p>apparently there are well bones in the .mesh file :<br /></p><div class="quotebox"><cite>armature.mesh wrote:</cite><blockquote><p>&lt;Bones num=&quot;4&quot;&gt;<br />&nbsp; &nbsp; &lt;Bone id=&quot;0&quot; name=&quot;Bone&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;position x=&quot;-2.618241&quot; y=&quot;0.000000&quot; z=&quot;0.000000&quot; /&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;rotation x=&quot;89.999992&quot; y=&quot;100.106392&quot; z=&quot;0.000001&quot; /&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;scale x=&quot;1.000000&quot; y=&quot;1.000000&quot; z=&quot;1.000000&quot; /&gt;<br />&nbsp; &nbsp; &lt;/Bone&gt;<br />&nbsp; &nbsp; &lt;Bone id=&quot;1&quot; name=&quot;Bone.001&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;parent id=&quot;0&quot; /&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;position x=&quot;0.000000&quot; y=&quot;1.000094&quot; z=&quot;-0.000000&quot; /&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;rotation x=&quot;5.679412&quot; y=&quot;-179.110901&quot; z=&quot;19.974031&quot; /&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;scale x=&quot;1.000000&quot; y=&quot;1.000000&quot; z=&quot;1.000000&quot; /&gt;<br />&nbsp; &nbsp; &lt;/Bone&gt;<br />&nbsp; &nbsp; &lt;Bone id=&quot;2&quot; name=&quot;Bone.002&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;parent id=&quot;1&quot; /&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;position x=&quot;0.000000&quot; y=&quot;1.355897&quot; z=&quot;-0.000000&quot; /&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;rotation x=&quot;0.072250&quot; y=&quot;0.357129&quot; z=&quot;24.149242&quot; /&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;scale x=&quot;1.000000&quot; y=&quot;1.000000&quot; z=&quot;1.000000&quot; /&gt;<br />&nbsp; &nbsp; &lt;/Bone&gt;<br />&nbsp; &nbsp; &lt;Bone id=&quot;3&quot; name=&quot;Bone.003&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;parent id=&quot;2&quot; /&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;position x=&quot;0.000000&quot; y=&quot;1.801812&quot; z=&quot;-0.000000&quot; /&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;rotation x=&quot;5.126833&quot; y=&quot;-0.721032&quot; z=&quot;-7.293643&quot; /&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;scale x=&quot;1.000000&quot; y=&quot;1.000000&quot; z=&quot;1.000000&quot; /&gt;<br />&nbsp; &nbsp; &lt;/Bone&gt;<br />&lt;/Bones&gt;</p></blockquote></div><p><a href="https://www.yousendit.com/dl?phi_action=app/orchestrateDownload&amp;rurl=https%253A%252F%252Fwww.yousendit.com%252Ftransfer.php%253Faction%253Dbatch_download%2526batch_id%253DZUd0OU1kWkI5NVZFQlE9PQ">here</a> is the all .mesh</p><p>thanks for helping me <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>2011-08-21T14:58:42Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=478#p478</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: access to the mesh bones]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=477#p477"/>
			<content type="html"><![CDATA[<p>Look at the .mesh file with a text editor and check that you have armature and bones inside.<br />Or send me the file.</p><p>Also, I looked at your behavior code again,<br />you do : &quot;bone-&gt;addAxisAngleRotation(vector,i);&quot;<br />but &quot;i&quot; is equal to zero, so it won&#039;t add any rotation,</p><p>try : &quot;bone-&gt;addAxisAngleRotation(vector, 10);&quot;</p>]]></content>
			<author>
				<name><![CDATA[anael]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=2</uri>
			</author>
			<updated>2011-08-21T13:02:39Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=477#p477</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: access to the mesh bones]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=476#p476"/>
			<content type="html"><![CDATA[<p>Thanks for the answer, I am sorry but it doesn&#039;t work, I probably made a mistake in the mesh creation : </p><p>in blender :<br />I created a plane that I subdivided 5-6 times and a single bone that I extruded 3 times.<br />I selected the plane and the bone and &quot;ctrl+p -&gt; armature deform with empty group&quot;.<br />and for each bone&nbsp; I selected some faces that I assigned to the bone.<br /><a href="http://www.hostingpics.net/viewer.php?id=541674mara2.png"><span class="postimg"><img src="http://img11.hostingpics.net/pics/541674mara2.png" alt="http://img11.hostingpics.net/pics/541674mara2.png" /></span></a><br />and I exported this (mesh + armature) in maratis mesh without &quot;armature anim&quot;.</p><p>In Maratis :<br />I imported the mesh and gave to it my behavior<br /><a href="http://www.hostingpics.net/viewer.php?id=949431mara1.png"><span class="postimg"><img src="http://img11.hostingpics.net/pics/949431mara1.png" alt="http://img11.hostingpics.net/pics/949431mara1.png" /></span></a></p><p>do you see an error somewhere, please ?</p>]]></content>
			<author>
				<name><![CDATA[Alinor]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=64</uri>
			</author>
			<updated>2011-08-21T12:23:41Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=476#p476</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: access to the mesh bones]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=475#p475"/>
			<content type="html"><![CDATA[<p>Hi,</p><p>&quot;input-&gt;onKeyDown(&quot;MOUSE_BUTTON1&quot;)&quot; is launched only 1 frame just after you press the mouse button (not every frames).<br />You maybe want to use &quot;isKeyPressed(&quot;MOUSE_BUTTON1&quot;)&quot;.</p><p>You maybe also have animation keys that cancel your changes,<br />try to not export, or delete the Armature Animation file from Blender (.maa),<br />or use the piece of code I gave you in the previous post to remove keys for a specific bone.</p>]]></content>
			<author>
				<name><![CDATA[anael]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=2</uri>
			</author>
			<updated>2011-08-21T09:22:14Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=475#p475</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: access to the mesh bones]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=473#p473"/>
			<content type="html"><![CDATA[<div class="quotebox"><cite>Anaël wrote:</cite><blockquote><p>maybe you can help by studying how to improve the Blender python script exporter<br />to export Blender shape keys ?</p></blockquote></div><p>thank you for you fast response <img src="http://forum.maratis3d.com/img/smilies/wink.png" width="15" height="15" alt="wink" /><br />I am afraid it&#039;s quite over my faculties, I am sorry. </p><p>I made a very basic behavior to test mesh deforming by moving a bone, but the mesh didn&#039;t deform itself, can you see where the problem is, please ?</p><div class="quotebox"><cite>update methode wrote:</cite><blockquote><p>int i =0.0;</p><p>void Behavior::update(void)<br />{<br />&nbsp; &nbsp; MEngine * engine = MEngine::getInstance();<br />&nbsp; &nbsp; MGame * game = engine-&gt;getGame();</p><p>&nbsp; &nbsp; if(! game-&gt;isRunning())<br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; i=0;<br />&nbsp; &nbsp; &nbsp; &nbsp; return;<br />&nbsp; &nbsp; }<br />&nbsp; &nbsp; MOEntity * parent = (MOEntity *) getParentObject();<br />&nbsp; &nbsp; MVector3 vector;<br />&nbsp; &nbsp; MVector3 vector2;<br />&nbsp; &nbsp; MSystemContext * system = engine-&gt;getSystemContext(); <br />&nbsp; &nbsp; MInputContext * input = engine-&gt;getInputContext(); <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(input-&gt;isKeyPressed(&quot;A&quot;))<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; i++;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (i&gt;360)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; i=i-360;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; vector2.x=i;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; vector2.y=i;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; vector2.z=0.0;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; parent-&gt;setEulerRotation(vector2); // this work perfectly<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />if(parent)<br />{<br />&nbsp; &nbsp; MMesh* mesh = parent-&gt;getMesh();<br />&nbsp; &nbsp; if(mesh)<br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; MArmature * armature = mesh-&gt;getArmature();<br />&nbsp; &nbsp; &nbsp; &nbsp; if(armature)<br />&nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MOBone* bone=armature-&gt;getBone(0);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(bone)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { // bone has indeed a no NULL adress here<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(input-&gt;onKeyDown(&quot;MOUSE_BUTTON1&quot;))<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; vector.x=0.0;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; vector.y=1.0;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; vector.z=1.0;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; bone-&gt;addAxisAngleRotation(vector,i); // nothing doing here <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; }<br />}</p><p>}</p></blockquote></div>]]></content>
			<author>
				<name><![CDATA[Alinor]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=64</uri>
			</author>
			<updated>2011-08-20T12:31:59Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=473#p473</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: access to the mesh bones]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=467#p467"/>
			<content type="html"><![CDATA[<p>Hi,</p><p>to move a bone, you have access to all the MObject3d functions (MOBone derive from MObject3d),<br />for example, the rotation/translation (there is a lot more, you can look at MObject3d.h for more detail) :</p><p>bone-&gt;setEulerRotation(euler);<br />bone-&gt;addAxisAngleRotation(axis, angle);<br />bone-&gt;setPosition(position);</p><p>Be just careful that there is no keyframes associated with the bone, or it will discard your changes.<br />If you want to remove keyframes for a specific bone, lets say the bone 0 for example, you can do :</p><p>MArmatureAnim * armatureAnim = mesh-&gt;getArmatureAnim();<br />if(armatureAnim)<br />{<br />&nbsp; &nbsp; // get bones anim array<br />&nbsp; &nbsp; MObject3dAnim * bonesAnim = armatureAnim-&gt;getBonesAnim();</p><p>&nbsp; &nbsp; // clear bone 0 keys<br />&nbsp; &nbsp; bonesAnim[0].clearPositionKeys();<br />&nbsp; &nbsp; bonesAnim[0].clearScaleKeys();<br />&nbsp; &nbsp; bonesAnim[0].clearRotationKeys();<br />}</p><br /><p>To play/stop animation (you can look at MOEntity.h for more animation related functions) :</p><p>entity-&gt;changeAnimation(animationId);</p><br /><p>And for shape keys animation, I started working on it and wrote the MMorphingData class,<br />but I didn&#039;t finished to implement it, maybe you can help by studying how to improve the Blender python script exporter<br />to export Blender shape keys ?</p><p>Cheers,<br />Anaël.</p>]]></content>
			<author>
				<name><![CDATA[anael]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=2</uri>
			</author>
			<updated>2011-08-11T16:40:21Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=467#p467</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: access to the mesh bones]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=464#p464"/>
			<content type="html"><![CDATA[<p>Hi, I have other questions about bones and Maratis engine <img src="http://forum.maratis3d.com/img/smilies/wink.png" width="15" height="15" alt="wink" /> :</p><p>suppose we have a MOBone named Bone0, how can we move him (Euler rotation like in Blender Pose mode, for example ) ?<br />how can we, with maratis Engine, play, stop and change mesh animations ?<br />and finally, does animations using shape keys work in maratis ?</p>]]></content>
			<author>
				<name><![CDATA[Alinor]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=64</uri>
			</author>
			<updated>2011-08-09T19:49:26Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=464#p464</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: access to the mesh bones]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=433#p433"/>
			<content type="html"><![CDATA[<p>cool <img src="http://forum.maratis3d.com/img/smilies/smile.png" width="15" height="15" alt="smile" /><br />I&#039;m waiting to see what you are working on <img src="http://forum.maratis3d.com/img/smilies/wink.png" width="15" height="15" alt="wink" /></p>]]></content>
			<author>
				<name><![CDATA[anael]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=2</uri>
			</author>
			<updated>2011-07-10T09:23:24Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=433#p433</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: access to the mesh bones]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=431#p431"/>
			<content type="html"><![CDATA[<p>that&#039;s perfect, I didn&#039;t see the methode &quot;MArmature *&nbsp; getArmature (void) &quot; in the MMesh class,<br />that&#039;s all I wanted to know, thanks <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>2011-07-09T10:41:23Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=431#p431</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: access to the mesh bones]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=429#p429"/>
			<content type="html"><![CDATA[<p>Hi !</p><div class="quotebox"><blockquote><p>Hi, I have a question about Maratis Engine.<br />if I import a mesh that has several bones, how can I stock them into a MOBone* variable ? (the bones don&#039;t appear in the maratis 3d view)</p></blockquote></div><p>What do you mean by &quot;stock them&quot; ?<br />Otherwise, to get bones from a mesh entity in c++, you can do like that :</p><p>MEngine * engine = MEngine::getInstance();<br />MLevel * level = engine-&gt;getLevel();</p><p>// get current scene<br />MScene * scene = level-&gt;getCurrentScene();</p><p>// get bone 0 from a mesh entity<br />MOEntity * entity = scene-&gt;getEntityByName(&quot;MyEntity&quot;);<br />if(entity)<br />{<br />&nbsp; &nbsp; MMesh * mesh = entity-&gt;getMesh();<br />&nbsp; &nbsp; if(mesh)<br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; MArmature * armature = mesh-&gt;getArmature();<br />&nbsp; &nbsp; &nbsp; &nbsp; if(armature)<br />&nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MOBone * bone = armature-&gt;getBone(0); // get bone 0<br />&nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; }<br />}</p>]]></content>
			<author>
				<name><![CDATA[anael]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=2</uri>
			</author>
			<updated>2011-07-08T20:13:13Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=429#p429</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[access to the mesh bones]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=428#p428"/>
			<content type="html"><![CDATA[<p>Hi, I have a question about Maratis Engine.<br />if I import a mesh that has several bones, how can I stock them into a MOBone* variable ? (the bones don&#039;t appear in the maratis 3d view) </p><p>I thought that they were considered like mesh children but they aren&#039;t.</p>]]></content>
			<author>
				<name><![CDATA[Alinor]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=64</uri>
			</author>
			<updated>2011-07-08T17:01:04Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=428#p428</id>
		</entry>
</feed>
