Beispiel #1
0
 protected override void OnRender(SceneScreen screen)
 {
     foreach (SceneScreen.Mesh mesh in Meshes)
     {
         screen.RenderMesh(mesh, WorldTransform);
     }
 }
 private void SceneEditor_Shown(object sender, EventArgs e)
 {
     foreach (KeyValuePair <string, SceneEvent> Event in SceneScreen.LoadAllSceneEvents())
     {
         ToolStripMenuItem tsmNewItem = new ToolStripMenuItem(Event.Value.SceneEventType);
         tsmNewItem.Tag    = Event.Value;
         tsmNewItem.Click += tsmNewItem_Click;
         cmsSceneEvents.Items.Add(tsmNewItem);
     }
 }
        private void LoadScene(string ScenePath)
        {
            string Name = ScenePath.Substring(0, ScenePath.Length - 4).Substring(15);

            this.Text = Name + " - Project Eternity Scene Editor";

            LoadedScene = new SceneScreen(Name);
            LoadedScene.Load();

            PropertiesDialog.txtMaxSceneEvent.Value = LoadedScene.MaxSceneEvent;

            ScenePreviewViewer.Preload(LoadedScene);
            SceneTimelineViewer.Preload(LoadedScene);
        }
Beispiel #4
0
        public OctreeModelSceneNode(SceneScreen screen, Drome.Objects.OctreeModel model) : base(screen, model, model.Physics)
        {
            this.OctreeModel = model;

            if (OctreeModel.VOMFilename == "")
            {
                return;
            }

            try
            {
                using (System.IO.MemoryStream ms = new System.IO.MemoryStream(Program.Filesystem.GetFileData(Program.Filesystem.GetFileEntry(OctreeModel.VOMFilename))))
                    using (System.IO.BinaryReader reader = new System.IO.BinaryReader(ms))
                    {
                        VOMFile = new VOMFile(reader);

                        List <SceneScreen.RenderTexture> textures = new List <SceneScreen.RenderTexture>();
                        foreach (TextureReference texref in VOMFile.BitmapIndices)
                        {
                            textures.Add(screen.LoadTextureReference(texref));
                        }

                        //VOMFile.ExportOBJ("vom.obj");
                        foreach (RenderGroup rg in VOMFile.RenderGroups)
                        {
                            SceneScreen.Mesh mesh      = new SceneScreen.Mesh(screen.Renderer.D3DDevice, rg);
                            TextureBlend     baseBlend = rg.TextureBlends.First(b => b.Effect == Texture.MapType.Base);
                            if (baseBlend.TextureIndex < textures.Count)
                            {
                                mesh.DiffuseTexture = textures[baseBlend.TextureIndex];
                            }
                            else
                            {
                                System.Diagnostics.Debug.WriteLine("ERROR: TextureBlend.TextureIndex out of range!");
                                mesh.DiffuseTexture = new SceneScreen.RenderTexture(screen.GetTexture("__error"));
                            }
                            Meshes.Add(mesh);
                        }
                    }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("Exception loading octree file: " + OctreeModel.VOMFilename);
            }
        }
 public void Preload(SceneScreen Scene)
 {
     this.Scene = Scene;
     OnCreateControl();
 }