Luce packages
LuceLuce BaseLuciaOS

dymokomi/luced-3d

Source of release 0.11.1

0.11.1 / src / node_catalog.luc

## Single source of truth for the node menu, defaults and parameter UI. Each
## node's parameters are rows of its parameter pane (`fields`), after
## Houdini's parameter templates: a kind, a label, the slot its value or text
## lives in, ranges, a menu's items, a unit, a tooltip and conditions. The
## numeric slots (`parameters`) come from the same rows, so defaults, clamping
## and the pane never disagree.
##
## Modeling, curve and field nodes are luce-geocore verbs, from one catalog
## over its two registries (VerbCatalog: mesh verbs, then set verbs): their
## parameters come from the verb, in value slots from 0, and grouped ones have
## the standard Group (text slot 0) and Group Type (value slot
## `group_type_slot`) of Houdini.
from luce_geocore.geocore import Verbs, VerbCatalog
from luce_std import math
from edit_kinds import is_edit, edit_kind_names, edit_kind
from edit_types import first_kind_slot, most_kind_parameters
from usd_nodes import is_usd_path, Composition, first_variant_slot
from fbx_nodes import is_fbx_path

## Value slots a node has, and the one verb nodes keep their Group Type in.
pub let value_slots: int = 16
pub let group_type_slot: int = 15

pub func is_verb(kind: str) -> bool:
    return VerbCatalog.index_of(kind) >= 0

## Verbs that run on the realized mesh (their groups name mesh components).
pub func is_mesh_verb(kind: str) -> bool:
    return Verbs.index_of(kind) >= 0

## Verbs that run on the whole geometry set (curves, fields, conversions).
pub func is_set_verb(kind: str) -> bool:
    let index = VerbCatalog.index_of(kind)
    return index >= 0 and VerbCatalog.is_set(index)

## Every verb's node kind, in the catalog's order.
pub func verbs() -> list[str]:
    let result: list[str] = []
    for index in 0..<VerbCatalog.count():
        result.append(VerbCatalog.name(index))
    return result

## Verb nodes with no input (primitive curves, SDF shapes).
func generators() -> list[str]:
    let result: list[str] = []
    for index in 0..<VerbCatalog.count():
        if VerbCatalog.inputs(index) == 0:
            result.append(VerbCatalog.name(index))
    return result

## Whether the node's second input must be connected.
pub func requires_second(kind: str) -> bool:
    let index = VerbCatalog.index_of(kind)
    if index >= 0:
        return VerbCatalog.second_required(index)
    return not (kind in ["Switch", "Null"])

## One row of a node's parameter pane. `slot` is the first value slot (a
## vector's components take the slots after it) or, for text rows, the text slot.
pub class Parameter:
    pub let name: str
    pub let slot: int
    pub let initial: float
    pub let minimum: float
    pub let maximum: float
    pub let step: float
    pub let integer: bool
    pub let decimals: int
    ## number, integer, vector, toggle, menu, text, path, button, info, folder, separator, color.
    pub var kind: str = "number"
    ## The name conditions and scripts use; the label, lower-cased, when not given.
    pub var key: str = ""
    pub var components: int = 1
    ## A vector's or color's defaults after the first.
    pub var rest: list[float]
    pub var items: str = ""
    pub var suffix: str = ""
    pub var doc: str = ""
    pub var hide_when: str = ""
    pub var disable_when: str = ""
    pub var slider: bool = false
    pub var soft_maximum: float = 0.0
    pub var join: bool = false
    pub var text: str = ""

    pub func init(self, name: str, slot: int, initial: float, minimum: float = -1000.0, maximum: float = 1000.0, step: float = 0.1, integer: bool = false, decimals: int = 3):
        self.name = name
        self.slot = slot
        self.initial = initial
        self.minimum = minimum
        self.maximum = maximum
        self.step = step
        self.integer = integer
        self.decimals = 0 if integer else decimals
        self.rest = []

    ## Whether the row keeps numbers in value slots (not text, buttons or headings).
    pub func valued(self) -> bool:
        return self.kind in ["number", "integer", "vector", "toggle", "menu", "color"]

# -- Row builders.

## A float, `doc` its tooltip; a slider when `slider` (to `soft` when the hard maximum is far).
func number(label: str, slot: int, initial: float, minimum: float = -1000.0, maximum: float = 1000.0, step: float = 0.1,
            doc: str = "", slider: bool = false, soft: float = 0.0, decimals: int = 3, suffix: str = "") -> Parameter:
    let parameter = Parameter(label, slot, initial, minimum, maximum, step, decimals = decimals)
    parameter.doc = doc
    parameter.slider = slider
    parameter.soft_maximum = soft
    parameter.suffix = suffix
    return parameter

func whole(label: str, slot: int, initial: float, minimum: float, maximum: float, doc: str = "", slider: bool = false) -> Parameter:
    let parameter = Parameter(label, slot, initial, minimum, maximum, 1.0, true)
    parameter.kind = "integer"
    parameter.doc = doc
    parameter.slider = slider
    return parameter

## Components on one row, in `slot` and the slots after it.
func vector(label: str, slot: int, defaults: list[float], doc: str = "", minimum: float = -1000.0, maximum: float = 1000.0, suffix: str = "") -> Parameter:
    let parameter = Parameter(label, slot, defaults[0], minimum, maximum)
    parameter.kind = "vector"
    parameter.components = defaults.length
    for component in 1..<defaults.length:
        parameter.rest.append(defaults[component])
    parameter.doc = doc
    parameter.suffix = suffix
    return parameter

func toggle(label: str, slot: int, initial: float, doc: str = "") -> Parameter:
    let parameter = Parameter(label, slot, initial, 0.0, 1.0, 1.0, true)
    parameter.kind = "toggle"
    parameter.doc = doc
    return parameter

## A choice of `items` (`label` or `label=value`, `|` between); its value is the item's.
func menu(label: str, slot: int, items: str, initial: float, doc: str = "") -> Parameter:
    var highest = 0.0
    var index = 0
    for item in items.split("|"):
        let parts = item.split("=")
        let value = float(index)
        highest = larger(highest, value if parts.length < 2 else parse_number(parts[1]))
        index += 1
    let parameter = Parameter(label, slot, initial, 0.0, highest, 1.0, true)
    parameter.kind = "menu"
    parameter.items = items
    parameter.doc = doc
    return parameter

## A line of text in text slot `slot`.
func entry(label: str, slot: int, doc: str = "", kind: str = "text") -> Parameter:
    let parameter = Parameter(label, slot, 0.0)
    parameter.kind = kind
    parameter.doc = doc
    return parameter

func heading(label: str, kind: str = "folder") -> Parameter:
    let parameter = Parameter(label, -1, 0.0)
    parameter.kind = kind
    return parameter

## A small whole number written as text ("2" in "Faces=2").
func parse_number(written: str) -> float:
    var value = 0.0
    for digit in written.trim():
        let at = "0123456789".index_of(digit) else return value
        value = value * 10.0 + float(at)
    return value

func larger(a: float, b: float) -> float:
    return a if a > b else b

pub func sources() -> list[str]:
    return ["Cube", "Grid", "Sphere", "Cylinder", "Cone", "Torus", "File", "Group"] + generators()

pub func categories() -> list[str]:
    return ["Primitives", "Modeling", "Deform", "Curves", "Volumes", "Transform / Copy", "Attributes", "Utility", "File I/O", "All"]

pub func category(kind: str) -> str:
    let verb = VerbCatalog.index_of(kind)
    if verb >= 0:
        return VerbCatalog.category(verb)
    if kind in ["File", "Cache", "Export"]:
        return "File I/O"
    if kind == "Group":
        return "Utility"
    if kind in sources():
        return "Primitives"
    if kind in ["Transform", "Mirror", "CopyTransform", "CopyToPoints", "MatchSize"]:
        return "Transform / Copy"
    if kind.starts_with("Attribute") or kind in ["Selection Group", "Normal", "Measure", "UVProject", "Color"]:
        return "Attributes"
    if kind in ["Merge", "Null", "Switch"]:
        return "Utility"
    return "Modeling"

pub func kinds() -> list[str]:
    return sources() + ["Transform", "Tessellate", "Cache", "Export", "Blast"] + edit_kind_names() + ["Merge", "Null", "Switch"] + verbs() + ["Mirror", "CopyTransform", "CopyToPoints", "MatchSize", "AttributeCreate", "AttributeRandomize", "AttributeDelete", "AttributeRename", "AttributePromote", "Selection Group", "Normal", "Measure", "UVProject", "Color"]

pub func input_count(kind: str) -> int:
    let verb = VerbCatalog.index_of(kind)
    if verb >= 0:
        return VerbCatalog.inputs(verb)
    return 0 if kind in sources() else (2 if kind in ["Merge", "Switch", "CopyToPoints"] else 1)

pub func has_group(kind: str) -> bool:
    let verb = VerbCatalog.index_of(kind)
    if verb >= 0:
        return VerbCatalog.grouped(verb)
    return kind in ["Blast", "Selection Group"]

pub func has_attribute_name(kind: str) -> bool:
    return kind in ["AttributeCreate", "AttributeRandomize", "AttributeDelete", "AttributeRename", "AttributePromote", "Selection Group"]

## The value slots of a node: one Parameter a slot, a vector's components
## each their own, for defaults and clamping.
pub func parameters(kind: str, path: str = "") -> list[Parameter]!:
    let result: list[Parameter] = []
    for row in fields(kind, path):
        if not row.valued():
            continue
        if row.components == 1:
            result.append(row)
            continue
        for component in 0..<row.components:
            let value = row.initial if component == 0 else row.rest[component - 1]
            result.append(Parameter(row.name + " " + ["X", "Y", "Z", "W"][component], row.slot + component, value, row.minimum, row.maximum, row.step, row.integer, row.decimals))
    return result

## Every row of a node's parameter pane, in order; a USD File node's
## composition rows come from its composed `stage`.
pub func fields(kind: str, path: str = "", stage: Composition? = none) -> list[Parameter]!:
    let rows: list[Parameter] = []
    if kind == "File":
        rows.append(entry("File", 0, "The geometry file: OBJ, FBX, STEP or USD (.usd, .usda, .usdc, .usdz).", "path"))
        let reload = heading("Reload", "button")
        reload.doc = "Read the file again from disk."
        rows.append(reload)
        let source = path.trim().lower()
        if source.ends_with(".step") or source.ends_with(".stp"):
            rows.append(number("STEP tolerance", 0, 0.0, 0.0, 1.0, 0.00001, "Model tolerance in file units; 0 uses the file's own.", decimals = 9))
        if is_usd_path(source):
            for row in usd_fields(stage):
                rows.append(row)
        if is_fbx_path(source):
            for row in fbx_fields():
                rows.append(row)
    if kind == "Cache":
        rows.append(entry("File", 0, "The .prism file the cooked geometry is saved to (and loaded from).", "path"))
    if kind == "Export":
        rows.append(entry("File", 0, "Where the input is written, in the format its extension names: .usd, .usda, .usdc, .usdz, .fbx, .obj or .prism.", "path"))
        rows.append(entry("Root prim", 1, "USD: the prim elements without a path attribute go under (empty: geo); it becomes the default prim."))
    if has_group(kind):
        rows.append(entry("Group", 0, "Elements to work on, in Houdini's group syntax: empty or * for all, 0 2-5 and 0-99:2 for numbers, names and globs, @P.y>0 or @name tests, ^ to remove, & to intersect, grow(x) and loop(x)."))
    if is_verb(kind) and has_group(kind):
        rows.append(menu("Group Type", group_type_slot, "Guess from group|Points|Edges|Primitives|Vertices", 0.0, "What the group's numbers name; Guess reads the named groups' type, else the operation's own."))
    if has_attribute_name(kind):
        rows.append(entry("Attribute", 1, "The attribute's name."))
    if kind == "AttributeRename":
        rows.append(entry("New name", 2, "What the attribute is called after."))
    for row in value_fields(kind):
        rows.append(row)
    return rows

## A File node's rows for a USD stage (usd_nodes.load_usd reads them), in
## value slots from 1: slot 0 keeps a STEP tolerance across format changes.
## Then its composition: what the stage holds, the variant selections text
## and a menu for each of its first variant sets, and the payload globs.
func usd_fields(stage: Composition?) -> list[Parameter]:
    let rows = load_fields()
    if let composed = stage:
        let summary = heading("Stage", "info")
        summary.text = composed.description()
        rows.append(summary)
    rows.append(entry("Variants", 1, "Variant selections in USD path syntax, blank separated: /Kitchen{look=clean} /Kitchen/Chair{size=big}. The menus below select after them."))
    if let composed = stage:
        let sets = composed.menu_sets()
        for index in 0..<sets.length:
            let shown = sets[index]
            let authored = shown.selection if shown.selection != "" else "none"
            rows.append(menu(f"{shown.prim.split("/")[-1]} {shown.name}", first_variant_slot + index, f"Authored ({authored})|" + shown.options.join("|"), 0.0,
                             f"{shown.prim}: variant set {shown.name}. Authored keeps the stage's own selection."))
    rows.append(entry("Load payloads", 2, "Load only the payloads of prims whose path matches one of these globs (* any run, ? one character), blank separated. Empty loads every payload, - none."))
    return rows

## The load options of a USD File node, value slots 1 to 8.
func load_fields() -> list[Parameter]:
    let set_time = toggle("Set time", 2, 0.0, "Off: the stage's start time, else each attribute's first sample. On: the time below.")
    set_time.key = "settime"
    let at = number("Time", 3, 0.0, -1000000.0, 1000000.0, 1.0, "The time code values are read at.")
    at.disable_when = "{ settime == 0 }"
    return [menu("Import", 1, "Flatten, keep instancing|Flatten everything", 0.0, "Keep point instancers as instances, or bake every instance into the meshes, curves and points."),
            set_time, at,
            toggle("Render purpose", 4, 1.0, "Load prims whose purpose is render."),
            toggle("Proxy purpose", 5, 0.0, "Load prims whose purpose is proxy."),
            toggle("Guide purpose", 6, 0.0, "Load prims whose purpose is guide."),
            toggle("Convert to Y-up meters", 7, 0.0, "Turn a Z-up stage Y-up and scale it to meters; off keeps the stage's own axes and units (in the usd.* detail attributes)."),
            toggle("Subdivide as authored", 8, 1.0, "Show meshes without a subdivisionScheme as Catmull-Clark surfaces, as USD's default says; off shows their polygons.")]

## A File node's rows for an FBX file (fbx_nodes.load_fbx reads them), in
## value slots from 1: slot 0 keeps a STEP tolerance across format changes.
func fbx_fields() -> list[Parameter]:
    let set_frame = toggle("Set frame", 5, 0.0, "Off: the file's pose as saved. On: the first animation stack at the frame below.")
    set_frame.key = "setframe"
    let frame = number("Frame", 6, 0.0, -1000000.0, 1000000.0, 1.0, "The frame the animation is read at, at the file's frame rate.")
    frame.disable_when = "{ setframe == 0 }"
    return [menu("Import", 1, "Merge into one mesh|Keep hierarchy", 0.0, "Merge every model's mesh into one mesh in world space (each face's model path in `path`), or keep each model's mesh in its own space, placed as an instance."),
            toggle("Instancing", 2, 1.0, "Load a mesh several models share once, as instances; off copies it for each model."),
            toggle("Convert to Y-up meters", 3, 0.0, "Turn the file Y-up and scale it to meters; off keeps its own axes and units (in the fbx.* detail attributes)."),
            toggle("Import normals", 4, 1.0, "Read the file's normals as N; off shows face normals."),
            set_frame, frame,
            toggle("Deform", 7, 1.0, "Apply blend shapes and skins; off shows the meshes as modeled.")]

## The format of a File node's path ("usd", "fbx", "step" or ""), whose
## rows it has.
pub func file_format(path: str) -> str:
    let source = path.trim().lower()
    if source.ends_with(".step") or source.ends_with(".stp"):
        return "step"
    if is_fbx_path(source):
        return "fbx"
    return "usd" if is_usd_path(source) else ""

## The numeric rows of each node kind.
func value_fields(kind: str) -> list[Parameter]:
    let verb = VerbCatalog.index_of(kind)
    if verb >= 0:
        return verb_fields(verb)
    if kind == "Blast":
        return [toggle("Isolate group", 0, 0.0, "On: keep only the group. Off: delete it.")]
    if kind == "Export":
        return [toggle("Split by path", 0, 1.0, "USD: one prim per path attribute value, as the file was imported; off writes one prim per family."),
                toggle("Precise points", 1, 0.0, "USD: double-precision points, keeping large coordinates exact.")]
    if kind == "Cache":
        return [toggle("Load from disk", 0, 0.0, "On: read the file and skip everything upstream. Off: write the input's result to the file when it changes, and pass it on.")]
    if kind == "Tessellate":
        return [whole("Surface divisions", 0, 16.0, 1.0, 64.0, "Subdivisions per CAD surface span.", true),
                number("Target edge", 1, 0.0, 0.0, 100000.0, 0.5, "Longest triangle edge in model units; 0 leaves it to the divisions.", soft = 10.0)]
    if kind == "Cube":
        return [number("Size", 0, 2.0, 0.001, 100.0, 0.1, "Edge length before the size factors.", true, 10.0),
                vector("Position", 1, [0.0, 0.0, 0.0], "Where the cube's center sits."),
                vector("Size factors", 7, [1.0, 1.0, 1.0], "Width, height and depth as factors of Size.", 0.001, 1000.0)]
    if kind in ["Grid", "Sphere", "Cylinder", "Cone", "Torus"]:
        let grid = kind == "Grid"
        let result = [number("Size" if grid else "Radius", 0, 2.0 if grid else 1.0, 0.001, 100.0, 0.1, "Overall size." if grid else "Distance from the center to the surface.", true, 10.0),
                      whole("Divisions", 1, 4.0 if grid else 16.0, 1.0 if grid else 4.0, 64.0, "Rows and columns." if grid else "Segments around.", true)]
        if kind == "Torus":
            result.append(number("Tube radius", 2, 0.3, 0.001, 100.0, 0.1, "Radius of the ring's cross section.", true, 2.0))
        elif kind in ["Cylinder", "Cone"]:
            result.append(number("Height", 2, 2.0, 0.001, 100.0, 0.1, "Length along Y.", true, 10.0))
        return result
    if kind in ["Transform", "Group"]:
        return [vector("Translate", 1, [0.0, 0.0, 0.0], "Moves the geometry, after rotating and scaling."),
                vector("Rotate", 4, [0.0, 0.0, 0.0], "Rotation about X, then Y, then Z, in degrees, about the pivot.", suffix = "°"),
                vector("Scale", 7, [1.0, 1.0, 1.0], "Scale along each axis about the pivot; never zero."),
                vector("Pivot", 10, [0.0, 0.0, 0.0], "The point rotation and scale happen about.")]
    if kind == "Mirror":
        return [menu("Axis", 0, "X|Y|Z", 0.0, "The axis the mirror plane faces."),
                toggle("Keep original", 1, 1.0, "Keep the input beside its mirror image.")]
    if kind == "CopyTransform":
        let step = vector("Step", 1, [2.5, 0.0, 0.0], "Offset between one copy and the next.")
        step.disable_when = "{ copies <= 1 }"
        let copies = whole("Copies", 0, 3.0, 1.0, 64.0, "How many, the source included.", true)
        copies.key = "copies"
        return [copies, step]
    if kind == "Switch":
        return [menu("Input", 0, "First|Second", 0.0, "Which input passes through.")]
    if kind == "MatchSize":
        return [number("Longest side", 0, 2.0, 0.001, 1000.0, 0.1, "The size the longest bounding-box side is scaled to.", soft = 10.0)]
    if kind in ["AttributeCreate", "AttributeRandomize", "AttributeDelete", "AttributeRename", "AttributePromote", "Selection Group"]:
        let domains = "Points=0|Vertices=1|Faces=2|Edges=4" if kind == "Selection Group" else "Points|Vertices|Faces|Detail"
        let result = [menu("Domain", 0, domains, 0.0, "Which elements carry the group." if kind == "Selection Group" else "Which elements carry the attribute.")]
        if kind == "AttributePromote":
            result.append(menu("Target domain", 1, domains, 2.0, "The domain the attribute moves to."))
        if kind in ["AttributeCreate", "AttributeRandomize"]:
            let size = whole("Tuple size", 1, 1.0, 1.0, 4.0, "Components per element: 1 for a float, 3 for a vector.")
            size.key = "size"
            result.append(size)
            result.append(toggle("Integer", 2, 0.0, "Store whole numbers."))
            result.append(vector("Maximum" if kind == "AttributeRandomize" else "Value", 3, [1.0, 0.0, 0.0, 0.0], "The value per component; components past the tuple size are unused."))
            if kind == "AttributeRandomize":
                result.append(whole("Seed", 7, 1.0, 0.0, 100000.0, "Another seed gives other random values."))
        return result
    if kind == "Normal":
        return [menu("Domain", 0, "Points=0|Faces=2", 0.0, "Smooth normals on points, or flat normals on faces.")]
    if kind == "UVProject":
        return [number("UV scale", 0, 1.0, 0.001, 1000.0, 0.1, "Texture repeats per model unit.", soft = 10.0)]
    if kind == "Color":
        let color = vector("Color", 0, [0.8, 0.4, 0.1], "Point color Cd, linear RGB, multiplied by the material.", 0.0, 1.0)
        color.kind = "color"
        return [color]
    if is_edit(kind):
        return [number("Tool amount", 0, 0.5, -100.0, 100.0, 0.05, "Inset: thickness. Bevel: offset. Rotate: Y degrees. Scale: factor. Fuse: tolerance. Crease: sharpness.", soft = 2.0),
                number("Soft radius", 1, 0.0, 0.0, 100000.0, 0.1, "Points within this distance of the selection follow its moves, less the farther they are. 0 is off.", soft = 5.0),
                menu("Falloff", 2, "Linear|Quadratic|Cubic|Smooth", 3.0, "How the soft weight falls off with distance."),
                menu("Symmetry", 3, "None|X|Y|Z", 0.0, "Mirror every tool across the plane through the origin normal to this axis."),
                toggle("Keep selection", 4, 0.0, "Keep the selected components through topology tools, instead of selecting what the tool made.")] + kind_rows(kind)
    return []

## An Edit kind's own parameters, in value slots from first_kind_slot.
func kind_rows(kind: str) -> list[Parameter]:
    let rows: list[Parameter] = []
    let edit = edit_kind(kind) else return rows
    for at in 0..<(edit.parameters.length if edit.parameters.length < most_kind_parameters else most_kind_parameters):
        let parameter = edit.parameters[at]
        let slot = first_kind_slot + at
        if parameter.kind == "toggle":
            rows.append(toggle(parameter.label, slot, parameter.initial, parameter.doc))
        else:
            rows.append(number(parameter.label, slot, parameter.initial, parameter.minimum, parameter.maximum, 0.01, parameter.doc, soft = math.min(parameter.maximum, 10.0)))
    return rows

## A verb's parameters as rows, in consecutive value slots from 0.
func verb_fields(verb: int) -> list[Parameter]:
    let result: list[Parameter] = []
    var slot = 0
    for parm in 0..<VerbCatalog.parm_count(verb):
        let label = VerbCatalog.parm_label(verb, parm)
        let kind = VerbCatalog.parm_kind(verb, parm)
        let initial = VerbCatalog.parm_initial(verb, parm)
        let low = VerbCatalog.parm_minimum(verb, parm)
        let high = VerbCatalog.parm_maximum(verb, parm)
        let doc = VerbCatalog.parm_doc(verb, parm)
        var row = number(label, slot, initial, low, high, 0.1, doc, VerbCatalog.parm_soft(verb, parm) > 0.0, VerbCatalog.parm_soft(verb, parm))
        if kind == 1:
            row = whole(label, slot, initial, low, high, doc, true)
        elif kind == 2:
            row = toggle(label, slot, initial, doc)
        elif kind == 3:
            let defaults: list[float] = []
            for component in 0..<VerbCatalog.parm_components(verb, parm):
                defaults.append(initial)
            row = vector(label, slot, defaults, doc, low, high)
        elif kind == 4:
            row = menu(label, slot, VerbCatalog.parm_choices(verb, parm), initial, doc)
        result.append(row)
        slot += row.components
    return result

pub func description(kind: str) -> str:
    let verb = VerbCatalog.index_of(kind)
    if verb >= 0:
        return VerbCatalog.description(verb)
    if kind == "Group":
        return "Nested network / double-click to enter"
    if is_edit(kind):
        return "Select and edit in the viewport; each edit is a step you can undo"
    if kind == "Cache":
        return "Save the cooked input to disk, or load it back and freeze upstream"
    if kind == "Export":
        return "Write the input to a USD, FBX, OBJ or prism file and pass it on"
    if kind == "CopyToPoints":
        return "Input 1: source / Input 2: target points"
    if kind in ["AttributeCreate", "AttributeRandomize", "AttributeDelete", "Selection Group"]:
        return "P: points / V: corners / F: faces / D: detail"
    if kind == "Color":
        return "Linear RGB point Cd, multiplied by material"
    return "Geometry operator"