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

Expose the original OBJ "illum" value #4409

Merged
merged 4 commits into from Feb 24, 2022
Merged

Expose the original OBJ "illum" value #4409

merged 4 commits into from Feb 24, 2022

Conversation

TerenceRussell
Copy link
Contributor

This commit exposes the original Obj model illum value (illumination_model) as a material property.

The illum value is defined in a .mtl material file like so:
illum 3

Background:
ObjFileImporter::createMaterials in ObjFileImporter.cpp partially interprets the illum value as an aiShadingMode enum and stores it in the AI_MATKEY_SHADING_MODEL material property. Illumination model values 3 thru 10 are lost in the interpretation. Exposing the original illum value allows user interpretation of the intended model.

Example accessor usage:
aiScene* scene = ...
int illum = 1;
aiMaterial* mtl = scene->mMaterials[m];
aiGetMaterialInteger(mtl, AI_MATKEY_OBJ_ILLUM, &illum);

Copy link
Member

@kimkulling kimkulling left a comment

Choose a reason for hiding this comment

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

Looks good.

@kimkulling kimkulling merged commit 04858c5 into assimp:master Feb 24, 2022
@kimkulling
Copy link
Member

Mered, thanks a lot for your contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants