Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Asset Variants

Discussion in 'Assets and Asset Store' started by PrecisionCats, Jul 18, 2022.

  1. PrecisionCats

    PrecisionCats

    Joined:
    Nov 19, 2017
    Posts:
    40
    Last edited: Nov 10, 2022
  2. PrecisionCats

    PrecisionCats

    Joined:
    Nov 19, 2017
    Posts:
    40
    2.1.0 - New Features

    Additions:
    - "Copy Override Path" is now added to the context menu.
    - Added emulation properties to PropertyFilter, i.e. DictionaryEmulationProperty, HashSetEmulationProperty, and StringHashSetEmulationProperty, which can change the way a List/Array or a (delimited) string behaves (the sequence of elements is not considered, only "keys" matter. When its override exists, an element can be a removal/addition).
    - To enable that functionality, Raw View now shows dummy fields for "undrawn" overrides.
    - Odin Dictionaries and HashSets can now have specific elements removed or added if an override for the element is present. For HashSets, these override paths follow Odin's dictionary key formatting instead of e.g. "hashSet.$12".
    - To enable that functionality, "undrawn" overrides can now be shown in an Odin inspector, in order to revert an "element removal" override.
    - New "Assets/Asset Variants/" menu items: "Create Overrides From Differences For All Asset Variants" and "Create Overrides From Differences for Selected".

    Changes:
    - Propagation and implicit override creation are now delayed while EditorGUIUtility.editingTextField is true.

    Fixes:
    - Consider Whole and Consider Separate are checked for drawing override indicators or not.
    - Pasting to an AssetImporter's userData with the menu item will update things correctly now.
    - Entering Play Mode will now always flush implicit override creation.
    - Holding alt in Raw View will now properly show non-nicified names for Material properties.
    - A fix for Odin dictionaries.
    - Fixes for Odin 3.0
    - Creating overrides from differences, e.g. with reparenting or "Clean Up Overrides", will no longer create an override for a material property when all its children are overridden already.
    - A parent Material's Raw View does not draw orange override buttons for material property paths anymore.




    2.0.2 - Fixes Part 2

    Fixes:
    - Fixed expand height layout issue with Odin Inspector.
    - Root level override indicators in a non-Odin inspector no longer disappear after switching from an Odin inspector.
    - Thin bars are now excluded from array size fields.
    - Immediate propagation now takes precedence over implicit override creation.
    - X to remove child AVHeader and override indicators visually updating fix.
    - Raw Drawer works properly now.



    2.0.1 - Fixes

    Fixes:
    - Ensures that changed values are always propagated before entering play mode.
    - Raw View updates properly now when the inspector is used to modify the SerializedObject.
    - AVHeader now updates properly when Undo/Redo are performed.
    - Prevents implicit overrides from being created before a propagation can occur, when changing selection from a dirtied parent to its children.
    - Fixes errors with Odin Inspector 2.x.
    - RawPropertyResolver is now properly active again.
    - Added some missing assembly definition files.



    2.0.0 - Improvements and Simplification

    Upgrade Steps:
    - If you previously modified your PDRSettings, make note of it. You can delete it.
    - Delete the old package.
    - Import the new package.
    - Assign your settings asset/s if you previously created any to Window/Asset Variants in the tabs ERSettings/AVSettings.
    - Possibly use the Setup options in Window/Asset Variants/Setup.

    Additions:
    - Inline Raw View button, which saves space.
    - The Raw View button is now drawn as a dark/light toggle button.
    - NonExtendedScriptableObjectAttribute to disable ExtendedScriptableObjectDrawer for specific fields.
    - Assets/Asset Variants/Select All.
    - PDRSettings.considerWholeAllInvisibleChildren and PDRSettings.considerSeparate.
    - TooltipIcon.
    - Unification of settings into the new Window/Asset Variants window.
    - Help tab in the System Prefs window.
    - Various additions.

    Fixes:
    - EditorTool and EditorToolContext are now blacklisted from Editor Replacement.
    - OnSceneGUI works again when WrapperEditors are used.
    - Fixed InvalidOperationException bug.
    - Fixed "... _unity_self" error bug.
    - Fixed a horizontal scrollbar showing up bug.
    - Various fixes.

    Removals:
    - Removed property-drawer-replacement, replaced by the new PropertyModifier.
    - Removed Asset Variants' dependency on editor-replacement.
    - Button style no longer exists for non-Raw View IMGUI.
    - AVUtility.OnValuesChanged() is now gone. No need to call it when fields are modified by code.
    - Rainbow.

    Changes:
    - "Unwrapped fields" are far less common (this especially affects built in asset types. This change does not affect Materials' unwrapped fields).
    - Parent field etc. are now drawn in the header.
    - Implicit overrides are now created whenever a field is modified (such as by user code) on any compatible asset. (This change can also affect performance as any change will require a full object comparison, eventually).
    - Raw View is now a popup window, exclusive to Asset Variants/.
    - What remains of PDRSettings has moved to AVSettings.
    - The considerWhole arrays are now grouped into a class.
    - Settings are now stored by GUID not path. (If you created your own settings assets you will need to reassign them to be current again).
    - Editor replacement initialization now happens immediately after a recompilation, instead of a frame later, making use of the new InitializeBeforeEditorReplacementAttribute.
    - ExtendedScriptableObjectDrawer now supports nested drawing.
    - Much less intrusive insertion of functionality into UI Toolkit especially.
    - Dropped support for Unity versions before 2020.2, for lack of required APIs.
    - Many small changes.




    1.2.2 - Fixes

    Fixes:
    - Fix to WrapperEditor's preview drawing. This fixes multi-selection errors namely for ParticleSystem when a component-compatible editor replacer is enabled.
    - WrapperEditors are now appropriately collapsible (e.g. a Renderer's Material at the bottom of a GameObject inspector).
    - typeof(ParticleSystem) is added to onlyIMGUITargetTypes, because UIElements' IMGUIContainer breaks its layouting.
    - Fixed WrapperEditor misalignments particularly to do with BeginFoldoutHeaderGroup.
    - Removed editorIMGUIContainerHierarchyMode as it doesn't do anything anymore.
    - The order of ~"Apply to Ancestor"s is flipped now to match Unity's order for ~"Apply to Prefab"s.

    Changes:
    - ColorWrapEditorReplacer is now a RemapFilteredEditorReplacer.
    - typeof(ParticleSystem) is added to ColorWrapEditorReplacer's (new) blacklist for cosmetic reasons.
    - Project settings types are now blacklisted for AVEditor, because there's not really a reason it should use it. They are also blacklisted for color wraps, because of cosmetic reasons.
    - Animator Controller is now blacklisted for AVEditor, because it has no serialized properties, so there is nothing Asset Variants can do with it.



    1.2.1 - Patch

    Changes:
    - Descendants are now cached.
    - m_Script is now blacklisted.

    Fixes:
    - Fixed DrawHeader bug that broke Addressables.
    - Context menu now immediately propagates.



    1.2.0 - Return to Familiarity

    Upgrade steps:
    - Delete EditorContainer.cs, import the new package, then recompile/restart.

    Additions:
    - Added the Thin Bars style option.
    - Added the option for bolding overridden fields.
    - UIElements' composite fields now have override buttons/thin bars (and bolding) for its children fields. This is possible because:
    - PropertyDrawer Replacement can now ApplyStyling.
    - Added "Create Override", "Create Override Keep Children", "Remove Children Overrides", "Remove Override", and "Clean Up Overrides" to the context menu.
    - Applying to any specific ancestor is now possible when single selection.
    - Added an "Edit in Raw View" context menu item to open the property in a Raw View popup window, further facilitating the hiding of the raw view button.
    - AVSettings, ERSettings, and PDRSettings assets now each have a TypeFilter field, so that writing code is not required to blacklist or whitelist types.
    - Added various new settings.
    - Sub-assets editor replacer with a single target now draws without a target foldout.
    - "Assets/Validate All Asset Variants" menu item.
    - When a child asset is open in another Editor, changes will be propagated to it immediately.

    Changes:
    - Editor Replacement now uses InspectorElement, which supports GenericInspector, which can improve performance, features, and familiarity over UIElements as default. Prefab override bars are also supported in UIElements now.
    - Some better MenuItem priorities.
    - Raw view now always applies default margins.

    Fixes:
    - "Revert" and "Apply to Parent" context menu items no longer show up if there are no relevant overrides.
    - Blacklist and whitelist are now searched by nearest BaseType match.
    - Fixed FormerlySerializedAsAttribute override renaming to account for sub-overrides.
    - Fixed some alignment bugs.
    - Odin editor implicit override creation works better for "unwrapped" fields.
    - In UIElements long and short fields can now create implicit overrides.
    - Context menu now works for Raw View foldouts.
    - Optimization for deeply nested fields.
    - Cyclical ManagedReference graphs no longer cause freezes.
    - Root level IMGUI foldout triangles with UIElements color wraps active are now clickable.
    - Better comparison in CreateOverridesFromDifferences.
    - Color wrap margins are now consistent in IMGUI.
    - Color wraps' heights in IMGUI are now immediately correct.
    - Context menu no longer throws errors if an asset is null due to missing script.
    - Editor Replacement now uses CreateEditorWithContext.
    - Bounds/BoundsInt now have a RawPropertyResolver so they draw children override buttons/bars in Odin.
    - RawViewWrapperEditor no longer draws spacing if there is no Raw View button drawn.
    - Odin example scripts compile for build now.




    1.1.0 - UX Improvements

    Upgrade steps:
    - Delete the old package.
    - Import the new package.
    - Use the menu Window/Asset Variants/... for some quick setup options.
    - If desired, use the new Window/System Prefs window.

    Additions:
    - Added Window/Asset Variants menu for much easier setup.
    - Added 5 new color wraps presets, including a grayscale one.
    - Added color wrap preset duplication.
    - Added whitelisting settings for combinations of Material only and Scriptable Object only.
    - Added new settings.
    - Added some context menu items.
    - Overrides created in CreateOverridesFromDifferences are now logged to the console.
    - Added Window/System Prefs to manage SystemPrefs's active and priority values.

    Changes:
    - Improved type blacklisting, to use the new TypeFilter which includes whitelist and inheritedWhitelist.
    - Better margins.
    - The setting formerlySerializedAsBaseAssetTypes no longer uses AssemblyQualifiedName.
    Color wraps now use sub-assets instead of folders.
    - Completely revamped PrefsPriority to become SystemPrefs, with all-around improved user experience.

    Fixes:
    - Miscellaneous fixes for when UIElements draws IMGUI.
    - Component Raw View works now for UIElements.
    - Fixes to AVTargets persistence.
    - The setting disableMaterialVariants now works.




    1.0.0 - First release
     
    Last edited: Dec 22, 2022
    ModLunar likes this.
  3. PrecisionCats

    PrecisionCats

    Joined:
    Nov 19, 2017
    Posts:
    40
    Version 2.1.0 has released!
     
    Dark-1-Games likes this.
  4. auau52

    auau52

    Joined:
    Apr 3, 2020
    Posts:
    16
    Any workaround for SerializeReference?
    If I create variant of asset contains list of SerializeReference an error occurs;

    Code (CSharp):
    1. InvalidOperationException: The operation is not possible when moved past all properties (Next returned false)
    2. UnityEditor.SerializedProperty.Verify (UnityEditor.SerializedProperty+VerifyFlags verifyFlags) (at <a53e7cd0bf8c4035ac3e78fb7b43c4a6>:0)
    3. UnityEditor.SerializedProperty.get_propertyType () (at <a53e7cd0bf8c4035ac3e78fb7b43c4a6>:0)
    4. PrecisionCats.ManagedReferencesHelper.SkipDuplicate (UnityEditor.SerializedProperty prop, System.Int32& prevDepth) (at Assets/Precision Cats/common/ManagedReferencesHelper.cs:46)
    5. AssetVariants.AV.SkipDuplicate (UnityEditor.SerializedProperty prop, System.Boolean _, System.Int32& prevDepth) (at Assets/Precision Cats/Asset Variants/Helpers/AV.cs:1520)
    6. AssetVariants.AV.RevertProp (AssetVariants.PathState pathState, UnityEditor.SerializedProperty srcProp, UnityEditor.SerializedProperty parentDstProp, UnityEditor.SerializedProperty& dstPropGuess, System.Boolean& found, System.Boolean odinPass, System.Boolean enteredArray, System.Int32& changes, UnityEditor.SerializedProperty dstProp) (at Assets/Precision Cats/Asset Variants/Helpers/AV.cs:585)
    7. AssetVariants.AV.RevertProp (AssetVariants.PathState pathState, UnityEditor.SerializedProperty srcProp, UnityEditor.SerializedProperty parentDstProp, UnityEditor.SerializedProperty& dstPropGuess, System.Boolean& found, System.Boolean odinPass, System.Boolean enteredArray, System.Int32& changes, UnityEditor.SerializedProperty dstProp) (at Assets/Precision Cats/Asset Variants/Helpers/AV.cs:1048)
    8. AssetVariants.AV.RevertProp (AssetVariants.PathState pathState, UnityEditor.SerializedProperty srcProp, UnityEditor.SerializedProperty parentDstProp, UnityEditor.SerializedProperty& dstPropGuess, System.Boolean& found, System.Boolean odinPass, System.Boolean enteredArray, System.Int32& changes, UnityEditor.SerializedProperty dstProp) (at Assets/Precision Cats/Asset Variants/Helpers/AV.cs:1048)
    9. AssetVariants.AV.RevertProp (AssetVariants.PathState pathState, UnityEditor.SerializedProperty srcProp, UnityEditor.SerializedProperty parentDstProp, UnityEditor.SerializedProperty& dstPropGuess, System.Boolean& found, System.Boolean odinPass, System.Boolean enteredArray, System.Int32& changes, UnityEditor.SerializedProperty dstProp) (at Assets/Precision Cats/Asset Variants/Helpers/AV.cs:1048)
    10. AssetVariants.AV.RevertProp (AssetVariants.PathState pathState, UnityEditor.SerializedProperty srcProp, UnityEditor.SerializedProperty parentDstProp, UnityEditor.SerializedProperty& dstPropGuess, System.Boolean& found, System.Boolean odinPass, System.Boolean enteredArray, System.Int32& changes, UnityEditor.SerializedProperty dstProp) (at Assets/Precision Cats/Asset Variants/Helpers/AV.cs:1048)
    11. AssetVariants.AV.RevertAssetFromParentAsset (AssetVariants.AV selfParent) (at Assets/Precision Cats/Asset Variants/Helpers/AV.cs:1304)
    12. AssetVariants.AV.UpdateAssetFromParentAsset (AssetVariants.AV selfParent) (at Assets/Precision Cats/Asset Variants/Helpers/AV.cs:1405)
    13. AssetVariants.AV.PropagateChangesToChildren () (at Assets/Precision Cats/Asset Variants/Helpers/AV.cs:1434)
    14. AssetVariants.AV.FlushAnyChangesToChildren () (at Assets/Precision Cats/Asset Variants/Helpers/AV.cs:1450)
    15. AssetVariants.AV.FlushDirty () (at Assets/Precision Cats/Asset Variants/Helpers/AV.cs:1477)
    16. AssetVariants.AV.Dispose () (at Assets/Precision Cats/Asset Variants/Helpers/AV.cs:2512)
    17. AssetVariants.AVTargets.CleanupUsers () (at Assets/Precision Cats/Asset Variants/Inspector/AVTargets.cs:78)
    18. AssetVariants.AVTargets.Update () (at Assets/Precision Cats/Asset Variants/Inspector/AVTargets.cs:592)
    19. UnityEditor.EditorApplication.Internal_CallUpdateFunctions () (at <a53e7cd0bf8c4035ac3e78fb7b43c4a6>:0)
    20.  
     
  5. auau52

    auau52

    Joined:
    Apr 3, 2020
    Posts:
    16
    Oops. The problem was type without any field. Not SerializeReference. Adding some random field for it works well.
     
    PrecisionCats likes this.
  6. Whatever560

    Whatever560

    Joined:
    Jan 5, 2016
    Posts:
    505
    Hello does this work for .anim ?
    Best

    [Edit : looks like it does .. nice. Would you have any screenshot vids of the workflow for those ?]