When running with debug enabled ('-d' argument),
warnings are printed for add-ons which are not yet updated.
Reminder to name things based on what they do,
not the technologies they use :)
Blender can crash while rendering, when scene data is changed from within
a `frame_change_pre` or `frame_change_post` callback function. This results
in bug reports like T60094, T67627, and T73530. Until this is properly
resolved, this limitation should be documented.
No functional changes.
We still had a few deprecated assignements of `bpy.props.xxx` to class
members in our API documentation and one of our py tests. Annotations
are to be used now.
Also remove the section about `register_module` utils, this has been
removed in 2.8.
Fix T71877: Python API overview sample code warning: class MyMaterialProps contains a property which should be an annotation!
Fix T71876: Python API overview references old bpy.utils.register_module function
Some types were documented in bpy.types aren't accessible there.
For now, disable documenting types from add-ons and some types from
bl_operators, bl_ui... since these are mostly for internal use.
We need to handle beta stage in a specific way, since it's no longer
master, but not yet 'real' rc/release stage...
For now, only point to version dir of the API doc, but no need to create
any symlink (that way, 'current' remain pointing to 2.80 release, while
'2.81' is no longer a symlink to 'master', but its own actual doc).
This reverts commit 20b2acf336cb8f6965fd39728a746922d1b8ae42, reversing
changes made to f185cc0ca55c8c817903d53bf5c107f3efd4e0db.
Merges should only go form the release branch to master. For backporting
commits, use cherry-pick.
Python3.7 is still fairly recent, not all distro use it as system python
yet, fallback to code compatible up to py3.5.
Also, often distro builds of Blender do not have the buildinfo, in that
case fallback to `SOURCE_DATE_EPOCH` envvar, and as last resort to
current time, as in orig patch D5756 (we still use blender builddate
when available).
Issues raised in recent own rBcd5c70630318.
It makes much more sense to use the build timestamp of the Blender
binary used to generate that manpage, than the current time.
As a bonus, when Blender building makes use of the SOURCE_DATE_EPOCH envvar
(through CMake, since previous commit), this also propagate automatically
to that man page.
Inspired by D5756 by Bernhard M. Wiedemann (@bmwiedemann), thanks.
`object` is the superclass of all objects. Old-style code could still be
using `class SomeClass(object)` and assigning something else to `object`
could have unexpected results.
This is now also documented in the
[Python style guide](https://wiki.blender.org/wiki/Style_Guide/Python)
on the wiki.
Differential Revision: https://developer.blender.org/D4922
Reviewed by: sergey
We can not access ensured-to-be-evaluated dependency graph from the
render API: some of it is running from within evaluation which makes
it possible for engines to access list of evaluated IDs.
Solved by passing dependency graph to viewport functions, similar to
the final render functions.
One of the usecases is to create mesh from an object is a manner similar to
how Apply Modifiers does it, and have it in the bmain so it can be referenced
by other objects.
This usecase is something what went unnoticed in the previous API changes, so
here is a followup.
Summary of changes:
* bpy.meshes.new_from_object() behaves almost the same as before this change.
The difference now is that it now ensures all referenced data-blocks are
original (for example, materials referenced by the mesh).
* object.to_mesh() now creates free-standing Mesh data-block which is outside
of any bmain. The object owns it, which guarantees the memory never leaks.
It is possible to force free memory by calling object.to_mesh_clear().
Reviewers: brecht
Reviewed By: brecht
Differential Revision: https://developer.blender.org/D4875
Main goal here is to make it obvious and predictable about
what is going on.
Summary of changes.
- Access to dependency graph is now only possible to a fully evaluated
graph. This is now done via context.evaluated_depsgraph_get().
The call will ensure both relations and datablocks are updated.
This way we don't allow access to some known bad state of the graph,
and also making explicit that getting update dependency graph is not
cheap.
- Access to evaluated ID is now possible via id.evaluated_get().
It was already possible to get evaluated ID via dependency graph,
but that was a bit confusing why access to original is done via ID
and to evaluated via depsgraph.
If datablock is not covered by dependency graph it will be returned
as-is.
- Similarly, request for original from an ID which is not evaluated
will return ID as-is.
- Removed scene.update().
This is very expensive to update all the view layers.
- Added depsgraph.update().
Now when temporary changes to objects are to be done, this is to
happen on original object and then dependency graph is to be
updated.
- Changed object.to_mesh() to behave the following way:
* When is used for original object modifiers are ignored.
For meshes this acts similar to mesh-copy, not very useful but
allows to keep code paths similar (i.e. for exporter which has
Apply Modifiers option it's only matter choosing between original
and evaluated object, the to_mesh() part can stay the same).
For curves this gives a mesh which is constructed from displist
without taking own modifiers and modifiers of bevel/taper objects
into account.
For metaballs this gives empty mesh.
Polygonization of metaball is not possible from a single object.
* When is used for evaluated object modifiers are always applied.
In fact, no evaluation is happening, the mesh is either copied
as-is, or constructed from current state of curve cache.
Arguments to apply modifiers and calculate original coordinates (ORCO,
aka undeformed coordinates) are removed. The ORCO is to be calculated
as part of dependency graph evaluation.
File used to regression-test (a packed Python script into .blend):
{F7033464}
Patch to make addons tests to pass:
{F7033466}
NOTE: I've included changes to FBX exporter, and those are addressing
report T63689.
NOTE: All the enabled-by-default addons are to be ported still, but
first want to have agreement on this part of changes.
NOTE: Also need to work on documentation for Python API, but, again,
better be done after having agreement on this work.
Reviewers: brecht, campbellbarton, mont29
Differential Revision: https://developer.blender.org/D4834
In 2.7x UV sculpt was a kind of sub-mode
(a toggle with it's own key-map & drawing code).
Move this to an operator that uses the tool-system,
this simplifies internal logic, especially brush selection
which now matches sculpt and other paint modes.
- Remove toggle used to enable uv sculpt.
- Expose the brush, which was already used but there was no way to
select different brushes.
- Make UV sculpt use paint paint tool slots
(using brushes how all other paint mode currently do).
- Move UV Sculpt keymap to the tools keymap.
- Remove Q to toggle UV sculpt mode,
S/P/G keys to switch tools.
In a separate step, all new functions should be added.
However, the best way to do this, is not clear yet.
A list of functions, that have to be added is available
in D4280.
Differential Revision: https://developer.blender.org/D4280
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.