The `Add` > `Scene` > `New Scene` operator was behaving as follows:
* If there is no active scene strip, create an empty blank scene and
assign it to a new scene strip.
* Otherwise, use the scene referenced by the active scene strip and
use one of the copy scene methods (blank, copy settings, copy linked,
or full copy) to create a new scene and assign it to a
new scene strip.
This was not ideal for 2 reasons:
1. With no strip selected, creating blank scenes is generally not very
useful as it means that the user has to e.g. update all the render
settings, add a camera, etc.
2. The behavior of copying an existing scene by using the active strip
is very hidden. Also because adding the strip immedialty calls the
move operator, so you cannot even adjust the copy method of the
scene.
This PR changes 3 things:
1. Don't use at the active scene strip. Instead use the active scene.
2. Don't create an empty blank scene, copy the settings of the active
scene by default. This means that e.g. render settings can be reused.
3. The operator entry in the `Add` > `Scene` menu is now called `Empty Scene`.
Part of #144063.
Pull Request: https://projects.blender.org/blender/blender/pulls/144069
This was disabled because island selection used to be exposed as a
UV selection mode (along with vertex/edge/face) where selecting
parts of other islands would seem like a bug.
Now island selection has been moved to a separate toggle it makes
sense to allow connected geometry to be included in the selection when
other selection options enforce this.
This PR adds a flag to the pose bone that determines its visibility.
Doing so allows to hide a pose bone and
* don't affect other instances of the same armature
* save the visibility even if the rig is linked
The visibility of the bone in object mode is now also determined by the
pose bone whereas before it was the `Bone`.
**This breaks backwards compatibility** on the Python API since the visibility property,
on the `Bone` behaves differently now as it hides the edit bone instead of the pose bone.
In order to remove all active uses of `BONE_HIDDEN_P` the changes in `armature_skinning.cc` are required.
Part of #138482
Pull Request: https://projects.blender.org/blender/blender/pulls/139167
Invoke context menu for shape key with right click.
Added `MESH_MT_shape_key_tree_context_menu`, this include operators
that takes action on selected/active tree items:
- Make Basis
- Duplicate
- Move to Top -> Move After Basis
- Move to Bottom -> Move to Last
See Video in PR description
Pull Request: https://projects.blender.org/blender/blender/pulls/143444
Edge and Vertex marks such as Crease, Bevel Weight, Seam, Sharp, have
specific use cases and colors assigned to them that users get familiar
with over time.
It can be hard to remember which color belong to what, this PR tries to
address this by introducing colored icons that follow the theme setting
for that edge mark/flag.
See PR for details and screenshots.
Pull Request: https://projects.blender.org/blender/blender/pulls/144075
Introduced in 4434a30d40
The above commit changed many of the `wm.radial_control` default
keybinds used in various paint modes to support accessing the "unified"
properties on a per-mode basis. While the base Blender keymap and the
industry compatible keymap were updated, this change was not applied
to custom keymaps, leading to confusing behavior for the users.
Pull Request: https://projects.blender.org/blender/blender/pulls/143872
Ensure that `__main__.__file__` is not set to "<blender string>" when
spawning the subprocess for the background downloader. Blender sets this
value when executing a Python string from C++ code. However, this value
causes issues with Python's `multiprocessing` module, as it expects that
IF the attribute is set, it contains the actual file of the actual main
module. Clearing it works fine, as `__file__` is optional anyway.
Pull Request: https://projects.blender.org/blender/blender/pulls/143985
Expose existing mask operators as tools in the toolbar.
The primitive tools are commented out since interactively placement
isn't currently supported by the operators.
Ref !136086
The W channel in quaternion and axis-angle F-Curves is now themeable
(defaulting to yellow), instead of incorrectly blending the X and Y axis
theme colors.
The original blending math did not take into account that the hue
channel actually wraps around, and so the blended color became blue
instead of the intended yellow.
Instead of fixing the math, the theme has been expanded for this W axis.
The default color is set to the mathematically correct yellow.
Co-authored-by: Sybren A. Stüvel <sybren@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/143211
The recently introduced feature of playhead snapping (#137278)
added a popover menu for snap targets.
This used text to indicate the contents of said popover.
In order to bring it in line with the other snapping menu, this PR adds
icons to indicate the enabled state of snapping.
Part of #135794
Pull Request: https://projects.blender.org/blender/blender/pulls/139271
This PR makes it easier to delete strip keyframes from the preview.
It works similarly to the 3D viewport and also works with keying sets.
Pressing "alt + I" deletes the keyframe on the current frame of the
selected strips, when a keyset is active it only deletes the keyframes
of the selected keyset.
Pull Request: https://projects.blender.org/blender/blender/pulls/140385
This makes it so that Grease Pencil Bezier handles use the same colors and shaders as `Curves` Objects.
This also makes the handles follow `handle_display` and add the option the the edit mode overlay.
Pull Request: https://projects.blender.org/blender/blender/pulls/141524
This removes the "Geometry" part from their name because we want to use them in
other node tree types too (see #141936).
Usually, we don't change idnames because they are the primary identifier of
nodes and is expected to stay the same. Since they are generally not shown to
users (just Python developers), it's also not urgent to change them. However, in
this specific case we have the opportunity to update the idname before the node
becomes an official feature, so it's not as bad to change it.
This patch has full backward compatibility, but no forward compatibility (for
files that used the experimental feature).
Pull Request: https://projects.blender.org/blender/blender/pulls/143823
This adds "use_occlude_geometry=True" and "only_selected=False" to the
keymap entry for K, mesh.knife_tool, even though these are the default
values for this operator. This fixes the complaint. And these same
props are set for "Knife Topology Tool" on the VIEW3D_MT_edit_mesh
menu so that it displays the shortcut correctly (#139393 remains
corrected).
Pull Request: https://projects.blender.org/blender/blender/pulls/143673
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
The code was using the legacy Grease Pencil data type
in `create_object_data`. For the object type `GREASEPENCIL` we should
be using `bpy.data.grease_pencils_v3`.
Pull Request: https://projects.blender.org/blender/blender/pulls/142335
Add a new package `scripts/modules/_bpy_internal/http`, containing
classes to download files via HTTP.
The code is intentionally put into the `_bpy_internal` package, as I
don't intend it to be the end-all-be-all of downloaders for general
use in add-ons. It's been written to support the Remote Asset Library
project (#134495), where it will be used to download JSON files (to
get the list of assets on the server) as well as the asset files
themselves.
The module consists of several parts. The main ones are:
`class ConditionalDownloader`
: File downloader, which downloads a URL to a file on disk.
It supports conditional requests via `ETag`/`If-None-Match` and
`Last-Modified`/`If-Modified-Since` HTTP headers (RFC 7273, section 3.
Precondition Header Fields). A `304 Not Modified` response is
treated as a succesful download.
Metadata of the request (the response length in bytes, and the above
headers) are stored on disk, in a location that is determined by the
user of the class. Probably in the future it would be nice to have a
single sqlite database for this (there's a TODO in the code about
this).
The downloader uses the Requests library, and manages its own HTTP
session object. This way it can handle TCP/IP connection reuse,
automatically retry failing connections, and in the future
HTTP-level authentication.
`class BackgroundDownloader`
: Wrapper for a `ConditionalDownloader` that manages a background
process for the actual downloading.
It runs the downloader in a background process, while ensuring that
its reporters (see below) get called on the main process. This way
it's possible to do background downloading, while still receiving
progress reports in a modal operator, which in turn can directly
call Blender's Python API. Care was taken to [not use Python
threads][1]
`class DownloadReporter`
: Protocol class. Objects adhering to the protocol can be given to a
`ConditionalDownloader` or `BackgroundDownloader`. The protocol has
functions like `download_starts(…)`, `download_progress(…)`,
`download_error(…)`, which will be called by the downloader to
report on what it's doing.
I chose to make this a protocol, rather than an abstract superclass,
because then it's possible to make an Operator a DownloadReporter
without requiring multi-classing.
[1]: https://docs.blender.org/api/main/info_gotchas_threading.html
Pull Request: https://projects.blender.org/blender/blender/pulls/138327
Add an asset shelf to the compositor node editor.
This is part of simplifying the compositing workflow:
https://projects.blender.org/blender/blender/issues/134214.
The reasoning is:
- Assets will help users get started more easily with compositing
- Assets will help keeping users within Blender and use the compositor
instead of doing post processing in a different software.
- The asset shelf is better than the asset browser because it has a
better user interface; it's easily hidable and doesn't take much space
The asset shelf is hidden by default in this PR, since we have no
assets yet.
Previously, a similar implementation was proposed for all node editors,
see https://projects.blender.org/blender/blender/pulls/110589.
We didn't move forward with this PR for the following reasons:
- For geometry nodes, no concrete use case was known/proposed
- The PR didn't intend to actually show the asset shelf, only
implement the possibility that it can be shown in node editors
Known Issues:
- Can't hide the asset shelf if region overlap is off: #129737
Pull Request: https://projects.blender.org/blender/blender/pulls/138983
The operator 'Setup Tracking Scene' now creates a new compositing node
group if one exists already.
`CLIP_OT_setup_tracking_scene` now creates a node tree manually instead
of relying on `use_nodes = True`.
This also fixes an invalid link to the Group Output node.
Pull Request: https://projects.blender.org/blender/blender/pulls/143556
Prefer "active" so the settings can still be changed,
typically this is preferred unless changing them would cause problems.
Also assign "active" immediately after assignment,
following the convention use elsewhere in scripts.
Areas can be made to take up more space in two different ways. One we
call "Maximize Area" that just takes up the rest of non-global space,
so leaving Top Bar and Status Bar and everything in the area unchanged.
The other option is shown as "Fullscreen Area" and it calls the same
operator with a use_hide_panels property. This hides the global areas
and also all regions in the area. This was added as an option for the
stereo 3D pipeline for viewing without the distraction of UI elements
that cause depth issue. #142418 further removed text overlays and the
navigation gizmos. This PR just renames the option to better describe
the result, using "Focus Mode".
Pull Request: https://projects.blender.org/blender/blender/pulls/142605
Deprecation meta-data support for RNA properties.
- Properties may have a deprecated note and version.
- Warnings shown when these are accessed from Python.
- A note is included in the generated documentation.
Support for marking functions as deprecated can be added in the future.
Ref !139487
The Image Editor had a different menu order compared to the 3DView (this
came with fb74dcc5d6).
Now made the order in the Image Editor match the one of the 3DView.
Also matches the order in the sidebar now.
Pull Request: https://projects.blender.org/blender/blender/pulls/143222
Add a new operator "Make Shape Key the Basis Key", shown in the Shape
Key menu as "Make Basis". Effectively this does the same thing as moving
the active shape key to the top of the list of shape keys: applying it
to the mesh.
This operator is added now, because !141930 will prevent moving shape
keys to the top of the list. This hopefully prevents accidentally making
other keys the basis key, which can cause issues that are hard to
recover from.
Pull Request: https://projects.blender.org/blender/blender/pulls/143200
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