Commit Graph

129560 Commits

Author SHA1 Message Date
Germano Cavalcante 6bbad6c428 Fix #113801: "Snap to Same Target" don't work as expected
Introduced during snap code refactoring.

It seemed wrong to overwrite the calculated nearest distance based only
on the original distance.

But this is intentional, (the code could be improved since there are
unnecessary tests to detect the closest object).
2023-10-17 14:31:49 -03:00
Falk David ed124d23d1 Fix: GPv3: Crash when storing deformed points
The issue was that the optional array was not correctly initialized.

Ref !113858
2023-10-17 19:29:52 +02:00
Dalai Felinto c5ed37a5c0 GPv3: Replace Material node
Note: At the moment the node only supports non-Grease Pencil materials.

But if the material socket is connected to the modifier a Grease Pencil
material can be used.

Part of #113602.

Co-authored-by: Hans Goudey <hans@blender.org>
Ref !113818.
2023-10-17 18:51:47 +02:00
Falk David 78cb2776bb Fix #113740: Crash adding layer into empty group
This crash was cause by some mismatch in the indices.
We need to make sure to clamp the insertion index to the size of the
span of the layers.

Pull Request: https://projects.blender.org/blender/blender/pulls/113852
2023-10-17 18:34:42 +02:00
Dalai Felinto f54d5df2fc GPv3: Fillet Curve node
Part of #113602.

Pull Request: https://projects.blender.org/blender/blender/pulls/113850
2023-10-17 18:30:38 +02:00
Hans Goudey e1fd7a8a7b Cleanup: Simplify grease pencil line overlay size counting
Avoid the need to iterate over every curve, and only iterate over the
cyclic attribute if it exists. This removes the check that avoided
creating cyclic segments for curves with only two points. If that
was necessary, some of the complexity would return, but the
new `array_utils` function wouldn't be necessary.

Pull Request: https://projects.blender.org/blender/blender/pulls/113814
2023-10-17 18:29:17 +02:00
Falk David 48e60dcbff Fix: GPv3: Compile error 2023-10-17 17:13:13 +02:00
Falk David 07749b389d GPv3: Convert radius to blender units
Previously, Grease Pencil used a radius convention where
1 "px" = 0.001 units. This "px" was the brush size which would be
stored in the stroke thickness and then scaled by the point pressure
factor. Finally, the render engine would divide this thickness value by
2000 (we're going from a thickness to a radius, hence the factor of
two) to convert back into blender units.

Store the radius now directly in blender units. This makes it
consistent with how hair curves handle the radius.

* Removes the scaling in the render engine.
* Makes sure the grease pencil primitives use the correct radii
* Changes the drawing tool to work with screen space radius
* Draws the drawing tool cursor in screen space
* Makes sure the scaling is done when converting from legacy
grease pencil objects
* Makes sure the scaling is done when loading previous files

Consequences for the draw tool:
* Since the tool has a radius input in pixels, it now works in screen space. This is a pretty big change to how it works by default before, so a new option will have to be added that allows the brush to be in "Scene" space. This is similar to how it works in sculpt mode. But this is a bigger change, so I would like to split that into a separate PR.

Pull Request: https://projects.blender.org/blender/blender/pulls/113770
2023-10-17 17:00:35 +02:00
Germano Cavalcante 5139a3a09f Merge branch 'blender-v4.0-release' into main 2023-10-17 11:46:45 -03:00
Germano Cavalcante 6ecef4d176 Fix crash when Transform Extend multiple NLA strips
`tdn` was being incremented even though it wasn't used, which led to
changes in memory outside the HEAP limits.
2023-10-17 11:46:10 -03:00
Miguel Pozo 6f125661e6 GPU: Add Texture::debug_clear
Clear uninitialized textures to NaN/debug values.
Enabled for `--debug-gpu` only.

Pull Request: https://projects.blender.org/blender/blender/pulls/113781
2023-10-17 15:54:09 +02:00
Miguel Pozo 25c2b17266 Merge branch 'blender-v4.0-release' 2023-10-17 15:46:32 +02:00
Miguel Pozo 405a618d88 Cleanup: Workbench: Remove no longer used properties 2023-10-17 15:45:59 +02:00
Falk David f59827de74 GPv3: Add API to copy and add a layer
This adds a core API to add a new layer by copying a source layer.
2023-10-17 15:41:50 +02:00
Jeroen Bakker 79cbeae939 Vulkan: Incorrect Node Socket Drawing
When drawing node sockets an immediate mode buffer is created that can
contain all the node sockets of the node. Only visible node sockets will
then be added. Vulkan assumed that all elements in the buffer needed to
be drawn, resulting using uninitialzed memory for drawing node sockets.

This resulted in very colorful and big artifacts rendered in the node
editor. This was detected during drawing of node sockets, but would have
been visible in other places as well.

Pull Request: https://projects.blender.org/blender/blender/pulls/113830
2023-10-17 13:45:14 +02:00
Jeroen Bakker da2e951512 Cleanup: Make format 2023-10-17 12:45:19 +02:00
Pratik Borhade fd192188cd Merge branch 'blender-v4.0-release' 2023-10-17 16:11:30 +05:30
Pratik Borhade 8867cfc563 Fix #113778: Skip unlinking a linked collection if parent is linked
Similar to 197f3d75d1, do not unlink a linked collection from a linked parent

Pull Request: https://projects.blender.org/blender/blender/pulls/113805
2023-10-17 12:39:01 +02:00
Hans Goudey 31ec00895f Curves: Add edit mode operator to set attribute values
Similar to #104426, this adds a simple operator to set attribute values
for curves edit mode. The operator is very basic and is only meant to
be a first step for more attribute editing features. Some of the
functionality could be achieved with node tools, but without dynamic
socket types or access to the active attribute, it would be incomplete.

Some of the RNA property registration, retrieval, and setting is reused
from the mesh edit mode operator. The rest of the logic is similar but
harder to de-duplicate.

Pull Request: https://projects.blender.org/blender/blender/pulls/105076
2023-10-17 12:35:40 +02:00
Omar Emara edfa6f3235 Fix: Texture pool resources are freed in wrong context 2023-10-17 13:00:25 +03:00
Christoph Lendenfeld dcca6c2b8c Refactor: Remove nla_cache parameter from insert_keyframe
No functional changes.

The parameter was only passed in as `nullptr` or
as empty list that was immediately freed after without use.

Pull Request: https://projects.blender.org/blender/blender/pulls/113817
2023-10-17 11:48:29 +02:00
Peng Yan f401970b42 Cleanup: use function calls to set flags for PropertyRNA
Changes include:

1. Replace `prop->flag |= PROP_xxx` with
    `RNA_def_property_flag(prop, PROP_xxx)`,
    use `RNA_def_property_clear_flag` to unset
2. Replace `srna->flag |= STRUCT_xxx` with
    `RNA_def_struct_flag(srna, STRUCT_xxx)`,
    use `RNA_def_struct_clear_flag` to unset
3. Replace `func->flag |= FUNC_xxx` with
    `RNA_def_func_flag(func, FUNC_xxx)`
4. Replace `prop->flag_override |= PROPOVERRIDE_xxx` with
    `RNA_def_func_override_flag(prop, PROPOVERRIDE_xxx`

Not changed:

1. Code setting PropertyRNA's `flag_internal` field.
    `PropertyFlagIntern` is defined in rna_internal_types.h, while
    other flags for PropertyRNA are all defined in RNA_types.hh.
    I've tried to define similar flag setting functions for `flag_internal`
    (see my commit 5036bd650c in the PR), but build fails with syntax
    error. I'm not quite clear about dependencies between the files,
    so I keep this part unchanged.

Pull Request: https://projects.blender.org/blender/blender/pulls/113807
2023-10-17 11:47:40 +02:00
Campbell Barton 6b0769c448 Merge branch 'blender-v4.0-release' 2023-10-17 20:01:00 +11:00
Campbell Barton e21dfb4c42 Correct comment in 5ac392ca40 2023-10-17 19:59:58 +11:00
Campbell Barton 5ac392ca40 Fix #102300: SSL/HTTPS Request Unable to Get Local Issuer Certificate
Resolve an error with SSL using a hard coded path to certificates on
Linux causing HTTPS access to fail.
request.urlopen(..) couldn't access any HTTPS URL's.
2023-10-17 19:58:34 +11:00
Falk David b164ce0cbf Refactor: Return `ViewContext` by value
This makes `ED_view3d_viewcontext_init` return the `ViewContext` by value instead of writing to a pointer.
No functional changes expected.

Pull Request: https://projects.blender.org/blender/blender/pulls/113761
2023-10-17 10:34:59 +02:00
Hans Goudey a1f3c2ef58 Merge branch 'blender-v4.0-release' 2023-10-17 10:34:25 +02:00
Hans Goudey d7e501ce3b Fix #112448: Leading deform modifiers skip adding original coordinates
Previously the first group of deform modifiers didn't need to access
original coordinates explicitly because the deformation wasn't included
in the mesh positions. After d20f992322 the mesh is deformed
directly though, so the original coordinates need to be added first.

In the case of this report, the particle system (which is a "deform"
modifier for reasons) didn't have original coordinates to work with, so
it created the child particles at the deformed positions from the shape
keys every time. Though for some reason it only did that for renders.

Pull Request: https://projects.blender.org/blender/blender/pulls/113679
2023-10-17 10:28:19 +02:00
Hans Goudey 30d66a4eaf Merge branch 'blender-v4.0-release' 2023-10-17 09:56:58 +02:00
Hans Goudey bd4c310a19 Fix: Missing edge domain in node tool set selection node
This wasn't implemented in the initial commit because we didn't have
a function to flush edge selections to vertices and faces. But using the
existing domain interpolations makes that trivial, so it may as well be
added now to avoid the arbitrary limitation from the user perspective.

See https://devtalk.blender.org/t/node-tools-feedback/31388/5

Pull Request: https://projects.blender.org/blender/blender/pulls/113367
2023-10-17 09:56:24 +02:00
Hans Goudey 4ae4e25dc2 Merge branch 'blender-v4.0-release' 2023-10-17 09:25:51 +02:00
Hans Goudey 3d236bc858 Mesh: Add operator to select elements based on boolean attribute
Adds a "Select by Attribute" operator as mentioned in the discussion in
#105317. This is done in 4.0 to limit the breaking aspect of the removal
of face maps. The selection storage functionality is replaced by boolean
attributes. We already have a way to control the data in the boolean
attribute with the "Set Attribute" operator, but we didn't have a way to
convert the attribute into a selection.

This operator works on the active attribute if is a boolean attribute
and isn't on the face corner domain. It adds to the existing selection
similar to other existing operators.

While this behavior can be recreated as a node tool, we add it as a
builtin operator here to avoid limitations of the new node-based
tool system and to make the late-in-the-release-cycle change safer.

Pull Request: https://projects.blender.org/blender/blender/pulls/113772
2023-10-17 09:24:51 +02:00
Hans Goudey 820f0c24c4 Mesh: Add versioning to convert old face maps to boolean attributes
See #105317

In 46cf093270, face maps were just converted to an integer
attribute. While the internal data remains the same that way, we lose
the names and some convenient methods of interaction. This commit
additionally converts each face map to a separate boolean attribute
using the old name. This does require that no attributes were using that
name already.

Each boolean attribute can be thought of as a selection, accessible in
geometry nodes and properly interpolated by mesh processing
algorithms. The selections no longer have to be unique, meaning
one face can be part of multiple selections.

Pull Request: https://projects.blender.org/blender/blender/pulls/113769
2023-10-17 09:17:07 +02:00
Campbell Barton a89686240e Build: unbreak WITH_UNITY_BUILD=OFF 2023-10-17 16:11:04 +11:00
Campbell Barton 768dedbe5a Cleanup: reserve 'mval' for region-relative pointer coordinates 2023-10-17 12:57:00 +11:00
Germano Cavalcante f20e38d422 Merge branch 'blender-v4.0-release' into main 2023-10-16 17:26:32 -03:00
Germano Cavalcante bbf87ee78c Fix #113786: Snapping to vertex is broken, when instances are used in GN
Missed in ff4f14b21.

For GN instances, we should use `DupliObject::ob_data`.
2023-10-16 17:26:02 -03:00
Dalai Felinto dd8d3ec27b GPv3: Convex Hull node
We create one convex hull per layer, following what we do for instances.

This is covered as part of the design in #113602, and as such not
commented on the code itself.

Part of #113602.

Pull Request: https://projects.blender.org/blender/blender/pulls/113788
2023-10-16 22:16:34 +02:00
Brecht Van Lommel 4fe903bef7 Merge branch 'blender-v4.0-release' into main 2023-10-16 20:10:09 +02:00
Brecht Van Lommel 0c958129a3 Fix deps build issues with Ogg/Vorbis on new Xcode, switch to CMake
These were already building with CMake on Windows, do the same for
Linux on macOS.
2023-10-16 20:09:41 +02:00
Brecht Van Lommel 4a376326c9 Fix OpenImageIO wrong dependency builder hash after repository moved
And update to new URL.
2023-10-16 20:09:41 +02:00
Hans Goudey 57c27b47b9 Cleanup: Avoid unnecessary check for empty curves
In `CurvesGeometry`, curves should never be empty. We shouldn't have
to check for that in the drawing code.
2023-10-16 19:51:12 +02:00
Hans Goudey 2528b6da9b Cleanup: Use const in grease pencil drawing code 2023-10-16 19:51:12 +02:00
Iliya Katueshenock fb57767f78 Cleanup: simplify extracting GField from geometry nodes parameters
Pull Request: https://projects.blender.org/blender/blender/pulls/113743
2023-10-16 19:19:53 +02:00
Harley Acheson d0e6f894fe Merge branch 'blender-v4.0-release' 2023-10-16 10:18:41 -07:00
Harley Acheson ffe980afad Fix #113766: Incorrect Cursor With Offset Position
Next character left edge position incorrect when string has
an offset positioning (scrolled within the input box).

Pull Request: https://projects.blender.org/blender/blender/pulls/113784
2023-10-16 19:17:28 +02:00
Jacques Lucke 006380aaca Cleanup: deduplicate field socket type check 2023-10-16 19:13:27 +02:00
Sergey Sharybin f8ee27c88b Sculpt: Preserve edge attribute on split with dyntopo
Copy custom data and flag from the original edge to the ones created
from it when splitting a long edge.

Unfortunately, can not use generic "example" edge approach as there
is a temporary flag BM_ELEM_TAG is re-applied in a loop: the new
edges can not be tagged with this tag. Additional complication is
that even we clear this tag from the input edge before splitting it
this tag is re=applied via long_edge_queue_face_add().

Hence, use our own simple function to copy minimal subset of data and
tags.

Co-Authored-By: Hans Goudey <hans@blender.org>

Pull Request: https://projects.blender.org/blender/blender/pulls/113783
2023-10-16 19:12:10 +02:00
Sergey Sharybin a19a36c631 Cleanup: More proper C++ usage in PBVH edge split
- More consistent naming of variables in diagram and code.
- Use C++ array and span, and make them short-lived, without
  trying to reuse them.

Co-Authored-By: Hans Goudey <hans@blender.org>
2023-10-16 19:12:08 +02:00
Sergey Sharybin 529392bb2c Cleanup: Const-correctness in bmesh code
Only handful of functions which are needed for the PBVH edge split.

Co-Authored-By: Hans Goudey <hans@blender.org>
2023-10-16 19:12:08 +02:00