• Runtimes
  • [UE4] Unreal Widget Animation

Related Discussions
...

Hey, this is great! I'll incorporate your changes in our repository as soon as I have time and make the widget's API the same as SkeletonAnimationComponent! I'll likely not get to this this week. If you want to give it a try, simply add the API from SkeletonAnimationComponent (and SkeletonComponent) to the widget class.

badlogic :

Hey, this is great! I'll incorporate your changes in our repository as soon as I have time and make the widget's API the same as SkeletonAnimationComponent! I'll likely not get to this this week. If you want to give it a try, simply add the API from SkeletonAnimationComponent (and SkeletonComponent) to the widget class.

Ok, thank you 🙂

Could you maybe send a pull request on GitHub for this?

badlogic :

Could you maybe send a pull request on GitHub for this?

Sorry,Now it's not my working time, so I can't initiate a pull request. I can try to launch it during working hours. For the time being, I can provide you with a plugin source that I have modified for your reference. Again, this code is only for For reference, you may need further optimization and organization because I don't have more time to perfect it..

https://drive.google.com/open?id=1aqSJo6HQk7cgHTAQeby8QCqnO2FFCq2Q

Hi, I created this pull request.. See: Fix Widget rendering error by GitHub-NetFly · Pull Request #1311

Awesome, I'll check your PR as soon as time permits!

7 天 后

Any progress on this issue? I have been able to render the Spine resource normally in the Widget using the above commit, but there is no corresponding animation API available. See the status on github is already Ready.. When can use?

6 天 后
Rose :

Any progress on this issue? I have been able to render the Spine resource normally in the Widget using the above commit, but there is no corresponding animation API available. See the status on github is already Ready.. When can use?

Sorry, we still have some issues unresolved.

I've added animation APIs to the widget, but as unreal_netfly said, there's still some issues to be resolved.

badlogic :

I've added animation APIs to the widget, but as unreal_netfly said, there's still some issues to be resolved.

I tested the 3.8 branch, and after Tick's DeltaTime was connected in BP, Tick worked fine.
But it will trigger an assertion. I think the API for setting up the animation may need to be changed under the Widget.
There is also a problem with the underlying renderer.
In the code that generates the vertices, I swapped the Y and Z axes.
That part of the code is where the "one frame" data is generated.
In theory, the slot will give new data every frame.
I didn't think about the problems that occurred after adding animations.
So this part of the vertex generation should have problems.

I can only work on the vertex issue after i have resolved not getting any ticks. What I do is:

  1. Create a widget blueprint (canvas) and open it in a separate window
  2. In design mode in the separate window, add a spine widget and set its data, e.g. to raptor
  3. Switch to graph mode in the separate window, set up construct to set an animation, setup tick to call the widget's tick function (including delta)
  4. Test the widget in the separate window by clicking Play.

Neither construct nor tick are called. As such, I can't test the animation API at the moment. Any idea what I might be doing wrong?

badlogic :

I can only work on the vertex issue after i have resolved not getting any ticks. What I do is:

  1. Create a widget blueprint (canvas) and open it in a separate window
  2. In design mode in the separate window, add a spine widget and set its data, e.g. to raptor
  3. Switch to graph mode in the separate window, set up construct to set an animation, setup tick to call the widget's tick function (including delta)
  4. Test the widget in the separate window by clicking Play.

Neither construct nor tick are called. As such, I can't test the animation API at the moment. Any idea what I might be doing wrong?

Did you add the Widget blueprint to the viewport? For example, add a widget to the viewport in the level blueprint?

I am here to provide you with a project that can trigger Tick normally. Just open the NewWorld map and you can test it. When the Tick is triggered normally, the engine will crash.
https://drive.google.com/open?id=1Zdh1ou0k_jAcjBpfL19sbQzoE_1CE9ST

No, I didn't add the widget to the viewport. I assume the design window is sufficient to test basic functionality, since it has a big fat "Play" button 🙂

Thanks for the project, I see if I can fix the crash today.

badlogic :

No, I didn't add the widget to the viewport. I assume the design window is sufficient to test basic functionality, since it has a big fat "Play" button 🙂

Thanks for the project, I see if I can fix the crash today.

Haha, UE4 Play button does mislead developers. 😃 😃

If you still have questions, you are welcome to continue to discuss with me.

badlogic :

I've added animation APIs to the widget, but as unreal_netfly said, there's still some issues to be resolved.

Thank you for your reply, it is a much-needed feature of my project. I will continue to pay attention to the progress of this feature. 🙂

The 3.8-beta branch contains a first preview version of the widget. unreal_netfly was reporting a crash I can not reproduce, and the automatic scaling of the skeleton to the widget size needs fixing, but other than that it should be ready.

I still have a doubt, what is the trigger condition of EventType_End? According to the description of the official document: "An animation has ended, either due to interruption or it has completed and is not looped." At the end of the animation, or the animation is interrupted, End will be executed, but after the animation ends, only EventType_Complete is triggered. , did not trigger EventType_End, I want to know what is the trigger condition of EventType_End?


After testing, I found that EventType End will also trigger when EventType Interrupt is triggered, but EventType_End will not be triggered when EventType_Complete is triggered.

Interrupting an animation (e.g. setting a new animation) will also trigger end as you found. Complete will be triggered when an animation has been completed. If the animation has been set to non-looping, end will also be triggered. If the animation has been set to looping, it will play again, and trigger a complete every time it was played back in full. In this looped case, end will only be triggered if the animation is replaced (and thus interrupted) by setting another animation.

badlogic :

Interrupting an animation (e.g. setting a new animation) will also trigger end as you found. Complete will be triggered when an animation has been completed. If the animation has been set to non-looping, end will also be triggered. If the animation has been set to looping, it will play again, and trigger a complete every time it was played back in full. In this looped case, end will only be triggered if the animation is replaced (and thus interrupted) by setting another animation.

My animation does not set a loop, triggering Complete without triggering End

Test as follows:

Did not execute End