Exemple #1
0
        public static void ExportObjectsFromScene(Window window = null)
        {
            try
            {
                RSDKv5.Scene sourceScene = GetSceneForObjectImporting(window);
                if (sourceScene == null)
                {
                    return;
                }

                SaveFileDialog saveFileDialog = new SaveFileDialog()
                {
                    Filter = "Exported TXT | *.txt",
                    Title  = "Save Exported Results As..."
                };
                if (saveFileDialog.ShowDialog() == DialogResult.OK)
                {
                    Methods.Entities.ObjectCollection.ExportObjectsFromSceneToFile(saveFileDialog.FileName, sourceScene.Objects, Methods.Solution.CurrentSolution.CurrentScene.Entities.SceneObjects);
                }
            }
            catch (Exception ex)
            {
                System.Windows.MessageBox.Show("Unable to export Objects. " + ex.Message);
            }
        }
Exemple #2
0
        public static void ImportObjectsFromScene(Window window = null)
        {
            try
            {
                RSDKv5.Scene sourceScene = GetSceneForObjectImporting(window);
                if (sourceScene == null)
                {
                    return;
                }
                var objectImporter = new ObjectImporter(sourceScene.Objects, Methods.Solution.CurrentSolution.CurrentScene.Entities.SceneObjects, Methods.Solution.CurrentSolution.StageConfig, Editor);
                if (window != null)
                {
                    objectImporter.Owner = window;
                }
                objectImporter.ShowDialog();

                if (objectImporter.DialogResult != true)
                {
                    return; // nothing to do
                }
                // user clicked Import, get to it!
                Methods.Internal.UserInterface.UpdateControls();
                Editor.EntitiesToolbar?.RefreshSpawningObjects(Methods.Solution.CurrentSolution.CurrentScene.Entities.SceneObjects);
                Methods.Internal.UserInterface.SplineControls.UpdateSplineSpawnObjectsList(Methods.Solution.CurrentSolution.CurrentScene.Entities.SceneObjects);
            }
            catch (Exception ex)
            {
                System.Windows.MessageBox.Show("Unable to import Objects. " + ex.Message);
            }
        }
 public EditorEntities(RSDKv5.Scene scene)
 {
     foreach (var obj in scene.Objects)
     {
         entities.AddRange(obj.Entities.Select(x => GenerateEditorEntity(x)));
     }
     FindDuplicateIds();
     entitiesBySlot = entities.ToDictionary(x => x.Entity.SlotID);
 }