| # | Bước | Công cụ | Script (bấm để xem mã) | Thời gian | Trạng thái | Thủ thuật trong script | Số liệu chính | Minh hoạ |
| 1 | env Kiểm tra môi trường (UE, Houdini, scan, ổ đĩa) |
Python (build.py) | |
2 s 0.0 % |
✅ ok | - Đọc Engine/Build/Build.version
- Kiểm tra license hython, dung lượng ổ
| ue_version 5.8.4 CL58902052 scan_zips 15 | — |
| 2 | extract Lấy scan từ thư mục nguồn (zip / thư mục OBJ / OBJ rời) vào SourceData/Scans |
Python (build.py) | |
39 s 0.7 % |
✅ ok | - zipfile đọc luồng 16 MB
- Ghi file .part rồi os.replace (không có file dở)
- Bỏ qua file đã đủ kích thước
- Nhận cả thư mục OBJ / OBJ rời
| frames 15 obj_total_GB 11.05 | — |
| 3 | hou_inspect Houdini: đo kích thước, hướng và ảnh xem trước từng frame |
hython (Houdini) | |
1 ph 37 s 1.8 % |
✅ ok | - File SOP đọc OBJ 0,6–1,8 GB
- bbox + PCA để tìm hướng đầu
- 6 ảnh ortho, mỗi ảnh một tiến trình hython (Vulkan crash ở lần render thứ 2)
| |  |
| 4 | hou_process Houdini: định hướng, làm sạch, giảm lưới, xuất mesh + chân dung |
hython (Houdini) | |
15 ph 40 s 16.9 % |
✅ ok | - 4 hython song song
- attribwrangle đổi trục (−y, z, −x)·100
- blast cắt 27 cm từ đỉnh đầu, connectivity giữ mảnh lớn nhất
- polyreduce::2.0 → ~120k điểm
- Xuất mảng nhị phân AMHC cho Unreal
- Chân dung FOV 30°
| frames_ok 15 |  |
| 5 | project Tạo dự án Unreal + bật plugin MetaHuman |
Python (build.py) | |
0 s 0.0 % |
✅ ok | - Viết .uproject + Config/*.ini
- Ghim +D3D12TargetedShaderFormats=PCD3D_SM6 (shader da MetaHuman)
- Bật plugin MetaHuman, HairStrands, AlembicHairImporter
| plugins 16 | — |
| 6 | ue_smoke Unreal: kiểm tra Python + MetaHuman API chạy headless |
Unreal commandlet | |
1 ph 01 s 1.1 % |
✅ ok | - UnrealEditor-Cmd -run=pythonscript
- Kiểm tra lớp Python MetaHuman + đăng nhập cloud
| engine 5.8.4-58902052+++UE5+Release-5.8 can_build False | — |
| 7 | ue_import Unreal: nhập mesh scan + texture vào Content |
Unreal commandlet | |
1 ph 03 s 1.1 % |
✅ ok | - Interchange OBJ → Static Mesh ×15
- Bỏ primitive < 3 đỉnh
| imported 15 | — |
| 8 | ue_landmarks Unreal: dò landmark trên 15 chân dung, tự chọn frame neutral |
Unreal commandlet | |
21 s 0.4 % |
✅ ok | - track_face_landmarks_from_image (NNE) → 16 contour
- Đặc trưng mở miệng/mắt chuẩn hoá theo khoảng cách hai mắt
| neutral_auto Frame44 |  |
| 9 | select_neutral Chọn frame neutral: landmark + chấm marker + hình hộp sọ (mũ lưới) |
hython (Houdini) | |
3 s 0.1 % |
✅ ok | - Mật độ chấm marker vùng má/mũi
- Tỉ lệ đỉnh đầu/mắt
- Ngưỡng tại khoảng trống lớn nhất giữa các giá trị
| neutral_frame Frame31 |  |
| 10 | ue_conform Unreal: tạo MetaHuman Character + dò landmark + conform từ scan neutral |
Unreal offscreen | |
1 ph 44 s 1.9 % |
✅ ok | - Editor -RenderOffscreen (ExportPosedDNA cần Slate)
- ConformTargetParams HEAD_ONLY + curve tracking + camera chân dung
- export_posed_dna, commit_posed_state_as_a_pose
| neutral_frame Frame31 landmark_points 358 |  |
| 11 | ue_rig Unreal: auto-rig + texture (dịch vụ đám mây MetaHuman) |
Unreal + cloud MetaHuman | |
2 ph 03 s 2.2 % |
✅ ok | - request_auto_rigging(JOINTS_AND_BLEND_SHAPES) chặn tới khi xong
- request_texture_sources (texture 2K)
| autorig_s 77.3 textures_s 10.3 | — |
| 12 | ue_skin Tông da: đo màu da scan, khớp Skin U/V của MetaHuman, tải lại texture |
Unreal offscreen | |
2 ph 45 s 3.0 % |
✅ ok | - Trung vị màu da má/trán, dải sáng 20–80 %
- Cổ áo trắng làm chuẩn phơi sáng
- ΔE CIE76 trong CIELAB
- Skin.BodyBias = tone^2.2 · 256 để đọc màu model
- Quét lưới 11×11 rồi 9×9 bước 0,025
| dE_before 29.907 dE_after 5.915 |  |
| 13 | ue_build Unreal: build/assemble MetaHuman + level xem lại |
Unreal offscreen | |
3 ph 07 s 3.4 % |
✅ ok | - build_meta_human pipeline CINEMATIC
- Bỏ qua thông báo RigVM 'Cannot break link'
- Level xem lại cạnh 15 scan
| built_assets 194 | — |
| 14 | ue_textures Unreal: xuất texture chính của MetaHuman ra PNG để kiểm tra |
Unreal commandlet | |
23 s 0.4 % |
✅ ok | | exported 6 |  |
| 15 | skin_compare So sánh tông da trước/sau trên albedo MetaHuman đã build |
hython (Houdini) | |
4 s 0.1 % |
✅ ok | - Trung vị màu da má/trán, dải sáng 20–80 %
- Cổ áo trắng làm chuẩn phơi sáng
- ΔE CIE76 trong CIELAB
| dE_before 29.91 dE_after 6.75 |  |
| 16 | verify Houdini: đo độ khớp MetaHuman ↔ scan (posed DNA, ICP, heat map, ảnh so sánh) |
hython (Houdini) | |
22 s 0.4 % |
✅ ok | - Đọc posed DNA bằng thư viện DNA của MetaHuman for Houdini
- Thử 4 phép quay, ICP, heat map 0–5 mm
| median_mm 2.21 within_5mm_pct 87.37 |  |
| 17 | hou_bald Houdini: bỏ tóc khỏi scan neutral, nội suy hộp sọ trọc từ frame đội mũ lưới |
hython (Houdini) | |
54 s 1.0 % |
✅ ok | - Mask tóc theo độ sáng texture tại UV
- Căn Frame33 → Frame31: 3 mốc 3D + ICP (Kabsch + xyzdist)
- Lấp sọ: lùi 4 mm theo pháp tuyến, làm mượt 30 lần
| hair_pct 50.4 cap_align_median_mm 1.33 |  |
| 18 | bald_conform Đầu trọc: conform MHC_Scan2_Bald từ mục tiêu đã bỏ tóc |
Unreal offscreen | |
1 ph 43 s 1.8 % |
✅ ok | - Editor -RenderOffscreen (ExportPosedDNA cần Slate)
- ConformTargetParams HEAD_ONLY + curve tracking + camera chân dung
- export_posed_dna, commit_posed_state_as_a_pose
| landmark_points 358 | — |
| 19 | bald_rig Đầu trọc: auto-rig + texture |
Unreal + cloud MetaHuman | |
2 ph 02 s 2.2 % |
✅ ok | - request_auto_rigging(JOINTS_AND_BLEND_SHAPES) chặn tới khi xong
- request_texture_sources (texture 2K)
| autorig_s 76.8 | — |
| 20 | bald_skin Đầu trọc: áp tông da đã khớp với scan (cùng U/V như MHC_Scan2) |
Unreal offscreen | |
1 ph 25 s 1.5 % |
✅ ok | - Skin.BodyBias = tone^2.2 · 256 để đọc màu model
- Quét lưới 11×11 rồi 9×9 bước 0,025
| dE_before 29.907 dE_after 5.915 | — |
| 21 | bald_grooms Đầu trọc: gắn tóc/lông mày/râu từ MetaHuman Optional Content |
Unreal offscreen | |
1 ph 39 s 1.8 % |
✅ ok | - AssetExportTask → PNG
- preview collection → on_edit_preview_collection → assemble_for_preview
- Tham số instance Melanin/Redness
- commit_eyes_settings (màu mống mắt từ scan)
| iris_uv [0.97, 0.5957] | — |
| 22 | bald_build Đầu trọc: build MetaHuman vào MetaHumansBald + level xem lại |
Unreal offscreen | |
3 ph 43 s 4.0 % |
✅ ok | - build_meta_human pipeline CINEMATIC
- Bỏ qua thông báo RigVM 'Cannot break link'
- Level xem lại cạnh 15 scan
| built_assets 252 | — |
| 23 | bald_render Đầu trọc: render MetaHuman có tóc trong Unreal (offscreen) để kiểm tra |
Unreal offscreen | |
3 ph 30 s 3.8 % |
✅ ok | - Slate post-tick callback + set_keep_python_script_alive
- SceneCapture2D 4 góc, chờ 150 s cho shader/groom
- export_render_target (thêm đuôi .png)
| views 4 |  |
| 24 | bald_export Đầu trọc: xuất DNA đầu/thân + gói DCC cho Houdini |
Unreal offscreen | |
2 ph 17 s 2.5 % |
✅ ok | - export_dna + export_dcc → head.dna, body.dna, Maps
| files 33 | — |
| 25 | bald_verify Đầu trọc: đo độ khớp vùng mặt + ảnh hộp sọ |
hython (Houdini) | |
24 s 0.4 % |
✅ ok | - Đọc posed DNA bằng thư viện DNA của MetaHuman for Houdini
- Thử 4 phép quay, ICP, heat map 0–5 mm
| median_mm 1.35 within_5mm_pct 90.69 |  |
| 26 | bald_groom_houdini Houdini: scene groom (MetaHuman for Houdini) trên đầu trọc, khớp độ dày tóc scan, xuất .abc |
hython (Houdini) | |
2 ph 46 s 3.0 % |
✅ ok | - HOUDINI_USER_PREF_DIR để nạp MetaHuman for Houdini
- groom::mh_head (thư mục DNA cần '/' cuối)
- Lớp tóc scan → MH Groom Head qua trường dịch chuyển cùng topology
- Khớp Length_Master theo độ dày tóc scan
- groom::mh_export → .abc
| scan_hair_top_mm 14.6 length_master 0.188 strands 61970 |  |
| 27 | hougroom_import Tóc Houdini: import .abc thành Groom + binding + wardrobe item |
Unreal offscreen | |
28 s 0.5 % |
✅ ok | - HairStrandsFactory (plugin AlembicHairImporter)
- Chép hair_groups_rendering/materials từ Hair_S_Casual
- GroomLibrary binding + wardrobe item qua import_text
| imported Hair_MHC_SCAN2_v2_Bald.Hair_MHC_SCAN2_v2_Bald… groom_material 3 slot(s), first=MI_Hair /MetaHumanCharacter/… | — |
| 28 | hougroom_conform Tóc Houdini: conform nhân vật riêng MHC_Scan2_Bald_HouGroom từ mục tiêu đầu trọc |
Unreal offscreen | |
1 ph 37 s 1.8 % |
✅ ok | - Editor -RenderOffscreen (ExportPosedDNA cần Slate)
- ConformTargetParams HEAD_ONLY + curve tracking + camera chân dung
- export_posed_dna, commit_posed_state_as_a_pose
| landmark_points 358 | — |
| 29 | hougroom_rig Tóc Houdini: auto-rig + texture cho MHC_Scan2_Bald_HouGroom |
Unreal + cloud MetaHuman | |
1 ph 57 s 2.1 % |
✅ ok | - request_auto_rigging(JOINTS_AND_BLEND_SHAPES) chặn tới khi xong
- request_texture_sources (texture 2K)
| autorig_s 73.3 | — |
| 30 | hougroom_skin Tóc Houdini: tải lại texture + tông da cho bản sao nhân vật |
Unreal offscreen | |
1 ph 24 s 1.5 % |
✅ ok | - Skin.BodyBias = tone^2.2 · 256 để đọc màu model
- Quét lưới 11×11 rồi 9×9 bước 0,025
| dE_before 29.907 dE_after 5.915 | — |
| 31 | hougroom_apply Tóc Houdini: đặt wardrobe item vào slot Hair của bản sao nhân vật |
Unreal offscreen | |
1 ph 13 s 1.3 % |
✅ ok | - preview collection → on_edit_preview_collection → assemble_for_preview
- Tham số instance Melanin/Redness
- commit_eyes_settings (màu mống mắt từ scan)
| grooms Hair=/Game/Grooms/Hair_MHC_SCAN2_v2_Bald/WI_H… | — |
| 32 | hougroom_build Tóc Houdini: build MetaHuman vào MetaHumansHouGroom + level xem lại |
Unreal offscreen | |
3 ph 29 s 3.8 % |
✅ ok | - build_meta_human pipeline CINEMATIC
- Bỏ qua thông báo RigVM 'Cannot break link'
- Level xem lại cạnh 15 scan
| built_assets 239 | — |
| 33 | hougroom_render Tóc Houdini: render kiểm tra trong Unreal |
Unreal offscreen | |
2 ph 55 s 3.2 % |
✅ ok | - Slate post-tick callback + set_keep_python_script_alive
- SceneCapture2D 4 góc, chờ 150 s cho shader/groom
- export_render_target (thêm đuôi .png)
| views 4 |  |
| 34 | rig_verify Kiểm chứng rig: khớp control mặt MetaHuman (RigLogic) vào từng scan biểu cảm, đo sai lệch mm |
hython (Houdini) | |
24 ph 35 s 26.5 % |
✅ ok | - RigLogic 13.2.8 + numpy (blend shape, FK, skinning)
- Gauss–Newton có chặn: 187 control + 6 tư thế đầu
- Landmark 2D (curves_config vIDs) + bỏ lòng miệng theo môi trong
- Lịch thô → tinh: landmark dẫn ở các vòng đầu
| expr_before_median_mm 1.69 expr_after_median_mm 0.49 worst_frame Frame45 |  |
| 35 | ue_expr_anim Biểu cảm → Unreal: AnimSequence mặt từ control đã khớp (1 biểu cảm/giây, curve CTRL_expressions_*) |
Unreal commandlet | |
30 s 0.5 % |
✅ ok | - AnimSequenceFactory trên Face_Archetype_Skeleton
- Curve CTRL_expressions_* 1 biểu cảm/giây, giữ frame cuối
| curves 163 frames 14 | — |
| 36 | ue_expr_render Biểu cảm → Unreal: level + Level Sequence, render MetaHuman ở từng biểu cảm, ghi vị trí joint |
Unreal offscreen | |
3 ph 09 s 3.4 % |
✅ ok | - SkeletalMeshActor riêng (BP MetaHuman tự dựng lại component)
- Level Sequence + set_current_time để tính pose trong editor
- Ghi vị trí joint FACIAL_*
| captures 28 |  |
| 37 | expr_compare Biểu cảm: so sánh Unreal ↔ rig numpy (joint, mm) + ảnh scan | rig | Unreal |
hython (Houdini) | |
5 s 0.1 % |
✅ ok | - Đổi trục (x, z, y) là phép phản xạ → áp trước Kabsch
- Chỉ so joint có skin weight
| diff_max_mm_all_frames 0.053 joints 619 |  |