As exposed in T62406, we can have some rare cases of crashes due to
memory re-allocation happening outside of expected scenarii.
Ideally this should be re-designed, but at least keep track of those
known exceptions to general rules...
* Added a TL;DR first paragraph summarizing that one shall not keep any
reference to Blender data when modifying its container.
* Added some info about fact that adding items to some data containers
(like Collection) can also invalidate existing items (due to array
re-allocation).
* Added a Do/Don't example which shows a crash after adding some items
to a collection.
Related to T61297.
There is a new `bpy.app.timers` api.
For more details, look in the Python API documentation.
Reviewers: campbellbarton
Differential Revision: https://developer.blender.org/D3994
The HTML title did not make it clear that these are docs for the API rather
than a general Blender documentation. Some of the page titles were also too
long and redundant.
I think this example does not belong into the api docs and certainly not in the place where it was until now.
Maybe this can become a template in Blender but personally I don't see much value in it as an "official example" because it is hard to see what is going on exactly.
There are a few other examples that show how to use the GPUOffScreen object now.
- Was setting active state, making it necessary to backup/restore
active object in cases where this isn't needed.
Existing scripts are explicitly setting the active object when needed.
- Use a boolean select arg (toggle selection wasn't used anywhere).
- Add an optional view layer argument since scripts should be able to
operate outside the user context.
RNA's ViewLayer would present 'first level' of layer collection as a
list (collection property), when it is actually now only a single item,
same as the scene's master collection.
Note: did not try to update view_layer python tests, those are already
fully broken for quiet some time I guess (they still assume
view_layer.collections to be mutable e.g.)...
Loop triangles are tessellated triangles create from polygons, for renderers
or exporters that need to match Blender's polygon tesselation exactly. These
are a read-only runtime cache.
Tessfaces are a legacy data structure from before Blender supported n-gons,
and were already mostly removed from the C code.
Details on porting code to loop triangles is in the release notes.
Differential Revision: https://developer.blender.org/D3539