1
1
Commit Graph

123537 Commits

Author SHA1 Message Date
c2309356c6 Merge branch 'main' into asset-shelf 2023-04-21 11:02:31 +02:00
99f5e60b86 RNA: ignore some large arrays in override code
This speeds up saving `070_0100.anim.blend` from the Heist project
from ~3s to ~300ms by adding PROPOVERRIDE_IGNORE in a few
places. It's not completely obvious to me when `PROPOVERRIDE_IGNORE`
should be used and when it shouldn't. Given that the same is done for
meshes already, it seems correct.

Pull Request: blender/blender#107196
2023-04-21 10:15:51 +02:00
680a54c7d0 EEVEE Next: Ensure correct texture usage for views
Add texture usage flags for textures which are used as texture views
or require texture views for backing implementation.

Authored by Apple: Michael Parkin-White

Pull Request: blender/blender#107163
2023-04-21 10:06:55 +02:00
25138fd6e0 EEVEE Next: GLSL Metal shader type compatibility
Apply compilation fixes for Metal compatibility.
This includes explicit type casts, packed data types
where vec3 alignment is inconsistent, constructor replacement
with factory function.

The Metal shader generator also needs knowledge of when bound
resources are fundamental data types, so
SHADOWS_TILE_DATA_PACKED must be described as uint in
ShaderCreateInfo.

Authored by Apple: Michael Parkin-White

Pull Request: blender/blender#107178
2023-04-21 09:55:37 +02:00
4134682ec2 Fix #107156: UV Cylinder/Sphere Projection fails after other operators
Caused by 6b8cdd5979.

Above commit introduced element tagging for boundary calculations but
only cleared them properly on all faces if the new `Preserve Seams`
option was chosen. We cannot be sure about the state of element tags
from prior operators though, so correct the culprit check to also only
be in effect if the new `Preserve Seams` option was chosen.

Pull Request: blender/blender#107161
2023-04-21 08:28:03 +02:00
c18351f670 Metal: Increase concurrent shader compilation threads
Leverage new API call in Metal to increase the number of threads
dedicated to concurrent shader compilation. First step to improve
parallel compilation times when multiple engines are active.

Would also enable an increase in worker threads for shader
compilation jobs within the DRWManager.

Note that this is only available in the latest
version of macOS Ventura (13.3).

Authored by Apple: Michael Parkin-White

Pull Request: blender/blender#106625
2023-04-21 07:52:17 +02:00
fdf920bf5d Metal: Add textureGrad support
Fixes compilation errors in viewport compositor.

Authored by Apple: Michael Parkin-White

Pull Request: blender/blender#106805
2023-04-21 07:45:30 +02:00
19dbe049db Fix #106469: unstable tessellation with quad-flipping detection
The result of detecting if a quad should flip the default 0-2 split
when tessellated only used a pre-calculated normal when available,
since the method of detecting the flip was different, the check for a
concave face could change depending on the existence of polygon-normals.

In practice this meant cycles render preview could use a different
tessellation than the GPU display.

While [0] exposed the bug, it's an inherent problem with having 2
methods of detecting concave quads.

Remove is_quad_flip_v3_first_third_fast_with_normal(..) and always
use is_quad_flip_v3_first_third_fast(..), because having to calculate
the normal inline has significant overhead.

Note that "bow-tie" quads may now render with a subdivision in a
different direction although they must be very distorted with both
triangles along the 0-2 split pointing away from each other.

Thanks to @HooglyBoogly for investigating the issue.

[0]: 16fbadde36.
2023-04-21 15:02:47 +10:00
5721b34e53 Cleanup: add win32 suffix to BLI_path_is_abs
Naming made it seem this might be the opposite of BLI_path_is_rel,
when it checks for WIN32 specific path prefixes.
2023-04-21 09:46:06 +10:00
417b62522d Cleanup: code-comments in path_util.c
- Remove duplicate doc-string.
- Use full sentences.
- Use back-ticks for path literals
  (to avoid confusion with doxy-slash commands).
2023-04-21 09:34:30 +10:00
fc749d9d25 Cleanup: replace binary '&' with '&&' check
As the intention is to check both statements are true, avoid bitwise
operations on boolean results.
2023-04-21 09:13:09 +10:00
54ce0ac922 Cleanup: use const variables when reading X11 events 2023-04-21 09:12:31 +10:00
62806012ed Cleanup: resolve uninitialized members in GHOST Window & SystemX11
While this didn't cause bugs, initialize members to avoid problems
in the future.

GHOST::SystemX11
- m_keyboard_vector
- m_keycode_last_repeat_key

GHOST::Window
- m_cursorGrabInitPos
- m_userData
2023-04-21 09:06:25 +10:00
ae24fe56a3 Cleanup: quiet shadowed variable warning 2023-04-21 08:42:10 +10:00
04faf12bd8 Cleanup: use BLI_listbase_is_single to avoid unnecessary counting 2023-04-21 08:35:09 +10:00
8e69b41bdf Cleanup: use const for implicit sharing info
Generally, one does not know if the sharing info is currently shared
and should therefore be const. Better keep it const almost all the
time and only remove the constness when absolutely necessary
and the code has checked that it is valid.
2023-04-20 23:32:33 +02:00
491f098edf Cleanup: Fix custom data memcpy call null argument
The data was only null if the size was also zero, but it's simple
to avoid the ASAN warning anyway.
2023-04-20 17:31:29 -04:00
f6ec11741c Fix #106208: data-block socket defaults not used for node group
The main challenge is to avoid dangling pointers. Currently, the lifetime of socket
declarations is somewhat unbounded (at least we didn't restrict it explicitly yet).
Therefore, storing non-owning pointers in it tricky. For ID pointers one could
potentially use the foreach-id iterator to update pointers in declarations as well,
but that's a bit out of scope and might not be the right solution anyway, since it's
not obvious that all node declarations are reachable from IDs stored in `bmain`.

The solution now is to use a callback that retrieves the right ID pointer when it
is used. The important thing is that the callback does not capture any potentially
dangling pointer either.

Pull Request: blender/blender#107179
2023-04-20 22:27:45 +02:00
4babb7c02e Cycles: oneAPI: Fix volume intersection for Embree GPU execution 2023-04-20 21:20:33 +02:00
0d9fa73b42 Cycles: oneAPI: Fix motion blur rendering for Embree GPU execution
CPU non-unified shared memory was used for shared geometry buffers.
For the Embree GPU case, we now create new geometry buffers on GPU instead.
2023-04-20 21:20:33 +02:00
7e92fb92ec Cycles: oneAPI: Fix kernels preloading in case of incompatible AoT binaries
When running oneAPI with AoT binaries, on hardware that's not compatible with
these, recompilation could have been missing from the kernels loading phase and
happen during execution instead.

These changes fixes it, any kernel compilation will now happen during the
kernels loading phase.
2023-04-20 21:20:33 +02:00
13d30b0481 Cleanup: fix various warnings on Windows
Ensure windows.h is included before some other headers to avoid
redefining macros.

Pull Request: blender/blender#107189
2023-04-20 20:46:13 +02:00
c732d901a7 Fix : Iteration for BMLayerCollection was broken
It was broken in two ways:
- bpy_bmlayercollection_iter passed PY_SSIZE_T_MIN, while
PY_SSIZE_T_MAX was needed.
- bpy_bmlayercollection_subscript_slice() contained an
off-by-one error.

Pull Request: blender/blender#107165
2023-04-20 20:28:25 +02:00
f04a7a07e3 macOS: Add open files to system recent files
Completes the TODO in GHOST_SystemPathsCocoa::addToSystemRecentFiles
Also renames the filename parameter to the more appropriate filepath.

The recently opened/saved file will now also show up in:
- Blender Dock icon > Right click.
- Three finger swipe down in Open Blender i.e., App Expose

Based on a earlier contribution by @jenkm.

Pull Request: blender/blender#107174
2023-04-20 23:53:08 +05:30
82ca3d3604 Fix #107185: Edit mode or existing attribute break rest position
After e45ed69349 we need to remove the existing attribute
when adding the rest position before evaluating modifiers. Also, adding
the rest position attribute was completely skipped in edit mode.

Pull Request: blender/blender#107190
2023-04-20 20:18:02 +02:00
2f4a8ecf18 Fix: Spreadsheet missing other geometry types for edit mode mesh objects
We need to add to the spreadsheet's display geometry set
rather than completely replacing it with just the mesh.
2023-04-20 13:06:01 -04:00
b2c822065c Fix #106977: Crash when OpenEXR IO fails
The crash can occur in the following situations:

- Attempt to open a corrupted EXR file
- Attempt to save an EXR file under a non-existing directory.

The root cause is not really clear: for some reason the OpenEXE API on
the Blender side can not catch OpenEXE exceptions by a constant
reference to a std::exception, although it can by a constant reference
to an Iex::BaseExc.

This does not seem to be an issue with the OpenEXR library itself as
the idiff tool from our SVN folder catches the exceptions correctly.
It is also not caused by the symbols_apple.map as erasing it does not
make the problem go away.

It could still be some compiler/visibility flag which we were unable
to nail down yet.

The proposed solution is to add catch-all cases, mimicking the OIIO
tools. This solves the problem with the downside is that there are
no friendly error messages in the terminal. Those messages could be
brought as part of the workaround by additionally catching the
Iex::BaseExc exception. But probably nobody relies on those error
prints anyway, so added complexity in the code is likely does not
worth it.

Pull Request: blender/blender#107184
2023-04-20 18:40:07 +02:00
5c4b0c98d3 Animation: Add in Parent space alignment option to the Transform Orientation gizmo
Animation: Adds a new "Parent Space" Orientation option for the Transformation Gizmo.

---
For child targets (objects, bones, etc) being able to transform in parent space is a desired feature (especially when it comes to rigging / animation).

For objects:
* with a parent, the gizmo orients to it's parents orientation
* without a parent, the gizmo orients to Global space

For Armatures:
* Child bone shows parent's space regardless if "Local Location" is set for parent bone
* For root bone **without** "Local Location" set, use the armature objects space.
* For root bone **with** "Local Location" set, use local bone space.

---

No new transformation orientation code needs to be written, we can achieve the desired results be using the existing `transform_orientations_create_from_axis`, `ED_getTransformOrientationMatrix`, and `unit_m3` methods. To do this, we check to see if the bone has a parent, if so, we use the bones pose matrix (`pose_mat`). This is done similarly for objects using the parent's object matrix (`object_to_world`).

Pull Request: blender/blender#104724
2023-04-20 17:40:19 +02:00
0e23aef6b6 Fix build error when not using unity build 2023-04-20 15:46:15 +02:00
475f9a3e23 Cycles: Break up geometry.cpp and scene.cpp file into smaller pieces
Scene.cpp  and Geometry.cpp are large file it can be broken up into smaller easier to handle files. This change has been broken out from #105403 to make understanding the changes easier.

geometry.cpp is broken up into:
1. geometry.cpp
2. geometry_attributes.cpp
3. geometry_bvh.cpp
4. geometry_mesh.cpp

scene.h & scene.cpp is broken into:
1. scene.h
2. scene.cpp
3. devicescene.h
4. devicescene.cpp

Pull Request: blender/blender#107079
2023-04-20 12:26:02 +02:00
e6387349d6 Merge branch 'main' into asset-shelf 2023-04-20 11:39:28 +02:00
100f37af49 Fix #100053: Incorrect saving asset catalogs after renaming parent item
When a parent item was renamed, the `TreeView` was doing everything as
expected, however `AssetCatalogService::update_catalog_path` is supposed
to also update the catalog paths of all sub-catalogs [which it does --
but it does not tag sub-catalogs as having unsaved changes, resulting in
wrong saving of catalogs afterwards, meaning the parent item was saved
with the old name and a new item with the new name was created].

Now also tag sub-catalogs for having unsaved changes.

This should also go into 3.3 LTS

Pull Request: blender/blender#107121
2023-04-20 11:21:27 +02:00
7ce10ebbbf Cycles: oneAPI: Remove excess quotes in a capabilities output 2023-04-20 11:09:16 +02:00
770b193253 Cleanup: use function style casts & nullptr, spelling in comments 2023-04-20 18:28:50 +10:00
0fa68d1a01 Cleanup: format 2023-04-20 18:28:50 +10:00
6d35e1c238 Fix missing include causing build error & invalid NULL check 2023-04-20 18:28:50 +10:00
fe7815e117 Fix #106771: Selection offset in timeline when NLA track is offset
The selection (box select, click select...) had an offset when selecting keys in the timeline.
That was because the function to get the NLA mapping ignored the timeline.

Pull Request: blender/blender#106904
2023-04-20 10:26:26 +02:00
60ced5283a Animation: make properties from motion path library overrideable
The following properties were not library overrideable, but now are
* Line Thickness
* Color
* Custom Color Checkbox

Pull Request: blender/blender#106959
2023-04-20 10:08:39 +02:00
4054d76749 Fix: Normalization with baked curves and preview range
Currently when a baked curve is in the Graph Editor and normalization is enabled, it doesn't work.
It even throws a warning.

This patch adds the missing logic to normalize baked FCurves within a preview range.

Pull Request: blender/blender#106890
2023-04-20 10:07:49 +02:00
88b125e75d Fix regression tests failure on the latest Xcode
When using Xcode version 14.3 on Apple Silicon hardware a number of
regression tests fails. This change fixes this problem.

The root cause comes to the floating point contraction. It was already
disabled for GCC on Linux, but not for Clang on neither of Linux or
macOS.

Also corrected the comment about Clang default, as it as set to on
somewhere in 2021.

Pull Request: blender/blender#107136
2023-04-20 08:56:55 +02:00
b69f8de5b5 Fix #105450: Resolve box selection issue in Metal
Occlusion query buffers not being cleared to zero resulted in
erroneoues selection in certain situations.

Authored by Apple: Michael Parkin-White

Pull Request: blender/blender#107135
2023-04-20 08:47:56 +02:00
dda4c0721c EEVEE-Next: Resolve compilation errors in Metal
Shader source requires explicit conversions and shader address
space qualifers in certain places in order to compile for Metal.

We also require constructors for a number of default struct types.

Authored by Apple: Michael Parkin-White

Pull Request: blender/blender#106219
2023-04-20 08:03:31 +02:00
397a14deff GPencil: Several Weight Paint additions
This patch adds several tools and options to the weight paint mode of Grease Pencil.

* Blur tool: smooths out vertex weights, by calculating a gaussian blur of adjacent vertices.
* Average tool: painting the average weight from all weights under the brush.
* Smear tool: smudges weights by grabbing the weights under the brush and 'dragging' them.

* With the + and - icons in the toolbar, the user can easily switch between adding and subtracting weight while drawing weights.
* With shortcut `D` you can toggle between these two.

* The auto-normalize options ensures that all bone-deforming vertex groups add up to 1.0 while weight painting.
* With `Ctrl-F` a radial control for weight is invoked (in addition to the radial controls for brush size and strength).
* With `Ctrl-RMB` the user can sample the weight. This sets the brush Weight from the weight under the cursor.

* When painting weights in vertex groups for bones, the user can quickly switch to another vertex group by clicking on a bone with `Ctrl-LMB`.
For this to work, follow these steps:
* Select the armature and switch to Pose Mode.
* Select your Grease Pencil object and switch immediately to Weight Paint Mode.
* Select a bone in the armature with `Ctrl-LMB`. The corresponding vertex group is automatically activated.

Pull Request: blender/blender#106663
2023-04-20 07:55:24 +02:00
3d6117994c Realtime Compositor: Implement ID Mask node
This patch implements the ID Mask node for the realtime compositor.

The node can be implemented as a GPU shader operation when the
anti-aliasing option is disabled, which is something we should do when
the evaluator allows nodes be executed as both standard and GPU shader
operations.

Pull Request: blender/blender#106593
2023-04-20 07:20:58 +02:00
335d32153e Cleanup: remove dead code, reduce variable scope 2023-04-20 13:57:31 +10:00
62cc09f267 Cleanup: match argument names between functions & declarations 2023-04-20 13:52:58 +10:00
92f79e002e Cleanup: format 2023-04-20 13:35:35 +10:00
3f0d2cf9e1 Add scripts dir to the make format paths for Python
`make format` uses autopep8 to format Python, using a list of paths
specified in `tools/utils_maintenance/autopep8_format_paths.py`. The
scripts folder used to be a submodule inside release, but it is now at
the root of the blender repo.

This commit adds `scripts` to the list of paths to format.

Ref !107143
2023-04-20 05:30:34 +02:00
716b9cff23 Fix: Search in node editors missing items
Mistake in d6abd2ce72.
2023-04-19 23:19:45 -04:00
5ca7e1301f Cleanup: Remove redundant custom data initialization
The comment didn't really make sense, since the removed code did the
same thing as the CustomData function anyway, and that's already done
in `mesh_init_data`.
2023-04-19 22:45:48 -04:00