Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 179 tweakpane plugin essentials #180

Merged
merged 7 commits into from
Aug 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@


## [3.2.0-next.0](https://github.com/Tresjs/cientos/compare/3.1.0...3.2.0-next.0) (2023-08-23)


### Features

* 107 use video texture ([#167](https://github.com/Tresjs/cientos/issues/167)) ([f0f1f9b](https://github.com/Tresjs/cientos/commit/f0f1f9bc6107c2d040195ca76f647ef6dcbeb2d3))


### Bug Fixes

* remove tweakpane essentials import ([eeed334](https://github.com/Tresjs/cientos/commit/eeed334398374089d17b3ebf34bfc7b5f963372b))

## [3.1.0](https://github.com/Tresjs/cientos/compare/3.0.1...3.1.0) (2023-08-17)


Expand Down
1 change: 0 additions & 1 deletion docs/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ declare module 'vue' {
LoveVueThreeJS: typeof import('./.vitepress/theme/components/LoveVueThreeJS.vue')['default']
RouterLink: typeof import('vue-router')['RouterLink']
RouterView: typeof import('vue-router')['RouterView']
WobbleMaterial: typeof import('./.vitepress/theme/components/WobbleMaterial.vue')['default']
WobbleMaterialDemo: typeof import('./.vitepress/theme/components/WobbleMaterialDemo.vue')['default']
}
}
6 changes: 6 additions & 0 deletions docs/guide/misc/use-tweakpane.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

[TweakPane](https://cocopon.github.io/tweakpane/) is a JavaScript library for creating a user interface for tweaking values of JavaScript variables. It's a great tool for fine-tuning parameters and monitoring value changes on your three.js applications.

::: warning

useTweakPane is going to be deprecated soon and will no longer be part of this package, please start migrating to [`@tresjs/leches` package](https://github.com/Tresjs/leches) or [v-tweakpane](https://github.com/vinayakkulkarni/v-tweakpane) instead.

:::

::: code-group

```bash [pnpm]
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@tresjs/cientos",
"description": "Collection of useful helpers and fully functional, ready-made abstractions for Tres",
"version": "3.1.0",
"version": "3.2.0-next.0",
"type": "module",
"packageManager": "pnpm@8.4.0",
"author": "Alvaro Saburido <hola@alvarosaburido.dev> (https://github.com/alvarosabu/)",
Expand Down Expand Up @@ -53,7 +53,6 @@
"@alvarosabu/prettier-config": "^1.3.0",
"@release-it/conventional-changelog": "^7.0.0",
"@tweakpane/core": "^1.1.9",
"@tweakpane/plugin-essentials": "^0.1.8",
"@types/node": "^20.5.4",
"@types/three": "^0.155.1",
"@typescript-eslint/eslint-plugin": "^6.4.1",
Expand Down
11 changes: 0 additions & 11 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 7 additions & 12 deletions src/core/misc/useTweakPane/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { onUnmounted, onMounted } from 'vue'
import { Pane } from 'tweakpane'
import * as EssentialsPlugin from '@tweakpane/plugin-essentials'
import { useRenderLoop } from '@tresjs/core'
import { useLogger } from '../../../composables/useLogger'

type TweakPane = Pane & { addBlade(blade: any): void, addInput(blade: any): void }
let pane: TweakPane
let fpsGraph: any

export /**
* Creates a TweakPane instance and returns it.
Expand All @@ -22,14 +21,12 @@
pane.element.style.top = '1rem'
pane.element.style.right = '1rem'
pane.element.style.zIndex = '9999'
pane.registerPlugin(EssentialsPlugin)

fpsGraph = pane.addBlade({
view: 'fpsgraph',
label: 'fpsgraph',
})
}

const { logWarning } = useLogger()

logWarning('useTweakPane is going to be deprecated soon and will no longer be part of this package, please start migrating to @tresjs/leches package https://github.com/Tresjs/leches or v-tweakpane https://github.com/vinayakkulkarni/v-tweakpane instead.')

Check warning on line 28 in src/core/misc/useTweakPane/index.ts

View workflow job for this annotation

GitHub Actions / Lint (16)

This line has a length of 258. Maximum allowed is 120

/**
* Disposes the TweakPane instance.
*
Expand All @@ -41,14 +38,12 @@
}

onMounted(() => {
const { onBeforeLoop, onAfterLoop, resume } = useRenderLoop()
const { resume } = useRenderLoop()
resume()
onBeforeLoop(() => fpsGraph.begin())
onAfterLoop(() => fpsGraph.end())
})
onUnmounted(() => {
disposeTweakPane()
})

return { pane, fpsGraph, disposeTweakPane }
return { pane, disposeTweakPane }
}
4 changes: 4 additions & 0 deletions stats.html

Large diffs are not rendered by default.

Loading