Skip to content

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

engine: explicit layer/prop params bypass selection-based enablement

Brandon Thomasdee16181fe0e
diff --git a/crates/engine/src/lib.rs b/crates/engine/src/lib.rs
index 89bfe04f7..f93caa18f 100644
--- a/crates/engine/src/lib.rs
+++ b/crates/engine/src/lib.rs
@@ -165,7 +165,11 @@ impl Session {
pub fn execute(&mut self, id: &str, params: Value) -> Result<Value> {
let spec = commands::find(id).ok_or_else(|| EngineError::UnknownCommand(id.to_string()))?;
if let Err(why) = (spec.enabled)(self) {
- return Err(EngineError::Disabled(id.to_string(), why));
+ // Explicit targets (agents, scripts) don't need a UI selection.
+ let explicit = ["layer", "layers", "prop", "keys"].iter().any(|k| params.get(k).is_some()) && commands::has_comp(self).is_ok();
+ if !explicit {
+ return Err(EngineError::Disabled(id.to_string(), why));
+ }
}
let r = (spec.run)(self, &params)?;
if spec.journal {