public MaterialThumbnailControl(MaterialInspectionView owner, Scene scene, Material material)
            : base(owner, GetBackgroundImage(), material.HasName ? material.Name : "Unnamed Material")
        {
            _owner    = owner;
            _scene    = scene;
            _material = material;

            _superSample = true;

            UpdatePreview();
            SetLoadingState();
        }
Esempio n. 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;
            }

            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);
        }