Basic Animation Preview not working

Hello dear Community!

I have followed the basic example Importing your first Model and Animation | Learn PlayCanvas.
It’s quite straightforward and easy :smiley:
Here is the project PlayCanvas 3D HTML5 Game Engine

Unfortunately the animation preview is not working on PC (Edge and Chrome). And the frame count does not change (stays at 0)

I see the following error: Failed to construct ‘ImageData’: The input data length is not a multiple of (4 * width).

Where does it come from?
The image size is 1024x1024 and the preview works on the iPad.

What’s more when I launch the project, the animation does not run.

Anyone would have an idea?

Thanks in advance for your help!

Cheers,
Pat

Quick note: the PC is on Windows 10 :wink:

Hmm, I can’t reproduce this on Mac

1 Like

Also just tried this on my Windows 10 PC with no issue.

Can you share you project please?

Thanks!
I’m new to Playcanvas. How can I share the project with you?

On the project dashboard, just post the URL here

Is it this one in posted in the first message? PlayCanvas 3D HTML5 Game Engine

Or PlayCanvas | HTML5 Game Engine

A second question: why doesn’t the animation start when launching ? The state machine should run it, right?

Hi @patsej and welcome!

If you define the Root entity as Root Bone, this works as expected.

image

1 Like

Hey Albertos,
Yes, this has fixed the animation start when launching. Thanks! :smiley:

On the other hand, the animation preview is still not working.
Where could it come from? Could you reproduce it on any machine? What does the error mean?

The preview is working for me in your project:

Did you change anything?

No, I haven’t changed anything.

I’ve just trying with another browser: Firefox.
Same behaviour but a different error:
Uncaught DOMException: Index or size is negative or greater than the allowed amount

with a warning before and after:
WebGL warning: generateMipmap: Tex image TEXTURE_2D level 0 is incurring lazy initialization.

Here is the screenshot:

Odd, I’m not getting the issue here :thinking:

Tried both firefox and chrome.

Can you run WebGL Report and post a screenshot please?

Sure

It looks alright to me, very confused why the preview is not working for you :thinking:

If you remove the texture from the material, does the preview work?

Thanks for checking. I’ve removed the texture from the material and I still get the error…
Maybe there is an issue with this specific model? I’ll try with another one. Is there a project I could use to check?

The model works fine on my machine which is why this is so confusing.

Can you try a different browser like Firefox? Do you have any extensions installed on your browser?

I have the same problem with displaying preview, but it works in the game.

Animation preview cannot render as input data is not a multiple of 4

If preview in anim file

If preview in anim state graph

This is true for both my own model and the Playbot asset from PlayCanvas

1 Like

Hi @robert.ua!

There is already a GitHub issue created for this.

Maybe you can report your case in a reply as well.

2 Likes

If this error occurs during the preview of the character placed in the scene, running the project in the browser results in the following bug and the project cannot be started.

viewport-error-console.js:159 TypeError: Cannot read properties of undefined (reading ‘length’)
at Skeleton.addTime (playcanvas-1.68.1.js:35178:35)
at Skeleton.set (playcanvas-1.68.1.js:35287:10)
at Skeleton.set (playcanvas-1.68.1.js:35272:22)
at AnimationComponent.play (playcanvas-1.68.1.js:42671:31)
at AnimationComponent.setModel (playcanvas-1.68.1.js:42700:11)
at ModelComponent.set (playcanvas-1.68.1.js:53950:55)
at ModelComponent._onModelAssetLoad (playcanvas-1.68.1.js:53804:15)
at ModelComponent._bindModelAsset (playcanvas-1.68.1.js:53785:10)
at ModelComponent.set (playcanvas-1.68.1.js:53908:13)
at ModelComponentSystem.initializeComponentData (playcanvas-1.68.1.js:54201:31)