How to use morph target?

I’ve created an animation in blender containing shape keys. Yet, when brough to playCanvas, they didn’t work.

So I checked the meshInstance and found about morph and it contained the morph data and even the ShapeKey name. So, how do I use it?

1 Like

Hi @guzu,

The following engine example shows how to animate a morphInstance using the setWeight() property:

1 Like

It works! :+1:

1 Like

I think I discovered a bug :sweat_smile:

setWeight(0,0) doesn’t work. I have to use setWeight(0,0.001) to clear the weights. Or is there another way to clear the weights?

That’s interesting, good catch, seems like a bug. Try raising an issue about it on the engine repo @guzu.

yep, I see the problem in the code and will fix it.

the fix is ready, and it should get released with the next engine release, probably next week. Thanks for reporting it!

1 Like

:grin: :+1: