/// <summary>
        /// Creates a new model component proxy.
        /// </summary>
        private DaggerfallModelProxy AddModelProxy(EntityProxy parent, uint id)
        {
            // Create new model
            DaggerfallModelComponent model = new DaggerfallModelComponent(worldControl.Core, id);

            // Create proxy for component
            DaggerfallModelProxy modelProxy = new DaggerfallModelProxy(sceneDocument, parent, model);

            // Add new proxy to tree view
            TreeNode node = AddTreeNode(parent.TreeNode, modelProxy);

            return(modelProxy);
        }
        /// <summary>
        /// Called when a new Daggerfall model is requested.
        /// </summary>
        private void AddDaggerfallModelMenuItem_Click(object sender, EventArgs e)
        {
            // Get selected entity
            EntityProxy entity = GetSelectedEntity();

            if (entity == null)
            {
                return;
            }

            // Add model
            DaggerfallModelProxy modelProxy = AddModelProxy(entity, defaultModelId);
        }
        /// <summary>
        /// Builds a default scene document.
        /// </summary>
        private void CreateDefaultDocument()
        {
            // Lock stacks
            sceneDocument.LockUndoRedo = true;

            // Set camera position
            sceneDocument.EditorScene.Camera.Position = new Vector3(0, 2, 50);
            sceneDocument.EditorScene.Camera.Update();

            // Add lighting rig
            AddDefaultLightingRig();

            // Create entities
            EntityProxy entityProxy = AddEntityProxy();

            // Add sphere primitive component
            SphereProxy sphereProxy = AddSphereProxy(entityProxy);

            sphereProxy.Position = new Vector3(0, 0.5f, 0);

            // Add model component
            DaggerfallModelProxy modelProxy = AddModelProxy(entityProxy, 456);

            // Add quad terrain component
            QuadTerrainProxy terrainProxy = AddQuadTerrainComponentProxy(entityProxy);

            terrainProxy.Position       = new Vector3(-1024f, 0, -1024f);
            terrainProxy.Scale          = new Vector3(4, 0.16f, 4);
            terrainProxy.TextureRepeat  = 100f;
            terrainProxy.NormalStrength = 0.01f;

            // Expand nodes
            documentProxy.TreeNode.Expand();
            entityProxy.TreeNode.Expand();

            // Unlock stacks
            sceneDocument.LockUndoRedo = false;
        }