Commit Graph

133035 Commits

Author SHA1 Message Date
Julian Eisel
f15ad836e6 Revert "Improve wording"
This reverts commit 0e7c2bac14.

Didn't intend to push this to the main branch, and didn't notice it was
still on there when pushing.
2024-02-16 16:39:54 +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
Julian Eisel
0e7c2bac14 Improve wording 2024-02-16 16:38:14 +01:00
Julian Eisel
439c8b62c3 Experiment: Add release notes PR link field to pull request template 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
Campbell Barton
8cfcd64185 WM: add WM_drag_get_string{_firstline} accessor functions
Add utility functions to access the drag string with an "_firstline()"
to avoid having to in-line first line access.
2024-02-16 16:34:10 +11:00
Campbell Barton
64843cb12d UI: support dropping text into the text editor & Python console
The Python console only supports dropping a single line of text,
see code-comments for details.
2024-02-16 14:27:06 +11:00
Campbell Barton
9eadae51fc WM: support events that drop strings
Previously only dropping file-paths was supported by the WM logic,
even though GHOST supported strings.

This is used for dropping a text selection as well as URL's
(on X11 & Wayland).

Add WM_DRAG_STRING, created from GHOST's GHOST_kDragnDropTypeString.
2024-02-16 14:27:02 +11:00
Campbell Barton
07ff3bcb70 GHOST/Wayland: support dropping text
This matches X11's support for GHOST_kDragnDropTypeString.

Dropping URL's from a web-browser uses this mime-type.
2024-02-16 14:27:00 +11:00
Campbell Barton
82c753a940 GHOST/Wayland: drag & drop cleanup, minor changes
- Don't generate a drop event when the drop data failed to read.
- Remove redundant drop-buffer duplication.
2024-02-16 14:26:58 +11:00
Campbell Barton
eafecb2bc3 Cleanup: remove unused WM_DRAG_VALUE 2024-02-16 14:26:56 +11:00
Campbell Barton
23a8ba3cd3 Cleanup: remove blenfont library linking from blenloader
This was only needed for tests.
2024-02-16 14:26:54 +11:00
Campbell Barton
adaf791dd7 Cleanup: remove unused struct members in uiHandleButtonData 2024-02-16 14:26:53 +11:00
Campbell Barton
5ae0b0c7f4 Cleanup: use the term "sincos" in convexhull_2d for clarity
The 2D vector calculated from edge vectors represents sin & cos which
wasn't obvious.
2024-02-16 14:26:51 +11:00
Campbell Barton
503d56e2c8 Cleanup: use const variables in convexhull_2d_sorted for clarity 2024-02-16 14:26:49 +11:00
Campbell Barton
37475d252f Cleanup: use "use_" prefix for RNA boolean 2024-02-16 14:26:47 +11:00
Campbell Barton
7582b15c4c Cleanup: spelling in comments 2024-02-16 14:26:46 +11:00
Campbell Barton
9992718703 Cleanup: restore macro to avoid repetition for swapping values 2024-02-16 14:26:45 +11:00
Jesse Yurkovich
551b846bcd Merge branch 'blender-v4.1-release' 2024-02-15 16:55:12 -08:00
Jesse Yurkovich
9e8bbc1129 Fix: USD hooks leak
If hooks are not unregistered Blender will report a leak on exit.

Store the hooks as unique_ptrs to remove manual memory management and
encapsulate the previous global list inside a function. These changes
ensure that everything is cleaned up on termination.

Also makes a small change to the hook documentation for a missing
`import` statement.

Pull Request: https://projects.blender.org/blender/blender/pulls/118294
2024-02-16 01:53:33 +01:00
Jacques Lucke
d803b6acca Cleanup: simplify usage of Map 2024-02-15 22:51:18 +01:00
Jacques Lucke
d9d9ff1dcd Nodes: hide shader input in node properties panel
This was missing in d27a1c47fa.
2024-02-15 21:55:53 +01:00
Jacques Lucke
f727ec95b7 Cleanup: typo 2024-02-15 21:49:27 +01:00
Jacques Lucke
75e9056cac Geometry Nodes: support group ids in Sample Nearest Surface node
This adds group ids to the `Sample Nearest Surface` node. This allows e.g. finding
the closest point on a specific mesh island.

Three new sockets are added:
* `Group ID`: Is evaluated on the face domain and splits the input mesh into  multiple
  parts, each with its own id.
* `Sample Group ID`: Determines in which group the closest nearest surface is detected.
* `Is Valid`: Outputs true if a nearest surface was found, it's false if the group is empty.

Pull Request: https://projects.blender.org/blender/blender/pulls/118150
2024-02-15 20:35:02 +01:00
Bastien Montagne
0801fcd6b3 Cleanup: make format 2024-02-15 19:49:58 +01:00