Exemple #1
0
            public override bool Inspect()
            {
                var changed = false;

                var br = InspectedBrush;

                if (InspectAdvanced || Cfg.useGridForBrush)
                {
                    "Paint On Grid".toggleIcon(ref Cfg.useGridForBrush, true).nl();
                }

                if (!br.useAlphaBuffer && (br.worldSpaceBrushPixelJitter || InspectAdvanced))
                {
                    "One Pixel Jitter".toggleIcon(ref br.worldSpaceBrushPixelJitter).changes(ref changed);
                    "Will provide a single pixel jitter which can help fix seams not being painted properly"
                    .fullWindowDocumentationClickOpen("Why use one pixel jitter?");
                    pegi.nl();
                }

                if (InspectedPainter && !InspectedPainter.GetMesh())
                {
                    "No mesh for sphere painting detected.".writeWarning();
                }

                base.Inspect().nl(ref changed);

                return(changed);
            }
Exemple #2
0
            public override bool Inspect()
            {
                var changed = false;

                var br = InspectedBrush;

                bool suggestGrid = false;

                if (InspectedPainter && !InspectedPainter.GetMesh())
                {
                    if (!Cfg.useGridForBrush)
                    {
                        "No mesh for sphere painting detected.".writeWarning();
                        suggestGrid = true;
                    }
                }

                if (InspectAdvanced || Cfg.useGridForBrush || suggestGrid)
                {
                    (Cfg.useGridForBrush
                        ? ("Grid: Z, X - change plane " + Environment.NewLine + " Ctrl+LMB - reposition GRID")
                        : "Paint On Grid").toggleIcon(ref Cfg.useGridForBrush).nl();

                    pegi.line();
                    pegi.nl();
                }

                if (!br.useAlphaBuffer && (br.worldSpaceBrushPixelJitter || InspectAdvanced))
                {
                    "One Pixel Jitter".toggleIcon(ref br.worldSpaceBrushPixelJitter).changes(ref changed);
                    "Will provide a single pixel jitter which can help fix seams not being painted properly"
                    .fullWindowDocumentationClickOpen("Why use one pixel jitter?");
                    pegi.nl();
                }



                base.Inspect().nl(ref changed);

                return(changed);
            }
Exemple #3
0
        public override bool ConfigTab_PEGI()
        {
            bool changed = false;

            if (InspectedPainter.IsAtlased())
            {
                "***** Selected Material Atlased *****".nl();
#if UNITY_EDITOR
                var m = InspectedPainter.GetMesh();
                if (m != null && AssetDatabase.GetAssetPath(m).Length == 0)
                {
                    "Atlased Mesh is not saved".nl();
                    var n = m.name;
                    if ("Mesh Name".edit(80, ref n))
                    {
                        m.name = n;
                    }
                    if (icon.Save.Click().nl())
                    {
                        InspectedPainter.SaveMesh();
                    }
                }
#endif


                var atlPlug = InspectedPainter.GetPlugin <TileableAtlasingPainterPlugin>();

                if ("Undo Atlasing".Click())
                {
                    InspectedPainter.meshRenderer.sharedMaterials = atlPlug.preAtlasingMaterials;

                    if (atlPlug.preAtlasingMesh != null)
                    {
                        InspectedPainter.meshFilter.mesh = atlPlug.preAtlasingMesh;
                    }
                    InspectedPainter.SavedEditableMesh = atlPlug.preAtlasingSavedMesh;

                    atlPlug.preAtlasingMaterials = null;
                    atlPlug.preAtlasingMesh      = null;
                    InspectedPainter.meshRenderer.sharedMaterial.DisableKeyword(PainterDataAndConfig.UV_ATLASED);
                }

                if ("Not Atlased".Click().nl())
                {
                    atlPlug.preAtlasingMaterials = null;
                    InspectedPainter.meshRenderer.sharedMaterial.DisableKeyword(PainterDataAndConfig.UV_ATLASED);
                }

                pegi.newLine();
            }
            else if ("Atlased Materials".foldout(ref showAtlasedMaterial).nl())
            {
                showAtlases = false;
                changed    |= atlasedMaterials.edit_List(ref InspectedPainter.selectedAtlasedMaterial, true).nl();
            }

            if ("Atlases".foldout(ref showAtlases))
            {
                if ((browsedAtlas > -1) && (browsedAtlas >= atlases.Count))
                {
                    browsedAtlas = -1;
                }

                pegi.newLine();

                atlases.edit_List(ref browsedAtlas, true);
            }

            return(changed);
        }