Repository navigation
fix(hierarchy): right-click Duplicate copies every component - #112
Open
Drima-code wants to merge 1 commit into
Open
Drima-code wants to merge 1 commit into
Drima-code wants to merge 1 commit into
Conversation
The hierarchy context-menu Duplicate spawned only a Name and a default Transform, so the "copy" had no mesh, collider or gameplay components and sat at the origin (on top of nothing, or hidden inside the original). It now deep-clones through clone_and_spawn, the same path the Ctrl+D shortcut uses (renzora_gizmo::shortcuts::duplicate_entities), so both produce the same object. Validated in a running editor: duplicating a mesh + static body + box collider + custom reflected components entity from the menu now yields the same component set as Ctrl+D (53 components, previously 4). Assisted-by: Claude Opus 5.5 (claude-opus-5-5)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Duplicate in the Hierarchy right-click menu did not duplicate anything: it spawned a new entity with only a
Nameand a defaultTransform. The "copy" had no mesh, collider, physics body or custom components and sat at the origin, so on an object at the origin it is invisible (it hides inside the original) and looks like it worked. Ctrl+D was fine. This makes the menu use the same deep clone as Ctrl+D.Changes
renzora_hierarchy::native::context_menu::duplicatenow deep-clones the target withEntityWorldMut::clone_and_spawn(the pathrenzora_gizmo::shortcuts::duplicate_entitiesuses for Ctrl+D) and appends(Copy)to the name, instead of spawning(Name, Transform::default()).RELEASE_NOTES.mdline.Related Issues
None filed; found while evaluating the editor for a project.
AI Assistance
Checklist
renzora check): not run in the container; see Testingrenzora test): not run in the container; see TestingmainAssisted-by:commit trailerTesting
Built and run natively on Linux (
cargo renzora dist, Rust 1.95.0) from an r1-alpha7 checkout carrying the same change (theduplicatefunction is identical onmain).Repro before the fix: add a Cube, give it a Physics Body + Collision Shape (and any extra component), right-click it in the Hierarchy, Duplicate. Querying the copy over BRP (
world.list_components) returned 4 components (Name,Transform,GlobalTransform,TransformTreeChanged); the original and a Ctrl+D copy had 53.After the fix: the menu copy has the same 53 components as the Ctrl+D copy (mesh,
PhysicsBodyData,CollisionShapeData, physics runtime state, custom reflected components) and survives save/reopen.cargo clippy --profile dist --no-deps -p renzora_hierarchy -- -D warnings -A clippy::too_many_arguments -A clippy::type_complexityis clean.