Browse Source

Copy/Paste updates

Josh Engebretson 10 years ago
parent
commit
3afb0a8284
1 changed files with 7 additions and 3 deletions
  1. 7 3
      Source/AtomicEditor/Editors/SceneEditor3D/SceneSelection.cpp

+ 7 - 3
Source/AtomicEditor/Editors/SceneEditor3D/SceneSelection.cpp

@@ -104,8 +104,11 @@ void SceneSelection::Paste()
 
     Node* parent = scene_;
 
-    if (nodes_.Size() == 1)
-        parent = nodes_[0];
+    if (nodes_.Size() >= 1)
+        parent = nodes_[0]->GetParent();
+
+    if (!parent)
+        parent = scene_;
 
     Clear();
 
@@ -120,8 +123,9 @@ void SceneSelection::Paste()
 
         Matrix3x4 transform = clipNode->GetWorldTransform();
 
-        parent->AddChild(clipNode);
         clipNode->SetWorldTransform(transform.Translation(), transform.Rotation(), transform.Scale());
+        parent->AddChild(clipNode);
+
 
         // clone
         newClipBoardNodes.Push(SharedPtr<Node>(clipNode->Clone()));