| For website(vitepress) development - | For website(vitepress) development - | ||||
| - Run `npm run website:dev` to start the website server. | - Run `npm run website:dev` to start the website server. | ||||
| Some examples requires env variables. | |||||
| - Run `cp examples/sample.env examples/.env` and set the required tokens/keys in the `examples/.env` file. | |||||
| ## Testing | ## Testing | ||||
| TBD | TBD |
| { | { | ||||
| "name": "@threepipe/plugin-tweakpane", | "name": "@threepipe/plugin-tweakpane", | ||||
| "version": "0.5.4", | |||||
| "version": "0.5.5", | |||||
| "lockfileVersion": 3, | "lockfileVersion": 3, | ||||
| "requires": true, | "requires": true, | ||||
| "packages": { | "packages": { | ||||
| "": { | "": { | ||||
| "name": "@threepipe/plugin-tweakpane", | "name": "@threepipe/plugin-tweakpane", | ||||
| "version": "0.5.4", | |||||
| "version": "0.5.5", | |||||
| "license": "Apache-2.0", | "license": "Apache-2.0", | ||||
| "dependencies": { | "dependencies": { | ||||
| "threepipe": "file:./../../src/" | "threepipe": "file:./../../src/" |
| { | { | ||||
| "name": "@threepipe/plugin-tweakpane", | "name": "@threepipe/plugin-tweakpane", | ||||
| "description": "Tweakpane UI Plugin for ThreePipe", | "description": "Tweakpane UI Plugin for ThreePipe", | ||||
| "version": "0.5.4", | |||||
| "version": "0.5.5", | |||||
| "devDependencies": { | "devDependencies": { | ||||
| "tweakpane-image-plugin": "https://github.com/repalash/tweakpane-image-plugin/releases/download/v1.1.404/package.tgz", | "tweakpane-image-plugin": "https://github.com/repalash/tweakpane-image-plugin/releases/download/v1.1.404/package.tgz", | ||||
| "uiconfig-tweakpane": "^0.0.10", | "uiconfig-tweakpane": "^0.0.10", |
| params = params ?? {} | params = params ?? {} | ||||
| params.extensions = ['.jpg', '.png', '.svg', '.hdr', '.ktx2', | params.extensions = ['.jpg', '.png', '.svg', '.hdr', '.ktx2', | ||||
| '.exr', /* '.mp4', '.ogg', '.mov',*/ '.jpeg', | '.exr', /* '.mp4', '.ogg', '.mov',*/ '.jpeg', | ||||
| '.bmp', '.gif', '.webp', '.cube'] | |||||
| '.bmp', '.gif', '.webp', '.cube', '.ktx2', '.avif', '.ico', '.tiff'] // todo update blueprint editor with this list | |||||
| if (typeof params.imageFit === 'undefined') params.imageFit = 'contain' | if (typeof params.imageFit === 'undefined') params.imageFit = 'contain' | ||||
| if (typeof params.clickCallback === 'undefined') params.clickCallback = (ev: MouseEvent, inp: HTMLInputElement) => { | if (typeof params.clickCallback === 'undefined') params.clickCallback = (ev: MouseEvent, inp: HTMLInputElement) => { | ||||
| const target = ev?.target as HTMLElement | const target = ev?.target as HTMLElement |
| const importers: Importer[] = [ | const importers: Importer[] = [ | ||||
| new Importer(SVGTextureLoader, ['svg', 'data:image/svg'], ['image/svg+xml'], false), // todo: use ImageBitmapLoader if supported (better performance) | new Importer(SVGTextureLoader, ['svg', 'data:image/svg'], ['image/svg+xml'], false), // todo: use ImageBitmapLoader if supported (better performance) | ||||
| new Importer(TextureLoader, ['webp', 'png', 'jpeg', 'jpg', 'ico', 'data:image', 'avif'], [ | |||||
| new Importer(TextureLoader, ['webp', 'png', 'jpeg', 'jpg', 'ico', 'data:image', 'avif', 'bmp', 'gif', 'tiff'], [ | |||||
| 'image/webp', 'image/png', 'image/jpeg', 'image/gif', 'image/bmp', 'image/tiff', 'image/x-icon', 'image/avif', | 'image/webp', 'image/png', 'image/jpeg', 'image/gif', 'image/bmp', 'image/tiff', 'image/x-icon', 'image/avif', | ||||
| ], false), // todo: use ImageBitmapLoader if supported (better performance) | ], false), // todo: use ImageBitmapLoader if supported (better performance) | ||||
| value?: IObject3D /* | Material*/ // todo is this required? | value?: IObject3D /* | Material*/ // todo is this required? | ||||
| source?: string // who is triggering the event. so that recursive events can be prevented | source?: string // who is triggering the event. so that recursive events can be prevented | ||||
| } | |||||
| } /* & IObjectSetDirtyOptions*/ | |||||
| } | } | ||||
| } | } | ||||
| // [key: keyof Object3DEventMap]: Object3DEventMap[key] & { | // [key: keyof Object3DEventMap]: Object3DEventMap[key] & { | ||||
| } | } | ||||
| export interface IObjectSetDirtyOptions extends ISetDirtyCommonOptions{ | export interface IObjectSetDirtyOptions extends ISetDirtyCommonOptions{ | ||||
| bubbleToParent?: boolean // bubble event to parent root | |||||
| change?: string | |||||
| refreshScene?: boolean // update scene after setting dirty | |||||
| /** | |||||
| * Bubble event to parent root(scene). | |||||
| */ | |||||
| bubbleToParent?: boolean | |||||
| /** | |||||
| * Change identifier that triggered the setDirty call. | |||||
| */ | |||||
| change?: string | keyof IObject3D | |||||
| /** | |||||
| * Update scene(bounds, shadows, plugins, etc) after setting dirty. | |||||
| */ | |||||
| refreshScene?: boolean | |||||
| geometryChanged?: boolean // whether to refresh stuff like ground. | |||||
| /** | |||||
| * Indicate whether the geometry has been changed to properly refresh plugins like ground, shadows. | |||||
| */ | |||||
| geometryChanged?: boolean | |||||
| /** | /** | ||||
| * update scene after setting dirty | |||||
| * | |||||
| * @deprecated use {@link refreshScene} instead | * @deprecated use {@link refreshScene} instead | ||||
| */ | */ | ||||
| sceneUpdate?: boolean // update scene after setting dirty | |||||
| sceneUpdate?: boolean | |||||
| source?: string // who is triggering the event. so that recursive events can be prevented | |||||
| /** | |||||
| * Source identifier of who is triggering the event. so that recursive events can be prevented | |||||
| */ | |||||
| source?: string | |||||
| // from onChange3 etc. | |||||
| /** | |||||
| * Key to identify the change. This is used to identify the change in the event. Can be used interchangeably with {@link change}. | |||||
| * Set from `onChange3` etc. | |||||
| */ | |||||
| key?: string | key?: string | ||||
| /** | /** | ||||
| isLight?: boolean | isLight?: boolean | ||||
| isCamera?: boolean | isCamera?: boolean | ||||
| isMesh?: boolean | isMesh?: boolean | ||||
| isMeshLine?: boolean | |||||
| isLine?: boolean | isLine?: boolean | ||||
| isLine2?: boolean | |||||
| isLineSegments?: boolean | isLineSegments?: boolean | ||||
| isLineSegments2?: boolean | |||||
| // isGroup?: boolean | // isGroup?: boolean | ||||
| isScene?: boolean | isScene?: boolean | ||||
| // isHelper?: boolean | // isHelper?: boolean | ||||
| */ | */ | ||||
| computeBoundingSphere?(): void; | computeBoundingSphere?(): void; | ||||
| /** | |||||
| * For LineSegments, Line2 etc | |||||
| */ | |||||
| computeLineDistances?(): void | |||||
| /** | /** | ||||
| * Set to `false` to disable propagation of any events from its children. | * Set to `false` to disable propagation of any events from its children. | ||||
| */ | */ |
| // this._mesh.lookAt(new Vector3().fromArray(this._options.up)) | // this._mesh.lookAt(new Vector3().fromArray(this._options.up)) | ||||
| this._mesh.setRotationFromEuler(new Euler(-Math.PI / 2., 0, this._mesh.rotation.z)) | this._mesh.setRotationFromEuler(new Euler(-Math.PI / 2., 0, this._mesh.rotation.z)) | ||||
| this._mesh.matrixWorldNeedsUpdate = true | this._mesh.matrixWorldNeedsUpdate = true | ||||
| this._mesh.setDirty() | |||||
| this._mesh.setDirty({refreshScene: false, source: BaseGroundPlugin.PluginType}) | |||||
| // this._viewer.scene.setDirty() | // this._viewer.scene.setDirty() | ||||
| } | } | ||||
| this._transformNeedRefresh = false | this._transformNeedRefresh = false | ||||
| interface ISceneSetDirtyOptions { | interface ISceneSetDirtyOptions { | ||||
| updateGround?: boolean | updateGround?: boolean | ||||
| } | } | ||||
| } | |||||
| } |