Add symbols and uploads from the foot of the media pool
A "+ symbol" and an "upload…" button pinned to the bottom of the pool, where a list's own "add one" goes. A new symbol goes into the library only, one empty frame placed nowhere, as Flash's New Symbol, and its name opens for editing. The pane head loses its "+". Converting footage reads "make roto". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
b2b6af8f26
commit
cd02eb0477
4 changed files with 52 additions and 9 deletions
|
|
@ -697,6 +697,17 @@
|
|||
(assoc-in % [:symbols sid :name] value)
|
||||
(update-in % [:symbols sid] dissoc :name)))))))
|
||||
|
||||
(rf/reg-event-db
|
||||
::add-symbol
|
||||
(fn [db [_ sid]]
|
||||
;; Into the library and nowhere else, as Flash's New Symbol: one empty
|
||||
;; frame, placed in nothing until it is dragged somewhere. `sid` comes from
|
||||
;; the caller so the pool can open the new row's name for editing.
|
||||
(if (clip/symbol (:clip (store/entry (:clip/current db))) sid)
|
||||
db
|
||||
(edit/transaction db #(assoc-in % [:symbols sid]
|
||||
{:id sid :name (name sid) :frames 1 :nodes {}})))))
|
||||
|
||||
(rf/reg-event-db
|
||||
::symbol-setting
|
||||
(fn [db [_ sid key value]]
|
||||
|
|
|
|||
|
|
@ -91,4 +91,4 @@
|
|||
"tracing layer"]
|
||||
[:button.on {:disabled (or loading? (< n 1) (empty? name))
|
||||
:on-click #(rf/dispatch [::footage/convert])}
|
||||
(if loading? "working…" "make symbol")]]]]))))
|
||||
(if loading? "working…" "make roto")]]]]))))
|
||||
|
|
|
|||
|
|
@ -38,6 +38,10 @@
|
|||
`events.footage/relabel`. A symbol of ANOTHER project is renameable where it
|
||||
lives and not from here.
|
||||
|
||||
ADDING IS AT THE FOOT: a new empty symbol, which goes into the library and is
|
||||
placed nowhere until it is dragged, and an upload, which is the same as a file
|
||||
dropped on the pane.
|
||||
|
||||
THE WHOLE PANE IS THE DROP TARGET for a file. A video dropped anywhere in it
|
||||
uploads and lands in THIS PROJECT's media, and goes no further: which frames of
|
||||
it become a symbol, and what that symbol is called, is asked when it is dropped
|
||||
|
|
@ -610,13 +614,7 @@
|
|||
(reset! depth 0)
|
||||
(when-let [file (aget (.. e -dataTransfer -files) 0)]
|
||||
(rf/dispatch [::footage/upload file])))}
|
||||
[:div.pane-head
|
||||
"media pool"
|
||||
[:span.spacer]
|
||||
[:button {:title "add a video, a sound or an image"
|
||||
:disabled loading?
|
||||
:on-click #(.click (js/document.getElementById "pool-file"))}
|
||||
"+"]]
|
||||
[:div.pane-head "media pool"]
|
||||
[:input {:id "pool-file" :type "file" :accept "video/*,audio/*,image/*"
|
||||
:style {:display "none"}
|
||||
:on-change (fn [^js event]
|
||||
|
|
@ -646,4 +644,22 @@
|
|||
[:span.count (get tallies k)])]))]
|
||||
[:div.pane-body
|
||||
(if (= :project @scope) [this-project ctx] [all-assets ctx])
|
||||
(when status [:div.dim status])]])))
|
||||
(when status [:div.dim status])]
|
||||
;; At the foot, where a list's own "add one" goes, and pinned there so it
|
||||
;; does not scroll away under a long one.
|
||||
[:div.pool-foot
|
||||
[:button {:title "a new empty symbol in this project's library"
|
||||
:on-click (fn [_]
|
||||
(let [sid (clip/fresh-id document)]
|
||||
(rf/dispatch [::project/add-symbol sid])
|
||||
(rf/dispatch [::ui/select [:symbol sid]])
|
||||
;; Show its row and open its name, so what it
|
||||
;; is called is the next thing you type.
|
||||
(reset! scope :project)
|
||||
(reset! query "")
|
||||
(reset! editing [:symbol sid])))}
|
||||
"+ symbol"]
|
||||
[:button {:title "add a video, a sound or an image — or drop one on this pane"
|
||||
:disabled loading?
|
||||
:on-click #(.click (js/document.getElementById "pool-file"))}
|
||||
"upload…"]]])))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue