Repository navigation
Animation networks - #25
Draft
filipppavlov wants to merge 29 commits into
Draft
filipppavlov wants to merge 29 commits into
filipppavlov wants to merge 29 commits into
Conversation
…d bugprone-easily-swappable-parameters as they are too noisy
- Add carbon-parser (and its re2c build dependency) from the carbon vcpkg registry and link it privately into CarbonMesh. - Move pose blending math into internal kernels (posekernels.h) shared by the public blend functions; the blend functions now set outPose.skeleton, which they previously left unset. - Move curve sampling helpers into animationinternal.h and the span pointer validator into validationutils.h so they can be reused. - Add tests for BlendPoses, ExtractBoneWeights and weighted BlendAdditivePose, which had no coverage. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- AnimationNetworkBuilder / AnimationGraphBuilder: editable network model (nodes, edges, parameters, subgraphs, expressions, asset references) with validation, saving to and loading from CAN files. - AnimationNetwork: read-only runtime network that loads a CAN file in place without per-node allocations and resolves assets through an AnimationAssetLoader or embedded CMF sections. - CAN file format (cmf::can::v1): header with CRC, network section with per-node-type data tables, embedded CMF sections; malformed files are rejected by validation. - .clang-tidy: CamelCase enums, template parameters and type aliases; ignore all-public structs in the non-private member checks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Compile ready networks once into a single memory block shared by all instances: subgraphs are inlined, producers are sorted in evaluation order, curves are bound to skeleton bones, bone weights are precomputed and pose slots are reused based on liveness. - AnimationNetworkInstance evaluates a network per animated object with one allocation and no allocations per frame: stateful playheads, lazy evaluation of unused branches, Switch/RandomSwitch selection with reroll on cycle and on activation, expressions and parameters. - Make adding node types safe: per-type node descriptions drive the socket layout, compiler and instance use one handler per type, and switches over node and operation types have no default case, with missing cases reported as errors (MSVC C4062, -Wswitch). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Move the Vulkan renderer, renderables, camera, shaders and CMF content loading from src/viewer to a private static library in src/render so that other tools can reuse it. - Renderables no longer depend on the viewer AppState; they expose plain setters. A new ViewerBinding in the viewer forwards AppState changes to them and reflects LOD and morph weights back for the UI. - Add RenderTarget for offscreen rendering, and an ImGuiLayer wrapping the ImGui GLFW/Vulkan backends (also used by the viewer). - AnimationState can apply an externally evaluated pose, matching bones by name. - Log functions are type safe templates over a single printf sink. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rors - CAN files may contain one EditorData section with opaque data of editing tools. The builder keeps it (Set/GetEditorData) and writes it as the last section; the runtime ignores it. FILE_VERSION is unchanged. - AnimationNetworkBuilder::GetSaveLayout returns graphs and nodes in the order Save stores them, so that tools can key data by file location. - GetAnimationNodeTypeInfo exposes node type names and fixed sockets. - Missing animations, bone masks and bones are warnings (GetWarnings) instead of errors: the network evaluates with rest poses, full bone weights and ignored bones respectively. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Editing logic of the animation network editor, independent of the UI:
- PathResolver maps protocol prefixes ("res:/...") to directories.
- FileAssetLoader loads network assets from files, shares them between
networks and remembers load errors.
- Document keeps node positions, graph views and the preview mesh, and
stores them as JSON in the EditorData section of CAN files. Networks
without editor data are laid out automatically.
- EditorSession provides the open graph, selection, snapshot based
undo/redo and editing operations, including clipboard copy/paste.
- EditorSettings persists prefixes, recent files and panel sizes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ImGui application on top of CanEditCore and CarbonMeshRender: - Graph canvas with zoom/pan, box and click selection, node dragging, socket connections, edge selection, context menus, drag and drop from the palette and parameters, clipboard and subgraph navigation. - Palette, properties, parameters and problems/assets panels in a fixed layout with resizable splitters; path prefix settings. - Preview that rebuilds the runtime network after edits and poses the preview mesh (or the skeleton) in an offscreen render target, with play controls and preview parameter values. - Networks with a missing skeleton can only have their skeleton fixed. Also: ImGuiLayer can clear the swapchain, and EditorSession::Reload requests assets again after path prefixes change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add the CanEdit user guide and describe the new render library and editor components in AGENTS.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Update now applies parameters, advances time, takes state machine transitions, rerolls RandomSwitch nodes and marks the operations that contribute to the pose. Evaluate only computes the decided pose and has no side effects, so it can be skipped or called repeatedly. Parameters set with SetParameter take effect at the next Update. The CanEdit preview calls Update( 0 ) while paused to apply edited values. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Animation networks, the CAN format, and the CanEdit editor
This branch adds a runtime for blending animations with a node graph, a binary file format for those graphs (CAN), and CanEdit, an ImGui editor for building them. To let the editor reuse the viewer's renderer, the rendering code moves out of the viewer into a static library.
Library (CarbonMesh)
Building networks
Node types
State machines
Runtime
CAN file format (include/cmf/can.h, namespace cmf::can::v1)
Shared internals and fixes
Dependencies
Render library (src/render, CarbonMeshRender)
CanEdit (src/canedit, requires -DBUILD_TOOLS=ON)
Tooling and docs
Compatibility
Testing
AI assistance
1000%