Problem
apply_triangulate_modifiers had two issues:
- It iterated
collection.objects with a obj.parent is not None guard, so any object that was parented (nested) was silently skipped during triangulated exports.
- The triangulate modifier was added to live mesh data and removed after export, but never actually baked — the exported file may not have contained triangulated geometry depending on the exporter.
Expected behaviour
All mesh objects in the collection (including nested ones) should be triangulated before export and restored cleanly afterwards without any leftover modifiers.
Fix
- Switch to
collection.all_objects to include nested objects.
- Bake the triangulated mesh via
new_from_object(eval_obj), swap obj.data, export, then restore the original mesh and remove the temp mesh.
Problem
apply_triangulate_modifiershad two issues:collection.objectswith aobj.parent is not Noneguard, so any object that was parented (nested) was silently skipped during triangulated exports.Expected behaviour
All mesh objects in the collection (including nested ones) should be triangulated before export and restored cleanly afterwards without any leftover modifiers.
Fix
collection.all_objectsto include nested objects.new_from_object(eval_obj), swapobj.data, export, then restore the original mesh and remove the temp mesh.