Fix glTF2 occlusion strength import/export and normal scale export#6602
Fix glTF2 occlusion strength import/export and normal scale export#6602kimkulling merged 2 commits intoassimp:masterfrom
Conversation
📝 WalkthroughWalkthroughThe changes refactor glTF2 importer and exporter modules to replace string-based texture property key construction with macro-based direct property access. A deprecated Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
code/AssetLib/glTF2/glTF2Exporter.cpp (1)
553-557: Remove the unusedGetMatTexPropdeclaration and definition.The header still contains the declaration at
glTF2Exporter.h:112, while the definition atglTF2Exporter.cpp:553–556has no active call sites (only commented-out references at lines 648 and 659 remain). Clean up by removing:
- The declaration from the header
- The definition from the .cpp file
- The commented-out calls at lines 648 and 659
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@code/AssetLib/glTF2/glTF2Exporter.cpp` around lines 553 - 557, Remove the unused GetMatTexProp API: delete its declaration from glTF2Exporter.h and remove its definition (glTF2Exporter::GetMatTexProp) from glTF2Exporter.cpp, and also remove the remaining commented-out references to GetMatTexProp where they appear in the file so there are no stale mentions; ensure no other code references the symbol before committing.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@code/AssetLib/glTF2/glTF2Exporter.cpp`:
- Around line 553-557: Remove the unused GetMatTexProp API: delete its
declaration from glTF2Exporter.h and remove its definition
(glTF2Exporter::GetMatTexProp) from glTF2Exporter.cpp, and also remove the
remaining commented-out references to GetMatTexProp where they appear in the
file so there are no stale mentions; ensure no other code references the symbol
before committing.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 7a52b11c-8d00-447a-98fb-a35e4a7cd54b
📒 Files selected for processing (3)
code/AssetLib/glTF2/glTF2Exporter.cppcode/AssetLib/glTF2/glTF2Exporter.hcode/AssetLib/glTF2/glTF2Importer.cpp
💤 Files with no reviewable changes (1)
- code/AssetLib/glTF2/glTF2Exporter.h
|
Merged, thanks a lot for your contribution. |
|



When trying to use assimp to import glTF2 files I ran into some issues with a handful of glTF-specific property keys:
"$tex.file.strength"rather than using the GLTF-specific keyAI_MATKEY_GLTF_TEXTURE_STRENGTHdefined as"$tex.strength"that already existed making it confusing and difficult to access this material property.AI_MATKEY_GLTF_TEXTURE_SCALEdefined as"$tex.scale"but exported by looking for the custom property key"$tex.file.scale"meaning round-trip import -> export would not retain this property.Summary by CodeRabbit