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).
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.
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
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
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
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
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
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.
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
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
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
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
- 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>