Download task/single-software-execution/cli/blender/task-18/task-18.json from HongchengGao/EngiWorld-Tasks: direct link, hf CLI and curl.
- Browser
- Download file 5.9 kB
-
https://huggingface.co/datasets/HongchengGao/EngiWorld-Tasks/resolve/main/task/single-software-execution/cli/blender/task-18/task-18.json
- Command line
-
hf download hf://datasets/HongchengGao/EngiWorld-Tasks/task/single-software-execution/cli/blender/task-18/task-18.json
-
curl -L -o task-18.json https://huggingface.co/datasets/HongchengGao/EngiWorld-Tasks/resolve/main/task/single-software-execution/cli/blender/task-18/task-18.json
5.9 kB
| { | |
| "id": "single-software-execution--cli--blender--task-18--ubuntu", | |
| "snapshot": "Blender-4.2.3", | |
| "instruction": "UV Pack + Bake Ambient Occlusion `/home/user/Desktop/scene.blend` contains a single mesh object `BumpyMesh`: a 2x2x2 subdivided cube (3 subdivisions, 386 verts, 384 quad faces) with noise-driven surface displacement so it has visible bumps and crevices. Launch Blender by running `blender` from a terminal. For this task, use `/opt/blender/blender` for Blender command-line or background runs when working on `scene.blend`.\n\nThe mesh has: - A pre-existing UV layer `UVMap` whose UV coordinates are heavily overlapping (every face was collapsed to the unit square via `bpy.ops.uv.reset()`). - Seams pre-marked on the 32 edges that form the top ring of the cube (the 4 sides * 8 subdivided edges each, bounding the +Z face). With only those seams, a fresh angle-based unwrap produces exactly 2 UV islands: the +Z face alone, and the bottom + 4 side faces joined together. - A material `BumpyMat` with Principled BSDF + Image Texture node. The Image Texture node references a blank 512x512 black image datablock `BakeAO` and is the ACTIVE node on the material's node tree, so Cycles baking will target it. - Render engine is set to Cycles CPU, 64 samples, deterministic (seed=0, single thread). Your task: 1. Re-unwrap `BumpyMesh` using the pre-marked seams (angle-based), so the UVs fit cleanly inside [0,1]^2 and respect the seam topology. 2. Pack the UV islands with a ~4-texel margin (4/512 ~= 0.0078; 0.02 is a safe value). The packed layout should fill the unit square well so the baked texture isn't dominated by uncovered-area darkness (you may additionally scale the UV layout so its bounding box fills most of [0,1]^2). 3. Bake AO at 64 samples into the `BakeAO` image using Cycles. Use a bake-time pixel margin of at least 4 (try 16 for more robust edge padding). 4. Save the baked image to `/home/user/Desktop/ao_bake.png`. 5. Pack `BakeAO` into the blend and save the scene as `/home/user/Desktop/answer.blend`. ## Required steps ``` import bpy obj = bpy.data.objects['BumpyMesh'] bpy.ops.object.select_all(action='DESELECT') bpy.context.view_layer.objects.active = obj obj.select_set(True) # Re-unwrap with the existing seams. bpy.ops.object.mode_set(mode='EDIT') bpy.ops.mesh.select_all(action='SELECT') bpy.ops.uv.unwrap(method='ANGLE_BASED', margin=0.001) bpy.ops.uv.pack_islands(margin=0.02, rotate=True) bpy.ops.object.mode_set(mode='OBJECT') # Optional: after pack_islands, the UV bbox may not fully fill [0,1]^2. # A non-uniform rescale on the whole UV layer stretches the packed bbox # to fit tightly inside the unit square so the bake covers most of the # image. (AO baking does not require constant UV density.) uv_data = obj.data.uv_layers.active.data us = [uv.uv.x for uv in uv_data] vs = [uv.uv.y for uv in uv_data] u_min, u_max = min(us), max(us) v_min, v_max = min(vs), max(vs) margin = 4 / 512.0 target = 1.0 - 2 * margin sx = target / max(u_max - u_min, 1e-9) sy = target / max(v_max - v_min, 1e-9) off_u = margin - sx * u_min off_v = margin - sy * v_min for uv in uv_data: uv.uv.x = uv.uv.x * sx + off_u uv.uv.y = uv.uv.y * sy + off_v # Make the BakeAO image texture node the material's active node. mat = obj.data.materials[0] for n in mat.node_tree.nodes: n.select = False if n.type == 'TEX_IMAGE' and n.image and n.image.name == 'BakeAO': n.select = True mat.node_tree.nodes.active = n # Configure + run the AO bake. scene = bpy.context.scene scene.render.engine = 'CYCLES' scene.cycles.bake_type = 'AO' scene.cycles.samples = 64 scene.render.bake.use_clear = True scene.render.bake.margin = 16 scene.render.bake.use_selected_to_active = False bpy.ops.object.bake(type='AO') # Save the baked image to PNG, then pack it into the blend. img = bpy.data.images['BakeAO'] img.filepath_raw = '/home/user/Desktop/ao_bake.png' img.file_format = 'PNG' img.save() img.pack() bpy.ops.wm.save_as_mainfile(filepath='/home/user/Desktop/answer.blend') ``` ## Requirements 1. The answer .blend exists and opens cleanly. 2. A MESH object named `BumpyMesh` exists with at least 100 vertices. 3. Every UV coord on `BumpyMesh.data.uv_layers.active` lies inside [0,1]^2 (epsilon 0.001). 4. UV island count (connected faces whose shared edges carry matching UVs on both sides) is in [2, 8]. With the pre-marked top-ring seams the correct count is 2. 5. An Image datablock named `BakeAO` exists in `bpy.data.images`. 6. `BakeAO` is exactly 512x512. 7. Mean luma of the baked image is in [0.55, 0.92]. Luma = 0.299 R + 0.587 G + 0.114 B. 8. Fraction of pixels with luma < 0.40 is in [0.03, 0.30].", | |
| "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.loc.gov/preservation/digital/formats/fdd/fdd000507.shtml", | |
| "config": [ | |
| { | |
| "type": "upload_file", | |
| "parameters": { | |
| "files": [ | |
| { | |
| "local_path": "task-18/init_file/scene.blend", | |
| "path": "/home/user/Desktop/scene.blend" | |
| } | |
| ] | |
| } | |
| } | |
| ], | |
| "trajectory": "trajectories/", | |
| "related_apps": [ | |
| "blender" | |
| ], | |
| "artifact_paths": [ | |
| "/home/user/Desktop/answer.blend", | |
| "/home/user/Desktop/ao_bake.png" | |
| ], | |
| "evaluator": { | |
| "postconfig": [ | |
| { | |
| "type": "upload_file", | |
| "parameters": { | |
| "files": [ | |
| { | |
| "local_path": "task-18/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" | |
| } | |