Commit Graph

134 Commits

Author SHA1 Message Date
6af4ef019c Revert follow-ups to #102313 before reverting that PR
This reverts the following commits:

- cd6e5ba9f4
- d36a3e5c06
- f2c6d16290
- aae51963ef
2025-06-21 00:04:39 +02:00
b0dc2b4e50 Merge pull request #107630 from gongpha/crash!-generating-thumbnails-for-invalid-scenes
Add null check on generating thumbnails for PackedScene
2025-06-18 18:14:07 -05:00
ab14669425 Merge pull request #107676 from daniel080400/fix_issue_107667
Do not remove ```SubViewport``` nodes in thumbnail preview scene
2025-06-18 18:13:40 -05:00
cd6e5ba9f4 Do not remove subviewport nodes in thumbnail preview scene 2025-06-19 01:31:15 +08:00
d36a3e5c06 Add null check on generating thumbnails for PackedScene 2025-06-17 20:04:33 +07:00
f2c6d16290 Avoid manipulating PackedScene cache when generating scene thumbnails 2025-06-14 18:11:37 +08:00
08343189dc Rework scene preview thumbnails 2025-05-31 16:57:51 +08:00
1384e82c2c Improve ScriptLanguage get keyword API. 2025-05-17 18:43:19 +08:00
94282d88f9 Core: Use Math namespace for constants 2025-04-10 16:29:30 -05:00
6f25babd6b Remove empty constructors and destructors from editor/ 2025-03-17 21:20:02 +01:00
3084ed4bff editor: Fix AtlasTexture editor previews for compressed textures 2025-02-09 06:40:05 +11:00
a1846b27ea Improve use of Ref.is_null/valid
Use `is_null` over `!is_valid` and vice versa.
2024-12-23 16:35:02 -05:00
f241c1fda0 Remove unused header in editor.
Co-authored-by: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com>
2024-12-24 00:40:38 +08:00
ab0a2517b1 Consider all texture types for resource thumbnail generation 2024-12-10 14:57:10 +01:00
af6d260c17 Don't include core/io/image.h in core/os/os.h
`core/os/os.h` doesn't use `core/io/image.h`. It just brings
transitive dependencies. Lots of dependencies because `core/os/os.h`
is transitively included in almost every file of godot

Also added `core/io/image.h` into files^1 where `Ref<Image>` and `core/os/os.h`
were used to prevent obscure errors involving `Ref<Image>`

^1 except those which include `core/io/image_loader.h` or `core/io/image.h` by
corresponding .h file with the same name

Signed-off-by: Yevhen Babiichuk (DustDFG) <dfgdust@gmail.com>
Co-authored-by: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com>
2024-10-18 19:04:19 +03:00
203f7427c4 Fix crash when creating thumbnails for 3d textures 2024-10-09 12:34:19 +02:00
0e948fa7e0 Add image previews for 3D and layered textures 2024-09-10 11:35:39 +02:00
3027b49943 Prevent generating preview for zero sized texture 2024-06-18 16:04:10 +08:00
308dbb8c63 [Core] Add scalar versions of Vector* min/max/clamp/snap(ped)
Convenience for a number of cases operating on single values
2024-05-02 10:31:13 +02:00
1fce8d8a91 Add tooltip plugin for AudioStream 2024-04-15 22:14:21 +02:00
79ba22a73f Use Vector* component-wise min/max/clamp functions where applicable 2024-03-20 13:47:42 +01:00
91f0a65fc9 Rework viewport capture in preview generation 2024-02-21 10:44:21 +01:00
d8b29efe66 Fix member names of AudioFrame to match extension 2024-02-13 15:37:09 +01:00
9c919ea285 Generate script resource preview without parsing 2024-01-26 19:04:10 +01:00
95b27fe8c7 Reorganize code related to editor theming
This change introduces a new EditorThemeManager class
to abstract theme generatio and its subroutines.

Logic related to EditorTheme, EditorColorMap, and editor
icons has been extracted into their respective files with
includes cleaned up.

All related files have been moved to a separate folder to
better scope them in the project. This includes relevant
generated files as well.
2024-01-16 11:57:45 +01:00
e90ea87b42 Abort threaded preview generators on exit 2023-11-10 15:31:43 +01:00
de7cbe8789 Highlight doc comments in a different color 2023-10-08 19:26:10 +03:00
d8ff69d53c Extract ScriptInstance to simplify includes
This allows to include script_instance.h directly in the
generated gdvirtual.gen.inc, and remove excessive includes
from the codebase.

This should also allow Resource to use GDVIRTUAL macros,
which wasn't possible previously due to a circular dependency.
2023-09-06 22:54:38 +02:00
7e21eb7e00 Extract and reorganize texture resource classes 2023-07-14 20:04:21 +02:00
04317e9ced Add metadata to resource previews 2023-05-10 14:03:10 +02:00
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
ea33001b95 Add safety-checks before some servers free() 2022-12-29 16:23:38 -05:00
ebf86c96e9 Rename Image's get_rect to get_region
Also renames its parameter to from "rect" to "region".
2022-11-01 23:35:48 +01:00
e48c5daddf Unify usage of GLOBAL/EDITOR_GET 2022-10-18 19:01:48 +02:00
072f6feaba Make some Image methods static 2022-10-14 14:34:15 +02:00
dd26ecdd31 Rename CONNECT_ONESHOT TO CONNECT_ONE_SHOT
For consistency. Every other exposed `one_shot` is spaced out like this.
2022-09-06 19:00:33 +02:00
ea0472fecf Refactor BitMap and add tests
Co-authored-by: Resul Çelik <resul_celik@hotmail.com>
2022-09-01 18:39:17 +02:00
385ee5c70b Implement Physical Light Units as an optional setting.
This allows light sources to be specified in physical light units in addition to the regular energy multiplier. In order to avoid loss of precision at high values, brightness values are premultiplied by an exposure normalization value.

In support of Physical Light Units this PR also renames CameraEffects to CameraAttributes.
2022-08-31 12:14:46 -07:00
10a56981dc Rename String plus_file to path_join 2022-08-29 19:38:13 -05:00
d4433ae6d3 Remove Signal connect binds
Remove the optional argument p_binds from `Object::connect` since it was deprecated by Callable.bind().
Changed all uses of it to Callable.bind()
2022-07-29 16:26:13 +02:00
d1ddee2258 Implement BPM support
Based on #62896, only implements the BPM support part.

* Implements BPM support in the AudioStreamOGG/MP3 importers.
* Can select BPM/Bar Size and total beats in a song file, as well as edit looping points.
* Looping is now BPM aware
* Added a special importer UI for configuring this.
* Added a special preview showing the audio waveform as well as the playback position in the resource picker.
* Renamed `AudioStream::instance` to `instantiate` for correctness.
2022-07-23 07:31:17 +02:00
d2900429e8 Add static methods for creating Image and ImageTexture 2022-07-08 13:40:47 +02:00
344ba0ffaf Refactor Font configuration and import UI, and Font resources. 2022-07-06 14:12:36 +03:00
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
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
180e5d3028 Remove RES and REF typedefs in favor of spelled out Ref<>
These typedefs don't save much typing compared to the full `Ref<Resource>`
and `Ref<RefCounted>`, yet they sometimes introduce confusion among
new contributors.
2022-05-03 01:43:50 +02:00
a93834c819 Add gradient resource preview generator 2022-04-21 00:08:35 +02:00
11572c6e30 Editor: Cleanup some includes dependencies
Removes some unnecessary includes from `editor_node.h`, and instead add
those where they're used.

Removes unnecessary `editor_node.h` includes in various editor classes.

Renames `dynamicfont` to `dynamic_font` in a couple files.

Misc cleanup while jumping through that rabbit hole.
2022-02-15 14:54:15 +01:00
b396fd4eef Improve compilation speed (forward declarations/includes cleanup) 2022-02-12 02:46:22 +01:00
317cd0b19a Refactor some object type checking code with cast_to
Less stringly typed logic, and less String allocations and comparisons.
2022-02-08 10:08:34 +01:00