import { type ConstraintRestReport } from './constraintRest'; import { type Document } from '@gltf-transform/core'; import { type BindNormalizeOptions, type BindNormalizeReport } from './armBind'; import { type ArmReachReport, type StaticWeightsOptions, type StaticWeightsReport } from './hairWeights'; import { type RestPoseOptions, type RestPoseReport } from './restPose'; import { type LimbBridgeOptions, type LimbBridgeReport } from './limbBridge'; /** * `helix character fix-rig -o `: the importer's rig-fix stages on an already-imported HELIX * character (the 68-joint helix-humanoid@1 skeleton, one skin per LOD). Order matters and matches the importer: * 1. limb bridges (limbBridge.ts): a hand fused to the thigh is cut free, judged under the arm re-bind of step 3 * (`previewArmRebind`), where the bridge would tear — not in the low source pose, where it does not stretch; * 2. arm reach (hairWeights.ts `releaseArmReach`): arm weight on geometry that is not the arm (a coat skirt the * auto-rig gave to the hands) goes to the pelvis/thighs/spine it hangs from, so the re-bind leaves it in place; * 3. bind normalisation (armBind.ts): arms onto the platform A-pose (+ sleeve allowance), head pitch; * 4. static weights (hairWeights.ts): hair and cloth hanging on the back onto the spine -> neck -> head chain. * Around them, rest pose (restPose.ts): joints far off the standard skeleton and spine/leg rests far off the canonical ones are * corrected FIRST (so the bridges and the arm re-bind judge the final legs), and the skeleton is lifted LAST so the soles clear the floor. * Every LOD skin gets the same treatment. Only vertex attributes (and, for a cut bridge, triangles), joint TRS and * inverse bind matrices change. */ export interface FixRigOptions { bind?: BindNormalizeOptions | false; weights?: StaticWeightsOptions | false; /** Arm<->leg bridge repair (stages/limbBridge.ts) before the re-bind, judged under it. Default on; `false` skips. */ limbBridges?: LimbBridgeOptions | false; /** Joint moves, canonical spine/leg rests and the ground lift (stages/restPose.ts). Default on; `false` skips. */ restPose?: RestPoseOptions | false; } export interface FixRigReport { input: string; output: string; weights: StaticWeightsReport | null; armReach: ArmReachReport | null; limbBridges: LimbBridgeReport | null; bind: BindNormalizeReport | null; restPose: RestPoseReport | null; } /** Joint moves and rests (before the bridges and arms) and the ground lift (last) are two passes of one report. */ export declare function mergeRestPose(a: RestPoseReport | null, b: RestPoseReport | null): RestPoseReport | null; export declare function fixRigDocument(document: Document, options?: FixRigOptions): Promise<{ weights: StaticWeightsReport | null; armReach: ArmReachReport | null; limbBridges: LimbBridgeReport | null; bind: BindNormalizeReport | null; restPose: RestPoseReport | null; constraints: ConstraintRestReport; }>; export declare function fixRigFile(inputPath: string, outputPath: string, options?: FixRigOptions): Promise; /** Human-readable lines for a fix-rig report (also used by the importer log). */ export declare function describeFixRig(report: { weights: StaticWeightsReport | null; armReach?: ArmReachReport | null; limbBridges?: LimbBridgeReport | null; bind: BindNormalizeReport | null; restPose?: RestPoseReport | null; output?: string; }): string[];