Commit Graph

83 Commits

Author SHA1 Message Date
88c4380737 Modules: Make sure to include modules_enabled.gen.h where needed 2021-11-12 13:42:58 +01:00
06a33e590f Merge pull request #53819 from TokageItLab/re-implement-ping-pong
Reimplement ping-pong animation and reverse playback
2021-11-09 22:11:04 +01:00
a2803f3d86 Merge pull request #54072 from KoBeWi/hrcr_is_ded 2021-11-03 17:31:48 +01:00
953a7bce7e reimplement ping-pong 2021-11-03 13:39:33 +09:00
de93d48901 glTF: Fix override materials and non-empty arrays
Keep track of MeshInstance and GeometryInstance override materials in the GLTFMesh object.
Ensure all arrays are non-empty to conform with "minItems":1 in glTF spec.
2021-11-01 23:22:45 -07:00
0ae65472e7 clang-format: Enable BreakBeforeTernaryOperators
clang-format keeps breaking the way it handles break *after* ternary operators,
so I give up and go with the only style they seem to actually test.
2021-10-28 15:57:41 +02:00
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
de4f29f458 Remove node_hrcr hack 2021-10-28 01:43:34 +02:00
cada1a4747 gltf: Fix validation errors due to chunk padding and empty skins.
GLB chunk padding length calculation was backwards and missing for the BIN chunk.
Fixed error caused by "skins":[] when no skins were present.
Finally, encode animations before textures to avoid accessor misalignment due to texture byteLength.
2021-10-25 21:12:43 -07:00
653e2a550c Fixed animation insertion in SkeletonEditor 2021-10-23 16:50:00 +09:00
4387f9645b Merge pull request #52940 from groud/toast_notification 2021-10-19 09:57:13 +02:00
ae1c016547 Implement Animation Blend Shape Tracks
* New track type BLEND_SHAPE
* Blend shapes are imported via this new track type
* Processing is more optimized (no longer relies on variants)
* Modified the Blend Shape API in MeshInstance3D to use indices rather than StringNames (more optimizes)
* Promo: Fixed a small bug in gizmo updating in Node3D that affected performance

Dedicated BlendShape tracks are required for both optimization and eventually implementing them in animation compression.
2021-10-16 08:36:05 -03:00
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
0587e5e018 Implement toast notifications in the editor 2021-10-14 13:30:54 +02:00
e3d1189916 Restore gltf animation export after split. 2021-10-13 15:18:27 -07:00
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
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
610de0974d Revert "Implement reverse playback and ping-pong loop in AnimationPlayer and NodeAnimation" 2021-10-11 19:27:50 -03:00
372ba76663 implement ping-pong loop in animation
Co-authored-by: Chaosus <chaosus89@gmail.com>
2021-10-09 18:08:43 +09:00
fc1634806a Enable GLTFDocumentExtensionConvertImporterMesh only in games. 2021-10-04 09:47:34 -07:00
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
c63b18507d Use range iterators for Map 2021-09-30 15:09:12 -06:00
5ffda27ea9 gltf export: Fix export of skeletons, skins and blend shapes.
Create GLTFSkeleton at the same time we create GLTFNode objects.
Create GLTFSkin at the same time we export MeshInstance3D
Fixes export of blend shape arrays for meshes with multiple surfaces.
Fixes array indexing issues in export of glTF morph target animations.

Converts BoneAttachment3D nodes during normal node creation: this avoids
special cases during mesh export, and especially exporting skeletons or meshes
which are children of BoneAttachment3D.

Co-authored-by: K. S. Ernest (iFire) Lee <ernest.lee@chibifire.com>
2021-09-29 13:07:52 -07:00
fc9767abb1 Use functions defined in the their classes. 2021-09-29 09:36:34 +05:45
f3e76a5397 Fix GLTF light import 2021-09-26 21:57:25 -05:00
ca55dfc00c Corrected GLTFDocument::save_scene from processing a nullptr
Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
2021-09-20 11:38:39 +00:00
13eff7de69 Merge pull request #52273 from aaronfranke/gltf-renames 2021-09-15 13:10:24 +02:00
aca4b737f1 8 uvs for glTF2, URI decode and Vertex Custom api.
Add glTF2 uri decode for paths.

Add vertex custom apis.

Add scene importer api.

Change Color to float; add support for float-based custom channels in SurfaceTool and EditorSceneImporterMesh

Co-authored-by: darth negative hunter
 <thenegativehunter2@users.noreply.github.com>
2021-09-10 09:16:48 -07:00
523b2d9199 Remove packed scene gltf
We determined through discussion that composing the packed scene from a node tree was a better design because it removed duplication of code.
2021-09-10 08:39:17 -07:00
33df50acdd Fix missing renames in the GLTF module 2021-08-31 00:06:46 -05:00
0c79a8fa22 Continue when glTF2 lights fail to parse. 2021-08-09 00:09:19 -07:00
23bf04ae9a Merge pull request #51052 from V-Sekai/gltf-fallbacks
glTF2 fallback load PNG and JPG
2021-07-30 17:04:29 +02:00
ddff1c10c3 glTF2 fallback load PNG and JPG 2021-07-30 07:30:50 -07:00
882f7d9bdf In glTF2 animations, log spam less when running. 2021-07-29 22:56:19 -07:00
2cd347f4fa Fix GLTF crash when the material is not set.
Sometimes there are meshes that doesn't have materials, so make sure to check this case before extracting the name.
2021-07-23 11:54:22 +02:00
c174a598b1 Set the surface name when GLTF file is imported. 2021-07-21 11:28:49 +02:00
06568bbfdf Misc cleanup of header includes
Was looking for misuse of module headers without checking that the module is
actually enabled and got carried away...
2021-07-15 00:46:43 +02:00
75688772b3 Fix editor suffixes and degrees conversion
* Functions to convert to/from degrees are all gone. Conversion is done by the editor.
* Use PROPERTY_HINT_ANGLE instead of PROPERTY_HINT_RANGE to edit radian angles in degrees.
* Added possibility to add suffixes to range properties, use "min,max[,step][,suffix:<something>]" example "0,100,1,suffix:m"
* In general, can add suffixes for EditorSpinSlider
Not covered by this PR, will have to be addressed by future ones:

* Ability to switch radians/degrees in the inspector for angle properties (if actually wanted).
* Animations previously made will most likely break, need to add a way to make old ones compatible.
* Only added a "px" suffix to 2D position and a "m" one to 3D position, someone needs to go through the rest of the engine and add all remaining suffixes.
* Likely also need to track down usage of EditorSpinSlider outside properties to add suffixes to it too.
2021-06-30 12:38:25 -03:00
d67c5afa95 Make curve interpolate crash less. 2021-06-27 22:07:50 -07:00
671bd64e4a Merge pull request #49754 from aaronfranke/is-eq-approx-sub-opt
Fix sub-optimal uses of is_equal_approx
2021-06-20 11:44:56 +02:00
45c24fd039 Fix sub-optimal uses of is_equal_approx 2021-06-20 03:03:06 -04:00
e28fd07b2b Rename instance()->instantiate() when it's a verb 2021-06-19 20:49:18 -06:00
2bafcd3422 Consolidate JSON, JSONParseResults and JSONParser into JSON
Renames JSON.parse_string() to parse()
Renames JSON.decode_data() to stringify()
2021-06-19 08:01:40 +01:00
479737538b Merge pull request #49401 from fire/8-weights
Fix 8 bone weights in glTF2
2021-06-16 07:43:42 -07:00
9e328bb5b7 Core: Move DirAccess and FileAccess to core/io
File handling APIs are typically considered part of I/O, and we did have most
`FileAccess` implementations in `core/io` already.
2021-06-11 14:52:39 +02:00
291e735972 Fix 8 bone weights in glTF2
Don't spam in glTF2 import either.

Clear() in SurfaceTool does not keep 8 weights.
2021-06-07 14:33:44 -07:00
8acd13a456 Rename Quat to Quaternion 2021-06-04 18:14:32 +01:00
125d1a7cd3 Rename Animation TYPE_TRANSFORM to TYPE_TRANSFORM3D 2021-06-03 21:11:54 -04:00
de3f6699a5 Rename Transform to Transform3D in core 2021-06-03 07:30:01 -04:00
e839a3291b gltf: Fix mesh nodes which are also bones.
Fix issue when two skeletons end up directly parented.
Prevent animating TRS for skinned Mesh node.
Fix animating weights on meshes with targets but no weights.
2021-05-27 19:33:01 -07:00