Some stepped keyframes not animating correctly

I am having issues with importing a mesh sequence. (For the record, I understand this is very inefficient, but it does allow for some effects that cannot be achieved in Playcanvas through other means. For example using a bifrost liquid mesh.)

The meshes are set up offscreen and they “jump” onscreen when they are the “active” mesh and then back offscreen when they are inactive. The mesh is keyed in translate Y to start at 1000, then jump to 0, then back to 1000. All these keys are “stepped” so there is no interpolation and so the “jump” happens instantaneously.

The FBX in question has two mesh sequences. One of them works great. The other seems to be interpolating the animation values incorrectly. The result is the “mesh” animation, which should look nice and smooth, flashes instead.

See included video. The beginning has the flashes, once it stops flashing, that is the second mesh sequence.

Here are the import settings:

The FBX looks fine when re-imported back into Maya.

I have even copied the keys themselves from the working mesh sequence onto the non-working mesh sequence and it still is broken after that.

Please help me identify why this is happening and what settings I need (in Maya and/or in Playcanvas) to make sure I can make these stepped keys work. We also use this “jump” technique in other places so the functionality of it is important.

Here is the scene:

Please help!

Looking at the animation, it is moving each mesh from Y 1000 to 0 back to Y 1000 via keyframes and I think our animation system is interpolating between the keyframes linearly by default

It’s not perfect but enabling Cubic Curves will help a lot:

I’m wondering if using scale would be better than 1000 units of movement here to hide/show the meshes or using a higher framerate for the animation in Maya/Max so that the keys are closer to each other in time :thinking:

I wonder if the flashing is due to an alpha material being used or that’s its missing a few frames in the playback due to framerate :thinking:

Thanks for your reply, yaustar!

I actually did have “Cubic Curves” checked.

I think the issue is somewhere in how the fbx-glb converter reads the mesh? Believe it or not, I think it might have something to do with the mesh more than the keys. Or at least the relationship between the mesh and the keys if that makes sense. As I mentioned one of the mesh sequences in the original file was working great and the import settings were the same (obviously since it was the same FBX) and the keys were created using the same script.

FWIW I tried setting the keys to be .0001 frames away from each other and I tried both linear and stepped keys and the problem still persisted. In other words, the translate Y keys looked like this:
frame .999 = 1000
frame 1 = 0
frame 1.999 = 0
frame 2 = 1000

I also tried setting keys at 60 fps instead of 24 fps and that didn’t fix it either.

After all that, I FINALLY got it working by essentially remaking the mesh.

In Maya, I used “Edit Mesh → Duplicate” (NOT “Edit → Duplicate”) to duplicate the FACES on the mesh and extract them into a brand new mesh (as opposed to just duplicating the entire mesh on the object level). I did this for each mesh on each frame and after I replaced the meshes with the new “clean” ones made up of the duplicated faces, it works fine. See video:

The animation is nice and smooth (except for where it loops, of course)

Since duplicating the faces and extracting them into a new mesh fixed the issue (and since there wasn’t an issue with the second mesh sequence in the original file) that’s why I assume the problem lies somewhere in the mesh itself? Perhaps in how it was created or maybe how it was manipulated (the original mesh was created using a few nonlinear deformers like “flare” and “bend” and “sine” before the mesh sequence was made from it).

I should mention I have another animation where I used the same “jump” technique with a rigged mesh (so the stepped keyframes were on the root joint, not a mesh) and it worked fine with no problems. Perhaps in part because there was no mesh to confuse Playcanvas?

Anyway, even though this work around worked for this particular instance, I would still love to identify the actual issue that causes this problem so it can be avoided in the future just in case this workaround doesn’t work for other cases.

Please let me know if you (or anybody else) has any thoughts on this.
Thanks again!

1 Like

CC’ing @slimbuck on this and created public issue to track: FBX that has stepped keyframe animation flickers in PlayCanvas but is fine in FBX Viewer · Issue #762 · playcanvas/editor · GitHub

1 Like