DiscussionsIssue archiveData Exchange and Application Framework

Archived discussion

Draco Compression

Data Exchange and Application FrameworkWed, 05/08/2024 - 07:573 replies

Browse this forum
QuestionAuthor

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 ?

Discussion

3 archived replies

Posts are displayed in their archived order.

01Commenter-1

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.

02Author

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";

03Commenter-2

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, Commenter-2.