Search Unity

ARKit blendshapes

Discussion in 'AR' started by ge53, Jun 6, 2019.

  1. ge53

    ge53

    Joined:
    Feb 19, 2017
    Posts:
    15
    I am able to easily substitute my own model with blendshapes into the Unity sloth/ARKit example but the Blender shape-keys do not animate (yes, manually with Unity sliders)--the tracking is good, and the model has animated before with a Kinect-- the blendshapes list fine on the skinned mesh renderer, and i have tried both the labeling you include for blendshapes on the sloth, as well as using the Apple Face-Anchor labels for blendshapes. Perhaps the “BlendShapeDriver.cs” is the problem but beyond my scope. I have tried .fbx export from Blender as well as directly importing the Blender file to Unity. All the Unity examples run fine on my phone (Face Blendshape scene and Sloth Blendshape scene). I am using IPhone X, Unity 2019.1.4, and X-Code 10.2.1. Any suggestions, please??
     
  2. ge53

    ge53

    Joined:
    Feb 19, 2017
    Posts:
    15
    I have narrowed this down to Blender(2.79) and .fbx exporter--importing then exporting the working sloth model and no longer seeing the animation even though the blendshapes do show on the skinned mesh renderer.. And debugging the following to be certain that no "currentBlendShapes" are not being read by this blendshapes driver --..

    f (currentBlendShapes != null)
    {
    foreach (KeyValuePair<string, float> kvp in currentBlendShapes)
    {
    int blendShapeIndex = skinnedMeshRenderer.sharedMesh.GetBlendShapeIndex("blendShape2." + kvp.Key);
    if (blendShapeIndex >= 0)
    {
    skinnedMeshRenderer.SetBlendShapeWeight(blendShapeIndex, kvp.Value * 100.0f);
    }


    Has anyone been able to substitute their own model from Blender in this example? or suggestions how to alter the .fbx exporter?
    Any fixes or suggestions, please...? thanks.
     
  3. ge53

    ge53

    Joined:
    Feb 19, 2017
    Posts:
    15
    I have narrowed this down to Blender(2.79) and .fbx exporter--importing then exporting the working sloth model and no longer seeing the animation even though the blendshapes do show on the skinned mesh renderer.. And debugging the following to be certain that no "currentBlendShapes" are not being read by this blendshapes driver --..

    f (currentBlendShapes != null)
    {
    foreach (KeyValuePair<string, float> kvp in currentBlendShapes)
    {
    int blendShapeIndex = skinnedMeshRenderer.sharedMesh.GetBlendShapeIndex("blendShape2." + kvp.Key);
    if (blendShapeIndex >= 0)
    {
    skinnedMeshRenderer.SetBlendShapeWeight(blendShapeIndex, kvp.Value * 100.0f);
    }


    Has anyone been able to substitute their own model from Blender in this example? or suggestions how to alter the .fbx exporter?
    Any fixes or suggestions, please...? thanks.
     
  4. likaiwei99

    likaiwei99

    Joined:
    Dec 10, 2016
    Posts:
    1
    You need to generate the mapping between ARKit Coefficients and Model BlendShapes(e.g. <index, name> pair in .fbx).