MoonBit-native BVH motion capture parser, validator, analysis helpers, and asset pipeline toolkit.
moon add zhangbowen2006/moonbvhkitmoon check
moon build
moon test
moon run cmd/main
moon run cmd/main -- --json
moon run cmd/main -- --csv
moon run cmd/main -- --quality --json
moon run cmd/main -- --profiles --csv
moon run examples/basictest "parse a BVH clip" {
let parsed = @moonbvhkit.parse_bvh(@moonbvhkit.fixture_walk_bvh())
assert_true(parsed.ok)
let doc = parsed.document
let stats = @moonbvhkit.analyze_bvh(doc)
assert_eq(stats.joint_count, 4)
assert_eq(stats.channel_count, 15)
}moon run cmd/main
moon run cmd/main -- --json
moon run cmd/main -- --csv
moon run cmd/main -- --quality
moon run cmd/main -- --quality --json
moon run cmd/main -- --profile unity
moon run cmd/main -- --profile blender --json
moon run cmd/main -- --profile strict-ci --csv
moon run cmd/main -- --profiles
moon run cmd/main -- --help| Area | Public API |
|---|---|
| Parse | tokenize_bvh, parse_bvh, parse_bvh_or_empty |
| Model | BvhDocument, BvhJoint, BvhMotion, BvhChannel, BvhVec3 |
| Query | joint_names, joint_paths, find_joint, find_joint_by_path, channels_in_motion_order |
| Frames | frame_values_for_joint, frame_values_for_joint_name, root_position_at, joint_rotation_at |
| Analysis | analyze_bvh, channel_ranges, widest_channel_range, detect_static_channels, sample_root_motion |
| Skeleton | skeleton_bones, summarize_skeleton, compare_skeletons, build_name_based_retarget_map |
| Motion Tools | slice_document, frame_at_time, root_speed_samples, detect_root_teleports, normalize_root_origin |
| Validation | validate_bvh, validate_document, validation_summary |
| Quality | quality_report, quality_report_from_bvh, quality_report_to_text, quality_report_to_json, quality_report_to_csv, quality_action_for_bvh |
| Import Profiles | unity_import_profile, blender_import_profile, strict_ci_import_profile, evaluate_import_profile, import_decision_to_json |
| Export | document_to_json, joint_table_csv, channel_range_csv, root_motion_csv |
| Integration | build_unity_clip_plan, build_blender_import_plan, bvh_runtime_manifest |
| Report | build_report, format_report, bvh_fixture_report |
fn BvhChannelMean::new(index : Int, name : String, mean : Double, sample_count : Int) -> BvhChannelMeanfn BvhChannelRange::new(path : String, channel : String, index : Int, min : Double, max : Double) -> BvhChannelRangepub(all) struct BvhError {
kind : BvhErrorKind
line : Int
column : Int
token : String
message : String
} derive(Eq, Debug)fn BvhError::new(kind : BvhErrorKind, message : String, line? : Int, column? : Int, token? : String) -> BvhErrorpub(all) struct BvhImportDecision {
profile_name : String
accepted : Bool
action : String
quality : BvhQualityReport
issues : Array[BvhValidationIssue]
} derive(Eq, Debug)pub(all) struct BvhImportProfile {
kind : BvhImportProfileKind
name : String
max_joint_count : Int
max_depth : Int
max_duration_seconds : Double
min_frame_rate : Double
max_frame_rate : Double
max_root_speed : Double
max_root_teleport : Double
min_quality_score : Int
require_root_position : Bool
allow_unknown_channels : Bool
allow_child_position_channels : Bool
require_loop_closure : Bool
} derive(Eq, Debug)fn BvhImportProfile::new(kind : BvhImportProfileKind, name : String, max_joint_count? : Int, max_depth? : Int, max_duration_seconds? : Double, min_frame_rate? : Double, max_frame_rate? : Double, max_root_speed? : Double, max_root_teleport? : Double, min_quality_score? : Int, require_root_position? : Bool, allow_unknown_channels? : Bool, allow_child_position_channels? : Bool, require_loop_closure? : Bool) -> BvhImportProfilepub(all) struct BvhJoint {
name : String
path : String
kind : BvhJointKind
offset : BvhVec3
channels : Array[BvhChannel]
channel_start : Int
channel_count : Int
depth : Int
children : Array[BvhJoint]
end_sites : Array[BvhEndSite]
} derive(Eq, Debug)pub(all) struct BvhParseResult {
ok : Bool
document : BvhDocument
error : BvhError
} derive(Eq, Debug)fn BvhPoseSample::new(frame_index : Int, root_position : BvhVec3, root_delta_from_first : BvhVec3) -> BvhPoseSamplepub(all) struct BvhQualityReport {
grade : BvhQualityGrade
score : Int
signals : Array[BvhQualitySignal]
recommended_action : String
} derive(Eq, Debug)pub(all) struct BvhQualitySignal {
severity : BvhIssueSeverity
code : String
score_delta : Int
message : String
} derive(Eq, Debug)fn BvhQualitySignal::new(severity : BvhIssueSeverity, code : String, score_delta : Int, message : String) -> BvhQualitySignalpub(all) struct BvhReport {
ok : Bool
summary : String
stats : BvhStats
validation : BvhValidationReport
error_code : String
} derive(Eq, Debug)fn BvhRetargetMapEntry::new(source_path : String, target_path : String, source_channel_count : Int, target_channel_count : Int) -> BvhRetargetMapEntryfn BvhRootTeleport::new(frame_index : Int, distance : Double, threshold : Double) -> BvhRootTeleportpub(all) struct BvhRuntimeManifest {
package_name : String
version : String
supported_format : String
entries : Array[BvhSupportEntry]
} derive(Eq, Debug)fn BvhSkeletonBone::new(path : String, parent_path : String, name : String, depth : Int, offset : BvhVec3, channel_count : Int, has_end_site : Bool) -> BvhSkeletonBonefn BvhSkeletonDiff::new(matched_paths : Array[String], missing_paths : Array[String], extra_paths : Array[String], channel_mismatch_paths : Array[String], offset_warning_paths : Array[String]) -> BvhSkeletonDifffn BvhSpeedSample::new(frame_index : Int, seconds : Double, distance_from_previous : Double, speed_units_per_second : Double) -> BvhSpeedSamplepub(all) struct BvhToken {
kind : BvhTokenKind
text : String
line : Int
column : Int
} derive(Eq, Debug)pub(all) struct BvhValidationIssue {
severity : BvhIssueSeverity
path : String
code : String
message : String
} derive(Eq, Debug)fn BvhValidationIssue::new(severity : BvhIssueSeverity, code : String, message : String, path? : String) -> BvhValidationIssuefn BvhValidationIssue::warning(code : String, message : String, path? : String) -> BvhValidationIssuepub(all) struct BvhValidationReport {
issues : Array[BvhValidationIssue]
error_count : Int
warning_count : Int
info_count : Int
} derive(Eq, Debug)fn build_blender_import_plan(document : BvhDocument, armature_name? : String) -> BvhBlenderImportPlanfn build_name_based_retarget_map(source : BvhDocument, target : BvhDocument) -> Array[BvhRetargetMapEntry]fn compare_skeletons(reference : BvhDocument, candidate : BvhDocument, offset_epsilon? : Double) -> BvhSkeletonDifffn frame_values_for_joint(document : BvhDocument, joint : BvhJoint, frame_index : Int) -> Array[Double]fn frame_values_for_joint_name(document : BvhDocument, name : String, frame_index : Int) -> Array[Double]fn import_profile_issues(document : BvhDocument, profile : BvhImportProfile) -> Array[BvhValidationIssue]MoonBit-native BVH motion capture parser, validator, analysis helpers, and asset pipeline toolkit.