Skip to main content
13-Aquamarine
October 19, 2023
Question

How I can skip step sequence in Vuforia studio?

  • October 19, 2023
  • 1 reply
  • 1961 views

Hi, dear community!

Can I skip the sequence step from a list for example - step 3 was made accidentally in a sequence list and I do not want to change it in Creo Illustrate because I use one 3D sequence file with 10 figures-animations + I use 10 views (with Wayfinder waypoints on each view). If I change the sequence file in my Vuforia Studio I would need to correct or reconnect all my Waypoints for all 10 Views.- and I don't want to do it.

Please advise how I can skip the sequence step or how I can set up Wayfinder so it does not lose waypoints after reuploading(after the update) the 3D sequence file.

 

 

 

1 reply

18-Opal
October 20, 2023

You could use some scripting to skip the step you don't want, something like this:

$scope.$on('newStep', function() {
	// if this is the step to skip, bump up the step number to the next step
	// for example, skip step 4 of sequence "Figure1"
	if ($scope.getWidgetProp("model-1", "sequence").includes("Figure1")) {
		if ($scope.getWidgetProp("model-1", "currentStep")==4) {
			$scope.setWidgetProp("model-1", "currentStep", 5);
		}
	}
});
13-Aquamarine
October 23, 2023

 

Hi, @ClayHelberg Thank you so much for your response!

I assume I am doing something wrong, because my step 3 (I want to skip) is still there, please advise.

This is my JS:

$scope.next=function(){
  if ($scope.getWidgetProp("model-1", "sequence").includes("Remove Switch Board")) {
if ($scope.getWidgetProp("model-1", "currentStep")==2) {
$scope.setWidgetProp("model-1", "currentStep", 4);
}
  }
$scope.step=$scope.step+1;
  $scope.view.wdg["model-1"].currentStep=$scope.step
}
 
$scope.back=function(){
$scope.step=$scope.step-1;
  $scope.view.wdg["model-1"].currentStep=$scope.step
}
 
$scope.step=0;
 
$scope.$watch('step', function(val) {
  console.log($scope.view.wdg["model-1"].currentStep)
  $timeout(function(){
    $scope.app.fn.triggerWidgetService("model-1", "play"); 
  },500); //wait for 1/2 second
         
  switch (val) {
     
      case 1:
      $scope.view.wdg['label-1'].text = " Unlock Vanes";
         $scope.view.wdg['wayfinder-1'].enabled=false
       $scope.app.fn.triggerWidgetService("model-1", "play");
        $scope.view.wdg['forward'].visible=false;
      $scope.view.wdg['backbtn'].visible=false;
      break;
      case 2:
      $scope.view.wdg['label-1'].text = "Remove Vanes";
        $scope.view.wdg['wayfinder-1'].enabled=false
      break;
      case 3:
      $scope.view.wdg['label-1'].text = "Remove Vanes";
        $scope.view.wdg['wayfinder-1'].enabled=false
      break;
    case 4:
      $scope.view.wdg['label-1'].text = " Remove Front Panel";
        $scope.view.wdg['wayfinder-1'].enabled=false
      break;
 
IB_10645210_0-1698070320240.png

 

18-Opal
October 23, 2023

It's hard to try to debug code just by eyeballing it, but one thing that does jump out at me is this:

$scope.next=function(){
 if ($scope.getWidgetProp("model-1", "sequence").includes("Remove Switch Board")) {
 if ($scope.getWidgetProp("model-1", "currentStep")==2) {
 $scope.setWidgetProp("model-1", "currentStep", 4);
 }
 }
 // the part below overwrites the skip above
 $scope.step=$scope.step+1;
 $scope.view.wdg["model-1"].currentStep=$scope.step
 }

The second part of this, where you increment $scope.step and then use it to set the model currentStep property, basically overwrites the bit above where you skip the step you want to skip.

One way to fix this would be to reverse the order of those code snippets, like this:

$scope.next=function(){
 $scope.step=$scope.step+1;
 $scope.view.wdg["model-1"].currentStep=$scope.step
 }
 if ($scope.getWidgetProp("model-1", "sequence").includes("Remove Switch Board")) {
 if ($scope.getWidgetProp("model-1", "currentStep")==2) {
 $scope.setWidgetProp("model-1", "currentStep", 4);
 }
 }