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] duplicated refreshes are triggered when loading the scene. #377

Closed
Tliks opened this issue Sep 3, 2024 · 0 comments · Fixed by #400
Closed

[PreviewSystem] duplicated refreshes are triggered when loading the scene. #377

Tliks opened this issue Sep 3, 2024 · 0 comments · Fixed by #400

Comments

@Tliks
Copy link

Tliks commented Sep 3, 2024

起動時やPlayMode終了時に全フィルターのinstantiateが完了したタイミングで以下のエラーを挟み同一のフィルターのinstantiateが再度走ることで合計2回呼ばれているように見えます。

その後 #376 によりシーン上から選択すると再度instantiateが呼ばれるため、合計3回呼ばれているように見えます。

スクリーンショット 2024-09-03 223122

TTT AtlasTextureとこちらの実装の2つで確認しました。

NDMF: 1.5.0-rc.4

UnityException: get_gameObject can only be called from the main thread.
Constructors and field initializers will be executed from the loading thread when loading a scene.
Don't use this function in the constructor or field initializers, instead move initialization code to the Awake or Start function.
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:107)
nadena.dev.ndmf.preview.ProxyPipeline+<>c__DisplayClass22_2.<Build>b__4 (System.Threading.Tasks.Task`1[TResult] items) (at ./Packages/nadena.dev.ndmf/Editor/PreviewSystem/Rendering/ProxyPipeline.cs:231)
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:263)
Rethrow as AggregateException: One or more errors occurred. (get_gameObject can only be called from the main thread.
Constructors and field initializers will be executed from the loading thread when loading a scene.
Don't use this function in the constructor or field initializers, instead move initialization code to the Awake or Start function.)
UnityEngine.Debug:LogException(Exception)
nadena.dev.ndmf.preview.ProxyPipeline:ShowError() (at ./Packages/nadena.dev.ndmf/Editor/PreviewSystem/Rendering/ProxyPipeline.cs:341)
nadena.dev.ndmf.preview.ProxySession:OnPreCull(Boolean) (at ./Packages/nadena.dev.ndmf/Editor/PreviewSystem/Rendering/ProxySession.cs:82)
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:61)
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

Successfully merging a pull request may close this issue.

1 participant