-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement a base class SkeletonModifier3D
as refactoring for nodes that may modify Skeleton3D
#87888
Merged
akien-mga
merged 1 commit into
godotengine:master
from
TokageItLab:animation-post-processable
Apr 4, 2024
Merged
Implement a base class SkeletonModifier3D
as refactoring for nodes that may modify Skeleton3D
#87888
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<class name="PhysicalBoneSimulator3D" inherits="SkeletonModifier3D" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> | ||
<brief_description> | ||
Node that can be the parent of [PhysicalBone3D] and can apply the simulation results to [Skeleton3D]. | ||
</brief_description> | ||
<description> | ||
Node that can be the parent of [PhysicalBone3D] and can apply the simulation results to [Skeleton3D]. | ||
</description> | ||
<tutorials> | ||
</tutorials> | ||
<methods> | ||
<method name="is_simulating_physics" qualifiers="const"> | ||
<return type="bool" /> | ||
<description> | ||
Returns a boolean that indicates whether the [PhysicalBoneSimulator3D] is running and simulating. | ||
</description> | ||
</method> | ||
<method name="physical_bones_add_collision_exception"> | ||
<return type="void" /> | ||
<param index="0" name="exception" type="RID" /> | ||
<description> | ||
Adds a collision exception to the physical bone. | ||
Works just like the [RigidBody3D] node. | ||
</description> | ||
</method> | ||
<method name="physical_bones_remove_collision_exception"> | ||
<return type="void" /> | ||
<param index="0" name="exception" type="RID" /> | ||
<description> | ||
Removes a collision exception to the physical bone. | ||
Works just like the [RigidBody3D] node. | ||
</description> | ||
</method> | ||
<method name="physical_bones_start_simulation"> | ||
<return type="void" /> | ||
<param index="0" name="bones" type="StringName[]" default="[]" /> | ||
<description> | ||
Tells the [PhysicalBone3D] nodes in the Skeleton to start simulating and reacting to the physics world. | ||
Optionally, a list of bone names can be passed-in, allowing only the passed-in bones to be simulated. | ||
</description> | ||
</method> | ||
<method name="physical_bones_stop_simulation"> | ||
<return type="void" /> | ||
<description> | ||
Tells the [PhysicalBone3D] nodes in the Skeleton to stop simulating. | ||
</description> | ||
</method> | ||
</methods> | ||
</class> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<class name="SkeletonModifier3D" inherits="Node3D" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> | ||
<brief_description> | ||
A Node that may modify Skeleton3D's bone. | ||
</brief_description> | ||
<description> | ||
[SkeletonModifier3D] retrieves a target [Skeleton3D] by having a [Skeleton3D] parent. | ||
If there is [AnimationMixer], modification always performs after playback process of the [AnimationMixer]. | ||
</description> | ||
<tutorials> | ||
</tutorials> | ||
<members> | ||
<member name="active" type="bool" setter="set_active" getter="is_active" default="true"> | ||
If [code]true[/code], the [SkeletonModifier3D] will be processing. | ||
</member> | ||
<member name="influence" type="float" setter="set_influence" getter="get_influence" default="1.0"> | ||
Sets the influence of the modification. | ||
[b]Note:[/b] This value is used by [Skeleton3D] to blend, so the [SkeletonModifier3D] should always apply only 100% of the result without interpolation. | ||
</member> | ||
</members> | ||
<signals> | ||
<signal name="modification_processed"> | ||
<description> | ||
Notifies when the modification have been finished. | ||
[b]Note:[/b] If you want to get the modified bone pose by the modifier, you must use [method Skeleton3D.get_bone_pose] or [method Skeleton3D.get_bone_global_pose] at the moment this signal is fired. | ||
</description> | ||
</signal> | ||
</signals> | ||
</class> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is confusing that "Active" and "Visible" are separate properties here.
if SkeletonModifier3D is a child of Node3D, it seems to me that it should use the Node3D visible property instead.
I am unsure why SkeletonModifier3D is a Node3D. If it's a Node, then a custom active property makes more sense, similar to AnimationMixer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is because XRModifiers inherit Node3D. I believe it make sense for SkeletonModifier3D extending Node3D in order to access the 3D coordinates of the world from within the modifier.
It may indeed be possible to integrate this with
visible
property since it is Node3D not Node unlike AnimationPlayer, but I am not sure if that is a good idea.