<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Importing iPhone X Face Mocap data into Maya. in Maya Programming Forum</title>
    <link>https://forums.autodesk.com/t5/maya-programming-forum/importing-iphone-x-face-mocap-data-into-maya/m-p/8126150#M9509</link>
    <description>&lt;P&gt;The whole point of this notation is to allow things to be matched by position in the hierarchy. If you take a little time and experiment with different&amp;nbsp;animExport/Import&amp;nbsp; or glance at &lt;A href="https://download.autodesk.com/us/maya/2009help/API/class_m_anim_curve_clipboard.html" target="_blank"&gt;https://download.autodesk.com/us/maya/2009help/API/class_m_anim_curve_clipboard.html&lt;/A&gt; you will be able to figure it out.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Think of it is going to a theater or stadium. The first number may indicate the floor, the second the aisle, and the third number the actual seat.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But this is not relevant for your task! Your json file gives you the attribute names which are a perfect match to your Sloth character's blendShape attribute names. So you will be matching values by name, not hierarchical position.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 12 Jul 2018 14:21:00 GMT</pubDate>
    <dc:creator>chaneyx</dc:creator>
    <dc:date>2018-07-12T14:21:00Z</dc:date>
    <item>
      <title>Importing iPhone X Face Mocap data into Maya.</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/importing-iphone-x-face-mocap-data-into-maya/m-p/8122955#M9504</link>
      <description>&lt;P&gt;I was pretty excited since I came across this &lt;A href="https://www.youtube.com/watch?v=w047Dbo-fGQ" target="_blank"&gt;video&lt;/A&gt;.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The face Mocap looks pretty solid and looks like something which can save countless hours of animations.&lt;/P&gt;&lt;P&gt;So basically how the whole thing works is&lt;/P&gt;&lt;P&gt;- Face mocap data is captured using unity app and saved in a text file.&lt;/P&gt;&lt;P&gt;- This data consists of values for 51 face blendshapes and transform&amp;nbsp;of the head origin.&lt;/P&gt;&lt;P&gt;- Then it is formatted into a .anim file, which can be imported into Maya.&lt;/P&gt;&lt;P&gt;You can read the whole article &lt;A href="https://uploadvr.com/using-iphone-x-maya-quick-cheap-facial-capture/" target="_blank"&gt;here&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was able to get the whole mocap data into a json&amp;nbsp;(&lt;A href="https://drive.google.com/file/d/1vDrMlOuMxcuFFt2nRaBESRwjBkVQn376/view?usp=sharing" target="_blank"&gt;file&lt;/A&gt;)&lt;/P&gt;&lt;P&gt;But currently stuck at the .anim file exporter.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There are a few parameters (even though they are explained &lt;A href="https://knowledge.autodesk.com/support/maya/learn-explore/caas/CloudHelp/cloudhelp/2016/ENU/Maya/files/GUID-87541258-2463-497A-A3D7-3DEA4C852644-htm.html" target="_blank"&gt;here&lt;/A&gt;) which are currently not making any sense to me as I am not an animator.&amp;nbsp;&lt;/P&gt;&lt;P&gt;If anyone can help me out with understanding the following piece of data from .anim file,&amp;nbsp;it will be very helpful.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;PRE&gt;anim translate.translateY 0 2 1;
animData {
  input time;
  output linear;
  weighted 0;
  preInfinity constant;
  postInfinity constant;
  keys {
    0 0 auto auto 1 0 0;
    1 0 auto fixed 1 0 0 0 1;
    20 0.24418778 fixed fixed 1 0 0 0.74613416 1 0.74613416 1;
    35 0.47890941 fixed fixed 1 0 0 0.61673066 1 0.61673066 1;
  }
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jul 2018 12:20:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/importing-iphone-x-face-mocap-data-into-maya/m-p/8122955#M9504</guid>
      <dc:creator>harshad.asawale</dc:creator>
      <dc:date>2018-07-11T12:20:45Z</dc:date>
    </item>
    <item>
      <title>Re: Importing iPhone X Face Mocap data into Maya.</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/importing-iphone-x-face-mocap-data-into-maya/m-p/8123596#M9505</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;You will need to experiment with exporting and reimporting animation to understand these things.&lt;BR /&gt;Alternatively, you can write your own MEL or Python imported which grabs the per frame keyframe &lt;BR /&gt;values you need and setKeyframes in the standard way - ie. setKeyframe -at scale;&lt;BR /&gt;&lt;BR /&gt;But here is some partial info off for you : &lt;BR /&gt;_________________________________________________________________&lt;BR /&gt;This is required by the MAnimCurveClipboard. &lt;BR /&gt;&lt;STRONG&gt;anim translate.translateY 0 2 1;&lt;BR /&gt;&lt;/STRONG&gt;It usually looks something like this : &lt;BR /&gt;anim translate.translateY translateY pSphere1 0 1 1;&lt;BR /&gt;Essentially it allows for curves to be pasted into hierarchies. &lt;BR /&gt;The 0 2 1 is the slightly cryptic part as it is specific to MAnimCurveClipboard.&lt;BR /&gt;&lt;STRONG&gt;animData {&lt;BR /&gt;&lt;/STRONG&gt;In your case, this will always be "time" as your animation is time driven&lt;STRONG&gt;  input time;&lt;BR /&gt;&lt;/STRONG&gt;Output keywords refer to the type of unit it is. &lt;BR /&gt;Rotations(angular), distances(linear), scales (unitless) are the most common.&lt;BR /&gt;Be aware that you may need to do a unit conversion with these values when dealing with rotation
&lt;STRONG&gt;  output linear;&lt;BR /&gt;&lt;/STRONG&gt;This is all the curve information&lt;BR /&gt;A basic read on the Windows-&amp;gt;Animation-&amp;gt;Graph Editor will help&lt;BR /&gt;For example, postInfinity refers to the extrapolation after the last keyframe. &lt;STRONG&gt;  weighted 0;
  preInfinity constant;
  postInfinity constant;&lt;BR /&gt;&lt;/STRONG&gt;This is the data you really want. It is your actual keyframes! &lt;BR /&gt;You will need to understand the Graph Editor tangents. &lt;BR /&gt;And you should look at the animTL and animTA curves in the hypergraph to understand&lt;BR /&gt;20 - frame 20&lt;BR /&gt;0.24418778 - value at frame 20&lt;BR /&gt;fixed - in tangent type&lt;BR /&gt;fixed - out tangent type&lt;BR /&gt;1 0 0 0.74613416 1 0.74613416 1&lt;STRONG&gt;  keys {
    0 0 auto auto 1 0 0;
    1 0 auto fixed 1 0 0 0 1;
    20 0.24418778 fixed fixed 1 0 0 0.74613416 1 0.74613416 1;
    35 0.47890941 fixed fixed 1 0 0 0.61673066 1 0.61673066 1;
  }
}&lt;/STRONG&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jul 2018 15:28:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/importing-iphone-x-face-mocap-data-into-maya/m-p/8123596#M9505</guid>
      <dc:creator>chaneyx</dc:creator>
      <dc:date>2018-07-11T15:28:48Z</dc:date>
    </item>
    <item>
      <title>Re: Importing iPhone X Face Mocap data into Maya.</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/importing-iphone-x-face-mocap-data-into-maya/m-p/8123648#M9506</link>
      <description>&lt;P&gt;I just checked out the demo. It is disturbingly cool.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;His setup relies on having a model in Maya that has the same blendShape&amp;nbsp;names as his Bebylon character. THIS IS ESSENTIAL. If you get this going, you will NOT need an in depth understanding of the .anim format.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You will notice in your .json file strings such as&amp;nbsp;eyeBlink_R,&amp;nbsp;eyeWide_R,&amp;nbsp;eyeLookDown_R,&amp;nbsp;noseSneer_R. etc.&amp;nbsp; In order to copy that animation to Maya, you will need a face with those blendShapes. If you have that, post your progress and we can help with the next step.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;See the attached image, he has all the blendShapes set up in Maya&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jul 2018 15:41:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/importing-iphone-x-face-mocap-data-into-maya/m-p/8123648#M9506</guid>
      <dc:creator>chaneyx</dc:creator>
      <dc:date>2018-07-11T15:41:15Z</dc:date>
    </item>
    <item>
      <title>Re: Importing iPhone X Face Mocap data into Maya.</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/importing-iphone-x-face-mocap-data-into-maya/m-p/8125487#M9507</link>
      <description>&lt;P&gt;Thanks for the detailed response.&lt;/P&gt;&lt;PRE&gt;anim translate.translateY 0 2 1;&lt;/PRE&gt;&lt;P&gt;Yes, the 0 2 1 is some sort of hierarchy node numbering system, which I wanted to know. But I think this will change every time while applying for a different rig.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;0 0 auto auto 1 0 0;
1 0 auto fixed 1 0 0 0 1;&lt;/PRE&gt;&lt;P&gt;Also sometimes it's 1 0 0 at the end and sometimes it has an additional 0 1 , which is confusing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now it all seems that&amp;nbsp;recreating the .anim file is simply not a scalable solution for applying the mocap data on any given rig. And it looks more feasible to do directly in Maya&amp;nbsp;itself with a python script where the nodes can be selected to apply specific animations.&lt;/P&gt;&lt;P&gt;I guess i'll take the python approach.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jul 2018 09:45:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/importing-iphone-x-face-mocap-data-into-maya/m-p/8125487#M9507</guid>
      <dc:creator>harshad.asawale</dc:creator>
      <dc:date>2018-07-12T09:45:27Z</dc:date>
    </item>
    <item>
      <title>Re: Importing iPhone X Face Mocap data into Maya.</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/importing-iphone-x-face-mocap-data-into-maya/m-p/8125492#M9508</link>
      <description>&lt;P&gt;I have the fbx&amp;nbsp;, with proper blendshapes setup.&amp;nbsp; PFA&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jul 2018 09:50:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/importing-iphone-x-face-mocap-data-into-maya/m-p/8125492#M9508</guid>
      <dc:creator>harshad.asawale</dc:creator>
      <dc:date>2018-07-12T09:50:21Z</dc:date>
    </item>
    <item>
      <title>Re: Importing iPhone X Face Mocap data into Maya.</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/importing-iphone-x-face-mocap-data-into-maya/m-p/8126150#M9509</link>
      <description>&lt;P&gt;The whole point of this notation is to allow things to be matched by position in the hierarchy. If you take a little time and experiment with different&amp;nbsp;animExport/Import&amp;nbsp; or glance at &lt;A href="https://download.autodesk.com/us/maya/2009help/API/class_m_anim_curve_clipboard.html" target="_blank"&gt;https://download.autodesk.com/us/maya/2009help/API/class_m_anim_curve_clipboard.html&lt;/A&gt; you will be able to figure it out.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Think of it is going to a theater or stadium. The first number may indicate the floor, the second the aisle, and the third number the actual seat.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But this is not relevant for your task! Your json file gives you the attribute names which are a perfect match to your Sloth character's blendShape attribute names. So you will be matching values by name, not hierarchical position.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jul 2018 14:21:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/importing-iphone-x-face-mocap-data-into-maya/m-p/8126150#M9509</guid>
      <dc:creator>chaneyx</dc:creator>
      <dc:date>2018-07-12T14:21:00Z</dc:date>
    </item>
    <item>
      <title>Re: Importing iPhone X Face Mocap data into Maya.</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/importing-iphone-x-face-mocap-data-into-maya/m-p/8126160#M9510</link>
      <description>&lt;P&gt;I am assuming you know how to do python programming so I am only giving you a partial solution here.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your json file is a list of dictionaries. You can make a file reader or cut and paste it to the script editor. Each dictionary has all the keys for each frame. Those keyframes are key value pairs of attribute names to attribute values. For example&amp;nbsp;"eyeBlink_R":0.630653619766235 indicates that blendShape attribute&amp;nbsp;&lt;SPAN&gt;eyeBlink_R gets a value of&amp;nbsp;0.630653619766235 for that particular frame.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Below is sample code for 1 frame. You will have to write the loop to do this for each dictionary within your file.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;import maya.cmds as cmds&lt;/P&gt;&lt;P&gt;frameData = {"eyeBlink_R":0.630653619766235,&lt;BR /&gt;"eyeWide_R":0,&lt;BR /&gt;"mouthLowerDown_L":0.0394449755549431,&lt;BR /&gt;"eyeLookDown_R":0.607172310352325,&lt;BR /&gt;"cheekSquint_L":0.0926333069801331,&lt;BR /&gt;"mouthDimple_R":0.0589954480528831,&lt;BR /&gt;"browInnerUp":0.215703368186951,&lt;BR /&gt;"eyeLookIn_L":0.000609547714702785,&lt;BR /&gt;"mouthPress_L":0.173792526125908,&lt;BR /&gt;"mouthStretch_R":0.130874514579773,&lt;BR /&gt;"browDown_L":0.0118590397760272,&lt;BR /&gt;"mouthFunnel":0.194534316658974,&lt;BR /&gt;"noseSneer_L":0.143848955631256,&lt;BR /&gt;"eyeLookOut_L":0.0232447534799576,&lt;BR /&gt;"eyeLookIn_R":0.133933961391449,&lt;BR /&gt;"mouthLowerDown_R":0.0413378998637199,&lt;BR /&gt;"browOuterUp_R":0.0843672901391983,&lt;BR /&gt;"mouthLeft":0.00630532624199986,&lt;BR /&gt;"cheekSquint_R":0.109647072851658,&lt;BR /&gt;"jawOpen":0.0494513735175133,&lt;BR /&gt;"eyeBlink_L":0.631030023097992,&lt;BR /&gt;"jawForward":0.00845738872885704,&lt;BR /&gt;"mouthPress_R":0.177991852164268,&lt;BR /&gt;"noseSneer_R":0.139457553625107,&lt;BR /&gt;"jawRight":0.00111576204653829,&lt;BR /&gt;"mouthShrugLower":0.110312908887863,&lt;BR /&gt;"eyeSquint_L":0.0642843469977379,&lt;BR /&gt;"eyeLookOut_R":7.60569946578471E-07,&lt;BR /&gt;"mouthFrown_L":0.146945968270302,&lt;BR /&gt;"cheekPuff":0.120135366916656,&lt;BR /&gt;"mouthStretch_L":0.160444423556328,&lt;BR /&gt;"mouthRollLower":0.0447048954665661,&lt;BR /&gt;"mouthUpperUp_R":0.085766077041626,&lt;BR /&gt;"mouthShrugUpper":0.129708498716354,&lt;BR /&gt;"eyeSquint_R":0.0651631653308868,&lt;BR /&gt;"mouthSmile_L":0.00668685464188457,&lt;BR /&gt;"eyeLookDown_L":0.609023749828339,&lt;BR /&gt;"eyeWide_L":0,&lt;BR /&gt;"mouthClose":0.0124557800590992,&lt;BR /&gt;"jawLeft":0.012608109973371,&lt;BR /&gt;"mouthDimple_L":0.0744616985321045,&lt;BR /&gt;"mouthFrown_R":0.145918473601341,&lt;BR /&gt;"mouthPucker":0.235637620091438,&lt;BR /&gt;"mouthRight":0.00372009864076972,&lt;BR /&gt;"browDown_R":0.0118923466652632,&lt;BR /&gt;"eyeLookUp_L":0,&lt;BR /&gt;"mouthSmile_R":0.00394255900755525,&lt;BR /&gt;"mouthUpperUp_L":0.0847973972558975,&lt;BR /&gt;"browOuterUp_L":0.0903196856379509,&lt;BR /&gt;"mouthRollUpper":0.0304965153336525,&lt;BR /&gt;"eyeLookUp_R":0,&lt;BR /&gt;"translation":[0.0122108394280076,-0.242821648716927,0.37145984172821],&lt;BR /&gt;"rotation":[-0.431879132986069,-0.017200656235218,-0.00822594482451677,-0.901729941368103]}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;transformNode = "Sloth_Head2"&lt;BR /&gt;blendShapeNode = "blendShape2"&lt;/P&gt;&lt;P&gt;for attr in frameData.keys() :&lt;/P&gt;&lt;P&gt;if ( attr == "translation" ) :&lt;BR /&gt;# Set xform data on head&lt;BR /&gt;cmds.setKeyframe(transformNode, v=frameData[attr][0], at="translateX ")&lt;BR /&gt;cmds.setKeyframe(transformNode, v=frameData[attr][1], at="translateY ")&lt;BR /&gt;cmds.setKeyframe(transformNode, v=frameData[attr][2], at="translateZ ")&lt;BR /&gt;&lt;BR /&gt;elif( attr == "rotation" ) :&lt;BR /&gt;# NOTE - you may need to convert the rotation values from radians to degrees&lt;BR /&gt;cmds.setKeyframe(transformNode, v=frameData[attr][0], at="rotateX")&lt;BR /&gt;cmds.setKeyframe(transformNode, v=frameData[attr][1], at="rotateY")&lt;BR /&gt;cmds.setKeyframe(transformNode, v=frameData[attr][2], at="rotateZ")&lt;/P&gt;&lt;P&gt;else :&lt;/P&gt;&lt;P&gt;# Set keyframe data on blendShapeNode&lt;BR /&gt;print attr&lt;BR /&gt;print frameData[attr]&lt;BR /&gt;cmds.setKeyframe( blendShapeNode , v=frameData[attr], at=attr)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jul 2018 14:22:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/importing-iphone-x-face-mocap-data-into-maya/m-p/8126160#M9510</guid>
      <dc:creator>chaneyx</dc:creator>
      <dc:date>2018-07-12T14:22:33Z</dc:date>
    </item>
    <item>
      <title>Re: Importing iPhone X Face Mocap data into Maya.</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/importing-iphone-x-face-mocap-data-into-maya/m-p/8126171#M9511</link>
      <description>&lt;P&gt;How did you get the json file exported from your phone?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jul 2018 14:25:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/importing-iphone-x-face-mocap-data-into-maya/m-p/8126171#M9511</guid>
      <dc:creator>chaneyx</dc:creator>
      <dc:date>2018-07-12T14:25:18Z</dc:date>
    </item>
    <item>
      <title>Re: Importing iPhone X Face Mocap data into Maya.</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/importing-iphone-x-face-mocap-data-into-maya/m-p/8126184#M9512</link>
      <description>&lt;P&gt;Thanks for the python code. I know bits of python but never done it in maya.&lt;/P&gt;&lt;P&gt;It will be my first time. But with the code which you have given it looks pretty straightforward.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For exporting the json, i took the unity ar kit example. And modified the blendshapeprinter.cs script to get all the frame data into a json file.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jul 2018 14:46:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/importing-iphone-x-face-mocap-data-into-maya/m-p/8126184#M9512</guid>
      <dc:creator>harshad.asawale</dc:creator>
      <dc:date>2018-07-12T14:46:46Z</dc:date>
    </item>
  </channel>
</rss>

