Commit Graph

126654 Commits

Author SHA1 Message Date
Hans Goudey bc8c892c65 Cleanup: Move WM headers to C++
Also move a few more headers that included WM headers.

Pull Request: https://projects.blender.org/blender/blender/pulls/110815
2023-08-04 23:11:22 +02:00
Hans Goudey aa5b142e98 Cleanup: Move fsmenu.c to C++
See #103343

Co-authored-by: Ray Molenkamp <github@lazydodo.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/110797
2023-08-04 22:15:03 +02:00
Jacques Lucke f18c45eb69 Cleanup: avoid using NOD_static_types.h for creating the node.type enum
The overall goal is to get rid of `NOD_static_types.h`. This patch removes
one usage of it to generate the `node.type` rna enum. Not all of the data
was available on `bNodeType` already, so I had to add the missing data there.

Pull Request: https://projects.blender.org/blender/blender/pulls/110810
2023-08-04 21:43:54 +02:00
Hans Goudey 9909bf60c9 Fix: Missing updates for geometry node group tool properties
Mistake in fd9d22ba57
2023-08-04 15:30:04 -04:00
Germano Cavalcante b31ccdcf4a Fix undefined variable usage
Error in b6ed70cd92
2023-08-04 16:28:15 -03:00
Hans Goudey e3e6fb8ecf Geometry Nodes: Initial tool-specific nodes
Add three new nodes for operations and inputs specific to
node group operators.
- **Selection** Whether elements are selected in the viewport
- **Set Selection** Sets the edit/sculpt selection, on the point,
  face, or curve domains
- **3D Cursor** Gives the location and rotation of the 3D cursor,
  in the local space of the modified object.
- **Face Set** The face set value from mesh sculpt mode,
  and whether the attribute exists.
- **Set Face Set** Set sculpt face set values.

In the add menu and search, the nodes are only visible in the
"Tool" context of the geometry node editor. They also give
errors when executed by a modifier.

Pull Request: https://projects.blender.org/blender/blender/pulls/109517
2023-08-04 20:59:04 +02:00
Alexander Gavrilov 9921c3532c Custom Data: make get_layer_index_n always safely handle n overrun.
This function is used to retrieve the index of the n'th layer of
the specified type, if it exists. Currently the way it handles
an n value that is too big is inconsistent: if there are more
layers of different types following the ones of the correct type,
and n isn't too big, it will safely detect that the corresponding
layer is of a different type and return -1. However, if the value
results in a buffer overrun, it causes an assertion or crash.

This means that safe code should currently ensure n is always
correct, making the type check in this function pointless.
Moreover, checking the range in the caller may incur more
overhead than making this code safe.

This changes the assert into a check to ensure consistent behavior.

Pull Request: https://projects.blender.org/blender/blender/pulls/110812
2023-08-04 20:40:05 +02:00
Hans Goudey 85bac9d292 Fix: Node group operators reset mesh select mode 2023-08-04 14:30:26 -04:00
Hans Goudey e0efc234c8 Cleanup: Small improvements to Hydra mesh and curves export
- Use threadsafe normal computation (will be improved more in #93551)
- Copy data directly instead of loops when format is the same
- Use bke::CurvesGeometry wrapper and attribute API
- Avoid `push_back` when size is known ahead of time
2023-08-04 13:59:22 -04:00
Hans Goudey 66dd1657b8 Cleanup: Use const for Blender data in Hydra exporter
As a render engine, this code generally shouldn't modify Blender data.
const helps to use the type system to enforce that.
2023-08-04 13:42:51 -04:00
Hans Goudey 39c3a86d8e Cleanup: Make object material count function take a const pointer 2023-08-04 13:42:51 -04:00
Hans Goudey f97a51350d Cleanup: Make mesh normal calculation function const
Since this outputs to a separate array and not a custom data layer,
it actually doesn't change the mesh (after 580833165c anyway).
2023-08-04 13:42:51 -04:00
Jacques Lucke 81096abe2a Fix: simulation outputs empty geometry when going to frame zero
Previously, simulation nodes would output default values when there is no
current simulation state and nothing should be computed. Now, the data is
just passed through which is usually less confusing.

Pull Request: https://projects.blender.org/blender/blender/pulls/110800
2023-08-04 19:34:35 +02:00
Germano Cavalcante b6ed70cd92 Triage: Add 'weekly_report' and 'issues_needing_info' tools
This commit adds 2 tools for triaging:
- /tools/triage/weekly_report.py
- /tools/triage/issues_needing_info.py

These tools automatically detect the username to list activities related to the user.

Pull Request: https://projects.blender.org/blender/blender/pulls/110652
2023-08-04 19:32:25 +02:00
Jacques Lucke 9c72199258 Cleanup: simplify usage of NOD_static_types.h in rna
There were a bunch of duplicated usages of `NOD_static_types.h` in
`rna_nodetree.cc`. This patch reduces the duplication, making it easier
to reason about what is going on.

Pull Request: https://projects.blender.org/blender/blender/pulls/110805
2023-08-04 18:48:16 +02:00
Jacques Lucke ab39386aec Cleanup: remove dead node tree rna code
This code seems to be dead since forever (wasn't used
in 4638e5f99a either.
2023-08-04 18:35:40 +02:00
Hans Goudey fd9d22ba57 Geometry Nodes: Operators: Support more object types and modes
Add support in the UI for the edit mode of curves, mesh, and point
cloud objects. It's possible to control for which mode sand object
types the asset is available with a dropdown in the node header.
To make this per-mode filtering possible, the static asset tree
cache is now unique per context mode.

See #101778

Pull Request: https://projects.blender.org/blender/blender/pulls/109526
2023-08-04 18:22:45 +02:00
Jacques Lucke d5eb51e911 Cleanup: make versioning_260.cc independent of NOD_static_types.h
The eventual goal is to get rid of `NOD_static_types.h` because that data should
be decentralized so that nodes can be more self-contained.

The switch cases are based on the state of `NOD_static_types.h` when the
versioning code was introduced in 4638e5f99a.

Pull Request: https://projects.blender.org/blender/blender/pulls/110804
2023-08-04 18:18:22 +02:00
Miguel Pozo 2f6af7a4b9 EEVEE Next: Fix: Normal RenderPass viewport display flicker
The active display should always be rendered,
even if the current sample doesn't write to it.
2023-08-04 18:15:38 +02:00
Hans Goudey 4395e0da93 Fix: Geometry nodes self object crash in node operator 2023-08-04 11:03:21 -04:00
Brecht Van Lommel 647f2053a9 Tests: add automated regressions tests for Hydra Storm
These are meant to test Hydra integration. Currently they are only enabled
for WITH_OPENGL_RENDER_TESTS=ON due to similar reasons as Eevee and
Workbench, which is that they require a GPU and results can be platform
dependent due to hardware and driver differences.

There are separate tests for USD and Hydra export paths. The goal is to
make these identical, but they aren't yet. So for that reason they have
separate reference renders, and there is a HTML page to compare them.

Ref #110765
2023-08-04 17:01:09 +02:00
Brecht Van Lommel 83fa353efc Hydra: add option to export through USD file instead of Hydra API
This is currently meant mainly for testing, when "Developer Extras" is
enabled. The goal is to make interactive Hydra export and USD file export
identical. We are not there yet, and having the ability to compare both
in the viewport and automated tests should help us get and stay there.

Ref #110765
2023-08-04 17:01:09 +02:00
Bogdan Nagirniak 04bb5f9995 Render: support USD Hydra render delegates
Hydra is a rendering architecture part of USD, designed to abstract the
host application from the renderer. A renderer implementing a Hydra
render delegate can run in any host application supporting Hydra, which
now includes Blender.

For external renderers this means less code to be written, and improved
performance due to a using a C++ API instead of a Python API.

Add-ons need to subclass bpy.types.HydraRenderEngine. See the example in
the Python API docs for details.

An add-on for Hydra Storm will be included as well. This is USD's
rasterizing renderer, used in other applications like usdview. For users
it can provide a preview of USD file export, and for developers it
serves a reference.

There are still limitations and missing features, especially around
materials. The remaining to do items are tracked in #110765.

This feature was contributed by AMD.

Ref #110765

Co-authored-by: Georgiy Markelov <georgiy.m.markelov@gmail.com>
Co-authored-by: Vasyl-Pidhirskyi <vpidhirskyi@gmail.com>
Co-authored-by: Brian Savery <brian.savery@gmail.com>
Co-authored-by: Brecht Van Lommel <brecht@blender.org>

Pull Request: https://projects.blender.org/blender/blender/pulls/104712
2023-08-04 17:01:09 +02:00
Bogdan Nagirniak 61f407d427 Build: install USD Storm and MaterialX libraries by default
* Bundle hdStorm and associated plugins
* Enable WITH_MATERIALX by default to bundle MaterialX libraries
* Set PXR_MTLX_STDLIB_SEARCH_PATHS so Storm can find MaterialX files

Co-authored-by: Georgiy Markelov <georgiy.m.markelov@gmail.com>
Co-authored-by: Brecht Van Lommel <brecht@blender.org>

Ref #110765, #104712
2023-08-04 17:01:09 +02:00
Brecht Van Lommel efe10cee5c Cleanup: compiler warning with clang 2023-08-04 17:01:09 +02:00
Jacques Lucke ba1e88bffc Fix: simulation with no-cache resets when changing property
The simulation used to reset when the previously computed frame is the
same as the current one. However, in this case the output should just be
the same as in the previous computation.

Pull Request: https://projects.blender.org/blender/blender/pulls/110799
2023-08-04 16:59:56 +02:00
Miguel Pozo a5e62537a5 Fix: Compilation error after 41c83d6cfc 2023-08-04 16:50:53 +02:00
Miguel Pozo ff470f3f2e EEVEE Next: Volumes
Port of EEVEE unified volume rendering to EEVEE Next, using compute
shaders.

Improvements:
- Skip empty volume outside object bounds. (Large performance
  increase)

Currently missing:
- Shadows and irradiance integration.
- Grid-space TAA.

Main Task: #105672

Pull Request: https://projects.blender.org/blender/blender/pulls/107176
2023-08-04 16:47:16 +02:00
Miguel Pozo 41c83d6cfc EEVEE Next: Sculpt support
Add sculpt support to EEVEE Next.

It creates a new resource handle for sculpt object, since
BKE_object_boundbox_get returns a wrong (zeroed) bounding box.

This also adds a new `resource_handle` function to the `draw::Manager`
that works like the default one, but lets the caller optionally override the
object matrix and/or bounds.

Pull Request: https://projects.blender.org/blender/blender/pulls/110703
2023-08-04 16:38:04 +02:00
Jacques Lucke ada738ac7c Fix: temperature attribute in eevee is divided by three
This fixes the eevee part of #110716.
Cycles still outputs zero which is the same issue as in #87494.

Pull Request: https://projects.blender.org/blender/blender/pulls/110768
2023-08-04 16:37:21 +02:00
Weizhen Huang c36eccfae9 Nodes: Copy socket values with the same `identifier` instead of `name`
`identifier` should be a better measure than `name` to check if a socket
has the same meaning among different nodes. Sometimes two sockets can
have the same name in the UI but have different (physical) meanings,
they can specify different identifiers to avoid the values being copied
when the nodes are replaced.

Pull Request: https://projects.blender.org/blender/blender/pulls/110792
2023-08-04 16:32:33 +02:00
Hans Goudey 97769581f5 Cleanup: Split fsmenu.c before C++ conversion
The complication is that `Carbon.h` also defines its own`Collection`
type, which is visible in this file as a forward declaration in
`UI_interface_icons.h`. To fix that, move the code that needs to
include platform specific includes to a separate file that includes
fewer Blender headers.

See #103343

Pull Request: https://projects.blender.org/blender/blender/pulls/110731
2023-08-04 16:09:56 +02:00
Julian Eisel 42dfa740c4 Fix crash when toggling asset shelf "Show Names" with sidebar open
There was an earlier version of this fix in the asset shelf branch, but
got reverted after the new version ended in main 4137f9a87f. But I
forgot to update the branch for the new fix.
2023-08-04 15:31:17 +02:00
Hans Goudey d0d21f2934 Fix: Array modifier assert when not recalculating normals
Reported by Bastien in chat, thanks!
2023-08-04 08:15:47 -04:00
Campbell Barton 1f612605ab Fix #110732: blender_theme_as_c fails fails with error
Renaming members of a struct that it's self was renamed was not working,
support renamed structs as well as order member renaming - needed for
the lamp members that replace one member with another.
2023-08-04 18:00:08 +10:00
Campbell Barton 1e1f4db8b6 Tools: add 'diff' and 'email' attrs to git_log utility module
Expose email email & diff as they're generally useful when inspecting
commits.
2023-08-04 14:46:24 +10:00
Campbell Barton ed6e24b176 Fix resource leak in git_log utility module
Resolve a resource leak I encountered in credits_git_gen.py during
development, where it could exit with an OSError: "Too many open files".
2023-08-04 14:37:32 +10:00
Campbell Barton 9ba38d5bb6 License checker: scan paths "*.inl;*.ch;*.osl;*.metal;*.tables" 2023-08-04 13:24:18 +10:00
Campbell Barton 0caf227530 License headers: use SPDX-FileCopyrightText for *.inl and *.osl files 2023-08-04 13:24:17 +10:00
Campbell Barton e548294de2 License headers: remove GPL header from OSL template script
Original script from Sylvio Sell [0] has "Blender Foundation" listed
as copyright holder. In general template scripts are examples
that users can use as a reference without the copyright applying to
their work.

[0]: http://maitag.de/~semmi/blender/lyapunov/osl/lyapunov.osl
2023-08-04 13:24:15 +10:00
Campbell Barton f88f1c4011 Cleanup: quiet mypy warning 2023-08-04 11:27:34 +10:00
Hans Goudey 81f51e5433 Cleanup: Remove mistakenly duplicated file in C++ conversion
Mistake in 731d296f35
2023-08-03 20:04:50 -04:00
Hans Goudey 444a42e71c Fix: Duplicate "Tool" geometry nodes menu with asset catalog
Still need to maintain the hack of listing the existing menu items
in the code from cf98518055 unfortunately.
2023-08-03 19:03:00 -04:00
Campbell Barton adf58a77ff Cleanup: use LISTBASE_FOREACH & LISTBASE_FOREACH_BACKWARD macros 2023-08-04 08:51:13 +10:00
Campbell Barton f7be60eff0 Cleanup: format 2023-08-04 08:46:18 +10:00
Campbell Barton 7afd938dde Cleanup: various non-functional C++ changes 2023-08-04 08:45:57 +10:00
Bastien Montagne 67bc7f9477 LibOverride: Fix RNA API to access liboverride operation's flag.
This should have been an bitflag enum since the beginning.
2023-08-03 20:07:13 +02:00
Germano Cavalcante 87d04de418 Transform: simplify proportional distance algorithm
The `TD_NOTCONNECTED` flag is not set in all cases.

In some cases, such as Meshes, the `FLT_MAX` value better determines
when the `TrasData` is not "connected".

Therefore, this commit removes the `TD_NOTCONNECTED` flag and adapts
the code to rely on the `FLT_MAX` value instead.

These TrasDatas shouldn't even be created in these cases.
2023-08-03 13:55:59 -03:00
Germano Cavalcante 2786680ad8 Cleanup: Remove unused struct
`TransCenterData` is no longer used since be60b3b239
2023-08-03 13:55:59 -03:00
Hans Goudey bc393c4033 Geometry Nodes: Draw node operator inputs in redo panel
Show node group inputs in the redo panel, including the
"use attribute" toggle. There are a few limitations that will
be solved separately:
- The redo panel is _always_ drawn, there is no way to show it conditionally yet
- There is no way to add the operator name to the redo panel title yet
- Attribute search is still missing for attribute inputs

Pull Request: https://projects.blender.org/blender/blender/pulls/109975
2023-08-03 18:04:36 +02:00