playMaker

Author Topic: Combining animation data?[SOLVED]  (Read 19071 times)

Red

  • Hero Member
  • *****
  • Posts: 563
Re: Combining animation data?
« Reply #15 on: August 04, 2012, 09:47:02 AM »
hmm, a screenshot or example FSM would certainly help... i'm still struggling with getting this up and running properly in the way which you're suggesting.

artician

  • 1.2 Beta
  • Sr. Member
  • *
  • Posts: 318
Re: Combining animation data?
« Reply #16 on: August 04, 2012, 04:38:50 PM »
I have two FSMs that control my animations.

'FSM_animation' controls my animations relating to movement.  There's absolutely nothing unique done here, and it focuses solely on the Walk, Run, Jumping animations, and transitioning to Ragdolls and back.



'FSM_weapons' controls my attacking animations, which vary depending on the type of weapon the player has.  There is only one state that plays the attack animation and uses the Mixing Transform, so I included the relative actions in my screenshot for it:



I hope that helps.  I would also appreciate it if someone who knows more than I do could vet my scripts and tell me if I can do anything differently (though they work fine for the most part as they are now).

Cheers!

Red

  • Hero Member
  • *****
  • Posts: 563
Re: Combining animation data?
« Reply #17 on: December 28, 2012, 01:47:15 PM »
Hey there, sorry for taking so long to get back (i had to do a push to get the animation data correctly imported.)

i've followed along as best i could but it doesn't seem to want to play the appropriate animation... almost like the other animation data (walking, standing, etc) is overwriting it's ability to play the weapon striking animation.

could you elaborate on the states of the regular animation? is there some setting i'm missing? if you could do a screencast that'd be really awesome (i find it easier to follow along as things go.)

also, can i take a peek at the heirarchy of the object you're animating? maybe it's the way i have mine set up (everything is named appropriately in the stack) that's causing these issues. oh, and could i take a look at how you have those variables set up (namely the "attackType" variable) in the variable list and the attacktypeA/B/C states?

artician

  • 1.2 Beta
  • Sr. Member
  • *
  • Posts: 318
Re: Combining animation data?
« Reply #18 on: December 28, 2012, 02:59:29 PM »
This is just a quick reply, but have you set your animations weight?  That makes the difference for me, as it gives priority to each animation being played. 

https://hutonggames.fogbugz.com/default.asp?W91

I'll try to reply more later.

Red

  • Hero Member
  • *****
  • Posts: 563
Re: Combining animation data?
« Reply #19 on: December 28, 2012, 05:30:20 PM »
I'll certainly give that a go. to be honest, this is still new territory for me ._. but i'm not unable to learn.

Red

  • Hero Member
  • *****
  • Posts: 563
Re: Combining animation data?
« Reply #20 on: December 29, 2012, 03:43:32 PM »
Oh, one thing i'd like to ask... would you recommend adding those weighting and setup actions to the "movement" animations as well?

FractalCore

  • 1.2 Beta
  • Full Member
  • *
  • Posts: 100
Re: Combining animation data?
« Reply #21 on: December 30, 2012, 07:30:58 AM »
I just happen to try this out for myself today and got surprisingly good results. The last time I attempted it, my character was swinging his arms all over the place, but this time it worked and I think I have a handle on it now.

This is for an enemy ai that needs to walk around looking for the player then run at the player and swing to attack. I set it up as a walk on the spot test at first, shifting it on to a moving enemy in the game should be easy.

In the first picture you can see four "moving" states. These all animate the entire character and all have the exact same action settings. All looping, blending, stop same layer, blend time 0.3. Most importantly, all layer 0.

In the second picture you can see the attack animation. This is isolated to only affect the torso up, so the legs keep walking/running/idling. Most important thing to notice, layer 1. This lets it play over top, stopping the arms swinging from the "moving" so they can punch, then blending back again.

Note, there's no weight changing here. In my tests so far I haven't needed it. The layers are doing all the work. I even added a 3rd layer so I could test out a quick impact reation animation (set to additive), for when the character is shot. It works perfectly. So he can now be walking, transition to running. While punching at the player, while his body shakes, taking multiple hits from the player.

Hope this helps.

Red

  • Hero Member
  • *****
  • Posts: 563
Re: Combining animation data?
« Reply #22 on: December 30, 2012, 12:20:23 PM »
Okay, i've tried both methods of adding the appropriate transforms and i'm at a loss... it's just not doing it.

though, for that string where you tell it the transforms (the "add mixing transform") it seems to be using a string... but, i've tried to tell it the root node of where i want to determine the layer (the first bone in the spinal system) and assuming it'd follow the heirarchy upwards... and i've told it to focus on ALL the bones in the heirarchy on up.

so, to illustrate... the first test i had a string variable with "bn-spine1/bn-spine2/bn-spine3...bn-hand1/bn-hand2" yielding no change... second string i just had "bn-spine1" and still nothing.

both are not yielding any results at all... as in, no indication that the movement is taking.

is this possibly somehow limited by the rig i'm using? it's not a standard biped (i really can't stand using it as i find it to be awfully limiting for what i need it for and it is practically useless for non bipedal creations.)
« Last Edit: December 30, 2012, 01:20:27 PM by Red »

FractalCore

  • 1.2 Beta
  • Full Member
  • *
  • Posts: 100
Re: Combining animation data?
« Reply #23 on: December 30, 2012, 04:54:38 PM »
I have to say, I like the Max Biped. Especially for games, with it's ability apply any animation to another biped even if it has a different number of bones. But it should be fine either way.

It might almost be worth trying initial tests with it, since it's guaranteed to export using fbx. The problem could very well be the way you've set up the bones hierarchy.

One thing though. You don't specify the WHOLE chain of bones. Only up to a point. On a standard Biped with four Spine bones...

Bip01/Bip01 Pelvis/Bip01 Spine/Bip01 Spine1

So if you use Biped and copy and paste that in. The animation will only effect the "Bip01 Spine" and up. Then make sure that animation is on a higher layer than what you want it to play over (what the legs will be doing).

Also, I'm not adding a String variable. I just type the words in there. The sequence has to start with the first bone, then follow through to the one the animation should play from. Bip01 in this case.

Another thing. I animated separate animations in Max. So there's a full body run cycle. Then in another max scene with the same character, I cleared out ALL animation keyframes and make the punch animation. Then use the technique where you export each rigged animation eg. Robot-A@Run, Robot-A@Punch. Then in Unity they automatically get loaded on to the Robot-A character. I highly recommend this over doing all animations in one scene then "Split Animations" in Unity. That gets messy and export times climb when you get hundreds of frames in there.
« Last Edit: December 30, 2012, 05:10:05 PM by FractalCore »

FractalCore

  • 1.2 Beta
  • Full Member
  • *
  • Posts: 100
Re: Combining animation data?
« Reply #24 on: December 30, 2012, 05:17:46 PM »
Hey artician. I see you seem to have a ragdoll setup, I wonder if you could shed some light on my Capture Pose / Add Animation Clip problem...

http://hutonggames.com/playmakerforum/index.php?topic=2832.0

Red

  • Hero Member
  • *****
  • Posts: 563
Re: Combining animation data?
« Reply #25 on: December 30, 2012, 05:36:11 PM »
Though that is a good idea, like i said, i'm averse to using biped and that doesn't really help with this current situation as i'd have to re-animate about 8 assets at this point (and some aren't bipedal so using biped isn't going to help with them.)

artician

  • 1.2 Beta
  • Sr. Member
  • *
  • Posts: 318
Re: Combining animation data?
« Reply #26 on: December 30, 2012, 11:48:49 PM »
Red and FractalCore: Use CAT (Character Animation Toolkit, included with Max 2010 and onward).

You will never need, touch, or want for anything rigging-related for years.  It's everything you could possibly need, and feels like having your own dedicated Technical Artist on staff.  :)

FractalCore - I'll reply to your Ragdoll thread directly.  It took me a while, but I got them working okay.


Red

  • Hero Member
  • *****
  • Posts: 563
Re: Combining animation data?
« Reply #27 on: December 31, 2012, 11:26:10 AM »
I'll be sure to look into CAT if this cannot be solved.

a step that i'm trying to see if that might help is to turn all the objects in the scene that are linked to the heirarchy into "bone" objects since a thought crept into my head that since these objects are technically, according to the file, not actually "bone" objects, then maybe Unity doesn't know how to handle them (or maybe it's Playmaker... not being a coder i don't know.)

past that, i'd be upset if i have to go back because we're talking about three week's worth of work down the tubes if i can't blend this animation. i can still use the non-blending animation data (such as the spiders i have been working on lately) since they're basic and not that advanced... but i kinda don't want to have to go back to formula if i can avoid it.

other than that, i might see about looking at some coding for animation blending via scripting... because if this is a limitation of Playmaker itself, it'd be good to know.

and, last but not least, this could very well be the kick in the pants i need to finally take some time to learn Mecanim... since i'm guessing that Playmaker support will eventually be added (and all you're really working with are four types of variables, right? so, just feeding the appropriate data into mecanim seems to be the thing that i'd need fo rthis.)

but yeah, just going to give a head's up... if all this doesn't work at all, i'll still be back at square one... which will be a real pain.

Red

  • Hero Member
  • *****
  • Posts: 563
Re: Combining animation data?
« Reply #28 on: December 31, 2012, 11:56:03 AM »
To update, even with setting it to bones (and also finding ONLY a set of bone objects that are actually bones) it's still not doing it.

it's basically just telling everything to stop and the animation freezes. so, i have tried all sorts of things and the only thing i can think of that's causing issues is that the entering of the name as a string isn't connecting to the actual bone object.

so, it's been confirmed, the rig is not the issue here. it's either the animation actions or how i've got it set up.

since this action is working on objects in the heirarchy, why not set them to use gameobjects instead of strings? using strings seems like too much of a wild-card in this issue which isn't working in this case probably because even though i've literally copied/pasted the name of the bone in the stack, it's still not taking.

i've even tried changing the order, adding the settings to the moving animations to try and tell it to only look at the legs... and still nothing.
« Last Edit: December 31, 2012, 12:07:48 PM by Red »

Red

  • Hero Member
  • *****
  • Posts: 563
Re: Combining animation data?
« Reply #29 on: December 31, 2012, 12:41:57 PM »
So, i've set up an exported package with the setup i've got... i would be greatly appreciative if someone could take a peek and see what i'm doing wrong.

http://rapidgator.net/file/66740279/Export-of-Level-for-Animation-help.unitypackage.html


I do have to state, however, that since this is currently set up with assets for my game, i can not give people permission to use them in their own games... sorry, but i have to do say this. feel free to pick the FSMs apart all you want though.
« Last Edit: December 31, 2012, 04:45:44 PM by Red »