Files
animation/tools/tailor/md_piupiu.py
T
jeremy 3ba86b2ea8 feat: clothing lane, character sources, and DCC bridges
Bulk import of the working lanes that were living untracked on the PC.

Content:
- characters/  Lena/male body lanes, bakes, texture work, run logs
- clothing/    garment pipeline, configs, gates, contract docs
- garments/    MD-authored garment sources (.zprj/.zpac)
- UAL-Lib/     Universal Animation Library 2 source (.blend/.fbx/.glb)
- tools/       blender_bridge, iclone_bridge, md_bridge, tailor, glm_agent
- docs/, plans/, dev/, .agents/plans/

Repo hygiene:
- .gitattributes: LFS now covers .blend, .zprj, .zpac, .obj, .npy and the
  Reallusion .iAvatar/.ccAvatar/.ccRestore containers. Without this the
  ~3.8 GB in this commit would land as raw blobs. .png/.jpg are left out
  on purpose — ~250 are already tracked raw and converting them would
  rewrite every one without shrinking history.
- .gitignore: exclude /accurig/ (~1 GB AccuRig program files, redistributable
  from Reallusion, nothing authored here) and /dev/null/ (git-lfs hook copies
  dropped by a `>/dev/null` redirect on Windows).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-06 15:55:43 -07:00

57 lines
2.1 KiB
Python

# Piupiu v2 (kapa haka flax skirt) — placement-targeted rebuild.
# QC targets (from reference photo, tools/tailor/qc_placement.py verifies):
# waistband top 1.05 m +-3 cm, hem 0.45 m +-4 cm (just below knee)
# python tools/md_bridge.py --file tools/tailor/md_piupiu.py --timeout 500
import os
import tempfile
report = {}
AVATAR_FBX = r"C:\Users\Jeremy\tinqs\animation\tools\tailor\avatar\Lena_QuatSkin_Avatar.fbx"
ZFAB = r"C:\Users\Public\Documents\MarvelousDesigner\New Assets\Fabric\(Default for Simulation).zfab"
TEX = r"C:\Users\Jeremy\tinqs\animation\tools\tailor\textures\piupiu.png" # dpi 43.3 = 600 mm
utility_api.NewProject()
op = ApiTypes.ImportExportOption()
op.scale = 10.0
op.bAddArrangementPoints = True
op.bAutoTranslate = True
report["avatar"] = import_api.ImportFBX(AVATAR_FBX, op)
# length 600 (waist 1.05 -> hem 0.45); tension waist 500/panel; A-line hem.
def panel(dx):
pts = [(160.0, 600.0), (660.0, 600.0), (820.0, 0.0), (0.0, 0.0)]
return pattern_api.CreatePatternWithPoints([(x + dx, y, 0) for (x, y) in pts])
sf = panel(0.0)
sb = panel(1000.0)
report["ids"] = [sf, sb]
pattern_api.AddSeamlinePairGroup(sf, 1, sb, 1, False, False)
pattern_api.AddSeamlinePairGroup(sf, 3, sb, 3, False, False)
fab = fabric_api.AddFabric(ZFAB)
fabric_api.SetBaseTextureMapImageGivenFilePath(TEX, fab)
for p in (sf, sb):
pattern_api.SetPatternPieceFabricIndex(p, fab)
arr = {a["ArrangementName"]: int(a["ArrangementIndex"])
for a in pattern_api.GetArrangementList()}
pattern_api.SetArrangement(sf, arr["Body_Front_Waist"])
pattern_api.SetArrangement(sb, arr["Body_Back_Waist"])
pattern_api.SetArrangementPosition(sf, 50, 30, 50)
pattern_api.SetArrangementPosition(sb, 0, 30, 50)
pattern_api.SetPatternStrengthen(sf, True)
pattern_api.SetPatternStrengthen(sb, True)
utility_api.ResetClothArrangement()
report["sim1"] = utility_api.Simulate(250)
pattern_api.SetPatternStrengthen(sf, False)
pattern_api.SetPatternStrengthen(sb, False)
report["sim2"] = utility_api.Simulate(50)
utility_api.Refresh3DWindow()
snap = os.path.join(tempfile.gettempdir(), "tinqs_md_piupiu_v2.png")
export_api.ExportSnapshot3D(snap)
report["snap"] = snap
result = report