{"action":"created","issue":{"url":"https://api.github.com/repos/viromedia/viro/issues/494","repository_url":"https://api.github.com/repos/viromedia/viro","labels_url":"https://api.github.com/repos/viromedia/viro/issues/494/labels{/name}","comments_url":"https://api.github.com/repos/viromedia/viro/issues/494/comments","events_url":"https://api.github.com/repos/viromedia/viro/issues/494/events","html_url":"https://github.com/viromedia/viro/issues/494","id":393710991,"node_id":"MDU6SXNzdWUzOTM3MTA5OTE=","number":494,"title":"Particle emitter inside portal not rerendering after toggling visible state","user":{"login":"tomasmigone","id":3076185,"node_id":"MDQ6VXNlcjMwNzYxODU=","avatar_url":"https://avatars1.githubusercontent.com/u/3076185?v=4","gravatar_id":"","url":"https://api.github.com/users/tomasmigone","html_url":"https://github.com/tomasmigone","followers_url":"https://api.github.com/users/tomasmigone/followers","following_url":"https://api.github.com/users/tomasmigone/following{/other_user}","gists_url":"https://api.github.com/users/tomasmigone/gists{/gist_id}","starred_url":"https://api.github.com/users/tomasmigone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomasmigone/subscriptions","organizations_url":"https://api.github.com/users/tomasmigone/orgs","repos_url":"https://api.github.com/users/tomasmigone/repos","events_url":"https://api.github.com/users/tomasmigone/events{/privacy}","received_events_url":"https://api.github.com/users/tomasmigone/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-12-22T23:49:48Z","updated_at":"2018-12-28T02:04:03Z","closed_at":null,"author_association":"NONE","body":"<!-- Requirements: please go through this checklist before opening a new issue -->\r\n  - [x] Review the documentation: https://docs.viromedia.com/\r\n  - [x] Search for existing issues: https://github.com/viromedia/viro\r\n  - [x] Use the latest ViroReact release: https://docs.viromedia.com/docs/releases\r\n\r\n## Environment\r\nPlease provide the following information about your environment:\r\n1. Development OS: Mac\r\n2. Device OS & Version: What Android OS version (7.0, 8.0, etc.) or iOS version (11.0, 11.2) is your device running on? Running iOS 12.1.1\r\n3. Version: ViroReact version and React Native version \r\nreact-native-cli: 2.0.1\r\nreact-native: 0.55.1\r\nreact-viro-cli: 2.12.0\r\n4. Device(s): What device(s) are you are seeing the issue on (i.e. iPhone X, Samsung Note 8, etc)\r\niPad 6th gen\r\n\r\n## Description\r\nI'm using an ARPortal inside an ARImageMarker. Everything works fine except for particles.\r\nThe issue im having is the following.\r\n\r\nThe first time I scan my marker, all objects and particles work as intended. \r\nI added a button to my app that basically sets the ViroNode visible to FALSE. I use this a way to reset the portal positioning. Only after re-scanning the marker will the ViroNode visible flag get set to TRUE again. \r\nAfter i press the button and re-scan the marker, the portal and other objects reappear, however the particles don't. I checked with react debug and the particle system has the run flag set to true, visible flag set to true. Nothing wrong in there (even tried resetting those flags).\r\n\r\n## Reproducible Demo\r\nHere is part of the code. I intentionally removed lights from the scene so it doesn't get more cluttered.\r\n\r\n`\r\n\r\n<ViroARScene>\r\n        <ViroARImageMarker pauseUpdates={this.state.pauseUpdates} target={'logo'} onAnchorFound={this._onAnchorFound} onAnchorUpdated={this._onAnchorUpdated} onAnchorUpdated={this._onAnchorUpdated} onAnchorRemoved={this._onAnchorRemoved}>\r\n          <ViroNode ref={this.mainNode} scale={[1, 1, 1]} position={[0, 0, 0]}>\r\n            <ViroPortalScene passable={false} rotation={[270, 0, 90]}>\r\n\r\n              <ViroPortal position={[0, 0, 0]} scale={[.3, .3, .3]}>\r\n                <Viro3DObject scale={[3, 3.9, 4]} rotation={[0, 0, 0]} position={[0, -3.2, 0]} source={require('../../../res/portal/portal.glb')} type='GLB'/>\r\n              </ViroPortal>\r\n\r\n              <Viro360Image isHdr={true} rotation={[0, 15, 0]} source={require('../../../res/escenas/skies_hdr.hdr')} />\r\n\r\n              <Viro3DObject\r\n                position={[-2.5, -5.7, -0.5]}\r\n                rotation={[0, 105, 0]}\r\n                scale={[1, 1, 1]}\r\n                source={require('../../../res/escenas/nieve2.glb')}\r\n                onLoadStart={this._onLoadStart}\r\n                onLoadEnd={this._onLoadEnd}\r\n                onError={this._onError}\r\n                type='GLB'\r\n              />\r\n              <ViroParticleEmitter\r\n                position={[-5, 5, 0]}\r\n                duration={2000}\r\n                visible={true}\r\n                delay={0}\r\n                run={true}\r\n                loop={true}\r\n                fixedToEmitter={true}\r\n\r\n                image={{\r\n                  source:require(\"../../../res/particle_snow.png\"),\r\n                  height:0.007,\r\n                  width:0.007,\r\n                  bloomThreshold:1.0\r\n                }}\r\n\r\n                spawnBehavior={{\r\n                  particleLifetime:[4000,4000],\r\n                  emissionRatePerSecond:[150, 200],\r\n                  spawnVolume:{\r\n                    shape:\"box\",\r\n                    params:[20, 1, 20],\r\n                    spawnOnSurface:false\r\n                  },\r\n                  maxParticles:800\r\n                }}\r\n\r\n                particleAppearance={{\r\n                  opacity:{\r\n                    initialRange:[0, 0],\r\n                    factor:\"Time\",\r\n                    interpolation:[\r\n                      {endValue:0.5, interval:[0,500]},\r\n                      {endValue:1.0, interval:[4000,5000]}\r\n                    ]\r\n                  },\r\n\r\n                  rotation:{\r\n                    initialRange:[0, 360],\r\n                    factor:\"Time\",\r\n                    interpolation:[\r\n                      {endValue:1080, interval:[0,5000]},\r\n                    ]\r\n                  },\r\n\r\n                  scale:{\r\n                    initialRange:[[5,5,5], [10,10,10]],\r\n                    factor:\"Time\",\r\n                    interpolation:[\r\n                      {endValue:[3,3,3], interval:[0,4000]},\r\n                      {endValue:[0,0,0], interval:[4000,5000]}\r\n                    ]\r\n                  },\r\n                }}\r\n\r\n                particlePhysics={{\r\n                  velocity:{\r\n                  initialRange:[[-2,-.5,0], [2,-3.5,0]]}\r\n                }}\r\n              />\r\n\r\n            </ViroPortalScene>\r\n          </ViroNode>\r\n\r\n        </ViroARImageMarker>\r\n\r\n      </ViroARScene>\r\n`\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/viromedia/viro/issues/comments/450272302","html_url":"https://github.com/viromedia/viro/issues/494#issuecomment-450272302","issue_url":"https://api.github.com/repos/viromedia/viro/issues/494","id":450272302,"node_id":"MDEyOklzc3VlQ29tbWVudDQ1MDI3MjMwMg==","user":{"login":"tomasmigone","id":3076185,"node_id":"MDQ6VXNlcjMwNzYxODU=","avatar_url":"https://avatars1.githubusercontent.com/u/3076185?v=4","gravatar_id":"","url":"https://api.github.com/users/tomasmigone","html_url":"https://github.com/tomasmigone","followers_url":"https://api.github.com/users/tomasmigone/followers","following_url":"https://api.github.com/users/tomasmigone/following{/other_user}","gists_url":"https://api.github.com/users/tomasmigone/gists{/gist_id}","starred_url":"https://api.github.com/users/tomasmigone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomasmigone/subscriptions","organizations_url":"https://api.github.com/users/tomasmigone/orgs","repos_url":"https://api.github.com/users/tomasmigone/repos","events_url":"https://api.github.com/users/tomasmigone/events{/privacy}","received_events_url":"https://api.github.com/users/tomasmigone/received_events","type":"User","site_admin":false},"created_at":"2018-12-28T02:04:03Z","updated_at":"2018-12-28T02:04:03Z","author_association":"NONE","body":"Hi! Thanks for the reply during this time of the year!\r\n\r\nJust tested your suggested workaround and it works great in my case.\r\nAnother possible workaround, which is what we ended up doing, is to work with the scale value. Basically set scale to [0, 0, 0] to \"hide\" the node and scale to [1, 1, 1] to show it. Not sure if this approach is less performant than the opacity one, but as far as we can tell there are no issues.\r\n\r\nThanks again\r\n"}}
{"actor":{"display_login":"tomasmigone"}}