godot/modules/gltf
Ryan Roden-Corrent c93d74aca0 Update blender export flags for 3.6.
Fixes #76338.

Blender 3.6 imports fail with:

```
TypeError: Converting py args to operator properties: : keyword "export_nla_strips" unrecognized
```

The `export_nla_strips` flag was removed and replaced with `export_animation_mode`.
In 3.6.0-3.6.21, this option does not exist at all and causes the failure above.
In 3.6.22, this option was re-added, but does nothing.
See 96a73cb664.

We now need to check the blender version to determine what flags to use.
This adds an additional shell command before every import.
We might consider caching the version, but we'd have to invalidate the cache if the blender version or path changes.

As an aside, the "group animations" setting in Godot does the opposite of what I'd expect.
When `group_tracks=true`, each animation is exported individually.
When `group_tracks=false`, all animations are exported as a single track.
This seems backwards, but I've kept the 3.6 behavior consistent with 3.5.

From https://docs.blender.org/api/3.6/bpy.ops.export_scene.html:

> ACTIONS Actions – Export actions (actives and on NLA tracks) as separate animations.
> ACTIVE_ACTIONS Active actions merged – All the currently assigned actions become one glTF animation.

Co-authored-by: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com>
(cherry picked from commit 7e64c6c399)
2023-10-24 19:51:53 +02:00
..
doc_classes GLTF: Rename GLTFCollider class to GLTFPhysicsShape 2023-06-16 15:18:24 -05:00
editor Update blender export flags for 3.6. 2023-10-24 19:51:53 +02:00
extensions GLTF: Rename GLTFCollider class to GLTFPhysicsShape 2023-06-16 15:18:24 -05:00
structures Style: Harmonize header includes in modules 2023-06-15 14:35:45 +02:00
README.md GLTF: Organize structures into a subfolder 2022-07-24 17:16:51 -05:00
SCsub SCons: Unify tools/target build type configuration 2022-09-26 16:31:46 +02:00
config.py GLTF: Rename GLTFCollider class to GLTFPhysicsShape 2023-06-16 15:18:24 -05:00
gltf_defines.h One Copyright Update to rule them all 2023-01-05 13:25:55 +01:00
gltf_document.cpp Use image index instead of texture index for source_images 2023-09-20 22:44:04 +02:00
gltf_document.h Add support for extending GLTF with more texture formats & support WebP 2023-05-22 16:30:20 -05:00
gltf_state.cpp Add a get_node_index method to GLTFState 2023-05-27 12:30:25 -05:00
gltf_state.h Add a get_node_index method to GLTFState 2023-05-27 12:30:25 -05:00
gltf_template_convert.h One Copyright Update to rule them all 2023-01-05 13:25:55 +01:00
register_types.cpp Make blend file importer warnings translatable 2023-09-21 15:28:24 +02:00
register_types.h One Copyright Update to rule them all 2023-01-05 13:25:55 +01:00

README.md

Godot GLTF import and export module

In a nutshell, the GLTF module works like this:

  • The structures/ folder contains GLTF structures, the small pieces that make up a GLTF file, represented as C++ classes.
  • The extensions/ folder contains GLTF extensions, which are optional features that build on top of the base GLTF spec.
  • GLTFState holds collections of structures and extensions.
  • GLTFDocument operates on GLTFState and its elements.
  • The editor/ folder uses GLTFDocument to import and export 3D models.