{"action":"created","issue":{"url":"https://api.github.com/repos/vispy/vispy/issues/928","labels_url":"https://api.github.com/repos/vispy/vispy/issues/928/labels{/name}","comments_url":"https://api.github.com/repos/vispy/vispy/issues/928/comments","events_url":"https://api.github.com/repos/vispy/vispy/issues/928/events","html_url":"https://github.com/vispy/vispy/pull/928","id":80629559,"number":928,"title":"Scenegraph overhaul","user":{"login":"campagnola","id":940580,"avatar_url":"https://avatars.githubusercontent.com/u/940580?v=3","gravatar_id":"","url":"https://api.github.com/users/campagnola","html_url":"https://github.com/campagnola","followers_url":"https://api.github.com/users/campagnola/followers","following_url":"https://api.github.com/users/campagnola/following{/other_user}","gists_url":"https://api.github.com/users/campagnola/gists{/gist_id}","starred_url":"https://api.github.com/users/campagnola/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/campagnola/subscriptions","organizations_url":"https://api.github.com/users/campagnola/orgs","repos_url":"https://api.github.com/users/campagnola/repos","events_url":"https://api.github.com/users/campagnola/events{/privacy}","received_events_url":"https://api.github.com/users/campagnola/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/vispy/vispy/milestones/5","html_url":"https://github.com/vispy/vispy/milestones/version%200.5","labels_url":"https://api.github.com/repos/vispy/vispy/milestones/5/labels","id":1103110,"number":5,"title":"version 0.5","description":"","creator":{"login":"campagnola","id":940580,"avatar_url":"https://avatars.githubusercontent.com/u/940580?v=3","gravatar_id":"","url":"https://api.github.com/users/campagnola","html_url":"https://github.com/campagnola","followers_url":"https://api.github.com/users/campagnola/followers","following_url":"https://api.github.com/users/campagnola/following{/other_user}","gists_url":"https://api.github.com/users/campagnola/gists{/gist_id}","starred_url":"https://api.github.com/users/campagnola/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/campagnola/subscriptions","organizations_url":"https://api.github.com/users/campagnola/orgs","repos_url":"https://api.github.com/users/campagnola/repos","events_url":"https://api.github.com/users/campagnola/events{/privacy}","received_events_url":"https://api.github.com/users/campagnola/received_events","type":"User","site_admin":false},"open_issues":41,"closed_issues":12,"state":"open","created_at":"2015-05-09T13:18:39Z","updated_at":"2015-06-17T15:45:41Z","due_on":"2015-09-30T07:00:00Z","closed_at":null},"comments":25,"created_at":"2015-05-25T18:47:44Z","updated_at":"2015-06-19T18:27:49Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/vispy/vispy/pulls/928","html_url":"https://github.com/vispy/vispy/pull/928","diff_url":"https://github.com/vispy/vispy/pull/928.diff","patch_url":"https://github.com/vispy/vispy/pull/928.patch"},"body":"This PR is a continuation of #895 (and supersedes it). I am keeping both PRs open for now so that the prior changes may be reviewed in isolation. Major tasks for this PR are:\r\n\r\n* [x] Remove multi-parenting in scenegraph\r\n* [x] Nodes have a single transform (and related simplifications)\r\n* [x] SceneCanvas.draw_visual should be simple and efficient\r\n* [x] Implement picking (finally)\r\n* [ ] ViewNode and a way to automatically create a view on a scenegraph subtree\r\n* [x] Other simplifications:\r\n    * [x] Remove all ViewBox clip methods except fragment. \r\n    * [x] Remove render/framebuffer/canvas scenegraph nodes (might restore these later if there turns out to be a need)\r\n\r\nVisuals to migrate:\r\n\r\n* [ ] Line  (GL is done, AGG is not)\r\n* [x] Mesh\r\n* [x] GridLines\r\n* [x] Markers\r\n* [x] Volume\r\n* [x] Image\r\n* [ ] Text\r\n* [ ] Polygon\r\n* [ ] Box\r\n* [ ] Cube\r\n* [ ] Ellipse\r\n* [ ] Isocurve\r\n* [ ] Isoline\r\n* [ ] Isosurface\r\n* [ ] Plane\r\n* [ ] Rectangle\r\n* [ ] RegularPolygon\r\n* [ ] Spectrogram\r\n* [ ] SurfacePlot\r\n* [ ] Tube\r\n* [ ] XYZAxis\r\n* [ ] Histogram\r\n* [ ] LinePlot\r\n\r\nEDIT BY Eric89GXL:\r\n\r\nRelated issues:\r\n* [x] Toggling a node toggles children #986\r\n* [x] Type of Canvas size #976\r\n* [x] Get SceneCanvas from node #927: exists? \r\n* [x] Original PR #895\r\n* [x] Reuse FBO in viewbox #791\r\n* [x] Grid plot with individual zooming #434: does it work?\r\n* [ ] Line editing example PR #926: modify to use picking?\r\n* [ ] Camera translate speed #914: need to add?\r\n* [ ] Plane and box PR #901: need to update visuals\r\n* [ ] Depth drawing precision #953: need to add?\r\n* [ ] Scene benchmarks broken #965: need to fix?\r\n* [ ] Centering of text visuals #975: working now?\r\n* [ ] Text visual changing viewport #981\r\n\r\ncloses #927\r\ncloses #791\r\ncloses #434\r\ncloses #986"},"comment":{"url":"https://api.github.com/repos/vispy/vispy/issues/comments/113598352","html_url":"https://github.com/vispy/vispy/pull/928#issuecomment-113598352","issue_url":"https://api.github.com/repos/vispy/vispy/issues/928","id":113598352,"user":{"login":"bollu","id":1694861,"avatar_url":"https://avatars.githubusercontent.com/u/1694861?v=3","gravatar_id":"","url":"https://api.github.com/users/bollu","html_url":"https://github.com/bollu","followers_url":"https://api.github.com/users/bollu/followers","following_url":"https://api.github.com/users/bollu/following{/other_user}","gists_url":"https://api.github.com/users/bollu/gists{/gist_id}","starred_url":"https://api.github.com/users/bollu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bollu/subscriptions","organizations_url":"https://api.github.com/users/bollu/orgs","repos_url":"https://api.github.com/users/bollu/repos","events_url":"https://api.github.com/users/bollu/events{/privacy}","received_events_url":"https://api.github.com/users/bollu/received_events","type":"User","site_admin":false},"created_at":"2015-06-19T18:27:48Z","updated_at":"2015-06-19T18:27:48Z","body":"@campagnola \r\n\r\nI've run into something interesting, which maybe me misunderstanding the code.\r\n\r\n1. When you create a ```MeshVisual```, it calls the ```vispy.Visual.__init__``` constructor [here](https://github.com/campagnola/vispy/blob/scenegraph-update/vispy/visuals/mesh.py#L95)\r\n\r\n2. The constructor in turn, calls ```prepare_transforms()``` [here](https://github.com/campagnola/vispy/blob/scenegraph-update/vispy/visuals/visual.py#L274)\r\n\r\n3. For the ```MeshVisual```, this needs to update the transforms of the phong lighting shader as well. However, this field of the ```MeshVisual``` is not available since the _first_ thing every visual does is to call the baseclass constructor.\r\n\r\n\r\nI see three ways out of this\r\n\r\n\r\n1. Initialize the fields needed for ```_prepare_transforms```, and then call the base ```Visual``` constructor\r\n\r\n2. provide a callback from the base-class constructor to initialize things needed before ```_prepare_transforms```\r\n\r\n3. Use a coroutine to temporarily hand back control to the ```MeshVisual``` (any derived class in principle) and then yield control from the derived class so the base class can continue initialization and call ```_prepare_transforms```.\r\n\r\nI like option 3, but I've never used coroutines in Python, and I think they're a [Python3 feature](https://docs.python.org/3/library/asyncio-task.html).\r\n\r\nI might, however, be overthinking the entire thing."}}