Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a cancel / continue callback to control LoadUSDFromFile #167

Open
MootoolsSoftware opened this issue Jun 17, 2024 · 1 comment
Open
Labels
enhancement New feature or request low priority

Comments

@MootoolsSoftware
Copy link

We are currently implementing an USD parser based on tinyusdz for an application that is displaying thumbnails from these files.
As the user might browse to another folder without waiting end of parsing, it must be possible to stop USD reading when this occurs.

When processing large file it would be convenient to add the ability to cancel the usd file parsing.
I don't find such possibility and that would be nice to be able to set a callback that returns true or false when the process should stop whould be nice.

@syoyo syoyo added enhancement New feature or request low priority labels Jun 17, 2024
@syoyo
Copy link
Collaborator

syoyo commented Jun 17, 2024

TinyUSDZ does not have a feature to cancel the parsing(and progress callback) at the moment.

For a while you can wrap USD Load API with C++ thread/future and set timeout or force kill the thread, but adding a progress callback would be better as you suggests.

Fortunately TinyUSDZ uses hand-written USDA parser and USDC parser, so adding a callback at arbitrary granularity(e.g. per-Prim, per-Property/Attribute) in the parser would be possible, but it would require some amount of work to implement it and also need some time to think about a good logic.

Priority is low unless you contribute or sponsor implementing this feature 🥺
(If you can sponsor it, you may also be interested in sponsoring optimized Ascii parser #164 and multi-threaded USD parsing #56 )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request low priority
Projects
None yet
Development

No branches or pull requests

2 participants