1
0
Fork 0
Commit Graph

85 Commits

Author SHA1 Message Date
Thaddeus Crews 9b96eaaf80
Merge pull request #107989 from Jojo-1000/docs-add-required-qualifier
Documentation: Add missing required qualifier for various classes
2025-09-19 09:17:06 -05:00
Aaron Franke ba92af7d07
ImporterMesh: Validate triangle indices array size is a multiple of 3 2025-08-18 06:36:21 -07:00
shadowcow13 c6c4c55146 Fix name included in animation when saved from slice in scene importer 2025-08-13 16:53:43 -06:00
Mounir Tohami 706601778e Prevent generating editor 3D scene preview in headless mode. 2025-07-31 11:44:07 +03:00
Jojo-1000 ab178719d9 Mark methods for various classes as required 2025-07-30 19:24:56 +02:00
Kody Van Ry 2554434cd9 Fix allow any descendant to be used as a Root Type in Scene Import 2025-07-20 15:27:05 -06:00
A Thousand Ships f11aff3841
Editor: Restructure editor code
Moving various editor files into sub folders to reduce clutter
2025-07-04 18:18:22 +02:00
Rémi Verschelde 45533589e4
Revert "Rework scene preview thumbnails"
This reverts commit 08343189dc.

While the feature is great, a number of issues have been found with the
implementation, and we need more time to resolve them.

So we roll this back for 4.5, to rework the feature for a later Godot
release.
2025-06-21 00:05:57 +02:00
Lukas Tenbrink e2931a5c19 Make conversions from `NodePath` to `String` explicit. 2025-06-11 16:50:27 +02:00
Aaron Franke a3daba29dd
Allow attaching scripts to nodes in the Advanced Import Settings dialog 2025-06-10 09:35:24 -07:00
Pāvels Nadtočajevs a0c4a8c4a9
Restore 3.x style material auto-extraction import option. 2025-06-10 12:03:45 +03:00
daniel080400 08343189dc Rework scene preview thumbnails 2025-05-31 16:57:51 +08:00
Arseny Kapoulkine 6190d412d3 Adjust LOD selection metrics to use attribute error
- Revert meshoptimizer patch; the metric used for LOD selection now
incorporates attribute error
- Since LOD selection is now aware of attribute deviation, we don't
need to use a higher normal weight
- To prevent normal creases from creating input triangles with very
large normal deviation, reduce default normal merge threshold
- Since we now use combined metric to select LODs, we never need LODs
with error>1 as these should not be selected if the mesh is visible.
2025-05-18 17:38:54 +03:00
Raphaël Daubelcour 9511e1137d Check if import_script is subtype of EditorScenePostImport 2025-05-14 12:07:17 -04:00
Thaddeus Crews 5dc375b2fc
Merge pull request #105014 from aaronfranke/no-type-suffixes
Allow completely opting out of name suffix magic in 3D scene import
2025-04-24 17:18:50 -05:00
Thaddeus Crews d236bd8633
Merge pull request #99543 from KoBeWi/using_rng_to_destroy_rng
Add `create_id_for_path()` to ResourceUID
2025-04-11 09:51:12 -05:00
kobewi ff1f040893 Add create_id_for_path() to ResourceUID 2025-04-11 00:53:34 +02:00
Thaddeus Crews 94282d88f9
Core: Use `Math` namespace for constants 2025-04-10 16:29:30 -05:00
Aaron Franke e96828673f
Allow completely opting out of name suffix magic in 3D scene import 2025-04-10 01:11:54 -07:00
Yufeng Ying 8ae16699c5 Do not use Dictionary::keys() for Dictionary iteration. 2025-04-05 18:42:13 +08:00
Michael Alexsander 556933306a
Allow to compile templates without navigation features 2025-04-01 11:53:35 -03:00
Lyuma 8997c999e9
Scene import: extract UID paths and store fallback
When extracting meshes, materials and animations, always store the uid:// path as well as a res:// fallback.
When validating import settings, load the fallback path if the uid:// path fails to load.
Update save_to_file/fallback_path every import to keep the file path in sync with the uid.
Use UID hashing for meshes and animations.
2025-03-19 11:50:39 +01:00
kobewi 6f25babd6b Remove empty constructors and destructors from editor/ 2025-03-17 21:20:02 +01:00
A Thousand Ships 466590d0ec
Use `get_slicec` instead of `get_slice` for single character splitters 2025-03-08 20:36:37 +01:00
A Thousand Ships 5113022dfe
Clean up some uses of `String::substr`
Cases where the end position is either equvalent to the default or past
the end of the string.
2025-03-07 14:50:38 +01:00
kobewi 06b2c9f23f Fix save path validation for imported scenes 2025-01-30 23:27:36 +01:00
Rémi Verschelde 21fcb56547 Remove unused `EditorSceneFormatImporter::_get_import_flags`
This has never been used since Godot was open sourced.

Import flags are used but directly through `_import_scene`.
2025-01-14 16:57:06 +01:00
Saracen 048788f07d Fix scrolling for advanced importer controls. 2025-01-14 11:36:48 +01:00
Lyuma e4de1f4583 Make `EditorSceneFormatImporter::_get_import_options` match EditorScenePostImportPlugin API 2025-01-13 21:45:53 +01:00
Aarni Koskela f134769506 Fix various typos
* Add TODO notes for typos that should be fixed for 5.0

Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
2025-01-08 14:47:42 +02:00
Rémi Verschelde a7d84fa022 Merge pull request #100792 from lyuma/post_import_plugin_subresources
Allow post-import plugins to modify `_subresources`
2025-01-08 00:21:03 +01:00
Lyuma 637fe3ccdd Allow post-import plugins to modify _subresources
The old code fetched some data before the `EditorScenePostImportPlugin._pre_process` callback.
While the callback could modify existing keys, this prevented users from adding new data on a fresh import.

By fetching the keys after pre_process, this means users can consistently modify import options for nodes, meshes, materials and animations in a post-import plugin.
2024-12-24 07:34:24 -08:00
A Thousand Ships 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
Yufeng Ying 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
Thaddeus Crews 1c78b09815
Merge pull request #96544 from SaracenOne/import_thumbnails
Generate thumbnails on imported scenes.
2024-11-27 10:47:02 -06:00
Thaddeus Crews 04786f0ee8
Merge pull request #97824 from TokageItLab/retarget-modifier
Add RetargetModifier3D for realtime retarget to keep original rest
2024-11-26 13:04:47 -06:00
Saracen 74611a74d1 Generate editor thumbnails on imported scenes. 2024-11-24 10:23:56 -08:00
Silc Lizard (Tokage) Renew f5b49af99f Add RetargetModifier3D for realtime retarget to keep original rest 2024-11-18 22:44:55 +09:00
Thaddeus Crews 2ed6d12652
Merge pull request #97363 from reduz/deterministic-gen-suberesources-id
Allow passing UID to importer
2024-11-11 14:18:30 -06:00
Juan fe34c45d2a
Allow passing UID to importer
This helps, for importers spitting out new resources to the res://
filesystem to actually hash them to generate deterministic UIDs.

This PR also fixes the determinism for translations.
2024-11-11 15:22:42 +01:00
Thaddeus Crews 925b690c98
Core: Integrate `Ref::instantiate` where possible 2024-11-10 12:41:26 -06:00
Aaron Franke 924732772b
GLTF: Preserve node visibility on import 2024-11-05 19:06:08 -08:00
Arseny Kapoulkine 260287b3a1 Rewrite index optimization code for maximum efficiency
While all the previous fixes to optimizeVertexCache invocation fixed the
vertex transform efficiency, the import code still was missing two
crucial recommendations from meshoptimizer documentation:

- All meshes should be optimized for vertex cache (this reorders
  vertices for maximum fetch efficiency)
- When LODs are used with a shared vertex buffer, the vertex order
  should be generated by doing a vertex fetch optimization on the
  concatenated index buffer from coarse to fine LODs; this maximizes
  fetch efficiency for coarse LODs

The last point is especially crucial for Mali GPUs; unlike other GPUs
where vertex order affects fetch efficiency but not shading, these GPUs
have various shading quirks (depending on the GPU generation) that
really require consecutive index ranges for each LOD, which requires the
second optimization mentioned above. However all of these also help
desktop GPUs and other mobile GPUs as well.

Because this optimization is "global" in the sense that it affects all
LODs and all vertex arrays in concert, I've taken this opportunity to
isolate all optimization code in this function and pull it out of
generate_lods and create_shadow_mesh; this doesn't change the vertex
cache efficiency, but makes the code cleaner. Consequently,
optimize_indices should be called after other functions like
create_shadow_mesh / generate_lods.

This required exposing meshopt_optimizeVertexFetchRemap; as a drive-by,
meshopt_simplifySloppy was never used so it's not exposed anymore - this
will simplify future meshopt upgrades if they end up changing the
function's interface.
2024-11-04 06:58:06 -08:00
Arseny Kapoulkine 494fe2fe21 LOD: Remove "Raycast Normals" and associated "Normal Split Angle" settings
"Raycast Normals" was introduced in 4.4 dev and defaulted to "false".
The limited testing results at the time suggested that raycasting
generally reduces normal quality compared to native simplifier results,
at the same time increasing vertex memory and import time.

To play it safe, we introduced a setting that defaulted to false, with
the goal of removing it later in 4.4 development cycle if no regressions
are noticed. Since we already had three dev snapshots and no reports,
this change removes the setting and associated code.

"Normal Split Angle" was only used when raycast normals were enabled;
this change removes it from the settings, but keeps it in the script
binding for compatibility.

Existing meshes import exactly the same after this change (unless they
chose to override raycasting which would be surprising).

split_normals helper was only used in this code path and is also removed
for simplicity; it is unlikely that this code will be useful as is, as
it can only regenerate normals without fixing tangents or updating
positions.
2024-10-28 10:14:04 -07:00
Aaron Franke b0f99099b4
Add "Use Node Type Suffixes" scene import option 2024-09-09 01:12:14 -07:00
A Thousand Ships 194bdde947
Cleanup of raw `nullptr` checks with `Ref`
Using `is_valid/null` over checks with `nullptr` or `ERR_FAIL_NULL` etc.
2024-08-31 15:01:09 +02:00
Rémi Verschelde 7f86ca057a
Merge pull request #96308 from SaracenOne/attempt_to_reset_imported_scene
Attempt applying RESET pose during import.
2024-08-30 09:59:59 +02:00
Saracen 31253257b3 Attempt applying RESET pose during import. 2024-08-29 22:58:26 +01:00
demolke c409e6d722 Import/export GLTF extras to node->meta
This is useful for custom tagging of objects with properties (for example in Blender) and having this available in the editor for scripting.

- Adds import logic to propagate the parsed GLTF extras all the way to the resulting Node->meta
- Adds export logic to save Godot Object meta into GLTF extras
- Supports `nodes`, `meshes` and `materials` (in GLTF sense of the words)
2024-08-29 19:17:04 +02:00
Aaron Franke 9dd71c6414
ResourceImporterScene: Replace animation bool with an import type string enum 2024-08-27 14:58:18 -07:00