如何将查看器环境设置为本地并将日志级别设置为调试

How to set the viewer environment to be local and log level to debug

我在查看器中看到了以下代码:

avp.LogLevels = {
    DEBUG: 5,
    LOG: 4,
    INFO: 3,
    WARNING: 2,
    ERROR: 1,
    NONE: 0
};

并且:

avp.initializeProtein = function () {

    //For local work, don't redirect texture requests to the CDN,
    //because local ones will load much faster, presumably.
    if (avp.ENABLE_DEBUG && avp.env == "Local" && !auth /* when auth is true, the viewer is operating under

如何将avp.env设置为本地并设置日志级别?

初始化查看器时,将 envdocument 选项作为本地资源传递。

function initialize() {
    var options = {
        'document' : './shaver/0.svf',
        'env':'Local'
        };

    var viewerElement = document.getElementById('viewer');

    viewer = new Autodesk.Viewing.Private.GuiViewer3D(viewerElement, {});

    Autodesk.Viewing.Initializer(options,function() {
    viewer.initialize();
    viewer.load(options.document);
    });
}

你可以看看我的博客post关于online/offline use of the viewer API

对于日志级别使用:

Autodesk.Viewing.Private.logger.setLevel(5) //debug