Log in or register to post comments

VuforiaBehavior Unable to set values properly via script

June 4, 2017 - 12:08am #1

Hello there,

I've been working on something for 3 days and I am at a dead-end. I've been trying to set VuforiaConfiguration automatically through a script once a scene starts via Awake() function.



I am able to edit the Configuration file easily this way:-

 

configFile.DigitalEyewear.EyewearType = DigitalEyewearARController.EyewearType.VideoSeeThrough;
configFile.DigitalEyewear.StereoFramework = DigitalEyewearARController.StereoFramework.Cardboard;

That sets Digital Eyewear to Video See-through and chooses Cardboard. Now, I want to specify the CentralAnchorPoint, Left Main Camera, and Right Main Camera of VuforiaBehavior script through the same code and I am unable to..I've checked VuforiaBehavior and CentralAnchorPoint, PrimaryCamera, and SecondaryCamera are "internal" getters.., but I've managed to do this tho;

 

DigitalEyewearARController.Instance.SetCentralAnchorPoint( GameObject.Find ("CardboardMain/Head").GetComponent<Transform>());
Debug.Log ("Head name is: " + DigitalEyewearARController.Instance.CentralAnchorPoint.name);
DigitalEyewearARController.Instance.PrimaryCamera = GameObject.Find ("CardboardMain/Head/Main Camera/Main Camera Left").GetComponent<Camera>();
Debug.Log ("Leftcam name is: " + DigitalEyewearARController.Instance.PrimaryCamera.name);
DigitalEyewearARController.Instance.SecondaryCamera = GameObject.Find ("CardboardMain/Head/Main Camera/Main Camera Right").GetComponent<Camera>();
Debug.Log ("Rightcam name is: " + DigitalEyewearARController.Instance.SecondaryCamera.name);

 

But, that does nothing..I still see null values on VuforiaBehavior script in the inspector like the following.





I'd really appreciate any help, Thanks in advance ^^

VuforiaBehavior Unable to set values properly via script

January 15, 2019 - 4:48pm #6

Hello,

Those APIs are still valid and are used in Engine SDK 8.0 samples.

Thanks,

Vuforia Engine Support

VuforiaBehavior Unable to set values properly via script

January 13, 2019 - 10:32pm #5

'RegisterVuforiaStartedCallback' and 'RegisterVuforiaStarted' both are giving the same error that there is no definition for it. Do you know of any new method to achieve the same goal?

VuforiaBehavior Unable to set values properly via script

June 8, 2017 - 12:12am #4

I also tried doing someting like this to see of anyting gonna change:-

VuforiaARController.Instance.SetWorldCenterMode (VuforiaARController.WorldCenterMode.SPECIFIC_TARGET);

But, my World Center Mode is still "CAMERA". which means nothing updates VuforiaBehavior script.

 

VuforiaBehavior Unable to set values properly via script

June 6, 2017 - 12:23pm #3

Hello,

Thank you for your reply.

"RegisterVuforiaStarted" was giving me an error that VuforiaARController doesn't contain a definition for it, so I used "RegisterVuforiaStartedCallback". But it's still not working ;/

VuforiaBehavior Unable to set values properly via script

June 5, 2017 - 6:11pm #2

Try registering OnVuforiaStarted() callback and moving your code into that.

https://library.vuforia.com/reference/api/unity/classVuforia_1_1VuforiaARController.html

void Start()
{
    VuforiaARController.Instance.RegisterVuforiaStarted(OnVuforiaStarted);
}

void OnVuforiaStarted()
{
    // put code here
}

 

Log in or register to post comments