foriero

UPDATE : Patch applied. Namespaces added for latest Spine 3.x runtime.

The goal these actions is to have animation characters (or whatever) controller done completely just in Playmaker.

Let me know what are your needs?

Download :
spine_playmaker.zip


SpineAnimationAction.cs (Sets or Adds your animations)

SpineEventAction.cs (Events listener start, end, complete plus custom spine events)

SpineEventConditionAction.cs (Listen and react to your events according to condition you specify)

SpineSlotAction.cs (Sets attachment and color of a slot)

---

V1.0 - First Spine's playmaker actions RELEASED. Already with these you can create nice animation controllers.

---

V1.1 - Added SpineSlotAction.cs
You do not have the required permissions to view the files attached to this post.
Founder & CEO Foriero s.r.o.
https://studio.foriero.com
User avatar
foriero
  • Posts: 258

Shiu

Cool stuff :D Thanks for sharing!
User avatar
Shiu

Shiu
  • Posts: 2368

kilopop

This looks great. I don't use Unity but am willing to try it after checking out Playmaker and Foriero's integration with Spine.
kilopop

Kickstarter Backer
  • Posts: 47

spiral

Cool!!

You can add actions to cover this:

viewtopic.php?f=7&t=3004
spiral
  • Posts: 38

foriero

Thanks Spiral, I will look into Mitch's implementation. In the meantime I did create new action and cleaned a bit the old ones. The new one is called SpineEventConditionAction.cs. Just set your condition on what you want to react and you are good to go.

---

Please download actions from initial post of this thread.
You do not have the required permissions to view the files attached to this post.
Founder & CEO Foriero s.r.o.
https://studio.foriero.com
User avatar
foriero
  • Posts: 258

lekima

foriero wrote:Thanks Spiral, I will look into Mitch's implementation. In the meantime I did create new action and cleaned a bit the old ones. The new one is called SpineEventConditionAction.cs. Just set your condition on what you want to react and you are good to go.

---

Please download actions from initial post of this thread.
Hi foriero,

I registered just to say thanks! I truly appreciate the actions, hope you can keep maintaining this.

Thank you.
lekima
  • Posts: 1

foriero

Thank you ;-)
Founder & CEO Foriero s.r.o.
https://studio.foriero.com
User avatar
foriero
  • Posts: 258

r2c

Hey,

This seems great, looking for a little advice though.
(Classic n00b warning - I'm super new to PlayMaker).

Is there a way to chain animations through PlayMaker? Meaning one after the other, my goal is to have a series of animations play and then fire a Complete Event.

I'm also wondering if there is a way to grab a random spine animation through PlayMaker? I could use a sendMessage to call a function - but that would just lead me to setting the animation through code (like I would normally).

Thanks for the help - sorry for starting a thread within a thread - PM holds some great possibilities with Spine.

r2c
r2c
  • Posts: 1

foriero

hello... sorry for late reply... is you can chain your animations in playmaker.
and also yes... not so hard to use SendRandomEvent action from playmaker and set your animation

---

guys I'm working on SpineSlotAction so that you can set attachments, color or disable or enable attachment.

You need more actions to control your spine animations in Playmaker? Please write here.
Founder & CEO Foriero s.r.o.
https://studio.foriero.com
User avatar
foriero
  • Posts: 258

OneUglyRobot

This is cool, but it won't work with variables at the moment. So if you need to control multiple objects that animate from one FSM you cannot.
OneUglyRobot
  • Posts: 36

Norman

foriero wrote:hello... sorry for late reply... is you can chain your animations in playmaker.
and also yes... not so hard to use SendRandomEvent action from playmaker and set your animation

---

guys I'm working on SpineSlotAction so that you can set attachments, color or disable or enable attachment.

You need more actions to control your spine animations in Playmaker? Please write here.
That sounds excellent, are you still updating this? I'd love to give it a whirl in my next project.
User avatar
Norman
  • Posts: 8

JohnDWillimann

Hiya, this is really great to see the Playmaker Integration however for some reason I can't get it working... :(

I've put the various scripts in the Playmaker Action and Editor folders but somehow I get the following messages.

Assets/PlayMaker/Actions/Editor/SpineActionEditor.cs(23,21): warning CS0168: The variable `action' is declared but never used

Assets/PlayMaker/Actions/Editor/SpineAnimationActionEditor.cs(44,71): error CS0021: Cannot apply indexing with [] to an expression of type `Spine.ExposedList<Spine.Animation>'

Any ideas how I can sort this out?

Thanks a lot. :-)
JohnDWillimann
  • Posts: 1

PaulMcG

Hi Ive come late to this as well, and im getting the same error as John above? Whats the best way to fix this.

Thanks
PaulMcG

Kickstarter Backer
  • Posts: 35

baptiste

How to install your action events? It does not show up in playmaker yet.

-- 19 Nov 2015, 11:47 --

Foriero, I have imported the .cs only and can access some features. However I do not understand all the actions and their implications. An explanation/video about how to install your code and how to use it in Unity would be ab-so-lu-te-ly fantastic!

A fan ;)
baptiste
  • Posts: 3

CrispyArrow

Hey there I also have the same error as John and was wondering if you've looked into it? This is exactly what i need to finish my project and it would be very appreciated :)
CrispyArrow
  • Posts: 4

ionrain

Hi guys,

I also run into this problem and made a patch until the author makes his own fix.
Just overwrite the original files in "Editor" folder with corresponding ones in the attached file.

Cheers
You do not have the required permissions to view the files attached to this post.
ionrain

Kickstarter 2 backer
  • Posts: 11

CrispyArrow

Okay I've edited this comment way too much but. I've figured out a way to implement animation blending:
In the SpineAnimationAction, I added this:
[Tooltip("")]
public int i;

and then i changed the value '0' on the AddAnimation, SetAnimation and ResetAnimation inside the
'public override void OnEnter()' to an 'i'. Like this:

skeleton.state.SetAnimation(i, animationName, loop.Value);

And lastly, in the SpineAnimationActionEditor I added EditField("i");.
With this, the action will have 1 extra visible variable, namely 'i'. this represents to what type the animation belongs. When Spine animations belong to different groups, they can blend with each other, otherwise you will get one animation running while the other is there, but just not playing.

I hope this helps somebody :)

IMPORTANT: this fsm action is kind of weird when you change the code. the 'Animation' field disappears when you change the code, so do the following:

Before changing the code:
- add a SpineAnimationAction to a playmaker FSM, and select the 'Animation' tab and choose your appropriate animation.
- Test it to see if it works.

If it worked:
- Change the scripts as mentioned above.
- check your SpineAnimationAction in your fsm action and check if 'i' is there. By now you might have noticed that the 'Animation' tab has disappeared.
- Test again, you will see the animation play even though the tab had disappeared!
- Check your playmaker fsm, for some reason, the 'Animation' tab is back. Now you can work normally again.
I don't know what causes this. there's a chance you might not have this but regardless, try it out just in case. otherwise you will have to reimport the download file and the patch file.
CrispyArrow
  • Posts: 4

Sebaslive

Hey CrispyArrow or anyone that has tried this out. How does the blend work? I added the code into the action but I dont know what you mean by
When Spine animations belong to different groups, they can blend with each other
Can you help me out in explaining this a bit more?


EDIT: I also converted the Spine sprite attacher script by Mitch to playmaker and is attached.
You do not have the required permissions to view the files attached to this post.
Sebaslive
  • Posts: 12

bez

Hi everyone:

I have just started using unity and playmaker. I tried to install the scripts and I got an error as well. Any updates on any of this or further integration of spine and playmaker?
I am trying to find out how I can create animation files from the animations that are under the Spine_SkeletonData and bring it into the Animator editor.

cheers
Bez
bez
  • Posts: 1

Dmitriy Makeyev

foriero wrote:Thanks Spiral, I will look into Mitch's implementation. In the meantime I did create new action and cleaned a bit the old ones. The new one is called SpineEventConditionAction.cs. Just set your condition on what you want to react and you are good to go.

---

Please download actions from initial post of this thread.
have a question for you, how to implement a script for Animation Event. For example, in Spine2d on the desired animation, I created an event for example "Wrong" and I want to be sent to SendEvent on detection. I nowhere to find examples related to Spine in Animator. I found one method, but it's a little different, jy defines the end of the animation but it does not work correctly, below I can apply this script can be useful.
using UnityEngine;


namespace HutongGames.PlayMaker.Actions
{

[ActionCategory("Artix")]
[Tooltip("Artix Production")]
public class SendEventEndAnimation : FsmStateAction
{

[RequiredField]
[CheckForComponent(typeof(UnityEngine.Animator))]
[Tooltip("The GameObject to be observed.")]
public FsmOwnerDefault gameObject;

[RequiredField]
[Tooltip("Send this event when animation finished.")]
public FsmEvent sendEvent;

[RequiredField]
[Tooltip("The name of the animation to be observed.")]
public FsmString animationName;

private Animator animator;

public override void Reset() {
gameObject = null;
sendEvent = null;
animationName = null;
}

// Code that runs on entering the state.
public override void OnEnter() {
var go = Fsm.GetOwnerDefaultTarget(gameObject);
animator = go.GetComponent<Animator>();
}

// Code that runs every frame.
public override void OnUpdate() {
var a = animator.GetCurrentAnimatorStateInfo(0);
if (a.IsName(animationName.Value) && a.normalizedTime >= 0.98f) {
Fsm.Event(sendEvent);
}
}
}
}
Jungle Town "Birthday quest"
User avatar
Dmitriy Makeyev
  • Posts: 46

garrot

Is this thread still alive? I want to use playmaker with Spine, but I don't know if many years later this actions works nowadays.
garrot
  • Posts: 7

Harald

You can have a look at these forum threads regarding playmaker integration:
PLAYMAKER
Spine - Unity - Playmaker / Quick Tip
User avatar
Harald

Harri
  • Posts: 850

garrot

thank you so much
garrot
  • Posts: 7

foriero

I think the actions are working. If not let me know. We are still here and using them everyday. :-)
Founder & CEO Foriero s.r.o.
https://studio.foriero.com
User avatar
foriero
  • Posts: 258

Harald

Thanks foriero! :)
User avatar
Harald

Harri
  • Posts: 850


Return to Unity