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
Since c6c127bfd3, objects for which `OB_TYPE_IS_GEOMETRY` fails (e.g.
Empties) were skipped.
However, empties instancing collections works well with light linking if
they contain geometry so we should be supporting these.
In order to do this use an existing function from preview rendering
(`collection_preview_contains_geometry_recursive`), move that to BKE and
use that from light linking operators.
Pull Request: https://projects.blender.org/blender/blender/pulls/143776
When creating `GPUSecondaryContext`s, `epoxy_gl_version` returns 0 and
`epoxy_has_gl_extension` always returns false.
This is caused by `GPU_context_create` being called without the ghost
context being activated.
Activating it fixes the issue.
Pull Request: https://projects.blender.org/blender/blender/pulls/142715
This commit works on two related issues:
1. It is too easy to forget to handle ID refcounting in custom RNA setters.
2. It is not possible to fully force RNA refcounting ON or OFF for some
properties.
Issue 1. has bit us several times recently (e.g. in animation or
compositor areas, see latest fixblender/blender!143577).
This commit addresses it by adding some debug-only checks around the
call to `PointerPropertyRNA::set()` in `RNA_property_pointer_set()`,
that validates that usercount of both previously and newly assigned IDs
matches expected (changes of) values.
While not ideal, this should make it way easier for developers to catch
that issue in the future.
The second issue was discovered while working on the first, leading to
e.g. questionable work-arounds like the `rna_DriverTarget_id_set`
setter, only defined to by-pass the automatically assigned
`PROP_ID_USERCOUNT` flag (and related automatic refcounting of the
default setter code).
It is addressed by adding an internal `PROP_INTERN_PTR_ID_REFCOUNT_FORCED`
flag, which keeps track of calls to
`RNA_def_property_flag`/`RNA_def_property_clear_flag` which explicitely
sets or clears the `PROP_ID_USERCOUNT` flag, and prevents automatic
setting of that flag in that case.
Pull Request: https://projects.blender.org/blender/blender/pulls/143660
The case when no mesh can be retrieved from the shrinkwrap target object can be
retrieved was not handled. It was handled by `ensure_shrinkwrap_cache_data` but
the calling function didn't check if the cache was actually created.
`BKE_modifier_get_evaluated_mesh_from_evaluated_object` can return null for an
object that would usually have a mesh but the object has not been evaluated yet,
as can be the case when there is a depsgraph cycle.
From my current understanding, the issue existed without 83325d1fd. Changing the
hash just made the depsgraph do different scheduling decisions so that now the
shrinkwrap was evaluated before the target object. The order in which these two
things are evaluated is arbitrary when there is a depsgraph cycle.
Pull Request: https://projects.blender.org/blender/blender/pulls/143757
When a shape key is made the new basis key, also update the "Relative
To" setting on the old & new basis keys. Both are made relative to the
new basis shape key.
Without this, the old basis key would still be relative to itself, which
effectively disables it. By making it relative to the new basis key, you
can increase its blend value to invert the effect of the new basis key.
Pull Request: https://projects.blender.org/blender/blender/pulls/143466
This commit introduces the extension modes for the map UV node. The
drop-down for the extension modes is only shown if the interpolation
mode is not set to anisotropic. This is due to extension modes currently
not being supported for the anisotropic filtering.
Pull Request: https://projects.blender.org/blender/blender/pulls/143415
The Dilate node Feather mode has artifacts on Intel Windows GPUs. This
is due to a wrong shader image format. So this patch fixes that by using
the correct single channel format.
Pull Request: https://projects.blender.org/blender/blender/pulls/143748
Since we are removing `scene.use_nodes` in #143578, most developers
will have to update their python script by replacing `scene.node_tree`
by `scene.compositing_node_group` in order to create a new compositing
node tree anyways. So we remove `scene.node_tree`.
Note: `scene->nodetree` in `scene_blend_write()` is still being written
to the blend file, so forward compatibility is not affected by this PR.
Pull Request: https://projects.blender.org/blender/blender/pulls/143619
* Remove the 'set default from all bitflags items' behavior of
`RNA_def_property_enum_bitflag_sdna`.
* Add some minimal sanity check regarding bitflag enums that also define
an `items` runtime callback.
It currently assumes that if a valid set of items is also statically
defined, the items callback will return a subset of these.
Implements #143538.
Pull Request: https://projects.blender.org/blender/blender/pulls/143733
* Bezier (NURBS) import, supporting both Blender and external variants.
* Cleaner Bezier export, with better results importing in Rhino.
* Internal support for exporting the new Curves type.
* Tests covering a broad number of related cases.
The current NURBS exporter writes curve data directly, without accounting
for internal padding or how knots are generated from modes. This adjusts the
export behavior to omit data that does not influence the geometry of the
curve. The result is a simplified output that is easier to parse during import,
both for the importer and when importing to other platforms (Rhino).
Visual explanation to the adjustment can be found in #139174.
Importer is also adjusted to support variations in knot patterns. Extending
it to support the data generated by the exporter and by other platforms (Rhino).
This should resolve some issues in relation to #138732.
Integrated tests are added to broadly validate the common cases generated
by the exporter, including variations of different modes and NURBS order.
Regression tests are added to validate that the NURBS generated in Rhino
are imported as expected.
More details in the PR.
Pull Request: https://projects.blender.org/blender/blender/pulls/139174
The issue was that the parent node group was not necessarily updated already
when the tracing code ran. So use socket identifiers instead of indices to try
to find corresponding sockets between group nodes and their corresponding
node groups.
This PR improves alignment between playhead and keyframe indicators,
especially noticeable at small UI scale sizes where we are currently
always out by one pixel. This is because keyframe icons are all odd
widths while the playhead line is an even width. This PR mostly makes
that line an odd width, with other small adjustments.
Pull Request: https://projects.blender.org/blender/blender/pulls/142904
When using link-drag-search to create bundle or closure nodes, the newly created
nodes are already synced automatically. Now this automatic syncing also happens
when an empty node is first linked. If there are any sockets already, the
automatic syncing does not happen as it can be unintentional. In this case the
user can just click the sync icon in the node header to update the sockets.
Pull Request: https://projects.blender.org/blender/blender/pulls/143744
This fixes an edge case in how the max acceptable edit distance is calculated
for deletions in fuzzy search, wherein the padding added to the max error count
could be negative when the query was longer than the matched term, producing a
max distance of zero.
This came up in chat a while back, where someone noted that, in the compositor,
searching for "bluir" wouldn't return the blur nodes; "blu" worked, "blui"
worked, but "bluir" returned no results, despite all three having equal edit
distances (1 insertion, 1 substitution, and 1 deletion, respectively). The edit
distance metrics themselves are calculated correctly; the issue was just with
how the distance threshold was set.
Pull Request: https://projects.blender.org/blender/blender/pulls/143741
This moves code used for tracing bundles and closures to a separate file. This
code is used to e.g. detect which Separate Bundle node a Combine Bundle node is
linked to. This allows providing automatic socket update operators for these
nodes. Similarly for closures.
Pull Request: https://projects.blender.org/blender/blender/pulls/143734
First part of design defined in #140360
Images in PR
This PR does two things:
- Creates new panel in theme preferences called "Common" that
doesn't belong to any editor
- Moves "Preview Range" property in common, and removes it
from animation editors.
Now, there is a single theme property for preview range, rather
than 5 for each animation editor.
Co-authored-by: Pablo Vazquez <pablo@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/140686
Shader compilation no longer uses the `WM_job` API.
Add a `GPU_shader_batch_is_compiling` function to query if there's any
shader compilation happening, and update `bpy_app_is_job_running` to
handle this as a special case.
Pull Request: https://projects.blender.org/blender/blender/pulls/143559
This PR removes the "Last Resort" font from the stack. Instead uses a
custom "not def" glyph, defined as an SVG file. This glyph is shown
when requesting a character not found for text inputs, text editor, and
for Sequencer text strips.
Pull Request: https://projects.blender.org/blender/blender/pulls/132032
- BLF font flags were an untyped enum; change to actual enum and
update usages from int to that.
- Move all BLF API enums to their own header, so that if something
needs just the enums they don't have to include whole BLF_api.hh
Pull Request: https://projects.blender.org/blender/blender/pulls/143692
Previously, the code assumed that closures are always created with the closure
zone and end up in the Evaluate Closure node. Similarly with bundles. While true
right now, this won't be true anymore with e.g. #141264 where unlinked input
sockets can also have a closure.
Pull Request: https://projects.blender.org/blender/blender/pulls/143725
It's broken and it's not needed anymore, since we require OpenGL 4.3.
Fix#142620
Note: Debug callbacks still won't work for compilation threads,
but that's relatively harmless and should cause no issues for the user.
This will be fixed in 5.0 with #142715.
(4.5 backport candidate)
Pull Request: https://projects.blender.org/blender/blender/pulls/142716
Use the form "Processing something..." (gerund, sentence case,
ellipsis) for running jobs progress label, according to Blender's
Human Interface Guidelines.
Pull Request: https://projects.blender.org/blender/blender/pulls/141573
The new anti-aliasing feature added in 299a581b1b didn't contain
versioning for startup.blend defaults, this caused the versioning
implemented in versioning_450.cc to be used instead, which was meant
to ensure older files stay the same. This thus caused the feature to be
effectively disabled in default/factory startup files.
Pull Request: https://projects.blender.org/blender/blender/pulls/143711
Proper fix, using `RNA_def_property_enum_bitflag_sdna` to mask the
affected bitflags when setting the value, and not overwrite unrelated
other bitflags.
Also similar fix/cleanup in DataTransfer modifier, who was also using
custom setters to handle this masking, instead of defining the
properties with `RNA_def_property_enum_bitflag_sdna`.
And added some documentation to `RNA_def_property_enum_sdna` and
`RNA_def_property_enum_bitflag_sdna`, to try to make it more explicit
what they are doing and what are their expected usecases.
Use Nodes were removed in d88d4cc8 from the UI, but marked deprecated
in Python API. Since we decided to remove `world.use_nodes` and
`material.use_nodes` for the shader editor (instead of deprecating
them), we also remove `scene.use_nodes`.
This PR only replaces the deprecated `scene.node_tree` with
`scene.compositing_node_group` where necessary. #143619 will fully
remove `node_tree`
Pull Request: https://projects.blender.org/blender/blender/pulls/143578
The node uses anisotropic sampling (which is currently not supported for the
extension mode), so extension modes are only rendered in the node if any
other interpolation method, but anisotropic is selected.
Pull Request: https://projects.blender.org/blender/blender/pulls/143367