diff --git a/resources/assets/src/components/Previewer.vue b/resources/assets/src/components/Previewer.vue index 30916367..4a33c1ce 100644 --- a/resources/assets/src/components/Previewer.vue +++ b/resources/assets/src/components/Previewer.vue @@ -75,14 +75,6 @@ export default { }, }, data: () => ({ - /** @type {skinview3d.SkinViewer} */ - viewer: null, - handles: { - walk: null, - run: null, - rotate: null, - }, - control: null, paused: false, }), computed: { @@ -135,9 +127,12 @@ export default { }) this.viewer.camera.position.z = this.initPositionZ this.viewer.animation = new skinview3d.CompositeAnimation() - this.handles.walk = this.viewer.animation.add(skinview3d.WalkingAnimation) - this.handles.run = this.viewer.animation.add(skinview3d.RunningAnimation) - this.handles.rotate = this.viewer.animation.add(skinview3d.RotatingAnimation) + + this.handles = { + walk: this.viewer.animation.add(skinview3d.WalkingAnimation), + run: this.viewer.animation.add(skinview3d.RunningAnimation), + rotate: this.viewer.animation.add(skinview3d.RotatingAnimation), + } this.handles.run.paused = true this.control = skinview3d.createOrbitControls(this.viewer) }, @@ -154,8 +149,6 @@ export default { }, reset() { this.viewer.dispose() - this.handles = {} - this.control = null this.initPreviewer() this.handles.walk.paused = true this.handles.run.paused = true diff --git a/resources/misc/changelogs/en/5.0.0.md b/resources/misc/changelogs/en/5.0.0.md index 3b55c695..9fed4985 100644 --- a/resources/misc/changelogs/en/5.0.0.md +++ b/resources/misc/changelogs/en/5.0.0.md @@ -28,6 +28,7 @@ - Upgraded AdminLTE to v3. - Lengthened `ip` field in order to support IPv6. - Optimized performance of validating player name. +- Optimized performance of invoking texture previewer (skinview3d). ## Fixed diff --git a/resources/misc/changelogs/zh_CN/5.0.0.md b/resources/misc/changelogs/zh_CN/5.0.0.md index 55c460d1..cd352fec 100644 --- a/resources/misc/changelogs/zh_CN/5.0.0.md +++ b/resources/misc/changelogs/zh_CN/5.0.0.md @@ -28,6 +28,7 @@ - AdminLTE 升级到 v3 - 将 `ip` 字段的长度增加到 39 以支持 IPv6 - 优化角色名校验的性能 +- 优化调用材质预览器(skinview3d)的性能 ## 修复