Coder Social home page Coder Social logo

gltf-metadata-cli's Introduction

glTF Metadata CLI Tool

CLI tool for managing metadata within glTF files using the KHR_XMP extension.

NOTICE

Binaries are not yet available, but will be coming very soon! In the meantime please follow the section below if you'd like to try out the alpha release.

How to use

Currently, binaries are not available. This will be rectified soon. In order to build a copy for yourself, you will need to install and configure Rust for your platform.

Once Rust is installed, follow these steps:

  1. Pull down the latest copy of this code from the v1.0.0-alpha01 tag: git checkout v1.0.0-alpha01
  2. Run cargo build. This will install and build dependencies.
  3. Run cargo run -- <YOUR ARGUMENTS HERE>. Some examples below:

To list out the metadata found in the Box.gltf file, use:

cargo run -- -i examples/Box.gltf --list

To create a version of the Boombox sample with metadata use:

cargo run -- -i glTF-Sample-Models/2.0/BoomBox/glTF/BoomBox.gltf -o glTF-Sample-Models/2.0/BoomBox/glTF/BoomBox_metadata.gltf -j examples/sample.khr_xmp.json

You can also read and write from .glb files as well. To create a version of the DamagedHelmet binary glTF sample with metadata, use:

cargo run -- -i ./glTF-Sample-Models/2.0/DamagedHelmet/glTF-Binary/DamagedHelmet.glb -o DamagedHelmet_metadata.glb -j examples/sample.khr_xmp.json

Available Arguments

Flag Value Description Required? Version Added
-i, --input Path Input file path Yes 1.0.0-alpha01
-o, --output Path Output file path Yes, unless --list flag present. 1.0.0-alpha01
-l, --list None Lists the metadata out to the console. No 1.0.0-alpha01
-j, --json Path JSON file path including KHR_xmp metadata No 1.0.0-alpha01
--allow-overwrite None Allow overwriting the output file. No 1.0.0-alpha01
-v, --verbose None Enable verbose logging output. No 1.0.0-alpha01

Future milestones

This section is formatted as "PRIORITY: Milestone" to give an idea of how important the milestone is to final 1.0.0 release.

  • CRITICAL: Migration flag to migrate from KHR_xmp to KHR_xmp_json_ld.
  • CRITICAL: Pre-built binaries for each platform.
  • HIGH: Input via command-line parameters.
  • MEDIUM: Implement basic writing from XMP files to both .glTF and .glb files.
  • MEDIUM: JSON/XMP input via Pipe.
  • MEDIUM: Support for multiple packets.
  • LOW: Extraction of KHR_xmp metadata into a JSON file.

Known issues

  • xmp:MetadataDate is not being updated or written.

Version Notes

1.0.0-alpha01

  • Initial Release.
  • Support for .glTF 2.0 spec files.
  • Implements --list functionality, to list out KHR_xmp metadata contained in .glTF files.
  • Implements basic --json writing of KHR_xmp metadata.

1.0.0-alpha02

  • Full support for .glb files. Added example.

1.0.0-alpha03

  • Implemented support for the new KHR_xmp_json_ld extension replacing KHR_xmp.
  • The --legacy switch is required for all operations using KHR_xmp. This includes listing existing KHR_xmp data.
  • The --migrate switch has been added but is not usable yet. Will be released soon in the next release.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.