Commit Graph

106929 Commits

Author SHA1 Message Date
Iliya Katueshenock
1dfd94a8d3 Cleanup: EEVEE: Fix compile warning
Pull Request: https://projects.blender.org/blender/blender/pulls/118322
2024-02-16 20:01:06 +01:00
Aras Pranckevicius
69b9735ce2 Merge branch 'blender-v4.1-release' 2024-02-16 20:56:56 +02:00
Aras Pranckevicius
6508ed8a3f Fix #118213: Applying effects to VSE Color/Text strips makes both the effect and source strip visible
This is different from applying effects to regular "source media" strips
like images or movies; an effect "hides" the input strip when it is
below itself in the channel.

Apply the same treatment to Color & Text strips. Fixes #118213.

If someone wants previous behavior for some reason, they can drag
the effect applied on Color/Text to be below the input strip.

Pull Request: https://projects.blender.org/blender/blender/pulls/118269
2024-02-16 20:56:06 +02:00
Brecht Van Lommel
7453c5ed67 Merge branch 'blender-v4.1-release' into main 2024-02-16 19:31:31 +01:00
Raul Fernandez
324ff4ddef macOS: Remove unnecessary checks now that minimum version is macOS 11.2
MacOS minimum version is now 11.2 we no longer need to check for lower API versions.

Pull Request: https://projects.blender.org/blender/blender/pulls/118388
2024-02-16 19:03:23 +01:00
Hans Goudey
333daa3185 Merge branch 'blender-v4.1-release' 2024-02-16 12:54:53 -05:00
Hans Goudey
f909e279e7 Fix #118360: Fill mask operator doesn't initialize hidden vertices
If there is no mask attribute yet and hidden vertices, the values for those
vertices wouldn't be initialized. Fix by simply initializing the entire array
when it's allocated.
2024-02-16 12:54:27 -05:00
Philipp Oeser
d555bbaa46 Merge branch 'blender-v4.1-release' 2024-02-16 18:26:44 +01:00
Philipp Oeser
2f1b9432be Fix #106999: Converting curves to particle system can lead to crash
So this happens on curves with only a single point in them.
If these are converted to the old particle system, we would end up with
a particle with only one key (invalid hair), then going to particle
editmode would crash.

The old particle system took care of this (e.g. when deleting keys in
`PARTICLE_OT_delete`)
See the following comment:
`/* We can't have elements with less than two keys. */`

So to resolve, only convert curves with multiple (>1) points in the
process.

Pull Request: https://projects.blender.org/blender/blender/pulls/118392
2024-02-16 18:25:43 +01:00
Hans Goudey
c686e6603e Cleanup: Fix missing declaration warning after recent commit
Missing from d9a1e906f5
2024-02-16 12:22:16 -05:00
Harley Acheson
4910de5160 Merge branch 'blender-v4.1-release' 2024-02-16 09:21:53 -08:00
Harley Acheson
f573a3bad3 Fix: Crash When Dragging Other Object Types into Bone Collection List
Dragging any other object type to the Bone Collections List results in
a null dereference.  This PR adds check that the drag type is
WM_DRAG_BONE_COLLECTION.

Pull Request: https://projects.blender.org/blender/blender/pulls/118393
2024-02-16 18:20:37 +01:00
Richard Antalik
a2c839e71c Fix #118190: Tool shortcut does not show in tooltip
fa6384eb39 introduced explicit setting of operator context as argument for
function `ED_region_panels_ex()`. However, this did not work correctly, because
`UiLayout` did not exist when `uiLayoutSetOperatorContext()` was called. This
has to be done in `ed_panel_draw()`.

Another issue is, that panel may be drawn, when mouse is over tool region,
which means, that `sequencer_tools_region_draw()` must look for whether
this is happening in preview or timeline region.

Pull Request: https://projects.blender.org/blender/blender/pulls/118292
2024-02-16 18:05:23 +01:00
Hans Goudey
8ab23f0a6e Assets: Return weak reference by value from asset representation
This is generally more flexible and less error prone. The struct
implements a proper descructorfor this anyway. That also makes the
separate free function unnecessary-- it's redundant with the destructor.
2024-02-16 12:02:08 -05:00
Hans Goudey
d9a1e906f5 Cleanup: GPv3: Add specific header for legacy conversion functions
Similar to `BKE_curve_legacy_convert.hh` and `BKE_mesh_legacy_convert.hh`

Pull Request: https://projects.blender.org/blender/blender/pulls/118390
2024-02-16 17:49:42 +01:00
Harley Acheson
7d1747819f Merge branch 'blender-v4.1-release' 2024-02-16 08:40:51 -08:00
Pratik Borhade
5ba104ac46 Fix #114962: Tree view: Crash during tooltip creation
Crash when dragging tree-item from one window to other instance of tree
view, with drop_target then nullptr. Returning null in this case lets
the process proceed normally and tooltip display correctly.

Pull Request: https://projects.blender.org/blender/blender/pulls/116892
2024-02-16 17:39:21 +01:00
Hans Goudey
44e695192a Cleanup: Make format 2024-02-16 11:35:54 -05:00
Falk David
8bca19ed12 GPv3: Layer Adjustment Conversion
This converts the "Layer Adjustments" from GPv2 into modifier setups in GPv3.

They include:
* Layer tint
* Layer thickness offset
* Thickness factor (for the entire object)

Both the "layer tint" and the "thickness factor" are converted using the existing modifiers.

Because the thickness modifier uses a factor instead of an offset, the "layer thickness offset" is converted to a geometry nodes modifier setup for each layer that adds an offset value to the radii instead of multiplying by a factor.

Pull Request: https://projects.blender.org/blender/blender/pulls/118149
2024-02-16 17:17:19 +01:00
Hans Goudey
921ce2fae8 Cleanup: Consistent use of "this" keyword in asset code
Follow the style guide for using `this->` to access non-private variables.
2024-02-16 11:01:17 -05:00
Julian Eisel
6d387b3ba8 Cleanup: Use reference where null asset library is not possible
It should not be possible to end up with an asset representation that
does not have a valid pointer/reference to the asset library owning it,
it's injected via all constructors. So reflect that by using a reference
instead of a (possibly null) pointer.
2024-02-16 16:53:36 +01:00
Julian Eisel
38c2305457 Cleanup: Remove unused header in asset file 2024-02-16 16:51:53 +01:00
Falk David
8b31e8663b GPv3: Convert editcurve to bézier curves
In GPv2, strokes could be edited using bézier curve handles. This was implemented by creating an `editcurve` for a stroke that would store the handles and other attributes.
In GPv3, we can directly make use of the `CURVE_TYPE_BEZIER` and store the curve as a bézier curve.

Note: This PR only handles conversion. Not rendering or anything else.

Pull Request: https://projects.blender.org/blender/blender/pulls/118386
2024-02-16 16:51:06 +01:00
Julian Eisel
a5a3125fe1 Refactor: Remove unused move constructor for asset representation
This shouldn't be needed, and was incorrect anyway: It wasn't copying
the owner asset library pointer.
2024-02-16 16:38:14 +01:00
Bastien Montagne
9275d40934 GPv3: Minor Refactor of conversion code.
Essentially move the Object-handling logic also into
`bke::greasepencil::convert::`. This code will also be needed for
automatic conversion on fileread etc.

It also helps to keep all the conversion logic in one place (especially
since there is going to be way more done at object level - modifiers,
animation, etc.).

Pull Request: https://projects.blender.org/blender/blender/pulls/118384
2024-02-16 16:29:31 +01:00
Omar Emara
9ab72eae38 Compositor: Unify Texture node between CPU and GPU
The CPU and GPU implementations of the compositor Texture node sample
the texture at different locations, producing differences. This is
primarly an issue with half pixel offsets to evaluate the texture at the
center of the pixels.

The CPU compositor only adds the offsets if interpolation is disabled,
regardless if the texture is of type image or not. Further the offset
was wrong, since it was not a half pixel offset, but a full pixel one.

The offsets should always be added, since it won't make a difference in
the non interpolated case, and it should always be added especially if
interpolation is enabled. A comment in the old code mentions something
about artifacts, but it is possible that this is a consequence of the
wrong offset that was used.

This patch always adds a half pixel offset, following the GPU code.

Pull Request: https://projects.blender.org/blender/blender/pulls/118377
2024-02-16 16:21:48 +01:00
Philipp Oeser
54110c56c4 Merge branch 'blender-v4.1-release' 2024-02-16 15:37:07 +01:00
Philipp Oeser
745d2e18dc Fix #107228: AttributeGroup.new crash when layer cannot be created
A layer cannot be created e.g. when creating a reserved-name attributes
with the wrong domain/type.

Caused by 101d04f41f [which just did not
check if the layer creation was successful].

This should go into 3.6 LTS as well.

Pull Request: https://projects.blender.org/blender/blender/pulls/118378
2024-02-16 15:36:31 +01:00
Omar Emara
0906201a4c Compositor: Fallback to a black color for invalid outputs
Currently, some compositor operations produce en empty output buffer by
specifying a COM_AREA_NONE canvas to indicate an invalid output, for
instance, when the Mask operation references an invalid mask. The
intention is that this buffer would signal that a fallback value should
fill the canvas of consumer operations.

The aforementioned behavior is currently implemented in a rather hacky
way, where it is implemented using the Translate operation as part of
canvas conversion in COM_convert_canvas, where the operation would clear
the entire buffer with zeros since out of bounds checking would always
take the out of bound case due to the empty buffer.

This behavior is problematic because we can't control the fallback
value, which would ideally be an opaque black color. Moreover, since
implicit type conversion happen before canvas conversion by design,
value typed buffers would eventually become transparent, which is rather
unexpected to the end user since float/value outputs can't have
transparency.

This is not a good design or implementation, but a redesign will be too
complex for now. So to fix this, we workaround it by handling the empty
buffer case explicitly in the Translate operation and fill the output
using a fallback black color, which works for both value and color typed
buffers, since this would also be the output of the value to color
implicit conversion.

Pull Request: https://projects.blender.org/blender/blender/pulls/118340
2024-02-16 15:32:59 +01:00
Falk David
eabb4f16ce Revert "Fix: GPv3: Move dvert copy out of parallel for"
This reverts commit 31b8323b93.

Allocating memory in parallel is fine as long as each threads only
writes to the memory it allocates, which is the case here.
2024-02-16 15:26:23 +01:00
Falk David
31b8323b93 Fix: GPv3: Move dvert copy out of parallel for
Since we're allocating new memory on the heap in the copy,
better to move this out of the parallel for
and avoid side effects.
2024-02-16 15:23:21 +01:00
Bastien Montagne
19cbc687e8 Fix a few issues in GP legacy to v3 conversion operator.
* Use name of old GP data for the new one, _not_ the object name.
* Properly decrease usercount of old GP ID.

Pull Request: https://projects.blender.org/blender/blender/pulls/118366
2024-02-16 15:22:39 +01:00
Bastien Montagne
5e4360ada6 Merge branch 'blender-v4.1-release' 2024-02-16 15:16:39 +01:00
Bastien Montagne
88ba4dfaa3 Fix #118299: Crash in some cases with invalid/deprecated LibOverride data.
`BKE_lib_override_library_validate` used on fileread to ensure all
liboverrides are valid was using direct call to
`BKE_lib_override_library_free`. However, this was lacking the handling
of embedded dependencies (from liboverride PoV), in particular
ShapeKeys.

Since these shapekeys were still tagged as embedded liboverrides,
liboverride code would later assume their owner (mesh etc.) was also a
valid liboverride, leading to various potential issues.

Use instead `BKE_lib_override_library_make_local`, which also ensures
that embedded dependencies are handled properly.
2024-02-16 15:08:39 +01:00
Falk David
9b815dcc4b Cleanup: GPv3: Legacy stroke conversion 2024-02-16 15:02:42 +01:00
Pratik Borhade
1077aebaa6 GPv3: Duplicate layer
Port layer duplicate operator to Grease Pencil v3.

Pull Request: https://projects.blender.org/blender/blender/pulls/117974
2024-02-16 14:07:29 +01:00
YimingWu
975c226282 GPv3: Array Modifier
This migrates the Array modifier to Grease Pencil v3.

Pull Request: https://projects.blender.org/blender/blender/pulls/117836
2024-02-16 14:04:01 +01:00
Omar Emara
7683449877 Cleanup: Unused function warning in Denoise node
The warning happens when OIDN is disabled as a build option.
2024-02-16 14:10:11 +02:00
Bastien Montagne
0e75fcbf4d Silence warning about unused var in release builds. 2024-02-16 13:07:23 +01:00
YimingWu
ace5c9af2a GPv3: Vertex Weight Angle modifier
This ports the Vertex Weight Angle modifier to Grease Pencil v3.

Pull Request: https://projects.blender.org/blender/blender/pulls/117846
2024-02-16 12:30:43 +01:00
Philipp Oeser
dd71f5287b Merge branch 'blender-v4.1-release' 2024-02-16 12:29:10 +01:00
Philipp Oeser
1a2edde400 Fix #118225 possible crash double clicking on certain anim channels
The intend in the report was to rename a linked object in the NLA
channels. The operator to rename actually does everything right, it
detects that the object is linked and passes through to other operators.

The crash then happens in the attempt to select keyframes of channels
(also doubleclick n the keymap) -- in `select_anim_channel_keys`.

The problem is that `bAnimListElem` `key_data` cannot be expected to be
an `FCurve` in all cases. Code does though, it always casts, but this is
unreliable, basically this would fail for all of the "summary" channels
or any channel type (e.g. mask layers etc.), either it is NULL or
garbage data.

So to resolve, we just check the `bAnimListElem` type -- if it is not
ALE_FCURVE we can early out (preventing the crash).

NOTE: this changes behavior of double clicking on a summary channel that
cannot be renamed slightly in that it will not deselect its keys anymore
(it was not selecting any keys anyways, this is actually more in line of
what would happen if you just select another channel -- this also leaves
key selection alone -- so this is actually an improvement as well imho)

Pull Request: https://projects.blender.org/blender/blender/pulls/118251
2024-02-16 12:28:13 +01:00
Jeroen Bakker
c790e6e49d OpenGL: Reduce Shader Switches
Specialization constants was always switching shader even when the
constants were not changed. An early exit path was never taken.

The performance improvement should not be noticable to end users.
But would match with the intention of the design of specialization
constants.

Pull Request: https://projects.blender.org/blender/blender/pulls/118315
2024-02-16 12:26:10 +01:00
Pratik Borhade
71adac1c39 Cleanup: Typo in namespace 2024-02-16 15:41:44 +05:30
Christoph Lendenfeld
10682abc56 Fix: Proportional editing indicator in the Dope Sheet not respecting NLA offsets
The issue was that the center of the transformation wasn't
mapped to the NLA offset.
Fix it by calling the function `BKE_nla_tweakedit_remap`.

Pull Request: https://projects.blender.org/blender/blender/pulls/118205
2024-02-16 10:55:47 +01:00
Omar Emara
f590b36e62 Merge branch 'blender-v4.1-release' 2024-02-16 10:55:29 +02:00
Omar Emara
1cae3d60e6 Fix #118344: Crash when File Output node has no input
The File Output node crashes if it has no image input. That's because we
would be attempting to save a zero sized image. So ensure that the node
has a non zero canvas before saving anything.
2024-02-16 10:51:36 +02:00
Jesse Yurkovich
8dce17e2be Merge branch 'blender-v4.1-release' 2024-02-15 23:42:19 -08:00
Jesse Yurkovich
c8f2a5cc42 UI: Fix FILE_PT_operator drawing when using UI layout panels
The `FILE_PT_operator` panel used in the file browser does not correctly
allow the new UI layout panels to be drawn correctly.

The layout panels depend on drawing the background so that different
colors can denote each panel section. In the case of `FILE_PT_operator`,
this background drawing is skipped entirely leading to a situation where
there's no panel delineation at all.

Forcing the background to be drawn leads to a second problem where
the "typical" panel colors are not used in this part of the file
browser. We need to match the surrounding area otherwise a much
lighter shade of gray will be used and look out of place.

The fix is to extend the processing for PANEL_TYPE_NO_HEADER to account
for both of the above situations.

Pull Request: https://projects.blender.org/blender/blender/pulls/118231
2024-02-16 08:40:32 +01:00
Omar Emara
e7ffe74920 Realtime Compositor: Support canceling evaluation
This patch adds support for canceling compositor evaluations for the
realtime compositor. Only the canceling of the Denoise operation is
supported for now. That's because inter-operation canceling is not
feasible since all work will have been submitted to the GPU driver
before the user is able to cancel. So some kind of blocking operations
would need to used to actually allow canceling, which is not something
we are going to investigate as part of this patch.

Pull Request: https://projects.blender.org/blender/blender/pulls/117725
2024-02-16 08:32:03 +01:00