Browse Source

Add play animation button to tweakpane editor util buttons

master
Palash Bansal 2 years ago
parent
commit
808935525b
No account linked to committer's email address

+ 2
- 2
plugins/tweakpane-editor/package-lock.json View File

{ {
"name": "@threepipe/plugin-tweakpane-editor", "name": "@threepipe/plugin-tweakpane-editor",
"version": "0.1.2",
"version": "0.1.3",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "@threepipe/plugin-tweakpane-editor", "name": "@threepipe/plugin-tweakpane-editor",
"version": "0.1.2",
"version": "0.1.3",
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"@threepipe/plugin-tweakpane": "file:./../tweakpane/src/", "@threepipe/plugin-tweakpane": "file:./../tweakpane/src/",

+ 1
- 1
plugins/tweakpane-editor/package.json View File

{ {
"name": "@threepipe/plugin-tweakpane-editor", "name": "@threepipe/plugin-tweakpane-editor",
"description": "Tweakpane Editor Plugin for ThreePipe", "description": "Tweakpane Editor Plugin for ThreePipe",
"version": "0.1.2",
"version": "0.1.3",
"devDependencies": { "devDependencies": {
"tippy.js": "^6.3.7" "tippy.js": "^6.3.7"
}, },

+ 19
- 11
plugins/tweakpane-editor/src/util-buttons.ts View File

import {AViewerPlugin, Class, createDiv, downloadBlob, FullScreenPlugin, ThreeViewer} from 'threepipe'
import {autoRotateCC, collapse, download, expand, resetSettings, snapshot, trash} from './icons'
import {
AViewerPlugin,
Class,
createDiv,
downloadBlob,
FullScreenPlugin,
GLTFAnimationPlugin,
ThreeViewer,
} from 'threepipe'
import {autoRotateCC, collapse, download, expand, playIcon, resetSettings, snapshot, trash} from './icons'
import tippy, {createSingleton} from 'tippy.js' import tippy, {createSingleton} from 'tippy.js'


export function createUtilButtons(viewer: ThreeViewer, allPlugins: Class<AViewerPlugin>[]) { export function createUtilButtons(viewer: ThreeViewer, allPlugins: Class<AViewerPlugin>[]) {
// viewer.getPlugin(CameraViewPlugin)!.viewLooping = !viewer.getPlugin(CameraViewPlugin)!.viewLooping // viewer.getPlugin(CameraViewPlugin)!.viewLooping = !viewer.getPlugin(CameraViewPlugin)!.viewLooping
// }, // },
// }, // },
// {
// id: 'play-gltf',
// icon: playIcon,
// tooltip: 'GLTF Animations',
// toggle: true,
// onclick: async() => {
// viewer.getPlugin(GLTFAnimationPlugin)?.playPauseAnimation()
// },
// },
{
id: 'play-gltf',
icon: playIcon,
tooltip: 'GLTF Animations',
toggle: true,
onclick: async() => {
viewer.getPlugin(GLTFAnimationPlugin)?.playPauseAnimation()
},
},
{ {
id: 'auto-rotate-cc', id: 'auto-rotate-cc',
icon: autoRotateCC, icon: autoRotateCC,

Loading…
Cancel
Save