Commit Graph

217 Commits

Author SHA1 Message Date
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
Jonathan Nicholl 2830e276b8 Clean up .blend importer to fix unreachable code paths 2022-10-03 14:48:36 -04:00
Jonathan Nicholl 3086b1b79d Fix visibility filtering options for .blend imports 2022-10-02 11:11:04 -04:00
Rémi Verschelde 39facb35a0 SCons: Unify tools/target build type configuration
Implements https://github.com/godotengine/godot-proposals/issues/3371.

New `target` presets
====================

The `tools` option is removed and `target` changes to use three new presets,
which match the builds users are familiar with. These targets control the
default optimization level and enable editor-specific and debugging code:

- `editor`: Replaces `tools=yes target=release_debug`.
  * Defines: `TOOLS_ENABLED`, `DEBUG_ENABLED`, `-O2`/`/O2`
- `template_debug`: Replaces `tools=no target=release_debug`.
  * Defines: `DEBUG_ENABLED`, `-O2`/`/O2`
- `template_release`: Replaces `tools=no target=release`.
  * Defines: `-O3`/`/O2`

New `dev_build` option
======================

The previous `target=debug` is now replaced by a separate `dev_build=yes`
option, which can be used in combination with either of the three targets,
and changes the following:

- `dev_build`: Defines `DEV_ENABLED`, disables optimization (`-O0`/`/0d`),
  enables generating debug symbols, does not define `NDEBUG` so `assert()`
  works in thirdparty libraries, adds a `.dev` suffix to the binary name.

Note: Unlike previously, `dev_build` defaults to off so that users who
compile Godot from source get an optimized and small build by default.
Engine contributors should now set `dev_build=yes` in their build scripts or
IDE configuration manually.

Changed binary names
====================

The name of generated binaries and object files are changed too, to follow
this format:

`godot.<platform>.<target>[.dev][.double].<arch>[.<extra_suffix>][.<ext>]`

For example:
- `godot.linuxbsd.editor.dev.arm64`
- `godot.windows.template_release.double.x86_64.mono.exe`

Be sure to update your links/scripts/IDE config accordingly.

More flexible `optimize` and `debug_symbols` options
====================================================

The optimization level and whether to generate debug symbols can be further
specified with the `optimize` and `debug_symbols` options. So the default
values listed above for the various `target` and `dev_build` combinations
are indicative and can be replaced when compiling, e.g.:

`scons p=linuxbsd target=template_debug dev_build=yes optimize=debug`
will make a "debug" export template with dev-only code enabled, `-Og`
optimization level for GCC/Clang, and debug symbols. Perfect for debugging
complex crashes at runtime in an exported project.
2022-09-26 16:31:46 +02:00
Rémi Verschelde 49fcf4ffad Style: Cleanup header guards for consistency
Fix file names for {Static,Lightmap}RaycasterEmbree.
2022-09-26 13:51:17 +02: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
Aaron Franke afe09ec914
Minor enhancements to the GLTF module (lights and docs) 2022-09-18 22:33:21 -05:00
Rémi Verschelde fc61fa3baa
Merge pull request #65611 from Sarfraz-droid/Issue65602 2022-09-13 10:43:16 +02:00
Rémi Verschelde 1513d76cb9 Fix some errors affecting the Web editor
- Don't warn about minimized/maximized modes not being available.
- Blender and FBX export both depend on running thirdparty applications,
  which can't be done (easily at least) for Web and Android editors.
- Editor theme complained about not being able to retrieve texture data
  for an icon. It was only used once so instead of flipping at runtime,
  let's just add a flipped icon.

Part of #65702.
2022-09-12 16:29:45 +02:00
Sarfraz 177f2a8419 Fix gltf 8 bone weights condition to check for the second joint array
size.
2022-09-10 23:54:20 +05:30
Micky 694190a354 Rename TileMap/GridMap.`world_to_map` and opposite to `local_to_map`
For both TileMap and GridMap:
- `world_to_map` -> `local_to_map`
- `map_to_world` -> `map_to_local`

Also changes any mention of "world" in this context to "local" to avoid future confusion.

Finally, updates the docs of both methods for consistency.
In particular, adding a note on how to convert the returned values from local to global coordinates and vice versa.
2022-09-05 18:08:39 +02:00
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