Commit Graph

120055 Commits

Author SHA1 Message Date
Hoshinova
d98005da5d Fix #112180: Noise with high detail and lacunarity outputs erratic values
This patch fixes #112180 by aligning the floor fraction function with
the GLSL/SVM ones, through the use of the floor math function.

Pull Request: https://projects.blender.org/blender/blender/pulls/112962
2023-09-27 18:01:17 +02:00
Germano Cavalcante
48204b630c Fix #112909, #112922: Weld modifier crashes in some situations
The weld modifier was experiencing crashes due to the `switch_to`
variable occasionally pointing to a collapsed corner.

The encumbrance of the code implementation utilizing `switch_to` was
proving to be problematic as it was escalating the complexity of
maintenance. 

To resolve the issue, a code rewrite was conducted.

The new implementation uses a `loop_next` in place of `switch_to` for
skipping corners.

This modification streamlined the code and improved its stability.

However, this solution does come with minor drawbacks. There is a small
increase in memory consumption and the corner group detection process
is now slightly more computational intensive.

Also the test files need to be updated.
2023-09-27 13:00:06 -03:00
Hans Goudey
06df854112 Cleanup: Make format 2023-09-27 10:15:42 -04:00
Hans Goudey
6caa8010d0 Merge branch 'blender-v4.0-release' 2023-09-27 10:07:50 -04:00
Hans Goudey
03f6fe81b2 Fix: Missing node asset unassigned non-asset label
The label should be displayed when there are no assets too.
2023-09-27 10:07:15 -04:00
Hans Goudey
1a7527b1df Geometry Nodes: Move node tools out of experimental
See #101778

Pull Request: https://projects.blender.org/blender/blender/pulls/112927
2023-09-27 16:04:36 +02:00
Julian Eisel
b5f6c00f0a Merge branch 'blender-v4.0-release' 2023-09-27 15:48:37 +02:00
Julian Eisel
ff78d33bb4 UI: Draw Image editor tool header transparent with button background
Same as 55eaa755e3, but for the Image Editor, since this should be done
consistently for all editors using tool headers with region background.
2023-09-27 15:48:20 +02:00
Hans Goudey
9e495c5b06 Geometry Nodes: Store tool group in a separate editor property
This enables switching back and forth between the modifier and tool
contexts of the geometry node editor without losing the assigned tool
node group.

See #101778

Pull Request: https://projects.blender.org/blender/blender/pulls/112926
2023-09-27 15:47:22 +02:00
Falk David
4f617bc728 Fix: Expose GPv3 RNA only in experimental
The `blender-v4.0-release` branch would not build because some parts of grease pencil v3 were still exposed when experimental features are disabled.

This is hiding the relevant parts behind `#ifdef WITH_GREASE_PENCIL_V3` to make sure they are only built when the experimental features is enabled.

Pull Request: https://projects.blender.org/blender/blender/pulls/112953
2023-09-27 15:46:18 +02:00
Julian Eisel
7ec7dac860 Fix background drawing in tool header after changing tools
After changing tools (and possibly other context), the buttons section
background drawing would be broken for one redraw, so the full region
would be drawn with a background, rather than just behind the button
boundaries.
2023-09-27 15:45:39 +02:00
Thomas Dinges
ab26ddc455 Revert "Release cycle: Bcon3 for Blender 4.0"
This reverts commit 8c25952886.
2023-09-27 12:53:52 +02:00
Thomas Dinges
74cc9f5738 Merge branch 'blender-v4.0-release' 2023-09-27 12:53:22 +02:00
Thomas Dinges
8c25952886 Release cycle: Bcon3 for Blender 4.0 2023-09-27 12:52:04 +02:00
Thomas Dinges
673ad635f5 Release cycle: Bcon1 for Blender 4.1 2023-09-27 12:49:46 +02:00
Falk David
00d4b5562b Fix BKE_deform.h compilation error on windows
The issue was that the pure c++ functions were defined within a `extern C` block.

Pull Request: https://projects.blender.org/blender/blender/pulls/112947
2023-09-27 12:11:32 +02:00
Julian Eisel
1cb3b83d33 Fix division by zero when split regions are hidden
Code has special handling so that only the first of two split regions
needs to be flagged as hidden. If the second one is also flagged that
can have some unwanted side-effects. Code to add the region resizing
edges relied on the region visibility flags though, rather than the
visibility check that respects this handling of split region hiding. So
code would run that is only intended for un-hidden regions.
2023-09-27 12:08:09 +02:00
Pratik Borhade
cea02c15f8 Fix #112896: Search menu: First character remains in text field
Search menu (F3) displays character which was pressed to open a context
specific search. This also breaks the old behavior of showing last searched
operator in text field, instead shows the pressed character.
To fix this, first store the `g_search_text/but->poin` string in
temp_buffer (before pressed key char is copied to `g_search_text`).
Later, restore the g_search_text after invoking the search menu.

Pull Request: https://projects.blender.org/blender/blender/pulls/112938
2023-09-27 12:07:12 +02:00
Julian Eisel
55eaa755e3 UI: Draw 3D view tools header transparent with background behind buttons
Makes use of the new buttons sections feature used by the asset shelf to
draw a background behind buttons, but the reset of the region fully
transparent. The UI team agreed on this as a way to minimize dead space,
but also as a better way to communicate our click through feature (where
dead space in overlapping regions forwards events to the underlying
region). The region background theme setting only affects the
non-transparent part of the region, the rest is always fully
transparent. With region overlap disabled, the bar is fully opaque still.

Also see #112241.
2023-09-27 11:57:37 +02:00
Julian Eisel
04d22d73f3 UI: Hide asset shelf by default
Only the pose library enables the asset shelf by default, but Blender
doesn't come with pose assets, they have to be created by the user. So
when entering pose mode with factory settings, the asset shelf will
currently be just a big empty bar. Plus, pose mode is used for posing
without pose assets quite a lot. So hide the asset shelf by default. The
pose library already shows a toggle to hide/unhide it where the previous
pose library UI was for discoverability.
2023-09-27 11:54:45 +02:00
Lukas Tönne
2f1b8f59e3 Cleanup: Nodes: Simplify drawing function
The node drawing function currently uses a stack-based traversal of
interface items. This is hard to read and for this purpose a recursive
function is easier to understand.

Pull Request: https://projects.blender.org/blender/blender/pulls/112860
2023-09-27 11:48:40 +02:00
Julian Eisel
1da08a5556 Asset shelf: Add asset library selector
Adds a menu to choose the asset library to use to the asset shelf
catalogs selector popover. This is consistent with the asset browser.
After talking to animators and some artists, this is likely something
they would want to have, since they don't always want all their assets
and catalogs to populate the asset shelf. It's also necessary for the
pose library UI to provide the same features roughly than the old one
(in the sidebar, before the asset shelf was introduced).
2023-09-27 11:31:21 +02:00
Julian Eisel
e3d4cf9b3d UI: Allow popover panels to register own notifier listeners
This is necessary to let popovers redraw when asynchronously loading
data. For example to display assets or asset catalogs as they get
loaded. Needed for the asset shelf catalog selector popover. Menus
already do the same to allow populating the menu with assets as they get
loaded.
2023-09-27 11:31:21 +02:00
Jacques Lucke
c8cc169d6f Geometry Nodes: add Inspection Index to Repeat Zone
Previously, it was only possible to inspect the data from the first iteration. That
applied to both, the viewer node as well as socket inspection. Now, there is a
new `Inspection Index` setting in the zone properties. It specifies which iteration
should be used by the inspection features.

In theory we could support features like counting the index from the end, but
that can be done separately as well, as it likely requires more UI.

Pull Request: https://projects.blender.org/blender/blender/pulls/112818
2023-09-27 11:09:39 +02:00
Falk David
bc7034d9fd CurvesGeometry: Add initial vertex group support
This PR adds vertex groups to `CurvesGeometry` as well as an attribute read/write accessor.

This is also in preparation for GPv3. Since the goal is to have full compatibility with the current grease pencil features, vertex groups need to be supported.

Grease Pencil allows filtering by vertex group for modifiers.To support this, it also makes sense to have read/write access for vertex groups in the attributes API.

In the future, vertex groups should be just another custom attribute on meshes/curves/grease pencil. There are some more issues to be solved before that can happen. This step gets us a bit closer since the vertex weight data is stored in `CustomData`.

Pull Request: https://projects.blender.org/blender/blender/pulls/106944
2023-09-27 10:26:06 +02:00
Philipp Oeser
0b1d2d63fe Allow setting weights (Ctrl+X) without paintmask enabled
Currently if there is no selection mode enabled the operator is disabled and greyed
out in the menu. The shortcut doesn't do anything, which can be unexpected and jarring.

With this PR the operator will work when no selection mode is enabled and in that case
fill the entire mesh using the Weight from the active tool.
This is then consistent with vertex paint mode and the "Set Vertex Color" operator.

So now remove the overly-strict `mask_paint_poll` poll (and replace with
more appropriate `weight_paint_mode_poll`).

NOTE: `mask_paint_poll` is now unused, could be removed
Pull Request: https://projects.blender.org/blender/blender/pulls/112413
2023-09-27 09:13:04 +02:00
Campbell Barton
5964ff7acb Fix missed header change from a9f0d19197 2023-09-27 16:53:45 +10:00
Campbell Barton
a9f0d19197 Fix memory leak with volume shaders with the workbench engine
../lib/tests/render/volume/smoke_fire.blend was leaking memory,
reloading leaked more memory each time.
2023-09-27 16:50:48 +10:00
Gilberto Rodrigues
7bc4478484 Clarify UV align operator behavior. Fix tooltips.
Clarify operator behavior of UV align operator, and fix the tooltips.
The tooltips were either vague/ambiguous,
or even wrong, see https://projects.blender.org/blender/blender-manual/issues/78557

Pull Request: https://projects.blender.org/blender/blender/pulls/112704
2023-09-27 08:43:56 +02:00
Campbell Barton
cdac2642ea Fix memory leak from loading files with legacy grease pencil palettes 2023-09-27 14:47:50 +10:00
Campbell Barton
b4d3bd134b Cleanup: quiet ASAN warning with invalid value for eButGradientType
-1 was assigned to eButGradientType which isn't a valid value,
add UI_GRAD_NONE to resolve this.
2023-09-27 14:28:47 +10:00
Campbell Barton
a9162dbba9 Fix memory leak for builds without fluid simulation enabled
Fluid-simulation data wasn't copied or freed when WITH_FLUIDSIM=OFF.
As this is modifier data which is created on load this should also
be freed.
2023-09-27 14:10:41 +10:00
Campbell Barton
c29a78d80d Fix memory leak when the explode modifier is used with vertex groups
Initializing all vertices from the original could allocater vertex
groups into the custom-data which were later overwritten witout freeing.

The leak happened in the test file:
.../lib/tests/modifier_stack/explode_modifier.blend
2023-09-27 13:48:15 +10:00
Campbell Barton
329b8176f7 Fix crashes drawing in the sequencer
Follow up to ee4c45c612.
2023-09-27 13:14:38 +10:00
Campbell Barton
46263a85ab Cleanup: spelling in comments 2023-09-27 13:03:29 +10:00
Campbell Barton
ee4c45c612 Fix crash drawing in the sequencer when Scene::ed is null
Regression in [0], also order checks so creating a map of sequencer
strips is done after the flag check.

[0]: 86a0d0015a
2023-09-27 13:02:35 +10:00
Richard Antalik
86a0d0015a VSE: Improve retiming UI
Currently retiming is quite awkward, when you need to retime multiple
strips strips in sync. It is possible to use meta strips, but this is
still not great. This is resolved by implementing selection.

General changes:
Gizmos are removed, since they are designed to operate only on active
strip and don't support selection.
Transform operator code is implemented for retiming data, which allows
more sophisticated manipulation.
Instead of drawing marker-like symbols, keyframes are drawn to
represent retiming data. Retiming handles are now called keys. To have
consistent names, DNA structures have been renamed.
Retiming data is drawn on strip as overlay.

UI changes:
Retiming tool is removed. To edit retiming data, press Ctrl + R, select
a key and move it. When retiming is edited, retiming menu and
context menu shows more relevant features, like making transitions.
Strip and retiming key selection can not be combined. It is possible to
use box select operator to select keys, if any key is selected.
Otherwise strips are selected.
Adding retiming keys is possible with I shortcut or from menu.
Retiming keys are always drawn at strip left and right boundary. These
keys do not really exist until they are selected. This is to simplify
retiming of strips that are resized. These keys are called "fake keys"
in code.

API changes:
Functions, properties and types related to retiming handles are renamed
to retiming keys:
retiming_handle_add() -> retiming_key_add()
retiming_handle_move() -> retiming_key_move()
retiming_handle_remove() -> retiming_key_remove()
retiming_handles -> retiming_keys
RetimingHandle -> RetimingKey

Retiming editing "mode" is activated by setting `Sequence.show_retiming_keys`.

Pull Request: https://projects.blender.org/blender/blender/pulls/109044
2023-09-27 01:45:59 +02:00
Jacques Lucke
46ade1c2df Fix #112916: crash when changing active repeat item
It seems like the cause for the crash was that the maps in
`AnonymousAttributeInferencingResult` use node indices as keys.
However, the order of nodes changes when changing node selection.
Generally, we don't want to trigger a more expensive update just
because we changed the selection, therefore things got out of sync
when building the lazy-function graph.

The solution here is not a full fix. Other things that cause a depsgraph
update but don't cause a tree-update could still cause the same kind
of crash. A better solution would be to address the root cause which
is that trivial operations like selection changes node order which is
used in many places. Also see `BKE_ntree_update_tag_node_reordered`.

Disabling depsgraph updates when changing the active simulation
or repeat item is correct as well though, and it solves this specific crash.
2023-09-27 01:35:40 +02:00
Brecht Van Lommel
3d39abc5e6 Fix build error after make format cleanup
The include order should not matter here, but do quick fix for now to
unbreak the builds.
2023-09-27 01:07:49 +02:00
Jacques Lucke
8418e41bf7 Fix: simulation nodes not working after copying object 2023-09-27 00:19:37 +02:00
Clément Foucault
f966205022 EEVEE-Next: Add tracing options for diffuse rays
Also fixes diffuse surface always tracing
even when tracing is off.
2023-09-26 23:46:08 +02:00
Clément Foucault
3a4fc2c94e EEVEE-Next: Shadow Map Tracing Initial Implementation
Shadow Map Ray Tracing is a technique that ray cast against the shadow
depth buffer. The technique is described in "Soft Shadows by
Ray Tracing Multilayer Transparent Shadow Maps".
Note that we only implement the single layer approach since storing
multiple depth is prohibitively expensive.

Pull Request: https://projects.blender.org/blender/blender/pulls/111809
2023-09-26 23:42:40 +02:00
Harley Acheson
b2b467cc8c Cleanup: Make format
Formatting changes resulting from Make Format
2023-09-26 14:10:32 -07:00
Harley Acheson
e64e39e3d0 UI: Change Overlay Text Size with Label Text Style
Text Overlays are currently hard-coded to 11 points. This allows them
to be set with Preferences / Themes / Text Styles, Widget Label.

Pull Request: https://projects.blender.org/blender/blender/pulls/112875
2023-09-26 23:07:29 +02:00
Hans Goudey
2e6b81f151 Cleanup: Make format 2023-09-26 17:05:36 -04:00
Hans Goudey
b49c84276c Geometry Nodes: Fix Support for extending nested menus with assets
The builtin asset catalog paths weren't properly updated after more
nesting was added to the geometry nodes add menu. This commit
resolves that and a few other issues extending menus like nested
menus in mesh edit mode. Unfortunately this requires some boilerplate
code duplicating the menu structure currently.
2023-09-26 17:01:50 -04:00
Hans Goudey
e5e07c184e Fix: Crash deleting geometry nodes node group
Missing null check in ad169ba67a.
2023-09-26 17:01:50 -04:00
Hans Goudey
355ed0838c Geometry Nodes: Expose non-asset tools
Node tools are no longer required to be assets, and they aren't assets
by default anymore. Non-assets don't have catalogs for header menu
organization, so they are only exposed in the "Unassigned" menu, which
is now just an icon so it takes less spac, makes the connection to the
asset browser, and signals more that it's not the "final" place for a
tool. Tool node groups have fake user set by default, since they don't
have users. The "Is Tool" status of a node group is configurable in the
editor N-panel, just like the modifier status.

This is similar to af3461c387, and has the same check for
whether a node group is "local."
2023-09-26 17:01:50 -04:00
Hans Goudey
af3461c387 Geometry Nodes: Require modifier tag for add menu, show non-assets
Any geometry node group with the "Is Modifier" tag is exposed in the add
modifier menu. Local node groups that aren't assets are displayed in a
subsection of the "Unassigned" menu, as they are "asset wannabees"
that function similarly but aren't shared to other files.

Only modifier node groups can be assigned to the geometry nodes
modifier. Because of this, existing node groups are versioned to have
the tag if they have a geometry output.

Internally, this means the operator that used to only handle node group
assets has to also add local geometry node groups. That change isn't
so large though. The other changes are just UI, or changes to the
node group property poll functions.

Note: For assets, saving the file to generate asset meta-data may be
necessary for the versioning to affect the add modifier menu.

Pull Request: https://projects.blender.org/blender/blender/pulls/112918
2023-09-26 21:53:20 +02:00
Hans Goudey
2d19e345cd Cleanup: Missing includes and forward declarations in header 2023-09-26 15:39:32 -04:00