Microsoft.glTF.Android.CPP 1.6.1

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Microsoft.glTF.Android.CPP --version 1.6.1                
NuGet\Install-Package Microsoft.glTF.Android.CPP -Version 1.6.1                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Microsoft.glTF.Android.CPP" Version="1.6.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Microsoft.glTF.Android.CPP --version 1.6.1                
#r "nuget: Microsoft.glTF.Android.CPP, 1.6.1"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Microsoft.glTF.Android.CPP as a Cake Addin
#addin nuget:?package=Microsoft.glTF.Android.CPP&version=1.6.1

// Install Microsoft.glTF.Android.CPP as a Cake Tool
#tool nuget:?package=Microsoft.glTF.Android.CPP&version=1.6.1                

General Fixes/Changes -Changed AnimationChannels vector to an indexed container -Added a Version type -Added optional support for UTF-8 byte order marks -Added support for generating line list indices for line strips and line loops -Added utils to support morph weight animation -Added missing operators to Color3 and Color4 classes -Added conversion of Color4 to uint32_t bgra -Enabled and fixed all clang warnings

#GLTF Deserializer/Serializer in C++

  • Fully compliant with KhronosGroup GLTF 2.0 spec
  • Can ingest GLB/GLTFs as well as GLTFs with embedded Base64
  • Support for extensions
  • Built-in compliance validation during deserialization
  • Low memory overhead
  • Simple interface for reading any model information automatically converted to any bit size
  • Flexibility and ease of integration to any 3D engine
  • macOS/Windows Compatible

GLTFSDK is a fully compliant Deserializer/Serializer for GLTF, GLB and Base64 encoded GLTF files, implemented in C++ 11. Designed for flexibility and ease of integration into 3D engines. It supports files containing extensions and extras, allows easy direct reading of any model information into vectors of any desired bit size, and has built-in compliance validation of files during deserialization. Available for both Windows and macOS.

#include <GLTFSDK/Deserialize.h>
#include <GLTFSDK/Serialize.h>
#include <GLTFSDK/GLTFResourceWriter.h>
#include <GLTFSDK/GLBResourceReader.h>
#include <iostream>
#include <fstream>


using namespace Microsoft::glTF;

class InStream : public IStreamReader
{
public:
    InStream() : m_stream(std::make_shared<std::stringstream>(std::ios_base::app | std::ios_base::binary | std::ios_base::in | std::ios_base::out))
    {
    }

    std::shared_ptr<std::istream> GetInputStream(const std::string&) const override
    {
        return m_stream;
    }

private:
    std::shared_ptr<std::stringstream> m_stream;
};

int main(int arg, char *argv[])
{
    auto glbStream = std::make_shared<std::ifstream>("some\\path.glb", std::ios::binary);
    auto streamReader = std::make_unique<InStream>();
    GLBResourceReader reader(*streamReader, glbStream);

    // get json from GLB and deserialize into GLTFDocument
    std::string json = reader.GetJson();
    GLTFDocument gltfDoc = DeserializeJson(json);

    //serialize and write new gltf json showing the json structure originally hidden in GLB
    std::string gltfJson = Serialize(gltfDoc, SerializeFlags::Pretty);
    std::ofstream outStream("some\\path.gltf");
    outStream << gltfJson;
    outStream.flush();
}
There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.6.3.1 1,778 8/31/2018
1.6.1 1,446 8/10/2018
1.5.19 1,293 6/15/2018

-Changed AnimationChannels vector to an indexed container
-Added a Version type
-Added optional support for UTF-8 byte order marks
-Added support for generating line list indices for line strips and line loops
-Added utils to support morph weight animation
-Added missing operators to Color3 and Color4 classes
-Added conversion of Color4 to uint32_t bgra
-Enabled and fixed all clang warnings