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>
This was the last use of `CustomDataAttributes`. It's not very useful
nowadays because we have a lower level (`CustomData`) and higher level
(`AttributeAccessor`) API.
As part of this I removed the ability to `reserve` instances which was
useful when adding instances one by one. Generally, such code should
eventually be rewritten to handle more instances at once, instead of
handling them one by one. This will lead to better performance and
is more in line with how other geometry types (like mesh) are handled.
This also adds the ability to move and assign `Instances` just like we can
move and assign `CurvesGeometry`.
The experimental GPU compositor is leaking memory in any setup.
This is because the current implementation of the render texture pool
always created a new texture and only freed the textures upon deletion.
This was a temporary implementation until a proper implementation that
uses the DRW textures pool was used.
This patch implements a small texture pool as a temporary fix until the
aforementioned DRW texture pool implementation is done.
The code is already replacing instances when needed (when there was no
instances previously created in the file). To do it regardless may lead
to remove instances from the loop.
The other related nodes did not have that issue:
* Curve to Points
* Curve Fill
This was caused by spatial denoising pass sampling invalid data.
This patch make it so that there is one padding tile all
around the denoise area.
This simplifies the denoise shader too.
This is a bit wasteful to dispatch tracing tiles for clearing
and a better solution would be to use a separate shader and
tile list only for this purpose.
Before bd00324c26, strip lengths were changed in
`rna_NlaStrip_frame_start_ui_set` and `rna_NlaStrip_frame_end_ui_set`
so as not to be shorter than NLASTRIP_MIN_LEN_THRESH.
This prevented `BKE_nlameta_flush_transforms` from working with
zero-length strips.
But now, in some cases, strip can be zero length.
Therefore, consider this case and avoid division by zero.
Pull Request: https://projects.blender.org/blender/blender/pulls/110121
`CustomDataAttributes` does not serve much of a purpose nowadays,
since we usually use either the lower level `CustomData` or the higher
level `AttributeAccessor` interface.
In switch-case structure, `PROP_NEVER_NULL` is already set
for String properties. However, the code setting `PROP_EDITABLE`
below was overwriting the flag. Then `PROP_NEVER_NULL` had
to be set for a second time.
Fixed by using proper API function to set these flags, and removed
the redundant second flag setting.
Pull Request: https://projects.blender.org/blender/blender/pulls/113739
`Vertex Crease`, like `Edge Crease`, is not supposed to use transform
symmetry.
So remove it.
(`Skin Resize` remains using symmetry since that case seems desirable.
See #84376)
When searching for a new node by dragging from a socket, some results
were untranslated. This is because they did not use a translation
context matching other occurrences, from which the strings were
extracted to the translation files.
Three nodes using operations were affected: Mix and Vector Math.
- Vector Math used the default context when it should have used
NodeTree.
- Mix and Mix RGB used NodeTree when they should have used the default
context.
Pull Request: https://projects.blender.org/blender/blender/pulls/113485
Send notifiers to redraw dopesheet when keyframe is inserted/deleted.
Change default duration (and soft/hard min) to 0 for inserting
keyframe. This unnecessarily adds extra keyframe.
Pull Request: https://projects.blender.org/blender/blender/pulls/113765
Incorporated the cleanup and tweaks from Hans Goudey to return CurvesGeometry directly.
Part of #113602.
Co-authored-by: Hans Goudey <hans@blender.org>
Ref !113721
When clicking or dragging a Panel's drag handle, a PANEL_STATE_DRAG
state transition is followed immediately by a PANEL_STATE_ANIMATE
transition. Both transitions start a timer.
Unfortunately, a subtle change introduced in
f3ab698951 meant the first timer would no
longer be destroyed before starting the second one.
The fix is to just reuse the timer if it's already present so that a
second one is not created in the first place.
Pull Request: https://projects.blender.org/blender/blender/pulls/113711
This helps solving the problem encountered in #113553. The problem is that we
currently can't support link-drag-search for nodes which have a dynamic declaration.
With this patch, there is only a single `declare` function per node type, instead of
the separate `declare` and `declare_dynamic` functions. The new `declare` function
has access to the node and tree. However, both are allowed to be null. The final
node declaration has a flag for whether it depends on the node context or not.
Nodes that previously had a dynamic declaration should now create as much of
the declaration as possible that does not depend on the node. This allows code
like for link-drag-search to take those sockets into account even if the other
sockets are dynamic.
For node declarations that have dynamic types (e.g. Switch node), we can also
add extra information to the static node declaration, like the identifier of the socket
with the dynamic type. This is not part of this patch though.
I can think of two main alternatives to the approach implemented here:
* Define two separate functions for dynamic nodes. One that creates the "static
declaration" without node context, and on that creates the actual declaration with
node context.
* Have a single declare function that generates "build instructions" for the actual
node declaration. So instead of building the final declaration directly, one can for
example add a socket whose type depends on a specific rna path in the node.
The actual node declaration is then automatically generated based on the build
instructions. This becomes quite a bit more tricky with dynamic amounts of sockets
and introduces another indirection between declarations and what sockets the node
actually has.
I found the approach implemented in this patch to lead to the least amount of
boilerplate (doesn't require a seperate "build instructions" data structure) and code
duplication (socket properties are still only defined in one place). At the same time,
it offers more flexibility to how nodes can be dynamic.
Pull Request: https://projects.blender.org/blender/blender/pulls/113742
The menu structure currently needs to be duplicated in the code to avoid
adding assets to more than one menu. This was done for geometry nodes
in b49c84276c but was missed for the compositor and shader
nodes. Also remove an unnecessary separator.
With #113707 text cursor position is set using the character's visible
bounds, so special care is needed for those without bounds like space.
Forgot this also applies to 4.0.