Commit Graph

104421 Commits

Author SHA1 Message Date
Campbell Barton 1e66938d7a Cleanup: spelling in comments, format 2023-11-07 11:35:16 +11:00
Campbell Barton c450b5f2b8 Cleanup: use full sentences in writefile.cc, minor clarifications
Also correct doxy-sections.
2023-11-07 11:31:02 +11:00
Campbell Barton 79840a9ec6 Cleanup: early returns in BLF, use full scentences 2023-11-07 11:31:01 +11:00
Julian Eisel 480dceab12 Asset shelf: Drag over checkboxes to enable/disable catalogs in selector
Makes it possible to swipe over the checkboxes used to enable or disable
catalogs in the asset catalog selector popup, to batch enable or disable
the ones dragged over.

Might also enable this feature for other cases where checkboxes are
displayed.
2023-11-06 22:22:54 +01:00
Julian Eisel 837e33c054 Merge branch 'blender-v4.0-release' 2023-11-06 21:54:33 +01:00
Julian Eisel abe925d0c6 Fix #114436: Crash when right clicking certain, nested, popup dialogs
`CTX_wm_region()` isn't reliable with popups. Handling should use
`uiHandleButtonData.region` instead, which respects popup regions.
2023-11-06 21:53:41 +01:00
Miguel Pozo 0db6d8a5fc EEVEE-Next: Fix shadow tests
Fix an issue in `find_first_valid` where Nvidia would incorrectly
increment `src` after return.
This should fix the issue where some tiles would stay corrupted
until resetting EEVEE.

Initialize tiles_data in `TestAlloc` so it doesn't fail in debug builds.

Pull Request: https://projects.blender.org/blender/blender/pulls/114550
2023-11-06 20:35:14 +01:00
Aras Pranckevicius 6e4adbe694 Cleanup: use_holes arg to isect_point_poly_v2 has been ignored since 2013
07851dd8df made the use_holes argument be no longer used.
2023-11-06 20:51:21 +02:00
Aras Pranckevicius 03bbdd804c Cleanup: move math_geom.c to c++ 2023-11-06 20:51:13 +02:00
Brecht Van Lommel adb41fe6b2 Merge branch 'blender-v4.0-release' into main 2023-11-06 19:13:18 +01:00
Brecht Van Lommel 0dad164505 Fix #114540: macOS crash on startup after recent changes in c2b755a3c0
Thanks to Michael Parkin-White for finding the cause.

Ref #114513
2023-11-06 18:37:45 +01:00
Bogdan Nagirniak 10848b9774 Fix #114229: Hydra MaterialX crash when node name starts with digit
Pull Request: https://projects.blender.org/blender/blender/pulls/114471
2023-11-06 18:11:38 +01:00
Alaska f1116f64bd Fix #114435: Harsh Principled BSDF Subsurface transition in EEVEE
Fixes a harsh transistion between diffuse and subsurface scattering
materials in the Principled BSDF as a user increases the Subsurface
Scattering Weight from 0 to 1.

Pull Request: https://projects.blender.org/blender/blender/pulls/114500
2023-11-06 17:25:14 +01:00
Thomas Barlow 9956ef4622 PyAPI: Allow prop collection raw array read access for non-editable props
Non-editable prop collection items would always fall back to the slower
loop in `rna_raw_access`.

This patch changes `RNA_property_collection_raw_array` to only fail with
non-editable items when intending to set values, allowing for the faster
raw array access to occur when reading values in `rna_raw_access`.

This brings the Python API `bpy_prop_collection.foreach_get` performance
of `Mesh.vertex_normals`/`polygon_normals`/`corner_normals` up to the same
speed as generic `FLOAT_VECTOR` attributes with the same domains.

Given a mesh with 393216 corners:

Using `foreach_get` with the "vector" prop and a compatible buffer object:
- Corner vector attribute: ~0.9ms
- Corner normals (before): ~7.9ms
- Corner normals (after):  ~0.9ms

Using `foreach_get` with the "vector" prop and a Python list:
- Corner vector attribute: ~11.0ms
- Corner normals (before): ~18.0ms
- Corner normals (after):  ~11.0ms

Pull Request: https://projects.blender.org/blender/blender/pulls/114063
2023-11-06 15:51:07 +01:00
Miguel Pozo 6d0b5e2ace EEVEE-Next: New shadow settings
Remove `Material > Shadow Mode` and use `Object > Shadow Ray Visibility`
and `Material > Transparent Shadows` instead.

The versioning system auto-updates objects/materials in EEVEE
scenes so their behavior is as close as possible to the previous one.

Update Cycles to use the native `use_transparent_shadow` property.

Note:
Material changes don't set any `recalc` flag on the objects that use
them, so the EEVEE Next shadow maps don't update when changing
settings/nodes.
Fixing this issue is required for 4.1, but it's out of the scope of this PR.

Pull Request: https://projects.blender.org/blender/blender/pulls/113980
2023-11-06 15:45:00 +01:00
Omar Emara 5258b17ef6 Fix #114260: Compositor sometimes produces straight alpha
The compositor sometimes produces straight alpha even though
premultiplied alpha is expected. Moreover, there is an inconsistency
between the CPU and GPU compositors.

For the GPU compositor, this is because GPU textures sometimes store
straight alpha, while the compositor always expects premultiplied alpha,
so we need to premultiply the alpha in those cases.

For the CPU compositor, this is because the image operation didn't
premultiply the alpha of byte textures, so we need to ensure
premultiplied alpha in those cases.

There is a data loss issue in case of byte images, since the IMB module
unpremultiplies premultiplied images then the compositor premultiplies
it again. But this will be handled in a different patch since it require
some design and refactoring first.

Pull Request: https://projects.blender.org/blender/blender/pulls/114305
2023-11-06 15:15:22 +01:00
Bastien Montagne e31a05b56f Merge branch 'blender-v4.0-release' 2023-11-06 12:49:05 +01:00
Falk David 2529aa6584 GPv3: Include current frame in multi-frame editing
When enabling multi-frame editing, also include the current frame
as editable. Not just the selected frames in the dopesheet.
This was a regression introduced in #114283.
2023-11-06 12:29:33 +01:00
Bastien Montagne 551927bbe3 Fix crash when opening AssetShelf the first time, in some cases.
When click-dragging on the 'up-arrow' of the asset-shelf to show it the
first time, some resizing operation could get called before the shelf
region was initialized, leading to crash on null pointer access.
2023-11-06 11:58:41 +01:00
Pratik Borhade e5327fa5b7 Fix #114521: Walk navigation global up does not work
Mistake in 93f6001683

Pull Request: https://projects.blender.org/blender/blender/pulls/114526
2023-11-06 11:24:36 +01:00
Campbell Barton c2b755a3c0 Cleanup: remove unsafe string API use for MTL shader generation on macOS
Ref !114513
2023-11-06 21:23:08 +11:00
Sybren A. Stüvel 45c74d8c9f Fix array out-of-bounds in VSE drawing code
Change `bg_colors[4]` to `bg_colors[3]` as the array has only 4 elements.
2023-11-06 11:02:07 +01:00
Campbell Barton f533fade0f Merge branch 'blender-v4.0-release' 2023-11-06 20:58:21 +11:00
Campbell Barton 27bb822511 Cleanup: remove unused variable 2023-11-06 20:58:11 +11:00
Campbell Barton c7afbbc836 Fix potential buffer overflow in strcpy use on macOS
The null byte wasn't taken into account when allocating memory
to strcpy into.

The calculation to check if allocation was needed  was also wrong,
causing allocation for every string.

In practice it's not so likely users would ever hit this since
the function tended to over allocate, even in the case an off by one
error occurred, in all likelihood the room would already be available.

Ref !114512
2023-11-06 20:54:21 +11:00
Omar Emara 99712d17fd Merge branch 'blender-v4.0-release' 2023-11-06 11:49:24 +02:00
Omar Emara 54e35e7388 Nodes: Draw using draw_color_simple as a fallback
If the draw_color method is not defined, try to use draw_color_simple as
a fallback. If not defined either, fallback to a magenta color.

The patch also updates the description of the method to clarify its use.

Pull Request: https://projects.blender.org/blender/blender/pulls/114527
2023-11-06 10:47:32 +01:00
Richard Antalik fe4f895214 Merge branch 'blender-v4.0-release' 2023-11-06 06:09:38 +01:00
Richard Antalik 0ca1e70de1 Fix #114434: Separate Images operator produces duplicate strips
Caused by typo - it has assigned `SEQ_SINGLE_FRAME_CONTENT` to `seq`,
while it should have been assigned to `seq_new`.
2023-11-06 06:08:52 +01:00
Richard Antalik 6eab42555c Cleanup: VSE cache drawing
Use `sequencer_visible_strips_get()` to iterate over strips, refactor
the code, so background drawing has own function and de-duplicate the
code.
2023-11-06 05:07:39 +01:00
Richard Antalik 2add7c9f78 Cleanup: Remove unnecessary typedefs 2023-11-06 04:21:09 +01:00
Richard Antalik 18ac16e592 Cleanup: VSE strip drawing readability
Decouple strip ordering logic from iteration.
2023-11-06 03:47:16 +01:00
Richard Antalik 41e030d2a5 Cleanup: Refactor VSE strip highlighting
Selected active strip highlights effect inputs and input channels for
multicam strips. This was done as 3rd pass in `draw_seq_strips()`.
4th pass was highlighting strip when doing solo preview.

Now this is added to a column of functions in `draw_seq_strip()`.

Highlighting effect input and solo preview is done when drawing actual
highlighted strip, but this is still done via alpha blending.

Highlighting multicam has to be done as alpha blending since this is
done by drawing rectangle over whole channel.
2023-11-06 03:10:19 +01:00
Richard Antalik 7673fc7d53 Cleanup: VSE: Strip drawing code readability
Originally code iterated twice over whole listbase with a lot of
preconditions to draw unselected, then selected strips.

Use `sequencer_visible_strips_get()` to get vector of visible strips,
split iteration in 2 separate loops.
Also move `special_seq_update` case to own function.
2023-11-06 02:20:42 +01:00
Richard Antalik 3fccfe0bc6 VSE: Use C++ containers for strip iteration
Use `VectorSet`, `Vector` or `Span` instead of `SeqCollection` struct.
It is now possible to use native `for` loops and `SEQ_ITERATOR_FOREACH`
macro can be removed.

Another feature is, sets of strips no longer needs to be freed. However,
this poses a limitation, that query functions can not be used in case,
where these sets need to be available outside of scope where they are
created.

Pull Request: https://projects.blender.org/blender/blender/pulls/111909
2023-11-06 01:36:44 +01:00
Campbell Barton 93f6001683 Cleanup: use explicit global/local naming for walk flags
Also remove the "Global" prefix from the modal key-map items
as this takes space in the status text.
2023-11-06 09:45:22 +11:00
Campbell Barton b66378bf00 Cleanup: use "g_" prefixed static walk variables, enable strict flags 2023-11-06 09:45:22 +11:00
Campbell Barton 361bd68f21 Fix error in recent cleanup to walk mode
[0] caused gravity not to work properly.

[0]: 1b3cfcc74f
2023-11-05 22:33:44 +11:00
Campbell Barton 02f0abe331 Cleanup: use full sentences as comments, blocks around case statements 2023-11-05 18:32:42 +11:00
Campbell Barton 1b3cfcc74f Cleanup: use enum types and improve argument naming for walk mode 2023-11-05 18:32:41 +11:00
Aaron Franke c62009a6ac 3D View: add local up/down movement to walk navigation
Minor usability enhancement for the walk navigation mode. Previously
walk navigation had local movement for forward/back/left/right,
but only global movement for up/down.
This PR adds local up/down movement, bound to the R and F keys.

Ref: !111682
2023-11-05 17:23:59 +11:00
Campbell Barton efef0bac5f CMake: remove redundant white-space as part of multi-line strings 2023-11-04 16:41:19 +11:00
Campbell Barton 243516e1d3 Cleanup: quiet warning from missing include 2023-11-04 14:34:45 +11:00
Campbell Barton 134393e846 Cleanup: spelling in comments 2023-11-04 14:08:13 +11:00
Campbell Barton 10e7d5da84 Cleanup: remove unused variables 2023-11-04 14:08:11 +11:00
Bastien Montagne 9b0ea21a5b USD: Fix Export progress report.
This progress report was utterly broken and useless when not exporting
animations, and not great either with animation export. This commit
fixes:
* Not generating any progress report when exporting a single frame.
* Assuming actual data export covers 100% of progress.

That last point is the biggest change, now actual export (be it
animated or still) only covers 75% of the whole range. The rest is used
to cover depsgraph building and updates (which can be noticiably slow
with big scenes), stage writing, etc.

Progression is still far from linear in time, but at least it gives
better feedback on actual progress of the whole export.

Pull Request: https://projects.blender.org/blender/blender/pulls/114416
2023-11-03 18:00:45 +01:00
Aras Pranckevicius 6833202ab3 PLY: improve import of custom vertex normals
Several improvements how PLY files containing vertex normals are imported:
- When they are present on a regular mesh, the code no longer sets
  all faces as "flat" (since that makes custom normals be ignored).
- When they are present on a pure point cloud (i.e. no faces),
  custom vertex normals are added as a float3 point domain attribute
  (ref #114371).
2023-11-03 17:41:27 +02:00
Sergey Sharybin 27faf83fff Merge branch 'blender-v4.0-release' 2023-11-03 15:41:29 +01:00
Sergey Sharybin e623d07362 Fix missing relations built for camera referenced by markers
A missing part since PR #110139: the nodes and relations builders
needs to be in-sync and build the same objects. The relations builder
was missing relations building for camera referenced by markers.

Pull Request: https://projects.blender.org/blender/blender/pulls/114443
2023-11-03 15:41:05 +01:00
Miguel Pozo e3d4db5ded Fix: EEVEE-Next: Planar display probe shader compilation 2023-11-03 15:26:19 +01:00