This converts `eButType` and `eButPointerType` as typed enums.
This improves a bit `uiDefBut` self-documentation by taking an
struct with `ButType` and `ButPointerType` types, instead of
using a single `int` to write both enum types and bit index.
Almost all other `uiDefBut*` functions take just a `ButType`
parameter now.
`uiDefButI` for example is equivalent to:
`uiDefBut({ButType(type), ButPointerType::Int},...);`
Pull Request: https://projects.blender.org/blender/blender/pulls/142132
Blender asserts when updating declaration of Menu Switch node, that's
because a compositor specific function always ran. Fix this by running
for compositor node trees only.
Pull Request: https://projects.blender.org/blender/blender/pulls/142331
This was caused by the drawing order being changed in 669a51904e
which made the edit wireframe draw after the regular wireframe.
The edit wireframe didn't output any AA wire data and would
remove any AA wire data written by the wireframe drawing.
This patch adds the correct wire AA data in the edit curve
drawing.
Candidate for 4.5 LTS backport.
Pull Request: https://projects.blender.org/blender/blender/pulls/142055
This improves the existing scene specialisation mechanism by replacing "kernel_data.kernel_features" with a function constant. It doesn't cause any additional compilation requests, but allows the backend compiler to eliminate more dead code. An additional compiler hint is provided for dead-stripping "volume_stack_enter_exit" which results in slightly faster rendering of non-volumetric scenes.
Pull Request: https://projects.blender.org/blender/blender/pulls/142235
The asserts were added in 45ab790e80
for better error detection.
The assert was happening because the duplicated layer
was referencing frames of the source layer by default,
causing the actual user counts of the drawings to be
in an invalid state (they they were getting fixed
after the call to `duplicate_layer`, but they could remain
invalid! ).
To fix this, we ensure that the user counts are correct
after calling `duplicate_layer`. New parameters are added
to allow duplicating the frames (with empty drawings) or
duplicating the frames and the drawings.
Pull Request: https://projects.blender.org/blender/blender/pulls/142201
Improves output from tests comparing export results to the golden
example file:
- Prints which of the files that are empty and/or has no newline.
- Prints a message when there is a mismatch in file length.
- Clarifies that the inner compare loop only compares up to shortest string.
- Prints the name of the failing golden file, indicating if it was the obj
or mtl file that failed.
Pull Request: https://projects.blender.org/blender/blender/pulls/141958
The `VelocityGeometryData::pos_buf_get()` is returning `nullptr`
because the batch it not yet ready during the sync phase.
But it is after the first viewport has been drawn.
The fix is to have a different function that return
true if the data will be available.
Candidate for 4.5 LTS backport.
Pull Request: https://projects.blender.org/blender/blender/pulls/142238
To combat the recent increase of low quality reports, this commit
adjusts the bug report template to include a checkbox users must tick
before they can submit the bug report. The checkbox asks if they have
filled out the bug report form with all the relevant information.
Pull Request: https://projects.blender.org/blender/blender/pulls/142219
Currently, it's hard to figure out the idname of a node when just looking at it
in the node editor. while most users don't need this information, it's very
useful for Python developers.
This patch adds the node idname to the tooltip that shows up when hovering over
the node header. It only shows if "Python Tooltips" is enabled in the
preferences.
This also fixes a bug where the dynamic node description wouldn't show when the
node is collapsed.
Pull Request: https://projects.blender.org/blender/blender/pulls/142178
- Cursors in wayland are expected to use pre-multiplied alpha.
Note that cursor generators create straight alpha,
pre multiplier in the wayland backend.
- Invert cursor colors on Wayland since dark cursors are often default,
this could use dark theme settings in the future.
Support showing vector cursors at the appropriate size based on each
monitors DPI.
This solves incorrectly sized cursors with Hi-DPI outputs as well as
supporting outputs with different DPI's.
Instead of passing pixel data, pass an object that can generate cursors,
GHOST/Wayland can then ensure the correct size is used based on the
display the cursor is shown on.
While may sound overly complicated it actually simplifies displaying
cursors on Wayland, especially for multiple monitors at different DPI's.
Showing cursors at higher or lower resolutions than the monitor's DPI
also behaves differently on GNOME & Plasma, resulting in situations
where the cursor would show larger/smaller than expected.
Details:
- Take advantage of the recently added SVG cursors & BLF time cursor
!140990 & !141367.
- Setting bitmap cursors via GHOST_SetCustomCursorShape is now a no-op
for Wayland since it's no longer used. This was supported in an
earlier version of this PR and could be restored if needed.
- While fractional scaling works it relies on the compositor downscaling
the cursors. Ideally they would be rendered at the target size but
this isn't a priority as the difference isn't noticeable.
Ref !141597
Resolve leak in new_from_object when preserve_all_data_layers=True and
a sub-surfaced mesh.
A copy was made, then BKE_mesh_wrapper_ensure_subdivision would return
the "mesh_eval" of the copy, leaking the mesh passed to
BKE_mesh_wrapper_ensure_subdivision.
Ref !142176
Performing operations based on window size in terms of pixel units has a
high chance of resulting in unwanted behavior for macOS, due to HiDPI
displays.
This commit adds an API warning suggesting against usage of the raw
`sizex` and `sizey` values.
Related to #141982
Pull Request: https://projects.blender.org/blender/blender/pulls/142274
When switching modes, the active object visibility is used to determine
whether or not the mode can be entered. Whether or not this object is
null or not is dependent on the current mode. Object Mode uses the
underlying visibility, whereas other modes do not. When
`mode_compat_set` is used, the active object is switched to object mode,
causing `CTX_data_active_base` to be null.
To fix this immediate issue and prevent further refactors from
potentially reintroducing it, this commit makes a number of changes:
* Clarifies the `object::mode_compat_set` function docstring in
ED_object.hh
* Makes `object::mode_compat_set` the last operator check
* Uses `BKE_view_layer_base_find` instead of `CTX_data_active_base`
since both necessary parameters are already on-hand in the function.
Pull Request: https://projects.blender.org/blender/blender/pulls/141985
The repro file in question contained invalid paths for the USD Skeleton.
This was not detected in our import code which proceeded to create bones
with empty (`""`), incorrect, names and subsequently allowed the
rest-pose setup to use non-existent bones during processing.
The primary fix here is to ensure that all incoming joint paths are both
valid and unique[1]. A secondary fix is made to the rest-pose function
to use our joint-to-bone map to ensure we are using the correct bone
names.
[1] https://openusd.org/release/api/class_usd_skel_skeleton.html#aa6bf8297f4aae6de9fbf1b784c524d30
Pull Request: https://projects.blender.org/blender/blender/pulls/142133
Due to ambiguity when decomposing the incoming skeleton joint matrix,
it's possible for the returned quaternion rotation to be "flipped" from
the perspective of prior/future frames due to the quaternion
double-cover property. This would manifest as glitchy animations and
subtly incorrect motion blur results during render.
This PR implements the traditional mitigation of comparing with the
prior frame's rotation data and negating the quat if necessary. An
alternate method to instead compare with the rest positions was
attempted but it still allowed flipped/discontinuous rotations for
spinning objects like wheels and propellers.
Pull Request: https://projects.blender.org/blender/blender/pulls/142026
This replaces the `GPENCIL_ANY_VERTEX_MASK` legacy macro
with a function that is used in the Grease Pencil code.
Also removes some includes of legacy headers.
Mistake in b19696c0b8
Don't reference the data from the `Array` which will just be the inline
buffer if `require_tangent` is false (for displacement baking).
I still observe a crash when multires baking, but that's deep in Cycles
code.
In `pygpu_shader_attrs_info_get`, it tries to check information for all
vertex attributes that are added via `VERTEX_IN`, however some drivers
will optimize compiled shaders so some vertex attributes that are not
used will be removed. This fix makes sure that the input length that
is used in `GPU_shader_get_attribute_len` does not exceed actual max
binding number.
Pull Request: https://projects.blender.org/blender/blender/pulls/137584
Fix#142045 crash on performing bevel operation on border edges.
When user selected both border edges and neigboring edges
(parallel to those border egdes) for the bevel operation,
the former were omitted during construction of BevVert objects
but their initial UV connectivity were recorded during call
to determine_uv_vert_connectivity function - specifically BMLoop
pointers were stored in BevelParams::uv_vert_maps member.
This later caused issues after rebuilding existing polygons
(bevel_rebuild_existing_polygons) since previously recorded
BMLoop pointers became invalid for border edges but still were
stored in uv_vert_maps (uv_vert_map_pop function was not called
for them since those loops were not related to BevVert objects).
This caused crash when accessing UV positions, when providing
invalid loop pointer to BM_ELEM_CD_GET_FLOAT_P function in bevel_merge_uvs.
When having a checkbox and a value both in one row together with an
animation decorator it is questionable whether the decorator should act
on animating the checkbox or the corresponding value.
We had similar cases before (e.g. 7c04ef210e)
In this case as well, one would think it is more desirable to animate
the actual Temperature **value** (instead of the checkbox), so this is
what this PR does.
Pull Request: https://projects.blender.org/blender/blender/pulls/142192
This issue occurred because versioning was applied twice.
The history:
* First I created 05aac73b45 which fixed the issue on main (4.5 at the time), version `405, 14`
* Then I created a backport for 4.4.3 f1e829a459 which also added versioning, version `404, 32`
That means all files created with 4.4.3 (`404, 32`) already had versioning
applied. However then opening it in 4.5 applied the versioning again since that only checked
if the version was at least `405, 14`
The fix is to exclude files that have already been saved with `404, 32`
Pull Request: https://projects.blender.org/blender/blender/pulls/142208
`PoseBone` and `Bone` already have their `struct_path_func` defined, but
that was missing from `EditBone`.
Since `EditBone` is usually what is visible from the UI (and only later
gets flushed to `Bone` via `ED_armature_from_edit`), it makes sense to
have complete RNA paths for `EditBone` as well.
Enables the usual context menu `Copy Data Path`, `Copy As New Driver`,
... automatically.
Pull Request: https://projects.blender.org/blender/blender/pulls/142065
The main goal of the patch is to make the socket tooltips more useful. This is
achieved in two ways:
* Use better text formatting in the tooltip to make it easier to parse and to
better separate the current actual value from more general information about
the socket.
* Add some more information like implicit field inputs when the node is not used
currently or more details about a color.
This patch basically rewrites the entire tooltip generation, because it's quite
different from before (where we just created a single string for the entire
tooltip).
I'm using monospace for the actual current socket value and type, while the
normal font is used for general information about the socket like it's name,
description, allowed geometry types etc.
Pull Request: https://projects.blender.org/blender/blender/pulls/140540
Fix for unreported issue with Grease Pencil interpolation tool: on cyclic curves
the last point is interpolated between the end points of the curve, especially
noticeable with sequence interpolation.
This required handling a corner case in the curve sample mapping function.
This function is complex and hard to verify with the operator alone, leading to
frequent issues and discovery of yet more corner cases. For this reason i
refactored the sampling function and added new unit tests.
This should help avoid regressions and make it clear how the function is
expected to behave in various corner cases.
The `sample_curve_padded` function has been moved into the geometry module,
since the `sculpt_paint` module does not have tests yet and is intended mostly
for higher-level operator code. The function has been split to separate out the
"reverse" sampling mode, which reduces complexity. Reverse sampling is done by
first reversing the input curve points, doing regular sampling, and then
reversing the resulting samples.
The function can now sample to larger or smaller sample arrays:
- Larger output arrays have a point aligned with each source point as before,
with the rest of the points evenly distributed over the source curve.
This ensures that the output curve matches the source as closely as possible,
especially for poly curves.
- Smaller output arrays are uniformly sampled along the length of the source
curve.
Pull Request: https://projects.blender.org/blender/blender/pulls/141946
The issue was that the `AnimData.tmp_slot_handle` had no RNA property associated with it
and so it couldn't be saved in the lib override.
The fix is to add the property. To ensure the correct code is called, most of the previous code
was replaced with a call to `blender::animrig::assign_tmpaction`
Pull Request: https://projects.blender.org/blender/blender/pulls/141395
The goal is to be able to form bundle value paths like `Group/Sub/Geometry` in
the future. Additionally we might want to be able to use these paths in some
kind of expression for selecting a set of bundle paths. This requires us to
constrain what characters are allowed to be used in bundle paths. This patch
forbids using various special characters. Since we don't know exactly which
characters we'll need exactly in the future, I added more characters to the
forbidden-list than likely necessary. It's easier to make them available later
on than to try to forbid them later.
The forbidden chars are the following currently:
`/*&|"^~!,{}()+$#@[];:?<>.-%\=`.
Those are automatically replaced by an underscore if used.
Pull Request: https://projects.blender.org/blender/blender/pulls/142168