FBX exporting animation with 1 fps #99876

Closed
opened 2022-07-20 18:45:15 +02:00 by Konstantin Kharkovschenko · 38 comments

System Information
Operating system: Windows-10-10.0.22000-SP0 64 Bits
Graphics card: NVIDIA GeForce RTX 3060 Laptop GPU/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 512.77

Blender Version
Broken: version: 3.3.0 Alpha, branch: master, commit date: 2022-07-19 23:16, hash: blender/blender@40ffb94ab4
Worked: Blender 3.2.1

Short description of error
When exporting FBX it ignores scene fps value and make it 1 fps. So when I put it in Unity I get 4 frames animation for 4 seconds 30 fps in Blender. If I import it in 3ds Max I get all 120 frames but importer warnings that file has different fps.

Exact steps for others to reproduce the error
Open scene, export fbx with default settings, place in unity project and see clip duration and fps in animation tab

fbx_fps_bug.blend

**System Information** Operating system: Windows-10-10.0.22000-SP0 64 Bits Graphics card: NVIDIA GeForce RTX 3060 Laptop GPU/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 512.77 **Blender Version** Broken: version: 3.3.0 Alpha, branch: master, commit date: 2022-07-19 23:16, hash: `blender/blender@40ffb94ab4` Worked: Blender 3.2.1 **Short description of error** When exporting FBX it ignores scene fps value and make it 1 fps. So when I put it in Unity I get 4 frames animation for 4 seconds 30 fps in Blender. If I import it in 3ds Max I get all 120 frames but importer warnings that file has different fps. **Exact steps for others to reproduce the error** Open scene, export fbx with default settings, place in unity project and see clip duration and fps in animation tab [fbx_fps_bug.blend](https://archive.blender.org/developer/F13303660/fbx_fps_bug.blend)

Added subscriber: @Morphin

Added subscriber: @Morphin

#102398 was marked as duplicate of this issue

#102398 was marked as duplicate of this issue

blender/blender#101655 was marked as duplicate of this issue

blender/blender#101655 was marked as duplicate of this issue

blender/blender#101216 was marked as duplicate of this issue

blender/blender#101216 was marked as duplicate of this issue

#101066 was marked as duplicate of this issue

#101066 was marked as duplicate of this issue

#101056 was marked as duplicate of this issue

#101056 was marked as duplicate of this issue

#100963 was marked as duplicate of this issue

#100963 was marked as duplicate of this issue

blender/blender#100151 was marked as duplicate of this issue

blender/blender#100151 was marked as duplicate of this issue
Member

Added subscriber: @OmarEmaraDev

Added subscriber: @OmarEmaraDev
Member

Changed status from 'Needs Triage' to: 'Needs Developer To Reproduce'

Changed status from 'Needs Triage' to: 'Needs Developer To Reproduce'
Member

I don't have Unity to test myself, but I suspect the change in behavior is caused by b91319aead.
The exporter does a linear search and finds the last matching time mode and frame rate:

for ref_fps, fps_mode in FBX_FRAMERATES:
if similar_values(fps, ref_fps):
fbx_fps = ref_fps
fbx_fps_mode = fps_mode

And now that the 30 FPS drop frame mode was added (30.0, 7), # Drop frame., scenes with 30 frames are exported as such, so maybe the exporter should break upon the first match.

I don't have Unity to test myself, but I suspect the change in behavior is caused by b91319aead. The exporter does a linear search and finds the last matching time mode and frame rate: ```lang=python ``` for ref_fps, fps_mode in FBX_FRAMERATES: if similar_values(fps, ref_fps): fbx_fps = ref_fps fbx_fps_mode = fps_mode ``` ``` And now that the 30 FPS drop frame mode was added `(30.0, 7), # Drop frame.`, scenes with 30 frames are exported as such, so maybe the exporter should break upon the first match.

I tried to setup different fps in the scene before export. Result is the same

I tried to setup different fps in the scene before export. Result is the same
Member

But the exporter works correctly in 3.2, right?

But the exporter works correctly in 3.2, right?

In #99876#1393655, @OmarEmaraDev wrote:
But the exporter works correctly in 3.2, right?

Yes. And it respects scene fps settings. I tried with 24, 30 and 60

> In #99876#1393655, @OmarEmaraDev wrote: > But the exporter works correctly in 3.2, right? Yes. And it respects scene fps settings. I tried with 24, 30 and 60
Member

Changed status from 'Needs Developer To Reproduce' to: 'Needs Triage'

Changed status from 'Needs Developer To Reproduce' to: 'Needs Triage'
Member

Changed status from 'Needs Triage' to: 'Needs User Info'

Changed status from 'Needs Triage' to: 'Needs User Info'
Member

I went over this again, the only change to the FBX exporter in that period is b91319aead, can you try to revert it manually and check if it resolves the issue?
I also compared an ASCII dumps of both files from 3.2 and 3.3 and there was no difference, so I am not sure what could have caused this change in behavior.

I went over this again, the only change to the FBX exporter in that period is b91319aead, can you try to revert it manually and check if it resolves the issue? I also compared an ASCII dumps of both files from 3.2 and 3.3 and there was no difference, so I am not sure what could have caused this change in behavior.

Yes. Commenting just 126 line in fbx_utils.py solved issue ((30.0, 7), # Drop frame.). Maybe it's because there are two 30 fps presets in list?

FBX_FRAMERATES = (
    #(-1.0, 0),  # Default framerate.
    (-1.0, 14),  # Custom framerate.
    (120.0, 1),
    (100.0, 2),
    (60.0, 3),
    (50.0, 4),
    (48.0, 5),
    (30.0, 6),  # BW NTSC, full frame.
    #(30.0, 7),  # Drop frame.
    (30.0 / 1.001, 9),  # Color NTSC, full frame.
    (30.0 / 1.001, 8),  # Color NTSC, drop frame.
    (25.0, 10),
    (24.0, 11),
    (1.0, 12),  # 1000 milli/s (use for date time?).
    (24.0 / 1.001, 13),
    (96.0, 15),
    (72.0, 16),
    (60.0 / 1.001, 17),
    (120.0 / 1.001, 18),
)
Yes. Commenting just 126 line in fbx_utils.py solved issue ((30.0, 7), # Drop frame.). Maybe it's because there are two 30 fps presets in list? ``` FBX_FRAMERATES = ( #(-1.0, 0), # Default framerate. (-1.0, 14), # Custom framerate. (120.0, 1), (100.0, 2), (60.0, 3), (50.0, 4), (48.0, 5), (30.0, 6), # BW NTSC, full frame. #(30.0, 7), # Drop frame. (30.0 / 1.001, 9), # Color NTSC, full frame. (30.0 / 1.001, 8), # Color NTSC, drop frame. (25.0, 10), (24.0, 11), (1.0, 12), # 1000 milli/s (use for date time?). (24.0 / 1.001, 13), (96.0, 15), (72.0, 16), (60.0 / 1.001, 17), (120.0 / 1.001, 18), ) ```
Member

That was my initial guess, but you said it also doesn't work with 24 and 60, so I am not sure why that extra 30 entry would cause issue for 24 and 60.

That was my initial guess, but you said it also doesn't work with 24 and 60, so I am not sure why that extra 30 entry would cause issue for 24 and 60.

Em... I've tried 24,30 and 60 in 3.2. In 3.3 I've tried only 30 and "Custom 30". Now I've tried 24 and 60 in 3.3 and it exports correctly. Sorry for misleading.

Em... I've tried 24,30 and 60 in 3.2. In 3.3 I've tried only 30 and "Custom 30". Now I've tried 24 and 60 in 3.3 and it exports correctly. Sorry for misleading.
Member

Changed status from 'Needs User Info' to: 'Confirmed'

Changed status from 'Needs User Info' to: 'Confirmed'
Member

Alright, confirming with my previous comment.

In #99876#1393613, @OmarEmaraDev wrote:
I don't have Unity to test myself, but I suspect the change in behavior is caused by b91319aead.
The exporter does a linear search and finds the last matching time mode and frame rate:

    for ref_fps, fps_mode in FBX_FRAMERATES:
        if similar_values(fps, ref_fps):
            fbx_fps = ref_fps
            fbx_fps_mode = fps_mode

And now that the 30 FPS drop frame mode was added (30.0, 7), # Drop frame., scenes with 30 frames are exported as such, so maybe the exporter should break upon the first match.

Alright, confirming with my previous comment. > In #99876#1393613, @OmarEmaraDev wrote: > I don't have Unity to test myself, but I suspect the change in behavior is caused by b91319aead. > The exporter does a linear search and finds the last matching time mode and frame rate: > ```lang=python > for ref_fps, fps_mode in FBX_FRAMERATES: > if similar_values(fps, ref_fps): > fbx_fps = ref_fps > fbx_fps_mode = fps_mode > ``` > And now that the 30 FPS drop frame mode was added `(30.0, 7), # Drop frame.`, scenes with 30 frames are exported as such, so maybe the exporter should break upon the first match.

Added subscribers: @hichamo6, @iss

Added subscribers: @hichamo6, @iss
Member

Added subscribers: @cfnjrey, @carlos13eab, @PratikPB2123

Added subscribers: @cfnjrey, @carlos13eab, @PratikPB2123
Member

Added subscriber: @AndyBrunton

Added subscriber: @AndyBrunton
Member

Added subscriber: @ramon_grill

Added subscriber: @ramon_grill
Member

Added subscriber: @Bobo-3

Added subscriber: @Bobo-3
Member

Added subscriber: @mont29

Added subscriber: @mont29
Member

but I suspect the change in behavior is caused by b91319aead.

@mont29 ^

> but I suspect the change in behavior is caused by b91319aead. @mont29 ^

Added subscribers: @izanfranco, @mano-wii

Added subscribers: @izanfranco, @mano-wii

This issue was referenced by 80969b3d45

This issue was referenced by 80969b3d451dfc305c5fa77f7774b849752a7d44

This issue was referenced by f3975a3bad

This issue was referenced by f3975a3bad00da1d6df6026c9e74667d92c8288d

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Bastien Montagne self-assigned this 2022-10-07 11:30:55 +02:00

Added subscriber: @Cenda

Added subscriber: @Cenda

Vysypka.fbx
Problem is back in 3.3.1, 3.3.2 RC

3.1.2 working well

[Vysypka.fbx](https://archive.blender.org/developer/F13753726/Vysypka.fbx) Problem is back in 3.3.1, 3.3.2 RC 3.1.2 working well

3.4 Alpha is ok, any chance to repair also 3.3.2?

3.4 Alpha is ok, any chance to repair also 3.3.2?

@Cenda it is listed to be backported in 3.3 (blender/blender#100749), not sure if it will make it into 3.3.2 or 3.3.3 though.

@Cenda it is listed to be backported in 3.3 (blender/blender#100749), not sure if it will make it into 3.3.2 or 3.3.3 though.
Member

Added subscriber: @rjmechanic93

Added subscriber: @rjmechanic93
Sign in to join this conversation.
No Milestone
No project
No Assignees
8 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender-addons#99876
No description provided.