Commit Graph

120055 Commits

Author SHA1 Message Date
Jason Fielder
ed540b4d3a Fix #114414: Alternative fix for greyscale textures retaining perf
Alternative solution to #114414 which reduces the scope of
textures for which single-channel greyscale optimization
is removed from.

Some byte buffers are converted to float buffers during
color management. These cases should retain support in
the optimal path.

Authored by Apple: Michael Parkin-White

Pull Request: https://projects.blender.org/blender/blender/pulls/114611
2023-11-09 11:02:20 +01:00
Sergey Sharybin
a4f4cb6c4a Cleanup: Sculpt, use C++ types for PBVH proxy node API
- Use float3 for coordinates inside of proxy
- Use Vector for storing coordinates and proxy nodes
- Use MutableSpan in the API to access proxy nodes

Pull Request: https://projects.blender.org/blender/blender/pulls/114638
2023-11-09 11:00:58 +01:00
Jeroen Bakker
b51027ea0c Vulkan: Fix Issues surrounding Grease Pencil Drawing
Some minor tweaks to the vulkan backend to support grease pencil
drawing. The changes include:

* Add support for GPU_DATA_10_11_11_REV clearing
* Use correct index buffer start and count

Anti aliasing isn't working as they require different samplers being
configured and that require some design work.
Effects haven't been tested.

Pull Request: https://projects.blender.org/blender/blender/pulls/114659
2023-11-09 11:00:09 +01:00
Sergey Sharybin
c3609ec435 Cleanup: Sculpt, use C++ vector types in internal types
Only converted value types in the structures.

The pointer values are left unchanged as it requires more careful look
to avoid possible alignment mismatch.

Function arguments are left unchanged as well.

Only float[3] is converted as the float[4] will likely need to be
converted to some C++ rotation class. And float[4][4] often did not
compile when change is only done in the header.

Pull Request: https://projects.blender.org/blender/blender/pulls/114636
2023-11-09 10:05:24 +01:00
Campbell Barton
fdbf235ba3 Merge branch 'blender-v4.0-release' 2023-11-09 18:45:17 +11:00
Thomas Barlow
1058a93994 Fix #106696: Invalid flag combinations used in #PyObject_GetBuffer
Code using #PyObject_GetBuffer was combining the `PyBUF_FORMAT` and
`PyBUF_SIMPLE` flags, but the documentation specifies that
`PyBUF_FORMAT` can be |'d to any of the flags except `PyBUF_SIMPLE`
because the latter already implies format `B` (unsigned bytes).

The flags in such cases have been replaced with
`PyBUF_ND | PyBUF_FORMAT`, which has the additional requirement that the
buffer must provide it's `shape` field.

This fixes `memoryview` objects raising a `BufferError` when requested,
due to the invalid combination of flags making them be considered
invalid buffers when they would otherwise be valid.

Ref: !106697
2023-11-09 18:43:05 +11:00
Thomas Dinges
801c3275f5 Release: Bump Blender 4.0 to RC, Bcon4 2023-11-09 08:17:55 +01:00
Campbell Barton
536e5323f5 Cleanup: suppress UBSAN undefined behavior warnings 2023-11-09 17:28:39 +11:00
Campbell Barton
8ee209cb77 Fix #114614: Reload scripts leaks memory
Address regression in [0] which allowed wmKeyMapItem::properties to
remain set when a valid wmKeyMapItem::ptr can't be created because the
wmOperatorType isn't available (temporarily in the case of reloading).

Resolve by freeing wmKeyMapItem::properties when the `ptr` isn't set.

Also add null pointer check not to assume wmKeyMapItem::properties
implies an allocated wmKeyMapItem::ptr. Something which is already
accounted for everywhere else.

[0]: 08e5f94a70
2023-11-09 15:48:07 +11:00
Campbell Barton
33e6e5aed1 Fix #114614: Reload scripts leaks memory
Also add null pointer check not to assume wmKeyMapItem::properties
implies an allocated wmKeyMapItem::ptr. Something which is already
accounted for everywhere else.
2023-11-09 15:37:40 +11:00
Campbell Barton
59264115ce Merge branch 'blender-v4.0-release' 2023-11-09 14:52:29 +11:00
Campbell Barton
7e12d92f40 Fix invalid value for ENUM_OPERATORS(...) macro
Use defines for multiple flags.
2023-11-09 14:51:33 +11:00
Campbell Barton
704985152e Refactor: initialize IMB after parsing settings
Avoid awkward kludges with IMB_init/exit & IMB_ffmpeg_init calls.

The animation player was responsible for calling IMB_exit, not IMB_init,
this complicated drag & drop which needed to re-internalize IMB before
returning.

Delay initializing IMB since none of the other argument handlers
depend on it, make wm_main_playanim_intern responsible for calling
both initialization & exit calls for IMB.

Also expand code comments for ARG_PASS_SETTINGS.
2023-11-09 13:58:00 +11:00
Campbell Barton
368b38be37 Merge branch 'blender-v4.0-release' 2023-11-09 13:07:44 +11:00
Campbell Barton
609ac5e378 Fix crash dragging images into the animation player (again)
This was fixed by [0] however that fix didn't account for IMB
sometimes freeing GPU resources created by color management
(resolved by [1] which effectively reverted [0]).

Resolve by re-initializing IMB in the case of drag & drop.

[0]: 51467b0611
[1]: 05c56603a9
2023-11-09 12:52:14 +11:00
Campbell Barton
58ea0e051f Cleanup: spelling in comments 2023-11-09 09:54:28 +11:00
Campbell Barton
6bba008325 Cleanup: format 2023-11-09 09:34:49 +11:00
Martijn Versteegh
596aab27bd Merge branch 'blender-v4.0-release' 2023-11-08 21:32:30 +01:00
Martijn Versteegh
aaf6937631 Fix #112697: Skip non-existing UV maps on VBO upload
Fix #112697: Skip unavaliable UV maps on VBO upload

The list of available UV maps is generated for the evaluated object,
however if any modifier generates UV maps (for example Geometry
Nodes) it is possible the evaluated object contains UV maps which are
not present in the base mesh. So when only the base mesh is uploaded,
for example in the UV editor, UV maps present in the list are not
guaranteed to exist.

Pull Request: https://projects.blender.org/blender/blender/pulls/114558
2023-11-08 21:31:22 +01:00
Miguel Pozo
f2a7145a57 Fix #114404: EEVEE-Next: Render region enforced even when disabled 2023-11-08 19:13:26 +01:00
Antonio Vazquez
8d0323e76e Cleanup: Remove compiler warning 2023-11-08 17:31:01 +01:00
Antonio Vazquez
405ad22429 GPv3: Set Uniform operator for Thickness and Opacity
This operator has the same functionality that GPv2 version of Stroke Normalize.

Note: The radius is set with the entry value * 0.5 and the param is named Thickness.

Related to #113991

Pull Request: https://projects.blender.org/blender/blender/pulls/114006
2023-11-08 16:19:00 +01:00
Matias Mendiola
e5704d37de GPv3: Switch Direction operator
This Operator is similar to GPv2 GPENCIL_OT_stroke_flip to switch the stroke direction.

Related to: [113590](113590)

Pull Request: https://projects.blender.org/blender/blender/pulls/114007
2023-11-08 16:05:54 +01:00
Omar Emara
571bddb6c8 Cleanup: Fix warnings due to disabled OCIO 2023-11-08 16:33:46 +02:00
Antonio Vazquez
a8cb0b0ca0 GPv3: Set selected curve material as active material
This operator assigns the material of the first selected curve as active material.

Related to #113569

Pull Request: https://projects.blender.org/blender/blender/pulls/114188
2023-11-08 15:00:48 +01:00
Falk David
f6655ab06c Fix #114453: Grease Pencil shows up as "Grease Pencil (legacy)" in some places
In Blender 4.0 Grease Pencil was showing up as "Grease Pencil (legacy)" in the UI in some places.
Since the current Grease Pencil is not replaced yet, it shouldn't be named this way in 4.0.

Pull Request: https://projects.blender.org/blender/blender/pulls/114531
2023-11-08 14:59:22 +01:00
Pratik Borhade
34874910b6 Merge branch 'blender-v4.0-release' 2023-11-08 17:33:26 +05:30
Pratik Borhade
f7dd40afbf Fix #114583: Missing forward axis option in obj export
This was accidently removed in cfffd813c1

Pull Request: https://projects.blender.org/blender/blender/pulls/114615
2023-11-08 12:58:15 +01:00
Hans Goudey
871c717c6e Fix: Remove support for node tool data-block inputs for 4.0
There are two bugs with data-block inputs currently. One is #113383,
where clicking the "Clear" button on the data-block picker closes the
redo panel. The worse issue is that storing pointer properties in
operators isn't safe at all. Deleting the data-block doesn't clear
the pointer property in operator storage, for example.

The proper solution is to reuse some code from the existing data-block
picker but back it with a `session_uuid` integer property instead of an
actual pointer. This makes lookups safe without depending on the name.
However, doing that for 4.0 is too risky, so for now we will just not
support data-block inputs in the redo panel.

Pull Request: https://projects.blender.org/blender/blender/pulls/114621
2023-11-08 10:46:59 +01:00
Hans Goudey
ece4b6e84d Cleanup: Remove unused functions
See 7b89a0a580, ae1b4a6a28
2023-11-08 10:18:37 +01:00
Werner, Stefan
b414187efb Build: Update OpenImageDenoise to 2.1.0
Major new feature in v2 is GPU support. This is not enabled yet,
this commit only changes the library version without enabling new
functionality.

Pull Request: https://projects.blender.org/blender/blender/pulls/112143
2023-11-08 10:12:05 +01:00
Sergey Sharybin
7b89a0a580 Cleanup: Mark unused arguments as such
Pull Request: https://projects.blender.org/blender/blender/pulls/114619
2023-11-08 09:44:58 +01:00
Jeroen Bakker
f76ceddc98 Vulkan: Workaround for Unsupported R8G8B8 Vertex Buffer Formats
On some platforms `VK_FORMAT_R8G8B8_*` are not supported as vertex buffers. The
obvious workaround for this is to use `VK_FORMAT_R8G8B8A8_*`. Using unsupported
vertex formats would crash Blender as it is not able to compile the graphics
pipelines that use them.

Known platforms are:
- NVIDIA Mobile GPUs (Quadro M1000M)
- AMD Polaris (open source drivers)

This PR adds the initial workings for other unsupported vertex buffer formats we
need to fix in the future.

`VKDevice.workarounds.vertex_formats` contain booleans if the workaround for
a specific format should be turned on (`r8g8b8 = true`). `VertexFormatConverter` can be
used to identify if conversions are needed and perform the conversion.

Pull Request: https://projects.blender.org/blender/blender/pulls/114572
2023-11-08 09:44:22 +01:00
Omar Emara
474b6fa070 Realtime Compositor: Support full precision compositing
This patch adds support for full precision compositing for the Realtime
Compositor. A new precision option was added to the compositor to change
between half and full precision compositing, where the Auto option uses
half for the viewport compositor and the interactive render compositor,
while full is used for final renders.

The compositor context now need to implement the get_precision() method
to indicate its preferred precision. Intermediate results will be stored
using the context's precision, with a number of exceptions that can use
a different precision regardless of the context's precision. For
instance, summed area tables are always stored in full float results
even if the context specified half float. Conversely, jump flooding
tables are always stored in half integer results even if the context
specified full. The former requires full float while the latter has no
use for it.

Since shaders are created for a specific precision, we need two variants
of each compositor shader to account for the context's possible
precision. However, to avoid doubling the shader info count and reduce
boilerplate code and development time, an automated mechanism was
employed. A single shader info of whatever precision needs to be added,
then, at runtime, the shader info can be adjusted to change the
precision of the outputs. That shader variant is then cached in the
static cache manager for future processing-free shader retrieval.
Therefore, the shader manager was removed in favor of a cached shader
container in the static cache manager.

A number of utilities were added to make the creation of results as well as
the retrieval of shader with the target precision easier. Further, a
number of precision-specific shaders were removed in favor of more
generic ones that utilizes the aforementioned shader retrieval
mechanism.

Pull Request: https://projects.blender.org/blender/blender/pulls/113476
2023-11-08 08:32:00 +01:00
Jesse Yurkovich
c6b5bb3d89 Merge branch 'blender-v4.0-release' 2023-11-07 18:31:59 -08:00
Jesse Yurkovich
8178b12af4 Windows: Remove wait for key-press in --debug mode
This was initially added a long time ago[1] to help with certain exit
behavior while running under a debugger. However, this shouldn't be
necessary any longer.

More importantly, tests have started to use the `--debug` option[2].
Somehow the bots are fine, but anyone running the tests locally on
Windows will experience what looks like a hang; unless they press a key
to allow the tests to continue.

[1] 1cc19c6993
[2] The `blendfile_versioning` test

Pull Request: https://projects.blender.org/blender/blender/pulls/114605
2023-11-08 03:30:42 +01:00
Germano Cavalcante
9410644795 Merge branch 'blender-v4.0-release' into main 2023-11-07 18:31:47 -03:00
Germano Cavalcante
7f89063161 Fix #114596: Face Nearest with steps sometimes breaks
When multiple steps are tested, we cannot depend on the distance
calculated for `nearest.dist_sq`, as it reduces with each step.
2023-11-07 18:30:53 -03:00
Gilberto Rodrigues
3fddfb48be Fix #114571: Retopology Overlay Face Color Regression
Fix #114571: Retopology Overlay Face Color Regression

Missed in dfd1b63cc7

Pull Request: https://projects.blender.org/blender/blender/pulls/114589
2023-11-07 21:43:01 +01:00
Brecht Van Lommel
fd60a0be38 Merge branch 'blender-v4.0-release' into main 2023-11-07 21:15:42 +01:00
Brecht Van Lommel
13b1d8d5e1 Fix build failure when WITH_USD=OFF and WITH_MATERIALX=ON 2023-11-07 20:57:35 +01:00
Brecht Van Lommel
7618d4a0ac Merge branch 'blender-v4.0-release' into main 2023-11-07 20:32:33 +01:00
Aras Pranckevicius
a70b42d1cd Cleanup: remove unused spherical harmonics functions
Looks like these were only used for CPU-based viewport shading
in pre-2.80 Blender. Which no longer exists.
2023-11-07 21:16:47 +02:00
Brecht Van Lommel
fb2f77d088 Fix macOS Python SSL still not using bundled certificate
The code from 5ac392ca4 did not work on macOS since WITH_INSTALL_PORTABLE
is not set there. This issue was hidden before, but now happens due to
the changes in #114569 to avoid using /etc/ssl.
2023-11-07 20:13:20 +01:00
Aras Pranckevicius
bdddb3b14e Cleanup: remove unused form_factor_ functions
Looks like these were only used for CPU-based ambient occlusion effect
in pre-2.80 Blender. Which no longer exists.
2023-11-07 21:11:25 +02:00
Aras Pranckevicius
13dbeac13c cleanup: remove "sa" acos/asin/sqrt functions and use "safe_" variants
Cleanup talked about in the previous semi-related PR, #114501

- saacos, saasin, sasqrt have been 100% identical to saacosf,
  saasinf, sasqrtf since 2012.
- For all the above, there exist more intuitively named safe_acosf,
  safe_asinf, safe_sqrtf that do the same thing, so switch all code to those.

Pull Request: https://projects.blender.org/blender/blender/pulls/114593
2023-11-07 19:49:01 +01:00
Miguel Pozo
7c68e9a94c Fix #114524: EEVEE-Next: Wrong normal map node result
The new draw manager stores the object scale as a regular flag.
Update `node_normal_map` to read it correctly.

Pull Request: https://projects.blender.org/blender/blender/pulls/114587
2023-11-07 18:58:31 +01:00
Omar Emara
ae739a6173 Fix #114530: Cryptomatte node not link drag searchable
The Cryptomatte node is not searchable in the link drag search operator.
That's because it still uses socket templates, which are no longer
supported for search since f5e6d4e4b0.

This patch fixes that by using the declare method instead of socket
templates.

Pull Request: https://projects.blender.org/blender/blender/pulls/114537
2023-11-07 18:44:56 +01:00
Aras Pranckevicius
b1c7b573c0 mesh: use faster acos() variant in normals calculation
Function                         Module   Inclusive Time  Exclusive Time
--------------------------------------------------------------------------
  mesh_render_data_update_normals  blender  297.51          0.00

  315 -> 297

acos() usage in all places related to normal calculations shows up in the
profiler. Given that "angle between faces" is only additional heuristic
weight in there (the effect of it at all is very subtle), approximate but
faster version of acos() might be just fine. Especially since some other
parts of Blender (e.g. mikktspace) use approximate acos in a conceptually
the same part.

- Adds safe_acos_approx() to BLI_math_base.hh. Implementation the same
  as already exists in Cycles; max error 0.00258 degrees. Between 2x and 4x
  faster in my tests.
- Changes all normals related calculations to use the function above instead
  of saacos.

Computing normals on a Stanford Lucy (14m verts) mesh:
- Mac (arm64, M1 Max): 247ms -> 229ms
- Win (x64, Ryzen 5950X): 276ms -> 250ms

All places that are about "normal calculation" were changed, including e.g.
Corrective Smooth modifier. Applying that one to the same 14m vertices mesh,
Mac M1 Max: 9.96s -> 9.76s

Tiny changes in several test output expectations w.r.t. normals are
observed, these were reviewed and updated expectations checked in svn.

Pull Request: https://projects.blender.org/blender/blender/pulls/114501
2023-11-07 18:22:17 +01:00
Damien Picard
7231ac0a52 I18n: extract and disambiguate a few messages
Extract:
- "Attribute", when creating a new attribute with
  `GEOMETRY_OT_attribute_add()`: make the default name in the operator
  a null string, and set it to "Attribute" translated inside an invoke
  method instead.
- Also for new attributes, from `BKE_id_attribute_calc_unique_name()`,
  for instance to create a default vertex color layer when going into
  Vertex Paint mode: use `DATA_()` instead of `IFACE_()`, since it
  represents user data.

Disambiguate:
- "Weight" can be the thickness of font glyphs.
- "Mark as Asset" and "Clear Asset" are operator names already
  extracted using the Operator context. They were recently added to a
  manual translation in the UI, but the existing one can be reused.
- "Second" as a time unit in the context of frame snapping.

Some messages reported by Satoshi Yamasaki in #43295.

Pull Request: https://projects.blender.org/blender/blender/pulls/114159
2023-11-07 18:08:58 +01:00