neon-age / smart-hierarchy Goto Github PK
View Code? Open in Web Editor NEWHuman-friendly hierarchy for Unity.
License: MIT License
Human-friendly hierarchy for Unity.
License: MIT License
This warning regularly pops up when i enter playmode:
No script asset for HierarchyPreferences. Check that the definition is in a file of the same name.
I am getting some errors when adding this package to a Unity 2022.1 project. Would love to get this to work since I have used it before in older projects and it was always so nice :)
Edit: it seems the issue has been fixed here, this does work for me.
I get these warnings for each Hierarchy Collection in my WebGL build;
A scripted object (probably AV.Hierarchy.Collection?) has a different serialization layout when loading. (Read 32 bytes but expected 40 bytes) Did you #ifdef UNITY_EDITOR a section of your serialized properties in any of your scripts?
Followed by warning;
The referenced script on this Behaviour (Game Object '*GOName*') is missing!
Normally I would just ignore these, but as it's WebGL it seems to create other issues down the line.
Versions
2020.3.20f1
.0.3.1
.Repro steps
Exception
NullReferenceException: Object reference not set to an instance of an object
AV.Hierarchy.GenericMenuUtil.GetItems (UnityEditor.GenericMenu menu) (at Library/PackageCache/[email protected]/Reflected/GenericMenuUtil.cs:21)
AV.Hierarchy.CopyPasteCommands.<OnInitialize>g__ReplaceMenuFunctions|6_2 (UnityEditor.GenericMenu menu) (at Library/PackageCache/[email protected]/Base/Commands/CopyPasteCommands.cs:28)
AV.Hierarchy.CopyPasteCommands+<>c.<OnInitialize>b__6_0 (UnityEditor.GenericMenu menu, UnityEngine.GameObject o) (at Library/PackageCache/[email protected]/Base/Commands/CopyPasteCommands.cs:21)
UnityEditor.SceneManagement.SceneHierarchyHooks.AddCustomGameObjectContextMenuItems (UnityEditor.GenericMenu menu, UnityEngine.GameObject gameObject) (at <83a38f5397d94e36a22efa3369c82390>:0)
UnityEditor.SceneHierarchy.CreateGameObjectContextClick (UnityEditor.GenericMenu menu, System.Int32 contextClickedItemID) (at <83a38f5397d94e36a22efa3369c82390>:0)
UnityEditor.SceneHierarchy.ContextClickOutsideItems () (at <83a38f5397d94e36a22efa3369c82390>:0)
UnityEditor.IMGUI.Controls.TreeViewController.HandleUnusedEvents () (at <83a38f5397d94e36a22efa3369c82390>:0)
UnityEditor.IMGUI.Controls.TreeViewController.OnGUI (UnityEngine.Rect rect, System.Int32 keyboardControlID) (at <83a38f5397d94e36a22efa3369c82390>:0)
UnityEditor.SceneHierarchy.DoTreeView (System.Single searchPathHeight) (at <83a38f5397d94e36a22efa3369c82390>:0)
UnityEditor.SceneHierarchy.OnGUI (UnityEngine.Rect rect) (at <83a38f5397d94e36a22efa3369c82390>:0)
UnityEditor.SceneHierarchyWindow.DoSceneHierarchy () (at <83a38f5397d94e36a22efa3369c82390>:0)
UnityEditor.SceneHierarchyWindow.OnGUI () (at <83a38f5397d94e36a22efa3369c82390>:0)
UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect onGUIPosition, UnityEngine.Rect viewRect) (at <83a38f5397d94e36a22efa3369c82390>:0)
UnityEditor.DockArea.DrawView (UnityEngine.Rect viewRect, UnityEngine.Rect dockAreaRect) (at <83a38f5397d94e36a22efa3369c82390>:0)
UnityEditor.DockArea.OldOnGUI () (at <83a38f5397d94e36a22efa3369c82390>:0)
UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <4c8a9874288b4fb78fa7fdbcd8065b00>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <4c8a9874288b4fb78fa7fdbcd8065b00>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <4c8a9874288b4fb78fa7fdbcd8065b00>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Boolean canAffectFocus) (at <4c8a9874288b4fb78fa7fdbcd8065b00>:0)
UnityEngine.UIElements.IMGUIContainer.SendEventToIMGUIRaw (UnityEngine.UIElements.EventBase evt, System.Boolean canAffectFocus, System.Boolean verifyBounds) (at <4c8a9874288b4fb78fa7fdbcd8065b00>:0)
UnityEngine.UIElements.IMGUIContainer.SendEventToIMGUI (UnityEngine.UIElements.EventBase evt, System.Boolean canAffectFocus, System.Boolean verifyBounds) (at <4c8a9874288b4fb78fa7fdbcd8065b00>:0)
UnityEngine.UIElements.IMGUIContainer.HandleEvent (UnityEngine.UIElements.EventBase evt) (at <4c8a9874288b4fb78fa7fdbcd8065b00>:0)
UnityEngine.UIElements.EventDispatchUtilities.PropagateEvent (UnityEngine.UIElements.EventBase evt) (at <4c8a9874288b4fb78fa7fdbcd8065b00>:0)
UnityEngine.UIElements.MouseEventDispatchingStrategy.SendEventToRegularTarget (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.BaseVisualElementPanel panel) (at <4c8a9874288b4fb78fa7fdbcd8065b00>:0)
UnityEngine.UIElements.MouseEventDispatchingStrategy.SendEventToTarget (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.BaseVisualElementPanel panel) (at <4c8a9874288b4fb78fa7fdbcd8065b00>:0)
UnityEngine.UIElements.MouseEventDispatchingStrategy.DispatchEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel iPanel) (at <4c8a9874288b4fb78fa7fdbcd8065b00>:0)
UnityEngine.UIElements.EventDispatcher.ApplyDispatchingStrategies (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, System.Boolean imguiEventIsInitiallyUsed) (at <4c8a9874288b4fb78fa7fdbcd8065b00>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <4c8a9874288b4fb78fa7fdbcd8065b00>:0)
UnityEngine.UIElements.EventDispatcher.Dispatch (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, UnityEngine.UIElements.DispatchMode dispatchMode) (at <4c8a9874288b4fb78fa7fdbcd8065b00>:0)
UnityEngine.UIElements.BaseVisualElementPanel.SendEvent (UnityEngine.UIElements.EventBase e, UnityEngine.UIElements.DispatchMode dispatchMode) (at <4c8a9874288b4fb78fa7fdbcd8065b00>:0)
UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at <4c8a9874288b4fb78fa7fdbcd8065b00>:0)
UnityEngine.UIElements.UIElementsUtility.UnityEngine.UIElements.IUIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& eventHandled) (at <4c8a9874288b4fb78fa7fdbcd8065b00>:0)
UnityEngine.UIElements.UIEventRegistration.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <4c8a9874288b4fb78fa7fdbcd8065b00>:0)
UnityEngine.UIElements.UIEventRegistration+<>c.<.cctor>b__1_2 (System.Int32 i, System.IntPtr ptr) (at <4c8a9874288b4fb78fa7fdbcd8065b00>:0)
UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& result) (at <00a477ed1abf4030be646c3244bd3667>:0)
I tried building for x64 Windows, but got 7 Errors that would prevent it.
The error message was always a variation of this:
Library\PackageCache\com.av.smart-hierarchy@94113c3d21\Base\HierarchySettingsProvider.cs(8,26): error CS0234: The type or namespace name 'EditorGUI' does not exist in the namespace 'UnityEditor' (are you missing an assembly reference?)
After removing Smart Hierarchy the build process did complete as it should.
I'm working with Bolt on UI elements for my game, and some of the canvas elements seem to cause warning messages like this:
Parent of RectTransform is being set with parent property. Consider using the SetParent method instead, with the worldPositionStays argument set to false. This will retain local orientation and scale rather than world orientation and scale, which can prevent common UI scaling issues.
UnityEngine.Transform:set_parent(Transform)
AV.Hierarchy.DetachOnBuildProcess:OnProcessScene(Scene, BuildReport) (at Library/PackageCache/com.av.smart-hierarchy@5a8cc0892c/Base/DetachOnBuildProcess.cs:45)
UnityEditor.Build.BuildPipelineInterfaces:OnSceneProcess(Scene, BuildReport)
This is caused by TreeView.FindItem() which goes throw whole hierarchy many-many times for each instanceId.
There is no optimal optimization for this method, so instead we better get all TreeView items and go throw each visible element manually.
Steps to reproduce:
Shows numerous warnings on import (Unity 2020.1.14f1), e.g.
StyleSheet import: type=Validation, code=InvalidProperty file=Packages/com.av.smart-hierarchy/UI/preferences-style.uss:3 Expected (<length> | <percentage>) but found '6' padding-left: 6 -> Property expects a unit. Did you forget to add px or %?
StyleSheet import: type=Validation, code=InvalidProperty file=Packages/com.av.smart-hierarchy/UI/popup-window.uss:21 Unknown property '-unity-slice' (did you mean '-unity-slice-top'?) -unity-slice: 1
So I've tried to set MeshFilter as a prioritized type over MeshRenderer, and it started to look so much easier for the eye!
And now I'm thinking to add some features to help reduce this visual noise created by some of the icons:
Another idea that comes to my mind is "Compound Components (?)"
Not sure if it's a good idea, as it might create confusion/distraction or result in even more noise..
What do you think?
I just downloaded a zip of the repo to test the latest changes and dragged the folder into my Unity project, but it created an error in the console.
The Menu entry in the preferences exists, but when i select it this error pops up.
I previously used the package manager, and modified the cache files to update it locally, so i didn't run into the issue before.
TypesPriority.SelectPrioritizedComponents() throws a Null Ref if an object in the hierarchy has a missing component
NullReferenceException: Object reference not set to an instance of an object
AV.Hierarchy.TypesPriority+<SelectPrioritizedComponents>d__4.MoveNext () (at Library/PackageCache/com.av.smart-hierarchy@41ed90624a/Base/TypesPriority.cs:66)
System.Collections.Generic.LargeArrayBuilder`1[T].AddRange (System.Collections.Generic.IEnumerable`1[T] items) (at <351e49e2a5bf4fd6beabb458ce2255f3>:0)
System.Collections.Generic.EnumerableHelpers.ToArray[T] (System.Collections.Generic.IEnumerable`1[T] source) (at <351e49e2a5bf4fd6beabb458ce2255f3>:0)
System.Linq.Enumerable.ToArray[TSource] (System.Collections.Generic.IEnumerable`1[T] source) (at <351e49e2a5bf4fd6beabb458ce2255f3>:0)
AV.Hierarchy.Components.ChooseMainComponent (UnityEngine.Component[] components) (at Library/PackageCache/com.av.smart-hierarchy@41ed90624a/Components/Components.cs:70)
AV.Hierarchy.Components..ctor (UnityEngine.GameObject instance) (at Library/PackageCache/com.av.smart-hierarchy@41ed90624a/Components/Components.cs:28)
AV.Hierarchy.ViewItem..ctor (UnityEngine.GameObject instance) (at Library/PackageCache/com.av.smart-hierarchy@41ed90624a/Base/ViewItem.cs:47)
AV.Hierarchy.SmartHierarchy.GetInstanceViewItem (System.Int32 id, UnityEngine.GameObject instance, UnityEngine.Rect rect, AV.Hierarchy.ViewItem& item) (at Library/PackageCache/com.av.smart-hierarchy@41ed90624a/Base/SmartHierarchy.cs:244)
AV.Hierarchy.SmartHierarchy.OnItemGUI (System.Int32 id, UnityEngine.Rect rect) (at Library/PackageCache/com.av.smart-hierarchy@41ed90624a/Base/SmartHierarchy.cs:145)
AV.Hierarchy.SmartHierarchy.OnItemCallback (System.Int32 id, UnityEngine.Rect rect) (at Library/PackageCache/com.av.smart-hierarchy@41ed90624a/Base/SmartHierarchy.cs:121)
AV.Hierarchy.SmartHierarchy.OnHierarchyItemGUI (System.Int32 id, UnityEngine.Rect rect) (at Library/PackageCache/com.av.smart-hierarchy@41ed90624a/Base/SmartHierarchy.cs:104)
UnityEditor.SceneHierarchy.OnRowGUICallback (System.Int32 instanceID, UnityEngine.Rect rect) (at <a8e33794c0064f2aa201ade069162226>:0)
UnityEditor.IMGUI.Controls.TreeViewController.DoItemGUI (UnityEditor.IMGUI.Controls.TreeViewItem item, System.Int32 row, System.Single rowWidth, System.Boolean hasFocus) (at <a8e33794c0064f2aa201ade069162226>:0)
UnityEditor.IMGUI.Controls.TreeViewController.IterateVisibleItems (System.Int32 firstRow, System.Int32 numVisibleRows, System.Single rowWidth, System.Boolean hasFocus) (at <a8e33794c0064f2aa201ade069162226>:0)
UnityEditor.IMGUI.Controls.TreeViewController.OnGUI (UnityEngine.Rect rect, System.Int32 keyboardControlID) (at <a8e33794c0064f2aa201ade069162226>:0)
UnityEditor.SceneHierarchy.DoTreeView (System.Single searchPathHeight) (at <a8e33794c0064f2aa201ade069162226>:0)
UnityEditor.SceneHierarchy.OnGUI (UnityEngine.Rect rect) (at <a8e33794c0064f2aa201ade069162226>:0)
UnityEditor.SceneHierarchyWindow.DoSceneHierarchy () (at <a8e33794c0064f2aa201ade069162226>:0)
UnityEditor.SceneHierarchyWindow.OnGUI () (at <a8e33794c0064f2aa201ade069162226>:0)
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <9577ac7a62ef43179789031239ba8798>:0)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <9577ac7a62ef43179789031239ba8798>:0)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <9577ac7a62ef43179789031239ba8798>:0)
UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at <a8e33794c0064f2aa201ade069162226>:0)
UnityEditor.HostView.Invoke (System.String methodName) (at <a8e33794c0064f2aa201ade069162226>:0)
UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect onGUIPosition, UnityEngine.Rect viewRect) (at <a8e33794c0064f2aa201ade069162226>:0)
UnityEditor.DockArea.DrawView (UnityEngine.Rect viewRect, UnityEngine.Rect dockAreaRect) (at <a8e33794c0064f2aa201ade069162226>:0)
UnityEditor.DockArea.OldOnGUI () (at <a8e33794c0064f2aa201ade069162226>:0)
UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <06214b245dbb4d10a9cefd10639bb04e>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
When disabling an object with the "set active" toggle in the hierarchy window, it can't be re-enabled with undo.
Like seriously its a life saver in a ultracomplicated scenes.
Can also be caused by other operations, like 'Create Collection'..
Suspect it's because of current hacky way of checking when items tree is being changed.
Reproduced in branches:
Hierarchy is being re-initialized on layout change, which breaks injected functionality, such as custom CopyPaste or hover preview
I don't know for sure, but you could probably add com.unity.modules.uielements
to package dependencies for auto-resolution, or maybe just note that UIElements package is required. Thanks for the package tho, really cool.
This is a temp solution to avoid "can't add Editor script" error on MonoBehaviours.
Will be eventually fixed with re-organization and splitting assemblies into:
Assemblies | |
---|---|
AV.Hierarchy.Core | Base folder, references Unity assemblies. |
AV.Hierarchy.Runtime | MonoBehaviours, references Core. |
AV.Hierarchy | Root, Editor-only, references Core and Runtime. |
But it will introduce new conflicts, so firstly these dev branches need to be merged into master:
Hope there is no developers that actually rely on Stadia ๐
If you maximize and unmaximize any other window - icons will disappear. They of course appear again when you focus on the hierarchy window.
Unity 2019.4
Library\PackageCache\com.av.smart-hierarchy@f460c32a86\Collections\CollectionEditor.cs(180,41): error CS0246: The type or namespace name 'HelpBox' could not be found (are you missing a using directive or an assembly reference?)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.