glTF-Blender-IO icon indicating copy to clipboard operation
glTF-Blender-IO copied to clipboard

`Limit to Playback Range` option does not work

Open marcofugaro opened this issue 3 years ago • 4 comments

Describe the bug

The Limit to Playback Range does not seem to work.

I have a simple animation of blender, of which I have selected only a small portion to export:

https://user-images.githubusercontent.com/7217420/115210383-d031e400-a0fe-11eb-9972-b11d6795c201.mov

When exporting, I have selected the Limit to Playback Range, which according to the docs: "Clips animations to selected playback range."

Screenshot 2021-04-19 at 10 46 06

However, when I use the exported gltf, here in gltf-viewer, the whole animation plays. This is confusing.

https://user-images.githubusercontent.com/7217420/115211077-81d11500-a0ff-11eb-9358-328f0ae9e4a5.mov

To Reproduce Steps to reproduce the behavior:

  1. Download test-playback.zip below
  2. Open test-playback.blend
  3. Export to gltf using the Limit to Playback Range option
  4. Open the gltf in https://gltf-viewer.donmccurdy.com/ for example
  5. The complete animation plays

Expected behavior Only the animation from frames 30 to 40 should be exported.

.blend file/ .gltf test-playback.zip

Version

  • OS: macOS
  • Blender Version: 2.93.0 Alpha 2021-04-10

marcofugaro avatar Apr 19 '21 09:04 marcofugaro

This may be related to #387 as well

marcofugaro avatar Apr 19 '21 09:04 marcofugaro

Ran into this recently as well. This seems like a pretty serious bug.

gigablox avatar May 17 '21 20:05 gigablox

The limit playback range is only the end frame, i guess, thats also how its named in Blender itself. I think you would need to use current_frame otherwise it will always export from frame 0, which is weird since blender starts at frame 1

in the py "gltf2_blender_export.py" #37 i see this statement.

if not export_settings['gltf_current_frame']:
        bpy.context.scene.frame_set(0)

But indeed the limit playback does not do anything. its not used in the exporter. Its only being declared as a boolean and not actually checked. There should be an if statement in that py file like it has for gltf_current_frame, something like below

if export_settings['gltf_frame_range']:
        bpy.context.scene.frame_end

i just tried looking into how animation is exported with this addon. Im wondering if Limit Playback Range could ever work in this addon. It seems it exports the animations using the actions and NLA strips. Therefor its never checking the main timeline and thus the Playback Range of the scene.

I think this addon will be better off with a visible start and end frame input like some other exporters have. Because if the "limit playback range" is not used, what is the end frame then? its not stated how much frames are exported then actually

Im not English by tongue, but isnt the word Range used wrong in this case. In Blender it also states range, but its an end frame. So say it states 40, this does not mean the Range is 40, because when start frame is 20 and end is 40, the Range in this case is 20.

schroef avatar Jan 03 '22 17:01 schroef

Also running into this issue. @julienduroure any plans to fix this? It's a pretty commonly used technique to build looping animations.

hybridherbst avatar Oct 04 '22 14:10 hybridherbst

Hello, This is now fixed in current main branch, after animation refactor 64e3532f48ebdf878a1c9b81ade6d1a19c8ff890

julienduroure avatar Feb 26 '23 10:02 julienduroure