Skip to content

Instantly share code, notes, and snippets.

@matux
Last active April 11, 2023 13:49
Show Gist options
  • Star 32 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save matux/4a30c4b4b29d636fe6847b6a3234bc4f to your computer and use it in GitHub Desktop.
Save matux/4a30c4b4b29d636fe6847b6a3234bc4f to your computer and use it in GitHub Desktop.
SceneKit scntool command line options
$ xcrun scntool --verbose
| Current SceneKit version is 4.560000
| Running scntool (compiled on Jul  1 2018 01:01:55)

usage: scntool --convert file --format format [--output file]
000084a8:  7363 7269 7074 696f 6e00 2d2d 7461 7267 6574 2d70 6c61 7466  :scription.--target-platf
000084c0:  6f72 6d3d 002d 2d74 6172 6765 742d 7665 7273 696f 6e3d 002d  :orm=.--target-version=.-
000084d8:  2d74 6172 6765 742d 6275 696c 642d 6469 723d 002d 2d72 6573  :-target-build-dir=.--res
000084f0:  6f75 7263 6573 2d66 6f6c 6465 722d 7061 7468 3d00 5343 4e54  :ources-folder-path=.SCNT
00008508:  6f6f 6c46 6f72 6365 5955 7000 5343 4e54 6f6f 6c46 6f72 6365  :oolForceYUp.SCNToolForce
00008520:  5665 7262 6f73 6500 2d2d 666f 7263 652d 792d 7570 002d 2d66  :Verbose.--force-y-up.--f
00008538:  6f72 6365 2d69 6e74 6572 6c65 6176 6564 002d 2d70 7265 6665  :orce-interleaved.--prefe
00008550:  722d 636f 6d70 7265 7373 6564 2d74 6578 7475 7265 7300 2d2d  :r-compressed-textures.--
00008568:  6173 7365 742d 6361 7461 6c6f 672d 7061 7468 002d 2d72 6573  :asset-catalog-path.--res
00008580:  6f75 7263 6573 2d70 6174 682d 7072 6566 6978 0075 7361 6765  :ources-path-prefix.usage
00008598:  3a20 2540 202d 2d63 6f6e 7665 7274 2066 696c 6520 2d2d 666f  :: %@ --convert file --fo
000085b0:  726d 6174 2066 6f72 6d61 7420 5b2d 2d6f 7574 7075 7420 6669  :rmat format [--output fi
000085c8:  6c65 5d00 436f 6e76 6572 7369 6f6e 2066 6169 6c65 642c 2077  :le].Conversion failed, w
000085e0:  696c 6c20 7369 6d70 6c79 2063 6f70 7920 696e 7075 7420 746f  :ill simply copy input to
000085f8:  206f 7574 7075 742e 0043 6f70 7920 6661 696c 6564 2025 4020  : output..Copy failed %@ 
00008610:  2d3e 2025 4020 6572 726f 723a 2540 002d 2d76 6572 626f 7365  :-> %@ error:%@.--verbose
00008628:  002d 2d63 6f6e 7665 7274 002d 6300 2d2d 636f 6d70 7265 7373  :.--convert.-c.--compress
00008640:  002d 6400 2d2d 6465 636f 6d70 7265 7373 002d 2d75 6e63 6f6d  :.-d.--decompress.--uncom
00008658:  7072 6573 7300 2d2d 636f 7079 002d 2d66 6f72 6d61 7400 556e  :press.--copy.--format.Un
  • --convert: File to convert. Formats found to be supported: com.apple.scenekit.scene (scn), com.apple.scenekit.scene.zip (scnz), com.apple.scenekit.particlesystem (.scnp), org.khronos.collada.digital-asset-exchange (.dae), c3d, bplist
  • --format: Format to convert to. Formats found to be supported: scn, c3d, dae.
  • --output: Destination path and filename.
  • -c (--compress)
  • -d (--decompress)
  • --uncompress
  • --copy
  • --target-platform=
  • --target-version=
  • --target-build-dir=
  • --asset-catalog-path
  • --resources-path-prefix
  • --resources-folder-path=
  • --force-y-up: Some documents use different up axis. When enabled, objects in a scene are converted to the Y-up orientation.
  • --force-interleaved: Because most geometries use more than one geometry source and the GPU typically uses data from multiple sources together, you can achieve better rendering performance for custom geometries by interleaving the vertex data for multiple semantics in the same array.
  • --prefer-compressed-textures: Use this option to prefer KTX, ASTC and PVRTC to other file formats. When enabled, if an image is referenced by a scene and exists within the asset catalog with the same name and the .astc or .pvrtc file extension, the compressed version will be used by SceneKit.
  • --verbose: Always use verbose to get pretty error messages. With --verbose: scntool: error: No file at path /path/to/model/file.scn Same error, without --verbose:
2018-07-06 21:30:34.086 scntool[47127:34783644] *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSFrozenArrayM objectAtIndexedSubscript:]: index 8 beyond bounds [0 .. 7]'
*** First throw call stack:
(
	0   CoreFoundation                      0x00007fff30d2f484 __exceptionPreprocess + 197
	1   libobjc.A.dylib                     0x00007fff5ce5ad08 objc_exception_throw + 48
	2   CoreFoundation                      0x00007fff30d663b4 _CFThrowFormattedException + 202
	3   CoreFoundation                      0x00007fff30d4b01c -[__NSFrozenArrayM objectAtIndexedSubscript:] + 118
	4   scntool                             0x000000010591b890 _Z27stringValueForArgumentNamedP7NSArrayP8NSString + 156
	5   scntool                             0x0000000105920133 main + 530
	6   libdyld.dylib                       0x00007fff5ddddb11 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Abort trap: 6

¯\_(ツ)_/¯

@eivindml
Copy link

Awesome. It's so weird that this tool isn't mentioned or documented anywhere (except here). I've been having so much trouble with importing .dae files into SceneKit editor. But after just converting them with this tool, it works flawlessly.

I don't even need the ConvertToXcodeCollada script that everybody mentions in their tutorials.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment