Commit Graph

1714 Commits

Author SHA1 Message Date
92600420ba Backported from Godot4: Implemented SkeletonEditorGizmo.
-TokageItLab, lyuma
f2e9867e9f
- It still has some issues, as this one works differently than the 3.x version, they will be fixed later.
2022-08-11 17:31:02 +02:00
d662b2f3c9 Fix unused variable. 2022-08-11 12:31:24 +02:00
1b743e8a6d Fixed comparison of integer expressions of different signedness warnings. 2022-08-11 12:28:04 +02:00
dd250bf678 Backported ImmediateMesh from Godot4. 2022-08-11 12:23:36 +02:00
aebf3ecc9d Ported some missing changes. 2022-08-11 11:20:37 +02:00
3cbdd9cfa1 Removed Module prefix / infix from the skeleton editor's classes. Also now the module only has one EditorPlugin. 2022-08-11 10:59:22 +02:00
b6eb2db442 Backported returning AfterGUIInput from forward_spatial_gui_input from Godot4. Also removed the first index parameter. This fully broke the skeleton editor, it will be fixed soon. 2022-08-11 02:24:30 +02:00
061bdd1f2e Fix shadowed declaration. 2022-08-11 01:33:57 +02:00
e3e39a1b2a Now EditorNode3DGizmo::add_mesh accepts a Mesh instead of an ArrayMesh. 2022-08-11 01:30:54 +02:00
58539a22b6 Backported from Godot4: Node3D gizmo improvements
* Clean-up of node_3d_editor_plugin.{h,cpp}: removed unused code, fixed some bugs.
* Moved node_3d_editor_gizmos.{h,cpp} to editor/plugins.
* Added support for multiple gizmos per node. This means custom gizmos will no longer override the built-in ones and that multiple gizmos can be used in more complex nodes.
* Added support for handle IDs. When adding handles to a gizmo, an ID can be specified for each one, making it easier to work with gizmos that have a variable number of handles.
* Added support for subgizmos, selectable elements that can be transformed without needing a node of their own. By overriding _subgizmo_intersect_frustum() and/or _subgizmo_intersect_ray() gizmos can define which subgizmos should be selected on a region or click selection. Subgizmo transformations are applied using get/set/commit virtual methods, similar to how handles work.
- JFonS
cfb555a081
- Note: MeshDataResourceEditor is now kind of painful to use, it will be fixed a bit later.
2022-08-11 01:24:29 +02:00
ed5024d3c3 Moved AnimationPlayerEditor::singleton to private, and added getter method for it. 2022-08-10 18:53:15 +02:00
7e451e0f30 Removed the built in SkeletonSpatialGizmoPlugin. (The skeleton editor module used to remove it anyway.) 2022-08-10 14:44:15 +02:00
07fa703645 Improvements to the skeleton's gizmo. It still has issues though. I'll get back to it later. 2022-08-10 14:28:26 +02:00
73fa94274b Fixed the bone editor's bone tree. 2022-08-10 12:51:20 +02:00
b352060a62 Added a new bones_updated signal to Skeleton. 2022-08-10 12:42:04 +02:00
49f76407ba Fix unsigned signed comparison warnings. 2022-08-10 11:34:12 +02:00
7a9fe9117a Fix build. 2022-08-10 10:17:02 +02:00
22ce231a4e Backported from Godot 4: New and improved IK system for Skeleton3D
This PR and commit adds a new IK system for 3D with the Skeleton3D node
that adds several new IK solvers, as well as additional changes and functionality
for making bone manipulation in Godot easier.
This work was sponsored by GSoC 2020 and TwistedTwigleg
Full list of changes:
* Adds a SkeletonModification3D resource
  * This resource is the base where all IK code is written and executed
* Adds a SkeletonModificationStack3D resource
  * This node oversees the execution of the modifications and acts as a bridge of sorts for the modifications to the Skeleton3D node
* Adds SkeletonModification3D resources for LookAt, CCDIK, FABRIK, Jiggle, and TwoBoneIK
  * Each modification is in it's own file
* Several changes to Skeletons, listed below:
  * Added local_pose_override, which acts just like global_pose_override but keeps bone-child relationships intract
    * So if you move a bone using local_pose_override, all of the bones that are children will also be moved. This is different than global_pose_override, which only affects the individual bone
  * Internally bones keep track of their children. This removes the need of a processing list, makes it possible to update just a few select bones at a time, and makes it easier to traverse down the bone chain
  * Additional functions added for converting from world transform to global poses, global poses to local poses, and all the same changes but backwards (local to global, global to world). This makes it much easier to work with bone transforms without needing to think too much about how to convert them.
  * New signal added, bone_pose_changed, that can be used to tell if a specific bone changed its transform. Needed for BoneAttachment3D
  * Added functions for getting the forward position of a bone
* BoneAttachment3D node refactored heavily
  * BoneAttachment3D node is now completely standalone in its functionality.
    * This makes the code easier and less interconnected, as well as allowing them to function properly without being direct children of Skeleton3D nodes
  * BoneAttachment3D now can be set either using the index or the bone name.
  * BoneAttachment3D nodes can now set the bone transform instead of just following it. This is disabled by default for compatibility
  * BoneAttachment3D now shows a warning when not configured correctly
* Added rotate_to_align function in Basis
* Added class reference documentation for all changes
- TwistedTwigleg
5ffed49907
Note: It still needs some work.
2022-08-10 01:01:38 +02:00
cf918406ae Renamed Skeleton's skeleton_updated signal to pose_updated to make the following backports that much easier. 2022-08-09 22:31:17 +02:00
0ffa8e33a7 Backporter from Godot 4: Unexpose methods and property for binding children to Bones.
- madmiraal
65faa12fd3
2022-08-09 22:05:43 +02:00
a478334d4a Backported from Godot master: Made low level changes to the Skeleton3D class and Skeleton3D inspector. Changes listed below:
* Added helper functions to Skeleton3D for converting transforms from bone space to global space, and vice versa.
* Updated the Skeleton3D class reference.
* Changed the icon used for bones in the Skeleton3D inspector to use BoneAttachement3D's icon.
* Changed the Skeleton3D inspector to use EditorPropertyTransform and EditorPropertyVector3 when possible.
* Placed the Transform/Matrix for each bone in a sub-section, so it is visually similar to the Node3D inspector.
- TwistedTwigleg
24905becb2
- Also fixed smaller issues.
2022-08-09 21:57:46 +02:00
3d4a55a1a3 Backported: Added feature to move physical bones with skeleton when not simulating physics. - AndreaCatania
374432d074
2022-08-09 19:19:50 +02:00
3b0c27d89c Fixed the skeleton editor. 2022-08-09 18:32:39 +02:00
27aaa70037 Added back set_bone_pose to Skeleton, as I don't see any reason not to have it. Also improved it it. 2022-08-09 18:31:47 +02:00
6d293dc7a3 Removed Transform type track from the Animation. This leaves a few things, like the skeleton editor broken, it will be fixed soon. 2022-08-09 17:40:42 +02:00
5cd0ea7e60 Fix serializing variants into binary files. 2022-08-09 15:50:30 +02:00
3a8ffc6df3 Added missing cases to switch. 2022-08-09 12:26:47 +02:00
8fd473f685 Backported: "Remove animation 3D transform track, replace by loc/rot/scale tracks" from Godot4.
ec19ed3723
Its a bit broken right now, more patches need to be ported. Also I kept the Transform track for now, and I did not touch the gltf module yet.
2022-08-08 23:49:18 +02:00
d89dc61436 Switched back to the old gltf module. Apparently this one can export aswell. 2022-08-08 19:45:06 +02:00
9ae0437034 Backported and added EditorSceneFormatImporterFBX and EditorSceneFormatImporterGLTF to the build. 2022-08-08 18:52:58 +02:00
f086cf4128 Now GLTFDocument can be built. 2022-08-08 18:01:02 +02:00
6decccc54f Now Color::clamp() actually has an implementation. 2022-08-08 18:00:42 +02:00
0517f3e462 Fix _scs_create's implementation. 2022-08-08 17:58:43 +02:00
a23d917937 use the proper _NO_DISCARD_ macro. 2022-08-08 17:36:15 +02:00
453c6cdda4 Remove duplicate methods. 2022-08-08 17:31:56 +02:00
2d2dfb6a84 Backported some of the improvemnents to BoneAttachment from Godot4. 2022-08-08 17:29:59 +02:00
5fa6f5e5fb Backported a few helper methods from Godot4 to Skeleton. 2022-08-08 17:29:34 +02:00
0b1ae86963 Backported the improvements to StringName from Godot4. 2022-08-08 17:26:23 +02:00
89b1ed9263 Ported contains for String from Godot4. 2022-08-08 16:06:34 +02:00
42607ee8ca Lots of work on GLTFDocument. 2022-08-08 02:53:46 +02:00
ffd29397f8 Added clamp() to color from Godot4. 2022-08-08 02:52:30 +02:00
eff5153375 Backported convert_rg_to_ra_rgba8 and convert_ra_rgba8_to_rg from Godot4's Image. 2022-08-08 02:39:21 +02:00
2e30e9f2d6 Ported uri_encode and uri_decode to String from Godot4. 2022-08-08 01:28:25 +02:00
ba00b5bf91 Added char utils header from godot4. 2022-08-08 01:27:57 +02:00
ae7d514cf3 Added set_column to Basis. 2022-08-08 01:18:58 +02:00
341b1a105f Update method in GLTFDocumentExtensionConvertImporterMesh. 2022-08-08 00:52:21 +02:00
b28af3a912 Proper 3.x style bindings for GLTFDocumentExtension. 2022-08-08 00:50:00 +02:00
53fcf8b2d3 Cleaned GLTFDocumentExtensionConvertImporterMesh too. 2022-08-08 00:43:26 +02:00
5e5ae40009 Cleaned up GLTFDocumentExtension aswell. 2022-08-08 00:39:35 +02:00
2f9608aa65 GLTFState is also in the build now. 2022-08-08 00:23:19 +02:00