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

Model-Item color reset

SOLVED
Level 7

Model-Item color reset

Hi, I'm using 3D models and model items as UI buttons. to fake a highlight onClick, i want to change and reset the color of the model-item. I know how to set the color, but I seem unable to reset the color field with "null", so that the original texture is visible again. basically no color at all.

I tried multiple things for 

 

$scope.app.view.Home.wdg[widget].color = 'rgba(x,x,x,x)';

saving the initial value of color and resetting it doesnt work, setting it to null, or any other rgba color didnt seem to do the trick. I would really appreciate a little hint, since this is most likely just a small issue Smiley Happy

 

Tags (1)
1 ACCEPTED SOLUTION

Accepted Solutions

Re: Model-Item color reset

So i do exactly this in experiances and use the $scope.setWidgetProp function. If i remember right it doesn't work with the function you are trying to use.

$scope.setWidgetProp(studioID, "color", "rgba(255,0,0, 1)"); //set color to red

$scope.setWidgetProp(studioID, "color", ""); //restore color to default
3 REPLIES 3

Re: Model-Item color reset

So i do exactly this in experiances and use the $scope.setWidgetProp function. If i remember right it doesn't work with the function you are trying to use.

$scope.setWidgetProp(studioID, "color", "rgba(255,0,0, 1)"); //set color to red

$scope.setWidgetProp(studioID, "color", ""); //restore color to default
Highlighted

Re: Model-Item color reset

Hi, thank you for your replies to all my questions. 

 

Your proposed code "$scope.setWidgetProp(studioID, "color", "")"  works on the actual Hololens.

Testing it in the Preview window though does not! 

Re: Model-Item color reset

I see similar behavior. For me this doesn't work in Preview but does one Android and iOS devices. I have found a few places where the Preview doesn't match real use, this is one of them. I have learned that if I do something that really seems like it should work and it doesn't in Preview I always test it on a device to confirm before trying another method.