Code Monkey home page Code Monkey logo

gltf2obj's Introduction

gltf2obj

This is a cpp tool that convert certain gltf model to obj. This is ideal for model that is converted from obj to gltf. And for certain reason want to convert it back.

This package depends on tiny-gltf to load the draco compressed gltf file. gltf2obj does not deal with image since the input is treated as that the textures are separated.

Build process

Get draco source

remember to get draco in this directory by git clone https://github.com/google/draco.git

Build for Mac/Linux

cd to draco folder.

$ mkdir build_dir && cd build_dir
$ cmake ../

Then go to gltf2obj folder

$ mkdir build_dir && cd build_dir
$ cmake ../
$ cmake --build .

Build for Windows

Install CMake GUI version

Using the GUI to open the draco folder. Choose the build directory to be build_dir Then click configure and generate button. Open the project in VS2015 for example. Build for the Release or Debug version.

After build complete, you should see drao.lib in build_dir/RELEASE directory.

Do the samething for the gltf2obj.

Then you should get the executable gltf2obj. Pass the gltf file Path and output dir to it, it will generate the corresponding obj model.

Batch processing

Please go to the script folder for python tools to convert between obj and gltf.

obj2gltf_batch.py

Use this example to convert a folder containing obj sequences to gltf sequences in destination folder.

Requirement: have node js tool obj2gltf and gltf-pipeline installed in the system

obj2gltf_batch.py -i <root of obj sequence> -o <root of output> [-d]

Provide -d in usual case to enable draco compression to the gltf output. If do not provide, we get gltf model without draco compression.

gltf2obj_batch.py

Use this example to convert a folder that contains gltf sequences to obj model.

Requirement: Need to have the c++ gltf2obj tool built already and knows the path to it.

gltf2obj_batch.py -e <path of the cpp gltf2obj tool> -i <root of gltf sequence> -o <root of output>

gltf2obj's People

Contributors

psycotodd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

gltf2obj's Issues

make draco error

gltf2obj/gltf2obj-main/draco/src/draco/core/status_or.h:38:51: error: call to deleted constructor of 'std::unique_ptr<draco::Mesh, std::default_deletedraco::Mesh >'
StatusOr(const T &value) : status_(OkStatus()), value_(value) {}

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.