public static pb_Smoothing_Editor Init(pb_Texture_Editor del, pb_Object[] _selection)
    {
        pb_Smoothing_Editor pse = (pb_Smoothing_Editor)EditorWindow.GetWindow(typeof(pb_Smoothing_Editor), true, "Smoothing Groups", true);

        pse.SetDelegate(del);
        pse.UpdateSelection(_selection);
        return(pse);
    }
Beispiel #2
0
    public void OnSelectionUpdate(pb_Object[] sel)
    {
        uv_selection.Clear();

        // Cache all selected UV settings
        for (int i = 0; i < sel.Length; i++)
        {
            foreach (pb_Face q in sel[i].SelectedFaces)
            {
                uv_selection.Add(q.uv);
            }
        }

        UpdateDiffDictionary();

        if (selection != null && selection.Length > 0)
        {
            if (selection[0].SelectedFaces.Length > 0)
            {
                uv_gui = selection[0].SelectedFaces[0].uv;

                currentMat = selection[0].SelectedFaces[0].material;

                if (queuedMat == null)
                {
                    queuedMat = currentMat;
                }
            }
        }
        else
        {
            currentMat = null;
        }

        selection = sel;
        if (pb_Editor.instanceIfExists)
        {
            SelectedFacesInEditZone = pb_Editor.instanceIfExists.SelectedFacesInEditZone;
        }

        if (smoothingEditor)
        {
            smoothingEditor.UpdateSelection(selection);
        }
    }