mirror of
https://github.com/storytold/effectcraft.git
synced 2026-11-20 00:55:43 +00:00
Doc comments for the functions this PR touches
This commit is contained in:
1 parent
ac34105a57
commit
8a479a4922
26 files changed
+95
No files matched your search
@@ -289,6 +289,7 @@ struct Pending {
|
||||
pub const MAX_PASSES: u32 = 24;
|
||||
|
||||
impl FrameServer {
|
||||
/// A frame server over `footage` and the optional expression host, with an empty layer cache.
|
||||
pub fn new(footage: Arc<dyn FootageSource>, expr: Option<Arc<dyn ExprHost>>) -> FrameServer {
|
||||
FrameServer {
|
||||
footage,
|
||||
|
||||
@@ -73,6 +73,8 @@ struct PathInfo {
|
||||
span: (f64, f64),
|
||||
}
|
||||
|
||||
/// Reads a mask or shape path at the current time and returns its comp-space vertices, value, expression reference and layer name.
|
||||
/// Errors when the property is missing, is not a path or has no vertices.
|
||||
fn info(s: &Session, cid: ItemId, lid: LayerId, uid: Uid, cmd: &str) -> Result<PathInfo> {
|
||||
let comp = s.project.comp(cid).ok_or(EngineError::NoComp)?;
|
||||
let layer = comp.layer(lid).ok_or(EngineError::NoComp)?;
|
||||
|
||||
@@ -1380,6 +1380,8 @@ fn convert_expr_to_keys(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
convert_one_expr(s, cid, lid, uid)
|
||||
}
|
||||
|
||||
/// Replaces the expression on one property with keyframes sampled from its evaluated values.
|
||||
/// Returns the number of properties converted.
|
||||
fn convert_one_expr(s: &mut Session, cid: ItemId, lid: LayerId, uid: Uid) -> Result<Value> {
|
||||
let comp = s.project.comp(cid).ok_or(EngineError::NoComp)?.clone();
|
||||
let layer = comp.layer(lid).ok_or(EngineError::NoComp)?.clone();
|
||||
|
||||
@@ -47,6 +47,7 @@ impl Env {
|
||||
fn of(s: &Session, cid: ItemId) -> Env {
|
||||
Env { time: s.time_of(cid), expr: s.expr.clone(), footage: s.footage.clone() }
|
||||
}
|
||||
/// The evaluation context of `comp` in `proj` at the session's current time.
|
||||
fn ctx<'a>(&'a self, proj: &'a Project, cid: ItemId, comp: &'a Comp) -> EvalCtx<'a> {
|
||||
EvalCtx {
|
||||
project: proj,
|
||||
|
||||
@@ -418,6 +418,7 @@ fn set_view_camera(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
Ok(json!({"view": v.id()}))
|
||||
}
|
||||
|
||||
/// Returns the active comp's 3D view state, with the comp size, for the 3D view commands.
|
||||
fn get_3d(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
let cid = comp_id(s, p)?;
|
||||
let comp = s.project.comp(cid).ok_or(EngineError::NoComp)?;
|
||||
|
||||
Reference in new issue
Block a user