Skip to main content
1-Visitor
March 14, 2021
Solved

Sequence does only play after double tap on HoloLens

  • March 14, 2021
  • 1 reply
  • 969 views

Hello,

I am currently working on a project where you can interact with a machine by using buttons to play animations.

I got the animation to play on the HoloLens using following code:


$scope.playSequence=function(name){
$scope.app.loadsequence(name);
$scope.$applyAsync();
console.warn("$scope.app.loadsequence() executed");
$timeout( function() {
$scope.app.loadsequence(name);
console.warn("app.loadsequence() executed");
$scope.$applyAsync();
}, 1000);

};

$scope.app.loadsequence = function(name)
{ $scope.setWidgetProp('schwader', 'sequence', "app/resources/Uploaded/"+name);
twx.app.fn.triggerWidgetService("schwader", 'playAll');
};

 

But I have now the problem that Animation plays in Preview just fine, but on the HoloLens it is needed to tap the button twice in order to play animation. 

Is it possible that because the machine is quite large that is taking its time to load in the animation?

 

Best answer by sebben

Hi,

 

you can do it like this:

 

$scope.playSequence = function(pvzName, SequenceName){

$scope.view.wdg["schwader"].sequence = "app/resources/Uploaded/" + pvzName + "/l-Creo%203D%20-%20" + SequenceName + ".pvi";

}

$scope.$on('sequenceloaded', function(evt, arg1) {

 angular.element(document.getElementById('schwader')).scope().playAll();
});

1 reply

sebben14-AlexandriteAnswer
14-Alexandrite
March 15, 2021

Hi,

 

you can do it like this:

 

$scope.playSequence = function(pvzName, SequenceName){

$scope.view.wdg["schwader"].sequence = "app/resources/Uploaded/" + pvzName + "/l-Creo%203D%20-%20" + SequenceName + ".pvi";

}

$scope.$on('sequenceloaded', function(evt, arg1) {

 angular.element(document.getElementById('schwader')).scope().playAll();
});