Closed yosun closed 3 years ago
ARKit Anchors typically are not removed until either explicitly removed (if user created) or the session is reset and in the ARKit plugin we only report an anchor as removed if it is no longer being reported by ARKit. In this case, ARKit maintains an understanding of the face even when the face itself isn't tracking. You can see this in ARFoundation by capturing the fc.updated
list of ARFace
s and checking the tracking state. When a face leaves the frame then the tracking state will report as None
but ARKit will report the same face trackableId
when that face moves back into frame.
Closing this issue. If you have more questions then please feel free to respond here.
Hi @yosun - I had reopened this old issue because you claimed that fc.added.Count
was never non-zero. That should not be the case, so I wanted to investigate. I tried to reproduce this in 2019.4 using the latest verified 2.1 packages (ARFoundation 2.1.8, ARKit 2.1.9, ARKit Face Tracking 1.0.7) with this script:
using UnityEngine;
using UnityEngine.XR.ARFoundation;
[RequireComponent(typeof(ARFaceManager))]
public class LogNumberOfFaces : MonoBehaviour
{
void Start() => GetComponent<ARFaceManager>().facesChanged += OnFaceChanged;
void OnFaceChanged(ARFacesChangedEventArgs eventArgs)
{
if (eventArgs.added.Count > 0)
{
Debug.Log($"{eventArgs.added.Count} faces added.");
}
}
}
As soon as my face is visible, the app prints "1 faces added." Unless it detects another face, it will not report an added face. Can you provide more details or a repro project? Or is this no longer an issue for you?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Unity bug report case number Please log a bug at https://unity3d.com/unity/qa/bug-reporting and post the case number here.
Describe the bug When subscribed to ARFaceManager facesChanged action, it seems ARFacesChangedEventArgs added and removed always 0 even when a face is added or removed
To Reproduce Steps to reproduce the behavior:
Expected behavior When a face is added or removed, fc.added.Count and fc.removed.Count should reflect non-zero numbers
Actual behavior When a face is added or removed, fc.added.Count and fc.removed.Count current maintains 0
Smartphone (please complete the following information):