Skip to content
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

fix(Navisworks): CNX-973 Fix: Material ID Logic and Render Proxy Cache #463

Merged
merged 6 commits into from
Dec 25, 2024

Conversation

jsdbroughton
Copy link
Contributor

@jsdbroughton jsdbroughton commented Dec 24, 2024

This update addresses an issue in the materialID logic, where the renderProxies material cache was based solely on colour. This caused transparent elements sharing the same colour to incorrectly reuse the same material, leading to rendering errors.

Additionally, the material unpacking routine has been improved to cross-check grouped geometry nodes. Previously, unnamed sibling nodes with no unique properties could result in incorrect overrides or omissions of render proxies for child geometries. The update introduces a new parameter for grouped nodes, ensuring the parent group does not improperly affect the displayValue render proxies of its children.

also fixes: CNX-893

- Refactor material selection logic to include transparency values
- Update material name generation to use absolute value of render color's ARGB
- Check Item category for material name before falling back to Material category
- Update object ID assignment in renderMaterialProxies dictionary
- Update NavisworksColorToColor method to include alpha value for transparency
- Improve code readability by explicitly specifying parameter names in System.Drawing.Color.FromArgb method
…g and rendering

- Add parameter `groupedNodes` to `UnpackRenderMaterial` method
- Throw exception if `groupedNodes` is null
- Initialize dictionaries `renderMaterialProxies` and `mergedIds`
- Build the `mergedIds` map once using grouped nodes
- Use merged ids in the iteration over navisworks objects for better performance
This commit adds a new boolean property, SkipNodeMerging, to the NavisworksRootObjectBuilder class. This property is used as a temporary workaround to disable node merging for debugging purposes. By default, SkipNodeMerging is set to false.
@jsdbroughton jsdbroughton added the bug Something isn't working label Dec 24, 2024
Copy link

linear bot commented Dec 24, 2024

Copy link

linear bot commented Dec 24, 2024

Copy link

codecov bot commented Dec 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 9.24%. Comparing base (f2f11c3) to head (8b6c15e).
Report is 1 commits behind head on dev.

Additional details and impacted files
@@          Coverage Diff          @@
##             dev    #463   +/-   ##
=====================================
  Coverage   9.24%   9.24%           
=====================================
  Files        227     227           
  Lines       4260    4260           
  Branches     533     533           
=====================================
  Hits         394     394           
  Misses      3850    3850           
  Partials      16      16           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

The commit fixes an issue with the logger import in the NavisworksRootObjectBuilder.cs file. The incorrect namespace was causing a compilation error. This change ensures that the correct namespace is used for the logger, resolving the compilation error and allowing the code to compile successfully.
@jsdbroughton jsdbroughton merged commit 13740de into dev Dec 25, 2024
5 checks passed
@jsdbroughton jsdbroughton deleted the jonathon/cnx-973-enhanced-material-support branch December 25, 2024 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants