Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/vsk-many-bone-ik-constraint-4.4'…
Browse files Browse the repository at this point in the history
… into vsk-many-bone-ik-constraint-4.4
  • Loading branch information
fire committed Dec 9, 2024
2 parents 088fec1 + ebed021 commit 2f3b4da
Showing 52 changed files with 385 additions and 4,058 deletions.
6 changes: 3 additions & 3 deletions modules/constraint_ik/config.py
Original file line number Diff line number Diff line change
@@ -9,13 +9,13 @@ def configure(env):
def get_doc_classes():
return [
"ConstraintIK3D",
"IKBone3D",
"IKEffector3D",
"IKConstraintBone3D",
"IKConstraintEffector3D",
"IKBoneSegment3D",
"IKEffectorTemplate3D",
"IKKusudama3D",
"IKRay3D",
"IKNode3D",
"IKConstraintNode3D",
"IKLimitCone3D",
]

20 changes: 10 additions & 10 deletions modules/constraint_ik/doc_classes/IKBone3D.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="IKBone3D" inherits="Resource" experimental="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<class name="IKConstraintBone3D" inherits="Resource" experimental="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
A class representing a 3D bone in an Inverse Kinematics system.
</brief_description>
<description>
The IKBone3D class represents a 3D bone in an Inverse Kinematics (IK) system. It provides methods to get and set constraints, pins, and check if the bone is pinned.
The IKConstraintBone3D class represents a 3D bone in an Inverse Kinematics (IK) system. It provides methods to get and set constraints, pins, and check if the bone is pinned.
</description>
<tutorials>
</tutorials>
@@ -16,21 +16,21 @@
</description>
</method>
<method name="get_constraint_orientation_transform">
<return type="IKNode3D" />
<return type="IKConstraintNode3D" />
<description>
Returns the IKNode3D object representing the orientation transform of the constraint.
Returns the IKConstraintNode3D object representing the orientation transform of the constraint.
</description>
</method>
<method name="get_constraint_twist_transform">
<return type="IKNode3D" />
<return type="IKConstraintNode3D" />
<description>
Returns the IKNode3D object representing the twist transform of the constraint.
Returns the IKConstraintNode3D object representing the twist transform of the constraint.
</description>
</method>
<method name="get_pin" qualifiers="const">
<return type="IKEffector3D" />
<return type="IKConstraintEffector3D" />
<description>
Returns the IKEffector3D object representing the pin of the bone.
Returns the IKConstraintEffector3D object representing the pin of the bone.
</description>
</method>
<method name="is_pinned" qualifiers="const">
@@ -41,9 +41,9 @@
</method>
<method name="set_pin">
<return type="void" />
<param index="0" name="pin" type="IKEffector3D" />
<param index="0" name="pin" type="IKConstraintEffector3D" />
<description>
Sets the IKEffector3D object representing the pin of the bone.
Sets the IKConstraintEffector3D object representing the pin of the bone.
</description>
</method>
</methods>
4 changes: 2 additions & 2 deletions modules/constraint_ik/doc_classes/IKBoneSegment3D.xml
Original file line number Diff line number Diff line change
@@ -10,10 +10,10 @@
</tutorials>
<methods>
<method name="get_ik_bone" qualifiers="const">
<return type="IKBone3D" />
<return type="IKConstraintBone3D" />
<param index="0" name="bone" type="int" />
<description>
Returns the IKBone3D object associated with the given bone index.
Returns the IKConstraintBone3D object associated with the given bone index.
</description>
</method>
<method name="is_pinned" qualifiers="const">
4 changes: 2 additions & 2 deletions modules/constraint_ik/doc_classes/IKEffector3D.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="IKEffector3D" inherits="Resource" experimental="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<class name="IKConstraintEffector3D" inherits="Resource" experimental="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
A class representing a 3D effector in an Inverse Kinematics system.
</brief_description>
<description>
The IKEffector3D class represents an effector in a 3D Inverse Kinematics (IK) system. An effector is the end point of a chain of bones, and its position is used to calculate the rotations of all preceding bones in the IK chain. This class provides methods for getting and setting the target node of the effector.
The IKConstraintEffector3D class represents an effector in a 3D Inverse Kinematics (IK) system. An effector is the end point of a chain of bones, and its position is used to calculate the rotations of all preceding bones in the IK chain. This class provides methods for getting and setting the target node of the effector.
</description>
<tutorials>
</tutorials>
8 changes: 4 additions & 4 deletions modules/constraint_ik/doc_classes/IKNode3D.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="IKNode3D" inherits="RefCounted" experimental="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<class name="IKConstraintNode3D" inherits="RefCounted" experimental="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
A 3D node used for inverse kinematics calculations.
</brief_description>
<description>
The IKNode3D class provides a node that can be used in an inverse kinematics chain. It includes methods for getting and setting the global and local transforms of the node, as well as disabling scaling and converting between local and global coordinates.
The IKConstraintNode3D class provides a node that can be used in an inverse kinematics chain. It includes methods for getting and setting the global and local transforms of the node, as well as disabling scaling and converting between local and global coordinates.
</description>
<tutorials>
</tutorials>
@@ -16,7 +16,7 @@
</description>
</method>
<method name="get_parent" qualifiers="const">
<return type="IKNode3D" />
<return type="IKConstraintNode3D" />
<description>
Returns the parent of this node.
</description>
@@ -57,7 +57,7 @@
</method>
<method name="set_parent">
<return type="void" />
<param index="0" name="p_parent" type="IKNode3D" />
<param index="0" name="p_parent" type="IKConstraintNode3D" />
<description>
Sets the parent of this node.
</description>
8 changes: 4 additions & 4 deletions modules/constraint_ik/editor/many_bone_ik_3d_gizmo_plugin.cpp
Original file line number Diff line number Diff line change
@@ -32,7 +32,6 @@
#include "core/templates/local_vector.h"
#include "editor/editor_interface.h"
#include "editor/editor_node.h"
#include "editor/many_bone_ik_shader.h"
#include "editor/plugins/node_3d_editor_gizmos.h"
#include "editor/plugins/node_3d_editor_plugin.h"
#include "scene/3d/mesh_instance_3d.h"
@@ -43,6 +42,7 @@
#include "../src/ik_kusudama_3d.h"
#include "../src/many_bone_ik_3d.h"
#include "many_bone_ik_3d_gizmo_plugin.h"
#include "many_bone_ik_shader.h"

#ifdef TOOLS_ENABLED
#include "editor/editor_node.h"
@@ -87,11 +87,11 @@ void ConstraintIK3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) {

Color current_bone_color = (current_bone_idx == selected) ? selected_bone_color : bone_color;

for (const Ref<IKBoneSegment3D> &segmented_skeleton : many_bone_ik->get_segmented_skeletons()) {
for (const Ref<IKConstraintBoneSegment3D> &segmented_skeleton : many_bone_ik->get_segmented_skeletons()) {
if (segmented_skeleton.is_null()) {
continue;
}
Ref<IKBone3D> ik_bone = segmented_skeleton->get_ik_bone(current_bone_idx);
Ref<IKConstraintBone3D> ik_bone = segmented_skeleton->get_ik_bone(current_bone_idx);
if (ik_bone.is_null() || ik_bone->get_constraint().is_null()) {
continue;
}
@@ -114,7 +114,7 @@ void ConstraintIK3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) {
}
}

void ConstraintIK3DGizmoPlugin::create_gizmo_mesh(BoneId current_bone_idx, Ref<IKBone3D> ik_bone, EditorNode3DGizmo *p_gizmo, Color current_bone_color, Skeleton3D *many_bone_ik_skeleton, ConstraintIK3D *p_many_bone_ik) {
void ConstraintIK3DGizmoPlugin::create_gizmo_mesh(BoneId current_bone_idx, Ref<IKConstraintBone3D> ik_bone, EditorNode3DGizmo *p_gizmo, Color current_bone_color, Skeleton3D *many_bone_ik_skeleton, ConstraintIK3D *p_many_bone_ik) {
Ref<IKKusudama3D> ik_kusudama = ik_bone->get_constraint();
if (ik_kusudama.is_null()) {
return;
Original file line number Diff line number Diff line change
@@ -76,7 +76,7 @@ class ConstraintIK3DGizmoPlugin : public EditorNode3DGizmoPlugin {
String get_gizmo_name() const override;
void redraw(EditorNode3DGizmo *p_gizmo) override;
int32_t get_priority() const override;
void create_gizmo_mesh(BoneId current_bone_idx, Ref<IKBone3D> ik_bone, EditorNode3DGizmo *p_gizmo, Color current_bone_color, Skeleton3D *many_bone_ik_skeleton, ConstraintIK3D *p_many_bone_ik);
void create_gizmo_mesh(BoneId current_bone_idx, Ref<IKConstraintBone3D> ik_bone, EditorNode3DGizmo *p_gizmo, Color current_bone_color, Skeleton3D *many_bone_ik_skeleton, ConstraintIK3D *p_many_bone_ik);
int subgizmos_intersect_ray(const EditorNode3DGizmo *p_gizmo, Camera3D *p_camera, const Vector2 &p_point) const override;
Transform3D get_subgizmo_transform(const EditorNode3DGizmo *p_gizmo, int p_id) const override;
void set_subgizmo_transform(const EditorNode3DGizmo *p_gizmo, int p_id, Transform3D p_transform) override;
10 changes: 5 additions & 5 deletions modules/constraint_ik/register_types.cpp
Original file line number Diff line number Diff line change
@@ -49,12 +49,12 @@ void initialize_constraint_ik_module(ModuleInitializationLevel p_level) {
}
#endif
if (p_level == MODULE_INITIALIZATION_LEVEL_SERVERS) {
GDREGISTER_CLASS(IKEffectorTemplate3D);
GDREGISTER_CLASS(IKConstraintEffectorTemplate3D);
GDREGISTER_CLASS(ConstraintIK3D);
GDREGISTER_CLASS(IKBone3D);
GDREGISTER_CLASS(IKNode3D);
GDREGISTER_CLASS(IKEffector3D);
GDREGISTER_CLASS(IKBoneSegment3D);
GDREGISTER_CLASS(IKConstraintBone3D);
GDREGISTER_CLASS(IKConstraintNode3D);
GDREGISTER_CLASS(IKConstraintEffector3D);
GDREGISTER_CLASS(IKConstraintBoneSegment3D);
GDREGISTER_CLASS(IKKusudama3D);
GDREGISTER_CLASS(IKRay3D);
GDREGISTER_CLASS(IKLimitCone3D);
6 changes: 3 additions & 3 deletions modules/constraint_ik/register_types.h
Original file line number Diff line number Diff line change
@@ -28,12 +28,12 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/

#ifndef MANY_BONE_IK_REGISTER_TYPES_H
#define MANY_BONE_IK_REGISTER_TYPES_H
#ifndef CONSTRAINT_IK_REGISTER_TYPES_H
#define CONSTRAINT_IK_REGISTER_TYPES_H

#include "modules/register_module_types.h"

void initialize_constraint_ik_module(ModuleInitializationLevel p_level);
void uninitialize_constraint_ik_module(ModuleInitializationLevel p_level);

#endif // MANY_BONE_IK_REGISTER_TYPES_H
#endif // CONSTRAINT_IK_REGISTER_TYPES_H
Loading

0 comments on commit 2f3b4da

Please sign in to comment.