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

Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X

Model-Item color reset

Laurenz
7-Bedrock

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 🙂

 

1 ACCEPTED SOLUTION

Accepted Solutions
jmikesell
15-Moonstone
(To:Laurenz)

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
jmikesell
15-Moonstone
(To:Laurenz)

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! 

jmikesell
15-Moonstone
(To:Laurenz)

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.

Top Tags