Commit Graph

100951 Commits

Author SHA1 Message Date
Sergey Sharybin
e1b60fdb91 Remove Z Buffer from ImBuf
It was only used by OpenEXR and Iris images, and saving the Z Buffer
in those formats was disabled by default. This option comes from the
times prior to the addition of the Multilayer EXR.

It also worth noting that it was not possible to save Iris with Depth
pass from Blender as internally it is called IRIZ format and it was
not exposed. But even after exposing this format option something still
was missing as saving and loading ITIZ did not show up the Depth pass.

The reason of removal is to make it a more clear match of the ImBuf
with a render pass, and use it instead of a custom type in the render
result and render pass API. This will simplify the API and also avoid
stealing buffers and making shallow copies when showing the render
result.

For the cases when Depth is needed a Multilayer EXR is to be used,
as most likely more than just the Depth will be needed.

On a user level this change:

- Removes the "Z Buffer" option from the interface.

- It preserves existing sockets in compositor nodes, but it will
  output black image. Also changing the image data-block will
  remove the socket unless a Multilayer EXR with Depth pass image
  is selected.

- Removes "Depth" socket of the Viewer and Composite nodes.

Ref #108618

Pull Request: https://projects.blender.org/blender/blender/pulls/109687
2023-07-04 17:03:02 +02:00
Falk David
61d5ff1409 GPv3: Add function to insert frames with duration
Adds a new function to insert a frame with a duration on a layer.
Also adds tests for the edge cases.

This introduces the concept of a `null-frame`.
It can be created with `GreasePencilFrame::null()` and checked for with
`is_null()`.
The purpose of a `null` frame is to indicate the end of whatever frame
comes before it. This way, the frames map does not need to store
the duration of frames. The duration is always implied by the distance
to the next frame.
2023-07-04 16:38:55 +02:00
Bastien Montagne
715bc6b200 Outliner: Fix assert on unreachable code in LibOverride view.
Collections also suport replacing their values in some case (e.g. when
it's a collection of ID pointers).
2023-07-04 16:36:32 +02:00
Brecht Van Lommel
948fccbd35 Fix #109598: Xcode build with Address Sanitizer failing
When using ASAN without WITH_COMPILER_ASAN, for example when enabling it
in Xcode, some symbols would be missing from makesdna. Instead just always
include them, there's no harm in it.

Also deduplicate some code.

Pull Request: https://projects.blender.org/blender/blender/pulls/109666
2023-07-04 15:22:33 +02:00
Julian Eisel
417011a2a3 Fix MSVC compile error and warning on Clang 2023-07-04 15:15:18 +02:00
Germano Cavalcante
c0d230e0b8 Revert "Transform: Allow navigation by default"
This reverts commit d53862351d.

After conducting tests with artists at the studio, it was observed that
altering the Transform Modal Maps caused significant disruption due to
the heavy reliance on the "Proportional Editing" and "Automatic
Constraint" features.

Considering this, it is now deemed more beneficial to provide users
with the choice of adapting their muscle memory to the new changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/109660
2023-07-04 14:53:39 +02:00
Hans Goudey
1b4b90f5f7 Cleanup: Remove unnecessary C API for asset representation
Now that almost all code is in C++, this is unnecessary and
just confuses things with multiple entry points to the same code.

Pull Request: https://projects.blender.org/blender/blender/pulls/109661
2023-07-04 14:46:19 +02:00
Clément Foucault
90448b8b5a GPU: Replace std::cout by std::cerr for dependency errors
This allow seeing them during the build process
2023-07-04 12:45:28 +02:00
Clément Foucault
3d76a75d9f GPU: Metal: Make 32bit depth promotion backend side
Doing the promotion on the internal GPU texture format
created a bug in `draw::Texture::ensure_impl` where
the texture would be constantly being recreated.
2023-07-04 12:18:28 +02:00
Damien Picard
445d71a577 I18n: translate missing geometry node attribute tooltips
As remarked by Harley Acheson in !109163, some tooltip lines regarding
geometry nodes attributes were not translated. They are basically just
bullet points followed by an actual line of text so they may not seem
important, but given that list items may not use the same bullet
points in all languages*, and other items are already translatable, it
makes sense to also translate these ones.

* For instance, the bullet point character used in Japanese is the
KATAKANA MIDDLE DOT, a monospaced variant.

Pull Request: https://projects.blender.org/blender/blender/pulls/109384
2023-07-04 09:53:23 +02:00
Jeroen Bakker
bfda24cae3 Fix: Update Stubs for Shader Builder
Issue introduced by recent changes where `BKE_pbvh_count_grid_quads`
required C++ linkage.
2023-07-04 08:09:38 +02:00
Joseph Eagar
3004198866 Sculpt: Fix #109555: Small object scales break sculpt
Caused by floating point overflow.
2023-07-03 22:28:21 -07:00
Jesse Yurkovich
5c37e2123e Fix #109442: Match previous behavior when loading BC5 DDS images
Prior to using OIIO for image loading, DDS files were hard-coded to
always treat files with BC5/ATI2 compression as normal maps[1].

This basically means that the B channel would be reconstructed from the
R,G channels in a particular way. There is a non-standard header flag
(coming from tools like NVTT and various others) that can also be used
to indicate if such processing should take place, and OIIO understands
that flag and acts appropriately.  However, not all files have that flag
set.

This patch reverts to the hard-coded behavior to match prior versions.
If the user has explicitly set the OIIO environment variable to say
otherwise, we will respect that setting instead.

[1] https://projects.blender.org/blender/blender/src/branch/blender-v3.5-release/source/blender/imbuf/intern/dds/DirectDrawSurface.cpp#L870

Pull Request: https://projects.blender.org/blender/blender/pulls/109541
2023-07-04 07:25:42 +02:00
Chris Blackbourn
9da64ac391 Fix #109673: Fix crash in debug builds when using uv unwrapper
Add NULL check to #BLI_rng_free which has `ATTR_NONNULL`
2023-07-04 16:48:06 +12:00
Pratik Borhade
0ade0959d4 Fix: Compiler error due to missing header
Caused by 9753e70e37
`BLI_string_replace_char` is used in thumbs.cc but header
was missing
2023-07-04 09:13:27 +05:30
Joseph Eagar
f031d7fbf3 Cleanup: remove duplicate function declaration. 2023-07-03 20:11:07 -07:00
Joseph Eagar
7e2659e4ab Cleanup: Split BKE_pbvh.h into BKE_pbvh_api.hh
Split much of BKE_pbvh.h into BKE_pbvh_api.hh.
BKE_pbvh.h is included by BKE_paint.h, which in
turn is included by large amounts of code including
RNA.

This makes it extremely difficult to change
or clean up the PBVH API, since each modification
of BKE_pbvh.h can take 20-30 minutes to compile,
even on a quad-core system with an SSD. This
commit fixes that by moving most of BKE_pbvh.h
into another file and just having the core,
external-facing interfaces in BKE_pbvh.h.
2023-07-03 20:01:04 -07:00
Campbell Barton
5c4510d39e Cleanup: update code comment for DNA_struct_get_compareflags
Translate (last?) Dutch text in Blender's source.
2023-07-04 12:37:22 +10:00
Campbell Barton
9e26960b77 Cleanup: code-comments 2023-07-04 12:36:41 +10:00
Campbell Barton
2b30e5ba05 Cleanup: remove unsafe strcat, strcpy, sprintf in non-blender utilities
Use BLI_string in makesrna, makesdna.
2023-07-04 12:02:26 +10:00
Campbell Barton
9753e70e37 Cleanup: move BLI_str_replace into BLI_string_utils.h
String search & replace is a higher level function (unlike BLI_string.h)
which handlers lower level replacements for printing and string copying.

Also use BLI_string_* prefix (matching other utilities).

This makes it possible to use BLI_string in Blender's internal utilities
without depending on DynStr, MemArena... etc.
2023-07-04 12:02:25 +10:00
Campbell Barton
bcdba3516b Cleanup: remove unused variable 2023-07-04 12:02:24 +10:00
Alice Scarlett
9cd07da339 Fix VSE subtitle export indexing
Some programs have trouble parsing .srt files if first index is 0.

While there doesn't seem to be any official specs for the .srt file
format, all resourses I could find online start indexing at 1. This
commit makes Blender's .srt exports start at 1 instead of 0.

Pull Request: https://projects.blender.org/blender/blender/pulls/107997
2023-07-04 03:55:44 +02:00
Chris Blackbourn
4f6ce68500 UV: Add "Invert Pins" to the menu in the uv editor
Thanks Robert Rioux for the suggestion.

Pull Request: https://projects.blender.org/blender/blender/pulls/109187
2023-07-04 02:46:23 +02:00
Hans Goudey
a3bfd6e20d Cleanup: Extract utility for counting indices
This utility counts the number of occurrences of each index in an array.
This is used for building mesh topology maps offsets, or for counting
the number of connected elements. Some users are geometry nodes,
the subdivision draw cache, and mesh to curve conversion.

See #109628
2023-07-03 18:47:03 -04:00
Clément Foucault
91d15a3613 EEVEE-Next: Fix shader compilation on Metal 2023-07-03 23:08:53 +02:00
Germano Cavalcante
5ea561b51c Cleanup: Use Vector and Matrices types in C++ 2023-07-03 16:20:52 -03:00
Germano Cavalcante
bc3ec100c2 Cleanup: Remove redundant code in Snap To Nearest
Result registration is already done in `SnapData::register_result`.
2023-07-03 16:20:52 -03:00
Germano Cavalcante
d0bbae8596 Fix #109641: Snapping doesn't respect Clipping Border
The clip planes in `rv3d->clip` were not being added.
2023-07-03 14:37:33 -03:00
Sergey Sharybin
5907ab0364 Fix redefinition SSE2NEON_PRECISE_SQRT on Apple Silicon
After some recent changes BLI_math_base got (indirectly) included
from DNA file, causing defines conflict in Cycles: Cycles wants the
default fast behavior of square root, and BLI color wants it to be
more preciese.

Proposed solution is to move the SSE block away from the math_base
closer to code which uses it. The initial intent was to make those
functions reusable, but for a long long time the color utilities
are the only users of those functions.

This change does not prevent the error from re-occurring in the
future if some code includes sse2neon and BLI color utilities, but
it makes such conflict situation much less likely to happen, for
now.

The downside of this change is that the code now need to include
BLI_simd.h explicitly to access BLI_HAVE_SSE2 instead of relying
on it being included indirectly with math headers. The mitigation
for this is to change semantic of the BLI_HAVE_SSE2: now it is
defined to 1 if SSE2 is supported and to 0 otherwise. This makes
it so the code needs to check if using `#if BLI_HAVE_SSE2` and
if the BLI_simd.h is not included it will generate warning when
using GCC or Clang.

This change in semantic is is something the current patches would
need to ensure is handled correctly.

Pull Request: https://projects.blender.org/blender/blender/pulls/109664
2023-07-03 19:18:30 +02:00
Sergey Sharybin
4cd10ddfdb Fix naive 4x4 matrix multiplication C++ implementation
Is not visible on any of the officially platforms, as everywhere
SSE2 is available (on Apple Silicon via sse2neon).

Only got noticed by some intermittent issue during development
which made BLI_HAVE_SSE2 unaccessible.

Seems that transpose was done a bit wrong. Not sure if worth trying
to fold the equation into C++ types, as that requires extra memory
transfers for transpose. Opted for a more naive folding, which
avoids extra copies.

Added a regression test for it, verified against numpy, the BLI
SSE2 implementation.
2023-07-03 19:18:28 +02:00
Germano Cavalcante
6abf253689 Fix #109633: 'Project Individual Elements' for 'Vert/Edge Slide'
`Project Individual Elements` was never supported for `Vert Slide` and
`Edge Slide`, however, albeit erroneously, this option still affected
those operations.

In Blender 3.6 this situation of `Project Individual Elements`
affecting the result, has been "fixed". But users still preferred the
old behavior.

Therefore, instead of falling back to `Snap To Face`, support
`Project Individual Elements` for `Vert Slide` and `Edge Slide`.

This is more like how it worked previously.
2023-07-03 12:30:56 -03:00
Falk David
3d99d05f00 GPv3: Add separate paint mode
This patch adds a separate paint mode for Grease Pencil 3.0.

Pull Request: https://projects.blender.org/blender/blender/pulls/109453
2023-07-03 16:34:30 +02:00
Miguel Pozo
9c955a20fe EEVEE Next: Use draw_gpencil_new
Avoid shader validation errors from overlapping resources.
GPencil drawing is not fully implemented yet, so this doesn't cause any functional change.
2023-07-03 16:01:49 +02:00
Julian Eisel
ed38ef31f7 UI: Fix view item context menu not using context from button
Needed for the asset shelf context menu to work, see #104831.

Ensures the view item button's context is passed on to the context menu.
Otherwise it cannot display operators relying on this context.
2023-07-03 15:55:34 +02:00
Jeroen Bakker
590f3582c9 Eevee-next: Lookdev HDRI Switcher
This PR adds support to override the world with the HDRI of the
viewport.

Blurring of the background and camera based rotation isn't supported.
Switching the HDRI would still use the world diffuse light as that is
baked into the irradiance cache.

These issues have been added to #109646

![image](/attachments/2613adff-064a-4f81-8bdd-f687ab8ffcfb)

Pull Request: https://projects.blender.org/blender/blender/pulls/109548
2023-07-03 15:34:11 +02:00
Falk David
de95539ced Cleanup: Rename grease pencil modes to legacy
Renames `OB_MODE_EDIT_GPENCIL`, `OB_MODE_PAINT_GPENCIL`,  `OB_MODE_SCULPT_GPENCIL`,  `OB_MODE_WEIGHT_GPENCIL`, `OB_MODE_VERTEX_GPENCIL, and the context modes` to `*_LEGACY`.

Pull Request: https://projects.blender.org/blender/blender/pulls/109648
2023-07-03 15:15:54 +02:00
Julian Eisel
0d1f3f445a UI: Support page based scrolling in View2D
No user visible changes expected. The feature is not exposed yet.

For the asset shelf (#102879), design is to use a paginated scrolling
style. That means, that any scrolling will always snap to a multiple of
the page size (the size used when pressing the Page Up/Down keys).
Together with strict region size snapping (implemented in the asset
shelf patch, #104831), this gives a clean scrolling experience where
partially visible rows are avoided (impossible even).

Introduces:
- `View2D.flag` value `V2D_SNAP_TO_PAGESIZE_Y`, which will cause any
  scrolling to only use multiples of the page size.
- A custom page size via `View2D.page_size_y` for when the full region
  size is not the appropriate page size value.
- API function `UI_view2d_offset_y_snap_to_closest_page()` to enforce
  the snapping from outside View2D. The asset shelf uses this to keep
  strict scrolling over DPI changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/109154
2023-07-03 15:15:18 +02:00
Jeroen Bakker
c6c69c0656 Eevee-next: Octahedral mapping
Use octahedral mapping to store probe textures. Octahedral textures are easier to sample
and will increase performance. When extracting the world probe it will first be rendered into
a cubemap. This cubemap will then be remapped using octahedral texture coordinates.

* `CaptureView` captures the world light into a cubemap.
* `CaptureView` triggers the reflection probe module to update the octahedral texture using
   the cubemap.
* When sampling reflection probes it will convert the (cubemap) direction to octahedral
   coordinate and read from the octahedral texture.

![image](/attachments/d3331660-f893-41b7-8c17-ae12ddf2ad11)

Pull Request: https://projects.blender.org/blender/blender/pulls/109559
2023-07-03 15:14:34 +02:00
Germano Cavalcante
9d1f66c492 Fix 'optimize' directive usage on MSVC
"O" isn't an option.
2023-07-03 09:48:56 -03:00
Jeroen Bakker
c2c1d6f67b Metal: EEVEE Next shadow unit test enablement
Ensure correct SSBO bindings are present for shadow tests.
Metal validation errors occur if SSBO bindings that are expected are
not bound. In this case, we can bind empty SSBOs, but these should
be of the correct type for the tests.

Also adding missing zero-initializations for required members within
LightData. Without these, unit tests fail with various issues including
prevalence of OOB reads.

Co-authored-by: Michael Parkin-White <mparkinwhite@apple.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/109645
2023-07-03 14:24:34 +02:00
Julian Eisel
248b322896 UI: Improve how region size snapping respects the maximum size
Previously, a region that used size snapping could be dragged to a
snapped size (say 3 times a column width), but then would be clamped to
an unsnapped size (say 2.7 times a column width) to make it fit the
available space.
Instead clamp the size before snapping, so that snapping respects the
available width/height (resulting in 2 times a column width for
example). Put differently, the region will not be made taller if there's
not enough space to fit the region up to the next snapping point.

Implemented as part of #104831.

Pull Request: https://projects.blender.org/blender/blender/pulls/109027
2023-07-03 13:06:38 +02:00
Jacques Lucke
d5cd0a1ea6 Cleanup: quiet warning due to unused function 2023-07-03 12:17:26 +02:00
Damien Picard
11ecfaa6b0 I18n: use proper name for the Convert Colorspace node
The Convert Colorspace node uses "Convert Colorspace" as a name on
registration, but it uses "Color Space" as a `DefNode()` in
NOD_static_types.h.

As a result, the node name is not extracted to the .po files, and thus
not translated.

This commit uses the same name in all definitions of the node.

Pull Request: https://projects.blender.org/blender/blender/pulls/109419
2023-07-03 12:16:43 +02:00
Bastien Montagne
fb8c9a2a42 Fix toggling of liboverrides between editable and non-edtiable with "Make" tool in the Outliner.
regression from 43a31d3c93.

Found while investigating #109513.
2023-07-03 12:07:08 +02:00
Clément Foucault
8fa8f1ca78 Cleanup: DRW: Remove uneeded point cloud vertex inputs 2023-07-03 11:51:53 +02:00
Bastien Montagne
0aafc49c91 Fix (unreported) missing viewlayer sync call in Outliner liboverride tool. 2023-07-03 11:46:38 +02:00
Campbell Barton
e06a341546 License headers: add SPDX-FileCopyrightText 2023-07-03 19:20:39 +10:00
Bastien Montagne
ad4aa692ce Fix #109590: Outliner: Assert in outliner_collect_objects_to_delete. 2023-07-03 11:19:44 +02:00
Miguel Pozo
903f9ad178 Workbench Next: Point Clouds
Point Cloud support for the new Draw Manager and Workbench Next.

Pull Request: https://projects.blender.org/blender/blender/pulls/109568
2023-07-03 11:16:44 +02:00