Commit Graph

97 Commits

Author SHA1 Message Date
Rémi Verschelde 7728839247
Rename FBX2glTF binary path setting back to 4.2 name
This preserves compatibility when upgrading Godot 4.2 projects which relied on that
path being configured in the editor settings.

The old name also makes sense for this one, it's fine for fbx2gltf_path to be under
a generic fbx category which could have more settings also impacting ufbx.
2024-05-30 23:42:11 +02:00
K. S. Ernest (iFire) Lee 24f56008ac Add bake_fps for FBXDocument, GLTFDocument and both import-export. 2024-05-23 09:09:36 -07:00
Lyuma c433754d34 fbx: change import option defaults
ufbx has special logic to handle animation/trimming, and most users expect trimming to be on.
For existing projects, we should upgrade files0 to FBX2glTF to preserve node compatibility.
2024-05-21 07:58:36 -07:00
Rémi Verschelde 82e77eab35
Merge pull request #91529 from bqqbarbhg/ufbx-warnings
FBX: Print ufbx load warnings on import
2024-05-07 13:48:56 +02:00
Rémi Verschelde e8d5bdd95d
Merge pull request #91528 from bqqbarbhg/ufbx-v0.14.0
FBX: Update ufbx to v0.14.0
2024-05-07 13:48:52 +02:00
bqqbarbhg 5cd7ae198d Update ufbx to v0.14.0 2024-05-07 14:27:21 +03:00
bqqbarbhg 04db5cf063 Print ufbx load warnings on import 2024-05-07 12:43:48 +03:00
bqqbarbhg b9ab0e46e2 Fix handling missing skins using ufbx importer
Previously, _asset_parse_skins() would mess with the order of skin indices.
However, the rest of the code expected these to match to ufbx skin indices.
To fix this, retain the original skin indices in FBXState::original_skin_indices.
2024-05-03 20:46:26 +03:00
bqqbarbhg 095569011c Resolve bind poses from FBX clusters instead of FBX poses
Turns out that the information in FBX Pose objects is relatively often broken.
Using skin cluster bind poses seems more reliable, but cannot capture the bind pose of the root bone.
2024-04-25 21:13:50 +03:00
Rémi Verschelde 17d9c52ad9
Merge pull request #90894 from lyuma/animation_step_30
Set animation step from importers. Increase default step from 10 to 30FPS
2024-04-24 09:59:21 +02:00
Lyuma 33e977ee34 fbx: Avoid name conflict with humanoid "Root" bone
The importer forces name uniqueness, even for the root. "RootNode" is less likely to conflict.
2024-04-23 01:43:03 -07:00
Lyuma bb9674c1b1 Set animation step from importers. Increase default step from 10 to 30 FPS. 2024-04-19 03:02:20 -07:00
Lyuma d3706488d9 Fix FBX and glTF when root nodes are skeleton bones
Set p_scene_parent to the skeleton to guarantee BoneAttachment3D nodes are added as a child of the active skeleton.
Use get_owner() to go all the way up when calculating the root node in generate_scene
2024-04-17 22:10:05 -07:00
bqqbarbhg 2a757e4897 Fix FBX texture path resolving 2024-04-13 20:28:12 +03:00
bqqbarbhg 659597b290 Enable FBX albedo factor when textures are bound 2024-04-13 03:12:03 +03:00
bqqbarbhg 5e52db5c93 Fix FBX orthographic camera size 2024-04-12 04:02:50 +03:00
bqqbarbhg d238b0ef57 Fix FBX emission_texture copy-paste issue 2024-04-12 03:52:57 +03:00
bqqbarbhg a998f0a482 Convert FBX material colors from linear to sRGB 2024-04-12 03:52:46 +03:00
Lyuma b0ce274a52 Apply "Remove Immutable Tracks" after post-import.
Reimplements "Remove Immutable" by comparing to the skeleton rest.
It is necessary to delay removing animation tracks until after the correct rest pose is calculated in rest-fixer.
Preserves the original implementation in the GLTFDocument / FBXDocument API for compatibility.
2024-03-30 23:45:22 -07:00
Lyuma 8232759100 Fix method bindings in FBXDocument by making them virtual in GLTFDocument. 2024-03-15 12:47:02 -07:00
398utubzyt 4c69e8c026 Fix compilation errors when `DISABLE_DEPRECATED` is defined 2024-02-28 05:09:29 -08:00
Lyuma 652ef966f9 Add new scene import option to import as Skeleton
Adds a bool import option `nodes/import_as_skeleton_bones`.
This is supported in all FBX or GLTF document based formats.
It is especially useful for retargeting and importing animations.
2024-02-26 03:06:07 -08:00
K. S. Ernest (iFire) Lee 04d43947bf
Add ufbx for FBX importing
This update introduces a new import method for FBX files using ufbx. If the fbx2gltf import fails, it will use the most recently cached scene from the ufbx import. The process is sped up by introducing threads to load the ufbx portion.

Key changes include:

- Support for importing geometry helper nodes in FBX files.
- Addition of cameras and lights with updated names.
- Removal of the fbx importer manager.
- Introduction of ModelDocument3D and updates to its methods.
- Changes to FBX import options and visibility.
- Updating the documentation and handling some errors.
- Store the original non-unique node, mesh and animation names in FBX and glTF.

Co-Authored-By: bqqbarbhg <bqqbarbhg@gmail.com>
2024-02-23 22:33:04 +01:00
Rémi Verschelde 33d477498e Remove ad-hoc FBX importer
This importer was the fruit of a lot of amazing reverse engineering
work by RevoluPowered, based on the original Assimp importer that was
introduced by fire.

While promising and well tuned for a specific type of FBX scenes, it
was found to have many flaws to support the many FBX exporters and
legacy models that Godot users want to use. As we currently lack a
maintainer to improve it, those issues are left unresolved and FBX
import is still sub-par in the current Godot releases.

After some experimentation, we're instead adding a new importer that
relies on Facebook's `fbx2gltf` command line tool to convert FBX to
glTF, so that we can then use our well-maintained glTF importer.
See #59653 and https://github.com/facebookincubator/FBX2glTF for details.
2022-03-30 13:04:31 +02:00
Haoyu Qiu c17d9f05f8 Simplify FBX importer project settings registering 2022-03-29 15:00:43 +08:00
Aleksey Smirnov 1a13de0f8d Replace copies with constant refs 2022-03-28 12:34:05 +03:00
Adam Scott 5e6d4baa48 Add GLTF, DAE and FBX importers enforcement for blend shape mask array 2022-03-24 17:15:23 -04:00
clayjohn fe49244611 Use Filament specular models and parametrization 2022-02-22 19:39:41 -08:00
Rémi Verschelde b8b4580448
Style: Cleanup single-line blocks, semicolons, dead code
Remove currently unused implementation of TextureBasisU, could be re-added
later on if needed and ported.
2022-02-16 14:06:29 +01:00
Hendrik Brucker b396fd4eef Improve compilation speed (forward declarations/includes cleanup) 2022-02-12 02:46:22 +01:00
Anilforextra adbe948bda String: Add contains(). 2022-02-04 01:28:02 +05:45
Nathan Franke 8a0a3accee
simplify formatting scripts, add a clang-tidy script, and run clang-tidy 2022-01-29 04:41:03 -06:00
Haoyu Qiu af67e4c291 Fix crash on importing FBX file 2022-01-10 18:24:31 +08:00
K. S. Ernest (iFire) Lee 07a39684a0 options dict is now passed to _import_scene. 2022-01-05 01:07:54 -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
luz paz a124f1effe Fix various typos
Found via ` codespell -q 3 -S ./thirdparty,*.po,./DONORS.md -L ackward,ang,ans,ba,beng,cas,childs,childrens,dof,doubleclick,expct,fave,findn,gird,hist,inout,leapyear,lod,nd,numer,ois,ony,paket,seeked,sinc,switchs,te,uint,varn`
Update editor/import/resource_importer_layered_texture.cpp

Co-authored-by: Raul Santos <raulsntos@gmail.com>
Update doc/classes/TileSetScenesCollectionSource.xml

Co-authored-by: Raul Santos <raulsntos@gmail.com>
Update scene/gui/graph_edit.cpp

Co-authored-by: Raul Santos <raulsntos@gmail.com>
Update scene/resources/animation.cpp

Co-authored-by: Raul Santos <raulsntos@gmail.com>
Update scene/resources/animation.cpp

Co-authored-by: Raul Santos <raulsntos@gmail.com>
Update scene/resources/animation.cpp

Co-authored-by: Raul Santos <raulsntos@gmail.com>
Update scene/gui/rich_text_label.cpp

Co-authored-by: Raul Santos <raulsntos@gmail.com>
Revert previously committed change
2022-01-02 01:03:58 -05:00
Nathan Franke 49403cbfa0
Replace String comparisons with "", String() to is_empty()
Also:
- Adds two stress tests to test_string.h
- Changes to .empty() on std::strings
2021-12-09 04:48:38 -06:00
Rémi Verschelde a2803f3d86
Merge pull request #54072 from KoBeWi/hrcr_is_ded 2021-11-03 17:31:48 +01:00
Rémi Verschelde 3a6be64c12
clang-format: Various fixes to comments alignment from `clang-format` 13
All reviewed manually and occasionally rewritten to avoid bad auto formatting.
2021-10-28 15:43:36 +02:00
Rémi Verschelde 3b11e33a09
clang-format: Disable alignment of operands, too unreliable
Sets `AlignOperands` to `DontAlign`.

`clang-format` developers seem to mostly care about space-based indentation and
every other version of clang-format breaks the bad mismatch of tabs and spaces
that it seems to use for operand alignment. So it's better without, so that it
respects our two-tabs `ContinuationIndentWidth`.
2021-10-28 15:19:35 +02:00
kobewi de4f29f458 Remove node_hrcr hack 2021-10-28 01:43:34 +02:00
reduz d03b7fbe09 Refactored Node3D rotation modes
* Made the Basis euler orders indexed via enum.
* Node3D has a new rotation_order property to choose Euler rotation order.
* Node3D has also a rotation_mode property to choose between Euler, Quaternion and Basis

Exposing these modes as well as the order makes Godot a lot friendlier for animators, which can choose the best way to interpolate rotations.
The new *Basis* mode makes the (exposed) transform property obsolete, so it was removed (can still be accessed by code of course).
2021-10-25 14:34:00 -03:00
reduz b3bf90b3ce Add scene Post-Import Plugin support.
* New plugin system to control the whole import workflow
* Can add options and run code at every import step (general, per node, mesh, animation, material etc.)

This constitutes a first version of these plugins. The ability to interact with the import preview dialog will likely be added later on.
2021-10-15 09:12:04 -03:00
K. S. Ernest (iFire) Lee 8f0c056431 Fix specific warnings issues by Clang
Found by `scons dev=yes` on llvm-mingw.
2021-10-14 14:14:26 -07:00
reduz 2dc823273e Remove REST transform influence in skeleton bones
* Animations and Skeletons are now pose-only.
* Rest transform is kept as reference (when it exists) and for IK
* Improves 3D model compatibility (non uniform transforms will properly work, as well as all animations coming from Autodesk products).
2021-10-13 14:51:29 -03:00
reduz ec19ed3723 Remove animation 3D transform track, replace by loc/rot/scale tracks.
* `Animation.TYPE_TRANSFORM3D` track is gone.
* Added POSITION_3D, ROTATION_3D, SCALE_3D tracks.
* GLTF2, Collada, FBX importers will only import the track types found.
* Skeleton3D bone poses are now Pos/Rot/Scale, pose matrix removed.
* AnimationPlayer and AnimationTree animate these tracks separately, only when found.
* Removed BakeReset code, is useless with these changes.

This is the first in a series of commits designed to make the animation system in Godot more useful, which includes:

* Better compatibility with Autodesk products
* Better reusability of animations across models (including retargeting).
* Proper animation compression.
* etc.

*Note* GLTF2 animation saving went broken with this PR, needs to be fixed in a subsequent one.
2021-10-12 20:08:42 -03:00
K. S. Ernest (iFire) Lee 1463fc889b GLTF for game templates.
Convert GLTF Document to use ImporterMeshInstance3D.

Add a GLTFDocument extension list and an extension for converting the importer mesh instance 3d to mesh instance 3d.

Use GLTF module when the editor tools are disabled.

Modified the render server to be less restrictive on matching blend arrays and have more logging.

Misc bugs with multimesh.

Always index the meshes.
2021-10-03 12:37:52 -07:00
Lightning_A c63b18507d Use range iterators for `Map` 2021-09-30 15:09:12 -06:00
Aaron Franke d54f2ad7ca
Don't generate empty doc sections and reduce code duplication 2021-09-20 20:59:33 -05:00
Aaron Franke ae1702bee5
Replace HTTP links with HTTPS for sites with HTTPS versions 2021-08-22 20:13:11 -05:00