Page 1 of 1

Diagnosing "[noesis] Visual is not a descendant of the specified ancestor"

Posted: 22 Jan 2021, 12:48
by peterh
After upgrading our project to 3.0, some of our popup views have been spamming the error message:
Visual is not a descendant of the specified ancestor
I know of some of the various ways this can occur, but am at a loss as to how to track where this occurs. Is there a way to track what component triggers the error? Would it be possible to improve the error message to something more useful (e.g. concrete type of the Visual, information about the specified ancestor)?

Re: Diagnosing "[noesis] Visual is not a descendant of the specified ancestor"

Posted: 25 Jan 2021, 11:52
by sfernandez
Are those messages being shown when using Popups normally (by changing its IsOpen property and interacting with them), or are the messages showing when you call in code functions like TransformToAncestor or TransformToDescendant? What is the callstack of the error message in Unity console?

We can improve the error message by adding the type of the visual and the ancestor. I think you have access to source code, so until we release a new version you can change it yourself in Visual.cpp line 1077:
NS_CHECK(visual == ancestor, "Visual '%s' is not a descendant of the specified ancestor '%s'",
        GetClassType()->GetName(), ancestor->GetClassType()->GetName());

Re: Diagnosing "[noesis] Visual is not a descendant of the specified ancestor"

Posted: 25 Jan 2021, 15:29
by peterh
Are those messages being shown when using Popups normally (by changing its IsOpen property and interacting with them), or are the messages showing when you call in code functions like TransformToAncestor or TransformToDescendant?
The messages are shown when opening popups with certain content. We don't get it for every popup we use, so it's definitely content-dependent.
What is the callstack of the error message in Unity console?
NoesisUnity:UnityLog(Int32, String) (at Assets/NoesisGUI/Plugins/NoesisUnity.cs:146)
Noesis.View:Noesis_View_Update(HandleRef, Double)
Noesis.View:Update(Double) (at Assets/NoesisGUI/Plugins/API/Core/View.cs:297)
We can improve the error message by adding the type of the visual and the ancestor. I think you have access to source code, so until we release a new version you can change it yourself in Visual.cpp line 1077:
NS_CHECK(visual == ancestor, "Visual '%s' is not a descendant of the specified ancestor '%s'",
        GetClassType()->GetName(), ancestor->GetClassType()->GetName());
Thanks, I'll try that!

Re: Diagnosing "[noesis] Visual is not a descendant of the specified ancestor"

Posted: 26 Jan 2021, 11:27
by sfernandez
It was a bug in Noesis when using a TextBox inside a Popup, the message was thrown by caret rendering code.
The issue is fixed for next release.