[unity] AnimationReferenceAssets: Added Spine Preferences setting "SkeletonDataAsset Mismatch Warning" to disable the mismatch warning color. See #2453.

This commit is contained in:
Harald Csaszar 2026-03-18 17:24:46 +01:00
parent f61278ac17
commit 30678aef83
4 changed files with 16 additions and 2 deletions

View File

@ -393,8 +393,9 @@
- Every Spine URP shader now has an `Outline` option to switch to the respective Outline shader variant. Uses multi-pass support of newer URP versions. Requires spine-unity core package version 4.3.44 or newer due to required modifications in custom Sprite Shader GUI.
- Added new variants of `GetRepackedSkin` and `GetRepackedAttachments` supporting blend modes. These new variants take a packing configuration input struct `RepackAttachmentsSettings` which provides optional `additiveMaterialSource`, `multiplyMaterialSource` and `screenMaterialSource` properties, enabling blend mode repacking when any is non-null. Create your `RepackAttachmentsSettings` from default settings via `RepackAttachmentsSettings.Default` and then customize settings as needed. Blend mode materials can be set at once using `UseSourceMaterialsFrom(SkeletonDataAsset)` or `UseBlendModeMaterialsFrom(SkeletonDataAsset)`. Uses new `RepackAttachmentsOutput` struct providing `DestroyGeneratedAssets` to easily destroy any previously generated assets.
- Updated example scenes to demonstrate new `GetRepackedSkin` variant usage.
- AnimationReferenceAsset: Added animation selector drop-down popup next to object assignment field for easy initial assignment and animation switching. Shows red warning color if the assigned AnimationReferenceAsset's SkeletonDataAsset does not match the one at the GameObjects `SkeletonAnimation` component. A mismatch may be intentional for a special split SkeletonDataAsset setup.
- AnimationReferenceAsset: Added animation selector drop-down popup next to object assignment field for easy initial assignment and animation switching. Shows red warning color if the assigned AnimationReferenceAsset's SkeletonDataAsset does not match the one at the GameObjects `SkeletonAnimation` component. A mismatch may be intentional for a special split SkeletonDataAsset setup. Warning color can be disabled in `Edit - Preferences - Spine`, `Warnings - SkeletonDataAsset Mismatch Warning`.
- AnimationReferenceAssets: The `SkeletonDataAsset` Inspector now generates the set of AnimationReferenceAssets as nested assets below a single asset `<skeletonname>_AnimationReferences.asset` to avoid cluttering the project with hundreds of asset files. This also makes searching the project for a suitable `AnimationReferenceAsset` of a given `SkeletonDataAsset` much faster. Use of existing old individual assets is still supported alongside nested new ones. If you require the old way of creating assets in your project, add `SPINE_INDIVIDUAL_ANIMATION_REFERENCE_ASSETS` to your project's Scripting Define Symbols.
- AnimationReferenceAssets: Added Spine Preferences setting `Editor Instantiation` - `Warnings - SkeletonDataAsset Mismatch Warning` to disable the warning color when a different SkeletonDataAsset is detected at the `AnimationReferenceAsset` than at the `SkeletonRenderer` component at the same GameObject or any parent GameObject. Might be valid setup for special AnimationReferenceAsset re-use for identical skeletons.
- **Deprecated**

View File

@ -81,7 +81,9 @@ namespace Spine.Unity.Editor {
new GUIContent(NoneString, SpineEditorUtilities.Icons.animation) :
new GUIContent(currentAnimationName, SpineEditorUtilities.Icons.animation);
GUIStyle usedStyle = isSkeletonDataMismatch ? ErrorPopupStyle : EditorStyles.popup;
GUIStyle usedStyle =
(isSkeletonDataMismatch && SpineEditorUtilities.Preferences.skeletonDataAssetMismatchWarning) ?
ErrorPopupStyle : EditorStyles.popup;
if (GUI.Button(dropdownRect, dropdownLabel, usedStyle)) {
ShowAnimationMenu(property, skeletonDataAsset, skeletonData);
}

View File

@ -218,6 +218,9 @@ namespace Spine.Unity.Editor {
const string WORKFLOW_MISMATCH_DIALOG_KEY = "SPINE_WORKFLOW_MISMATCH_DIALOG";
public static bool workflowMismatchDialog = SpinePreferences.DEFAULT_WORKFLOW_MISMATCH_DIALOG;
const string SKELETONDATA_ASSET_MISMATCH_WARNING_KEY = "SPINE_SKELETONDATA_ASSET_MISMATCH_WARNING";
public static bool skeletonDataAssetMismatchWarning = SpinePreferences.DEFAULT_SKELETONDATA_ASSET_MISMATCH_WARNING;
const string SPLIT_COMPONENT_CHANGE_WARNING_KEY = "SPINE_SPLIT_COMPONENT_CHANGE_WARNING";
public static bool splitComponentChangeWarning = SpinePreferences.DEFAULT_SPLIT_COMPONENT_CHANGE_WARNING;
@ -267,6 +270,7 @@ namespace Spine.Unity.Editor {
componentMaterialWarning = EditorPrefs.GetBool(COMPONENTMATERIAL_WARNING_KEY, SpinePreferences.DEFAULT_COMPONENTMATERIAL_WARNING);
skeletonDataAssetNoFileError = EditorPrefs.GetBool(SKELETONDATA_ASSET_NO_FILE_ERROR_KEY, SpinePreferences.DEFAULT_SKELETONDATA_ASSET_NO_FILE_ERROR);
workflowMismatchDialog = EditorPrefs.GetBool(WORKFLOW_MISMATCH_DIALOG_KEY, SpinePreferences.DEFAULT_WORKFLOW_MISMATCH_DIALOG);
skeletonDataAssetMismatchWarning = EditorPrefs.GetBool(SKELETONDATA_ASSET_MISMATCH_WARNING_KEY, SpinePreferences.DEFAULT_SKELETONDATA_ASSET_MISMATCH_WARNING);
splitComponentChangeWarning = EditorPrefs.GetBool(SPLIT_COMPONENT_CHANGE_WARNING_KEY, SpinePreferences.DEFAULT_SPLIT_COMPONENT_CHANGE_WARNING);
timelineDefaultMixDuration = EditorPrefs.GetBool(TIMELINE_DEFAULT_MIX_DURATION_KEY, SpinePreferences.DEFAULT_TIMELINE_DEFAULT_MIX_DURATION);
timelineUseBlendDuration = EditorPrefs.GetBool(TIMELINE_USE_BLEND_DURATION_KEY, SpinePreferences.DEFAULT_TIMELINE_USE_BLEND_DURATION);
@ -295,6 +299,7 @@ namespace Spine.Unity.Editor {
newPreferences.componentMaterialWarning = EditorPrefs.GetBool(COMPONENTMATERIAL_WARNING_KEY, SpinePreferences.DEFAULT_COMPONENTMATERIAL_WARNING);
newPreferences.skeletonDataAssetNoFileError = EditorPrefs.GetBool(SKELETONDATA_ASSET_NO_FILE_ERROR_KEY, SpinePreferences.DEFAULT_SKELETONDATA_ASSET_NO_FILE_ERROR);
newPreferences.workflowMismatchDialog = EditorPrefs.GetBool(WORKFLOW_MISMATCH_DIALOG_KEY, SpinePreferences.DEFAULT_WORKFLOW_MISMATCH_DIALOG);
newPreferences.skeletonDataAssetMismatchWarning = EditorPrefs.GetBool(SKELETONDATA_ASSET_MISMATCH_WARNING_KEY, SpinePreferences.DEFAULT_SKELETONDATA_ASSET_MISMATCH_WARNING);
newPreferences.timelineDefaultMixDuration = EditorPrefs.GetBool(TIMELINE_DEFAULT_MIX_DURATION_KEY, SpinePreferences.DEFAULT_TIMELINE_DEFAULT_MIX_DURATION);
newPreferences.timelineUseBlendDuration = EditorPrefs.GetBool(TIMELINE_USE_BLEND_DURATION_KEY, SpinePreferences.DEFAULT_TIMELINE_USE_BLEND_DURATION);
newPreferences.handleScale = EditorPrefs.GetFloat(SCENE_ICONS_SCALE_KEY, SpinePreferences.DEFAULT_SCENE_ICONS_SCALE);
@ -320,6 +325,7 @@ namespace Spine.Unity.Editor {
EditorPrefs.SetBool(COMPONENTMATERIAL_WARNING_KEY, preferences.componentMaterialWarning);
EditorPrefs.SetBool(SKELETONDATA_ASSET_NO_FILE_ERROR_KEY, preferences.skeletonDataAssetNoFileError);
EditorPrefs.SetBool(WORKFLOW_MISMATCH_DIALOG_KEY, preferences.workflowMismatchDialog);
EditorPrefs.SetBool(SKELETONDATA_ASSET_MISMATCH_WARNING_KEY, preferences.skeletonDataAssetMismatchWarning);
EditorPrefs.SetBool(SPLIT_COMPONENT_CHANGE_WARNING_KEY, preferences.splitComponentChangeWarning);
EditorPrefs.SetBool(TIMELINE_DEFAULT_MIX_DURATION_KEY, preferences.timelineDefaultMixDuration);
EditorPrefs.SetBool(TIMELINE_USE_BLEND_DURATION_KEY, preferences.timelineUseBlendDuration);
@ -399,6 +405,7 @@ namespace Spine.Unity.Editor {
SpineEditorUtilities.BoolPrefsField(ref textureImporterWarning, TEXTUREIMPORTER_WARNING_KEY, new GUIContent("Texture Settings Warning", "Log a warning and recommendation whenever Texture Import Settings are detected that could lead to undesired effects, e.g. white border artifacts."));
SpineEditorUtilities.BoolPrefsField(ref componentMaterialWarning, COMPONENTMATERIAL_WARNING_KEY, new GUIContent("Component & Material Warning", "Log a warning and recommendation whenever Component and Material settings are not compatible."));
SpineEditorUtilities.BoolPrefsField(ref skeletonDataAssetNoFileError, SKELETONDATA_ASSET_NO_FILE_ERROR_KEY, new GUIContent("SkeletonDataAsset no file Error", "Log an error when querying SkeletonData from SkeletonDataAsset with no json or binary file assigned."));
SpineEditorUtilities.BoolPrefsField(ref skeletonDataAssetMismatchWarning, SKELETONDATA_ASSET_MISMATCH_WARNING_KEY, new GUIContent("SkeletonDataAsset Mismatch Warning", "Highlight AnimationReferenceAsset dropdown in red when the reference asset's SkeletonDataAsset does not match the one at the skeleton component."));
SpineEditorUtilities.BoolPrefsField(ref workflowMismatchDialog, WORKFLOW_MISMATCH_DIALOG_KEY, new GUIContent("Workflow Mismatch Dialog", "Show warning dialog when PMA atlas is detected but not supported with current project settings."));
SkeletonDataAsset.errorIfSkeletonFileNullGlobal = skeletonDataAssetNoFileError;
}

View File

@ -235,6 +235,9 @@ namespace Spine.Unity.Editor {
internal const bool DEFAULT_WORKFLOW_MISMATCH_DIALOG = true;
public bool workflowMismatchDialog = DEFAULT_WORKFLOW_MISMATCH_DIALOG;
internal const bool DEFAULT_SKELETONDATA_ASSET_MISMATCH_WARNING = true;
public bool skeletonDataAssetMismatchWarning = DEFAULT_SKELETONDATA_ASSET_MISMATCH_WARNING;
internal const bool DEFAULT_SPLIT_COMPONENT_CHANGE_WARNING = true;
public bool splitComponentChangeWarning = DEFAULT_SPLIT_COMPONENT_CHANGE_WARNING;
@ -394,6 +397,7 @@ namespace Spine.Unity.Editor {
EditorGUILayout.PropertyField(settings.FindProperty("textureImporterWarning"), new GUIContent("Texture Settings Warning", "Log a warning and recommendation whenever Texture Import Settings are detected that could lead to undesired effects, e.g. white border artifacts."));
EditorGUILayout.PropertyField(settings.FindProperty("componentMaterialWarning"), new GUIContent("Component & Material Warning", "Log a warning and recommendation whenever Component and Material settings are not compatible."));
EditorGUILayout.PropertyField(settings.FindProperty("skeletonDataAssetNoFileError"), new GUIContent("SkeletonDataAsset no file Error", "Log an error when querying SkeletonData from SkeletonDataAsset with no json or binary file assigned."));
EditorGUILayout.PropertyField(settings.FindProperty("skeletonDataAssetMismatchWarning"), new GUIContent("SkeletonDataAsset Mismatch Warning", "Highlight AnimationReferenceAsset dropdown in red when the reference asset's SkeletonDataAsset does not match the one at the skeleton component."));
EditorGUILayout.PropertyField(settings.FindProperty("workflowMismatchDialog"), new GUIContent("Workflow Mismatch Dialog", "Show warning dialog when PMA atlas is detected but not supported with current project settings."));
SkeletonDataAsset.errorIfSkeletonFileNullGlobal = settings.FindProperty("skeletonDataAssetNoFileError").boolValue;
}