This adds the `viewlayername` property to grease pencil v3 layers.
It's exposed as `viewlayer_render` in python.
Note: this is not used in the renderer yet. Will be used in a following PR.
Pull Request: https://projects.blender.org/blender/blender/pulls/119422
The current font style can be overridden with a input or other widget text style,
this change ensures that the right font style is set so `BLF_width` don't use a
overridden font text style.
Pull Request: https://projects.blender.org/blender/blender/pulls/119442
- Remove the unnecessary `ContainerValue` from the class hierarchy
- Construct `StringValue` with a `std::string` by value to avoid copies
- Remove some indirection by using type names directly instead of aliases
- Use utility methods to lookup/append specific data types for arrays/dicts
- Simplify conversion from unique_ptr to shared_ptr
- Avoid use of `new` and `delete`
- Avoid creating maps of all elements in vector for a single lookup
The `AssetEntryReader` and `AssetEntryWriter` classes were only used
once and just added indirection hiding the actual logic of reading and writing
asset metadata from the index. It also hid double map lookups and extra
string copies/allocations.
Changes:
- Add Vert Slide and Edge Slide to 'UV -> Transform' menu.
- Add a separator for Vert Slide and Edge Slide in the context menu.
- Don't display the "Correct UVs" option in the Redo menu of UV Editor.
It's typically only worth specifying specific captures when the lambda
is stored as a function object for use later. Since this is just passed
as a FunctionRef as an iteration callback, we can use a less complex
capture here. That also helps clarify that this isn't a callback.
Caused by dd0e60fb51
That commit was an optimization attempt to reuse the depth buffer
updated by the engines.
But it fails when `GPU_clear_depth` is called for gizmos.
So, due to error proneness, revert that solution for now.
It's possible for an object to be in edit mode without being selected. Use the
`FOREACH_OBJECT_IN_MODE_BEGIN` iterator to find all objects in the mode instead.
Pull Request: https://projects.blender.org/blender/blender/pulls/119412
EEVEE-Next performes less on integrated GPUs then discrete GPUs.
Most shaders have been analyzed, but there will always be bottlenecks
related to architectural differences.
In order to make EEVEE-Next run smooth on integrated GPUs this change
will implement viewport pixel size option similar to Cycles. The main difference
is that the samples will still be weighted and up-sampled to the final film
resolution. This makes the pixels not look squared in the viewport but will
resolve to something close to the results without up-scaling.
This improves the performance especially on integrated GPUs. The improvement
for discrete GPUs are less noticeable. See here the stats when playing
`rain_restaurant.blend` back on a RAPHAEL_MENDOCINO iGPU.
| Pixel size | Frames per second |
|------------|-------------------|
| 1x | 0.25 FPS |
| 2x | 4.14 FPS |
| 4x | 6.90 FPS |
| 8x | 9.95 FPS |
Related to: #114597
See PR for some example images.
Pull Request: https://projects.blender.org/blender/blender/pulls/118903
When bone collection is moved to root collection by drag-drop,
visibility of dropped collection is lost. This is due to missing flags
for the root bone collection which cleared `BONE_COLLECTION_ANCESTORS_VISIBLE`
flag of dropped bcol.
Pull Request: https://projects.blender.org/blender/blender/pulls/119366
We recently added a new "Internet" icon, meant to represent internet
services and protocols generally, in contrast with the existing "url"
icon which can be seen as being http (web link) specifically. This
PR just uses this icon for cloud storage uses and for remote extension
repository.
Pull Request: https://projects.blender.org/blender/blender/pulls/119409
Add an icon called INTERNET that looks like our current URL without the
mouse cursor, so it looks less specifically like a web document. So can
be used to represent other internet and cloud-based services.
Pull Request: https://projects.blender.org/blender/blender/pulls/119186
Small operator confirmations get separate confirm and cancel buttons,
better descriptions and configurable confirm button text. But still
popup at cursor location and can be cancelled with mouse movement.
Pull Request: https://projects.blender.org/blender/blender/pulls/118346
The Weighted Normal modifier has a "Keep Sharp" option that used to
recalculate the sharp edge tags based on the mesh's smoothing angle.
To keep the same behavior, an auto smooth versioning modifier has to
be added before that modifier when the option is on.
Pull Request: https://projects.blender.org/blender/blender/pulls/119400
This PR extracts the `SCULPT_OT_project_line_gesture` operator into its
own file and namespace out of the `paint_mask.cc` file and
`blender::ed::sculpt_paint::mask` namespace.
Pull Request: https://projects.blender.org/blender/blender/pulls/119394
This PR moves the `SCULPT_OT_face_set_lasso_gesture` and
`SCULPT_OT_face_set_box_gesture` operator out of the `paint_mask.cc`
file and `blender::ed::sculpt_paint::mask` namespace to
`sculpt_face_set.cc` and `blender::ed::sculpt_paint::face_set`.
Pull Request: https://projects.blender.org/blender/blender/pulls/119392
This PR extracts the `SCULPT_OT_trim_box_gesture` and
`SCULPT_OT_trim_lasso_gesture` into a separate file and
namespace from `blender::ed::sculpt_paint::mask`.
Pull Request: https://projects.blender.org/blender/blender/pulls/119390
I ran into this issue a while ago too, where the vertex iteration
macro didn't process all of the vertices. I didn't figure it out yet,
but it makes more sense in the context of the surrounding code
to specialize this anyway.
The issue was that the clamping to the bounds happened before the rounding to the increment step.
In the reported case this led to a divide by 0 error.
The fix is to do the increment first, then the clamp to bounds.
This was reported by Raymond Luc on #117287
Pull Request: https://projects.blender.org/blender/blender/pulls/119367
Unfortunately the only versioning code that can "properly" add data-
blocks is not run when linking or appending (`do_versions_after_setup`
has details). The versioning has to be done manually for this case.
Fortunately that is simple since the versioning function already just
operators on a main database.
This could happen if objects were hidden after going to editmode and
knife was used on them.
In that case, raycasting would (rightfully) fail, but there is a
fallback in place using the back-buffer selection method (in which the
hidden object is still present). So a face would be found, but this
makes all following code confusing/wrong since we are working with
coordinates / faces under the assumption there would be a valid/
corresponding object to it in `KnifeTool_OpData` > `objects` -- which is
not the case...
So to resolve, just check if the object is visible before calling
`EDBM_face_find_nearest` in knife code.
Alternativeliy, we could also add a check for Base viewport visibility
to all the bmesh `find_nearest` functions (a bit hesitant though since i
am not sure this would be desired in all cases)
Pull Request: https://projects.blender.org/blender/blender/pulls/119383
Fix of error introduced in c31718649d. Attribute names will
be freed on domain resizing. This mean, ref-names which is attribute
ids is will be invalid. To avoid this, make sure names will be gathered
only after resize. To avoid unnecessary topology map computation before
mesh resize, check if attributes on required domain exists, instead
of gathering them and check if span is not empty.
Pull Request: https://projects.blender.org/blender/blender/pulls/119242
With some data-type conversions we can do a best-effort conversion of
UI data like default values and min and max to the new data type.
This can help to make Python scripts simpler and to avoid bugs like
#105965.
Pull Request: https://projects.blender.org/blender/blender/pulls/106161
Added a null check for RE_GetRenderLayer() which could possibly return
null and then stored in `render_layer`, in order to prevent members of
`render_layer` being accessed in RE_pass_find_by_name(), and thus solved
the segmentation fault.
Pull Request: https://projects.blender.org/blender/blender/pulls/119200
The core of the issue was that `sculpt_flag` was used by three different enums (`eGP_Sculpt_Flag`, `eGP_Sculpt_Mode_Flag`, and `eBrushFlags`). This resulted in the flag getting overriden because `ENUM_OPERATORS` expected the maximum value of `eGP_Sculpt_Flag` to be `(1 << 3)` which it wasn't.
The `sculpt_flag` was exposed through python as `"direction"`.
In the UI this meant that it was effectively used as `brush.direction`. This fix replaces `brush.gpencil_settings.direction` with `brush.direction`.
It also makes sure `sculpt_flag` is only ever used with values from `eGP_Sculpt_Flag`.
Pull Request: https://projects.blender.org/blender/blender/pulls/119373
This commit adds the `SCULPT_OT_hide_show_lasso_gesture` and the
corresponding Lasso Hide tool.
* Exposes the selection type for both the lasso and box hide tools
as a option in the header
* Adds functionality into `sculpt_gesture.cc` for handling lasso
selections with the `Outside` selection type
For `SelectionType::Outside`, the current implementation opts to not
do any filtering on the PBVH node level due to cases where the node
is mostly covered by a single gesture.
Addresses one of the tools in #80390
Pull Request: https://projects.blender.org/blender/blender/pulls/119140
The regression happened because object instances were turned into normal geometry
instances which don't have object-level visibility settings. Long term, this may not be
something we can support, but it's also not something we should break unnecessarily
and accidentally.
Pull Request: https://projects.blender.org/blender/blender/pulls/119370
I think the issue is that the run-node-group operator overwrites the data stored in the
`Mesh` while mesh edit mode operations typically only change the `BMEditMesh`. It
seems like that causes issues because the mesh edit mode undo stack does not
keep track of changes to the `Mesh`. When hitting undo, Blender assumes that the
`Mesh` stored in the object has not changed and therefore it does not have to be
read from the undo step again.
The preliminary fix implemented here is to just not change the `Mesh` but only the
`BMEditMesh` like any other edit mode operator. This seems to solve the issue.
I haven't quite figured out yet how to tell the undo system that the `Mesh` has to be
loaded from the undo step when undoing out of mesh edit mode. Doing that might
provide a better solution.
Pull Request: https://projects.blender.org/blender/blender/pulls/119015
The function didn't return early in case the domain was empty.
The fix makes sure we return an empty `MutableSpan` in this case
(add doesn't try to create a new custom data layer).
Python's behavior changed since this feature was added causing the
object to be tracked when freed by Python's subtype_dealloc even
if Blender has not tracked the data. Detect this case and untrack
the object before freeing.
Lines in the history never change, each input line is added to the
end (unless it is a duplicate of the last item).
A new history_index member keeps track of where the up/down arrows have
moved in the history.
Preserved the previous down-arrow behavior of going to the item after
the one that was copied, this is useful in Python for re-entering a
multi-line block.
Ref !119356
This is a improved solution compared to 20dbcd8814
Caused by 930b11b0fe.
When checking edges that share faces between them, the `find_best_dir`
method cannot use edges that were added in the current loop.
Previously, all information outside the render area did not get considered because transform operations such as translation and rotation might cause the output area to be smaller.
In this patch, the whole image gets flipped regardless of the output area, which makes the behavior consistent with the GPU compositor.
Pull Request: https://projects.blender.org/blender/blender/pulls/119278
Rendering with F12 causes some inconsistencies between canvases and areas of interest. This is due to some corrections of composite node canvas to fit to the render size, which are not necessary for the Viewer Node. This patch fixes the issue by considering the input image as a whole before translating.
Note: this is still consistent with immediate realization of transform nodes in GPU compositor, where nodes are to be evaluated from left to right.
Pull Request: https://projects.blender.org/blender/blender/pulls/119276
Grease Pencil provides custom vertex group attributes as VArrays that
are a view on the `MDeformVert` buffer. These attributes are not spans,
which the curve conversion code was expecting. Non-span VArrays must be
materialized first.
Pull Request: https://projects.blender.org/blender/blender/pulls/119212
There seems to be an integer overflow in OpenVDB code. For now just avoid rendering
the volume when the indices are very large, which is an extreme case anyway.
Pull Request: https://projects.blender.org/blender/blender/pulls/119279
For various reasons, the animation system can't properly update the node tree
so that the socket availability caused by changing node enum properties
propagates completely. So animating node properties that affect
socket visibility to change isn't possible without issues like crashes.
Unfortunately that wasn't disallowed before. In this commit there is
a balance of disabling animation on sockets that could reasonably expected
to affect socket visibility, and minimizing breaking changes.
Pull Request: https://projects.blender.org/blender/blender/pulls/119221
For node tools, I would like to give the option of invoking the operator from the
menu, but waiting for a mouse click for the future "Mouse Position" node. Not
all node tools should do that though, and they all use the same operator type,
so it needs to depend on an operator callback. That's implemented here.
Pull Request: https://projects.blender.org/blender/blender/pulls/118983
Header file is renamed to GEO_mesh_boolean_convert.cc and
files that included it are updated to use that path.
This is in preparation for bigger changes to the internal
boolean API, which make more sense as a "geometry" API
than a kernel API.
Pull Request: https://projects.blender.org/blender/blender/pulls/119336
Use the prior fixed button widths as minimum sizes for the template_ID
new and open buttons. That way they will look the same as before under
most circumstances but will still adjust rather than overflow for
longer content or larger text sizes.
Pull Request: https://projects.blender.org/blender/blender/pulls/119330
As part of #118623, we discovered that the operator used for adding images in the 3D viewport was not the same when drag and dropping as when adding it from the add menu. This lead to different and potentially confusing behaviour for the user when they use both.
This patch removes the python operator and unifies the functionality into one operator. It also renames the operator to be in line with the other "Add X" object operators.
Pull Request: https://projects.blender.org/blender/blender/pulls/118973
The issue was that calling `ensure_geometry_instances` converts all instances to a
geometry, even the ones that can't be converted. The comment already says that
non-geometry instances should stay intact, but that didn't work correctly yet:
```
/**
* If references have a collection or object type, convert them into geometry instances
* recursively. After that, the geometry sets can be edited. There may still be instances of
* other types of they can't be converted to geometry sets.
*/
```
Pull Request: https://projects.blender.org/blender/blender/pulls/119324
This fixes the following name collisions:
* Compositor Box/Ellipse Mask node: `width` -> `mask_width`
(also renamed the `height` property accordingly)
* Shader AOV Output node: `name` -> `aov_name`
* Geometry Color node: `color` -> `value`.
Those are breaking changes unfortunately, because looking up those property
names yielded the node-specific and not the common property. Therefore, this is
targeted at `main` instead of `4.1`.
Pull Request: https://projects.blender.org/blender/blender/pulls/119284
The `execute_eraser_on_drawing` expects the first argument to be the layer index, but the drawing index
was passed to the lamda.
The fix makes sure to pass the active layer index.
Also return early if there is no active layer.
Moving a set of keyframes could cause crashes by setting invalid
`drawing_index` in `GreasePencilFrame` data.
The transform operator for grease pencil keyframes can add and remove
keyframes by overwriting existing frames. The `move_duplicate_frames`
function in particular has to keep track of drawing user counts to
ensure that the drawings referenced by the frames are still alive at the
end.
This was broken when moving multiple keyframes at once, such that later
keyframes would overwrite the target positions for earlier frames (for
example moving frames [1,2,3] to [2,3,4]). The `move_duplicate_frames`
was first removing the source frame and then adding it back at the
destination. In case the source frame was already the destination of an
earlier keyframe, this will cause incorrect user count because the frame
being removed is not the same as the one being added back.
To avoid this problem, remove all the source keyframes first before any
other modification of the destination layer. That way we can be sure the
frames at the source index is actually the expected frame.
Pull Request: https://projects.blender.org/blender/blender/pulls/119207
The shader compilation job assumes it can only be closed on program
exit, leaving all their materials as queued.
However, render tasks can kill it, causing drw_deferred_shader_add to
get stuck in an infinite loop.
Pull Request: https://projects.blender.org/blender/blender/pulls/119172
Sets the newly drawn stroke to be deselected. (matching legacy implementation)
Previously the selection attribute was left uninitialized, and would often be outside of the valid range, causing a crash to occur during some operator.
Pull Request: https://projects.blender.org/blender/blender/pulls/119306
Accessing `__class__` on a removed object raised an exception, making
`isinstance(ob, cls)` unreliable. Always allow class access.
Resolves issue raised by blender/blender-addons!104958.
GPU compositor crashes when the Hue Correct and one of the Curves node
are used together. That's due to a utility function that goes by the
same name in both nodes. To fix this, rename one of them to be more
specific.
If we run into NULL `RegionView3D` `regiondata` [which e.g. happens if
we just set `bpy.context.area.type = 'VIEW_3D'` without further actions
in the text editor prior to calling the transform operator], we can make
it gracefully work just by using `t->spacetype = SPACE_EMPTY` in
`initTransInfo`.
Similar check is already done in ba229e3859 (marked /* running in the
text editor */).
Transform code is smart enough to have fallback code in place that sets
matrices etc.
Pull Request: https://projects.blender.org/blender/blender/pulls/119205
This patch implements the GPU Bloom glare for the CPU compositor, and
adds a new option for it, leaving the Fog Glow option unimplemented once
again for the GPU compositor.
Pull Request: https://projects.blender.org/blender/blender/pulls/119128
Resolves assertion firing when creating an SSBO
from a VBO which is not aligned to 16 bytes.
Required to ensure API validation is satisfied.
Authored by Apple: Michael Parkin-White
Pull Request: https://projects.blender.org/blender/blender/pulls/119298
When restoring a temporary context, account for changes to the context
made by actions (typically operators) in the script.
There was an incorrect assumption that an override which didn't change
the current context would also be unchanged when restoring the temporary
context's original values.
Fixes vertex group data loss after the `Draw Tool`, `Delete`, `Dissolve` operators.
Note: This is not a exhaustive list and there are other operators that will still loss vertex group data.
Pull Request: https://projects.blender.org/blender/blender/pulls/119034
This patch adds special cases to Shader::uniform_int routine
to allow writing of small types (1 bytes, 2 bytes) to the push
constant buffer.
This previously interpreted all incoming push constant data as
integer components only, resulting in rendering artifacts such as
bad SRGB mode selection and shader editor not rendering due
to mis-aligned overlay parameter, as the uniform assignment
would overflow consecutive small types.
Authored by Apple: Michael Parkin-White
Pull Request: https://projects.blender.org/blender/blender/pulls/119285
Reduce dependence on Blender headers as much as possible and move closer
to an include-what-you-use setup.
- Removes unnecessary includes
- Replaces some includes with more appropriate, narrower, substitutes
Pull Request: https://projects.blender.org/blender/blender/pulls/119234