#1063: find a light's Casts Shadows option by its After Effects name

A script asks a light's options for "ADBE Casts Shadows", which returned null. The light's option
is named "Casts Shadows" here, so the lookup never matched. The name is now an alias for the
castsShadows property, and a regression test checks the lookup returns the property.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
This commit is contained in:
Kristian Myram
2026-10-13 01:53:35 +02:00
co-authored by Claude Haiku 5.5
parent 470ea7a3af
commit 5530560fb8
2 changed files with 18 additions and 0 deletions
+2
View File
@@ -393,6 +393,8 @@ fn alias(k: &str) -> Option<&'static str> {
"content" | "contents" => "contents",
"maskshape" | "maskpath" => "path",
"maskfeather" => "feather",
// A light's options name it "ADBE Casts Shadows" in After Effects (#1063).
"adbecastsshadows" => "castsShadows",
"maskopacity" => "opacity",
"maskexpansion" | "maskoffset" => "expansion",
"sourcetext" => "sourceText",
+16
View File
@@ -1010,3 +1010,19 @@ fn scripted_text_range_selector_resolves_and_is_the_only_selector() {
);
assert_eq!(o.result, json!([1, "ADBE Text Selector", 50, 100, "ADBE Text Percent Offset"]));
}
/// #1063: a script asks a light's options for After Effects' "ADBE Casts Shadows".
#[test]
fn light_options_accept_the_after_effects_casts_shadows_name() {
let mut s = session();
let o = ok(
&mut s,
r#"
var comp = app.project.items.addComp("Repro", 1920, 1080, 1, 10, 25);
var light = comp.layers.addLight("Key", [100, 100]);
var c = light.property("ADBE Light Options Group").property("ADBE Casts Shadows");
c == null ? "null" : c.name
"#,
);
assert_ne!(o.result, json!("null"), "{:?}", o.result);
}