| { | { | ||||
| "name": "threepipe", | "name": "threepipe", | ||||
| "version": "0.0.5", | |||||
| "version": "0.0.6-dev", | |||||
| "lockfileVersion": 2, | "lockfileVersion": 2, | ||||
| "requires": true, | "requires": true, | ||||
| "packages": { | "packages": { | ||||
| "": { | "": { | ||||
| "name": "threepipe", | "name": "threepipe", | ||||
| "version": "0.0.5", | |||||
| "version": "0.0.6-dev", | |||||
| "license": "MIT", | "license": "MIT", | ||||
| "dependencies": { | "dependencies": { | ||||
| "@types/three": "https://github.com/repalash/three-ts-types/releases/download/v0.152.1008/package.tgz", | |||||
| "@types/three": "https://github.com/repalash/three-ts-types/releases/download/v0.152.1010/package.tgz", | |||||
| "@types/webxr": "^0.5.1", | "@types/webxr": "^0.5.1", | ||||
| "@types/wicg-file-system-access": "^2020.9.5", | "@types/wicg-file-system-access": "^2020.9.5", | ||||
| "ts-browser-helpers": "^0.6.0" | "ts-browser-helpers": "^0.6.0" | ||||
| "rollup-plugin-license": "^3.0.1", | "rollup-plugin-license": "^3.0.1", | ||||
| "rollup-plugin-postcss": "^4.0.2", | "rollup-plugin-postcss": "^4.0.2", | ||||
| "stats.js": "^0.17.0", | "stats.js": "^0.17.0", | ||||
| "three": "https://github.com/repalash/three.js-modded/releases/download/v0.152.2007/package.tgz", | |||||
| "three": "https://github.com/repalash/three.js-modded/releases/download/v0.152.2009/package.tgz", | |||||
| "tslib": "^2.5.0", | "tslib": "^2.5.0", | ||||
| "tweakpane": "^3.1.9", | "tweakpane": "^3.1.9", | ||||
| "tweakpane-image-plugin": "https://github.com/repalash/tweakpane-image-plugin/releases/download/v1.1.403/package.tgz", | "tweakpane-image-plugin": "https://github.com/repalash/tweakpane-image-plugin/releases/download/v1.1.403/package.tgz", | ||||
| "dev": true | "dev": true | ||||
| }, | }, | ||||
| "node_modules/@types/three": { | "node_modules/@types/three": { | ||||
| "version": "0.152.1008", | |||||
| "resolved": "https://github.com/repalash/three-ts-types/releases/download/v0.152.1008/package.tgz", | |||||
| "integrity": "sha512-TAoOxd0SXOsgp2q0SzLWSmZrEQO+bUzhgMczw6JlNGhaNDR/uNzr915DaD/cOw6KC592QfTC/RVhrFNV7e9WmA==", | |||||
| "version": "0.152.1010", | |||||
| "resolved": "https://github.com/repalash/three-ts-types/releases/download/v0.152.1010/package.tgz", | |||||
| "integrity": "sha512-Mnl6+lJhZUj2zLMqK7a5qrG8QLHHqHVQ8MJ7i5NzjGZ/ZJ//GqY6B24q7Z8F3ei8ASWQv0YteEfH5noc3Z2lMQ==", | |||||
| "dependencies": { | "dependencies": { | ||||
| "@tweenjs/tween.js": "~18.6.4", | "@tweenjs/tween.js": "~18.6.4", | ||||
| "fflate": "~0.6.9", | "fflate": "~0.6.9", | ||||
| } | } | ||||
| }, | }, | ||||
| "node_modules/three": { | "node_modules/three": { | ||||
| "version": "0.152.2007", | |||||
| "resolved": "https://github.com/repalash/three.js-modded/releases/download/v0.152.2007/package.tgz", | |||||
| "integrity": "sha512-++0udqOCSmsl6U1OaB0QBIVTTUeKAkG6PnWLqPyAwUESZFC175oqZVX2UmcY63iTDdVyVkNKNYWXVKh0gc9Tuw==", | |||||
| "version": "0.152.2009", | |||||
| "resolved": "https://github.com/repalash/three.js-modded/releases/download/v0.152.2009/package.tgz", | |||||
| "integrity": "sha512-qUqy+/uRzvW3F4xvyRCnnJVZ8yssgSYurrUCU1I3AJq7lz/p2CoWbdZYWXBXpNxR8+0Awx9S6Cy0Ah5Lq7g6Hw==", | |||||
| "dev": true, | "dev": true, | ||||
| "license": "MIT" | "license": "MIT" | ||||
| }, | }, | ||||
| "dev": true | "dev": true | ||||
| }, | }, | ||||
| "@types/three": { | "@types/three": { | ||||
| "version": "https://github.com/repalash/three-ts-types/releases/download/v0.152.1008/package.tgz", | |||||
| "integrity": "sha512-TAoOxd0SXOsgp2q0SzLWSmZrEQO+bUzhgMczw6JlNGhaNDR/uNzr915DaD/cOw6KC592QfTC/RVhrFNV7e9WmA==", | |||||
| "version": "https://github.com/repalash/three-ts-types/releases/download/v0.152.1010/package.tgz", | |||||
| "integrity": "sha512-Mnl6+lJhZUj2zLMqK7a5qrG8QLHHqHVQ8MJ7i5NzjGZ/ZJ//GqY6B24q7Z8F3ei8ASWQv0YteEfH5noc3Z2lMQ==", | |||||
| "requires": { | "requires": { | ||||
| "@tweenjs/tween.js": "~18.6.4", | "@tweenjs/tween.js": "~18.6.4", | ||||
| "fflate": "~0.6.9", | "fflate": "~0.6.9", | ||||
| } | } | ||||
| }, | }, | ||||
| "three": { | "three": { | ||||
| "version": "https://github.com/repalash/three.js-modded/releases/download/v0.152.2007/package.tgz", | |||||
| "integrity": "sha512-++0udqOCSmsl6U1OaB0QBIVTTUeKAkG6PnWLqPyAwUESZFC175oqZVX2UmcY63iTDdVyVkNKNYWXVKh0gc9Tuw==", | |||||
| "version": "https://github.com/repalash/three.js-modded/releases/download/v0.152.2009/package.tgz", | |||||
| "integrity": "sha512-qUqy+/uRzvW3F4xvyRCnnJVZ8yssgSYurrUCU1I3AJq7lz/p2CoWbdZYWXBXpNxR8+0Awx9S6Cy0Ah5Lq7g6Hw==", | |||||
| "dev": true | "dev": true | ||||
| }, | }, | ||||
| "through": { | "through": { |
| "rollup-plugin-license": "^3.0.1", | "rollup-plugin-license": "^3.0.1", | ||||
| "rollup-plugin-postcss": "^4.0.2", | "rollup-plugin-postcss": "^4.0.2", | ||||
| "stats.js": "^0.17.0", | "stats.js": "^0.17.0", | ||||
| "three": "https://github.com/repalash/three.js-modded/releases/download/v0.152.2007/package.tgz", | |||||
| "three": "https://github.com/repalash/three.js-modded/releases/download/v0.152.2009/package.tgz", | |||||
| "tslib": "^2.5.0", | "tslib": "^2.5.0", | ||||
| "tweakpane": "^3.1.9", | "tweakpane": "^3.1.9", | ||||
| "@tweakpane/core": "^1.1.8", | "@tweakpane/core": "^1.1.8", | ||||
| "tweakpane-image-plugin": "https://github.com/repalash/tweakpane-image-plugin/releases/download/v1.1.403/package.tgz" | "tweakpane-image-plugin": "https://github.com/repalash/tweakpane-image-plugin/releases/download/v1.1.403/package.tgz" | ||||
| }, | }, | ||||
| "dependencies": { | "dependencies": { | ||||
| "@types/three": "https://github.com/repalash/three-ts-types/releases/download/v0.152.1008/package.tgz", | |||||
| "@types/three": "https://github.com/repalash/three-ts-types/releases/download/v0.152.1010/package.tgz", | |||||
| "@types/webxr": "^0.5.1", | "@types/webxr": "^0.5.1", | ||||
| "@types/wicg-file-system-access": "^2020.9.5", | "@types/wicg-file-system-access": "^2020.9.5", | ||||
| "ts-browser-helpers": "^0.6.0" | "ts-browser-helpers": "^0.6.0" | ||||
| "uiconfig.js": "^0.0.4", | "uiconfig.js": "^0.0.4", | ||||
| "ts-browser-helpers": "^0.5.0", | "ts-browser-helpers": "^0.5.0", | ||||
| "uiconfig-tweakpane": "^0.0.3", | "uiconfig-tweakpane": "^0.0.3", | ||||
| "three": "https://github.com/repalash/three.js-modded/releases/download/v0.152.2007/package.tgz", | |||||
| "three-f": "https://github.com/repalash/three.js-modded/archive/refs/tags/v0.152.2007.tar.gz", | |||||
| "@types/three": "https://github.com/repalash/three-ts-types/releases/download/v0.152.1008/package.tgz", | |||||
| "@types/three-f": "https://github.com/repalash/three-ts-types/archive/refs/tags/v0.152.1008.tar.gz", | |||||
| "three": "https://github.com/repalash/three.js-modded/releases/download/v0.152.2009/package.tgz", | |||||
| "three-f": "https://github.com/repalash/three.js-modded/archive/refs/tags/v0.152.2009.tar.gz", | |||||
| "@types/three": "https://github.com/repalash/three-ts-types/releases/download/v0.152.1010/package.tgz", | |||||
| "@types/three-f": "https://github.com/repalash/three-ts-types/archive/refs/tags/v0.152.1010.tar.gz", | |||||
| "@types/three-pkg": "https://gitpkg.now.sh/repalash/three-ts-types/types/three?modded_three", | "@types/three-pkg": "https://gitpkg.now.sh/repalash/three-ts-types/types/three?modded_three", | ||||
| "tweakpane-image-plugin": "git+ssh://github.com/repalash/tweakpane-image-plugin.git#52d5542047fd07d2e7225b5b67c9f7620366f2c7" | "tweakpane-image-plugin": "git+ssh://github.com/repalash/tweakpane-image-plugin.git#52d5542047fd07d2e7225b5b67c9f7620366f2c7" | ||||
| }, | }, |
| */ | */ | ||||
| exportExt?: string, | exportExt?: string, | ||||
| /** | /** | ||||
| * Export the viewer config (scene settings). | |||||
| * only works for rootSceneModelRoot. default = true | |||||
| * Export and bundle the viewer config (scene settings). | |||||
| * only works for rootSceneModelRoot and supported only in GLTFExporter2 {@link GLTFExporter2Options.viewerConfig} | |||||
| * @default true | |||||
| */ | */ | ||||
| viewerConfig?: boolean, | viewerConfig?: boolean, | ||||
| } & GLTFExporter2Options & AnyOptions | |||||
| [key: string]: any | |||||
| } & GLTFExporter2Options | |||||
| export interface IAssetExporter extends IEventDispatcher<'exportFile' | 'exporterCreate'>{ | export interface IAssetExporter extends IEventDispatcher<'exportFile' | 'exporterCreate'>{ | ||||
| getExporter(...ext: string[]): IExporter|undefined | getExporter(...ext: string[]): IExporter|undefined |
| } from '../gltf' | } from '../gltf' | ||||
| import {glbEncryptionProcessor} from '../gltf/gltfEncyptionHelpers' | import {glbEncryptionProcessor} from '../gltf/gltfEncyptionHelpers' | ||||
| export type GLTFExporter2Options = GLTFExporterOptions & { | |||||
| export type GLTFExporter2Options = { | |||||
| /** | /** | ||||
| * embed images in glb even when remote url is available, {@default false} | * embed images in glb even when remote url is available, {@default false} | ||||
| */ | */ | ||||
| encryptKey?: string|Uint8Array, | encryptKey?: string|Uint8Array, | ||||
| [key: string]: any | [key: string]: any | ||||
| } | |||||
| } & GLTFExporterOptions | |||||
| export class GLTFExporter2 extends GLTFExporter implements IExportParser { | export class GLTFExporter2 extends GLTFExporter implements IExportParser { | ||||
| } | } | ||||
| // eslint-disable-next-line @typescript-eslint/naming-convention | // eslint-disable-next-line @typescript-eslint/naming-convention | ||||
| onDone(Object.assign(o, {__isGLTFOutput: true})) | onDone(Object.assign(o, {__isGLTFOutput: true})) | ||||
| // @ts-expect-error wrong ts | |||||
| }, onError, gltfOptions, new GLTFWriter2()) | }, onError, gltfOptions, new GLTFWriter2()) | ||||
| } | } | ||||
| // Add extra check for null images. This is set in processTexture when we have a rootPath | // Add extra check for null images. This is set in processTexture when we have a rootPath | ||||
| processImage(image: any, format: PixelFormat, flipY: boolean, mimeType = 'image/png') { | processImage(image: any, format: PixelFormat, flipY: boolean, mimeType = 'image/png') { | ||||
| if (!image) return -1 | if (!image) return -1 | ||||
| // @ts-expect-error todo: update in three-ts-types | |||||
| return super.processImage(image, format, flipY, mimeType, image._savePreview ? 32 : undefined, image._savePreview ? 32 : undefined) | return super.processImage(image, format, flipY, mimeType, image._savePreview ? 32 : undefined, image._savePreview ? 32 : undefined) | ||||
| } | } | ||||
| const d = encodingVersion < 3 ? halfFloatToRgbe2(buffer.data, 4) : halfFloatToRgbe(buffer.data, 4) | const d = encodingVersion < 3 ? halfFloatToRgbe2(buffer.data, 4) : halfFloatToRgbe(buffer.data, 4) | ||||
| const id = new ImageData(d, buffer.width, buffer.height) | const id = new ImageData(d, buffer.width, buffer.height) | ||||
| // @ts-expect-error patched three. todo: update the types | |||||
| const b64 = ImageUtils.getDataURL(id, true).split(',')[1] | const b64 = ImageUtils.getDataURL(id, true).split(',')[1] | ||||
| mime = 'image/png' | mime = 'image/png' |
| materials: Material[] = [] | materials: Material[] = [] | ||||
| private _createMaterial(material: any): Material { | |||||
| protected _createMaterial(material: any): Material { | |||||
| if (!Rhino3dmLoader2.ImportMaterials) return this.materials[0] || new MeshStandardMaterial({ | if (!Rhino3dmLoader2.ImportMaterials) return this.materials[0] || new MeshStandardMaterial({ | ||||
| color: new Color(1, 1, 1), | color: new Color(1, 1, 1), | ||||
| metalness: 0.8, | metalness: 0.8, | ||||
| name: 'default', | name: 'default', | ||||
| side: DoubleSide, | side: DoubleSide, | ||||
| }) | }) | ||||
| // @ts-expect-error not in ts | |||||
| return super._createMaterial(material) | return super._createMaterial(material) | ||||
| } | } | ||||
| private _compareMaterials!: (material: Material) => Material | private _compareMaterials!: (material: Material) => Material |
| } | } | ||||
| let renderFn = ()=> { | let renderFn = ()=> { | ||||
| // @ts-expect-error patched three.js RenderPass to accept depthBuffer | |||||
| super.render(renderer, undefined, readBuffer, deltaTime, maskActive, depthRenderBuffer) // read is write in super.render (RenderPass) | |||||
| super.render(renderer, null, readBuffer, deltaTime, maskActive, depthRenderBuffer) // read is write in super.render (RenderPass) | |||||
| } | } | ||||
| if (!this.renderManager.rgbm) { | if (!this.renderManager.rgbm) { | ||||
| depthRenderBuffer = renderBufferProps2.__webglDepthRenderbuffer || renderBufferProps2.__webglDepthbuffer | depthRenderBuffer = renderBufferProps2.__webglDepthRenderbuffer || renderBufferProps2.__webglDepthbuffer | ||||
| } | } | ||||
| renderFn = ()=> { | renderFn = ()=> { | ||||
| // @ts-expect-error patched three.js RenderPass to accept depthBuffer | |||||
| super.render(renderer, undefined, this.transparentTarget, deltaTime, maskActive, depthRenderBuffer) | |||||
| super.render(renderer, null, this.transparentTarget as any, deltaTime, maskActive, depthRenderBuffer) | |||||
| } | } | ||||
| // Transparent | // Transparent |
| } from '../core' | } from '../core' | ||||
| import {base64ToArrayBuffer, Class, onChange2, serializable, serialize, ValOrArr} from 'ts-browser-helpers' | import {base64ToArrayBuffer, Class, onChange2, serializable, serialize, ValOrArr} from 'ts-browser-helpers' | ||||
| import {uiConfig, uiFolderContainer, uiMonitor, uiSlider, uiToggle} from 'uiconfig.js' | import {uiConfig, uiFolderContainer, uiMonitor, uiSlider, uiToggle} from 'uiconfig.js' | ||||
| import {generateUUID} from '../three' | |||||
| import {textureDataToImageData} from '../three/utils/texture' | |||||
| import {EXRExporter2} from '../assetmanager/export/EXRExporter2' | |||||
| import {BlobExt} from '../assetmanager' | |||||
| import {generateUUID, textureDataToImageData} from '../three' | |||||
| import {BlobExt, EXRExporter2} from '../assetmanager' | |||||
| @serializable('RenderManager') | @serializable('RenderManager') | ||||
| @uiFolderContainer('Render Manager') | @uiFolderContainer('Render Manager') |
| targetKey?: string // for caching. | targetKey?: string // for caching. | ||||
| clone(trackTarget?: boolean): this | clone(trackTarget?: boolean): this | ||||
| setSize(width: number, height: number, depth?: number): void; | setSize(width: number, height: number, depth?: number): void; | ||||
| copy(source: IRenderTarget): this; | |||||
| dispose(): void; | dispose(): void; | ||||
| scissor: Vector4; | scissor: Vector4; |
| throttleUpdate = 60 // throttle to 60 updates per second (implemented in OrbitControls.js.update() method) | throttleUpdate = 60 // throttle to 60 updates per second (implemented in OrbitControls.js.update() method) | ||||
| zoomIn(delta: number) { | |||||
| // @ts-expect-error not in ts | |||||
| super.zoomIn(delta) | |||||
| } | |||||
| zoomOut(delta: number) { | |||||
| // @ts-expect-error not in ts | |||||
| super.zoomOut(delta) | |||||
| } | |||||
| } | } |
| export {GLStatsJS} from './GLStatsJS' | export {GLStatsJS} from './GLStatsJS' | ||||
| export {CustomContextMenu} from './CustomContextMenu' | export {CustomContextMenu} from './CustomContextMenu' | ||||
| export {Dropzone, type DropFile, type ListenerCallback, type DropEventType} from './Dropzone' | export {Dropzone, type DropFile, type ListenerCallback, type DropEventType} from './Dropzone' | ||||
| export {ThreeSerialization, type SerializationMetaType, type SerializationResourcesType, MetaImporter, metaToResources, getEmptyMeta, metaFromResources, convertArrayBufferToStringsInMeta, convertStringsToArrayBuffersInMeta, copyMaterialUserData, copyObject3DUserData, copyUserData, copyTextureUserData} from './serialization' | |||||
| export {ThreeSerialization, type SerializationMetaType, type SerializationResourcesType, MetaImporter, metaToResources, getEmptyMeta, metaFromResources, convertArrayBufferToStringsInMeta, convertStringsToArrayBuffersInMeta, copyMaterialUserData, copyObject3DUserData, copyUserData, copyTextureUserData, jsonToBlob} from './serialization' | |||||
| export {shaderReplaceString} from './shader-helpers' | export {shaderReplaceString} from './shader-helpers' | ||||
| export {makeGLBFile} from './gltf' | export {makeGLBFile} from './gltf' | ||||
| if (plugin && typeof plugin === 'string' || (plugin as any).PluginType) plugin = this.getPlugin(plugin as any) | if (plugin && typeof plugin === 'string' || (plugin as any).PluginType) plugin = this.getPlugin(plugin as any) | ||||
| if (!plugin) return {} | if (!plugin) return {} | ||||
| const meta = getEmptyMeta() | const meta = getEmptyMeta() | ||||
| const data = (plugin as IViewerPlugin).toJSON?.(meta) | |||||
| const data = (<IViewerPlugin>plugin).toJSON?.(meta) | |||||
| if (!data) return {} | if (!data) return {} | ||||
| data.resources = metaToResources(meta) | data.resources = metaToResources(meta) | ||||
| return data | return data |