Skip to main content

Crate renamite_model

Crate renamite_model 

Source
Expand description

Serializable document model + pure evaluator.

Group evaluation: pass 1 accumulates shape paths and applies modifiers in document order; pass 2 recurses/emits styles bottom-first so Scene.items is in painter’s order. Nodes live in a slotmap arena. Tree membership is attach/detach so undo/redo never changes a NodeId.

Structs§

AnimatedDash
AssetId
ClipPath
Color
CompId
Composition
CompoundPath
Multi-contour geometry: boolean results and stroke expansions produce outer contours plus holes, which one VectorPath cannot represent.
DashSample
Document
FontAsset
A project font: the user-visible name, the logical family key text nodes reference, and the raw TTF/OTF bytes (saved/loaded inside the project).
Gradient
A gradient in the node’s local space. The evaluator folds the owning shape’s world transform into start/end before baking vertex colors.
GradientStop
One color anchor along a gradient axis. offset is in 0..=1.
GradientStops
Ordered gradient stops, sampled by sample. Kept small (usually 2-4).
ImageAsset
An embedded image asset. Stores the original encoded PNG/JPEG/WebP bytes and the decoded pixel dimensions established at import time.
ImageNode
KeyframeData
Serialized keyframe (for RestoreKeyframe / undo).
LayerProps
MaskProps
Node
NodeId
NodeTransformContext
Resolved transform information for one node at an editor frame.
Overrides
Per-frame property patch. Produced by clip/state-machine playback, consumed by evaluate_with. Never touches the document.
PropPath
Scene
SceneItem
StrokeSample
TextNode
TimeMap

Enums§

Asset
BlendMode
FillRule
GradientKind
ModelError
ModifierKind
NodeKind
PaintKind
Parent
PropMut
PropRef
ScenePaint
Resolved, per-frame paint attached to a scene item. The renderer bakes this into mesh vertex colors at tessellation time.
ShapeKind
StarKind
StrokeCap
StrokeJoin
StyleKind
StylePaint
Paint on a style node: solid color or gradient. Animated so whole-list keyframes (e.g. stop-color morphs) work through the existing machinery.
TextAlign
Horizontal alignment of each line within the text block.
TrimMode
How Trim distributes [start, end] across multiple accumulated paths.
Value

Traits§

PropReader
PropValue
PropVisitor

Functions§

evaluate
evaluate_with
fill_style_for
The topmost fill style that paints shape: the last Fill style sibling in the closest ancestor scope that has one. Used by the inspector to edit a shape’s fill (the tool instead tracks the exact style via SceneItem). Children are z-ordered with index 0 = top, so the first Fill wins.
immediate_child_below
Return the immediate child of ancestor that contains descendant.
node_affine
The node’s own transform as an affine, ignoring group/accumulated transforms. Gradient handles are authored in this space and folded into world space with this same affine during evaluation, so the inverse maps world gradient handles back to local coordinates for editing.
node_is_ancestor
node_supports_opacity
Opacity multiplies into emission for every kind except masks, which only contribute a clip path and never emit paint. Modifier opacity applies to nested children (pass 3); it does not attenuate the pass-1 path effect.
node_supports_prop
Full per-prop support: section gate above, then path granularity. Anything returning false here is rejected by prop_mut/prop_ref.
node_supports_section
Whether kind honors anything in section. Sections group paths, so one arm covers a whole feature; per-path granularity (star Burst inner radius, solid-vs-gradient color, dash presence) stays in the descriptor filter and the prop_mut/prop_ref match arms.
node_supports_transform
Single source of truth for which props a node kind honors at render, keyed by section (not path string): one match instead of three parallel tables. prop_mut/prop_ref consult this, so unsupported edits fail loudly instead of writing dead values. Keep the arms in sync with eval_group/emit_style/apply_modifier.
node_transform_context
Resolve one attached node’s parent/world transforms.
nodes_bounds
Union bbox of all items belonging to nodes (selection bounds).
outer_select_target
Outermost selectable container for picked under comp.
pick
Low-level geometry hit: returns the leaf shape/text/image node.
pick_box
Nodes whose geometry is FULLY CONTAINED in the box (rubber-band semantics). min/max are normalized so drags in any direction work.
pick_box_selectable
Rubber-band variant of pick_selectable.
pick_selectable
pick_selectable_with_leaf
Topmost (outer, leaf) hit under pt, skipping locked subtrees.
prop_section_of
Sections of PropPaths a node kind supports, mirroring the section strings in renamite_behavior_common::inspect descriptors. None means the path belongs to no known section and is always rejected.
read_prop
selected_ancestor_for_pick
If picked belongs to an already-selected group/layer, return that selected ancestor instead of replacing it with the leaf shape.
selection_bounds
Union bounds of selected leaf nodes and all rendered descendants of selected groups/layers.
shape_path
The vector outline of a shape (or mask shape) node’s geometry in its own local coordinate space at frame, honoring any shape.* overrides.
stroke_style_for
Topmost stroke style in the closest ancestor scope that has one. Children are z-ordered with index 0 = top, so the first Stroke wins.
visit_prop
world_delta_to_parent
Convert a world-space drag delta to a node’s parent coordinate system.

Type Aliases§

AssetMap
CompMap
NodeMap