oxihuman-morph 0.1.2

Parametric morphology engine for human body generation — targets, blendshapes, FACS
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
// Auto-split part 1 of oxihuman-morph lib.rs
// Do not edit directly — generated by workstream B refactor

#[path = "age_model.rs"]
pub mod age_model;

#[path = "anim_retarget.rs"]
pub mod anim_retarget;
pub use anim_retarget::{
    parse_bvh_text, retarget_bvh_to_param_tracks, BvhData, BvhJointFrame, SkeletonMapping,
};

#[path = "anthropometry.rs"]
pub mod anthropometry;

#[path = "apply.rs"]
pub mod apply;

#[path = "blend_profile.rs"]
pub mod blend_profile;

#[path = "cache.rs"]
pub mod cache;

#[path = "colors.rs"]
pub mod colors;

#[path = "compress.rs"]
pub mod compress;

#[path = "constraint.rs"]
pub mod constraint;

#[path = "curves.rs"]
pub mod curves;

#[path = "delta_cache.rs"]
pub mod delta_cache;

#[path = "diff.rs"]
pub mod diff;

#[path = "engine.rs"]
pub mod engine;
pub use engine::{HumanEngine, MeshBuffers};

#[path = "expression.rs"]
pub mod expression;
pub use expression::{apply_expression_to_engine, ExpressionComponent, ExpressionPreset};

#[path = "fitting.rs"]
pub mod fitting;

#[path = "history.rs"]
pub mod history;

#[path = "interpolate.rs"]
pub mod interpolate;

#[path = "measurements.rs"]
pub mod measurements;

#[path = "params.rs"]
pub mod params;
pub use params::ParamState;

#[path = "preset_io.rs"]
pub mod preset_io;

#[path = "presets.rs"]
pub mod presets;

#[path = "regions.rs"]
pub mod regions;

#[path = "schema_migration.rs"]
pub mod schema_migration;

#[path = "search.rs"]
pub mod search;

#[path = "session.rs"]
pub mod session;

#[path = "shape_compare.rs"]
pub mod shape_compare;

#[path = "skin_color.rs"]
pub mod skin_color;

#[path = "symmetry.rs"]
pub mod symmetry;

#[path = "target_lib.rs"]
pub mod target_lib;

#[path = "units.rs"]
pub mod units;

#[path = "weight_curves.rs"]
pub mod weight_curves;

#[cfg(feature = "simd")]
#[path = "simd_morph.rs"]
pub mod simd_morph;

#[path = "pose_blend.rs"]
pub mod pose_blend;
pub use pose_blend::{
    angle_to_weight, make_elbow_corrective, make_shoulder_corrective, BlendInterpolation,
    JointRotation, PoseBlendLibrary, PoseCorrectiveShape,
};

#[path = "timeline.rs"]
pub mod timeline;
pub use timeline::Keyframe as TimelineKeyframe;
pub use timeline::{AnimTrack, Timeline, TrackInterp};

#[path = "diversity.rs"]
pub mod diversity;
pub use diversity::{
    default_body_params, generate_population, van_der_corput, DiversitySampler,
    Lcg as DiversityLcg, ParamSpec, SamplingStrategy,
};

#[path = "incremental.rs"]
pub mod incremental;
pub use incremental::{DirtyTracker, IncrementalMorphCache};
#[path = "blend_tree.rs"]
pub mod blend_tree;
pub use blend_tree::{
    blend_params, clamp_params, merge_params, scale_params, BlendMode, BlendNode, ParamMap,
};

#[path = "param_constraint.rs"]
pub mod param_constraint;
pub use param_constraint::{
    age_constraints, bmi_constraints, proportion_constraints, Constraint, ConstraintSolver,
    Params as ConstraintParams, SolveResult,
};

#[path = "muscle_sim.rs"]
pub mod muscle_sim;
pub use muscle_sim::{
    bicep_muscle, calf_muscle, muscle_from_region, quadricep_muscle, BulgeDirection, Muscle,
    MuscleSimulator,
};

#[path = "character_rig.rs"]
pub mod character_rig;
pub use character_rig::{
    minimal_human_rig, standard_human_rig, CharacterRig, MorphBinding, RigBodyRegion, RigJoint,
};

#[path = "morph_layer.rs"]
pub mod morph_layer;
pub use morph_layer::{blend_layer, LayerBlend, MorphLayer, MorphLayerStack};
#[path = "pose_graph.rs"]
pub mod pose_graph;
pub use pose_graph::{
    apply_easing, Easing, PoseGraph, PoseNode, PoseParams as GraphPoseParams, PoseTransition,
};

#[path = "emotion_system.rs"]
pub mod emotion_system;
pub use emotion_system::{
    default_emotion_system, lerp_emotion_blend, Emotion, EmotionBlend, EmotionExpression,
    EmotionSystem,
};

#[path = "body_preset.rs"]
pub mod body_preset;
pub use body_preset::{
    preset_athletic, preset_average, preset_child, preset_elder, preset_heavy, preset_muscular,
    preset_petite, preset_slender, preset_tall, standard_preset_library, BodyCategory,
    BodyParams as PresetBodyParams, BodyPreset, PresetLibrary,
};

#[path = "facs.rs"]
pub mod facs;
pub use facs::{
    default_facs_mapper, emotion_to_facs, parse_facs_string, ActionUnit, FacsIntensity, FacsMapper,
    FacsState,
};

#[path = "gaze.rs"]
pub mod gaze;
pub use gaze::{
    compute_gaze, eye_angles_to_point, gaze_to_rotation_matrix, iris_deform_weight,
    lid_follow_weight, EyeConfig, EyeGazeAngles, GazeResult, GazeTarget, SaccadeSequence,
};

#[path = "speech_viseme.rs"]
pub mod speech_viseme;
pub use speech_viseme::{
    default_viseme_mapper, phoneme_to_viseme, LipSyncTrack, Phoneme, PhonemeEvent, Viseme,
    VisemeMapper, VisemeMorphWeights,
};

#[path = "genetic.rs"]
pub mod genetic;
pub use genetic::{
    average_params, blend_params as genetic_blend_params, clamp_params as genetic_clamp_params,
    crossover_blend, dominant_blend, inherit_random, lcg_f32, params_distance, GeneticParams,
    GeneticPopulation, GeneticProfile,
};

#[path = "expression_library.rs"]
pub mod expression_library;
pub use expression_library::{
    expression_distance, ExpressionBlender, ExpressionLibrary,
    ExpressionPreset as ExpressionLibPreset,
};

#[path = "body_scan_fit.rs"]
pub mod body_scan_fit;
pub use body_scan_fit::{
    align_scan_to_mesh, estimate_measurements, fit_params_to_scan, measurements_to_params,
    quick_fit_from_bbox, scan_to_mesh_error, BodyMeasurementsEstimate, FitConfig,
    FitResult as ScanFitResult, IcpAligner, IcpResult, PhotoFitResult, PointCloud, ScanCloud,
    ScanFitConfig, ScanFitter,
};

#[path = "mocap_bvh.rs"]
pub mod mocap_bvh;
pub use mocap_bvh::{
    map_bvh_to_oxihuman, parse_bvh, retarget_scale, write_bvh, BvhChannel, BvhFile, BvhFrame,
    BvhJoint, BvhSkeleton,
};

#[path = "body_landmark.rs"]
pub mod body_landmark;
pub use body_landmark::{
    detect_landmarks, landmark_frame, nearest_vertex, remap_landmarks, transfer_landmarks,
    Landmark, LandmarkId, LandmarkSet, Side,
};

#[path = "param_animation.rs"]
pub mod param_animation;
pub use param_animation::{
    blend_clip, breathing_clip, cubic_hermite, interpolate as param_interpolate, smoothstep_interp,
    InterpMode, Keyframe as ParamKeyframe, LoopMode, ParamClip, ParamTrack,
};

#[path = "ethnic_variation.rs"]
pub mod ethnic_variation;
pub use ethnic_variation::{
    age_to_param, bmi_to_params, height_m_to_param, lcg_normal, sample_heights, AnthroLibrary,
    AnthroProfile, AnthroSample,
};

#[path = "crowd_generator.rs"]
pub mod crowd_generator;
pub use crowd_generator::{
    enforce_diversity, generate_crowd, generate_crowd_halton, halton, lcg_rand as crowd_lcg_rand,
    param_distance as crowd_param_distance, Crowd, CrowdCharacter, CrowdConfig, VariationClass,
};

#[path = "muscle_control.rs"]
pub mod muscle_control;
pub use muscle_control::{
    blend_rig_states, params_to_muscle_activation, rig_to_morphs, MuscleDefinition,
    MuscleGroup as MuscleControlGroup, MuscleRig, MuscleState, Side as MuscleSide,
};

#[path = "emotion_space.rs"]
pub mod emotion_space;
pub use emotion_space::{
    idw_weight, mix_expressions, pad_to_description, EmotionAnchor, EmotionSpace,
    EmotionTransition, PadPoint,
};

#[path = "motion_graph.rs"]
pub mod motion_graph;
pub use motion_graph::{
    blend_morph_maps as motion_blend_morphs, build_expression_graph, build_locomotion_graph,
    MotionController, MotionGraph, MotionState, MotionTransition, TransitionCondition,
};

#[path = "influence_map.rs"]
pub mod influence_map;
pub use influence_map::{
    build_influence_map, influence_map_stats, target_vertex_coverage, top_influences_for_vertex,
    vertex_target_overlap, InfluenceMap, InfluenceMapStats, VertexInfluence,
};

#[path = "expression_mixer.rs"]
pub mod expression_mixer;
pub use expression_mixer::{
    add_weight_maps, clamp_weight_map, corrective_layer, emotion_layer, lip_sync_layer,
    merge_weight_maps, micro_expression_layer, scale_weight_map, threshold_weight_map,
    top_n_weights, weight_map_magnitude, ExpressionMixer, MixLayer, MorphWeightMap,
};

#[path = "expression_retarget.rs"]
pub mod expression_retarget;
pub use expression_retarget::{
    blend_retargeted, build_prefix_map, identity_map, makehuman_to_daz_map, retarget_stats,
    retarget_weights as retarget_expr_weights, scale_retarget_weights,
    MorphWeights as RetargetMorphWeights, RetargetConfig, RetargetMap as ExprRetargetMap,
    RetargetStats, UnmappedPolicy,
};

#[path = "mutation_engine.rs"]
pub mod mutation_engine;
pub use mutation_engine::{
    default_human_specs, fitness_rank, tournament_select, MutationConfig, MutationEngine,
    MutationResult, ParamMap as MutationParamMap, ParamSpec as MutationParamSpec,
};

#[path = "body_proportions.rs"]
pub mod body_proportions;
pub use body_proportions::{
    golden_ratio_params, normalize_to_schema, params_to_ratios, proportion_score, standard_schemas,
    ProportionAnalysis, ProportionLibrary, ProportionSchema,
};

#[path = "expression_sequence.rs"]
pub mod expression_sequence;
pub use expression_sequence::{
    blink_track, breathing_expr_track, ease_value, lerp_weights as seq_lerp_weights,
    EaseType as ExprEaseType, ExprKeyframe, ExprSequencer, ExprTrack, ExprWeights, SeqLoopMode,
};

#[path = "skin_deform.rs"]
pub mod skin_deform;
pub use skin_deform::{
    blend_skin_maps, bulge_weights, clamp_skin_map, default_skin_system, sag_weights,
    wrinkle_weights, MorphMap as SkinMorphMap, SkinDeformPattern, SkinDeformSystem,
};

#[path = "character_dna.rs"]
pub mod character_dna;
pub use character_dna::{
    crossover_dna, decode_dna, dna_distance, dna_from_base64, dna_from_hex, dna_to_base64,
    dna_to_hex, dna_to_params_map, encode_dna, mutate_dna, CharacterDna, ExtendedDna,
};

#[path = "pose_driver.rs"]
pub mod pose_driver;

#[path = "volume_morph.rs"]
pub mod volume_morph;

#[path = "weight_optimizer.rs"]
pub mod weight_optimizer;
pub use pose_driver::{
    normalize_weights, pose_distance, rbf_gaussian, rbf_inverse_distance, rbf_thin_plate,
    PoseDriver, PoseDriverConfig, PoseDriverSample, RbfFalloff,
};
pub use volume_morph::{
    compute_mesh_volume, laplacian_smooth_deltas, mesh_volume_ratio, uniform_scale_correction,
    volume_error_percent, volume_preserving_delta, VolumeMorphConfig, VolumeMorphResult,
};
pub use weight_optimizer::{
    apply_weights, clamp_weights, gradient_wrt_weights, reconstruction_error, OptimizationResult,
    WeightOptimizer,
};

#[path = "emotion_timeline.rs"]
pub mod emotion_timeline;

#[path = "micro_expression.rs"]
pub mod micro_expression;

#[path = "speech_baker.rs"]
pub mod speech_baker;
pub use emotion_timeline::{
    apply_easing_fn, interpolate_emotions, normalize_emotion_time, EmotionKeyframe,
    EmotionTimeline, TimelineEasing, TimelineLoop,
};
pub use micro_expression::{
    inject_random_micros, merge_weights, micro_expr_weight_at, standard_micro_expressions,
    MicroExpression, MicroExpressionEvent, MicroExpressionLayer,
};
pub use speech_baker::{
    active_phonemes_at, bake_phoneme_sequence, blend_viseme_weights, build_default_viseme_map,
    BakedLipSync, BakerConfig, PhonemeEvent as BakerPhonemeEvent,
};

#[path = "anthropometric_constraints.rs"]
pub mod anthropometric_constraints;

#[path = "body_symmetry.rs"]
pub mod body_symmetry;

#[path = "corrective_shapes.rs"]
pub mod corrective_shapes;
pub use anthropometric_constraints::{
    bmi_from_params, check_params_against_constraints, enforce_constraints, params_to_body_ratios,
    realism_score, standard_anthropometric_constraints, violation_severity, AnthroCheckResult,
    AnthroConstraint, AnthroConstraintSet, AnthroViolation,
};
pub use body_symmetry::{
    asymmetry_noise, enforce_symmetry, find_symmetry_pairs_x, inject_asymmetry, mirror_position,
    symmetrize_morph_deltas, symmetry_report, AsymmetryConfig, SymmetryAxis, SymmetryConfig,
    SymmetryReport,
};
pub use corrective_shapes::{
    apply_corrective_to_mesh, combine_corrective_deltas, corrective_distance, corrective_weight,
    standard_corrective_shapes, CorrectiveEvalResult, CorrectiveShape, CorrectiveShapeLibrary,
};

#[path = "blend_shape_io.rs"]
pub mod blend_shape_io;

#[path = "expression_transfer.rs"]
pub mod expression_transfer;

#[path = "retarget_mesh.rs"]
pub mod retarget_mesh;
pub use blend_shape_io::{
    blend_shape_stats, export_blend_shape_obj_delta, export_blend_shapes_csv,
    export_blend_shapes_json, filter_zero_deltas, import_blend_shape_obj_delta,
    import_blend_shapes_csv, import_blend_shapes_json, merge_blend_shape_libraries,
    BlendShapeEntry, BlendShapeLibraryFile,
};
pub use expression_transfer::{
    barycentric_coords, delta_magnitude, interpolate_delta_barycentric, mesh_scale_ratio,
    transfer_expression, transfer_expression_batch, ExpressionTransferBatch,
    ExpressionTransferConfig, TransferInterp, TransferredExpression,
};
pub use retarget_mesh::{
    closest_vertex, retarget_error_stats, retarget_mesh_positions, smooth_transferred_positions,
    transfer_deltas, RetargetMeshConfig, RetargetMeshResult,
};

#[path = "param_space_optimizer.rs"]
pub mod param_space_optimizer;

#[path = "parametric_face.rs"]
pub mod parametric_face;

#[path = "target_authoring.rs"]
pub mod target_authoring;
pub use param_space_optimizer::{
    analyze_param_space, build_correlation_matrix, find_redundant_params, normalize_param_samples,
    param_correlation, param_importance_score, param_variance, reduce_param_set,
    ParamSpaceAnalysis, ParamSpaceConfig,
};
pub use parametric_face::{
    apply_expression_preset, blend_face_params, expression_presets, standard_face_action_units,
    standard_face_params, FaceActionUnit, FaceModel, FaceParam,
};
pub use target_authoring::{
    authored_target_stats, create_target_from_delta_field, create_target_from_mesh_pair,
    invert_target, merge_targets, mirror_target_x, scale_target, smooth_target_deltas,
    target_delta_bounds, AuthoredTarget, AuthoringConfig,
};

#[path = "mocap_retarget_adv.rs"]
pub mod mocap_retarget_adv;
pub use mocap_retarget_adv::{
    blend_poses, quat_inverse, quat_multiply, quat_slerp, retarget_pose_adv,
    standard_biped_retarget_map, Joint, RetargetMap, SkeletonPose,
};

#[path = "expression_calibration.rs"]
pub mod expression_calibration;
pub use expression_calibration::{
    calibrate_expression_to_landmarks, landmark_delta, normalize_landmark_set,
    standard_68_landmarks, AuActivation, FacialLandmark, LandmarkSet as CalibLandmarkSet,
};

#[path = "body_composition.rs"]
pub mod body_composition;
pub use body_composition::{
    bmi, body_fat_from_bmi_sex_age, classify_body_fat, interpolate_compositions,
    morph_params_from_composition, validate_composition, BodyComposition, CompositionProfile,
};

#[path = "crowd_variation.rs"]
pub mod crowd_variation;
pub use crowd_variation::{
    cluster_crowd, crowd_diversity_score, crowd_to_json,
    generate_crowd as generate_crowd_variation, standard_crowd_axes, Crowd as CrowdVariation,
    CrowdMember, CrowdSpec, Distribution, VariationAxis,
};

#[path = "age_progression_adv.rs"]
pub mod age_progression_adv;
pub use age_progression_adv::{
    body_aging_params, compute_age_stage, default_aging_curve_female, default_aging_curve_male,
    face_aging_params, simulate_aging, skin_aging_params, AgeProfile as AgeProfileAdv, AgeStage,
    AgingCurve,
};

#[path = "expression_composer.rs"]
pub mod expression_composer;
pub use expression_composer::{
    add_layer, add_preset_layer, blend_layers, default_composer_config, evaluate_expression,
    expression_energy as composer_expression_energy,
    expression_to_json as composer_expression_to_json,
    get_layer_weight as composer_get_layer_weight, layer_count, new_composed_expression,
    new_expression_composer, normalize_expression as composer_normalize_expression, remove_layer,
    reset_expression, set_layer_weight, ComposedExpression, ExpressionComposer,
    ExpressionComposerConfig, ExpressionComposerLayer,
};

#[path = "body_language.rs"]
pub mod body_language;
pub use body_language::{
    apply_emotion_to_params, blend_body_emotions, classify_body_language, dominant_emotion,
    generate_pose_for_emotion, interpolate_pose_features, mirror_pose, normalize_pose_features,
    pose_similarity, pose_to_json, BodyEmotion, BodyLanguageProfile, PoseFeatures,
};

#[path = "speech_prosody.rs"]
pub mod speech_prosody;
pub use speech_prosody::{
    blend_prosody_emotions, classify_prosody_emotion, dominant_prosody_emotion,
    estimate_arousal_valence, generate_prosody_for_emotion, interpolate_prosody, normalize_prosody,
    prosody_similarity, prosody_to_face_params, prosody_to_json, speech_rate_category,
    ProsodyEmotion, ProsodyFeatures, ProsodyProfile,
};

#[path = "pose_symmetry.rs"]
pub mod pose_symmetry;
pub use pose_symmetry::{
    apply_pose_offset, detect_symmetry_pairs, enforce_symmetry_pose, find_joint_by_name,
    interpolate_poses, mirror_joint_rotation, mirror_pose as mirror_skeleton_pose,
    pose_distance_sym, pose_symmetry_error, quat_slerp_pose, standard_biped_symmetry_pairs,
    JointPose, PoseSkeleton, SymmetryPair,
};

#[path = "body_hair.rs"]
pub mod body_hair;
pub use body_hair::{
    add_region, blend_hair_profiles, curl_tip, default_hair_profile, generate_strands,
    hair_count_for_region, hair_profile_to_params, lod_density_factor, region_by_name,
    scale_density, total_strand_count, HairGenerationParams, HairProfile, HairRegion, HairStrand,
};

#[path = "motion_warp.rs"]
pub mod motion_warp;
pub use motion_warp::{
    apply_warp, blend_clips, clip_duration, concat_clips, identity_warp_curve, linear_warp_curve,
    loop_clip, pose_lerp, reverse_clip, sample_clip, speed_scale_clip, trim_clip, warp_time,
    MotionClip, MotionFrame, WarpCurve, WarpMode, WarpedClip,
};

#[path = "facial_rig.rs"]
pub mod facial_rig;
pub use facial_rig::{
    add_bone as add_facial_bone, add_corrective, apply_facial_pose, blend_facial_poses, bone_count,
    corrective_count, default_facial_rig, evaluate_correctives, facial_rig_to_json,
    get_bone as get_facial_bone, identity_pose as identity_facial_pose, new_facial_rig,
    quat_angle_between, set_bone_rotation, CorrectiveShape as FacialCorrectiveShape, FacialBone,
    FacialPose, FacialRig,
};