Search Unity

VuforiaBehaviour.Instance.enabled = true doesn't automatically reinitialize trackers

Discussion in 'Vuforia' started by spvn, Jun 21, 2018.

  1. spvn

    spvn

    Joined:
    Dec 10, 2013
    Posts:
    80
    I'm trying to re-initialize vuforia using VuforiaBehaviour.Instance.enabled = true as has been suggested many times in this forum. However, on doing so it doesn't seem to automatically reinitialize everything else like trackers/smart terrain/etc.

    Also, the callback registered using VuforiaARController.Instance.RegisterVuforiaStartedCallback doesn't fire on re-initialization either.

    How am I supposed to properly reinitialise the vuforia and all its components?
     
  2. imrev

    imrev

    Joined:
    Jan 17, 2018
    Posts:
    2
    I have a similar issue, as after I do a disable/re-enable the targets are not recognised anymore. I need to take some pictures with the Hololens in the same scene between target recognitions.
    I tried both
    VuforiaBehaviour.Instance.enabled=false;
    ...
    VuforiaBehaviour.Instance.enabled=true;

    and

    CameraDevice.Instance.Stop();
    CameraDevice.Instance.Deinit();
    ...
    CameraDevice.Instance.Init(CameraDevice.CameraDirection.CAMERA_DEFAULT);
    CameraDevice.Instance.Start();

    Did anyone manage to find a suitable solution?
     
  3. imrev

    imrev

    Joined:
    Jan 17, 2018
    Posts:
    2
    To rectify, after making sure that the disposal of everything camera related was finished,



    CameraDevice.Instance.Stop();

    CameraDevice.Instance.Deinit();

    ...[take photo with the Hololens]

    CameraDevice.Instance.Init(CameraDevice.CameraDirection.CAMERA_DEFAULT);

    CameraDevice.Instance.Start();



    worked as expected.
     
    gnsx likes this.