Commit Graph

126870 Commits

Author SHA1 Message Date
Hans Goudey
efacffebfc Cleanup: Add comment for mesh triangulation faces cache 2023-08-11 22:03:25 -07:00
Charles Wardlaw
cf5666345d USD IO: Generic Attributes Support
Part 2 of the patch I wrote moving USD over to the new Attributes API
for Colors: https://projects.blender.org/blender/blender/pulls/105347

This patch adds support for more types of generic Mesh Attributes.
Attribute Types and Domains are converted to their USD counterparts
where possible.  For example, float Attributes used for modifying
shader masks or int Attributes for grouping are now able to be
round-tripped.  Due to the differences in the two systems some
conversions are necessary, but attempts were made to keep data
loss to a minimum.

If you export to USDA, you'll find the Attributes get prefixed with
a "primvars:" namespace; this is expected behavior and identifies
the exported Attributes as different from other USD Schema.

Not supported:
- Edge domain.  There doesn't seem to be a proper conversion for
this in USD.  One exception is for creasing and sharpness, but if
they are desired I can add them in a future patch.

Co-authored-by: kiki <charles@skeletalstudios.com>
Co-authored-by: Charles Wardlaw <cwardlaw@nvidia.com>
Co-authored-by: Hans Goudey <h.goudey@me.com>
Co-authored-by: Charles Wardlaw <kattkieru@users.noreply.github.com>
Co-authored-by: Michael Kowalski <makowalski@nvidia.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/109518
2023-08-11 23:47:17 +02:00
Germano Cavalcante
6ec842c43c Merge by Distance: Redo face split code
The split face code relied a lot of the edges added to the weld context.

But with 113004687d, some edges are removed from context. And even more
edges can be removed (reducing loops and arrays).

Removing the dependence on edges decreases the array and time spent in
loops.

Furthermore, the corner edge array should not be needed for the
merge by distance operation.

So this commit redoes the face/loops iterator which previously
needed the `loop_next` member to skip loops depending on the previous
one (possibly linked to the edge whose vertex will be merged) and now
uses the `switch_to` member to switch loops instead of skipping and
depend on the former.
2023-08-11 16:23:52 -03:00
Hans Goudey
0bd3c23f1b Fix: Build error on windows after recent commit
See f0467b4615

Pull Request: https://projects.blender.org/blender/blender/pulls/111054
2023-08-11 21:15:04 +02:00
Hans Goudey
f0467b4615 Cleanup: Return std::string from operator name and description callbacks
With the end goal of simplifying ownership and memory management,
and allowing the use of `get_name` in contexts without statically
allocated strings, use `std::string` for the return values of these two
operator type callbacks instead of `const char *` and `char *`.

In the meantime things get uglier in some places. I'd expect `std::string`
to be used more in the future elsewhere in Blender though.

Pull Request: https://projects.blender.org/blender/blender/pulls/110823
2023-08-11 19:11:27 +02:00
Brecht Van Lommel
6fa4519b98 Cycles: remove unnecessary transform parameters from lights
The transform matrix already specifies everything, no need to duplicate
this which can lead to mistakes.

Ref #110689
2023-08-11 17:41:06 +02:00
Brecht Van Lommel
1d2b2e23a0 Fix Hydra render delegate handling paths with certain characters wrong
Use appropriate function for converting paths. This adds an ugly
dependency on a function that is private to python/, similar to how it
is done for Freestyle. Solving that will be for a separate change.

Ref #110765
2023-08-11 17:41:06 +02:00
Almaz-Shinbay
55117f20ee Outliner: Port pose group elements to new tree-element code design
No user visible changes expected.

Part of #96713, continuation of work started in 249e4df110 and 2e221de4ce.
Refer to these for a motivation and design overview.

Adds new classes for pose group elements.

Pull Request: https://projects.blender.org/blender/blender/pulls/110587
2023-08-11 17:36:09 +02:00
Nicolas Sourd
092251b1fd Fix Cycles Hydra render delegate ignoring the light falloff property
If the falloff is defined with a supported value, a LightFalloffNode is added
to the graph, instead of the default EmissionNode.

Pull Request: https://projects.blender.org/blender/blender/pulls/110690
2023-08-11 17:24:08 +02:00
Nicolas Sourd
23ce783f8d Fix Cycles Hydra render delegate not rendering spot lights
Because axisu and axisv were not initialized. The default null vector led
to NaN values in the lighting code.

Pull Request: https://projects.blender.org/blender/blender/pulls/110689
2023-08-11 17:23:36 +02:00
Brecht Van Lommel
0810d2ec54 Fix build errors, after merging PR not updated for latest changes 2023-08-11 17:06:44 +02:00
Brecht Van Lommel
ae10823ff2 Fix OSL build error on Windows after recent changes
Include just oslversion.h to avoid conflicts with OIIO in kernel.
2023-08-11 17:06:44 +02:00
Bastien Montagne
4facf670a8 Fix (unreported) foreach_id missing handling of ID pointers from RNA strips modifiers.
Also factorized fcurve modifiers foreach_id processing into their own
new function, `BKE_fmodifiers_foreach_id`.
2023-08-11 16:57:22 +02:00
Colin Marmond
cad95478ce Nodes: add ability to preview shader output nodes(AOV, group, material)
AOV/group/material output nodes can now be previewed the same way the
other nodes are.

This patch also improves the socket detection of the preview by using
`get_main_socket` which takes care of the priorities of the sockets.

Pull Request: https://projects.blender.org/blender/blender/pulls/110945
2023-08-11 16:47:56 +02:00
Colin Marmond
c966d7c2f9 Nodes: stop the shader preview job when changing the viewed nodetree
When the user goes in an out a nested node-tree, the preview job should be stopped.

Pull Request: https://projects.blender.org/blender/blender/pulls/111041
2023-08-11 16:13:24 +02:00
Colin Marmond
b3485c29a8 Nodes: use flat previews for shader nodes by default
For shader nodes, use the flat preview scene as default.

A new setting in the overlay panel adds the possibility to
use the material preview scene for the node previews.

Pull Request: https://projects.blender.org/blender/blender/pulls/110958
2023-08-11 16:12:58 +02:00
Bastien Montagne
e46f3acfdf Fix (unreported) missing expander code for new liboverride data.
Recent change to liboverride data model (6a86dd5f34) forgot to add the
new 'RNA item ID pointers references' to the expander code (readfile
area).

Note that this was essentially harmless, as these IDs are expected to be
referenced by actual data (or liboverride reference pointer) as well,
they should never be the only ones pointing at a linked ID. But better
to do it properly nonetheless.
2023-08-11 14:57:11 +02:00
Brecht Van Lommel
c5bd71b375 Fix compiler warning about undefined OSL_LIBRARY_VERSION_CODE
Pull Request: https://projects.blender.org/blender/blender/pulls/111048
2023-08-11 14:55:40 +02:00
Almaz-Shinbay
d5c7608b39 Outliner: Port view layer elements to new tree-element code design
No user visible changes expected.

Part of #96713, continuation of work started in 249e4df110 and 2e221de4ce.
Refer to these for a motivation and design overview.

Adds a new class for view layer elements.

Pull Request: https://projects.blender.org/blender/blender/pulls/110920
2023-08-11 14:52:08 +02:00
Almaz-Shinbay
d9de0a4725 Fix missing ShaderFx pointer to TreeElementGPencilEffect constructor
Fix the crash that 1f722a6d01 causes when opening files with GPv3 objects.

Pull Request: https://projects.blender.org/blender/blender/pulls/110585
2023-08-11 12:34:48 +02:00
Bastien Montagne
3f8416a1b2 Documentation: Add i18n info about operators' get_name/get_description callbacks. 2023-08-11 12:14:27 +02:00
Bastien Montagne
203e6e2b41 Fix (unreported) Several OperatorType.get_name not doing translation.
`OperatorType.get_name` callback is supposed to return strings directly
usable in the UI, i.e. translated if needed.

Several callbacks did not, noticiably the generic
`ED_select_pick_get_name` and `ED_select_circle_get_name` ones.

And the `sculpt_color_filter_get_name` was not using available RNA
helpers for enum items has it should have.

Finally, `RNA_property_enum_name_gettexted` and
`RNA_property_enum_item_from_value_gettexted` were also not using the
optimal higher-level translation API.

Noticed while reviewing !110776.
2023-08-11 12:00:16 +02:00
Aras Pranckevicius
6e73332306 Fix missing headers with unity/pch off, caused by recent cleanups 2023-08-11 12:51:20 +03:00
Amelie Fondevilla
5b0f200ea1 GPv3: Fix layer renaming synchronization from the dopesheet
Renaming a layer (or a layer group) from a dopesheet was not synchronized with the rest of blender.
This patch fixes this by adding the proper notifiers to the RNA layer/layer group properties, and by updating the listeners of the layer treeview (properties panel), and the outliner to redraw the area if a layer was renamed.

Pull Request: https://projects.blender.org/blender/blender/pulls/111038
2023-08-11 11:31:30 +02:00
Philipp Oeser
3c26f84225 Vertex Paint: Add option to lock alpha for 'Set Vertex Colors'
It is a common practice in gamedev to rely on coding various data into
the alpha channel of the mesh and there was no way to preserve that when
using the `Set Vertex Colors` operator (would always sets the Alpha component to '1').

Now add an "Affect Alpha" option (similar to what we have for brushes)
and when that is disabled, existing alpha is locked.

Fixes #110014

Pull Request: https://projects.blender.org/blender/blender/pulls/111002
2023-08-11 10:39:13 +02:00
Campbell Barton
d3353eb34b Cleanup: use const variables, reduce right-shift in unti.cc
Also assert the 3D view fixed size buffer is large enough.
2023-08-11 18:12:45 +10:00
Campbell Barton
8ce5a24b77 PyAPI: add preferences.filepaths.extension_repos.new/remove methods
Provide convenient access to adding/removing repositories,
useful for testing.
2023-08-11 17:37:12 +10:00
Campbell Barton
00ffa63b8f Fix Unix Makefiles running discover_nodes.py every build
Touch the output file when any of the files it depends on are newer
to stop Unix Makefiles from running the generator for every build.

Also remove use of pathlib, gives 10-15% slowdown as it adds indirect
imports such as urllib without much benefit (joining a path).
2023-08-11 17:13:34 +10:00
Campbell Barton
fd920ba39f Fix crash loading a blend file with an unknown area type 2023-08-11 17:13:34 +10:00
Jeroen Bakker
cbdcc5dfd0 Fix: Compilation Error in Draw Test Cases
Pull Request: https://projects.blender.org/blender/blender/pulls/111035
2023-08-11 08:18:30 +02:00
Richard Antalik
4ad04c9501 Fix #110727: VSE relative paths do not work with linked scenes
This is identical issue as #108094, but with image strips.

Use `ID_BLEND_PATH_FROM_GLOBAL` instead of
`BKE_main_blendfile_path_from_global`.
2023-08-11 08:03:45 +02:00
Ray Molenkamp
cc2093a25a makesrna: don't regenerate files unless changed with MSBUILD
`makesrna` was somewhat wasteful in causing rebuilds on MSBUILD for
files that have not changed.

This makes 2 changes to `makesrna.cc`

- the code in place to keep "make" out of trouble and regenerate
  files regardless if they have changed or not has been disabled for non
  "Unix Makefile" generators, as they do not appear to be needing this.

  This brings the number of actions ninja takes down after a white-space
  change in `rna_wm.cc` from 423 down to 107.

- `rna_prototypes_gen.h` was always written, this is somewhat wasteful
  and has been changed to be only written when changed.

  This brings the number of actions ninja takes down after a white-space
  change in `rna_wm.cc` from 107 down to 11.

in total, this saves several minutes of build time for simple changes
to rna source files.

Ref !110664.
2023-08-11 15:39:57 +10:00
Campbell Barton
5ed81a957a PyAPI: support passing None to imbuf.load(..) for consistency
Support a None argument which has the same behavior as not passing the
argument in. This matches bpy.data.temp_data behavior.
2023-08-11 15:14:56 +10:00
Campbell Barton
ac43b5ec80 Fix #111033: Crash on startup when Blender path isn't UTF8 compatible 2023-08-11 15:03:20 +10:00
Campbell Barton
8ce2ac0d9a Fix non UTF8 paths for Python functions which take path arguments
Use PyC_ParseUnicodeAsBytesAndSize parser instead of "s" / "z" type
specifier. This relates to #111033, resolving Python exceptions which
causes icons not to load (for e.g.).

Now bytes are also supported as path arguments.
2023-08-11 15:02:20 +10:00
Campbell Barton
2e286bcf8b PyAPI: add PyC_ParseUnicodeAsBytesAndSize parser utility
Expose PyC_UnicodeAsBytesAndSize using a parser which PyArg_ParseTuple
can use. This should be used with PyArg_ParseTuple instead of "s" type
specifier when passing in file-system path arguments.
PyC_ParseUnicodeAsBytesAndSize_OrNone has been included to match "z".
2023-08-11 14:59:54 +10:00
Campbell Barton
ddf9e4be1b Fix missing headers, caused by recent cleanups with the compositor 2023-08-11 14:57:56 +10:00
Aaron Carlisle
48ac28ce84 UI: Rename RNA name 'Resolution %' to 'Resolution Scale'
This is not used in the UI except for the tooltip.
UI elements should be given full names rather than relying on symbols.

This improves the API docs as well as makes it a more understandable tooltip message.

Pull Request: https://projects.blender.org/blender/blender/pulls/110865
2023-08-11 06:04:57 +02:00
Campbell Barton
d2a2d06691 Cleanup: simplify argument parsing for preview load enum
Use PyC_StringEnumItems to handle matching a value & raising an error
for invalid arguments.
2023-08-11 12:35:06 +10:00
Campbell Barton
3af7ed0e8e Cleanup: reduce number of calls to PyUnicode_FromString 2023-08-11 10:03:45 +10:00
Campbell Barton
9810942adf Cleanup: avoid uninitialized members in GHOST classes 2023-08-11 09:34:08 +10:00
Campbell Barton
87c61f2354 CMake: add warning for WITH_UNITY_BUILD 2023-08-11 09:34:07 +10:00
Campbell Barton
465810dd52 Fix missing headers, caused by recent cleanups 2023-08-11 09:23:36 +10:00
Lukas Stockner
2ac0b36e4e Cycles: Rework component layering in Principled BSDF
Overall, this commit reworks the component layering in the Principled BSDF
in order to ensure that energy is preserved and conserved.

This includes:
- Implementing support for the OSL `layer()` function
- Implementing albedo estimation for some of the closures for layering purposes
  - The specular layer that the Principled BSDF uses has a proper tabulated
    albedo lookup, the others are still approximations
- Removing the custom "Principled Diffuse" and replacing it with the classic
  lambertian Diffuse, since the layering logic takes care of energy now
- Making the merallic component independent of the IOR

Note that this changes the look of the Principled BSDF noticeably in some
cases, but that's needed, since the cases where it looks different are the
ones that strongly violate energy conservation (mostly grazing reflections
with strong Specular).

Pull Request: https://projects.blender.org/blender/blender/pulls/110864
2023-08-10 23:53:37 +02:00
Jacques Lucke
cc4d5c432c RNA: move headers to C++
Also see #103343.

Pull Request: https://projects.blender.org/blender/blender/pulls/111022
2023-08-10 22:40:27 +02:00
Jeroen Bakker
72d3e43a3b Vulkan: Enable Draw Manager Test Cases
This PR enabled the draw manager test cases when compiling with
`WITH_VULKAN_BACKEND=On`. Currently they should pass all the tests
in draw_pass_test.cc that also pass for OpenGL. The draw_visibility
test seems to be faulty (also for OpenGL).

The vulkan backend doesn't have all the features implemented to
pass the Eevee testcases and are expected to fail.

Pull Request: https://projects.blender.org/blender/blender/pulls/110994
2023-08-10 21:41:52 +02:00
Jacques Lucke
048fa6480f Cleanup: quiet unused parameter warning 2023-08-10 21:41:17 +02:00
Jacques Lucke
7c0e2646f9 Nodes: move more rna code to node files
Continuation of f7c0ef1f73.

Pull Request: https://projects.blender.org/blender/blender/pulls/111000
2023-08-10 20:48:41 +02:00
Harley Acheson
c4fb34a3f7 Fix #110085: Ignore Scroller Zone when on a Screen Edge
When the mouse cursor is between editors ignore scroller zones, which
overflow their areas, so that screen edges are always detected.

Pull Request: https://projects.blender.org/blender/blender/pulls/110402
2023-08-10 20:41:44 +02:00
Brecht Van Lommel
11bca76f96 Cycles: update OSL to work with version 1.13.2
While keeping compatibility with older versions.

Ref #110708

Pull Request: https://projects.blender.org/blender/blender/pulls/110980
2023-08-10 20:01:09 +02:00