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

Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X

How can I make 3D models appear using 3d toggles in Studio?

CB_9115947
6-Contributor

How can I make 3D models appear using 3d toggles in Studio?

Let me start by saying everything works perfectly in preview, but not on HoloLens. 

I'm creating an experience where certain models appear and disappear depending upon which 3D toggle is active/inactive.  There are three toggles that make the same model appear (it's generic and has no sequences or animation). When the other toggles are selected, the generic model will disappear, but none of the other models (all of which DO have sequences) do not appear. I'm guess it has to do with the fact that they have sequences attached to them since the JS seems to be the same.

 

Here's an example of some of the JS I'm using for each 3D Toggle:

//Overview Settings
$scope.overview = function() {
$scope.view.wdg['3DToggleButton-2']['pressed'] = false;
$scope.view.wdg['3DToggleButton-3']['pressed'] = false;
$scope.view.wdg['3DToggleButton-4']['pressed'] = false;
$scope.view.wdg['3DToggleButton-5']['pressed'] = false;
$scope.view.wdg['3DToggleButton-6']['pressed'] = false;
$scope.view.wdg['3DToggleButton-7']['pressed'] = false;
$scope.view.wdg['3DToggleButton-8']['pressed'] = false;
$scope.app.params.model1 = true;
$scope.app.params.model2 = false;
$scope.app.params.model3 = false;
$scope.app.params.model4 = false;
$scope.app.params.model5 = true;
$scope.app.params.model6 = false;
$scope.app.params.image2 = true;
$scope.app.params.image3 = false;
$scope.app.params.image4 = false;
$scope.app.params.image5 = false;
$scope.app.params.image6 = false;
$scope.app.params.image7 = false;
$scope.app.params.image8 = false;
$scope.app.params.image9 = false;
};


//Pole Settings
$scope.pole = function() {
$scope.view.wdg['3DToggleButton-1']['pressed'] = false;
$scope.view.wdg['3DToggleButton-3']['pressed'] = false;
$scope.view.wdg['3DToggleButton-4']['pressed'] = false;
$scope.view.wdg['3DToggleButton-5']['pressed'] = false;
$scope.view.wdg['3DToggleButton-6']['pressed'] = false;
$scope.view.wdg['3DToggleButton-7']['pressed'] = false;
$scope.view.wdg['3DToggleButton-8']['pressed'] = false;
$scope.app.params.model1 = false;
$scope.app.params.model2 = false;
$scope.app.params.model3 = false;
$scope.app.params.model4 = false;
$scope.app.params.model5 = true;
$scope.app.params.model6 = true;
$scope.app.params.image2 = false;
$scope.app.params.image3 = true;
$scope.app.params.image4 = false;
$scope.app.params.image5 = false;
$scope.app.params.image6 = false;
$scope.app.params.image7 = false;
$scope.app.params.image8 = false;
$scope.app.params.image9 = false;
};


//Light Arm Settings
$scope.lightArm = function() {
$scope.view.wdg['3DToggleButton-1']['pressed'] = false;
$scope.view.wdg['3DToggleButton-2']['pressed'] = false;
$scope.view.wdg['3DToggleButton-4']['pressed'] = false;
$scope.view.wdg['3DToggleButton-5']['pressed'] = false;
$scope.view.wdg['3DToggleButton-6']['pressed'] = false;
$scope.view.wdg['3DToggleButton-7']['pressed'] = false;
$scope.view.wdg['3DToggleButton-8']['pressed'] = false;
$scope.app.params.model1 = false;
$scope.app.params.model2 = true;
$scope.app.params.model3 = false;
$scope.app.params.model4 = false;
$scope.app.params.model5 = true;
$scope.app.params.model6 = false;
$scope.app.params.image2 = false;
$scope.app.params.image3 = false;
$scope.app.params.image4 = true;
$scope.app.params.image5 = false;
$scope.app.params.image6 = false;
$scope.app.params.image7 = false;
$scope.app.params.image8 = false;
$scope.app.params.image9 = false;
};

 

ACCEPTED SOLUTION

Accepted Solutions

The sequence visibility does take precedence over any JS. This could be the issue. You can try setting the sequence to blank and then explore the JS

View solution in original post

4 REPLIES 4

The sequence visibility does take precedence over any JS. This could be the issue. You can try setting the sequence to blank and then explore the JS

I'll give that a try.  But then how do I apply the sequence?

via code you can set the sequence (you will have to know the name )

 

$scope.view.wdg['model-1']['sequence']='app/resources/Uploaded/Illustration/l-Creo%203D%20-%20drillChuck.pvi';

 

Then you will need to listern for event sequenceloaded

 

var modelName = "model-1";
$scope.$on('sequenceloaded', function(evt, args, meta) {

// do something $scope.$broadcast('app.view["Home"].wdg["' +modelName+ '"].svc.playAll'); });

  Hope this helps

I will give it a try, thank you!

Announcements

Top Tags