Commit Graph

126005 Commits

Author SHA1 Message Date
Campbell Barton
1dec7189ed Fix '--help' message error in code_clean when '%' characters were used 2023-07-13 09:54:05 +10:00
Campbell Barton
0e10173c2d Cleanup: function style casts for C++, nullptr & other minor changes 2023-07-13 09:54:05 +10:00
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 3d383d383f8ec68a127a.
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
aa700821a8 Extern: Update NanoSVG
Update to current version of NanoSVG

Pull Request: https://projects.blender.org/blender/blender/pulls/109948
2023-07-12 21:27:00 +02:00
Harley Acheson
65e8b21a95 Fix #109525: Improved Win32 Repeat Key Filtering
Allows Win32 key repeat filtering to support multiple simultaneously
repeating keys, as can happen with modifiers. Removes
m_keycode_last_repeat_key and instead checks current down status.

Pull Request: https://projects.blender.org/blender/blender/pulls/109991
2023-07-12 20:55:00 +02:00
Germano Cavalcante
75658109be Fix #109630: Grave and Single Quote keys not being detected on MacOS
The `UCKeyTranslate` function was being used wrong.

The `deadKeyState` param should use `kUCKeyTranslateNoDeadKeysMask`
instead of `kUCKeyTranslateNoDeadKeysBit` (optionally could also use
`(1 << kUCKeyTranslateNoDeadKeysBit`)).

This commit also dispenses with accessing the keyAction, as this is not
crucial for determining the key.

Comments have also been added to better describe the code.

Pull Request: https://projects.blender.org/blender/blender/pulls/109987
2023-07-12 20:06:43 +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
7f04df62e4 Fix Cycles division by zero in recent distant light texture coordinates 2023-07-12 18:14:11 +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 a5a72019a910952ac082e9613e95d0c672cf2964

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
Ray Molenkamp
1058fd1b2b Ghost: Fix build error with MSVC 17.7 preview 3
the initialization of m_pkts with an int threw an error with
17.7P3 since it decided int -> uint64_t required a narrowing
conversion. Not sure why it got picky here all of a sudden
but given it's not wrong, we may as well fix it properly.

This change changes the queueSize parameter to size_t and
adds a bounds check at the calling site to ensure the value
it gets will be positive before casting.
2023-07-12 09:32:35 -06:00
Bastien Montagne
6f5f1737f3 Revert "LibOverride: Work around reset of system liboverrides on save."
This reverts commit 457b26aba333f091a3abadef4fb37214604f34a9.

This change was not actually needed, actual issue was caused by
784d09a87c, and has been fixed by 1c0ffa1e1816a5.
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 7ec335f99543f20b3b8ebfc6c33c420a55060387.
There is a difference between resetting the `std::shared_ptr` and resetting
the cache.
2023-07-12 13:08:28 +02:00
Weizhen Huang
0b3efc9d8c Cleanup: Cycles: remove SHARP distribution internally
this option was already unselectable in the UI, and is treated as GGX
with zero roughness. Upon building the shader graph, we only convert a
closure to `SHARP` when option Filter Glossy is not used and the
roughness is below certain threshold. The benefit is that we can avoid
calling `bsdf_eval()` or return earlier in some cases, but the thresholds
vary across files.
This patch removes `SHARP` closures altogether, and checks if the
roughness value is below a global threshold `BSDF_ROUGHNESS_THRESH`
after blurring, in which case the flag `SD_BSDF_HAS_EVAL` is not set.
The global threshold is set to be `5e-7f` because threshold smaller than
that seems to have caused problem in the past (c6aa0217ac). Also removes
a bunch of functions, variables and arguments that were only there
because we converted closures under certain conditions.

Pull Request: https://projects.blender.org/blender/blender/pulls/109902
2023-07-12 12:36:31 +02:00
Falk David
84c8c331b4 Fix: Complier error
The commit 64887c80a2a93036073c85f280ce78dcc363e0ee declared
rna_enum_grease_pencil_selectmode_items as static, when it should
have not been static.
2023-07-12 12:01:13 +02:00
Dalai Felinto
157f1dfc81 Cleanup: make format 2023-07-12 11:55:18 +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 7a943428de7b

Looking at history, e.g. 575ade22d4de or prior, it seems the
"fallthrough" [related compiler warning was removed in 7a943428de7b] 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
Matias Caamaño
58b34917e5 Fix #109086: Center Safe Areas missing parameter
Add the "Center Action Safe Margin" that was missing in VSE UI.

Pull Request: https://projects.blender.org/blender/blender/pulls/109944
2023-07-12 08:28:30 +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