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

Error Object reference not set to an instance of an object on Editor stop #70

Open
novavision opened this issue Apr 7, 2022 · 2 comments

Comments

@novavision
Copy link

Describe the bug
On scene unload or editor play mode stop I get the error

NullReferenceException: Object reference not set to an instance of an object
Deform.Deformable.IsVisible () (at Library/PackageCache/com.beans.deform@3802324a6b/Code/Runtime/Mesh/Deformable.cs:235)
Deform.Deformable.ShouldCull (System.Boolean ignoreCullingMode) (at Library/PackageCache/com.beans.deform@3802324a6b/Code/Runtime/Mesh/Deformable.cs:241)
Deform.Deformable.ApplyData (System.Boolean ignoreCullingMode) (at Library/PackageCache/com.beans.deform@3802324a6b/Code/Runtime/Mesh/Deformable.cs:345)
Deform.Deformable.ApplyData () (at Library/PackageCache/com.beans.deform@3802324a6b/Code/Runtime/Mesh/Deformable.cs:359)
Deform.DeformableManager.CompleteDeformables (System.Collections.Generic.HashSet`1[T] deformables) (at Library/PackageCache/com.beans.deform@3802324a6b/Code/Runtime/Core/DeformableManager.cs:103)
Deform.DeformableManager.OnDisable () (at Library/PackageCache/com.beans.deform@3802324a6b/Code/Runtime/Core/DeformableManager.cs:77)

To Reproduce
Steps to reproduce the behavior:

  1. Add any deformer to the scene
  2. Apply deformation
  3. Hit Stop editor
  4. See error
  • OS: Windows 11, MacOS
  • Unity: 2021.2.17f1
  • Deform version: smooth-normals version 1.2.1
keenanwoodall added a commit that referenced this issue Apr 9, 2022
@keenanwoodall
Copy link
Owner

Thanks for the report. I was unable to reproduce the error, but since it's a simple null ref I added a null check to the line in question. Lemme know if that fixed it!

@novavision
Copy link
Author

This error is about Deformable is not removed from DeformMaganager on stop (editor) or scene unload (build). Object with deformable component destroyed, but DeformManager still excute it's update.

However, this happened with me only in case if I got Deformable component disabled by default on start. I wasn't sure how is it better to toggle deformable exactly when it needed and used this approach. But, after I enabled it by defaul but jsut set update option to Stop, and toggle to Play/Pause layer on, everything worked as expected without error.

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