Commit Graph

117690 Commits

Author SHA1 Message Date
Clément Foucault
973813f8ba Cleanup: DRW: Remove unused DRWInstanceData
Rel #134690
2025-02-26 19:43:49 +01:00
Jacques Lucke
63e6f53ba0 Modifiers: new Visual Geometry to Objects operator
This adds a new `Visual Geometry to Objects` operator which is added to the
`Apply` menu.

It creates new objects from the evaluated geometry of the active object. Other
than e.g. applying modifiers, this operator does keep all generated data and
creates new objects and collections for instances. It does have some
similarities to `Make Instances Real` with the main difference that it doesn't
actually realize instances, i.e. instanced geometry is still shared between all
objects using it.

It does intentionally not replace the original object, because the semantics of
that aren't all that obvious. It's especially tricky when the object was
referenced by other objects. Instance attributes are not preserved currently.

Pull Request: https://projects.blender.org/blender/blender/pulls/134119
2025-02-26 17:48:54 +01:00
Aras Pranckevicius
d64aa0112f VSE: speedup RE_render_result_rect_from_ibuf by avoiding memory clear
The RE_render_result_rect_from_ibuf function (used only by VSE) was
allocating memory for the render result, clearing it to zero and
immediately overwriting it with the image pixel data. Remove the
"clear to zero" part.

Rendering a 1920x1080 resolution movie with VSE (using float
pixel data), average RE_render_result_rect_from_ibuf time goes from
6.8ms down to 3.8ms

Pull Request: https://projects.blender.org/blender/blender/pulls/135170
2025-02-26 16:17:48 +01:00
Philipp Oeser
a5d652e5c0 Merge branch 'blender-v4.4-release' 2025-02-26 15:56:25 +01:00
Philipp Oeser
a636b101d7 Fix #121609: Shrinkwrap invert vertex group (no group specified) wrong
Same was true for SimpleDeform.

Invert vertex group influence should only have an effect if there is a
group specified.
Shrinkwrap always uses a weight (gets weights via
`BKE_defvert_array_find_weight_safe` -- which gets full weight for no
group specified, rightfully so), if this gets inverted, we get no
influence at all.

Now move the inverting of the weights to `BKE_defvert_array_find_weight_safe`,
adjust the other callers accordingly (Bevel also does not need to check for a valid
vertexgroup beforehand).

Pull Request: https://projects.blender.org/blender/blender/pulls/121625
2025-02-26 15:56:08 +01:00
Philipp Oeser
a8ed137e52 Merge branch 'blender-v4.4-release' 2025-02-26 15:38:50 +01:00
Philipp Oeser
bc3c6c4e7c Fix #134895: Cancelling sculpt mode elastic transforms deforms mesh
Since the transform system uses previous positions to update to
"original" positions upon cancel, the elastic transforms are not working
well with this (due to their `TransformDisplacementMode::Incremental`
nature).

To resolve, rely on restoring positions from undo (as done elsewhere in
sculpt).

Pull Request: https://projects.blender.org/blender/blender/pulls/134919
2025-02-26 15:38:29 +01:00
Philipp Oeser
ef9742d5de Merge branch 'blender-v4.4-release' 2025-02-26 15:35:53 +01:00
Philipp Oeser
7ac3de70fd Fix #135159: Copied modifier doesn't keep the name of the modifier
`BKE_modifier_copy_ex` did it (which is called e.g. when copying the
whole stack from one object to another), but when simply duplicating a
modifier (`modifier_copy`), it was just ensuring a unique name (based on
the default name) without copyig the existing name prior.

Pull Request: https://projects.blender.org/blender/blender/pulls/135172
2025-02-26 15:35:35 +01:00
Philipp Oeser
51f0758f61 Merge branch 'blender-v4.4-release' 2025-02-26 14:14:36 +01:00
Philipp Oeser
d2ecf66492 Fix #120697: better error for BVHTree.FromObject()
When called on an object that you cannot get a mesh from (e.g. Empties),
you would run into an unhelpful "SystemError: <built-in method
FromObject of type object at ...> returned NULL without setting an
exception"

Now be more specific in the error message.

Pull Request: https://projects.blender.org/blender/blender/pulls/135162
2025-02-26 14:14:14 +01:00
Clément Foucault
f3736aa7af Fix #135018: EEVEE: Plane lightprobe renders incorrectly in ortho view
Caused by wrong view vector which is used to check which way
to point the clipping plane at.

To be backported to 4.2.

Pull Request: https://projects.blender.org/blender/blender/pulls/135166
2025-02-26 14:13:33 +01:00
Pratik Borhade
3a1e7ffebe Fix #134737: Node: Panel deleted when Parented with children
Skip `move_to_parent()` operation when new_parent is already
children of "item" to avoid running into this situation.

Pull Request: https://projects.blender.org/blender/blender/pulls/135148
2025-02-26 14:13:33 +01:00
Clément Foucault
e9dfe79054 Fix #135018: EEVEE: Plane lightprobe renders incorrectly in ortho view
Caused by wrong view vector which is used to check which way
to point the clipping plane at.

To be backported to 4.2.

Pull Request: https://projects.blender.org/blender/blender/pulls/135166
2025-02-26 14:01:30 +01:00
Omar Emara
6365110312 Cleanup: GPU: Remove common_math.glsl includes
This patch refactors GPU shaders to remove includes to the utility
gpu_shader_common_math.glsl file. This is done because it has duplicate
functions that exist in other files, and it was really created for use
in GPU material nodes.

The safe_divide and hypot functions were removed since they exist in
gpu_shader_math_base_lib.glsl.

The compatible_[mod|pow] and wrap functions were moved into
gpu_shader_math_base_lib.glsl.

The floor_to_int function was inlined since it was trivial and only used
in one place.

The quick_floor was removed because it was unused.

The euler_to_mat3 function was replaced with the from_rotation function
from gpu_shader_math_matrix_lib.glsl.

Now the file only contains some GPU material node utility functions.

Pull Request: https://projects.blender.org/blender/blender/pulls/135160
2025-02-26 13:37:20 +01:00
Aras Pranckevicius
844c6e1280 Cleanup: rename IMB divers.cc -> conversion.cc
Looks like "divers" comes from ancient times, Dutch word meaning "misc".
But by now, everything in that file is about conversion between different
pixel data types.

Pull Request: https://projects.blender.org/blender/blender/pulls/135165
2025-02-26 12:44:33 +01:00
Aras Pranckevicius
148aa54398 ImBuf: unify color space transform threaded/non-threaded functions
There's no point in having non-threaded image color space conversion functions.
So merge the threaded and non-threaded functions and clarify names while at it:

- IMB_colormanagement_transform & IMB_colormanagement_transform_threaded
    -> IMB_colormanagement_transform_float
- IMB_colormanagement_transform_byte & IMB_colormanagement_transform_byte_threaded
    -> IMB_colormanagement_transform_byte
- IMB_colormanagement_transform_from_byte & IMB_colormanagement_transform_from_byte_threaded
    -> IMB_colormanagement_transform_byte_to_float

These places were doing single-threaded colorspace conversion previously, and
thus now are potentially faster:
- IMB_rect_from_float (used in many places)
- EXR image "save as render" saving (image_exr_from_scene_linear_to_output)
- Object baking (write_internal_bake_pixels, write_external_bake_pixels)
- General image saving, clipboard copy, movie preparation
  (IMB_colormanagement_imbuf_for_write)
- Linear conversion when reading HDR images/movies
  (colormanage_imbuf_make_linear)
- EXR multi-layer conversion (render_result_new_from_exr)

For one case I benchmarked, which is to render out a 2D stabilized 10 bit input
movie clip out of VSE, the total render time went from 49sec down to 44sec
(Ryzen 5950X), one of the single-threaded parts was the colorspace conversion
in the movieclip code.

Pull Request: https://projects.blender.org/blender/blender/pulls/135155
2025-02-26 12:11:47 +01:00
Clément Foucault
b3e20616d0 Fix #135116: DRW: Leaks while using generated metarig rigs
In this case, the evaluator cache was never referenced and
the subdiv free queue empty. So the freeing of the cache
never happened.

This function is called once per frame and is unlikely
to generate overhead by doing one lock.
2025-02-26 12:11:23 +01:00
Aras Pranckevicius
525ece8465 ImBuf: faster orthogonal image rotation
Speedup IMB_rotate_orthogonal (used for example in auto-rotating
videos that were shot sideways on a phone) by: 1) not copying previous
pixel values into new result, only for them to be immediately
overwritten by rotated pixels, and 2) using multi-threading.

Performing rotation of 1920x1080 resolution HDR (float) video frame
goes from 20ms down to 5ms (Ryzen 5950X, Windows)

Pull Request: https://projects.blender.org/blender/blender/pulls/135158
2025-02-26 11:31:52 +01:00
Pratik Borhade
66a3500324 Fix #134737: Node: Panel deleted when Parented with children
Skip `move_to_parent()` operation when new_parent is already
children of "item" to avoid running into this situation.

Pull Request: https://projects.blender.org/blender/blender/pulls/135148
2025-02-26 11:10:40 +01:00
Omar Emara
e224e437da Cleanup: Compositor: Remove common_math_utils includes
This patches removes common_math_utils includes from compositor shaders
and replaces them with math lib includes. This involves moving some
functions from that file to to the math lib files.

Pull Request: https://projects.blender.org/blender/blender/pulls/135157
2025-02-26 10:47:39 +01:00
Philipp Oeser
7faee6b33b Merge branch 'blender-v4.4-release' 2025-02-26 09:13:03 +01:00
Philipp Oeser
462d887114 Fix #122152: Mask Points select API wrong
Only a single `select` prop was exposed, and this was set to "bezt.f1"
(so it affected the left handle only).

Now we add properties for `left`, `right` and the `single` handle, the
selection prop for the control point is renamed to
`select_control_point` [which is now in line with the API for a bezier
curve].

NOTE: setting/getting a `single` handle uses the existing functions for
this -- handle is selected if any of the right/left handle is selected,
setting the handle results in both handles getting selected.

Pull Request: https://projects.blender.org/blender/blender/pulls/135114
2025-02-26 09:12:46 +01:00
Philipp Oeser
ea40fef958 Merge branch 'blender-v4.4-release' 2025-02-26 09:11:15 +01:00
Jesse Yurkovich
1254cb7e03 Cleanup: USD: Use newly enabled BKE_fcurve_bezt_resize API
Pull Request: https://projects.blender.org/blender/blender/pulls/135147
2025-02-26 07:31:59 +01:00
YimingWu
78b54dd6d5 Fix #134489: Grease Pencil: Simplify operator should follow selection
Previously Grease Pencil simplify operator didn't take stroke selection
into account when it's running in Adaptive or Merge modes. Now filters
points with selected stroke to make all modes have consistent behaviour.

Note that the behaviour of simplify is to operate on the entire
stroke if there's anything selected on the stroke. This is consistent
with what we have prior to switching to Grease Pencil v3 (4.2 and prior)
Arguably some modes can be further improved by only work on selected
segments, but it's beyond the scope of this patch.

Pull Request: https://projects.blender.org/blender/blender/pulls/134497
2025-02-26 02:33:31 +01:00
Harley Acheson
ac549dcfde UI: Show ANIM_OT_change_frame as "Set Frame (Solo Preview)" in VSE
Operator ANIM_OT_change_frame currently has a hidden feature when used
within the Sequencer, called "Solo Preview". But this feature is not
advertised anywhere in the interface. This PR adds a new property to
the operator called "seq_preview" that enables this feature and then
shows the name as "Set Frame (Solo Preview)".
2025-02-26 01:54:26 +01:00
Sean Kim
956a0fad80 Sculpt: Expose location parameter for sculpt.mask_by_color
Currently, there is no way to call the sculpt.mask_by_color operator
from the python API without simulating mouse events. This makes writing
python tests harder than it needs to be.

This commit does the following:
* Adds an exec callback for the mask_by_color operator.
* Adds new `location` property, an int array defined in region space
  coordinates to represent the mouse location.
* Extracts logic into a helper function so that the `invoke` and `exec`
  paths are functionally equivalent.

Pull Request: https://projects.blender.org/blender/blender/pulls/134964
2025-02-26 01:28:24 +01:00
Harley Acheson
6035447ce5 UI: Select Operator Name Improvements
Different object selection modes show custom names like "Select
(Extend)", but this does not happen for "Enumerate" modes. This PR
shows these modes (on the status bar) with specific names and alters
the title of the resulting menu from "Select Menu" to "Select Object",
"Deselect Object", etc.

Pull Request: https://projects.blender.org/blender/blender/pulls/134371
2025-02-26 01:19:46 +01:00
Harley Acheson
2514ca8bd6 Merge branch 'blender-v4.4-release' 2025-02-25 15:40:25 -08:00
Harley Acheson
199c046449 UI: Do Not Show Editor Border for Single Area Separated Windows
With recent changes to the matching of OS title bar to Blender colors
on MacOS and Windows, it looks far nicer to not show the editor border
for windows that only have a single area and also do not have any
global areas. This PR removes them in this case.

Pull Request: https://projects.blender.org/blender/blender/pulls/134961
2025-02-26 00:38:50 +01:00
Jacques Lucke
33d052b84e Merge branch 'blender-v4.4-release' 2025-02-26 00:27:34 +01:00
Yahia
132af79a82 Fix #135047: missing arrow to collapse/expand in properties
It used to be  `depth + 1` in 4.3 instead of `depth`.

Pull Request: https://projects.blender.org/blender/blender/pulls/135082
2025-02-26 00:27:03 +01:00
Clément Foucault
f47f990594 Cleanup: DRW: Remove uniforms declaration and dangerous defines 2025-02-25 23:46:27 +01:00
Clément Foucault
b2ed7eb45c Cleanup: DRW: Remove unused legacy shader libraries 2025-02-25 23:10:19 +01:00
Clément Foucault
3a7d086200 Cleanup: DRW: Remove legacy create info and rename new ones
This is just mass renaming
2025-02-25 23:05:12 +01:00
Campbell Barton
3271b37189 Unbreak build from missing include on some configurations
For some reason this was needed on one of my systems
even with TBB enabled.
2025-02-26 09:01:36 +11:00
Bastien Montagne
f0233665de Merge branch 'blender-v4.4-release' 2025-02-25 20:55:42 +01:00
Bastien Montagne
6b6e6a2cd1 Fix (unreported) invalid crash in debug, disabled-by-default code.
Code printing memory usage of Main ID namemaps could try to run on
nullptr.
2025-02-25 20:53:42 +01:00
Aaron Carlisle
3eca8ca60f Merge branch 'blender-v4.4-release' 2025-02-25 14:08:58 -05:00
Hans Goudey
24e67d9d49 Point Cloud: Remove multiplication in radius extraction and shaders
This multiplication by 100/0.01 was there for historical reasons.
This commit just removes it everywhere.

Pull Request: https://projects.blender.org/blender/blender/pulls/135123
2025-02-25 19:10:45 +01:00
Clément Foucault
e515f16776 Cleanup: DRW: Remove unused legacy object attribute UBO 2025-02-25 18:49:14 +01:00
Clément Foucault
cb7d9222cf Cleanup: DRW: Remove legacy object data create infos
Remove deprecated (and unused) create infos and mass
rename the `*_new` ones.
2025-02-25 18:46:42 +01:00
Falk David
ddced37ea4 Fix #134984: Grease Pencil: Applying a modifier clears keyframe of hidden layer
This was happening because in `apply_eval_grease_pencil_data`
we gather all the potential original layers to clear. This was done
by taking the set of all original layers and then removing layers
from the set that map to an evaluated layer.
The remaining layers are unmapped and should be cleared.

The problem is that invisible layers are no longer part of evaluated
data so there wouldn't be a mapping that could be found.

To fix this, we don't initialize the set of `orig_layers_to_clear` to
all the layers, but instead to only the layers that are visible.
This will ensure that we don't clear keyframes of hidden layers.

Pull Request: https://projects.blender.org/blender/blender/pulls/135121
2025-02-25 18:36:53 +01:00
Clément Foucault
d8387a82ff Cleanup: DRW: Remove legacy common_math_lib 2025-02-25 18:12:33 +01:00
Clément Foucault
30ccd6b179 GPU: Fix compilation of tests
Caused by missing include.
2025-02-25 18:12:05 +01:00
Nathan Vegdahl
f1628c6c03 Fix: missing includes
Building failed with certain build options disabled, such as in my
extra-lean build.

Bisecting indicates that d0a6189b50 was
the cause, although it's not obvious to me why. But likely some
indirect include that was lost in the refactor.
2025-02-25 18:00:26 +01:00
Miguel Pozo
f15a16d1c6 Merge branch 'blender-v4.4-release' 2025-02-25 15:58:16 +01:00
Miguel Pozo
cdf821c978 Fix #134890: Overlay: Missing Weight Paint overlays with Display as Wire
Support both opaque and masked transparency weight overlays at
the same time.

Pull Request: https://projects.blender.org/blender/blender/pulls/134942
2025-02-25 15:55:16 +01:00
Dalai Felinto
f5d929dbb1 Point Cloud: Draw selection overlay
This uses a fixed point size for selection, so that point selection is always visible
regardless of radius size.

The radius size is used to offset the selection point, so it is always visible, even when the radius is too large.

Co-authored by Hans Goudey.

---

Pull Request: https://projects.blender.org/blender/blender/pulls/134908
2025-02-25 15:20:52 +01:00