Doc: Py API: Add more info about UNDO operator option.

Essentially, any operator modifying Blender data should enable this
`UNDO` option, else bad things (corruption, crashes...) are likely to
happen.

* Added a new Operator example to explain this topic.
* Updated some existing Operator examples that were not correct anymore.
* Added a new small section in the gotchas page linking to it.
* Added also short reminder about this in the `UNDO` 'tooltip'
  description itself.

Related to #77557.
This commit is contained in:
Bastien Montagne
2024-11-11 16:09:55 +01:00
parent ac75e37c8e
commit 69a7948575
10 changed files with 275 additions and 197 deletions

View File

@@ -737,6 +737,15 @@ interactively by the user is the only way to make sure that the script doesn't b
guarantee of any kind that it will be safe and consistent. Use it at your own risk.
Modifying Blender Data & Undo
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
In general, when Blender data is modified, there should always be an undo step created for it.
Otherwise, there will be issues, ranging from invalid/broken undo stack, to crashes on undo/redo.
This is especially true when modifying Blender data :ref:`in operators <operator_modifying_blender_data_undo>`.
Undo & Library Data
^^^^^^^^^^^^^^^^^^^