Esempio n. 1
0
        private void refreshToolStripMenuItem_Click(object sender, EventArgs e)
        {
            //      Find the attached preview items and invalidate
            var n = ShaderFragmentNodeUtil.GetShaderFragmentNode(graphControl, AttachedId(sender));

            if (n != null)
            {
                foreach (NodeItem i in n.Items)
                {
                    if (i is ShaderFragmentPreviewItem)
                    {
                        ((ShaderFragmentPreviewItem)i).InvalidateShaderStructure();
                    }
                }
            }
        }
Esempio n. 2
0
        private void largePreviewToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var n = ShaderFragmentNodeUtil.GetShaderFragmentNode(graphControl, AttachedId(sender));

            if (n != null)
            {
                var nodeId = ((ShaderFragmentNodeTag)n.Tag).Id;

                // generate a preview builder for this specific node...
                var nodeGraph = ModelConversion.ToShaderPatcherLayer(graphControl);
                var shader    = ShaderPatcherLayer.NodeGraph.GeneratePreviewShader(nodeGraph, nodeId);
                var builder   = PreviewRender.Manager.Instance.CreatePreview(shader);

                // create a "LargePreview" window
                new LargePreview(builder, _document).Show();
            }
        }