assimp / assimp/assimp

ProgressHandler support in C API

Open
#3,753 3 comments 1 reaction 0 assignees View on GitHub
API Feature-Request Progress indication
Dominant language
C++
Stars
13.2k
Forks
3.2k
Avg merge
2d 8h
Merged PRs (30d)
21

Description

Assimp exports the `ProgressHandler` class and offers `Importer::SetProgressHandler()` to set a custom progress handler.

This, however, requires a C++ class with virtual functions and there is no way (to my knowledge) to use this functionality from the C interface in `cimport.h`.

I.e. from C, it is impossible to
1. display progress information
2. cancel imports.

It would be handy to have C support for progress: Let Assimp internally derive `ProgressHandler` to store a pair of (C function pointer + user context) similar to `struct aiFileIO`, then forward all updates to the C function pointer. I don’t know how that pair would be passed to `aiImportFileFromMemoryWithProperties()` without breaking the API, though.

Contributor guide

Open the contributing guide

Research direction

Start with cimport.h and the ProgressHandler/Importer::SetProgressHandler() entry points, then inspect aiImportFileFromMemoryWithProperties() and the existing aiFileIO callback pattern. Define how a C callback and user context would be registered without breaking the API; done means C callers can receive progress updates and cancel imports.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, cpp
Domain
api, backend-api-design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.