Skip to content

Commit

Permalink
fix(Runtime): FaceTrackingSystem Correctives now optional
Browse files Browse the repository at this point in the history
Summary: The correctives field of `FaceTrackingSystem.cs` should be optional because not everyone will have a correctives file on-hand.

Reviewed By: andkim-meta

Differential Revision: D42488038

fbshipit-source-id: 2095b151acee61cac1f437c7218c15b0db767508
  • Loading branch information
sohailshafiiWk authored and facebook-github-bot committed Jan 12, 2023
1 parent f8bdd9f commit 213d5b0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Runtime/Scripts/Tooltips.cs
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ public static class FaceTrackingSystemTooltips
"OVR face expressions component.";

public const string CorrectiveShapesDriver =
"Corrective shapes driver component.";
"Optional corrective shapes driver component.";

public const string BlendshapeModifier =
"Optional blendshape modifier component.";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@ public class FaceTrackingSystem : MonoBehaviour
protected OVRFaceExpressions _ovrFaceExpressions;

/// <summary>
/// Corrective shapes driver component.
/// Optional corrective shapes driver component.
/// </summary>
[SerializeField]
[Optional]
[Tooltip(FaceTrackingSystemTooltips.CorrectiveShapesDriver)]
protected CorrectiveShapesDriver _correctiveShapesDriver;

Expand All @@ -43,7 +44,7 @@ public class FaceTrackingSystem : MonoBehaviour
protected BlendshapeModifier _blendshapeModifier;

/// <summary>
/// If true, the corrective driver will run and apply correctives.
/// If true, the correctives driver will apply correctives.
/// </summary>
public bool CorrectivesEnabled { get; set; }

Expand All @@ -61,7 +62,6 @@ private void Awake()
{
Assert.IsNotNull(_blendShapeMapping);
Assert.IsNotNull(_ovrFaceExpressions);
Assert.IsNotNull(_correctiveShapesDriver);
ExpressionWeights = new float[(int)OVRFaceExpressions.FaceExpression.Max];

CorrectivesEnabled = true;
Expand All @@ -82,7 +82,7 @@ private void Update()
UpdateAllMeshesUsingFaceTracking();
}

if (CorrectivesEnabled)
if (CorrectivesEnabled && _correctiveShapesDriver != null)
{
_correctiveShapesDriver.ApplyCorrectives();
}
Expand Down

0 comments on commit 213d5b0

Please sign in to comment.