setShadingStyle 'matcap'

I’m trying to test the command “setShadingStyle”.
I have uploaded this test script:
https://riccardorocca.github.io/home/test_setShadingStyle.html

At line 32 I set the option “matcap”:
api.setShadingStyle(‘matcap’, {type: ‘lit’}, function(err) {

But the model gets stuck and does not open properly.
It works fine using the other two options (“classic” and “pbr”).

Can you help me find out what is the problem with “matcap”?

Riccardo

Seems documentation is quite unclear on the subject, sorry.

matcap has neither ‘lit’ or ‘shadelss’ type but ‘matcap’, sor line 32 should be:

api.setShadingStyle(‘matcap’, {type: ‘matcap’}, function(err) {

Here’s a jsfiddle showing it working: https://jsfiddle.net/sketchfab/y6qLo302/

Thanks for the report, we’ll update documentation to make it clearer.

Thank you Paul.

It has worked for me as well.

Riccardo

Hi Paul.

Is it possible to apply a ’matcap’ style only to one specific object?

For instance, in the example that I sent you, I would like to apply it to ‘Topography’, while leaving ‘GraphicScale’ and ‘Text’ with their original colors.

Thank you,

Riccardo

Hi,

It’s not possible actually to switch only some material, it’s a scene parameter.

1 Like