mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-20 14:30:41 +00:00
3dgs & ply support (#7602)
## Summary integrated sparkjs https://sparkjs.dev/, built by [world labs ](https://www.worldlabs.ai/) to support 3dgs. - Add 3D Gaussian Splatting (3DGS) support using @sparkjsdev/spark library - Add PLY file format support with multiple rendering engines - Support new file formats: `.ply`, `.spz`, `.splat`, `.ksplat` - Add PLY Engine setting with three options: `threejs` (mesh), `fastply` (optimized ASCII point clouds), `sparkjs` (3DGS) - Add `FastPLYLoader` for 4-5x faster ASCII PLY parsing - Add `original(Advanced)` material mode for point cloud rendering with THREE.Points 3dgs generated by https://marble.worldlabs.ai/ test ply file from: 1. made by https://github.com/PozzettiAndrea/ComfyUI-DepthAnythingV3 2. threejs offically repo ## Screenshots https://github.com/user-attachments/assets/44e64d3e-b58d-4341-9a70-a9aa64801220 https://github.com/user-attachments/assets/76b0dfba-0c12-4f64-91cb-bfc5d672294d https://github.com/user-attachments/assets/2a8bfe81-1fb2-44c4-8787-dff325369c61 https://github.com/user-attachments/assets/e4beecee-d7a2-40c9-97f7-79b09c60312d ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-7602-3dgs-ply-support-2cd6d73d3650814098fcea86cfaf747d) by [Unito](https://www.unito.io)
This commit is contained in:
@@ -75,23 +75,36 @@ export class Load3dService {
|
||||
const sourceModel = source.modelManager.currentModel
|
||||
|
||||
if (sourceModel) {
|
||||
const modelClone = sourceModel.clone()
|
||||
if (source.isSplatModel()) {
|
||||
const originalURL = source.modelManager.originalURL
|
||||
if (originalURL) {
|
||||
await target.loadModel(originalURL)
|
||||
}
|
||||
} else {
|
||||
const modelClone = sourceModel.clone()
|
||||
|
||||
target.getModelManager().currentModel = modelClone
|
||||
target.getSceneManager().scene.add(modelClone)
|
||||
target.getModelManager().currentModel = modelClone
|
||||
target.getSceneManager().scene.add(modelClone)
|
||||
|
||||
target.getModelManager().materialMode =
|
||||
source.getModelManager().materialMode
|
||||
const sourceOriginalModel = source.getModelManager().originalModel
|
||||
|
||||
target.getModelManager().currentUpDirection =
|
||||
source.getModelManager().currentUpDirection
|
||||
if (sourceOriginalModel) {
|
||||
target.getModelManager().originalModel = sourceOriginalModel
|
||||
}
|
||||
|
||||
target.setMaterialMode(source.getModelManager().materialMode)
|
||||
target.setUpDirection(source.getModelManager().currentUpDirection)
|
||||
target.getModelManager().materialMode =
|
||||
source.getModelManager().materialMode
|
||||
|
||||
if (source.getModelManager().appliedTexture) {
|
||||
target.getModelManager().appliedTexture =
|
||||
source.getModelManager().appliedTexture
|
||||
target.getModelManager().currentUpDirection =
|
||||
source.getModelManager().currentUpDirection
|
||||
|
||||
target.setMaterialMode(source.getModelManager().materialMode)
|
||||
target.setUpDirection(source.getModelManager().currentUpDirection)
|
||||
|
||||
if (source.getModelManager().appliedTexture) {
|
||||
target.getModelManager().appliedTexture =
|
||||
source.getModelManager().appliedTexture
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user