David Prieto
David Prieto

Reputation: 2299

How to build Vuforia Unity project as a Windows PC Standalone app?

I have this app on Vuforia for Unity, but when I build it for Windows (as an .exe) it doesn't even opens the camera.

There has to be a way because you can test the aplication inside Unity on Windows.

EDIT:

I have been searching solutions on the subject and it turns out that someone solved the problem, but it charges $250 for the plugin he developed.

For what I can tell of the demo he offers what the plugin does is search for available web cams and let the user select one, then just activates it.

The idea behind this hack is just fool vuforia into thinking that is inside Unity's Play Mode, instead of an stand alone app.

Does anybody has an idea how to accomplish this?

There is nothing particullary special about Unity Play Mode, it just run the scene you are working inside Unity's editor, and Vuforia is already program to work with that. In fact, the only script that triggers Play Mode in vuforia is inside VuforiaBehaviour.cs:

else if (VuforiaRuntimeUtilities.IsPlayMode())
    unityPlayer = new PlayModeUnityPlayer();

Full script:

using UnityEngine;

namespace Vuforia
{
    /// <summary>
    /// The VuforiaBehaviour class handles tracking and triggers native video
    /// background rendering. The class updates all Trackables in the scene.
    /// </summary>
    public class VuforiaBehaviour : VuforiaAbstractBehaviour
    {
        protected override void Awake()
        {
            IUnityPlayer unityPlayer = new NullUnityPlayer();

            // instantiate the correct UnityPlayer for the current platform
            if (Application.platform == RuntimePlatform.Android)
                unityPlayer = new AndroidUnityPlayer();
            else if (Application.platform == RuntimePlatform.IPhonePlayer)
                unityPlayer = new IOSUnityPlayer();
            else if (VuforiaRuntimeUtilities.IsPlayMode())
                unityPlayer = new PlayModeUnityPlayer();

            SetUnityPlayerImplementation(unityPlayer);

            gameObject.AddComponent<ComponentFactoryStarterBehaviour>();

            base.Awake();
        }

        private static VuforiaBehaviour mVuforiaBehaviour= null;

        /// <summary>
        /// A simple static singleton getter to the VuforiaBehaviour (if present in the scene)
        /// Will return null if no VuforiaBehaviour has been instanciated in the scene.
        /// </summary>
        public static VuforiaBehaviour Instance
        {
            get
            {
                if (mVuforiaBehaviour == null)
                    mVuforiaBehaviour = FindObjectOfType<VuforiaBehaviour>();

                return mVuforiaBehaviour;
            }
        }
    }
}

I have tried to alter this but it doesn't work, and I think is because the program doesn't now what camera to use. How can I force this script to use an integrated webcam?

I won't let go this issue.

Upvotes: 1

Views: 10076

Answers (4)

android6p
android6p

Reputation: 81

I had the same problem however there is a possibility for windows 10. What you can do is set : windows store as the platform in unity build settings and also download visual studio 2017. Make sure you have universal windows platform development installed as well which you can check on the visual studio installer. Once all this is setup you can build the app from visual studio and also create an app package that will run on windows 10 desktop. Refer to this link on how to build for windows 10 : https://blogs.windows.com/buildingapps/2016/10/12/how-to-develop-augmented-reality-apps-with-vuforia-for-windows-10/#om4WrsBhgs8u87hs.97

Upvotes: 1

Ontario
Ontario

Reputation: 86

Vuforia only supports phones, devices and HMDs: http://vuforia.com/Devices

This discussion makes it look like a licensing issue, where StudierStube retains rights to desktop implementations.

Upvotes: 1

CV Lab
CV Lab

Reputation: 11

it's been discussed here - Vuforia augment reality windows

There is no official solution to build standalone apps.

Upvotes: 1

Everts
Everts

Reputation: 10721

You can test in Editor but you can build only for iOS and Android.

Upvotes: 2

Related Questions