Commit Graph

120055 Commits

Author SHA1 Message Date
Philipp Oeser
64c15823f7 Fix #135355: ops.render.opengl() in the console wont return {'FINISHED'}
Caused by 40ac21e5a5 [does not remember/resore the previous ScrArea &
ARegion anymore].
Without this, the operator reporting might get confused by using the
wrong area/region, so added back

NOTE: I tried to just notify `NC_SPACE | ND_SPACE_INFO_REPORT` in
`screen_opengl_render_end` (same as in `wm_operator_finished` >
`wm_operator_register`), but to no avail...

Think this is quite good pratice to leave us with the original area/
region anyways though.

Thx @brecht for improvements (restoring in `screen_opengl_render_init`
already, also taking care of restoring in some early out cases)

Co-authored-by: Brecht Van Lommel <brecht@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/135394
2025-03-04 09:35:27 +01:00
Philipp Oeser
3589c5489a Fix: Cursor snapping does not work for Curves bezier handles
For this to work, we have to take into account handles in TransVert as
well.

Behavior is the same as in legacy curves (meaning that if the control
point itself is selected, the handles are ignores).

Part of #133448 (same thing for grease pencil, which I plan to also make
part of TransVert, but better solve for Curves first, so we can share
code here).

Pull Request: https://projects.blender.org/blender/blender/pulls/134945
2025-03-04 09:35:12 +01:00
Omar Emara
85a78774da Merge branch 'blender-v4.4-release' 2025-03-04 09:34:41 +02:00
Omar Emara
a50144e55c Fix #134914: Backdrop remain after loading new file
The compositor backdrop is still visible even after a new completely
different file is loaded. This is because compositor contexts cache
things like the backdrop, and contexts are stored on interactive
compositor renders, which are not freed until Blender is closed. To fix
this, we cleanup the interactive compositor renders that were created
upon file load.

Pull Request: https://projects.blender.org/blender/blender/pulls/135390
2025-03-04 08:33:17 +01:00
Jeroen Bakker
4a95c0405c Cleanup: Subdiv: Remove wrapper OpenSubdiv_Buffer
`OpenSubdiv_Buffer` is a wrapper that was introduced at the time
that Blender couldn't use CPP directly. It contains a pointer to
a VertBuf and callbacks to use GPU module on that buffer.

This PR replaces OpenSubdiv_Buffer with `blender::gpu::VertBuf` and
removes the wrapper.

NOTE: OpenSubdiv tests are added to blender_test executable to make the
library dependencies not to complicated.

Pull Request: https://projects.blender.org/blender/blender/pulls/135389
2025-03-04 07:51:15 +01:00
Hans Goudey
94eff0aa06 Cleanup: Move geometry editors module function to C++ namespace 2025-03-03 22:49:55 -05:00
Hans Goudey
38c732c85f Cleanup: Deduplicate geometry attribute convert function 2025-03-03 22:48:25 -05:00
Hans Goudey
51f719cfab Geometry: Support "Convert Attribute" for curves and point cloud
Add this operator to the dropdown menu to the right of the attribute list
for curves and point cloud geometries. For these geometry types the
operator can run in edit mode too, unlike meshes.
2025-03-03 22:38:47 -05:00
Hans Goudey
43be4d2f9e Cleanup: Use StringRef instead of StringRefNull 2025-03-03 22:38:47 -05:00
Hans Goudey
6a379f218f Cleanup: Correct comment in customdata.cc 2025-03-03 22:38:47 -05:00
Campbell Barton
f892bef8eb Merge branch 'blender-v4.4-release' 2025-03-04 11:43:53 +11:00
Sean Kim
584f15cc33 Cleanup: Convert BLI_mempool to blender::Pool in bmesh_log.cc
* Adds an `allocated_` prefixed `Vector` to track all used pointers so
  everything can be deconstructed when `BMLogEntry` is freed.

Pull Request: https://projects.blender.org/blender/blender/pulls/135415
2025-03-04 01:37:46 +01:00
Hans Goudey
cd0956d72f Cleanup: Simplify check for sculpt BVH normals update in mesh draw code 2025-03-03 18:22:56 -05:00
Campbell Barton
72d89eee87 Fix use of the pixelsize for the size of rounded area bounds
Use the scale-factor instead of the pixelsize.

Without this, changing the line-width can double or half the size of
rounded corners.

Ref !135383
2025-03-04 10:10:09 +11:00
Harley Acheson
a021176ff4 UI: Show "Not Found" Icon when Not Found
In the unlikely event that an icon is requested that is not found, show
a specific icon that is meant to indicate this state, in "Error" color.

Pull Request: https://projects.blender.org/blender/blender/pulls/134959
2025-03-03 22:25:42 +01:00
Clément Foucault
f15e72971a Cleanup: DRW: Avoid warning caused by class/struct mismatching definition
Showed as a compiler warning.
2025-03-03 20:23:15 +01:00
Brecht Van Lommel
c5f203e02f Merge branch 'blender-v4.4-release' 2025-03-03 19:30:52 +01:00
Brecht Van Lommel
1689c3ed0b Fix #135354: View render animation from Python no longer shows progress
To match old behavior, keep showing the time cursor in case a blocking
animation render is used from a Python script.
2025-03-03 19:29:54 +01:00
Clément Foucault
3f1289836c Merge branch 'blender-v4.4-release' 2025-03-03 18:58:37 +01:00
Clément Foucault
446ad3ba13 Fix #135246: Overlay: Loose wire disapears when line antialias is off
This was caused by the normals not being available (default to
`vec3(0)`) which produced `NaN`s down the line after the
unsafe normalize. Changing to `safe_normalize` fixes the issue.
2025-03-03 18:58:14 +01:00
Hans Goudey
a58dd0b5c3 Refactor: Curves: Various changes to draw cache extraction
- Avoid redundant computaiton of curve type index masks
- Parallelize index buffer build (always add space for a cyclic segment)
- Avoid overhead of GPU index buffer "add vert" utilities
- Add utility for consistent order of point and handle data
- Make some variable names more consistent
- Avoid mixing multiple abstraction levels in the same function
2025-03-03 12:05:23 -05:00
Sean Kim
090454361e Cleanup: Add comment for sculpt_undo.cc StepData#bm_entry
Pull Request: https://projects.blender.org/blender/blender/pulls/135340
2025-03-03 17:46:52 +01:00
Aleš Jelovčan
7206ad7dc4 Fix #135395: Use new Grease Pencil object type for status bar stats
Status bar stats did not display any data for Grease Pencil, because
the check still used the legacy Grease Pencil type.

Pull Request: https://projects.blender.org/blender/blender/pulls/135397
2025-03-03 17:46:16 +01:00
Sean Kim
34eec790b5 Cleanup: Update bmesh_log.hh documentation
Pull Request: https://projects.blender.org/blender/blender/pulls/135339
2025-03-03 17:45:46 +01:00
Hans Goudey
935868acbb Cleanup: Simplify curve handles comment 2025-03-03 11:11:56 -05:00
Aras Pranckevicius
cc2c6692c0 Cleanup: Name more IMB things as "byte" or "float" instead of "rect" and "rectFloat"
- IB_rect -> IB_byte_data
- IB_rectfloat -> IB_float_data
- Rename some functions:
	- IMB_get_rect_len -> IMB_get_pixel_count
	- IMB_rect_from_float -> IMB_byte_from_float
	- IMB_float_from_rect_ex -> IMB_float_from_byte_ex
	- IMB_float_from_rect -> IMB_float_from_byte
	- imb_addrectImBuf -> IMB_alloc_byte_pixels
	- imb_freerectImBuf -> IMB_free_byte_pixels
	- imb_addrectfloatImBuf -> IMB_alloc_float_pixels
	- imb_freerectfloatImBuf -> IMB_free_float_pixels
	- imb_freemipmapImBuf -> IMB_free_mipmaps
	- imb_freerectImbuf_all -> IMB_free_all_data
- Remove IB_multiview (not used at all)
- Remove obsolete "module" comments in public IMB headers

Pull Request: https://projects.blender.org/blender/blender/pulls/135348
2025-03-03 17:11:45 +01:00
Clément Foucault
db9aa0b435 Fix: DRW: Wrong logic for Grease Pencil visibility test
Fixes a warning and a logic error.
2025-03-03 17:11:07 +01:00
Clément Foucault
c2f02448c3 Merge branch 'blender-v4.4-release' 2025-03-03 16:21:37 +01:00
Clément Foucault
3653fe9524 Fix #135191: Overlay: Edit Mesh: Face selection Z-fighting with edit cage
The offset was not applied inside the vertex shader for
the edit Face selection overlay. Making the offset apply
to this shader fixes the issue.
2025-03-03 16:21:00 +01:00
Hans Goudey
16fff2e49c Cleanup: Transform: Use C++ parallel_for to remove boilerplate
threading::parallel_for implements its own check to avoid
threading when the data length is below the grain size, and
its overhead is lower anyway, since it doesn't use a function
call for every element.

Pull Request: https://projects.blender.org/blender/blender/pulls/135316
2025-03-03 16:16:41 +01:00
Clément Foucault
c3ad5e3861 Cleanup: DRW: Remove unused function from header and cleanup function names
Pull Request: https://projects.blender.org/blender/blender/pulls/135322
2025-03-03 16:12:16 +01:00
Clément Foucault
56258cee9b Cleanup: DRW: Reduce code duplication and group similar functions 2025-03-03 16:12:16 +01:00
Clément Foucault
7d5ec51d26 Refactor: DRW: Remove access to global context for instance data
Pass the `ObjectRef` in a few more places.
Remove the now unused functions.
2025-03-03 16:12:16 +01:00
Clément Foucault
2038ba699d Refactor: DRW: Make Dupli batch extraction use C++ types
And add documentation about why do we need this.

Removes the potential engine data and only keep a `Set`
of instanciated object.
2025-03-03 16:12:16 +01:00
Clément Foucault
d5871be8dd Refactor: DRW: Pass ObjectRef directly to engine object sync
Reduces API bloat.
2025-03-03 16:12:16 +01:00
Sebastian Parborg
cb7d80238b Merge branch 'blender-v4.4-release' 2025-03-03 15:23:55 +01:00
Sebastian Parborg
6a3642cb1f Fix #135193: Correctly clamp the current frame when starting playback
The old code didn't properly communicate that it changed the current
frame leading to de-syncs in state between the frame shown and the audio
etc.
2025-03-03 15:21:47 +01:00
Julian Eisel
32cae542da Assets: Batch create/remove previews for all selected assets
Part of #134755 / #134766.

Previously operators to create or remove previews would only work on the
active asset/data-block. From feedback this can be quite an
inconvenience, e.g. when curating asset libraries for sharing or
production environments.

This change makes it so the following operators (all available in the
asset browser side-bar) create or remove the preview on the whole
selection:
- Generate Preview (refresh icon)
- Generate Preview from Object
- Remove Preview

Loading preview images from disk doesn't support this yet.

Pull Request: https://projects.blender.org/blender/blender/pulls/135267
2025-03-03 14:49:53 +01:00
Sybren A. Stüvel
6f80d722c6 Fix #135163: Grease Pencil layer visibility animation doesn't work in NLA
Add a new function `bke::animdata::prop_is_animated()` that returns
whether an RNA path + array index is animated by anything. This covers
the assigned Action, NLA Action strips, and drivers.

This function is now used in the determination whether the visibility
of a GreasePencil layer is animated.

The easiest way to implement this with the existing F-Curve-visiting
logic was to call `adt_apply_all_fcurves_cb()`. However, that function
did not allow the callback function to signal "stop looping, I found
what was I was looking for", so I extended it to do just that. I don't
expect the extra conditions to significantly slow down the other uses,
as the branch predictor will very likely optimise for the "returning
true" case for those calls that simply visit everything.

Pull Request: https://projects.blender.org/blender/blender/pulls/135317
2025-03-03 14:24:07 +01:00
Falk David
c24b540400 Fix #135313: Grease Pencil: Layer adjustments get applied repeatedly during playback
The issue was that during playback, the evaluated Grease Pencil ID
is not being copied again for re-evaluation. This meant that the
adjustments get re-applied over and over again.

Ideally, we would restore the drawing pointers before modifiying them
again, but this is a bit trickier to implement.

To fix this issue for now, we do the layer adjustments during object
data evaluation. Using the geometry set for modifier evaluation
means that we copy the data and apply the adjustments for every
object.

In the future this can be optimized to only happen once per
Grease Pencil ID (in `BKE_grease_pencil_eval_geometry`).

Pull Request: https://projects.blender.org/blender/blender/pulls/135387
2025-03-03 14:09:06 +01:00
Hans Goudey
9cade06f5f Refactor: Nodes: Use Map instead of GHash for compositor previews
Replace `bNodeInstanceHash` with a `Map`. Move it to the node tree
runtime data. Simplify some code by removing the tag from the hash
value and collecting unused previews directly. Then just remove a
bunch of code that's now unused.

Note that texture node previews haven't been working for a while
anyway, and the experimental shader node previews seem to use
a different system (this one is a remnant of Blender Internal).

Pull Request: https://projects.blender.org/blender/blender/pulls/135310
2025-03-03 14:04:20 +01:00
Miguel Pozo
52079f27e7 Merge branch 'blender-v4.4-release' 2025-03-03 13:47:05 +01:00
Miguel Pozo
f2c7e60a8c Fix #135357: Overlay-Next: Reference images briefly disappear when entering orthographic view
depth_bias_winmat_ is computed after sync.
2025-03-03 13:46:13 +01:00
Clément Foucault
127a5d6d3a Cleanup: GPU: Shader C++: Avoid #pragma once in main file warning
Pull Request: https://projects.blender.org/blender/blender/pulls/135384
2025-03-03 12:50:47 +01:00
Clément Foucault
783472671e Cleanup: GPU: Add macro for default constructor compatibility on MSL 2025-03-03 12:50:45 +01:00
Clément Foucault
2c20c200bf Cleanup: GPU: Remove warning about is_zero redundant declaration 2025-03-03 12:50:45 +01:00
Bastien Montagne
666267ef40 Fix assert in BKE_main_namemap when reusing brush assets on fileload.
Code in readfile that copies over brush assets (and related data) from
the old Main to the new one cannot use the namemap reliably, due to how
the linked IDs of the library get temporarily spread between both Mains.

Since in theory there should be no need for name uniqueness processing
in this case anyway, for now disable the relevant code when the library
is re-used.

NOTE: Issue reported in #135315, revealed by recent refactor in
00f406c34c and 16e552298c.

NOTE: This fix is a bit hackish, but seems to be the simplest most
straight-forward way to address the problem. More invasive solution can
be investigated if this proves to still be problematic.

NOTE: While 4.4 also has the same invalid handling, this PR should
likely not be ported to it, as previous BKE_main_namemap code was more
permissive with such invalid behaviors, and there is no known bad
consequences in practice.

Pull Request: https://projects.blender.org/blender/blender/pulls/135362
2025-03-03 11:34:48 +01:00
Bastien Montagne
4a6e73c3e6 Merge branch 'blender-v4.4-release' 2025-03-03 11:03:47 +01:00
Jeroen Bakker
4bf3c36c6a Cleanup: Subdiv: Missing usage binding defines
Patch evaluation shaders has defines, but they were not used. This PR
cleansup the incremental binding by using these defines.

Pull Request: https://projects.blender.org/blender/blender/pulls/135379
2025-03-03 11:03:12 +01:00
Habib Gahbiche
b0fbd9154e Fix: 2D cage gizmo rotation part not being highlighted
The transform gizmo in the sequence editor does not show highlights properly for rotation, when hovering over it or while dragging it.

This patch has no further side effects on operators that use the 2d cage gizmo without rotation such as the crop gizmo and the viewer (transform) gizmo in the compositor.

Pull Request: https://projects.blender.org/blender/blender/pulls/135065
2025-03-03 10:46:20 +01:00