Skip to main content
1-Visitor
April 9, 2019
Question

Playing different sequence is not working on HoloLens

  • April 9, 2019
  • 1 reply
  • 4211 views

Hello,

I am trying to change the 'sequence' property of my 3Dmodel using JS for a HoloLens experience.

On the preview everything is ok, but on the Hololens itself the sequence is not switching.

 

The sequence itself is called "sequence" ("l-Creo 3D - sequence.pvi").

I tryed several approaches to reach the sequence:

$scope.setWidgetProp('staticModel', 'sequence', "app/resources/Uploaded/l-Creo 3D - sequence.pvi");
$scope.setWidgetProp('staticModel', 'sequence', "Uploaded/l-Creo 3D - sequence.pvi");
$scope.setWidgetProp('staticModel', 'sequence', "l-Creo 3D - sequence.pvi");

The interesting thing is, that all of these above is working in the preview.

But not with the HoloLens eventually.

I am using Creo Illustrate 4.2 and a single PVZ file is uploaded to the application resources in Studio.

Any help will be much appreciated.

Thanks!

1 reply

21-Topaz I
April 11, 2019

Hi @IstvanPolacsek ,

 

I think the first thing what we need to verify is the sequence working on the HoloLens when we set it directly to the sequence property of the model widget. So means it should not work only in preview mode.

As second - I used in a test project  successful the following code:

 

$scope.app.loadsequence = function()
	{ $scope.setWidgetProp('model-1', 'sequence', "app/resources/Uploaded/l-Creo 3D - Figure1.pvi"); 
	 twx.app.fn.triggerWidgetService("model-1", 'play'); 
 };
///////
 $rootScope.$on('modelLoaded', function()
 {$scope.app.loadsequence();
 console.warn("$scope.app.loadsequence() executed"); 
 				$timeout( function() {
 $scope.app.loadsequence();
 console.warn("app.loadsequence() executed"); 
 $scope.$applyAsync();
 }, 1000);
 
 });
$scope.app.playsequence = function()
	{ 
	 twx.app.fn.triggerWidgetService("model-1", 'play'); 
 };

$scope.app.loadsequence1 = function()
	{ $scope.setWidgetProp('model-1', 'sequence', "app/resources/Uploaded/l-Creo 3D - SecondFigure.pvi"); 
	 twx.app.fn.triggerWidgetService("model-1", 'playAll'); 
 };

 

One important thing is to pay attention to call the setting of the sequence first when the model - widget is already loaded - also for instance when you change the displayed view 

21-Topaz I
April 11, 2019

Another code where I know that was working :

var figure_list =["l-Creo 3D - Figure1","l-Creo 3D - Figure2","l-Creo - Figure3","l-Creo - Figure4"];


$scope.app.setSequence = function(val)
	{ $scope.setWidgetProp('model-1', 'sequence', "app/resources/Uploaded/"+figure_list[val-1]+".pvi"); 
	 $scope.$applyAsync();
 };
...
app.setSequnece(2); //sett the Figure2
...
1-Visitor
April 16, 2019

Hi @RolandRaytchev,

 

Answering your first comment, the sequences do work when I set them as model properties.

 

I think the problem is similar with the tag-along function:

On HoloLens these event simply not fire (for some reason).

 

I will look into the codes you provided and report about the results.