mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-03-09 07:00:06 +00:00
[3d] improve storing Camera State logic (#2328)
This commit is contained in:
@@ -82,6 +82,10 @@ class Load3d {
|
||||
)
|
||||
this.controls.enableDamping = true
|
||||
|
||||
this.controls.addEventListener('end', () => {
|
||||
this.storeNodeProperty('Camera Info', this.getCameraState())
|
||||
})
|
||||
|
||||
this.gltfLoader = new GLTFLoader()
|
||||
this.objLoader = new OBJLoader()
|
||||
this.mtlLoader = new MTLLoader()
|
||||
@@ -576,6 +580,10 @@ class Load3d {
|
||||
|
||||
if (this.viewHelper.animating) {
|
||||
this.viewHelper.update(delta)
|
||||
|
||||
if (!this.viewHelper.animating) {
|
||||
this.storeNodeProperty('Camera Info', this.getCameraState())
|
||||
}
|
||||
}
|
||||
|
||||
this.renderer.clear()
|
||||
|
||||
@@ -149,6 +149,10 @@ class Load3dAnimation extends Load3d {
|
||||
|
||||
if (this.viewHelper.animating) {
|
||||
this.viewHelper.update(delta)
|
||||
|
||||
if (!this.viewHelper.animating) {
|
||||
this.storeNodeProperty('Camera Info', this.getCameraState())
|
||||
}
|
||||
}
|
||||
|
||||
this.viewHelper.render(this.renderer)
|
||||
|
||||
Reference in New Issue
Block a user