[Bf-committers] Proposal: New Importer for both glTF and COLLADA

Brecht Van Lommel brechtvanlommel at gmail.com
Sun May 17 16:23:05 CEST 2020


Hi Recep,

Thanks for the overview, AssetKit being a small well-written library
is good. However there would be a significant amount of work involved
in integrating it in Blender. Not just in getting the implementation
to work, but also in refining both AssetKit itself and the Blender
integration based on actual user testing, which is often the hardest
part.

We already have glTF and COLLADA integrations which while not perfect,
have been tested by users and improved over time. The glTF add-on in
particular has active developers. For COLLADA it's not clear it's
worth investing much time as it has few active users, and the standard
has not been updated since 2008.

I think changing as little as possible in COLLADA and working on
improving the glTF and USD integrations is the way forward for the
Blender project. It's not clear to me that integrating a library like
AssetKit is the most efficient way to do that.

Regards,
Brecht.


On Sat, May 16, 2020 at 6:44 PM Recep Aslantas via Bf-committers
<bf-committers at blender.org> wrote:
>
> Hi,
>
> My name is Recep,
>
> I was working on library called AssetKit ( https://github.com/recp/assetkit )
> Recently I have implemented importing Morph Targets and Animation from glTF.
>
> AssetKit can import all glTF 2.0 and with "KHR_materials_pbrSpecularGlossiness"
> extension. So it can import Metallic Roughness + Specular Glossiness materials.
>
> It also supports COLLADA 1.4 and COLLADA 1.5 (common profile).
> It uses single interface for both glTF and COLLADA 1.4/1.5.
>
> AssetKit comes with lot of options (and utils), a few options are (all are optional):
> * Triangulate polygons
> * Generate normals
> * Compute Bounding Box
> * Bugfixes for Transparency
> * Compute exact center
> * Convert Coordinate System to Another (Any-to-Any)
> I'm trying to make it faster and more flexible by time. Recently I have written a json and xml parser
> to parse glTF and COLLADA fast as possible. These new parsers also reduced the binary size and
> make the build time faster and portable. Because these are header-only, see my Github https://github.com/recp?tab=repositories to see them
>
> AssetKit is written in C99 and its size is only ~ 240KB + 50KB stb_image.h == 290KB, and it can import
> glTF and COLLADA files and load images. This will reduce Blender size too and increase build time.
>
> The API interface must be very easy to work with.
>
> AssetKit also tries to make the loading and rendering faster by providing utilities and options.
>
> For instance, after you loaded a file with AssetKit like:
>
> AkDoc *doc;
> AkResult ret;
>
> ret = ak_load(&doc, "sample.gltf or .dae", NULL);
>
> you can import morph targets into single buffer with desired inputs with desired order:
>
> void  *morphBuffer;
> size_t buffSize, targetByteStride;
>
> static AkInputSemantic desiredInputs[] = {
> AK_INPUT_SEMANTIC_POSITION,
> AK_INPUT_SEMANTIC_NORMAL,
> AK_INPUT_SEMANTIC_TANGENT
> };
>
> ak_morphInterleaveInspect(&buffSize, &targetByteStride, morph, desiredInputs, 3);
> morphBuffer = malloc(buffSize);
> ak_morphInterleave(morphBuffer, morph, desiredInputs, 3);
>
> now you can pass morphBuffer to GPU directly. This is optional step of course.
>
> AssetKit also provides simple and elegant API like Javascript:
>
> object1 = ak_getObjectById(doc, "object-id")
> object2 = ak_getObjectByUrl(url)
>
> The memory management in AssetKit is awesome. It provides hierarchical memory allocator,
> if you free parent node or document then sub nodes or the whole document will be freed.
>
> I propose to replace OpenCOLLADA and glTF importer with AssetKit.
> AssetKit will also support additional formats without changed the integration if possible
> as extension library like AssetKit-Ext.lib
>
> I can help to integrate it with Blender and feedbacks are always welcome.
> You can propose or request some changes before integration if you like it.
>
> I'll provide CMake build files as soon as possible. The exporter side will be available in the future.
>
> Please take a look at the repo and sources at https://github.com/recp/assetkit
> and ask any questions if you have any.
>
> You will also get better support for this library than others :) I always respond fast as possible on Github.
> Also any contributions/contributors/feedbacks... are always welcome.
>
> Thanks
>
> - Recep
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at blender.org
> https://lists.blender.org/mailman/listinfo/bf-committers


More information about the Bf-committers mailing list