WIP: uv-simple-select #1

Closed
Chris Blackbourn wants to merge 182 commits from uv-simple-select into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.

182 Commits

Author SHA1 Message Date
8188c7a84a Fix #104374: Simplify UV Face Selection and UV Island Selection
Implement "Face Touching" UV selection for Box Select, Lasso Select
and Circle Select.

Implement "Penalty" system for UV click select.
2023-02-17 12:33:21 +13:00
65cfb1cd73 Cleanup: format 2023-02-17 12:32:16 +13:00
de91227bb5 Fix #104841: Split function for Cycles for sharp edges ignores attribute
Cycles uses the "split faces" mesh function to support sharp edges
and auto-smooth. However, 75ad8da1ea updated that
function to ignore the edges that are explicitly tagged as sharp and
only use the edge angle. Fix by taking the attribute into account too.
2023-02-17 12:32:16 +13:00
e4ae15b7ef Fix #104826: Mesh to BMesh with shape keys can corrupt layers
The custom data layer mappings from dfacaf4f40 were created
*before* the BMesh shape key layers were added, invalidating the BMesh
data offsets they stored. Fix by creating the mappings after all layers
have been created.
2023-02-17 12:32:16 +13:00
51bbcba3ff Fix: Use proper types in compare node link drag search options
Clean up logic to make it more clear and formalize the way to choose
fixed node data type based on operation. This make possible to more
easily fix wrong node data type for color type and less than ops.

Pull Request #104617
2023-02-17 12:32:16 +13:00
88cbb65268 Fix: Remove the rest of the tracks in the BKE_nlatrack_remove_and_free to free up the memory
Fix: The BKE_nlatrack_remove_and_free (#104752) unit test leaks a little memory. Cleaning up the rest of the track list to ensure everything is freed.
Co-authored-by: Nate Rupsis <nrupsis@gmail.com>
Pull Request #104839
2023-02-17 12:32:16 +13:00
b69b8e5198 Fix unused variable in release builds
Assert is not needed in this case.
2023-02-17 12:32:16 +13:00
83eff2bd33 Fix #104785: Quick fur keeps asset status of appended node groups
Use the recently added "clear_asset_data" option in the append operator.

Pull Request #104828
2023-02-17 12:32:16 +13:00
9f87978a2a WM: Add option for clearing asset data to append operator
When appending assets it often isn't expected for the asset tags and
meta-data to be included. Add an option to the append operator to
disable appending the asset data, exposing existing internal options.
2023-02-17 12:32:16 +13:00
7e2537da13 Fix #104166: Add redraw for asset marking and unmarking
When the users click the "Mark as Asset" with the mouse hover the fake
user button, the button was not refreshed. In fact, the areas are not
listening to the "NC_ID NA_EDITED", which is the signal emitted after
an asset is marked/unmarked. Because of this, the areas aren't redrawn
(especially the ID buttons).

This little patch adds the event listening for the areas where this
problem is happening  node editor and properties editor.

Pull Request #104694
2023-02-17 12:32:16 +13:00
994f3533f8 Cleanup: Use Span to iterate over nodes instead of ListBase
Similar to 5b8e2ebd97.
2023-02-17 12:32:16 +13:00
6f0c48710e Cleanup: Nodes: Avoid unnecessary const cast, use early return 2023-02-17 12:32:16 +13:00
16505aa84a Cleanup: Fix operator description 2023-02-17 12:32:16 +13:00
a5a43ad551 Cleanup: Adding in NLA Track Remove / Remove and free BKE methods
This PR adds 2 new methods:
* BKE_nlatrack_remove
* BKE_nlatrack_remove_and_free

and modifies the existing `BKE_nlatrack_free` to remove the track list parameter.

This refactor splits out the removal / freeing into it's own methods, and provides a higher order method (BKE_nlatrack_remove_and_free) to conveniently call both.

Co-authored-by: Nate Rupsis <nrupsis@gmail.com>
Pull Request #104752
2023-02-17 12:32:16 +13:00
08590dc307 Curves: Add select more/less
This adds the "Select More/Less" operators for Curves. Both operators use the `select_adjacent` function to (de)select adjacent points.

Pull Request #104626
2023-02-17 12:32:16 +13:00
1979b55b1f Cleanup: Refactor File/Asset Browser button dragging code
Code to set the dragging data for a button was mostly duplicated, they
share it now. The followup commit also needs an easy way to reuse the
logic, which is possible now.
2023-02-17 12:32:16 +13:00
769d0a629b UI: Refactor how draggable part of button is determined
No longer use the existance of an image pointer inside the button, or
the the type of a button to decide if the entire button should be
draggable, or only its icon. This was rather sneaky, undocumented
behavior. Instead make this a proper option in the public UI API, and
enable it by default in specific cases to match the previous behavior.

This at least makes the behavior known and controllable in the API, and
not something that's just "secretly" done deep down in the button
handling code. I'd argue we should just use the entire button width by
default for dragging, but that would be a bigger change.
2023-02-17 12:32:16 +13:00
768ccbc07d Curves: Add remove_selection function
This adds a `remove_selection` function that can be used by other
objects that make use of `CurvesGeometry`.

Pull Request #104813
2023-02-17 12:32:16 +13:00
b9ed92c828 Cleanup: Remove read-only attribute type
After the removal of the "normal" attribute providers, we no longer
use the concept of read-only attributes. Removing this status simplifies
code, clarifies the design, and removes potentially buggy corner cases.

Pull Request #104795
2023-02-17 12:32:16 +13:00
328ac680b6 Geometry Nodes: Remove "normal" attribute
The "normal" was added before fields existed because we needed a
way to expose the data to geometry nodes. It isn't really an attribute,
because it's read-only and it's derived rather than original data.

No features have relied on the "normal" attribute existing, except
for the corresponding column in the spreadsheet. However, the
column in the spreadsheet is also inconsistent, since it isn't an
attribute but looks just like the other columns. The normal is
always visible in the spreadsheet.

Pull Request #104795
2023-02-17 12:32:16 +13:00
f2ec567733 Themes: Fix several issues in Blender Light theme
* Fix #92539: Hard to read the breadcrumbs.
* Fix View Item active, hover, and text color (e.g. count numbers in the
  Spreadsheet were almost unreadable).
* Fix mismatching node type colors with the default theme.
  Blender Light is meant to be simply a brighter version of the default,
  so screenshots and tutorials can be followed with both themes.
* Use the same outline color for widgets, so they match when aligned in a row.
* Make panels standout (not fully transparent), like in the default theme.
2023-02-17 12:32:16 +13:00
6be5939112 Fix #104697: Curves Sculpt: Setting brush shortcuts does not work
The active tools in `_defs_curves_sculpt` don't use names that are
exactly the same as the corresponding brush name with "builtin_brush."
at the beginning, instead they use more standard identifiers without
capitals or spaces.

The "brush_select" utility operator assumed the names matched though.
That can be fixed by manually mapping the brushes to the active tools.

Pull Request #104792
2023-02-17 12:32:16 +13:00
f30f1818fd Fix #104698: Assert and failure adding shortcuts to curves sculpt tools
The keymap name in `WM_keymap_guess_from_context` didn't match the
name of the keymap in the Blender default keymap (`km_sculpt_curves`).
Fix by changing the utility function to match the keymap name.

Before right clicking on any tool in curves sculpt mode gave an assert,
now it shows a context menu.

Pull Request #104791
2023-02-17 12:32:16 +13:00
e1fd1b8d17 UI: Improvement to screen_find_area_xy
In BKE_screen_area_map_find_area_xy (find a ScrArea by 2D location),
ignore edges by using screen verts instead of totrct

Differential Revision: blender/blender#104680

Reviewed by Brecht Van Lommel
2023-02-17 12:32:15 +13:00
5880150620 Fix #104584: Reassigning effect strip input does not update its position
Lookup cache was not invalidated, to update attached effects position, a handle
of a input strip is touched.

To update attached effects, currently the code only does that when strip
position is changed. This is, because effect strip updating is done internally
in sequencer module code and ideally shouldn't be done at all. A TODO comment
with further explanation is added.
2023-02-17 12:32:15 +13:00
837f909664 Windows: allow windows to span multiple monitors
On the Windows platform allow Blender windows to be created that are
spread over multiple adjacent monitors.

---

On Windows we are quite feature-complete and stable for the creation and placement of multiple (non-temp) Blender windows. We correctly do so across multiple monitors no matter their arrangement, resolution, and scale.

However, there is another way that Blender could use multiple monitors - suggested by a core dev - which is to size a window so that it comprises multiple monitors. There are some advantages to this way of working because the one window remains constantly active and in focus. It also allows a single region (like a node editor) to be as large as possible.

But this way of working is not currently possible. That is because during window creation we constrain them to fit within the confines of the nearest single monitor. This has mostly been done for simplicity and safety. We don't want to restore a saved window to a position where it cannot be seen or used.

This patch addresses that. It allows windows to span multiple monitors, and does so safely by constraining the four corners of the window to be within the working area of any active monitor.  This means it allows the creation of single windows as shown below in blue (left two), but does not allow the one in orange (right):

![image.png](/attachments/b2a9dfca-d54c-467a-ab95-717df3b25051)

Note this has been previously (before gitea) reviewed and approved by Brecht.

Co-authored-by: Harley Acheson <harley.acheson@gmail.com>
Pull Request #104438
2023-02-17 12:32:15 +13:00
55d7793bff Cleanup: format 2023-02-17 12:32:15 +13:00
e71615a26d Cleanup: document & improve naming for Wayland's pending window actions 2023-02-17 12:32:15 +13:00
89e12ddf86 Fix #104370: Draw: Don't request the same attribute more than once
Avoid running out of attributes when multiple material slots use the same one.

Cleanup:
Removes the return value from drw_attributes_add_request since it shouldn't be modified afterward and it's never used.
Avoid making copies of DRW_AttributeRequest in drw_attributes_has_request.

Co-authored-by: Miguel Pozo <pragma37@gmail.com>
Pull Request #104709
2023-02-17 12:32:15 +13:00
7ee8749aac Fix: Skip anonymous CustomData layers for the python API
Now that the UV map names are read from the evaluated mesh the names of
the anonymous layers would show up in the UV Map node and be accessible
via the python interface.

This changes the collection definition to skip anonymous layers.

Pull Request #104783
2023-02-17 12:32:15 +13:00
c2071da085 Cleanup: Make format, fix missing static warning 2023-02-17 12:32:15 +13:00
b47bd6e619 Cleanup: Use simpler attribute transfer API in duplicate elements node
Instead of retrieving which attributes to transfer from the geometry set
which exists at a different abstraction level, get them from accessors
directly with a newer utility function. This removes boilerplate code
and makes the logic clearer for a future even more generic attribute
propagation API.
2023-02-17 12:32:15 +13:00
Colin Marmond
f03cf8ac08 Fix #102529: De-duplicate add node search items with assets
Fix a little omission. The id name has a 2 char prefix which has
to be removed in order to compare to the real name.

Pull Request #104793
2023-02-17 12:32:15 +13:00
07025f0eb7 Fix #104789: uv_layers.remove() always raises error
A simple typo from 6c774feba2. Also return
so nothing happens when the UV map isn't found.
2023-02-17 12:32:15 +13:00
c7c524d8d4 Fix #104690: Evaluated positions user-after-free for copied poly curves
The evaluated positions cache can live longer than a specific
`CurvesGeometry`, but for only-poly curves, it pointed to the positions,
which are freed when the curves are. Instead, use the same pattern
as the evaluated offsets and don't store the positions span, just return
it when retrieving evaluated positions.
2023-02-17 12:32:15 +13:00
93299b3f1b Cycles: disable AMD GPU rendering binaries due to compiler bugs
There are known bugs in HIP compiler that are causing random build failures
when making changes to the Cycles kernel. This is preventing developers from
efficiently making improvements to Cycles.

For now Cycles AMD GPU rendering is disabled in Blender 3.6 until a good
solution is found, so that ongoing work like Principled v2 is not blocked.
We hope this can be resolved later on in the 3.6 release cycle.

Ref #104786
2023-02-17 12:32:15 +13:00
36147cb8b8 Revert changes to align asset library labels in menus
This reverts 1116d821dc and part of 5bac672e1a.

The solution was made specifically for the 3.5 release, to avoid
breaking other cases. The previous commit addressed the problem properly
by letting the general menu code align labels where needed.
2023-02-17 12:32:15 +13:00
fa1222f296 UI: Ensure menus with icons align all menu item labels
Usually in Blender, we try to align the labels of items within a menu,
if necessary by adding a blank icon for padding. This wasn't done for
menus generated from enum properties (RNA or custom property enums). Now
we do it whenever there is at least one item with an icon.
2023-02-17 12:32:15 +13:00
297d2b5fa1 Fix weird icon padding in asset library selector menu button
Since the menu doesn't automatically align the labels like other menus
and pulldowns in Blender, I manually made them align using the blank
icon. However the menu button would also include this blank icon now.

This is a specific fix for the 3.5 release. In the main branch I will
replace it with proper support for automatically aligning labels in such
menus.
2023-02-17 12:32:15 +13:00
Matti-Ranta
085f5fd50e Cleanup: delete .arcconfig
Now that https://developer.blender.org/ has been decommissioned, arcconfig is no longer needed.

Pull Request #104768
2023-02-17 12:32:15 +13:00
3d863eb653 Fix possible compiler warning and linker error
Type was forward declared as class, but is a struct. GCC is quiet about this
Clang gives a warning about potential linker errors on MSVC.
2023-02-17 12:32:15 +13:00
1be728996a Revert "Splash screen for Blender 3.5"
This reverts commit a0b4da2bd0.
2023-02-17 12:32:15 +13:00
765bd10501 Revert "Blender 3.5 Beta:"
This reverts commit 904b7e4e41.
2023-02-17 12:32:15 +13:00
38455d2616 Splash screen for Blender 3.5
Credits: Nicole Morena
2023-02-17 12:32:15 +13:00
4f3ebb158c Blender 3.5 Beta:
* BLENDER_VERSION_CYCLE set to beta
* Update pipeline_config.yaml to point to 3.5 branches and svn tags
* Update and uncomment BLENDER_VERSION in download.cmake
2023-02-17 12:32:15 +13:00
4dd17bfaaa Release cycle: Bump version to 3.6. 2023-02-17 12:32:15 +13:00
67383276e2 Asset Browser: Add separator line & icon padding for import method menu
Usually when a menu item displays an icon, we indent all other items
with an empty icon so items align nicely. Now with more built-in asset
libraries (the new "Essentials" library), this inconsistency becomes
more apparent.

Also add a separator line between the "All" asset library and the
others, makes the menu look more organized.
2023-02-17 12:32:15 +13:00
0879863aa1 Asset Browser: Hide import method menu for essentials
Essentials always use "Append (Reuse Data)", displaying the menu to
change that doesn't make sense.
2023-02-17 12:32:15 +13:00
6f67d735f7 Assets/UI: Use UI-list for asset library preferences UI
The Preferences for asset libraries are becoming more than a simple name
+ path. E.g. there is now an Import Method options, and we previously
also considered a Relative Paths option (which we may still want to
add). The previous UI, while consistent with the Auto Run Python Scripts
UI isn't well suited for less than trivial cases. Using UI lists makes
the UI more scalable and follows usual list UI patterns more. There is
also more space for the path button now.

Part of #104686.
2023-02-17 12:32:15 +13:00
ded9e2798c Asset Browser: Rename "Import Type" to "Import Method"
"Type" sounds like you're selecting a thing, not a behavior. So "Method"
should be better. Part of 104686.
2023-02-17 12:32:15 +13:00
34a203cfb1 Assets: Preference for default import method for an asset library
The default import method for an asset library can now be determined in
the Preferences. The Asset Browser has a new "Follow Preferences" option
for the importing. The essentials asset library still only uses "Append
(Reuse Data)".

This is part of #104686, which aims at improving the import method
selection, especially for the introduction of the new essentials library
(which doesn't support certain import methods). Further changes are
coming to improve the UI, see #104686.

Pull Request: #104688
2023-02-17 12:32:15 +13:00
637dcd8a0a Curves: Replace quick fur operator, add to add menu
The quick fur operator now uses the new hair system. It adds a new
curves object for every selected mesh, and adds geometry nodes
modifiers from the essentials assets that generate curves. A few
settings are exposed in the redo panel, including an option for whether
to apply the modifier to generate the initial curves so that there is
original editable data.

The point of the operator is to give people a sense of how to use the
node groups and to give a very fast way to build a basic setup for
further tweaking.

Pull Request #104764
2023-02-17 12:32:15 +13:00
f1b7c2fb65 Fix #90629: VSE: Split selection is determined by menu position
Use the right hand side selection, as it fits the typical workflow
the best.

Arguably, the same would need to be done for the k-shortcut, but
that is another issue to be tackled. As well as making the selection
active.

Pull Request #104777
2023-02-17 12:32:15 +13:00
c1d2081e6d Fix #104760: GPencil Fill Gap circles no longer disappear when blue line appear
The problem was the alpha channel was set wrongly and the original 0 value was replaced with 1 by error.
2023-02-17 12:32:15 +13:00
af437548f2 Curves: move edit mode out of experimental
We (Dalai, Hans, Falk, Simon and me) decided that the curves edit mode
is useful enough to justify moving it out of experimental now. So far it
supports the following features:
* Various selection tools. The selections are synced with sculpt mode.
* Transform tools.
* Delete curves/points.

More functionality of the old curve edit mode will be ported over in
future releases.
2023-02-17 12:32:15 +13:00
4316ab1d24 Cleanup: LineArt: Remove lineart_cpp_bridge.cc
Removed this file because lineart_cpu.cc is already c++.

Pull Request #104736
2023-02-17 12:32:15 +13:00
2ea260993f EEVEE: Remove unnecessary material optimization assertion.
Fix unreported assert in basic scenes.

Authored by Apple: Michael Parkin-White

Pull Request #104775
2023-02-17 12:32:15 +13:00
15cdd89f2b Curves: Add delete operator to edit mode
This implements the delete operator in curves edit mode. The behavior
is similar to the delete operator in the edit mode of legacy curves,
i.e. it's actually dissolving and doesn't split curves. This is also
the behavior that we generally want for the hair use case.

The operator is added to the `Curves` menu and can be accessed via
the keyboard using `X` or `Del`.

Pull Request #104765
2023-02-17 12:32:15 +13:00
33fd7c1ce8 Curves: add Curve Parameter Falloff to comb brush
This adds a new `Curve Falloff` popover to the comb brush tool settings.
The curve control allows changing the brush weight along the curve to
e.g. affect the tip more than the root. This is a relative way to get
something like stiffness for short hair.

This functionality could potentially be added to some other brushes,
but the comb brush is the most important one, so that is added first.

I did add the buttons add the buttons to choose a curve map preset.
However, I did not add the preset dropdown, because that just adds
some unnecessary complexity in the code now and is redundant.

Pull Request #104589
2023-02-17 12:32:15 +13:00
fbbe2b4eaa Cleanup: extract the check to save a blend file into a function
Part of D11422 by @filedescriptor, makes it convenient to run a funciton
when the file cannot be saved.
2023-02-17 12:32:15 +13:00
eaccf5d7b1 Cleanup: rename Byte to Bytes in Python string utilities
These functions operate on byte arrays, not a single byte,
match naming for CPython's PyBytes_AS_STRING.
2023-02-17 12:32:15 +13:00
df58ee679f Mesh: Set active attribute values edit mode operator
This patch adds a simple operator to set values of the active
attribute for the selected element. The aim is to give simple control
over attribute values in edit mode rather than to provide the fastest
workflow for most cases. Eventually this operator might be less
important compared to more advanced attribute editing tools, but for
now, exposing a little bit of functionality is low hanging fruit and
will help to see the possibilities.

The implementation mostly consists of boilerplate to register the
necessary property types for the operator and draw their UI.
Beyond that, we just loop over selected elements and set a value.

Pull Request #104426
2023-02-17 12:32:14 +13:00
be92bfd6fa Cleanup: quiet clang warnings
Quiet unused argument, shadow, array-bounds & range-loop-bind-reference
warnings.
2023-02-17 12:32:14 +13:00
fdaf71d126 Cleanup: spelling in comments 2023-02-17 12:32:14 +13:00
a43dca7424 Cleanup: quiet warnings from shellcheck, correct indentation 2023-02-17 12:32:14 +13:00
a1e9657794 Cleanup: use 'show_' prefix for RNA sculpt booleans
Follow naming conventions from
https://wiki.blender.org/wiki/Source/Architecture/RNA
2023-02-17 12:32:14 +13:00
1a51ff2f4b Fix #84057: Delete operator removes unexpected strip
Caused by strips being flagged for removal, but the flag was never
cleared. As far as I can tell, this issue is not reproducible anymore,
but there may be files with this flag still set.
2023-02-17 12:32:14 +13:00
de23e63607 Fix overlay_uniform_color_clipped inheritance
overlay_uniform_color_clipped was inheriting from overlay_depth_only, which doesn't
make much sense.
I've changed it to inherit from overlay_uniform_color instead, which is consistent
with other \*\_clipped variants of shaders.

Pull Request #104761
2023-02-17 12:32:14 +13:00
b47c938af2 Eevee: GPU Material node graph optimization.
Certain material node graphs can be very expensive to run. This feature aims to produce secondary GPUPass shaders within a GPUMaterial which provide optimal runtime performance. Such optimizations include baking constant data into the shader source directly, allowing the compiler to propogate constants and perform aggressive optimization upfront.

As optimizations can result in reduction of shader editor and animation interactivity, optimized pass generation and compilation is deferred until all outstanding compilations have completed. Optimization is also delayed util a material has remained unmodified for a set period of time, to reduce excessive compilation. The original variant of the material shader is kept to maintain interactivity.

Also adding a new concept to gpu::Shader allowing assignment of a parent shader from which a shader can pull PSO descriptors and any required metadata for asynchronous shader cache warming. This enables fully asynchronous shader optimization, without runtime hitching, while also reducing runtime hitching for standard materials, by using PSO descriptors from default materials, ahead of rendering.

Further shader graph optimizations are likely also possible with this architecture. Certain scenes, such as Wanderer benefit significantly. Viewport performance for this scene is 2-3x faster on Apple-silicon based GPUs.

Authored by Apple: Michael Parkin-White

Ref T96261
Pull Request #104536
2023-02-17 12:32:14 +13:00
4bfffa41a6 OBJ: fixed some faces wrongly skipped in invalid face validation logic (#104593)
The logic for looping over imported OBJ faces and checking whether any
of them are "invalid" (duplicate vertices) was wrongly skipping
validation of the next face right after some invalid face. It
was the previously invalid face, moving the last into its place,
but then the loop was incrementing the face index and that just-moved
face was not properly validated.

Fixes #104593 - importing attached obj file (which contains some faces
that have duplicate indices). Added test coverage with a much smaller
obj file.
2023-02-17 12:32:14 +13:00
48693eecb0 Fix: Curve resolution input node missing default
When the attribute doesn't exist, the node should give the default
of 12, as defined by the accessor method for `bke::CurvesGeometry`.

Pull Request #104674
2023-02-17 12:32:14 +13:00
77417114ca Fix wrong variable being used as plan in 'gizmo_3d_dial_matrixbasis_calc'
A plane must be `float[4]`.
2023-02-17 12:32:14 +13:00
46d858a8dd Revert "MSVC: lower C4100 warning level from 4 to 3"
This reverts commit db4e7616f3.

Caused many issues when compiling mantaflow.
2023-02-17 12:32:14 +13:00
90f57ca1ca Gizmo: use the final matrix for the dial3D clip plane
Dial3D uses the `matrix_basis` for the clip plane.

This can cause inconsistencies if the gizmo has `matrix_offset` or
`matrix_space`.
2023-02-17 12:32:14 +13:00
42d838ca07 MSVC: lower C4100 warning level from 4 to 3
This better aligns with OSX/Linux warnings.

Although `__pragma(warning(suppress:4100))` is not the same as
`__attribute__((__unused__))` in gcc (which only affects the attribute
instead of the line), it still seems to be better to use it than to
hide the warning entirely.
2023-02-17 12:32:14 +13:00
024c4bfc90 GPU: Fix wrong 2D shader used from 3D drawing
Regression introduced by d165d6aa2a.
2023-02-17 12:32:14 +13:00
452522958d Fix #104748: GPencil: Fill tool is not working at all
Caused by missing color uniform update.
2023-02-17 12:32:14 +13:00
e1e157565b Curves: Add transform tools to toolbar
This commit also makes `ED_transform_calc_gizmo_stats` work
for curves.

Pull Request #104750
2023-02-17 12:32:14 +13:00
5dda4567d2 Geometry Nodes: Operator to wrap a modifier's node group
As described in #104171, add an operator that creates a new node group
that contain the current node group and named attribute nodes to deal
with the outputs. This saves manual work when moving a high-level
modifier to the node editor for better procedural control.

Pull Request #104546
2023-02-17 12:32:14 +13:00
481baf0184 Curves: cage overlay for sculpt mode
This adds a new overlay for curves sculpt mode that displays the curves that the
user currently edits. Those may be different from the evaluated/original curves
when procedural deformations or child curves are used.

The overlay can clash with the evaluated curves when they are exactly on top of
each other. There is not much we can do about that currently. The user will have
to decide whether the overlay should be shown or not on a case-by-case basis.

Pull Request #104467
2023-02-17 12:32:14 +13:00
d6e95c5801 Cleanup: rename vertex buffer attribute to be more specific
This renames `data` and `color` to `selection`. This is better because
it's actually what the corresponding buffers contain. Using this
more correct name makes sharing vertex buffers between different
gpu batches for different shaders easier.
2023-02-17 12:32:14 +13:00
ad934593af Assets: show all assets by default instead of current file
The "current file" mode is only useful when creating new assets.
However, the far more common use case and the one that should require
fewer steps is to use existing assets.

There is a risk that this causes freezing if the file browser preview
caching does not work properly. So we'll have to keep an eye on the bug
tracker to see if this is an issue in practice.

Pull Request #104749
2023-02-17 12:32:14 +13:00
2a9cc75a37 Assets: bundle Essentials with Blender
This patch adds an "Essentials" asset library that is bundled with Blender.
Also see #103620. At build time, the `lib/assets/publish` folder is copied
to `datafiles/assets` in the build directory.

In the UI, the "Essentials" library can be accessed like other custom asset
libraries with the exception that assets from that library cannot be linked.

The immediate impact of this is that Blender now comes with some geometry
node groups for procedural hair grooming.

Pull Request #104474
2023-02-17 12:32:14 +13:00
1e38fe4f27 Fix #104652: UV Face Dots randomized
Match the check from before 75db4c082b,
where we just checked that the face dots bitmap wasn't null.
2023-02-17 12:32:14 +13:00
d1413a3eef Curves: Use deformed points in edit mode overlay
Uses the deformed crazyspace to populate the position buffer for Curves edit mode overlay.

Pull Request #104705
2023-02-17 12:32:14 +13:00
3120bfa0fc OBJ: Support polylines with more than 2 vertices.
The OBJ spec (page B1-17) allows "l" entries to specify
polylines with more than 2 vertices, optionally with texture
coordinates.

Previously, only the first 2 vertices of each polyline
were read and added as loose edges, failing when texture
coordinates were present.

This adds support for proper polylines, reading but ignoring
texture coordinates.

Pull Request #104503
2023-02-17 12:32:14 +13:00
1e243b93b8 MSVC: suppress additional warnings out of external headers
In 161908157d we moved all warnings
coming out of the library folder to /W0 as many of them do not follow
our code-style nor can we force them to.

When i made this change, i took `/external:templates-` to mean
"and that goes for you too, templates" and it decisively does the
opposite leading to /W3 warnings coming out of openvdb

This change removes the flag as it should have never have been added
in the first place.
2023-02-17 12:32:14 +13:00
Robin Hohnsbeen
153e4256d4 Sculpting: Vector displacement for the sculpting draw brush
Sculpt: Added vector displacement for the sculpting draw brush (area plane mapping only for now)

Vector displacement maps (VDM) provide a way to create complex displacements that can have overhangs in one brush dab.
This is unlike standard displacement with height maps that only displace in the normal direction.
Forms like ears, curled horns, etc can be created in one click if VMDs are used.
There is a checkbox on the draw brush in the texture settings "Vector Displacement" that enables/disables this feature.

Technical description: The RGB channels of a texture in a brush stroke are read and interpreted as individual vectors, that are used to offset vertices.
As of now, this is only working for the draw brush using the area plane mapping. Symmetry and radial symmetry are working.

A few things to consider when making VD-Maps:
* UVs need to stay intact for the bake mesh (e.g. voxel remeshing can't be used to create VD Meshes)
* When exporting a VD Map it should be in the file format OpenEXR (for positive and negative floating point values).
* Export resolution can be 512x512 or lower (EXR files can get very large, but VDM brushes don't need a high resolution)

And when using them:
* Inside Blender clamping needs to be unchecked on the texture
* The brush falloff should be set to constant (or nearly constant)

This patch was inspired by this [right-click-select proposal](https://blender.community/c/rightclickselect/WqWx/) Thanks for the post!

(Moved [this patch](https://archive.blender.org/developer/D17080) to here.)

Co-authored-by: Robin Hohnsbeen <robin@hohnsbeen.de>
Pull Request #104481
2023-02-17 12:32:14 +13:00
0bd9a9ab59 Fix memory leak in view3d_select
There was an unintentional early return in the click select
execute function that caused the operator properties not
to be freed.
2023-02-17 12:32:14 +13:00
40321e2547 Curves: change collision radius for consistency with default radius
Offset distance for curve collision  will be matched with default curve
radius for better visibility.

Pull Request #104648
2023-02-17 12:32:14 +13:00
810e43e27d Fix: duplicate elements node does not update curve type counts
Curve type counts are updated eagerly but it was missing in this
node leading to a crash further down the line where the counts
were expected to be correct.
2023-02-17 12:32:14 +13:00
5158ff0190 Allocator: Fail building when trying to MEM_delete a void pointer
`MEM_delete()` is designed for type safe destruction and freeing, void
pointers make that impossible.
Was reviewing a patch that was trying to free a C-style custom data
pointer this way. Apparently MSVC compiles this just fine, other
compilers error out. Make sure this is a build error on all platforms
with a useful message.
2023-02-17 12:32:14 +13:00
6858332d6d Build: correct forwarding jobs argument to make_deps_wrapper.sh 2023-02-17 12:32:14 +13:00
80ce22010b Constraints: use a dimensionless unit prop for Maintain Volume
The Volume property of the Maintain Volume constraint was marked as a
distance, which made it confusing--especially with non-metric units.

The volume can actually be understood as a factor of the initial
volume, so it should be dimensionless.

Additionally, the volume had a range of 0.001 to 100.0. This is wide
enough in most cases, but sometimes you may need to go orders of
magnitude higher or lower to consider vast or thin objects, and there
should be no drawback to extending the limits, provided they stay
positive.

Pull Request #104489
2023-02-17 12:32:14 +13:00
1a10effc13 Cycles: Temporary fix for Principled Hair albedo
The proper fix (bb9eb262d4) caused compilation problems with HIP, so we're
delaying it until 3.6.
To fix the original bug report (#104586), this is a quick workaround that'll
hopefully not upset the compiler.

Pull Request #104723
2023-02-17 12:32:14 +13:00
24b2b3d9b0 Fix T103354: Author extents on UsdGeomMesh
A properly authored USD file will have the extent attribute authored on all prims conforming to UsdGeomBoundable.
This cached extent information is useful because it allows the 3D range of prims to be quickly understood without reading potentially large arrays of data. Note that because the shape of prims may change over time, extent attributes are always evaluated for a given timecode.

This patch introduces support for authoring extents on meshes and volumes during export to USD.

Because extents are common to multiple kinds of geometries, the main support for authoring extents has been placed in USDAbstractWriter, whose new author_extent method can operate on any prim conforming to pxr::UsdGeomBoundable. The USD library already provides us the code necessary to compute the bounds for a given prim, in pxr::UsdGeomBBoxCache::ComputeLocalBound.
Note that not all prims that are imageable are boundable, such as transforms and cameras.

For more details on extents, see https://graphics.pixar.com/usd/release/api/class_usd_geom_boundable.html#details.

Note that when new types of geometries are introduced, such as curves in https://developer.blender.org/D16545, we will need to update the USD writer for that geometry such that it calls this->author_extent.

Update on Feb 2: This patch has been updated to include a unit test to ensure authored extents are valid. This test requires new test assets that will need to be submitted via svn. The test assets are attached in the d16837_usd_test_assets.zip file. To use, unzip and merge the contents of this zip into the lib/tests/usd folder.

This unit test also addresses #104269 by validating compliance of exported USD via UsdUtils.ComplianceChecker.

Pull Request #104676
2023-02-17 12:32:14 +13:00
e266e5464b Gizmo: press shift key to scale cage2d gizmo uniformly
Reviewed by: Campbell Barton
Pull Request #104418
2023-02-17 12:32:14 +13:00
1acfb158b5 Revert: Formatting changes space_toolsystem_toolbar 2023-02-17 12:32:14 +13:00
f0a0f78aa3 Deps: build one at a time, each using all available cores on Linux
Use a MAKE wrapper for 'make deps' on Linux that ensures dependencies
are built one at a time. This is preferable because building many
dependencies at once made troubleshooting impractical and had the
downside that large deps such as LLVM would bottleneck on a single core.

This may be used for macOS, so far it's only tested on Linux.
2023-02-17 12:32:14 +13:00
9592cbd972 GNUmakefile: include install directory in 'make deps' message
Avoids uncertainly, ensure deps are copied from the right place.
2023-02-17 12:32:14 +13:00
f5dd3da9c9 Update RNA to User manual mappings 2023-02-17 12:32:14 +13:00
8ff35ff95d PyDocs: update links in generated API docs for GITEA migration
- Correct broken link for undocumented modules.
  Point to the contributing page, it seems #51062 was lost with the
  GITEA task migration.
- Correct Blender Version link to the SHA1.
2023-02-17 12:32:14 +13:00
dfc9d29a51 Cleanup: avoid redundant sqrt when picking reroute nodes 2023-02-17 12:32:14 +13:00
1ba32c8911 Cleanup: pass a const argument to CustomData_get_elem_size 2023-02-17 12:32:14 +13:00
74ae8b3c62 Cleanup: line wrapping in USERPREF_PT_experimental_new_features
Changing from Phabricator links caused poor formatting.
Also remove blank lines between comment and it's function.
2023-02-17 12:32:14 +13:00
ba710f9d49 Cleanup: include missing header, sort CMake file lists 2023-02-17 12:32:14 +13:00
d1b5705f59 Cleanup: quiet unreachable-code warning, use ARRAY_SIZE macro 2023-02-17 12:32:14 +13:00
f85420ede5 License headers: add missing license identifier 2023-02-17 12:32:13 +13:00
df60d2d0a5 Fix #66863: Bisect plane rotation behavior bugged for side/cut view
The matrix of the rotation gizmo is somewhat confusing.

Attaching to the Z axis has more predictable results.
2023-02-17 12:32:13 +13:00
e3b9903252 Cleanup: spelling in comments, reference enum types in doc-strings
Also use doxy formatting for structs in sculpt_uv.c.
2023-02-17 12:32:13 +13:00
78f3157ae7 Cleanup: format 2023-02-17 12:32:13 +13:00
0d09e56cce Cleanup: use typed enum (eDirEntry_SelectFlag) where appropriate 2023-02-17 12:32:13 +13:00
b79345d97e BLI_utildefines: add ^= operator to ENUM_OPERATORS macro 2023-02-17 12:32:13 +13:00
Erik Abrahamsson
d6bd80e0c1 Docs: improve online manual lookup time time
Matching the RNA id's to the search pattern is slow because
of the function `fnmatchcase`. This patch first checks the string
prefix without any special characters used by fnmatch,
if the `startswith` check fails, there is no need to check `fnmatchcase`.
Before the optimization, an online manual lookup took about 400ms
which is quite noticeable, with this patch applied it's under 10ms.

Ref !104581.
2023-02-17 12:32:13 +13:00
a62534fd48 Revert "Cycles: Clean up the Principled Hair BSDF implementation"
This reverts commit cb77865c21.

Appears to break HIP compilation, so delay until 3.6.
2023-02-17 12:32:13 +13:00
da0eef4eab Cycles: Add support for CUDA 12
CUDA 12 no longer supports sm_3*, in particular 35 and sm_37,
so skip building those if only CUDA 12+ is available.

Pull Request #104713
2023-02-17 12:32:13 +13:00
ab0fcf2590 Fix #104097: re-enable Cycles AMD Vega support
The internal compiler error appears to be gone. Unclear why it appeared in the
first place and why it's gone now. Just random kernel code changes causing it.

Pull Request #104719
2023-02-17 12:32:13 +13:00
f8cd9d7875 Cycles: Clean up the Principled Hair BSDF implementation
- Rename roughness variables for more clarity - before, the SVM/OSL code would
  set s and v to the linear roughness values, and the setup function would over-
  write them with the distribution parameters. This actually caused a bug in the
  albedo code, since it intended to use the linear roughness value, but ended up
  getting the remapped value.
- Deduplicate the evaluation and sample functions. Most of their code is the
  same, only the middle part is different.
- Changed albedo computation to return the sum of the intensities of the four
  BSDF lobes. Previously, the code applied the inverse of the color->sigma
  mapping from the paper - this returns the color specified in the node, but
  for very dark hair (e.g. when using the Melanin controls) the result is
  extremely low (e.g. 0.000001) despite the hair still reflecting a significant
  amount of light (since the R lobe is independent of sigma). This causes issues
  with the light component passes, so this change fixes #104586.
- There's quite a few computations at the start of the evaluation function that
  are needed for sampling, evaluation and albedo computation, but only depend on
  the view direction. Therefore, just precompute them - we still have space in
  PrincipledHairExtra after all.
- Fix a tiny bug - the direction sampling code did not account for the R lobe
  roughness modifier.

Pull Request #104669
2023-02-17 12:32:13 +13:00
9019b2f025 Curves: Draw point overlay only in point selection mode
In case the selection domain is `ATTR_DOMAIN_CURVE` then do not draw the points.

Pull Request #104715
2023-02-17 12:32:13 +13:00
da4908248b Cleanup: Move draw_attributes.hh to C++
In order to experiment with different storage types for `DRW_Attributes`
and for general cleanup (see #103343). Also move a curves header to C++.

Pull Request #104716
2023-02-17 12:32:13 +13:00
5297f851e9 Fix: Incorrect BMesh to Mesh attribute copying
The existing logic to copy `BMesh` custom data layers to `Mesh`
attribute arrays was quite complicated, and incorrect in some cases
when the source and destinations didn't have the same layers.
The functions leave a lot to be desired in general, since they have
a lot of redundant complexity that ends up doing the same thing for
every element.

The problem in #104154 was that the "rest_position" attribute overwrote
the mesh positions since it has the same type and the positions weren't
copied. This same problem has shown up in boolean attribute conversion
in the past. Other changes fixed some specific cases but I think a
larger change is the only proper solution.

This patch adds preprocessing before looping over all elements to
find the basic information for copying the relevant layers, taking
layer names into account. The preprocessing makes the hot loops
simpler.

In a simple file with a 1 million vertex grid, I observed a 6%
improvement animation playback framerate in edit mode with a simple
geometry nodes modifier, from 5 to 5.3 FPS.

Fixes #104154, #104348

Pull Request #104421
2023-02-17 12:32:13 +13:00
460d17a443 Fix #104588: Initialize Face Sets from edit mode selection broken
Mistake in da4bd24c3e
2023-02-17 12:32:13 +13:00
bce40f8f5f BMesh: Add flexibility for future lazily created UV selection
Don't crash on nonexisting uv selection layers. Add an assert
because for now it is a bug if they don't exist. But when converting
back to Mesh it is preferable to accept in release mode, as opposed to
crashing.

Pull Request #104600
2023-02-17 12:32:13 +13:00
301220dab0 Fix #104501: Clear CD_FLAG_NOCOPY after use
When generating a Mesh from a BMesh the uv map bool layers are not
copied if all elements are false. To suppress the copying the flag
CD_FLAG_NOCOPY is set in the layer flags. However these layers *do*
need to be copied to other BMeshes (for example undo steps). So we
need to clear them afterwards.
2023-02-17 12:32:13 +13:00
060efd3b12 USD Import: USD Shapes support
This commit adds the ability to import USD Shape primitives (Gprims).
They are imported as Blender Meshes using the USD API to convert, so
that they appear the same as they would in other applications. USD
Shapes are important in many workflows, particularly in gaming, where
they are used for stand-in geometry or for collision primitives.

Pull Request #104707
2023-02-17 12:32:13 +13:00
e8c827c6a7 Curves: Fix curve segment selection
Make sure that in curve selection mode, the segments are checked
for intersection instead of only the points.

Pull Request #104703
2023-02-17 12:32:13 +13:00
75be65fd00 Fix #104373: Motion Tracker solve with anamorphic footage not working
The issue was caused by rather recent refactor in 7dea18b3aa.

The root of the issue lies within the fact that the optical center was updated
on the Blender side after the solution was run. There was a mistake in the code
which double-corrected for the pixel aspect ratio.

Added a comment in the code about this, so that it does not look suspicious.

Pull Request #104711
2023-02-17 12:32:13 +13:00
d84cccef61 Cleanup: Remove redundant translation markers in context poll message
`CTX_wm_operator_poll_msg_set()` is covered by the translation script
and always translates these strings. Checked with Bastien, he prefers
not having the redundancy here.
2023-02-17 12:32:13 +13:00
b18bf4ef27 Fix bug report including rB commit hash prefix not needed for Gitea 2023-02-17 12:32:13 +13:00
906a0bd4db Cleanup: fix a few typos in UI messages
Issues reported by @Joan-Pujolar in #43295.

Pull Request #104672
2023-02-17 12:32:13 +13:00
5c3179ea84 Fix #103397: Vector UI control shader UBO alignment fix.
Replace float3 with packed_float3 when using additional type padding.

Authored by Apple: Michael Parkin-White

Ref #96261
Pull Request #104699
2023-02-17 12:32:13 +13:00
22f8f944fe Cleanup: Add in NLAStrip / NLATrack remove / clean methods
## Cleanup: Refactor NLATrack / NLAStrip Remove

This PR adds 3 new methods:
* BKE_nlatrack_remove_strip
* BKE_nlastrip_remove
* BKE_nlastrip_remove_and_free

These named BKE methods are really just replacements for BLI_remlink, but with some added checks, and enhanced readability.

Co-authored-by: Nate Rupsis <nrupsis@gmail.com>
Pull Request #104437
2023-02-17 12:32:13 +13:00
5d3ed646f8 Cleanup: add comment explaining #interpf is performing lerp 2023-02-17 12:32:13 +13:00
4abbdba2fa GPencil: Fix unreported Eyedropper color difference in Materials
The color selected was converted wrongly for materials. The undo of the conversion must be done only for palettes.

Also, some code cleanup done.
2023-02-17 12:32:13 +13:00
9653ea3f27 Fix: No update setting curve selection domain with all selected
Send a notification and tag for an update even if the selection doesn't
exist, which is still necessary for drawing that depends on the
selection domain.
2023-02-17 12:32:13 +13:00
e71650920a Cleanup: add comment to cage gizmo scaling regarding the boundary 2023-02-17 12:32:13 +13:00
6e52a74202 Cycles: Replace resolution divider loop with an analytical formula
As a side effect of this change, more resolution divisions are now available.
Before this patch the possible resolution divisions were all powers of two.
Now the possible resolution divisions are the multiples of pixel_size.

This increase in possible resolution divisions is the same idea proposed in https://archive.blender.org/developer/D13590.
In that patch there were concerns that this will increase the time between a user navigating
and seeing the 1:1 render. To my knowledge this is a non-issue and there should be
little to no increase in time between those two events.

Pull Request #104450
2023-02-17 12:32:13 +13:00
93cdbee7d3 Assets: Store pointer to owning asset library in asset representation
This is needed to be able to query asset library information from an
asset. This again is relevant especially for the "All" asset library,
where you can't just directly access the library itself, which is
different for different assets.

The current design is that an asset representation is owned by exactly
one asset library, so having this pointer is perfectly compatible with
the design.

Reviewed by: Julian Eisel
2023-02-17 12:32:13 +13:00
080352d85b Tests: add unit test for BLI_strnlen
It wasn't there. Now it is.
2023-02-17 12:32:13 +13:00
cbfa019d37 Cleanup: EEVEE-Next: Fix typo 2023-02-17 12:32:13 +13:00
6590357e8c GPUShader: Fix compilation caused by designated initializers in C++ 2023-02-17 12:32:13 +13:00
037a340c46 Cycles: Fix compilation after recent GPU cleanups 2023-02-17 12:32:13 +13:00
914c3af5c8 Cleanup: GPUShader: Rename GPU_shader_uniform_vector
Rename to `GPU_shader_uniform_float/int_ex` to make more sense as a
general purpose function.
2023-02-17 12:32:13 +13:00
0f23bb8437 Cleanup: GPUShader: Remove GPU_shader_uniform_int/float
Simplify the API, leaving only one function to set uniform without the
uniform name.
2023-02-17 12:32:13 +13:00
dcc4105611 GPU: Removes GPU_shader_get_builtin_ssbo
Simplify the API. Use hardcoded ssbo location instead.
2023-02-17 12:32:13 +13:00
997d2561bc Cleanup: GPU: Rename some functions for consistency 2023-02-17 12:32:13 +13:00
db9e351271 Cleanup: GPU: Move eGPUKeyframeShapes to shader shared
Removes code duplication.
2023-02-17 12:32:13 +13:00
15dbc0c8ff Cleanup: GPUShader: Reorganize GPU_shader.h to separate depecated API
This avoid confusion to what to use nowadays.
Also improves documentation.
2023-02-17 12:32:13 +13:00
167b45fd2f Cleanup: GPUShader: Split Builtins to their own header
Also improve documentation and cleanup.
2023-02-17 12:32:13 +13:00
0c64889070 GPU: Remove GPU_SHADER_3D_POINT_FIXED_SIZE_VARYING_COLOR
This replaces `GPU_SHADER_3D_POINT_FIXED_SIZE_VARYING_COLOR` by
GPU_SHADER_2D_POINT_UNIFORM_SIZE_UNIFORM_COLOR_OUTLINE_AA`.

None of the usage made sense to not use the AA shader.
Scale the point size to account for the rounded shape.
2023-02-17 12:32:13 +13:00
bdf33706a6 GPU: Move gpu_shader_builtin.c to C++
This also removes all unused part of it now that we have converted all
shaders to use create infos.
2023-02-17 12:32:13 +13:00
ea9bf0d028 Gizmo: add gizmos for spot and point light radius
Ref #104280

Pull Request #104410
2023-02-17 12:32:13 +13:00
19515022d8 Gizmo: make cage gizmo follow the cursor exactly when scaling
Ref #104280
The scaling of area light / spot light blend was wrong because it is
calculated for pivot at the edges. The new implementation in theory
works for all `abs(pivot) <= 0.5f`, although we only have -0.5, 0, and
0.5.
- Axis constraint for box cage was only applied when there is translate
flag, now the same logic is applied regardless of the translate flag,
this means when dragging the edge, the scaling in the other axis stays
the same; when dragging the corners, it applies free-form scaling.
- Due to the existence of margin, `data->orig_mouse` does not lie
exactly on the boundary. Using that value to compute the scaling causes
the error to accumulate over distance. The new implementation uses the
original dimension of the object instead, and only uses
`data->orig_mouse` to determine the side of the original cursor relative
to the pivot.
- For circular gizmo with unsigned scaling, the gizmo only follow the
cursor exactly when the cursor stays in the original quadrant, otherwise
it's hard to handle the logic when we should clamp the scaling.
2023-02-17 12:32:12 +13:00
6c4908e82c Fix #80307: Underline shortcut not working in enum context menus
The buttons of enum context menus are of type `UI_BUT_ROW`. They
are part of the set of buttons we create underline shortcuts for in
`ui_menu_block_set_keyaccels`.
But since they weren't handled in `ui_handle_button_activate_by_type`,
pressing the underline shortcuts didn't do anyting in those cases.

Co-authored-by: Leon Schittek <leon.schittek@gmx.net>
Co-authored-by: Brecht Van Lommel <brecht@noreply.localhost>
Pull Request #104433
2023-02-17 12:32:12 +13:00
b24661ff3e UI: add camera passepartout color to theme
Currently the passepartout color is hardcoded to black. While a
sensible default for cinema, it may make less sense for other media,
whether video, print, web, etc. It greatly affects viewing conditions
of the image and should be user selectable, much like painting
programs allow.

Pull Request #104486
2023-02-17 12:32:12 +13:00
768db16409 Fix #104341: Handle edge case in Curve to Mesh node
Don't create caps when using cyclic profile splines with two or fewer
points.
This case wasn't handled, yet, leading to invalid meshes or crashes.

Co-authored-by: Leon Schittek <leon.schittek@gmx.net>
Pull Request #104594
2023-02-17 12:32:12 +13:00
25c641a8f6 Vulkan: Use guardedalloc for driver allocations.
Vulkan has a pluggable memory allocation feature, which allows internal
driver allocations to be done by the client application provided
allocator. Vulkan uses this for more client application allocations
done inside the driver, but can also do it for more internal oriented
allocations.

VK_ALLOCATION_CALLBACKS initializes allocation callbacks for host allocations.
The macro creates a local static variable with the name vk_allocation_callbacks
that can be passed to vulkan API functions that expect
const VkAllocationCallbacks *pAllocator.

When WITH_VULKAN_GUARDEDALLOC=Off the memory allocation implemented
in the vulkan device driver is used for both internal and application
oriented memory operations.

For now this would help during the development of Vulkan backend to
detect hidden memory leaks that are hidden inside the driver part
of the stack. In a later stage we need to measure the overhead and
if this should become the default behavior.

Pull Request #104434
2023-02-17 12:32:12 +13:00
1caa70dad9 GPU: Use same read back API as SSBOs
The GPU module has 2 different styles when reading back data from
GPU buffers. The SSBOs used a memcpy to copy the data to a
pre-allocated buffer. IndexBuf/VertBuf gave back a driver/platform
controlled pointer to the memory.

Readback is done for test cases returning mapped pointers is not safe.
For this reason we settled on using the same approach as the SSBO.
Copy the data to a caller pre-allocated buffer.

Reason why this API is currently changed is that the Vulkan API is more
strict on mapping/unmapping buffers that can lead to potential issues
down the road.

Pull Request #104571
2023-02-17 12:32:12 +13:00
0ffbe49978 Cleanup: Quiet unused variable warning
Also name another argument for consistency.
2023-02-17 12:32:12 +13:00
737cb51f52 Fix: Missing const specifier for curve field input
Mistake in 000e722c7d, which probably made the viewer node
auto-domain detection behave differently when the special case was used.
2023-02-17 12:32:12 +13:00
45fb9ee832 Fix: Workbench Next: Extruded frustum binding 2023-02-17 12:32:12 +13:00
6c391ffbe3 Fix #104637: EEVEE Displacement regression after #104595
Keep using the 3 evaluations dF_branch method for the Displacement output.
The optimized 2 evaluations method used by node_bump is now on its own macro (dF_branch_incomplete).
displacement_bump modifies the normal that nodetree_exec uses, so even with a refactor it wouldn’t be possible to re-use the computation anyway.
2023-02-17 12:32:12 +13:00
1888a5daa1 BLI: use larger integer type in BitVector
Using larger integer types allows for more efficient code, because we
can use the hardware better. Instead of working on individual bytes,
the code can now work on 8 bytes at a time. We don't really benefit
from this immediately but I'm planning to implement some more optimized
bit vector operations for #104629.

Pull Request #104658
2023-02-17 12:32:12 +13:00
94b7741288 Cleanup: use sized int types for polyfill_2d
Also correct building when USE_CLIP_EVEN is disabled.
2023-02-17 12:32:12 +13:00
3605c4bdfe Tests: add polyfill2d test to ensure the result has no zero area tris
Add a test to address the issue raised in #103913, where zero area
triangles could be created from polygons that have co-linear edges
but were not degenerate.
2023-02-17 12:32:12 +13:00
cf0de1ced6 Cleanup: use '#' prefix for issues instead of 'T'
Match the convention from Gitea instead of Phabricator's T for tasks.
2023-02-17 12:32:12 +13:00
a2a470d2df Cleanup: spelling in comments 2023-02-17 12:32:12 +13:00
90f1b12b50 Fix crash selecting faces in wire-frame mode
Regression in [0] didn't account for the mesh not having
subdivision surface is applied.

[0]: 75db4c082b
2023-02-17 12:32:12 +13:00
13e926719a Cleanup: EEVEE-Next: Add LIGHT_FOREACH macros to clang-format exceptions 2023-02-17 12:32:12 +13:00
affe15b20c Cleanup: GPU: Remove commented lines without any comments or purpose
These were added during a big refactor. They were supposed to be
uncommented at some point but the new code does not even need a default
world.
2023-02-17 12:32:12 +13:00
55d3de4faf Cleanup: remove whole-archive linking for USD
Since USD is no longer statically linked these linker tricks
are no longer needed.

Co-authored-by: Ray Molenkamp <github@lazydodo.com>
Pull Request #104627
2023-02-17 12:32:12 +13:00
f815ae44ab Fix curves selection toggling 2023-02-17 12:32:12 +13:00
23964e6ed4 Transform: Hide trackball gizmo while dragging
It was accidentally displayed in a38d99e0b2.
2023-02-17 12:32:12 +13:00
19b1957f8f Fix circular transform gizmo always displaying Global orientation
The Global orientation comes from the mode's default orientation
(without the constraints).

It's not really exposed.
2023-02-17 12:32:12 +13:00
528f9c467d Fix #104587: 'Extrude To Cursor' snapping ignoring 'Target Selection'
Although not a transform operator, `Extrude to Cursor` depends on some
snapping settings.

So it should use the `Target Selection` options as well.
2023-02-17 12:32:11 +13:00
dac8e1c7db Fix transform gizmos not changing in Automatic Constraint mode 2023-02-17 12:32:11 +13:00
59e1b3a8b5 Nodes: change order of Hide Value and Hide in Modifier
Based on the review comment in #104517.
2023-02-17 12:32:11 +13:00
e60a54ac2d Geometry Nodes: Add option to hide input in modifier
When building a node group that's meant to be used directly in the
node editor as well as in the modifier, it's useful to be able to have
some inputs that are only meant for the node editor, like inputs that
only make sense when combined with other nodes.

In the future we might have the ability to only display certain assets
in the modifier and the node editor, but until then this simple solution
allows a bit more customization.

Pull Request #104517
2023-02-17 12:32:11 +13:00
18f69d3b32 Cleanup: Remove const keyword in declarations 2023-02-17 12:32:11 +13:00
5f8f8135b0 Curves: initial surface collision for curves sculpt mode
During hair grooming in curves sculpt mode, it is very useful when hair strands
are prevented from intersecting with the surface mesh. Unfortunately, it also
decreases performance significantly so we don't want it to be turned on all the time.

The surface collision is used by the Comb, Pinch and Puff brushes currently.
It can be turned on or off on a per-geometry basis.

The intersection prevention quality of this patch is not perfect yet. This can
be improved over time using a better solver. Overall, perfect collision detection
at the cost of bad performance is not necessary for interactive sculpting,
because the user can fix small mistakes very quickly. Nevertheless, the quality
can probably still be improved significantly without too big slow-downs depending
on the use case. This can be done separately from this patch.

Pull Request #104469
2023-02-17 12:32:11 +13:00
31f03b9607 Geometry Nodes: use smooth normals in Distribute Points on Faces node
Previously, the node used the "true" normal of every looptri. Now it uses the
"loop normals" which includes e.g. smooth faces and custom normals. The true
normal can still be used on the points by capturing it before the Distribute node.

We do intend to expose the smooth normals separately in geometry nodes as well,
but this is an important first step.

It's also necessary to generate child hair between guide hair strands that don't
have visible artifacts at face boundaries.

For perfect backward compatibility, the node still has a "Legacy Normal" option
in the side bar. Creating the exact same behavior with existing nodes isn't
really possible unfortunately because of the specifics of how the Distribute
node used to compute the normals using looptris.

Pull Request #104414
2023-02-17 12:32:11 +13:00
7957c1a22b Fix #104374: Simplify UV Face Selection and UV Island Selection
Like in the 3D viewport, UV Face Selection was previously based on
distance to the face center.

Instead, measure distance to nearest edge instead, which is more
consistent with a 2D viewport.
2023-02-11 20:11:55 +13:00