Skip to content

Partial reloads 01: Move the Tachi animation sources into a consolidated Blender project - #176

Closed
sunzenshen wants to merge 2 commits into
masterfrom
stack/reload-zr68c/10-layout
Closed

sunzenshen wants to merge 2 commits into
masterfrom
stack/reload-zr68c/10-layout

Conversation

@sunzenshen

@sunzenshen sunzenshen commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Description

Move the Tachi model sources into one Blender file and add various animator quality of life tweaks.


This PR moves the Tachi model sources into one Blender file, viewmodels.blend, and adds the tools the
later weapon PRs use: a guarded export, range-of-motion limits on the rigs, and a sidebar panel for
animators. It (ideally) changes no game file with this iteration: the shipped Tachi SMDs and models are (almost within minor floating point drift after compilation) byte-for-byte the same, so nothing changes in game.


Overview of Changes

  • One Blender file, one scene per gun: neo/modelsrc/weapons/viewmodels.blend holds one scene per gun
    (jinrai_tachi) and replaces the per-team .blend files from Tachi animations for reload from empty with the slide locked open #170. The scene has one rig (<project>_rig), one
    camera, one Action (<project>_animations) with one slot per sequence, and the arm meshes of both teams, both
    skinned to that rig. A Team toggle (collection visibility, and a button in the panel) shows one team's arms or
    the other. A README_ANIMATOR text block in the file lists the rules. The Jinrai and NSF arm images move from
    tachi/textures/ to arms/textures/, shared by every weapon. They are Blender previews only; the blend keeps
    their paths relative.
  • Merge tool (merge_teams.py): builds the one scene from the two team scenes and checks that the merged
    scene poses the same as both originals (PASS 0.0000 u for the Tachi). It is kept in the repo so a later gun
    can be merged the same way.
  • Shared QC: the two Tachi QCs differed only in $modelname. Each team QC is now $modelname plus
    $include "../tachi/viewmodel.qci".
  • Export guard (export_viewmodels.py): the shipped slots stay the original clips. A rewrite that differs
    only by float round-off gets its old bytes back (KEPT); a real change restores every shipped SMD and fails,
    naming the slot, frame and bone, unless --edit-shipped is given. The export finds each scene's rig and Action
    by the project's name, so a new gun needs no table entry. The export writes only the Jinrai project of each gun; naming
    an nsf_ project fails with a message. NSF compiles its shipped clips from its own anims/ on disk. Glued
    clips and reload phase times are not here: a later layer adds them as glue.py, which the export and the
    panel run when the file is present.
  • Range-of-motion limits (rom_limits.py, rom_spec.json, rom_widen.json): each limited bone carries
    ROM:loc / ROM:rot constraints set to its range in the shipped clips plus 0.05 u / 0.5 deg, so a drag stops
    where the original animation never goes. The export checks every frame first and fails on a clamped key, then
    exports with the limits muted, so the SMDs are the keys. rom_widen.json lists meant poses past a limit
    (empty here).
  • Pace check: after the export, each authored slot (one the QC does not compile from the project's own
    anims/) is compared with the shipped clips; a PACE WARN names bones that move more than 10 % faster. The
    Tachi has no authored slot, so it reports 0.
  • Viewmodel panel (viewmodel_tools.py): a 3D Viewport sidebar tab that shows the slot's kind (shipped or
    authored), sets the frame range, checks the slot's limits, mutes or frees limits, widens a limit with a
    reason, and exports the gun (its Jinrai project). Not installed: blender viewmodels.blend --python viewmodel_tools.py.
  • README: the weapons README describes the layout, working in Blender, the preview camera, the limits,
    exporting, compiling and adding a gun.

How to Review

  • The text files carry the change: export_viewmodels.py, rom_limits.py, viewmodel_tools.py,
    compile_viewmodels.py (wording only), the QC / QCI files, the two JSON files and the README.
  • viewmodels.blend is binary. Its content is the two old Tachi scenes merged into one, plus the ROM:*
    constraints that rom_limits.py -- apply writes from rom_spec.json. The gates below check it against the
    shipped SMDs and models.
  • Commits, in order: shared QC; the single file with the export and limits; the panel; the README; the team
    merge (merge_teams.py, the one-scene blend, the export, panel and README updates; blend 1.89 to 1.17 MB).

Checks (measured)

Blender 5.2.3 with Blender Source Tools, Source SDK Base 2013 MP studiomdl.exe under Wine.

check result
merge_teams.py on the Tachi PASS 0.0000 u against both original scenes
export jinrai_tachi rc 0; 4 KEPT (round-off only); no shipped SMD or QC differs from the layer before the merge
range-of-motion check 0 clamps
rom_limits.py -- spec on the file rewrites rom_spec.json unchanged
compile both teams rc 0, 10 files; 8 byte-identical to the layer before the merge, the 2 .mdl differ in 6 bytes, all in texture-entry pointer slots
compiled vs shipped models 54 / 54 bones in order; every sequence same frames and fps; max bone position difference 0.0000 u, max rotation 0.053 deg (float32 floor of the compare tool); vertices 0.0000 u
panel loads headless; every slot reads as shipped; Team jinrai to nsf to jinrai switches the sleeve (screenshots: grey camo, dark NSF, same reload pose); Export gun rc 0, no SMD changed
in game (master's assets, as layer 01 changes only neo/modelsrc) Tachi: draw, 15 to 0 (fireempty), reloadempty 0 to 15, reserve 45 to 30, idle01; HUD matches; only the engine baseline asserts

The compiled models are not committed: they match the shipped ones, so the shipped files stay.
A recompile does not reproduce the shipped .vvd byte for byte: the normals and tangents differ by at most
1.8e-7 (one float rounding step); positions, weights, UVs and vertex order are identical. Compiling master's own
Tachi sources gives the same bytes as this PR, so the difference comes from the studiomdl build, not from this change.


Toolchain

  • Windows MSVC VS2022
  • Linux GCC Distro Native (Linux Mint 22.3, GCC 13.3.0)

Related

@sunzenshen
sunzenshen force-pushed the stack/reload-zr68c/10-layout branch from b595a45 to d7287f1 Compare November 9, 2026 04:50
@sunzenshen sunzenshen changed the title Move the Tachi sources into one viewmodels.blend Partial reloads 10: Move the Tachi sources into one viewmodels.blend Nov 9, 2026
@sunzenshen sunzenshen closed this Nov 9, 2026
@sunzenshen
sunzenshen deleted the stack/reload-zr68c/10-layout branch November 9, 2026 05:05
@sunzenshen
sunzenshen restored the stack/reload-zr68c/10-layout branch November 9, 2026 05:05
@sunzenshen sunzenshen reopened this Nov 9, 2026
@sunzenshen sunzenshen changed the title Partial reloads 10: Move the Tachi sources into one viewmodels.blend Partial reloads 01: Move the Tachi sources into one viewmodels.blend Nov 9, 2026
@sunzenshen
sunzenshen requested a review from sunmachine November 9, 2026 05:52
@sunzenshen
sunzenshen marked this pull request as ready for review November 9, 2026 05:52
One Blender file holds a scene per viewmodel project (rig, preview
mesh, camera, one Action with a slot per sequence), replacing the
per-team .blend files. The two Tachi QCs share one viewmodel.qci and
the arm preview images move to arms/textures for every weapon.

The export now guards the shipped clips (round-off rewrites keep the
old bytes; a real change fails unless --edit-shipped), checks the
range-of-motion limits from rom_spec.json before writing, and warns
when an authored slot moves faster than the shipped clips. A sidebar
panel (viewmodel_tools.py) runs these from Blender. The README
describes the workflow.

The shipped Tachi SMDs and models are unchanged.
viewmodels.blend now holds one scene per gun: jinrai_tachi keeps its
rig and action, and the NSF preview mesh moves onto that rig in its own
collection, so one key moves both teams' arms. The NSF project has no
scene: it compiles from its shipped SMDs on disk. merge_teams.py did
the merge and stays for a gun added later with two scenes.

The export takes the Jinrai project only and refuses an NSF one.
--edit-shipped copies a changed shipped SMD into the NSF project, so
both teams play the edited clip. rom_spec.json has one section per
gun. The Viewmodel panel shows the team on view and flips it with a
Team button. The preview images keep their paths relative to the
.blend.

Export jinrai_tachi: rc 0, no clamp, no SMD changed. Both Tachi models
compile byte-identical to before, except the texture pointer slots
studiomdl leaves uninitialized.
@sunzenshen

Copy link
Copy Markdown
Contributor Author

Related to the Tachi animation assets from #170:

ps-tachi-2-empty.mp4
ps-tachi-3-drawempty.mp4

@sunzenshen

sunzenshen commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor Author

To reiterate the proposed process from Discord, the intention is not to merge this specific PR directly. Instead, It's meant to help illustrate the gradual evolution from small steps to the larger picture.

The first PR of this stack that would be a candidate for merging in to master would be the sprint with an empty open Tachi animation: #194

But depending on how quickly we get through the first 4 PRs, it might be better to merge the combined Tachi and Milso PRs: #196

@sunzenshen sunzenshen changed the title Partial reloads 01: Move the Tachi sources into one viewmodels.blend Partial reloads 01: Move the Tachi animation sources into one viewmodels.blend Nov 10, 2026
@sunzenshen sunzenshen changed the title Partial reloads 01: Move the Tachi animation sources into one viewmodels.blend Partial reloads 01: Move the Tachi animation sources into a consolidated Blender project Nov 10, 2026
@sunzenshen

Copy link
Copy Markdown
Contributor Author

Closing in favor of reviewing #196 as a consolidated PR, with the commits showing the staged evolution of the combined feature.

@sunzenshen sunzenshen closed this Nov 12, 2026
This was referenced Nov 13, 2026
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