void OnGUI() { GUILayout.BeginHorizontal(); GUILayout.Label("Select character to use for calibration:", GUILayout.Width(200)); charOBJ = (GameObject)EditorGUILayout.ObjectField(charOBJ, typeof(GameObject), true, GUILayout.ExpandWidth(true)); GUILayout.EndHorizontal(); if (!charOBJ) { return; } shaper = charOBJ.GetComponent <FacePlusShaper>(); if (charOBJ && (!shaper || !charOBJ.GetComponent <FacePlusConnector>())) { GUILayout.Label("Character does not have FacePlusShaper and/or FacePlusConnector component!"); return; } EditorGUILayout.Space(); //TODO: check if tracking is already happening and use the tracked character. if (isTracking) { CaptureGUI(); } else { OfflineGUI(); } }
bool ConfigureFuseCharacter() { //TODO: check if character already configured //TODO: be able to get char properties by user input. if (!leftEye || !rightEye) { warningText = "No left eye or right eye joint found! That's ok though."; } if (!headJoint || /* !leftEye || !rightEye || */ !faceMesh) { return(false); } //Add appropriate components fpConnector = charOBJ.GetComponent <FacePlusConnector>() ? charOBJ.GetComponent <FacePlusConnector>() : charOBJ.AddComponent <FacePlusConnector>(); fpConnector.Type = FacePlusConnector.RigType.BlendShape; fpConnector.HeadJoint = headJoint; fpConnector.LeftEyeTransform = leftEye; fpConnector.RightEyeTransform = rightEye; fpConnector.FaceMesh = faceMesh; fpShaper = charOBJ.GetComponent <FacePlusShaper>() ? charOBJ.GetComponent <FacePlusShaper>() : charOBJ.AddComponent <FacePlusShaper>(); fpExtraBlendshapes = charOBJ.GetComponent <FacePlusExtras_MoreBlendshapeMeshes>() ? charOBJ.GetComponent <FacePlusExtras_MoreBlendshapeMeshes>() : charOBJ.AddComponent <FacePlusExtras_MoreBlendshapeMeshes>(); fpExtraBlendshapes.FaceMesh = faceMesh; fpExtraBlendshapes.ExtraBlendshapeMeshes = extraMeshes; /* smooth head rotation is broked, let's not use it for now! * * fpSmoothHeadRot = charOBJ.GetComponent<FacePlusExtras_SmoothHeadRotation>() ? charOBJ.GetComponent<FacePlusExtras_SmoothHeadRotation>() * : charOBJ.AddComponent<FacePlusExtras_SmoothHeadRotation>(); * fpSmoothHeadRot.HeadJoint = headJoint; */ return(true); }
bool ConfigureFuseCharacter() { //TODO: check if character already configured //TODO: be able to get char properties by user input. if(!leftEye || !rightEye) warningText = "No left eye or right eye joint found! That's ok though."; if(!headJoint ||/* !leftEye || !rightEye || */!faceMesh) return false; //Add appropriate components fpConnector = charOBJ.GetComponent<FacePlusConnector>() ? charOBJ.GetComponent<FacePlusConnector>() : charOBJ.AddComponent<FacePlusConnector>(); fpConnector.Type = FacePlusConnector.RigType.BlendShape; fpConnector.HeadJoint = headJoint; fpConnector.LeftEyeTransform = leftEye; fpConnector.RightEyeTransform = rightEye; fpConnector.FaceMesh = faceMesh; fpShaper = charOBJ.GetComponent<FacePlusShaper>() ? charOBJ.GetComponent<FacePlusShaper>() : charOBJ.AddComponent<FacePlusShaper>(); fpExtraBlendshapes = charOBJ.GetComponent<FacePlusExtras_MoreBlendshapeMeshes>() ? charOBJ.GetComponent<FacePlusExtras_MoreBlendshapeMeshes>() : charOBJ.AddComponent<FacePlusExtras_MoreBlendshapeMeshes>(); fpExtraBlendshapes.FaceMesh = faceMesh; fpExtraBlendshapes.ExtraBlendshapeMeshes = extraMeshes; /* smooth head rotation is broked, let's not use it for now! fpSmoothHeadRot = charOBJ.GetComponent<FacePlusExtras_SmoothHeadRotation>() ? charOBJ.GetComponent<FacePlusExtras_SmoothHeadRotation>() : charOBJ.AddComponent<FacePlusExtras_SmoothHeadRotation>(); fpSmoothHeadRot.HeadJoint = headJoint; */ return true; }
void OnGUI() { GUILayout.BeginHorizontal (); GUILayout.Label ("Select character to use for calibration:", GUILayout.Width (200)); charOBJ = (GameObject) EditorGUILayout.ObjectField (charOBJ, typeof(GameObject), true, GUILayout.ExpandWidth(true)); GUILayout.EndHorizontal (); if(!charOBJ) return; shaper = charOBJ.GetComponent<FacePlusShaper>(); if(charOBJ && (!shaper || !charOBJ.GetComponent<FacePlusConnector>())){ GUILayout.Label("Character does not have FacePlusShaper and/or FacePlusConnector component!"); return; } EditorGUILayout.Space (); //TODO: check if tracking is already happening and use the tracked character. if(isTracking) CaptureGUI(); else OfflineGUI(); }