The model uses an old version of the renderer

api

(Umaptechnologies) #1

Following up from the solution @james posted here, given that it was a bit of a hack:

Since we got our new error reporting online, we've noticed this message cropping up

Your changes couldn't be saved because the model uses an old version of the renderer. Please go the editor(link) and save the settings to fix this.

It comes up for shading and background both. Going to the edit page as it suggests, it seems the model defaults to PBR as its renderer. Since it only comes up sometimes we figured this wasn't an intentional API change. Any ideas how we could make this behavior work more consistently? Thanks.


#2

Settings has defaulted to PBR for some time, and it was intentional, but I'm not sure that's related to this issue.

Are you PATCHing old models or you see this error on new uploads? Could you share a specific model and the PATCH you sent?


(Umaptechnologies) #4

Sorry, should have been more precise. When I mentioned intentionality I was referring to the previous thread where you stated that the solution was a hack and subject to change. We are PATCHing. The model is here (model name is "fcc5b1d3-e811-4859-bc99-d91e6fea0090_dpc"). I'm afraid I can't reproduce the request verbatim, but it's essentially copy-pasted from the suggestion you made in the previous thread. It's going to look something like this:

requests.patch(
    'https://api.sketchfab.com/v2/models/0e9acf59a2a34c8cb7522f3b507aa2cd?token=<our API token>',
    headers={'content-type': 'application/json'},
    data={
        'options': {
        'shading': {
            'type': 'shadeless',
            'renderer': 'classic'
        },
        'background': {
            'color': [0.2, 0.3, 0.4],
            'enable': 'fixed',
            'uid': <our UID>
        }
    }
}

#5

I think you're missing the vertex color object

{type: "lit", renderer: "classic", vertexColor: {enable: false, useAlpha: false, colorSpace: "linear"}}

But I recommend switching to v3 (beta):

http://sketchfab-staging-docs.s3-website-eu-west-1.amazonaws.com/data-api/v3/index.html#!/models/patch_v3_models_uid_options