CARVIEW |
Navigation Menu
-
Notifications
You must be signed in to change notification settings - Fork 658
Leave RenderPackage data intact when passed to AggregateRenderPackages #13437
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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?
@@ -1308,7 +1308,7 @@ public void InstancedMeshesAndLinesAreAddedToBackGroundPreviewForEachMatrixWhenS | |||
Assert.AreEqual(0, BackgroundPreviewGeometry.NumberOfVisibleCurves()); | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
grid lines, cube edges and cone edges are not 3 visible curve objects?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same for the axes but I can't remember if that is curve or mesh geometry.
var j = 0; | ||
foreach (var item in rp.LineVertexRangesAssociatedWithInstancing) | ||
{ | ||
var range = item.Value; | ||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whats this change about?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
for (var j = 0; j < rp.MeshVerticesRangesAssociatedWithTextureMaps.Count; j++) | ||
{ | ||
var range = rp.MeshVerticesRangesAssociatedWithTextureMaps[j]; | ||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh I see, just to make debugging it easier?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 <craig.long@autodesk.com> Co-authored-by: Trygve Wastvedt <trygve.wastvedt@autodesk.com> (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 <craig.long@autodesk.com> Co-authored-by: Trygve Wastvedt <trygve.wastvedt@autodesk.com> (cherry picked from commit 104ac05) Co-authored-by: Craig Long <craig.alan.long@gmail.com>
#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 <craig.long@autodesk.com> Co-authored-by: Trygve Wastvedt <trygve.wastvedt@autodesk.com>
* 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 <craig.long@autodesk.com> Co-authored-by: Trygve Wastvedt <trygve.wastvedt@autodesk.com> * 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 <96534278+jesusalvino@users.noreply.github.com> Co-authored-by: Craig Long <craig.alan.long@gmail.com> Co-authored-by: Craig Long <craig.long@autodesk.com> Co-authored-by: Trygve Wastvedt <trygve.wastvedt@autodesk.com> Co-authored-by: filipeotero <89042471+filipeotero@users.noreply.github.com> Co-authored-by: Roberto T <61755417+RobertGlobant20@users.noreply.github.com>
Purpose
The purpose of this PR is to modify the behavior of the
AggregateRenderPackages
method. Current method is triggered based on theNodeModel.RenderPackagesUpdated
event. Currently a theAggregateRenderPackages
modify theRenderPackage
object 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 modifiedRenderPackage
which 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
*.resx
filesRelease Notes
Update API behavior for AggregateRenderPackages.
Fix regressions in background preview render for some list of objects.
Reviewers
@mjkkirschner @aparajit-pratap
FYIs
@twastvedt