TheZero

I would like to thank you for your help with the previous questions. But I can't figure out SkeletonAnimation.Initialize(true);
When the Skeleton Data skeleton is changed, SkeletonAnimation.Initialize(true); is called.
But when set to True, MixDuration stops working; if set to False, it will return null ref. I've used this setup before but had no problems

Code:
Spine.png
У вас нет необходимых прав для просмотра вложений в этом сообщении.
TheZero
  • Сообщения: 11

Mario

The mix durations are stored in the AnimationStateData of the SkeletonDataAsset, and will be assigned to the internal AnimationState object when you call Initialize(): https://github.com/EsotericSoftware/spine-runtimes/blob/4.0/spine-unity/Assets/Spine/Runtime/spine-unity/Components/SkeletonAnimation.cs#L177

Make sure the skeleton data asset you assign before calling Initialize() has mix durations.
Аватара пользователя
Mario

Mario
  • Сообщения: 3091

TheZero

After initialization I checked DefaltMix its value is equal to 0.2 as specified. But no result. Maybe I didn't understand something?
Code:
Spine.png
У вас нет необходимых прав для просмотра вложений в этом сообщении.
TheZero
  • Сообщения: 11

Mario

Hm, that must be a bug then, and something Harri, our local Unity wizard has to look into. He's currently on vaccation, I'll tell him to have a look when he's back.
Аватара пользователя
Mario

Mario
  • Сообщения: 3091

TheZero

I checked my code, found an error in the implementation, but fixing it did not help. I ran into this issue and setting Initialization(false) fixed the issue. Now the logic has changed and True is required.
Maybe this will help you somehow, I also tried to ask
directly
mix trackEntry but the result is 0.

If there are any other assumptions, I can check the implementation, maybe it's not about Spine

If you need an implementation of a class with animation control, I can provide it, but unfortunately only by mail.
TheZero
  • Сообщения: 11

Mario

We'd need a simple Unity project that runs out of the box that reproduces the issue. You can send it via contact@esotericsoftware.com
Аватара пользователя
Mario

Mario
  • Сообщения: 3091

TheZero

The topic is not relevant, the problem was solved by delimiting animation states from different tracks. And calling Initialize(false) before creating the track. But I'm not sure if this is the correct approach. Leave a comment if you don't mind
Code:
Spine.png
У вас нет необходимых прав для просмотра вложений в этом сообщении.
TheZero
  • Сообщения: 11

Harald

I'm not sure I understand correctly what the initial problem was, and how the changes shown in the last posting solved the issue for you. Could you please describe in more detail what exact problem you encountered (what exactly you mean by "MixDuration stops working", where did you set it and what did you expect), and how your last posted changes above fixed them? Please note that when changing the SkeletonDataAsset you need to clear and reload the skeleton, only calling Initialize(false) (which initializes the skeleton if not previously initialized) will not be sufficient on its own.

We would really like to fix any known issues in the runtime, so any additional info would be much appreciated.
Аватара пользователя
Harald

Harri
  • Сообщения: 4107

TheZero

Short
The game presudstvuet conditionally speaking modules.
At the beginning of each module, I have a method call that initializes the skeleton we need by Enum.
Where it assigns the skeleton, initializes it with Initialization(trye) .
Next comes the call to create a skin. These methods are called upon completion after creating a custom skin
SetSkin();
SetSlotsToSetupPose()


The agreement with the management class can only be attributed by mail with detailed explanations.
TheZero
  • Сообщения: 11

Harald

If you can manage, we would be happy to receive a simple reproduction Unity project by email. You can send it to contact@esotericsoftware.com as a zip package (briefly mentioning this forum thread URL so that we know the context).
Аватара пользователя
Harald

Harri
  • Сообщения: 4107


Вернуться в Unity