Hello,
I have a question about using the new MT360 with Unity on the HoloLens.
I have trained 3 models. So I have 3 datasets, and imported them in Unity.
I created 3 ModelTargetBehaviour objects, and attached a script to each to show/hide them when tracking is found/lost.
What I want to achieve ideally is to track all models simultaneously, but I cannot get this to work.
I understand that this may not be supported. In that case, I want to at least be able to switch between them, so I can decide at run-time which model I want to search for and track.
I am not sure how this is to be done. I looked a little at enabling/disabling datasets, but I do not understand it yet.
Moreover, if I do not do anything special, but just run my app with the 3 ModelTargetBehaviours enabled, it seems there is a problem "activating" any dataset after the first. This makes me think they are not loaded correctly and so I cannot possibly switch to them anyway. Here is a part of the log that shows this:
Vuforia Engine initialization successful UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[]) UnityEngine.Logger:Log(LogType, Object) UnityEngine.Debug:Log(Object) Vuforia.VuforiaRuntime:UpdateInitialization() Vuforia.VuforiaARController:Start() System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo) System.Reflection.MethodBase:Invoke(Object, Object[]) System.Delegate:DynamicInvokeImpl(Object[]) System.MulticastDelegate:DynamicInvokeImpl(Object[]) System.Delegate:DynamicInvoke(Object[]) Vuforia.DelegateHelper:InvokeDelegate(Delegate, Object[]) Vuforia.DelegateHelper:InvokeWithExceptionHandling(Action) (Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 45)
Found Trackable named ObjectA with id 2 UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[]) UnityEngine.Logger:Log(LogType, Object) UnityEngine.Debug:Log(Object) Vuforia.StateManager:AssociateTrackableBehavioursForDataSet(DataSet) Vuforia.DataSet:Load(String, StorageType) Vuforia.DataSet:Load(String) Vuforia.DatabaseLoadARController:LoadDatasets() Vuforia.VuforiaARController:StartAfterInitializationCompleted() System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo) System.Reflection.MethodBase:Invoke(Object, Object[]) System.Delegate:DynamicInvokeImpl(Object[]) System.MulticastDelegate:DynamicInvokeImpl(Object[]) System.Delegate:DynamicInvoke(Object[]) Vuforia.DelegateHelper:InvokeDelegate(Delegate, Object[]) Vuforia.DelegateHelper:InvokeWithExceptionHandling(Action) (Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 45)
Found Trackable named ObjectB with id 4 UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[]) UnityEngine.Logger:Log(LogType, Object) UnityEngine.Debug:Log(Object) Vuforia.StateManager:AssociateTrackableBehavioursForDataSet(DataSet) Vuforia.DataSet:Load(String, StorageType) Vuforia.DataSet:Load(String) Vuforia.DatabaseLoadARController:LoadDatasets() Vuforia.VuforiaARController:StartAfterInitializationCompleted() System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo) System.Reflection.MethodBase:Invoke(Object, Object[]) System.Delegate:DynamicInvokeImpl(Object[]) System.MulticastDelegate:DynamicInvokeImpl(Object[]) System.Delegate:DynamicInvoke(Object[]) Vuforia.DelegateHelper:InvokeDelegate(Delegate, Object[]) Vuforia.DelegateHelper:InvokeWithExceptionHandling(Action) (Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 45)
Could not activate dataset. UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[]) UnityEngine.Logger:Log(LogType, Object) UnityEngine.Debug:LogError(Object) Vuforia.ObjectTracker:ActivateDataSet(DataSet) Vuforia.DatabaseLoadARController:LoadDatasets() Vuforia.VuforiaARController:StartAfterInitializationCompleted() System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo) System.Reflection.MethodBase:Invoke(Object, Object[]) System.Delegate:DynamicInvokeImpl(Object[]) System.MulticastDelegate:DynamicInvokeImpl(Object[]) System.Delegate:DynamicInvoke(Object[]) Vuforia.DelegateHelper:InvokeDelegate(Delegate, Object[]) Vuforia.DelegateHelper:InvokeWithExceptionHandling(Action) (Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 45)
Found Trackable named ObjectC with id 6 UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[]) UnityEngine.Logger:Log(LogType, Object) UnityEngine.Debug:Log(Object) Vuforia.StateManager:AssociateTrackableBehavioursForDataSet(DataSet) Vuforia.DataSet:Load(String, StorageType) Vuforia.DataSet:Load(String) Vuforia.DatabaseLoadARController:LoadDatasets() Vuforia.VuforiaARController:StartAfterInitializationCompleted() System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo) System.Reflection.MethodBase:Invoke(Object, Object[]) System.Delegate:DynamicInvokeImpl(Object[]) System.MulticastDelegate:DynamicInvokeImpl(Object[]) System.Delegate:DynamicInvoke(Object[]) Vuforia.DelegateHelper:InvokeDelegate(Delegate, Object[]) Vuforia.DelegateHelper:InvokeWithExceptionHandling(Action) (Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 45)
Could not activate dataset. UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[]) UnityEngine.Logger:Log(LogType, Object) UnityEngine.Debug:LogError(Object) Vuforia.ObjectTracker:ActivateDataSet(DataSet) Vuforia.DatabaseLoadARController:LoadDatasets() Vuforia.VuforiaARController:StartAfterInitializationCompleted() System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo) System.Reflection.MethodBase:Invoke(Object, Object[]) System.Delegate:DynamicInvokeImpl(Object[]) System.MulticastDelegate:DynamicInvokeImpl(Object[]) System.Delegate:DynamicInvoke(Object[]) Vuforia.DelegateHelper:InvokeDelegate(Delegate, Object[]) Vuforia.DelegateHelper:InvokeWithExceptionHandling(Action)
So, essentially, this happens:
- Found Trackable named ObjectA with id 2
- [Nothing. No complaint about the dataset not being activated]
- Found Trackable named ObjectB with id 4
- Could not activate dataset. [Because it was already activated for ObjectA?]
- Found Trackable named ObjectC with id 6
- Could not activate dataset.
I am using Vuforia 8.3.8, Unity 2018.4.2f1, and MRTK 2.0.0-Beta2
I just don't understand why the datasets cannot be activated.
I also don't know for sure how to switch between them so that Vuforia will actually search for the model I want.
If someone can help me with some specific pointers, it would be greatly appreciated.
I am not a novice with Unity or programming in general, but I am new to Vuforia and so do not know the API very well yet...
Thanks!
Hello,
Hello,
Thank you for the information
Thank you for the information.