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

Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X

Model-Item color reset

Laurenz
10-Marble

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 🙂

 

ACCEPTED SOLUTION

Accepted Solutions

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

View solution in original post

3 REPLIES 3

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

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! 

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.

Announcements

Top Tags