Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set performance and appearance settings in Autodesk Viewer?

I have been having trouble using JavaScript to preset performance and appearance settings for the viewer. I wanted to pre-define some of the settings like anti-aliasing, and shadows to be off on load. I am new to this API and basically couldn't figure out how to instantiate the Viewer3D object.

finally I figured out the answer and posted it below.

like image 477
Mike Avatar asked Jan 28 '26 15:01

Mike


1 Answers

I have figured out how to do this in my extension if anyone else was wondering

function MyExtension(viewer, options) {
    Autodesk.Viewing.Extension.call(this, viewer, options);
    // Preset performance settings
    viewer.setLightPreset(1);
    viewer.setQualityLevel(false, false);
    viewer.setGhosting(true);
    viewer.setGroundShadow(false);
    viewer.setGroundReflection(false);
    viewer.setEnvMapBackground(false);
    viewer.setProgressiveRendering(true);
}
like image 138
Mike Avatar answered Jan 31 '26 03:01

Mike



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!