{"action":"created","issue":{"url":"https://api.github.com/repos/highfidelity/hifi/issues/7456","repository_url":"https://api.github.com/repos/highfidelity/hifi","labels_url":"https://api.github.com/repos/highfidelity/hifi/issues/7456/labels{/name}","comments_url":"https://api.github.com/repos/highfidelity/hifi/issues/7456/comments","events_url":"https://api.github.com/repos/highfidelity/hifi/issues/7456/events","html_url":"https://github.com/highfidelity/hifi/pull/7456","id":143310629,"number":7456,"title":"Add model caching","user":{"login":"zzmp","id":5403956,"avatar_url":"https://avatars.githubusercontent.com/u/5403956?v=3","gravatar_id":"","url":"https://api.github.com/users/zzmp","html_url":"https://github.com/zzmp","followers_url":"https://api.github.com/users/zzmp/followers","following_url":"https://api.github.com/users/zzmp/following{/other_user}","gists_url":"https://api.github.com/users/zzmp/gists{/gist_id}","starred_url":"https://api.github.com/users/zzmp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zzmp/subscriptions","organizations_url":"https://api.github.com/users/zzmp/orgs","repos_url":"https://api.github.com/users/zzmp/repos","events_url":"https://api.github.com/users/zzmp/events{/privacy}","received_events_url":"https://api.github.com/users/zzmp/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/highfidelity/hifi/labels/QA%20Ready","name":"QA Ready","color":"bfd4f2"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":13,"created_at":"2016-03-24T17:30:55Z","updated_at":"2016-03-25T02:45:29Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/highfidelity/hifi/pulls/7456","html_url":"https://github.com/highfidelity/hifi/pull/7456","diff_url":"https://github.com/highfidelity/hifi/pull/7456.diff","patch_url":"https://github.com/highfidelity/hifi/pull/7456.patch"},"body":"### Move tex alpha detection to cv method\r\n\r\nThe old `NetworkGeometry::isLoadedWithTextures()` function was `const`, so I pulled strings to keep this one `const`. On review, it seems unnecessary.\r\nI'm happy to leave it (it seems to me like it should be `const`), but also fine taking it out, as it mutates the keys in the material to reflect any opacity the `albedoTexture` may have.\r\n\r\n### Fetch model geometries through cache\r\n\r\n- Hook up the resource to the cache.\r\n- Set up the cache such that it loads mappings (fst), then definitions (fbx, obj) in a cascade.\r\n- Clean up `NetworkGeometry.`\r\n\r\nThis turns `NetworkGeometry` into a wrapper for a `GeometryResource` `_resource`, the immutable resource fetched form the cache, and a copy of it, the `Geometry` `_instance`, copied once the resource loads. This way textures can be mutated without affecting the original resource (and any other instances).\r\n\r\nI also cleaned up the set/getTextures code, and made ctor's for `NetworkMaterial` to make the texture initializations easier to look at. Hopefully I succeeded. The biggest change is that they are now stored in a `std::vector` instead of individual members.\r\nThis cleanup will bubble up into `RenderableModelEntityItem::remapTextures` in the next commit.\r\n*I can factor this out if it is too big a change, but I'd started with it before the push for P1's, and it was easier to work with it than take it out.*\r\n\r\n### Update users of NetworkGeometry\r\n\r\n- Give `Model`, the consumer of `NetworkGeometry`, some convenience methods to avoid `_model->getGeometry()->getGeometry()->getGeometry()` (yes, that was in my first draft).\r\n- Wrap accessors to the model and collision `FBXGeometry`.\r\n- Add `isCollissionLoading` to `Model`, and add `assert`s to the loading checks.\r\n- Update all consumers of `Model` to use the new `NetworkGeometry`."},"comment":{"url":"https://api.github.com/repos/highfidelity/hifi/issues/comments/201114061","html_url":"https://github.com/highfidelity/hifi/pull/7456#issuecomment-201114061","issue_url":"https://api.github.com/repos/highfidelity/hifi/issues/7456","id":201114061,"user":{"login":"hifi-gustavo","id":4554450,"avatar_url":"https://avatars.githubusercontent.com/u/4554450?v=3","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":"2016-03-25T02:45:29Z","updated_at":"2016-03-25T02:45:29Z","body":"Build console output for commit: c625d36bd8ee2f37ae84c68729d0c75df157e54b available at: https://gist.github.com/31b42be7e468df8cd8f8<br/><br/>Installers available for download at: <br/>Windows: http://s3.amazonaws.com/hifi-public/pr-builds/HighFidelity-Alpha-PR7456.exe<br/>OS X: http://s3.amazonaws.com/hifi-public/pr-builds/HighFidelity-Alpha-PR7456.dmg"}}