Search Issue Tracker
By Design
By Design in 2023.1.X
Votes
0
Found in
2021.3.4f1
2022.1.5f1
2022.2.0a17
2023.1.0a1
Issue ID
UUM-6038
Regression
No
visualTreeAssetSource is null when the element is not at the root of the UI document
Reproduction steps:
1. Open the attached project (IN-6324_UpdatedRepro.zip)
2. Open the SampleScene.unity Scene, located in the /Assets/Scripts folder in the Project window
3. Enter the Play Mode
4. Observe the output in the Console window
Expected result: the nested element should be “TemplateDocument (UnityEngine.UIElements.VisualTreeAsset)”
Actual result: the nested element is null
Reproducible with: 2021.3.4f1, 2022.1.5f1, 2022.2.0a17, 2023.1.0a1
Could not test with: 2019.4.39f1, 2020.3.35f1 (UIDocument class doesn’t exist)
Reproducible on: Windows 10 (21H2)
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Out-of-bounds memory access with multiple CanvasRenderers under a Canvas when using Mesh API
- Inspector tries to access file after it was deleted when the file was locked in Inspector window
- Changing Transform values in Search window Inspector loses focus while dragging and stopping mouse without releasing dragging action
- Saving changes on the dirty VFX Graph during the Play mode throws "The referenced script (Unknown) on this Behaviour is missing!" warnings
- VFX Graph Debug Info overlaps the "Initialize" block debug info by default
Resolution Note:
visualTreeAssetSource is intentionally only set on root elements for performance reasons as it is used internally to track documents that might need reloading after asset changes.
When null, one can walk up the hierarchy until value is non-null to get the desired asset reference.
Resolution Note (2023.1.X):
visualTreeAssetSource is intentionally only set on root elements for performance reasons as it is used internally to track documents that might need reloading after asset changes.
When null, one can walk up the hierarchy until value is non-null to get the desired asset reference.