Draco Compression

I am able export gltf with Draco compression. But I don't know about reading Draco compressed gltf file.
Does open cascade support import of Draco compressed file ?

gkv311 n's picture

Where your doubts come from? Do you experience some issues?

Both reader (RWGltf_CafReader) and writer (RWGltf_CafWriter) support Draco compression extension, in case of OCCT was built with USE_DRACO=ON building option.

rahulmulik9's picture

How can I read a file that includes 'KHR_draco_mesh_compression'?
I'm new to this, and here's what my current code looks like

std::vector<Mesh> meshes;
std::vector<Animation> animations;
std::string extras;
const char* error = 0;
Standard_CString input_file = aFileName;
cgltf_data* gltfdata = parseGltf(input_file, meshes, animations, extras, &error);

in parseGLTF i have written this code up to now for Draco compression

cgltf_result result = cgltf_parse_file(&options, path, &data); //where data is cgltf_data* data

if (requiresExtension(data, "KHR_draco_mesh_compression")) //requiredExtension will check data contain KHR_draco_mesh_compression or not
*error = "file requires Draco mesh compression support";

Dmitrii Pasukhin's picture

Hello, you code is not a OCCT related code.

To read GLTF you need to use RWGltf_CafReader and it will read draco compressed files by default.(if OCCT was build with USE_DRACE=on, on configuration time and can't be udpated in real time)

Best regards, Dmitrii.