Luce packages
LuceLuce BaseLuciaOS

dymokomi/luced-3d

Source of release 0.11.6

0.11.6 / src / display_settings.luc

## What every viewport pane shows alike (view_state.luc holds what each pane
## has of its own): the analysis modes' settings (zebra and isophote
## stripes, curvature, draft), how the rest of the scene draws around a
## context, normal guides and control hulls, the CAD mesh quality the cook
## meshes bodies at, how Gaussian splats draw, and the Render mode's samples
## and display transform (shared with the Render panel). None of it is part
## of the graph or its undo history.
from luce_3d.graphics import SplatLook, SplatMode

pub class DisplaySettings:
    ## Zebra and isophote stripes: count, dark share, axis (0 X, 1 Y, 2 Z,
    ## 3 the view's up), planar instead of cylindrical, stripes without shading.
    pub var zebra_stripes: int = 20
    pub var zebra_duty: float = 0.5
    pub var zebra_axis: int = 1
    pub var zebra_planar: bool = false
    pub var zebra_stripes_only: bool = false
    ## Curvature (mode 9): the value shown (0 mean, 1 Gaussian, 2 k1, 3 k2,
    ## 4 the larger |k|) and the value the map spans (0: automatic).
    pub var curvature_kind: int = 0
    pub var curvature_range: float = 0.0
    ## Curvature's radius band: where the smallest radius of curvature is
    ## under the least, magenta; over the greatest, grey (0: no limit).
    pub var curvature_band_low: float = 0.0
    pub var curvature_band_high: float = 0.0
    ## Draft (mode 10): the pull direction (0 +X, 1 +Y, 2 +Z, 3 -X, 4 -Y,
    ## 5 -Z) and the draft angle asked for, in degrees.
    pub var draft_axis: int = 1
    pub var draft_angle: float = 1.0
    ## How the rest of the scene draws around a context (context_display.luc):
    ## 0 all, 1 greyed, 2 hidden.
    pub var context_mode: int = 1
    pub var normals_visible: bool = false
    ## How finely CAD bodies are meshed for the viewport (surface divisions,
    ## as the Tessellate node's): finer shows zebra and curvature truer.
    pub var cad_quality: int = 16
    ## Whether control hulls (curve control polygons, CV nets) and camera and
    ## light glyphs are drawn.
    pub var hulls_visible: bool = true
    ## Gaussian splats: dots at their centers instead of shaded splats
    ## (Wireframe always shows centers, as Houdini does), the highest SH band
    ## evaluated, the alpha below which splats are culled, and a multiplier on
    ## their size.
    pub var splat_centers: bool = false
    pub var splat_degree: int = 3
    pub var splat_cull: float = 0.00392156862745098
    pub var splat_scale: float = 1.0
    ## Level of detail: merged splats stand in for runs of splats whose
    ## footprint is under this many pixels (0: off), once the clouds shown
    ## number `splat_lod_from` splats or more (luce-3d's SplatLook).
    pub var splat_lod: float = 2.0
    pub var splat_lod_from: int = 10000000
    ## Render mode: the samples a pixel it refines to, and the display
    ## transform it shares with the Render panel (exposure in stops; neutral
    ## tone mapping, else standard clipping).
    pub var render_samples: int = 256
    pub var render_exposure: float = 0.0
    pub var render_neutral: bool = true

    ## How point clouds draw in a pane shading in display `mode`.
    pub func splat_look(self, mode: int) -> SplatLook:
        var look = SplatLook()
        look.mode = SplatMode.centers if self.splat_centers or mode == 0 else SplatMode.splats
        look.sh_degree = self.splat_degree
        look.alpha_cull = self.splat_cull
        look.scale = self.splat_scale
        look.lod_pixels = self.splat_lod
        look.lod_from = self.splat_lod_from
        return look