Hello, I'm trying to migrate the code from GSAP2 to GSAP3. I manage to rewrite almost everything, but I'm stuck with the changes inside the MorphSVGPlugin. In GSAP2 I had the following code:
const path = MorphSVGPlugin.pathDataToBezier(
exampleLineNode,
{
align: "relative"
});
.....//later in gsap.timeline
.to(anotherNode, 1, {
bezier: {
type: "soft",
values: path,
autoRotate: 90
},
......
where exampleLineNode
<path id="exampleLine" fill="none" stroke="#DDDDDD" stroke-width="5" stroke-miterlimit="22.9" d="M829.3 313.6V294c0-9 7.2-16 16-16H928c9 0 16 7 16 16v131.7"></path>
My problem is I have no idea how to replace "pathDataToBezier" function. I've read
So I changed the code in the timeline
motionPath: {
path: path,
autoRotate: 90
},
but still, I have no idea how to provide correct data to the path in the motionPath. I've tried MotionPathPlugin.rawPathToString(exampleLineNode)
but without luck (it doesn't return anything, I have Uncaught TypeError: Cannot read properties of undefined (reading '0'). I tried to insert the raw d attribute from the <path>( I mean: 'M829.3 313.6V294c0-9 7.2-16 16-16H928c9 0 16 7 16 16v131.7'), but the element disappears without an error.
What I'm doing wrong?