{"action":"created","issue":{"url":"https://api.github.com/repos/mrdoob/three.js/issues/6934","labels_url":"https://api.github.com/repos/mrdoob/three.js/issues/6934/labels{/name}","comments_url":"https://api.github.com/repos/mrdoob/three.js/issues/6934/comments","events_url":"https://api.github.com/repos/mrdoob/three.js/issues/6934/events","html_url":"https://github.com/mrdoob/three.js/pull/6934","id":98497307,"number":6934,"title":"Modern Mixer-based Animation System","user":{"login":"bhouston","id":588541,"avatar_url":"https://avatars.githubusercontent.com/u/588541?v=3","gravatar_id":"","url":"https://api.github.com/users/bhouston","html_url":"https://github.com/bhouston","followers_url":"https://api.github.com/users/bhouston/followers","following_url":"https://api.github.com/users/bhouston/following{/other_user}","gists_url":"https://api.github.com/users/bhouston/gists{/gist_id}","starred_url":"https://api.github.com/users/bhouston/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bhouston/subscriptions","organizations_url":"https://api.github.com/users/bhouston/orgs","repos_url":"https://api.github.com/users/bhouston/repos","events_url":"https://api.github.com/users/bhouston/events{/privacy}","received_events_url":"https://api.github.com/users/bhouston/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":64,"created_at":"2015-08-01T01:40:16Z","updated_at":"2015-09-10T15:05:23Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/mrdoob/three.js/pulls/6934","html_url":"https://github.com/mrdoob/three.js/pull/6934","diff_url":"https://github.com/mrdoob/three.js/pull/6934.diff","patch_url":"https://github.com/mrdoob/three.js/pull/6934.patch"},"body":"This PR is an implementation of the idea outlined here: https://github.com/mrdoob/three.js/issues/6881\r\n\r\nThere are five new classes in the ```/src/animation``` directory:\r\n\r\n* AnimationAction.js\r\n* AnimationClip.js\r\n* AnimationMixer.js\r\n* AnimationUtils.js\r\n* KeyframeTrack.js\r\n* PropertyBinding.js\r\n\r\nI have also modified these classes to work with the new system:\r\n\r\n* ```MorphAnimMesh```\r\n* ```BlendCharacter```\r\n* ```UCSCharacter```\r\n* ```MD2Character```\r\n\r\nI've updated the animation examples to work with the new system -- these are the most interesting:\r\n\r\nhttps://exocortex.github.io/three.js/examples/#webgl_animation_skinning_morph\r\nhttps://exocortex.github.io/three.js/examples/#webgl_animation_skinning_blending\r\nhttps://exocortex.github.io/three.js/examples/#webgl_morphtargets_horse\r\nhttps://exocortex.github.io/three.js/examples/#webgl_morphtargets_md2\r\n\r\nThe main benefits of this design are tremendous:\r\n- Compatible with the existing JSONLoader format.\r\n- Anything can be animated: bones, material properties (colors, opacity, booleans), visibility, transforms, morphs. This is done via the use of track names that can be resolved to anything in a scene sub-hierarchy via the PropertyBinding.\r\n- The mixer can do fadeIn, fadeOut, crossfade, and warping of any animatable properties.\r\n- AnimationClips are ways to package together hetereogeneous animations together -- a clip can even contain animations on different nodes within a sub-hierarchy.\r\n\r\nCool things:\r\n- Clips can animate anything in a sub-hierarchy of an object.  This can be powerful as it can drive the animations of a number of related nodes.\r\n- Supports interpolation of Vector2, Vector3, Vector4, Color, Quaternion (any class with .clone and .lerp/.slerp works), as well as Boolean, Number, and String.\r\n- PropertyBinding is fairly fast because it uses memorization in a bunch of places.\r\n- Includes a [lossless keyframe optimizer](https://github.com/mrdoob/three.js/pull/6934/files#diff-63940056589cfa5ed47ab45f8206d93cR172) (lossy would be the next step) that removes unnecessary keyframes and uses precaluation to speed accessing keyframes.\r\n- Memory optimized to avoid allocations at runtime without sacrificing speed or flexibility.\r\n- It would be straightforward to add new track types.\r\n- You can animate the weight and timescales of clips.  I use this in the \"webgl_animation_skinning_blending\" to simplify crossfades.\r\n- Clips can be used on multiple characters at the same time.\r\n- KeyframeTracks uses a [local search strategy](https://github.com/mrdoob/three.js/pull/6934/files#diff-63940056589cfa5ed47ab45f8206d93cR33) for the current key which is generally very fast given the access patterns.  Right now it caches the local search index in the keyframe track, but eventually that should be moved into the Action for further speed improvements.\r\n \r\nThis was developed with significant input from @dsarno and @amirebrahimi."},"comment":{"url":"https://api.github.com/repos/mrdoob/three.js/issues/comments/139273961","html_url":"https://github.com/mrdoob/three.js/pull/6934#issuecomment-139273961","issue_url":"https://api.github.com/repos/mrdoob/three.js/issues/6934","id":139273961,"user":{"login":"mrdoob","id":97088,"avatar_url":"https://avatars.githubusercontent.com/u/97088?v=3","gravatar_id":"","url":"https://api.github.com/users/mrdoob","html_url":"https://github.com/mrdoob","followers_url":"https://api.github.com/users/mrdoob/followers","following_url":"https://api.github.com/users/mrdoob/following{/other_user}","gists_url":"https://api.github.com/users/mrdoob/gists{/gist_id}","starred_url":"https://api.github.com/users/mrdoob/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrdoob/subscriptions","organizations_url":"https://api.github.com/users/mrdoob/orgs","repos_url":"https://api.github.com/users/mrdoob/repos","events_url":"https://api.github.com/users/mrdoob/events{/privacy}","received_events_url":"https://api.github.com/users/mrdoob/received_events","type":"User","site_admin":false},"created_at":"2015-09-10T15:05:23Z","updated_at":"2015-09-10T15:05:23Z","body":"I think `animations` is a better name for the json format. Maybe we can increase the version to 5 and use the animation converter If we find `animation` and the version is < 5..."}}