playMaker

Author Topic: Setting influence of look at vs bone animation  (Read 3114 times)

kurageart

  • Playmaker Newbie
  • *
  • Posts: 13
Setting influence of look at vs bone animation
« on: January 16, 2013, 07:46:25 AM »
Hello.. I made a rigged - animated character (animation is controlled  by using playmaker, also) having his head looking at a target. By assigning a simply "look at" on a fsm made in the "head bone", everything works.Great!

But i was wondering if is possible to set the influence that the "look at" haves on the animation..
By default is "100%" ...i would like to set it a little less, so the motion looks more natural..

Any solution? Perhaps i have to play with mecanim, but for what I've seen, mechanim fits well only with humanoid characters.. right? :o

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Setting influence of look at vs bone animation
« Reply #1 on: January 17, 2013, 01:44:12 AM »
Hi,

 What you would do then, is have another gameObject to look at, and then you can use the rotation property of that gameObject and blend or lerp or follow it the way you want with your actual head.

Does that make sense?

bye,

 Jean

kurageart

  • Playmaker Newbie
  • *
  • Posts: 13
Re: Setting influence of look at vs bone animation
« Reply #2 on: January 17, 2013, 05:45:18 AM »
yes, it totally makes sense... my question was about : how to "blend" the influence of the game object to look at with the actual bone animation of the main character (the one who is looking )?

Red

  • Hero Member
  • *****
  • Posts: 563
Re: Setting influence of look at vs bone animation
« Reply #3 on: January 17, 2013, 08:32:14 AM »
well, from a rigging perspective if you want something to look midway between two points, you have to take the two points and find the average point in between them... this is me thinking off the top of my head and i'm not sure how well to do it in playmaker... but here goes nothing.

first, if you can get the rotational information from the preceeding bone object or have a game-object that's oriented the same as the head bone but parented to the neck bone (so you have something to extract the default information from.) i would probably add in another game-object parented to the neck bone with the look-at script attached to be the second object to extract the rotation data of...

from there, i am not sure which math-like actions to use but if you can take both those objects, average out the data (so, maybe add the rotation in each of the three axis, divide by two and recompile that data back into a vector3 variable) and tell the head bone itself to orient itself with the rotational data in this new vector3 variable you've just made might do it... if you're having all this happen every frame, it should (theoretically) give you real-time data... and with the head having the variable information fed to it and orienting it, it can be (i think) simple matter of setting up a system where you tell it "use this" and "don't use this." with either global variables fired off as events from whatever FSM you want to control it with.

again, though, i dont' know how this would be do-able in playmaker... but it's kinda what i'd do if i were rigging it and the systems aren't terribly different in that respect as they use bone-objects for extracting the transform information.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Setting influence of look at vs bone animation
« Reply #4 on: January 18, 2013, 01:06:25 AM »
Hi,

 Yes, you got the theory right.

 as far as the math actions. I would use lerp really and simply have a fixed ratio, which means you can define the "blend" between two position. I am really weak when it comes to quaternions, so I would go with a set of dummies for look at target, instead of trying to mess with quats and rotation... which I am never comfortable with.

bye,

 Jean