GithubHelp home page GithubHelp logo

crayon-tools's Introduction

What's This?

Various command line tools for crayon.

Getting started

Its easy to setup crayon-cli in your environments by following steps below:

git clone [email protected]:shawnscode/crayon-tools.git && make

Workspace

We are using a simple workspace.toml file to configurate the workspace settings. Here is a minimal version of it:

[assets]
source = 'assets' # the path to assets folder..
destination = 'resources' # the path to resources folder, which are usually compiled from assets.

# sets the importer for extensions, if extensions are not listed below, it will be treated as
# `Bytes` asset.
[[assets.importers]]
type = 'Texture'
extensions = ['.png', '.jpg', '.jpeg', '.bmp', '.tga', '.psd'] # Yes, we do supports .PSD files.

[[assets.importers]]
type = 'Transmission'
extensions = ['.obj', '.blend', '.fbx', '.gltf', '.dae', '.3ds']

[[assets.importers]]
type = 'Audio'
extensions = ['.mp3', '.wav', '.ogg', '.flac']

Assets Workflow

General Thoughts

The most important sub-command that comes with crayon-cli would be assets pre-processing. There are different requirement for asset to be processed in various situations.

  1. The assets might be modified by artiest continuous, so it would be great if we store resource in formats which could producing and editing by authoring tools directly.

  2. The most effecient format is dependent on platform and hardware devices. The assets might be converts to various formats based on the build target before packing into playable package.

  3. The processing of assets from plain formats into runtime formats might causes heavily cpu consumption, and takes minutes for medium size project. By the same time, its a common requirement to edit and preview the effects on playable environment. So we should have some kind of mechanism to manage the asset processing incrementally.

  4. Many software use path as identification of assets, it works fine before we refining the name or file structure of assets, and path itself is not platform independent yet. Its better to have a general GUID mapped to asset.

How it Works

crayon-cli build

This CLI automatically imports assets and manages various kinds of additionla data about them for you, such as what import settings should be used to import the asset, below is a description of how this process works.

When you place an asset (name) in the specified workspace::assets folder, and runs crayon-cli build:

  1. A meta-file name.meta.toml is created;
  2. For every resource that this asset might produces, a universal-uniqued id is assigned to it;

And besides that, all the assets will be processed, converted to internal game-ready versions incrementally in the workspace::resources folder.

Meta-file

The UUID that crayon-cli assigns to each resource is stored inside the .meta.toml file alongside the asset file itself. This .meta file must stay with the asset file it relates to.

And also the meta files contain values for all the import settings, For a texture, this includes settings such as the TextureWrap, TextureFilter and Compression mode etc.. If you change the import settings for an asset, the asset will be re-imported according to your new settings with next build command.

  • Notes that .meta.toml files must match and stay with their respective asset files. If you move or rename an asset, you must move or rename the .meta.toml file to match, or you will lost all the references that points to it (a new GUID might be generated for it).

crayon-tools's People

Contributors

shawnscode avatar

Watchers

alanpoon avatar

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.