Download

How to get a morph target value from an animation at runtime?

Hi people!

I made a question at AnswerHub and I’m posting the link to it here. Ok?

https://answers.unrealengine.com/questions/130076/how-to-get-morph-target-value-on-animation.html

Summarizing… I need to get the value of a certain morph target (in runtime) that is being animated from an imported animation from 3D’s Max.

Here’s a link to a video that I recorded from a test that I made:

https://youtube.com/watch?v=jxBoY2GOQFg

Any help? Thanks thanks!

People, I really need this to work on a system to improve facial expression visualization, adding wrinkles to the characters when they smile or when raise eyebrows!

Something like this:

https://www.youtube.com/watch?v=5Nohp4uo-Xo

So I’ll need those morph target values in runtime to guide the material parameters!

Thank you!

hi , here you are just playing an animation without any relation with morph
why don’t you use a timeline by setting your morph target to animate your object

Hi Mhousse1247,

I’m animating both bones and morph targets on the timeline in 3D’s Max, that’s how I need to import all completed character meshes and their animations. The morph target is being correctly animated in game, but the problem is that the blend value is not changing using the blueprint in the video.

you dont get the value because there is no relation between morph targets and the animation you created based on this morph

There only appears to be a Set Morph Target weight in Blueprint - you should be able to get the weight from c++ . Looks like it needs a mention on Answerhub

Mhousse1247, It still seems very strange to me, but I understand.

Anadin, yes I took a look at the source code and I’ll try to implement something… I just need to access the animation curve of the morph targets.

Actually is just a matter of getting animation data from 3ds/Maya/whatever to UE4 and its fairly simple, just think outside the box :wink:

Regarding the wrinkles I did a proof of concept and right now I’m developing a dual system for facial animation, one will be blend shape based, the other one will be joint based.
In the proof of concept I’m not using blendshapes, its all bone driven.
The joint based one will be swappable between characters :slight_smile:

Tech demo is on the way, but lack of time is a problem.
Anyway I guess that by the end of novemeber/december I’ll probably release some videos and I’ll be available for work, since the system that I’m developing is quite efficient.

So that no one else find their way to this post and gets stuck trying to figure out how to implement that code for half a day (seriously you need to include the .h and .ccp to make sense of getting that to work for non-programmers) I have found that there are two nodes for the morph targets.

First is Get Morph Target which only gives you the base pose value, but the second one is Get Curve Value that gives you the morph target value during play. You won’t see it if you drag of the mesh because you need to get the Anim Instance for the mesh, There is a screenshot below showing both methods (the one connected gives you runtime values for the morph target).

907d1cf3de822b189ed09ea97dfd25334b0c6e92.png

Thanks for your post Miroac! :slight_smile:

You rock man! Helped me 5 years later. Though “Get Morph Target” was gonna do it and was wondering why it was outputting 0.