The `bounds` is `nullopt` when the number of points is 0 at current frame.
The fix uses `value_or()` to make sure we get some bounds.
Also uses `Bounds<float3>` instead of `std::optional<Bounds<float3>>`
in `gpencil_object_cache_add`.
Pull Request: https://projects.blender.org/blender/blender/pulls/119690
Enables operators that uses `WM_operator_props_dialog_popup`
or `redo` popup to use layout panels.
Other popups would likely also support layout panels, only
they need to set its dummy panel with `UI_popup_dummy_panel_set`.
Popups don't normally use `Panel`, but that's the type that stores the
layout panel states. Therefore, to use layout panels in a popup, one
currently needs to create a dummy panel whose purpose is to store the
layout panel states for as long as the popup is open.
Alternatively, we could potentially also store the layout panel states
somewhere else in the future for popups, but that might be a more involved
change for now.
See #119519 for an example script that uses layout panels in a popup.
Pull Request: https://projects.blender.org/blender/blender/pulls/119519
It's not necessary to check for `points.size() >= 3` since the extra
point space is always added thus the point should always be filled with
valid attribute to avoid erroneous "closing stroke".
Pull Request: https://projects.blender.org/blender/blender/pulls/119727
Even though there is a dialog users must accept when removing a
repository & directory being removed is shown, it's possible users
assume this only removes files which are part of the repository after
pointing the custom-directory to their home directory or similar.
Removing repositories which point to a custom-directory now only
remove packages and server meta-data to prevent accidents.
Resolves#119481.
GPv3 uses `OB_MODE_EDIT` so it falsely shows empty mesh data in stats.
This worked in legacy gp because it had special edit_mode type.
To show correct grease pencil data in edit mode, rearrange if conditions and
add special check for `OB_GREASE_PENCIL`
Pull Request: https://projects.blender.org/blender/blender/pulls/119689
When the edit mesh modifier stack first deforms the original edit mesh,
it creates deformed positions in a separate array. That array is copied
to the mesh's vertex positions if a subsequent modifier requires an
actual mesh rather than a mesh wrapper.
However, if that last deform modifier is the last "on cage" modifier
and the next modifier requires a real Mesh, we hit a code path that
didn't copy the temporary position array, since it was contained in the
separate `EditMeshData` struct that must be handled manually.
This was a regression in 91b27ab637. In the future I hope to
make this simpler by expanding the use of implicit sharing and making
the conversion from original BMesh to a Mesh more lazy / const correct.
Pull Request: https://projects.blender.org/blender/blender/pulls/119718
File Browser listings can clip content, remove columns, etc as the
available space narrows. This PR just makes this never happen for
the horizontal display mode, where files are shown in multiple columns,
as this is not applicable.
Pull Request: https://projects.blender.org/blender/blender/pulls/119673
The issue was caused by 29aaa2922d.
With the change from the offended commit there was nothing that
would have informed objects previously linked to a light that they
need to re-calculate their light linking collections.
This change makes it so scene's hierarchy is tagged for update,
which propagates to all dependencies which do depend on hierarchy
of objects and collections in the scene.
This brings behavior closer to what it used to be, without causing
slowdown with full re-evaluation (which was fixed by the offending
commit).
Pull Request: https://projects.blender.org/blender/blender/pulls/119698
Smooth transparent shadows by jittering their opacity threshold every
sample.
Always enabled on final renders, optionally enabled in the viewport with
`scene.eevee.shadow_jittered_transparency`.
Pull Request: https://projects.blender.org/blender/blender/pulls/119480
Allow the user to scale shadow-map resolution per-light.
Adapt the PCF scale based on shadow-map to pixel footprint ratio,
since we can no longer assume that higher LODs don't need filtering.
This allows using much lower shadow resolutions, which can yield
quite significant performance improvements, with relatively little
perceptual quality loss (at the cost of softening shadow edges).
The per-light resolution scale is a literal scale, so for example 0.5
means half the resolution. The Scene Simplify Shadows setting has
been updated to match this behavior.
Pull Request: https://projects.blender.org/blender/blender/pulls/119436
Resolves an issue with stroke rendering in
Metal using the geometry shader fallback
path. Stroke rendering now matches OpenGL
which should enable the GPencil fill tool to
function correctly at all zoom levels.
Authored by Apple: Michael Parkin-White
Pull Request: https://projects.blender.org/blender/blender/pulls/119660
The code tried to retrieve the bounds from the data
synced back to the original object at the end of depsgraph
evaluation. That data is only set on original objects.
Instead just retrieve the bounds directly from the evaluated
object. Also make two variables const now that it's possible.
Pull Request: https://projects.blender.org/blender/blender/pulls/119674
Add a null pointer check around CPU processor, matching the rest of the
processor access.
This solves crash in cases when the OCIO configuration exists but is
invalid: i.e. by removing a lookup table. It could lead to an invalid
render result, but is better than a crash.
The original issue with running Blender from within .zip archive might
still need investigation, as there might be a way to make it work.
Pull Request: https://projects.blender.org/blender/blender/pulls/119693
Initializing the uid of the geom nodes modifier created
by the point instancer reader to prevent an assertion failure
(in a call to to BKE_modifiers_persistent_uids_are_valid())
when reading any USD point instancers in debug builds.
Pull Request: https://projects.blender.org/blender/blender/pulls/119683
Since there is no special case for drawing redo panel, this callback is
not required. Panel will be generated automatically because `undo` and `register`
flags are added to operator.
This improves alignment in redo panel.
Pull Request: https://projects.blender.org/blender/blender/pulls/119494
Previously, we haven't added this because there were plans to use these
declarations at a higher abstraction level where one declaration potentially
contains more than one socket. This hasn't happened yet, and we are also using
other ways to achieve dynamic socket amounts (using dynamic declarations).
Therefore, it is reasonable to simplify the code by storing the integer socket
type in the declaration directly.
Pull Request: https://projects.blender.org/blender/blender/pulls/119691
Those shouldn't really exist at all currently, since we forbid them in 354915cf3c.
Unfortunately, not all cases were removed, and many node trees with such sockets
have been created during the development of 4.1 due to the auto-smooth changes.
I'm not entirely sure if it's still possible to properly remove them now. The commit
above mentions that we might lose links due to changed identifiers. Maybe we're
better off just supporting these inlined sockets while also allowing the "align with
previous socket" functionality.
Either way, not creating more of such node trees for now is reasonable, since we
explicitly disabled that functionality for now.
Pull Request: https://projects.blender.org/blender/blender/pulls/119654
UI would sometimes disappear with the Metal backend.
This occured in situations where there was only a single
GPUContext within a single GHOST window, meaning
the activation routine for the context was never run.
Context activation is required to ensure the backbuffer
was up to date upon resize. Otherwise, re-sizing the
window would cause the screen to turn grey as the
new drawables would not be rendered to.
Authored by Apple: Michael Parkin-White
Co-authored-by: Michael Parkin-White <mparkinwhite@apple.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/119299
Since [0] some comments referencing UI_MAX_NAME_STR were incorrect.
Also correct buffer size for preview_id in uiTemplatePreview so newly
created names are guarantee to be the correct size.
[0]: a180314ac5
- Prefix comments before members is used practically everywhere,
remove C99 syntax from inside comments.
- Replace double quotes with backticks for code styling.
The list identifier includes the class name and an list_id,
see: WM_uilisttype_to_full_list_id
This requires using UI_MAX_NAME_STR (as noted in doc-string).
This PR strips the `sculpt_gesture_trim` prefix and other similar
prefixes from the `sculpt_trim.cc` code, as it is already contained
within the `blender::ed::sculpt_paint::trim` namespace.
Pull Request: https://projects.blender.org/blender/blender/pulls/119680