Skip to main content
1-Visitor
August 14, 2018
Solved

Model-Item color reset

  • August 14, 2018
  • 1 reply
  • 3012 views

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 🙂

 

Best answer by jmikesell

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

1 reply

jmikesell1-VisitorAnswer
1-Visitor
August 20, 2018

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
Laurenz1-VisitorAuthor
1-Visitor
August 29, 2018

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! 

1-Visitor
August 29, 2018

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.