Commit Graph

248 Commits

Author SHA1 Message Date
Aaron Franke 133e5d197b
Don't try to read values from null cameras and lights in GLTF 2022-09-04 09:52:25 -05:00
Rémi Verschelde 3a62c294c7 Merge pull request #65170 from KoBeWi/your_argument_is_TypedArray 2022-09-02 13:57:02 +02:00
Jonathan Nicholl 15d057c521 Add `is_zero_approx` methods to `Vector2`, `3`, and `4` 2022-09-02 00:29:50 -04:00
kobewi 7adc8376ed Change Array arguments to TypedArray 2022-09-01 13:13:19 +02:00
Rémi Verschelde 432b25d364
Merge pull request #65066 from aaronfranke/str-path-join 2022-08-30 10:01:11 +02:00
Aaron Franke 10a56981dc
Rename String `plus_file` to `path_join` 2022-08-29 19:38:13 -05:00
Aaron Franke 03cd8097e1
Move GLTF camera conversion code into GLTFCamera 2022-08-28 11:18:32 -05:00
Aaron Franke 3d76b91229
Move GLTF light conversion code into GLTFLight 2022-08-28 11:18:22 -05:00
Micky ef5b9a06a9 Rename `hint_tooltip` to `tooltip_text` & setget
`hint_tooltip` -> `tooltip_text`
`set_tooltip` -> `set_tooltip_text`
`_get_tooltip` -> `get_tooltip_text`

Updates documentation, too.
2022-08-27 01:35:01 +02:00
Micky 59e11934d8 Rename `str2var` to `str_to_var` and similar
Affects the Math class, a good chunk of the audio code, and a lot of other miscellaneous classes, too.

- `var2str` -> `var_to_str`
- `str2var` -> `str_to_var`
- `bytes2var` -> `bytes_to_var`
- `bytes2var_with_objects` -> `bytes_to_var_with_objects`
- `var2bytes` -> `var_to_bytes`
- `var2bytes_with_objects` -> `var_to_bytes_with_objects`
- `linear2db` -> `linear_to_db`
- `db2linear` -> `db_to_linear`
- `deg2rad` -> `deg_to_rad`
- `rad2deg` -> `rad_to_deg`

- `dict2inst` -> `dict_to_inst`
- `inst2dict` -> `inst_to_dict`
2022-08-26 14:58:22 +02:00
Jonathan Nicholl 6ff41a3fcd Fix Blender file path check to require a directory 2022-08-24 16:08:01 -04:00
kobewi f7f4873ed0 Replace Array return types with TypedArray 3 2022-08-24 12:53:36 +02:00
Jonathan Nicholl d24b65b363 Update messages for missing FBX2glTF, add similar messages for Blender 2022-08-22 20:30:33 -04:00
Rémi Verschelde 09b012a409
Merge pull request #64400 from aaronfranke/gltf-fix-camera 2022-08-22 22:23:08 +02:00
rafallus da7a5653f4 Expose Basis `set_orthogonal_index` method as a GridMap function 2022-08-20 21:42:20 -05:00
Aaron Franke be81b33e2b
GLTF: Fix orthographic cameras, internally store data in GLTF's format 2022-08-14 19:18:53 -05:00
Aaron Franke 3bbb50359d
Document GLTFLight and GLTFSpecGloss 2022-08-14 14:57:58 -05:00
Hakim 805ffdfbf6 Prevent AnimationPlayer from being added on GLTF import if the option is unchecked. Fixes #63954 2022-08-10 11:17:29 +02:00
Yuri Sizov c5d7115038 Rename the argument tag to param in XML documentation 2022-08-08 22:34:31 +03:00
Aaron Franke ce0080768c
Make "Godot source files" comment consistent in modules 2022-08-05 17:09:11 -05:00
Rémi Verschelde 602e967ba8
Merge pull request #55943 from jvanmourik/master
glTF animation parsing: Changed the 'loop' and 'cycle' animation name keywords to be case-insensitive
2022-07-31 17:28:43 +02:00
Rémi Verschelde 90019676b0 Code quality: Fix header guards consistency
Adds `header_guards.sh` bash script, used in CI to validate future
changes. Can be run locally to fix invalid header guards.
2022-07-25 11:17:40 +02:00
Rémi Verschelde 3084a48ace
Merge pull request #63219 from reduz/implement-vector4-projection 2022-07-25 11:13:27 +02:00
Aaron Franke 7b8f9a0e8e
GLTF: Organize structures into a subfolder 2022-07-24 17:16:51 -05:00
Rémi Verschelde a1f0ea5d19
Merge pull request #63409 from V-Sekai/gltf-export 2022-07-25 00:03:38 +02:00
K. S. Ernest (iFire) Lee b2bd4cc792 Mend duplicate nodes in the gltf export. 2022-07-24 14:38:57 -07: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
Aaron Franke 6887b3f8ee
GLTF: Only list used extensions when they're actually used 2022-07-23 21:59:16 -05:00
reduz 455c06ecd4 Implement Vector4, Vector4i, Projection
Implement built-in classes Vector4, Vector4i and Projection.

* Two versions of Vector4 (float and integer).
* A Projection class, which is a 4x4 matrix specialized in projection types.

These types have been requested for a long time, but given they were very corner case they were not added before.
Because in Godot 4, reimplementing parts of the rendering engine is now possible, access to these types (heavily used by the rendering code) becomes a necessity.

**Q**: Why Projection and not Matrix4?
**A**: Godot does not use Matrix2, Matrix3, Matrix4x3, etc. naming convention because, within the engine, these types always have a *purpose*. As such, Godot names them: Transform2D, Transform3D or Basis. In this case, this 4x4 matrix is _always_ used as a _Projection_, hence the naming.
2022-07-23 14:00:01 +02:00
bruvzg 8823eae328
Rename OSX to macOS and iPhoneOS to iOS. 2022-07-21 09:37:52 +03:00
Rémi Verschelde b942c1ffe3
Merge pull request #62827 from fire-forge/ok-cancel
Add `ok_button_text` to AcceptDialog and `cancel_button_text` to ConfirmationDialog
2022-07-13 14:10:38 +02:00
FireForge e4067064ce Add ok_button_text to AcceptDialog and cancel_button_text to ConfirmationDialog 2022-07-09 10:47:08 -05:00
kobewi d2900429e8 Add static methods for creating Image and ImageTexture 2022-07-08 13:40:47 +02:00
PZerua aa7ab96e71 Fix light intensity and attenuation import from GLTF 2022-07-05 19:48:01 +02:00
Rémi Verschelde e72f3abe2f glTF: Fix a couple typos in warnings on image parsing 2022-07-03 02:55:31 +02:00
Rémi Verschelde 9923851370 Fix typos with codespell
Using codespell 2.2-dev from current git.
2022-05-23 21:32:19 +02: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
Rémi Verschelde 84f64ddde9
Merge pull request #60723 from reduz/refactor-module-initialization 2022-05-04 19:08:43 +02:00
reduz de0ca3b999 Refactor module initialization
* Changed to use the same stages as extensions.
* Makes the initialization more coherent, helping solve problems due to lack of stages.
* Makes it easier to port between module and extension.
* removed the DRIVER initialization level (no longer needed).
2022-05-04 17:34:51 +02:00
Aaron Franke fa7a7795f0
Rename Basis get_axis to get_column, remove redundant methods 2022-05-03 09:37:47 -05:00
Rémi Verschelde d22850234c
Merge pull request #59393 from techiepriyansh/move-gltf-export-under-scene-menu 2022-04-27 11:51:49 +02:00
K. S. Ernest (iFire) Lee 44b6ee001e Discard images from gltf import for the animation library.
This is an optimization.
2022-04-23 17:41:34 -07:00
Rémi Verschelde 970debed93
Merge pull request #60177 from reduz/animation-library-import
Import scenes as AnimationLibrary
2022-04-13 22:47:54 +02:00
reduz 66009318e0 Import scenes as AnimationLibrary
Added the ability to import scenes as AnimationLibrary

* Completes implementation of https://github.com/godotengine/godot-proposals/issues/4296
* Helps if you want to export animations to a separate file (say a GLTF) to avoid re-importing/exporting them every time the model changes.
* Helps if you simply want to have animations using a dummy model, which can be shared across multiple models.

Creates a secondary scene importer used only for animations.

**NOTE**: A new flag for scene importer: EditorSceneFormatImporter.IMPORT_DISCARD_MESHES_AND_MATERIALS has been added, to hint importers that they should skip meshes and animations (and hence make importing faster). It is not implemented in any importer yet, this should be done in a separate PR.
2022-04-13 15:06:56 +02:00
Rémi Verschelde 46ef52162e Color: Rename `to_srgb`/`to_linear` to include base color space
This helps reduce confusion around sRGB <> Linear conversions by making
both input and output color spaces explicit.
2022-04-13 11:45:52 +02:00
Priyansh Rathi 0ea7780e33
move gltf export under scene menu 2022-04-12 19:42:41 +05:30
Rémi Verschelde 4ab86c6731
Merge pull request #59980 from reduz/animation-libraries 2022-04-11 14:18:35 +02:00
reduz 6f401439f8 Implement Animation Libraries
* Instead of containing single animations, AnimationPlayer now contains libraries.
* Libraries, in turn, contain the animations.

This paves the way for implementing the possibility of importing scenes as animation libraries, finally allowing to import animations separate from the 3D models.

Missing (will be done on separate PRs):

* Make it possible to import scenes (dae/fbx/gltf) as animation libraries.
* Make it possible for AnimationTree to import animation libraries on its own, so it does not rely on AnimationPlayer for everything.
2022-04-11 12:51:54 +02:00
bruvzg 9381acb6a4
Make FileAccess and DirAccess classes reference counted. 2022-04-11 13:28:51 +03:00
Rémi Verschelde d4b54e35f9 Fix path handling in FBX and Blend importers
Fixes #59996.
2022-04-07 23:33:28 +02:00
Marc Gilleron 277825e956 Initialize pointer variables to fix random crash on startup.
`configure_blender_dialog` is lazily created if equal to null,
however nothing really sets it to null.
2022-04-03 23:21:29 +01:00
Rémi Verschelde 4263f02f28
Merge pull request #59764 from reduz/blender-import-autodetect 2022-04-01 11:42:05 +02:00
reduz e32215fbad Add Blender install autodetection and configuration.
This PR is a continuation to #54886

* Changed Blender path editor setting from binary to installation.
* Add a class to query whether the format is supported.
* This class allows to create proper editors to configure support.

**NOTE**: This PR only provides autodetection on Linux. Code needs to be added for Windows and MacOS to autodetect the Blender installation.

Co-authored-by: bruvzg <7645683+bruvzg@users.noreply.github.com>
Co-authored-by: Pedro J. Estébanez <pedrojrulez@gmail.com>
2022-04-01 11:01:12 +02:00
Rémi Verschelde 340ad7d748
Merge pull request #59755 from V-Sekai/import-gltf-mat-placeholder 2022-04-01 01:12:16 +02:00
K. S. Ernest (iFire) Lee d8b3d14d82 Add support for Blend importing of material placeholders.
Couldn't get the 'NONE' option to work.
2022-03-31 10:11:06 -07:00
K. S. Ernest (iFire) Lee b675a6b9de Allow importing punctual lights from Blend. 2022-03-31 09:34:12 -07:00
K. S. Ernest (iFire) Lee 0a6889d834 Add fbx2gltf support for importing .fbx files
Lets you drag or place .fbx files in the project folder and it will import the files.

An editor setting sets the location of the fbx2gltf binary.

Enables .fbx and .blend by default.

Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
2022-03-30 15:22:46 +02: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
Rémi Verschelde 45ec0e31c3 Remove last editor code dependencies in template build
SConstruct change also makes it possible to outright delete the `editor`
folder in a `tools=no` build, which we use in CI to ensure no invalid
cross-dependencies are added.
2022-03-28 21:13:01 +02:00
Rémi Verschelde 5fe6984639 Modules: Don't build editor-specific classes in templates
They're moved to an `editor` subfolder so that we can easily handle them
separately.
2022-03-28 16:48:15 +02:00
Adam Scott 5e6d4baa48 Add GLTF, DAE and FBX importers enforcement for blend shape mask array 2022-03-24 17:15:23 -04:00
Lyuma 35b964606e glTF export for new TYPE_BLEND_SHAPE tracks 2022-03-03 05:28:00 -08:00
Haoyu Qiu c798f98779 Fix GLTF exporter crash when using GridMap 2022-02-20 21:52:04 +08:00
Fazil Babu 771170e7b0 Default material is assigned to meshes without material for glTF export 2022-02-16 20:19:19 +05:30
Rémi Verschelde 78a767edb3
Merge pull request #35679 from Calinou/doc-add-xml-schema 2022-02-15 13:14:58 +01:00
Hugo Locurcio b68dd2e189
Add an XML schema for documentation
This makes it easier to spot syntax errors when editing the
class reference. The schema is referenced locally so validation
can still work offline.

Each class XML's schema conformance is also checked on GitHub Actions.
2022-02-15 00:03:31 +01:00
trollodel cd1d7294d8 Remove the EditorNode parameter from EditorPlugins create methods
Remove EditorNode usage from the Navigation editor plugin.
2022-02-14 18:21:42 +01:00
trollodel 05b56f316d Remove most EditorNode constructor parameters and fields 2022-02-14 14:16:24 +01:00
Rémi Verschelde 7a7fabe4f6
Merge pull request #57641 from Geometror/compilation-time-improvements-1 2022-02-12 09:46:02 +01:00
Hendrik Brucker b396fd4eef Improve compilation speed (forward declarations/includes cleanup) 2022-02-12 02:46:22 +01:00
Fazil Babu 92f4c33492 CSG Meshes can be exported as glTF 2022-02-11 22:48:28 +05:30
Rémi Verschelde 1bdb82c64e
Fix typos with codespell
Using codespell 2.2-dev from current git.

Added `misc/scripts/codespell.sh` to make it easier to run it once in a
while and update the skip and ignore lists.
2022-02-10 12:30:19 +01:00
Rémi Verschelde 90162851a7
Core: Move generated `VERSION_HASH` to a `.cpp` file
This lets us have its definition in `core/version.h` and avoid
rebuilding a handful of files every time the commit hash changes.
2022-02-09 09:20:17 +01:00
Fabio Alessandrelli d219547c96 [Net] New replication interface, spawner and synchronizer nodes.
Initial implementation of the MultiplayerReplicationInterface and its
default implementation (SceneReplicationInterface).

New MultiplayerSpawner node helps dealing with instantiation of scenes
on remote peers (e.g. clients).
It supports both custom spawns via a `_spawn_custom` virtual function,
and optional auto-spawn of known scenes via a TypedArray<PackedScenes>
property.

New MultiplayerSynchornizer helps synchronizing states between the local
and remote peers, supports both sync and spawn properties and is
configured via a `SceneReplicationConfig` resource.
It can also sync via path (i.e. without being spawned by a
MultiplayerSpawner if both peers has it in tree, but will not send the
spawn state in that case, only the sync one.
2022-02-04 14:56:30 +01:00
Anilforextra adbe948bda String: Add contains(). 2022-02-04 01:28:02 +05:45
Paweł Fertyk 12d0ff1a4d Issue 57130 Fix GLTFDocument.generate_scene if state is null 2022-01-25 00:48:12 +01:00
K. S. Ernest (iFire) Lee b468104842 Skip Draco-compressed glTF 3d format files. 2022-01-08 10:14:46 -08:00
kobewi 9e095bb68b Fix some more wrong node names 2022-01-07 00:27:20 +01:00
Rémi Verschelde 3662105f8b
Merge pull request #56479 from V-Sekai/import-options 2022-01-05 20:44:42 +01:00
Rémi Verschelde 118f6d42ac
Merge pull request #56380 from RedMser/export_gltf_normal_crash 2022-01-05 10:46:32 +01:00
Rémi Verschelde c6bd3ca191
Merge pull request #56290 from nikitalita/fix-gltf-mesh-prims 2022-01-05 10:34:08 +01:00
K. S. Ernest (iFire) Lee 07a39684a0 options dict is now passed to _import_scene. 2022-01-05 01:07:54 -08:00
K. S. Ernest (iFire) Lee 5ce54ce142
Merge pull request #52541 from V-Sekai/gltf-load-scene-buffer
Add gltf import buffer.
2022-01-04 12:12:09 -08:00
K. S. Ernest (iFire) Lee d8923d8c74 Add import glb from buffer
Split functions from gltf document import and export into six functions.

Use base path to allow two code paths based on an empty base path or a full base path.

Add uri decode in _parse_buffers.
2022-01-04 06:06:03 -08:00
Rémi Verschelde fe52458154
Update copyright statements to 2022
Happy new year to the wonderful Godot community!
2022-01-03 21:27:34 +01:00
RedMser 0e36d5e782 Fix glTF scene export crash on null normal texture
Also removes a redundant get_texture call directly below
the modified code block.

Fixes #56379
2021-12-31 17:45:03 +01:00
nikitalita f34ea3873e FIX GLTF Document mesh primitive conversions 2021-12-27 17:36:58 -08:00
jvanmourik 4070f55ff0 glTF animation parsing: Changed the 'loop' and 'cycle' animation name keywords to be case-insensitive 2021-12-15 01:25:30 +01:00
Aaron Franke 368c0bc0ac
Misc build system fixes 2021-12-10 12:14:27 -06:00
Aaron Franke e9808e3d9a
Add a double-precision editor build to CI 2021-12-09 09:52:48 -06:00
Hugo Locurcio 89ec3d3bc7
Remove or make verbose some debugging prints
The message about SpatialMaterial conversion was turned into a warning,
as it can potentially interfere with porting projects from Godot 3.x
(if there's a bug in the conversion code).
2021-12-05 23:22:23 +01:00
jitspoe 8f433a1f53 Fix crash when exporting meshes to gltf that have no skin. 2021-11-22 22:40:47 -05:00
Rémi Verschelde 88c4380737
Modules: Make sure to include modules_enabled.gen.h where needed 2021-11-12 13:42:58 +01:00
Rémi Verschelde 06a33e590f
Merge pull request #53819 from TokageItLab/re-implement-ping-pong
Reimplement ping-pong animation and reverse playback
2021-11-09 22:11:04 +01:00
Rémi Verschelde a2803f3d86
Merge pull request #54072 from KoBeWi/hrcr_is_ded 2021-11-03 17:31:48 +01:00
Silc 'Tokage' Renew 953a7bce7e reimplement ping-pong 2021-11-03 13:39:33 +09:00
Lyuma de93d48901 glTF: Fix override materials and non-empty arrays
Keep track of MeshInstance and GeometryInstance override materials in the GLTFMesh object.
Ensure all arrays are non-empty to conform with "minItems":1 in glTF spec.
2021-11-01 23:22:45 -07:00
Rémi Verschelde 0ae65472e7
clang-format: Enable `BreakBeforeTernaryOperators`
clang-format keeps breaking the way it handles break *after* ternary operators,
so I give up and go with the only style they seem to actually test.
2021-10-28 15:57:41 +02:00