| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [View Raw Code] [Original HTTPS Page] |
Version: 1.0 · Created: 2026-08-29
How this project documents itself so it stays understandable, scalable, and transferable — to a new contributor, or to an agent starting a fresh session.
| Layer | Location | Audience | Updated |
|---|---|---|---|
| Memory | memory/*.md | Agents + maintainers resuming work | Every session |
| Architecture | memory/architecture.md, mindmap.md | Anyone changing structure | Every structural change |
| API reference | Doxygen from headers → docs/api/ | Library consumers | Generated on build |
| Guides | docs/guides/*.md | New contributors, users | On feature change |
| Formats | docs/formats/*.md | Importer/exporter authors | On format change |
| ADRs | docs/adr/NNNN-*.md | Future maintainers asking "why?" | On each significant decision |
| Changelog | CHANGELOG.md | Users | Every release |
| Licensing | LICENSING.md | Legal, redistributors | Every dependency/asset change |
/// Applies the full modifier stack to the base mesh.
///
/// Resets every vertex to its original position, then applies each target in
/// @p stack at its recorded weight. Application is additive and order-independent
/// because each target contributes a sparse offset:
///
/// coord[verts[i]] += data[i] * weight
///
/// @param stack Target paths mapped to weights. Zero-weight entries must be
/// absent — the reference deletes them
/// (legacy/python/apps/human.py:920-921) and callers rely on it.
/// @param out Destination, resized to the base mesh vertex count.
/// @return Number of vertices actually modified, for dirty-range tracking.
///
/// @note Thread-safe with respect to @p stack; @p out must not be shared.
/// @see memory/architecture.md §I.3 for the reference behaviour this matches.
[[nodiscard]] uint32_t applyStack(const TargetStack& stack, std::span<Vec3> out) const;Required tags on every public entity: a one-line summary, @param for each parameter, @return when non-void, @note for threading or lifetime constraints.
Comment the non-obvious only. Specifically do comment:
// Quantised to int16 * 1e-3 to match the compiled-target format
// (legacy/python/core/algos3d.py:221). Widening this breaks .npz compatibility.// ponytail: linear scan over 163 bones. Fine at this size; index by name
// if a rig ever exceeds ~1k bones.Do not comment what the code plainly states. // increment i is noise.
One file per significant decision: docs/adr/0001-use-qt-rhi.md.
# ADR 0001 — Use Qt RHI rather than direct Metal
Date: 2026-08-29
Status: Accepted (Proposed | Accepted | Superseded by ADR-NNNN | Deprecated)
## Context
OpenGL is deprecated on macOS and capped at 4.1. The Python reference uses the
fixed-function pipeline with client-side vertex arrays and needs nothing above
GL 2.1 (verified: no glGenBuffers anywhere in legacy/python/lib/glmodule.py).
We must choose a modern graphics backend.
## Decision
Use Qt RHI with the Metal backend on macOS.
## Consequences
+ Ships with Qt 6; no extra dependency.
+ qsb bakes shaders once for Metal/Vulkan/D3D12 — keeps Windows/Linux open.
+ Integrates with QRhiWidget, so the viewport is a normal widget.
- One abstraction layer away from Metal; compute-shader morphing needs checking.
- Depth range differs from GL (z in [0,1] not [-1,1]) — lib/matrix.py:60-92
must be reworked, not transliterated.
## Alternatives considered
- Direct Metal: maximum control, but macOS-only and much more code.
- bgfx: capable, but a third-party dependency duplicating what Qt already ships.Write an ADR when a decision is expensive to reverse, surprising to a newcomer, or was contested. Not for routine choices.
Every file format we read or write gets docs/formats/<format>.md:
This matters disproportionately here: .mhm, .mhclo, .mhmat, .mhskel, .target, .mhw, .mhpose have no specification anywhere — the Python source is the only definition. Writing these documents is how that knowledge stops being locked in legacy/python/.
Mermaid, inline in Markdown, so diagrams version and diff as text.
flowchart LR
slider[Slider drag] --> mod[Modifier.updateValue]
mod --> weights[weight = value x PROD factors]
weights --> stack[TargetStack]
stack --> apply["coord[v] += offset * w"]
apply --> dirty[Dirty ranges]
dirty --> gpu[Partial VBO update]
gpu --> draw[RHI draw]
Use a diagram when structure or flow is the point. Never a diagram that only restates a list. Every diagram carries a caption naming what it shows and what it deliberately omits.
Keep-a-Changelog format, SemVer. Grouped Added / Changed / Deprecated / Removed / Fixed / Security. Written for users, not committers: "FBX export now writes correct units at every scale" — not "fix scale_factor".
Every entry that fixes reference behaviour notes the difference explicitly, because output will change for existing users.
Every document carries **Version:** and **Created:**/**Updated:**. Any document making claims about the reference implementation also names the commit it was verified against. Format docs carry the format version they describe.
When a doc is superseded, mark it Status: Superseded by <path> and keep it — history explains why things are the way they are.
legacy/python/core/files3d.py:41-64 is the cautionary example: its docstring promises "a range of functions to handle most common 3D file formats" and the module reads exactly one — OBJ. Aspirational documentation is a lie with a timestamp.
| Back | FazBrowse Home | New Git URL |