MCPcopy
hub / github.com/alyssaxuu/motionity / autoKeyframe

Function autoKeyframe

src/js/functions.js:55–189  ·  view source on GitHub ↗
(object, e, multi)

Source from the content-addressed store, hash-verified

53
54// Object has been modified, automatically add a keyframe
55function autoKeyframe(object, e, multi) {
56 if (e.action == 'drag') {
57 newKeyframe(
58 'left',
59 object,
60 currenttime,
61 object.get('left'),
62 true
63 );
64 newKeyframe('top', object, currenttime, object.get('top'), true);
65 } else if (e.action == 'scale') {
66 newKeyframe(
67 'scaleX',
68 object,
69 currenttime,
70 object.get('scaleX'),
71 true
72 );
73 newKeyframe(
74 'scaleY',
75 object,
76 currenttime,
77 object.get('scaleY'),
78 true
79 );
80 newKeyframe(
81 'left',
82 object,
83 currenttime,
84 object.get('left'),
85 true
86 );
87 newKeyframe('top', object, currenttime, object.get('top'), true);
88 newKeyframe(
89 'width',
90 object,
91 currenttime,
92 object.get('width'),
93 true
94 );
95 newKeyframe(
96 'height',
97 object,
98 currenttime,
99 object.get('height'),
100 true
101 );
102 } else if (e.action == 'rotate') {
103 newKeyframe(
104 'angle',
105 object,
106 currenttime,
107 object.get('angle'),
108 true
109 );
110 if (multi) {
111 newKeyframe(
112 'scaleX',

Callers 1

events.jsFile · 0.85

Calls 1

newKeyframeFunction · 0.85

Tested by

no test coverage detected