Commit Graph

103962 Commits

Author SHA1 Message Date
Pablo Vazquez
9f2d32c154 UI: Use proper icon for nodes with UV Maps picker
It was set to none, which draws as a dot instead of the already familiar
UV Map icon used in the UV Maps list and other places.

Affects:
* UV Map
* Tangent
* Normal Map

Following !113793 efforts to unify icons.
2023-10-18 12:36:25 +02:00
Falk David
a89bb7632a GPv3: Separate/Delete Geometry node
This implements deleting a selection of layers on a grease pencil geometry.

Pull Request: https://projects.blender.org/blender/blender/pulls/113828
2023-10-18 11:54:56 +02:00
Falk David
080823f93c Fix: GPv3: Memory leak in set_name
The `set_name` function was not freeing the previously
allocated string and would leak the memory.
2023-10-18 11:50:41 +02:00
Hans Goudey
95201c6cbf Merge branch 'blender-v4.0-release' 2023-10-18 11:32:04 +02:00
Hans Goudey
b2fe1bf624 Fix #113824: Setting curves select mode changes active attribute
Currently the active attribute is stored as an index. This should be
changed to a string, but until then, adding or removing an attribute
changes the indeices. The workaround is to store the name and fix
the active attribute after the change.
2023-10-18 11:31:34 +02:00
Falk David
bc0e5cf8bd Cleanup: GPv3: Use helper to duplicate drawings 2023-10-18 11:27:01 +02:00
Falk David
74facf9841 GPv3: Add wrapper class for DrawingReference
Adds a simple C++ wrapper so we don't have to use
`MEM_dupallocN`, `MEM_freeN` etc.
2023-10-18 11:27:01 +02:00
Hans Goudey
b3460a6b2c Merge branch 'blender-v4.0-release' 2023-10-18 11:14:11 +02:00
Hans Goudey
cdae07dccf Fix #113842: Curves Info node length output always zero
Caused by a1cc621e1e. The "is_hair_length" value needs to be
set before `attr_input_name` is called because it uses the value to set
the attribute name with the "l" alias.
2023-10-18 11:13:38 +02:00
Jacques Lucke
5bee6bcedc Geometry Nodes: new Split to Instances node
This node allows splitting up a geometry into groups. A group is defined as all
elements with the same group id. The output contains an instance per group.
The `Group ID` output can be used for further deterministic processing.

The node supports meshes, curves, point clouds and instances. It only works
on the top-level geometry, so it does not go into nested instances because it
also generates new instances.

Co-authored-by: Hans Goudey <hans@blender.org>

Pull Request: https://projects.blender.org/blender/blender/pulls/113083
2023-10-18 10:26:23 +02:00
Jacques Lucke
9c56a19640 Merge branch 'blender-v4.0-release' 2023-10-18 10:18:04 +02:00
Jacques Lucke
969dd7b985 Geometry Nodes: add forward compatibility for map range socket identifiers
Also see 0ea193bdb3.
2023-10-18 10:17:43 +02:00
Jacques Lucke
fa1e65f554 Geometry Nodes: show grease pencil materials in material socket
This is only done when the experimental grease pencil option is
turned on for now.
2023-10-18 10:04:04 +02:00
Jacques Lucke
6e35e30ba8 Merge branch 'blender-v4.0-release' 2023-10-18 09:57:26 +02:00
Jacques Lucke
4f3262a128 Fix: update curve types before using them 2023-10-18 09:56:22 +02:00
Dalai Felinto
9a967d26fd GPv3: Set 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.

Ref !113816.
2023-10-18 08:58:02 +02:00
Richard Antalik
3a230075cc Merge branch 'blender-v4.0-release' 2023-10-18 01:13:26 +02:00
Richard Antalik
01612bacfd Fix #113755: Incorrect speed overlay on retimed strips
Caused by off by 1 error in speed calculation.
2023-10-18 01:11:31 +02:00
Harley Acheson
8b74073383 Merge branch 'blender-v4.0-release' 2023-10-17 15:51:33 -07:00
Harley Acheson
9a3fa4d8cc Fix #113826: Set Explicit Font Size for Overlays
The complaint illustrates how text measurement can be broken by a
drawing callback. This is because overlays are setting global_font_size
value, which is used by subsequent drawing, but does not explicitly set
size on the global_font_default font, which is needed for measurement.

Pull Request: https://projects.blender.org/blender/blender/pulls/113868
2023-10-18 00:50:05 +02:00
Hans Goudey
e84ba67c73 Fix: Material selection node test failure
The actual selection needs to be evaluated on the right domain, not
necessarily the domain from the field context. It's interpolated as
a separate step.

Also reuse the attribute accessor already assigned to a local variable.
2023-10-17 22:46:16 +02:00
Hans Goudey
60e7e89bfa Cleanup: Retrieve virtual array single value in one call 2023-10-17 22:43:38 +02:00
Hans Goudey
4c7fe8b583 Cleanup: Remove unnecessary parentheses in switch cases
Also remove unnececessary checks that can be combined with the switch,
and use `.index_range()` instead of `IndexRange(.size())`.
2023-10-17 22:28:47 +02:00
Dalai Felinto
e773cc2967 GPv3: Set Material Index node
Part of #113602.

Pull Request: https://projects.blender.org/blender/blender/pulls/113821
2023-10-17 20:20:40 +02:00
Germano Cavalcante
6b001ea76c Merge branch 'blender-v4.0-release' into main 2023-10-17 14:53:45 -03:00
Dalai Felinto
42f71c9dca GPv3: Material Selection node
Part of #113602.

Pull Request: https://projects.blender.org/blender/blender/pulls/113827
2023-10-17 19:52:46 +02:00
Germano Cavalcante
934c2c894b Fix 'Snap Mode' versioning
NEAREST and PROJECT were swapped.
2023-10-17 14:52:42 -03:00
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