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

Show/Hide separate models on 3D button clicks for Hololens

CB_9115947
6-Contributor

Show/Hide separate models on 3D button clicks for Hololens

I'm looking to be able to show a particular model and hide all others on the click of a particular 3D button.  

 

On scene entry, I want a particular model (Model-1) to show and all others to be hidden, which I have done with the following code:

$scope.Test = function() {
  $scope.setWidgetProp('model-2', 'ForceHide', 'true');
};
 $scope.Test();
 $scope.Test = function() {
  $scope.setWidgetProp('model-3', 'ForceHide', 'true');
};
 $scope.Test();
 $scope.Test = function() {
  $scope.setWidgetProp('model-4', 'ForceHide', 'true');
};
 
But then I want to SHOW each model separately when a particular button is pushed.  Then if a user 
1 REPLY 1
sebben
12-Amethyst
(To:CB_9115947)

Hi,

 

you just need a function like this:

$scope.UpdateVisibility = function(widget, visibility) {
    $scope.view.wdg[widget].visible = visibility;
}

Then enter in the JS box of the click event for button 1:

UpdateVisibility("model-1", true);
UpdateVisibility("model-2", false);
UpdateVisibility("model-3", false);
UpdateVisibility("model-4", false);

 

For button 2: 

UpdateVisibility("model-1", false);
UpdateVisibility("model-2", true);
UpdateVisibility("model-3", false);
UpdateVisibility("model-4", false);

 

and so on.

Top Tags