Skip to content

Add CSC (Composite Scene) editor#371

Open
robert-d-schultz wants to merge 2 commits into
donkeyProgramming:masterfrom
robert-d-schultz:csc-editor
Open

Add CSC (Composite Scene) editor#371
robert-d-schultz wants to merge 2 commits into
donkeyProgramming:masterfrom
robert-d-schultz:csc-editor

Conversation

@robert-d-schultz

Copy link
Copy Markdown
Contributor

Summary

  • Adds a full editor for Total War .csc (Composite Scene) files: an ESF binary envelope reader/writer (Shared/GameFiles/Esf, ported from RPFM's ESF handling), CSC-specific grammar detectors for ROOT/ELEMENT/COMPOSITE_SCENE (Shared/GameFiles/CSC), and the editor itself (Editors/CscEditor) — scene graph building, skeletal animation playback with cross-fade blending and bone-splice overrides across overlapping bindings, a custom transform gizmo, a keyframe curve editor, and a look-through-camera porthole preview.
  • Supporting engine changes the editor depends on: Camera.ViewMatrixOverride/ProjectionMatrixOverride, RenderEngineComponent/RenderTargetHelper additions for the porthole preview, GameSkeleton.CreateFromAnimationFile for ad-hoc skeletons, AnimationPlayer.SetManualFrame for cross-fading clips, and a corrected bone-attach/pivot composition order in Rmv2MeshNode.
  • A few small unrelated bug fixes found along the way: a mouse-capture drag freeze, a dropped attach-point name for nested variant-mesh children, and a bind-pose fallback in SkeletonBoneAnimationResolver.

Test plan

  • Full solution build: 0 errors
  • Full test suite green across all 12 test projects, including 22/22 new Test.CscEditor tests and 83/83 GameWorld.CoreTest

robert-d-schultz and others added 2 commits July 22, 2026 08:14
- WpfMouse: a missed hit-test mid-drag no longer stops position tracking
  before the button is released, so fast mouse movement during a capture
  drag doesn't freeze the cursor.
- ComplexMeshLoader: nested <VARIANT_MESH> children under a <SLOT> were
  losing their attach_point name (the recursive call passed the outer
  attachmentPointName through instead of slot.AttachmentPoint).
- SkeletonBoneAnimationResolver: added a bind-pose fallback when no
  animation frame is available and a bounds check against BoneCount,
  so attach_point/rigid-bone meshes don't collapse to the model origin.
- Pin SQLitePCLRaw.bundle_e_sqlite3 2.1.12 in the three
  TreatWarningsAsErrors projects that pull in a vulnerable transitive
  version (NU1903 audit advisory).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Adds a full editor for Total War .csc files: an ESF envelope
reader/writer (Shared/GameFiles/Esf, ported from RPFM's ESF format
handling), CSC-specific grammar detectors for ROOT/ELEMENT/
COMPOSITE_SCENE (Shared/GameFiles/CSC), and the editor itself
(Editors/CscEditor) - scene graph building, skeletal animation
playback/blending/splicing across overlapping bindings, a custom
gizmo, a keyframe curve editor, and a look-through-camera porthole
preview.

Supporting engine changes needed by the editor:
- Camera: ViewMatrixOverride/ProjectionMatrixOverride for looking
  through a scene-defined camera.
- RenderEngineComponent/RenderTargetHelper: HideGrid, SquareRenderSize
  and an alpha-preserving LastFrame for the porthole preview.
- GameSkeleton.CreateFromAnimationFile: builds a skeleton directly
  from an animation's own bone table for "ad-hoc" skeletons that have
  no dedicated skeleton file (e.g. building-destruction rigs) - also
  wired into SceneObjectEditor.SetAnimation for every editor.
- AnimationPlayer.SetManualFrame: lets external code inject an
  already-sampled frame, used for cross-fading overlapping clips.
- Rmv2MeshNode: corrected bone-attach and pivot composition order,
  and a new AttachmentOuterWorld slot so CSC's flat scene graph
  (which must push a leaf's full world into ModelMatrix for picking)
  and Kitbasher's nested scenegraph can share the same attach-bone
  resolver without one clobbering the other.

22 new unit tests (ESF round-trip, channel evaluation, scene
round-trip with hierarchy/keyframes, nested-element handling).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.

1 participant