Commit graph

161 commits

Author SHA1 Message Date
Rémi Verschelde b5334d14f7
Update copyright statements to 2021
Happy new year to the wonderful Godot community!

2020 has been a tough year for most of us personally, but a good year for
Godot development nonetheless with a huge amount of work done towards Godot
4.0 and great improvements backported to the long-lived 3.2 branch.

We've had close to 400 contributors to engine code this year, authoring near
7,000 commit! (And that's only for the `master` branch and for the engine code,
there's a lot more when counting docs, demos and other first-party repos.)

Here's to a great year 2021 for all Godot users 🎆
2021-01-01 20:19:21 +01:00
Rémi Verschelde 4ca98c7a35
Merge pull request #44183 from madmiraal/box_shape-size
Use a size Vector for adjusting the size of Rectangles and Boxes
2020-12-28 16:06:50 +01:00
Marcel Admiraal 5b937d493f Rename empty() to is_empty() 2020-12-28 10:39:56 +00:00
K. S. Ernest (iFire) Lee 4b4efd2674 Add exporting glTF2.
* Support KHR_texture_transform.
* Support exporting glTF2
* Support exporting instanced scenes
* Extract into a gltf state and gltf document
* Add a tools menu for exporting gltf2
2020-12-22 16:56:28 -08:00
reduz 7bf90c7888 Improved shadow rendering efficiency
-Do not bind attributes that are not needed
-Improve a bit more how meshoptimizer interacts with Godot
2020-12-18 19:47:32 -03:00
reduz d2302f53d6 Implement automatic LOD (Level of Detail)
-Happens on import by default for all models
-Just works (tm)
-Biasing can be later adjusted per node or per viewport (as well as globally)
-Disabled AABB.get_support test because its broken
2020-12-18 15:48:03 +01:00
reduz 77a045e902 Rework Mesh handling on scene importing.
-Reworked how meshes are treated by importer by using EditorSceneImporterMesh and EditorSceneImporterMeshNode. Instead of Mesh and MeshInstance, this allows more efficient processing of meshes before they are actually registered in the RenderingServer.
-Integrated MeshOptimizer
-Reworked internals of SurfaceTool to use arrays, making it more performant and easy to run optimizatons on.
2020-12-13 21:29:51 -03:00
Marcel Admiraal 43c9106806 Use box size instead of extents for Shape dimensions 2020-12-08 11:58:21 +00:00
reduz 70f5972905 Refactored Mesh internals and formats.
-Changed how mesh data is organized, hoping to make it more efficient on Vulkan and GLES.
-Removed compression, it now always uses the most efficient format.
-Added support for custom arrays (up to 8 custom formats)
-Added support for 8 weights in skeleton data.
-Added a simple optional versioning system for imported assets, to reimport if binary is newer
-Fixes #43979 (I needed to test)

WARNING:

-NOT backwards compatible with previous 4.x-devel, will most likely never be, but it will force reimport scenes due to version change.
-NOT backwards compatible with 3.x scenes, this will be eventually re-added.
-Skeletons not working any longer, will fix in next PR.
2020-12-02 13:07:59 -03:00
lordkettune 4313a7bdc8 Fix issues with custom tracks on reimport 2020-07-02 16:08:20 -07:00
Sl3dge78 95cd74fc4b Fix #20467. The "Anim imported" warning gets displayed properly when working on imported anims. 2020-06-18 23:12:22 +02:00
Rémi Verschelde 0ee0fa42e6 Style: Enforce braces around if blocks and loops
Using clang-tidy's `readability-braces-around-statements`.
https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html
2020-05-14 21:57:34 +02:00
Rémi Verschelde 07bc4e2f96 Style: Enforce separation line between function definitions
I couldn't find a tool that enforces it, so I went the manual route:
```
find -name "thirdparty" -prune \
  -o -name "*.cpp" -o -name "*.h" -o -name "*.m" -o -name "*.mm" \
  -o -name "*.glsl" > files
perl -0777 -pi -e 's/\n}\n([^#])/\n}\n\n\1/g' $(cat files)
misc/scripts/fix_style.sh -c
```

This adds a newline after all `}` on the first column, unless they
are followed by `#` (typically `#endif`). This leads to having lots
of places with two lines between function/class definitions, but
clang-format then fixes it as we enforce max one line of separation.

This doesn't fix potential occurrences of function definitions which
are indented (e.g. for a helper class defined in a .cpp), but it's
better than nothing. Also can't be made to run easily on CI/hooks so
we'll have to be careful with new code.

Part of #33027.
2020-05-14 16:54:55 +02:00
Rémi Verschelde 0be6d925dc Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks
Which means that reduz' beloved style which we all became used to
will now be changed automatically to remove the first empty line.

This makes us lean closer to 1TBS (the one true brace style) instead
of hybridating it with some Allman-inspired spacing.

There's still the case of braces around single-statement blocks that
needs to be addressed (but clang-format can't help with that, but
clang-tidy may if we agree about it).

Part of #33027.
2020-05-14 16:54:55 +02:00
Hugo Locurcio 0d7b627936
Tweak the error message displayd when a post-import script fails
See #38662.
2020-05-11 21:11:17 +02:00
Juan Linietsky 1bea8e1eac New lightmapper
-Added LocalVector (needed it)
-Added stb_rect_pack (It's pretty cool, we could probably use it for other stuff too)
-Fixes and changes all around the place
-Added library for 128 bits fixed point (required for Delaunay3D)
2020-05-10 15:59:09 -03:00
Rémi Verschelde 69de7ce38c Style: clang-format: Disable AllowShortCaseLabelsOnASingleLine
Part of #33027.
2020-05-10 13:13:54 +02:00
JFonS f7dadc4796 Add caching the lightmap unwrapping on import
This commit adds caching to the lightmap mesh unwraps generated on
import. This speeds up re-imports of meshes that haven't changed and
also makes sure that the unwraps are consistent across imports.

The unwrapping process is not deterministic, so one could end up with
a different mapping every time the scene was imported, breaking any
previously baked lightmaps. The changes in this commit prevent that
from happening.
2020-04-22 15:34:00 +02:00
lupoDharkael 95a1400a2a Replace NULL with nullptr 2020-04-02 13:38:00 +02:00
Rémi Verschelde eaaee63b62 doc: Update classref with node renames
A few extra renames for classes which were missed in last week's PRs.
2020-03-30 18:23:02 +02:00
Rémi Verschelde d1acbbce7f Rename more 2D and 3D nodes to follow convention
Rename editor plugins to match the new node names.
2020-03-27 16:26:34 +01:00
Juan Linietsky eaae4b6408 Renamed 2D and 3D nodes to make their types explicit
Fixes #30736.
2020-03-27 14:54:04 +01:00
Rémi Verschelde cb282c6ef0 Style: Set clang-format Standard to Cpp11
For us, it practically only changes the fact that `A<A<int>>` is now
used instead of the C++03 compatible `A<A<int> >`.

Note: clang-format 10+ changed the `Standard` arguments to fully
specified `c++11`, `c++14`, etc. versions, but we can't use `c++17`
now if we want to preserve compatibility with clang-format 8 and 9.
`Cpp11` is still supported as deprecated alias for `Latest`.
2020-03-17 07:36:24 +01:00
Andrea Catania 2e0fb66c6f Renamed PlaneShape to WorldMarginShape 2020-02-27 17:45:16 +01:00
Andrea Catania 3b64ecbc4b Renamed NavigationMeshInstance to NavigationRegion 2020-02-27 17:42:53 +01:00
Juan Linietsky 33b5c57199 Variant: Added 64-bit packed arrays, renamed Variant::REAL to FLOAT.
- Renames PackedIntArray to PackedInt32Array.
- Renames PackedFloatArray to PackedFloat32Array.
- Adds PackedInt64Array and PackedFloat64Array.
- Renames Variant::REAL to Variant::FLOAT for consistency.

Packed arrays are for storing large amount of data and creating stuff like
meshes, buffers. textures, etc. Forcing them to be 64 is a huge waste of
memory. That said, many users requested the ability to have 64 bits packed
arrays for their games, so this is just an optional added type.

For Variant, the float datatype is always 64 bits, and exposed as `float`.

We still have `real_t` which is the datatype that can change from 32 to 64
bits depending on a compile flag (not entirely working right now, but that's
the idea). It affects math related datatypes and code only.

Neither Variant nor PackedArray make use of real_t, which is only intended
for math precision, so the term is removed from there to keep only float.
2020-02-25 12:55:53 +01:00
Juan Linietsky 9a34f39d32 Add support for named binds in Skin.
Helps better reutilization of skeletons from Maya exported files.
2020-02-21 09:40:29 -03:00
Juan Linietsky 867d073b98 Changed logic and optimized ObjectID in ObjectDB and Variant, removed RefPtr. 2020-02-15 08:36:04 -03:00
Juan Linietsky dd3682e5fe Modernized default 3D material, fixes material bugs. 2020-02-11 12:01:24 +01:00
Rémi Verschelde 4faaf6089a Remove unused #if 0'ed code 2020-01-21 21:41:54 +01:00
Rémi Verschelde a7f49ac9a1 Update copyright statements to 2020
Happy new year to the wonderful Godot community!

We're starting a new decade with a well-established, non-profit, free
and open source game engine, and tons of further improvements in the
pipeline from hundreds of contributors.

Godot will keep getting better, and we're looking forward to all the
games that the community will keep developing and releasing with it.
2020-01-01 11:16:22 +01:00
homer666 9d98ed1d86 Restore import animation storage checkbox behavior 2019-09-28 12:33:00 +10:00
Rémi Verschelde dec10dd776
Merge pull request #32051 from qarmin/some_error_explanation
Added some obvious errors explanations
2019-09-25 11:51:54 +02:00
qarmin 17732fe698 Added some obvious errors explanations 2019-09-25 10:28:50 +02:00
qarmin 50be65bf43 Changed some code found by Clang Tidy and Coverity 2019-09-22 18:45:08 +02:00
Rasmus Ketelsen 8dfe83406f Added the ability to import scene resources as .tres files 2019-08-27 15:21:20 +02:00
qarmin aab8da25ad Fix some code found by Coverity Scan and PVS Studio 2019-07-23 09:14:31 +02:00
qarmin 6cbaf7662f Changed some code showed in LGTM and Coverage 2019-07-20 08:09:57 +02:00
qarmin 4e5310cc60 Some code changed with Clang-Tidy 2019-06-26 15:08:25 +02:00
Rémi Verschelde c957e56741
Merge pull request #24286 from glaforte/bugfix/20878
Fixes the support of the 'keep on reimport' flag - Issue #20878.
2019-05-30 16:42:50 +02:00
Rémi Verschelde c51d2ed55c
Merge pull request #25480 from WindyDarian/scene_import_root_type_script_global_class_support
Support script global class (class_name) as root_type when importing a scene
2019-05-29 17:31:15 +02:00
Rémi Verschelde 7013607ef9
Merge pull request #28365 from fire/split_clip_blend_shapes
Modify ResourceImporterScene to split animations with blendshapes.
2019-05-06 16:58:29 +02:00
Rémi Verschelde 6ee5f7c881
Merge pull request #27453 from KoBeWi/glhf_scene_root
Use filename for scene root of imported models
2019-04-30 11:38:32 +02:00
homer666 106d1f3c3c Refresh import dock on change "animation/storage" 2019-04-29 11:38:45 +10:00
K. S. Ernest (iFire) Lee 342266d782 Modify ResourceImporterScene to split animations with blendshapes.
# Conflicts:
#	editor/import/resource_importer_scene.cpp
2019-04-23 17:25:44 -07:00
Juan Linietsky 5823b5d77d Bundled VHACD library for convex decomposition.
Modified both MeshInstance tools as well as importer to use it instead of QuickHull.
2019-04-10 17:47:28 -03:00
Tomasz Chabora 82fadde680 Use filename for scene root of imported models 2019-04-08 18:43:55 +02:00
Angeloss 40acc3ecdc Fix: Keep custom tracks option now keeps animation loop property and value track update mode.
(cherry picked from commit 589c5698a0)
2019-04-03 16:59:34 +02:00
Ilaria Cislaghi b6fe7a794d Importer for scenes only overrides the base Node if differently specified by the user 2019-03-02 13:31:11 +01:00
Juan Linietsky f669ebeeaf -Properly handle missing ETC support on export
-Added ability for resource importers to save metadata
-Added ability for resource importers to validate depending on project settings
2019-02-26 18:45:06 -03:00
marxin 8d51618949 Add -Wshadow=local to warnings and fix reported issues.
Fixes #25316.
2019-02-20 19:44:12 +01:00
Rémi Verschelde c5dcbeb160 Scene: Ensure classes match their header filename
Also drop some unused files.

Renamed:
- `scene/2d/navigation2d.h` -> `navigation_2d.h`
- `scene/2d/screen_button.h` -> `touch_screen_button.h`
- `scene/3d/scenario_fx.h` -> `world_environment.h`
- `scene/audio/audio_player.h` -> `audio_stream_player.h`
- `scene/resources/bit_mask.h` -> `bit_map.h`
- `scene/resources/color_ramp.h` -> `gradient.h`
- `scene/resources/shape_line_2d.h` -> `line_shape_2d.h`
- `scene/resources/scene_format_text.h` -> `resource_format_text.h`
- `scene/resources/sky_box.h` -> `sky.h`

Dropped:
- `scene/resources/bounds.h`
2019-02-12 17:21:48 +01:00
Windy Darian c478f30321 Support script global class (class_name) when importing a scene
We could already choose a script global class for root_type at scene import config. However, it would fall back to default Spatial if a script global class is chosen. This will make sure the base type for the script class is used, and the script to root node is attached upon import.
2019-01-29 23:25:57 -05:00
Rémi Verschelde b16c309f82 Update copyright statements to 2019
Happy new year to the wonderful Godot community!
2019-01-01 12:58:10 +01:00
Guillaume Laforte d09ccf6f81 Fixes the support of the 'keep on reimport' flag - Issue #20878. 2018-12-11 08:56:36 -05:00
Juan Linietsky e0871b0f52 Baker fixes 2018-10-07 11:18:44 -03:00
Rémi Verschelde 277b24dfb7 Make core/ includes absolute, remove subfolders from include path
This allows more consistency in the manner we include core headers,
where previously there would be a mix of absolute, relative and
include path-dependent includes.
2018-09-12 09:52:22 +02:00
Rémi Verschelde 52466d57e9 Make some debug prints verbose-only, remove others 2018-08-24 14:59:01 +02:00
Hein-Pieter van Braam 0e29f7974b Reduce unnecessary COW on Vector by make writing explicit
This commit makes operator[] on Vector const and adds a write proxy to it.  From
now on writes to Vectors need to happen through the .write proxy. So for
instance:

Vector<int> vec;
vec.push_back(10);
std::cout << vec[0] << std::endl;
vec.write[0] = 20;

Failing to use the .write proxy will cause a compilation error.

In addition COWable datatypes can now embed a CowData pointer to their data.
This means that String, CharString, and VMap no longer use or derive from
Vector.

_ALWAYS_INLINE_ and _FORCE_INLINE_ are now equivalent for debug and non-debug
builds. This is a lot faster for Vector in the editor and while running tests.
The reason why this difference used to exist is because force-inlined methods
used to give a bad debugging experience. After extensive testing with modern
compilers this is no longer the case.
2018-07-26 00:54:16 +02:00
Max Hilbrunner 43a2e9e669
Merge pull request #15881 from dertom95/EditorScenePostImport
EditorScenePostImport: added get_source_folder() and get_source_file(…
2018-07-05 02:27:26 +02:00
Juan Linietsky c02d8be59d further fixes to tag detection on importer 2018-07-02 05:54:58 -03:00
Juan Linietsky beebd0b9de Add a condition to detect duplicates objects, so cases like object-col.323, common in blender, is still detected as collision. 2018-07-02 02:02:32 -03:00
Juan Linietsky 896e250f2b -Fix in animationplayback, sound would be cut on loop
-Fix on scene importer, keeping changes to animation tracks was not working
2018-07-01 17:45:19 -03:00
Thomas Trocha 48e3ff0c8a EditorScenePostImport: added get_source_folder() and get_source_file() methods 2018-05-31 03:23:42 +02:00
Hugo Locurcio 1c419531a0 Change ".." punctuation for "..." in editor strings (#16507) 2018-04-22 19:36:01 +02:00
Juan Linietsky 1322ca6fb2 Ability to import .escn files, which is just a .tscn but with forced import.
This works together with the new Blender to Godot exporter.
2018-01-30 11:04:22 -03:00
Rémi Verschelde e4213e66b2 Add missing copyright headers and fix formatting
Using `misc/scripts/fix_headers.py` on all Godot files.
Some missing header guards were added, and the header inclusion order
was fixed in the Bullet module.
2018-01-05 01:22:23 +01:00
Rémi Verschelde b50a9114b1 Update copyright statements to 2018
Happy new year to the wonderful Godot community!
2018-01-01 14:40:47 +01:00
Juan Linietsky 3de20641f5 Property install export templates when downloaded from http
added a scale parameter for scene import
2017-12-17 15:48:24 -03:00
Juan Linietsky fa8a1fc420 Fixes how transform is applied to geometry in UV unwrap 2017-12-17 12:04:54 -03:00
Rémi Verschelde 8f25a2dc11 Cleanup some #if 0'd code 2017-12-17 15:40:24 +01:00
Juan Linietsky f3ad14224e -Add lightmapper
-Fixes to unwrapper (remove degenerates), makes Thekla not crash
-Added optional cancel button in EditorProgress
-Added function to force processing of events (needed for cancel button)
2017-12-14 09:01:27 -03:00
Juan Linietsky 65fb961b8b -Ability to and unwrap lightmap coordinates on import
-Added unwrap functionality to Mesh
-Ability to display and debug mesh UVs
-Added multiline draw, so it's easier and faster to draw UVs
-Many fixes to SurfaceTool
-Fixes to Thekla Unwrap, but it's a piece of ass and it keeps crashing. Will have to go away
2017-12-09 14:18:14 -03:00
Juan Linietsky 209cb3830c Exposed EditorSceneImporter to script. Added APIs to use intermediate converters more easily. 2017-12-07 15:44:20 -03:00
Juan Linietsky 5614902611 ability to keep user tracks when importing animations, closes #12801 2017-12-07 10:19:35 -03:00
Juan Linietsky 9738ebcda0 -Fixed height fog (was broken)
-Make sure materials are named in OBJ importer, so they can be saved outside as resources.
2017-11-25 12:32:41 -03:00
Juan Linietsky 66a8a07c2c Add importer option to make meshes bakeable by default. 2017-11-25 01:29:35 -03:00
Rémi Verschelde 91349290dc
Merge pull request #12717 from NathanWarden/material_import_fix
Fixed a bug where materials and/or meshes weren't assigned to scene on first import.
2017-11-20 09:13:36 +01:00
Ferenc Arn d28763a4c1 Rename Rect3 to AABB.
Fixes #12973.
2017-11-17 11:01:41 -05:00
Saracen f8a95499bd Added 'convcol' flag for importing meshes as convex collision and completed code
for parsing collision flags to mesh data.
2017-11-16 13:06:30 +00:00
Nathan Warden 400db80d25 Fixed a bug where materials weren't assigned to scene on first import. 2017-11-07 00:06:11 -05:00
Saracen ef90965883 Restores functionality of the use_compression flag in the Collada importer. 2017-11-01 00:01:24 +00:00
Leon Krause 0899b5029c Correct spelling SEPERATE -> SEPARATE to fix build 2017-09-21 03:29:26 +02:00
Juan Linietsky 423ca9bcaf Fix import order, so scenes are imported after textures.
Also fix bugs when meshes are always generated.
2017-09-20 21:04:20 -03:00
Indah Sylvia 13b630eb0c Fixed Typo: 'Seperate' to 'Separate' 2017-09-19 15:51:00 +07:00
Hein-Pieter van Braam 2648e50779 Merge pull request #11066 from SaracenOne/animation_external_resources
Allow animations to be saved to external files during scene import.
2017-09-12 14:28:48 +02:00
Rémi Verschelde cf941fdc35 Merge pull request #11026 from hpvb/fix-assign-in-if
Remove assignment and declarations in if statements
2017-09-12 11:57:49 +02:00
SaracenOne f95edd3be9 Allow animations to be saved to external files during scene import. 2017-09-11 06:59:03 +01:00
Hein-Pieter van Braam 8230bf0a2f Remove assignment and declarations in if statements
After discussing with @reduz and @akien-mga it was decided that we do
not allow assignments or declarations in if statements. This PR removes
the instances of this I could find by automated means.
2017-09-08 14:59:15 +02:00
Hein-Pieter van Braam 67a706fc1b Fix various assorted warnings
Fix various warnings that don't have enough instances to merit
individual commits. Also fixes a potential bug in audio_server.cpp.
2017-09-08 14:57:48 +02:00
Juan Linietsky d39e79e7ec Fix issues regarding reload of resources in imported scenes. Closes #10017 2017-08-31 18:57:44 -03:00
Juan Linietsky efcafab625 Changed defaults, as it seems to be obviousy better to keep materials outside by default.. 2017-08-29 21:54:26 -03:00
Rémi Verschelde 7ad14e7a3e Dead code tells no tales 2017-08-27 22:13:45 +02:00
Rémi Verschelde bd282ff43f Use HTTPS URL for Godot's website in the headers 2017-08-27 14:16:55 +02:00
Juan Linietsky 1894157c9f -Massive clean up to gizmos
-Make sure handles are always visible (on top)
-Fixed instanced scene selection (should work properly now)
-Added interpolated camera
-Customizable gizmo colors in editor settings
2017-08-26 00:47:28 -03:00
Hein-Pieter van Braam cacced7e50 Convert Object::cast_to() to the static version
Currently we rely on some undefined behavior when Object->cast_to() gets
called with a Null pointer. This used to work fine with GCC < 6 but
newer versions of GCC remove all codepaths in which the this pointer is
Null. However, the non-static cast_to() was supposed to be null safe.

This patch makes cast_to() Null safe and removes the now redundant Null
checks where they existed.

It is explained in this article: https://www.viva64.com/en/b/0226/
2017-08-24 23:08:24 +02:00
Hein-Pieter van Braam 3894f20d98 Remove an assignment to self
This line does a = a and has a FIXME line. It seems that reduz can't
think of a reason for it either, so here it goes.
2017-08-23 23:51:37 +02:00
Juan Linietsky e61d547ed0 Make sure local to scene resources are initialized after loading all nodes, fixes #9438 2017-08-18 08:26:41 -03:00
Juan Linietsky 33c1d25517 Several improvements and fixes to import system. Might fix many issues opened, but have to check in detail.. 2017-08-17 17:18:50 -03:00
Poommetee Ketson 023321d59e ResourceImporterScene: fix 'bult' typo 2017-08-08 11:11:14 +07:00