Transfr Share Plugin A sample plugin that provides helpers to export and upload scene to a server and get a shareable link. It uses the options from the AssetExporterPlugin to export the scene or object, and can be configured using it's ui.

Uses the free service transfr.one by default which deletes the files after a certain time, but the url can be changed to a custom backend or a self-hosted version of transfr.

Note: since the uploaded files are publicly accessible by anyone by default, it is recommended to encrypt the file using the exporter options or use a secure backend.

Hierarchy

  • AViewerPluginSync
    • TransfrSharePlugin

Constructors

Properties

_dirty: boolean = false
_viewer?: ThreeViewer
_viewerListeners: PartialRecord<
    | "dispose"
    | "*"
    | "update"
    | "preRender"
    | "postRender"
    | "preFrame"
    | "postFrame"
    | "addPlugin"
    | "removePlugin"
    | "renderEnabled"
    | "renderDisabled",
    (e: IViewerEvent) => void,
> = {}
baseUrls: Record<string, string> = ...
constructor: typeof AViewerPluginSync & typeof AViewerPlugin
dependencies: typeof AssetExporterPlugin[] = ...
enabled: boolean = true
pageUrl: string = window.location.href
queryParam: string = 'm'
serverUrl: string = 'https://bee.transfr.one/scene.glb'
toJSON: any = null
uiConfig?: UiObjectConfig = undefined
OldPluginType?: string
PluginType: "TransfrSharePlugin" = 'TransfrSharePlugin'

Accessors

Methods

  • Parameters

    • e: IViewerEvent

    Returns IViewerEvent

  • Parameters

    • Optionalprefix: string

    Returns string

  • Returns ISerializedConfig | Record<string, never>

  • Parameters

    • state: any

    Returns Promise<void>

  • Parameters

    • viewer: ThreeViewer

    Returns void

  • Parameters

    • viewer: ThreeViewer

    Returns void

  • Upload the scene and copy the link to clipboard along with the base url and query param if provided

    Parameters

    • Optionalbase: string | URL
    • Optionalparam: string

    Returns Promise<null | string>