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

Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X

Model Item colors are not showing up in View

agangaiah
14-Alexandrite

Model Item colors are not showing up in View

The colors applied to the model items are not showing up when it is being viewed using the Vuforia View App.

 

Aby idea why this is happening?

 

Avinash

1 ACCEPTED SOLUTION

Accepted Solutions

The problem is that some time when the model widget has a sequence property set to a figure e.g. figure-1 and it could override the colors . Therefore, is good to check if the sequence property is set and to unset it. OK, only the relevant is this line :

 

$scope.setWidgetProp('model-1','sequence', undefined);

 

another way ->you can try to set directly the modelItem without modelItem explicit widget definition is some call like this:

 

$timeout(function() {  
      tml3dRenderer.setColor('model-1-/0/0/4/1','rgba(44, 130, 201,1);');
       },500)

 

where 'model-1' is the widget name of the model widget and /0/0/4/1 is the ModelItem widget occurrence path

View solution in original post

6 REPLIES 6

Hi @agangaiah ,

 

how did you apply the color to the modelItem widget - via setting property in UI or via Script? 

Is only specific ModelItem Widget?

Is the occurrence path to a part or to subassembly?

So is the behavior in preview ok? On which type of device? /android, HoloLens or IOS ?

Hi, 

 

1. Color was applied JS Script

2. All Model Item Widgets

3. The occurrence path is to a part.

4. In Preview the behaviour is okay but when viewed in both android and IOS, it does not work. 

what is the example of the relevenat js code line your used to set the color of particular modelItemWidget. e.g. set via rgba function e.g. "rgba(255,0,0,1.0)";

Did you apply also texture and shader property  to the model or modelItem widget?

Hi Roland,

 

Here is the JS code that i used : 

$scope.view.wdg['modelItem-1'].color = 'rgba(44, 130, 201, 1)';

 

And no, I have not used any shader etc.,

Ok , thanks.

Is the sequence property set of the model where the ModelItem widget (modelItem-1) referred to .

If yes , could try  before setting of the modelItem  color to unset it e.g. something like (assuming that model-1 is the name of the model widget) :

 

 

 

...
tml3dRenderer.setProperties('model-1-/',        { decal:false, hidden:false});
$scope.setWidgetProp('model-1','sequence', undefined);
...

 

 

 

The problem is that some time when the model widget has a sequence property set to a figure e.g. figure-1 and it could override the colors . Therefore, is good to check if the sequence property is set and to unset it. OK, only the relevant is this line :

 

$scope.setWidgetProp('model-1','sequence', undefined);

 

another way ->you can try to set directly the modelItem without modelItem explicit widget definition is some call like this:

 

$timeout(function() {  
      tml3dRenderer.setColor('model-1-/0/0/4/1','rgba(44, 130, 201,1);');
       },500)

 

where 'model-1' is the widget name of the model widget and /0/0/4/1 is the ModelItem widget occurrence path

Top Tags