"Use Nodes" was removed in the compositor to simplify the compositing
workflow. This introduced a slight inconsistency with the Shader Node
Editor.
This PR removes "Use Nodes" for object materials.
For Line Style, no changes are planned (not sure how to preserve
compatibility yet).
This simplifies the state of objects; either they have a material or
they don't.
Backward compatibility:
- If Use Nodes is turned Off, new nodes are added to the node tree to
simulate the same material:
- DNA: Only `use_nodes` is marked deprecated
- Python API:
- `material.use_nodes` is marked deprecated and will be removed in
6.0. Reading it always returns `True` and setting it has no effect.
- `material.diffuse_color`, `material.specular` etc.. Are not used by
EEVEE anymore but are kept because they are used by Workbench.
Forward compatibility:
Always enable 'Use Nodes' when writing blend files.
Known Issues:
Some UI tests are failing on macOS
Pull Request: https://projects.blender.org/blender/blender/pulls/141278
Since it's inclusion, we have more convenient ways to enable features
such as ASAN. Remove the script since this hasn't been updated in a long
time and would be better off as a 3rd party tool.
Temporary directory handling had a logical error, assuming the
"session" temporary directory was owned and created by Blender
and could be recursively removed on exit.
However, it's possible creating the session sub-directory fails,
in that case the temporary directory was used for the "session".
This meant setting `C:\` as the temporary directory in the preferences
would attempt to recursively remove `C:\` on exit.
Resolve with the following changes:
- Only perform a recursive removal on the temporary directory
if a session sub-directory was created.
- If the creating the user-preferences temporary "session" sub-directory
fails fall back to the systems temporary directory and try to
create the "session" directory there.
Previously this was only done if the preference path didn't exist.
The preferences path was still used if it existed but couldn't be
written to.
Include a test to ensure this is working as expected.
Ref !144042
Add a [Python code generator][1] that takes an OpenAPI definition and
outputs the corresponding data model as [dataclasses][2]
This is intended to be used in the Remote Asset Library project, to
create, download, parse, and validate information of a remote asset
library.
[1]: https://koxudaxi.github.io/datamodel-code-generator/
[2]: https://docs.python.org/3/library/dataclasses.html
## Running the Generator
The generator is a Python script, which creates its own Python
virtualenv, installs the dependencies it needs, and then runs the
generator within that virtualenv.
The script is intended to run via the `generate_datamodels` CMake
target. For example, `ninja generate_datamodels` in the build
directory.
## Details
The virtualenv is created in Blender's build directory, and is not
cleaned up after running. This means that subsequent runs will just
use it directly, instead of reinstalling dependencies on every run.
## Generated Code & Interaction with Build System
It is my intention that the code generation _only_ happens when the
OpenAPI specification changes. This means that the generated code will
be committed to Git like any hand-written code. Building Blender will
therefore _not_ require the code generator to run. Only people working
on the area that uses the generated code will have to deal with this.
Pull Request: https://projects.blender.org/blender/blender/pulls/139495
When adding a shape key, set its blend value to 1.0 / 100%.
There is no practical use case where user wants to add shape key but
not work on it. New shape keys at value 0 have no purpose. Adding
shape key should be interpreted by Blender as user wanting to
sculpt/model on it. Also, being at 1.0 initially doesn't change
anything visually, because key isn't edited yet and it doesn't deform
mesh.
The default value of the shape key is also set to 1.0. When using
right-click to reset values, user most often wants to return to 1
(which is "correct" state of deformation without multiplication)
rather than 0 (which is no deformation at all).
Co-authored-by: Sybren A. Stüvel <sybren@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/133399
Part of https://projects.blender.org/blender/blender/pulls/141278
Blend files compatibility:
If a World exists and "Use Nodes" is disabled, we add new nodes to the
existing node tree (or create one if it doesn't) that emulates the
behavior of a world without a node tree. This ensures backward and
forward compatibility.
Python API compatibility:
- `world.use_nodes` was removed from Python API => **Breaking change**
- `world.color` is still being used by Workbench, so it stays there,
although it has no effect anymore when using Cycles or EEVEE.
Python API changes:
Creating a World using `bpy.data.worlds.new()` now creates a World with
an empty (embedded) node tree. This was necessary to enable Python
scripts to add nodes without having to create a node tree (which is
currently not possible, because World node trees are embedded).
Pull Request: https://projects.blender.org/blender/blender/pulls/142342
With the recent Gitea update, parent repos (E.g. `blender/blender`) do
not have "parents" listed in the information gathered by API anymore.
This has lead to the weekly report script encountering errors if the
user has committed directly to a parent repo. This commit fixes that.
Pull Request: https://projects.blender.org/blender/blender/pulls/142701
Add a new CLI option `--date YYYY-MM-DD` to the weekly log generator. Using
it will make it ignore the `--weeks-ago` parameter, and just show the
activity for that specific day.
This is just something I personally found useful, to occasionally inspect
a specific date (WBSO daily log).
Pull Request: https://projects.blender.org/blender/blender/pulls/141281
This new file can parse the file header (first few bytes) as well as the block
headers.
Right now, this is used by two places:
* `blendfile.py` which is used by `blend2json.py`
* `blend_render_info.py`
This new module is shipped with Blender because it's needed for
`blend_render_info.py` which is shipped with Blender too. This makes using it in
`blendfile.py` (which is not shipped with Blender) a bit more annoying. However,
this is already not ideal, because e.g. `blend2json` also has to add to
`sys.path` already to be able to import `blendfile.py`.
This new file could also be used by blender-asset-tracer (BAT).
The new `BlendFileHeader` and `BlockHeader` types may be subclassed by code
using it, because it wants to store additional derived data (`blendfile.py` and
BAT need this).
New tests have been added that check that the file and block header is parsed
correctly for different kinds of .blend files.
Pull Request: https://projects.blender.org/blender/blender/pulls/140341
This changes the engine identifier back to `BLENDER_EEVEE`.
We keep the `BLENDER_EEVEE_NEXT` identifier around for
versioning reasons (have to detect when it is the active
engine of a older file).
This also rename a bunch of pannels that were using `next`
in their name.
This is a breaking change for Addons compatibility.
Pull Request: https://projects.blender.org/blender/blender/pulls/140282
This indirectly also fixes `blend2json.py` because it's build on top of
`blendfile.py`.
Main changes:
* Update .blend file header parsing to support the different header types.
* Support unpacking `LargeBHead8`.
* Use `namedtuple` instead of index access when accessing block header because
the order of items is different now.
* Update comments that were either fully redundant or already outdated.
Pull Request: https://projects.blender.org/blender/blender/pulls/140195
e.g. stands for "exempli gratia" in Latin which means "for example".
The best way to make sure it makes sense when writing is to just expand
it to "for example". In these cases where the text was "for e.g.", that
leaves us with "for for example" which makes no sense. This commit fixes
all 110 cases, mostly just just replacing the words with "for example",
but also restructuring the text a bit more in a few cases, mostly by
moving "e.g." to the beginning of a list in parentheses.
Pull Request: https://projects.blender.org/blender/blender/pulls/139596
The script check_source/static_check_size_comments.py run directly
or called via the convenience target "make check_size_comments".
Add a utility module: `line_number_utils` which implements
a version of `re.finditer` that includes line numbers & ranges.
Since ec141ba3ff, commits from all branches are listed. Issue is that
commits from different repositories and branches will be mixed.
Personally I prefer grouping commits better, so I always edit the output
manually.
With this, commits will be grouped by branch, or PR if one can be found.
The branches and commits will then be printed under their target
repository. This isn't the owning repository of the branch or PR (often
people's personal fork), but the one it targets. This worked much better
in own tests.
Further:
- For some common repositories more readable names are used, e.g.
"Blender Manual" instead of "blender/blender-manual".
- Commits of the Blender repository are listed first, without grouping
under a `blender/blender`.
- Commits to each repository's main branch are listed first, directly
under the repository grouping.
- See PR for a textual mockup of the output format.
Pull Request: https://projects.blender.org/blender/blender/pulls/138615