Shift-T traces the selection only
Tracing on for the tracing layers in the selection — the selected node, what it places at any depth, its children, a face's own footage — and every other layer off. Again, and every layer shows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
ea2becf4c7
commit
4fe620f50a
4 changed files with 155 additions and 63 deletions
38
frontend/test/arthur/events/tracing_test.cljs
Normal file
38
frontend/test/arthur/events/tracing_test.cljs
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
(ns arthur.events.tracing-test
|
||||
(:require [cljs.test :refer [deftest is]]
|
||||
[arthur.events.ui :as ui]
|
||||
[arthur.footage.store :as store]
|
||||
[re-frame.core :as rf]
|
||||
[re-frame.db :as rf-db]))
|
||||
|
||||
(defn- placed [id src] {:id id :kind :instance :z (name id) :source {:symbol src}})
|
||||
|
||||
(def document
|
||||
;; Two references side by side, and a face traced from footage of its own.
|
||||
{:fps 12 :width 320 :height 200
|
||||
:symbols {:main {:id :main :frames 12
|
||||
:nodes {:a (placed :a :ref) :c (placed :c :ref) :b (placed :b :face)}}
|
||||
:ref {:id :ref :frames 12 :type :trace :nodes {}}
|
||||
:face {:id :face :frames 12
|
||||
:nodes {:plate {:id :plate :kind :rect :z "a"}
|
||||
:mouth {:id :mouth :kind :rect :z "b"}}}}})
|
||||
|
||||
(defn- shift-t [selection tracing]
|
||||
(let [id (store/install! {:clip document :store {}} "trace-selection")]
|
||||
(reset! rf-db/app-db {:clip/current id :ui {:open :main :selection selection :tracing tracing}})
|
||||
(rf/dispatch-sync [::ui/trace-selection])
|
||||
(get-in @rf-db/app-db [:ui :tracing])))
|
||||
|
||||
(deftest shift-t-traces-the-selection-only
|
||||
(is (= {:on? true :opacity 0.5 :hidden #{[:main :c] [:face :plate]}}
|
||||
(shift-t [:node :main :a [:a]] {:on? false :opacity 0.5 :hidden #{}}))
|
||||
"one reference: the other and the face's footage go")
|
||||
(is (= #{[:main :a] [:main :c]}
|
||||
(:hidden (shift-t [:node :main :b [:b]] {:on? false :opacity 0.5 :hidden #{}})))
|
||||
"the face: its own footage, wherever it is placed")
|
||||
(is (= #{} (:hidden (shift-t [:node :main :a [:a]]
|
||||
{:on? true :opacity 0.5 :hidden #{[:main :c] [:face :plate]}})))
|
||||
"again, and every layer is back")
|
||||
(is (= {:on? false :opacity 0.5 :hidden #{}}
|
||||
(shift-t nil {:on? false :opacity 0.5 :hidden #{}}))
|
||||
"nothing selected changes nothing"))
|
||||
Loading…
Add table
Add a link
Reference in a new issue