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

Community Tip - Need help navigating or using the PTC Community? Contact the community team. X

Navigate view after all steps finished playing

KM
11-Garnet
11-Garnet

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. 
1 ACCEPTED SOLUTION

Accepted Solutions
sebben
12-Amethyst
(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
12-Amethyst
(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
11-Garnet
11-Garnet
(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
12-Amethyst
(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
11-Garnet
11-Garnet
(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
12-Amethyst
(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
11-Garnet
11-Garnet
(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
12-Amethyst
(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.

Top Tags