Download task/single-software-execution/cli/blender/task-41/task-41.json from HongchengGao/EngiWorld-Tasks: direct link, hf CLI and curl.
- Browser
- Download file 6.64 kB
-
https://huggingface.co/datasets/HongchengGao/EngiWorld-Tasks/resolve/main/task/single-software-execution/cli/blender/task-41/task-41.json
- Command line
-
hf download hf://datasets/HongchengGao/EngiWorld-Tasks/task/single-software-execution/cli/blender/task-41/task-41.json
-
curl -L -o task-41.json https://huggingface.co/datasets/HongchengGao/EngiWorld-Tasks/resolve/main/task/single-software-execution/cli/blender/task-41/task-41.json
6.64 kB
| { | |
| "id": "single-software-execution--cli--blender--task-41--ubuntu", | |
| "snapshot": "Blender-4.2.3", | |
| "instruction": "BVH retarget -> FK/IK switch -> bake -> Alembic export This is a long-chain task combining four real Blender stages. Launch Blender by running `blender` from a terminal. Use `/opt/blender/blender` for Blender command-line or background runs when working on `character.blend`.\n\nYou will take a BVH motion-capture clip, retarget it onto a Character rig, wire an FK/IK switch via a driver, bake the resulting visual pose to keyframes, and export the deformed mesh to an Alembic cache. ## Inputs - `/home/user/Desktop/character.blend` : a scene containing * an ARMATURE object named `Character` with 4 connected bones in a leg chain: `Hip` -> `UpperLeg.L` -> `LowerLeg.L` -> `Foot.L` (pose-bone rotation_mode is already set to XYZ). No IK constraint, no action, no drivers. * a low-poly MESH object named `Body` parented to `Character` with an Armature modifier (vertex groups already bound to the bones so the mesh deforms when the bones move). * scene `frame_start = 1`, `frame_end = 30`. - `/home/user/Desktop/walk.bvh` : a 30-frame BVH motion-capture file. The skeleton root is `mixamorig_Hips` with 6 channels (Xposition/Yposition/Zposition/Zrotation/Xrotation/Yrotation). Child chain is `mixamorig_LeftUpLeg` -> `mixamorig_LeftLeg` with 3 rotation channels each. The hip translates upward (BVH Yposition ramps 0 -> 0.55 over the clip) and the knee oscillates to provide real bend. ## Stages (perform all four) ### Stage 1 - Retarget the BVH onto Character 1. Import the BVH with `bpy.ops.import_anim.bvh(filepath='/home/user/Desktop/walk.bvh', axis_forward='Y', axis_up='Z')`. This produces a new ARMATURE object (typically named `walk`) and an action. 2. Build a new action on the `Character` armature and copy keyframes from the BVH action's fcurves, remapping the bone name inside each `data_path` via this mapping table EXACTLY: | BVH source bone | Character target bone | |-----------------------|------------------------| | mixamorig_Hips | Hip | | mixamorig_LeftUpLeg | UpperLeg.L | | mixamorig_LeftLeg | LowerLeg.L | For each source, copy `pose.bones[\"<src>\"].rotation_euler` (all 3 indices) to `pose.bones[\"<tgt>\"].rotation_euler`. 3. Copy the hip location channels (`pose.bones[\"mixamorig_Hips\"].location`, all 3 indices) to `pose.bones[\"Hip\"].location` on the Character. ### Stage 2 - FK/IK switch driver 1. Create an EMPTY object named `IK.Foot.L` (any empty type is fine). 2. Add an IK constraint on `Character.pose.bones[\"LowerLeg.L\"]`: - `type='IK'` - `target = IK.Foot.L` - `chain_count = 2` 3. Add a float custom property `ik_switch` on the `Character` ARMATURE OBJECT (not the armature data), range [0, 1], default 1.0. 4. Add a SCRIPTED driver on the IK constraint's `.influence` property: - Driver expression = `var`. - One driver variable of `type='SINGLE_PROP'`, `id_type='OBJECT'`, `id=Character`, `data_path='[\"ik_switch\"]'`. ### Stage 3 - Bake the visual pose Make `Character` the active object in POSE mode, then call `bpy.ops.nla.bake` over frames 1..30 with `visual_keying=True`, `bake_types={'POSE'}`. Keep the IK constraint and its driver in place (`clear_constraints=False`) so the saved file still exposes the switch. ### Stage 4 - Clean up + Alembic export 1. Remove the BVH import-artifact armature (the one produced by `import_anim.bvh`, typically named `walk` with bones named `mixamorig_*`). Delete its armature-data and its orphan action too. 2. Export the deformed `Body` mesh to an Alembic cache. Select `Body`, make it active, then call `bpy.ops.wm.alembic_export(filepath='/home/user/Desktop/answer.abc', start=1, end=30, selected=True, flatten=False, uvs=True, packuv=False, vcolors=False)` (vcolors=False avoids headless errors on meshes without a color layer). 3. Save the file as `/home/user/Desktop/answer.blend`. ## Outputs - `/home/user/Desktop/answer.blend` - `/home/user/Desktop/answer.abc` ## Requirements 1. Both `answer.blend` and `answer.abc` exist on disk. 2. `answer.blend` opens as a valid Blender file. 3. An ARMATURE object named `Character` exists. 4. No BVH import-artifact objects remain. Specifically no object whose name starts with `mixamo` or `walk`, or contains `bvh` (case-insensitive), and no auxiliary armature carrying bones named `mixamorig_*`. 5. `Character` has a custom property `ik_switch` (value in [0, 1]), AND the IK constraint on `LowerLeg.L` has a driver on `.influence` whose first variable reads `Character[\"ik_switch\"]`. 6. `Character.animation_data.action` exists with at least 30 keyframes summed across its fcurves (bake result). 7. Re-importing `answer.abc` into a fresh scene via `bpy.ops.wm.alembic_import` yields a mesh whose vertex count is constant across frames 1, 15, 30 and is >= 8. 8. In the re-imported cache, vertex 0 travels at least 0.3 BU in world space between frame 1 and frame 30. 9. In the re-imported cache, the mesh bbox-centre moves at least 0.4 BU along the world Z axis between frame 1 and frame 30 (this proves the BVH hip translation survived all four stages and reached the Alembic samples).", | |
| "source": "https://docs.blender.org/manual/en/4.1/; https://docs.blender.org/api/4.1/; https://developer.blender.org/docs/release_notes/4.1/; https://www.alembic.io/; https://www.loc.gov/preservation/digital/formats/fdd/fdd000507.shtml", | |
| "config": [ | |
| { | |
| "type": "upload_file", | |
| "parameters": { | |
| "files": [ | |
| { | |
| "local_path": "task-41/init_file/character.blend", | |
| "path": "/home/user/Desktop/character.blend" | |
| } | |
| ] | |
| } | |
| }, | |
| { | |
| "type": "upload_file", | |
| "parameters": { | |
| "files": [ | |
| { | |
| "local_path": "task-41/init_file/walk.bvh", | |
| "path": "/home/user/Desktop/walk.bvh" | |
| } | |
| ] | |
| } | |
| } | |
| ], | |
| "trajectory": "trajectories/", | |
| "related_apps": [ | |
| "blender" | |
| ], | |
| "artifact_paths": [ | |
| "/home/user/Desktop/answer.blend" | |
| ], | |
| "evaluator": { | |
| "postconfig": [ | |
| { | |
| "type": "upload_file", | |
| "parameters": { | |
| "files": [ | |
| { | |
| "local_path": "task-41/eval.py", | |
| "path": "/home/user/Desktop/eval.py" | |
| } | |
| ] | |
| } | |
| } | |
| ], | |
| "func": "exact_match", | |
| "result": { | |
| "type": "vm_command_line", | |
| "command": "python3 /home/user/Desktop/eval.py", | |
| "shell": "true" | |
| }, | |
| "expected": { | |
| "type": "rule", | |
| "rules": { | |
| "expected": "True\n" | |
| } | |
| } | |
| }, | |
| "proxy": false, | |
| "fixed_ip": false, | |
| "possibility_of_env_change": "low" | |
| } | |