#interpolating paths with transitionSeries

15 messages · Page 1 of 1 (latest)

small terrace
#

Hello. I'm facing something that I don't really understand how to solve.
I use the clipPath with svg and an image and make an interpolatePath from star to triangle on top of that.
My issue is that when the transition comes around the path does not go back to original but stays a triangle until the normal interpolate on frame 20 - 50 kicks in again and makes the star into triangle again.
I tried to use a useMemo but nothing came from it.

            const { path: pathStar, width: widthStar, height: heightStar, transformOrigin, instructions } = makeStar({
                innerRadius: 150,
                outerRadius: 200,
                points: 5,
            });

            const { path: trianglePath, width, height, } = makeTriangle({
                length: 400,
                direction: "down",
            });

            const s = interpolate(frame, [20, 50], [0, 1], {
                extrapolateLeft: "clamp",
                extrapolateRight: "clamp",
            })
            // const interpolated = interpolatePath(s, pathStar, trianglePath);
            const interpolated = useMemo(() => {
                return interpolatePath(s, pathStar, trianglePath);
            }, [s, pathStar, frame, trianglePath]);

          return (
                <div >
                    <svg >
                        <defs>
                            <clipPath id="svgPath">
                                <path d={interpolated} />
                            </clipPath>
                        </defs>
                    </svg>
                    <Img
                        style={{
                            clipPath: 'url(#svgPath)',

                        }}
                        src="https://....."
                    />
                </div>
            );```
small terrace
#

hmm... so basically the s interpolate functions runs during the transition but the actual render only happens once the transition is over is what I get from this logs

#

1 frame difference

small terrace
#

I did a little bit more testing and now I think that the shapes (makeStar() ) does not get involved in the transition

sage sandal
small terrace
small terrace
#

4.0.145. vs. 4.0.143

small terrace
#

What I want to point out in these 2 videos is the animations don't seem to get ecexuted anymore so something broke and I don't know what 🙂
I'll do some digging and will post more if I figure out what's happening. Still think it's a me problem

small terrace
#

definitely something I'm doing wrong

sage sandal
#

@small terrace help me out to understand what I am seeing.. what is the issue exactly you are facing? is it something remotion can do better?

small terrace
#

@sage sandal guete morgä 🙂
I think in those videos there are 2 things that I'm investigating.
Interpolating shapes during the transitions not getting the transition and my animations not working properly.
The animations I think I figured out my mistake. Going to try to fix that today.
Interpolating shapes I'm still confused and need to dig deeper into this topic once I have a better understanding what does work and what doesn't in oder to give you a proper bug report if there is any .

sage sandal
small terrace
#

probably only a me problem but tripped me up