CASTLE-MODEL-CONVERTER(1)

πŸ’– CASTLE-MODEL-CONVERTER(1) πŸ’–

okay bestie, sit down, hydrate, and let me tell you about castle-model-converter β€” it's a converter for various 3D and 2D model formats and it is, genuinely, iconic. ✨


🌈 SYNOPSIS 🌈

castle-model-converter [OPTION]... INPUT-FILE [OUTPUT-FILE]

that's it. that's the whole vibe. πŸ‘‘


πŸ¦‹ FEATURES πŸ¦‹

okay so for input? we support literally all the 3D and 2D model formats that Castle Game Engine supports: glTF, X3D, VRML, Spine JSON, sprite sheets (in Castle Game Engine, Cocos2D and Starling XML formats), MD3, Wavefront OBJ, 3DS, STL, Collada, and more. the "and more" is doing so much heavy lifting but she earned it. πŸ’…

for output? we support X3D, VRML and STL. so you can convert any input format to X3D or STL. you can also convert between X3D classic and X3D XML encodings β€” in both directions, we love a bidirectional queen 🫢 β€” and you can convert (upgrade!) from VRML 2.0 to X3D. glow-up fr fr.

we can also validate the input model without doing any conversion at all. no conversion, just ✨judgement✨.


πŸŽ€ USAGE πŸŽ€

call it with these parameters:

  1. The input filename. it can be any filename, URL or - (to mean standard input). Required. no input, no party.
  2. The output filename. it can be any filename, URL or - (to mean standard output).

this parameter is optional. if you don't provide it, the output goes to the standard output (so it's equivalent to using - as the output filename) β€” unless --validate is used, in which case the output is not written anywhere at all. she's not writing, she's just reading. πŸ’€


🌸 EXAMPLES 🌸

# Convert glTF to X3D
castle-model-converter input.gltf output.x3d

# Validate some glTF and X3D files
castle-model-converter --validate input.gltf
castle-model-converter --validate input.x3d

# Convert file from X3D classic encoding to X3D XML encoding
castle-model-converter input.x3dv output.x3d

# Convert file from X3D XML encoding to X3D classic encoding
castle-model-converter input.x3d output.x3dv

# Convert VRML 2.0 to X3D in classic encoding.
castle-model-converter input.wrl output.x3dv

# Convert standard input to standard output
castle-model-converter - - < input.x3dv > output.x3dv
castle-model-converter - --stdin-url=fakeurl.gltf - < input.gltf > output.x3dv

the last two? piping through stdin and stdout? main character energy. πŸ”₯


✨ ALL COMMAND-LINE OPTIONS ✨

  • --validate β€” only validate the input model, don't do any conversion. will exit with non-zero status if the input is not 100% valid. and listen: even warnings (the ones that are totally ignorable during normal conversion) cause a non-zero exit status when validating. she is strict. she is thorough. she is that girl. πŸ’…
Note our "validation" isn't 100% complete, bestie. that means passing the validation does not guarantee that your model satisfies every single detail of the specification of the given format. we check for a lot of model issues (including, but not limited to, issues that would make it impossible to render this model using Castle Game Engine). but it's not a complete validation of the model per every detail of the specification. so like… passing = good vibes, not a legal certificate. πŸ™ˆ
  • --no-x3d-extensions β€” do not use Castle Game Engine extensions. this will output a file valid in all X3D browsers (but maybe with some Castle Game Engine-specific features missing). trading ✨extra sparkle✨ for universal compatibility, a classic tradeoff.
  • --enable-downloads β€” enable (blocking) downloads from the net, e.g. to download a texture or inlined (using X3D Inline node) models referenced by htt(s) protocol. yes bestie she will go get it herself, but she will block while doing it, so don't come crying about the wait. 😭
  • --stdin-url=URL β€” if the input URL is -, then we read file contents from the standard input. in this case, you can use this option to provide a fake URL for the input. we'll use it to resolve relative URLs inside the input (e.g. to glTF binary blobs, textures or X3D inlines) and to determine the input file type. default is stdin.x3dv in the current directory, so we assume input is X3D (classic encoding), and resolve URLs with respect to the current directory. 🧚
  • --stdout-url=URL β€” if the output URL is -, then we write file contents to the standard output. in this case, you can use this option to provide a fake URL for the output. we'll use it to determine the output file type. default is stdout.x3dv in the current directory, so we make output in X3D (classic encoding). πŸŽ€
  • --float-precision=DIGITS β€” number of digits after the decimal point when writing floating-point numbers. default is to write all possibly relevant digits. specify any value >= 0 to use this number of digits. precision queen, choose your own adventure. ⭐
  • -h / --help β€” print the help message and exit.
  • -v / --version β€” print the version number and exit.

πŸ’œ Deprecated πŸ’œ

  • --encoding=classic|xml β€” deprecated. use the given X3D encoding on output. by default, we use classic encoding (suitable for X3D files with .x3dv extensions).
Deprecated, do not use this. the 2nd parameter should determine the output type β€” the .x3d extension says to make X3D XML, .x3dv says to make X3D classic. or use --stdout-url to provide a fake URL in case output is to stdout. like, we're not mad, we're just disappointed. πŸ’€

πŸ”₯ RESOURCES πŸ”₯


πŸ‘‘ SEE ALSO πŸ‘‘


🫢 AUTHOR 🫢

Michalis Kamburelis


and that's the tea, bestie πŸ’– this was the castle-model-converter page, man page name CASTLE-MODEL-CONVERTER(1), from castle-model-converter, dated 2024-05-15. go convert something gorgeous. slay. πŸŒˆβœ¨πŸŽ€

πŸ“¦ where this page comes from