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

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

Hololens 2 Illustrate sequence problems

AlexK
14-Alexandrite

Hololens 2 Illustrate sequence problems

Hello All,

 

I've been having problems while creating an experience for Hololens 2.

 

When I try to switch sequences using JS, the hololens wont change the sequence. I've added the PVI files of the sequences, that used to fix the problem, but not this time.

 

I've made a workaround by splitting the sequences to different models, but now i can't toggle the model visibility when a sequence is selected. The model opacity also cannot be changed when the sequence is selected. My workaround was to change the scale of the models to 0.01 to hide them, but this not a good solution.

 

Is there a proper fix for these bugs?

 

Best wishes

 

Alex

1 ACCEPTED SOLUTION

Accepted Solutions

So , tested your experience where I tested the full path and it was working fine  on HoloLens 2 device with the current Vuforia View app. Here attached the version I tested. First I had the impression that hide Deck is not working but it was to fast playing so when I was  looking  on the button when I clicked it and looked then to ship it was already done so needed to click from other view point direction then was able to see that this step in the seq2 was also playing - means was ok

View solution in original post

5 REPLIES 5

Hi @AlexK ,

so depends what was the code what you use.

Is it working in preview mode but not working on HoloLens , or both?

I remember last time I used a code like this what was working

 

 

/////////////////////////////////////////
$scope.setSequenceList = function(){
//this parameter is linked to the sequence property of the model widget
  $scope.app.params['sequenceList'] = [
    {
      "display":"Figure 1",
      "value":"app/resources/Uploaded/l-Creo 3D - Figure 1.pvi"
    },
    {
      "display":"Figure 2",
      "value":"app/resources/Uploaded/l-Creo 3D - Figure 2.pvi"
    }
  ]
}
//------------------
$rootScope.$on('modelLoaded', function() { 
//on model load then set the sequence list
 $scope.setSequenceList();
 
timeout(()=> {  
$scope.app.playModelStep("Figure 1","model-1",3,true)},1000) //delay 

})

 

 

where the definition of playModelStep was something like this:

 

 

//////////////
//definition of the function
$scope.app.playModelStep = function (sequence,modelName,step_number,play) {
//sequnece -sequnece name e.g. TestFigure1 - as shown in UI
//modelName - model name e.g. model-1
//step_number - set this number to current step
//play   true/false execute play for the model

 
$scope.$applyAsync(()=>{$scope.setWidgetProp(modelName, 'sequence',  '');});


  $timeout(function () {
  $scope.$applyAsync(()=>{$scope.setWidgetProp(modelName, 'sequence',  'app/resources/Uploaded/l-Creo 3D - '+sequence +'.pvi');}); 
    
  },50);

  $timeout(function () {
     
  $scope.$applyAsync(()=>{$scope.setWidgetProp(modelName, 'currentStep', parseInt(step_number));});
  
 if(play)   //check if play should be applyed
  
 $timeout(function () {angular.element(document.getElementById(modelName)).scope().play(); }, 100);
                      }, 500);
};
//////////////////////////////////

 

  

AlexK
14-Alexandrite
(To:RolandRaytchev)

Hi Roland,

 

Thanks for sending your code, I will try it out. I see you are selecting a single step of the sequence and playing it. Can I set the param and use a normal button that is linked to the play function of the model?

 

This is the code I used:

$scope.click1 = function()
{
    $scope.setWidgetProp( 'model-1',  'sequence', 'l-Creo 3D - Seq1.pvi');
}
 
$scope.click2 = function()
{
    $scope.setWidgetProp( 'model-1',  'sequence', 'l-Creo 3D - Seq2.pvi');
}

It did work for me in the past, and it works fine in preview. 

 

I got around to make a test experience without any sensitive data, to show my problem. (attached Hololens_Seq_Test.zip)

 

Did you notice as well that you can't toggle the visibility of models with set sequences?

 

Best wishes,

 

Alex

Hi Alex,

yes, so far I know, this should work , 

for example in the function example - second part - definition of ($scope.app.playModelStep() ) the last parameter "play" - when it is false - it will   set a sequence and step but will  it will not play the step. So that when you use a play button - means a button where the click event is bind to the play service of the model widget it should play the step as you already  set it with the function. I will check you example and will try to make it working. Thanks

So , tested your experience where I tested the full path and it was working fine  on HoloLens 2 device with the current Vuforia View app. Here attached the version I tested. First I had the impression that hide Deck is not working but it was to fast playing so when I was  looking  on the button when I clicked it and looked then to ship it was already done so needed to click from other view point direction then was able to see that this step in the seq2 was also playing - means was ok

AlexK
14-Alexandrite
(To:RolandRaytchev)

Hi Roland,

 

Thank you very much, I must have deleted the URL while copy pasting. The hiding problem is still an issue, but if i just unset the sequence before hiding it works, maybe the devs could look into that.

 

Best wishes,

Alex

Top Tags