Commit Graph

359 Commits

Author SHA1 Message Date
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
Yuri Sizov e1859346dc Merge pull request #78621 from RevoluPowered/add-emission-strength-support-to-gltf
Add support for GLTF extension KHR_materials_emissive_strength
2023-07-12 17:16:41 +02:00
Aaron Franke 07400f2065
Add copyright to GLTFState 2023-07-10 00:24:10 -05:00
Rémi Verschelde 81064cc239
Doctool: Remove version attribute from XML header
We don't use that info for anything, and it generates unnecessary diffs
every time we bump the minor version (and CI failures if we forget to
sync some files from opt-in modules (mono, text_server_fb).
2023-07-06 10:08:21 +02:00
Rémi Verschelde 346f1ab86b
Bump version to 4.2-dev
Keep on waitin'
2023-07-05 22:07:03 +02: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
Rémi Verschelde f9fc77bbe4
Merge pull request #77545 from aaronfranke/gltf-no-skeleton
Fix exporting MeshInstances without a Skeleton in the GLTF module
2023-06-23 00:10:00 +02:00
Aaron Franke a222bdf83f
GLTF: Rename GLTFCollider class to GLTFPhysicsShape 2023-06-16 15:18:24 -05:00
Rémi Verschelde 25b2f1780a
Style: Harmonize header includes in modules
This applies our existing style guide, and adds a new rule to that style
guide for modular components such as platform ports and modules:

Includes from the platform port or module ("local" includes) should be listed
first in their own block using relative paths, before Godot's "core" includes
which use "absolute" (project folder relative) paths, and finally thirdparty
includes.

Includes in `#ifdef`s come after their relevant section, i.e. the overall
structure is:

- Local includes
  * Conditional local includes
- Core includes
  * Conditional core includes
- Thirdparty includes
  * Conditional thirdparty includes
2023-06-15 14:35:45 +02:00
Hakim 1fb1dd3248 Refresh the filesystem tab when exporting a new GLTF file 2023-06-10 23:04:20 +02:00
Aaron Franke 6dde6b4cdf
GLTF: Expose the inertia tensor instead of a vector 2023-06-06 21:06:49 -05:00
Aaron Franke 629613a867
GLTF: Document `gltf_skeleton->godot_bone_node` is unused when importing 2023-06-03 02:13:07 -05:00
Aaron Franke a98be434b7
Fix center of mass when importing GLTF physics bodies 2023-05-29 00:09:15 -05:00
Aaron Franke 5e139c2ab9
Add a get_node_index method to GLTFState 2023-05-27 12:30:25 -05:00
Aaron Franke 4017524363
Fix exporting MeshInstances without a Skeleton in the GLTF module 2023-05-27 03:41:31 -05:00
Rémi Verschelde cb711a9950
Merge pull request #76895 from aaronfranke/gltf-webp
Add support for extending GLTF with more texture formats and support WebP
2023-05-26 11:00:06 +02:00
Theraot 3b9bcadb9e Fix GLTFSkin binding for the godot_sking property 2023-05-23 19:28:06 -05:00
Aaron Franke 7da93a0bc0
Add support for extending GLTF with more texture formats & support WebP 2023-05-22 16:30:20 -05:00
Ninni Pipping 71ee65dc57 Enable shadow warnings and fix raised errors 2023-05-11 16:00:59 +02:00
Lyuma 72d131899b gltf: Permit sparse accessors without a bufferView. 2023-05-09 10:03:38 -07: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 8f7b09916d
Merge pull request #76026 from YuriSizov/editor-running-up-that-gui
Extract editor run toolbar into its own component
2023-04-26 12:15:29 +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
Yuri Sizov 8a74d8438f Extract editor run toolbar into its own component
- Simplify and update its logic.
- Simplify EditorScript.
- Improve EditorNode and other relevant includes.
- Fix scene-based path in the movie writer when
reloading a scene.
2023-04-19 17:12:28 +02: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
Yuri Sizov 4154039832 Improve includes of EditorNode (and everything else)
Also start organizing editor-specific GUI components
into a dedicated folder, `editor/gui`.
Also move `editor_file_server` next to the rest of debugger classes.
2023-04-07 18:59:49 +02:00
Aaron Franke 639b8e7dc7
Implement physics support in the GLTF module 2023-03-09 20:02:05 -06:00
juliuse98 7a0d12182e
Fix blend-file import when using custom color management in blender
When using custom color management in blender the --version command will
output additional information infront of the "normal" output and this
prevented the import.

Fixes #74439.
2023-03-06 22:36:03 +01:00
Rémi Verschelde 6941ffaef3
Merge pull request #74293 from akien-mga/fbx-dialog-disable-importer
FBX: Disable importer when canceling FBX2glTF setup
2023-03-06 10:55:21 +01:00
Hakim e14fa5532b Get the unlit / unshaded extension when importing GLTF and set it when exporting 2023-03-05 22:34:04 +01:00
Rémi Verschelde d81e6ee024
FBX: Disable importer when canceling FBX2glTF setup
Pretty hacky solution but it's better than an infinite loop.

All this import setup needs to be redone, it's very difficult to properly
bail out from an invalid import without triggering reimport loops.

Also fix underline not visible at default editor scale in LinkButton.

Fixes #73319.
2023-03-03 13:53:03 +01:00
Rémi Verschelde eaca689118
Merge pull request #74167 from aaronfranke/gltf-node-doc
Document GLTFNode and some of GLTFState
2023-03-03 11:06:39 +01:00
Rémi Verschelde 1c39cc5ff8
Merge pull request #74018 from Abdul-AZ/master
Fix glTF mesh importer not freeing nodes correctly on import
2023-03-02 11:24:39 +01:00
Aaron Franke 2cc22fb964
Document GLTFNode and some of GLTFState 2023-03-01 10:25:23 -06:00
Rémi Verschelde 1c1524a651
Bump version to 4.1-dev
Can't stop, won't stop, they said, huh?
2023-03-01 01:44:37 +01:00
Abdulrahman Al Zeidi 5e0641ea9a Fix glTF mesh importer not freeing nodes correctly on import 2023-02-27 02:44:23 +00:00
Aaron Franke 9a031806bd
GLTF: Delete unused skeleton_to_node 2023-02-26 15:16:31 -06:00
Rémi Verschelde fe08570ac5
Merge pull request #73667 from aaronfranke/gltf-unused-joint-bool
Remove unused joint boolean in GLTFNode
2023-02-21 08:47:15 +01:00
Aaron Franke 84658b47ca
Remove unused joint boolean in GLTFNode 2023-02-21 00:48:02 -06:00
Lyuma 1c090d37b4 fbx: Set base_dir correctly in append_from_scene 2023-02-20 16:32:27 -08:00
Rémi Verschelde 1f6a5426e2
Merge pull request #73345 from TokageItLab/gltfimport
Fix gltf import generate_scene() option
2023-02-15 09:53:22 +01:00
Silc Renew 4970c27ff5 Fix gltf import generate_scene() option 2023-02-15 17:43:34 +09: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
Rémi Verschelde 6e2b9b3bdc
Merge pull request #72802 from RedMser/blender-rpc-error-handling
Better error handling for Blender RPC import
2023-02-06 22:45:18 +01:00
RedMser 8f099c7de3 Better error handling for Blender RPC import
- If RPC import fails, then try a direct import as well. While it's
 slower, it may be better than failing the import completely.
- Connection errors will disable RPC automatically, to avoid having to
wait the full 30 seconds timeout each time.
  This should be properly fixed by allowing to override the timeout
per HTTPClient.
2023-02-06 18:23:20 +01: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
Rémi Verschelde c40020513a
Merge pull request #72440 from V-Sekai/gltf_embed_as_uncompressed
gltf: Add GLTFHandleBinary::HANDLE_BINARY_EMBED_AS_UNCOMPRESSED
2023-02-01 12:10:13 +01: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 9b0f194bbb
Fix blend runner copyright headers 2023-02-01 09:39:31 +01:00
Rémi Verschelde d29036bcda
Merge pull request #69319 from RedMser/blender-import-rpc
Batch import Blend files using XML RPC
2023-02-01 08:21:16 +01:00
Raul Santos 9e9eac4676
Use enum instead of int in virtual methods return type 2023-01-31 19:06:49 +01: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 518b9e5801
Add missing classref changes after #62942 2023-01-27 12:07:53 +01: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
Aaron Franke 208df30eeb
Improve the documentation of GLTFDocument's append methods 2023-01-15 14:27:08 -06: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
James Mintram 897de50d71 Update stale node ref after replace_by in GLTF importer 2023-01-01 20:14:33 +00:00
reduz e93d991329
Add a dialog for customizing FBX import
* If FBX files are found, a dialog will pop up asking to configure FBX2glTF.
* Dialog can also be accessed by going Editor -> Configure FBX Import.
* The dialog also shows a link to click to download the converter, which
  should contain instructions.
2022-12-18 01:08:54 +01:00
Quentin Guidée b14c87cb92
glTF: Fix export crash with a ShaderMaterial (fixes #70159) 2022-12-17 10:03:42 -05:00
RedMser ba388d09b4 Batch import Blend files using XML RPC
This improves performance when importing many Blender files, as it
avoids waiting for Blender to startup every time.
Old logic is still available by setting the RPC port setting to 0.
2022-12-15 18:27:02 +01: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
Eduard Zalyaev 627b9ca049 EditorSceneFormatImporterGLTF: check if "animation/trimming" parameter from import settings exists
Fixes godotengine#69625
2022-12-06 19:11:21 +03: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
trollodel c90d0bd84f Use forward-declarations in big editor classes 2022-11-29 09:59:43 +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
K. S. Ernest (iFire) Lee 5aafa3f54a Add GLTFDocument documentation.
Co-authored-by: Meow <mosesturner@protonmail.com>
Co-authored-by: Aaron Franke <arnfranke@yahoo.com>
2022-11-20 14:51:41 -08:00
Rémi Verschelde d5d83eefd3
Merge pull request #66026 from aaronfranke/gltf-extension
Change the way GLTFDocumentExtension classes are registered
2022-11-20 11:44:05 +01:00
trollodel ba9e619b51 Use forward-declarations in EditorPlugin where possible 2022-11-11 20:25:51 +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
Aaron Franke 83634119d4
Replace Quaternion Euler constructor with `from_euler` method 2022-11-01 09:28:12 -05:00
kobewi d06a8320e5 Simplify GDVIRTUAL_CALL calls 2022-10-19 00:05:48 +02:00
Aaron Franke a70dce893f
Add a way to store additional data in GLTFState and GLTFNode 2022-10-15 12:04:36 -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
Rémi Verschelde 75616d60e4 Merge pull request #66841 from jtnicholl/blend_enum_checks
Clean up .blend importer to fix unreachable code paths
2022-10-05 08:29:35 +02:00
Clay John 4b52c6caef
Merge pull request #59481 from LunaticInAHat/gltf_texture_filter_fix_4
Respect texture filtering when importing GLTF
2022-10-03 16:33:11 -07:00
The Tophat Demon c1a600545c GLTF imports & exports material texture filters 2022-10-03 16:20:08 -04:00