← All ideas
  • Published 6 Aug 2022

bpy.data.make_dirty() for manually seting is_dirty flag to True

Information whether changes in the blend file have been saved is sometimes necessary for correct execution.

Use case might be generating blend file data and other files from script for further rendering via CLI subprocess.

bpy.data.is_dirty seems to be the value that tells us if the file was edited, but the documentation is not really complete. is_dirty only switches to True if operators have been called from the UI and these operators contain UNDO in bl_options. We can completely change the contents of the blend from a Python script and is_dirty will still be set to False if these criteria are not met.

I propose to add a new method that will allow addon developers to manually set the is_dirty flag to True in operators that cannot have UNDO options for various reasons.

We should also improve the is_dirty documentation to describe exactly when the flag will switch. And point to make_dirty once it's implemented.

devtalk.blender.org/t/how-to-get-bpy-data-is-dirty-updating-when-changes-are-done-by-script/4852

100%

Development Status: Open

Upvote 5 Downvote 0
moniewski
6 Aug 2022

0 Comments