Skip to content

AnimationSystem2 support #876

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

Merged
merged 21 commits into from
Jul 29, 2025
Merged

AnimationSystem2 support #876

merged 21 commits into from
Jul 29, 2025

Conversation

kristiker
Copy link
Member

@kristiker kristiker commented Dec 11, 2024

Valve is developing a new animation system for Source 2 and has pushed a few resource files in Deadlock and CS2 that we can experiment with. Open source implementation that inspires this new Source 2 system can be found here.

TODO

  • Parse animation sequence/clip (NmClip)
    • Metadata
    • Bone Positions
    • Bone Rotations
    • Bone Scales
  • Parse skeleton (NmSkel)
  • Test animations on renderer

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces support for the new AnimationSystem2 implementation by adding a new AnimationClip resource type (NmClip) and integrating it into the animation pipeline and viewer modules.

  • Added AnimationClip class in ModelAnimation2 for parsing and handling new animation data.
  • Extended the Skeleton and Animation classes to support the new data formats and integrated the new resource type in Resource, Viewer, and Renderer layers.

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
ValveResourceFormat/Resource/ResourceTypes/ModelAnimation2/AnimationClip.cs Implements reading and decoding for new animation clip data.
ValveResourceFormat/Resource/ResourceTypes/ModelAnimation/Skeleton.cs Introduces a new Skeleton constructor from NmSkeleton and updates bone parent assignment.
ValveResourceFormat/Resource/ResourceTypes/ModelAnimation/Animation.cs Integrates the new AnimationClip within the existing Animation framework.
ValveResourceFormat/Resource/Resource.cs Registers the new NmClip resource type.
GUI/Types/Viewers/Resource.cs Adds a new viewer case for the AnimationClip resource.
GUI/Types/Renderer/SkeletonSceneNode.cs Adjusts animation update logic to account for the new Animation2 property.
GUI/Types/Renderer/GLModelViewer.cs Adds support for rendering the new AnimationClip by initializing the appropriate AnimationController.

@ValveResourceFormat ValveResourceFormat deleted a comment from Copilot AI Mar 27, 2025
@ValveResourceFormat ValveResourceFormat deleted a comment from Copilot AI Mar 27, 2025
@kristiker kristiker marked this pull request as ready for review July 29, 2025 10:06
Comment on lines 53 to 57
public GLModelViewer(VrfGuiContext guiContext, AnimationClip anim) : base(guiContext)
{
this.clip = anim;
}

Copy link
Member Author

Choose a reason for hiding this comment

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

It might be better to make a different class. Maybe later on.

@@ -255,6 +255,11 @@ public virtual void PostSceneLoad()
offset = Math.Clamp(offset, 0f, 2000f);
var location = new Vector3(offset, 0, offset);

if (this is GLModelViewer { clip: not null })
Copy link
Member

Choose a reason for hiding this comment

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

dont like this hack

@kristiker kristiker merged commit 91b9811 into master Jul 29, 2025
6 checks passed
@kristiker kristiker deleted the anim2 branch July 29, 2025 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy