Copy and paste exists only for animation keys today (#102, state.keyClipboard, Ctrl+C/Ctrl+V in shortcuts.ts). It is missing where it is needed most: placed objects in the scene view / hierarchy / container tab, and nodes in every graph (behavior, state machine, shader, particles – all four use GraphCanvas).
Proposal
Common
Ctrl+C, Ctrl+X, Ctrl+V act on the current selection kind: objects, nodes (with the groups/comments caught alongside), keys as before.
Context menus get Copy, Cut and Paste: the object menu (hierarchy and scene view), the node menu, and the empty-canvas menus of scene view and graph (Paste only).
Ctrl+D = duplicate (copy + paste in one undo step, the clipboard stays untouched). Offered in the same menus.
The clipboard is the editor's own, in memory, like the key clipboard. It lives across tabs, scenes, containers and graphs of the open project, and is gone on reload or project switch. No system clipboard: a copy holds asset ids that mean nothing in another project.
Paste is one undo step and selects what it pasted.
Where it lands: at the pointer when the pointer is over the target canvas (the copied group keeps its layout, its bounding box centred on the pointer). Otherwise – hierarchy, keyboard with the pointer elsewhere – on the original spot shifted by one grid step, so the copy is visible next to the original.
Objects
The copy takes the whole subtree of every copied object (children, colliders, rigidbodies), with fresh ids; parentId inside the copy is remapped.
Overrides, name, instanceEdits of a placed container and the look (rotation, scale, mirror) come along. editorOffset is not copied (view-only, as in CreateContainerCommand).
Parent on paste: the pasted roots become children of the selected object when exactly one object is selected and it can take children; otherwise they keep their original parent when it exists in the target holder, else top level. They keep their world look (carryTransform).
Content of a placed container can be copied; it pastes as ordinary objects.
Pasting a container into its own template (or anything placementRejection refuses) is refused with the usual notice.
Names stay as they are (no "copy" suffix) – objects fall back to the asset name anyway and names are not unique today.
Nodes
Copied: the nodes, edges between copied nodes, and the selected groups/comments. Edges to nodes outside the copy are dropped.
A node pastes only where the palette would offer it (paletteEntries of the target asset): a State never lands in a behavior, a behavior node never in a shader graph. Behavior start/end is skipped when the target already has one. Skipped nodes are named in a notice; the rest is pasted.
Pasting into a different behavior is allowed. A Variables node naming a variable the target does not have shows the usual warning (ghost port), nothing is created automatically.
States keep their names (names need not be unique, see #52).
Open questions
Ctrl+X and Ctrl+D in this issue as well, or only copy and paste?
Parent on paste: "into the one selected object" as above, or always the original parent / top level?
Where it lands without the pointer on the canvas: grid step next to the original (proposal) or exactly on top of it?
e2e with real keys and clicks in the scene view, hierarchy and graph; counter-probes as usual.
Copy and paste exists only for animation keys today (#102, `state.keyClipboard`, Ctrl+C/Ctrl+V in `shortcuts.ts`). It is missing where it is needed most: placed objects in the scene view / hierarchy / container tab, and nodes in every graph (behavior, state machine, shader, particles – all four use `GraphCanvas`).
## Proposal
### Common
- **Ctrl+C, Ctrl+X, Ctrl+V** act on the current selection kind: objects, nodes (with the groups/comments caught alongside), keys as before.
- **Context menus** get Copy, Cut and Paste: the object menu (hierarchy and scene view), the node menu, and the empty-canvas menus of scene view and graph (Paste only).
- **Ctrl+D = duplicate** (copy + paste in one undo step, the clipboard stays untouched). Offered in the same menus.
- **The clipboard is the editor's own, in memory**, like the key clipboard. It lives across tabs, scenes, containers and graphs of the open project, and is gone on reload or project switch. No system clipboard: a copy holds asset ids that mean nothing in another project.
- **Paste is one undo step** and selects what it pasted.
- **Where it lands:** at the pointer when the pointer is over the target canvas (the copied group keeps its layout, its bounding box centred on the pointer). Otherwise – hierarchy, keyboard with the pointer elsewhere – on the original spot shifted by one grid step, so the copy is visible next to the original.
### Objects
- The copy takes **the whole subtree** of every copied object (children, colliders, rigidbodies), with fresh ids; `parentId` inside the copy is remapped.
- Overrides, name, `instanceEdits` of a placed container and the look (rotation, scale, mirror) come along. `editorOffset` is not copied (view-only, as in `CreateContainerCommand`).
- **Parent on paste:** the pasted roots become children of the selected object when exactly one object is selected and it can take children; otherwise they keep their original parent when it exists in the target holder, else top level. They keep their world look (`carryTransform`).
- **Content of a placed container** can be copied; it pastes as ordinary objects.
- Pasting a container into its own template (or anything `placementRejection` refuses) is refused with the usual notice.
- Names stay as they are (no "copy" suffix) – objects fall back to the asset name anyway and names are not unique today.
### Nodes
- Copied: the nodes, **edges between copied nodes**, and the selected groups/comments. Edges to nodes outside the copy are dropped.
- `params`, declared `ports`, `collapsed`, edge `label`/`folded` come along; everything gets fresh ids.
- **A node pastes only where the palette would offer it** (`paletteEntries` of the target asset): a `State` never lands in a behavior, a behavior node never in a shader graph. `Behavior start`/`end` is skipped when the target already has one. Skipped nodes are named in a notice; the rest is pasted.
- Pasting into a different behavior is allowed. A `Variables` node naming a variable the target does not have shows the usual warning (ghost port), nothing is created automatically.
- States keep their names (names need not be unique, see #52).
## Open questions
1. Ctrl+X and Ctrl+D in this issue as well, or only copy and paste?
2. Parent on paste: "into the one selected object" as above, or always the original parent / top level?
3. Where it lands without the pointer on the canvas: grid step next to the original (proposal) or exactly on top of it?
## Tests
- Unit: copy/paste commands for objects (subtree, remapped parents, look kept, container content, refused placement, undo) and nodes (inner edges only, annotations, palette filter, terminals, undo).
- e2e with real keys and clicks in the scene view, hierarchy and graph; counter-probes as usual.
Umgesetzt in 2b89292 (Wiki: 79c3b3e). Wie im Kommentar festgelegt: nur Copy & Paste, ohne Ctrl+X/Ctrl+D; Paste ins eine ausgewählte Objekt; ohne Mauszeiger auf der View versetzt neben das Original.
Verhalten
Ctrl+C / Ctrl+V für Szenen-Objekte (mit ganzem Teilbaum: Kinder, Collider, Rigidbodies) und Graph-Nodes (mit Links zwischen kopierten Nodes, Groups und Kommentaren). Gilt für Behavior, State Machine, Shader und Partikel.
Menüs: Copy/Paste im Objekt-Menü, neues Menü mit Paste auf leerer Fläche der Scene-View, Copy im Node- und Box-Menü, Paste in der Palette auf leerer Fläche.
Wo die Kopie landet: unter dem Mauszeiger, sonst einen Rasterschritt (100) versetzt. Jede weitere Kopie, die noch existiert, rückt einen Schritt weiter (nach Undo zählt sie nicht mehr).
Parent: das eine ausgewählte Objekt. Ergänzung: Ist das Ziel das Original oder eine frühere Kopie, landet die Kopie daneben, sonst würde jedes Ctrl+V eine Ebene tiefer stecken. Ohne Ziel bleibt der alte Parent, falls vorhanden, sonst oberste Ebene. Das Aussehen bleibt unter dem neuen Parent gleich.
Container: Ein platzierter Container bleibt Container; Inhalt aus einem Container wird als normale Objekte eingefügt; Container ins eigene Template wird abgelehnt.
Nodes: nur, was die Palette dort anbieten würde. Ein zweites Start/End, ein State im Behavior oder ein Behavior, das sich selbst aufruft, fällt weg; ein Hinweis nennt es.
Ctrl+V und Bild-Import: Solange Objekte kopiert sind, nutzt Ctrl+V im Scene- und Container-Tab die Kopie (wie die Timeline bei Keys). Passt die Kopie nicht zum Tab, geht die Taste an den Bild-Import.
Aufbau
src/core/model/clipboard.ts: Kopie als Schnappschuss.
src/core/commands/pasteCommands.ts: zwei Paste-Commands, je ein Undo-Schritt, Eingefügtes ist danach ausgewählt.
src/editor/clipboard.ts: Ziel, Platz und Palette-Filter; Anbindung in shortcuts.ts, Menüs, GraphCanvas, SceneViewport.
Tests
./check.sh: 175 Files, 2531 Tests, CHECK EXIT 0
Neues e2e-Modul 51: ALL PASSED, 11 Checks mit echten Tasten und Klicks
13 Unit-Tests in tests/editor/clipboard.test.ts, einer davon für den Fund „Versatz zählt nach Undo weiter“
7 Gegenproben, alle greifen (6 Unit, 1 im Browser)
Nicht im Browser geprüft: Paste im Container-Tab, in State-Machine-, Shader- und Partikel-Graph und aus dem Hierarchie-Menü. Das deckt nur der gemeinsame Code-Weg ab.
Umgesetzt in 2b89292 (Wiki: 79c3b3e). Wie im Kommentar festgelegt: nur Copy & Paste, ohne Ctrl+X/Ctrl+D; Paste ins eine ausgewählte Objekt; ohne Mauszeiger auf der View versetzt neben das Original.
## Verhalten
- **Ctrl+C / Ctrl+V** für Szenen-Objekte (mit ganzem Teilbaum: Kinder, Collider, Rigidbodies) und Graph-Nodes (mit Links zwischen kopierten Nodes, Groups und Kommentaren). Gilt für Behavior, State Machine, Shader und Partikel.
- **Menüs:** Copy/Paste im Objekt-Menü, neues Menü mit Paste auf leerer Fläche der Scene-View, Copy im Node- und Box-Menü, Paste in der Palette auf leerer Fläche.
- **Wo die Kopie landet:** unter dem Mauszeiger, sonst einen Rasterschritt (100) versetzt. Jede weitere Kopie, die noch existiert, rückt einen Schritt weiter (nach Undo zählt sie nicht mehr).
- **Parent:** das eine ausgewählte Objekt. Ergänzung: Ist das Ziel das Original oder eine frühere Kopie, landet die Kopie daneben, sonst würde jedes Ctrl+V eine Ebene tiefer stecken. Ohne Ziel bleibt der alte Parent, falls vorhanden, sonst oberste Ebene. Das Aussehen bleibt unter dem neuen Parent gleich.
- **Container:** Ein platzierter Container bleibt Container; Inhalt aus einem Container wird als normale Objekte eingefügt; Container ins eigene Template wird abgelehnt.
- **Nodes:** nur, was die Palette dort anbieten würde. Ein zweites Start/End, ein State im Behavior oder ein Behavior, das sich selbst aufruft, fällt weg; ein Hinweis nennt es.
- **Ctrl+V und Bild-Import:** Solange Objekte kopiert sind, nutzt Ctrl+V im Scene- und Container-Tab die Kopie (wie die Timeline bei Keys). Passt die Kopie nicht zum Tab, geht die Taste an den Bild-Import.
## Aufbau
- `src/core/model/clipboard.ts`: Kopie als Schnappschuss.
- `src/core/commands/pasteCommands.ts`: zwei Paste-Commands, je ein Undo-Schritt, Eingefügtes ist danach ausgewählt.
- `src/editor/clipboard.ts`: Ziel, Platz und Palette-Filter; Anbindung in `shortcuts.ts`, Menüs, `GraphCanvas`, `SceneViewport`.
## Tests
- `./check.sh`: 175 Files, 2531 Tests, CHECK EXIT 0
- Neues e2e-Modul 51: ALL PASSED, 11 Checks mit echten Tasten und Klicks
- 13 Unit-Tests in `tests/editor/clipboard.test.ts`, einer davon für den Fund „Versatz zählt nach Undo weiter“
- 7 Gegenproben, alle greifen (6 Unit, 1 im Browser)
**Nicht im Browser geprüft:** Paste im Container-Tab, in State-Machine-, Shader- und Partikel-Graph und aus dem Hierarchie-Menü. Das deckt nur der gemeinsame Code-Weg ab.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Copy and paste exists only for animation keys today (#102,
state.keyClipboard, Ctrl+C/Ctrl+V inshortcuts.ts). It is missing where it is needed most: placed objects in the scene view / hierarchy / container tab, and nodes in every graph (behavior, state machine, shader, particles – all four useGraphCanvas).Proposal
Common
Objects
parentIdinside the copy is remapped.instanceEditsof a placed container and the look (rotation, scale, mirror) come along.editorOffsetis not copied (view-only, as inCreateContainerCommand).carryTransform).placementRejectionrefuses) is refused with the usual notice.Nodes
params, declaredports,collapsed, edgelabel/foldedcome along; everything gets fresh ids.paletteEntriesof the target asset): aStatenever lands in a behavior, a behavior node never in a shader graph.Behavior start/endis skipped when the target already has one. Skipped nodes are named in a notice; the rest is pasted.Variablesnode naming a variable the target does not have shows the usual warning (ghost port), nothing is created automatically.Open questions
Tests
Umgesetzt in
2b89292(Wiki: 79c3b3e). Wie im Kommentar festgelegt: nur Copy & Paste, ohne Ctrl+X/Ctrl+D; Paste ins eine ausgewählte Objekt; ohne Mauszeiger auf der View versetzt neben das Original.Verhalten
Aufbau
src/core/model/clipboard.ts: Kopie als Schnappschuss.src/core/commands/pasteCommands.ts: zwei Paste-Commands, je ein Undo-Schritt, Eingefügtes ist danach ausgewählt.src/editor/clipboard.ts: Ziel, Platz und Palette-Filter; Anbindung inshortcuts.ts, Menüs,GraphCanvas,SceneViewport.Tests
./check.sh: 175 Files, 2531 Tests, CHECK EXIT 0tests/editor/clipboard.test.ts, einer davon für den Fund „Versatz zählt nach Undo weiter“Nicht im Browser geprüft: Paste im Container-Tab, in State-Machine-, Shader- und Partikel-Graph und aus dem Hierarchie-Menü. Das deckt nur der gemeinsame Code-Weg ab.