cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X

Navigate view after all steps finished playing

KM
12-Amethyst
12-Amethyst

Navigate view after all steps finished playing

Hi,

 

I have multiple views in a project. 

How to automatically navigate to second view after steps in first view end. I'm using Hololens 2
 
Thank you. 
ACCEPTED SOLUTION

Accepted Solutions
sebben
13-Aquamarine
(To:KM)

That should not be possible unless you also kept the first solution. ( But it should wait until the step is completed anyway)

 

To rewind a step just add a button and connect the click event with the rewind service of the model.

 

If you want to make sure the last step is finished before the user can change the view you can change condition of the if statement:

if($scope.view.wdg["model-1"].currentStep == $scope.view.wdg["model-1"].steps && $scope.view.wdg["model-1"].playing == false)

 

If it still does not work can you please share an example how you are trying to do it. Thanks.

 

View solution in original post

7 REPLIES 7
sebben
13-Aquamarine
(To:KM)

Hi,

you can use this function:

 

$scope.$on('stepcompleted', function(evt, arg1, arg2, arg3) { 
if($scope.view.wdg["model-1"].currentStep == $scope.view.wdg["model-1"].steps){
  $scope.navigate("View2");
	}
}); 

 

Make sure you change the model and view name according to your experience.

KM
12-Amethyst
12-Amethyst
(To:sebben)

Hi, thank you for your response.

 

i've tried it, and it works. 

 

But i've concern regarding swipe left gesture. Is it possible to navigate view if the last step has finished playing without user clicking on rewind button and then user swipe left?  

sebben
13-Aquamarine
(To:KM)

You can use the swipe left gesture. You need to write a function like this:

$scope.navigateToView = function() { 
if($scope.view.wdg["model-1"].currentStep == $scope.view.wdg["model-1"].steps){
  $scope.navigate("View2");
	}
}

 

Next, click the JS icon next to the swipeleft application event, and enter the following in the expression box: viewCtrl.navigateToView();

 

KM
12-Amethyst
12-Amethyst
(To:sebben)

I've tried the solution that you gave. But it automatically change to next view without playing the last step. 

 

I want the last step being played first, and user can rewind the last step by clicking on the button. After last step finished playing, user swipe left to navigate to next view. 

sebben
13-Aquamarine
(To:KM)

That should not be possible unless you also kept the first solution. ( But it should wait until the step is completed anyway)

 

To rewind a step just add a button and connect the click event with the rewind service of the model.

 

If you want to make sure the last step is finished before the user can change the view you can change condition of the if statement:

if($scope.view.wdg["model-1"].currentStep == $scope.view.wdg["model-1"].steps && $scope.view.wdg["model-1"].playing == false)

 

If it still does not work can you please share an example how you are trying to do it. Thanks.

 

KM
12-Amethyst
12-Amethyst
(To:sebben)

Thank you for your help. 

 

I've tried the script to navigate view. It's working on the preview mode, but when I test it with Hololens, its not working. 

 

How can I solve this issue?

sebben
13-Aquamarine
(To:KM)

It works for me.

 

Make sure you perform the gestures right like is written here:

 

http://support.ptc.com/help/vuforia/studio/en/#page/Studio_Help_Center%2FEyewearExperiences.html%23wwID0ECNXO

 

If it still does not work, could you please share an example. Thanks.

Announcements

Top Tags