editor: parented duplication fix #389
This commit is contained in:
+11
-3
@@ -1441,10 +1441,12 @@ void EditorComponent::Update(float dt)
|
||||
EntitySerializer seri;
|
||||
clipboard.SetReadModeAndResetPos(false);
|
||||
clipboard << prevSel.size();
|
||||
translator.PreTranslate();
|
||||
for (auto& x : prevSel)
|
||||
{
|
||||
scene.Entity_Serialize(clipboard, seri, x);
|
||||
}
|
||||
translator.PostTranslate();
|
||||
|
||||
if (wi::input::Press((wi::input::BUTTON)'X'))
|
||||
{
|
||||
@@ -1486,16 +1488,22 @@ void EditorComponent::Update(float dt)
|
||||
RecordSelection(archive);
|
||||
|
||||
auto& prevSel = translator.selectedEntitiesNonRecursive;
|
||||
ClearSelected();
|
||||
|
||||
translator.PreTranslate();
|
||||
wi::vector<Entity> addedEntities;
|
||||
for (auto& x : prevSel)
|
||||
{
|
||||
wi::scene::PickResult picked;
|
||||
picked.entity = scene.Entity_Duplicate(x);
|
||||
AddSelected(picked);
|
||||
addedEntities.push_back(picked.entity);
|
||||
}
|
||||
translator.PostTranslate();
|
||||
|
||||
ClearSelected();
|
||||
|
||||
for (auto& x : addedEntities)
|
||||
{
|
||||
AddSelected(x);
|
||||
}
|
||||
|
||||
RecordSelection(archive);
|
||||
RecordAddedEntity(archive, addedEntities);
|
||||
|
||||
Reference in New Issue
Block a user