Leave RenderPackage data intact when passed to AggregateRenderPackages#13437
Leave RenderPackage data intact when passed to AggregateRenderPackages#13437mjkkirschner merged 12 commits intoDynamoDS:masterfrom
Conversation
|
|
@saintentropy to review this for correctness I think I'm going to need a more detailed description about what was changed/ how it works - at this point I have no memory of / bandwidth to get deep into this code. |
mjkkirschner
left a comment
There was a problem hiding this comment.
it seems okay, a few questions, and I think it would be good if we could create a regression test for the failure - maybe 2 subscribers to the event?
| ViewModel.RenderPackageFactoryViewModel.ShowEdges = true; | ||
| //this graph displays a grid, cones, cone edges, cube instances, cube edge instances. | ||
| Assert.AreEqual(3, BackgroundPreviewGeometry.NumberOfVisibleCurves()); | ||
| Assert.AreEqual(2, BackgroundPreviewGeometry.NumberOfVisibleCurves()); |
There was a problem hiding this comment.
grid lines, cube edges and cone edges are not 3 visible curve objects?
There was a problem hiding this comment.
Yeah this is where there was a error in the original test. NumbersOfVisibleCurves removes grids from the number it returns. So the expected behavior is 2. Cube edges and Cone Edges. Not sure what the third was before. Probably an empty item.
There was a problem hiding this comment.
Same for the axes but I can't remember if that is curve or mesh geometry.
| var startIndex = range.Item1; //Start line vertex index | ||
| var count = range.Item2 - range.Item1 + 1; //Count of line vertices | ||
| var uniqueId = baseId + ":" + j + LinesKey; | ||
| var uniqueId = baseId + ":" + j + LinesKey + "_Instance"; |
There was a problem hiding this comment.
The current implementation has a collision on uniqueIds if a render package contains instanced mesh and multiple texture maps. This change just makes sure the unique Ids for each type of helix geometry is actually unique.
| var startIndex = range.Item1; //Start mesh vertex index | ||
| var count = range.Item2 - range.Item1 + 1; //Count of mesh vertices | ||
| var uniqueId = baseId + ":" + j + MeshKey; | ||
| var uniqueId = baseId + ":" + j + MeshKey + "_Texture"; |
There was a problem hiding this comment.
oh I see, just to make debugging it easier?
There was a problem hiding this comment.
See above but yes
I'm looking into making this test. As far as I can tell I need to be able to modify the feature flags, as the issue only happens when the |
Hi @twastvedt - maybe @saintentropy can confirm - I thought this issue only happened when instancing was true!? But if you need to modify the flags during your test for some reason - I think what you can do is make this property internal and set it: or maybe it's easier to just override this cache, since it's in the same process: |
OK, found a couple things.
At any rate, I added a test which I verified fails before the PR, now passes. Still looking at the rendering edge cases. |
|
@mjkkirschner I think this is ready to go? Just wanted to give you the chance to look at the test I added, if you want to. It's pretty straightforward though. I added an image comparison test which checks for the render bug Craig discovered in the process of this PR. I verified that it renders something different (the bug) before this PR's changes. |
|
thanks @twastvedt - I will merge now, can you please cherry pick the squashed commit to 2.17? |
#13437) * Leave RP data intact * Fix tests * Remove unnessary code * Spelling typos and clean up * clean up * clean up * Add regression test for render package mutation. * Unsubscribe from event. * Add image comparison test for render bug. * Fix test image size. Co-authored-by: Craig Long <[email protected]> Co-authored-by: Trygve Wastvedt <[email protected]> (cherry picked from commit 104ac05)
#13437) (#13519) * Leave RP data intact * Fix tests * Remove unnessary code * Spelling typos and clean up * clean up * clean up * Add regression test for render package mutation. * Unsubscribe from event. * Add image comparison test for render bug. * Fix test image size. Co-authored-by: Craig Long <[email protected]> Co-authored-by: Trygve Wastvedt <[email protected]> (cherry picked from commit 104ac05) Co-authored-by: Craig Long <[email protected]>
#13437) * Leave RP data intact * Fix tests * Remove unnessary code * Spelling typos and clean up * clean up * clean up * Add regression test for render package mutation. * Unsubscribe from event. * Add image comparison test for render bug. * Fix test image size. Co-authored-by: Craig Long <[email protected]> Co-authored-by: Trygve Wastvedt <[email protected]>
* Fixing horizontal center (#13312) * Fix Trusted Message behavior (#13355) * Fix Trusted Message behavior * Extract Business Logic as a function * Moving API to Preferences * Adding unit test * Leave RenderPackage data intact when passed to AggregateRenderPackages (#13437) * Leave RP data intact * Fix tests * Remove unnessary code * Spelling typos and clean up * clean up * clean up * Add regression test for render package mutation. * Unsubscribe from event. * Add image comparison test for render bug. * Fix test image size. Co-authored-by: Craig Long <[email protected]> Co-authored-by: Trygve Wastvedt <[email protected]> * DYN-5437 Export image button shortcut (#13550) * Insert the export command in the shortcut view model * remove test method * Dyn 5317 check webview2 installed (#13464) * DYN-5317-Check-WebView2-Installed I added a validation that before starting the DynamoSandbox app we will check if the WebView2 Runtime is installed or not, if is not installed we will show a MessageBox with the link of the WebView2 installer and then after pressing the OK button close Dynamo. Also in the DynamoMessageBox I added a RichTextBox that will be visible under very specific circumstances, this RichTextBox allows to have a blue hyperlink as a part of the text so the user can click it and open the webview2 installer webpage. * DYN-5317-Check-WebView2-Installed removing extra comment * DYN-5674-CustomNode-Renamed (#13854) After the auto-save functionality is triggered when we are located in the Custom Node edit tab when the node in the Home Workspace is being renamed to "backup". Then after my fix first is checking if it has a name and file associated (that usually happen when you create/edit a custom node) if that is the case then we don't execute the rename process. Also I added a test that will validate that the Save functionality doesn't rename the CustomNode name. * clean up --------- Co-authored-by: jesusalvino <[email protected]> Co-authored-by: Craig Long <[email protected]> Co-authored-by: Craig Long <[email protected]> Co-authored-by: Trygve Wastvedt <[email protected]> Co-authored-by: filipeotero <[email protected]> Co-authored-by: Roberto T <[email protected]>
Purpose
The purpose of this PR is to modify the behavior of the
AggregateRenderPackagesmethod. Current method is triggered based on theNodeModel.RenderPackagesUpdatedevent. Currently a theAggregateRenderPackagesmodify theRenderPackageobject it is handed via the event when it is processing data to add to the view. The issue with this modification is that other consumers this event will receive a modifiedRenderPackagewhich does not contain the original data. The PR changes the the RenderPackage data is processed so that it is not modified.In testing this PR I also noticed some scenarios today which Render incorrectly. Edge cases where a list is created combining objects that are rendered via instance data, objects with texture maps, and regular geometry.
Todo
Declarations
Check these if you believe they are true
*.resxfilesRelease Notes
Update API behavior for AggregateRenderPackages.
Fix regressions in background preview render for some list of objects.
Reviewers
@mjkkirschner @aparajit-pratap
FYIs
@twastvedt