Correction to [0] which was incomplete,
resolve by tracking which BevList's are reversed.
Rename DL_HOLE to DL_REVERSED since this isn't set from BevList::hole
and only tracks if the data was reversed.
[0]: 8eed0d7c31
Ref !156330
This hits an negative ref-count assert in msvc debug builds, and can
cause undefined behavior in Linux builds. As mention in
`PyC_DefaultNameSpace`, the returned dictionary object is owned by the
`__main__` module, the reference is just borrowed.
Pull Request: https://projects.blender.org/blender/blender/pulls/156822
The return type of `active_uv_map_name` is `StringRefNull` and
that of `CustomData_get_active_layer_name` is `const char *` so
the compiler wraps the result of `CustomData_get_active_layer_name`
in a `StringRefNull` constructor for the ternary operator to evaluate to
a single common type but `CustomData_get_active_layer_name`
returns `nullptr` in this case so passing `nullptr` into the
`StringRefNull` constructor triggers a segmentation fault as it
evaluates to `strlen(nullptr)`.
Fix by appending `c_str()` to `active_uv_map_name` to force both
conditions of the ternary to resolve to `const char *`.
Pull Request: https://projects.blender.org/blender/blender/pulls/156198
Resolve CDT even-odd filling error where a polygon without
an edge touching the convex hull wouldn't be filled.
Boundary region detection only checked constrained edges
to the outer face, missing unconstrained hull edges.
This left the search with no starting point, marking all faces as holes.
Unconstrained hull edges are now also used to detect boundary regions,
but constrained edges are prioritized since they carry the actual
polygon crossing winding.
Ref !156688
When a 2D curve is extruded, geometry is built from bevel list data
where hole contours have their winding reversed (for correct surface
normals). The CDT fill then inherited this reversed winding, causing
the non-zero fill rule to behave like even-odd.
Resolve by flagging reversed outlines and correcting them
when filling the arrays for CDT input.
Ref !155742
Previously line art collection flags and intersection priority will only
work if you set it on object's immediate parent. Not sure how long the
issue persisted, likely after line art object instance rewrite. The most
likely reason that this was not really discovered because most cases we
do set object's intersection flags/priority or set it at their immediate
parents. This PR makes sure that values in parent collections gets
inherited to child objects.
One thing this PR did additionally is it will always assign a intersection
line to one of the object it came from. This will indeed create
ambiguity as in which object did the intersection line come from,
however it's much better because we can at least filter them by
collection, which is much more usable in real life productions.
Pull Request: https://projects.blender.org/blender/blender/pulls/156433
Previously line art doesn't take face mark into consideration when
generating interestion lines, so faces that are inhibited from
generating lines will still produce intersection lines, this can lead
to visual artifacts in structures like mouth corner creases. This fix
will prevent filtered faces from generating intersection lines.
Pull Request: https://projects.blender.org/blender/blender/pulls/156580
Color is now using lamp.color x emission node color
Except for EEVEE where node setup is ignored
For intensity: For EEVEE, node setup is ignored
The exported values are now aligned with what the viewport displays.
Before 5.1, nodes data was used, and lamp properties was used if no nodes data was present.
But in 5.1, a node tree is created by default event if not used by EEVEE. It leads to misunderstanding by users why color/intensity was not exported.
Pull Request: #157130
Co-authored-by: Julien Duroure <julien.duroure@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/158627
The following two commits are backported to blender-v5.1-release:
- 0bedd81f2b
- bf20994350
The former disabled the texture pool only for Intel 7th to 10th Gen
Processor iGPUs, while the latter disabled it for a wider range of
GPUs. Some refactoring happened on main where
`workarounds.no_texture_pool` was renamed to
`GCaps.texture_pool_workaround`, but I kept the old naming in the
backport.
Disabling the texture pool works around visual corruptions and
memory leaks on older Intel iGPUs with certain driver versions.
Pull Request: https://projects.blender.org/blender/blender/pulls/158641
The usage of the texture pool after the visual corruptions fix for
the image cache workaround for #156496 leads to memory leaks.
This commit enables the texture pool workaround for Intel Windows
until the issues have been resolved.
Pull Request: https://projects.blender.org/blender/blender/pulls/157994
The attribute data can be null when the size is zero, but to create
single values there needs to be data. In this case just ignore the
single value status, it doesn't really make a difference for empty
attributes anyway.
Pull Request: https://projects.blender.org/blender/blender/pulls/156779
Address an issue running blender 5.x on the otoy rndr network
where it crashes when loading a scene.
Reset the file pointer to the beginning of the file
in case we are closing it using the windows file
handle due to failure of reading it with memory map.
This keeps everything consistent for later opening that file again.
Ref !155823
The fix in 3c3cde26b5 treated any frame
vertex shared with the target hull face as a degenerate case and fell
back to creating a simple cap face instead of attempting to fix the
detached frame with `skin_fix_hole_no_good_verts`. This could cause the
output of the skin modifier to be disconnected in some cases.
Fix by gating the shared vertex cap on the absence of interior frame
vertices.
Pull Request: https://projects.blender.org/blender/blender/pulls/156214
This was never implemented. Adding support is relatively simple.
We either expose the path corresponding to the bake or the
path the bake will inherit from the modifier.
Because there are arbitrarily many metadata files and the connection
to the binary blob files is only clear at runtime when loading the bakes,
this PR just exposes the entire directory.
Co-authored-by: Sybren A. Stüvel <sybren@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/156380
Co-authored-by: Hans Goudey <hans@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/157175
Correctly process objects' particle systems in `object_foreach_path()`.
The `//blendcache_particle` directory is now reported.
Previously the code reported the `cache->path` property, for each
cache in the particle system. However, that path is only to be used
when the 'External' checkbox is checked.
Pull Request: https://projects.blender.org/blender/blender/pulls/155720
Saving AVIF was reading past the buffer bounds for 8bit images,
workaround the bug by re-allocating a buffer with the necessary
padding to avoid the error.
This has been fixed up-stream, the workaround can eventually be removed
when we drop support for older OIIO versions.
Ref !155824
5.1 backport.
Pull Request: https://projects.blender.org/blender/blender/pulls/157119
The OpenImageIO version we use has broken CMYK to RGB conversion in
JPEG, this is a temporary workaround until we upgrade to a newer
version. Directly read the CMYK image with libjpeg.
Note that when we upgrade, we can remove the CMYK conversion code
entirely as OpenImageIO supports this natively nowadays.
---
NOTE: This is the backport for 5.1.1.
Pull Request: https://projects.blender.org/blender/blender/pulls/157146
Fix#155878: Point light gizmo doesn't stick to cursor anymore
Resolve regression in [0] check caused the point light radius
not to follow the cursor.
[0]: b4b2e05858
Ref !156194
Fix: glitch scaling orthographic camera gizmo with shift X/Y
Grabbing the edge of the camera with the shift set to ~2 would behave
as if the opposite edge was grabbed and the cursor moved from one
side of the camera to the other.
There is no need to use the pivot in this calculation as the deltas
already take the pivot into account.
Pull Request: https://projects.blender.org/blender/blender/pulls/157124
Add two tests, one to check that sub-classing works as expected,
another for the operators callable types.
Written to validate fixes for #155928 & #155996 and ensure
there are no further regressions.
Ref !155994
Resolve regression in [0] which didn't account for the move to our
own callable type needing to validate the key types in the keyword dict.
Add `PyC_Dict_CheckKeysAreStrings` utility to allow reuse for
callable types in the future.
[0]: 877283a09a
Ref !155997
Caused by a09d0cfd8c
The above commit added a new function
`BKE_pose_channel_find_selected_names`.
Compared to its counterpart `BKE_armature_find_selected_bone_names` it
didn't check for collection visibility when determining which bones
should count as selected. Since that function is used when applying
pose assets, it would now also apply to bones hidden by a collection.
The fix is to use `animrig::bone_is_selected` which does check collection visibility.
Pull Request: https://projects.blender.org/blender/blender/pulls/157039
Starting Blender 5.1, applying modifier do not return an active UVMap
So, glTF exporter needs to check if there are some UVMaps by checking size of uv_layers, instead of existance of layer.active
Pull Request: https://projects.blender.org/blender/blender/pulls/157068
Don't set some node pointers to null after freeing, so that even on read
after free in the UI code, this mostly does not crash. This is reverting
part of 9fde9d68bf.
A proper fix for this is in #155797, but is was considered too risky to
backport. This may help on some systems but also not improve things on
others.
Pull Request: https://projects.blender.org/blender/blender/pulls/156712
This includes 2 different commits from main, see individual commits for details.
Backport: Fix#156022: Menu auto scroll can stop at submenus buttons
When a button overlaps the auto scroll handler it not longer gets
completely hidden, instead the button is partially drawn, that makes
buttons to be interactive.
This prevents to open sub-menus or to highlight other buttons while
hovering auto scroll-handlers.
Fix Regression: Auto open menus not working after using menu auto scroll handlers
Mistake in 58aa355049
When using an auto-scroll handler for popups a timer is created to
handle the auto-scroll, however currently this timer is created just
once and when the mouse moves inside the popup or when the scroll hits
its minimum/maximum value the timer still remains active.
This removes the timer when the auto-scroll handler is not hovered
or it can't scroll anymore.
Also note that Pie menus are using the scrolltimer for popup animations,
so also allow auto-opening menu buttons on pie menus.
Pull Request: https://projects.blender.org/blender/blender/pulls/156049
Cached image code leaks an intermediate result that wraps external data.
This is a consequence of 2735711420, since external data previously did
not require freeing. To fix this, just add a release call after use.
Pull Request: https://projects.blender.org/blender/blender/pulls/156756
The Denoise node crashes Blender if denoising passes were connected
directly to a Denoise node inside and outside a node group at the same
time. That's due to double free where the derived data of the pass is
freed twice. This happens because denoising passes referenced external
data, and the result class assumed that external data would not have a
data reference count, and while that is true for the actual data, it is
not true for derived data, so data sharing might lead to derived data
getting freed twice.
To fix this, we keep track of data reference count even for external
data.
Pull Request: https://projects.blender.org/blender/blender/pulls/156368
The issue was caused by a failing `RegGetValueW()` call in
`getScrollDirectionFromReg()` within GHOST TrackpadWin32 due to
uninitialized output arguments, causing nondeterministic orbiting
direction depending on the environment.
Fixed by properly initializing the`scrollDirectionRegValue` and
`pcbData` variables passed to the function. In addition to this, a
correction was made to the default value returned in the querying
failing case, and comments were added to better detail the meaning of
return values.
Pull Request: https://projects.blender.org/blender/blender/pulls/156986
With NVIDIA driver 595+ some materials would render black in EEVEE
with the Vulkan backend. This turns out to be because of an issue in
the eevee_surf_deferred/hybrid_frag.glsl shader: `gbuffer::pack_closure`
is doing a switch on the closure type that was fetched from
`g_closure_bins`. However, control flow before that does not guarantee
that `g_closure_bins` was initialized at that point (it can be by the
the shader node evaluation, but there are code paths where it is not).
The compiler thus determines that the closure type may be unitialized,
which is undefined behavior and therefore it is free to optimize the
entire switch and connected code away.
This fixes that by ensuring the closure type is always initialized.
Pull Request: https://projects.blender.org/blender/blender/pulls/155847
There is an obsolete swapchain configuration being checked.
This configuration was used 2 years ago when wayland color management
wasn’t mature. Nowadays this configuration is not being used until
the latest NVIDIA driver started to use it again. This made some bugs
appear as incorrect code paths is being selected to copy framebuffer
to the swapchain.
Pull Request: https://projects.blender.org/blender/blender/pulls/156741
`ED_screen_user_menu_item_find_operator` fails to return operator due to
`IDP_EqualsProperties/ok_idprop` being false. Buttons defined with
`template_id_def_new_but` doesn't allocate idpropgroup, so apparently
`but->opptr->data` is null. But when added in quick favorites menu,
`layout->op/uiItemFullO_ptr_ex` creates idpropgroup
"wmOperatorProperties". This mismatch case eventually fails to show
"Remove" button in quick favorites. To fix this, pass `is_strict=false`,
that way `IDP_EqualsProperties_ex` returns true when either of idprop
in comparison is null.
Pull Request: https://projects.blender.org/blender/blender/pulls/155609
Having it read-only was an intentional choice at the time due to
discussion in #153012. Changing strip duration and the right handle
position effectively did the same thing from the UI.
But there are some cases where we might want to change duration instead.
Such as when "copying to selected" or if performing logic from a script.
So make the new property writeable too.
Pull Request: https://projects.blender.org/blender/blender/pulls/156115
Hard split information (`anim_startofs/endofs`) was ignored by "Sync
Scene Time."
To fix, update `sync_active_scene_and_time_with_scene_strip` and
`ANIM_draw_scene_strip_range` to take this into consideration.
Co-authored-by: John Kiril Swenson <eliphaz@noreply.localhost>
Pull Request: https://projects.blender.org/blender/blender/pulls/155450
Expose grease pencil `fill_id` and `hide_stroke` attributes to high
level python API. This allows to easily get or set those attributes
using the stroke object itself in scripts or interactive console.
#### Usage:
For the example, let's store a drawing (first frame on first layer of
an active GP object):
`drawing = bpy.context.object.data.layers[0].frames[0].drawing`
Using low level API:
`drawing.attributes['fill_id'].data[0].value = 1`
`drawing.attributes['hide_stroke'].data[0].value = True`
Now also possible directly on stroke object with high level API:
`drawing.strokes[0].fill_id = 1`
`drawing.strokes[0].hide_stroke = True`
Pull Request: https://projects.blender.org/blender/blender/pulls/156246
The GPU compositor crashes if the render resolution is too large. This
is because the compositor is internally limited to 8k resolution due to
hardware limitations. To fix this, we error out before the render
starts, this is the same fix as b81cca4033 but on the UI level.
Pull Request: https://projects.blender.org/blender/blender/pulls/156927
Screw modifier sorts edges that are part of a face and keeps a map of
the sorting. It also tried to remap edges where the first vertex
happened to touch the face, but as the second vertex wasn't part of the
face it was not in the map. Skip edges not in the map.
Pull Request: https://projects.blender.org/blender/blender/pulls/156811
The node_build_multi_function callback must always result in a valid
multifunction for the node. Use a constant value in case the rotation
axes are the same and no real function is defined.
Pull Request: https://projects.blender.org/blender/blender/pulls/156429
Previosly when user added a path to a keying set but not filled in the
actual path, attemting to insert a keyframe in this keying set will
crash due to empty string and a failed RNA property parsing. Now guard
this situation early to avoid this kind of problem.
Pull Request: https://projects.blender.org/blender/blender/pulls/156733