M3.8: stub burn-down
Implement 20 formerly disabled menu stubs: Look at Selected/All Layers (2D viewer fit, 3D view cameras, active camera), Switch View Layout (1/2/4 views in the viewer) and Share View Options, Create Camera from 3D View, Add Output Module (every module encodes the item's frames), Pre-render (queue + Import & Replace Usage post-render action), Save Current Preview, RotoBezier / Convert To Bezier Path, Group / Ungroup Shapes, Set First Vertex, Free Transform Points, mask Motion Blur (sub-frame mask samples), Feather Falloff (smooth/linear), Hide Locked Masks, and workspace save / save as / edit. Tests incl. undo. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
c4100bcf80
commit
799b5b39ed
@@ -71,7 +71,15 @@ pub const MASK_COLORS: [[u8; 3]; 8] = [
|
||||
|
||||
pub fn mask(ids: &mut Ids, name: &str, path: ShapePath, mode: MaskMode, color: [u8; 3]) -> PropGroup {
|
||||
let mut g = ids.group("mask", name);
|
||||
g.kind = GroupKind::Mask { mode, inverted: false, color, locked: false };
|
||||
g.kind = GroupKind::Mask {
|
||||
mode,
|
||||
inverted: false,
|
||||
color,
|
||||
locked: false,
|
||||
motion_blur: Default::default(),
|
||||
feather_falloff: Default::default(),
|
||||
roto_bezier: false,
|
||||
};
|
||||
g.with(ids.prop("path", "Mask Path", Value::Path(path)).with_ui(ParamUi::Path))
|
||||
.with(ids.prop("feather", "Mask Feather", Value::Vec2([0.0, 0.0])).with_ui(ParamUi::Pixels))
|
||||
.with(ids.prop("opacity", "Mask Opacity", Value::Scalar(100.0)).with_ui(slider(0.0, 100.0, 0.0, 100.0, 0)))
|
||||
|
||||
@@ -14,7 +14,7 @@ use std::sync::Arc;
|
||||
|
||||
use effectcraft_color::{BlendMode, Label};
|
||||
use effectcraft_time::{FrameRate, Tick};
|
||||
pub use props::{Expression, GroupKind, MaskMode, Node, ParamUi, PropGroup, Property, Uid, parse_path};
|
||||
pub use props::{Expression, FeatherFalloff, GroupKind, MaskMode, MaskMotionBlur, Node, ParamUi, PropGroup, Property, Uid, parse_path};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
pub use effectcraft_keyframe as keyframe;
|
||||
|
||||
@@ -162,6 +162,15 @@ pub enum GroupKind {
|
||||
inverted: bool,
|
||||
color: [u8; 3],
|
||||
locked: bool,
|
||||
/// Layer ▸ Mask ▸ Motion Blur.
|
||||
#[serde(default)]
|
||||
motion_blur: MaskMotionBlur,
|
||||
/// Layer ▸ Mask ▸ Feather Falloff.
|
||||
#[serde(default)]
|
||||
feather_falloff: FeatherFalloff,
|
||||
/// Layer ▸ Mask and Shape Path ▸ RotoBezier: tangents follow the vertices automatically.
|
||||
#[serde(default)]
|
||||
roto_bezier: bool,
|
||||
},
|
||||
Effect {
|
||||
/// Effect spec id, e.g. `ec.blur.gaussian`.
|
||||
@@ -169,6 +178,24 @@ pub enum GroupKind {
|
||||
},
|
||||
}
|
||||
|
||||
/// Mask motion blur (sub-frame samples of an animated mask path).
|
||||
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
pub enum MaskMotionBlur {
|
||||
/// Blur when the layer's Motion Blur switch is on.
|
||||
#[default]
|
||||
SameAsLayer,
|
||||
On,
|
||||
Off,
|
||||
}
|
||||
|
||||
/// How a mask's feather ramps: Smooth (Gaussian) or Linear.
|
||||
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
pub enum FeatherFalloff {
|
||||
#[default]
|
||||
Smooth,
|
||||
Linear,
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
pub enum MaskMode {
|
||||
None,
|
||||
|
||||
@@ -401,6 +401,37 @@ pub struct RenderQueueItem {
|
||||
/// Resolved path of the last render (first file for sequences).
|
||||
#[serde(default)]
|
||||
pub last_output: Option<String>,
|
||||
/// Further Output Modules (Composition ▸ Add Output Module): the same frames are encoded
|
||||
/// once per module.
|
||||
#[serde(default, skip_serializing_if = "Vec::is_empty")]
|
||||
pub extra_outputs: Vec<OutputModule>,
|
||||
/// Post-Render Action of the first output module.
|
||||
#[serde(default, skip_serializing_if = "PostRenderAction::is_none")]
|
||||
pub post_render: PostRenderAction,
|
||||
}
|
||||
|
||||
/// What happens after an item renders (Output Module ▸ Post-Render Action).
|
||||
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Serialize, Deserialize)]
|
||||
pub enum PostRenderAction {
|
||||
#[default]
|
||||
None,
|
||||
/// Import the rendered file into the project.
|
||||
Import,
|
||||
/// Import it and replace every use of the rendered composition (Composition ▸ Pre-render).
|
||||
ImportAndReplace,
|
||||
}
|
||||
|
||||
impl PostRenderAction {
|
||||
pub fn is_none(&self) -> bool {
|
||||
*self == PostRenderAction::None
|
||||
}
|
||||
pub fn label(self) -> &'static str {
|
||||
match self {
|
||||
PostRenderAction::None => "None",
|
||||
PostRenderAction::Import => "Import",
|
||||
PostRenderAction::ImportAndReplace => "Import & Replace Usage",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl RenderQueueItem {
|
||||
@@ -415,8 +446,14 @@ impl RenderQueueItem {
|
||||
started: None,
|
||||
render_time: None,
|
||||
last_output: None,
|
||||
extra_outputs: vec![],
|
||||
post_render: PostRenderAction::None,
|
||||
}
|
||||
}
|
||||
/// Every output module, the first one first.
|
||||
pub fn output_modules(&self) -> impl Iterator<Item = &OutputModule> {
|
||||
std::iter::once(&self.output).chain(self.extra_outputs.iter())
|
||||
}
|
||||
/// Will be rendered by the next Render.
|
||||
pub fn is_queued(&self) -> bool {
|
||||
self.render && matches!(self.status, RenderStatus::Queued)
|
||||
|
||||
Reference in New Issue
Block a user