Announcement

Collapse
No announcement yet.

Blender to Unreal Rotation + Root Motion Problem

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Blender to Unreal Rotation + Root Motion Problem

    Apologies if this has been solved somewhere else, I have searched deep into the Google and haven't found a solution on Unreal Forums or anywhere else.

    I am having problems with root motion in Unreal Engine/Blender. First, when I import my FBX into unreal, the rotation is off by 90 degrees, and second, the root motion does not play in the play mode, and my character just stays still.

    These are the steps I went through:

    First, I added a root bone to the animation, by following along the main hips and project onto the floor.
    Click image for larger version

Name:	1.png
Views:	28
Size:	527.9 KB
ID:	1692683
    Next, I exported as FBX using the following blender settings.
    Click image for larger version

Name:	2.png
Views:	27
Size:	51.1 KB
ID:	1692684
    Next, I imported them into Unreal. This is where I got worried, as the rotation showed the character sliding upwards into the air. After enabling root motion, things looked relatively normal, and the root bone was locked in place as the animation played above it.
    Click image for larger version

Name:	3.png
Views:	27
Size:	539.8 KB
ID:	1692685
    Now, I create a montage, and in my Animation_BP I set root motion to "Root motion from montages only."
    Click image for larger version

Name:	4.png
Views:	27
Size:	561.3 KB
ID:	1692686Click image for larger version

Name:	5.png
Views:	27
Size:	74.0 KB
ID:	1692688
    As I click play, everything seems to be working as normal, except when I run my slide montage using keypress E, I lock in place as I do the animation.

    If root motion is the problem, what can I do to make the slide animation run as normal, using root motion, and move forward?
    If the problem is the weird rotation on import, how can I fix that Blender/Unreal relationship?

    Again, apologies if this has been answered to a greater extent then the ones I get when I google.

    Thank You!
    - HappyDragon78
    Attached Files

    #2
    Ok, so from the beginning.

    First thing first you should be importing your skeleton as a T or A pose, and selecting the skeleton when importing animations.
    this will maybe already correct your odd rotation.

    Second, -y forward z up is what you picked. Make sure that your rig/animation is looking forward on the Negarive y axis in blender. Or change the axis. More common is positive y.
    s is always up. Some times X is forward if you started on a default blender file.

    Third. Before exporting both the rig in A pose and the animation, make sure to clear/apply all transforms manually.
    Atrl A - apply loc/rot/scale or all transforms.

    Now, assuming you get the rig and animation to import correctly with the proper facing (which might literally just be that negative y axis). Enable root motion on the main animation. Then on the montage. That should get you a working thing.
    If the animation is not setup for root motion, the montage won't utilize root motion (because potentially a montage is made up of many different animations, some of which mat not require the root motion active.)

    Edit: the alternate approach is to move the root motion to an animation curve, and manually apply it in AnimBP via the curve itself that plays in the animation... to do that simply move the root motion data (copy and paste, you can find a vid of me doing it on the page for the plugin you would need http://mosthostla.com/gamedev/ue4curves ) to a custom named curve, export with that, and simply script the AnimBP to move the root bone translation based on the value of this curve along with an "on/off" alpha you can toggle for extra control.
    far more complex, but it removes the need for hybrid root motion animations...
    Last edited by MostHost LA; 11-30-2019, 07:32 AM.

    Comment


      #3
      Originally posted by MostHost LA View Post

      Third. Before exporting both the rig in A pose and the animation, make sure to clear/apply all transforms manually.
      Atrl A - apply loc/rot/scale or all transforms.
      This solved it! You're amazing

      Comment

      Working...
      X