ThreePipe
    Preparing search index...

    Class PickingPlugin

    Base Class for Sync Viewer Plugins

    Hierarchy (View Summary)

    Index
    _dirty: boolean = false
    _viewer?: ThreeViewer
    _viewerListeners: PartialRecord<IViewerEventTypes, (e: IViewerEvent) => void> = {}
    actions: ViewerAction[] = ...

    The actions of the selection, registered in viewer.actions while the plugin is added (a UI lists them, the app changes their keys there). The edit keys (Mod+A, Mod+D, Mod+C, Mod+X, Mod+V) are letters, as in other apps: they follow the printed key on any layout. The other keys are places on the keyboard (KeyboardEvent.code). Mod is Cmd on a Mac and Ctrl on other platforms.

    autoApplyMaterialOnDrop: boolean = true
    autoFocus: boolean
    autoFocusHover: boolean = false
    constructor: typeof AViewerPluginSync & typeof AViewerPlugin
    dependencies: typeof CameraViewPlugin[] = ...
    duplicateMode: DuplicateMode = 'simple'

    Duplicate offset mode:

    • simple: position/rotation/scale applied independently (Figma-style, straight lines)
    • compound: full matrix delta (circular arrays, spirals)
    enabled: boolean = true
    isViewerPluginSync: true = ...
    keyboardShortcuts: boolean = true

    The keys of actions. Off: the actions have no keys (a UI still lists and runs them).

    set the keys in viewer.actions: setShortcut(id, null) for one action, or enabled = false for all the keys (an app with its own keymap)

    materialTypes: (
        | {
            cls: typeof UnlitMaterial;
            def: UnlitMaterial<IMaterialEventMap>;
            line?: undefined;
            name: string;
        }
        | {
            cls: typeof UnlitLineMaterial;
            def: UnlitLineMaterial<IMaterialEventMap>;
            line: boolean;
            name: string;
        }
        | {
            cls: typeof LineMaterial2;
            def: LineMaterial2<IMaterialEventMap>;
            line: boolean;
            name: string;
        }
        | {
            cls: typeof PhysicalMaterial;
            def?: undefined;
            line?: undefined;
            name: string;
        }
    )[] = ...
    multiSelectEnabled: boolean = true
    selectionMode: "object" | "material" | "texture" | "geometry" = 'object'
    selectionUi: boolean = true

    The UI of the plugin shows the settings of the selection: its uiConfig, its geometry and materials, and the Focus button. Off: it shows only the picking settings, for an app that shows the selection in another place, like the InspectorPlugin of @threepipe/plugin-tweakpane-editor (a uiConfig renders in one UI at a time).

    Note: this is for runtime use only, not serialized

    uiConfig: UiObjectConfig = ...
    widgetEnabled: boolean = true

    Note: this is for runtime use only, not serialized

    OldPluginType: "PickingPlugin" = 'PickingPlugin'
    PluginType: "Picking" = 'Picking'
    • Reset position, rotation, or scale of selected objects to identity. All resets are in local space and undoable.

      Parameters

      • component: "rotation" | "scale" | "position"

      Returns void

    • Toggle visibility of selected objects based on primary selected object's state. If primary is visible → hide all selected. If primary is hidden → show all selected.

      Returns void