Commit Graph

225 Commits

Author SHA1 Message Date
6d8f029df4 Use the Blender file name instead of the generated GLTF file name 2023-11-09 12:11:39 -06:00
58076b9ccb Implement glTF compat version system for files from older Godot versions 2023-11-03 12:07:25 -05:00
d1043a5f93 Enhance checks and user experience around tangents.
Ensure `ensure_tangents` option actually creates tangent array. Even if it is just a dummy array.

Allow mesh to generate its own tangents when using compression. This allows users to compress meshes without tangents.

Warn users if they are trying to read from tangents without providing tangents.
2023-11-01 22:40:42 +01:00
4b671eec0e Reimport bone attachment fixes:
Assign bone_idx to GLTF importer to fix serialization.
Notifies Skeletons and BoneAttachments when reimporting.
Removes usage of NOTIFICATION_NODE_RECACHE_REQUESTED
2023-10-27 20:34:01 +01:00
1c70a7ae6a Prevent godot crash from importing a certain kind of invalid gltf
invalid type: mistach interpolation CUBICSPLINE and value size
2023-10-20 16:58:11 +08:00
034c0f1624 Replace sanity with safety for checks 2023-10-08 16:22:24 +02:00
51ed3aef63 Vertex and attribute compression to reduce the size of the vertex format.
This allows Godot to automatically compress meshes to save a lot of bandwidth.

In general, this requires no interaction from the user and should result in
no noticable quality loss.

This scheme is not backwards compatible, so we have provided an upgrade
mechanism, and a mesh versioning mechanism.

Existing meshes can still be used as a result, but users can get a
performance boost by reimporting assets.
2023-10-05 12:02:23 -06:00
7bd894ba7a Fix skeletons when generating multiple Godot scenes from one GLTF 2023-09-28 17:48:33 -05:00
dc14f02892 Merge pull request #81851 from aaronfranke/gltf-single-root
GLTF: Add root node export options and GODOT_single_root extension
2023-09-26 17:52:51 +02:00
446893fdd1 GLTF: Add GODOT_single_root extension 2023-09-26 10:18:52 -05:00
517e9f8aef [Modules] Replace ERR_FAIL_COND with ERR_FAIL_NULL where applicable 2023-09-26 16:44:52 +02:00
3f4513d4de Add error checks for DirAccess creation. 2023-09-26 03:07:43 +01:00
ec0e6800bc Fix gltf importer forcing vertex colors on all materials
The importer already checks if a mesh has vertex colors and enables
vertex colors on the material using it.

Before this fix, GLTF importer would force shader generation to use
vertex colors even if the scene did not have vertex colors at all, or
did not need them; causing inefficient shader and PSO generation.
2023-09-24 19:37:33 -03:00
51f67ea4c5 Merge pull request #81264 from aaronfranke/gltf-node-name-camera
GLTF: Change "Camera3D" generated node name to "Camera"
2023-09-16 21:22:29 +02:00
be53991b5a Merge pull request #80272 from aaronfranke/gltf-root-node-logic
GLTF: Improve logic for keeping track of the real root node
2023-09-16 21:21:40 +02:00
2723f781dd GLTF: Allow specifying export image format including from extensions 2023-09-14 17:33:48 -05:00
908716529d GLTF: Add a comment for skinned mesh tree placement
Co-authored-by: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com>
2023-09-05 12:19:31 -05:00
5b7001dccf GLTF: Improve logic for keeping track of the real root node 2023-09-03 03:35:29 -05:00
c1bc4fbd20 GLTF: Change "Camera3D" generated node name to "Camera" 2023-09-03 02:47:34 -05:00
da89753cc6 Fix doubly-reserved unique names in GLTF scene name assignment 2023-08-20 00:03:56 -05:00
f67b6c158c Use image index instead of texture index for source_images 2023-08-05 16:54:35 -07:00
2970839085 Set base_path and filename during export 2023-08-03 16:49:22 -05:00
1d42504b30 Merge pull request #79623 from aaronfranke/gltf-export-preserialize
Add `export_preserialize` to the GLTF export process
2023-08-03 18:33:49 +02:00
2d13a9651c GLTF: Preserve the original bytes when importing a texture 2023-08-03 10:30:33 -05:00
bc68fa368d More cosmetic improvements in the GLTF code 2023-08-03 02:05:41 -05:00
6b38024b6a Merge pull request #79801 from aaronfranke/gltf-scene-export-logic
Improve GLTF export logic for scene root nodes
2023-08-02 12:20:23 +02:00
3988bf614b Merge pull request #79775 from aaronfranke/gltf-node-gen-cosmetic
Cosmetic changes in GLTF node generation code
2023-08-02 12:19:58 +02:00
c000b0ce1b Merge pull request #79267 from aaronfranke/gltf-copyright
Add copyright to GLTFState
2023-08-02 12:16:40 +02:00
955104385c Cosmetic changes in GLTF node generation code 2023-07-30 13:51:25 -05:00
8da45d9e16 Improve GLTF export logic for scene root nodes 2023-07-22 23:45:27 -05:00
e8906b5b80 Add export_preserialize to the GLTF export process 2023-07-18 15:20:24 -05:00
7e21eb7e00 Extract and reorganize texture resource classes 2023-07-14 20:04:21 +02:00
ac16c2696e Merge pull request #79421 from wojtekpil/gltf_emission_strength_export
Add `KHR_materials_emissive_strength` extension support for exporting GLTFs
2023-07-14 18:50:08 +02:00
a875baa218 Add KHR_materials_emissive_strength extension support for exporting gltfs 2023-07-13 15:30:30 +02:00
865d7e3e00 GLTF: Internal renames in material parsing code 2023-07-12 14:15:08 -05:00
07400f2065 Add copyright to GLTFState 2023-07-10 00:24:10 -05:00
83f2fce078 Add support for KHR_materials_emissive_strength
This reads the multiplier for the emission strength from GLTF files.

This is fairly universal and is required for blender's emission value to be imported.

The value is a simple universal multiplier and is unitless.

Sponsored by The Mirror.
2023-06-23 19:43:43 +01:00
4017524363 Fix exporting MeshInstances without a Skeleton in the GLTF module 2023-05-27 03:41:31 -05:00
7da93a0bc0 Add support for extending GLTF with more texture formats & support WebP 2023-05-22 16:30:20 -05:00
610877e326 Merge pull request #72288 from MewPurPur/use-string-repeat
Use `String.repeat()` to optimize several String methods
2023-05-05 09:56:48 -07:00
6b84e258d2 Use String.repeat() in more places 2023-05-01 02:27:46 +02:00
be00dcd724 Merge pull request #73656 from TokageItLab/expose-3d-tracks
Expose interpolation methods for 3D track in `Animation` class
2023-04-25 09:57:52 +02:00
d5b8a0fc37 Merge pull request #69266 from aaronfranke/gltf-physics
Implement physics support in the GLTF module
2023-04-25 09:56:58 +02:00
fac8a918f9 Expose interpolation methods for 3D track in Animation class 2023-04-25 01:45:14 +09:00
8b6fa79eee Fix blend_shape (shapekey) empty name import.
Corresponds to the Blender glTF-Importer PR
https://github.com/KhronosGroup/glTF-Blender-IO/pull/1902
2023-04-12 16:37:49 +02:00
639b8e7dc7 Implement physics support in the GLTF module 2023-03-09 20:02:05 -06:00
e14fa5532b Get the unlit / unshaded extension when importing GLTF and set it when exporting 2023-03-05 22:34:04 +01:00
28a340bf3b For basisu avoid inserting to the image array twice.
Basisu images were getting referenced incorrectly like set black or set as not transparent.
2023-02-14 17:22:36 -08:00
dbc1e94695 Fixes for gltf export.
* Fix null crashes.
* Bake tracks
* Add some error messages.
2023-02-07 11:57:25 -08:00
5fbcb80170 Use reimport_append api for importing embedded gltf images
Co-authored-by: K. S. Ernest (iFire) Lee <ernest.lee@chibifire.com>
2023-02-06 07:11:45 -08:00