Two animations on the same entity

Hi,

I have a FBX to be imported from 3ds max and it has two animations (each has the same duration) - one is for expanding the frame’s width and the other is for expanding the frame’s height.(it would not be changing the scale of the frame because I need to keep the frame’s thickness)

What I need to achieve is a frame with arbitrary ratio of width / height by setting currentTime of each animation to get a portrait, landscape or square of various sizes. Is it possible in Playcanvas? It looks Playcanvas does not allow to set currentTime separately if we have multiple animation assets in the component. Please help.

Thank you,

1 Like

From the sounds of things, you won’t be able to do this with exported animations in most engines as you want an arbitrary height/width .

It sounds like you want to do 9 slicing and scale each part separately (you will need to set this up and write the logic).

@Mr_F might have a graphical trick up his sleeve to make this easier.

I approached this project with slicing into several parts, but the actual frame is a pretty complicated mesh and couldn’t get nice cuts (90 degree cut) which affects thickness of the frame here and there when scaling. Any other suggestions please?

One idea (although I have no idea how to do this in PlayCanvas) is to move the bones (I’m assuming there are bones?) in code rather than using a bespoke animation.

Yes, the animation component has bones. Are you saying moving these bones? or something new?

The animation system is way too old and can’t do that (or maybe it can - ask @will)
What you want can be done with morphing (aka blendshapes) though.

Morphing? Can you point out where to get started?