{ "id": "single-software-execution--cli--blender--task-22--ubuntu", "snapshot": "Blender-4.2.3", "instruction": "Shape-key Smile Morph + Bone Driver `/home/user/Desktop/scene.blend` contains: - A mesh object `Face` (a subdivided plane) with shape keys `Basis` and `smile`. Launch Blender by running `blender` from a terminal. On this machine, use `/opt/blender/blender` for Blender command-line or background runs when working on `scene.blend`.\n\nAt `smile.value = 1.0` the outer vertices (|x| >= 0.5) are lifted in +Z, simulating mouth corners lifting. - An armature object `Rig` at the origin with a single bone `ctrl_jaw` (head=(0,0,0), tail=(0,0,0.5)). The `ctrl_jaw` pose bone's `rotation_mode` is set to 'XYZ'. - No driver yet on the `smile` shape key (its value stays at 0 regardless of bone rotation). - `Face` is NOT parented to `Rig`. add a driver so that the `smile` shape key's value is driven by the X-rotation of the `ctrl_jaw` bone, clamped to [0, 1], with a scale of 2: smile = max(0, min(1, rx * 2)) where `rx` is the LOCAL_SPACE ROT_X of the `ctrl_jaw` pose bone on `Rig`. Save the result as `/home/user/Desktop/answer.blend`. ## Requirements 1. Get the `smile` key block: ```python key_block = face.data.shape_keys.key_blocks['smile'] fcurve = key_block.driver_add('value') drv = fcurve.driver drv.type = 'SCRIPTED' drv.expression = 'max(0, min(1, rx * 2))' ``` 2. Add a `TRANSFORMS` variable named `rx`: ```python var = drv.variables.new() var.name = 'rx' var.type = 'TRANSFORMS' tgt = var.targets[0] tgt.id = rig # the armature OBJECT tgt.bone_target = 'ctrl_jaw' tgt.transform_type = 'ROT_X' tgt.transform_space = 'LOCAL_SPACE' ``` 3. Save as `/home/user/Desktop/answer.blend`. ## Requirements 1. The saved file opens as a valid Blender file. 2. Mesh object `Face` exists. 3. Armature object `Rig` exists with a bone named `ctrl_jaw`. 4. `Face.data.shape_keys.key_blocks` contains a key block named `smile`. 5. `Face.data.shape_keys.animation_data.drivers` contains an F-curve whose `data_path` references the `smile` key block's `value`. 6. The driver's first variable has `transform_type == 'ROT_X'`, `bone_target == 'ctrl_jaw'`, and its target id is the `Rig` object. 7. The driver expression contains a clamp operator (`max`, `min`, or `clamp`) and a factor of 2 applied to `rx` (e.g. `max(0, min(1, rx * 2))` or `max(0, min(1, rx*2))`). 8. Setting `Rig.pose.bones['ctrl_jaw'].rotation_euler = (0.5, 0, 0)` and updating the depsgraph yields `smile.value == 1.0` (tol 1e-3). 9. Setting it to `(0.1, 0, 0)` yields `smile.value == 0.2` (tol 1e-3). 10. Setting it to `(-0.3, 0, 0)` yields `smile.value == 0.0` (tol 1e-3). Save the result as `/home/user/Desktop/answer.blend`.", "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-22/init_file/scene.blend", "path": "/home/user/Desktop/scene.blend" } ] } } ], "trajectory": "trajectories/", "related_apps": [ "blender" ], "artifact_paths": [ "/home/user/Desktop/answer.blend" ], "evaluator": { "postconfig": [ { "type": "upload_file", "parameters": { "files": [ { "local_path": "task-22/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" }