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

System.NullReferenceException when stack importing layers since the 4.2.0 update #835

Closed
Darantius opened this issue Feb 8, 2024 · 2 comments
Assignees

Comments

@Darantius
Copy link

Darantius commented Feb 8, 2024

System

UVtools v4.2.0 X64
Operative system: Microsoft Windows 10.0.19045 X64
Processor: Intel(R) Core(TM) i5-4670 CPU @ 3.40GHz
Processor cores: 4
Memory RAM: 6.86 / 15.93 GB
Runtime: win10-x64
Framework: .NET 6.0.26
AvaloniaUI: 11.0.7
OpenCV: 4.8.1

Path:       C:\Program Files\UVtools\
Executable: C:\Program Files\UVtools\UVtools.exe
Loaded file: PRINT 102% Metal floor arrow tip maghex.pwmx [Version: 1] [Class: PhotonWorkshopFile]

Printer and Slicer

  • Printer: Anycubic Photon Mono X
  • Slicer: Lychee

Description of the bug

Since the most recent update, importing layers using the 'stack' method (to add an existing model next to another) often generates this error:

System.NullReferenceException: Object reference not set to an instance of an object.
at UVtools.Core.Operations.OperationLayerImport.<>c__DisplayClass61_5.b__4(Int64 i) in UVtools.Core\Operations\OperationLayerImport.cs:line 518
at System.Threading.Tasks.Parallel.<>c__DisplayClass20_01.<ForWorker64>b__1(RangeWorker& currentWorker, Int32 timeout, Boolean& replicationDelegateYieldedBeforeCompletion) --- End of stack trace from previous location --- at System.Threading.Tasks.Parallel.<>c__DisplayClass20_01.b__1(RangeWorker& currentWorker, Int32 timeout, Boolean& replicationDelegateYieldedBeforeCompletion)
at System.Threading.Tasks.TaskReplicator.Replica.Execute()

How to reproduce

  1. Open sliced object 'A' in UVtools, detect issues and resolve, save file, close
  2. Open sliced object 'B' in UVtools, detect issues and resolve, save file
  3. Use import layers function with 'stack' method to try to add save object A next to B (or other way around) to be printed together.
  4. Error returned after import calculation. Object not added

I've attached two files as an example which most recently caused this issue. Have seen the issue with many other files however.

Files

Import bug example files.zip
UVtools_mRWtPafUJp
UVtools_y34kzUmgkX

Copy link

github-actions bot commented Feb 8, 2024

This is your first time submitting an issue with UVtools 🥳Please review your issue and ensure that the submit template was followed, the information is complete, and not related to any other open issue. It will be reviewed shortly. Debugging is very important and make the program better. Thanks for contributing and making the software better! 🙌

sn4k3 added a commit that referenced this issue Feb 10, 2024
- **UI:**
  - **Pixel editor:**
    - (Add) Shortcut: Ctrl/⌘+E to de/activate pixel editor
    - (Add) Profiles (#604, #831)
    - (Improvement) Use DataGrid row header to show the operation count instead of process and store indexes for the objects
    - (Fix) Drawings and Text controls are not stretched to fill the available space to the right
  - (Improvement) macOS: Shortcuts Ctrl+0, Ctrl+R, Ctrl+F changed to use command key(⌘) instead of control key
- (Improvement) Dynamic layer height, Lithophane, PCB exposure and Phased exposure: Use better performant `HasNonZero` instead of `CountNonZero` to check if there are any pixels to process
- (Improvement) Update demo file with the newest version of the format and use SL1S printer instead
- (Change) Extract file contents shortcut: From Ctrl+E to Ctrl+Shift+E
- (Fix) Files with different resolution information from empty layers were generating wrong image creation for such layers (#833)
- (Fix) Possible throw an exception about invalid roi when using Roi and/or masks under some tools
- (Fix) Skeletonize memory leak
- (Fix) System.NullReferenceException when accessing reallocated layers (#835)
- (Fix) Unable to save profiles for "Light bleed compensation", "Phased exposure"
- (Fix) PrusaSlicer printer "UVtools Prusa SL1S SPEED": Fix the display width and height, they were flipped
- (Upgrade) AvaloniaUI from 11.0.7 to 11.0.9
@sn4k3
Copy link
Owner

sn4k3 commented Feb 10, 2024

Fixed

@sn4k3 sn4k3 closed this as completed Feb 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants