Repository navigation
Description
Summary
Assigning false to a selected property's selected attribute leaves the property selected. Scripts cannot deselect that property through the documented Boolean setter, even though assigning true selects it and the getter reports the current selection.
Runtime or environment
Independently reproduced with a source-built EffectCraft CLI from commit 813c7c4. Each invocation used a fresh headless session with disposable configuration, no project file, bridge, autosave or save option. The reproduction uses a 64 by 64 composition at 10 fps for one second and an 8 by 8 solid. GUI and MCP execution were not tested.
Steps to reproduce
- Save this complete script as property-selection.jsx. It creates its own composition and layer, explicitly activates the composition, and establishes the initial selection.
var c = app.project.items.addComp("Selection", 64, 64, 1, 1, 10);
c.openInViewer();
var layer = c.layers.addSolid([1, 0, 0], "Layer", 8, 8, 1);
var opacity = layer.transform.opacity;
var rotation = layer.transform.rotation;
app.run("edit.deselectAll", {});
rotation.selected = true;
var states = [];
opacity.selected = true;
states.push([opacity.selected, rotation.selected]);
opacity.selected = false;
states.push([opacity.selected, rotation.selected]);
opacity.selected = true;
states.push([opacity.selected, rotation.selected]);
({states: states, propertyNames: c.selectedProperties.map(function(p) { return p.name; })})- Run the supported CLI entry point with an installed or source-built effectcraft-cli on PATH. No existing project or media file is required.
FIXTURES="$(mktemp -d)"
EFFECTCRAFT_CONFIG_DIR="$FIXTURES/config" effectcraft-cli script property-selection.jsx --json- Read result.states. Each pair contains the target Opacity selection followed by the retained Rotation selection, after assigning true, false and true to Opacity.
Expected behavior
The target should report true, false and true, while Rotation remains selected throughout. The expected states are [[true,true],[false,true],[true,true]]. The documented read/write Boolean attribute says that assigning false deselects the property.
Actual behavior
The CLI exited 0 with ok:true, error:null, empty output and empty stderr. It returned {"propertyNames":["Rotation","Opacity"],"states":[[true,true],[true,true],[true,true]]}. The false assignment left Opacity selected, and reassigning true did not resolve that failure.
Evidence
- Expected source: The After Effects Scripting Guide, PropertyBase.selected, explicitly defines a read/write Boolean and says to assign false to deselect a property. EffectCraft adopts this documented scripting object model in docs/plugins.md:31-38 and documents the CLI entry point in docs/agents.md:561-573.
- Failure source: The independently executed CLI reproduction above returned true after the false assignment. The property's setter at crates/script/src/prelude.js:571-578 only calls prop.select for a truthy value. The selection command and getter data are at crates/engine/src/commands/prop.rs:314-347 and crates/script/src/model.rs:96-108.
- Evidence provenance: observed
- Local verification: reproduced
- Reproduction completeness: complete
The failure fixture has no keyframes, so properties included because of selected keys cannot explain its readback. A separate executed Layer.selected control returned [true,false,true] for the same assignments.
A verified recovery is available for the tested composition by clearing selection and explicitly restoring the property, layer, key and vertex selections that must remain. Deselect All alone clears all four categories, and ordinary property replacement also changes key and vertex selection. The following complete fixture records those effects and verifies recovery for one retained property with a selected key and one selected mask vertex. It does not establish automatic recovery for arbitrary selection layouts.
Save this script as selection-recovery.jsx and run it with the same CLI command, replacing the script filename.
var c = app.project.items.addComp("Selection", 64, 64, 1, 1, 10);
c.openInViewer();
var layer = c.layers.addSolid([1, 0, 0], "Layer", 8, 8, 1);
var mask = app.run("mask.new", {layer:layer.id,vertices:[[1,1],[7,1],[7,7],[1,7]],closed:true});
var opacity = layer.transform.opacity;
var rotation = layer.transform.rotation;
rotation.setValueAtTime(0, 0);
rotation.setValueAtTime(0.5, 45);
app.run("edit.deselectAll", {});
rotation.selected = true;
opacity.selected = true;
app.run("keys.select", {keys:[{layer:layer.id,path:"transform/rotation",time:0}]});
app.run("mask.selectVertices", {vertices:[{layer:layer.id,mask:mask.mask,index:1}]});
function counts(s) { return [s.selected_props.length,s.selected_layers.length,s.selected_keys.length,s.selected_vertices.length]; }
var before = app.run("editor.state", {});
app.run("edit.deselectAll", {});
var cleared = app.run("editor.state", {});
app.run("layer.select", {layers:before.selected_layers});
app.run("prop.select", {layer:layer.id,path:"transform/rotation",add:true,selectKeys:false});
app.run("keys.select", {keys:[{layer:layer.id,path:"transform/rotation",time:0}]});
app.run("mask.selectVertices", {vertices:before.selected_vertices});
var recovered = app.run("editor.state", {});
var result = {before:counts(before),cleared:counts(cleared),recovered:counts(recovered),properties:[opacity.selected,rotation.selected],keys:rotation.selectedKeys,layerPreserved:JSON.stringify(before.selected_layers)===JSON.stringify(recovered.selected_layers),keysPreserved:JSON.stringify(before.selected_keys)===JSON.stringify(recovered.selected_keys),verticesPreserved:JSON.stringify(before.selected_vertices)===JSON.stringify(recovered.selected_vertices)};
app.run("prop.select", {layer:layer.id,path:"transform/rotation",add:false});
result.replacementCounts=counts(app.run("editor.state", {}));
result.replacementKeys=rotation.selectedKeys;
result;The executed recovery returned {"before":[2,1,1,1],"cleared":[0,0,0,0],"keys":[1],"keysPreserved":true,"layerPreserved":true,"properties":[false,true],"recovered":[1,1,1,1],"replacementCounts":[1,1,2,0],"replacementKeys":[1,2],"verticesPreserved":true}, with exit 0, ok:true and no error. Counts are selected properties, layers, keys and vertices. Recovery removed Opacity while retaining Rotation and the original layer, key and vertex selections. The final add:false property replacement selected both Rotation keys and cleared the vertex.
Restoration check
The first script must return [[true,true],[false,true],[true,true]] without extra deselection or recovery commands. Assigning false must remove Opacity while preserving Rotation; assigning true afterward must select Opacity again. Repeated false assignments must keep the target deselected. A passing result must come from the Boolean setter itself, rather than from clearing unrelated selection. The second fixture documents workaround limits and does not replace this acceptance check.
Triage assessment
- Impact level: P2
- Assessment status: supported
- Impact basis: A supported scripting setter silently leaves the wrong property selection for an ordinary valid property. The observed failure is bounded to selection state; no downstream edit, deletion or data loss was executed or claimed.
- Workaround status: available
- Workaround basis: The executed recovery fixture removed the target, retained the other property, and preserved its original layer, key and vertex selections through explicit restoration. Deselect All alone and ordinary property replacement do not preserve that state. Recovery for arbitrary selection layouts has not been verified.
Activity
fix(script): deselect individual properties via Property.selected=fal…
fix(script): Property/Layer/Item.selected setters handle false to des…