Commit Graph

70 Commits

Author SHA1 Message Date
Aaron Franke 923a8eb5d3
Move GLTFAccessorType into GLTFAccessor 2024-07-04 15:46:48 -07:00
Aaron Franke d3a58e57b8
Rename accessor GLTFType to GLTFAccessorType, fix verbose prints, doc 2024-05-24 03:21:13 -07:00
K. S. Ernest (iFire) Lee 24f56008ac Add bake_fps for FBXDocument, GLTFDocument and both import-export. 2024-05-23 09:09:36 -07:00
Lyuma 8232759100 Fix method bindings in FBXDocument by making them virtual in GLTFDocument. 2024-03-15 12:47:02 -07:00
Rémi Verschelde 21b33c5ea4
Merge pull request #89418 from lyuma/gltf_vertex_packing
Only store vertices referenced by the indices per surface in the glTF importer
2024-03-14 22:34:52 +01:00
Rémi Verschelde 37b08a3724
Merge pull request #89356 from lyuma/vsk-gltf-sparse-accessors-4.3
GLTF export: Use sparse accessors for morph targets
2024-03-14 22:34:47 +01:00
Rémi Verschelde 453485aede
Merge pull request #89270 from Repiteo/enforce-typename-in-templates
Enforce template syntax `typename` over `class`
2024-03-14 22:34:37 +01:00
Lyuma 77f6e35a8d glTF importer now only stores vertices referenced by the indices per surface. 2024-03-13 18:34:55 -07:00
Lyuma db2c9571bb glTF export: morph targets are relative, so use zero as reference 2024-03-12 02:39:15 -07:00
K. S. Ernest (iFire) Lee 1e63a2a132 Update buffer view target handling, encode sparse accessors as vec3.
Co-authored-by: Lyuma <xn.lyuma@gmail.com>
2024-03-12 02:39:00 -07:00
Lyuma fd2aa564ab gltf export: Remove snapping and fix validation
Round min/max correctly in accessors
Include correct target in vertex and indices bufferViews
Avoid use of Math::snapped
Normalize vertex weights.
2024-03-10 06:07:46 -07:00
Thaddeus Crews 9903e6779b
Enforce template syntax `typename` over `class` 2024-03-07 22:39:09 -06:00
K. S. Ernest (iFire) Lee 04d43947bf
Add ufbx for FBX importing
This update introduces a new import method for FBX files using ufbx. If the fbx2gltf import fails, it will use the most recently cached scene from the ufbx import. The process is sped up by introducing threads to load the ufbx portion.

Key changes include:

- Support for importing geometry helper nodes in FBX files.
- Addition of cameras and lights with updated names.
- Removal of the fbx importer manager.
- Introduction of ModelDocument3D and updates to its methods.
- Changes to FBX import options and visibility.
- Updating the documentation and handling some errors.
- Store the original non-unique node, mesh and animation names in FBX and glTF.

Co-Authored-By: bqqbarbhg <bqqbarbhg@gmail.com>
2024-02-23 22:33:04 +01:00
Aaron Franke 4c8d69f264
Fix crash when importing a GLTF file with a skeleton as the root 2024-02-04 02:48:16 -06:00
Aaron Franke 8acef03cb5
Add export settings to the export dialog for GLTF 2023-12-30 19:57:39 -06:00
Aaron Franke 58076b9ccb
Implement glTF compat version system for files from older Godot versions 2023-11-03 12:07:25 -05:00
Aaron Franke 446893fdd1
GLTF: Add GODOT_single_root extension 2023-09-26 10:18:52 -05:00
Rémi Verschelde 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
Aaron Franke 2723f781dd
GLTF: Allow specifying export image format including from extensions 2023-09-14 17:33:48 -05:00
Aaron Franke 5b7001dccf
GLTF: Improve logic for keeping track of the real root node 2023-09-03 03:35:29 -05:00
Aaron Franke 2970839085
Set base_path and filename during export 2023-08-03 16:49:22 -05: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 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
Aaron Franke 955104385c
Cosmetic changes in GLTF node generation code 2023-07-30 13:51:25 -05:00
Aaron Franke 07400f2065
Add copyright to GLTFState 2023-07-10 00:24:10 -05:00
Aaron Franke 7da93a0bc0
Add support for extending GLTF with more texture formats & support WebP 2023-05-22 16:30:20 -05: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
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
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 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
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
Aaron Franke 5c48dfac48
Consistently use `p_` for parameters in GLTFDocument 2022-12-10 16:07:17 -06: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
RedMser 9c50e99c5c Add unregister for GLTFDocumentExtension 2022-11-22 21:46:59 +01: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
The Tophat Demon c1a600545c GLTF imports & exports material texture filters 2022-10-03 16:20:08 -04: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
Aaron Franke afe09ec914
Minor enhancements to the GLTF module (lights and docs) 2022-09-18 22:33:21 -05:00
Aaron Franke 7b8f9a0e8e
GLTF: Organize structures into a subfolder 2022-07-24 17:16:51 -05:00
Aaron Franke 00ec9321f6
GLTF: Move shared defines into a separate gltf_defines.h file
Also move GLTFDocument's template conversion functions into gltf_template_convert.h
2022-07-24 14:21:27 -05:00
reduz 45af29da80 Add a new HashSet template
* Intended to replace RBSet in most cases.
* Optimized for iteration speed
2022-05-20 22:40:38 +02:00
K. S. Ernest (iFire) Lee d600e0bc00 Improve gltf extension GLTFDocument api. 2022-05-20 06:58:48 -07:00
reduz 746dddc067 Replace most uses of Map by HashMap
* Map is unnecessary and inefficient in almost every case.
* Replaced by the new HashMap.
* Renamed Map to RBMap and Set to RBSet for cases that still make sense
  (order matters) but use is discouraged.

There were very few cases where replacing by HashMap was undesired because
keeping the key order was intended.
I tried to keep those (as RBMap) as much as possible, but might have missed
some. Review appreciated!
2022-05-16 10:37:48 +02:00
bruvzg 9381acb6a4
Make FileAccess and DirAccess classes reference counted. 2022-04-11 13:28:51 +03:00
K. S. Ernest (iFire) Lee 9484ee7a9e Add support for importing .blend files
Lets you drag or place .blend files in the project folder and it will import the files.

Checks for Blender 3.0's gltf2 `export_keep_originals` option.

Add basepath support to GLTFDocument append_from_file.

Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
2022-03-29 21:54:41 +02:00
K. S. Ernest (iFire) Lee b468104842 Skip Draco-compressed glTF 3d format files. 2022-01-08 10:14:46 -08:00