Creatide / AnimateMate

Create your animations directly in Sketch using AnimateMate.
http://AnimateMate.com
MIT License
1.33k stars 78 forks source link

Offset added after exporting animation #8

Closed rmnblm closed 8 years ago

rmnblm commented 8 years ago

First, thank you for this amazing plugin. I really appreciate your work!

But I have a problem when exporting the animation with multiple layers. I see that you're calculating the key frames based on the artboards X and Y coordinates. I was trying to only animate a nested layer. After the export, the animated layer has been given an offset. The offset is the same X and Y values of the parent layer of the nested layer.

For example, I have my artboard. Then there is layer 1 with (0, 40). Inside layer 1 is another layer 2 which I animated with keyframes. After the export, layer 2 has been moved 40 pixels down on the Y-axis.

Hope you understand my problem. :see_no_evil:

niittymaa commented 8 years ago

Hi and thanks.

There is something about groups in this Basics video if you did not see it yet: https://goo.gl/u0FXf4 Must say that groups not easiest way to work atm :) Because when you change group size or make it under other group after you've already animated it, that will lead you problems with offset. After you got the point how it works, it will be easier.

Item animations calculated based on group position in artboard. So if group position is X10 Y10 and inside that group you have item with animation values X10 Y10. Then "real" values in artboard for that item is X20 Y20, because it's get zero point from group top left point. And this goes on with every groups if you've nested layers... So it will add every parent group positions to child group positions.

So one way to avoid is make "bounds" layer to inside of group, to "reset" off set to same point as artboard. So using "bounds" layers is useful to avoid some problems. And remember that if you move groups then item will be offsetted based to group positions, so sometimes this is also benefit feature.

You can send me example sketch file to hello@creatide.com if you want me to look the actual problem. And remember that if your animations is going too complex, it could be better to do it with AE :)

Hope this helps.

c-d203a534-400a-4e90-acde-7cea5e3139b4

c-a4f6885d-63bf-4df3-b8de-346f4f93c21f

Group_Offset_Example_01.sketch.zip