Playmaker Forum

PlayMaker Updates & Downloads => Share New Actions => Topic started by: jeanfabre on December 05, 2014, 07:13:00 AM

Title: Mecanim Animator Fsm State synchronization
Post by: jeanfabre on December 05, 2014, 07:13:00 AM
Hi,

 I can't track a previous post on this, tho I was sure I did post about it... anyway...

 I worked on a component that will synchronize Animator and Fsm together, so that within an fsm states will be activated to follow the exact process of an Animator.

--  Simply create state of the same names as the animator states you are targeting and you are good to go.

-- Same with Animator Transitions, simply name the state after the transition name or custom name and you are all set.

-- You don't need to include the layer name like "Base.xx", but if you have several layers you want to follow then it will be necessary, and you can choose what layer is the default within the component  ( 0 is the default).

I also made a quick video to show the basics, and there is a sample scene as well in the animator demo package.


 You can get it all on the wiki page (https://hutonggames.fogbugz.com/default.asp?W1031)

Bye,

 Jean
Title: Re: Mecanim Animator Fsm State synchronization
Post by: mdotstrange on December 05, 2014, 09:30:11 AM
Thats really useful! Thanks Jean!

I imported it into a clean project using the newest PM from the asset store with Unity 4.6 and I get the error in the attached screenshot-
Title: Re: Mecanim Animator Fsm State synchronization
Post by: Alex Chouls on December 05, 2014, 11:45:21 AM
I think Jean probably used the beta version where this method was made public.

Jean, you should be able to access the method with reflection until it's made public in the next update...
Title: Re: Mecanim Animator Fsm State synchronization
Post by: jeanfabre on December 05, 2014, 11:49:38 AM
Hi,

 Yeah... All day, I had this at the back of my mind.. Why did I not released this before?! now I know :)

 Anyway, I have repubished so that it's compatible with the current PlayMaker version.

 Please delete the PlayMaker Animator Examples, and re install. I will release the rest once 1.8 is out.

 Sorry about that :) I was too focused on doing these screencasts...

 Bye,

 Jean
Title: Re: Mecanim Animator Fsm State synchronization
Post by: mdotstrange on December 05, 2014, 04:44:32 PM
Ok  :)

Its an awesome addition btw- I'm looking forward to 1.8
Title: Re: Mecanim Animator Fsm State synchronization
Post by: MaDDoX on December 11, 2014, 12:54:04 AM
This is absolutely terrific, congratulations Jean! :)
Title: Re: Mecanim Animator Fsm State synchronization
Post by: jeanfabre on December 11, 2014, 01:46:44 AM
Hey Maddox :) Hope you are well!

Thanks :) yes, I have to give credits to Paul Hayes :

https://github.com/paulhayes/AnimatorStateMachineUtil

And I took his concept and applied it to PlayMaker with some additional features, like you don't need to explicitly reference layers) and it understands transitions as well ( even custom named transitions:).

 The next iteration will allow you to have a state "xxx Ended" so that you can enter an fsm state when an animator state ended. I will also likely create a system to bind animator process with playmaker events.


 Bye,

 Jean
Title: Re: Mecanim Animator Fsm State synchronization
Post by: terrorOfNewDelhi on January 12, 2015, 03:28:46 AM
Hi Jean,

I'm pretty new to PlayMaker (loving it, btw), but it seems to me that the last thing you mentioned - a system to bind animator process with playmaker events - would be incredibly useful.
Then you could control all rules and actions with FSMs, and simply set up the Animator states & transitions and have them follow the various FSM states.

Am I crazy, or would this be a good way of setting up animations?
And do you have any idea when you're likely to add this?

Thanks, and thanks again for an amazing tool.
Brendan
Title: Re: Mecanim Animator Fsm State synchronization
Post by: jeanfabre on January 12, 2015, 07:53:57 AM
Hi,

 Right now you can already do this using the system I created, and in each state have a "send event". So you can do this, but yes, of course it would be great to do that from the component inspector directly.

I think you need to be careful with triggering animation in that context, instead animations should be trigger within mecanim, and fsm should follow the mecanim states to do the rest ( move the rigibbody, adjust the camera, etc).

 it seems to me that willing to go from mecanim to playmaker to finally trigger animations is uncessary, mecanim is self sufficient for this.

 Bye,

 Jean
 Bye,

 Jean
Title: Re: Mecanim Animator Fsm State synchronization
Post by: terrorOfNewDelhi on January 13, 2015, 04:15:35 AM
Thanks for the reply Jean.
I'll have a think about it further. It's a bit of a moot point for what I'm doing right now, since I'm using a blend tree.
Title: Re: Mecanim Animator Fsm State synchronization
Post by: Zeldafreakneo on July 16, 2017, 09:39:14 PM
Where is this functionality now?
Title: Re: Mecanim Animator Fsm State synchronization
Post by: djaydino on July 16, 2017, 10:38:24 PM
Hi,
You can still get it on the animator proxy on the Ecosystem (https://hutonggames.fogbugz.com/default.asp?W1181)
But you should deselect all and only select :
Code: [Select]
PlayMakerAnimatorStateSynchronization
or you can download the attachment below and import.
Title: Re: Mecanim Animator Fsm State synchronization
Post by: stvbabb on July 31, 2017, 03:52:22 PM
Hello,

Wow, I'm just now seeing this from Youtube and it's exactly what I need! Thank you!

And I hope you don't me replying in an old thread, but this is amazing.

Just one question, what is the syntax to get into a animation sub state?

So, i have a complex character controller with lots of animations, but in the layers it goes:

Base Layer
Upper Layer

in Upper Layer there is a 'Pistol' sub state machine. And within this sub state machine I want to use the state synchronization.

Is this possible?

And, syntax for the playmaker FSM states as:

Upper Layer.Pistol.Attack

Or

UpperLayer.Pistol.Attack

Or

UpperLayer.Attack

I can't figure it out.

Cheers, and thanks for the amazing playmaker work!
Title: Re: Mecanim Animator Fsm State synchronization
Post by: jeanfabre on August 01, 2017, 05:30:14 AM
Hi,

 good questions, I'll try to figure it out.

 Bye,

 Jean
Title: Re: Mecanim Animator Fsm State synchronization
Post by: stvbabb on August 01, 2017, 07:14:44 AM
Hi Jean,

Awesome, thank you! I'll keep trying as well.
Title: Re: Mecanim Animator Fsm State synchronization
Post by: jeanfabre on August 03, 2017, 02:42:20 AM
Hi,

 ok, basically you are likely missing the layer assignment.

 in the proxy, you need to put the layer index to the Animator Layer you want to watch, so layer index will likely be 1 in your case

 and then sub state are accessed indeed using the .

 note: you don't have to use the layer name in your states.

 Let me know how it goes. First try to have your system work with the second layer on regular Animator states, and then inside sub states.

Bye,

 Jean