Commit Graph

126854 Commits

Author SHA1 Message Date
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
Julian Eisel
c19caff2dc Cleanup: Include layer tree element in assert check 2023-08-10 17:58:31 +02:00
Bastien Montagne
bcc0b9f73f Tweaks to previous commit affecting debug reports of our guarded allocator.
Somehow missed these tweaks (from @LazyDodo) in own recent 2e79ca3205
commit, sorry for the noise.
2023-08-10 17:56:36 +02:00
Bastien Montagne
2e79ca3205 Fix #110971: Replace our own barely-working backtrace on memleaks feature with ASAN utils.
Instead of storing the backtrace in all memory blocks, and trying to get
meaningful info out of this list of pointers when printing leaked ones,
just use `__asan_describe_address` when ASAN is enabled.

This also work on Windows, in addition to linux and (presumably) OSX,
but does require to build with ASAN enabled.

The previous code was not working very well anymore, for some reason the
call to `backtrace_symbols` seems to fail to give any meaningful
information nowadays on most of Blender code. And it was only
implemented for linux and OSX.

Based on an idea from @LazyDodo, many thanks!

Pull Request: https://projects.blender.org/blender/blender/pulls/111006
2023-08-10 17:54:56 +02:00
Julian Eisel
a89c104972 Cleanup: Don't set unused ID code member for Outliner layer base element
This is one of the many ID elements that should be ignored from further
processing in this if-else block. It would only set the
`TreeElement.idcode` (and call an assert) for this, which wasn't used
elsewhere. We're trying to untangle the code step by step and make it
more clear & explicit which data is set where, changes like this help.
2023-08-10 17:54:01 +02:00
Christoph Lendenfeld
8ddb8e0d05 Animation: Blend To Ease Slider
This PR blends the selected keyframes to an ease-in or ease-out curve.
The difference to the existing ease slider is that this one blends,
while the other snaps to the ease curve

Co-authored-by: Ares Deveaux <aresdevo@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/110566
2023-08-10 17:51:14 +02:00
Falk David
d14289c46a GPv3: Fix: Assert hit when exiting paint mode
The function `ed_object_mode_generic_exit_ex` was missing
a case for the `OB_MODE_PAINT_GREASE_PENCIL`.
2023-08-10 17:44:27 +02:00
Falk David
7e594b5d96 GPv3: Allow buttons for child nodes to be inactive
This makes it so that in the layer tree UI layers that have an
invisible parent will render their visibility icon as inactive (faded).
Same for the locked icon.
2023-08-10 17:44:27 +02:00
Iliya Katueshenock
9f8535a498 Fix: bring back repeat input node rna declaration
Wrongly removed as part of 43667b807e

Pull Request: https://projects.blender.org/blender/blender/pulls/111014
2023-08-10 17:40:08 +02:00
Julian Eisel
4095e6a14c Fix incorrect parameter value passed to ID template
This argument is a boolean, not an icon. Value of both would be 0.
2023-08-10 17:13:02 +02:00
Julian Eisel
ff636ed092 UI: Allow passing empty string to templateID to ensure no label
This caused confusion when Bastien passed an empty string to the ID
template, expecting that it would ensure no default label is placed, but
it caused the layout to be split. This is because we'd still add an
empty label in this case.
2023-08-10 17:12:18 +02:00
Philipp Oeser
dce2368b8c Fix #110464: rna_idprop_ui_create() fails to create new string property
The `BPy_IDPropertyUIManager` takes different keywords for different
data types in its `update` methods.
Booleans and Strings only handle defaults and description while Floats
and Ints can handle additional stuff like min/max.
(see `idprop_ui_data_update_string` vs. e.g.
`idprop_ui_data_update_float`)

There was a different code path in `rna_idprop_ui_create` for bools
already (only passing a subset to `update`), now use this for string as
well since it matches.

Bug introduced in 8b9a3b94fc.

Probably good for LTS.

Pull Request: https://projects.blender.org/blender/blender/pulls/110935
2023-08-10 16:54:35 +02:00
Julian Eisel
e2cd2236ca Refactor: Avoid unsafe cast for Outliner sequence elements
Relying on the `TreeStoreElem.id` void pointer makes assumptions about
what code elsewhere sets to it (it's also misleading since it's actually
not an ID pointer), in this case we can easily avoid that.
2023-08-10 16:51:50 +02:00
Julian Eisel
c0065979a1 Refactor: Remove hack to store sequence type in Outliner tree element
`TreeElement.idcode` would be reused to store the sequence type. This is
risky if the field is assumed to actually contain a valid ID-code,
without further checks.
This was only accessed in one place, which I've refactored to a clean,
type-safe solution now.
2023-08-10 16:51:29 +02:00
Christoph Lendenfeld
b56fc47eed Fix: Wrong property name and description 2023-08-10 16:33:44 +02:00
Christoph Lendenfeld
a0aa5480b1 Animation: Blend Offset Slider
Adds an operator to the Graph Editor that moves the selected
segment up/down so it aligns with the keys before/after the segment.

Co-authored-by: Ares Deveaux <aresdevo@gmail.com>
Co-authored-by: Sybren A. Stüvel <sybren@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/110544
2023-08-10 16:09:39 +02:00
Falk David
4f66031714 GPv3: Fix TreeNode::parent_group() for root group
For the root group, the parent is `nullptr` so calling `parent_group()`
would fail. This fixes the issue by adding a null check and returning
`nullptr` otherwise.
2023-08-10 16:05:21 +02:00