Commit Graph

205 Commits

Author SHA1 Message Date
Lyuma f67b6c158c Use image index instead of texture index for source_images 2023-08-05 16:54:35 -07:00
Aaron Franke 2970839085
Set base_path and filename during export 2023-08-03 16:49:22 -05:00
Rémi Verschelde 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
Aaron Franke 2d13a9651c
GLTF: Preserve the original bytes when importing a texture 2023-08-03 10:30:33 -05:00
Aaron Franke bc68fa368d
More cosmetic improvements in the GLTF code 2023-08-03 02:05:41 -05:00
Rémi Verschelde 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
Rémi Verschelde 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
Rémi Verschelde c000b0ce1b
Merge pull request #79267 from aaronfranke/gltf-copyright
Add copyright to GLTFState
2023-08-02 12:16:40 +02:00
Aaron Franke 955104385c
Cosmetic changes in GLTF node generation code 2023-07-30 13:51:25 -05:00
Aaron Franke 8da45d9e16
Improve GLTF export logic for scene root nodes 2023-07-22 23:45:27 -05:00
Aaron Franke e8906b5b80
Add export_preserialize to the GLTF export process 2023-07-18 15:20:24 -05:00
Hendrik Brucker 7e21eb7e00 Extract and reorganize texture resource classes 2023-07-14 20:04:21 +02:00
Yuri Sizov 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
wojtekpil a875baa218 Add KHR_materials_emissive_strength extension support for exporting gltfs 2023-07-13 15:30:30 +02:00
Aaron Franke 865d7e3e00
GLTF: Internal renames in material parsing code 2023-07-12 14:15:08 -05:00
Aaron Franke 07400f2065
Add copyright to GLTFState 2023-07-10 00:24:10 -05:00
RevoluPowered 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
Aaron Franke 4017524363
Fix exporting MeshInstances without a Skeleton in the GLTF module 2023-05-27 03:41:31 -05:00
Aaron Franke 7da93a0bc0
Add support for extending GLTF with more texture formats & support WebP 2023-05-22 16:30:20 -05:00
Clay John 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
VolTer 6b84e258d2 Use String.repeat() in more places 2023-05-01 02:27:46 +02:00
Rémi Verschelde 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
Rémi Verschelde d5b8a0fc37
Merge pull request #69266 from aaronfranke/gltf-physics
Implement physics support in the GLTF module
2023-04-25 09:56:58 +02:00
Silc Renew fac8a918f9 Expose interpolation methods for 3D track in Animation class 2023-04-25 01:45:14 +09:00
Martin Capitanio 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
Aaron Franke 639b8e7dc7
Implement physics support in the GLTF module 2023-03-09 20:02:05 -06:00
Hakim e14fa5532b Get the unlit / unshaded extension when importing GLTF and set it when exporting 2023-03-05 22:34:04 +01:00
K. S. Ernest (iFire) Lee 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
K. S. Ernest (iFire) Lee dbc1e94695 Fixes for gltf export.
* Fix null crashes.
* Bake tracks
* Add some error messages.
2023-02-07 11:57:25 -08:00
Lyuma 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
Lyuma bc24d01359 gltf: Add GLTFHandleBinary::HANDLE_BINARY_EMBED_AS_UNCOMPRESSED
This option allows for a safe fallback for embedded gltf textures in cases where VRAM compression is not needed.
Add an is_editor_hint guard around GLTFHandleBinary::HANDLE_BINARY_EXTRACT_TEXTURES, to use EMBED_AS_UNCOMPRESSED by default at runtime.
This provides an option for pixel art to be stored losslessly.
Additionally, respect project importer defaults for texture import settings.
Avoid writing and reimporting extracted textures identical to version on disk.
2023-02-01 01:42:36 -08:00
Rémi Verschelde 68cee1f02a
Merge pull request #72201 from fire/gltf-extract-img
Restore gltf embedded scenes due to problems with textures.
2023-01-31 13:18:37 +01:00
K. S. Ernest (iFire) Lee 39ef247721 gltf: Avoid using base64 hash as an image filename
Consistently use the images.name property with deduplication, or else the image index.
2023-01-31 02:30:16 -08:00
Silc Renew 8b3be51d17 Add remove immutable tracks option to glTF importer
Co-authored-by: Lyuma <xn.lyuma@gmail.com>
2023-01-30 08:57:27 +09:00
Rémi Verschelde 9d555f5c68
Merge pull request #62499 from fire/gltf-binary-img-compression
Handle gltf binary images
2023-01-27 11:35:55 +01:00
Rémi Verschelde 8b662c763e
Merge pull request #72162 from lyuma/skeleton_rename
Make BoneAttachment3D and Skeleton3D names consistent.
2023-01-27 11:24:34 +01:00
K. S. Ernest (iFire) Lee 39922d7167 Handle gltf binary
[ Ignore and Warn | Extract Textures (default) | Optimize Loading Embedded as Basisu ]

Enable compressed mip maps from Basis Universal for faster compressions.

Increase the quality of Basis to avoid corruption.

To keep compatibility use the first mip of the previous internal Godot format.

Because texture names may have invalid filename characters, adds String::validate_filename to sanitize filenames for import pipeline use.
2023-01-27 02:02:02 -08:00
Lyuma 3f4ea98b34 Make BoneAttachment3D and Skeleton3D names consistent.
BoneAttachment3D nodes are now named as their bone name.
Resolves cases where BoneAttachment3D nodes will have arbitrary names like BoneAttachment3D6
Reserve the name "Skeleton3D" and use this name for all generated Skeleton3D nodes.

This change will break existing imported scenes with more than one skeleton and/or bone attachments.
2023-01-26 23:25:33 -08:00
Lyuma 03bd1da32b Avoid nested skeletons, and handle skinned meshes with children.
Recursively adds child nodes into each skeleton. This should prevent nested skeletons and avoid bone attachments for leaf bones.

In cases where a skinned mesh has children, creates two scene nodes with the same name, which both will represent this single gltf node.
Because blend shape animations must target the mesh, adds a separate mapping for ImporterMeshInstance3D node references.

This change will break existing imported scenes with bone attachments and more than one skeleton.

Co-authored-by: K. S. Ernest (iFire) Lee <ernest.lee@chibifire.com>
2023-01-26 22:41:58 -08:00
SaracenOne 03523572b9 Adds missing method call to set blendshape tracks as 'imported' when importing from a GLTF. 2023-01-23 07:40:06 +00:00
K. S. Ernest (iFire) Lee a103400871 Fixes cases where the runtime ResourceLoader cannot load gltf images. 2023-01-19 09:10:28 -08:00
Rémi Verschelde d95794ec8a
One Copyright Update to rule them all
As many open source projects have started doing it, we're removing the
current year from the copyright notice, so that we don't need to bump
it every year.

It seems like only the first year of publication is technically
relevant for copyright notices, and even that seems to be something
that many companies stopped listing altogether (in a version controlled
codebase, the commits are a much better source of date of publication
than a hardcoded copyright statement).

We also now list Godot Engine contributors first as we're collectively
the current maintainers of the project, and we clarify that the
"exclusive" copyright of the co-founders covers the timespan before
opensourcing (their further contributions are included as part of Godot
Engine contributors).

Also fixed "cf." Frenchism - it's meant as "refer to / see".
2023-01-05 13:25:55 +01:00
Quentin Guidée b14c87cb92
glTF: Fix export crash with a ShaderMaterial (fixes #70159) 2022-12-17 10:03:42 -05:00
Aaron Franke f83f13f3a2
Pass GLTFState to the export_preflight method 2022-12-11 13:22:25 -06:00
Aaron Franke 5c48dfac48
Consistently use `p_` for parameters in GLTFDocument 2022-12-10 16:07:17 -06:00
Rémi Verschelde 0c1273629d
Merge pull request #69372 from aaronfranke/gltf-cleanup
GLTF module: Clean up lots of includes
2022-12-10 10:48:14 +01:00
bruvzg ecec415988
Use system fonts as fallback and improve system font handling.
Add support for font weight and stretch selection when using system fonts.
Add function to get system fallback font from a font name, style, text, and language code.
Implement system font support for Android.
Use system fonts as a last resort fallback.
2022-12-04 18:44:20 +02:00
Aaron Franke 1bbbee384d
GLTF: Clean up lots of includes 2022-11-29 23:11:08 -06:00
Rémi Verschelde 09e1db2148
Merge pull request #68665 from TokageItLab/cut-unkeyed-gltf-anim
Add "Trimming" option to cut un-keyed timeline before first key in glTF animation
2022-11-29 16:51:56 +01:00
Silc Renew db7473672f Add trimming option to cut un-keyed timeline before first key in gltf 2022-11-29 13:53:33 +09:00