Commit Graph

101942 Commits

Author SHA1 Message Date
Sergey Sharybin
dd5ef3f91a Refactor: Make prepare_viewlayer a base render method
Should be no functional changes.
2023-08-14 11:18:24 +02:00
Sergey Sharybin
c664618e10 Cleanup: Add _cb suffix to the callbacks stored in Render
Should be no functional changes.

Preparing for introduction of member function which are
available in the base class.
2023-08-14 11:18:24 +02:00
Richard Antalik
bf001961f3 Fix #110861: VSE operators disregards locked strips
Operators slip, swap and split operated on strips that are locked.
2023-08-14 05:54:27 +02:00
Campbell Barton
cdab5d82d7 CMake: remove non-functioning logic to delete files before installing
This logic has not been working since 2014 [0] although it was briefly
fixed (by accident) when TARGETDIR_VER was made an absolute directory
[1] (since reverted as that caused problems with CPACK/WIN32).

"file(REMOVE_RECURSE ${TARGETDIR_VER})" would attempt to remove:
- "${CMAKE_BINARY_DIR}/${TARGETDIR_VER}" instead of
- "${CMAKE_INSTALL_PREFIX}/${TARGETDIR_VER}".

While this could be re-enabled by correcting the path,
it slows down the install target by copying files every "install".

This could be made to detect changes and only cleaning files in this
case however this ends up being fairly involved, see: PR !111084.

As stale files haven't been causing problems as far as I'm aware,
remove this code.

[0]: e43c5fa005
[1]: d605cc7574
2023-08-14 12:57:24 +10:00
Richard Antalik
675b66d852 Fix #110846: VSE tools region not updated with other regions
Add listener to the region.
2023-08-14 04:07:15 +02:00
Clément Foucault
d844c5a13a Metal: Add support for Multi-Viewport
This seems to work but there is an issue with fragment
shader not getting the correct value.

Authored by Apple: Michael Parkin-White
2023-08-13 23:46:53 +02:00
Clément Foucault
c7dce76619 Metal: Various fixes
Authored by Apple: Michael Parkin-White
2023-08-13 23:42:06 +02:00
Clément Foucault
743d78461f GPU: Make test compile without OpenGL 2023-08-13 23:38:07 +02:00
Bastien Montagne
29930ef589 readfile: Move Object proxy validation code from lib_link to do_version.
This is now deprecated data, no reason to keep such logic in the main
lib-linking code of Object ID.
2023-08-13 13:43:54 +02:00
Campbell Barton
282944caac CMake: revert use of CMAKE_INSTALL_PREFIX as it broke CPack on WIN32
Absolute paths aren't supported when using CPack on WIN32.
This effectively reverts [0] & [1].

[0]: 7209ed80bb
[1]: d605cc7574
2023-08-13 21:34:03 +10:00
Bastien Montagne
6cd7eda1c6 Fix (unreported) wrong handling of depreacted non-Empty instantiating objects in readfile code.
Fixing this is do-version work. Having that kind of logic in lib-linking
code is... beyond despicable.
2023-08-13 13:10:27 +02:00
Bastien Montagne
44e3995cf5 Cleanup: Simplify 'expand' main loop in readfile code.
No behavioral change expected here.
2023-08-13 11:25:24 +02:00
Campbell Barton
d605cc7574 CMake: use CMAKE_INSTALL_PREFIX in more places
Also remove quotes for consistency as they aren't needed and weren't
used in quite a few places.
2023-08-13 14:27:47 +10:00
Campbell Barton
329474f018 CMake: fix for WITH_DOC_MANPAGE failing to run Blender
Use the installed executable location instead of the build location,
this would work in situations when the build location had relevant
files accessible but this is often not the case.
2023-08-13 14:19:57 +10:00
ChengduLittleA
337c47275c Fix #110917: Multiply UI_SCALE_FAC to view scroll operators
Previously the delta value is hard coded (40), this would be too slow on
high DPI screens. Now multiply that by `UI_SCALE_FAC` will solve the
issue.

Pull Request: https://projects.blender.org/blender/blender/pulls/110940
2023-08-13 04:57:36 +02:00
Hans Goudey
9804b2244a Cleanup: Make sculpt face visibility test inline
This simple function just performed a null check and an array lookup.
Just writing it in the few places its used works fine too, and avoiding
the function call per triangle can improve and make the check clearer.

Also, avoiding the abstraction makes the "node fully visible" check
when building the PBVH more obvious; that has been refactored here.

Pull Request: https://projects.blender.org/blender/blender/pulls/111072
2023-08-12 23:58:26 +02:00
Hans Goudey
b04a72866d Revert "Multires: Simplify grids normals update and grid to face map"
This reverts commit c97178fa2e.

This was committed to main by mistake, it was meant for a local branch.
2023-08-12 16:38:39 -04:00
Hans Goudey
d38a0cf537 Fix: Potential error in RNA operator description callback
Avoid freeing the RNA list before converting the result to std::string.
2023-08-12 16:29:51 -04:00
Guillermo
0f501865a5 Fix #111073: Crash when F3 is pressed
Initializing a string whit `nullptr` causes undefined behavior.

Pull Request: https://projects.blender.org/blender/blender/pulls/111075
2023-08-12 22:21:50 +02:00
Hans Goudey
c97178fa2e Multires: Simplify grids normals update and grid to face map
The goal is to move to more data oriented design, reducing memory
usage and simplifying code by clarifying data access, avoiding
unnecessary levels of abstraction, and reusing code.

- Simplify threading with the C++ threading API
- Pass the faces to update with an IndexMask instead of a pointer array
  - IndexMask uses less memory and simplifies masking and iteration
- Store the grid to face map with indices instead of pointers
  - Now this is exactly the same as `build_loop_to_face_map`
2023-08-12 12:20:10 -04:00
Hans Goudey
3d6a8ab54f Cleanup: Remove unused argument to PBVH draw 2023-08-12 12:17:25 -04:00
Iliya Katueshenock
63fd2575e6 Nodes: move more rna code to geometry node files
Continuation of 43667b807e.
Only geometry nodes with shared enum arrays.

Pull Request: https://projects.blender.org/blender/blender/pulls/111056
2023-08-12 17:36:42 +02:00
Germano Cavalcante
6332eecda0 Fix #110970: knife project is broken
Error in 5cdec2f12a

`ED_view3d_win_to_segment_clipped` returns the ray_end directly.

The code was treating it as if it were a direction.
2023-08-12 10:47:52 -03:00
Campbell Barton
7209ed80bb CMake: use CMAKE_INSTALL_PREFIX for the install destination
Use the variable instead of "." for the install destination.
While they're equivalent, it's not discoverable where the value
for "." is set.

It also results in paths containing "/./", while valid isn't so nice
if the paths are copied from the terminal for use elsewhere.
2023-08-12 23:44:06 +10:00
Campbell Barton
848e808b8a Cleanup: various non-functional C++ changes, correct doxy groups 2023-08-12 18:48:20 +10:00
Campbell Barton
311fa9768d Cleanup: spelling in comments 2023-08-12 16:29:51 +10:00
Campbell Barton
4f59b33873 Cleanup: minor changes to discover_nodes.py
- Compile & reuse the regular expression.
- Use `fh` instead of `f` for the file-handle.
- Correct typo.
2023-08-12 16:29:50 +10:00
Campbell Barton
86c4ce66af Cleanup: pass ICON_NONE instead of zero to UI functions 2023-08-12 16:29:49 +10:00
Campbell Barton
12538b75e9 Cleanup: unused but set variable warning 2023-08-12 16:29:48 +10:00
Pratik Borhade
d87db8d569 Fix #111024: Crash when adding attribute to curve object
After 12ef20990b, attributes and vertex group names were checked
simultaneously to fix the name collision. But this results in crash when
new attribute is added to curve object (it searches for vertex group
list). To avoid the crash, check for supported id types in new function
`BKE_id_supports_vertex_groups`.

Pull Request: https://projects.blender.org/blender/blender/pulls/111036
2023-08-12 07:37:37 +02:00
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
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
Brecht Van Lommel
0810d2ec54 Fix build errors, after merging PR not updated for latest changes 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
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