{"action":"created","comment":{"url":"https://api.github.com/repos/mrdoob/three.js/pulls/comments/158655968","pull_request_review_id":85497485,"id":158655968,"diff_hunk":"@@ -800,9 +800,41 @@ THREE.GLTFExporter.prototype = {\n \n \t\t\t\t\tfor ( var attributeName in geometry.morphAttributes ) {\n \n+\t\t\t\t\t\t// glTF 2.0 morph supports only POSITION/NORMAL/TANGENT.\n+\t\t\t\t\t\t//\n+\t\t\t\t\t\t// @TODO TANGENT support\n+\n+\t\t\t\t\t\tif ( attributeName !== 'position' && attributeName !== 'normal' ) {\n+\n+\t\t\t\t\t\t\tcontinue;\n+\n+\t\t\t\t\t\t}\n+\n \t\t\t\t\t\tvar attribute = geometry.morphAttributes[ attributeName ][ i ];\n-\t\t\t\t\t\tattributeName = nameConversion[ attributeName ] || attributeName.toUpperCase();\n-\t\t\t\t\t\ttarget[ attributeName ] = processAccessor( attribute, geometry );\n+\n+\t\t\t\t\t\t// Three.js morph attribute has absolute values\n+\t\t\t\t\t\t// while the one of glTF has relative values.\n+\t\t\t\t\t\t// So we convert here.\n+\t\t\t\t\t\t//\n+\t\t\t\t\t\t// glTF 2.0 Specification:\n+\t\t\t\t\t\t// https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#morph-targets\n+\n+\t\t\t\t\t\tvar baseAttribute = geometry.attributes[ attributeName ];\n+\t\t\t\t\t\t// Clones attribute not to override\n+\t\t\t\t\t\tvar attribute2 = attribute.clone();","path":"examples/js/exporters/GLTFExporter.js","position":27,"original_position":27,"commit_id":"2bd18746dd69c4d8d3a95d1cba4a3f0f04dd442c","original_commit_id":"2bd18746dd69c4d8d3a95d1cba4a3f0f04dd442c","user":{"login":"donmccurdy","id":1848368,"avatar_url":"https://avatars3.githubusercontent.com/u/1848368?v=4","gravatar_id":"","url":"https://api.github.com/users/donmccurdy","html_url":"https://github.com/donmccurdy","followers_url":"https://api.github.com/users/donmccurdy/followers","following_url":"https://api.github.com/users/donmccurdy/following{/other_user}","gists_url":"https://api.github.com/users/donmccurdy/gists{/gist_id}","starred_url":"https://api.github.com/users/donmccurdy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/donmccurdy/subscriptions","organizations_url":"https://api.github.com/users/donmccurdy/orgs","repos_url":"https://api.github.com/users/donmccurdy/repos","events_url":"https://api.github.com/users/donmccurdy/events{/privacy}","received_events_url":"https://api.github.com/users/donmccurdy/received_events","type":"User","site_admin":false},"body":"nit: could you rename this `relativeAttribute` or something like that? Comment above it wouldn't be necessary in that case.","created_at":"2017-12-25T22:56:18Z","updated_at":"2017-12-25T22:57:26Z","html_url":"https://github.com/mrdoob/three.js/pull/12967#discussion_r158655968","pull_request_url":"https://api.github.com/repos/mrdoob/three.js/pulls/12967","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/mrdoob/three.js/pulls/comments/158655968"},"html":{"href":"https://github.com/mrdoob/three.js/pull/12967#discussion_r158655968"},"pull_request":{"href":"https://api.github.com/repos/mrdoob/three.js/pulls/12967"}}},"pull_request":{"url":"https://api.github.com/repos/mrdoob/three.js/pulls/12967","id":160061594,"html_url":"https://github.com/mrdoob/three.js/pull/12967","diff_url":"https://github.com/mrdoob/three.js/pull/12967.diff","patch_url":"https://github.com/mrdoob/three.js/pull/12967.patch","issue_url":"https://api.github.com/repos/mrdoob/three.js/issues/12967","number":12967,"state":"open","locked":false,"title":"GLTFExporter Fix Morph","user":{"login":"takahirox","id":7637832,"avatar_url":"https://avatars2.githubusercontent.com/u/7637832?v=4","gravatar_id":"","url":"https://api.github.com/users/takahirox","html_url":"https://github.com/takahirox","followers_url":"https://api.github.com/users/takahirox/followers","following_url":"https://api.github.com/users/takahirox/following{/other_user}","gists_url":"https://api.github.com/users/takahirox/gists{/gist_id}","starred_url":"https://api.github.com/users/takahirox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/takahirox/subscriptions","organizations_url":"https://api.github.com/users/takahirox/orgs","repos_url":"https://api.github.com/users/takahirox/repos","events_url":"https://api.github.com/users/takahirox/events{/privacy}","received_events_url":"https://api.github.com/users/takahirox/received_events","type":"User","site_admin":false},"body":"This PR fixes `GLTFExporter` Morph.\r\n\r\n- glTF 2.0 morph supports only POSITION/NORMAL/TANGENT. So let's skip others.\r\n- Three.js morph attribute has absolute values while the one of glTF has relative values. So we need to convert.\r\n\r\nYou can see that the second one fixes a morph issue on Don's glTF viewer\r\nhttps://gltf-viewer.donmccurdy.com/\r\n\r\nWithout this change [scene.zip](https://github.com/mrdoob/three.js/files/1585993/scene.zip)\r\nWith this change [scene_fix.zip](https://github.com/mrdoob/three.js/files/1585994/scene_fix.zip)\r\n\r\nZip files include glTF AnimationMorphCube model loaded with `GLTFLoader` and then exported with `GLTFExporter`\r\n\r\nhttps://github.com/KhronosGroup/glTF-Sample-Models/tree/master/2.0/AnimatedMorphCube\r\n\r\n/cc @fernandojsg @donmccurdy ","created_at":"2017-12-25T16:10:23Z","updated_at":"2017-12-25T22:57:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1e4768ed02d3d269111ba149db590468514f7b60","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/mrdoob/three.js/pulls/12967/commits","review_comments_url":"https://api.github.com/repos/mrdoob/three.js/pulls/12967/comments","review_comment_url":"https://api.github.com/repos/mrdoob/three.js/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mrdoob/three.js/issues/12967/comments","statuses_url":"https://api.github.com/repos/mrdoob/three.js/statuses/2bd18746dd69c4d8d3a95d1cba4a3f0f04dd442c","head":{"label":"takahirox:GLTFExporterMorph","ref":"GLTFExporterMorph","sha":"2bd18746dd69c4d8d3a95d1cba4a3f0f04dd442c","user":{"login":"takahirox","id":7637832,"avatar_url":"https://avatars2.githubusercontent.com/u/7637832?v=4","gravatar_id":"","url":"https://api.github.com/users/takahirox","html_url":"https://github.com/takahirox","followers_url":"https://api.github.com/users/takahirox/followers","following_url":"https://api.github.com/users/takahirox/following{/other_user}","gists_url":"https://api.github.com/users/takahirox/gists{/gist_id}","starred_url":"https://api.github.com/users/takahirox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/takahirox/subscriptions","organizations_url":"https://api.github.com/users/takahirox/orgs","repos_url":"https://api.github.com/users/takahirox/repos","events_url":"https://api.github.com/users/takahirox/events{/privacy}","received_events_url":"https://api.github.com/users/takahirox/received_events","type":"User","site_admin":false},"repo":{"id":45166916,"name":"three.js","full_name":"takahirox/three.js","owner":{"login":"takahirox","id":7637832,"avatar_url":"https://avatars2.githubusercontent.com/u/7637832?v=4","gravatar_id":"","url":"https://api.github.com/users/takahirox","html_url":"https://github.com/takahirox","followers_url":"https://api.github.com/users/takahirox/followers","following_url":"https://api.github.com/users/takahirox/following{/other_user}","gists_url":"https://api.github.com/users/takahirox/gists{/gist_id}","starred_url":"https://api.github.com/users/takahirox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/takahirox/subscriptions","organizations_url":"https://api.github.com/users/takahirox/orgs","repos_url":"https://api.github.com/users/takahirox/repos","events_url":"https://api.github.com/users/takahirox/events{/privacy}","received_events_url":"https://api.github.com/users/takahirox/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/takahirox/three.js","description":"Three.js fork for MMDLoader","fork":true,"url":"https://api.github.com/repos/takahirox/three.js","forks_url":"https://api.github.com/repos/takahirox/three.js/forks","keys_url":"https://api.github.com/repos/takahirox/three.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/takahirox/three.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/takahirox/three.js/teams","hooks_url":"https://api.github.com/repos/takahirox/three.js/hooks","issue_events_url":"https://api.github.com/repos/takahirox/three.js/issues/events{/number}","events_url":"https://api.github.com/repos/takahirox/three.js/events","assignees_url":"https://api.github.com/repos/takahirox/three.js/assignees{/user}","branches_url":"https://api.github.com/repos/takahirox/three.js/branches{/branch}","tags_url":"https://api.github.com/repos/takahirox/three.js/tags","blobs_url":"https://api.github.com/repos/takahirox/three.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/takahirox/three.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/takahirox/three.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/takahirox/three.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/takahirox/three.js/statuses/{sha}","languages_url":"https://api.github.com/repos/takahirox/three.js/languages","stargazers_url":"https://api.github.com/repos/takahirox/three.js/stargazers","contributors_url":"https://api.github.com/repos/takahirox/three.js/contributors","subscribers_url":"https://api.github.com/repos/takahirox/three.js/subscribers","subscription_url":"https://api.github.com/repos/takahirox/three.js/subscription","commits_url":"https://api.github.com/repos/takahirox/three.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/takahirox/three.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/takahirox/three.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/takahirox/three.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/takahirox/three.js/contents/{+path}","compare_url":"https://api.github.com/repos/takahirox/three.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/takahirox/three.js/merges","archive_url":"https://api.github.com/repos/takahirox/three.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/takahirox/three.js/downloads","issues_url":"https://api.github.com/repos/takahirox/three.js/issues{/number}","pulls_url":"https://api.github.com/repos/takahirox/three.js/pulls{/number}","milestones_url":"https://api.github.com/repos/takahirox/three.js/milestones{/number}","notifications_url":"https://api.github.com/repos/takahirox/three.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/takahirox/three.js/labels{/name}","releases_url":"https://api.github.com/repos/takahirox/three.js/releases{/id}","deployments_url":"https://api.github.com/repos/takahirox/three.js/deployments","created_at":"2015-10-29T07:20:39Z","updated_at":"2017-10-30T08:56:49Z","pushed_at":"2017-12-25T15:57:37Z","git_url":"git://github.com/takahirox/three.js.git","ssh_url":"git@github.com:takahirox/three.js.git","clone_url":"https://github.com/takahirox/three.js.git","svn_url":"https://github.com/takahirox/three.js","homepage":"http://takahirox.github.io/three.js/examples/#webgl_loader_mmd","size":646447,"stargazers_count":21,"watchers_count":21,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":false,"has_wiki":true,"has_pages":true,"forks_count":3,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":3,"open_issues":0,"watchers":21,"default_branch":"master"}},"base":{"label":"mrdoob:dev","ref":"dev","sha":"092d2c0b287815f905678169ac77a41d09536c84","user":{"login":"mrdoob","id":97088,"avatar_url":"https://avatars0.githubusercontent.com/u/97088?v=4","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},"repo":{"id":576201,"name":"three.js","full_name":"mrdoob/three.js","owner":{"login":"mrdoob","id":97088,"avatar_url":"https://avatars0.githubusercontent.com/u/97088?v=4","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},"private":false,"html_url":"https://github.com/mrdoob/three.js","description":"JavaScript 3D library.","fork":false,"url":"https://api.github.com/repos/mrdoob/three.js","forks_url":"https://api.github.com/repos/mrdoob/three.js/forks","keys_url":"https://api.github.com/repos/mrdoob/three.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mrdoob/three.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mrdoob/three.js/teams","hooks_url":"https://api.github.com/repos/mrdoob/three.js/hooks","issue_events_url":"https://api.github.com/repos/mrdoob/three.js/issues/events{/number}","events_url":"https://api.github.com/repos/mrdoob/three.js/events","assignees_url":"https://api.github.com/repos/mrdoob/three.js/assignees{/user}","branches_url":"https://api.github.com/repos/mrdoob/three.js/branches{/branch}","tags_url":"https://api.github.com/repos/mrdoob/three.js/tags","blobs_url":"https://api.github.com/repos/mrdoob/three.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mrdoob/three.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mrdoob/three.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/mrdoob/three.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mrdoob/three.js/statuses/{sha}","languages_url":"https://api.github.com/repos/mrdoob/three.js/languages","stargazers_url":"https://api.github.com/repos/mrdoob/three.js/stargazers","contributors_url":"https://api.github.com/repos/mrdoob/three.js/contributors","subscribers_url":"https://api.github.com/repos/mrdoob/three.js/subscribers","subscription_url":"https://api.github.com/repos/mrdoob/three.js/subscription","commits_url":"https://api.github.com/repos/mrdoob/three.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/mrdoob/three.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/mrdoob/three.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/mrdoob/three.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/mrdoob/three.js/contents/{+path}","compare_url":"https://api.github.com/repos/mrdoob/three.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mrdoob/three.js/merges","archive_url":"https://api.github.com/repos/mrdoob/three.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mrdoob/three.js/downloads","issues_url":"https://api.github.com/repos/mrdoob/three.js/issues{/number}","pulls_url":"https://api.github.com/repos/mrdoob/three.js/pulls{/number}","milestones_url":"https://api.github.com/repos/mrdoob/three.js/milestones{/number}","notifications_url":"https://api.github.com/repos/mrdoob/three.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mrdoob/three.js/labels{/name}","releases_url":"https://api.github.com/repos/mrdoob/three.js/releases{/id}","deployments_url":"https://api.github.com/repos/mrdoob/three.js/deployments","created_at":"2010-03-23T18:58:01Z","updated_at":"2017-12-25T22:25:25Z","pushed_at":"2017-12-25T22:47:05Z","git_url":"git://github.com/mrdoob/three.js.git","ssh_url":"git@github.com:mrdoob/three.js.git","clone_url":"https://github.com/mrdoob/three.js.git","svn_url":"https://github.com/mrdoob/three.js","homepage":"https://threejs.org/","size":571199,"stargazers_count":37848,"watchers_count":37848,"language":"JavaScript","has_issues":true,"has_projects":false,"has_downloads":false,"has_wiki":true,"has_pages":true,"forks_count":14034,"mirror_url":null,"archived":false,"open_issues_count":887,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":14034,"open_issues":887,"watchers":37848,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/mrdoob/three.js/pulls/12967"},"html":{"href":"https://github.com/mrdoob/three.js/pull/12967"},"issue":{"href":"https://api.github.com/repos/mrdoob/three.js/issues/12967"},"comments":{"href":"https://api.github.com/repos/mrdoob/three.js/issues/12967/comments"},"review_comments":{"href":"https://api.github.com/repos/mrdoob/three.js/pulls/12967/comments"},"review_comment":{"href":"https://api.github.com/repos/mrdoob/three.js/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mrdoob/three.js/pulls/12967/commits"},"statuses":{"href":"https://api.github.com/repos/mrdoob/three.js/statuses/2bd18746dd69c4d8d3a95d1cba4a3f0f04dd442c"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"donmccurdy"}}