Coder Social home page Coder Social logo

recp / assetkit Goto Github PK

View Code? Open in Web Editor NEW
181.0 13.0 17.0 3.18 MB

🎨 Modern 2D/3D - Importer • Exporter • Util - Library, also known as (AssetIO)

License: Apache License 2.0

Shell 0.20% M4 0.23% C 98.11% Python 0.80% Batchfile 0.03% CMake 0.62%
3d collada gltf 3d-importer 3d-exporter 3d-engine 3d-asset mesh mesh-import 3d-loader

assetkit's Introduction


C/C++ CI CMake MSBuild Codacy Badge Coverage Status glTF Badge

Patreon: Become a patron Sponsors on Open Collective Backers on Open Collective


Brand-new modern 3D asset importer, exporter library. This library will include common 3D utils funcs. It is written with C99 but C++ wrappers or other language bindings can be written in the future.

This library will try to full support COLLADA specs and glTF specs, plus well-known other 3D formats e.g .obj, .stl, .ply...

📌 There is also an optional renderer library called Graphics Kernel (Realtime Rendering) and rays (Path/Ray Tracer) which can render AssetKit contents. You can see how to load AssetKit to Graphics Kernel in AssetKit-GL repo. Both renderers and documentation with samples will be updated regularly...

📚 Documentation (In Progress)

Almost all functions (inline versions) and parameters will be documented inside the corresponding headers.
Complete documentation: http://assetkit.readthedocs.io

💪 Supported Formats

  • Asset Exchange (todo) http://github.com/AssetExchange/spec
  • COLLADA 1.4 and COLLADA 1.4.1
  • COLLADA 1.5
  • glTF 2.0 (Embedded or Separated (.gltf), Binary (.glb), Extensions...)
  • Wavefront Obj (.obj + .mtl)
  • STL (ASCII, Binary)
  • PLY (ASCII, Binary)
  • 3MF (in progress)
  • FBX (License?, probably need to download FBX SDK externally)
  • USD and friends (License?)
  • Alembic (License?)
  • Draco
  • X3D
  • in progress for next...
  • Exporter

🚀 Features

  • Single interface for glTF 2.0 (with extensions), COLLADA 1.4/1.4.1/1.5, Wavefront Obj and others...
  • Very very small and very fast library
  • Javascript-like API to get URL or ID obj = ak_getObjectById(doc, objectId)...
  • Options to Generate Mesh Normals (Default: enabled)
  • Option to Triangulate Polygons (Default: enabled)
  • Option to change Coordinate System (Default: enabled)
  • Option to calculate Bounding Boxes (Default: enabled)
  • Unique and Flexible Coordinate System
    • Support multiple coordinate system
    • Can convert any coordinate system to another with adding transform or with changing transform, vertex data...
  • Unique and Flexible Memory Management System
    • Hierarchical unique memory management
      • When a node is freed then all sub memories will be freed
    • COLLADA's sid and ID values are mapped to memory nodes itself to reduce memory size and make it easy to manage things.
    • Allow attach ID, sid or user data to a memory node
  • Object-based Asset support; resolve asset element for any element
  • Bugfix some DAE files
  • Will be optimized to be fastest, smallest and most flexible, extendible Asset loader.
  • Uses mmap to load files, you can disable this if needed
  • Documentation
  • Cmake support
  • Tests

🔨 Build

CMake (All platforms)

$ mkdir build
$ cd build
$ cmake .. # [Optional] -DAK_SHARED=ON
$ make
$ sudo make install # [Optional]
Cmake options with Defaults:
option(AK_SHARED "Shared build" ON)
option(AK_STATIC "Static build" OFF)
option(AK_USE_TEST "Enable Tests" OFF) # for make check - make test

Use with your CMake project

  • Example:
cmake_minimum_required(VERSION 3.8.2)

project(<Your Project Name>)

add_executable(${PROJECT_NAME} src/main.c)
target_link_libraries(${LIBRARY_NAME} PRIVATE assetkit)

add_subdirectory(external/assetkit/)

# or you can use find_package() to configure assetkit

Unix (Autotools)

Step 1: First you should build dependencies, do this only once:

$ sh ./build-deps.sh

Step 2: Build, Test and Install AssetKit

$ sh autogen.sh
$ ./configure
$ make
$ make check
$ [sudo] make install

Step 3: Change install name if required, after make finished make automaticall runs sh ./post-build.sh script. It changes install names. You may want to edit build scripts and post-build.sh script if you want to build AssetKit with existing libraries. Default behavior is that AssetKit will look up sub libraries inside .libs folder, if you only need to change .libs name then change it in post-build.sh script file.

Windows (MSBuild)

Windows related build files, project files are located in win folder, make sure you are inside assetkit/win folder. Code Analysis are enabled to it may take awhile to build

git and python commands should be installed/accessible.

$ cd win
$ .\build.bat
$ msbuild assetkit.vcxproj /p:Configuration=Release

if msbuild won't work correctly then try to build with devenv:

$ devenv assetkit.sln /Build Release

Contributors

This project exists thanks to all the people who contribute. [Contribute].

Backers

Thank you to all our backers! 🙏 [Become a backer]

Sponsors

Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [Become a sponsor]

Trademarks

glTF and COLLADA and their logos are trademarks of Khronos Group.

assetkit's People

Contributors

clayne avatar ning-y avatar recp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

assetkit's Issues

Minimal usage example

Please provide new usage example for reading meshes or update the wiki tutorial.

I couldn't make the library work.

Investigate other ways to convertring multi-index array to single-index array

Currently I'm duplicating positions for different input values for same position. For instance consider a CUBE; cube has 8 unique positions, and 24 normals. So we have single INDEX/ELEMENT ARRAY in GL.

Assume that COLLADA gives two different index for describe POSITION and NORMAL indices e.g.:
1 0 2 0 3 0 1 1 4 1 2 1 ...

During parsing I'm converting this indices (<p>) to: ( by duplicating positions )
1 2 3 4 5 6 ...

In the end, I'm making 8 positions to 24 then send GPU,

Maybe there are better way to do this?

Make Converting Coord Sys Optional

As default behavior, AssetKit tries convert document coordinate system to default coordinate system which is configurable option AK_OPT_COORD. But the problem is that viewer may not want involve to any coord-sys specific operation.

Making this step optional will improve loading performance

Default is Y_UP but with an option like ak_opt_set(AK_OPT_USE_DOC_COORD, true); loaded document's coord sys can be considered as default coord-sys e.g. if imported document is Z_UP default will be Z_UP and loader will skip converting coord-sys (geometries, transforms, cameras, lights...)

AK_OPT_USE_DOC_COORD should not override AK_OPT_COORD option

Figure out "Page build failure" warning/error

The page build failed with the following error:

The submodule registered for ./lib/libxml2 could not be cloned. Make sure it's using https:// and that it's a public repo. For more information, see https://help.github.com/articles/page-build-failed-invalid-submodule.

For information on troubleshooting Jekyll see:

https://help.github.com/articles/troubleshooting-jekyll-builds

If you have any questions you can contact us by replying to this email.

NOTE: libxml2 submodule reference link starts with git:// not https://, also GitBook maybe used instead of Jekyll, not sure!

How to compile this? getting error.

I keep getting this error and have git and python both installed and to PATH....

Annotation 2020-05-18 003148

note I am not a developer or coding person, I just want to test this addon ....

Thanks.

Can't build library on linux

I am running Garuda Linux

I git clone the repository run cmake/automake as in the tutorial and i get compile errors after I run make.

Consolidate compiler generated dependencies of target ds
[  0%] Building C object deps/ds/CMakeFiles/ds.dir/src/util.c.o
/home/snake/Desktop/AssetKit/deps/ds/src/util.c: In function ‘ds_print_i64’:
/home/snake/Desktop/AssetKit/deps/ds/src/util.c:122:16: error: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 2 has type ‘int64_t’ {aka ‘long int’} [-Werror=format=]
122 |   printf("\t%llu\n", *(int64_t *)key);
|             ~~~^     ~~~~~~~~~~~~~~~
|                |     |
|                |     int64_t {aka long int}
|                long long unsigned int
|             %lu
/home/snake/Desktop/AssetKit/deps/ds/src/util.c: In function ‘ds_print_ui64’:
/home/snake/Desktop/AssetKit/deps/ds/src/util.c:128:16: error: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 2 has type ‘uint64_t’ {aka ‘long unsigned int’} [-Werror=format=]
128 |   printf("\t%llu\n", *(uint64_t *)key);
|             ~~~^     ~~~~~~~~~~~~~~~~
|                |     |
|                |     uint64_t {aka long unsigned int}
|                long long unsigned int
|             %lu
cc1: all warnings being treated as errors
make[2]: *** [deps/ds/CMakeFiles/ds.dir/build.make:104: deps/ds/CMakeFiles/ds.dir/src/util.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:672: deps/ds/CMakeFiles/ds.dir/all] Error 2
make: *** [Makefile:156: all] Error 2

If I try to hand fix these errors, a bunch of errors pop up, not just warning, but errors like AK_INLINE, AkFloat3 etc.

loading images

Currently AssetKit uses stb_image to load images but maybe creating a separate library for images would be better and give more control for loading images.

Android Support

AssetKit must support Android JNI / NDK. Currently I couldn't build AssetKit for Android because of I couldn't build libxml2 for Android.

Dropping some dependencies is an option to make it more build friendly, especially for Android.

Generate Normals

If mesh doesn't contain normals then they must be generated if this option is not disabled.

This is optional for users. Default behavior is generate normals if needed.

proposal: store joint and weights in mesh

In the current design, we store joints and joint weights in skin object. But these data could be stored in mesh instead of skin like glTF design. In this way we could access joints and weights more easily. Render engines could load joints/weights more easily...

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.