Commit graph

124865 commits

Author SHA1 Message Date
Philipp Oeser
825978fc83 Bump version cycle to 3.6.18 release 2024-11-18 11:37:06 +01:00
Xavier Hallade
1849e53986 Fix #129235: Cycles: out of bound read from Embree
6c03339e48 moved from
rtcSetNewGeometryBuffer to rtcSetSharedGeometryBuffer but kept the
additional padding of 1 element in the function call.

It was previously used for over-allocating, to allow 16-byte reads of
all accessed elements, as Embree requires.
With rtcSetSharedGeometryBuffer, this argument led to an out-of-bounds
read as memory was already allocated without padding.
float3 is already 16-bytes so there is no need for padding, hence we
remove it.

We can also note that now, even when using rtcSetSharedGeometryBuffer,
over-allocating is not needed as it's done and functional on Embree side
since v3.6.

Pull Request: https://projects.blender.org/blender/blender/pulls/129643

Pull Request: https://projects.blender.org/blender/blender/pulls/130274
2024-11-15 09:30:41 +01:00
Christoph Lendenfeld
773570d3e7 Fix #128805: Missing Depsgraph Update when removing FCurve modifiers
The problem was that when removing FCurve modifiers via the python API
the Depsgraph wasn't notified.
Fixed by tagging the owner ID of the fcurve modifier for an update.

Pull Request: https://projects.blender.org/blender/blender/pulls/128984
2024-11-15 09:01:34 +01:00
Campbell Barton
d460fbae60 Fix #120861: BMFace.copy_from_face_interp looses reference
Remove call to BM_elem_attrs_copy in face interpolation function.
This was copying custom-data which cleared the faces CD_BM_ELEM_PYPTR,
making the Python objects behave as if it was removed.

While the issue could also be fixed by skipping the PYPTR layer,
copying attributes such as the material & normal in a face-data
interpolation function isn't correct. In cases where this is needed,
it's better the caller handles copying attributes.
2024-11-15 09:01:34 +01:00
Philipp Oeser
8b18e57921 Fix BMFace/BMLoop.copy_from_face_interp() functions
Resolve incorrect use of `METH_O`.

Ref !127076
2024-11-15 09:01:34 +01:00
Philipp Oeser
c150e3dcc1 Fix #127117: NLA Channels missing update on animated object visibility
e420caab19 already fixed this for "manually" changing visibility, but
if this change comes through animation, these notifiers dont fire (rna
callbacks dont run).

So to resolve, also redraw on `ND_FRAME`, this is something every region
in animation editors listens to anyways, so probably right for
consistency (and to solve this bug), even though it might eat away some
ticks.

Pull Request: https://projects.blender.org/blender/blender/pulls/127145
2024-11-15 09:01:34 +01:00
Philipp Oeser
c8a60bdd38 Fix #126869: frame navigation keymap missing from relevant sidebars
Affected NLA, Dopesheet, Timeline

Region needs `ED_KEYMAP_FRAMES` flag to initialize the corresponding
"Frames" keymap.

Basically the same as cd1d6d7770 , but now also for `space_nla` &
`space_action`

Pull Request: https://projects.blender.org/blender/blender/pulls/126918
2024-11-15 09:01:34 +01:00
Philipp Oeser
61fc21363f Fix #126728: Movie Clip Editor "Sync Visible Range" option not working
True for both `Graph` and `Dopesheet` views in the MCE.

For all other time-based editors, the main region (`RGN_TYPE_WINDOW`) is
of interest to be tagged for syncing `V2D_VIEWSYNC_SCREEN_TIME`. In the
case of the Movie Clip Editor however, the `Graph` and `Dopesheet`
regions in question are of type `RGN_TYPE_PREVIEW`.

So to resolve, we have to take this into account in view2d_sync RNA code

NOTE: this PR does not add versioning code, so any "falsely" tagged
`Graph` and `Dopesheet` view will "loose" the setting (will have to be
enabled again on the "right" region), this could be added though -- it
would be impossible to tell **which**  view exactly, so on each
`RGN_TYPE_WINDOW` encountered, we'd have to then tag **both** `Graph`
and `Dopesheet` afaict

Pull Request: https://projects.blender.org/blender/blender/pulls/126785
2024-11-15 09:01:34 +01:00
Philipp Oeser
faec806e8f Fix #126434: Boid particle fight rule crash involving non-boid psys
For the boid Fight rule (and when determining friend/enemy health), we
need to check if other `ParticleTarget` psys is actually boids as well
(their health data is accessed -- which is only present on boid particle
systems), otherwise NULL data access crashes.

I know, EOL, but simple crash fixers should still get a chance to get in
I think.
Could also go into LTSes.

Pull Request: https://projects.blender.org/blender/blender/pulls/126494
2024-11-15 09:01:34 +01:00
Pratik Borhade
e7e991c354 Fix #128601: Redoing move operation crash in sculpt mode
PBVH is null when redoing the move operation. To fix this,
update active object data from evaluated object before sending
undo_push.

Also fixed the crash in cache_init() after updating depsgraph

Pull Request: https://projects.blender.org/blender/blender/pulls/128625
2024-11-15 09:01:34 +01:00
Clément Foucault
849a20de96 DRW: Rename draw_debug_info.hh to avoid conflict with main branch
Between 0bfd5e3536
and b1cbd9c889
the main branch is incorrectly processing the file
`draw_debug_info.hh` as GLSL and does some string
preprocessing on it. But the output filename matches
the name of the header source file used for compiling
the gpu module. This file not having been updated
since a long time doesn't get copied from the source
folder when switching to other branch and make compilation
fail.

In order to avoid breaking the buildbot longer, we
rename the incriminating file to force recreate it
when building the release branch.

Pull Request: https://projects.blender.org/blender/blender/pulls/130297
2024-11-15 09:00:39 +01:00
Philipp Oeser
2ce9b0da23 Bump version cycle to 3.6.18 candidate 2024-11-14 13:55:08 +01:00
Philipp Oeser
f26e6dc62a Bump version cycle to 3.6.17 release 2024-10-14 17:23:55 +02:00
Alaska
8d4fa68724 Update license information
Ref: !128100
2024-10-10 13:19:10 +02:00
Philipp Oeser
fde515d2aa Bump version cycle to 3.6.17 candidate 2024-10-10 13:02:55 +02:00
Philipp Oeser
54d0e53a36 Release: Bump to 3.6.16 release 2024-09-23 14:24:51 +02:00
Bastien Montagne
4842c3686a Fix #127142: Do not instantiate loose 'annotation' legacy GPv2 data on link.
_No response_

Pull Request: https://projects.blender.org/blender/blender/pulls/127150
2024-09-12 15:55:51 +02:00
Brecht Van Lommel
21142a807c Fix #118514: Cycles MetalRT crash with empty scene
Pull Request: https://projects.blender.org/blender/blender/pulls/118907

Pull Request: https://projects.blender.org/blender/blender/pulls/127500
2024-09-12 15:54:14 +02:00
Jesse Yurkovich
1da590cd2e Build: Ambiguous call to isfinite for MSVC 17.11
Overload resolution must have changed and is causing issues for one
particular code path attempting to use `isfinite(ccl::uchar)`.
Compiler output attached.

It turns out that the code in question can be simplified to just remove
the ambiguity because only the float codepath wants to check for finite
values.

----
Reduced repro: https://godbolt.org/z/YWz3Yc3x8

Pull Request: https://projects.blender.org/blender/blender/pulls/125348
2024-09-12 15:13:00 +02:00
Weizhen Huang
9eabc20a48 Fix #126799: undefined behavior of shader node Arctan2 at (0, 0)
`atan2(0, 0)` is undefined on many platforms. To ensure consistent
result across platforms, we return `0` in this case.

Note only the behavior of the shader node `Artan2` is changed here.
During shading, we might still produce `atan2(0, 0)` internally and
cause different results across platforms, but that usually happens with
single samples and is not obvious, plus checking this condition all the
time is costly. If later we find out it's indeed necessary to change all
the invocation of `atan2(0, 0)`, we could change the wrapper functions
in `metal/compat.h` and `mtl_shader_defines.msl`.

Pull Request: https://projects.blender.org/blender/blender/pulls/126951
2024-09-12 15:08:41 +02:00
Philipp Oeser
ba7aa9aaa5 Bump version cycle to 3.6.16 candidate 2024-09-12 15:05:18 +02:00
Philipp Oeser
f612027620 Bump version cycle to 3.6.15 release 2024-08-19 13:18:38 +02:00
Jeroen Bakker
84d1cf16e7 Fix #116229: Fix EEVEE GLitches on Legacy AMD Platforms
According to the issue not all legacy AMD platforms that required the
high quality normals workaround where enabled. I have not been able to
reproduce the issue due hardware availability.

This PR will enable the workaround for all HD ATI GPUs.

Pull Request: https://projects.blender.org/blender/blender/pulls/116340

Pull Request: https://projects.blender.org/blender/blender/pulls/126402
2024-08-16 14:46:29 +02:00
Philipp Oeser
c788de853e Fix #125064 : Cursor Value to Selected wrong with Normalized FCurves
This affected cursor snapping as well as the `Jump to Keyframes`
operator since both use `sum_selected_keyframes` to get the averaged
values of elements. It was already taking into account the normalization
factor, but the way a single `KeyframeEditData` was created from
multiple `bAnimListElem` was wrong:

- first, we should only add to it if we actually have some keys selected
(not a problem without normalization, but with it, we would add values
there
- second, the offset needs to be taken into account for each selected
key when adding to the absolute values

Could go into LTS probably

Pull Request: https://projects.blender.org/blender/blender/pulls/125221
2024-08-16 14:05:27 +02:00
Alaska
99618031b3 Fix #125168: Cycles spot light theata_e can flip with a wide spread
When the spread of a spot light is at it's maximum (180 degrees),
then `atan(tan(theta_e))` could become quite unpredictable due to
a asymtote in the tan function when working with lights with this
spread (because theta_e is `spread * 0.5 = pi/2`).
This lead to issues like theta_e for the spotlight becoming negative,
which lead to rendering errors due to a malformed light tree.

This commit fixes this issue by adding a episilon region around the
troublesome values and sets theta_e to `pi/2` when in that region.

Candidate for backporting to 4.2 and potentially 3.6

Pull Request: https://projects.blender.org/blender/blender/pulls/125172
2024-08-16 14:04:44 +02:00
Philipp Oeser
80ae465cbd Bump version cycle to 3.6.15 candidate 2024-08-16 13:56:52 +02:00
Philipp Oeser
e480a2c446 Bump version cycle to 3.6.14 release 2024-07-15 11:00:15 +02:00
Weizhen Huang
5da75183d9 Fix #123448: Cycles area light using MIS when the spread is zero
area light with zero spread was introduced in bf18032977. Such paths can
only be sampled with NEE, so MIS should not be used.
This fixes the discrepancy when Direct Light Sampling is set to MIS or NEE.

Pull Request: #118584
2024-07-10 10:36:22 +02:00
Philipp Oeser
33785d4760 Fix #94125: Collada: not all edit mode changes are exported
This was the case when mulitple objects had changes in multi-object-
editmode.

Similar to f8b11528b2 & 3dd08beab3, this now ensures we have mesh data
in editmode.

Pull Request: https://projects.blender.org/blender/blender/pulls/123732

Pull Request: https://projects.blender.org/blender/blender/pulls/124403
2024-07-09 13:27:27 +02:00
Xavier Hallade
2ae87b8fb0 Cycles: oneAPI: Fix driver version check for future Intel GPU drivers
SYCL runtime currently relies on an internal driver behavior that will
break the driver version string returned by SYCL if it changes:
https://github.com/oneapi-src/unified-runtime/issues/1777
This will be fixed at SYCL runtime level but until we use a new enough
one, we need to add additional verifications to avoid blocking execution
on a driver that will change this internal behavior.

Pull Request: https://projects.blender.org/blender/blender/pulls/124084
2024-07-09 12:28:44 +02:00
Brecht Van Lommel
8c68ded7b9 Snap: Add appstream common-id
This makes it easier to query Blender through the snapcraft API.

Fix #123473
2024-07-09 12:27:43 +02:00
Philipp Oeser
472243310b Fix #118148: STL/PLY: Imported object data has increased usercount
STL/PLY (also Collada) use `BKE_mesh_assign_object` to assign a mesh
(already in main, has a usercount of 1) to a fresh object.
That function does a bunch of (unneeded) things (test modifiers/
materials which is not necessary since these are fresh objects) next to
increasing usercount. Collada steers against this by reducing usercount
again. Other importers such as alembic assign the mesh directly to
object data (which is also what this PR proposes).

Pull Request: https://projects.blender.org/blender/blender/pulls/123558
2024-07-09 12:25:35 +02:00
Philipp Oeser
b883d76611 Bump version cycle to 3.6.14 candidate 2024-07-09 12:23:36 +02:00
Philipp Oeser
791bdfd03f Bump version cycle to 3.6.13 release 2024-06-24 13:14:44 +02:00
Bastien Montagne
267df240b2 Fix 'Copy to selected' on dynamic RNA properties failing in some cases.
Related to #119999 and #122059.

In case the _source_ PropertyRNA was unset (i.e. its underlying
IDProperty storage did not exist), the copy operation would silently
fail.

In fact, the existing code handling IDProperties separately in
`RNA_property_copy` was pretty bad, since it would also bypass all the
RNA 'setting value' code (like custom setters, update handling).

Turns out, liboverride RNA apply code can already handle all of these
cases, so simply pass the raw 'unresolved' RNA property to it, and
remove all this special handling code from `RNA_property_copy`, solves
all the issues.
2024-06-13 15:59:27 +02:00
Bastien Montagne
6807f35a8f Fix #119999: RNA copy failure due to improper handling of unset dynamic RNA properties.
A fully unset (i.e. null IDProperty storage pointer) dynamic RNA
property would not be properly handled by RNA copy code path. This led
to having a type mismatch (because dynamic RNA booleans are stored in
integer IDProperies) betwen source and destination RNA properties.
Since the fix in 6adf5adb7f, such type mismatch will abort the copying
process.

This is fixed by updating the `PropertyRNAOrID` internal struct to also
store whether the given property is actually a dynamic RNA one with
IDProperty storage.

NOTE: Potential side-effects: That kind of change is very difficult to
fully analyse, but no side-effects from this fix are expected. The only
code which behavior is changed is `rna_ensure_property_realdata`, which
is only used by `RNA_property_copy` currently.

This change to `PropertyRNAOrID`/`rna_property_rna_or_id_get` _may_ be
useful in the future though, e.g. in liboverride codepath...
2024-06-13 13:00:44 +02:00
Brecht Van Lommel
31a98dc847 Fix #82483: Random Cycles baking hangs with node editor open
CTX_data_ensure_evaluated_depsgraph should not be used in drawing code.
This triggered a depsgraph updated which in turn called
DRW_notify_view_update. This would bind the GPU context a second time
and hang due to recursive mutex calls.

Pull Request: https://projects.blender.org/blender/blender/pulls/123024
2024-06-10 18:30:03 +02:00
Philipp Oeser
279693bdbb Fix #122526: Pie menu executes the active as well as the shortcut button
A bit on shaky ground here, but it looks like we actually dont want to
execute the hovered buttons value/op if we chose another item in the pie
menu. This can be achieved by using the **onfree** arg to
`button_activate_exit` called on the active(hovered) button.

Not sure if this is the correct solution tbh (but maybe it demonstrates
where the bug of #122526 can be located).
I have tested pie menus with this patch and they seems to behave
normally (even nested ones).

Pull Request: https://projects.blender.org/blender/blender/pulls/122567

Pull Request: https://projects.blender.org/blender/blender/pulls/122998
2024-06-10 13:40:14 +02:00
Philipp Oeser
6846976ffc Fix #122598: Curves Grow brush broken on curves with only two points
Code was getting a direction (to grow in) from the last point in a curve
and another point in the middle of the curve.
On a curve with only two points, these points were the same, resulting
in a zero delta and thus doing nothing.

To resolve, take the root point instead in this scenario to get a valid
direction.

Pull Request: https://projects.blender.org/blender/blender/pulls/122644
2024-06-10 13:07:29 +02:00
Philipp Oeser
60986373bc Fix #122429: With Cloth brush set, cloth filter (Scale) is disfunctional
The cloth scale Filter relies on properly set up deformation constraints
(this is done in `do_cloth_brush_build_constraints_task`).
Whenever the Brush (not the Filter) is set to `SCULPT_TOOL_CLOTH`
(having it selected prior to the filter), another code path is taken and
the setting up the proper constraints is skipped (making the Filter
disfunctional).

To distinguish between filter usage and brush usage, there were already
checks for the `StrokeCache` (indicating brush usage afaict), so to
resolve, use the same check to prevent entering the particular code path
associated with the `SCULPT_TOOL_CLOTH`.

Probably an oversight in c2f0522760

Pull Request: https://projects.blender.org/blender/blender/pulls/122440
2024-06-10 13:06:35 +02:00
Philipp Oeser
7c9d59414a Fix #122344: PLY exports non-normalized custom normals on scaled objects
On export, PLY creates a matrix (in `set_world_axes_transform`) -- the
inverse transpose of the regular matrix [seems like the usual way of
transforming normals]] --  by which the normals are multiplied. This can end
up in non-normalized custom normals on scaled objects though. Corrected
in this PR by just normalizing after said multiplication.

On import, `BKE_mesh_set_custom_normals_from_verts` is used with the raw
data -- which ends up in `mesh_normals_corner_custom_set` which in turn
"is expected to have normalized normals" (from the comment).
We _could_ also make sure to normalize on import, however, setting these
properly on export seems the primary choice.
Other importers also dont go the extra route of making sure to normalize
the incoming data, so this seems to be in line of what other Im-/Exports
do.

Pull Request: https://projects.blender.org/blender/blender/pulls/122432
2024-06-10 12:56:40 +02:00
Philipp Oeser
59f21ebce0 Fix #122150: UI: layout.template_search() crash without an active item
`template_search` was introduced in c20c203b82

Seems it assumed an active item is always there.
Without an active item, we are running into a crash trying to get the
textbut width.

So solution is to not draw that text button at all until an active item
is chosen.

This also goes in line with what `template_ID` is doing (it also skips
the text button without an active item).

Pull Request: https://projects.blender.org/blender/blender/pulls/122165
2024-06-10 12:55:59 +02:00
Philipp Oeser
246c57cbe2 Fix #102872: Custom Normals Average operator ui shows wrong properties
`Weight` & `Threshold` sliders should **not** show in case of `Type` :
`Custom Normal` and **should** show for both `Type` : `Face Area` &
`Type` : `Corner Angle`

In code, it looks like we are gathering `loop_weight` with `val`.
- this is always 1.0 for `EDBM_CLNOR_AVERAGE_LOOP`
- this is taken from `BM_face_calc_area` for
`EDBM_CLNOR_AVERAGE_FACE_AREA`
- this is taken from `BM_loop_calc_face_angle` for
`EDBM_CLNOR_AVERAGE_ANGLE`

Code then compares not equal those values with given threshold, but for
`EDBM_CLNOR_AVERAGE_LOOP` this will never trigger (since all values are
the same), thus `count` is always zero which makes the effective
`n_weight` always 1. So all loop split normals are averaged for a vertex
with the same weight (seems to make sense to me -- at is just plain
average)

Long story short: the condition to show `Weight` & `Threshold` sliders
is just flipped (these only apply for the methods that take neighbor
faces into account).

Pull Request: https://projects.blender.org/blender/blender/pulls/121864
2024-06-10 12:55:09 +02:00
Christoph Lendenfeld
b11ffad1df Fix #119945: Dependency Graph not updated properly when adding constraints through python
The issue was that when adding a constraint through
python to an object that is already animated,
the constraint did not evaluate properly at first.
The fix is to update the depsgraph when creating a
constraint through the API.
Such an update already happened when running the
operator to create a constraint.

Pull Request: https://projects.blender.org/blender/blender/pulls/122198
2024-06-10 12:42:15 +02:00
Philipp Oeser
3afc0e5ed7 Bump version cycle to 3.6.13 candidate 2024-06-10 12:11:50 +02:00
Philipp Oeser
626a6b1c67 Bump version cycle to 3.6.12 release 2024-05-20 11:06:31 +02:00
Philipp Oeser
b2b7abf1e2 Fix #121121: NLA push down places local tracks before library overrides
The history here goes from c0bd240ad0 through 89ae4a7a2a (which were
still good), but then with 81b56f8bbc we have gotten to a point were
tracks were placed **before** overrides in case no local tracks were
found.

Now corrected.

Pull Request: https://projects.blender.org/blender/blender/pulls/121395

Pull Request: https://projects.blender.org/blender/blender/pulls/121730
2024-05-13 12:07:54 +02:00
Harley Acheson
d30df88748 Fix #121108: Improved Poll Function for IMAGE_OT_clipboard_paste
Ensure that the current area is an Image Editor before allowing
clipboard paste, since that will fail.

Pull Request: https://projects.blender.org/blender/blender/pulls/121142
2024-05-13 11:19:24 +02:00
Bastien Montagne
2d51478723 Fix #121310: Marking or clearing 'Fake User' on ID not undoable.
Remapping of internal ID pointers in 'undo swap' case (i.e. when new ID
data had to be read from undo buffer, but current ID address is kept)
needs to also ignore 'fake user' handling, otherwise it would reverse
the undoing effect.
2024-05-13 11:18:43 +02:00
Jacques Lucke
263ce1ebb0 Fix #120084: custom group node remains undefined after registering node type 2024-05-13 11:17:57 +02:00