Commit graph

193 commits

Author SHA1 Message Date
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
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
Rémi Verschelde
06bdc91afd
Merge pull request #69083 from fire/abstract_gltf_material
Cache materials in gltf as the abstract class of Material in GLTFDocument
2022-11-24 18:54:25 +01:00
K. S. Ernest (iFire) Lee
baab97302a Cache materials in gltf as the abstract class of Material
Use the abstract material class instead of BaseMaterial3D. This allows inserting ShaderMaterials into gltf. Like in VRM.
2022-11-24 09:00:09 -08:00
RedMser
9c50e99c5c Add unregister for GLTFDocumentExtension 2022-11-22 21:46:59 +01:00
Aaron Franke
98ef359240
Add three new methods to GLTFDocumentExtension 2022-11-21 14:38:46 -06:00
Aaron Franke
73c673a614
Change the way GLTFDocumentExtension classes are registered
Also move GLTFDocumentExtension into the extensions folder
2022-11-09 20:58:48 -06:00
Aaron Franke
83634119d4
Replace Quaternion Euler constructor with from_euler method 2022-11-01 09:28:12 -05:00
kobewi
072f6feaba Make some Image methods static 2022-10-14 14:34:15 +02:00
Rémi Verschelde
8017827144 SCons: Re-enable treating #warning as error with werror
Replace all TODO uses of `#warning` by proper TODO comments, and will open
matching bug reports to keep track of them.

We don't have a great track record fixing TODOs, but I'd wager we're even
worse for fixing these "TODO #warning" so we should prohibit this usage.
2022-10-10 16:12:26 +02:00
bruvzg
0103af1ddd
Fix MSVC warnings, rename shadowed variables, fix uninitialized values, change warnings=all to use /W4. 2022-10-07 11:32:33 +03:00
The Tophat Demon
c1a600545c GLTF imports & exports material texture filters 2022-10-03 16:20:08 -04:00
Aaron Franke
7097e8add7
Add a way to get the GLTF extensions supported by GLTFDocumentExtension 2022-09-19 19:40:06 -05:00
Aaron Franke
b72dc0de89
Make used extensions stored in GLTFState
This allows GLTFDocumentExtension classes to add to the used extensions array.
2022-09-19 19:39:49 -05:00