Skip to content

Commit 1b352de

Browse files
committed
throw error message for invalid property path for animations (fixes #4105) (#4122)
1 parent d82d7b2 commit 1b352de

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

examples/animation/arms/index.html

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<a-entity position="0 -10.1 -1" rotation="30 180 0">
2121
<a-sphere radius="7" color="#7BC8A4"></a-sphere>
2222

23-
<a-entity animation="property: rotation; to: 45 100 100; dur: 5000; delay: 250; loop: true; dir: alternate">
23+
<a-entity animation="property: object3D.rotation; to: 45 100 100; dur: 5000; delay: 250; loop: true; dir: alternate">
2424
<a-sphere radius="1.5" color="#7BC8A4"></a-sphere>
2525
<a-cylinder position="0 5 0" height="10" radius="0.075" color="#404040"></a-cylinder>
2626

@@ -168,23 +168,23 @@
168168

169169
<a-entity animation="property: rotation; to: -360 360 -360; dur: 30000; easing: linear; loop: true; dir: normal; fill: none">
170170

171-
<a-entity position="0 -20 50" animation="property: rotation; to: 45 100 100; dur: 5000; delay: 250; repeat: indefinite; direction: alternate">
171+
<a-entity position="0 -20 50" animation="property: rotation; to: 45 100 100; dur: 5000; delay: 250; loop: true; dir: alternate">
172172
<a-sphere radius="1.5" color="#7BC8A4"></a-sphere>
173173
<a-cylinder position="0 5 0" height="10" radius="0.075" color="#404040"></a-cylinder>
174174

175-
<a-entity position="0 10 0" animation="property: rotation; to: 90 90 0; dur: 2000; delay: 0; repeat: indefinite; direction: alternate">
175+
<a-entity position="0 10 0" animation="property: rotation; to: 90 90 0; dur: 2000; delay: 0; loop: true; dir: alternate">
176176
<a-sphere radius="1" color="#F16745"></a-sphere>
177177
<a-cylinder position="0 5 0" height="10" radius="0.075" color="#404040"></a-cylinder>
178178

179-
<a-entity position="0 10 0" animation="property: rotation; to: 50 10 100; dur: 2000; delay: 0; repeat: indefinite; direction: alternate">
179+
<a-entity position="0 10 0" animation="property: rotation; to: 50 10 100; dur: 2000; delay: 0; loop: true; dir: alternate">
180180
<a-sphere radius="3" color="#4CC3D9"></a-sphere>
181181
<a-cylinder position="0 5 0" height="10" radius="0.075" color="#404040"></a-cylinder>
182182

183-
<a-entity position="0 10 0" animation="property: rotation; to: 50 40 50; dur: 2000; delay: 250; repeat: indefinite; direction: alternate">
183+
<a-entity position="0 10 0" animation="property: rotation; to: 50 40 50; dur: 2000; delay: 250; loop: true; dir: alternate">
184184
<a-sphere radius="4.5" color="#FFC65D"></a-sphere>
185185
<a-cylinder position="0 5 0" height="10" radius="0.075" color="#404040"></a-cylinder>
186186

187-
<a-entity position="0 10 0" animation="property: rotation; to: 90 90 0; dur: 2000; delay: 0; repeat: indefinite; direction: alternate">
187+
<a-entity position="0 10 0" animation="property: rotation; to: 90 90 0; dur: 2000; delay: 0; loop: true; dir: alternate">
188188
<a-sphere radius="1.5" color="#93648D"></a-sphere>
189189
<a-cylinder position="0 5 0" height="10" radius="0.075" color="#404040"></a-cylinder>
190190

@@ -197,7 +197,7 @@
197197
</a-entity>
198198
</a-entity>
199199

200-
<a-entity position="40 20 0" animation="property: rotation; to: 45 100 100; dur: 5000; delay: 250; repeat: indefinite; direction: alternate">
200+
<a-entity position="40 20 0" animation="property: rotation; to: 45 100 100; dur: 5000; delay: 250; loop: true; dir: alternate">
201201
<a-sphere radius="1.5" color="#7BC8A4"></a-sphere>
202202
<a-cylinder position="0 5 0" height="10" radius="0.075" color="#404040"></a-cylinder>
203203

@@ -209,11 +209,11 @@
209209
<a-sphere radius="3" color="#4CC3D9"></a-sphere>
210210
<a-cylinder position="0 5 0" height="10" radius="0.075" color="#404040"></a-cylinder>
211211

212-
<a-entity position="0 10 0" animation="property: rotation; to: 50 40 50; dur: 2000; delay: 250; repeat: indefinite; direction: alternate">
212+
<a-entity position="0 10 0" animation="property: rotation; to: 50 40 50; dur: 2000; delay: 250; loop: true; dir: alternate">
213213
<a-sphere radius="4.5" color="#FFC65D"></a-sphere>
214214
<a-cylinder position="0 5 0" height="10" radius="0.075" color="#404040"></a-cylinder>
215215

216-
<a-entity position="0 10 0" animation="property: rotation; to: 90 90 0; dur: 2000; delay: 0; repeat: indefinite; direction: alternate">
216+
<a-entity position="0 10 0" animation="property: rotation; to: 90 90 0; dur: 2000; delay: 0; loop: true; dir: alternate">
217217
<a-sphere radius="1.5" color="#93648D"></a-sphere>
218218
<a-cylinder position="0 5 0" height="10" radius="0.075" color="#404040"></a-cylinder>
219219

src/components/animation.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -568,6 +568,10 @@ function getRawProperty (el, path) {
568568
for (i = 0; i < split.length; i++) {
569569
value = value[split[i]];
570570
}
571+
if (value === undefined) {
572+
console.log(el);
573+
throw new Error('[animation] property (' + path + ') could not be found');
574+
}
571575
return value;
572576
}
573577

0 commit comments

Comments
 (0)