x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

AnswerHub Maintenance

Background maintenance is scheduled to occur between 9 - 11am EDT on Tuesday, May 21. Site operation may be slower than normal during this time and a brief interruption in operation may be observed

fbx export from UE4 bug and Blender Animation Import 25 fps work around

I possibly found a bug in unreal engine 4 fbx animation export, namely that it exports it's animation with 1 frame extra and then scales the animation to that range. For example, when exporting "ThirdPersonWalk" animation sequence from 3rdPerson Template it should export frames 0 to 29 but it exports frames 0 to 30.

To work around this bug, for importing ue4 animation fbx exports into blender correctly you have to do the following things:

1) change file "import_fbx.py" in folder "\scripts\addons\io_scene_fbx" line 2337 from

 real_fps = 25.0

to

 real_fps = bpy.context.scene.render.fps

2) Set blender's frame rate to 30 fps in Properties Editor in the Render Tab.

3) import exported fbx animation

4) Scale the animation to one frame less, for example if animation is from frame 0 to 30 scale the animation so it becomes frame 0 to 29. you can do this manually in Dope Sheet Editor by setting current frame to 0 in Dope Sheet Editor and than press shortcut "S" to scale and type "0.9666" ((last frame - 1)/ last frame in this case 29/30 which is 0.9666). This will be a hassle if you have to do it for a lot of imported animations or someone could make a python script to do this automatically.

Edit: here's a simple python script to automatically scale the time correctly of an armature. Select the armature, copy-paste this script in the Text Editor and run it

 import bpy
 
 # store current area type, then change area type to Dopesheet Editor
 area = bpy.context.area
 old_type = area.type
 area.type = 'DOPESHEET_EDITOR'
 
 # get active object, animation range, scale animation
 obj = bpy.context.scene.objects.active
 obj_frame_range = obj.animation_data.action.frame_range
 obj_frame_length = obj_frame_range[1] - obj_frame_range[0]
 bpy.context.scene.frame_current = obj_frame_range[0]
 time_scale_value = (obj_frame_length - 1)/obj_frame_length
 bpy.ops.transform.transform(mode='TIME_SCALE', value=(time_scale_value, 0, 0, 0))
 
 #restore area type to first state
 area.type = old_type


Hopefully the bug will be fixed soon and you just have to set fps to 30.

This bug of ue4 exporting one extra frame and scaling the whole animation to the new range probably also is in 3ds max and maya.

Product Version: UE 4.20
Tags:
more ▼

asked Oct 29 '18 at 09:51 PM in Using UE4

avatar image

joeyeroq
11 3

avatar image AugustoMoura Dec 01 '18 at 11:00 AM

UE4 seems to show two different frame counts As a original 10 frames animation:

Animation Sequence editor: 10 frames

Content Browser (number of keys): 11 frames

Exported from UE4 FBX ASCII: 11 frames

But you actually don't need to scale the animation, on my tests i've created an animation from frame 0 to 10, exported from Blender and then imported to UE4, then exported from UE4 (as ASCII FBX it shows as 11 frames), but when imported into Blender it imported as 1 frame forward, 1 to 11 (but still 10 frames in total)

In my case i've imported many animations, so i used this code to move all keyframes one frame back:

 import bpy
 
 for action in bpy.data.actions:
     for fcurve in action.fcurves:
         for point in fcurve.keyframe_points:
             point.co.x -= 1
(comments are locked)
10|2000 characters needed characters left

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question