Skip to content

feat: duplicate project#178

Open
kleenkanteen wants to merge 5 commits intopascalorg:mainfrom
kleenkanteen:feat/duplicate-project
Open

feat: duplicate project#178
kleenkanteen wants to merge 5 commits intopascalorg:mainfrom
kleenkanteen:feat/duplicate-project

Conversation

@kleenkanteen
Copy link

@kleenkanteen kleenkanteen commented Mar 26, 2026

What does this PR do?

Adds a cloneSceneGraph() utility function to the core package. It enables cloning a scene so that the host app can duplicate it. Implements #157

How to test

  1. Check out the branch and then create a scene with multiple nodes (walls, items, doors, windows)
  2. Clone the scene using cloneSceneGraph()
  3. Inspect the Scene Graph Explorer to verify:
  • All node IDs are properly regenerated with correct prefixes
  • Parent-child relationships are preserved (check parentId and children arrays)

Changes

  1. Deep clones all nodes
  2. Generates new UUIDs for every node
  3. Remaps all internal references (parentId, children arrays, etc.)
  4. Returns a clean SceneGraph ready to be saved as a new project

Screenshots / recordings

Vid of me testing a copy of this branch (#179) with an addition, which has a "clone scene" button that calls our utility function: https://cap.so/s/56tstwb0zmggmmm

Checklist

  • I've tested this locally with bun dev
  • My code follows the existing code style (run bun check to verify)
  • I've updated relevant documentation (if applicable)
  • This PR targets the main branch

kleenkanteen and others added 4 commits March 25, 2026 22:05
…st button

- setScene now clears collections to avoid stale references
- Test clone button applies cloned collections after setScene

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Reverts changes from commit a87fe56
to remove the Test Clone Scene functionality from the settings panel.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
@kleenkanteen kleenkanteen marked this pull request as draft March 26, 2026 04:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant