The mesh triangulation data is stored in CPU memory with the same format
as the triangles GPU index buffer. Because of that we can skip creating a
temporary copied owned by the GPU API. One way to do that is to just
upload the data directly and avoid keeping a reference to it. However, we
can only upload GPU data from the main thread with OpenGL, so instead
reference the data and keep track of whether to free it.
When drawing a mesh with a single material and 1.8 million faces, this
change gives a 12-15% improvement in framerate, from about 32 to 37 FPS.
Part of #116901.
Pull Request: https://projects.blender.org/blender/blender/pulls/122175
Previously, when dropping a node on a link with incompatible sockets, the link
would be removed. While sometimes useful in super simple setup, it is generally
useless for most work. Even worse, users might not notice that they accidentally
removed a link (this has been reported in the recent geometry nodes workshop).
This patch changes this behavior in two ways:
* A node can't be inserted onto an incompatible link anymore.
* A link will be dimmed while dragging a node over it, if it is incompatible or if
alt is pressed.
Pull Request: https://projects.blender.org/blender/blender/pulls/121975
The pixels size was not computed in the right space.
This is the easy fix as refactoring the directional
shadows is too risky/time consuming right now.
Fix#121641
These operators in sculpt mode affect hidden geometry which is undesirable.
- bpy.ops.sculpt.face_set_edit
- bpy.ops.sculpt.face_sets_init
- bpy.ops.sculpt.face_sets_create(mode='SELECTION')
- bpy.ops.mesh.paint_mask_extract()
- bpy.ops.mesh.paint_mask_slice()
This PR adds checks for hidden faces in these operators.
For operator `bpy.ops.sculpt.face_sets_init` it also modifies the way
face sets indices were generated so generated indices is unique. This
is needed so new initialized face sets do not get same indices as hidden
face sets.
For generating unique face set index I have created a set container
which stores hidden face sets indices. Before assigning indices to a
face set it checks if it is already in set container, if it is then
it'll keep increasing index by 1 until it is not in set container.
Modifying Operator `bpy.ops.mesh.paint_mask_slice()` is little complex,
it will not affect hidden geometry only when fill holes option is
unchecked, because currently filling hole code does not take hidden
geometry into account and because of this in some cases hidden part
of geometry can be trapped inside mesh.
Co-authored-by: Hans Goudey <hans@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/119168
New operator OUTLINER_OT_start_filter bound to Ctrl-F to move keyboard
focus to the Outliner search filter box. And OUTLINER_OT_clear_filter
bound to Alt-F to clear the search box. Both similar to Properties.
Pull Request: https://projects.blender.org/blender/blender/pulls/122126
Though the whole modifier menu could use a reorganization, it probably doesn't
make sense to do that before we have a builtin library of node group assets.
We already have the "Normals" category though, so these two modifiers make
more sense there.
Pull Request: https://projects.blender.org/blender/blender/pulls/122168
`BM_mesh_triangulate` is used in exporters (when the "Triangulate"
option is ON), the `Triangulate` modifier and currently also in the
`Triangulate` geometry node (even though there are plans to change this,
see !112264)
So in practice, exporters (Alembic/FBX/OBJ/Collada) were breaking
custom normals for game pipelines (unless everything was triangulated
beforehand).
This change builds upon 93c8955a72 (uses the use
`BM_custom_loop_normals_to_vector_layer` /
`BM_custom_loop_normals_from_vector_layer` pair of calls).
In the case of the `Triangulate` modifier, this had its own try at
preserving custom normals in 7d0fcaa69a -- doing very similar
things but as an option -- this is now removed (so it is always done,
which fits into "interpolate custom data if it's there" design that we have
nowadays).
NOTE: the "Triangulate Faces" operator already did the same
Pull Request: https://projects.blender.org/blender/blender/pulls/121871
This was caused by wrong assumption that `shadow_radius`
is also a radius for area light. To avoid the confusion,
use a new property for area light shadow scaling.
Blender shows invalid links in red in the node editor. However, it's not always
obvious why some links don't work, especially for beginners. This patch adds
additional information for every invalid link on the node that it links to.
The following error messages are added:
* Invalid link because of missing implicit conversions.
* Link cycle in node tree.
* A link from a field to a socket that does not support fields.
* Using the same menu on multiple Menu Switch nodes.
Currently, there are some per tree-type special cases in the link validation code.
In the future, this should be moved to tree type specific callbacks.
Pull Request: https://projects.blender.org/blender/blender/pulls/121976
Previously, the new frame was always added as root frame and did not have a parent.
Now, the common root frame of all selected nodes is detected and the new frame is attached to it.
Pull Request: https://projects.blender.org/blender/blender/pulls/121972
Fixes#121902, #121865, #121905 and some other reports that were closed
as duplicates.
Reverts a change done as part of 7d80fde033.
Reverting this change breaks the yet-to-be-used asset shelf popup a bit,
in that refreshing it won't work propery anymore. Think that's fair
given that 1) the popup isn't in use yet, 2) its refreshing implementation
causes a bunch of high priority bugs, and 3) #122068 is in review with a
better solution to handle refreshing. Namely, it converts the popup to a
popover, which handles refreshing differently, and thus makes the change
being reverted here unnecessary anyway.
The operator has a modal keymap with a toggle for inverted mode. This
key was only bound to `PRESS` events, preventing actual toggling during
modal operation.
It also needs to be invoked in inverted mode with ctrl, so a new
operator property was added to initialize the setting.
Pull Request: https://projects.blender.org/blender/blender/pulls/122146
In `SyncModule::sync_curves/sync_point_cloud` the material variable
can be used after it has been freed. The cause is that cryptomatte
can request a new material, which might trigger a relocation of the
references material.
This PR fixes this by doing the shadow sync before the cryptomatte
sync.
Pull Request: https://projects.blender.org/blender/blender/pulls/121909
Getting the owner ID of an embedded liboverride is not that expansive
anymore.
Also explain difference between this function and the new similar
`ID_IS_EDITABLE` macro.
When synchonizing the image for presentation the incorrect access
mask was used. This PR changes the access mask from data transfer
write to memory write. The data transfer write is not allowed to
change the image layout.
Pull Request: https://projects.blender.org/blender/blender/pulls/122138
* Debugging groups were not being applied as that part of the code
wasn't ported to the original patch
* Debugging groups didn't account for nodes that weren't owned by
any debug group.
Pull Request: https://projects.blender.org/blender/blender/pulls/122136
`node_socket_add_tooltip_in_node_editor` doesn't set a free function.
but uiLayoutSetTooltipFunc didn't check on it. Documentation states
that the free_arg parameter is optional.
Pull Request: https://projects.blender.org/blender/blender/pulls/122115
Moving the cursor away from the extensions "Add Repository" popup
could crash because the "Repositories" popover was closed while the
popup it created remains open.
Resolve by clearing wmEventHandler_UI::context.region_popup
which match the freed region, following similar logic already used by
WM_event_modal_handler_region_replace.
Note that this bug was exposed by [0].
[0]: 38d11482f5
Add a preference to "Work Offline" system preference as well as command
line options `--offline-mode` & `--online-mode`
(which overrides the preference).
This option is displayed in the initial setup screen too.
This is currently respected by:
- Check for updates on startup
- Disables running an update when enabling extensions.
When Blender is launched with `--offline-mode` the option cannot be
enabled in the preferences. This is intended for environments
where internet access is intentionally disallowed.
Background: with Blender supporting access to online-repositories
as well as 3rd party extensions themselves potentially accessing the
internet. This setting provides a way for users to disable online
functionality.
This prevents error messages when online access fails in environments
without internet access as well as the ability for users who prefer
Blender doesn't access the internet to have one place to turn this off.
While it does not enforce limitations on add-ons, 3rd party scripts
are expected to respect this setting using `bpy.app.internet_offline`.
The details for this will be handled along with other policies scripts
are expected to follow.
Ref !121994
When selecting Scene World with Cycles, the world background will be missing-texture pink for one frame before showing the correct light.
The issue here appears to be that Cycles queries rna_View3DShading_selected_studio_light_get, which returns the placeholder "Default" value which doesn't have a file path, so the world ends up pink.
Immediately afterwards, the UI code calls rna_View3DShading_studio_light_get, which initializes shading->lookdev_light to the proper default.
The easiest workaround for this is to provide the proper flags when getting the selected studio light, which will not match the placeholder entry and therefore return the proper default.
Pull Request: https://projects.blender.org/blender/blender/pulls/121987
Part of #116901.
The only non-obvious part is changing from using the `MR_DATA_LOOP_NOR`
flag as a signal to calculate normals and store them in `MeshRenderData` to
a more explicit check that the normals buffer is requested. In the future hopefully
these dependencies will be refactored to be part of the task graph instead.
Move the responsibility of deciding whether to calculate face corner
normals closer to the buffers and iteration, in preparation for replacing
the `data_flag` and `iter_flag` abstractions from the extractors system.
Part of #116901. Main benefits to this change are reduced function call
overhead and a simpler hot loop when face corner normals are extracted.
Code duplication is also reduced through use of templates. The downside
is that the access patterns aren't clearly better for the BMesh case where
a lot of data is stored array-of-structs style.
Make better use of the lazy calculation by avoiding storing a reference
to the calculated normals in the mesh render data. This reduces memory
usage from 282 MB to 225 MB in a test file with about 2 million faces.