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

[2.X] Add a helper for custom IO in Assimp #2199

Merged
merged 5 commits into from
Jul 1, 2024
Merged

Conversation

Perksey
Copy link
Member

@Perksey Perksey commented May 29, 2024

Summary of the PR

Adds a CustomFileIO class which allows a Stream factory to be used in the context of a FileIO implementation in Assimp.

Related issues, Discord discussions, or proposals

https://discord.com/channels/521092042781229087/607634593201520651/1245146529468121138

Further Comments

@Perksey Perksey requested a review from a team as a code owner May 29, 2024 18:47
@Perksey
Copy link
Member Author

Perksey commented May 29, 2024

This is ready for review.

Comment on lines 175 to 178
if (GCHandle.FromIntPtr((nint) file->UserData).Target is not Stream s)
{
throw new InvalidOperationException("Invalid UserData for File.");
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function can probably be wrapped into a Stream s = GetStreamFromUserData(file->UserData);, which would de-duplicate a lot of code here

@Perksey Perksey merged commit 8ac952e into main Jul 1, 2024
6 checks passed
@Perksey Perksey deleted the feature/assimp-io-helper branch July 1, 2024 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants