glTF-Blender-IO
glTF-Blender-IO copied to clipboard
`Limit to Playback Range` option does not work
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](https://user-images.githubusercontent.com/7217420/115210662-1c7d2400-a0ff-11eb-9315-35acc30838cd.png)
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:
- Download
test-playback.zip
below - Open
test-playback.blend
- Export to gltf using the
Limit to Playback Range
option - Open the gltf in https://gltf-viewer.donmccurdy.com/ for example
- 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
This may be related to #387 as well
Ran into this recently as well. This seems like a pretty serious bug.
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.
Also running into this issue. @julienduroure any plans to fix this? It's a pretty commonly used technique to build looping animations.
Hello, This is now fixed in current main branch, after animation refactor 64e3532f48ebdf878a1c9b81ade6d1a19c8ff890