How careful do I have to be when modifying a Blender file through bpy?
Is it possible, through any part of the the Python API/console, to permanently alter a file's data in a way that is impossible to undo through the GUI?
Is the fact that it is or isn't possible by explicit design, or is it due to lucky concidence or unlucky bugs?
bpy, and via the data structures and methods therein. I'm not going to callopen().write()oros.system()with unsanitized inputs, for example, but I might recurse throughbpy.dataand randomly reassign, call, or delete objects' properties and methods with other objects' properties and_RNA_UIvalues. – Will Chen Feb 27 '21 at 22:29bpy.datacan modify one of methods, which in turn can do the harm. This is also what I meant by "Since it's Python" - you can freely modify methods and properties of all objects. Damaging an OS without ill intent is unlikely, but possible, and corrupting a file is more likely - but how likely exactly depends largely on your coding style and any answer other than "it's possible" I think would be opinionated and therefore a bad fit on this site. – Markus von Broady Feb 27 '21 at 22:39bpy" and the "file's data" in my original question, I indicate that my interest is not on monkey-patched OS-level calls that then have some chance of damaging the file on-disk. Rather, my concern is whether the internal structure of the file, as opened and stored in memory in Blender and then written back to disk by Blender, can be altered bybpyitself in a way that cannot be undone through the GUI. – Will Chen Feb 27 '21 at 23:06bpyAPI itself has any features that could cause file and scene corruption, and whether it's meant to— Not whether you can modify said API to add on such features. – Will Chen Feb 27 '21 at 23:07The files that you corrupted— Do you remember if they were through operations in the API itself (I.E. corrupted data in-memory, messed up DNA/RNA/link/what-have-you, which was then written out to disk), or if it was through OS, process, or file system-level errors (E.G. crash while saving)?
– Will Chen Feb 28 '21 at 16:52