Three.js: LoopRepeat executes an action once too many

Created on 1 Jan 2018  Â·  5Comments  Â·  Source: mrdoob/three.js

Description of the problem

When I was writing the unit test of AnimationAction, I noticed something I didn't expect. When asking to LoopRepeat a action 3 times, it executes the action 4 times, I think.
Example: https://jsfiddle.net/wqoLka39/3/

Three.js version
  • [x] Dev
  • [ ] r89
  • [ ] ...
Browser
  • [x] All of them
  • [ ] Chrome
  • [ ] Firefox
  • [ ] Internet Explorer
OS
  • [x] All of them
  • [ ] Windows
  • [ ] macOS
  • [ ] Linux
  • [ ] Android
  • [ ] iOS
Hardware Requirements (graphics card, VR Device, ...)
Suggestion

Most helpful comment

This is confusing. We should just change the behavior to be what everyone
expects.

Best regards,
Ben Houston
http://Clara.io Online 3d modeling and rendering

On Jan 1, 2018 11:43 AM, "Don McCurdy" notifications@github.com wrote:

^I've been surprised by that as well. Not sure if there's another way to
phrase the API that would feel more intuitive.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/mrdoob/three.js/issues/13011#issuecomment-354662826,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAj6_cxgg6NPY_4Ed9ZISd6eUDz1LSKJks5tGQsYgaJpZM4RQDqZ
.

All 5 comments

/ping @bhouston @tschw

This is documented under AnimationAction.repetitions:

The number of repetitions of the performed AnimationClip over the course of this action. Can be set via setLoop. Default is Infinity.

Setting this number has no effect, if the loop mode is set to THREE.LoopOnce.

Note: The first run is not taken into account. For example: if repetition is set to 2, the total number of executed rounds will be 3.

^I've been surprised by that as well. Not sure if there's another way to configure the action that would feel more intuitive, or if this is derived from another tool like Unity?

This is confusing. We should just change the behavior to be what everyone
expects.

Best regards,
Ben Houston
http://Clara.io Online 3d modeling and rendering

On Jan 1, 2018 11:43 AM, "Don McCurdy" notifications@github.com wrote:

^I've been surprised by that as well. Not sure if there's another way to
phrase the API that would feel more intuitive.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/mrdoob/three.js/issues/13011#issuecomment-354662826,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAj6_cxgg6NPY_4Ed9ZISd6eUDz1LSKJks5tGQsYgaJpZM4RQDqZ
.

I agree.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

seep picture seep  Â·  3Comments

akshaysrin picture akshaysrin  Â·  3Comments

jack-jun picture jack-jun  Â·  3Comments

makc picture makc  Â·  3Comments

clawconduce picture clawconduce  Â·  3Comments