@playcanvas/splat-transform 0.8.0 → 0.8.1

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
@@ -9,7 +9,7 @@
9
9
  SplatTransform is an open source CLI tool for converting and editing Gaussian splats. It can:
10
10
 
11
11
  📥 Read PLY, Compressed PLY, SPLAT, KSPLAT formats
12
- 📤 Write PLY, Compressed PLY, CSV, and SOGS formats
12
+ 📤 Write PLY, Compressed PLY, CSV, and SOG formats
13
13
  🔗 Merge multiple splats
14
14
  🔄 Apply transformations to input splats
15
15
  🎛️ Filter out Gaussians or spherical harmonic bands
@@ -33,7 +33,7 @@ npm install -g @playcanvas/splat-transform
33
33
  ## Usage
34
34
 
35
35
  ```bash
36
- splat-transform [GLOBAL] <input.{ply|compressed.ply|splat|ksplat}> [ACTIONS] ... <output.{ply|compressed.ply|meta.json|csv}> [ACTIONS]
36
+ splat-transform [GLOBAL] <input.{ply|compressed.ply|splat|ksplat}> [ACTIONS] ... <output.{ply|compressed.ply|sog|meta.json|csv}> [ACTIONS]
37
37
  ```
38
38
 
39
39
  **Key points:**
@@ -51,7 +51,8 @@ splat-transform [GLOBAL] <input.{ply|compressed.ply|splat|ksplat}> [ACTIONS] .
51
51
  **Output:**
52
52
  - `.ply` - Standard PLY format
53
53
  - `.compressed.ply` - Compressed PLY format
54
- - `meta.json` - SOGS format (JSON + WebP images)
54
+ - `.sog` - SOG bundled format
55
+ - `meta.json` - SOG unbundled format (JSON + WebP images)
55
56
  - `.csv` - Comma-separated values
56
57
 
57
58
  ## Actions
@@ -99,7 +100,10 @@ splat-transform input.ply output.compressed.ply
99
100
  # (compressed .ply is detected automatically on read)
100
101
  splat-transform input.compressed.ply output.ply
101
102
 
102
- # Convert to SOGS format
103
+ # Convert to SOG bundled format
104
+ splat-transform input.ply output.sog
105
+
106
+ # Convert to SOG unbundled format
103
107
  splat-transform input.ply output/meta.json
104
108
  ```
105
109
 
package/dist/index.mjs CHANGED
@@ -1882,7 +1882,7 @@ let Quat$1 = class Quat {
1882
1882
  }
1883
1883
  };
1884
1884
 
1885
- var version$1 = "0.8.0";
1885
+ var version$1 = "0.8.1";
1886
1886
 
1887
1887
  class Column {
1888
1888
  name;
@@ -93322,6 +93322,7 @@ const writeFile$1 = async (filename, data) => {
93322
93322
  await outputFile.close();
93323
93323
  };
93324
93324
  let webpEncoder;
93325
+ let gpuDevice;
93325
93326
  const writeSog = async (fileHandle, dataTable, outputFilename, shIterations = 10, shMethod, indices = generateIndices(dataTable)) => {
93326
93327
  // initialize output stream
93327
93328
  const isBundle = outputFilename.toLowerCase().endsWith('.sog');
@@ -93428,7 +93429,9 @@ const writeSog = async (fileHandle, dataTable, outputFilename, shIterations = 10
93428
93429
  quats[ti * 4 + 3] = 252 + maxComp;
93429
93430
  }
93430
93431
  await write('quats.webp', quats);
93431
- const gpuDevice = shMethod === 'gpu' ? await createDevice() : null;
93432
+ if (shMethod === 'gpu' && !gpuDevice) {
93433
+ gpuDevice = await createDevice();
93434
+ }
93432
93435
  // convert scale
93433
93436
  const scaleData = await cluster1d(new DataTable(['scale_0', 'scale_1', 'scale_2'].map(name => dataTable.getColumnByName(name))), shIterations, gpuDevice);
93434
93437
  await writeTableData('scales.webp', scaleData.labels);