mirror of
https://github.com/storytold/effectcraft.git
synced 2026-10-28 20:16:52 -06:00
Scripting: Property.selected=false deselects mask and effect groups too (#566 follow-up)
prop.deselect resolved its uid through prop_ref, which only finds leaf properties, so mask.selected=false threw. Resolve it as prop.select does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QiAJeFttZp83Fh7YuzAR5f
This commit is contained in:
@@ -462,7 +462,12 @@ fn select_prop(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
/// Deselect only the named property, preserving unrelated property, layer, key and
|
||||
/// mask-vertex selections. Selected keys also imply selectedProperties in the script API.
|
||||
fn deselect_prop(s: &mut Session, params: &Value) -> Result<Value> {
|
||||
let (_, lid, uid) = prop_ref(s, params, "prop.deselect")?;
|
||||
// Groups (masks, effects) are selected by uid too, so resolve the uid as prop.select does.
|
||||
let (_, lid) = layer_p(s, params, "prop.deselect")?;
|
||||
let uid = match params.get("prop").and_then(Value::as_u64) {
|
||||
Some(u) => u,
|
||||
None => prop_ref(s, params, "prop.deselect")?.2,
|
||||
};
|
||||
let mask = s.active_comp().and_then(|c| c.layer(lid)).and_then(|l| path_points(l, uid, l.layer_time(s.time()))).map(|(mask, _)| mask);
|
||||
s.state.selected_props.retain(|(layer, prop)| *layer != lid || *prop != uid);
|
||||
s.state.selected_keys.retain(|key| key.layer != lid || key.prop != uid);
|
||||
|
||||
Reference in New Issue
Block a user