Skip to content

EffectCraft: An open-source motion graphics and compositing tool written by scratch in pure Rust

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

Kristian Myram5530560fb8b6
diff --git a/crates/script/src/model.rs b/crates/script/src/model.rs
index 4445fbbf2..3c44e1641 100644
--- a/crates/script/src/model.rs
+++ b/crates/script/src/model.rs
@@ -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",
diff --git a/crates/script/src/tests.rs b/crates/script/src/tests.rs
index 303bd820a..594b93044 100644
--- a/crates/script/src/tests.rs
+++ b/crates/script/src/tests.rs
@@ -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);
+}