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

[PreviewSystem] Add error handling at IRenderFilter.Instantiate #448

Open
Tliks opened this issue Oct 12, 2024 · 0 comments
Open

[PreviewSystem] Add error handling at IRenderFilter.Instantiate #448

Tliks opened this issue Oct 12, 2024 · 0 comments

Comments

@Tliks
Copy link

Tliks commented Oct 12, 2024

IRenderFilterを実装したクラスのInstantiate 内で何らかの理由で例外が吐かれたもしくはnullが返された際、現在の実装では次のフレームで再度Instantiateが呼び出され、結果常時Instantiateが呼ばれる状態に陥ってしまうように見えます。これはEditModeへの負荷とコンソールへの大量のエラーを伴うので、エラーが発生したRenderFilterはその旨を通知した上でスキップするといったようなハンドリングがあっても良いのではないかと思いました。

nullが返された場合は以下のエラーが常時発生します

NullReferenceException: Object reference not set to an instance of an object
nadena.dev.ndmf.preview.NodeController.Create (nadena.dev.ndmf.preview.IRenderFilter filter, nadena.dev.ndmf.preview.RenderGroup group, nadena.dev.ndmf.ObjectRegistry registry, System.Collections.Generic.List`1[T] proxies, System.String trace) (at ./Packages/nadena.dev.ndmf/Editor/PreviewSystem/Rendering/NodeController.cs:133)
nadena.dev.ndmf.preview.ProxyPipeline+<>c__DisplayClass23_2.<Build>b__5 (System.Threading.Tasks.Task`1[TResult] items) (at ./Packages/nadena.dev.ndmf/Editor/PreviewSystem/Rendering/ProxyPipeline.cs:267)
nadena.dev.ndmf.preview.ProxyPipeline.Build (nadena.dev.ndmf.preview.ProxyObjectCache proxyCache, System.Collections.Generic.IEnumerable`1[T] filters, nadena.dev.ndmf.preview.ProxyPipeline priorPipeline) (at ./Packages/nadena.dev.ndmf/Editor/PreviewSystem/Rendering/ProxyPipeline.cs:314)
Rethrow as AggregateException: One or more errors occurred. (Object reference not set to an instance of an object)
UnityEngine.Debug:LogException(Exception)
nadena.dev.ndmf.preview.ProxyPipeline:ShowError() (at ./Packages/nadena.dev.ndmf/Editor/PreviewSystem/Rendering/ProxyPipeline.cs:396)
nadena.dev.ndmf.preview.ProxySession:OnPreCull(Boolean) (at ./Packages/nadena.dev.ndmf/Editor/PreviewSystem/Rendering/ProxySession.cs:92)
nadena.dev.ndmf.preview.PreviewSession:OnPreCull(Boolean) (at ./Packages/nadena.dev.ndmf/Editor/PreviewSystem/PreviewSession.cs:51)
nadena.dev.ndmf.preview.ProxyManager:OnPreCull(Camera) (at ./Packages/nadena.dev.ndmf/Editor/PreviewSystem/ProxyManager.cs:64)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)
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

1 participant