Commit Graph

100838 Commits

Author SHA1 Message Date
Jacques Lucke
e13dc04fb8 Cleanup: move rna_modifier to C++
Also see #103343.

Pull Request: https://projects.blender.org/blender/blender/pulls/109502
2023-06-29 14:08:42 +02:00
Hans Goudey
e4cc91a611 Geometry Nodes: Node group operators initial phase
This PR adds a new operator to run a node group on object geometry.
Only curves sculpt mode is supported for now, to simplify the design.

A new geometry node editor context to edit operator groups is also
added. This allows changing any node group, rather than only node
groups that are part of the active modifier context.

3D viewport menus are added with any geometry node group
asset in a catalog that contains the `Operator` tag. Currently Blender
must be restarted to refresh the list of available operators.

This is only the first phase of the node group operator feature.
Many more features will be added in next steps.

See #101778

Pull Request: https://projects.blender.org/blender/blender/pulls/108947
2023-06-29 13:57:54 +02:00
Jacques Lucke
f3da3c7de4 Cleanup: improve debug printing for anonymous attribute inferencing 2023-06-29 12:32:22 +02:00
Jeroen Bakker
95a703242a Cleanup: Renamed WorldPipeline to BackgroundPipeline
Rename cause for #108149 we want to use WorldPipeline for rendering
the world cubemap.

Pull Request: https://projects.blender.org/blender/blender/pulls/109495
2023-06-29 11:33:20 +02:00
Chris Blackbourn
dee737d64b Cleanup: use c++ constructor and destructor for paramhandle in uv unwrap 2023-06-29 17:19:09 +12:00
Campbell Barton
35389e8b35 Cleanup: use const qualifier for arguments & variables 2023-06-29 10:56:33 +10:00
Campbell Barton
0dfeccfc6b Cleanup: pass strings as const references where appropriate 2023-06-29 10:55:58 +10:00
Campbell Barton
09c0c86d83 Fix property tags dummy enum value holding a reference to stack memory
Also update the doc-string to include a warning about this.
2023-06-29 10:31:23 +10:00
Almaz-Shinbay
65f40a4e5d Cleanup: use snake case for outliner class function names
Part of #96713. Follow the style conventions for naming: https://wiki.blender.org/wiki/Style_Guide/C_Cpp#Naming

Pull Request: https://projects.blender.org/blender/blender/pulls/109402
2023-06-29 00:58:18 +02:00
Hans Goudey
ccfc67e4cd Cleanup: Simplify mask usage when evaluating attribute
Avoid the need for temporary `IndexMask` variables for "full"
selections which can jsut be specified to the field evaluator.
2023-06-28 16:43:22 -04:00
Germano Cavalcante
b6a534e41b Fix mouse offset of Set Snap Base returning original position
`Mouse Input::in val_unproj` was disregarded when resetting the initial
mouse position.

This caused the mouse to return to the previous position before the
`Set Snap Base` after navigating the 3D view.
2023-06-28 15:09:22 -03:00
Germano Cavalcante
ce7ee791b0 Fix Automatic Constraint using mouse position from before navigation
Axis "selection" gets messy if it doesn't use the same offset value
that is updated after navigating.
2023-06-28 14:14:58 -03:00
Ray molenkamp
2dac20e35f CMake/Cleanup: Use bf_intern_atomic target
Use the bf_intern_atomic target rather than adding a relative path
to it in the INC section.

Pull Request: https://projects.blender.org/blender/blender/pulls/109424
2023-06-28 19:12:55 +02:00
Bastien Montagne
a60c1e5bb8 Fix (studio-reported) crash when using 'Clear' on a liboverride hierarchy in the Outliner.
Usual issue of modifying the data hierarchy while iterating on it in its
outliner representation. And usual fix for this problem (only store data
to be processed during the iteration over Outliner data, and perform the
actual operation in a single call afterwards).

This commit also tries to improve a bit the 'Clear' process when applied
to a bunch of IDs, by iterating several times over the list of IDs to
clear, and only processing 'liboverrides leaves' first. That way, if
clearing a liboverride leaves turn other liboverrides into leaves, then
can also be processed that way, instead of just being reset.

Note that this is a naive and quite imperfect solution though
(dependency islands cannot be handled that way e.g.), this feature needs
a complete re-write at some point to be more complete and consistent.
Don't think this is high priority though, as it is not really that
useful in practice afaik.

Note: This should be backported to 3.6 LTS (and maybe 3.3 LTS if
applicable).
2023-06-28 19:00:11 +02:00
Hans Goudey
f89b32382a Point Cloud: Add initial edit mode support
Similar to 5f16e24cc9, this adds support for edit mode
to the point cloud object type, which is currently hidden behind an
experimental option. No interaction is possible yet, for now this
can be used as a testing for a node-group-operator-only mode.
2023-06-28 12:52:55 -04:00
Iliya Katueshenock
ffb0517e6e Cleanup: fix debug lazy function name for Switch node
Pull Request: https://projects.blender.org/blender/blender/pulls/109437
2023-06-28 17:26:31 +02:00
Hans Goudey
a1cc621e1e Cleanup: Remove unused custom data type
`CD_HAIRLENGTH` is not really a custom data type, it was just used to
specify the hair particle "length" attribute to pass it to EEVEE and
material preview. Because of the "typemap" array in `CustomData`,
it's better not to have this unnecessary type. Instead, use the same
mechanism used to request the active color attribute.

Pull Request: https://projects.blender.org/blender/blender/pulls/109449
2023-06-28 17:17:31 +02:00
Miguel Pozo
12a10448f9 Cleanup: Add explanation to sculpt_batches_get 2023-06-28 15:45:12 +02:00
Germano Cavalcante
fc0e110e60 Fix #109433: Snapping occluding objects even in wireframe mode
The internal `use_occlusion_test` option was only being removed if it
was in conjunction with the `Snap to Face` option.

Both test occlusion and Snap to Face are conflicting. In wireframe mode
the objects are not occluded, but Snap to Face can prevent them from
being snapped.

The solution is to prioritize snapping to other non-Face elements but
still allow "Snap to Face" in X-Ray mode.
2023-06-28 10:34:43 -03:00
Philipp Oeser
128c95438f Fix #109302: baking UDIM displacement normalization wrong
Since UDIM baking support in 6787cc13d4, the normalization of
diplacement heights was always based on the min/max height detected in
the _last_ tile, which could lead to clipping if the last tile had very
subtle (or no) displacement.

Now getting the min/max is spread across all images.
This also takes the first thread into account for getting the min/max (which for some reason was skipped).

Pull Request: https://projects.blender.org/blender/blender/pulls/109409
2023-06-28 14:58:52 +02:00
Philipp Oeser
ab215965c6 Fix: python textformatting ASAN overflow
Since 3f26bdf840, `text_format_string_literal_find` is used to get the
length of the string literal. This can return -1 though and this can
lead to accessing negative index in the string afterwards.

Now, let `text_format_string_literal_find` return 0 (instead of -1) since 0
is never going to be a valid string length anyways.

Pull Request: https://projects.blender.org/blender/blender/pulls/109441
2023-06-28 14:14:04 +02:00
Falk David
6bec3bca09 GPv3: Remove dead code in drawing operator
These lines were not used and caused compiler warnings.
They can be safely removed.
2023-06-28 11:40:12 +02:00
Falk David
fdfc09502a GPv3: Improve redrawing for drawing operator
The new drawing operator uses the `paint_stroke` API which didn't
know about grease pencil yet. This simple change causes the redraw
to happen on every(?) event, which did not happen before.
2023-06-28 11:40:12 +02:00
Iliya Katueshenock
4060ba4024 Cleanup: reserve vector before an append loop
Pull Request: https://projects.blender.org/blender/blender/pulls/109416
2023-06-28 08:48:00 +02:00
Campbell Barton
d886fc0238 Fix assert on startup with empty script directories 2023-06-28 15:46:04 +10:00
Campbell Barton
3ab8e9b144 PlayAnim: only load the built-in mono-space font
There is no need to load all fonts on startup when only the mono-spaced
font is used.
2023-06-28 13:46:26 +10:00
Campbell Barton
d1e6c8f5a6 Cleanup: spelling in comments 2023-06-28 12:27:48 +10:00
Campbell Barton
275ac77f16 Cleanup: quiet clang warnings from using u8 defines 2023-06-28 12:19:51 +10:00
Campbell Barton
2332b981a5 Cleanup: quiet missing variable declaration warning 2023-06-28 12:17:06 +10:00
Campbell Barton
2f1230593c Cleanup: use nullptr, function style casts, use ELEM macro 2023-06-28 12:17:06 +10:00
Campbell Barton
93b0be468f Cleanup: use r_ prefix for return arguments in ED_anim_api callbacks 2023-06-28 12:17:06 +10:00
Campbell Barton
0fdc84fcdd Cleanup: remove incorrect/unhelpful comments 2023-06-28 12:17:06 +10:00
Harley Acheson
37eabb171a Cleanup: Make format
Format changes only
2023-06-27 12:10:07 -07:00
Damien Picard
9b4749e7c7 UI: replace "x" with multiplication sign when displaying calculations
The multiplication sign looks like an "x" but should be used in its
stead to display calculations and dimensions such as "1920x1080". It
is supported in many fonts including DejaVu Sans, the font currently
used for the UI.

Pull Request: https://projects.blender.org/blender/blender/pulls/106388
2023-06-27 21:03:05 +02:00
Ray molenkamp
eff9e2f4ce CMake: plumbing for modern CMake usage
This is the minimal change required to start using modern CMake in the
blender build system. This change is designed to allow small
incremental changes to the build system rather than doing it in one
big bang which would be unmaintainable (for me)

The biggest functional change is, previously all libraries in the
`LIB` section of a `blender_add_lib` call had the `INTERFACE` scope,
which is rarely, if ever the correct scope. This diff changes this to
`PRIVATE`

Concrete implications of this diff :

The `LIB`, `INC` and `INC_SYS` sections of an `blender_add_lib` call
now allow scoping keywords (`PUBLIC`, `PRIVATE,` `INTERFACE`) to
declare the scope of the dependency.

Right now the only library using any modern cmake is
`bf_intern_atomic` which is an header only interface library that will
just advertise its include directories.

This allows us to clean up any `CMakeLists.txt` that adds
`../../../intern/atomic` to its `INC` section to remove it in `INC` by
adding a `PRIVATE bf_intern_atomic` to the `LIB` section.

Pull Request: https://projects.blender.org/blender/blender/pulls/107858
2023-06-27 20:57:50 +02:00
Germano Cavalcante
d53862351d Transform: Allow navigation by default
As suggested in #108669, the "Navigate during Transform" option has
been removed and this feature works by default.

Now if you press `G`, `R` or `S` to move, rotate or scale an object you
can also navigate in the viewport.

Note that this update modifies the default keymap.
Now pressing `Alt` is required for the following modals:
- `PROPORTIONAL_SIZE_UP`,
- `PROPORTIONAL_SIZE_DOWN`,
- `PROPORTIONAL_SIZE`,
- `AUTOIK_CHAIN_LEN_UP`,
- `AUTOIK_CHAIN_LEN_DOWN`,
- `AUTOCONSTRAIN`,
- `AUTOCONSTRAINPLANE`.

Pull Request: https://projects.blender.org/blender/blender/pulls/109388
2023-06-27 20:29:05 +02:00
Bastien Montagne
6221410409 Fix #109004: Append: in Localize All case, LibOverrides does not behave properly.
The root of the issue was that when localizing all linked data, it makes
no sense (and there is no way) to keep liboverrides, since some linked
data would then remain linked.

The solution is then to clear any override data from localized IDs.
While simple in theory, this adds a noticeable amount of complexity to
the 'append' process, as now some IDs should remain linked, and some
should be forcefull copied (instead of directly made local), such that
the liboverride reference data remains valid.

NOTE: Appending without `Localize All` remains unchanged here, and will
keep the liboverrides untouched, since in that case having some linked
data as result of the append operation is expected.

This fix should be backported to the 3.6 LTS.
2023-06-27 18:31:45 +02:00
Bastien Montagne
daf414b48e IDManagement: Add option to 'make local' code to clear liboverride data.
In some cases, when making a linked liboverride data local, the
liboverride data should be preserved (and therefore produce a local
liboverride data).

However, it implies that the data is not really, fully made local, since
it has (critical) dependencies to linked data.

This new option allows 'make local' code to also clear any liboverride
data in the processed ID, making it effectively fully local.

Preliminary step to solve #109004.
2023-06-27 18:31:45 +02:00
Germano Cavalcante
597f9abcfa Snap: Refactor Face Nearest approach
- Use C++ types for matrices and vectors;
- Deduplicate code with `SnapData::register_result`;

This commit also improves the way of detecting supported snap types.
2023-06-27 12:49:55 -03:00
Germano Cavalcante
229ae63c6e Cleanup: Silence warning
```
warning: "DEBUG" is not defined
```
2023-06-27 12:49:41 -03:00
Iliya Katueshenock
fde8e6ce65 Fix #109406: Ignore unsupported socket in shader
In 3957a1ad03 was
added the new Rotation socket to a Mix node.
Mix node can be used in shaders node tree. This cause problem,
rotation socket is not supported in shader currently. This fix
just add check to ignore any unsupported sockets in shader and
to fix any related problem.

Pull Request: https://projects.blender.org/blender/blender/pulls/109410
2023-06-27 16:46:18 +02:00
Falk David
eb856f6fbb GPv3: Build group hierarchy for layer tree UI
This commit implements building of the layer tree hierarchy in the
layer tree UI.
Layer Groups that contain layers are now collapsible and visibility as well
as locking can be toggled.
2023-06-27 15:48:07 +02:00
Falk David
2f6d6d84d6 Fix: GPv3: Memory leak in reorder layer operator
In case the target layer was not found, the execute function of the
operator would leak the memory of the string.
2023-06-27 15:48:07 +02:00
Falk David
4bb600ef95 GPv3: Add functions to find layer groups by name
This commit adds `find_group_by_name` functions to the grease pencil
data. This is similar to the `find_layer_by_name` functions.
2023-06-27 15:48:07 +02:00
Falk David
5a9db0dd4c GPv3: Add initial layer group python API access
This adds a `groups` collection property to the grease pencil data
to access group information.
For now groups have a `name`, `hide`, and `lock` property.
2023-06-27 15:48:07 +02:00
Falk David
bf4e9ffbd9 GPv3: Add rename function for layer groups
This adds core functions to rename layer groups while preserving
name uniqueness.
2023-06-27 15:48:07 +02:00
Falk David
fee9801955 GPv3: Add caching of layer groups
Similar how nodes and layers are cached in a flat vector, this commit
adds caching of layer groups. This will be used e.g. by the python API
to access all the groups as a collection property.
2023-06-27 15:48:07 +02:00
Falk David
5967cb53e9 GPv3: Make visibility and lock state inheritable
This adds functions to check if a `LayerGroup` is visible or locked.
Additionally, visibility and the lock state is now inherited.
E.g. `Layer`s that are the children of a hidden `LayerGroup` will also
be hidden. This does not change their stored visibility. It just means
that the function `is_visible()` on the layers will return `false`.
The same applies for locking.
2023-06-27 15:48:07 +02:00
Philipp Oeser
258ba398ed Fix #109198: Enum properties don't display text in Dope Sheet sliders
`uiDefAutoButR` (or actually `uiDefButR_prop` > `ui_def_but_rna` later
down the line) has this behavior when "" string is passed in, it will
not display text on or next to the button.
This is of course desired in most scenarios -- it might even be desired
for non-icon enums in certain cases (though this is already a bit harder
to find cases for), so changing behavior in said functions is probably
not what we want.

The behavior - from the dopsheet sliders - would seem like a bug though.

Passing NULL (instead of "") to `uiDefAutoButR` results in properly
displaying the chosen item on the dropdown for enums, but for other
property types it would then show the property ui name alongside the
button (which is not what we want in the dopsheet, UI names are already
drawn there separately).

So now, pass "" or NULL conditionally (depending on property type
`PROP_ENUM`).

Pull Request: https://projects.blender.org/blender/blender/pulls/109205
2023-06-27 15:32:53 +02:00
Richard Antalik
91ff6457be Fix VSE ensuring handle adds duplicate handle.
This happened, because `SEQ_retiming_find_segment_start_handle()` does
not consider last handle as valid return value, so it was never checked
against.
2023-06-27 12:52:27 +02:00