View Settings Operations
3D View Settings Tutorial.
This tutorial demonstrates how to control the options found in the 3D View Settings dialog through the scripting API, including performance, visualization, floor shadows, back face coloring, and miscellaneous scene appearance settings.
Topics covered:
- Performance (rendering quality, interactive update rate)
- Visualization (depth peeling, FXAA, hidden line removal)
- Ambient occlusion shadows for improved depth perception
- Floor shadows (enable, quality, softness, darkness, floor plane)
- Back face coloring
- Miscellaneous (scene bounding box color, axes labels color, axes scale)
Prerequisites
- Volvicon application must be running
- A valid license must be active
Performance - Rendering Quality​
# Control how much detail is kept while the 3D scene is being rotated, panned,
# or zoomed. Higher quality preserves more detail but can lower the frame rate.
#
# Available quality levels:
# api.RenderingQuality.Adaptive - Detail is reduced automatically while
# interacting to keep the view responsive
# api.RenderingQuality.Normal - A fixed balance between detail and speed
# api.RenderingQuality.Maximum - Full detail is kept at all times
# Set adaptive rendering quality (default)
view_operations.set_rendering_quality(api.RenderingQuality.Adaptive)
# Get the current rendering quality
quality = view_operations.get_rendering_quality()
print(f"Rendering quality: {quality}")
# Keep full detail while interacting (recommended with Mask 3D Preview (Direct))
# view_operations.set_rendering_quality(api.RenderingQuality.Maximum)
Performance - Interactive Update Rate​
# Set the target frames per second used while the scene is being manipulated.
# Higher values favor smoother interaction over detail. Valid range is 1 to 100.
#
# Note: the update rate has no effect while the rendering quality is set to
# api.RenderingQuality.Maximum, where full detail is always used.
# Set a 30 FPS interactive update rate
view_operations.set_rendering_update_rate(30.0)
# Get the current update rate
update_rate = view_operations.get_rendering_update_rate()
print(f"Interactive update rate: {update_rate} FPS")
Visualization - Depth Peeling, FXAA, Hidden Line Removal​
# Toggle rendering options that affect image quality in the 3D view.
# Depth peeling renders translucent geometry in the correct order.
# Enabling it can reduce rendering performance.
view_operations.set_depth_peeling_enabled(True)
print(f"Depth peeling enabled: {view_operations.is_depth_peeling_enabled()}")
# FXAA smooths the edges of 3D geometry (when supported by the graphics card).
view_operations.set_fxaa_enabled(True)
print(f"FXAA enabled: {view_operations.is_fxaa_enabled()}")
# Hidden line removal draws only the front wireframe surface.
view_operations.set_hidden_line_removal_enabled(False)
print(f"Hidden line removal enabled: {view_operations.is_hidden_line_removal_enabled()}")
Visualization - Ambient Occlusion (Depth Perception)​
# Ambient occlusion darkens crevices and contact areas so the shape of surfaces
# is easier to read. It is currently not applied to volume rendering.
# Enable ambient occlusion shadows
view_operations.set_ambient_occlusion_enabled(True)
print(f"Ambient occlusion enabled: {view_operations.is_ambient_occlusion_enabled()}")
# Set the ambient occlusion scale factor. Valid range is -3 to 3.
# A value of 0 enables automatic mode, where the scale is chosen automatically
# based on the sizes of the scene objects.
view_operations.set_ambient_occlusion_scale_factor(0.0) # automatic
print(f"Ambient occlusion scale factor: {view_operations.get_ambient_occlusion_scale_factor()}")
# Use a fixed scale factor instead of automatic mode
# view_operations.set_ambient_occlusion_scale_factor(1.5)
# Disable ambient occlusion again
# view_operations.set_ambient_occlusion_enabled(False)