{"action":"created","comment":{"url":"https://api.github.com/repos/BabylonJS/Babylon.js/pulls/comments/199659510","pull_request_review_id":133821409,"id":199659510,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5OTY1OTUxMA==","diff_hunk":"@@ -282,21 +282,26 @@\n         /**\r\n          * Stop and delete the current animation\r\n          * @param animationName defines a string used to only stop some of the runtime animations instead of all\r\n+         * @param targetMask - a function that determines if the animation should be stopped based on its target (all animations will be stopped if both this and animationName are empty)\r\n          */\r\n-        public stop(animationName?: string): void {\r\n-            if (animationName) {\r\n+        public stop(animationName?: string, targetMask?: (target: any) => boolean): void {\r\n+            if (animationName || targetMask) {\r\n                 var idx = this._scene._activeAnimatables.indexOf(this);\r\n \r\n                 if (idx > -1) {\r\n \r\n                     var runtimeAnimations = this._runtimeAnimations;\r\n \r\n                     for (var index = runtimeAnimations.length - 1; index >= 0; index--) {\r\n-                        if (typeof animationName === \"string\" && runtimeAnimations[index].animation.name != animationName) {\r\n+                        const runtimeAnimation = runtimeAnimations[index];\r\n+                        if (typeof animationName === \"string\" && runtimeAnimation.animation.name != animationName) {\r\n+                            continue;\r\n+                        }\r\n+                        if (typeof targetMask === \"function\" && !targetMask(runtimeAnimation.target)) {\r","path":"src/Animations/babylon.animatable.ts","position":22,"original_position":22,"commit_id":"17f34bac87697a76b0864d96cb406080a9a9a63a","original_commit_id":"17f34bac87697a76b0864d96cb406080a9a9a63a","user":{"login":"deltakosh","id":1306056,"node_id":"MDQ6VXNlcjEzMDYwNTY=","avatar_url":"https://avatars0.githubusercontent.com/u/1306056?v=4","gravatar_id":"","url":"https://api.github.com/users/deltakosh","html_url":"https://github.com/deltakosh","followers_url":"https://api.github.com/users/deltakosh/followers","following_url":"https://api.github.com/users/deltakosh/following{/other_user}","gists_url":"https://api.github.com/users/deltakosh/gists{/gist_id}","starred_url":"https://api.github.com/users/deltakosh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deltakosh/subscriptions","organizations_url":"https://api.github.com/users/deltakosh/orgs","repos_url":"https://api.github.com/users/deltakosh/repos","events_url":"https://api.github.com/users/deltakosh/events{/privacy}","received_events_url":"https://api.github.com/users/deltakosh/received_events","type":"User","site_admin":false},"body":"Well both can be removed actually and replaced by if (xx) :)","created_at":"2018-07-03T01:03:31Z","updated_at":"2018-07-03T01:03:31Z","html_url":"https://github.com/BabylonJS/Babylon.js/pull/4644#discussion_r199659510","pull_request_url":"https://api.github.com/repos/BabylonJS/Babylon.js/pulls/4644","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/BabylonJS/Babylon.js/pulls/comments/199659510"},"html":{"href":"https://github.com/BabylonJS/Babylon.js/pull/4644#discussion_r199659510"},"pull_request":{"href":"https://api.github.com/repos/BabylonJS/Babylon.js/pulls/4644"}},"in_reply_to_id":199544598},"pull_request":{"url":"https://api.github.com/repos/BabylonJS/Babylon.js/pulls/4644","id":198461623,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk4NDYxNjIz","html_url":"https://github.com/BabylonJS/Babylon.js/pull/4644","diff_url":"https://github.com/BabylonJS/Babylon.js/pull/4644.diff","patch_url":"https://github.com/BabylonJS/Babylon.js/pull/4644.patch","issue_url":"https://api.github.com/repos/BabylonJS/Babylon.js/issues/4644","number":4644,"state":"open","locked":false,"title":"masking for scene beginAnimation functions","user":{"login":"fmmoret","id":5396858,"node_id":"MDQ6VXNlcjUzOTY4NTg=","avatar_url":"https://avatars3.githubusercontent.com/u/5396858?v=4","gravatar_id":"","url":"https://api.github.com/users/fmmoret","html_url":"https://github.com/fmmoret","followers_url":"https://api.github.com/users/fmmoret/followers","following_url":"https://api.github.com/users/fmmoret/following{/other_user}","gists_url":"https://api.github.com/users/fmmoret/gists{/gist_id}","starred_url":"https://api.github.com/users/fmmoret/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fmmoret/subscriptions","organizations_url":"https://api.github.com/users/fmmoret/orgs","repos_url":"https://api.github.com/users/fmmoret/repos","events_url":"https://api.github.com/users/fmmoret/events{/privacy}","received_events_url":"https://api.github.com/users/fmmoret/received_events","type":"User","site_admin":false},"body":"## Description\r\nThis change let's you decide to not apply parts of animations to models. This is useful when you want de-synced animations running in parallel on a character in a selective manner. \r\n\r\nThis was me: http://www.html5gamedevs.com/topic/38248-animation-masking-parallel-animations/\r\nThese are similar asks that I found: http://www.html5gamedevs.com/topic/32712-animation-interpolation-and-blendingspeed/?tab=comments#comment-187528\r\nhttp://www.html5gamedevs.com/topic/26295-parallel-animations-blending/?tab=comments#comment-151089\r\n\r\n## Looking for feedback\r\nI am curious what your guys' input is on:\r\n1) the interface for this masking function,\r\n2) if we should also skip the target.getAnimatables if the masking function masks out target.\r\nI felt like by the time people are doing masking, they probably have very custom use cases & may not want to mask out descendants.\r\n3) if we should keep the stopCurrent code how it is or also mask out the stop\r\n\r\n## Example and current solutions\r\nSay that I have two animations crafted by my animation artist: \r\n(a) sword swinging animation that involves my model's legs slightly or not at all.\r\n(b) standard walking animation that swings it's arms back and forth\r\n\r\nIf my game requires that I be able to swing my sword while walking, I want to be able to apply that swing animation to the top of the body & keep walking. \r\n\r\nMy reasonable options are basically 1) use blended animations, 2) ask my artist to separate the top and bottom parts of all animations that I might ever want to combine\r\n\r\n1) just doesn't really get the job done, b/c you're just not doing either of the animations that you really want -- you have some weird blurry thing in-between\r\n2) works in an enterprise / professional environment, but most of us hobby / indie devs don't have personal artists or have weak-to-zero blender skills.\r\n\r\nIf you have better animations to demo this, I would encourage trying that out, but\r\nhere's an example:\r\n\r\nWith masking -- note that I've masked out the upper body animations until I use the attack. The feet continue to walk with the walk animation cadence.\r\n![with](https://user-images.githubusercontent.com/5396858/42121788-9b64e90c-7bea-11e8-9af5-22221ea97ade.gif)\r\nWithout\r\n![without](https://user-images.githubusercontent.com/5396858/42121789-9b80116e-7bea-11e8-8f16-b6b95940085f.gif)\r\n","created_at":"2018-06-30T05:51:29Z","updated_at":"2018-07-03T01:03:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0bc6836ff64cc5d809735d77ad6c17efe5ff86e1","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/BabylonJS/Babylon.js/pulls/4644/commits","review_comments_url":"https://api.github.com/repos/BabylonJS/Babylon.js/pulls/4644/comments","review_comment_url":"https://api.github.com/repos/BabylonJS/Babylon.js/pulls/comments{/number}","comments_url":"https://api.github.com/repos/BabylonJS/Babylon.js/issues/4644/comments","statuses_url":"https://api.github.com/repos/BabylonJS/Babylon.js/statuses/17f34bac87697a76b0864d96cb406080a9a9a63a","head":{"label":"fmmoret:fm-animation-masking","ref":"fm-animation-masking","sha":"17f34bac87697a76b0864d96cb406080a9a9a63a","user":{"login":"fmmoret","id":5396858,"node_id":"MDQ6VXNlcjUzOTY4NTg=","avatar_url":"https://avatars3.githubusercontent.com/u/5396858?v=4","gravatar_id":"","url":"https://api.github.com/users/fmmoret","html_url":"https://github.com/fmmoret","followers_url":"https://api.github.com/users/fmmoret/followers","following_url":"https://api.github.com/users/fmmoret/following{/other_user}","gists_url":"https://api.github.com/users/fmmoret/gists{/gist_id}","starred_url":"https://api.github.com/users/fmmoret/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fmmoret/subscriptions","organizations_url":"https://api.github.com/users/fmmoret/orgs","repos_url":"https://api.github.com/users/fmmoret/repos","events_url":"https://api.github.com/users/fmmoret/events{/privacy}","received_events_url":"https://api.github.com/users/fmmoret/received_events","type":"User","site_admin":false},"repo":{"id":139220681,"node_id":"MDEwOlJlcG9zaXRvcnkxMzkyMjA2ODE=","name":"Babylon.js","full_name":"fmmoret/Babylon.js","owner":{"login":"fmmoret","id":5396858,"node_id":"MDQ6VXNlcjUzOTY4NTg=","avatar_url":"https://avatars3.githubusercontent.com/u/5396858?v=4","gravatar_id":"","url":"https://api.github.com/users/fmmoret","html_url":"https://github.com/fmmoret","followers_url":"https://api.github.com/users/fmmoret/followers","following_url":"https://api.github.com/users/fmmoret/following{/other_user}","gists_url":"https://api.github.com/users/fmmoret/gists{/gist_id}","starred_url":"https://api.github.com/users/fmmoret/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fmmoret/subscriptions","organizations_url":"https://api.github.com/users/fmmoret/orgs","repos_url":"https://api.github.com/users/fmmoret/repos","events_url":"https://api.github.com/users/fmmoret/events{/privacy}","received_events_url":"https://api.github.com/users/fmmoret/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/fmmoret/Babylon.js","description":"Babylon.js: a complete JavaScript framework for building 3D games with HTML 5 and WebGL","fork":true,"url":"https://api.github.com/repos/fmmoret/Babylon.js","forks_url":"https://api.github.com/repos/fmmoret/Babylon.js/forks","keys_url":"https://api.github.com/repos/fmmoret/Babylon.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fmmoret/Babylon.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fmmoret/Babylon.js/teams","hooks_url":"https://api.github.com/repos/fmmoret/Babylon.js/hooks","issue_events_url":"https://api.github.com/repos/fmmoret/Babylon.js/issues/events{/number}","events_url":"https://api.github.com/repos/fmmoret/Babylon.js/events","assignees_url":"https://api.github.com/repos/fmmoret/Babylon.js/assignees{/user}","branches_url":"https://api.github.com/repos/fmmoret/Babylon.js/branches{/branch}","tags_url":"https://api.github.com/repos/fmmoret/Babylon.js/tags","blobs_url":"https://api.github.com/repos/fmmoret/Babylon.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fmmoret/Babylon.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fmmoret/Babylon.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/fmmoret/Babylon.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fmmoret/Babylon.js/statuses/{sha}","languages_url":"https://api.github.com/repos/fmmoret/Babylon.js/languages","stargazers_url":"https://api.github.com/repos/fmmoret/Babylon.js/stargazers","contributors_url":"https://api.github.com/repos/fmmoret/Babylon.js/contributors","subscribers_url":"https://api.github.com/repos/fmmoret/Babylon.js/subscribers","subscription_url":"https://api.github.com/repos/fmmoret/Babylon.js/subscription","commits_url":"https://api.github.com/repos/fmmoret/Babylon.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/fmmoret/Babylon.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/fmmoret/Babylon.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/fmmoret/Babylon.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/fmmoret/Babylon.js/contents/{+path}","compare_url":"https://api.github.com/repos/fmmoret/Babylon.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fmmoret/Babylon.js/merges","archive_url":"https://api.github.com/repos/fmmoret/Babylon.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fmmoret/Babylon.js/downloads","issues_url":"https://api.github.com/repos/fmmoret/Babylon.js/issues{/number}","pulls_url":"https://api.github.com/repos/fmmoret/Babylon.js/pulls{/number}","milestones_url":"https://api.github.com/repos/fmmoret/Babylon.js/milestones{/number}","notifications_url":"https://api.github.com/repos/fmmoret/Babylon.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fmmoret/Babylon.js/labels{/name}","releases_url":"https://api.github.com/repos/fmmoret/Babylon.js/releases{/id}","deployments_url":"https://api.github.com/repos/fmmoret/Babylon.js/deployments","created_at":"2018-06-30T05:02:47Z","updated_at":"2018-06-30T05:02:56Z","pushed_at":"2018-06-30T23:22:58Z","git_url":"git://github.com/fmmoret/Babylon.js.git","ssh_url":"git@github.com:fmmoret/Babylon.js.git","clone_url":"https://github.com/fmmoret/Babylon.js.git","svn_url":"https://github.com/fmmoret/Babylon.js","homepage":"http://www.babylonjs.com","size":1224074,"stargazers_count":0,"watchers_count":0,"language":"TypeScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"BabylonJS:master","ref":"master","sha":"037d7a85efe6626e082fa9438412e835008f8234","user":{"login":"BabylonJS","id":4855800,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ4NTU4MDA=","avatar_url":"https://avatars1.githubusercontent.com/u/4855800?v=4","gravatar_id":"","url":"https://api.github.com/users/BabylonJS","html_url":"https://github.com/BabylonJS","followers_url":"https://api.github.com/users/BabylonJS/followers","following_url":"https://api.github.com/users/BabylonJS/following{/other_user}","gists_url":"https://api.github.com/users/BabylonJS/gists{/gist_id}","starred_url":"https://api.github.com/users/BabylonJS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BabylonJS/subscriptions","organizations_url":"https://api.github.com/users/BabylonJS/orgs","repos_url":"https://api.github.com/users/BabylonJS/repos","events_url":"https://api.github.com/users/BabylonJS/events{/privacy}","received_events_url":"https://api.github.com/users/BabylonJS/received_events","type":"Organization","site_admin":false},"repo":{"id":11007313,"node_id":"MDEwOlJlcG9zaXRvcnkxMTAwNzMxMw==","name":"Babylon.js","full_name":"BabylonJS/Babylon.js","owner":{"login":"BabylonJS","id":4855800,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ4NTU4MDA=","avatar_url":"https://avatars1.githubusercontent.com/u/4855800?v=4","gravatar_id":"","url":"https://api.github.com/users/BabylonJS","html_url":"https://github.com/BabylonJS","followers_url":"https://api.github.com/users/BabylonJS/followers","following_url":"https://api.github.com/users/BabylonJS/following{/other_user}","gists_url":"https://api.github.com/users/BabylonJS/gists{/gist_id}","starred_url":"https://api.github.com/users/BabylonJS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BabylonJS/subscriptions","organizations_url":"https://api.github.com/users/BabylonJS/orgs","repos_url":"https://api.github.com/users/BabylonJS/repos","events_url":"https://api.github.com/users/BabylonJS/events{/privacy}","received_events_url":"https://api.github.com/users/BabylonJS/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/BabylonJS/Babylon.js","description":"Babylon.js: a complete JavaScript framework for building 3D games with HTML 5 and WebGL","fork":false,"url":"https://api.github.com/repos/BabylonJS/Babylon.js","forks_url":"https://api.github.com/repos/BabylonJS/Babylon.js/forks","keys_url":"https://api.github.com/repos/BabylonJS/Babylon.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/BabylonJS/Babylon.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/BabylonJS/Babylon.js/teams","hooks_url":"https://api.github.com/repos/BabylonJS/Babylon.js/hooks","issue_events_url":"https://api.github.com/repos/BabylonJS/Babylon.js/issues/events{/number}","events_url":"https://api.github.com/repos/BabylonJS/Babylon.js/events","assignees_url":"https://api.github.com/repos/BabylonJS/Babylon.js/assignees{/user}","branches_url":"https://api.github.com/repos/BabylonJS/Babylon.js/branches{/branch}","tags_url":"https://api.github.com/repos/BabylonJS/Babylon.js/tags","blobs_url":"https://api.github.com/repos/BabylonJS/Babylon.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/BabylonJS/Babylon.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/BabylonJS/Babylon.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/BabylonJS/Babylon.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/BabylonJS/Babylon.js/statuses/{sha}","languages_url":"https://api.github.com/repos/BabylonJS/Babylon.js/languages","stargazers_url":"https://api.github.com/repos/BabylonJS/Babylon.js/stargazers","contributors_url":"https://api.github.com/repos/BabylonJS/Babylon.js/contributors","subscribers_url":"https://api.github.com/repos/BabylonJS/Babylon.js/subscribers","subscription_url":"https://api.github.com/repos/BabylonJS/Babylon.js/subscription","commits_url":"https://api.github.com/repos/BabylonJS/Babylon.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/BabylonJS/Babylon.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/BabylonJS/Babylon.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/BabylonJS/Babylon.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/BabylonJS/Babylon.js/contents/{+path}","compare_url":"https://api.github.com/repos/BabylonJS/Babylon.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/BabylonJS/Babylon.js/merges","archive_url":"https://api.github.com/repos/BabylonJS/Babylon.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/BabylonJS/Babylon.js/downloads","issues_url":"https://api.github.com/repos/BabylonJS/Babylon.js/issues{/number}","pulls_url":"https://api.github.com/repos/BabylonJS/Babylon.js/pulls{/number}","milestones_url":"https://api.github.com/repos/BabylonJS/Babylon.js/milestones{/number}","notifications_url":"https://api.github.com/repos/BabylonJS/Babylon.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/BabylonJS/Babylon.js/labels{/name}","releases_url":"https://api.github.com/repos/BabylonJS/Babylon.js/releases{/id}","deployments_url":"https://api.github.com/repos/BabylonJS/Babylon.js/deployments","created_at":"2013-06-27T20:40:42Z","updated_at":"2018-07-03T00:37:51Z","pushed_at":"2018-07-03T00:52:43Z","git_url":"git://github.com/BabylonJS/Babylon.js.git","ssh_url":"git@github.com:BabylonJS/Babylon.js.git","clone_url":"https://github.com/BabylonJS/Babylon.js.git","svn_url":"https://github.com/BabylonJS/Babylon.js","homepage":"http://www.babylonjs.com","size":1224033,"stargazers_count":7068,"watchers_count":7068,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1506,"mirror_url":null,"archived":false,"open_issues_count":64,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":1506,"open_issues":64,"watchers":7068,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/BabylonJS/Babylon.js/pulls/4644"},"html":{"href":"https://github.com/BabylonJS/Babylon.js/pull/4644"},"issue":{"href":"https://api.github.com/repos/BabylonJS/Babylon.js/issues/4644"},"comments":{"href":"https://api.github.com/repos/BabylonJS/Babylon.js/issues/4644/comments"},"review_comments":{"href":"https://api.github.com/repos/BabylonJS/Babylon.js/pulls/4644/comments"},"review_comment":{"href":"https://api.github.com/repos/BabylonJS/Babylon.js/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/BabylonJS/Babylon.js/pulls/4644/commits"},"statuses":{"href":"https://api.github.com/repos/BabylonJS/Babylon.js/statuses/17f34bac87697a76b0864d96cb406080a9a9a63a"}},"author_association":"NONE"}}
{"actor":{"display_login":"deltakosh"}}