Commit Graph

101188 Commits

Author SHA1 Message Date
Campbell Barton
7f0a8bcbbc Cleanup: quiet warnings 2023-07-13 09:54:05 +10:00
Harley Acheson
5f7e07e053 UI: Show SVG Thumbnails with Checkerboard Backgrounds
Show checkerboard background behind SVG thumbnails just as we do for
other image types.

Pull Request: https://projects.blender.org/blender/blender/pulls/110036
2023-07-13 01:36:07 +02:00
Hans Goudey
a3e05f06a6 Fix: Draw manager uses empty positions after recent refactor
Add an explicit empty check after 3d383d383f.
2023-07-12 17:09:51 -04:00
Harley Acheson
f56e589151 Cleanup: Make format
Just changes resulting from make format.
2023-07-12 14:06:46 -07:00
Ray Molenkamp
98336cb8ca USD: Use pre-compiled headers
bf_usd is a bit slow to build, and most time is spend on the front end
of the compiler parsing USD's headers.

this change enables pre-compiled headers for the most expensive
headers to parse.

When building `bf_usd` single threaded with -j1 (for accurate measurements)

```
before Wall time:      0h 4min 30sec 931 ms 504299 ns
after  Wall time:      0h 0min 50sec 808 ms 24399 ns
```

Pull Request: https://projects.blender.org/blender/blender/pulls/110027
2023-07-12 22:55:57 +02:00
Harley Acheson
565436bf5f UI: SVG Thumbnails
Allow SVG files to have previews in the File Browser. Adds
nanosvgrast.h to extern\nanosvg\, which is an SVG rasterizer that is
an optional part of the nanosvg source.

Pull Request: https://projects.blender.org/blender/blender/pulls/109567
2023-07-12 22:39:23 +02:00
Harley Acheson
b7a119c785 Fix #40059: Use Modifier Keys Between Windows on Win32
Use modifier keys that are pressed before activating a new window.
Allows call of `wm_window_update_eventstate_modifiers` on
`GHOST_kEventWindowActivate` by using `GetAsyncKeyState` instead of
`GetKeyState` in GHOST_SystemWin32::getModifierKeys, which retrieves
actual hardware state.

Pull Request: https://projects.blender.org/blender/blender/pulls/110020
2023-07-12 20:01:37 +02:00
Bastien Montagne
bf93fb0f46 Fix (unreported) incorrect behavior of liboverride hierarchy fixing code.
Code in charge of fixing invalid liboverride hierarchy roots would be
too agressive in re-assigning new root in replacement of old one. When
the invalid initial case was a 'low-level' type of ID (like a nodetree
e.g.), it could 'contaminate' many valid data (objects etc.) and force
them into its own local hierarchy.

This commit fixes the issue by storing all 'processed as valid' IDs into
a set, and ensuring that once an ID has been put into that set, its
hierarchy root is not changed anymore.

in other words, it changes the old behavior of 'last encountered hierarchy
wins' to 'first encountered hierarchy wins'. Since higher-level types of
IDs (like collections or objects) are processed first, this is the
most logical behavior too.
2023-07-12 19:20:49 +02:00
Clément Foucault
1f1c39b980 EEVEE-Next: Rework interactive sampling
This allow multiple effect to require different
amount of samples for interactive mode.
2023-07-12 19:02:29 +02:00
Hans Goudey
12d7f8e7c1 Fix #109840: Select similar crease broken after generic conversion
Thanks to Jesse Yurkovich for finding the issue, which was an incorrect
fallthrough that caused bevel weights to be used instead.
2023-07-12 12:41:44 -04:00
Clément Foucault
a635f8bbf7 EEVEE-Next: Fix uninitialized closure_bits_ 2023-07-12 18:18:38 +02:00
Brecht Van Lommel
9705f4cc56 Cleanup: rename GPU context in RenderEngine for consistency with other code 2023-07-12 18:14:11 +02:00
Brecht Van Lommel
b29d2c607d Fix #109718: Cycles crash with persistent data and bpy.ops.render
Don't reuse freed context for subsequent render.
2023-07-12 18:14:11 +02:00
Hans Goudey
9a879b27b3 Cleanup: Fix macOS build error, move set performance test out of header
Fixes, similar to a5a72019a9

Pull Request: https://projects.blender.org/blender/blender/pulls/110017
2023-07-12 18:04:13 +02:00
Jacques Lucke
75322803df Cleanup: move more editors folders to c++
This moves `space_script`, `space_statusbar`, `space_topbar`,
`space_userpref`, `space_view3d` and `util`.

Also see #103343.

Pull Request: https://projects.blender.org/blender/blender/pulls/110015
2023-07-12 18:02:56 +02:00
Germano Cavalcante
c284555d03 Cleanup: improve 'view3d_opengl_read_Z_pixels' comment
The comment implies that the operation is slow because it creates and
destroys a framebuffer.

Actually the slowness comes from forcing CPU-GPU synchronization.
2023-07-12 12:53:43 -03:00
Nate Rupsis
1837bda030 Animation: Make Vertex Weight Edit modifier inclusive
Update VertexWeighEdit modifier  Group Add / Remove threshold to be inclusive.

Additionally, add 3.6 backwards compatibility (4.0 versioning) to slightly offset Group Add / Remove threshold property value to make exclusive.

Pull Request: https://projects.blender.org/blender/blender/pulls/108286
2023-07-12 17:52:52 +02:00
Ray Molenkamp
769d18877b Cleanup: make format 2023-07-12 09:34:37 -06:00
Bastien Montagne
6f5f1737f3 Revert "LibOverride: Work around reset of system liboverrides on save."
This reverts commit 457b26aba3.

This change was not actually needed, actual issue was caused by
784d09a87c, and has been fixed by 1c0ffa1e18.
2023-07-12 17:26:13 +02:00
Julian Eisel
eee24c3378 UI: Avoid error print when using temporary region data
In some cases we store temporary region data that doesn't require
freeing. Code shouldn't expect the data pointer to be unset in this
case, so don't print an error.
2023-07-12 17:24:31 +02:00
Pratik Borhade
861931101c Fix #109994: Layer unlinks from the list when drop location is same
For drag-drop, drag node is first unlinked from existing position then
linked above or below the drop layer.

When drag and drop layers are same, layer is unlinked from listbase and
further linking fails because layer is not found in the listbase.

Pull Request: https://projects.blender.org/blender/blender/pulls/110009
2023-07-12 17:12:23 +02:00
Bastien Montagne
1c0ffa1e18 Fix mistake in recent change to liboverride cleanup of invalid operations.
Issue introduced by own 784d09a87c, would end up cleaning too many,
including valid liboverride operations.
2023-07-12 17:05:10 +02:00
Germano Cavalcante
f1fbe9a691 Cleanup: Remove redundant selection center calculation
NDOF Pan was calculating the selection center unnecessarily.

This was overlooked in 37d1d4cb07.

Getting the selection center is one of the heaviest operations during
navigation. Needs to be avoided as much as possible.
2023-07-12 11:37:22 -03:00
Brecht Van Lommel
3d86417777 Fix build error without unity build 2023-07-12 16:18:26 +02:00
Colin Marmond
1ebdd2d9cf Nodes: Move preview images to an overlay
Move the node previews to the overlay region, atop each node.
It allows nodes to keep the same size when the preview is toggled,
which is more convenient for large nodes and large nodetrees.

The preview has to be drawn from `node_draw_extra_info_panel`
because there could be overlapping between info text and the preview.
When the node is out of the view, it also has to make sure that the
preview is also out of the view before exiting the draw function.

Pull Request: https://projects.blender.org/blender/blender/pulls/108001
2023-07-12 16:14:12 +02:00
Hans Goudey
a5a72019a9 Cleanup: Move Map performance test out of header
Avoid including <unordered_map> in BLI_map.hh
for the performance test only used in the test file.
2023-07-12 09:45:25 -04:00
Jacques Lucke
3f33e0c6cd Cleanup: clang format in disabled code segments
This formats code that is disabled using `#if 0`. Formatting was achieved
by temporarily changing `#if 0` to `#if 1 /*something*/`, then formatting,
and then changing it back to `#if 0`.
2023-07-12 14:18:59 +02:00
Jacques Lucke
19d4cafb12 Cleanup: move more editors code to c++
This moves the remaining `.c` files in the following `editors` folders to C++:
`physics`, `screen`, `sound`, `space_buttons`, `space_file`, `space_graph` and `space_image`.

One exception is `fsmenu.c` which has platform specific issues on macos and
windows. E.g. the `Carbon/Carbon.h` include also declares a `Collection` type that collides
with ours.

Also see #103343.

Pull Request: https://projects.blender.org/blender/blender/pulls/109918
2023-07-12 13:43:00 +02:00
Jacques Lucke
38cecf9f89 Fix: simulation nodes baking does not work
This was accidentally broken in 7ec335f995.
There is a difference between resetting the `std::shared_ptr` and resetting
the cache.
2023-07-12 13:08:28 +02:00
Falk David
84c8c331b4 Fix: Complier error
The commit 64887c80a2 declared
rna_enum_grease_pencil_selectmode_items as static, when it should
have not been static.
2023-07-12 12:01:13 +02:00
Richard Antalik
5f17e0c796 VSE: Optimize cache linking
Pass key that is being removed to `seq_cache_relink_keys()`. This allows
to remove checks before calling the function. Also makes it possible to
assert, that links are actually pointing where they should be.
2023-07-12 10:50:45 +02:00
Falk David
09f8f4d049 GPv3: Add initial dopesheet support
This PR adds basic support for viewing layers and keyframes in the grease pencil dopsheet for the new grease pencil data-type.
Resolves #108508.

Co-authored-by: Amelie Fondevilla <amelie.fondevilla@les-fees-speciales.coop>
Pull Request: https://projects.blender.org/blender/blender/pulls/108807
2023-07-12 10:32:09 +02:00
Sietse Brouwer
64887c80a2 GPv3: Convert selection domain on curves when selection mode changes
When the selection mode in the Grease Pencil tool settings changes,
the selection domain of all curves in the active Grease Pencil object
has to change.
This PR handles that conversion. Point selections are converted to
curve selection and vice versa.

Note: this PR only takes care of selection modes 'Point' and 'Stroke'.
'Segment' mode is handled in a separate PR (#109221).

Pull Request: https://projects.blender.org/blender/blender/pulls/109964
2023-07-12 10:22:46 +02:00
Philipp Oeser
ac3f4e959f Fix #109822: Average Brush in Vertex Paint Mode is broken
Caused by 7a943428de

Looking at history, e.g. 575ade22d4 or prior, it seems the
"fallthrough" [related compiler warning was removed in 7a943428de] was
actually intended in the case of `VPAINT_TOOL_AVERAGE`.

So first, the average color is calculated and after that regular drawing
should happen with that color.

Now make this more clear by calling both `calculate_average_color` as
well as `vpaint_do_draw` before breaking.

Pull Request: https://projects.blender.org/blender/blender/pulls/109971
2023-07-12 09:45:21 +02:00
Harley Acheson
c6adafd8ef UI: add progress indicator variations & RNA API
Add pie and ring styles of progress indicators. Exposes progress bar to
the Python API and adds a "type" property to allow style variation.

This can be used for scripts & add-ons to show progress in the UI.

Ref !109882.

Co-authored-by: Campbell Barton <campbell@blender.org>
2023-07-12 14:00:39 +10:00
Campbell Barton
e63a77eeb8 Cleanup: rename uiButProgressbar to uiButProgress
Prepare for other types of progress to be added.
2023-07-12 13:31:46 +10:00
Campbell Barton
46815ac188 Cleanup: quiet warning for a NONULL argument being NULL
Only call BKE_pose_blend_write when the object has a pose.
2023-07-12 13:30:54 +10:00
Campbell Barton
f9316e4079 Cleanup: spelling in comments 2023-07-12 12:45:35 +10:00
Campbell Barton
d5c2c98314 Cleanup: remove redundant call to seq_cache_relink_keys
When all keys are removed there is no need to update links.
2023-07-12 12:41:33 +10:00
Campbell Barton
7af0c79722 Cleanup: add function attributes to BKE_action.h 2023-07-12 12:31:05 +10:00
Guillermo Venegas
6c3a2a033a Fix: wrong parameter order in BKE_action_frame_range_calc
Error in 2f2facef74.

Ref !109979.
2023-07-12 12:31:05 +10:00
Richard Antalik
02c87b1740 Fix possible use after free in VSE cache
Use `BLI_ghash_insert` instead of `BLI_ghash_reinsert` to store images.

VSE links stored cache keys for each frame in style of linked list.
These links must be maintained when any image/key is removed from the
cache. Reinserting can free key without proper relinking, which would
lead to accessing this freed key when cache limiting frees images in
a frame.

This should not happen since reinserting is prevented in
`seq_cache_put()`, but it's safer to assert, that key is not stored in
hash instead.
2023-07-12 03:36:14 +02:00
Hans Goudey
c728fa0663 Cleanup: Simplify retrieving color attribute, improve const correctness
Make it harder to retrieve a mutable attribute from const a const mesh,
and use the attribute search function to check multiple domains and
colors at once.
2023-07-11 16:50:34 -04:00
Jacques Lucke
3d73b71a97 Geometry Nodes: new Repeat Zone
This adds support for running a set of nodes repeatedly. The number
of iterations can be controlled dynamically as an input of the repeat
zone. The repeat zone can be added in via the search or from the
Add > Utilities menu.

The main use case is to replace long repetitive node chains with a more
flexible alternative. Technically, repeat zones can also be used for
many other use cases. However, due to their serial nature, performance
is very  sub-optimal when they are used to solve problems that could
be processed in parallel. Better solutions for such use cases will
be worked on separately.

Repeat zones are similar to simulation zones. The major difference is
that they have no concept of time and are always evaluated entirely in
the current frame, while in simulations only a single iteration is
evaluated per frame.

Stopping the repetition early using a dynamic condition is not yet
supported. "Break" functionality can be implemented manually using
Switch nodes in the  loop for now. It's likely that this functionality
will be built into the repeat zone in the future.
For now, things are kept more simple.

Remaining Todos after this first version:
* Improve socket inspection and viewer node support. Currently, only
  the first iteration is taken into account for socket inspection
  and the viewer.
* Make loop evaluation more lazy. Currently, the evaluation is eager,
  meaning that it evaluates some nodes even though their output may not
  be required.

Pull Request: https://projects.blender.org/blender/blender/pulls/109164
2023-07-11 22:36:10 +02:00
Ray Molenkamp
9547e7a317 Fix: shader_builder build issue
The blenkernel cleanup commit from this morning
forgot to update the shader builder.
2023-07-11 14:20:31 -06:00
Hans Goudey
282993e75f Cleanup: Simplify RNA access of attribute data type and domain 2023-07-11 15:43:48 -04:00
Hans Goudey
f0b53777c8 Cleanup: Use spans and float3 to store sculpt and PBVH vert positions
Also store the allocated deformed positions in a separate array in PBVH,
so there isn't one pointer that _sometimes_ has ownership of its data.

Pull Request: https://projects.blender.org/blender/blender/pulls/109981
2023-07-11 21:01:53 +02:00
Hans Goudey
90ba798885 Cleanup: Remove file added mistakenly in previous commit 2023-07-11 14:54:54 -04:00
Hans Goudey
be09e94f05 Cleanup: Remove unused animation channel type
Unused after f3f05daf11
2023-07-11 14:50:29 -04:00
Hans Goudey
f5ffdafea2 Fix: Node operators crash when using depsgraph
The scene time node and volume nodes crashed, since the despgraph
needs to be retrieved from the operator data instead of modifier data.
2023-07-11 13:38:25 -04:00