Skip to content

Commit

Permalink
Merge pull request #71137 from lyuma/remove_modification_stack_3d
Browse files Browse the repository at this point in the history
Remove SkeletonModificationStack3D, and Skeleton3D api cleanup
  • Loading branch information
akien-mga committed Jan 13, 2023
2 parents 682ef35 + fd25bb5 commit 030a95d
Show file tree
Hide file tree
Showing 33 changed files with 47 additions and 5,294 deletions.
5 changes: 1 addition & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- [New and improved IK in Skeleton2D](https://github.com/godotengine/godot/pull/40347).
- New classes: SkeletonModifier2D, SkeletonModifierStack2D, SkeletonModification2DLookAt, SkeletonModification2DCCDIK, SkeletonModification2DFABRIK, SkeletonModification2DJiggle, SkeletonModification2DTwoBoneIK, PhysicalBone2D, SkeletonModification2DPhysicalBones, SkeletonModification2DStackHolder.
- New `Transform2D.looking_at()` function.
- [New and improved IK in Skeleton3D](https://github.com/godotengine/godot/pull/39353).
- New classes: SkeletonModifier3D, SkeletonModifierStack3D, SkeletonModifier3DLookAt, SkeletonModification3DCCDIK, SkeletonModification3DFABRIK, SkeletonModification3DJiggle, SkeletonModification3DTwoBoneIK, SkeletonModification3DStackHolder.
- The Bone struct now includes a local_pose_override.
- [Improvements to Skeleton3D](https://github.com/godotengine/godot/pull/39353).
- The Bone struct now keeps track of its children bones, if it has any.
- Added functions to Skeleton3D for getting the forward vector using the information stored in the rest pose for the bones.
- New `Basis.rotate_to_align()` function.
- Refactored the BoneAttachment3D node.
- Removed the `process_list` functions.
Expand Down
31 changes: 3 additions & 28 deletions doc/classes/BoneAttachment3D.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,6 @@
Returns the [NodePath] to the external [Skeleton3D] node, if one has been set.
</description>
</method>
<method name="get_override_mode" qualifiers="const" is_deprecated="true">
<return type="int" />
<description>
Deprecated. Local pose overrides will be removed.
Returns the override mode for the BoneAttachment3D node (0=global / 1=local).
</description>
</method>
<method name="get_override_pose" qualifiers="const">
<return type="bool" />
<description>
Returns whether the BoneAttachment3D node is overriding the bone pose of the bone it's attached to.
</description>
</method>
<method name="get_use_external_skeleton" qualifiers="const">
<return type="bool" />
<description>
Expand All @@ -49,21 +36,6 @@
Sets the [NodePath] to the external skeleton that the BoneAttachment3D node should use. The external [Skeleton3D] node is only used when [code]use_external_skeleton[/code] is set to [code]true[/code].
</description>
</method>
<method name="set_override_mode" is_deprecated="true">
<return type="void" />
<param index="0" name="override_mode" type="int" />
<description>
Deprecated. Local pose overrides will be removed.
Sets the override mode for the BoneAttachment3D node (0=global / 1=local). The override mode defines which of the bone poses the BoneAttachment3D node will override.
</description>
</method>
<method name="set_override_pose">
<return type="void" />
<param index="0" name="override_pose" type="bool" />
<description>
Sets whether the BoneAttachment3D node will override the bone pose of the bone it is attached to. When set to [code]true[/code], the BoneAttachment3D node can change the pose of the bone.
</description>
</method>
<method name="set_use_external_skeleton">
<return type="void" />
<param index="0" name="use_external_skeleton" type="bool" />
Expand All @@ -79,5 +51,8 @@
<member name="bone_name" type="String" setter="set_bone_name" getter="get_bone_name" default="&quot;&quot;">
The name of the attached bone.
</member>
<member name="override_pose" type="bool" setter="set_override_pose" getter="get_override_pose" default="false">
Whether the BoneAttachment3D node will override the bone pose of the bone it is attached to. When set to [code]true[/code], the BoneAttachment3D node can change the pose of the bone. When set to [code]false[/code], the BoneAttachment3D will always be set to the bone's transform.
</member>
</members>
</class>
96 changes: 6 additions & 90 deletions doc/classes/Skeleton3D.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
Skeleton3D provides a hierarchical interface for managing bones, including pose, rest and animation (see [Animation]). It can also use ragdoll physics.
The overall transform of a bone with respect to the skeleton is determined by the following hierarchical order: rest pose, custom pose and pose.
Note that "global pose" below refers to the overall transform of the bone with respect to skeleton, so it not the actual global/world transform of the bone.
To setup different types of inverse kinematics, consider using [SkeletonIK3D], or add a custom IK implementation in [method Node._process] as a child node.
</description>
<tutorials>
<link title="3D Inverse Kinematics Demo">https://godotengine.org/asset-library/asset/523</link>
Expand All @@ -32,26 +33,11 @@
Removes the global pose override on all bones in the skeleton.
</description>
</method>
<method name="clear_bones_local_pose_override" is_deprecated="true">
<return type="void" />
<description>
Deprecated. Local pose overrides will be removed.
Removes the local pose override on all bones in the skeleton.
</description>
</method>
<method name="create_skin_from_rest_transforms">
<return type="Skin" />
<description>
</description>
</method>
<method name="execute_modifications" is_deprecated="true">
<return type="void" />
<param index="0" name="delta" type="float" />
<param index="1" name="execution_mode" type="int" />
<description>
Executes all the modifications on the [SkeletonModificationStack3D], if the Skeleton3D has one assigned.
</description>
</method>
<method name="find_bone" qualifiers="const">
<return type="int" />
<param index="0" name="name" type="String" />
Expand Down Expand Up @@ -113,13 +99,6 @@
Returns the global rest transform for [param bone_idx].
</description>
</method>
<method name="get_bone_local_pose_override" qualifiers="const">
<return type="Transform3D" />
<param index="0" name="bone_idx" type="int" />
<description>
Returns the local pose override transform for [param bone_idx].
</description>
</method>
<method name="get_bone_name" qualifiers="const">
<return type="String" />
<param index="0" name="bone_idx" type="int" />
Expand Down Expand Up @@ -167,43 +146,18 @@
Returns the rest transform for a bone [param bone_idx].
</description>
</method>
<method name="get_modification_stack" is_deprecated="true">
<return type="SkeletonModificationStack3D" />
<description>
Returns the modification stack attached to this skeleton, if one exists.
</description>
</method>
<method name="get_parentless_bones" qualifiers="const">
<return type="PackedInt32Array" />
<description>
Returns an array with all of the bones that are parentless. Another way to look at this is that it returns the indexes of all the bones that are not dependent or modified by other bones in the Skeleton.
</description>
</method>
<method name="global_pose_to_local_pose" is_deprecated="true">
<return type="Transform3D" />
<param index="0" name="bone_idx" type="int" />
<param index="1" name="global_pose" type="Transform3D" />
<description>
Takes the passed-in global pose and converts it to local pose transform.
This can be used to easily convert a global pose from [method get_bone_global_pose] to a global transform in [method set_bone_local_pose_override].
</description>
</method>
<method name="global_pose_to_world_transform" is_deprecated="true">
<return type="Transform3D" />
<param index="0" name="global_pose" type="Transform3D" />
<description>
Deprecated. Use [Node3D] apis instead.
Takes the passed-in global pose and converts it to a world transform.
This can be used to easily convert a global pose from [method get_bone_global_pose] to a global transform usable with a node's transform, like [member Node3D.global_transform] for example.
</description>
</method>
<method name="global_pose_z_forward_to_bone_forward" is_deprecated="true">
<return type="Basis" />
<param index="0" name="bone_idx" type="int" />
<param index="1" name="basis" type="Basis" />
<method name="get_version" qualifiers="const">
<return type="int" />
<description>
Rotates the given [Basis] so that the forward axis of the Basis is facing in the forward direction of the bone at [param bone_idx].
This is helper function to make using [method Transform3D.looking_at] easier with bone poses.
Returns the number of times the bone hierarchy has changed within this skeleton, including renames.
The Skeleton version is not serialized: only use within a single instance of Skeleton3D.
Use for invalidating caches in IK solvers and other nodes which process bones.
</description>
</method>
<method name="is_bone_enabled" qualifiers="const">
Expand All @@ -213,15 +167,6 @@
Returns whether the bone pose for the bone at [param bone_idx] is enabled.
</description>
</method>
<method name="local_pose_to_global_pose" is_deprecated="true">
<return type="Transform3D" />
<param index="0" name="bone_idx" type="int" />
<param index="1" name="local_pose" type="Transform3D" />
<description>
Converts the passed-in local pose to a global pose relative to the inputted bone, [param bone_idx].
This could be used to convert [method get_bone_pose] for use with the [method set_bone_global_pose_override] function.
</description>
</method>
<method name="localize_rests">
<return type="void" />
<description>
Expand Down Expand Up @@ -298,19 +243,6 @@
[b]Note:[/b] The pose transform needs to be a global pose! To convert a world transform from a [Node3D] to a global bone pose, multiply the [method Transform3D.affine_inverse] of the node's [member Node3D.global_transform] by the desired world transform
</description>
</method>
<method name="set_bone_local_pose_override" is_deprecated="true">
<return type="void" />
<param index="0" name="bone_idx" type="int" />
<param index="1" name="pose" type="Transform3D" />
<param index="2" name="amount" type="float" />
<param index="3" name="persistent" type="bool" default="false" />
<description>
Deprecated. Local pose overrides will be removed.
Sets the local pose transform, [param pose], for the bone at [param bone_idx].
[param amount] is the interpolation strength that will be used when applying the pose, and [param persistent] determines if the applied pose will remain.
[b]Note:[/b] The pose transform needs to be a local pose! Use [method global_pose_to_local_pose] to convert a global pose to a local pose.
</description>
</method>
<method name="set_bone_name">
<return type="void" />
<param index="0" name="bone_idx" type="int" />
Expand Down Expand Up @@ -356,29 +288,13 @@
Sets the rest transform for bone [param bone_idx].
</description>
</method>
<method name="set_modification_stack" is_deprecated="true">
<return type="void" />
<param index="0" name="modification_stack" type="SkeletonModificationStack3D" />
<description>
Sets the modification stack for this skeleton to the passed-in modification stack, [param modification_stack].
</description>
</method>
<method name="unparent_bone_and_rest">
<return type="void" />
<param index="0" name="bone_idx" type="int" />
<description>
Unparents the bone at [param bone_idx] and sets its rest position to that of its parent prior to being reset.
</description>
</method>
<method name="world_transform_to_global_pose" is_deprecated="true">
<return type="Transform3D" />
<param index="0" name="world_transform" type="Transform3D" />
<description>
Deprecated. Use [Node3D] apis instead.
Takes the passed-in global transform and converts it to a global pose.
This can be used to easily convert a global transform from [member Node3D.global_transform] to a global pose usable with [method set_bone_global_pose_override], for example.
</description>
</method>
</methods>
<members>
<member name="animate_physical_bones" type="bool" setter="set_animate_physical_bones" getter="get_animate_physical_bones" default="true">
Expand Down
66 changes: 0 additions & 66 deletions doc/classes/SkeletonModification3D.xml

This file was deleted.

Loading

0 comments on commit 030a95d

Please sign in to comment.