Boomasundari
Boomasundari

Reputation: 1

Couldn't change the object color in Autodesk Forge Viewer

I've tried to change the object color in Autodesk Forge Viewer using the following link.

https://adndevblog.typepad.com/cloud_and_mobile/2015/12/change-color-of-elements-with-view-and-data-api.html

But, I've got the below issue when trying to load the extension "Autodesk.ADN.Viewing.Extension.Color".

"Uncaught (in promise) Extension failed to .load() : Autodesk.ADN.Viewing.Extension.Color at ExtensionManager.js:390"

Upvotes: 0

Views: 276

Answers (1)

Adam Nagy
Adam Nagy

Reputation: 2125

That's an old article. Now the load() function of the extension needs to return true on a successful load - as shown here: https://forge.autodesk.com/en/docs/viewer/v7/developers_guide/viewer_basics/extensions/

So just return true at this place in the code:

    _self.unload = function() {
        console.log('Autodesk.ADN.Viewing.Extension.Color unloaded');
        return true;
    };

    return true; // <<-- add this here
};

Upvotes: 1

Related Questions