Search Unity

How do I access Face Capture components (TakeRecorder & ARKitFaceDevice) in script?

Discussion in 'Virtual Production' started by DanRP, May 17, 2022.

  1. DanRP

    DanRP

    Joined:
    May 26, 2013
    Posts:
    33
    Hello,

    I'm trying to access the following components in script: TakeRecorder & ARKitFaceDevice

    According to the documentation,TakeRecorder resides in the Unity.LiveCapture namespace, however, I am unable to access this namespace in a "using" statement. It doesn't appear to exist for me.

    I'm not sure what namespace ARKitFaceDevice belongs to.

    Can anyone shed some light on how to access these 2 components in script?
     
  2. fffMalzbier

    fffMalzbier

    Joined:
    Jun 14, 2011
    Posts:
    3,276
  3. DanRP

    DanRP

    Joined:
    May 26, 2013
    Posts:
    33
    Here's an update on this issue:

    Just to reiterate: The problem I was having is that, after adding the Live Capture package to my project, I was unable to add "using Unity.LiveCapture" to the top of my scripts. It would give me an error message saying something like "namespace LiveCapture does not exist under Unity". Since I was unable to add the "using" clause, I was unable to reference the relevant objects such as TakeRecorder and FaceActor.

    I found this work around which doesn't make sense to me: I installed the Live Capture Sample project from the Package Manager. Then I loaded the sample scene. Then I created a test script and was able to successfully add "using Unity.LiveCapture" to the top of my scripts. Then I loaded my original scene and was then also able to add "using Unity.LiveCapture" and start referencing the live capture object.

    It doesn't make sense, but it worked. I hope this helps someone.
     
    fffMalzbier likes this.
  4. ScottSewellUnity

    ScottSewellUnity

    Unity Technologies

    Joined:
    Jan 29, 2020
    Posts:
    20
    Hey! I suspect you are trying to reference the Unity.LiveCapture assembly, but have not added a reference to it in the asmdef the script you are writing belongs to. The reason you can reference it in a test script is that the Unity.LiveCapture assembly is automatically referenced by scripts not included under an asmdef.
     
  5. Qleenie

    Qleenie

    Joined:
    Jan 27, 2019
    Posts:
    867
    I personally think that the access rights for this package are way to restrictive. I needed to implement an own FaceMapper, as I don't use SkinnedMeshRenderer. The only way I was able to resolve was by copying all scripts into my project and changing access rights.
     
  6. Sergi_Valls

    Sergi_Valls

    Unity Technologies

    Joined:
    Dec 2, 2016
    Posts:
    212
    We will make DefaultFaceMapper public and overridable in 3.x. Hopefully this will help.
     
    marc_tanenbaum and Qleenie like this.
  7. wartron

    wartron

    Joined:
    Jan 23, 2015
    Posts:
    8
    Im kinda in the same boat i think. basicly i need all com.unity.live-capture@1.1.0 classes to be public.

    I think it should be as simple as copying the files, throwing in a new namespace and just making them public. but idk really
     
  8. CETechnology

    CETechnology

    Joined:
    Apr 14, 2022
    Posts:
    4
    (...resurrecting a year-old thread...)

    I agree that the LiveCapture classes should be more open. For example, I want to use facial expressions from LiveCapture but when the character is speaking I want to use Oculus Lipsync to control the mouth. Right now the two systems are fighting with each other and it looks bad.

    I'd like be able to set the multiplier value to zero for mouth-related blendshapes when speech is detected (so the lipsync has full control of the mouth when the character is speaking), but there's no way to access it. :(