# Task: Duplicate Object / Duplicate Group ## Objective Duplicate an object and, if possible, duplicate a grouped structure. ## Test File Split - Vanilla object duplication test: `main.js` - Vanilla group duplication test: `group.js` - R3F object duplication test: `src/App.jsx` - R3F group duplication test: `src/Group.jsx` - Run object test: default route - Command (Vanilla object): `npm run dev:object` or `yarn dev:object` - Command (Vanilla group): `npm run dev:group` or `yarn dev:group` ## Vanilla three.js - Possible: Yes - Notes: - Object duplication is in `main.js` using mesh clone. - Group duplication is in `group.js` using `THREE.Group()` and group clone. - Transforms preserved: Yes, duplicate keeps copied transform values and can be moved independently after duplication. - Structure preserved: Yes, child hierarchy is preserved when duplicating a group. - Linked or independent: Mostly independent transforms, but geometry and material are shared by default unless explicitly cloned. - UX clean: Yes for developers, but requires code understanding. - Key concepts: - Object3D clone behavior - Shared vs cloned geometry and material - Complexity: Easy ## R3F - Possible: Yes - Notes: - Object duplication is in `src/App.jsx` using repeated meshes with shared geometry/material. - Group duplication is in `src/Group.jsx` by rendering the grouped component twice. - Transforms preserved: Yes, each instance has its own position, rotation, and scale. - Structure preserved: Yes, component tree/group structure is preserved. - Linked or independent: Instance transforms are independent; geometry/material may be shared or isolated depending on how props/instances are created. - UX clean: Yes, declarative and easier to scale. - What R3F abstracted: - Imperative clone calls become declarative repeated components/instances. - Complexity: Easy ## Thob Page Builder - Possible: Yes - Notes: - There is a shortcut to duplicate objects. - Observed behavior: duplicate creates a completely different object that cannot be linked to the original, unlike vanilla and R3F patterns where sharing/linking behavior can be controlled. - Duplicate group behavior: Same as single object duplication, a complete copy is made with no linking. - Transforms preserved: Yes. - Structure preserved: Yes, as copy- paste duplication. - Linked or independent: Independent only, with no linking behavior available. - UX clean: Mixed. Shortcut is quick, but behavior is confusing because linked duplication is not possible. - Builder steps: - Create an object - Use duplicate shortcut - Duplicate a grouped structure and verify it is a full independent copy - Complexity: Medium ## What to Observe - Are transforms preserved? - Vanilla: Yes - R3F: Yes - Thob: Yes - Does duplication preserve structure? - Vanilla: Yes - R3F: Yes - Thob: Yes, as full copy- paste duplication - Does the duplicate remain linked or independent? - Vanilla: Transform- independent, data can be shared by default unless cloned - R3F: Transform- independent, sharing depends on implementation - Thob: Independent only, no linking behavior - Is the UX clean? - Vanilla: Technical but predictable - R3F: Clean and scalable - Thob: Fast shortcut, but ambiguous result for duplication semantics ## Comparison Summary - Possible in all 3? Yes - Main differences: - Vanilla and R3F give clear control over sharing vs independence. - Thob duplicate shortcut creates separate objects and does not support linked behavior. - Where Thob is better: - Fast editor action for simple duplication - Where Thob is weaker: - No linked duplication model - No linked group duplication model - What feels awkward or unclear: - No option to keep duplicates linked for synchronized edits ## Limitation Type (if any) - [x] Editor UX limitation - [ ] Runtime limitation - [x] Schema / data model limitation - [ ] Component limitation - [ ] Event system limitation - [ ] Asset pipeline limitation - [ ] Unknown / needs investigation ## Workaround - Is there a workaround? - Yes - If yes, what is it? - Use reusable components/prefabs and instantiate multiple independent copies. - If linked behavior is required, use explicit shared data/component references where supported. ## Suggested Improvement - What should improve in Thob? - Add explicit duplicate modes: independent duplicate and linked duplicate. - Add reliable deep group duplication with clear hierarchy preview. - it Is: - editor - schema/data - UX ## Difficulty Estimate - Medium ## Business Value - High ## Recommendation Yes. Thob should support both independent and linked duplication because currently duplication works as copy-paste only, which limits synchronized workflows.