Example #1
0
 void CalibrateGUI()
 {
     GUILayout.Label("A Calibration Preset helps track your face better!");
     if (GUILayout.Button("Create a Calibration Preset"))
     {
         FacePlusCalibrationWindow.Init();
         if (character)
         {
             GetWindow <FacePlusCalibrationWindow>().SetCharacter(character.gameObject);
         }
     }
     EditorGUILayout.Space();
     Divider();
 }
Example #2
0
        void OnGUI()
        {
            GUILayout.BeginHorizontal();
            GUILayout.Label("Fuse Character GameObject:", GUILayout.Width(200));
            var input = EditorGUILayout.ObjectField(charOBJ, typeof(GameObject), true, GUILayout.ExpandWidth(true));

            if (input != null && PrefabUtility.GetPrefabType(input) == PrefabType.ModelPrefab)
            {
                charOBJ = Instantiate(input) as GameObject;
            }
            else
            {
                charOBJ = (GameObject)input;
            }
            //charOBJ = (GameObject) EditorGUILayout.ObjectField (charOBJ, typeof(GameObject), true, GUILayout.ExpandWidth(true));
            GUILayout.EndHorizontal();
            EditorGUILayout.Space();

            GUILayout.Label(warningText);

            Color defaultCol = GUI.skin.label.normal.textColor;

            if (configured || !triedToConfigure)
            {
                AutoConfigGUI();
            }

            if (!configured && triedToConfigure)
            {
                GUI.skin.label.normal.textColor = errorColor;
                GUILayout.Label("Darn! Couldn't find the following things in your rig. Try specifying them below");
                GUI.skin.label.normal.textColor = defaultCol;
                EditorGUILayout.Space();
                if (!headJoint)
                {
                    GUILayout.Label("No head joint found in rig!");
                }
                if (!leftEye)
                {
                    GUILayout.Label("No left eye joint found in rig!");
                }
                if (!rightEye)
                {
                    GUILayout.Label("No right eye joint found in rig!");
                }
                if (!faceMesh)
                {
                    GUILayout.Label("No mesh with facial blendshapes found! For fuse characters this is the Body mesh");
                }
                EditorGUILayout.Space();

                ManualConfigGUI();
                GUI.skin.label.normal.textColor = defaultCol;
            }
            else if (triedToConfigure)
            {
                GUI.skin.label.normal.textColor = successColor;
                GUILayout.Label("Success!");
                GUI.skin.label.normal.textColor = defaultCol;
                EditorGUILayout.Space();
                GUILayout.Label("Calibrate Face Plus to for better tracking results!");
                if (GUILayout.Button("Create a Calibration Preset"))
                {
                    FacePlusCalibrationWindow.Init();
                    GetWindow <FacePlusCalibrationWindow>().SetCharacter(charOBJ);
                    this.Close();
                }
            }
        }
 public static void Init()
 {
     // Get existing open window or if none, make a new one
     FacePlusCalibrationWindow window = (FacePlusCalibrationWindow)EditorWindow
                                        .GetWindow(typeof(FacePlusCalibrationWindow), false, "FacePlus Preset Calibration");
 }