{"action":"created","issue":{"url":"https://api.github.com/repos/DynamoDS/Dynamo/issues/4931","labels_url":"https://api.github.com/repos/DynamoDS/Dynamo/issues/4931/labels{/name}","comments_url":"https://api.github.com/repos/DynamoDS/Dynamo/issues/4931/comments","events_url":"https://api.github.com/repos/DynamoDS/Dynamo/issues/4931/events","html_url":"https://github.com/DynamoDS/Dynamo/pull/4931","id":95137754,"number":4931,"title":"IsUpdated Render Fixes (DO NOT MERGE)","user":{"login":"ikeough","id":1139788,"avatar_url":"https://avatars.githubusercontent.com/u/1139788?v=3","gravatar_id":"","url":"https://api.github.com/users/ikeough","html_url":"https://github.com/ikeough","followers_url":"https://api.github.com/users/ikeough/followers","following_url":"https://api.github.com/users/ikeough/following{/other_user}","gists_url":"https://api.github.com/users/ikeough/gists{/gist_id}","starred_url":"https://api.github.com/users/ikeough/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ikeough/subscriptions","organizations_url":"https://api.github.com/users/ikeough/orgs","repos_url":"https://api.github.com/users/ikeough/repos","events_url":"https://api.github.com/users/ikeough/events{/privacy}","received_events_url":"https://api.github.com/users/ikeough/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/DynamoDS/Dynamo/labels/DNM","name":"DNM","color":"5319e7"},{"url":"https://api.github.com/repos/DynamoDS/Dynamo/labels/PTAL","name":"PTAL","color":"207de5"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-07-15T08:47:09Z","updated_at":"2015-07-16T14:33:30Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/DynamoDS/Dynamo/pulls/4931","html_url":"https://github.com/DynamoDS/Dynamo/pull/4931","diff_url":"https://github.com/DynamoDS/Dynamo/pull/4931.diff","patch_url":"https://github.com/DynamoDS/Dynamo/pull/4931.patch"},"body":"### Purpose\r\n\r\nThe entire rendering system was based on the assumption that after an evaluation, we would get a full set of render data back representing the scene. With the fix of the `IsUpdated` flag we now only receive render data for those nodes which were updated during the evaluation.\r\n\r\nUnfortunately, recent refactors of `Watch3DView` were based on the original assumption and thus cleared their internal geometry dictionary during each render, assuming that it would be refreshed with new data. A portion of this work is to keep existing render data, not affected by the evaluation, in the dictionary, and only update the new information.\r\n\r\nThis PR moves much of the functionality currently in `VisualizationManager` into `Watch3DView.xaml.cs`. This is done to cut down on the confusing event cycles used by the visualization manager to communicate to the views. This creates a uni-directional data flow, with the view responding to events on the model. All model, workspace, and node property change events previously handled by the visualization manager are now handled by the view. The unfortunate downside of this is that the `Watch3DView` class has now grown to >1000 LOC.\r\n\r\nThis works also removes the `IWatchViewModel` interface as it became exceedingly slim. The `DynamoViewModel` now works as the view model for all instances of `Watch3DView` with the view class itself acting as the data model for the geometry collections shown in the view.\r\n\r\nTODO:\r\n- [ ] Fix `Watch3D`. Task merging is currently keeping `Watch3D` nodes and the background preview from playing nicely. When both a `Watch3DView` on a node and the background `Watch3DView` respond to the `ExecutionCompleted` event, for example, they kick off a series of scheduler tasks to update render packages, aggregate, etc. These tasks get compacted and one or the other view never gets updated. This is currently \"fixed\" by having a `referenceNode` field on the `Watch3DView` which is set, if it's a `Watch3D` node, and null if it is not. We can then use this field to determine whether we should do certain tasks - this needs a better solution!\r\n- [ ] Test with `RevitVisualizationManager`. Most likely, the render completion events are no longer being fired, and we will need a better way of signaling to Revit that it's time to do the rendering. Remove the `IVisualizationManager` interface once Revit is working.\r\n- [ ] Reinstate the changes from https://github.com/DynamoDS/Dynamo/pull/4932\r\n\r\nPTAL:\r\n@pboyer \r\n\r\nFYI:\r\n@ramramps "},"comment":{"url":"https://api.github.com/repos/DynamoDS/Dynamo/issues/comments/121975282","html_url":"https://github.com/DynamoDS/Dynamo/pull/4931#issuecomment-121975282","issue_url":"https://api.github.com/repos/DynamoDS/Dynamo/issues/4931","id":121975282,"user":{"login":"ikeough","id":1139788,"avatar_url":"https://avatars.githubusercontent.com/u/1139788?v=3","gravatar_id":"","url":"https://api.github.com/users/ikeough","html_url":"https://github.com/ikeough","followers_url":"https://api.github.com/users/ikeough/followers","following_url":"https://api.github.com/users/ikeough/following{/other_user}","gists_url":"https://api.github.com/users/ikeough/gists{/gist_id}","starred_url":"https://api.github.com/users/ikeough/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ikeough/subscriptions","organizations_url":"https://api.github.com/users/ikeough/orgs","repos_url":"https://api.github.com/users/ikeough/repos","events_url":"https://api.github.com/users/ikeough/events{/privacy}","received_events_url":"https://api.github.com/users/ikeough/received_events","type":"User","site_admin":false},"created_at":"2015-07-16T14:33:30Z","updated_at":"2015-07-16T14:33:30Z","body":"@pboyer I agree with the comment above re `DynamoViewModel` we had that interface, `IWatchViewModel` and I removed it because it had only one property left in it (I think). It's possible that the `Watch3D` does not actually need a view model."}}