• Unity
  • Unity 2020.1.6f1 SkeletonDataModifierAsset not called.

  • Editado
Related Discussions
...

Hi Harald, the code below is never invoked. I have created new Scriptable object but nothing. Do I need to put my scriptable object in a special directory?

[CreateAssetMenu(menuName = "Scriptable Objects/IntegratorTool2D/SpineDataModifierAsset", order = 200)]
public class IntegratorTool2DSpineDataModifierAsset : SkeletonDataModifierAsset
{
    public override void Apply(SkeletonData skeletonData)
    {
        Debug.Log("JEDETO");
    }
}
20 días más tarde

This one is project stopper. I tried to look into it but have not found where you register the scriptable objects into the list!

foriero escribió

This one is project stopper.

You should not upgrade your projects to unsupported Unity versions. It's like going down a road which has been closed due to construction work just to find that there is a hole in the ground that you cannot get over now.

But anyway, we are happy to fix it so that we can officially support 2020.1 soon.

foriero escribió

I tried to look into it but have not found where you register the scriptable objects into the list!

You do know that you register them yourself at your SkeletonDataAsset by adding them to the list manually? They are not automatically added, they never were.

Nevertheless, the new problem with Unity 2020.1 occurs when re-importing the directory containing the asset: the list in the SkeletonDataAsset briefly contains no entries when they should be processed, after that the entries are de-serialized but then it's too late. This will be fixed in the mentioned ticket.


The issue documented in the ticket also turns out to have been false alarm. After adding a SkeletonDataModifierAsset to the list of a SkeletonDataAsset, you have to save the asset once, afterwards upon either a) modifying the json skeleton file or b) reimporting the parent directory, the SkeletonDataModifierAsset Apply() method is called correctly.

Just without saving, it behaved inconsistently, most of the time not applying the SkeletonDataModifierAsset. Closing the ticket now.

Thank you.


Harald, may I ask you to set this in your Spine editor utilities? https://docs.unity3d.com/ScriptReference/AssetPostprocessor.GetPostprocessOrder.html

The reason is that we need to do some additional postprocessing ( even after the modifiers ) and without the order I'm not unable to set our AssetPostprocessor with higher number so that it is called after yours.

For now I'm doing this in our postprocessor:

public override int GetPostprocessOrder() => int.MaxValue;

May be you do this:

public override int GetPostprocessOrder() => int.MaxValue - 1;

Thank you, Marek.

You're welcome.

foriero escribió

Harald, may I ask you to set this in your Spine editor utilities? https://docs.unity3d.com/ScriptReference/AssetPostprocessor.GetPostprocessOrder.html
[..]
The reason is that we need to do some additional postprocessing ( even after the modifiers ) and without the order I'm not unable to set our AssetPostprocessor with higher number so that it is called after yours.

The default AssetPostprocessor implementation returns 0 at GetPostprocessOrder, see the source code here:
https://github.com/Unity-Technologies/UnityCsReference/blob/master/Editor/Mono/AssetPostprocessor.cs#L66
Setting it to a higher value will not make it earlier.

I assume that the problem you see is related to this documentation line:

https://docs.unity3d.com/ScriptReference/AssetPostprocessor.GetPostprocessOrder.html escribió

The GetPostprocessOrder function does not affect the order of OnPostprocessAllAssets calls.

I also don't know why the behaviour is designed like this, perhaps you can sign a "bad design" ticket at Unity. Chances are low however that this will improve.

Harald escribió

perhaps you can sign a "bad design" ticket at Unity

Haha, I would love if this worked! :headwall: