Skip to content
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

Removed the skeleton property from the .animationset resource. #7990

Merged
merged 9 commits into from Sep 20, 2023

Conversation

JCash
Copy link
Contributor

@JCash JCash commented Sep 12, 2023

We've removed the skeleton property from the .animationset resource.
This allows us to better match animation names with bone names at runtime.

The root bone of a skeleton is now also always renamed to root, making it easier to use similar code in engine/scripting.

Fixes #7712

PR checklist

  • Code
    • Add engine and/or editor unit tests.
    • New and changed code follows the overall code style of existing code
    • Add comments where needed
  • Documentation
    • Make sure that API documentation is updated in code comments
    • Make sure that manuals are updated (in github.com/defold/doc)
  • Prepare pull request and affected issue for automatic release notes generator
    • Pull request - Write a message that explains what this pull request does. What was the problem? How was it solved? What are the changes to APIs or the new APIs introduced? This message will be used in the generated release notes. Make sure it is well written and understandable for a user of Defold.
    • Pull request - Write a pull request title that in a sentence summarises what the pull request does. Do not include "Issue-1234 ..." in the title. This text will be used in the generated release notes.
    • Pull request - Link the pull request to the issue(s) it is closing. Use on of the approved closing keywords.
    • Affected issue - Assign the issue to a project. Do not assign the pull request to a project if there is an issue which the pull request closes.
    • Affected issue - Assign the "breaking change" label to the issue if introducing a breaking change.
    • Affected issue - Assign the "skip release notes" is the issue should not be included in the generated release notes.

@@ -180,7 +175,7 @@ static void loadModelAnimations(ArrayList<ModelImporter.Bone> bones, AnimationSe

// Currently, by design choice, each file must only contain one animation.
// Our current approach is to choose the longest animation (to eliminate target poses etc)
ModelUtil.loadAnimations(scene, bones, animBuilder, animId, localAnimationIds);
ModelUtil.loadAnimations(scene, animBuilder, animId, localAnimationIds);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We no longer require the bones when loading an animation.
we load it as-is, and instead do animation track/bone matching at runtime.

Comment on lines +426 to +431
String boneName = bone.getSourceId();
if (bi == 0 || refIndex == 0)
{
boneName = "root";
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another change after a design discussion with @matgis : Since the root bone is such a unique bone, we wanted to make sure it's always named the same, making it easier for users to import content from various sources.

@JCash JCash marked this pull request as ready for review September 15, 2023 08:02
matgis
matgis previously approved these changes Sep 15, 2023
Copy link
Contributor

@matgis matgis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Editor and .proto changes look good to me.

(defn register-resource-types [workspace]
(resource-node/register-ddf-resource-type workspace
:ext "animationset"
:icon animation-set-icon
:label "Animation Set"
:load-fn load-animation-set
:sanitize-fn sanitize-animation-set
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@JCash JCash merged commit 3509aa9 into dev Sep 20, 2023
23 checks passed
@JCash JCash deleted the skeleton-remap branch September 20, 2023 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Model animation broken in 1.4.6
2 participants