3

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.

Mike
  • 375
  • 1
  • 14
  • Welcome on Stackoverflow! Your question might be improved if you could tell us what you already tried, what parameters you wanted to set and what the exact problems are. – Slizzered Jul 25 '16 at 16:35
  • @Slizzered my apologies, it was a very vague question, my first on stackoverflow, but I figured out the answer and posted it below. Basically 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. – Mike Jul 25 '16 at 17:14

1 Answers1

4

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);
}
Mike
  • 375
  • 1
  • 14