When animating a material property, I get an "extensions" error that prevents the scene from loading

Hey,
I am trying to do the most basic animation of material colour, where I simply access the base colour of a material and change it over time. I have looked at the samples but cant get it to work. Half the time, when I add an animator that uses an animation that references a material property, I get an error related to “extensions” on the GLB model the animation is on. Other times, I dont get that error, but the animation never plays.

Below, you can see the dragon animator example in the samples folder. You can see I am accessing the base colour on the material too, but I keep getting the error shown when I try run it.

Hello nostalgicbear,

The “extensions” error you’re experiencing may stem from how the animation of material properties is set up or how the GLB model handles those animations. Here are a few suggestions to troubleshoot this issue:

  1. Ensure that the animation is correctly configured: Check that the animation clip is properly accessing the base color of the material you want to animate. This typically involves the correct path for the material property. You can use the structure similar to:

    material.color.set(new THREE.Color(Math.random(), Math.random(), Math.random())); // Example for animating color.
    
  2. Utilize the KHR_animation_pointer extension properly: The KHR_extension allows more complex animations in GLB files. Ensure this is indeed enabled in your export settings. If you encounter an issue with the GLB, double-check if the animation files are correctly linked to the materials.

  3. Inspect the GLTF file: You could use the Needle Engine viewer to inspect the GLB model. This can help you determine if the animation data is correctly stored. You can use the link below, replacing <url> with your file’s URL:

    https://viewer.needle.tools/?url=<url>
    
  4. Validation of Export Settings: Make sure your export settings include the necessary extensions, especially for animations. Check if “KHR_animation_pointer” is selected before exporting from your project.

  5. Testing with Sample Projects: Utilizing the dragon animator example can give insights. Note the variations or potential misconfigurations in your setup compared to the example. You can refer to samples from the Samples Repository.

  6. Update and Compatibility: Ensure that both Needle Engine and Three.js libraries are up to date to prevent compatibility issues.

  7. Checking Console Logs: Look for more detailed logs in the console output pane of Visual Studio Code to get insights into what part of your setup might be failing.

If you could share more details about how you’re animating the color or any specific snippets of your code, that would help diagnose the problem better.

Let me know if you need further assistance!

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

Hi,

  • do you see any warnings or errors related to Animation export in Unity?
  • are you sure your materila is correctly exported? Can you share your glTF file here?

Hey @marcel , Im not getting any errors or warnings on export. This is happening on basic cubes too. Here is a video showing two things:

  1. The small cube over the player has a lit material from Packages/Universal RP/Runtime. Materials/ which seems to work in the browser (but doesnt work when previewing colour change via an animation it in editor)
  2. You can see that I change the Color Fade property in the animation, and it shows as working in preview, but not when run in browser. The cube used is a custom imported cube with a single material slot, but this also happens on the standard Unity cube (I thought maybe it was something related to the model initially).

Im not getting any error other than the “extensions” one reported earlier.

Could you send a bugreport with this project? We can take a look

Just to be sure: you dont get any error in the Unity console, right?

Sure.

Correct, I get the error in the browser console. Ill raise a bug report and update.

Hi, we didn’t receive your report yet - just making sure we didnt miss anything