{"action":"created","issue":{"url":"https://api.github.com/repos/highfidelity/hifi/issues/13596","repository_url":"https://api.github.com/repos/highfidelity/hifi","labels_url":"https://api.github.com/repos/highfidelity/hifi/issues/13596/labels{/name}","comments_url":"https://api.github.com/repos/highfidelity/hifi/issues/13596/comments","events_url":"https://api.github.com/repos/highfidelity/hifi/issues/13596/events","html_url":"https://github.com/highfidelity/hifi/pull/13596","id":340766979,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAxMTAxMjgw","number":13596,"title":"Replace vec2, vec3, and xColor properties with JS prototypes","user":{"login":"SamGondelman","id":7650116,"node_id":"MDQ6VXNlcjc2NTAxMTY=","avatar_url":"https://avatars1.githubusercontent.com/u/7650116?v=4","gravatar_id":"","url":"https://api.github.com/users/SamGondelman","html_url":"https://github.com/SamGondelman","followers_url":"https://api.github.com/users/SamGondelman/followers","following_url":"https://api.github.com/users/SamGondelman/following{/other_user}","gists_url":"https://api.github.com/users/SamGondelman/gists{/gist_id}","starred_url":"https://api.github.com/users/SamGondelman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SamGondelman/subscriptions","organizations_url":"https://api.github.com/users/SamGondelman/orgs","repos_url":"https://api.github.com/users/SamGondelman/repos","events_url":"https://api.github.com/users/SamGondelman/events{/privacy}","received_events_url":"https://api.github.com/users/SamGondelman/received_events","type":"User","site_admin":false},"labels":[{"id":751510477,"node_id":"MDU6TGFiZWw3NTE1MTA0Nzc=","url":"https://api.github.com/repos/highfidelity/hifi/labels/Create","name":"Create","color":"e288db","default":false},{"id":675876856,"node_id":"MDU6TGFiZWw2NzU4NzY4NTY=","url":"https://api.github.com/repos/highfidelity/hifi/labels/Engine","name":"Engine","color":"A2277C","default":false},{"id":278749229,"node_id":"MDU6TGFiZWwyNzg3NDkyMjk=","url":"https://api.github.com/repos/highfidelity/hifi/labels/Feedback%20Welcome","name":"Feedback Welcome","color":"cafc94","default":false},{"id":374042454,"node_id":"MDU6TGFiZWwzNzQwNDI0NTQ=","url":"https://api.github.com/repos/highfidelity/hifi/labels/Packet%20Version%20Change","name":"Packet Version Change","color":"1d76db","default":false},{"id":313595519,"node_id":"MDU6TGFiZWwzMTM1OTU1MTk=","url":"https://api.github.com/repos/highfidelity/hifi/labels/QA%20Ready","name":"QA Ready","color":"bfd4f2","default":false},{"id":751529405,"node_id":"MDU6TGFiZWw3NTE1Mjk0MDU=","url":"https://api.github.com/repos/highfidelity/hifi/labels/Scripting%20API%20change","name":"Scripting API change","color":"fbca04","default":false},{"id":794364211,"node_id":"MDU6TGFiZWw3OTQzNjQyMTE=","url":"https://api.github.com/repos/highfidelity/hifi/labels/Server%20&%20Network","name":"Server & Network","color":"f2bf8a","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/highfidelity/hifi/milestones/32","html_url":"https://github.com/highfidelity/hifi/milestone/32","labels_url":"https://api.github.com/repos/highfidelity/hifi/milestones/32/labels","id":3290831,"node_id":"MDk6TWlsZXN0b25lMzI5MDgzMQ==","number":32,"title":"RC72","description":"","creator":{"login":"conklin94122","id":12115653,"node_id":"MDQ6VXNlcjEyMTE1NjUz","avatar_url":"https://avatars2.githubusercontent.com/u/12115653?v=4","gravatar_id":"","url":"https://api.github.com/users/conklin94122","html_url":"https://github.com/conklin94122","followers_url":"https://api.github.com/users/conklin94122/followers","following_url":"https://api.github.com/users/conklin94122/following{/other_user}","gists_url":"https://api.github.com/users/conklin94122/gists{/gist_id}","starred_url":"https://api.github.com/users/conklin94122/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/conklin94122/subscriptions","organizations_url":"https://api.github.com/users/conklin94122/orgs","repos_url":"https://api.github.com/users/conklin94122/repos","events_url":"https://api.github.com/users/conklin94122/events{/privacy}","received_events_url":"https://api.github.com/users/conklin94122/received_events","type":"User","site_admin":false},"open_issues":9,"closed_issues":1,"state":"open","created_at":"2018-04-23T19:27:08Z","updated_at":"2018-07-31T21:26:14Z","due_on":null,"closed_at":null},"comments":25,"created_at":"2018-07-12T19:24:16Z","updated_at":"2018-07-31T21:50:52Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/highfidelity/hifi/pulls/13596","html_url":"https://github.com/highfidelity/hifi/pull/13596","diff_url":"https://github.com/highfidelity/hifi/pull/13596.diff","patch_url":"https://github.com/highfidelity/hifi/pull/13596.patch"},"body":"Fixes:\r\nhttps://highfidelity.manuscript.com/f/cases/16341/vec3-saving-with-blue-green-red-info-in-json\r\nhttps://highfidelity.manuscript.com/f/cases/10596/Entities-editEntity-color-changes-should-support-r-g-b-in-addition-to-spelling-out-red-green-blue\r\nhttps://highfidelity.manuscript.com/f/cases/12274/PolyLine-entity-s-strokeColors-property-should-be-an-array-of-color-values-not-Vec3-values\r\nhttps://highfidelity.manuscript.com/f/cases/16358/Entity-color-edits-not-sticking\r\n\r\nBefore, our JS vec3s were just maps with x, y, and z properties.  There was also a color type with only red, green, and blue.  Now, vec2s and vec3s are exposed to JS as objects with properties (x, y, z) and aliases (r, g, b)/(red, green, blue)/(width, height, depth).  Similarly, vec2s have (x, y) and aliases (u, v)/(width, height).\r\n\r\nWhat does this mean?\r\n\r\nBefore:\r\n```\r\nvar color = Entities.getEntityProperties(<entity id>).color;\r\nprint(JSON.stringify(color)); // prints `{red: 255, green: 0, blue: 0}`\r\ncolor.r = 127;\r\nprint(JSON.stringify(color)); // prints `{red: 255, green: 0, blue: 0, r: 127}`\r\nEntities.editEntity(<entity id>, { color: {red: 0, green: 255, blue: 0} }); // works\r\nEntities.editEntity(<entity id>, { color: {r: 0, g: 255, b: 0} }); // doesn't work\r\nEntities.editEntity(<entity id>, { color: {x: 0, y: 255, z: 0} }); // doesn't work\r\n```\r\nNow:\r\n```\r\nvar color = Entities.getEntityProperties(<entity id>).color;\r\nprint(JSON.stringify(color)); // prints `{x: 255, y: 0, z: 0}`\r\ncolor.r = 127;\r\nprint(JSON.stringify(color)); // prints `{x: 127, y: 0, z: 0}`\r\nEntities.editEntity(<entity id>, { color: {red: 0, green: 255, blue: 0} }); // works\r\nEntities.editEntity(<entity id>, { color: {r: 0, g: 255, b: 0} }); // works\r\nEntities.editEntity(<entity id>, { color: {x: 0, y: 255, z: 0} }); // works\r\n```\r\n\r\nTest plan:\r\n- These changes affect a lot of different areas.  Run the autotester to confirm that the tests in hifi_tests still work.\r\n- Verify that Create still works properly, with special attention to vec2 or vec3 properties: position, dimensions, various physics properties, and particle properties (verify that the particle tab works correctly, especially the color fields and color pickers)\r\n- Export some entities (try: primitives and particles after messing with their properties).  In the resulting JSON, confirm that vec3 properties only list x, y, and z (not both xyz and red/green/blue).  Import those entities again and confirm that the properties persisted correctly.\r\n- Confirm that you can edit an entity's color like this: `Entities.editEntity(<entity id>, { color: { x: 255, green: 155, b: 55 } });`.  Go into create and confirm that its color is `{ red: 255, green: 155, blue: 55 }`\r\n- Create a sphere.  Sphere is red. Shut down Interface and server.  Restart server and Interface.  Edit sphere's color: change green component to 255, then change blue component to 255.  Sphere is white. \r\n Restart server and Interface.  Sphere should be white (not red, as in master)."},"comment":{"url":"https://api.github.com/repos/highfidelity/hifi/issues/comments/409379600","html_url":"https://github.com/highfidelity/hifi/pull/13596#issuecomment-409379600","issue_url":"https://api.github.com/repos/highfidelity/hifi/issues/13596","id":409379600,"node_id":"MDEyOklzc3VlQ29tbWVudDQwOTM3OTYwMA==","user":{"login":"hifi-gustavo","id":4554450,"node_id":"MDQ6VXNlcjQ1NTQ0NTA=","avatar_url":"https://avatars0.githubusercontent.com/u/4554450?v=4","gravatar_id":"","url":"https://api.github.com/users/hifi-gustavo","html_url":"https://github.com/hifi-gustavo","followers_url":"https://api.github.com/users/hifi-gustavo/followers","following_url":"https://api.github.com/users/hifi-gustavo/following{/other_user}","gists_url":"https://api.github.com/users/hifi-gustavo/gists{/gist_id}","starred_url":"https://api.github.com/users/hifi-gustavo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hifi-gustavo/subscriptions","organizations_url":"https://api.github.com/users/hifi-gustavo/orgs","repos_url":"https://api.github.com/users/hifi-gustavo/repos","events_url":"https://api.github.com/users/hifi-gustavo/events{/privacy}","received_events_url":"https://api.github.com/users/hifi-gustavo/received_events","type":"User","site_admin":false},"created_at":"2018-07-31T21:50:52Z","updated_at":"2018-07-31T21:50:52Z","author_association":"NONE","body":"Windows build is available at: https://deployment.highfidelity.com/jobs/pr-build/label%3Dwindows/11740/HighFidelity-Beta-PR13596-7c8d080.exe"}}
{"actor":{"display_login":"hifi-gustavo"}}