Просмотр исходного кода

Merge remote-tracking branch 'refs/remotes/origin/stash' into migrate

master
Palash Bansal 1 год назад
Родитель
Сommit
1782b876b4
Аккаунт пользователя с таким Email не найден

+ 3
- 0
.gitignore Просмотреть файл

@@ -68,3 +68,6 @@ typings/

website/.vitepress/dist
website/.vitepress/cache

.DS_Store
experiments

+ 1
- 0
examples/tsconfig.json Просмотреть файл

@@ -9,6 +9,7 @@
"isolatedModules": false,
"module": "es2020",
"noImplicitAny": true,
"noImplicitOverride": false,
"declaration": false,
"noImplicitThis": true,
"noUnusedLocals": true,

+ 3188
- 3245
package-lock.json
Разница между файлами не показана из-за своего большого размера
Просмотреть файл


+ 14
- 10
package.json Просмотреть файл

@@ -1,19 +1,29 @@
{
"name": "threepipe",
"version": "0.0.33",
"version": "0.0.34",
"description": "A 3D viewer framework built on top of three.js in TypeScript with a focus on quality rendering, modularity and extensibility.",
"main": "dist/index.js",
"module": "dist/index.mjs",
"types": "src/index.ts",
"types": "dist/index.d.ts",
"sources": "src/index.ts",
"browser": "dist/index.js",
"exports": {
".": {
"import": "./dist/index.mjs",
"require": "./dist/index.js"
},
"./dist/": {
"import": "./dist/",
"require": "./dist/"
}
},
"type": "module",
"scripts": {
"compile": "rimraf lib && npm run compile:esm && npm run copy:css",
"compile:esm": "tsc -p ./src",
"copy:css": "copyfiles -u 1 \"src/**/*.css\" lib",
"new:pack": "npm run prepare && clean-package && npm pack && clean-package restore",
"new:publish": "npm run prepare && clean-package && npm publish && clean-package restore",
"new:publish": "git diff --exit-code --name-only HEAD * && npm run prepare && clean-package && npm publish && clean-package restore && git tag v$npm_package_version",
"build": "npm run update-version && npm run compile && vite build",
"dev": "NODE_ENV=development vite build --watch",
"build-examples": "tsc --project examples/tsconfig.build.json",
@@ -37,13 +47,7 @@
"devDependencies",
"optionalDependencies",
"//"
],
"replace": {
"main": "dist/index.js",
"module": "dist/index.mjs",
"browser": "dist/index.js",
"types": "dist/index.d.ts"
}
]
},
"files": [
"dist",

+ 12
- 2
plugins/blend-importer/package.json Просмотреть файл

@@ -1,12 +1,22 @@
{
"name": "@threepipe/plugin-blend-importer",
"description": "Basic importer for .blend file",
"version": "0.0.2",
"version": "0.0.3",
"devDependencies": {
},
"dependencies": {
"threepipe": "file:./../../src/"
},
"exports": {
".": {
"import": "./dist/index.mjs",
"require": "./dist/index.js"
},
"./dist/": {
"import": "./dist/",
"require": "./dist/"
}
},
"clean-package": {
"remove": [
"clean-package",
@@ -30,7 +40,7 @@
],
"scripts": {
"new:pack": "npm run prepare && clean-package && npm pack && clean-package restore",
"new:publish": "npm run prepare && clean-package && npm publish --access public && clean-package restore",
"new:publish": "git diff --exit-code --name-only HEAD * && npm run prepare && clean-package && npm publish --access public && clean-package restore && git tag v$npm_package_version",
"prepare": "npm run build && npm run docs",
"build": "rimraf dist && vite build",
"dev": "NODE_ENV=development vite build --watch",

+ 12
- 2
plugins/blueprintjs/package.json Просмотреть файл

@@ -1,13 +1,23 @@
{
"name": "@threepipe/plugin-blueprintjs",
"description": "Blueprint.js UI Plugin for ThreePipe",
"version": "0.2.0",
"version": "0.2.1",
"devDependencies": {
"uiconfig-blueprint": "^0.0.3"
},
"dependencies": {
"threepipe": "file:./../../src/"
},
"exports": {
".": {
"import": "./dist/index.mjs",
"require": "./dist/index.js"
},
"./dist/": {
"import": "./dist/",
"require": "./dist/"
}
},
"type": "module",
"main": "dist/index.js",
"module": "dist/index.mjs",
@@ -19,7 +29,7 @@
],
"scripts": {
"new:pack": "npm run prepare && clean-package && npm pack && clean-package restore",
"new:publish": "npm run prepare && clean-package && npm publish --access public && clean-package restore",
"new:publish": "git diff --exit-code --name-only HEAD * && npm run prepare && clean-package && npm publish --access public && clean-package restore && git tag v$npm_package_version",
"prepare": "npm run build && npm run docs",
"build": "rimraf dist && vite build",
"dev": "NODE_ENV=development vite build --watch",

+ 12
- 2
plugins/configurator/package.json Просмотреть файл

@@ -1,7 +1,7 @@
{
"name": "@threepipe/plugin-configurator",
"description": "Plugins for creating material and object configurators in threepipe.",
"version": "0.1.1",
"version": "0.1.2",
"devDependencies": {
},
"dependencies": {
@@ -21,6 +21,16 @@
}
}
},
"exports": {
".": {
"import": "./dist/index.mjs",
"require": "./dist/index.js"
},
"./dist/": {
"import": "./dist/",
"require": "./dist/"
}
},
"type": "module",
"main": "dist/index.js",
"module": "dist/index.mjs",
@@ -31,7 +41,7 @@
],
"scripts": {
"new:pack": "npm run prepare && clean-package && npm pack && clean-package restore",
"new:publish": "npm run prepare && clean-package && npm publish --access public && clean-package restore",
"new:publish": "git diff --exit-code --name-only HEAD * && npm run prepare && clean-package && npm publish --access public && clean-package restore && git tag v$npm_package_version",
"prepare": "npm run build && npm run docs",
"build": "rimraf dist && vite build",
"dev": "NODE_ENV=development vite build --watch",

+ 11
- 2
plugins/extra-importers/package.json Просмотреть файл

@@ -1,7 +1,7 @@
{
"name": "@threepipe/plugins-extra-importers",
"description": "Extra Threepipe plugins for importing several file types.",
"version": "0.2.0",
"version": "0.2.1",
"devDependencies": {
},
"dependencies": {
@@ -22,6 +22,15 @@
}
}
},
"exports": {
".": {
"import": "./dist/index.mjs"
},
"./dist/": {
"import": "./dist/",
"require": "./dist/"
}
},
"type": "module",
"main": "dist/index.mjs",
"module": "dist/index.mjs",
@@ -32,7 +41,7 @@
],
"scripts": {
"new:pack": "npm run prepare && clean-package && npm pack && clean-package restore",
"new:publish": "npm run prepare && clean-package && npm publish --access public && clean-package restore",
"new:publish": "git diff --exit-code --name-only HEAD * && npm run prepare && clean-package && npm publish --access public && clean-package restore && git tag v$npm_package_version",
"prepare": "npm run build && npm run docs",
"build": "rimraf dist && vite build",
"dev": "NODE_ENV=development vite build --watch",

+ 2
- 2
plugins/gaussian-splatting/package-lock.json Просмотреть файл

@@ -1,12 +1,12 @@
{
"name": "@threepipe/plugin-gaussian-splatting",
"version": "0.2.0",
"version": "0.2.1",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@threepipe/plugin-gaussian-splatting",
"version": "0.2.0",
"version": "0.2.1",
"license": "Apache-2.0",
"dependencies": {
"threepipe": "file:./../../src/"

+ 13
- 2
plugins/gaussian-splatting/package.json Просмотреть файл

@@ -1,7 +1,7 @@
{
"name": "@threepipe/plugin-gaussian-splatting",
"description": "Gaussian Splatting for Threepipe",
"version": "0.2.1",
"version": "0.2.2",
"devDependencies": {
"comlink": "^4.4.1",
"@types/emscripten": "^1.39.10"
@@ -9,6 +9,17 @@
"dependencies": {
"threepipe": "file:./../../src/"
},
"exports": {
".": {
"import": "./dist/index.mjs",
"require": "./dist/index.js",
"types": "./src/index.d.ts"
},
"./dist/": {
"import": "./dist/",
"require": "./dist/"
}
},
"clean-package": {
"remove": [
"clean-package",
@@ -34,7 +45,7 @@
],
"scripts": {
"new:pack": "npm run prepare && clean-package && npm pack && clean-package restore",
"new:publish": "npm run prepare && clean-package && npm publish --access public && clean-package restore",
"new:publish": "git diff --exit-code --name-only HEAD * && npm run prepare && clean-package && npm publish --access public && clean-package restore && git tag v$npm_package_version",
"prepare": "npm run build && npm run docs",
"build": "rimraf dist && vite build",
"dev": "NODE_ENV=development vite build --watch",

+ 12
- 2
plugins/geometry-generator/package.json Просмотреть файл

@@ -1,12 +1,22 @@
{
"name": "@threepipe/plugin-geometry-generator",
"description": "Geometry generator plugin to create updatable parametric objects/geometries.",
"version": "0.3.0",
"version": "0.3.1",
"devDependencies": {
},
"dependencies": {
"threepipe": "file:./../../src/"
},
"exports": {
".": {
"import": "./dist/index.mjs",
"require": "./dist/index.js"
},
"./dist/": {
"import": "./dist/",
"require": "./dist/"
}
},
"clean-package": {
"remove": [
"clean-package",
@@ -30,7 +40,7 @@
],
"scripts": {
"new:pack": "npm run prepare && clean-package && npm pack && clean-package restore",
"new:publish": "npm run prepare && clean-package && npm publish --access public && clean-package restore",
"new:publish": "git diff --exit-code --name-only HEAD * && npm run prepare && clean-package && npm publish --access public && clean-package restore && git tag v$npm_package_version",
"prepare": "npm run build && npm run docs",
"build": "rimraf dist && vite build",
"dev": "NODE_ENV=development vite build --watch",

+ 12
- 2
plugins/gltf-transform/package.json Просмотреть файл

@@ -1,7 +1,7 @@
{
"name": "@threepipe/plugin-gltf-transform",
"description": "Utility plugins for threepipe using gltf-transform to optimize/compress glTF files.",
"version": "0.1.0",
"version": "0.1.1",
"devDependencies": {
"@gltf-transform/core": "3.2.1",
"@gltf-transform/extensions": "3.2.1"
@@ -9,6 +9,16 @@
"dependencies": {
"threepipe": "file:./../../src/"
},
"exports": {
".": {
"import": "./dist/index.mjs",
"require": "./dist/index.js"
},
"./dist/": {
"import": "./dist/",
"require": "./dist/"
}
},
"clean-package": {
"remove": [
"clean-package",
@@ -32,7 +42,7 @@
],
"scripts": {
"new:pack": "npm run prepare && clean-package && npm pack && clean-package restore",
"new:publish": "npm run prepare && clean-package && npm publish --access public && clean-package restore",
"new:publish": "git diff --exit-code --name-only HEAD * && npm run prepare && clean-package && npm publish --access public && clean-package restore && git tag v$npm_package_version",
"prepare": "npm run build && npm run docs",
"build": "rimraf dist && vite build",
"dev": "NODE_ENV=development vite build --watch",

+ 12
- 2
plugins/network/package.json Просмотреть файл

@@ -1,13 +1,23 @@
{
"name": "@threepipe/plugin-network",
"description": "Network/AWS/Cloud related plugins for threepipe",
"version": "0.1.0",
"version": "0.1.1",
"devDependencies": {
},
"dependencies": {
"threepipe": "file:./../../src/",
"aws4fetch": "^1.0.18"
},
"exports": {
".": {
"import": "./dist/index.mjs",
"require": "./dist/index.js"
},
"./dist/": {
"import": "./dist/",
"require": "./dist/"
}
},
"clean-package": {
"remove": [
"clean-package",
@@ -33,7 +43,7 @@
],
"scripts": {
"new:pack": "npm run prepare && clean-package && npm pack && clean-package restore",
"new:publish": "npm run prepare && clean-package && npm publish --access public && clean-package restore",
"new:publish": "git diff --exit-code --name-only HEAD * && npm run prepare && clean-package && npm publish --access public && clean-package restore && git tag v$npm_package_version",
"prepare": "npm run build && npm run docs",
"build": "rimraf dist && vite build",
"dev": "NODE_ENV=development vite build --watch",

+ 11
- 1
plugins/plugin-template-rollup/package.json Просмотреть файл

@@ -8,6 +8,16 @@
"threepipe": "file:./../../src/",
"@threepipe/plugin-tweakpane": "file:./../tweakpane/src/"
},
"exports": {
".": {
"import": "./dist/index.mjs",
"require": "./dist/index.js"
},
"./dist/": {
"import": "./dist/",
"require": "./dist/"
}
},
"clean-package": {
"remove": [
"clean-package",
@@ -34,7 +44,7 @@
],
"scripts": {
"new:pack": "npm run prepare && clean-package && npm pack && clean-package restore",
"new:publish": "npm run prepare && clean-package && npm publish --access public && clean-package restore",
"new:publish": "git diff --exit-code --name-only HEAD * && npm run prepare && clean-package && npm publish --access public && clean-package restore && git tag v$npm_package_version",
"prepare": "npm run build && npm run docs",
"build": "rimraf dist && NODE_ENV=production rollup -c",
"dev": "rollup -c -w",

+ 11
- 1
plugins/plugin-template-vite/package.json Просмотреть файл

@@ -24,6 +24,16 @@
}
}
},
"exports": {
".": {
"import": "./dist/index.mjs",
"require": "./dist/index.js"
},
"./dist/": {
"import": "./dist/",
"require": "./dist/"
}
},
"type": "module",
"main": "dist/index.js",
"module": "dist/index.mjs",
@@ -34,7 +44,7 @@
],
"scripts": {
"new:pack": "npm run prepare && clean-package && npm pack && clean-package restore",
"new:publish": "npm run prepare && clean-package && npm publish --access public && clean-package restore",
"new:publish": "git diff --exit-code --name-only HEAD * && npm run prepare && clean-package && npm publish --access public && clean-package restore && git tag v$npm_package_version",
"prepare": "npm run build && npm run docs",
"build": "rimraf dist && vite build",
"dev": "NODE_ENV=development vite build --watch",

+ 12
- 2
plugins/svg-renderer/package.json Просмотреть файл

@@ -1,7 +1,7 @@
{
"name": "@threepipe/plugin-svg-renderer",
"description": "Plugins for SVG Rendering of 3d objects for Threepipe",
"version": "0.2.1",
"version": "0.2.2",
"devDependencies": {
"@svgdotjs/svg.js": "^3.2.0",
"@svgdotjs/svg.topath.js": "^2.0.3",
@@ -16,6 +16,16 @@
"dependencies": {
"threepipe": "file:./../../src/"
},
"exports": {
".": {
"import": "./dist/index.mjs",
"require": "./dist/index.js"
},
"./dist/": {
"import": "./dist/",
"require": "./dist/"
}
},
"clean-package": {
"remove": [
"clean-package",
@@ -41,7 +51,7 @@
],
"scripts": {
"new:pack": "npm run prepare && clean-package && npm pack && clean-package restore",
"new:publish": "npm run prepare && clean-package && npm publish --access public && clean-package restore",
"new:publish": "git diff --exit-code --name-only HEAD * && npm run prepare && clean-package && npm publish --access public && clean-package restore && git tag v$npm_package_version",
"prepare": "npm run build && npm run docs",
"build": "rimraf dist && vite build",
"dev": "NODE_ENV=development vite build --watch",

+ 12
- 2
plugins/tweakpane-editor/package.json Просмотреть файл

@@ -1,7 +1,7 @@
{
"name": "@threepipe/plugin-tweakpane-editor",
"description": "Tweakpane Editor Plugin for ThreePipe",
"version": "0.3.0",
"version": "0.3.1",
"devDependencies": {
"tippy.js": "^6.3.7",
"treejs": "git://github.com/repalash/treejs.git#d303016bb74e75725d13e97291ac1d4727985918"
@@ -10,6 +10,16 @@
"threepipe": "file:./../../src/",
"@threepipe/plugin-tweakpane": "file:./../tweakpane/src/"
},
"exports": {
".": {
"import": "./dist/index.mjs",
"require": "./dist/index.js"
},
"./dist/": {
"import": "./dist/",
"require": "./dist/"
}
},
"clean-package": {
"remove": [
"clean-package",
@@ -34,7 +44,7 @@
],
"scripts": {
"new:pack": "npm run prepare && clean-package && npm pack && clean-package restore",
"new:publish": "npm run prepare && clean-package && npm publish --access public && clean-package restore",
"new:publish": "git diff --exit-code --name-only HEAD * && npm run prepare && clean-package && npm publish --access public && clean-package restore && git tag v$npm_package_version",
"prepare": "npm run build && npm run docs",
"build": "rimraf dist && vite build",
"dev": "NODE_ENV=development vite build --watch",

+ 12
- 2
plugins/tweakpane/package.json Просмотреть файл

@@ -1,7 +1,7 @@
{
"name": "@threepipe/plugin-tweakpane",
"description": "Tweakpane UI Plugin for ThreePipe",
"version": "0.4.1",
"version": "0.4.2",
"devDependencies": {
"tweakpane-image-plugin": "https://github.com/repalash/tweakpane-image-plugin/releases/download/v1.1.404/package.tgz",
"uiconfig-tweakpane": "^0.0.8"
@@ -9,6 +9,16 @@
"dependencies": {
"threepipe": "file:./../../src/"
},
"exports": {
".": {
"import": "./dist/index.mjs",
"require": "./dist/index.js"
},
"./dist/": {
"import": "./dist/",
"require": "./dist/"
}
},
"type": "module",
"main": "dist/index.js",
"module": "dist/index.mjs",
@@ -20,7 +30,7 @@
],
"scripts": {
"new:pack": "npm run prepare && clean-package && npm pack && clean-package restore",
"new:publish": "npm run prepare && clean-package && npm publish --access public && clean-package restore",
"new:publish": "git diff --exit-code --name-only HEAD * && npm run prepare && clean-package && npm publish --access public && clean-package restore && git tag v$npm_package_version",
"prepare": "npm run build && npm run docs",
"build": "rimraf dist && vite build",
"dev": "NODE_ENV=development vite build --watch",

+ 13
- 1
src/plugins/animation/PopmotionPlugin.ts Просмотреть файл

@@ -173,11 +173,24 @@ export class PopmotionPlugin extends AViewerPluginSync<''> {
}
return true
}
// todo: test boolean
if (options.from === undefined) {
console.warn('from is undefined', options)
resolve()
return
}
const isBool = typeof options.from === 'boolean'
if (isBool) {
options.from = options.from ? 1 : 0 as any
options.to = options.to ? 1 : 0 as any
}
const opts: AnimationOptions<V> = {
driver: this.defaultDriver,
...options,
onUpdate: !isBool ? options.onUpdate : undefined,
onComplete: ()=>{
try {
if (isBool) options.onUpdate?.(options.to as any)
options.onComplete && options.onComplete()
} catch (e: any) {
if (!end2()) return
@@ -198,7 +211,6 @@ export class PopmotionPlugin extends AViewerPluginSync<''> {
resolve()
},
}
// todo: support boolean using timeout.
const anim = animate(opts)
this.animations[uuid]._stop = anim.stop
this.animations[uuid].options = opts

+ 7
- 0
src/plugins/pipeline/GBufferPlugin.ts Просмотреть файл

@@ -169,6 +169,13 @@ export class GBufferPlugin
this.target.texture[0].name = 'gbufferDepthNormal'
this.target.texture[1].name = 'gbufferFlags'
this.textures = this.target.texture

// todo flag buffer filtering?
// const flagTexture = this.flagsTexture
// flagTexture.generateMipmaps = false
// flagTexture.minFilter = NearestFilter
// flagTexture.magFilter = NearestFilter

} else {
this.target.texture.name = 'gbufferDepthNormal'
this.textures.push(this.target.texture)

+ 10
- 4
src/utils/animation.ts Просмотреть файл

@@ -68,24 +68,30 @@ export function makeSetterFor<V>(target: any, key: string, setDirty?: ()=>void)
if (typeof target?.setDirty === 'function') target.setDirty()
setDirty?.()
}
if (v && typeof v.copy === 'function')
const isBool = typeof v === 'boolean'
if (v && v.isColor)
return (a: any) => {
v.set(a)
dirty()
}
else if (v && typeof v.copy === 'function')
return (a: any) => {
v.copy(a)
dirty()
}
else
return (a: V)=>{
target[key] = a
target[key] = !isBool ? a : !!a
dirty()
}
}

export async function animateTarget<V>(target: any, key: string, options: AnimationOptions<V>, animations?: AnimateResult[]) {
export async function animateTarget<V>(target: any, key: string, options: AnimationOptions<V>, animations?: AnimateResult[], forceCurrent = false) {
if (!(key in target)) {
console.error('invalid key', key, target)
}
const setter = makeSetterFor(target, key)
const fromVal = target[key]
const fromVal = forceCurrent || options.from === undefined ? target[key] : options.from
const onUpdate = (val: V)=>{
setter(val)
options.onUpdate && options.onUpdate(val)

+ 1
- 1
src/viewer/version.ts Просмотреть файл

@@ -1 +1 @@
export const VERSION = '0.0.33'
export const VERSION = '0.0.34'

+ 1
- 0
tsconfig.json Просмотреть файл

@@ -10,6 +10,7 @@
"declaration": true,
"declarationMap": true,
"declarationDir": "dist",
"skipLibCheck": true,
"noImplicitThis": true,
"noUnusedLocals": true,
"noUnusedParameters": true,

Загрузка…
Отмена
Сохранить