Page MenuHome

Fix T100797: C++ exporters do not remember the path on subsequent exports
ClosedPublic

Authored by Aras Pranckevicius (aras_p) on Sep 7 2022, 10:06 AM.

Details

Summary

Most/all C++ based IO code had a pattern of doing if (!RNA_struct_property_is_set(op->ptr, "filepath")) { /* set default path */ }. However, RNA_struct_property_is_set returns false for properties restored from "previous operator settings" (property restoration code sets IDP_FLAG_GHOST flag on them, which "is set" sees and goes "nope, not set").

The fix here is to apply similar logic as 10 years ago in the T32855 fix (rBdb250a4): use RNA_struct_property_is_set_ex instead.

Open question: the "check if file path is set, set default path that's based on blender file location" seems to be pretty much copy-pasta just with different extension between all these places. Maybe worth factoring it out into a common shared function?

Diff Detail

Repository
rB Blender