@playcanvas/splat-transform 0.8.1 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -3,13 +3,16 @@
3
3
  [![NPM Version](https://img.shields.io/npm/v/@playcanvas/splat-transform.svg)](https://www.npmjs.com/package/@playcanvas/splat-transform)
4
4
  [![NPM Downloads](https://img.shields.io/npm/dw/@playcanvas/splat-transform)](https://npmtrends.com/@playcanvas/splat-transform)
5
5
  [![License](https://img.shields.io/npm/l/@playcanvas/splat-transform.svg)](https://github.com/playcanvas/splat-transform/blob/main/LICENSE)
6
+ [![Discord](https://img.shields.io/badge/Discord-5865F2?style=flat&logo=discord&logoColor=white&color=black)](https://discord.gg/RSaMRzg)
7
+ [![Reddit](https://img.shields.io/badge/Reddit-FF4500?style=flat&logo=reddit&logoColor=white&color=black)](https://www.reddit.com/r/PlayCanvas)
8
+ [![X](https://img.shields.io/badge/X-000000?style=flat&logo=x&logoColor=white&color=black)](https://x.com/intent/follow?screen_name=playcanvas)
6
9
 
7
10
  | [User Guide](https://developer.playcanvas.com/user-manual/gaussian-splatting/editing/splat-transform/) | [Blog](https://blog.playcanvas.com/) | [Forum](https://forum.playcanvas.com/) | [Discord](https://discord.gg/RSaMRzg) |
8
11
 
9
12
  SplatTransform is an open source CLI tool for converting and editing Gaussian splats. It can:
10
13
 
11
- 📥 Read PLY, Compressed PLY, SPLAT, KSPLAT formats
12
- 📤 Write PLY, Compressed PLY, CSV, and SOG formats
14
+ 📥 Read PLY, Compressed PLY, SPLAT, KSPLAT, SPZ formats
15
+ 📤 Write PLY, Compressed PLY, CSV, SOG and HTML viewer formats
13
16
  🔗 Merge multiple splats
14
17
  🔄 Apply transformations to input splats
15
18
  🎛️ Filter out Gaussians or spherical harmonic bands
@@ -33,7 +36,7 @@ npm install -g @playcanvas/splat-transform
33
36
  ## Usage
34
37
 
35
38
  ```bash
36
- splat-transform [GLOBAL] <input.{ply|compressed.ply|splat|ksplat}> [ACTIONS] ... <output.{ply|compressed.ply|sog|meta.json|csv}> [ACTIONS]
39
+ splat-transform [GLOBAL] <input.{ply|compressed.ply|splat|ksplat}> [ACTIONS] ... <output.{ply|compressed.ply|sog|meta.json|csv|html}> [ACTIONS]
37
40
  ```
38
41
 
39
42
  **Key points:**
@@ -42,19 +45,18 @@ splat-transform [GLOBAL] <input.{ply|compressed.ply|splat|ksplat}> [ACTIONS] .
42
45
 
43
46
  ## Supported Formats
44
47
 
45
- **Input:**
46
- - `.ply` - Standard PLY format
47
- - `.compressed.ply` - Compressed PLY format (auto-detected and decompressed on read)
48
- - `.splat` - Binary splat format (antimatter15 format)
49
- - `.ksplat` - Compressed binary splat format (mkkellogg format)
50
-
51
- **Output:**
52
- - `.ply` - Standard PLY format
53
- - `.compressed.ply` - Compressed PLY format
54
- - `.sog` - SOG bundled format
55
- - `meta.json` - SOG unbundled format (JSON + WebP images)
56
- - `.csv` - Comma-separated values
57
-
48
+ | Format | Input | Output | Description |
49
+ | ------ | ----- | ------ | ----------- |
50
+ | `.ply` | | | Standard PLY format |
51
+ | `.compressed.ply` | | ✅ | Compressed PLY format (auto-detected and decompressed on read) |
52
+ | `.ksplat` | ✅ | ❌ | Compressed splat format (mkkellogg format) |
53
+ | `.splat` | ✅ | ❌ | Compressed splat format (antimatter15 format) |
54
+ | `.spz` | ✅ | ❌ | Compressed splat format (Niantic format) |
55
+ | `.mjs` | | ❌ | Generate a scene using an mjs script (Beta) |
56
+ | `.sog` | ❌ | ✅ | Bundled super-compressed format (recommended) |
57
+ | `meta.json` | ❌ | ✅ | Unbundled super-compressed format (also outputs `.webp` images) |
58
+ | `.csv` | | | Comma-separated values spreadsheet |
59
+ | `.html` | | ✅ | Standalone HTML viewer app |
58
60
  ## Actions
59
61
 
60
62
  Actions can be repeated and applied in any order:
@@ -67,6 +69,7 @@ Actions can be repeated and applied in any order:
67
69
  -c, --filterByValue name,cmp,value Keep splats where <name> <cmp> <value>
68
70
  cmp ∈ {lt,lte,gt,gte,eq,neq}
69
71
  -b, --filterBands {0|1|2|3} Strip spherical-harmonic bands > N
72
+ -P, --params name=value[,name=value...] Pass parameters to .mjs generator script
70
73
  ```
71
74
 
72
75
  ## Global Options
@@ -77,6 +80,8 @@ Actions can be repeated and applied in any order:
77
80
  -v, --version Show version and exit
78
81
  -g, --no-gpu Disable gpu when compressing spherical harmonics.
79
82
  -i, --iterations <number> Specify the number of iterations when compressing spherical harmonics. More iterations generally lead to better results. Default is 10.
83
+ -p, --cameraPos Specify the viewer starting position. Default is 2,2,-2.
84
+ -e, --cameraTarget Specify the viewer starting target. Default is 0,0,0.
80
85
  ```
81
86
 
82
87
  ## Examples
@@ -105,6 +110,9 @@ splat-transform input.ply output.sog
105
110
 
106
111
  # Convert to SOG unbundled format
107
112
  splat-transform input.ply output/meta.json
113
+
114
+ # Convert to HTML viewer with target and camera location
115
+ splat-transform -a 0,0,0 -e 0,0,10 input.ply output.html
108
116
  ```
109
117
 
110
118
  ### Transformations
@@ -140,7 +148,15 @@ splat-transform input.ply --filterBands 2 output.ply
140
148
  splat-transform -w cloudA.ply -r 0,90,0 cloudB.ply -s 2 merged.compressed.ply
141
149
 
142
150
  # Apply final transformations to combined result
143
- splat-transform input1.ply input2.ply output.ply -t 0,0,10 -s 0.5
151
+ splat-transform input1.ply input2.ply output.ply -p 0,0,10 -e 0.5
152
+ ```
153
+
154
+ ### Generators (Beta)
155
+
156
+ Generator scripts can be used to synthesize gaussian splat data. See [gen-grid.mjs](generators/gen-grid.mjs) for an example.
157
+
158
+ ```bash
159
+ splat-transform gen-grid.mjs -P width=10,height=10,scale=10,color=0.1 scenes/grid.ply -w
144
160
  ```
145
161
 
146
162
  ## Getting Help