-
Notifications
You must be signed in to change notification settings - Fork 234
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
Conversation
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.
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. |
Co-Authored-By: Pavel Djundik <xPaw@users.noreply.github.com>
Co-Authored-By: Pavel Djundik <xPaw@users.noreply.github.com>
GUI/Types/Renderer/GLModelViewer.cs
Outdated
public GLModelViewer(VrfGuiContext guiContext, AnimationClip anim) : base(guiContext) | ||
{ | ||
this.clip = anim; | ||
} | ||
|
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 might be better to make a different class. Maybe later on.
GUI/Types/Renderer/GLSceneViewer.cs
Outdated
@@ -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 }) |
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.
dont like this hack
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