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 called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. 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
14-Alexandrite
(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.

Announcements

Top Tags