Inspector: one row per channel, names from symbols, tweens you can see
The inspector shows what can be changed and nothing else. Ids, spans and the facts the fields below them already said are gone; explanations are hover text. Performance only appears for a face. Every animatable thing is one row: ◀ ◆ ▶, its name, its value, its gap. The arrows jump to the key before and after on every channel. A drawing's keys are an ordinary `shape` row, as are a palette placement's and a tracing layer's holds. The gap switch is about the gap the playhead is in, and on a key the one arriving at it, so keying B asks about A→B. The timeline draws every gap on a channel row, tween or hold, and a click switches it. An instance has no name of its own: it is called what it places, a rename renames the symbol, and `(n)` says how many places show it. Export numbers two placements of one symbol. Instance names in old documents are ignored. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
e2ca251ef4
commit
4b780f9e91
13 changed files with 569 additions and 510 deletions
|
|
@ -74,28 +74,28 @@
|
||||||
(defn node-label
|
(defn node-label
|
||||||
"What to call node `n` on screen.
|
"What to call node `n` on screen.
|
||||||
|
|
||||||
A NAME A PERSON TYPED WINS, and for an instance that is the ONLY thing `:name`
|
AN INSTANCE IS CALLED WHAT IT PLACES, read through on every render, and has
|
||||||
now means: `place-symbol` deliberately does not copy the symbol's name onto the
|
no name of its own. A name on the placement meant the same drawing could show
|
||||||
node it makes. Two instances of one symbol are told apart by what somebody
|
under two names, and that a rename in one place reached nowhere else; renaming
|
||||||
called them — `8625 left` and `8625 right` of one `face` — and reading through
|
an instance renames its symbol (`::ui/rename-node`), so every placement of it
|
||||||
in front of that would collapse them to the same word.
|
follows. How many places share it is `uses`.
|
||||||
|
|
||||||
OTHERWISE AN INSTANCE IS LABELLED BY WHAT IT PLACES, read through on every
|
Anything else is called by its own `:name`. An id is a uuid for a placement
|
||||||
render. A name copied at creation goes stale the moment the symbol is renamed,
|
and a keyword for an authored node, and neither reads as a name, so the last
|
||||||
and then the document shows one thing under two names: the symbol reads `bg` in
|
resort is a legible stand-in — `:face-1` loses its colon and a uuid is cut."
|
||||||
its tab while an instance of it still reads `symbol-18`, which is how a person
|
|
||||||
comes to paste a symbol into itself without being able to see that is what they
|
|
||||||
are doing. `problems` refuses that cycle; this is why it stops looking like a
|
|
||||||
reasonable thing to try.
|
|
||||||
|
|
||||||
An id is a uuid for a placement and a keyword for an authored node, and neither
|
|
||||||
reads as a name, so the last resort is a legible stand-in rather than `(str
|
|
||||||
id)` — `:face-1` keeps its colon and a uuid pushes a column open."
|
|
||||||
[clip id n]
|
[clip id n]
|
||||||
(or (:name n)
|
(or (some->> (node/source n) (symbol-name clip))
|
||||||
(some->> (node/source n) (symbol-name clip))
|
(:name n)
|
||||||
(if (keyword? id) (subs (str id) 1) (subs (str id) 0 8))))
|
(if (keyword? id) (subs (str id) 1) (subs (str id) 0 8))))
|
||||||
|
|
||||||
|
(defn uses
|
||||||
|
"How many nodes in the document place symbol `sid`."
|
||||||
|
[clip sid]
|
||||||
|
(count (for [[_ sym] (:symbols clip)
|
||||||
|
[_ n] (:nodes sym)
|
||||||
|
:when (= sid (node/source n))]
|
||||||
|
n)))
|
||||||
|
|
||||||
(defn frames
|
(defn frames
|
||||||
"A symbol's length. Read off the symbol, never copied beside it."
|
"A symbol's length. Read off the symbol, never copied beside it."
|
||||||
[clip sid]
|
[clip sid]
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,8 @@
|
||||||
interpolating matrix entries is meaningless: a rotation tweened through its
|
interpolating matrix entries is meaningless: a rotation tweened through its
|
||||||
matrix shears on the way. Flat Float64Array for evaluation because at 30fps
|
matrix shears on the way. Flat Float64Array for evaluation because at 30fps
|
||||||
per-frame allocation is the only thing that will make this stutter."
|
per-frame allocation is the only thing that will make this stutter."
|
||||||
(:require [arthur.domain.channel :as ch]))
|
(:require [arthur.domain.channel :as ch]
|
||||||
|
[clojure.string :as str]))
|
||||||
|
|
||||||
(def kinds
|
(def kinds
|
||||||
"`:bitmap` is in the vocabulary and not implemented; it is
|
"`:bitmap` is in the vocabulary and not implemented; it is
|
||||||
|
|
@ -108,6 +109,17 @@
|
||||||
[:audio :pan] (ch/framed 0.0)
|
[:audio :pan] (ch/framed 0.0)
|
||||||
[:audio :rate] (ch/framed 1.0)})
|
[:audio :rate] (ch/framed 1.0)})
|
||||||
|
|
||||||
|
(def ^:private channel-names
|
||||||
|
{[:xform :pos] "pos" [:xform :rot] "rot°" [:xform :scale] "scale"
|
||||||
|
[:xform :skew] "skew" [:xform :pivot] "pivot" [:geom :pts] "shape"
|
||||||
|
[:style :color] "color" [:vis] "vis" [:palette] "palette"})
|
||||||
|
|
||||||
|
(defn channel-name
|
||||||
|
"What to call channel `path` on screen: the same short word in the inspector
|
||||||
|
and the timeline."
|
||||||
|
[path]
|
||||||
|
(or (channel-names path) (str/join " " (map name path))))
|
||||||
|
|
||||||
(defn defaults-of [n]
|
(defn defaults-of [n]
|
||||||
(if (= :audio (:kind n)) audio-defaults defaults))
|
(if (= :audio (:kind n)) audio-defaults defaults))
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -78,18 +78,22 @@
|
||||||
the other instances removed, which is why seven instances of one symbol are
|
the other instances removed, which is why seven instances of one symbol are
|
||||||
seven different exports rather than seven copies of one.
|
seven different exports rather than seven copies of one.
|
||||||
|
|
||||||
Instances are ordered and labelled by `clip/node-label`, never by id: a uuid
|
Instances are labelled by `clip/node-label` — the symbol they place — and
|
||||||
sorts at random and means nothing to read."
|
numbered in stacking order where one symbol is placed more than once, never
|
||||||
|
by id: a uuid sorts at random and means nothing to read."
|
||||||
[clip open]
|
[clip open]
|
||||||
(let [label #(clip/node-label clip %1 %2)
|
(let [label #(clip/node-label clip %1 %2)
|
||||||
instances (->> (get-in clip [:symbols open :nodes])
|
instances (->> (get-in clip [:symbols open :nodes])
|
||||||
(filter (comp #{:instance} :kind val))
|
(filter (comp #{:instance} :kind val))
|
||||||
(sort-by (fn [[id n]] [(label id n) (str id)])))]
|
(sort-by (fn [[id n]] [(label id n) (or (:z n) "") (str id)])))
|
||||||
|
numbered (mapcat (fn [same]
|
||||||
|
(if (< 1 (count same))
|
||||||
|
(map-indexed (fn [i [id n]] [id (str (label id n) " " (inc i))]) same)
|
||||||
|
(map (fn [[id n]] [id (label id n)]) same)))
|
||||||
|
(partition-by (fn [[id n]] (label id n)) instances))]
|
||||||
(into (mapv (fn [sid] {:symbol sid :label (name sid)})
|
(into (mapv (fn [sid] {:symbol sid :label (name sid)})
|
||||||
(sort-by str (keys (:symbols clip))))
|
(sort-by str (keys (:symbols clip))))
|
||||||
(mapv (fn [[id n]]
|
(mapv (fn [[id l]] {:symbol open :isolate id :label l}) numbered))))
|
||||||
{:symbol open :isolate id :label (label id n)})
|
|
||||||
instances))))
|
|
||||||
|
|
||||||
(defn target
|
(defn target
|
||||||
"What the export is pointed at. A nil symbol is whichever one is open, so a
|
"What the export is pointed at. A nil symbol is whichever one is open, so a
|
||||||
|
|
|
||||||
|
|
@ -45,14 +45,19 @@
|
||||||
|
|
||||||
(rf/reg-event-db
|
(rf/reg-event-db
|
||||||
::rename-node
|
::rename-node
|
||||||
|
;; An instance has no name of its own — see `clip/node-label` — so renaming one
|
||||||
|
;; renames the symbol it places, everywhere it is placed. Blank removes the
|
||||||
|
;; name, which falls back to the id.
|
||||||
(fn [db [_ sid id value]]
|
(fn [db [_ sid id value]]
|
||||||
(let [document (:clip (store/entry (:clip/current db)))
|
(let [document (:clip (store/entry (:clip/current db)))
|
||||||
|
n (get-in document [:symbols sid :nodes id])
|
||||||
|
path (if-let [of (node/source n)] [:symbols of] [:symbols sid :nodes id])
|
||||||
value (not-empty (str/trim (str value)))]
|
value (not-empty (str/trim (str value)))]
|
||||||
(if-not (get-in document [:symbols sid :nodes id])
|
(if (or (nil? n) (nil? (get-in document path)))
|
||||||
db
|
db
|
||||||
(edit/transaction db #(if value
|
(edit/transaction db #(if value
|
||||||
(assoc-in % [:symbols sid :nodes id :name] value)
|
(assoc-in % (conj path :name) value)
|
||||||
(update-in % [:symbols sid :nodes id] dissoc :name)))))))
|
(update-in % path dissoc :name)))))))
|
||||||
|
|
||||||
(defn selected
|
(defn selected
|
||||||
"`db` with `selection` as its primary active row.
|
"`db` with `selection` as its primary active row.
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,17 @@
|
||||||
;; row out of a dozen says at a glance that its blocks follow one another in
|
;; row out of a dozen says at a glance that its blocks follow one another in
|
||||||
;; time instead of being on screen together. Whole and half coordinates, so
|
;; time instead of being on screen together. Whole and half coordinates, so
|
||||||
;; the three dividers land on pixels at 11px.
|
;; the three dividers land on pixels at 11px.
|
||||||
:lane {:stroke ["M1.5 3.5h9v5h-9z" "M4.5 3.5v5" "M7.5 3.5v5"]}})
|
:lane {:stroke ["M1.5 3.5h9v5h-9z" "M4.5 3.5v5" "M7.5 3.5v5"]}
|
||||||
|
;; To the key before and after: the transport's step, without its bar.
|
||||||
|
:prev {:fill ["M8.5 3v6L4 6z"]}
|
||||||
|
:next {:fill ["M3.5 3v6L8 6z"]}
|
||||||
|
;; The gap between two keys as a value graph draws it: a ramp from one to
|
||||||
|
;; the other, or a step that holds and then jumps.
|
||||||
|
:tween {:fill ["M1.5 8h2v2h-2z" "M8.5 2h2v2h-2z"] :stroke ["M3 8.5 9 3.5"]}
|
||||||
|
:hold {:fill ["M1.5 8h2v2h-2z" "M8.5 2h2v2h-2z"] :stroke ["M3.5 9H9.5V4"]}
|
||||||
|
;; How an instance plays: through once into a stop, round, or one frame.
|
||||||
|
:once {:fill ["M2.4 2.6 7.6 6 2.4 9.4z" "M8.4 2.6h1.4v6.8H8.4z"]}
|
||||||
|
:still {:stroke ["M3.5 2.5h5v7h-5z"] :fill ["M5 4.5h2v3H5z"]}})
|
||||||
|
|
||||||
(defn view
|
(defn view
|
||||||
"The glyph named `k`, sized by CSS and inked in `currentColor` — so a button's
|
"The glyph named `k`, sized by CSS and inked in `currentColor` — so a button's
|
||||||
|
|
|
||||||
|
|
@ -111,20 +111,6 @@
|
||||||
(when (and (nil? t) (not held?)) " · repeats; no single frame above"))
|
(when (and (nil? t) (not held?)) " · repeats; no single frame above"))
|
||||||
:else nil)))
|
:else nil)))
|
||||||
|
|
||||||
(defn- shared-with
|
|
||||||
"How many places in the document use the same drawing as `n`, or nil where it
|
|
||||||
places none. Counted rather than flagged, because \"used in 4 places\" is the
|
|
||||||
fact somebody needs before deciding to decouple one — and counted over every
|
|
||||||
node that places it, not only over cels, because a drawing reused as a plain
|
|
||||||
instance somewhere else is just as shared and `make unique` is just as much
|
|
||||||
the answer."
|
|
||||||
[clip n]
|
|
||||||
(when-let [of (and n (node/source n))]
|
|
||||||
(count (for [[_ sym] (:symbols clip)
|
|
||||||
[_ other] (:nodes sym)
|
|
||||||
:when (= of (node/source other))]
|
|
||||||
other))))
|
|
||||||
|
|
||||||
(defn view []
|
(defn view []
|
||||||
(let [clip @(rf/subscribe [::render/clip])
|
(let [clip @(rf/subscribe [::render/clip])
|
||||||
open @(rf/subscribe [::render/open])
|
open @(rf/subscribe [::render/open])
|
||||||
|
|
@ -134,7 +120,7 @@
|
||||||
n (when (= :node kind) (get-in clip [:symbols sid :nodes id]))
|
n (when (= :node kind) (get-in clip [:symbols sid :nodes id]))
|
||||||
crumbs (trail clip open (if (and n (seq path)) path (when n [id])))
|
crumbs (trail clip open (if (and n (seq path)) path (when n [id])))
|
||||||
last-i (dec (count crumbs))
|
last-i (dec (count crumbs))
|
||||||
shared (shared-with clip n)
|
shared (some->> n node/source (clip/uses clip))
|
||||||
says (whereabouts clip n inside)]
|
says (whereabouts clip n inside)]
|
||||||
[:section.loc
|
[:section.loc
|
||||||
[:nav.crumbs {:aria-label "editing location"}
|
[:nav.crumbs {:aria-label "editing location"}
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,12 @@
|
||||||
(ns arthur.ui.params
|
(ns arthur.ui.params
|
||||||
"The right pane: what the selection is, and what can be changed about it.
|
"The right pane: what the selection is, and what can be changed about it.
|
||||||
|
|
||||||
Sections rather than a mode switch. The clip's facts are always true, so the
|
ONLY WHAT CAN BE CHANGED. An id, a span, a count of nodes are either in the
|
||||||
clip section is always there; node, footage, face and tracking sections follow
|
timeline already or of no use to somebody drawing, so the pane shows controls
|
||||||
the thing actually selected. Nothing here computes — every control dispatches
|
and nothing else, densely: a header naming the selection, then one row per
|
||||||
an intent and every readout comes off a subscription."
|
thing that can be keyed, then whatever else the selection has. Nothing here
|
||||||
|
computes — every control dispatches an intent and every readout comes off a
|
||||||
|
subscription."
|
||||||
(:require [clojure.string :as str]
|
(:require [clojure.string :as str]
|
||||||
[arthur.domain.clip :as clip-domain]
|
[arthur.domain.clip :as clip-domain]
|
||||||
[arthur.domain.channel :as channel]
|
[arthur.domain.channel :as channel]
|
||||||
|
|
@ -17,32 +19,24 @@
|
||||||
[arthur.domain.pose :as pose]
|
[arthur.domain.pose :as pose]
|
||||||
[arthur.domain.symbol :as symbol]
|
[arthur.domain.symbol :as symbol]
|
||||||
[arthur.events.history :as history]
|
[arthur.events.history :as history]
|
||||||
[arthur.events.paint :as paint-events]
|
|
||||||
[arthur.events.playback :as pb]
|
[arthur.events.playback :as pb]
|
||||||
[arthur.events.project :as project]
|
[arthur.events.project :as project]
|
||||||
[arthur.events.ui :as ui]
|
[arthur.events.ui :as ui]
|
||||||
[arthur.subs.playback :as playback]
|
[arthur.subs.playback :as playback]
|
||||||
[arthur.subs.render :as render]
|
[arthur.subs.render :as render]
|
||||||
[arthur.subs.ui :as sub]
|
[arthur.subs.ui :as sub]
|
||||||
|
[arthur.ui.icon :as icon]
|
||||||
[arthur.ui.palette :as palette]
|
[arthur.ui.palette :as palette]
|
||||||
[arthur.ui.settings :as settings]
|
[arthur.ui.settings :as settings]
|
||||||
[re-frame.core :as rf]
|
[re-frame.core :as rf]
|
||||||
[reagent.core :as r]))
|
[reagent.core :as r]))
|
||||||
|
|
||||||
(defn- brief
|
(defn- brief
|
||||||
"A value that fits the column. The `facts` list puts the whole thing in a
|
"A value that fits the column, for the few places an id is still the only name."
|
||||||
`title`, so nothing is lost — but a node id is a uuid and a `:z` is a
|
|
||||||
timestamp joined to one, and either wrapped over three lines pushes every
|
|
||||||
parameter below it off the pane."
|
|
||||||
[v]
|
[v]
|
||||||
(let [s (str v)]
|
(let [s (str v)]
|
||||||
(if (> (count s) 22) (str (subs s 0 20) "…") s)))
|
(if (> (count s) 22) (str (subs s 0 20) "…") s)))
|
||||||
|
|
||||||
(defn- facts [& pairs]
|
|
||||||
(into [:dl.facts]
|
|
||||||
(mapcat (fn [[k v]] (when v [[:dt k] [:dd {:title (str v)} v]])))
|
|
||||||
(partition 2 pairs)))
|
|
||||||
|
|
||||||
(defn- section [title & body]
|
(defn- section [title & body]
|
||||||
(into [:section.section [:h2 title]] body))
|
(into [:section.section [:h2 title]] body))
|
||||||
|
|
||||||
|
|
@ -70,316 +64,349 @@
|
||||||
(when @draft (reset! draft s))
|
(when @draft (reset! draft s))
|
||||||
(when-not (js/isNaN n) (on-number n))))})])))
|
(when-not (js/isNaN n) (on-number n))))})])))
|
||||||
|
|
||||||
(defn- number-field [label value on-change & [placeholder disabled?]]
|
(defn- count-input
|
||||||
[:label.inspector-field label
|
"A whole number of at least 1, blank meaning \"none of its own\"."
|
||||||
[number-input {:min 1 :step 1 :value value
|
[value on-change & [{:keys [placeholder disabled label]}]]
|
||||||
:placeholder placeholder
|
[number-input {:min 1 :step 1 :value value :placeholder placeholder
|
||||||
:disabled disabled?
|
:disabled disabled :aria-label label :title label
|
||||||
:parse #(if (seq %) (js/parseInt % 10) nil)
|
:parse #(if (seq %) (js/parseInt % 10) nil)
|
||||||
:on-number on-change}]])
|
:on-number on-change}])
|
||||||
|
|
||||||
(defn- name-field [label value commit!]
|
(defn- text-input [value commit! & [attrs]]
|
||||||
[:label.inspector-field label
|
[:input (merge {:type "text" :default-value value
|
||||||
[:input {:type "text" :default-value value
|
:key value
|
||||||
:key value
|
:on-key-down #(when (= "Enter" (.-key %)) (.. % -target blur))
|
||||||
:on-key-down #(when (= "Enter" (.-key %)) (.. % -target blur))
|
:on-blur #(commit! (.. % -target -value))}
|
||||||
:on-blur #(commit! (.. % -target -value))}]])
|
attrs)])
|
||||||
|
|
||||||
|
(defn- prop
|
||||||
|
"One labelled row of a form: the label in the narrow column, controls after."
|
||||||
|
[label & controls]
|
||||||
|
(into [:div.prop [:span.prop-name label]] controls))
|
||||||
|
|
||||||
|
(defn- palette-select [value on-change & [disabled?]]
|
||||||
|
(let [clip @(rf/subscribe [::render/clip])]
|
||||||
|
[:select {:value (str (or value "")) :disabled disabled?
|
||||||
|
:on-change (fn [e]
|
||||||
|
(let [v (.. e -target -value)]
|
||||||
|
(on-change (first (filter #(= v (str %)) (keys (pal/palettes clip)))))))}
|
||||||
|
[:option {:value ""} "inherit"]
|
||||||
|
(for [[id p] (sort-by (comp str :name val) (pal/palettes clip))]
|
||||||
|
^{:key (str id)} [:option {:value (str id)} (:name p)])]))
|
||||||
|
|
||||||
;; ---------------------------------------------------------------------------
|
;; ---------------------------------------------------------------------------
|
||||||
;; the clip
|
;; the header
|
||||||
|
|
||||||
(defn- clip-section []
|
(defn- header
|
||||||
(let [clip @(rf/subscribe [::render/clip])
|
"What is selected, as its name — the one field that says which thing this is.
|
||||||
open @(rf/subscribe [::render/open])
|
An instance is called what it places, so its name IS its symbol's and a rename
|
||||||
frames @(rf/subscribe [::render/frames])
|
here reaches every placement; `(n)` says how many that is."
|
||||||
project @(rf/subscribe [::playback/project])
|
[kind value placeholder commit! uses]
|
||||||
busy? (:busy? project)]
|
[:div.inspect-head
|
||||||
[section "project"
|
[:span.inspect-kind kind]
|
||||||
[facts
|
[text-input value commit! {:class "inspect-name" :placeholder placeholder
|
||||||
"stage" (str (:width clip) "×" (:height clip))
|
:aria-label "name"}]
|
||||||
"open" (some-> open name)
|
(when (and uses (< 1 uses))
|
||||||
"length" (str frames " frames")]
|
[:span.uses {:title (str "placed " uses " times · a rename reaches every one")}
|
||||||
[:div.inspector-form
|
(str "(" uses ")")])])
|
||||||
[name-field "name" (or (:name project) (:name clip) "")
|
|
||||||
#(rf/dispatch [::project/rename %])]
|
|
||||||
[number-field "width" (:width clip)
|
|
||||||
#(rf/dispatch [::project/project-setting :width %]) nil busy?]
|
|
||||||
[number-field "height" (:height clip)
|
|
||||||
#(rf/dispatch [::project/project-setting :height %]) nil busy?]
|
|
||||||
[settings/rate busy?]]]))
|
|
||||||
|
|
||||||
;; ---------------------------------------------------------------------------
|
;; ---------------------------------------------------------------------------
|
||||||
;; a node
|
;; one row per channel
|
||||||
|
;;
|
||||||
|
;; ◀ ◆ ▶, the name, the value, and the gap: the same row for a transform, a
|
||||||
|
;; colour, a drawing and a palette, as After Effects puts its key navigator by
|
||||||
|
;; every property. ◆ keys the channel here or takes the key here off; an edit
|
||||||
|
;; writes a key on a keyed channel or the one value on one that is not. ◀ ▶ go to
|
||||||
|
;; the key before and after. The gap switch is the same choice as clicking the
|
||||||
|
;; gap in the timeline.
|
||||||
|
|
||||||
(defn- channel-state
|
(def ^:private order
|
||||||
"One line saying how this channel is animated, which is the only thing about it
|
(zipmap [[:xform :pos] [:xform :rot] [:xform :scale] [:xform :skew] [:xform :pivot]
|
||||||
this pane can say without an editor for its values."
|
paint/geometry [:style :color] [:vis]]
|
||||||
[ch]
|
(range)))
|
||||||
(cond
|
|
||||||
(:dense ch) (str "dense · " (get-in ch [:dense :frames]) " frames")
|
|
||||||
(:keys ch) (str (count (:keys ch)) " keys · " (name (or (:interp ch) :hold)))
|
|
||||||
:else (let [v (:value ch)]
|
|
||||||
(str "framed · " (if (channel/nothing? v) "absent" (pr-str v))))))
|
|
||||||
|
|
||||||
(defn- segment-select
|
(defn- gap-at
|
||||||
"Hold or tween, for the gap after the key at `left` — the same choice on a
|
"The key whose gap the switch is about, given the keys `ks` and frame `f`: the
|
||||||
drawing as on a transform."
|
gap the playhead is inside, and standing on a key, the gap ARRIVING at it —
|
||||||
[sid id path ch left]
|
keying B after A is asking about A→B. On the first key, the gap leaving it."
|
||||||
[:select.interp {:value (name (or (channel/segment-interp ch left) :hold))
|
[ks f]
|
||||||
:on-change #(rf/dispatch [::project/set-segment-interp
|
(when f
|
||||||
sid id path left (keyword (.. % -target -value))])}
|
(let [left (or (last (filter #(< % f) ks)) (when (= f (first ks)) f))]
|
||||||
[:option {:value "hold"} "hold"]
|
(when (and left (some #(< left %) ks)) left))))
|
||||||
[:option {:value "linear"} "tween"]])
|
|
||||||
|
|
||||||
(defn- drawing-keys
|
(defn- seek-own!
|
||||||
"The polygon controls: jump to a drawing key, add one here, and choose what the
|
"Put the playhead on own frame `f` of something whose clock is `time`."
|
||||||
gap after the current one does. Lifted out of the old stage toolbar unchanged —
|
[time f]
|
||||||
a drawing key is a parameter of the shape, and this is where the shape's
|
(rf/dispatch [::pb/seek (js/Math.round (+ (:at time) (/ f (:rate time))))]))
|
||||||
parameters are.
|
|
||||||
|
|
||||||
Keys are in the shape's OWN frames — the symbol's it lives in, through every
|
(defn- key-nav
|
||||||
instance above it — and `time` maps the open symbol's frames to them. `frame`
|
"◀ ◆ ▶ over keys `ks`: `frame` is the one being edited, nil off screen, and
|
||||||
is nil when the shape is not on screen, where there is no here to key."
|
`own` is `{:time :frame}`, the clock the jumps go through."
|
||||||
[sid id n {:keys [frame time]}]
|
[ks frame {:keys [time] here :frame} on-key title]
|
||||||
(let [geom (get-in n [:channels paint/geometry])
|
(let [ks (sort ks)
|
||||||
active (when geom (paint/active-frame geom frame))
|
here (or frame here)
|
||||||
ks (when geom (sort (keys (:keys geom))))
|
before (when here (last (filter #(< % here) ks)))
|
||||||
next-k (first (filter #(> % active) ks))
|
after (when here (first (filter #(> % here) ks)))]
|
||||||
[start end] (:span n)]
|
[:span.key-nav
|
||||||
[:<>
|
[:button.nav {:disabled (or (nil? before) (nil? time))
|
||||||
[:div.row {:style {:margin "5px 0"}}
|
:title (if before (str "key at " before) "no key before")
|
||||||
[:button {:disabled (or (nil? frame) (< frame start) (>= frame end)
|
:aria-label "previous key"
|
||||||
(contains? (:keys geom) frame))
|
:on-click #(seek-own! time before)}
|
||||||
:on-click #(rf/dispatch [::paint-events/add-key sid id frame])}
|
[icon/view :prev]]
|
||||||
"drawing key here"]]
|
[:button.key {:class (cond (some #{frame} ks) "on" (seq ks) "keyed")
|
||||||
(when (seq ks)
|
:disabled (nil? frame)
|
||||||
[:div.row
|
:title title
|
||||||
[:span.dim "keys"]
|
:on-click on-key}
|
||||||
(doall
|
"◆"]
|
||||||
(for [f ks]
|
[:button.nav {:disabled (or (nil? after) (nil? time))
|
||||||
^{:key f}
|
:title (if after (str "key at " after) "no key after")
|
||||||
[:button {:class (when (= frame f) "on")
|
:aria-label "next key"
|
||||||
:disabled (nil? time)
|
:on-click #(seek-own! time after)}
|
||||||
:on-click #(rf/dispatch [::pb/seek (js/Math.round
|
[icon/view :next]]]))
|
||||||
(+ (:at time) (/ f (:rate time))))])}
|
|
||||||
(str f)]))])
|
|
||||||
(when next-k
|
|
||||||
[:div.row {:style {:margin-top "5px"}}
|
|
||||||
[:label.dim (str "key " active " → " next-k " ")
|
|
||||||
[segment-select sid id paint/geometry geom active]]])]))
|
|
||||||
|
|
||||||
;; The transform and visibility, which every node has, as one row each: ◆ keys
|
(defn- gap-switch [ch path frame set-gap!]
|
||||||
;; the channel here or takes the key here off, and an edit writes a key on a
|
(let [ks (sort (keys (:keys ch)))
|
||||||
;; keyed channel or the one value on one that is not. `frame` is the node's own,
|
left (when-not (node/hold-only? path (channel/value-at ch (or frame 0) nil))
|
||||||
;; nil when it is not on screen, where a keyed channel has no here to write to.
|
(gap-at ks frame))
|
||||||
;; Rotation is shown in degrees. Between two keys, the gap after the one here
|
tween? (and left (= :linear (channel/segment-interp ch left)))]
|
||||||
;; holds or tweens, as a drawing's does.
|
(if left
|
||||||
|
[:button.gap {:class (when tween? "on")
|
||||||
|
:title (str (if tween? "tween" "hold") " from key " left
|
||||||
|
" · click to " (if tween? "hold" "tween"))
|
||||||
|
:aria-label (if tween? "tween" "hold")
|
||||||
|
:on-click #(set-gap! left (if tween? :hold :linear))}
|
||||||
|
[icon/view (if tween? :tween :hold)]]
|
||||||
|
[:span.gap])))
|
||||||
|
|
||||||
(defn- channel-control [sid id path ch frame auto-key? node-path]
|
(defn- channel-row
|
||||||
|
"Channel `path`, `ch`, of whatever the row is about. `frame` is its own frame
|
||||||
|
being edited, nil where it is not on screen and a keyed channel has no here to
|
||||||
|
write to; `own` is its clock. `on-key` and `set-gap!` are the writes, `value`
|
||||||
|
the editor."
|
||||||
|
[{:keys [path ch frame own live? on-key set-gap!]} value]
|
||||||
|
(let [ks (keys (:keys ch))]
|
||||||
|
[:div.chan {:class (when live? "live") :data-channel (str/join " " (map name path))}
|
||||||
|
[key-nav ks frame own on-key
|
||||||
|
(if (seq ks) (str (count ks) " keys · key or unkey here") "key this here")]
|
||||||
|
[:span.chan-name (node/channel-name path)]
|
||||||
|
[:span.chan-value value]
|
||||||
|
[gap-switch ch path frame set-gap!]]))
|
||||||
|
|
||||||
|
(defn- number-fields
|
||||||
|
"The value of a number or a vector of them, as boxes. Rotation is shown in
|
||||||
|
degrees."
|
||||||
|
[path v off? put]
|
||||||
|
(let [deg? (= path [:xform :rot])
|
||||||
|
field (fn [i x on-number]
|
||||||
|
^{:key i}
|
||||||
|
[number-input {:step "any" :disabled off?
|
||||||
|
:value (if deg? (/ (js/Math.round (* x (/ 18000 js/Math.PI))) 100) x)
|
||||||
|
:parse js/parseFloat
|
||||||
|
:on-number #(on-number (if deg? (* % (/ js/Math.PI 180)) %))}])]
|
||||||
|
(if (number? v)
|
||||||
|
(field 0 v put)
|
||||||
|
(doall (map-indexed (fn [i x] (field i x #(put (assoc (vec v) i %)))) v)))))
|
||||||
|
|
||||||
|
(defn- swatches [value off? palette pick!]
|
||||||
|
[:span.chan-swatches
|
||||||
|
(doall
|
||||||
|
(for [[i {:keys [name hex]}] (map-indexed vector (:slots palette))]
|
||||||
|
^{:key i}
|
||||||
|
[:button.swatch
|
||||||
|
{:class (when (= i value) "on")
|
||||||
|
:style {:background hex}
|
||||||
|
:disabled off?
|
||||||
|
:aria-label (str "color " i (when name (str " " (clojure.core/name name))))
|
||||||
|
:aria-pressed (= i value)
|
||||||
|
:title (str i (when name (str " · " (clojure.core/name name))) " · " hex)
|
||||||
|
:on-click #(pick! i)}]))])
|
||||||
|
|
||||||
|
(defn- channel-value
|
||||||
|
"The editor for channel `path` of node `n`: boxes, a switch, swatches — or,
|
||||||
|
where there is nothing to type, what it is."
|
||||||
|
[sid id n path ch frame palette node-path]
|
||||||
(let [keyed? (some? (:keys ch))
|
(let [keyed? (some? (:keys ch))
|
||||||
;; No store: the call site below hands this only channels that are not
|
|
||||||
;; `:dense`, which are the only ones with anything in tier 2 to read.
|
|
||||||
v (channel/value-at ch (or frame 0) nil)
|
|
||||||
off? (and keyed? (nil? frame))
|
off? (and keyed? (nil? frame))
|
||||||
deg? (= path [:xform :rot])
|
v (when-not (:dense ch) (channel/value-at ch (or frame 0) nil))
|
||||||
;; A boolean has nothing between true and false to tween through.
|
put #(rf/dispatch [::project/set-channel sid id path frame %])]
|
||||||
left (when (and keyed? frame (not (boolean? v))) (paint/active-frame ch frame))
|
(cond
|
||||||
gap? (and left (some #(< left %) (keys (:keys ch))))
|
(:dense ch)
|
||||||
put #(rf/dispatch [::project/set-channel sid id path frame %])
|
[:span.dim {:title "measured from the footage · regenerate to change it"}
|
||||||
field (fn [i x on-number]
|
(str "measured · " (get-in ch [:dense :frames]) "f")]
|
||||||
^{:key i}
|
|
||||||
[number-input {:step "any" :disabled off?
|
|
||||||
:value (if deg? (/ (js/Math.round (* x (/ 18000 js/Math.PI))) 100) x)
|
|
||||||
:parse js/parseFloat
|
|
||||||
:on-number #(on-number (if deg? (* % (/ js/Math.PI 180)) %))}])]
|
|
||||||
[:dd.channel {:class (when auto-key? "live")}
|
|
||||||
[:button.key {:class (cond (contains? (:keys ch) frame) "on" keyed? "keyed")
|
|
||||||
:disabled (nil? frame)
|
|
||||||
:title (if keyed? (str (count (:keys ch)) " keys") "key this here")
|
|
||||||
:on-click #(rf/dispatch [::project/toggle-key sid id path frame])}
|
|
||||||
"◆"]
|
|
||||||
(cond
|
|
||||||
(boolean? v) [:input {:type "checkbox" :checked v :disabled off?
|
|
||||||
:on-change #(put (.. % -target -checked))}]
|
|
||||||
(number? v) (field 0 v put)
|
|
||||||
:else (doall (map-indexed (fn [i x] (field i x #(put (assoc (vec v) i %))))
|
|
||||||
v)))
|
|
||||||
;; THE WAY BACK TO THE MIDDLE, on the pivot row and nowhere else. A pivot is
|
|
||||||
;; a choice and does not follow the drawing, which is what keeps a keyed spin
|
|
||||||
;; from being re-aimed by somebody drawing one more shape inside the symbol —
|
|
||||||
;; so "put it back in the middle of what is there now" has to be something
|
|
||||||
;; you can ask for. `::ui/centre-pivot` moves nothing while it does it.
|
|
||||||
(when (and (= path [:xform :pivot]) (seq node-path))
|
|
||||||
[:button.key {:title "centre the pivot on the middle of what it draws now"
|
|
||||||
:aria-label "centre pivot"
|
|
||||||
:on-click #(rf/dispatch [::ui/centre-pivot node-path])}
|
|
||||||
"⌖"])
|
|
||||||
(when gap? [segment-select sid id path ch left])]))
|
|
||||||
|
|
||||||
(defn- color-control [sid id ch frame auto-key? palette]
|
(= path paint/geometry)
|
||||||
(let [keyed? (some? (:keys ch))
|
[:span.dim {:title "double-click the shape on the stage to edit its points"}
|
||||||
value (channel/value-at ch (or frame 0) nil)
|
(str (quot (count v) 2) " points")]
|
||||||
;; A knockout or a remap is no slot, and none is marked.
|
|
||||||
value (cond
|
|
||||||
(integer? value) value
|
|
||||||
(keyword? value) (or (first (keep-indexed #(when (= value (:name %2)) %1)
|
|
||||||
(:slots palette))) 0))
|
|
||||||
off? (and keyed? (nil? frame))]
|
|
||||||
[:dd.channel {:class (when auto-key? "live")}
|
|
||||||
[:button.key {:class (cond (contains? (:keys ch) frame) "on" keyed? "keyed")
|
|
||||||
:disabled (nil? frame)
|
|
||||||
:title (if keyed? (str (count (:keys ch)) " held keys") "key color here")
|
|
||||||
:on-click #(rf/dispatch [::project/toggle-key sid id [:style :color] frame])}
|
|
||||||
"◆"]
|
|
||||||
[:div.channel-swatches
|
|
||||||
(doall
|
|
||||||
(for [[i {:keys [name hex]}] (map-indexed vector (:slots palette))]
|
|
||||||
^{:key i}
|
|
||||||
[:button.swatch
|
|
||||||
{:class (when (= i value) "on")
|
|
||||||
:style {:background hex}
|
|
||||||
:disabled off?
|
|
||||||
:aria-label (str "color " i (when name (str " " (clojure.core/name name))))
|
|
||||||
:aria-pressed (= i value)
|
|
||||||
:title (str i (when name (str " · " (clojure.core/name name))) " · " hex)
|
|
||||||
:on-click #(rf/dispatch [::project/set-channel sid id [:style :color] frame i])}]))]
|
|
||||||
(when keyed? [:span.dim "hold"])]))
|
|
||||||
|
|
||||||
(defn- instance-playback [[sid id n]]
|
(= path [:style :color])
|
||||||
|
(if (symbol/remap? v)
|
||||||
|
[:span.dim "remap ↓"]
|
||||||
|
;; A slot by name is the slot of that name; a knockout is none.
|
||||||
|
(swatches (if (keyword? v)
|
||||||
|
(first (keep-indexed #(when (= v (:name %2)) %1) (:slots palette)))
|
||||||
|
(when (integer? v) v))
|
||||||
|
off? palette put))
|
||||||
|
|
||||||
|
(boolean? v)
|
||||||
|
[:input {:type "checkbox" :checked v :disabled off?
|
||||||
|
:on-change #(put (.. % -target -checked))}]
|
||||||
|
|
||||||
|
(or (number? v) (and (sequential? v) (every? number? v)))
|
||||||
|
[:<>
|
||||||
|
(number-fields path v off? put)
|
||||||
|
;; A pivot does not follow the drawing, so "put it back in the middle of
|
||||||
|
;; what is there now" has to be something you can ask for. Moves nothing.
|
||||||
|
(when (and (= path [:xform :pivot]) (seq node-path))
|
||||||
|
[:button.icon {:title "centre the pivot on what it draws now"
|
||||||
|
:aria-label "centre pivot"
|
||||||
|
:on-click #(rf/dispatch [::ui/centre-pivot node-path])}
|
||||||
|
"⌖"])]
|
||||||
|
|
||||||
|
:else [:span.dim (brief (pr-str v))])))
|
||||||
|
|
||||||
|
(defn- channels
|
||||||
|
"Every channel of node `n`, transform first."
|
||||||
|
[[sid id n] node-path]
|
||||||
|
(let [auto-key? @(rf/subscribe [::sub/auto-key?])
|
||||||
|
clip @(rf/subscribe [::render/clip])
|
||||||
|
frame (:frame @(rf/subscribe [::sub/selected-placement]))
|
||||||
|
own @(rf/subscribe [::sub/own-time node-path])
|
||||||
|
palette (get (pal/palettes clip)
|
||||||
|
(or (get-in clip [:symbols sid :palette]) (pal/default-palette-id clip)))]
|
||||||
|
[:div.chans
|
||||||
|
(doall
|
||||||
|
(for [[path ch] (sort-by (fn [[path]] [(get order path 99) (str path)]) (node/channels n))]
|
||||||
|
^{:key (str path)}
|
||||||
|
[channel-row {:path path :ch ch :frame frame :own own
|
||||||
|
:live? (and auto-key? (not (:dense ch)))
|
||||||
|
:on-key #(rf/dispatch [::project/toggle-key sid id path frame])
|
||||||
|
:set-gap! #(rf/dispatch [::project/set-segment-interp sid id path %1 %2])}
|
||||||
|
[channel-value sid id n path ch frame palette node-path]]))]))
|
||||||
|
|
||||||
|
;; ---------------------------------------------------------------------------
|
||||||
|
;; an instance's playback, and a symbol's own settings
|
||||||
|
|
||||||
|
(def ^:private modes
|
||||||
|
[[:once :once "play once"] [:loop :loop "loop"] [:frame :still "hold one frame"]])
|
||||||
|
|
||||||
|
(defn- playback-row [[sid id n]]
|
||||||
(let [{:keys [in speed end]} (node/playback-of n)
|
(let [{:keys [in speed end]} (node/playback-of n)
|
||||||
mode (cond (zero? speed) :frame
|
mode (cond (zero? speed) :frame
|
||||||
(or (= :loop end) (get-in n [:time :loop?])) :loop
|
(or (= :loop end) (get-in n [:time :loop?])) :loop
|
||||||
:else :once)
|
:else :once)
|
||||||
change! (fn [field value]
|
change! #(rf/dispatch [::project/instance-playback sid id %1 %2])]
|
||||||
(rf/dispatch [::project/instance-playback sid id field value]))]
|
(prop "play"
|
||||||
[section "playback"
|
[:span.seg
|
||||||
[:div.inspector-form
|
(doall
|
||||||
[:label.inspector-field "mode"
|
(for [[m glyph title] modes]
|
||||||
[:select {:value (name mode)
|
^{:key m}
|
||||||
:aria-label "instance playback mode"
|
[:button {:class (when (= m mode) "on") :title title :aria-label title
|
||||||
:on-change #(change! :mode (keyword (.. % -target -value)))}
|
:aria-pressed (= m mode)
|
||||||
[:option {:value "once"} "play once"]
|
:on-click #(change! :mode m)}
|
||||||
[:option {:value "loop"} "loop"]
|
[icon/view glyph]]))]
|
||||||
[:option {:value "frame"} "hold frame"]]]
|
[:span.dim "from"]
|
||||||
[:label.inspector-field "start frame"
|
[number-input {:min 0 :step 1 :value in
|
||||||
[number-input {:min 0 :step 1 :value in
|
:title "the frame of its symbol it starts on"
|
||||||
:aria-label "instance start frame"
|
:aria-label "instance start frame"
|
||||||
:parse #(js/parseInt % 10)
|
:parse #(js/parseInt % 10)
|
||||||
:on-number #(change! :in %)}]]
|
:on-number #(change! :in %)}]
|
||||||
[:label.inspector-field "speed"
|
[:span.dim "×"]
|
||||||
[number-input {:min 0 :step 0.1 :value speed
|
[number-input {:min 0 :step 0.1 :value speed
|
||||||
:disabled (= :frame mode)
|
:disabled (= :frame mode)
|
||||||
:aria-label "instance playback speed"
|
:title "speed" :aria-label "instance playback speed"
|
||||||
:parse js/parseFloat
|
:parse js/parseFloat
|
||||||
:on-number #(change! :speed %)}]]]]))
|
:on-number #(change! :speed %)}])))
|
||||||
|
|
||||||
(defn- node-section [[sid id n]]
|
(defn- symbol-fields
|
||||||
(let [[start end] (:span n)
|
"A symbol's length, stage and authoring palette."
|
||||||
;; The selected row path, for the one control that needs to name the node
|
[sid]
|
||||||
;; the way a stage gesture does rather than by `[sid id]`: ⌖ re-centres a
|
(let [clip @(rf/subscribe [::render/clip])
|
||||||
;; pivot, and finding the middle of what a node draws means resolving it
|
sym (get-in clip [:symbols sid])
|
||||||
;; where it is placed.
|
busy? (:busy? @(rf/subscribe [::playback/project]))
|
||||||
node-path (nth @(rf/subscribe [::sub/selection]) 3 nil)
|
put! #(rf/dispatch [::project/symbol-setting sid %1 %2])]
|
||||||
auto-key? @(rf/subscribe [::sub/auto-key?])
|
[:<>
|
||||||
clip @(rf/subscribe [::render/clip])
|
(prop "length"
|
||||||
placement @(rf/subscribe [::sub/selected-placement])
|
[count-input (:frames sym) #(put! :frames %) {:disabled busy? :label "length in frames"}]
|
||||||
frame (:frame placement)
|
[:span.dim "f"])
|
||||||
palette-id (or (get-in clip [:symbols sid :palette]) (pal/default-palette-id clip))
|
(prop "size"
|
||||||
palette (get (pal/palettes clip) palette-id)]
|
[count-input (:width sym) #(put! :width %)
|
||||||
[section (str (name (:kind n)) " · in " (name sid))
|
{:placeholder (str (:width clip)) :disabled busy? :label "width"}]
|
||||||
[facts
|
[:span.dim "×"]
|
||||||
"id" (brief id)
|
[count-input (:height sym) #(put! :height %)
|
||||||
;; Which symbol a cel places. The one fact that makes an instance
|
{:placeholder (str (:height clip)) :disabled busy? :label "height"}]
|
||||||
;; legible as an instance rather than as a node.
|
(when (or (:width sym) (:height sym))
|
||||||
"of" (when (= :instance (:kind n)) (str (node/source n)))
|
[:button.icon {:disabled busy? :title "use the project's stage size"
|
||||||
;; A span is in the node's OWN frames and `at` is where its frame 0 sits
|
:aria-label "use project stage"
|
||||||
;; in this symbol. See `node/placed-span`.
|
:on-click #(do (put! :width nil) (put! :height nil))}
|
||||||
"span" (when start (str start " … " end))
|
"↺"]))
|
||||||
"at" (when (node/mapped-time? n) (str (get-in n [:time :at] 0)))]
|
(prop "palette"
|
||||||
[:div.inspector-form
|
[palette-select (:palette sym) #(rf/dispatch [::project/symbol-palette sid %]) busy?])]))
|
||||||
[name-field "name" (or (:name n) "")
|
|
||||||
#(rf/dispatch [::ui/rename-node sid id %])]]
|
|
||||||
(when (:paint? n) [drawing-keys sid id n @(rf/subscribe [::sub/selected-local])])
|
|
||||||
[:div.row {:style {:margin-top "6px"}} [:span.dim "channels"]]
|
|
||||||
;; Channels belong to the placement, before its source playback clock.
|
|
||||||
;; Entering the source would wrap keys on loops and pin them on holds.
|
|
||||||
(let [{:keys [frame]} placement]
|
|
||||||
[:dl.facts
|
|
||||||
(doall
|
|
||||||
(for [[path ch] (sort-by (fn [[path]]
|
|
||||||
[(cond
|
|
||||||
(= :xform (first path)) 0
|
|
||||||
(= path [:style :color]) 1
|
|
||||||
:else 2)
|
|
||||||
(str path)])
|
|
||||||
(node/channels n))]
|
|
||||||
^{:key (str path)}
|
|
||||||
[:<>
|
|
||||||
[:dt (str/join " " (map name path))]
|
|
||||||
(cond
|
|
||||||
(and (= path [:style :color]) (not (:dense ch)))
|
|
||||||
[color-control sid id ch frame auto-key? palette]
|
|
||||||
|
|
||||||
(and (contains? (node/defaults-of n) path) (not (:dense ch)))
|
(defn- project-fields []
|
||||||
[channel-control sid id path ch frame auto-key? node-path]
|
(let [clip @(rf/subscribe [::render/clip])
|
||||||
|
project @(rf/subscribe [::playback/project])
|
||||||
|
busy? (:busy? project)]
|
||||||
|
[section "project"
|
||||||
|
(prop "name" [text-input (or (:name project) (:name clip) "")
|
||||||
|
#(rf/dispatch [::project/rename %]) {:aria-label "project name"}])
|
||||||
|
(prop "stage"
|
||||||
|
[count-input (:width clip) #(rf/dispatch [::project/project-setting :width %])
|
||||||
|
{:disabled busy? :label "width"}]
|
||||||
|
[:span.dim "×"]
|
||||||
|
[count-input (:height clip) #(rf/dispatch [::project/project-setting :height %])
|
||||||
|
{:disabled busy? :label "height"}])
|
||||||
|
(prop "rate" [settings/rate busy?])]))
|
||||||
|
|
||||||
:else [:dd (channel-state ch)])]))])]))
|
;; ---------------------------------------------------------------------------
|
||||||
|
;; a node
|
||||||
|
|
||||||
(defn- palette-placement-section [[sid id n]]
|
(defn- node-view
|
||||||
|
"A selected node: its name, its channels, and for an instance how it plays
|
||||||
|
and the settings of the symbol it places."
|
||||||
|
[[sid id n :as selected]]
|
||||||
|
(let [clip @(rf/subscribe [::render/clip])
|
||||||
|
;; The row path, which names the node the way a stage gesture does: its
|
||||||
|
;; clock and its pivot are found where it is placed.
|
||||||
|
node-path (or (nth @(rf/subscribe [::sub/selection]) 3 nil) [id])
|
||||||
|
of (node/source n)]
|
||||||
|
[:<>
|
||||||
|
(if of
|
||||||
|
[header (if (symbol/lane? (clip-domain/symbol clip of)) "lane" "instance")
|
||||||
|
(clip-domain/symbol-name clip of) (name of)
|
||||||
|
#(rf/dispatch [::ui/rename-node sid id %]) (clip-domain/uses clip of)]
|
||||||
|
[header (name (:kind n)) (or (:name n) "") (clip-domain/node-label clip id n)
|
||||||
|
#(rf/dispatch [::ui/rename-node sid id %]) nil])
|
||||||
|
[channels selected node-path]
|
||||||
|
(when of
|
||||||
|
[:div.props
|
||||||
|
[playback-row selected]
|
||||||
|
[symbol-fields of]])]))
|
||||||
|
|
||||||
|
(defn- palette-placement-view
|
||||||
|
"A placement on the palette lane: which palette it switches to, keyed and
|
||||||
|
tweened like any channel."
|
||||||
|
[[sid id n]]
|
||||||
(let [clip @(rf/subscribe [::render/clip])
|
(let [clip @(rf/subscribe [::render/clip])
|
||||||
transition (node/source n)
|
transition (node/source n)
|
||||||
open-frame @(rf/subscribe [::render/open-frame])
|
open-frame @(rf/subscribe [::render/open-frame])
|
||||||
[start _] (node/placed-span n)
|
[start _] (node/placed-span n)
|
||||||
frame (max 0 (- open-frame (or start 0)))
|
frame (max 0 (- open-frame (or start 0)))
|
||||||
|
own {:time {:at (or start 0) :rate 1} :frame frame}
|
||||||
ch (or (get-in n [:channels [:palette]])
|
ch (or (get-in n [:channels [:palette]])
|
||||||
(assoc (channel/framed
|
(assoc (channel/framed
|
||||||
(get-in clip [:symbols (node/source n) :palette-ref]))
|
(get-in clip [:symbols transition :palette-ref]))
|
||||||
:semantic :palette))
|
:semantic :palette))
|
||||||
value (channel/value-at ch frame nil)
|
value (channel/value-at ch frame nil)
|
||||||
chosen (if (map? value) (:from value) value)
|
chosen (if (map? value) (:from value) value)]
|
||||||
keyframes (sort (keys (:keys ch)))
|
[:<>
|
||||||
left (when (seq keyframes)
|
[header "palette" (clip-domain/symbol-name clip transition) (name transition)
|
||||||
(or (last (filter #(<= % frame) keyframes)) (first keyframes)))
|
#(rf/dispatch [::ui/rename-node sid id %]) nil]
|
||||||
right (when left (first (filter #(< left %) keyframes)))
|
[:div.chans
|
||||||
palettes (sort-by (comp str :name val) (pal/palettes clip))]
|
[channel-row {:path [:palette] :ch ch :frame frame :own own
|
||||||
[section "palette transition"
|
:on-key #(rf/dispatch [::project/toggle-palette-key sid id frame])
|
||||||
[:div.inspector-form
|
:set-gap! #(rf/dispatch [::project/set-segment-interp sid id [:palette] %1 %2])}
|
||||||
[name-field "name" (clip-domain/symbol-name clip transition)
|
[palette-select (when-not (= pal/inherit chosen) chosen)
|
||||||
#(rf/dispatch [::project/rename-symbol transition %])]]
|
#(rf/dispatch [::project/set-palette-choice sid id frame (or % pal/inherit)])]]]]))
|
||||||
[:div.inspector-form
|
|
||||||
[:label.inspector-field "palette"
|
|
||||||
[:span.row
|
|
||||||
[:button.key {:class (cond (contains? (:keys ch) frame) "on" (:keys ch) "keyed")
|
|
||||||
:title (if (:keys ch) (str (count (:keys ch)) " keys") "key this here")
|
|
||||||
:on-click #(rf/dispatch [::project/toggle-palette-key sid id frame])}
|
|
||||||
"◆"]
|
|
||||||
[:select {:value (if (= pal/inherit chosen) "" (str chosen))
|
|
||||||
:on-change
|
|
||||||
(fn [e]
|
|
||||||
(let [v (.. e -target -value)
|
|
||||||
palette-id (or (first (filter #(= v (str %))
|
|
||||||
(keys (pal/palettes clip))))
|
|
||||||
pal/inherit)]
|
|
||||||
(rf/dispatch [::project/set-palette-choice sid id frame palette-id])))}
|
|
||||||
[:option {:value ""} "inherit"]
|
|
||||||
(for [[palette-id p] palettes]
|
|
||||||
^{:key (str palette-id)}
|
|
||||||
[:option {:value (str palette-id)} (:name p)])]]]
|
|
||||||
(when right
|
|
||||||
[:label.inspector-field (str "key " left " → " right)
|
|
||||||
[segment-select sid id [:palette] ch left]])]]))
|
|
||||||
|
|
||||||
(defn- palette-symbol-section [sid]
|
|
||||||
(let [clip @(rf/subscribe [::render/clip])
|
|
||||||
sym (get-in clip [:symbols sid])]
|
|
||||||
[section "palette transition"
|
|
||||||
[:div.inspector-form
|
|
||||||
[name-field "name" (clip-domain/symbol-name clip sid)
|
|
||||||
#(rf/dispatch [::project/rename-symbol sid %])]]
|
|
||||||
[facts "palette" (or (get-in clip [:palettes (:palette-ref sym) :name])
|
|
||||||
(:palette-ref sym))]
|
|
||||||
[:div.dim "Keyframes and cut/tween interpolation are edited on a placement in the palette lane."]]))
|
|
||||||
|
|
||||||
;; ---------------------------------------------------------------------------
|
;; ---------------------------------------------------------------------------
|
||||||
;; corrections
|
;; corrections
|
||||||
|
|
||||||
|
|
@ -439,8 +466,8 @@
|
||||||
lane-context? (or (symbol/lane? (clip-domain/symbol clip sid))
|
lane-context? (or (symbol/lane? (clip-domain/symbol clip sid))
|
||||||
(and (= :instance (:kind selected))
|
(and (= :instance (:kind selected))
|
||||||
(symbol/lane? (clip-domain/symbol clip (node/source selected)))))
|
(symbol/lane? (clip-domain/symbol clip (node/source selected)))))
|
||||||
targets (if lane-context? [selected-id] [])]
|
]
|
||||||
(when (seq targets)
|
(when lane-context?
|
||||||
(r/with-let [draft (r/atom (correction-initial clip sid selected-id))]
|
(r/with-let [draft (r/atom (correction-initial clip sid selected-id))]
|
||||||
(let [target (:target @draft)
|
(let [target (:target @draft)
|
||||||
motion (:motion @draft)
|
motion (:motion @draft)
|
||||||
|
|
@ -448,16 +475,6 @@
|
||||||
layers (correction-layers clip sid target)]
|
layers (correction-layers clip sid target)]
|
||||||
[section "corrections"
|
[section "corrections"
|
||||||
[:div.correction-grid
|
[:div.correction-grid
|
||||||
[:label.inspector-field "owner"
|
|
||||||
[:select {:value (or (first (keep-indexed #(when (= %2 target) %1) targets)) 0)
|
|
||||||
:on-change (fn [e]
|
|
||||||
(let [i (js/parseInt (.. e -target -value) 10)
|
|
||||||
id (nth targets i)]
|
|
||||||
(reset! draft (correction-initial clip sid id))))}
|
|
||||||
(doall (for [[i id] (map-indexed vector targets)]
|
|
||||||
^{:key (str id)}
|
|
||||||
[:option {:value i}
|
|
||||||
(str "selected · " (brief id))]))]]
|
|
||||||
[:label.inspector-field "property"
|
[:label.inspector-field "property"
|
||||||
[:select {:value (if (= [:xform :rot] (:path @draft)) "rotation" "position")
|
[:select {:value (if (= [:xform :rot] (:path @draft)) "rotation" "position")
|
||||||
:on-change #(swap! draft assoc :path
|
:on-change #(swap! draft assoc :path
|
||||||
|
|
@ -471,7 +488,6 @@
|
||||||
[:option {:value "constant"} "constant"]
|
[:option {:value "constant"} "constant"]
|
||||||
[:option {:value "ramp"} "ramp"]
|
[:option {:value "ramp"} "ramp"]
|
||||||
[:option {:value "return"} "return"]]]
|
[:option {:value "return"} "return"]]]
|
||||||
[:div]
|
|
||||||
[draft-number draft :from "from owner frame" true]
|
[draft-number draft :from "from owner frame" true]
|
||||||
[draft-number draft :through "through owner frame" true]
|
[draft-number draft :through "through owner frame" true]
|
||||||
(case motion
|
(case motion
|
||||||
|
|
@ -524,39 +540,28 @@
|
||||||
|
|
||||||
(defn- layer-section
|
(defn- layer-section
|
||||||
"Tracing layer `id` of symbol `sid`, at row `path` from the open symbol, under
|
"Tracing layer `id` of symbol `sid`, at row `path` from the open symbol, under
|
||||||
`title`, with `more` appended."
|
`title`, with `more` appended. Its holds are keys like any other: ◆ holds the
|
||||||
|
picture here until the next one, ◀ ▶ go between them."
|
||||||
[title sid id path & more]
|
[title sid id path & more]
|
||||||
(let [n (get-in @(rf/subscribe [::render/clip]) [:symbols sid :nodes id])
|
(let [n (get-in @(rf/subscribe [::render/clip]) [:symbols sid :nodes id])
|
||||||
{:keys [on? hidden]} @(rf/subscribe [::render/tracing])
|
{:keys [on? hidden]} @(rf/subscribe [::render/tracing])
|
||||||
shown? (and on? (not (contains? hidden [sid id])))
|
shown? (and on? (not (contains? hidden [sid id])))
|
||||||
{:keys [frame time]} @(rf/subscribe [::sub/own-time path])
|
{:keys [frame] :as own} @(rf/subscribe [::sub/own-time path])
|
||||||
holds (get-in n [:time :holds] [])
|
holds (get-in n [:time :holds] [])]
|
||||||
seek! #(rf/dispatch [::pb/seek (js/Math.round (+ (:at time) (/ % (:rate time))))])]
|
|
||||||
(into
|
(into
|
||||||
[section title
|
[section title
|
||||||
[:div.row
|
[:div.chan
|
||||||
[:label.dim {:title "show it over the picture · a reference, never exported"}
|
[key-nav holds frame own #(rf/dispatch [::project/toggle-hold sid id frame])
|
||||||
[:input {:type "checkbox" :checked (boolean shown?)
|
(if (nil? frame)
|
||||||
:on-change #(rf/dispatch [::ui/show-trace [sid id] (not shown?)])}]
|
"move the playhead over this layer to hold a frame"
|
||||||
" show"]]
|
"hold the picture on this frame until the next hold")]
|
||||||
[:div.row {:style {:margin "5px 0"}}
|
[:span.chan-name "hold"]
|
||||||
;; A DEAD BUTTON WITH NO REASON GIVEN is what reads as the feature not
|
[:span.chan-value
|
||||||
;; working, so say why there is nothing to hold.
|
[:label.dim {:title "show it over the picture · a reference, never exported"}
|
||||||
(if (nil? frame)
|
[:input {:type "checkbox" :checked (boolean shown?)
|
||||||
[:span.dim "move the playhead over this layer to hold a frame"]
|
:on-change #(rf/dispatch [::ui/show-trace [sid id] (not shown?)])}]
|
||||||
[:button {:title "hold the picture on this frame until the next hold"
|
" show"]]
|
||||||
:on-click #(rf/dispatch [::project/toggle-hold sid id frame])}
|
[:span.gap]]]
|
||||||
(if (some #{frame} holds) (str "remove hold at " frame) (str "hold at " frame))])]
|
|
||||||
(when (seq holds)
|
|
||||||
[:div.row
|
|
||||||
[:span.dim "holds"]
|
|
||||||
(doall
|
|
||||||
(for [f holds]
|
|
||||||
^{:key f}
|
|
||||||
[:button {:class (when (= frame f) "on")
|
|
||||||
:disabled (nil? time)
|
|
||||||
:on-click #(seek! f)}
|
|
||||||
(str f)]))])]
|
|
||||||
more)))
|
more)))
|
||||||
|
|
||||||
(def ^:private origins
|
(def ^:private origins
|
||||||
|
|
@ -571,8 +576,8 @@
|
||||||
[face path]
|
[face path]
|
||||||
(let [reads (get-in @(rf/subscribe [::render/clip]) [:symbols face :nodes :head :reads])]
|
(let [reads (get-in @(rf/subscribe [::render/clip]) [:symbols face :nodes :head :reads])]
|
||||||
[layer-section (str "tracing · " (name face)) face :plate (conj path :plate)
|
[layer-section (str "tracing · " (name face)) face :plate (conj path :plate)
|
||||||
[:div.row {:style {:margin-top "5px"}}
|
[:div.prop
|
||||||
[:span.dim "head"]
|
[:span.prop-name "head"]
|
||||||
(doall
|
(doall
|
||||||
(for [[label r title] origins]
|
(for [[label r title] origins]
|
||||||
^{:key label}
|
^{:key label}
|
||||||
|
|
@ -604,9 +609,10 @@
|
||||||
marks (pose/marks (:nodes sym) (:frames sym) store)
|
marks (pose/marks (:nodes sym) (:frames sym) store)
|
||||||
on? (contains? smart face)]
|
on? (contains? smart face)]
|
||||||
[section (str "performance \u00b7 " (name face))
|
[section (str "performance \u00b7 " (name face))
|
||||||
[:div.row {:style {:margin "5px 0"}}
|
[:div.row
|
||||||
[:label.dim {:title (str "let a closure the grid drops move the frame a slot "
|
[:label {:title (str "let a closure the grid drops move the frame a slot "
|
||||||
"reads \u2014 backward, and only within that slot's own gap")}
|
"reads \u2014 backward, and only within that slot's own gap"
|
||||||
|
" \u00b7 the stage only: an export is unaffected until this is a saved setting")}
|
||||||
[:input {:type "checkbox" :checked on?
|
[:input {:type "checkbox" :checked on?
|
||||||
:on-change #(rf/dispatch [::ui/smart-picking face (not on?)])}]
|
:on-change #(rf/dispatch [::ui/smart-picking face (not on?)])}]
|
||||||
" smart frame picking"]]
|
" smart frame picking"]]
|
||||||
|
|
@ -622,48 +628,7 @@
|
||||||
(str/join " " (take 24 fs))
|
(str/join " " (take 24 fs))
|
||||||
(when (> (count fs) 24) " \u2026"))}
|
(when (> (count fs) 24) " \u2026"))}
|
||||||
(str (if (vector? group) (str/join "/" (map name group)) (name group))
|
(str (if (vector? group) (str/join "/" (map name group)) (name group))
|
||||||
" " (count fs))]))])
|
" " (count fs))]))])]))
|
||||||
[:div.row
|
|
||||||
[:span.dim "the stage only \u00b7 an export is unaffected until this is a saved setting"]]]))
|
|
||||||
|
|
||||||
;; ---------------------------------------------------------------------------
|
|
||||||
;; a symbol
|
|
||||||
|
|
||||||
(defn- symbol-section [sid & [title]]
|
|
||||||
(let [clip @(rf/subscribe [::render/clip])
|
|
||||||
sym (get-in clip [:symbols sid])
|
|
||||||
frame @(rf/subscribe [::render/open-frame])
|
|
||||||
busy? (:busy? @(rf/subscribe [::playback/project]))]
|
|
||||||
[section (or title "symbol")
|
|
||||||
[facts
|
|
||||||
"id" (str sid)
|
|
||||||
"length" (str (:frames sym) " frames")
|
|
||||||
"stage" (let [[w h] (clip-domain/stage clip sid)] (str w "×" h))
|
|
||||||
"nodes" (str (count (:nodes sym)))]
|
|
||||||
[:div.inspector-form
|
|
||||||
[name-field "name" (clip-domain/symbol-name clip sid)
|
|
||||||
#(rf/dispatch [::project/rename-symbol sid %])]
|
|
||||||
[number-field "length (frames)" (:frames sym)
|
|
||||||
#(rf/dispatch [::project/symbol-setting sid :frames %]) nil busy?]
|
|
||||||
[number-field "width" (:width sym)
|
|
||||||
#(rf/dispatch [::project/symbol-setting sid :width %]) "project default" busy?]
|
|
||||||
[number-field "height" (:height sym)
|
|
||||||
#(rf/dispatch [::project/symbol-setting sid :height %]) "project default" busy?]
|
|
||||||
[:label.inspector-field "authoring palette"
|
|
||||||
[:select {:value (str (or (:palette sym) "")) :disabled busy?
|
|
||||||
:on-change (fn [e]
|
|
||||||
(let [v (.. e -target -value)
|
|
||||||
id (first (filter #(= v (str %)) (keys (pal/palettes clip))))]
|
|
||||||
(rf/dispatch [::project/symbol-palette sid id])))}
|
|
||||||
[:option {:value ""} "inherit"]
|
|
||||||
(for [[id p] (sort-by (comp str :name val) (pal/palettes clip))]
|
|
||||||
^{:key (str id)} [:option {:value (str id)} (:name p)])]]
|
|
||||||
(when (or (:width sym) (:height sym))
|
|
||||||
[:div.row
|
|
||||||
[:button {:disabled busy? :on-click #(do
|
|
||||||
(rf/dispatch [::project/symbol-setting sid :width nil])
|
|
||||||
(rf/dispatch [::project/symbol-setting sid :height nil]))}
|
|
||||||
"use project stage"]])]]))
|
|
||||||
|
|
||||||
;; ---------------------------------------------------------------------------
|
;; ---------------------------------------------------------------------------
|
||||||
;; tracked objects
|
;; tracked objects
|
||||||
|
|
@ -809,8 +774,8 @@
|
||||||
offset (if gaze (channel/value-at (:values gaze) current nil) [0 0])]
|
offset (if gaze (channel/value-at (:values gaze) current nil) [0 0])]
|
||||||
(swap! draft assoc :opening opening
|
(swap! draft assoc :opening opening
|
||||||
:gaze-x (* 100 (first offset)) :gaze-y (* 100 (second offset))))))]
|
:gaze-x (* 100 (first offset)) :gaze-y (* 100 (second offset))))))]
|
||||||
[:div {:style {:margin-top "8px"}}
|
[:div {:style {:margin-top "8px"}
|
||||||
[:div.dim "Eye adjustments · key a pose, then scrub and key another. Adjustments tween within this interval."]
|
:title "eye adjustments · key a pose, then scrub and key another; they tween within this interval"}
|
||||||
[:label.inspector-field "eye"
|
[:label.inspector-field "eye"
|
||||||
[:select {:value (name side)
|
[:select {:value (name side)
|
||||||
:on-change #(swap! draft assoc :side (keyword (.. % -target -value)))}
|
:on-change #(swap! draft assoc :side (keyword (.. % -target -value)))}
|
||||||
|
|
@ -846,8 +811,8 @@
|
||||||
repairs (distinct (for [[_ n] (get-in clip [:symbols sid :nodes])
|
repairs (distinct (for [[_ n] (get-in clip [:symbols sid :nodes])
|
||||||
[_ c] (:channels n) r (:repairs c)] r))]
|
[_ c] (:channels n) r (:repairs c)] r))]
|
||||||
(r/with-let [draft (r/atom {:from 0 :through 1 :donor 2 :head? false})]
|
(r/with-let [draft (r/atom {:from 0 :through 1 :donor 2 :head? false})]
|
||||||
[section "repair intervals"
|
[section [:span {:title "hold a clean pose across damaged frames · face settings still apply · frames are this face's own, from 0"}
|
||||||
[:div.dim "Hold a clean pose across damaged frames. Face settings still apply. Frame numbers are local to this face, starting at 0."]
|
"repair intervals"]
|
||||||
(for [[field label] [[:from "from face frame"]
|
(for [[field label] [[:from "from face frame"]
|
||||||
[:through "through face frame"]
|
[:through "through face frame"]
|
||||||
[:donor "clean donor frame"]]]
|
[:donor "clean donor frame"]]]
|
||||||
|
|
@ -874,6 +839,24 @@
|
||||||
[:button {:on-click #(rf/dispatch [::ui/remove-repair sid id])} "remove"]]
|
[:button {:on-click #(rf/dispatch [::ui/remove-repair sid id])} "remove"]]
|
||||||
[eye-repair-controls sid repair current]])])))
|
[eye-repair-controls sid repair current]])])))
|
||||||
|
|
||||||
|
;; ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
(defn- symbol-view
|
||||||
|
"A symbol, selected or open with nothing selected: its name and settings."
|
||||||
|
[sid]
|
||||||
|
(let [clip @(rf/subscribe [::render/clip])
|
||||||
|
sym (get-in clip [:symbols sid])]
|
||||||
|
[:<>
|
||||||
|
[header (if (= :palette (:type sym)) "palette" "symbol")
|
||||||
|
(clip-domain/symbol-name clip sid) (name sid)
|
||||||
|
#(rf/dispatch [::project/rename-symbol sid %]) (clip-domain/uses clip sid)]
|
||||||
|
[:div.props
|
||||||
|
(if (= :palette (:type sym))
|
||||||
|
(prop "palette"
|
||||||
|
[:span {:title "keys and tweens are set on a placement in the palette lane"}
|
||||||
|
(or (get-in clip [:palettes (:palette-ref sym) :name]) (str (:palette-ref sym)))])
|
||||||
|
[symbol-fields sid])]]))
|
||||||
|
|
||||||
(defn view []
|
(defn view []
|
||||||
(let [clip @(rf/subscribe [::render/clip])
|
(let [clip @(rf/subscribe [::render/clip])
|
||||||
open @(rf/subscribe [::render/open])
|
open @(rf/subscribe [::render/open])
|
||||||
|
|
@ -882,49 +865,40 @@
|
||||||
;; tab would.
|
;; tab would.
|
||||||
inspected (or selection [:symbol open])
|
inspected (or selection [:symbol open])
|
||||||
node @(rf/subscribe [::sub/selected-node])
|
node @(rf/subscribe [::sub/selected-node])
|
||||||
;; The face the tracing section is about: the SELECTED PLACEMENT's symbol,
|
;; The symbol the selected node places, or nil.
|
||||||
;; or, when the selection is not an instance or there is none, the OPEN
|
|
||||||
;; symbol — which is the face itself when a face is open to be drawn over.
|
|
||||||
;; That last case had no section at all before, and it is the one where
|
|
||||||
;; the keys are actually being set.
|
|
||||||
;; The symbol this cel places, or nil for a lane: which face a
|
|
||||||
;; lane traces is not a question with one answer, and naming the drawing
|
|
||||||
;; showing now would move the section under the playhead.
|
|
||||||
placed (node/source (peek node))
|
placed (node/source (peek node))
|
||||||
footage-faces (footage-faces clip selection node)
|
|
||||||
tracking-owners (tracking-owners clip selection node)
|
tracking-owners (tracking-owners clip selection node)
|
||||||
palette-placement? (and node
|
palette-placement? (and node
|
||||||
(= :palette-track
|
(= :palette-track
|
||||||
(get-in clip [:symbols (first node) :type])))
|
(get-in clip [:symbols (first node) :type])))
|
||||||
palette-symbol? (and (= :symbol (first inspected))
|
palette-symbol? (and (= :symbol (first inspected))
|
||||||
(= :palette (get-in clip [:symbols (second inspected) :type])))
|
(= :palette (get-in clip [:symbols (second inspected) :type])))
|
||||||
|
;; The face the face sections are about: the selected placement's symbol,
|
||||||
|
;; or the open symbol when that is a face being drawn over.
|
||||||
face (or placed (when (face? clip open) open))
|
face (or placed (when (face? clip open) open))
|
||||||
layer? (and placed (clip-domain/trace? (clip-domain/symbol clip placed)))
|
layer? (and placed (clip-domain/trace? (clip-domain/symbol clip placed)))
|
||||||
;; Where that face or layer sits, as a row path from the open symbol. A
|
;; Where that face or layer sits, as a row path from the open symbol. A
|
||||||
;; selection made on the stage has no path and names a node directly in
|
;; selection made on the stage has no path and names a node directly in
|
||||||
;; the open symbol; the open symbol itself is at no path at all.
|
;; the open symbol; the open symbol itself is at no path at all.
|
||||||
path (if placed (or (nth selection 3 nil) [(second node)]) [])]
|
path (if placed (or (nth selection 3 nil) [(second node)]) [])
|
||||||
|
a-face? (and face (face? clip face) (not layer?))]
|
||||||
[:section.pane.params
|
[:section.pane.params
|
||||||
[:div.pane-head "inspector"]
|
[:div.pane-head "inspector"]
|
||||||
[:div {:style {:min-height 0}}
|
[:div.inspect
|
||||||
(when palette-placement? [palette-placement-section node])
|
(cond
|
||||||
(when (= [:symbol (clip-domain/opens-on clip)] inspected)
|
palette-placement? [palette-placement-view node]
|
||||||
[clip-section])
|
node [node-view node]
|
||||||
(when (and node (not palette-placement?)) [node-section node])
|
(= :symbol (first inspected)) [symbol-view (second inspected)])
|
||||||
(when (and placed (not palette-placement?)) [instance-playback node])
|
|
||||||
(when (and node (not palette-placement?)) [palette/remap-section])
|
(when (and node (not palette-placement?)) [palette/remap-section])
|
||||||
(when (and placed (not palette-placement?)) [symbol-section placed "source symbol"])
|
|
||||||
(when (and node (not palette-placement?)) ^{:key (str (first node) "/" (second node))}
|
(when (and node (not palette-placement?)) ^{:key (str (first node) "/" (second node))}
|
||||||
[correction-section node])
|
[correction-section node])
|
||||||
(when layer?
|
(when layer?
|
||||||
[layer-section (str "tracing · " (clip-domain/symbol-name clip placed))
|
[layer-section "tracing" (first node) (second node) path])
|
||||||
(first node) (second node) path])
|
|
||||||
(when (get-in clip [:symbols face :nodes :plate])
|
(when (get-in clip [:symbols face :nodes :plate])
|
||||||
[face-section face path])
|
[face-section face path])
|
||||||
(when (and face (face? clip face) (not layer?)) ^{:key (str "repair/" face)} [repair-section face path])
|
(when a-face? ^{:key (str "repair/" face)} [repair-section face path])
|
||||||
(when (and face (not layer?)) ^{:key (str "perf/" face)} [performance-section face])
|
(when a-face? ^{:key (str "perf/" face)} [performance-section face])
|
||||||
(when palette-symbol? [palette-symbol-section (second inspected)])
|
|
||||||
(when (and (= :symbol (first inspected)) (not palette-symbol?))
|
|
||||||
[symbol-section (second inspected)])
|
|
||||||
(when (and (seq tracking-owners) (not palette-placement?) (not palette-symbol?))
|
(when (and (seq tracking-owners) (not palette-placement?) (not palette-symbol?))
|
||||||
[tracking-section tracking-owners])]]))
|
[tracking-section tracking-owners])
|
||||||
|
(when (= [:symbol (clip-domain/opens-on clip)] inspected)
|
||||||
|
[project-fields])]]))
|
||||||
|
|
|
||||||
|
|
@ -92,9 +92,9 @@
|
||||||
apply! (fn [mode] (close!) (rf/dispatch [::project/set-fps to mode]))
|
apply! (fn [mode] (close!) (rf/dispatch [::project/set-fps to mode]))
|
||||||
changed? (and to (not= to fps))]
|
changed? (and to (not= to fps))]
|
||||||
[:<>
|
[:<>
|
||||||
[:label.inspector-field "frame rate"
|
[:button {:disabled disabled? :title "frame rate · change it"
|
||||||
[:button {:disabled disabled? :on-click #(do (reset! draft fps) (reset! open? true))}
|
:on-click #(do (reset! draft fps) (reset! open? true))}
|
||||||
(str fps " fps")]]
|
(str fps " fps")]
|
||||||
(when @open?
|
(when @open?
|
||||||
[dialog "Frame rate" close!
|
[dialog "Frame rate" close!
|
||||||
[chips (str "from " fps " fps to") rates to #(str % " fps") #(reset! draft %)
|
[chips (str "from " fps " fps to") rates to #(str % " fps") #(reset! draft %)
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@
|
||||||
first pass is drawn. An expanded loop therefore shows keys where they first
|
first pass is drawn. An expanded loop therefore shows keys where they first
|
||||||
happen and not where they happen again."
|
happen and not where they happen again."
|
||||||
(:require [clojure.string :as str]
|
(:require [clojure.string :as str]
|
||||||
|
[arthur.domain.channel :as channel]
|
||||||
[arthur.domain.node :as node]
|
[arthur.domain.node :as node]
|
||||||
[arthur.domain.keyframes :as keyframes]
|
[arthur.domain.keyframes :as keyframes]
|
||||||
[arthur.domain.clipboard :as clipboard]
|
[arthur.domain.clipboard :as clipboard]
|
||||||
|
|
@ -29,6 +30,7 @@
|
||||||
[arthur.domain.span :as span]
|
[arthur.domain.span :as span]
|
||||||
[arthur.domain.symbol :as symbol]
|
[arthur.domain.symbol :as symbol]
|
||||||
[arthur.events.playback :as pb]
|
[arthur.events.playback :as pb]
|
||||||
|
[arthur.events.project :as project]
|
||||||
[arthur.events.ui :as ui]
|
[arthur.events.ui :as ui]
|
||||||
[arthur.footage.store :as store]
|
[arthur.footage.store :as store]
|
||||||
[arthur.ui.icon :as icon]
|
[arthur.ui.icon :as icon]
|
||||||
|
|
@ -89,6 +91,19 @@
|
||||||
{:sid sid :id (:id n) :channel channel :frame f
|
{:sid sid :id (:id n) :channel channel :frame f
|
||||||
:at (->open f) :scale (- (->open 1) (->open 0))})))
|
:at (->open f) :scale (- (->open 1) (->open 0))})))
|
||||||
|
|
||||||
|
(defn- gaps
|
||||||
|
"The stretches between one key of a channel and the next, each holding or
|
||||||
|
tweening, as Flash draws a classic tween between two keyframes. Nil for a
|
||||||
|
channel whose values are choices — a colour, a switch — which only ever hold."
|
||||||
|
[n sid path ch ->open]
|
||||||
|
(let [fs (keyed-frames ch)]
|
||||||
|
(when-not (node/hold-only? path (val (first (:keys ch))))
|
||||||
|
(mapv (fn [[a b]]
|
||||||
|
{:sid sid :id (:id n) :channel path :left a
|
||||||
|
:from (->open a) :to (->open b)
|
||||||
|
:tween? (= :linear (channel/segment-interp ch a))})
|
||||||
|
(partition 2 1 fs)))))
|
||||||
|
|
||||||
(defn- channel-rows [n sid path depth ->open span]
|
(defn- channel-rows [n sid path depth ->open span]
|
||||||
(let [keyed (filter (comp seq :keys val)
|
(let [keyed (filter (comp seq :keys val)
|
||||||
(sort-by (comp str key) (node/channels n)))]
|
(sort-by (comp str key) (node/channels n)))]
|
||||||
|
|
@ -96,12 +111,13 @@
|
||||||
(for [[cpath ch] keyed]
|
(for [[cpath ch] keyed]
|
||||||
{:path (conj path cpath)
|
{:path (conj path cpath)
|
||||||
:depth depth
|
:depth depth
|
||||||
:label (str/join " " (map name cpath))
|
:label (node/channel-name cpath)
|
||||||
:kind :channel
|
:kind :channel
|
||||||
:select nil
|
:select nil
|
||||||
:span span
|
:span span
|
||||||
:keys (mapv ->open (keyed-frames ch))
|
:keys (mapv ->open (keyed-frames ch))
|
||||||
:key-items (filterv #(= cpath (:channel %)) (key-items n sid ->open))
|
:key-items (filterv #(= cpath (:channel %)) (key-items n sid ->open))
|
||||||
|
:gaps (gaps n sid cpath ch ->open)
|
||||||
:dense? (boolean (:dense ch))})
|
:dense? (boolean (:dense ch))})
|
||||||
[{:path (conj path ::automation-hint)
|
[{:path (conj path ::automation-hint)
|
||||||
:depth depth
|
:depth depth
|
||||||
|
|
@ -171,6 +187,7 @@
|
||||||
:kind :node
|
:kind :node
|
||||||
:node-kind (:kind child)
|
:node-kind (:kind child)
|
||||||
:of (node/source child)
|
:of (node/source child)
|
||||||
|
:uses (some->> (node/source child) (clip/uses clip))
|
||||||
:portal? true
|
:portal? true
|
||||||
:select [:node sid (:id child) cpath]
|
:select [:node sid (:id child) cpath]
|
||||||
:expandable? true
|
:expandable? true
|
||||||
|
|
@ -283,6 +300,7 @@
|
||||||
:node-kind (:kind n)
|
:node-kind (:kind n)
|
||||||
:lane? lane?
|
:lane? lane?
|
||||||
:of (node/source n)
|
:of (node/source n)
|
||||||
|
:uses (some->> (node/source n) (clip/uses clip))
|
||||||
:select [:node sid id rpath]
|
:select [:node sid id rpath]
|
||||||
:expandable? true
|
:expandable? true
|
||||||
:expanded? open?
|
:expanded? open?
|
||||||
|
|
@ -623,7 +641,7 @@
|
||||||
on every render after, which would fight a person scrolling away."
|
on every render after, which would fight a person scrolling away."
|
||||||
(memoize (fn [_selection] (fn [el] (some-> el (.scrollIntoView #js {:block "nearest"}))))))
|
(memoize (fn [_selection] (fn [el] (some-> el (.scrollIntoView #js {:block "nearest"}))))))
|
||||||
|
|
||||||
(defn- label-cell [{:keys [path depth label kind node-kind lane? span select expandable? expanded? of via]}
|
(defn- label-cell [{:keys [path depth label kind node-kind lane? span select expandable? expanded? of via uses]}
|
||||||
selection selections target-path over solo tracing renaming draft choose-row!]
|
selection selections target-path over solo tracing renaming draft choose-row!]
|
||||||
(let [node? (= :node kind)
|
(let [node? (= :node kind)
|
||||||
selected? (contains? selections select)
|
selected? (contains? selections select)
|
||||||
|
|
@ -639,6 +657,7 @@
|
||||||
(when (and select (= select selection)) " primary")
|
(when (and select (= select selection)) " primary")
|
||||||
(when (= path target-path) " target")
|
(when (= path target-path) " target")
|
||||||
(when lane? " lane")
|
(when lane? " lane")
|
||||||
|
(when (= :palette kind) " palette")
|
||||||
(when (= :ghost kind) " ghost")
|
(when (= :ghost kind) " ghost")
|
||||||
(when (= path over-path)
|
(when (= path over-path)
|
||||||
(case where
|
(case where
|
||||||
|
|
@ -726,6 +745,11 @@
|
||||||
"Escape" (do (.preventDefault e) (reset! renaming nil))
|
"Escape" (do (.preventDefault e) (reset! renaming nil))
|
||||||
nil))}]
|
nil))}]
|
||||||
[:span.name label])
|
[:span.name label])
|
||||||
|
;; How many places show this same drawing: rename it here and every one
|
||||||
|
;; of them changes, and `make unique` is how to stop that.
|
||||||
|
(when (and uses (< 1 uses) (not editing?))
|
||||||
|
[:span.uses {:title (str "placed " uses " times · a rename reaches every one")}
|
||||||
|
(str "(" uses ")")])
|
||||||
(cond
|
(cond
|
||||||
lane? [:span.kind "·lane"]
|
lane? [:span.kind "·lane"]
|
||||||
node? [:span.kind (if via (str "· in " via) (str "·" (name node-kind)))])
|
node? [:span.kind (if via (str "· in " via) (str "·" (name node-kind)))])
|
||||||
|
|
@ -875,7 +899,7 @@
|
||||||
`:from` is the frame the press was on and `:df` how many frames the pointer has
|
`:from` is the frame the press was on and `:df` how many frames the pointer has
|
||||||
moved since. What it looks like mid-drag is `[:ui :sliding]`, which the clip
|
moved since. What it looks like mid-drag is `[:ui :sliding]`, which the clip
|
||||||
every row and the stage are drawn from already has in it."
|
every row and the stage are drawn from already has in it."
|
||||||
[{:keys [path span keys key-items dense? kind node-kind select slides cels lane? of unmapped? owner]}
|
[{:keys [path span keys key-items gaps dense? kind node-kind select slides cels lane? of unmapped? owner]}
|
||||||
frames sliding hint {:keys [clip store open selection selections target-path key-selection key-preview key-anchor key-state key-elements choose-row!]}]
|
frames sliding hint {:keys [clip store open selection selections target-path key-selection key-preview key-anchor key-state key-elements choose-row!]}]
|
||||||
(let [selected-set (set selections)
|
(let [selected-set (set selections)
|
||||||
active-row (:row @sliding)
|
active-row (:row @sliding)
|
||||||
|
|
@ -1224,6 +1248,21 @@
|
||||||
(when select
|
(when select
|
||||||
[:span.tl-edge.out {:title "Drag endpoint · Shift-drag ripples later clips"
|
[:span.tl-edge.out {:title "Drag endpoint · Shift-drag ripples later clips"
|
||||||
:on-pointer-down #(begin! % (nth select 3) :out select nil nil)}])]))
|
:on-pointer-down #(begin! % (nth select 3) :out select nil nil)}])]))
|
||||||
|
;; Click a gap between two keys to switch it between holding and tweening.
|
||||||
|
(doall
|
||||||
|
(for [{:keys [sid id channel left from to tween?]} gaps
|
||||||
|
:when (and (< from frames) (< 0 to))]
|
||||||
|
^{:key left}
|
||||||
|
[:button.tl-gap
|
||||||
|
{:type "button" :class (when tween? "tween")
|
||||||
|
:title (if tween? "tween · click to hold" "hold · click to tween")
|
||||||
|
:style {:left (at% from frames)
|
||||||
|
:width (str (* 100 (/ (- to from) (max 1 frames))) "%")}
|
||||||
|
:on-pointer-down #(.stopPropagation %)
|
||||||
|
:on-click (fn [^js e]
|
||||||
|
(.stopPropagation e)
|
||||||
|
(rf/dispatch [::project/set-segment-interp sid id channel left
|
||||||
|
(if tween? :hold :linear)]))}]))
|
||||||
;; A dense channel has a value on every frame, so ticking each one is a solid
|
;; A dense channel has a value on every frame, so ticking each one is a solid
|
||||||
;; block that says less than the bar behind it already does.
|
;; block that says less than the bar behind it already does.
|
||||||
;; The lane's own keys, and those of the clips on it drawn after the
|
;; The lane's own keys, and those of the clips on it drawn after the
|
||||||
|
|
|
||||||
|
|
@ -281,9 +281,10 @@
|
||||||
(testing "an unnamed symbol falls back to its id, not to the node's uuid"
|
(testing "an unnamed symbol falls back to its id, not to the node's uuid"
|
||||||
(is (= "inner" (clip/node-label (update-in c [:symbols :inner] dissoc :name)
|
(is (= "inner" (clip/node-label (update-in c [:symbols :inner] dissoc :name)
|
||||||
id n))))
|
id n))))
|
||||||
(testing "but a name somebody typed on the instance still wins"
|
(testing "and a name left on the instance is not read: it has none of its own"
|
||||||
;; Two instances of one symbol are told apart only by this.
|
(is (= "mouth" (clip/node-label c id (assoc n :name "left eye")))))
|
||||||
(is (= "left eye" (clip/node-label c id (assoc n :name "left eye")))))
|
(testing "every placement of a symbol is counted"
|
||||||
|
(is (= 1 (clip/uses c :inner))))
|
||||||
(testing "and a node that places nothing is labelled by its own name or id"
|
(testing "and a node that places nothing is labelled by its own name or id"
|
||||||
(is (= "lid" (clip/node-label c :lid {:id :lid :kind :rect :name "lid"})))
|
(is (= "lid" (clip/node-label c :lid {:id :lid :kind :rect :name "lid"})))
|
||||||
(is (= "lid" (clip/node-label c :lid {:id :lid :kind :rect}))))))
|
(is (= "lid" (clip/node-label c :lid {:id :lid :kind :rect}))))))
|
||||||
|
|
|
||||||
|
|
@ -61,26 +61,26 @@
|
||||||
#uuid "22222222-2222-4222-8222-222222222222"
|
#uuid "22222222-2222-4222-8222-222222222222"
|
||||||
{:id #uuid "22222222-2222-4222-8222-222222222222"
|
{:id #uuid "22222222-2222-4222-8222-222222222222"
|
||||||
:kind :instance :parent :root :z "a2"
|
:kind :instance :parent :root :z "a2"
|
||||||
:name "8625 right"
|
|
||||||
:source {:symbol :sym/face}}
|
:source {:symbol :sym/face}}
|
||||||
#uuid "11111111-1111-4111-8111-111111111111"
|
#uuid "11111111-1111-4111-8111-111111111111"
|
||||||
{:id #uuid "11111111-1111-4111-8111-111111111111"
|
{:id #uuid "11111111-1111-4111-8111-111111111111"
|
||||||
:kind :instance :parent :root :z "a1"
|
:kind :instance :parent :root :z "a1"
|
||||||
:name "8625 left"
|
|
||||||
:source {:symbol :sym/face}}
|
:source {:symbol :sym/face}}
|
||||||
:a-rect {:id :a-rect :kind :rect :parent :root :z "a3"}}}
|
:a-rect {:id :a-rect :kind :rect :parent :root :z "a3"}}}
|
||||||
:sym/face {:frames 40 :nodes {:root {:id :root :kind :group :z "a1"}}}}})
|
:sym/face {:frames 40 :nodes {:root {:id :root :kind :group :z "a1"}}}}})
|
||||||
|
|
||||||
(deftest the-picker-offers-every-symbol-then-every-instance-in-the-open-one
|
(deftest the-picker-offers-every-symbol-then-every-instance-in-the-open-one
|
||||||
(let [ts (export/targets clip :main)]
|
(let [ts (export/targets clip :main)]
|
||||||
(is (= ["main" "face" "8625 left" "8625 right"] (mapv :label ts))
|
(is (= ["main" "face" "face 1" "face 2"] (mapv :label ts))
|
||||||
"every symbol, then the instances in the open one")
|
"every symbol, then the instances in the open one")
|
||||||
(testing "the instances isolate a node in the open symbol and the symbols do not"
|
(testing "the instances isolate a node in the open symbol and the symbols do not"
|
||||||
(is (= [nil nil] (mapv :isolate (take 2 ts))))
|
(is (= [nil nil] (mapv :isolate (take 2 ts))))
|
||||||
(is (every? uuid? (mapv :isolate (drop 2 ts))))
|
(is (every? uuid? (mapv :isolate (drop 2 ts))))
|
||||||
(is (every? #(= :main (:symbol %)) (drop 2 ts))))
|
(is (every? #(= :main (:symbol %)) (drop 2 ts))))
|
||||||
(testing "ordered by label, because a uuid sorts at random"
|
(testing "one symbol placed twice is numbered in stacking order, because a uuid sorts at random"
|
||||||
(is (= ["8625 left" "8625 right"] (mapv :label (drop 2 ts)))))
|
(is (= [#uuid "11111111-1111-4111-8111-111111111111"
|
||||||
|
#uuid "22222222-2222-4222-8222-222222222222"]
|
||||||
|
(mapv :isolate (drop 2 ts)))))
|
||||||
(testing "and a node that is not an instance is not offered"
|
(testing "and a node that is not an instance is not offered"
|
||||||
(is (not-any? #{"a-rect"} (map :label ts))))))
|
(is (not-any? #{"a-rect"} (map :label ts))))))
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -562,31 +562,26 @@ async function main() {
|
||||||
await page.eval(SEEK(f));
|
await page.eval(SEEK(f));
|
||||||
await sleep(100);
|
await sleep(100);
|
||||||
check(await page.eval(`(() => {
|
check(await page.eval(`(() => {
|
||||||
const button = [...document.querySelectorAll('.params button')]
|
const button = document.querySelector('.params .chan[data-channel="geom pts"] button.key');
|
||||||
.find(b => b.textContent === 'drawing key here');
|
if (!button || button.disabled || button.classList.contains('on')) return false;
|
||||||
if (!button || button.disabled) return false;
|
|
||||||
button.click();
|
button.click();
|
||||||
return true;
|
return true;
|
||||||
})()`), `a drawing key can be added at frame ${f}`);
|
})()`), `a drawing key can be added at frame ${f}`);
|
||||||
await sleep(100);
|
await sleep(100);
|
||||||
}
|
}
|
||||||
await page.eval(SEEK(8));
|
// Standing on key 16, the gap switch is about the gap arriving at it, 8 → 16.
|
||||||
|
const GAP = `document.querySelector('.params .chan[data-channel="geom pts"] button.gap')`;
|
||||||
|
await page.eval(SEEK(16));
|
||||||
await sleep(100);
|
await sleep(100);
|
||||||
const tweenSelected = await page.eval(`(() => {
|
const tweenSelected = await page.eval(`(() => {
|
||||||
const label = [...document.querySelectorAll('.params label')]
|
const gap = ${GAP};
|
||||||
.find(el => el.textContent.startsWith('key 8 → 16'));
|
if (!gap || gap.getAttribute('aria-label') !== 'hold') return false;
|
||||||
const select = label?.querySelector('select');
|
gap.click();
|
||||||
if (!select) return false;
|
|
||||||
select.value = 'linear';
|
|
||||||
select.dispatchEvent(new Event('change', { bubbles: true }));
|
|
||||||
return true;
|
return true;
|
||||||
})()`);
|
})()`);
|
||||||
await sleep(100);
|
await sleep(100);
|
||||||
check(tweenSelected && await page.eval(`(() => {
|
check(tweenSelected && await page.eval(`${GAP}?.getAttribute('aria-label') === 'tween'`),
|
||||||
const label = [...document.querySelectorAll('.params label')]
|
'the second drawing gap can be set to tween');
|
||||||
.find(el => el.textContent.startsWith('key 8 → 16'));
|
|
||||||
return label?.querySelector('select')?.value === 'linear';
|
|
||||||
})()`), 'the second drawing gap can be set to tween');
|
|
||||||
check((await statusMatching(/saved r\d+/)) !== null,
|
check((await statusMatching(/saved r\d+/)) !== null,
|
||||||
'the painted shape saves by itself', await page.eval(STATUS));
|
'the painted shape saves by itself', await page.eval(STATUS));
|
||||||
check(await fromMenu(MENU_PICK_NEWEST), 'the painted document can be reopened');
|
check(await fromMenu(MENU_PICK_NEWEST), 'the painted document can be reopened');
|
||||||
|
|
@ -610,13 +605,10 @@ async function main() {
|
||||||
re_frame.core.dispatch_sync(c.vector(k('arthur.events.ui/select'),
|
re_frame.core.dispatch_sync(c.vector(k('arthur.events.ui/select'),
|
||||||
c.vector(k('node'), k('main'), id, c.vector(id))));
|
c.vector(k('node'), k('main'), id, c.vector(id))));
|
||||||
})()`);
|
})()`);
|
||||||
await page.eval(SEEK(8));
|
await page.eval(SEEK(16));
|
||||||
await sleep(100);
|
await sleep(100);
|
||||||
check(await page.eval(`(() => {
|
check(await page.eval(`${GAP}?.getAttribute('aria-label') === 'tween'`),
|
||||||
const label = [...document.querySelectorAll('.params label')]
|
'the per-gap tween setting survives the project round trip');
|
||||||
.find(el => el.textContent.startsWith('key 8 → 16'));
|
|
||||||
return label?.querySelector('select')?.value === 'linear';
|
|
||||||
})()`), 'the per-gap tween setting survives the project round trip');
|
|
||||||
|
|
||||||
// The local 8625 study is optional in a fresh test database. When present,
|
// The local 8625 study is optional in a fresh test database. When present,
|
||||||
// tune its shared symbol while its stage is playing.
|
// tune its shared symbol while its stage is playing.
|
||||||
|
|
|
||||||
|
|
@ -926,7 +926,6 @@ button.share-button:hover, button.share-button.on { filter: brightness(1.1); }
|
||||||
letter-spacing: .07em;
|
letter-spacing: .07em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.inspector-form { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-top: 7px; }
|
|
||||||
.inspector-field { display: grid; gap: 2px; color: var(--dim); }
|
.inspector-field { display: grid; gap: 2px; color: var(--dim); }
|
||||||
.inspector-field input { width: 100%; color: var(--fg); }
|
.inspector-field input { width: 100%; color: var(--fg); }
|
||||||
|
|
||||||
|
|
@ -936,11 +935,6 @@ button.share-button:hover, button.share-button.on { filter: brightness(1.1); }
|
||||||
.correction-item { display: flex; align-items: center; gap: 4px; min-width: 0; }
|
.correction-item { display: flex; align-items: center; gap: 4px; min-width: 0; }
|
||||||
.correction-item > span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
.correction-item > span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||||
|
|
||||||
/* Label / value, once, for every read-only fact in the pane. */
|
|
||||||
.facts { display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; margin: 0; }
|
|
||||||
.facts dt { color: var(--dim); }
|
|
||||||
.facts dd { margin: 0; overflow: hidden; text-overflow: ellipsis; }
|
|
||||||
|
|
||||||
.knob { display: grid; gap: 1px; margin-bottom: 6px; }
|
.knob { display: grid; gap: 1px; margin-bottom: 6px; }
|
||||||
.knob .top-line { display: flex; justify-content: space-between; gap: 8px; }
|
.knob .top-line { display: flex; justify-content: space-between; gap: 8px; }
|
||||||
.knob .top-line .name { color: var(--dim); }
|
.knob .top-line .name { color: var(--dim); }
|
||||||
|
|
@ -1402,28 +1396,70 @@ button.share-button:hover, button.share-button.on { filter: brightness(1.1); }
|
||||||
border-top: 1px solid var(--hair);
|
border-top: 1px solid var(--hair);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* A transform or visibility channel: its key button, then a field per component. */
|
/* The inspector. One column of names, 46px, and controls after it: the
|
||||||
.facts dd.channel { display: flex; gap: 3px; align-items: center; overflow: visible; }
|
header, then a row per channel, then labelled rows. */
|
||||||
.facts dd.channel input[type=number] { width: 0; flex: 1; min-width: 0; }
|
.inspect-head {
|
||||||
.facts dd.channel .key { padding: 0 3px; color: var(--dim); }
|
display: flex; align-items: center; gap: 5px;
|
||||||
.facts dd.channel .key.keyed { color: var(--fg); }
|
padding: 6px; border-bottom: 1px solid var(--hair);
|
||||||
.facts dd.channel .key.on { color: var(--sel); }
|
position: sticky; top: 0; z-index: 1; background: var(--pane);
|
||||||
.facts dd.channel .channel-swatches {
|
|
||||||
display: flex;
|
|
||||||
flex: 1;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
gap: 3px;
|
|
||||||
min-width: 0;
|
|
||||||
}
|
}
|
||||||
.facts dd.channel .channel-swatches .swatch { flex: 0 0 15px; }
|
.inspect-kind { color: var(--dim); flex: 0 0 auto; }
|
||||||
.facts dd.channel.live {
|
.inspect-name { flex: 1; min-width: 0; font-weight: 600; }
|
||||||
margin: -2px;
|
.uses, .tl-label .uses { color: var(--dim); flex: 0 0 auto; }
|
||||||
padding: 2px;
|
|
||||||
|
.chans, .props { padding: 4px 6px; display: grid; gap: 3px; border-bottom: 1px solid var(--hair); }
|
||||||
|
|
||||||
|
/* ◀ ◆ ▶ · name · value · gap */
|
||||||
|
.chan { display: grid; grid-template-columns: auto 38px 1fr 16px; gap: 4px; align-items: center; min-height: 20px; }
|
||||||
|
.chan-name, .prop-name { color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
||||||
|
.chan-value { display: flex; gap: 3px; align-items: center; min-width: 0; }
|
||||||
|
.chan-value input[type=number], .prop input[type=number] { width: 0; flex: 1; min-width: 0; }
|
||||||
|
.chan-value select, .prop select { flex: 1; min-width: 0; }
|
||||||
|
.chan.live {
|
||||||
|
margin: -1px -3px; padding: 1px 3px;
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
background: var(--live-bg);
|
background: var(--live-bg);
|
||||||
box-shadow: 0 0 0 1px rgba(35, 148, 71, .45), 0 0 6px rgba(35, 148, 71, .28);
|
box-shadow: 0 0 0 1px rgba(35, 148, 71, .45);
|
||||||
}
|
}
|
||||||
.facts dd.channel.live input { border-color: var(--live); }
|
.chan.live input { border-color: var(--live); }
|
||||||
|
|
||||||
|
.key-nav { display: flex; align-items: center; }
|
||||||
|
.key-nav button, .chan .gap, .prop .icon, .chan-value .icon {
|
||||||
|
padding: 0; border: 0; background: none; width: 14px; height: 18px;
|
||||||
|
display: inline-flex; align-items: center; justify-content: center;
|
||||||
|
color: var(--dim);
|
||||||
|
}
|
||||||
|
.key-nav button:disabled { opacity: .3; }
|
||||||
|
.key-nav .key { width: 16px; }
|
||||||
|
.key-nav .key.keyed { color: var(--fg); }
|
||||||
|
.key-nav .key.on { color: var(--sel); }
|
||||||
|
.key-nav svg, .chan .gap svg, .prop .seg svg { width: 11px; height: 11px; }
|
||||||
|
.key-nav button:hover:not(:disabled), .chan button.gap:hover, .icon:hover:not(:disabled) { color: var(--fg); }
|
||||||
|
.chan .gap.on { color: var(--sel); }
|
||||||
|
|
||||||
|
.chan-swatches { display: flex; flex-wrap: wrap; gap: 2px; min-width: 0; }
|
||||||
|
.chan-swatches .swatch { flex: 0 0 11px; width: 11px; height: 11px; }
|
||||||
|
|
||||||
|
.prop { display: flex; gap: 4px; align-items: center; min-height: 20px; }
|
||||||
|
.prop > .prop-name { flex: 0 0 46px; }
|
||||||
|
.prop input[type=text] { flex: 1; min-width: 0; }
|
||||||
|
|
||||||
|
.prop .seg button { padding: 1px 4px; display: inline-flex; align-items: center; }
|
||||||
|
|
||||||
|
/* A gap between two keys of a channel row: empty where it holds, a ramp where
|
||||||
|
it tweens, as Flash draws a classic tween. Click to switch. */
|
||||||
|
button.tl-gap {
|
||||||
|
position: absolute; top: 50%; height: 9px; margin-top: -4.5px;
|
||||||
|
padding: 0; border: 0; border-radius: 0; background: transparent;
|
||||||
|
cursor: pointer; z-index: 3;
|
||||||
|
}
|
||||||
|
button.tl-gap::after {
|
||||||
|
content: ""; position: absolute; left: 6px; right: 6px; top: 4px; height: 1px;
|
||||||
|
background: var(--line);
|
||||||
|
}
|
||||||
|
button.tl-gap.tween { background: rgba(47, 111, 192, .22); }
|
||||||
|
button.tl-gap.tween::after { top: 3px; height: 3px; background: var(--sel); }
|
||||||
|
button.tl-gap:hover { background: rgba(47, 111, 192, .28); }
|
||||||
|
|
||||||
/* The selected node's transform box, in stage pixels (the SVG's viewBox). */
|
/* The selected node's transform box, in stage pixels (the SVG's viewBox). */
|
||||||
.paint-overlay .handles .box { fill: none; stroke: #e6ca8b; stroke-width: 0.5; stroke-dasharray: 2 1; pointer-events: none; }
|
.paint-overlay .handles .box { fill: none; stroke: #e6ca8b; stroke-width: 0.5; stroke-dasharray: 2 1; pointer-events: none; }
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue