Beispiel #1
0
        /// <summary>
        /// Binds a scene to the InspectionView.
        /// </summary>
        /// <param name="scene">May be null, in this case the inspector remains disabled</param>
        public void SetSceneSource(Scene scene)
        {
            if (Scene == scene)
            {
                return;
            }

            Clear();
            Scene = scene;

            if (scene == null)
            {
                Enabled = false;
                return;
            }

            Enabled = true;

            Hierarchy = new HierarchyInspectionView(Scene, tabPageTree);
            Textures  = new TextureInspectionView(Scene, textureFlowPanel);
            if (Textures.Empty)
            {
                // disable the texture tab altogether if there are no textures
                // this would need to be changed if there was a way to add
                // new texture slots later on.
                tabControlInfoViewPicker.TabPages.Remove(tabPageTextures);
            }

            Animations = new AnimationInspectionView(Scene, tabPageAnimations);
            if (Animations.Empty)
            {
                // same for animations
                tabControlInfoViewPicker.TabPages.Remove(tabPageAnimations);
            }

            //
            Materials = new MaterialInspectionView(Scene, ParentForm as MainWindow, materialFlowPanel);
        }
Beispiel #2
0
        /// <summary>
        /// Binds a scene to the InspectionView.
        /// </summary>
        /// <param name="scene">May be null, in this case the inspector remains disabled</param>
        public void SetSceneSource(Scene scene)
        {
            if (Scene == scene)
            {
                return;
            }

            Scene = scene;
            if(scene == null)
            {
                Enabled = false;
                return;
            }

            Clear();

            Enabled = true;
            Hierarchy = new HierarchyInspectionView(Scene, tabPageTree);
            Textures = new TextureInspectionView(Scene, textureFlowPanel);
            if(Textures.Empty)
            {
                // Disable the texture tab altogether if there are no textures
                // This would need to be changed if there was a way to add 
                // new texture slots later on.
                tabControlInfoViewPicker.TabPages.Remove(tabPageTextures);
            }

            Animations = new AnimationInspectionView(Scene, tabPageAnimations);
            if (Animations.Empty)
            {
                // Same for animations.
                tabControlInfoViewPicker.TabPages.Remove(tabPageAnimations);
            }

            //
            Materials = new MaterialInspectionView(Scene, ParentForm as MainWindow, materialFlowPanel);
        }