Shape Keys not supported?

Hi,
I imported a model with shape key and positional animation into unity, and in Unity both are visible, but when I export the scene, in Needle only the positional animation is visible. Are shapekeys not supported? Or is there something additional I need to activate? I simply put an animator and a play animation on click component on the object.

Hi Dylan,

Shape Keys (or blend shapes) are indeed supported in Needle Engine with Unity. However, ensuring they are exported correctly requires activating specific settings. You should enable KHR_animation_pointer support, which allows morph targets/blend shapes to be animated.

To ensure shape keys are exported:

  1. Go to Project Settings > UnityGLTF.
  2. Enable the KHR_animation_pointer plugin.

Additionally, make sure that your blend shapes are properly configured in Unity and that you are exporting your model with the “Sparse Accessors” setting enabled, especially if your animations are complex (see the documentation) (see the documentation).

If you’ve done all the above and the issue persists, please double-check your import pipeline to confirm that the blend shapes are appropriately set up in your Unity Animator.

Feel free to ask if you have any further questions!

3 replies left
thread_uyRAxIcag7VES40JaerQAyDl
Reply to this message to continue the conversation

Thank you. For this to work, do I need to import the animated object as glb? Or as fbx? And with which settings should I export it from Blender?

Hi Dylan,

You can choose to import your animated object in either glTF (.glb) or FBX format. However, exporting it as a glTF is generally recommended, especially if you want to leverage morph targets (shape keys) and ensure better compatibility with Needle Engine.

For glTF (.glb) export from Blender:

  1. In Blender, go to File > Export > glTF 2.0.
  2. Here are important settings:
    • Format: Select either .glb (binary) or .gltf (JSON with external assets).
    • Export Settings:
      • Check Selected Objects if you only want to export a specific object.
      • Enable Apply Modifiers and Include Shape Keys for animations.
      • If using shape keys, select Animation and enable Export Animation.
      • Enable Sparse Accessors to create smaller files for complex animations (see the documentation) (see the documentation).

For FBX export:

  1. Go to File > Export > FBX.
  2. Recommended settings:
    • Scale: Keep it at 1.0.
    • Under the Geometry tab, enable Apply Modifiers and select Shape Keys.
    • Under the Animation tab, enable Baked Animation and ensure the correct frame range is set.

Make sure you also have the appropriate settings in Unity (Project Settings > UnityGLTF) to support shape key animations.

Let me know if you have further questions!

3 replies left
thread_uyRAxIcag7VES40JaerQAyDl
Reply to this message to continue the conversation

The object is imported as fbx, the blend shapes are visible in the inspector, and the animation preview in unity shows the animation. I have also activated the KHR_animation_pointer plugin. But the animation is still not visible in Needle.

Hi Dylan,

Since you’ve activated the KHR_animation_pointer plugin, and the blend shapes are visible in Unity but not appearing in Needle, consider the following steps:

  1. Check Animator Configuration: Ensure that your Animator Controller is correctly configured and that the animation clips contain the blend shape keyframes. If using Animator, the clips must be set to the correct motion state during export.

  2. Export Settings: Make sure you are exporting the FBX correctly:

    • In Unity, navigate to Project Settings > UnityGLTF. Confirm both the KHR_animation_pointer and any other relevant export options are enabled.
    • For Animation, specify that you want to export from the Animator Controller.
  3. Needle Viewer: Verify if the exported animation is loaded correctly in Needle Viewer. You can use the Needle Viewer to debug your exported GLB or FBX file.

  4. Hierarchy and Node Names: Sometimes issues arise from how the objects are named or structured in Unity. Ensure that the game object hierarchy accurately reflects what should be animated.

  5. Update Packages: If you’re not running the latest version of Needle Engine and UnityGLTF, consider updating them. Recent fixes related to blend shapes and animations may resolve compatibility issues (see the documentation) (see the documentation).

If you still have issues after these steps, it might be worthwhile to test exporting a simple scene with just blend shapes to isolate the problem. Let me know if you need further assistance!

2 replies left
thread_uyRAxIcag7VES40JaerQAyDl
Reply to this message to continue the conversation

the animation clip contains the blend shape keyframes, KHR_animation_pointer is on, and I have the current versions of Needle Engine and UnityGLTF. The positional part of the same animation is exported correctly, but the blend shape animation just won’t show up.

Hi Dylan,

Since you have confirmed that the blend shapes are configured correctly in Unity and the animation clip contains keyframes, here are some additional troubleshooting steps specific to Needle Engine and UnityGLTF exports:

  1. Check for Updates: Ensure both Needle Engine and UnityGLTF have the latest updates installed. Recent changes fixed blend shape animation export issues, especially for FBX objects that do not contain bones (see the documentation).

  2. Verify Export Settings: Double-check export settings in UnityGLTF for the following:

    • Enable Sparse Accessors setting for better blend shape and animation data handling.
    • Ensure no errors occur during the export process.
  3. Animation Paths: Confirm that the animation paths in your Animator contain the proper bindings for the blend shapes. Sometimes the lack of correct bindings will cause the animations not to show up.

  4. Hierarchy and Skinned Mesh: Make sure the hierarchy of your imported model and the SkinnedMeshRenderer settings are intact. Blend shapes require the mesh to be skinned correctly.

  5. Testing with Simple Model: As a last resort, create a minimal test model that only contains a single shape key and an animation. This can determine if the issue lies with the specific model or the overall pipeline.

  6. Consult Sample Projects: Reference the existing samples provided in the Needle Engine repository to ensure that your implementation aligns with their examples (see export).

If the blend shape animations still fail to appear after these checks, consider reaching out to the Needle Engine community or support to report the issue directly for further insights.

Let me know if you need any more assistance!

1 replies left
thread_uyRAxIcag7VES40JaerQAyDl
Reply to this message to continue the conversation

Okay, this is very confusing. I tried to export the scene directly from Blender using Needle engine for Blender, and the result is the same. The positional animation is displayed correctly, but the shape key animation is not shown. I don’t understand what the problem is here.

Hi Dylan,

Given that you are encountering the same issue when exporting directly from Blender using Needle Engine, consider the following focused troubleshooting steps:

  1. Export Mode: Ensure that in the Needle Export settings within Blender, you select the option that enables export of all components, including animations and blend shapes (see the documentation).

  2. Animation Actions: Verify that the actions created for your shape keys in Blender are properly linked and accessible during export. Use the Action Editor to ensure all keyframes are visible for each action.

  3. Check Blender Version: Compatibility between versions of Blender and the Needle Engine Blender add-on can affect functionality. Ensure that you use Blender 4.0 or later since some features may require the latest enhancements (see index) (see the documentation).

  4. Export Options in Blender: Go to File > Export > glTF 2.0. Check that Include > Animation and Animation Type > All Actions are selected in the settings.

  5. Test a Minimal Model: As before, please try exporting a simple shape with basic shape keys and no additional complexities. This might help determine if the configuration of your current model is contributing to the issue.

  6. Community and Support Channels: If the problem persists even after these checks, consider reaching out within the Needle Engine community or support for targeted help, as they may have insights on version-specific quirks (see faq).

If you try these steps and still face challenges, please let me know how it goes!

0 replies left
thread_uyRAxIcag7VES40JaerQAyDl
Reply to this message to continue the conversation

Hi, by shape keys you mean Blendshapes?

Blendshapes are supported and should work (we use them in a couple of projects and you can see them being used in our FaceFilters sample). It shouldnt matter if it’s a FBX or glTF file.

Can you share more details about your asset?