1
1

Compare commits

...

2305 Commits

Author SHA1 Message Date
RedMser
426c0865d3 Animation: Fix operator properties for redo panel
Animation: Fix operator properties for redo panel

After the redo panel is added to animation editors in D14960, many operators
must be adjusted to appear and function correctly.

A full list of changes is tracked in T98195

---

This patch only includes actual usability fixes. It does not do any changes for the user's convenience, like adding other helpful properties to operators. This can be done in a follow-up patch.

Reviewed By: sybren

Maniphest Tasks: T98195

Differential Revision: https://developer.blender.org/D14977
2022-08-01 12:21:05 +02:00
RedMser
87cc77d375 Animation: Add redo panel to Dopesheet and NLA
Animation: Add redo panel to Dopesheet and NLA

---

Also implicitly adds it for the timeline editor, since it's a kind of action editor internally.

This feature is needed for changing advanced properties of animation operators, such as select grouped (see D14811).
But it can also be useful for existing operators, like precise keyframe position tweaking.

Changes are basically the same as in D6286 (which added the redo panel for Graph Editor).

Some operators have internal properties that should be hidden. A full list can be found in T98195. These will be fixed in a follow-up patch.

{F13079611} {F13079612}

Reviewed By: sybren

Differential Revision: https://developer.blender.org/D14960
2022-08-01 12:20:40 +02:00
Jeroen Bakker
3393b7137e RenderReport: Add option to add platform specific overrides.
Reference images in the reference_override_dir will be chosen before
images in reference_dir. This allows platform specific reference
images, with a common base.

Ignored when set to None. The caller is responsible
of setting the reference override dir as the unit test is more aware
what the definition of a platform is.

Patch adds `gpu.platform.device_type_get` function to get the device
type that blender has detected.

Reviewed By: brecht

Maniphest Tasks: T99046

Differential Revision: https://developer.blender.org/D15265
2022-08-01 10:57:32 +02:00
6749a4a8f0 Cleanup: missing braces warning 2022-08-01 11:02:18 +10:00
ca172677b1 Cleanup: simplify uv parametrizer in preparation for C++
Replace `PChart` allocation with simpler calloc/free
2022-08-01 09:46:39 +12:00
17567c235a Cleanup: Remove mesh edge "tmp tag"
Ref T95966. Also fixes modification of input mesh,
which should be considered constant.
2022-07-31 11:56:44 -05:00
5b1ad3d7cf Merge branch 'blender-v3.3-release' 2022-07-31 18:32:26 +03:00
bea5281919 Fix T100075: OBJ import: images loaded multiple times instead of being reused
The new OBJ/MTL importer was creating a new image for any referenced
texture, even if another material (or another property of the same
material) already referenced the same texture. Make it use
BKE_image_load_exists function just like Collada or USD importers do.

Fixes T100075. Extended test coverage to count imported images;
without the fix import_cubes_with_textures_rel would have incorrectly
created 5 images instead of 4.
2022-07-31 18:10:48 +03:00
8c8c744f9d Merge branch 'blender-v3.3-release' 2022-07-31 13:19:35 +02:00
27e6962bed Fix T100086: GPencil Bezier curve edit not updated after smoothing
The stroke was recalculated, but the curve data was not updated.
2022-07-31 13:19:09 +02:00
a49b49d934 Cleanup: simplify uv parametrizer in preparation for C++
Replaces PCHART_HAS_PINS with `bool has_pins`.
2022-07-31 19:17:46 +12:00
3c5620aabd Cleanup: Move interface_region_tooltip.c and header to C++ 2022-07-30 16:40:41 -05:00
af6f0f1757 Fix failing blenlib test from previous commit
Commit 310be2e37c did not update UI_MENU_ARROW_SEP used in tests.
2022-07-30 09:27:32 -07:00
310be2e37c UI: UI_MENU_ARROW_SEP Unicode Character
Use a smaller arrow text character as menu item separator.

See D15578 for examples and details.

Differential Revision: https://developer.blender.org/D15578

Reviewed by Julian Eisel
2022-07-30 07:54:12 -07:00
a581460728 UV: Add options for uv select similar in island mode
In island selection mode, add new options for uv select similar:

* Area UV
* Area 3D
* Face (number of faces in island)

See also https://developer.blender.org/T47437
Differential Revision: https://developer.blender.org/D15553
2022-07-30 23:24:11 +12:00
d31886b3fe Cleanup: braces around statements in OBJ parser 2022-07-30 13:10:35 +03:00
1a0fab56b4 Merge remote-tracking branch 'origin/blender-v3.3-release' 2022-07-29 23:23:07 -07:00
8ae14bc1d7 Fix 100035: Make UDIM detection less aggressive
There's been a handful of reports where "obviously" not a UDIM filenames
were detected as such during image open.[1]

This change makes the detection less aggressive by enforcing that the
4-digit sequence be delineated on both sides by one of the following 3
characters ., -, _

This fixes the problem for such filenames as:
"screenshot-1080p.png", "Image-1920x1080.png", "(1999) Photo.png", and
"antiguaChestnut_X_1240Wx814H.png"

[1] T97366 T98918 T99154 T100035

Differential Revision: https://developer.blender.org/D15573
2022-07-29 23:17:41 -07:00
aa7734c9da Cleanup: Clang tidy 2022-07-29 23:23:50 -05:00
599a7ddf17 Cleanup: Move five interface files to C++
Builds on all four platforms on the buildbot. Includes clang tidy fixes.
2022-07-29 23:22:31 -05:00
e6b1e97dd7 Sculpt: fix broken triangle/vertex count for DynTopo 2022-07-29 19:12:40 -07:00
d7cfb6ac71 Sculpt: Opaque vertex type for sculpt
This is a port of sculpt-dev's `SculptVertRef` refactor
(note that `SculptVertRef was renamed to PBVHVertRef`)
to master. `PBVHVertRef` is a structure that abstracts
the concept of a vertex in the sculpt code; it's simply
an `intptr_t` wrapped in a struct.

For `PBVH_FACES` and `PBVH_GRIDS` this struct stores a
vertex index, but for `BMesh` it stores a direct pointer
to a BMVert.  The intptr_t is wrapped in a struct to prevent
the accidental usage of it as an index.

There are many reasons to do this:

* Right now `BMesh` verts are not logical sculpt verts;
  to use the sculpt API they must first be converted to indices.
  This requires a lot of indirect lookups into tables, leading to performance
  loss.  It has also led to greater code complexity and duplication.
* Having an abstract vertex type makes it feasible to have one unified
  temporary attribute API for all three PBVH modes, which in turn
  made it rather trivial to port sculpt brushes to DynTopo in
  sculpt-dev (e.g. the layer brush, draw sharp, the smooth brushes,
  the paint brushes, etc).  This attribute API will be in a future patch.
* We need to do this anyway for the eventual move to C++.

Differential Revision: https://developer.blender.org/D14272
Reviewed By: Brecht Van Lommel
Ref D14272
2022-07-29 19:03:51 -07:00
27a16abe81 Sculpt: fix name collision in DynTopo temp attributes
The attributes PBVH_BMESH uss to store the owning node
for vertices and faces were being created with the same
name, which is no long allowed.
2022-07-29 18:58:36 -07:00
9b9417b661 Cleanup: Replace reinterpret_cast<> with static_cast<> in UI code 2022-07-29 18:45:12 +02:00
03cd794119 Fix attempt for MSVC build error after 42ccbb7cd1 2022-07-29 18:10:26 +02:00
091156f64a Merge branch 'blender-v3.3-release' 2022-07-29 18:00:50 +02:00
Brecht Van Lommel
cfd16c04f8 Build: hide all symbols except a few required ones on Linux
Instead of specifying which symbols to hide, we hide all and make a few
visible. Some users may be relying on calling internal Blender functions,
but Windows is already hiding all of them and this is just not supported.

Fixes T99900: crash with some third-party Python libraries since OneAPI

Ref T76442

Differential Revision: https://developer.blender.org/D14971
2022-07-29 17:54:32 +02:00
42ccbb7cd1 Cleanup: Move RNA path functions into own C++ file
Adds `rna_path.cc` and `RNA_path.h`.

`rna_access.c` is a quite big file, which makes it rather hard and
inconvenient to navigate. RNA path functions form a nicely coherent unit
that can stand well on it's own, so it makes sense to split them off to
mitigate the problem. Moreover, I was looking into refactoring the quite
convoluted/overloaded `rna_path_parse()`, and found that some C++
features may help greatly with that. So having that code compile in C++
would be helpful to attempt that.

Differential Revision: https://developer.blender.org/D15540

Reviewed by: Brecht Van Lommel, Campbell Barton, Bastien Montagne
2022-07-29 16:56:48 +02:00
187d90f036 Merge branch 'blender-v3.3-release' 2022-07-29 15:33:25 +02:00
1665e40e16 install_deps: Add handling of libaom, update ffmpeg build for it.
Ref T98555.
2022-07-29 15:32:02 +02:00
d3879e9aaa Merge branch 'blender-v3.3-release' 2022-07-29 15:17:40 +02:00
065dfe744c install_deps: bump IMath/OpenEXR to 3.1.5.
Ref T98555.
2022-07-29 15:17:15 +02:00
3a138a74e5 install_deps: add building of Alembic binaries.
Those are used by alembic regression tests.
2022-07-29 15:17:15 +02:00
Tianhao Chai
b862cf0b9f Fix Cycles build error with CUDA on arm64
Checking arm64 assembly support before CUDA/Metal would cause NVCC to
generate inline arm64 assembly.

Differential Revision: https://developer.blender.org/D15569
2022-07-29 14:57:09 +02:00
a679164cf6 Merge branch 'blender-v3.3-release' 2022-07-29 12:25:31 +02:00
ae0b8e904c Fix (unreported) lib-linking of ID properties not taking library parameter.
While this was not a critical issue (that lib pointer is only used for
some kind of sanity check that no linked data uses local ID pointers),
better to keep `IDP_BlendReadLib` in sync with all other lib-linking
code.
2022-07-29 12:25:15 +02:00
b639e60864 Realtime Compositor: Add needed GPU module changes
This patch implements the necessary changes to the GPU module that are
needed by the realtime compositor.

A new function GPU_material_from_callbacks was added to construct a GPU
material from a number of callbacks. A callback to construct the
material graph by adding and linking the necessary GPU material nodes.
And the existing code generator callback. This essentially allows the
construction of GPU materials independent of node trees and without the
need to do any node tree localization.

A new composite source output to the code generator was added. This
output contains the serialization of nodes that are tagged with
GPU_NODE_TAG_COMPOSITOR, which are the nodes linked to the newly added
composite output links.

Two new GPU uniform setters were added for int2 and matrix3 types.

Shader create info now supports generated compute sources.

Shaders starting with gpu_shader_compositor are now considered part of
the shader library.

Additionally, two fixes were implemented. First, GPU setter node
de-duplication now appropriately increments the reference count of the
references resources. Second, unlinked sockets now get their value from
their associated GPU node stack instead of the socket itself.

Differential Revision: https://developer.blender.org/D14690

Reviewed By: Clement
2022-07-29 08:47:52 +02:00
c3ca487498 Render: Propagate view updates to draw engines
Currently, draw engines are not notified of view updates if a render
engine is active and was updated. It is unclear why this is the case
currently, but this behavior was part of the initial commit.

This patch propagates view updates regardless if the update was handled
by an active render engine. This is needed by the realtime compositor as
it implements logic for view updates, which currently does not execute
if Cycles is rendering for instance.

Differential Revision: https://developer.blender.org/D15207

Reviewed By: Brecht
2022-07-29 08:30:51 +02:00
4815772fda Cleanup: quiet warnings in recent BLF and rna_ui changes 2022-07-29 13:48:09 +10:00
e9bd6abde3 BLF: New Font Stack for Better Language Coverage
Replace our existing two fonts with a stack of new fonts to increase
and improve language coverage and to add many new symbols and icons.
Covers glyphs of top 44 languages - 1.5 billion more potential users.

See D10887 for lots of details.

Differential Revision: https://developer.blender.org/D10887

Reviewed by Brecht Van Lommel
2022-07-28 20:09:20 -07:00
c0845abd89 BLF: Fonts with FT_Face Optional
Allow FontBLFs to exist with NULL FT_Face, added only when actually
needed. Speeds up startup and unused fonts are not loaded.

See D15258 for more details.

Differential Revision: https://developer.blender.org/D15258

Reviewed by Brecht Van Lommel
2022-07-28 17:50:34 -07:00
848dd4a40a BLF: Don't Print Empty Strings
Optimize font drawing by skipping empty strings.

See D15472 for more details.

Differential Revision: https://developer.blender.org/D15472

Reviewed by Campbell Barton
2022-07-28 17:28:05 -07:00
e261290cb6 Merge branch 'blender-v3.3-release' 2022-07-28 17:40:42 -05:00
6ca602dd9f Fix T99761: Curves sculpt mode crash with empty curves
The virtual arrays may be null if the curves are empty,
it's simple to just skip the domain interpolation completely.
2022-07-28 17:39:10 -05:00
a9c74a0cd0 Fix set iterator test failure on macOS
This is a quite interesting case, where two arguments to a function are
evaluated in different order on Apple Clang than on GCC and I guess
MSVC. Left a comment on that.
2022-07-28 23:53:33 +02:00
3d91a853b2 Cleanup: Nodes: Store node group idname in tree type
There was already a utility to retrieve the correct node group idname
from the context, `node_group_idname`, but often it's clearer to
use lower-level arguments, or the context isn't accessible.
Storing the group idname in the tree type makes it accessible
without rewriting it elsewhere.
2022-07-28 16:34:17 -05:00
4757a5ad33 Cleanup: Make BKE_idprop.h self sufficient
It relied on uint, which is defined in a separate header.
2022-07-28 16:20:36 -05:00
eea1f9b1df Merge branch 'blender-v3.3-release' 2022-07-28 16:08:36 -05:00
1adeae56e6 Fix: Grammar mistake in info message 2022-07-28 16:08:20 -05:00
5c2fff306e Cleanup: Use LISTBASE_FOREACH macro 2022-07-28 16:02:46 -05:00
72d8a40a3d Cleanup: Use const context argument for UIList callbacks 2022-07-28 16:02:15 -05:00
cf61be6190 Cleanup: Use new IDProperty creation API for geometry ndoes modifier
Use the API from 36068487d0 instead
of the uglier `IDPropertyTemplate` API.
2022-07-28 15:50:39 -05:00
543ea41569 Cleanup: Remove unused node "add and link node" operator
The link drag search from 11be151d58 implements
this now. It was added in 3ebe7d970e but never used.
2022-07-28 15:40:32 -05:00
19528cfecd Merge branch 'blender-v3.3-release' 2022-07-28 21:31:14 +02:00
79ab76e156 Cleanup: simplifications and consistency for vector types
* OneAPI: remove separate float3 definition
* OneAPI: disable operator[] to match other GPUs
* OneAPI: make int3 compact to match other GPUs
* Use #pragma once
* Add __KERNEL_NATIVE_VECTOR_TYPES__ to simplify checks
* Remove unused vector3
2022-07-28 21:27:13 +02:00
fb42c5838c Revert "Fix T98773: GPU Subdivision breaks auto selection in UV edit mode"
This reverts commit e2c02655c7. It was already
reverted in the 3.2 branch, as it caused more serious issues than it solved.

Fixes T99805, T99323, T99296.
2022-07-28 21:20:51 +02:00
d094a3722c Fix wrong post-increment operators & test for BLI containers 2022-07-28 20:45:28 +02:00
9c65af2df0 Merge branch 'blender-v3.3-release' 2022-07-28 21:27:14 +03:00
68db023329 ID namemap: fix missing removal of old name in do_versions_rename_id
Was causing an assert that the old name exists in the name map, but
is not present in the actual database. Reported in #blender-coders
2022-07-28 21:26:30 +03:00
ae89fcfdaf Merge branch 'blender-v3.3-release' 2022-07-28 14:36:49 -03:00
fafb901baa PyDoc: fix 2D builtin shaders documentation
2D shaders require the `vec2` attribute for "pos" (not `vec3`)
2022-07-28 14:36:07 -03:00
2b9d4af261 EEVEE-Next: UI: Make Vector pass greyed out when motion blur is enabled
Also clears the render result to 0 to avoid invalid motion vectors.
2022-07-28 17:01:05 +02:00
53fc9add51 EEVEE-Next: Cleanup: Isolate render result readback and prototype progress
Still not working but the idea is to read the result and display the
first image sample so that user has a better feedback of the
rendering.
2022-07-28 17:01:05 +02:00
1e0aa2612c EEVEE-Next: Motion Blur new implementation
The new implementation leverage compute shaders to reduce the
number of passes and complexity.

The max blur amount is now detected automatically, replacing the property
in the render panel by a simple checkbox.

The dilation algorithm has also been rewritten from scratch into a 1 pass
algorithm that does the dilation more efficiently and more precisely.

Some differences with the old implementation can be observed in areas with
complex motion.
2022-07-28 17:01:05 +02:00
82327ce01d DRW: TextureFromPool: Change API to use acquire / release
This removes the quirk of having to call the sync function for each new
render loop.

# Conflicts:
#	source/blender/draw/engines/eevee_next/eevee_view.cc
2022-07-28 17:00:46 +02:00
0830ff55d8 EEVEE-Next: Fix Vector render pass 2022-07-28 16:58:01 +02:00
aacdaa7b1a Merge branch 'blender-v3.3-release' 2022-07-28 16:32:27 +02:00
ea23e937ce Cleanup/refactor: Readfile: Add dedicated function to insert ID pointers in libmap.
New `oldnewmap_lib_insert` does nothing special, it just wraps around existing
`oldnewmap_insert`, but it's the logical counter part of `oldnewmap_liblookup`.

It also helps tremendously when debuging complex ID pointers issues in
readfile.c code.
2022-07-28 16:29:57 +02:00
f3be8e66d7 Fix (studio-reported) crash in some rare cases in blendfile read code.
Crash would happen when a linked ID would become missing, that was
'pre-declared' and used only once as a 'weak link' in another library
stored before the one it came from.

In that case, the place-holder generated in read code would be freed in
`read_library_clear_weak_links`, when handling its 'owner' library, but
since all previous libraries in the list had already been 'lib_linked'
and their filedata (and related libmap) freed, the update of the libmaps
in `read_library_clear_weak_links` would not apply to data from those
previous libraries, leading to ID pointers there pointing to freed
memory.

This fix should also be backported to 2.93.
2022-07-28 16:29:57 +02:00
69bf74bd76 Merge branch 'blender-v3.3-release' 2022-07-28 16:40:37 +03:00
c49717a824 Fix T100017: OBJ: new importer does not import vertices that aren't part of any face
The Python based importer had a special case handling of "no faces in
the whole file at all", where it ended up treating the whole file
as essentially a point-cloud-like object (just loose vertices, no
faces or edges). The new importer code was missing this special case.

Fixes T100017. Added gtest coverage that was failing without the fix.
2022-07-28 16:39:42 +03:00
Iliay Katueshenock
07e201ec13 Geometry Nodes: add assert to check if node supports lazyness
Only nodes supporting lazyness can mark inputs as unused. For other
nodes, this is done automatically of all outputs are unused.

Differential Revision: https://developer.blender.org/D15409
2022-07-28 13:39:40 +02:00
d892f96cb1 Cleanup: Fix typo in comment 2022-07-28 12:52:20 +02:00
d034c28f51 Merge branch 'blender-v3.3-release' 2022-07-28 11:42:46 +02:00
ccb9d5d307 Curves: enable density brush when first entering curves sculpt mode
Previously, no tool was selected, which was a bug.
2022-07-28 11:41:36 +02:00
aa7d130347 Curves: improve handling of empty surface meshes 2022-07-28 11:37:35 +02:00
6ae9565d06 Cleanup: quiet GCC stringop-overflow warning 2022-07-28 16:08:59 +10:00
d41f0c7b15 Cleanup: unused header 2022-07-28 16:01:29 +10:00
a98102e32e Merge branch 'blender-v3.3-release' 2022-07-28 09:39:57 +10:00
8d4fa03e5c BLI_math: improve symmetrical values from sin_cos_from_fraction
When plotting equally distant points around a circle support an extra
axis of symmetry so twice as many exact values are repeated than
originally added in [0], see code-comments for a detailed explanation.
Tests to ensure accuracy and exact symmetry have been added too.

Follow up on fix for T87779.

[0]: 087f27a52f
2022-07-28 09:39:54 +10:00
397731d4df BLI_math: improve symmetrical values from sin_cos_from_fraction
When plotting equally distant points around a circle support an extra
axis of symmetry so twice as many exact values are repeated than
originally added in [0], see code-comments for a detailed explanation.
Tests to ensure accuracy and exact symmetry have been added too.

Follow up on fix for T87779.

[0]: 087f27a52f
2022-07-28 09:34:46 +10:00
ff048f5d27 Curves: Avoid virtual function overhead when finding selected curves
This showed up on a profile of sculpting with the comb brush.
Use a span instead of a virtual array.
2022-07-27 15:41:32 -05:00
165fa9e2a1 Merge branch 'blender-v3.3-release' 2022-07-27 21:26:18 +02:00
38af5b0501 Cycles: switch Cycles triangle barycentric convention to match Embree/OptiX
Simplifies intersection code a little and slightly improves precision regarding
self intersection.

The parametric texture coordinate in shader nodes is still the same as before
for compatibility.
2022-07-27 21:03:33 +02:00
69f2732a13 Cleanup: remove unnecessary bvh_instance_motion_pop 2022-07-27 21:02:21 +02:00
cd47d1b2ed Fix broken BVH2 on CPU after recent changes
Runtime switching between Embree and BVH2 got lost.
2022-07-27 20:58:02 +02:00
55fb2abc81 Curves: Bring back parallel copying of curve and point attributes
This was removed in cacdea7f4a to fix a bug, but copying point
and curve attributes should be fine as long as the attribute arrays are
retrieved before-hand.

Differential Revision: https://developer.blender.org/D15541
2022-07-27 11:52:11 -05:00
0dcfd93c6e Fix: curves edit hints not propagated in Join Geometry node
Found while investigating why crazy-space editing didn't work in T100026.
2022-07-27 18:38:45 +02:00
6e5eb46d73 Fix T100026: crash with zero-sized attributes
The problem was that zero-sized and non-existant attributes were
handled the same in some parts of the attribute API, which led to
unexpected behavior.

The solution is to properly differentiate the case when an attribute
does not exist and when it is just empty (because the geometry
is empty).

Differential Revision: https://developer.blender.org/D15557
2022-07-27 18:20:22 +02:00
d6b970dd7b Merge branch 'blender-v3.3-release' 2022-07-27 18:07:29 +02:00
84a3ff63d0 Fix: missing evaluated offsets in Resample Curve node
Differential Revision: https://developer.blender.org/D15556
2022-07-27 18:05:31 +02:00
84272ce19a Fix: add missing return
It was correct but less efficient without this early return.
2022-07-27 17:54:49 +02:00
5560da7ceb Revert "Blender 3.3 splashscreen"
This reverts commit d61ab45385.
2022-07-27 17:32:21 +02:00
37ebd66570 Revert "Blender 3.3 - Beta"
This reverts commit 32a9aac3b8.
2022-07-27 17:32:05 +02:00
3b71a62390 Merge branch 'blender-v3.3-release' 2022-07-27 17:31:49 +02:00
d61ab45385 Blender 3.3 splashscreen
Credits: Piotr Krynski
2022-07-27 17:25:56 +02:00
b2dd1f8f01 Fix build include for rna_curves.c
* Since curves are no longer experimental, this should be included at any time.
2022-07-27 17:19:15 +02:00
32a9aac3b8 Blender 3.3 - Beta
* BLENDER_VERSION_CYCLE set to beta
* Update pipeline_config.yaml to point to 3.2 branches and svn tags
* Update and uncomment BLENDER_VERSION in download.cmake
2022-07-27 17:14:21 +02:00
9015952c9c Blender 3.4 Alpha: Start of new release cycle. 2022-07-27 16:53:19 +02:00
83362f87bb Blender 3.3: Finalizing version bump. 2022-07-27 16:33:49 +02:00
415f88d8b0 Fix wrong fileversion usage in own recent rB9ac81ed6abfb. 2022-07-27 16:20:50 +02:00
ea4b1d027d Geometry Nodes: Rename "Field on Domain" to "Interpolate Domain"
This name doesn't require understanding of fields, and
is phrased as an action which is consistent with other nodes.
Discussed in the latest geometry nodes sub-module meeting.
2022-07-27 08:56:17 -05:00
Erik Abrahamsson
c8ae1fce60 Geometry Nodes: Shortest Paths nodes
This adds three new nodes:
* `Shortest Edge Paths`: Actually finds the shortest paths.
* `Edge Paths to Curves`: Converts the paths to separate curves.
  This may generate a quadratic amount of data, making it slow
  for large meshes.
* `Edge Paths to Selection`: Generates an edge selection that
  contains all edges that are part of a path. This can be used
  with the Separate Geometry node to only keep the edges that
  are part of a path. For large meshes, this approach can be
  much faster than the `Edge Paths to Curves` node, because
  less data is created.

Differential Revision: https://developer.blender.org/D15274
2022-07-27 15:38:44 +02:00
9ac81ed6ab Fix corrupted blend files after issues from new name_map code.
Add a version of #BKE_main_namemap_validate that also fixes the issues,
and call it in a do_version to fix recent .blend files saved after the
regression introduced in rB7f8d05131a77.

This is mandatory to fix some production files here at the studio, among
other things.
2022-07-27 15:33:29 +02:00
9f53272df4 Fix more issues with new name map and liboverrides.
Follow-up to rB13e17507c069, forgot to handle shapekeys...
2022-07-27 15:33:29 +02:00
58dcd20998 ID namemap: Fix more issues when changing libs.
Fix tests, and some issue when making an ID local.

There are probably a few more issues still though.
2022-07-27 15:33:29 +02:00
Amelie Fondevilla
4843b161d6 Fix T99870 : Prevents crash when rearranging channels in dopesheet
The function to rearrange channels only works for F-curves channels for now, adding the `FCURVESONLY` filter prevents the function to be called for grease pencil channels, thereby fixing the crash.

Reviewed by : sybren
Differential Revision: http://developer.blender.org/D15504
2022-07-27 11:40:44 +02:00
7324f32a94 ID namemap tests: Use consistency check, fix an issue.
Massively use the new consistency check in namemap regression tests, and
fix an issue with library data tests revealed by those checks.
2022-07-27 11:22:48 +02:00
18dc611b40 ID namemap: Add check for consistency.
Add a util function to check that content of a given Main and the
namemaps in it are consistent.

Add some asserts calling this check after file read, and after some
override operations.
2022-07-27 11:22:48 +02:00
1e55b58e4f UI: Sort tools in curves sculpting mode
The previous order was based on the order of when the tools were
developed. Instead we now cluster them based on similar functionality:

* Selection
* Add/Remove
* Deform/Transform
* Annotation

Done in collaboration with Pablo Vazquez.
2022-07-27 11:15:48 +02:00
13e17507c0 Fix crashes due to non-uniqueness in ID names in some cases.
Liboverrides are doing some very low-level manipulation of IDs in apply
code, to reduce over-head of name and sorting handling.

This requires specific care to ensure thatr the new namemap runtime data
remains up-to-date and valid. Otherwise, names of existing IDs would be
missing from the map, which would later lead to having several different
IDs with the same name. Critical corruption in Blender ID management.

Reported by animators at the Blender studio.

Regression from rB7f8d05131a77.
2022-07-27 11:10:45 +02:00
4dd409a185 Fix T99976: Animated visibility not rendering properly in viewport
A mistake in the 0dcee6a386 which made specific driven visibility
to work, but did not properly handle actual time-based visibility.

The basic idea of the change is to preserve recalculation flags of
nodes which were tagged for update but were not evaluated due to
visibility constraints. In the file from the report this makes it
so tagging which is done first time ID is in the dependency graph
are handled when the ID actually becomes visible. This is what
solved the root of the problem from the report: there was missing
geometry update since it was "swallowed" by the evaluation during
the object being invisible. In other configurations this change
allows to handle pending geometry updates due to animated modifiers
be handled when object becomes visible without time change.

This change also solves visibility issue of the synchronization
component which also started to be handled badly since the
previous fix attempt. Basically, the needed exception in its
visibility handling did not happen and a regular logic was used
for it.

Tested with files from the T99733, T99976, and from the Heist
project.

Differential Revision: https://developer.blender.org/D15544
2022-07-27 10:19:42 +02:00
d706d0460c Cycles oneAPI: simplify num_concurrent_states selection
The number of Execution Units and resident "threads" (simd width * threads
per EUs) are now exposed and used to select the number of states using
a simplified heuristic.
2022-07-27 09:45:33 +02:00
38e270ae30 Cleanup: Move wm_dragdrop.c to C++ 2022-07-26 23:15:33 -05:00
e67710b908 deps/oiio: fix build issue on windows
tiff now outputs tiffd.lib for debug builds
oiio was not informed about this and had
a build error because of it.
2022-07-26 20:59:44 -06:00
f43a8835dc deps/alembic: add missing imath dependency
if alembic builds before imath it'll cause a build error.
2022-07-26 20:54:27 -06:00
Jun Mizutani
2ca18e78f9 Sculpt: Remove debug printf
Reviewed By: Joseph Eagar
Differential Revision: D15547
Ref D15547
2022-07-26 14:25:58 -07:00
b75d0c7e7a Geometry Nodes: Implement link drag search for two nodes
It was never added for the field on domain and field at index nodes.
They need special handling because they have many what should be
a multi-type socket declaration.
2022-07-26 16:12:42 -05:00
f14f81e5ac Nodes: Allow using escape key to exit node resizing 2022-07-26 16:03:43 -05:00
faa0c7aa6f Cleanup: Move mesh_tessellate.c to C++ 2022-07-26 14:41:34 -05:00
Falk David
88f0d483bd Python: Expose property to mute action groups
This patch adds a `mute` RNA property on `ActionGroup`s that allows them to be easily muted/unmuted from python.
This uses the existing `AGRP_MUTED` flag which was also accessible from the user interface.

Reviewed By: sybren

Differential Revision: https://developer.blender.org/D15329
2022-07-26 21:32:05 +02:00
8571093f99 GPencil: Small UI change in overlay for consistency
To keep consistency is better add the word `Inactive` for `Fade Layers` and `Fade Objects`  to keep the same naming used in other areas of the overlay panel.

Reviewed by: Matias Mendiola
2022-07-26 16:39:17 +02:00
2b8e35eeb0 Fix T99984: Small GPencil overlay UI bugs in Edit Mode
This commit fixes the opacity for curves hiding the option.

Actually, the curve points and handles drawing is using the same code that mesh curves and the opacity is not supported. While this feature will be added for mesh curves and gpencil, now it's better to hide this option.

Reviewed: Matias Mendiola

Note: The handle problem reported in this task was fixed in  a separated commit: 203e7ba332
2022-07-26 16:34:27 +02:00
1998269b10 Refactor: Extract color attributes as generic attributes
Previously there was a special extraction process for "vertex colors"
that copied the color data to the GPU with a special format. Instead,
this patch replaces this with use of the generic attribute extraction.
This reduces the number of code paths, allowing easier optimization
in the future.

To make it possible to use the generic extraction system for attributes
but also assign aliases for use by shaders, some changes are necessary.
First, the GPU material attribute can now store whether it actually refers
to the default color attribute, rather than a specific name. This replaces
the hack to use `CD_MCOL` in the color attribute shader node. Second,
the extraction code checks the names against the default and active
names and assigns aliases if the request corresponds to a special active
attribute. Finally, support for byte color attributes was added to the
generic attribute extraction.

Differential Revision: https://developer.blender.org/D15205
2022-07-26 08:37:38 -05:00
5945a90df9 Fix T98788: bad first curve tangent when first points have same position 2022-07-26 15:25:59 +02:00
72f77598a2 Fix T98798: tag collection geometry when changing instance offset
Changing the instance offset moves the entire "collection geometry".
So other features that depend on the geometry should be reevaluated.
2022-07-26 14:59:40 +02:00
ac1554bcf6 Fix T98982: cannot change default value of some node group input types 2022-07-26 14:49:12 +02:00
5aba7f9774 Geometry Nodes: Hide value button for field at index node
Changing the value doesn't accomplish anything, since the retrieved
value would be the same for every index then. So it's best to hide it
to make the node clearer.
2022-07-26 07:42:32 -05:00
78b7140b02 deps: update TIFF and OpenEXR
* OpenEXR 3.1.4 -> 3.1.5, this fixes several issues OSS fuzz found.
* libtiff 4.3.0 -> 4.4.0, this fixes several CVE's.

This also converts the harvest of libtiff on windows to a post install handler,
there's a few left but Windows is getting close to being harvest free.

Differential Revision: https://developer.blender.org/D15478
2022-07-26 13:25:58 +02:00
aa788b759a deps: FFmpeg vpx/aom-av1 updates
This is a refresh of our current FFmpeg 5.0.0 (unchanged) version with the
following changes:

* libvpx all platforms: enable SSE3/4/AVX/AVX2 instruction sets. libvpx has a
  proper CPUID check in place and will not call the faster kernels unless it is
  sure the CPU supports it. So we can safely enable this, this partially
  resolves T95743 (completely on Linux and macOS).

* libvpx Windows - threading was disabled due to a shared dependency on
  libwinpthreads.dll which we prefer not to distribute. However when configure
  cannot find pthreads it will happily fall back on a win32 threads based
  emulation layer. This also resolves the final part of T95743.

* libaom-av1 - new dependency required for D14920, this is a somewhat odd
  dependency, it's cmake based, but still needs the perl environment setup, so
  we have to setup the env and call cmake our selves for the configure, build
  and install commands. This dep has the same libwinpthreads issue as vpx on
  Windows, however since it's cmake based, it's easier to prevent cmake from
  detecting it.

Differential Revision: https://developer.blender.org/D15399
2022-07-26 13:25:58 +02:00
caf907626d Fix T99271: modifier errors are not cleared 2022-07-26 13:01:30 +02:00
c5712c6795 Fix T99373: add some padding in spreadsheet vector columns
This improves readability in some cases (e.g. in T99373).
2022-07-26 12:36:44 +02:00
Nate Rupsis
b08c5381ac default N-panel open for animation editors
The Graph, Driver, and Dopesheet's (and sub modes) properties panel
(N-Panel) are now open by default. This includes the editors in the
default Animation workspace.

Note that, because the Timeline is implemented as a special mode of the
Dopesheet, switching between Timeline and Dopesheet will *not* change
the visibility of the properties panel.

Maniphest Tasks: T97980

Differential Revision: https://developer.blender.org/D14910
2022-07-26 11:43:05 +02:00
e4a779264c Partially revert "Build: Fix build of library dependencies on Linux aarch64"
This reverts the Flex-related parts of commit
rBef268c78933079137288e326704431432adf9ad9, as those caused a build
error on CentOS 7 (which is used for the precompiled Linux libraries).

CentOS 7 only has Automake 1.13, whereas after this commit version 1.15
seems to be required.

Since in its patch description (D15319) it's mentioned that this
"probably doesn't warrant changing", and it's actually blocking the
build of the precompiled libraries for Blender 3.3 now, I'll revert the
Flex-related part of the commit.
2022-07-26 11:43:05 +02:00
Iliay Katueshenock
c94ca54cda BLI: add use_threading parameter to parallel_invoke
`parallel_invoke` allows executing functions on separate threads.
However, creating tasks in tbb has a measurable amount of overhead.
Therefore, it can be benefitial to disable parallelization when
the amount of work done per function is small.

See D15539 for some benchmark results.

Differential Revision: https://developer.blender.org/D15539
2022-07-26 11:10:16 +02:00
203e7ba332 GPencil: Update curve handle display after change overlay option
The handles were not updated after changing the settings.

This is a partial fix of T99984
2022-07-26 11:07:28 +02:00
c597d6cb64 Fix T99979: GPencil strokes cannot be edited after set origin
The stroke points were changed but the bounding box calculation was not done and this produced a problem in any bounding box check done by different tools.
2022-07-26 10:53:08 +02:00
c869f54dcb Cleanup: Typo in comments: data-lock -> data-block. 2022-07-26 10:00:20 +02:00
bdb4ebebf1 Cleanup: quiet GCC cast-function-type warnings for gflags 2022-07-26 14:47:12 +10:00
c3bc53162a Cleanup: format 2022-07-26 13:23:45 +10:00
f1f89ca751 Cleanup: spelling in comments 2022-07-26 13:21:21 +10:00
3ae85a0d8f Fix Python SystemExit exceptions silently exiting
Any script that raised a SystemExit called by --python, --python-expr
command line args or by executing the text block would exit without
printing a message. This caused the error from T99966 to be hidden.

Add explicit handling for SystemExit to ensure the message is always
shown before exiting.

More details noted in code-comments.
2022-07-26 13:21:15 +10:00
37ad72ab23 Fix T99966: Python API docs fail to generate
The recent addition of "active_action" [0] required updating in the
API docs type information.

[0]: cd21022b78
2022-07-26 12:51:01 +10:00
4cf6524731 Fix Cycles Metal build errors after recent changes
float8 is a reserved type in Metal, but is not implemented. So rename to
float8_t for now.

Also move back intersection handlers to kernel.metal, they can't be in the
class that encapsulates the other Metal kernel functions.
2022-07-26 00:17:37 +02:00
f76a2c0d18 Fix: Fix attribute writer debug warnings in terminal
Use an imperfect solution, since this code will be replaced soon anyway.
2022-07-25 16:06:28 -05:00
462f99bf38 Sculpt: Fix T99779, pbvh gets wrong active vertex for multires
The recent multires winding fix missed a code branch.
2022-07-25 11:53:48 -07:00
fb9f12eeec UI: Nishita sky: Increase Sun Elevation UI sensitivity and remove min/max
This now use default angle precision which matches the sun rotation.
Feeling is much more natural.
2022-07-25 19:26:12 +02:00
46dbfce7fc Cycles: Nishita Sky: Fix sun disk imprecision for large elevation
The issue was introduced by rBad5e3d30a2d2 which made possible to use
unbounded elevation angle.

In order to not touch the shading code, we just remap the value to the
expected range the shading code expects. This means that elevation angles
above +/-PI/2 effectively flip the sun rotation angle.
2022-07-25 19:26:12 +02:00
703dff333c Fix T99459: GPencil: Fill tool on the surface not in the correct place
There is a 1 pixel error in the size registered for the buffer
dimensions.

NOTE: This issue indicates that the texture scale is different from the
region, so the mouse-based coordinates used are actually misaligned.
This misalignment will be fixed in another commit.

Regression probably introduced in rB1d49293b8044 + rB45f167237f0c8
2022-07-25 14:13:48 -03:00
00a3533429 Curves: Unify poll functions, add message with no surface
The "snap to surface" operators now have "disabled" poll messages
when there is no surface object.

The implementation in most curves operators is also unified.
The goal is to avoid having to define and use the poll failure messages
in multiple places, to reduce the boilerplate that tends to be
necessary to add an operator, and to increase the likelihood that
operators are implemented with proper poll messages.

Differential Revision: https://developer.blender.org/D15528
2022-07-25 11:59:33 -05:00
739136caca Fix: Assert in resample curve node with single point curve 2022-07-25 11:53:22 -05:00
f26aa186b2 Cleanup: remove __KERNEL_CPU__
This was tested in some places to check if code was being compiled for the
CPU, however this is only defined in the kernel. Checking __KERNEL_GPU__
always works.
2022-07-25 17:43:35 +02:00
Andrii Symkin
793d203139 Cycles: add math functions for float8
This patch adds required math functions for float8 to make it possible
using float8 instead of float3 for color data.

Differential Revision: https://developer.blender.org/D15525
2022-07-25 17:36:58 +02:00
7a74d91e32 Cleanup: move device BVH code to kernel/device/*/bvh.h
Having the OptiX/MetalRT/Embree/MetalRT implementations all in one file with
many #ifdefs became too confusing. Instead split it up per device, and also
move it together with device specific hit/filter/intersect functions and
associated data types.
2022-07-25 16:34:22 +02:00
Arye Ramaty
c6ce70855a Geometry Nodes: Add node descriptions/tooltips
This commit adds tooltips to the geometry nodes add menu.

Differential Revision: https://developer.blender.org/D15414
2022-07-25 08:56:24 -05:00
881ef0548a Fix wrong Cycles SSS intersection distance after ray distance changes
No need anymore to have a difference between CPU/GPU, all distances
remain in world space.
2022-07-25 15:19:29 +02:00
484ad31653 Cycles: simplify handling of ray distance in GPU rendering
All our intersections functions now work with unnormalized ray direction,
which means we no longer need to transform ray distance between world and
object space, they can all remain in world space.

There doesn't seem to be any real performance difference one way or the
other, but it does simplify the code.
2022-07-25 13:27:40 +02:00
023eb2ea7c Cycles: more closely match some math and intersection operations in Embree
This helps with debugging, and gives a slightly closer match between CPU
and CUDA/HIP/Metal renders when it comes to ray tracing precision.
2022-07-25 13:27:40 +02:00
d567785658 Fix T99816: renaming attribute works incorrectly
This fixes two issues:
* There was a crash when the new attribute name was empty.
* The attribute name was incremented (e.g. "Attribute.001") when
  the old and new name were the same.
2022-07-25 13:16:59 +02:00
332d547ab7 Fix T99850: incorrect tangents on evaluated bezier curves
Cyclic curves don't need the tangent correction based on the first
and last handle position.
2022-07-25 13:10:34 +02:00
b9e66af686 Fix T99851: Subdivide Curve node does not initialize attributes of end point 2022-07-25 12:45:04 +02:00
2c81b4d4cf Fix T99880: no node timing for frames in node groups 2022-07-25 12:27:45 +02:00
5feb3541f4 Fix T99889: Fillet Curve node uses wrong radius 2022-07-25 12:20:54 +02:00
Ramil Roosileht
cf9dd3c0d8 Fix T99036: hex color in "Add Color Attribute"
Proposed solution by @scurest The color attribute in the RNA was tagged as
 COLOR_GAMMA. This change will change it to a regular COLOR.

{F13217692}

Reviewed By: joeedh, jbakker

Maniphest Tasks: T99036

Differential Revision: https://developer.blender.org/D15272
2022-07-25 12:15:27 +02:00
6f1cdcba85 Fix T99929: lattice modifier looks up vertex group index in wrong place
It looked up the vertex group index based on the object instead of the
actual mesh that is currently used. Since geometry nodes, the number
and order of attributes can change in arbitrary ways during evaluation.
Therefore, this index has to be looked up on the mesh which contains
the most up-to-date information.

There are probably similar issues in other modifiers. That has to be
fixed step by step. Ideally by using the attribute api directly eventually.
2022-07-25 11:54:49 +02:00
c5afef1224 Fix missing disabled hint when dragging from Asset Browser in edit mode
When dragging assets into the 3D View while in any other mode than
object mode, dropping would be disabled and the cursor would indicate
that. However there was supposed to be an "Only supported in object
mode" message, that similar operators showed, but got forgotten when
this one was introduced.
2022-07-25 11:44:56 +02:00
1c05f30e4d Curves: add warning when invalid uv map is used when adding curves
UV maps that are used for surface attachment must not have overlapping
uv islands, because then the same uv coordinate would correspond to
multiple surface positions.

Ref T99936.
2022-07-25 11:42:27 +02:00
53113a2e57 Geometry: detect when the sample uv is in multiple triangles 2022-07-25 11:32:39 +02:00
c5394f3db8 EEVEE-Next: Fix float3 passes being incorrect 2022-07-25 11:25:24 +02:00
f814871e81 EEVEE-Next: Fix some Material compilation errors 2022-07-25 11:25:24 +02:00
47d1a7484c EEVEE-Next: Display compatible properties panels
Only a few are kept not available as their features are not yet supported.
2022-07-25 11:25:24 +02:00
cd9ebc816e Fix build error with WITH_CYCLES_KERNEL_NATIVE_ONLY on macOS Arm
-march=native is not supported for all architectures.
2022-07-25 11:23:25 +02:00
72fb92ded8 Fix T99961: crash when spreadsheet shows volume grids 2022-07-25 11:22:14 +02:00
cacdea7f4a Fix: crash when accessing attributes from multiple threads
Calling two non-const methods on a `MutableAttributeAccessor`
at the same time in multiple threads is not safe.

While I don't know what caused the crash here exactly, I do know
that it happens while looking up the attribute for writing, which
may modify the unterlying geometry. I couldn't reproduce the
bug with a debug build or without threading.
2022-07-25 11:14:42 +02:00
Alex Parker
44258b5ad0 Undo: Improve image undo performance
When texture painting a lot of time is spent in ED_image_paint_tile_find.
This fixes stores the PaintTiles in a blender::Map making ED_image_paint_tile_find an O(1) rather than O(n) operation.

When using threading the locking should happen during read as well,
still this gives a boost in performance as the read is now much faster.

Reviewed By: jbakker

Maniphest Tasks: T99546

Differential Revision: https://developer.blender.org/D15415
2022-07-25 08:14:32 +02:00
7808ee9bd7 Geometry Nodes: Improve UV Sphere primive performance
In a test producing 10 million vertices I observed a 3.6x improvement,
from 470ms to 130ms. The largest improvement comes from calculating
each mesh array on a separate thread. Besides that, the larger changes
come from splitting the filling of corner and face arrays, and
precalculating sines and cosines for each ring.

Using `parallel_invoke` does gives some overhead. On a small 32x16
input, the time went up from 51us to 74us. It could be disabled
for small outputs in the future. The reasoning for this parallelization
method instead of more standard data-size-based parallelism is that the
latter wouldn't be helpful except for very high resolution.
2022-07-24 20:03:16 -05:00
Lukas Stockner
6db059e3d7 Render: Update lightgroup membership in objects and world if lightgroup is renamed
As discussed, this only updates objects in and the world of the scene to which the view layer belongs, which also avoids the problem of not having a BMain available.

Differential Revision: https://developer.blender.org/D14740
2022-07-24 21:33:04 +02:00
f7d5aaa365 Alembic: speed up edge crease import
The Alembic importer uses a linear search over the mesh edges to find
the right edge when setting edge creases. Although the complexity is
`O(m * n)`, with `m` being the number of creased edges, and `n` being
the number of edges, this can lead to a quadratic complexity as `m`
approches `n`.

This patch uses `EdgeHash` to store and retrieve the edges, which
should bring complexity closer to `O(n)`, provided that lookup is
`O(1)`.

See differential for some timings. In most files, this is expected
to give at least a 2-3x speedup for this operation, but can lead
orders of magnitude speed increase for dense meshes with a significant
number of edge creases.

Differential Revision: https://developer.blender.org/D15521
2022-07-24 21:18:11 +02:00
d26c29d8e4 Fix T98367: Light group passes do not work when shadow catcher is used 2022-07-24 20:36:46 +02:00
31365c6b9e Attributes: Use new API for C-API functions
Use the C++ API to implement more of the existing C functions.
This corrects the cases where one tries to add a builtin attribute
with the wrong domain or type on curves, though a better warning
message would be helpful in the future, and also reduces duplication
of the internal logic. Not much more is possible without changing
the interface.
2022-07-24 12:46:28 -05:00
ad632a13d9 EEVEE-Next: Decorelate Large filter spiral sampling
This avoids correlation artifacts with the jitter pattern itself.
Also try to reduce the visible spiral pattern.
2022-07-24 19:24:50 +02:00
b1c49b3b2a EEVEE-Next: Fix depth accumulation and stability in viewport
The display depth is used to composite Gpencil and Overlays. For it to
be stable we bias it using the dFdx gradient functions. This makes
overlays like edit mode not flicker.

The previous approach to save the 1st center sample does not work anymore
since we jitter the projection matrix in a looping pattern when scene
is updated. So the center depth is only (almost) valid 1/8th of the times.
The biasing technique, even if not perfect, does the job of being stable.

This has a few cons:
- it makes the geometry below the ground plane unlike workbench engine.
- it makes overlays render over geometry at larger depth discontinuities.
2022-07-24 19:24:50 +02:00
a5bcb4c148 EEVEE-Next: Make animated viewport non jittered when disabling denoising 2022-07-24 19:24:50 +02:00
68101fea68 EEVEE-Next: Add back background opacity toggle 2022-07-24 19:24:50 +02:00
8ac5b1fdb3 EEVEE-Next: Make Anti-Flicker more strong
This might make the image a bit blurier but it reduces the flickering of
shiny surfaces during animation.

This uses the technique described in "High Quality Temporal Supersampling"
by Brian Karis at Siggraph 2014 (Slide 45): Reduce the exponential factor
when the history is close the bounding box border.
2022-07-24 19:24:50 +02:00
bd9bb56f18 EEVEE-Next: Fix Alt+B render borders
A few offsets were missing.
Reminder that this does not change the actual render resolution but it
reduces the VRAM consumption of accumulation buffers.
2022-07-24 19:24:50 +02:00
364babab65 EEVEE-Next: Fix background velocity 2022-07-24 19:24:50 +02:00
0fcc04e7bf Cleanup: Fix off-by-half-errors with udim search 2022-07-24 14:48:30 +12:00
f1f2c26223 Cleanup: Simplify uv sculpt tool
No functional changes.
2022-07-24 13:48:53 +12:00
c94c0d988a Fix: Removing attributes from UI invalidates caches
Use the new attribute API to implement the attribute remove function
used by RNA, except for BMesh attributes. Currently, removing curve
attributes from the panel in the property editor does not mark the
relevant caches dirty (for example, the cache of curve type counts),
because that behavior is implemented with the new attribute API.
Also, eventually we want to merge the two APIs, and removing an
attribute is the first function that can be partially implemented
with the new API.

Differential Revision: https://developer.blender.org/D15495
2022-07-23 19:59:59 -05:00
0c3851d31f EEVEE-Next: Film: Rename filter_size for clarity and add box filter ...
... as a debug option.
2022-07-23 22:57:10 +02:00
3ea2b4ac31 EEVEE-Next: Film: Fix incorrect anti-aliasing
There was a confusion about what space the offset was in.
2022-07-23 22:57:10 +02:00
7c6d546f3a Fix an assert trip in boolean tickled by D11272 example.
The face merging code in exact boolean made an assumption that
the tesselated original face was manifold except at the boundaries.
This should be true but sometimes (e.g., if the input faces have
self-intersection, as happens in the example), it is not.
This commit makes face merging tolerant of such a situation.
It might leave some stray edges from triangulation, but it should
only happen if the input is malformed.
Note: the input may be malformed if there were previous booleans
in the stack, since snapping the exact result to float coordinates
is not guaranteed to leave the mesh without defects.

This is the second try at this commit. The previous one had a typo
in it -- luckily, the tests caught the problem.
2022-07-23 12:15:59 -04:00
d53ea1d0af Fix T99905: wrong toposort when the node tree is cyclic 2022-07-23 14:37:58 +02:00
092732d113 IO: speed up import of large amounts of objects in USD/OBJ by pre-sorting objects by name
Previously, when creating "very large" (tens-hundreds of thousands)
amounts of objects, the Blender code that was ensuring name
uniqueness was the bottleneck. That got recently addressed (D14162),
however now sorting of IDs by their names is the remaining bottleneck.

Name sorting code in Blender is optimized for the pattern where names
are inserted in already sorted order (i.e. objects expect to get added
near the end of the list). By doing this pre-sorting of objects
intended to get created by an importer (USD and OBJ, in this patch),
this sorting bottleneck can be largely removed, especially with very
high object counts.

Windows, Ryzen 5950X, import times:

- OBJ, splash screen scene (26k objects): 22.0s -> 20.7s
- USD, Disney Moana scene (250k objects): 585s -> 82.2s (10 minutes -> 1.5 minutes)

Reviewed By: Michael Kowalski, Howard Trickey
Differential Revision: https://developer.blender.org/D15506
2022-07-23 15:16:14 +03:00
beb746135d Fix T99830: missing update after reordering node group sockets 2022-07-23 13:30:15 +02:00
5da807e00f Fix: Store Named Attribute node not working when attribute did not exist 2022-07-23 12:14:45 +02:00
fc8b9efb24 Update RNA to User manual mappings 2022-07-22 21:00:34 -04:00
82467e5dcf Cleanup: Typo with uv sphere normal creation
Regression from 087f27a52f
2022-07-23 09:12:13 +12:00
80b2fc59d1 Fix T99873: Use evaluated vertex groups in armature modifier
Geometry nodes has added the ability to modify mesh vertex groups
during evaluation (see 3b6ee8cee7). However, the armature
modifier always uses the vertex groups from the original object.
This is wrong for the modifier stack, where each modifier is meant
to use the output of the previous.

This commit makes the armature modifier use the evaluated vertex groups
if they are available. Otherwise it uses the originals like before.

Differential Revision: https://developer.blender.org/D15515
2022-07-22 15:49:53 -05:00
7d8b651268 EEVEE-Next: Add exposure awareness to denoising
This uses the exposure to get a better approximation of the perceptual
brighness of a sample before accumulating it.

Note that we do not modify exposure of the image. Only the samples weights
are computed differently.
2022-07-22 21:03:06 +02:00
676a2f690c EEVEE-Next: Fix render not working
The swaps during accumulation were ignored because of the way the
`SwapChain<>` implementation works.

Using external references and updating them fixes the issue.
2022-07-22 20:32:17 +02:00
35843ddcd8 Fix T99835: Incorrect title case for two node names 2022-07-22 11:36:55 -05:00
98395e0bdf Cleanup: Use r_ prefix for boolean return parameters
Also rearrange some lines to simplify logic.
2022-07-22 10:49:09 -05:00
c40971d79a Fix T99873: Store named attribute node cannot write to vertex groups
Since fd5e5dac89, the node would remove the attribute before
adding it again, which lost the vertex group status of an attribute,
meaning they were written as arbitrary attributes.

Now, the node first tries to write to attributes with the same domain
and data-type, which covers the vertex group case. Then it falls back
to removing the attribute and adding it again. Even that can fail
though, so I added an error message to make that a bit clearer.

Differential Revision: https://developer.blender.org/D15514
2022-07-22 10:31:40 -05:00
e4eaf424b9 Fix nodes not transforming
Error in {rB98bf714b37c1}
2022-07-22 12:17:22 -03:00
6bcda04d1f Geometry Nodes: Port sample curves node to new data-block
Use the newer more generic sampling and interpolation functions
developed recently (ab444a80a2) instead of the `CurveEval` type.
Functions are split up a bit more internally, to allow a separate mode
for supplying the curve index directly in the future (T92474).

In one basic test, the performance seems mostly unchanged from 3.1.

Differential Revision: https://developer.blender.org/D14621
2022-07-22 09:59:28 -05:00
1f94b56d77 Curves: support sculpting on deformed curves
Previously, curves sculpt tools only worked on original data. This was
very limiting, because one could effectively only sculpt the curves when
all procedural effects were turned off. This patch adds support for curves
sculpting while looking the result of procedural effects (like deformation
based on the surface mesh). This functionality is also known as "crazy space"
support in Blender.

For more details see D15407.

Differential Revision: https://developer.blender.org/D15407
2022-07-22 15:39:41 +02:00
Germano Cavalcante
98bf714b37 Refactor: arrange transform convert functions in 'TransConvertTypeInfo'
Simplify the transform code by bundling the TransData creation, Data
recalculation, and special updates into a single struct.

So similar functions and parameters can be accessed without special
type checks.

Differential Revision: https://developer.blender.org/D15494
2022-07-22 10:01:27 -03:00
185eeeaaac GHOST/Wayland: Fix mouse wheel events for Sway Compositor (use seat v5)
Bump the requested seat version to v5, use discreet scroll callback.

Tested with gnome, river & sway.
2022-07-22 22:15:00 +10:00
003dfae270 Cycles: enable oneAPI in Linux release builds
0f50ae131f didn't do it reliably
since it was deactivated explicitly a bit above.
2022-07-22 13:03:49 +02:00
e0d4aede4d BMesh: move bmesh_mesh to C++
This allows parts of the code to be threaded more easily.
2022-07-22 20:40:31 +10:00
95e60b4ffd Cleanup: move crazyspace.c to c++
Doing this in preparation for D15407.
2022-07-22 12:33:08 +02:00
087f27a52f Fix T87779: Asymmetric vertex positions in circles primitives
Add sin_cos_from_fraction which ensures each quadrant has matching
values when their sign is flipped.
2022-07-22 13:59:36 +10:00
08c5d99e88 Cleanup: add BKE_image_find_nearest_tile_with_offset
Every caller BKE_image_find_nearest_tile was calculating the tile offset
so add a version of this function that returns the offset too.
2022-07-22 13:07:24 +10:00
72e249974a Fix crash loading factory settings in image paint mode
Loading factory settings left the region NULL, causing the brushes
poll function to crash.
2022-07-22 12:25:10 +10:00
d3db38cfb1 Cleanup: quiet nonull-compare warnings with GCC 2022-07-22 12:23:33 +10:00
7725740543 UV: Edge support for select shortest path operator
Calculating shortest path selection in UV edge mode was done using vertex
path logic. Since the UV editor now supports proper edge selection [0],
this approach can sometimes give incorrect results.

This problem is now fixed by adding separate logic to calculate the
shortest path in UV edge mode.

Resolves T99344.

[0]: ffaaa0bcbf

Reviewed By: campbellbarton

Ref D15511.
2022-07-22 11:17:16 +10:00
aa1ffc093c Fix T99884: Crash when converting to old curve type
The conversion from Curves to CurveEval used an incorrect type
for one of the builtin attributes. Also, an incorrect default was used
for reading the nurbs_weight attribute.
2022-07-21 19:44:06 -05:00
7a4a6ccad7 Cleanups: Small changes to armature deform
Use const pointers, remove unused data member for parallel callback,
use listbase macro.
2022-07-21 17:21:56 -05:00
ada6012518 Fix T99854: Crash converting legacy NURBS curves to new type
Creating the attributes was done inside a parallel loop. Also correct a
typo for the parallel grain size, which was meant to be a power of two.
2022-07-21 12:13:42 -05:00
Sebastiano Barrera
a5c2d0018c Fix T91932: number sliders wrap around when dragged for long distance on X11
The value of number sliders (e.g. the "end frame" button) wrap around to
their pre-click value when dragging them for a very long distance (e.g.
by lifting the mouse off the desk and placing it back on to keep
dragging in the same direction).

The problem is X11-specific, and due to XTranslateCoordinates using a
signed int16 behind the curtains, while its signature and the rest of
Blender uses int32. The solution is to only use XTranslateCoordinates on
(0, 0) to get the delta between the screen and client reference systems,
and applying the delta in a second step.

Differential Revision: https://developer.blender.org/D15507
2022-07-21 19:02:03 +02:00
611be46cc9 Cleanup: compiler warning 2022-07-21 19:01:19 +02:00
a36f029459 Fix crash in some very rare case in remapping code.
Actualy 'safe' building of the base has in view layers (as part of
`BKE_main_collection_sync_remap`) would only happen when there was
already an existing one, otherwise it was skipped, and rebuilt later
(without the support for doublons) in collection sync code.

Very odd that that error was never spotted before, issue in code has
been there for a long time already. Probably only happens in rare cases
(specific conjuction of factors during remapping of old ID into itelf
new id)?

Reported by @hjalti from Blender studio. Reproducing case:
`heist/pro/shots/050_alarm/050_0160/050_0160.anim.blend`, r1407
2022-07-21 18:11:13 +02:00
ef5b435e8f DRW: Volume: Fix crash in command line render caused by null textures
This was caused by the world volume shader needing placeholder textures
that were not available until cache populate begins.

Adding a check and creating on the fly fixes the issue.
2022-07-21 16:41:51 +02:00
d431b1416b EEVEE-Next: Add back option to disable TAA (Viewport Denoising 2022-07-21 16:41:51 +02:00
b0f9639733 Fix crash due to improper handling of new library runtime name_map data on read/write.
Code handling read/write of libraries is still particular... but trying
to call `library_runtime_reset` on a random address at readtime was an
obvious mistake I should have caught during review :(

Regression from rB7f8d05131a77.
2022-07-21 16:39:07 +02:00
396b7a6ec8 Spreadsheet: Implement selection filter for curves sculpt mode
The spreadsheet can retrieve the float selection using the same
utilities as curves sculpt brushes. Theoretically this can work in
original, evaluated, and viewer node modes, at least when the
sculpt selection attributes are able to be propagated.

Differential Revision: https://developer.blender.org/D15393
2022-07-21 09:34:48 -05:00
412d93c298 GPU: Fix compilation with WITH_GPU_BUILDTIME_SHADER_BUILDER option 2022-07-21 15:50:35 +02:00
92eb59341c EEVEE-Next: Filter NaN at output to avoid propagation. 2022-07-21 15:50:35 +02:00
9f00e138ac Cleanup: DRW: common_math_geom_lib.glsl: Fix variable name style 2022-07-21 15:50:35 +02:00
e022753d7a EEVEE-Next: Add Temporal-AntiAliasing
The improvements over the old implementation are:
- Improved history reprojection filter (catmull-rom)
- Use proper velocity for history reprojection.
- History clipping is now done in YCoCg color space using better algorithm.
- Velocity is dilated to keep correct edge anti-aliasing on moving objects.

As a result, the 3x3 blocks that made the image smoother in the previous
implementation are no longer visible is replaced by correct antialiasing.

This removes the velocity resolve pass in order to reduce the bandwidth
usage. The velocities are just resolved as they are loadded in the film
pass.
2022-07-21 15:50:35 +02:00
2bad3577c0 DRW: common_math_geom_lib.glsl: Add line_aabb_clipping_dist 2022-07-21 15:50:35 +02:00
4ba6bac2f1 Fix build error in tests binary after previous commit
Also remove an unused include and add a comment,
const, use the math namespace.
2022-07-21 08:30:07 -05:00
63be57307e Cleanup: Rename length parameterization interpolation function
The name makes more sense as an action, other interpolation
methods besides linear probably don't make sense here anyway.
2022-07-21 08:15:06 -05:00
95ab16004d Cleanup: Remove debug print in test 2022-07-21 08:00:30 -05:00
03338e0270 GHOST/Wayland: fix cursor glitch after grabbing while hidden
When the cursor grabbing was disabled, Blender's internal location
(wmWindow.eventstate) kept the location before un-hiding.

This caused the paint cursor to show in the wrong location after
adjusting the color wheel for e.g.
2022-07-21 21:47:41 +10:00
a06b04f92d Cleanup: Simplify relation flags assignment 2022-07-21 12:54:35 +02:00
2034e8c42d Geometry Nodes: add debug check for whether AttributeWriter.finish is called
Calling `finish` after writing to generic attributes is currently necessary for
correctness. Previously, this was easy to forget. Now there is a check for this
in debug builds.
2022-07-21 12:47:44 +02:00
538da79c6d Curves: fix applying materials when applying modifier
The issue was that geometry nodes was run on the original curves,
and set a pointer to an evaluated material id on it. The fix is to not
mix up original and evaluated data by making sure that geometry nodes
does not modify the original data.
2022-07-21 12:23:38 +02:00
d099e0d2a4 Cleanup: Make automated code check happy.
- Assert that one of the thwo branches in
  `id_override_library_create_hierarchy` are always processed.
- Init success value regardless.
2022-07-21 12:18:57 +02:00
f7252e9692 Cleanup: Unused forward declaration 2022-07-21 12:16:31 +02:00
10b048fd9e Fix T99885: Invalid dependency graph state when curves surface is invisible
Differential Revision: https://developer.blender.org/D15510
2022-07-21 11:26:36 +02:00
Bastien Montagne
ee3facd087 LibOverride: support 'make override' for all selected items.
This commit allows to select several data-blocks in the outliner and
create overrides from all of them, not only the active one.

It properly creates a single hierarchy when several IDs from a same
hierarchy root data are selected.

Reviewed By: Severin

Differential Revision: https://developer.blender.org/D15497
2022-07-21 10:18:43 +02:00
0dcee6a386 Fix T99733: Objects with driven visibility are evaluated when not needed
The issue was caused by the fact that objects with driven or animated
visibility were considered visible by the dependency graph evaluation.

This change makes it so the dependency graph evaluation is aware of
visibility which might be changing. This is achieved by evaluating the
path of the graph which affects objects visibility and adjusts to it
before evaluating the rest of the graph.

There is some time penalty to this, but there does not seem to be a
way to fully avoid this penalty.

With the production shot from the heist project the FPS drops by a
tenth of a frame (~9.4 vs ~9.3 fps) when adding a driver to an object
which keeps it visible. Note that this is a bit hard to measure since
the FPS fluctuates quite a bit throughout the playback. On the other
hand, having a driver on a visibility of a heavy object from character
and setting visibility to false gives big speedup.

Also worth noting that there is no penalty at all when there are no
animated visibilities in the scene.

Differential Revision: https://developer.blender.org/D15498
2022-07-21 09:49:16 +02:00
4089b7b80b Depsgraph: Clear operation evaluation flags early on
The goal is to make it possible to evaluate the graph in multiple
passes without evaluating the same node multiple times.

Currently should not be any functional changes.
2022-07-21 09:48:59 +02:00
d6faee2824 Cleanup: format 2022-07-21 17:45:36 +10:00
2eeedbbca9 Cleanup: add ISMOUSE_MOTION macro
Replace verbose ELEM(..) usage, now each kind of mouse event has it's
own macro.
2022-07-21 16:23:33 +10:00
7a73685460 Fix WM_event_type_mask_test ignoring wheel and gesture events
WM_event_type_mask_test checks assumed ISMOUSE macro worked for any
kind of mouse event when it only accepted buttons & motion.

Now ISMOUSE checks for any kind of mouse event,
use ISMOUSE_BUTTON/WHEEL/GESTURE for more specific checks.
2022-07-21 16:07:11 +10:00
095b8d8688 WM: replace ISMOUSE with ISMOUSE_BUTTON
The ISMOUSE macro was used in situations only button events
needed to be checked.

The only functional difference would be MOUSEMOVE events were
previously accepted for these checks.
2022-07-21 15:54:39 +10:00
4ec0a8705b WM: categorize smart-zoom as a gesture
Event handling and the enum definition documents MOUSESMARTZOOM
as a gesture however it wasn't accepted by ISMOUSE_GESTURE,
instead it was added to the ISMOUSE macro.

Move the type check to ISMOUSE_GESTURE.
2022-07-21 15:28:01 +10:00
dd158f1cab Fix failing cycles test from previous commit
Deprecated custom data type CD_MTEXPOLY has inconsistent data usage.

Reviewed By: Campbell Barton
2022-07-21 16:28:56 +12:00
c171e8b95c Fix T90620: Ignore missing UV data caused by corrupt .blend file
Add crash protection and partial recovery for corrupt .blend files,
particularly for missing UV data.

Differential Revision: https://developer.blender.org/D15489
2022-07-21 15:24:38 +12:00
46a2592eef Cleanup: spelling in comments, typos in tool-tips 2022-07-21 13:21:53 +10:00
e75adb979b Fix T99678: Crash applying non-existent modifiers
Regression in [0] accessed the modifier type before NULL check.

[0]: 78fc5ea1c3
2022-07-21 12:52:24 +10:00
9f68369247 Fix T99687: Cloth filter crash
The code was failing to exclude the sculpt object from
the list of collision objects.
2022-07-20 15:17:07 -07:00
eb281e4b24 Fix T99878: Deleting curves or points removes anonymous attributes
Use the attribute API instead of the CustomData API, to correctly
handle anonymous attributes and simplify the code. One non-obvious
thing to note is that the type counts are recalculated by the "finish"
function of the `curve_type` attribute, so they don't need to be copied
explicitly. Also, the mutable attribute accessor cannot be an reference
if we want to give it an rvalue, which is convenient in this case.
2022-07-20 16:40:05 -05:00
fe108d85b4 Cleanup: Remove unused function 2022-07-20 14:30:44 -05:00
d34f8ac3d9 Cleanup: Remove unnecessary handling of normals for fluid colliders
The normals are transformed, but not used. It looks like this logic was
just copied from below where the mesh is transformed for creating
emitters, which do use vertex normals.
2022-07-20 13:18:03 -05:00
5d4574ea0e Fix T99340: Image.frame_duration returning wrong value when image not loaded
The logic here was broken in d5f1b9c, it should load the image first.
2022-07-20 18:23:03 +02:00
c4d8e28aa7 UI: Remove redundant view reference in view items
The new view item base class already holds a reference to the view, no
need to have one in the derived class as well.
2022-07-20 17:16:15 +02:00
0c6ae51d9f Fix missing registration of grid view items in the view 2022-07-20 17:16:15 +02:00
712960cefd Cleanup: use BLI_strncpy instead of strcpy
Using `strcpy` resulted in `stringop-truncation` warnings for me.
2022-07-20 16:08:02 +02:00
3ea91cecc9 Cleanup: remove unused get_cage_mesh parameter
All callers passed `false` for this parameter, making it more confusing
than useful. If this functionality is needed again in the future, a separate
function should be added.

Differential Revision: https://developer.blender.org/D15401
2022-07-20 15:57:16 +02:00
Wannes Malfait
7561183830 Fix T99667: regression in Delete Geometry node
Differential Revision: https://developer.blender.org/D15445
2022-07-20 15:49:50 +02:00
29c68e2523 Fix T99869: Edge crease no longer working
Missed in d14c2d549b
2022-07-20 10:28:23 -03:00
a814c7091b Fix T99847: Dragging image from Image Editor to Node Editor broken
Oversight in b0da080c2c. The `session_uuid` operator property wouldn't
be checked by the invoke callback, and if neither the `filepath` nor the
`name` property were set, the File Browser would open.
2022-07-20 14:54:32 +02:00
7f8d05131a IDManagement: Speedup ID unique name assignment by tracking used names/basenames/suffixes
An implementation of T73412, roughly as outlined there:

Track the names that are in use, as well as base names (before
numeric suffix) plus a bit map for each base name, indicating which
numeric suffixes are already used. This is done per-Main/Library,
per-object-type.

Timings (Windows, VS2022 Release build, AMD Ryzen 5950X):

- Scene with 10k cubes, Shift+D to duplicate them all: 8.7s -> 1.9s.
  Name map memory usage for resulting 20k objects: 4.3MB.
- Importing a 2.5GB .obj file of exported Blender 3.0 splash scene
  (24k objects), using the new C++ importer: 34.2s-> 22.0s. Name map
  memory usage for resulting scene: 8.6MB.
- Importing Disney Moana USD scene (almost half a million objects):
  56min -> 10min. Name map usage: ~100MB. Blender crashes later on
  when trying to render it, in the same place in both cases, but
  that's for another day.

Reviewed By: Bastien Montagne
Differential Revision: https://developer.blender.org/D14162
2022-07-20 14:27:14 +03:00
8d69c6c4e7 Constraints: add checks to specially handle the custom space target.
- The custom space target never needs B-Bone data (used by depsgraph).
- When drawing the relationship lines use the space matrix directly.
- Don't use the custom target to control the target space type dropdown.

Differential Revision: https://developer.blender.org/D9732
2022-07-20 14:18:17 +03:00
e6855507a5 Constraints: add missing calls to initialize custom space.
Add calls to a few locations that look like they may need to
initialize the Custom Space matrix, i.e. generally any place
that computes target matrices.

Differential Revision: https://developer.blender.org/D9732
2022-07-20 14:18:17 +03:00
054a169be0 Use appropriate context for the DopeSheet Action Custom Properties panel.
Refactor D14646 to use context.active_action for the Action
Custom Properties panel, matching the already existing Action panel.

This has the advantage that it allows access to the properties of
any actions with channels visible in the Dope Sheet, e.g. Shape Keys,
Materials etc; while using just the active object is limited to just
the object animation.

Also move both panels from Item to the Action tab.

Differential Revision: https://developer.blender.org/D15288
2022-07-20 14:18:17 +03:00
ae49e0e8be Cleanup: unused parameter in own recent commit rB92ca920c52b9. 2022-07-20 11:09:16 +02:00
Damien Picard
c48dc61749 I18n: fixes to add-on message extraction
This commit fixes several issues in add-ons UI messages extraction code:

- In multi-file modules, the script would crash because it tried to write to
  the dir instead of a `translations.py` file;
- The add-on message extraction works by enabling the add-on, getting all
  messages; disabling the add-on, getting all messages; then comparing the
  two message sets. But often a bug happens where a class gets a
  description from somewhere else in memory. I couldn’t debug that, so a
  workaround is to check that the message isn’t a corrupted one before
  removing it;
- `printf()` doesn't exist in Python and would crash the script;
- `self.src[self.settings.PARSER_PY_ID]` can be replaced by `self.py_file`
  in class `I18n`, since a property exists to do that;
- At one point a generator was printed instead of its values, so let's
  unpack the generator to get the values. Maybe the print could be
  deleted entirely;
- Use SPDX license identifier instead of GPL license block, to be more in
  line with other scripts from the codebase.

Reviewed By: mont29

Differential Revision: https://developer.blender.org/D15474
2022-07-20 11:05:07 +02:00
Bastien Montagne
92ca920c52 Add a 'Apply and Delete All' operation to shapekeys.
Adds a new option to the 'Delete ShpaKeys' operator, which first applies
the current mix to the object data, before removing all shapekeys.

Request from @JulienKaspar from Blender studio.

Reviewed By: JulienKaspar

Differential Revision: https://developer.blender.org/D15443
2022-07-20 10:55:08 +02:00
ecf4f4a71f Curves: fix uninitialized curve type when adding new curves 2022-07-20 10:47:23 +02:00
c3b9a4e001 Cleanup: Access attributes with new API instead of geometry components
Remove the boilerplate of using a local geometry component just to use
the attribute API that was necessary before b876ce2a4a.
2022-07-19 22:34:32 -05:00
215f805ce6 Curves: Remove use of CurveEval in sculpt brushes
This commit removes the use of PolySpline for resampling curves and
replaces it with the length parameterization utility for that purpose.
I didn't test performance, but I would expect the shrinking to be
slightly faster because I reused some arrays to avoid allocating
them for every curve. I noted some potential improvements in
the "add curves" function.

Differential Revision: https://developer.blender.org/D15342
2022-07-19 21:48:32 -05:00
2551cf9087 Curves: Port fillet node to the new data-block
This commit ports the fillet curves node to the new curves data-block,
and moves the fillet node implementation to the geometry module to help
separate the implementation from the node.

The changes are similar to the subdivide node or resample node. I've
resused common utilities where it makes sense, though some things like
the iteration over attributes can be generalized further. The node
is now multi-threaded per-curve and inside each curve, and some buffers
are reused per curve to avoid many allocations.

The code is more explicit now, and though there is more boilerplate to
pass around many spans, the more complex logic should be more readable.

Differential Revision: https://developer.blender.org/D15346
2022-07-19 18:50:27 -05:00
5d6e4822d8 Cleanup: Combine geometry null checks in if statements
Testing if components or virtual arrays are null in the same line they
are retrieved can make this boilerplate code a bit easier to read.
2022-07-19 18:29:23 -05:00
40ffb94ab4 Cleanup: Use generic utility for copying compressed attribute
In the future, `materialize_compressed_to_uninitialized_threaded`
could be moved somewhere else and reused.
2022-07-19 18:16:12 -05:00
410a6efb74 Point Cloud: Remove redundant custom data pointers
Similar to e9f82d3dc7, but for point clouds instead.

Differential Revision: https://developer.blender.org/D15487
2022-07-19 18:06:56 -05:00
e9f82d3dc7 Curves: Remove redundant custom data pointers
These mutable pointers present problems with ownership in relation to
proper copy-on-write for attributes. The simplest solution is to just
remove them and retrieve the layers from  `CustomData` when they are
needed. This also removes the complexity and redundancy of having to
update the pointers as the curves change. A similar change will apply
to meshes and point clouds.

One downside of this change is that it makes random access with RNA
slower. However, it's simple to just use the RNA attribute API instead,
which is unaffected. In this patch I updated Cycles to do that. With
the future attribute CoW changes, this generic approach makes sense
because Cycles can just request ownership of the existing arrays.

Differential Revision: https://developer.blender.org/D15486
2022-07-19 18:01:04 -05:00
Pratik Borhade
28985ccc05 Fix T99583: Missing update for option in particle edit mode
Missing Ui refresh when property is accessed through shortcut.
Use RNA_def_property_update to solve this.

Differential Revision: https://developer.blender.org/D15431
2022-07-19 14:20:44 -05:00
43d04c7eeb UI Code Quality: Move eyedropper files to own folder
Part of T98518
2022-07-19 19:33:38 +02:00
Tomek Gubala
3b7ac10d62 UV: add Snap Cursor to Origin
Similar to snapping to the world origin in the 3D viewport. This can be found
in the Shift+S pie menu and UV > Snap menu.

Differential Revision: https://developer.blender.org/D15055
2022-07-19 19:29:03 +02:00
75e62df429 Cleanup: compiler warning 2022-07-19 19:22:13 +02:00
cd478fbfb3 Fix error printed in console when running Shade Flat operator
Only the Shade Smooth operator has autosmooth settings.
2022-07-19 19:22:13 +02:00
edc89c7f46 Fix build error when not using unity build 2022-07-19 19:22:13 +02:00
d14c2d549b Fix T99643: Vertex Crease fails with symmetry
Create a transform conversion type that only considers the Vertex
Custom Data.

This reduces the complexity of converting Meshes and slightly
optimizes the transformation.
2022-07-19 14:13:00 -03:00
597955d0a8 Cleanup: Remove compile option for curves object
After becb1530b1 the new curves object type isn't hidden
behind an experimental flag anymore, and other areas depend on this,
so disabling curves at compile time doesn't make sense anymore.
2022-07-19 12:10:45 -05:00
16b145bc62 Cleanup: Improve API and documentation of interface_view.cc
File documentation was outdated and could use general improvement.
Function names didn't really reflect the level they are operating on.
2022-07-19 18:04:03 +02:00
fb9dc810f1 UI Code Quality: Move view related files to own folder
Part of T98518.
2022-07-19 18:04:03 +02:00
Amélie Fondevilla
801513efa0 Fix T99732: Crash on F3 in the dopesheet
Adding the `FCURVESONLY` filter in the filter function of the Grease
Pencil dopesheet prevents calls to F-curves related functions to grease
pencil channels, thereby fixing the crash.

Reviewed By: antoniov, sybren

Maniphest Tasks: T99732

Differential Revision: https://developer.blender.org/D15490
2022-07-19 17:49:10 +02:00
87ae10a050 Curves: Hide snapping menu in curves sculpt mode
The menu/popover doesn't affect anything in the mode, and precision
operations that would use snapping are meant for edit mode anyway.
2022-07-19 10:45:01 -05:00
35b4e3a350 RNA: Don't allocate empty char pointer properties
Instead of allocating a single 0 char, set the `char *` DNA pointer to
null. This avoids the overhead of allocating and copying single-bytes.

rBeed45b655c9f didn't do this for safety reasons, but I checked the
existing uses of this behavior in DNA/RNA. Out of 43 total `char *`
members, this change only affects 7 recently added properties.
For a complete list, see the patch description.

Differential Revision: https://developer.blender.org/D14779
2022-07-19 10:30:19 -05:00
c771dd5e9c Depsgraph: Make animated properties API receive const ID
Semantically it is more correct as the cache does not modify the ID.

There is need to do couple of const casts since the BKE (which is in C)
does not easily allow to iterate into f-curves of const ID.

Should be no functional changes.
2022-07-19 17:22:53 +02:00
6a1ab4747b Geometry Nodes: Copy parameters when copying a curves data-block
Previously, things like materials, symmetry, and selection options
stored on `Curves` weren't copied to the result in nodes like the
subdivide and resample nodes. Now they are, which fixes some
unexpected behavior and allows visualization of the sculpt mode
selection.

In the realize instances and join nodes the behavior is the same as
for meshes, the parameters are taken from the first (top) input.

I also refactored some functions to return a `CurvesGeometry` by-value,
which makes it the responsibility of the node to copy the parameters.
That should make the algorithms more reusable in other situations.

Differential Revision: https://developer.blender.org/D15408
2022-07-19 10:16:30 -05:00
9246ff373a Metal: Add license header to new files 2022-07-19 17:14:39 +02:00
Jason Fielder
9835d5e58b Metal: MTLUniformBuffer module implementation
Initial implementation.

Authored by Apple: Michael Parkin-White
Ref T96261

Reviewed By: fclem
Differential Revision: https://developer.blender.org/D15357
2022-07-19 17:12:39 +02:00
Jason Fielder
6bba4d864e Metal: MTLQueryPool implementation adding support for occlusion queries.
When a query begins, the current visibility result buffer needs to be
associated with the currently active Render Pass. The MTLContext and
MTLCommandBuffer are responsible for ensuring new render pass objects are
created if the visibility state changes.

Authored by Apple: Michael Parkin-White
Ref T96261

Reviewed By: fclem

Maniphest Tasks: T96261

Differential Revision: https://developer.blender.org/D15356
2022-07-19 17:02:15 +02:00
3370c1a8a7 Cleanup: Add comment for geometry nodes lazyness 2022-07-19 09:54:20 -05:00
ad5e3d30a2 Nishita sky: Increase elevation range
The Nishita sky texture currently only allows moving the sun to the zenith.
The problem is if you want to animate the passing of a full night-day-night
cycle. Currently it's not easy to do due to this limitation.

The patch makes it so users can easily animate the sun moving from sunrise
to sunset by expanding the max sun elevation to go 360° instead of 90°.

Reviewed By: fclem
Differential Revision: https://developer.blender.org/D13724
2022-07-19 16:36:57 +02:00
2e3fb58128 Cleanup: Apply clang-format 2022-07-19 16:33:09 +02:00
5bee991132 UI: Port view item features to base class, merge view item button types
No user visible changes expected.

Merges the tree row and grid tile button types, which were mostly doing
the same things. The idea is that there is a button type for
highlighting, as well as supporting general view item features (e.g.
renaming, drag/drop, etc.). So instead there is a view item button type
now. Also ports view item features like renaming, custom context menus,
drag controllers and drop controllers to `ui::AbstractViewItem` (the new
base class for all view items).

This should be quite an improvement because:
- Merges code that was duplicated over view items.
- Mentioned features (renaming, drag & drop, ...) are much easier to
  implement in new view types now. Most of it comes "for free".
- Further features will immediately become availalbe to all views (e.g.
  selection).
- Simplifies APIs, there don't have to be functions for individual view
  item types anymore.
- View item classes are split and thus less overwhelming visually.
- View item buttons now share all code (drawing, handling, etc.)
- We're soon running out of available button types, this commit merges
  two into one.

I was hoping I could do this in multiple smaller commits, but things
were quite intertwined so that would've taken quite some effort.
2022-07-19 16:31:23 +02:00
348ec37f52 UI: Add AbstractViewItem base class
No user visible changes expected.

Similar to rBc355be6faeac, but for view items now instead of the view.
Not much of the item code is ported to use it yet, it's actually a bit
tricky for the most part. But just introducing the base class already
allows me to start unifying the view item buttons (`uiButTreeRow` and
`uiButGridTile`). This would be a nice improvement.
2022-07-19 16:31:23 +02:00
Colin Basnett
2f834bfc14 Fix T97559: Undoing of NLA strip duplication requires two undo steps
Fix the issue where undoing a "duplicate NLA strip" operation would
require two undo steps.

The cause of this was that the operator was not using the operator macro
system to combine both the duplication and the translate operators into
one. Instead, the old code was simply manually invoking invoking the
translate operator after the duplicate operator had completed.

This patch requires the default keymap to be modified to include the two
new macro operators, `NLA_OT_duplicate_move` and
`NLA_OT_duplicate_linked_move` in favour of the old keymap that simply
called `NLA_OT_duplicate` and passed along a `linked` argument.

`duplicate_move` and `duplicate_move_linked` are two different enough
operations to justify having their own operators from user's
point-of-view, especially since we cannot yet have different tool-tips
based on an operator's settings.

Reviewed By: sybren, mont29

Differential Revision: https://developer.blender.org/D15086
2022-07-19 16:07:30 +02:00
Colin Basnett
4812eda3c5 Animation RNA: Add clear() method to FCurveKeyframePoints
Add `FCurveKeyframePoints.clear()` method to delete all keyframe points
from an FCurve.

Reviewed By: sybren

Differential Revision: https://developer.blender.org/D15283
2022-07-19 15:58:37 +02:00
2232855b50 Curves: align surface and curves object in Empty Hair operator
Without this, symmetry does not work by default when the surface
object was not at the same location as the 3d cursor.
2022-07-19 15:49:45 +02:00
95fd7c3679 Depsgraph: Cleanup, Make variable less ambiguous and more clear 2022-07-19 15:27:20 +02:00
bc6b612d8b Depsgraph: Make variable naming more clear
Disambiguate from nodes visibility flags.
2022-07-19 15:25:49 +02:00
Ethan-Hall
44f1495b57 EEVEE: use mipmaps of compressed textures (DDS)
Currently Blender generates mipmaps that override the existing ones.
This patch disables generating new mipmaps for compressed textures.

Reviewed By: fclem

Differential Revision: https://developer.blender.org/D14459
2022-07-19 15:20:53 +02:00
e8465f941c Depsgraph: Cleanup, use nested namespace definition 2022-07-19 14:44:07 +02:00
835203fde8 Depsgraph: Localize synchronization component visibility handling
Move it from generic visibility handling to the synchronization
component node implementation. Should be no functional changes.
2022-07-19 14:36:36 +02:00
73f8a7ca0a Depsgraph: Cleanup, comments wrapping and spacing between lines
Should make it easier to read. No functional changes expected.
2022-07-19 14:25:02 +02:00
6d2100f7de Depsgraph: Introduce operation code for visibility operation
No functional changes, just makes code more semantically clear.
2022-07-19 13:00:19 +02:00
99faebfca6 Depsgraph: Cleanup, don't mic static function and anonymous namespace 2022-07-19 12:51:24 +02:00
2280a71f90 Depsgraph: Refactor evaluation into smaller reusable functions
Should be no functional changes.
2022-07-19 12:41:47 +02:00
9b2b61a07b Depsgraph: Cleanup, use nested namespace definition 2022-07-19 11:40:18 +02:00
d3c063188e Depsgraph: Make name and name tag optional in component node
Matches the builder API, making some code less verbose.
2022-07-19 11:31:44 +02:00
ff98b5eaa8 Depsgraph: Clarify comment in the component node 2022-07-19 11:29:00 +02:00
e00a027c1e Depsgraph: Use single task pool during evaluation
Not sure why multiple pools were created: the pool should be able to
handle two sets of tasks.

Perhaps non-measurable improvement in terms of performance but this
change simplifies code a bit.
2022-07-19 11:18:30 +02:00
533a5a6a8c Fix T99785: Make Principled Hair IOR input behave like other IOR sliders
Was accidental regression in rBed9b21098dd27bf9364397357f89b4c2648f40c2

Remove the input slider's PROP_FACTOR subtype in favor of the default to
align with other IOR sliders. This provides much better control when
dragging the value with the mouse.

Differential Revision: https://developer.blender.org/D15477
2022-07-18 20:38:19 -07:00
bbf87c4f75 Fix T99737: Dropping files fails with Wayland
Drop events ignored the cursor coordinates, under the assumption that
cursor motion events would also be sent to update the cursor location.

This depended on the behavior of the compositor, it failed for Sway
but worked for Gnome-shell & River.

Resolve by making use of the drop events cursor coordinates.
2022-07-19 13:33:02 +10:00
7ebd1f4b79 Cleanup: quiet compiler warnings 2022-07-19 13:32:53 +10:00
37922eab90 Fix T99794: regression from uv unwrap selected
Restore only_selected_faces flag inadvertently changed by c0e4532331

Differential Revision: https://developer.blender.org/D15480
2022-07-19 13:26:24 +12:00
135e530356 Fix T99781: uv minimize stretch now unflips flipped faces
Add a small gradient to flipped faces proportional to length of edges.

Differential Revision: https://developer.blender.org/D15475
2022-07-19 10:26:28 +12:00
Henrik Dick
d175eb6c30 Fix Text Editor highlight of assert and async
Due to the ordering of the checks, assert and async were not highlighted
in the editor, even though they were in the list of keywords.

Differential Revision: http://developer.blender.org/D15483
2022-07-18 23:33:30 +02:00
8358cc7963 Fix wrong alpha for scene linear byte images during texture painting
Make the update logic consistent with the case where the initial texture is
created. Also fixes a wrong assert.

Thanks Clément for spotting this.
2022-07-18 17:40:48 +02:00
cd21022b78 Context: implement an active_action property that returns a single action.
Although e.g. in the dopesheet there is no specific concept of
active action, displaying panels requires singling out one action
reference. It is more efficient and clearer to implement this
natively in the context rather than using selected_visible_actions[0].

- In the Action Editor the action is taken from the header.
- In the Dope Sheet the first selected action is chosen, because
  there is no concept of an active channel or keyframe.
- In the Graph Editor the action associated with the active curve
  is used, which should also be associated with the active vertex.
  This case may be different from selected_visible_actions[0].

Differential Revision: https://developer.blender.org/D15412
2022-07-18 17:44:46 +03:00
935b7a6f65 Context: implement indexing for list properties in path_resolve.
The real RNA path_resolve method supports indexing lists,
but the python version on the Context object does not. This
patch adds the missing feature for completeness.

Differential Revision: https://developer.blender.org/D15413
2022-07-18 17:38:00 +03:00
1f8567ac68 Fix T99750: crash with file output node, after image colorspace saving changes 2022-07-18 15:50:39 +02:00
757041560f Build: update Embree to 3.13.4, enable Neon2x on Arm
* Allows Apple Silicon machines to use 8-wide BVH, which the release notes
  mention give an 8% performance boost.
* An update to this version is also required for OpenPGL.

This patch includes contributions from Jason Fielder and Sebastian Herholz.

Ref D15286, T98555

Differential Revision: https://developer.blender.org/D15482
2022-07-18 15:36:34 +02:00
3407ed5f9b Cleanup: change internal Cycles compact BVH default to match UI 2022-07-18 15:34:13 +02:00
Damien Picard
dec8854bf3 I18n: translate add node operator tooltips
The tooltips from the Add Node menu were extracted, but not translated.

Reviewed By: mont29

Differential Revision: https://developer.blender.org/D15467
2022-07-18 15:10:08 +02:00
Jun Mizutani
47f3b53756 Fix T99742: crash when generating rigify rigs, after recent changes
Differential Revision: https://developer.blender.org/D15473
2022-07-18 14:47:48 +02:00
c7f788b877 Subdiv: remove unused GPU device choice, fix crash with libepoxy on init
openSubdiv_init() would detect available evaluators before any OpenGL context
exists, causing a crash with libepoxy. This test however is redundant as we
already check the requirements on the Blender side through the GPU API.

To simplify things, completely remove the device detection in the opensubdiv
module and reduce the evaluators to just CPU and GPU. The plan here is to move
to the GPU module abstraction over OpenGL/Metal/Vulkan and so all these
different backends no longer make sense.

This also removes the user preference for OpenSubdiv compute device, which was
not used for the new GPU subdivision implementation.

Ref D15291

Differential Revision: https://developer.blender.org/D15470
2022-07-18 13:59:08 +02:00
3c016fbfd0 Fix error indenting new-lines in generated RST API docs
New-lines in RNA type descriptions caused invalid RST indentation.

This resolve the error noted by @nutti in D15481.
2022-07-18 20:00:21 +10:00
cd1e4ae448 Fix T99644: Anchored brush mode fails for negative brushes
The stroke code now supports raycasting the original mesh.
This fixes anchored mode not working for negative brushes,
which might move the mesh out of the initial mouse cursor
position.
2022-07-16 17:27:25 -07:00
9a14887905 Sculpt: Fix scene spacing mode (phase 1)
The scene spacing code was failing to
check if a raycast failed, which can happen
when sculpting the edges of objects in negative
mode.

Note I removed what I suspect was a hack put
in to fix this, spacing was clamped
to 0.001 scene units.

Scene spacing mode is actually quite broken,
so it will be fixed in a series of phases.
2022-07-16 16:45:41 -07:00
d136a996ca Audaspace: minor formatting fix for last commit. 2022-07-16 22:20:08 +02:00
Colin Basnett
1e4c557d82 Fix T99039: bpy.ops.sound.mixdown returns indecipherable error
Fix for {T99039}.

The problem was that `AUD_mixdown` and `AUD_mixdown_per_channel` were returning pointers to freed memory.

Two key changes are made:
1. The return value of those functions now simply return a bool as to whether the operation succeeded, instead of an optional error string pointer.
2. The error string buffer is now passed into the function to be filled in case an error occurs. In this way, the onus of memory ownership is unamibiguously on the caller.

Differential Revision: https://developer.blender.org/D15260
2022-07-16 22:14:19 +02:00
0a8d21e0c9 PyAPI: re-enable the "bgl" module for headless builds
Instead of removing the `bgl` module, set all it's functions to stubs
so importing `bgl` or any of it's members doesn't raise an error.

This avoids problems for scripts that import bgl but don't call it's
functions when running in background mode.
2022-07-16 17:30:17 +10:00
49babc7caa Cleanup: early exit MEM_lockfree_freeN when called with NULL pointer
Simplify logic for freeing a NULL pointer. While no null-pointer
de-reference was performed, this wasn't as so obvious as the pointer
was passed to MEM_lockfree_allocN_len before checking for NULL.

NOTE: T99744 claimed the a NULL pointer free was a vulnerability,
while I can't see evidence for this - exiting early makes it clearer
the memory isn't accessed.

*Details*

- Add MEMHEAD_LEN macro, avoids redundant NULL check.
- Use "UNLIKELY(..)" hint's for error cases
  (freeing NULL pointer and checking if `leak_detector_has_run`).
2022-07-16 17:23:42 +10:00
f76b537d48 Fix T99744: NULL pointer free with corrupt zSTD reading 2022-07-16 16:32:36 +10:00
bf49e6040c Fix error in assertion after 92a99c1496 2022-07-16 16:12:48 +10:00
b985437283 Fix workbench background render broken after recent changes from D15463
For Eevee the light baking can initialize OpenGL earlier, but for workbench we
can't assume the backend exists here already.
2022-07-15 20:10:42 +02:00
92a99c1496 Fix Eevee backround render crash after recent changes from D15463
Backend initialization needs to be delayed until after the OpenGL context
is created. This worked fine in foreground mode because the OpenGL context
already exists for the window at the point GPU_backend_init_once was called,
but not for background mode.

Create the backend just in time in GPU_context_create as before, and
automatically free it when the last context id discarded. But check if any
GPU backend is supported before creating the OpenGL context.

Ref D15463, D15465
2022-07-15 19:11:07 +02:00
5152c7c152 Cycles: refactor rays to have start and end distance, fix precision issues
For transparency, volume and light intersection rays, adjust these distances
rather than the ray start position. This way we increment the start distance
by the smallest possible float increment to avoid self intersections, and be
sure it works as the distance compared to be will be exactly the same as
before, due to the ray start position and direction remaining the same.

Fix T98764, T96537, hair ray tracing precision issues.

Differential Revision: https://developer.blender.org/D15455
2022-07-15 18:46:24 +02:00
bb376da6df Fix Cycles MetalRT error after recent specialization changes 2022-07-15 18:28:13 +02:00
03aeef64d5 Cleanup: compiler warnings 2022-07-15 16:57:04 +02:00
c505f19efe Fix compiler error in debug builds after 1cf465bbc3 2022-07-15 16:52:01 +02:00
1cf465bbc3 Fix GPU backend deleting resources without an active context
This causes an assert with libepoxy, but was wrong already regardless.

Refactor logic to work as follows:
* GPU_exit() deletes backend resources
* Destroy UI GPU resources with the context active
* Call GPU_backend_exit() after deleting the context

Ref D15291

Differential Revision: https://developer.blender.org/D15465
2022-07-15 16:31:28 +02:00
5e1229f253 Fix overly noisy surface deform warning message
An increased number of vertices is not a stopper for the surface
deform modifier anymore. It might still be useful to expose the
message in the UI, but printing error message to the console on
every modifier evaluation makes real errors to become almost
invisible.

Differential Revision: https://developer.blender.org/D15468
2022-07-15 16:30:11 +02:00
82f65d8971 Cleanup: VSE waveform drawing
No functional changes.
2022-07-15 15:52:37 +02:00
011d3c75a7 Cleanup: compiler warning 2022-07-15 15:20:53 +02:00
00dc747702 Fix T99706: Crash rendering with headless builds
When rendering with headless builds, show an error instead of crashing.

Previously GPU_backend_init was called indirectly from
DRW_opengl_context_create, a new function is now called from the window
manager (GPU_backend_init_once), so it's possible to check if the GPU
has a back-end.

This also disables the `bgl` Python module when building WITH_HEADLESS.

Reviewed By: fclem

Ref D15463
2022-07-15 22:16:44 +10:00
Damien Picard
180db0f752 UI: make many modifier strings translatable
This includes:
- new modifier names

It mostly uses `N_` because the strings are actually translated elsewhere.
The goal is simply to export them to .po files.

Most of the new translations were reported in T43295#1105335.

Reviewed By: mont29

Differential Revision: https://developer.blender.org/D15418
2022-07-15 14:15:40 +02:00
914617f8fd Fix (unreported) LibOverride: invalid behaviors when creating (partial) overrides.
The outliner would tagg all existing local IDs (for remap from linked
reference data to newly created overrides) when creating a new override.
This would become critical issue in case there is several existing
copies of the same override hierarchy (leading to several hierarchies
using the same override).

Further more, BKE override creation code would not systematically
properly remapp linked usages to new overrides one whithin the affected
override hierarchy, leading to potential undesired remaining usages of
linked data.
2022-07-15 14:15:40 +02:00
523bbf7065 Cycles: generalize shader sorting / locality heuristic to all GPU devices
This was added for Metal, but also gives good results with CUDA and OptiX.
Also enable it for future Apple GPUs instead of only M1 and M2, since this has
been shown to help across multiple GPUs so the better bet seems to enable
rather than disable it.

Also moves some of the logic outside of the Metal device code, and always
enables the code in the kernel since other devices don't do dynamic compile.

Time per sample with OptiX + RTX A6000:
                                         new                  old
barbershop_interior                      0.0730s              0.0727s
bmw27                                    0.0047s              0.0053s
classroom                                0.0428s              0.0464s
fishy_cat                                0.0102s              0.0108s
junkshop                                 0.0366s              0.0395s
koro                                     0.0567s              0.0578s
monster                                  0.0206s              0.0223s
pabellon                                 0.0158s              0.0174s
sponza                                   0.0088s              0.0100s
spring                                   0.1267s              0.1280s
victor                                   0.0524s              0.0531s
wdas_cloud                               0.0817s              0.0816s

Ref D15331, T87836
2022-07-15 13:42:47 +02:00
da4ef05e4d Cycles: Apple Silicon optimization to specialize intersection kernels
The Metal backend now compiles and caches a second set of kernels which are
optimized for scene contents, enabled for Apple Silicon.

The implementation supports doing this both for intersection and shading
kernels. However this is currently only enabled for intersection kernels that
are quick to compile, and already give a good speedup. Enabling this for
shading kernels would be faster still, however this also causes a long wait
times and would need a good user interface to control this.

M1 Max samples per minute (macOS 13.0):

                    PSO_GENERIC  PSO_SPECIALIZED_INTERSECT  PSO_SPECIALIZED_SHADE

barbershop_interior       83.4	            89.5                   93.7
bmw27                   1486.1	          1671.0                 1825.8
classroom                175.2	           196.8                  206.3
fishy_cat                674.2	           704.3                  719.3
junkshop                 205.4	           212.0                  257.7
koro                     310.1	           336.1                  342.8
monster                  376.7	           418.6                  424.1
pabellon                 273.5	           325.4                  339.8
sponza                   830.6	           929.6                 1142.4
victor                    86.7              96.4                   96.3
wdas_cloud               111.8	           112.7                  183.1

Code contributed by Jason Fielder, Morteza Mostajabodaveh and Michael Jones

Differential Revision: https://developer.blender.org/D14645
2022-07-15 13:40:04 +02:00
5653c5fcdd Cycles: keep track of SVM nodes used in kernels
To be used for specialization in Metal, to automatically leave out unused nodes
from the kernel.

Ref D14645
2022-07-15 13:40:04 +02:00
79da7f2a8f Cycles: refactor to move part of KernelData definition to template header
To be used for specialization on Metal in a following commit, turning these
members into compile time constants.

Ref D14645
2022-07-15 13:40:04 +02:00
Damien Picard
2e70d5cb98 Render: camera depth of field support for armature bone targets
This is useful when using an armature as a camera rig, to avoid creating and
targetting an empty object.

Differential Revision: https://developer.blender.org/D7012
2022-07-15 13:40:04 +02:00
5ddbc14bb2 Render: improve render border operator in image editor
* Snap border to pixels just outside the drawn border, to more easily select
  specific pixels by drawing a border inside them.
* Support cropped border renders.
2022-07-15 13:40:04 +02:00
9ea1b88f0f Cleanup: add utlity function to compute render resolution
Instead of duplicating logic many times.
2022-07-15 13:40:04 +02:00
b8ffd43bd2 Cleanup: make format 2022-07-15 13:40:04 +02:00
4d7c990180 Fix T98061: uv resize with individual origins could break constrain to bounds
Fix unreported: Resize with Constrain To Bounds will now limit one shared scale
value for both U and V instead of calculating separate scale values for each.

To fix T98061, the individual origins (transdata->center) is now used when
that mode is active.

See also: 0e9367fc29

Differential Revision: https://developer.blender.org/D15420
2022-07-15 23:18:13 +12:00
e69c4482f1 I18n: Add suport for labels from modifiers' subpanels.
Was a bit oif a struggle since those functions take a first string which
is not our label, but should work fine now.

Reported/detected as part of D15418.
2022-07-15 11:42:58 +02:00
Martijn Versteegh
8e1323f633 Fix: Move DRW_shgroup_add_material_resources(grp, mat) to after the null-check for grp.
Reviewed By: fclem

Maniphest Tasks: T99646

Differential Revision: https://developer.blender.org/D15436
2022-07-15 11:23:26 +02:00
f4d7ea2cf6 Fix T99606: Regression: TexCoordinate losing precision far away from origin
Same root cause as T99128. The fix also needed to be done in another place.
2022-07-15 11:16:14 +02:00
98f688ac42 GPU: Fix shader builder on hardware that does not have all features 2022-07-15 11:16:14 +02:00
862170c0b1 Cleanup: GPU: Replace NULL by nullptr from C++ files 2022-07-15 11:16:14 +02:00
ca1daf4cda Fix an increasing bottleneck when key press operator is too slow
The goal of this change is to fix an increasing bottleneck of the event
queue handling when there is an operator bound to a key press event and
is taking longer to finish than a key-repeat speed on the system.

Practical example of when it happens is the marker tracking operator in
a single-frame track mode. Quite often artists will hold down Alt-arrow
to track a segment of footage which seems trivial to track. The issue
arises when the Alt-arrow is released: prior to this change it is was
possible that more frames will be tracked. It also seems that redraws
are less smooth.

It is a bit hard to make easily shareable computer-independent test
case. Instead, a synthetic case can be reproduced by adding a 50 ms
sleep in the `text_move_exec()`. In such synthetic case open a long
text in the text editor and hold left/right arrow button to navigate
the cursor. The observed behavior is that seemingly redraws happen
less and less often and cursor travels longer and longer distances
between redraws. The cursor will also keep moving after the buttons
has been released.

The proposed solution is to ignore sequential key-press events from
being added to the event queue. This seems to be the least intrusive
and the most safe approach:

- If the operator is fast enough there will be no multiple press events
  in the queue in both prior and after of this change.

- If the operator is slow enough, clicking the button multiple times
  (i.e. clicking arrow button 3 times in a heavy shot will change the
  scene frame by exactly 3 frames because no events are ignored in
  this case).

- Only do it for key press events, keeping mouse and tabled behavior
  unchanged which is crucial for the paint mode.

Note that this is a bit different from the key repeat tracking and
filtering which is already implemented for keymaps as here we only want
to avoid the event queue build-up and do want to ignore all repeat
events. In other words: we do want to handle as many key presses as the
operator performance allows it without clogging anything.

A possible extension to this change could be a key press counter, so
that instead of ignoring the event we merge it into the last event in
the queue, incrementing some counter. This way if some operator really
needs to know exact number of key repeats it can still access it.

Differential Revision: https://developer.blender.org/D15444
2022-07-15 11:03:00 +02:00
c2715dc416 GPU: Remove USD dependency from shader_builder.
Dependency was added as shader builder depended to blenkernel as an
umbrella, in stead of adding the actual dependencies it required.
2022-07-15 10:54:10 +02:00
63ea0f7581 BLI_bitmap: fix _BITMAP_NUM_BLOCKS to not over-count by one block
For bit counts that were exact multiple of block size, the macro was
computing one block too much.

Reviewed By: Campbell Barton, Bastien Montagne
Differential Revision: https://developer.blender.org/D15454
2022-07-15 10:21:27 +03:00
8fd2b79ca1 BLI_bitmap: ability to declare by-value, and function to find lowest unset bit
In preparation for a larger change (D14162), some BLI_bitmap
functionality that could be submitted separately:

- Ability to declare a fixed size bitmap by-value, without extra
  memory allocation: BLI_BITMAP_DECLARE
- Function to find the index of lowest unset bit:
  BLI_bitmap_find_first_unset
- Test coverage of the above.

Reviewed By: Campbell Barton, Bastien Montagne
Differential Revision: https://developer.blender.org/D15454
2022-07-15 10:20:04 +03:00
d8094f9212 GHOST/Wayland: partial support for updating the UI scale
Partial support for changing the UI scale while Blender is open.

The scale is set but issues with the window size not updating remain.
2022-07-15 15:42:24 +10:00
60f260eb6a GHOST/Wayland: fix error setting the cursor scale
Calculate a scale that's compatible with the cursor size.
Needed so the cursor is always a multiple of scale.
2022-07-15 15:36:21 +10:00
d14d570580 blend_render_info: add check for negative BHead length (corrupt file)
Without this check, corrupt files would raise a Python exception,
now early exit with a useful error.
2022-07-15 14:53:38 +10:00
c8e8f107bf Fix T99711: Eternal loop reading blend file thumbnail
Account for negative BHead length (already handled by blend file loading).
2022-07-15 14:53:38 +10:00
675f6ef089 Cleanup: Use const pointers for ImageSaveOptions and ImageFormatData
Use const pointers to ImageSaveOptions and ImageFormatData for API
parameters where appropriate.

Differential Revision: https://developer.blender.org/D15400
2022-07-14 21:27:58 -07:00
178868cf42 Fix T79304: improve uv island calculation when in edge selection mode
Differential Revision: https://developer.blender.org/D15419
2022-07-15 14:19:48 +12:00
0e9367fc29 Cleanup: separate clipUVTransform into two different functions
No functional changes.

Prep for D15420 / T98061.
2022-07-15 10:44:11 +12:00
b1329d7eaa Fix T99705: fix integer overflow in thumbnail extractor
It was smart enough to check if the buffer had the right
size but neglected to cast to a 64 bit value so it
overflowed.

Differential Revision: https://developer.blender.org/D15457
Reviewed By: brecht
2022-07-14 12:18:35 -06:00
9fedcde750 Modifiers: fix mesh to volume modifier on non-volume objects 2022-07-14 20:05:23 +02:00
bdd0ac5bce Fix on_drag_start handler not getting ID when dragging from Outliner
We would first invoke the dragging, and then set the drag data (like the
ID or the dragged modifier), so the `wmDropBox.on_drag_start()` handler
wouldn't be able to access this. This broke dragging some IDs from the
Outliner, noticed in D15333.

It's now possible to first create/request drag data, extend it, and then
invoke the actual dragging. The normal function to start dragging
returns `void` now instead of `wmDrag *`, so the drag data can't easily
be modified after starting anymore.
2022-07-14 19:21:56 +02:00
1ef686bd26 UI: Tweak layout of File Browser Preferences
* Don't nest "Show Recent Locations" and "Show System Locations" under a
  "Defaults" heading. They are not just a default setting but completely
  hide panels from the UI.
* Use own "Show Locations" heading instead, and remove redundant words
  from labels.
* Move the options to the top of the panel, they are more general since
  they can't be toggled in a File Browser session, and thus have bigger
  impact.

We may want to remove these options in a future major release, I don't
think they are useful.

Agreed on with Pablo Vazquez.
2022-07-14 19:21:22 +02:00
b6de6da59a I18n: Fix regex for messages from BKE_modifier_set_error.
Signature of this function changed at some point, regex to extract
messages from it was no longer working.

Reported/detected as part of D15418.
2022-07-14 18:50:16 +02:00
3b15467e97 Fix T99702: Gpencil Flip strokes did not support multiframe edit
This was a missing feature and this commit solves this.
2022-07-14 16:42:26 +02:00
Olivier Maury
1b5db02a02 Fix Cycles MNEE wrong results with area light spread
When the solve is successful, the light sample needs to be updated since the
effective shading point is now on the last refractive interface. Spread was
not taken into account, creating false caustics.

Differential Revision: https://developer.blender.org/D15449
2022-07-14 16:36:38 +02:00
28c3739a9b Cleanup: replace state flow macros in the kernel with functions 2022-07-14 16:36:38 +02:00
5539fb3121 Cycles: add presets to the Performance panel
With choices Default, Lower Memory and Faster Render. For convenience, and
to help communicate what the various settings do.

Differential Revision: https://developer.blender.org/D15446
2022-07-14 16:36:38 +02:00
02ce29c6ee Improve Tool tip for Add-on search
Differential Revision: https://developer.blender.org/D15411
2022-07-14 16:33:04 +02:00
4b1d315017 Cycles: Improve cache usage on Apple GPUs by chunking active indices
This patch partitions the active indices into chunks prior to sorting by material in order to tradeoff some material coherence for better locality. On Apple Silicon GPUs (particularly higher end M1-family GPUs), we observe overall render time speedups of up to 15%. The partitioning is implemented by repeating the range of `shader_sort_key` for each partition, and encoding a "locator" key which distributes the indices into sorted chunks.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D15331
2022-07-14 14:26:18 +01:00
47d4ce498e Cleanup: minor changes to camera frame fitting
Use const vars & make order of min/max checks consistent.
2022-07-14 22:08:30 +10:00
2d04012e57 Cleanup: spelling in comments
Also remove duplicate comments in bmesh_log.h, caused by automated
comment relocation in [0].

[0]: c4e041da23
2022-07-14 22:02:52 +10:00
9dfabc1de3 Cleanup: remove redundant event->val check for 3D text insertion 2022-07-14 22:01:43 +10:00
93f74299f0 Cleanup: clang-tidy changes to GHOST_SystemX11
Also remove redundant check.
2022-07-14 21:55:46 +10:00
cdd8b96e3b GHOST: remove redundant ascii argument to GHOST_EventKey
Now only the utf8 buffer is used there is no reason to pass both.
2022-07-14 21:54:28 +10:00
eb3e56a36e Fix: Wrong output types for some compositor nodes
The Difference Matte and RGB To BW nodes have a wrong output type. They
should be floats but are of type color.

This is a regression that was introduced during the migration to the
socket builder API in D13266.

Reviewed By: Blendify, fclem

Differential Revision: https://developer.blender.org/D15232
2022-07-14 13:52:44 +02:00
db80cf6ad7 GHOST/X11: avoid redundant utf8 text lookups for release events
The text representation of release events is never used,
so only calculate this for press events.
2022-07-14 21:10:22 +10:00
64e196422e GHOST/X11: Quiet warning about key-release events having their utf8 set
Quiet warning from [0], no functional change as the this information
was always ignored.

Key release events shouldn't have associated text, this was cleared
for wmEvent's, so there is no reason to pass it from GHOST.

[0]: d6fef73ef1
2022-07-14 21:04:16 +10:00
7fa7722350 Cleanup: format, unused argument 2022-07-14 20:53:20 +10:00
6cd30d5ff0 IDManagement: add more ID naming tests
As part of a larger change (https://developer.blender.org/D14162),
adding more test coverage for existing functionality separately.

New tests:
- ids_sorted_by_default
- ids_sorted_by_default_with_libraries
- name_too_long_handling
- create_equivalent_numeric_suffixes
- zero_suffix_is_never_assigned
- remove_after_dup_get_original_name
- name_number_suffix_assignment
- renames_with_duplicates
- names_are_unique_per_id_type
2022-07-14 13:41:43 +03:00
9024ac31be Fix curve drawing crash after changing geometry nodes output.
Using geometry nodes with attributes on a curve object and changing the
output is crashing. This is because the `render_mutex` in the curve
drawing cache is cleared after changes in `curves_batch_cache_init` and
set to null. The cache isn't actually needed currently because all draw
updates are single-threaded, but the new `drw_attributes_merge` function
still tries to access it (this seems to be tolerated on Linux platforms
but crashes on Windows).

Make sure the render_mutex is always initialized after (re-)initializing
the cache.
2022-07-14 11:17:59 +01:00
cb62095c1c Correct error with IME from d6fef73ef1 2022-07-14 20:07:06 +10:00
96cc603037 Geometry Nodes: update curve type counts after realizing instances
The type counts have to be updated eagerly. This was missing from
the realize-instances code before, leading to bugs further down
the line.
2022-07-14 11:49:28 +02:00
c8a07ef663 BLI: fix finding indices from virtual array
The sorting of index vectors assumed that all vectors have
at least one element. Now this is checked for more explicitely.
2022-07-14 11:32:01 +02:00
bcdce4ffd8 Geometry Nodes: fix face corner to edge boolean interpolation
This is a follow up for rB44e530e1b107fd0d91f472f9a58642ab59fd5422
which did not fix the function that interpolates boolean attributes.
2022-07-14 10:47:26 +02:00
44e530e1b1 Geometry Nodes: fix face corner to edge attribute interpolation
Looks like this was wrong all the time.. Luckily, this conversion
is not very common.

Found when testing D15274.
2022-07-14 10:35:59 +02:00
Damien Picard
9d73bbd966 UI: translate tooltips coming from menu descriptions
Many menus get their labels exported to the .po file, but then are not actually translated in the UI.

Before:
{F13283752}

After:
{F13283750}

Reviewed By: mont29

Differential Revision: https://developer.blender.org/D15417
2022-07-14 10:29:10 +02:00
Colin Basnett
8e3879ab52 Cleanup: Rename & refactor several F-curve functions
Rename and refactor several F-curve key manipulation functions, and move
them from `editors` to `blenkernel`.

The functions formerly known as `delete_fcurve_key`,
`delete_fcurve_keys`, and `clear_fcurve_keys` have been moved from
`ED_keyframes_edit.h` to `BKE_fcurve.h` and have been renamed according
to hierarchical naming rules.

Below is a table of the naming changes.

| From | To |
| -- | -- |
| `delete_fcurve_key(fcu, index, do_recalc)` | `BKE_fcurve_delete_key(fcu, index)` |
| `delete_fcurve_keys(fcu)` | `BKE_fcurve_delete_keys_selected(fcu)` |
| `clear_fcurve_keys(fcu)` | `BKE_fcurve_delete_keys_all(fcu)` |
| `calchandles_fcurve()` | `BKE_fcurve_handles_recalc()` |
| `calchandles_fcurve_ex()`| `BKE_fcurve_handles_recalc_ex()` |

The function formerly known as `delete_fcurve_key` no longer takes a
`do_fast` parameter, which determined whether or not to call
`calchandles_fcurve`. Now, the responsibility is on the caller to run
the new `BKE_fcurve_handles_recalc` function if they have want to
recalculate the handles.

In addition, there is now a new static private function called
`fcurve_bezt_free` which sets the key count to zero and frees the key
array. This function is now used in couple of instances of functionally
equivalent code. Note that `BKE_fcurve_delete_keys_all` is just a
wrapper around `fcurve_bezt_free`.

This change was initially spurred by the fact that `delete_fcurve_keys`
was improperly named; this was a good opportunity to fix the location
and naming of a few of these functions.

Reviewed By: sybren

Differential Revision: https://developer.blender.org/D15282
2022-07-14 10:24:32 +02:00
Iliay Katueshenock
77df9d788a Fix T99239: weird behavior in Field on Domain node 2022-07-14 10:05:24 +02:00
Damien Picard
f48fadc953 UI: translate quick favorites menu operator names
Some operator titles were not translated in the quick favorites menu.

Before:
{F13283724}

After:
{F13283725}

Reviewed By: mont29

Differential Revision: https://developer.blender.org/D15416
2022-07-14 10:01:09 +02:00
Damien Picard
1571ee66b5 I18N: Allow translating newly added GP data names, and a missing Surface one. 2022-07-14 10:01:09 +02:00
3935bf255e Fix T99677: crash when convex hull node is used on empty mesh
Fundamental issue is that the attribute api returns none, because
the custom data api returns null for a layer when the size of 0.
This should be improved separately.
2022-07-14 09:57:08 +02:00
411bcf1fe7 Cleanup: simplify 3D text insert, remove checks for ascii escape codes
3D text included checks for escape codes such as \n\r\b which have not
been included in wmEvent.ascii since [0] (2009).

Remove these and use more straightforward logic for overriding the
events text input.

[0] 66437a62a7
2022-07-14 17:04:22 +10:00
b35e33317d Cleanup: update & correct comments for event handling
- Remove references to `ISTEXTINPUT` as any keyboard event with it's
  utf8_buf set can be handled as text input.

- Update references to the key repeat flag.
2022-07-14 16:10:13 +10:00
d6fef73ef1 WM: Remove ASCII members from wmEvent & GHOST_TEventKeyData
The `ascii` member was only kept for historic reason as some platforms
didn't support utf8 when it was first introduced.

Remove the `ascii` struct members since many checks used this as a
fall-back for utf8_buf not being set which isn't needed.
There are a few cases where it's convenient to access the ASCII value
of an event (or nil) so a function has been added to do that.

*Details*

- WM_event_utf8_to_ascii() has been added for the few cases an events
  ASCII value needs to be accessed, this just avoids having to do
  multi-byte character checks in-line.

- RNA Event.ascii remains, using utf8_buf[0] for single byte characters.

- GHOST_TEventKeyData.ascii has been removed.

- To avoid regressions non-ASCII Latin1 characters from GHOST are
  converted into multi-byte UTF8, when building X11 without
  XInput & X_HAVE_UTF8_STRING it seems like could still occur.
2022-07-14 15:59:19 +10:00
816a73891b GHOST/SDL: pass in utf8 buffer for keyboard events
While GHOST/SDL doesn't support non-ASCII text input,
use the UTF8 buffer to be consistent with all other back-ends.

Move the conversion from SDL_KeyboardEvent to ASCII into a function.

Also only lookup this value on key press (not release).
2022-07-14 15:58:46 +10:00
d3374e5337 Fix build and warnings from previous commit. 2022-07-14 16:19:21 +12:00
931779197a Fix T99684: Upgrade Averages Island Scale with options Scale UV and Shear
Differential Revision: https://developer.blender.org/D15421
2022-07-14 15:42:08 +12:00
09a74ff8b6 GHOST/SDL: add support for the key repeat flag
Now all ghost back-ends support the key repeat flag
(accessed as WM_EVENT_IS_REPEAT from wmEvent.flag).
2022-07-14 09:46:58 +10:00
50d832634e Docs: Fix out of order parameters
Fixes T99672
2022-07-13 16:25:57 -04:00
144d9f2b2e Cleanup: Do not use spaces in default data names.
Using white spaces in data names should not be encouraged in general,
better not give wrong example here.

Originally part of D15441.
2022-07-13 17:40:35 +02:00
88fbf0a8fc Fix (studio-reported) bad remapping of libraries.
New remapper code would also fail in some cases when remapping
libraries, similar to the issue yesterday, because ID_LI type had no
mask value.

That would fail to remap `parent` member of a library to NULL when
deleting that parent, leading to a crash e.g. in Outliner tree building
code.

Reported by @JulienKaspar from Blender studio.
2022-07-13 16:11:59 +02:00
ccdf189d3c Documentation: Update Docs for Gizmo
This patch updates the documentation for arguments regarding the `Gizmo`
type.

- Corrected `select_id` doc for draw_preset_ functions. `-1` indicates
  that no selection ID is to be written, but previous docs incorrectly
  specified `0` instead.
- Added missing doc for `target` argument for `target_set_handler`
  function.

Reviewed by: Aaron Carlisle (Blendify)

Differential Revision: https://developer.blender.org/D14834
2022-07-13 08:43:57 -04:00
441dd08dba Expose option for fallback tools keymap in GizmoGroup type
This patch allows new GizmoGroup classes to support tool fallback keymap.

With this patch, when new gizmo groups add `'TOOL_FALLBACK_KEYMAP'` to
its `bl_options`, the fallback tools are added to the group. This
allows a `WorkSpaceTool` (for example) to have selection be a fallback
tool if the user LeftMouse drags away from other gizmos in the group.

Reviewed by: Campbell Barton (campbellbarton)

Differential Revision: https://developer.blender.org/D15154
2022-07-13 08:30:40 -04:00
c484599687 Expose snap options in transform operators
This commit exposes snap options in transform operators. These options
are needed for Python tools to control snapping without requiring the
tool settings to be adjusted.

The newly exposed options are:

- `snap_elements` for choosing which element(s) of target the source
  geometry should snap to (ex: Face Raycast).
- `use_snap_self`, `use_snap_edit`, `use_snap_nonedit`,
  `use_snap_selectable_only` for controlling target selection.
- `use_snap_project` for controlling Face Raycast snapping.
- `use_snap_to_same_target` and `snap_face_nearest_steps` for
  controlling Face Nearest snapping.

Reviewed by: Campbell Barton (campbellbarton)

Differential Revision: https://developer.blender.org/D15398
2022-07-13 07:10:09 -04:00
c8be3d3b27 Fix T99654: Applying Mirror modifier breaks the erase tool
The problem was the new generated strokes were copied from original and the location was offset to mirror, but the internal geometry data was not updated and the collision check done by brushes was not working.

Now, the internal geometry data is recalculated when the modifier is applied.
2022-07-13 12:56:48 +02:00
74888cdbfd Fix (studio-reported) issue in remapping code.
Not clearing runtime remapping data for the new ID as well as the old
one can lead to false stale data there, wichi could e.g. make indirectly
linked data be tagged as directly linked.

This would generate an error report on file write when hapening on
ShapeKey ID, since that type is not allowed to be directly linked.
2022-07-13 11:15:19 +02:00
a084839605 Cleanup: logical order of axis defines, assign variables for readability 2022-07-13 16:42:06 +10:00
b3913d7551 Cleanup: use defines for camera axes for view frame fitting
The values used for axes weren't in any meaningful order, use defines
to improve readability.
2022-07-13 16:18:16 +10:00
9422627155 Fix T99653: "Align Active Camera to Selected" fails with ortho camera
There were two bugs, a regression in [0] and the object-data wasn't
tagged for depsgraph updating.

[0]: 19df0e3cfd
2022-07-13 16:18:14 +10:00
8f543a73ab Fix T99659: Improve UV Island calculation with hidden faces.
Simplify interface, regularize implementation and some light cleanup.

See also: T79304 and D15419.
2022-07-13 11:42:42 +12:00
d0a552b5c6 Fix: set dangling pointer to null
The data has been moved somewhere else, the span should not
keep a pointer to it.
2022-07-12 18:47:51 +02:00
5f09440d5a Cycles: Make not-compact BVH the default for embree
Measurements shown on average a 1.08x speedup for a 1.04x increase in
memory usage which is an acceptable trade off for a default setting,
although discoverability of such settings influencing memory usage could
be improved.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D15429
2022-07-12 18:40:14 +02:00
9f153949f9 Enable "copy to selected" for new Curves modifiers
The operator bpy.ops.object.modifier_copy_to_selected()
does not work for the new Curves objects.
This is because it isn't added to BKE_object_supports_modifiers.

Differential Revision: https://developer.blender.org/D15439
2022-07-12 18:31:33 +02:00
1c382a4940 Curves: improve error checking in deform curves on surface node 2022-07-12 17:10:23 +02:00
02aefa7659 Fix: wrong node name in menu 2022-07-12 17:10:23 +02:00
b767628173 Fix: Memory leaks in indexer code
Reviewed By: Richard Antalik

Differential Revision: http://developer.blender.org/D15376
2022-07-12 16:58:04 +02:00
Khoi Dau
93253d5dcc Fix T99103: crash when displaying or rendering Grease Pencil object
On some hardware/systems, blender may crash when adding, rendering or displaying Grease Pencil objects.

In `/source/blender/draw/engines/gpencil/shaders/gpencil_vert.glsl`, line 35:
```
gpMaterialFlag gp_flag = floatBitsToInt(gp_mat._flag);
```
`gpMaterialFlag` is of type `uint`. This is a mismatched-type assignment that can cause crashes on some hardware/systems with GLSL that do not support implicit type casting.

So use `floatBitsToUint` for type conversion.

Differential Revision: https://developer.blender.org/D15433
2022-07-12 11:34:41 -03:00
d58072caf4 Fix: missing geometry copy before modifying it
A geometry component may reference read-only geometry.
In this case it has to be copied before making changes to it.

This was caused by rBb876ce2a4a4638142.
2022-07-12 16:27:06 +02:00
47dd42485e Cycles: fix and enable JIT oneAPI CentOS7 builds for drivers 23570+
The current specific CentOS7 workaround we have for AoT, which is to
disable __FAST_MATH__ by using -fhonor-nans, now also fixes the
compilation issue for JIT as well since at least driver 23570.
2022-07-12 15:55:32 +02:00
4a445c8dc0 LibOverride: Fix some issues from.revealed by recent previous commit.
rB57097e9a8515 did not properly consider case where you have more than
one override for a same reference linked ID.

Also adds more security checks around shapekeys, since match between
override and its linked reference is never ensured either way (fixes a
crash reported by @Rik from Blender studio).
2022-07-12 15:34:40 +02:00
f72cedffb6 Cleanup: Use interpf instead of repeating the logic
This makes the code clearer.
2022-07-12 10:20:01 -03:00
2d1fe736fa Fix T96238: shrinking to zero doesn't actually scales the radius to zero
Probably to prevent the radius of a point from being stuck at zero,
the `Shrink/Fatten` curve operator sets a minimum value of `0.001`
for all points being transformed.

This is an inconvenience as these points may have been purposely set
to zero on the panel.

And it also doesn't follow the convention seen in other operators
(which keep the value zero).

So remove this limitation.
2022-07-12 10:11:05 -03:00
57097e9a85 Fix T99261: partial LibOverride creation would not properly remap all needed data.
When creating partial overrides, there may also be need to reamap usage
of linked data towards already existing overrides, in newly created
overrides.
2022-07-12 14:39:08 +02:00
RedMser
4344b2bf19 Markers: Make delete confirmation depend on key used
Add a 'Delete Confirmation' operator property to the 'Delete Marker'
operator. This determines whether the user is asked to confirm the
deletion or not.

Defaults so that only {key X} ({key Backspace} for industry compatible
keymap) prompts for deletion, whereas {key Del} does not show the
confirmation popup.

This also makes the default keymap for marker deletion consistent with
the common delete operators (such as objects and keyframes).

Reviewed By: sybren

Differential Revision: https://developer.blender.org/D13818
2022-07-12 13:00:56 +02:00
52b7f2b089 UV: Box and lasso selection for partially intersecting edges
In UV edge mode, box and lasso selections allow edge selections only
when the entire edge is contained within the selection area. This
doesn't consider any edges that partially overlap with the selection
area.

This is  now fixed by adding a second pass, similar to how these
operators work for edit-mesh selections. Now if both operators are
unable to find any edges contained within the selection area, then
they will perform a second pass which checks for edges that partially
intersect with the selection area.

Now edge selection in the UV editor matches edit-mesh edge-selection
when drawing wire-frame.

Resolves T99443.

Ref D15362
2022-07-12 19:50:40 +10:00
bb3a538843 Fix: Incorrect coordinates used in BLI_rct*_isect_segment functions
Ref D15330.
2022-07-12 19:28:26 +10:00
8bd32019ca Fix threading crash due to conflict in mesh wrapper type
A mesh wrapper might be being accessed for read-only from one thread
while another thread converts the wrapper type to something else.

The proposes solution is to defer assignment of the mesh wrapper
type until the wrapper is fully converted. The good thing about this
approach is that it does not introduce extra synchronization (and,
potentially, evaluation pipeline stalls). The downside is that it
might not work with all possible wrapper types in the future. If a
wrapper type which does not clear data separation is ever added in
the future we will re-consider the threading safety then.

Unfortunately, some changes outside of the mesh wrapper file are
to be made to allow "incremental" construction of the mesh prior
changing its wrapper type.

Unfortunately, there is no simplified file which demonstrates the
issue. It was investigated using Heist production file checked at
the revision 1228: `pro/lib/char/einar/einar.shading.blend`. The
repro case is simple: tab into edit mode, possibly few times.

The gist is that there several surface deform and shrinkwrap
modifiers which uses the same target. While one of them is building
BVH tree (which changes wrapper type) the other one accesses it for
read-only via `BKE_mesh_wrapper_vert_coords_copy_with_mat4()`.

Differential Revision: https://developer.blender.org/D15424
2022-07-12 10:26:52 +02:00
6e6da22eb0 Fix: crash when iterating over all attributes 2022-07-12 09:42:19 +02:00
b8d1e576bc Cleanup: use array for internal _bpy methods 2022-07-12 16:11:19 +10:00
ae6a4fcc7a Tests: add test to ensure restricted py-driver execution is working
Add internal function (only used for testing at the moment)
`_bpy._driver_secure_code_test`.

Add test `script_pyapi_bpy_driver_secure_eval` to serves two purposes:

- Ensure expressions that should be insecure remain so when upgrading
  Python or making any changes in this area.

- Ensure new versions of Python don't introduce new byte-codes that
  prevent existing expressions from being executed
  (happened when upgrading from 3.7, see [0]).

[0]: dfa5201763
2022-07-12 16:11:19 +10:00
00c7e760b3 Python: add opcodes for safe py-drivers
The following opcodes have been added, see [0] for details:

- LIST_TO_TUPLE: convert a list to a tuple,
  use for constructing lists/tuples in some cases.

- LIST_EXTEND: use for constructing lists with unpacking.

- SET_UPDATE: use for constructing sets with unpacking.

- CONTAINS_OP: check if `a in b` generally useful.

When writing tests these op-codes where needed for basic operations
and can be safely supported.

Add note why dictionary manipulation op-codes have been left out.

Also restrict namsepace access to anything with an underscore prefix
since these may be undocumented.

[0]: https://docs.python.org/3.10/library/dis.html
2022-07-12 16:05:13 +10:00
2a1d12d7a0 Fix (studio-reported) crash in ID remapping code on rare cases.
Some ID types did not have a filter value, even though they would be
used in remapping code, leading to missing remappings. In that specific
case, shape keys would actually never be properly remapped.

Reproducible in r1230 of
`Heist/pro/animation_test/einar/einar_new_expression_shapes2.blend`,
2022-07-11 19:16:04 +02:00
995c904d00 Fix (unreported) crash in liboverride code on rare cases.
When dealing with 'embedded' IDs (and the like, e.g. shape keys),
liboverride code could fail in case the reference linked data (e.g. a
mesh) would not have a shapekey anymore, while the override mesh would
still have one.

Found while investigating another issue in Heist production file
`Heist/pro/animation_test/einar/einar_new_expression_shapes2.blend`,
r1230.
2022-07-11 19:16:04 +02:00
8ca09e6c5e GPU: add BUIDTIME to WITH_GPU_SHADER_BUILDER
Adds a better name that describes when it is used.
The GPU_SHADER_BUILDER is a buildtime tool for developers
to pre-validate GLSL (and in the overseen future pre-compile to
SpirV). We don't see that this needs to become a required
step in the future so WITH_GPU_BUILDTIME_SHADER_BUILDER
is more descriptive name.
2022-07-11 16:45:07 +02:00
Jeroen Bakker
76d8614236 GPU: Do not allow GPU Shader builder when USD is enabled.
Linking GPU shader builder requires stubs for many functions of the USD library.
We don't want to rely on other modules to update the stubs for a tool that
is only used by GPU developers.

This patch raises an error when both WITH_GPU_SHADER_BUILDER and WITH_USD are
enabled. This reduces the maintenance of updating the stubs when USD API changes.

Reviewed By: LazyDodo

Differential Revision: https://developer.blender.org/D15422
2022-07-11 16:12:36 +02:00
6e426259b4 Fix T99218: light group add button should be disabled when name is empty
Previously it was inactive but still clickable.

Ref D15316
2022-07-11 14:02:38 +02:00
6ca5ac2084 GPU: Update shader builder stubs.
Fixes workflow when using WITH_GPU_SHADER_BUILDER=On.
2022-07-11 13:36:29 +02:00
275419f6fd Fix/Cleanup UI messages. 2022-07-11 12:46:22 +02:00
1c4c904786 Deps Builder: Disable TermInfo and ncurses for DPC++
They are not strictly needed for compilation and disabling them makes
the compiler more portable without any special trickery.

This change aimed to solve problem which currently happens on the API
documentation build which does not have terminfo installed, but needs
to compile Cycles.

Note that the DPC++ is to be re-compiled.
2022-07-11 12:09:09 +02:00
da101118d4 Cleanup: Remove unused operator name storage in UI lists 2022-07-11 11:17:08 +02:00
7357176b57 Fix T99383: Wrong origdata type in color filter 2022-07-11 00:19:53 -07:00
cb39058f2f Fix T94633: Sculpt mode missing check for hidden active object
Note there is a bug in BKE_object_is_visible_in_viewport, it
returns false when the object is in local mode.

The transform operator poll should do a similar test.  That
would allow us to move the test from sculpt_brush_strok_invoke
to SCULPT_mode_poll (at the moment we cannot do this due to
the brush operator falling through to the translate keymap
item in global view3d keymap).
2022-07-10 23:39:45 -07:00
133d398120 PyAPI: add Matrix.is_identity read-only attribute
Add a convenient way of checking if the matrix is an identity matrix.
2022-07-11 12:45:00 +10:00
d51bc8215f GPencil: Dot-dash modifier rename segment bug fix.
This patch fixes naming and renaming issue with dot-dash modifier segment list.

Before: when double clicking and exiting it would append
number at the end regardless of name being changed or not.

Now it works like in other areas.

Authored by: Aleš Jelovčan (frogstomp)

Reviewed By: YimingWu (NicksBest)

Differential Revision: https://developer.blender.org/D15359
2022-07-11 10:13:07 +08:00
d4a4691c0c Cleanup: spelling in comments 2022-07-11 10:38:04 +10:00
a83502f05f Cleanup: remove unused GHOST function getAnyModifiedState.
Remove unused GHOST_WindowManager::getAnyModifiedState()
2022-07-11 10:38:02 +10:00
7f4ee97b9e Revert "Fix an assert trip in boolean tickled by D11272 example."
This reverts commit 6543290116.
It broke tests and I don't know why, so reverting this while
figuring that out.
2022-07-10 18:50:11 -04:00
6543290116 Fix an assert trip in boolean tickled by D11272 example.
The face merging code in exact boolean made an assumption that
the tesselated original face was manifold except at the boundaries.
This should be true but sometimes (e.g., if the input faces have
self-intersection, as happens in the example), it is not.
This commit makes face merging tolerant of such a situation.
It might leave some stray edges from triangulation, but it should
only happen if the input is malformed.
Note: the input may be malformed if there were previous booleans
in the stack, since snapping the exact result to float coordinates
is not guaranteed to leave the mesh without defects.
2022-07-10 14:50:17 -04:00
fad857f473 Fix T99532: New OBJ importer in some cases fails to import faces
The importer code was written under incorrect assumption that vertex
data (v, vn, vt commands etc.) are grouped by object, i.e. follow the
o command, and that each object has its own vertex data commands. This
is not the case -- all the vertex data in the whole OBJ file is
"global", with no relation to any objects/groups; it's just that the
faces belong to the object, and then they pull in any vertices they
like.

This patch fixes this incorrect assumption in the importer:

- Vertex data is now properly global; no need to track some sort of
  "offsets" per object like it was doing before.
- For each object, face definitions track the minimum & maximum vertex
  indices referenced by the object, and then all that vertex range is
  created in the final Blender object. Note: it might be (unusual, but
  possible) that an object does not reference a sequential range of
  vertices, e.g. just a single face with vertex indices 1, 10, 100 --
  the resulting Blender mesh will have all the 100 vertices (some
  "loose" without belonging to a face). It should be possible to track
  the used vertices exactly (e.g. with a vector set), but I haven't
  done that for performance reasons.

Reviewed By: Howard Trickey
Differential Revision: https://developer.blender.org/D15410
2022-07-10 20:09:29 +03:00
4114ace616 Fix T99536: new 3.2 OBJ importer fails with trailing space after wrapped lines
Address the issue by re-working line continuation handling: stop
trying to parse sequences like "backslash, newline" (which is the
bug: it should also handle "backslash, possible whitespace, newline")
during parsing. Instead, fixup line continuations after reading chunks
of input file data - turn backslash and the following newline into
spaces. The rest of parsing code does not have to be aware of them
at all then.

Makes the file attached to T99536 load correctly now. Also will extend
one of the test files in subversion tests repo to contain backslashes
followed by newlines.
2022-07-10 18:27:38 +03:00
443690604f Fix cursor display size with tablet input in GHOST/Wayland
The scale for tablet cursor surfaces was never set, making them display
larger. Now the outputs scale is set for mouse & tablet cursors.
2022-07-09 22:46:53 +10:00
1de14061cb Cleanup: split out wl_buffer creation into a utility function
Simplify logic for initializing the wl_buffer, ensure the cursors
custom data is never heft in a half initialized state.
Also remove the need for multiple calls to close when handling errors.
2022-07-09 22:27:30 +10:00
9a1d772339 Cleanup: remove buffer_t in GHOST/Wayland
This was allocated and only used to store the custom cursor data.
Use a pointer & size member instead for simplicity.
2022-07-09 22:27:28 +10:00
ef970b7756 Cleanup: split memfd_create into it's own function for Wayland
Avoid ifdef's in cursor loading by creating a memfd_create_sealed
utility function that works irrespective of memfd_create availability.
2022-07-09 22:27:27 +10:00
b5d22a8134 Fix resource leaks setting custom cursors in Wayland
- Memory from the prior cursor was never un-mapped.
- posix_fallocate failure left a file handle open..
2022-07-09 22:27:26 +10:00
80f8b7cbbb UI: renaming fIle browser thumbnail sizes
Rename the thumbnail size from Regular to Medium since it's the typical
way to refer to sizing in American English

Reviewed By: Campbell Barton
Differential Revision: https://developer.blender.org/D15305
2022-07-09 02:09:07 -06:00
e3801a2bd4 Weight & Vertex Paint: always respect edit mode hiding on faces.
In some cases it is mandatory to be able to hide parts of the mesh
in order to paint certain areas. The Mask modifier doesn't work in
weight paint, and edit mode hiding requires using selection, which
is not always convenient.

This makes the weight and vertex paint modes always respect edit mode
hiding like sculpt mode. The change in behavior affects drawing and
building paint PBVH. Thus it affects brushes, but not menu operators
like Smooth or Normalize.

In addition, this makes the Alt-H shortcut available even without
any selection enabled, and implements Hide for vertex selection.

Differential Revision: https://developer.blender.org/D14163
2022-07-09 10:39:53 +03:00
d9e00fbbf6 Cleanup: quiet class-memaccess warning 2022-07-09 15:08:23 +10:00
bc2121147f Cleanup: Remove unused variable 2022-07-08 18:47:31 -05:00
2ee6891728 Fix T99494: Transition effects not working correctly
This was caused by strip content length and start position being
incorrect. Previously this was set from strip boundary by update
function, but it was removed.

Add back code to set effect strip start and length.

Previously content length was always 1 for effects, but now it must
correspond to strip length. Because of this workaround for speed effect
to get this apparent content length was removed.
2022-07-08 18:07:07 +02:00
d8e980a4a6 Fix bug in recently added MutableVArraySpan move constructor 2022-07-08 16:27:47 +02:00
8159e0a666 Curves: use consistent default radius for Cycles, Eevee, Set Curve Radius node
To avoid Cycles not showing any hair by default, and to avoid very slow render
due to many overlaps with the previous 1 meter default in the node.

Fixes T97584, T99319

Differential Revision: https://developer.blender.org/D15405
2022-07-08 16:21:32 +02:00
f639b59a29 Cleanup: convert brush.c to C++
In preparation of refactoring for texture nodes.
2022-07-08 16:21:32 +02:00
b876ce2a4a Geometry Nodes: new geometry attribute API
Currently, there are two attribute API. The first, defined in `BKE_attribute.h` is
accessible from RNA and C code. The second is implemented with `GeometryComponent`
and is only accessible in C++ code. The second is widely used, but only being
accessible through the `GeometrySet` API makes it awkward to use, and even impossible
for types that don't correspond directly to a geometry component like `CurvesGeometry`.

This patch adds a new attribute API, designed to replace the `GeometryComponent`
attribute API now, and to eventually replace or be the basis of the other one.

The basic idea is that there is an `AttributeAccessor` class that allows code to
interact with a set of attributes owned by some geometry. The accessor itself has
no ownership. `AttributeAccessor` is a simple type that can be passed around by
value. That makes it easy to return it from functions and to store it in containers.

For const-correctness, there is also a `MutableAttributeAccessor` that allows
changing individual and can add or remove attributes.

Currently, `AttributeAccessor` is composed of two pointers. The first is a pointer
to the owner of the attribute data. The second is a pointer to a struct with
function pointers, that is similar to a virtual function table. The functions
know how to access attributes on the owner.

The actual attribute access for geometries is still implemented with the `AttributeProvider`
pattern, which makes it easy to support different sources of attributes on a
geometry and simplifies dealing with built-in attributes.

There are different ways to get an attribute accessor for a geometry:
* `GeometryComponent.attributes()`
* `CurvesGeometry.attributes()`
* `bke::mesh_attributes(const Mesh &)`
* `bke::pointcloud_attributes(const PointCloud &)`

All of these also have a `_for_write` variant that returns a `MutabelAttributeAccessor`.

Differential Revision: https://developer.blender.org/D15280
2022-07-08 16:16:56 +02:00
f391e8f316 Linux: Move Mesa software OpenGL libraries to sub-directory
Allows to put libraries which are always needed by Blender into the
lib/ folder and not worry about OpenGL libraries picked up from there.

Currently no functional changes as we do not yet have dynamic libraries
which we load at startup. It allows to use direct linking of oneAPI
Cycles device (see D15397), also it is something which would need to
happen to support USD/Hydra/TBB compiler as dynamic libraries in the
future.

Differential Revision: https://developer.blender.org/D15403
2022-07-08 15:44:06 +02:00
0f50ae131f Cycles: enable oneAPI in Linux release builds
with a very high min-driver version requirement, placeholder until JIT
CentOS runtime compilation issue gets fixed in a defined version.
min-driver version check can be worked around by setting
CYCLES_ONEAPI_ALL_DEVICES environment variable.
2022-07-08 15:39:13 +02:00
5723bf926d Fix T99191: Boolean modifier creates invalid material indices
Similar to 1a6d0ec71c which changed the mesh boolean node (and
also caused this bug), this commit changes the material mapping for the
exact mode of the boolean modifier. Now the result should contain any
material on the faces of the input objects (including materials linked
to objects and meshes). The improvement is possible because materials
can be changed during evaluation (as of 1a81d268a1).

Differential Revision: https://developer.blender.org/D15365
2022-07-08 08:32:32 -05:00
becb1530b1 Hair Curves: The new curves object is now available
This commit doesn't implement any new feature but makes the new curves
object type no longer experimental.

Documentation:

* https://docs.blender.org/manual/en/3.3/modeling/curves/primitives.html#empty-hair
* https://docs.blender.org/manual/en/3.3/sculpt_paint/curves_sculpting/introduction.html

Note: This also makes the Selection Paint tool available. This tool
should have been moved out of the "New Curves Tool" flag when we got the
selection drawing to work.

Differential Revision: https://developer.blender.org/D15402
2022-07-08 15:11:32 +02:00
2c55d8c1cf Cleanup: make format 2022-07-08 15:11:32 +02:00
05b38ecc78 Curves: support deforming curves on surface
Curves that are attached to a surface can now follow the surface when
it is modified using shape keys or modifiers (but not when the original
surface is deformed in edit or sculpt mode).

The surface is allowed to be changed in any way that keeps uv maps
intact. So deformation is allowed, but also some topology changes like
subdivision.

The following features are added:
* A new `Deform Curves on Surface` node, which deforms curves with
  attachment information based on the surface object and uv map set
  in the properties panel.
* A new `Add Rest Position` checkbox in the shape keys panel. When checked,
  a new `rest_position` vector attribute is added to the mesh before shape
  keys and modifiers are applied. This is necessary to support proper
  deformation of the curves, but can also be used for other purposes.
* The `Add > Curve > Empty Hair` operator now sets up a simple geometry
  nodes setup that deforms the hair. It also makes sure that the rest
  position attribute is added to the surface.
* A new `Object (Attach Curves to Surface)` operator in the `Set Parent To`
  (ctrl+P) menu, which attaches existing curves to the surface and sets the
  surface object as parent.

Limitations:
* Sculpting the procedurally deformed curves will be implemented separately.
* The `Deform Curves on Surface` node is not generic and can only be used
  for one specific purpose currently. We plan to generalize this more in the
  future by adding support by exposing more inputs and/or by turning it into
  a node group.

Differential Revision: https://developer.blender.org/D14864
2022-07-08 14:47:10 +02:00
aa78278ef6 Fix build error without unity build, after recent changes 2022-07-08 14:38:21 +02:00
155bb95353 Fix Crash: Reading canvas tool settings.
Blender would crash when a file was saved where the tool settings is
set to paint on a single image (3d texture painting).

Reason is that the selected image memory address wasn't updated
when the new address.
2022-07-08 14:05:11 +02:00
Jeroen Bakker
a8f7d41d38 Draw: Curve outline drawing in object mode.
This patch adds (selected/active) outline around a curve object in object mode.

{F13270680}

In the past the draw bounds option was enabled for any curve objects. With this
patch it isn't needed and will be disabled.

In the future the curve outline could also be enabled to improve GPU selection.

Reviewed By: dfelinto, HooglyBoogly, fclem

Maniphest Tasks: T95933

Differential Revision: https://developer.blender.org/D15308
2022-07-08 12:08:31 +02:00
Damien Picard
2c4dfe3453 Add a few missing UI strings to translation.
Reviewed By: mont29

Differential Revision: https://developer.blender.org/D15392
2022-07-08 11:55:01 +02:00
754dae6c76 GHOST/Wayland: add logging for listener handlers
Add logging to all Wayland listener callbacks as it can be difficult
to detect the cause of problems.

Using break-points often isn't practical for debugging interactive
windowing / compositor issues

Logging needs to be enabled on the command line, e.g:

blender --log "ghost.wl.*" --log-level 2 --log-show-basename
2022-07-08 19:40:10 +10:00
47616992f8 GHOST: use ELEM/ARRAY_SIZE/UNPACK macros to avoid repetition
Also use UNLIKELY macro for checks for very unlikely scenarios.
2022-07-08 19:39:11 +10:00
418d82af28 GHOST: add GHOST_utildefines
Add macros from BLI_utildefines, mainly to avoid that avoid repetition
(ELEM, UNPACK*, CLAMP* & ARRAY_SIZE).

Also add macros LIKELY/UNLIKELY as there are quiet a lot of checks
for unlikely situations for GHOST/Wayland (not having a keyboard,
or mouse for e.g.).
2022-07-08 19:36:31 +10:00
c4b32f1b29 Cleanup: Move mesh legacy conversion to a separate file
It's helpful to make the separation of legacy data formats explicit,
because it declutters actively changed code and makes it clear which
areas do not follow Blender's current design. In this case I separated
the `MFace`/"tessface" conversion code into a separate blenkernel
.cc file and header. This also makes refactoring to remove these
functions simpler because they're easier to find.

In the future, conversions to the `MLoopUV` type and `MVert`
can be implemented here for the same reasons (see T95965).

Differential Revision: https://developer.blender.org/D15396
2022-07-07 22:33:57 -05:00
b98a937db6 Fix T99364: Unable to select bones when custom shape display is disabled
Regression in [0] which revealed an error in [1].
Logic for pose channel custom transform ignored ARM_NO_CUSTOM.

[0]: 3267c91b4d
[1]: c3fef001ee
2022-07-08 11:33:22 +10:00
03173d63c0 Cleanup: spelling in comments
Also move mis-placed doc-string.
2022-07-08 09:48:49 +10:00
9ef3736959 Cleanup: format 2022-07-08 09:10:24 +10:00
56bf92f0f6 Cleanup: Calm GCC Conversion Warning
Commit b9c0eed206 introduced a GCC conversion warning because of an
assignment of a long int value to an int.

Own Code
2022-07-07 14:29:37 -07:00
b9c0eed206 BLF: Add Support for Variable Fonts
Add support for Variable/Multiple Master font features. These are fonts
that contain a range of design variations along multiple axes. This
contains no client-facing options.

See D12977 for details and examples

Differential Revision: https://developer.blender.org/D12977

Reviewed by Brecht Van Lommel
2022-07-07 12:59:16 -07:00
fc06b4c033 Fix T99332: resize video in image editor does not update correctly
Use the image user from the image editor to correctly get the frame in the
operators. Based on patch by Nicolas (john-g-h-doe) with changes by me.

Differential Revision: https://developer.blender.org/D15380
2022-07-07 21:01:30 +02:00
52fa0c4251 Cleanup: Remove unused variable 2022-07-07 13:43:13 -05:00
4e9e44ad28 Cleanup: improve asserts in generic span 2022-07-07 19:27:30 +02:00
ba62e20af6 BLI: make some spans default constructible
`GSpan` and spans based on virtual arrays were not default constructible
before, which made them hard to use sometimes. It's generally fine for
spans to be empty.

The main thing the keep in mind is that the type pointer in `GSpan` may
be null now. Generally, code receiving spans as input can assume that
the type is not-null, but sometimes that may be valid. The old #type() method
that returned a reference to the type still exists. It asserts when the
type is null.
2022-07-07 19:19:18 +02:00
7cfea48752 LibOverride: Make fully editable when creating an experimental user setting.
This is temporary to investigate which behavior should be kept when
creating an override hierarchy if there are no cherry-picked data
defined: make all overrides user-editable, or not.

This removes the 'make override - fully editable' menu entries.
2022-07-07 18:19:11 +02:00
b8605ee458 UI: Superimposed pin icon for workspace scene pinning in the scene switcher
Followup to the previous commit, to display a pin icon in the scene switcher.
This is a good indicator to have and such workspace-wide functionality should
be available in the topbar, close to what it belongs to (scene switching).
Downside is that it makes this already crowded region even more crowded. But
thanks to the use of superimposed icons, it's not too noisy visually.

Differential Revision: https://developer.blender.org/D11890

Reviewed by: Campbell Barton
2022-07-07 18:14:05 +02:00
e0cc86978c Workspaces: Option to pin scene to a workspace
Adds a "Pin Scene" option to the workspace. When activated, the workspace will
remember the scene that was last activated in it, so that when switching back
to this workspace, the same scene will be reactivated. This is important for a
VSE workflow, so that users can switch between different workspaces displaying
a scene and thus a timeline for a specific task.

The option can be found in the Properties, Workspace tab. D11890 additionally
adds an icon for this to the scene switcher in the topbar.

The workspace data contains a pointer to the scene which is a UI to scene data
relation. When appending a workspace, the pointer is cleared.

Differential Revision: https://developer.blender.org/D9140

Reviewed by: Brecht Van Lommel, Bastien Montagne (no final accept, but was fine
with the general design earlier)
2022-07-07 18:08:18 +02:00
f9a805164a Outliner, Library Overrides: List child objects under parents
Because children point to, or "use" their parent, the Library Overrides
Hierarchies mode in the Outliner would show parents contained in children, not
children contained in a parent. See D15339 for pictures.

In production files this would make the rig listed under all its children, so
it would appear many times in the tree. Now it appears once and the children
are collected under it.

Refactors the tree building, so instead of using
`BKE_library_foreach_ID_link()`, it now uses the ID relations mapping in
`MainIDRelations`.

Reviewed By: mont29

Differential Revision: https://developer.blender.org/D15339
2022-07-07 17:19:59 +02:00
Bastien Montagne
fcf1a9ff71 Fix T99256: Regression: Meta balls segfaulting copy-to-selected.
Revealed by rB43167a2c251b, but actuall issue is the
`rna_MetaBall_update_data` function expecting a never-NULL `scene`
pointer, which is not guaranteed.

This lead to refactoring the duo
`rna_MetaBall_update_data`/`BKE_mball_properties_copy`, since it was
doing a very sub-optimal O(n^2) process, new code is O(2n) now
(n being the number of Objects).

Not sure why the objects were processed through the existing bases of
the existing scene in the first place, this could miss a lot of affected
objects (e.g. in case said objects are in an excluded collection, etc.).

Also noticed that both old and new implementation can fail to fully propagate
changes to all affected meta-balls in some specific corner cases, added
a comment about it in the code.

Reviewed By: sergey

Maniphest Tasks: T99256

Differential Revision: https://developer.blender.org/D15338
2022-07-07 16:25:34 +02:00
c76e1ecac6 Compositor: Pre-fill motion tracking fields
Extends current functionality which was only filling in
the active movie clip. Now we also pre-fill tracking object
name, as well as (plane)track name.
2022-07-07 16:15:44 +02:00
59e1009f10 Cleanup: Use std::move for geometry set
The only real improvement is avoiding some reference counting,
but the main for the change is consistency. Also don't move a
StringRef, since that doesn't own any data anyway.
2022-07-07 09:01:46 -05:00
85ef8e1945 Cleanup: Use C++ style of avoiding unused variable warnings
As documented in the best practices section of the style guide:
https://wiki.blender.org/wiki/Style_Guide/Best_Practice_C_Cpp
2022-07-07 08:55:36 -05:00
a91f9c2c01 Cleanup: Use generic index mask utility
This may lead to improved performance from multithreading as well.
2022-07-07 08:49:23 -05:00
f0ac55f519 Fix: Spreadsheet does not display original curves data
The spreadsheet ignored the component choice in the data set region
for curves and volume objects, and the original curves data-block wasn't
retrieved from the original object.
2022-07-07 08:35:47 -05:00
Amélie Fondevilla
a26038ff38 Fix T99505: NLA tweak mode crashes with GPencil data
Adding Grease Pencil keyframes in the dopesheet (rB92d7f9ac56e0) lead to
crashes from the NLA editor (T99505). This is now resolved, by removing
grease pencil keyframes from NLA editor (as it was in 3.2), and
filtering them out of all NLA-related operations.

Reviewed By: sybren

Differential Revision: https://developer.blender.org/D15391
2022-07-07 15:31:06 +02:00
Pratik Borhade
3063d90cfc Fix T99453: Regression: Crash on calling menu search
Fix T99453.
Crash due to null pointer access.
So wrap the function call in simple `if` check

Reviewed By: sybren

Maniphest Tasks: T99453

Differential Revision: https://developer.blender.org/D15370
2022-07-07 15:24:17 +02:00
eb7218de8d Fix T99386: Driven modifiers are always re-evaluated during animation
Even if the driver is not dependent on time the modifiers were always
re-evaluated during playback. This is due to the legacy nature of the
check whether modifier depends on time or not: it was simply checking
for sub-string match for modifier in the F-Curve and drivers RNA paths.

Nowadays such dependencies are created by the dependency graph builder,
which allows to have more granular control over what depends on what.

The code is now simplified to only check for "static" dependency of the
modifier form time: for example, Wave modifier which always depends on
time (even without explicit animation involved).

This change also fixes missing relation from the animation component to
the shader_fx modifiers, fixing race condition.

Additional files used to verify relations:
- Geometry: F13257368
- Grease Pencil: F13257369
- Shader FX: F13257370

In these files different types of modifiers have an animated property,
and the purpose of the test is to verify that the modifiers do react
to the animation and that there is a relation between animation and
geometry components of the object. The latter one can only be checked
using the dependency graph relation visualization.

The drivers are not tested by these files. Those are not typically
depend on time, and if there were missing relation from driver to
the modifier we'd receive a bug report already. As well as if there
was a bug in missing time relation to a driver we'd also receive a
report.

Differential Revision: https://developer.blender.org/D15358
2022-07-07 15:22:21 +02:00
9a4927031d Cleanup: Remove redundant filtering of legacy normal attribute
This is already done inside of `attribute_search_add_items`.
2022-07-07 08:15:29 -05:00
ed7dc4282c Cleanup: Correct comment with spreadsheet enum type 2022-07-07 08:14:00 -05:00
5c3dc52536 Cleanup: Improve variable name
The new name makes more sense in non-node-related contexts.
2022-07-07 08:13:11 -05:00
e3ef56ef91 Curves: Add sculpt selection overlay
This commit adds visualization to the selection in curves sculpt mode.
Previously it was only possible to see the selection when it was
connected to a material.

In order to obstruct the users vision as little as possible, the
selected areas of the curve are left as is, but a dark overlay
is drawn over unselected areas.

To make it work, the overlay requests the selection attribute and then
ensures that the evaluation is complete for curves. Then it retrieves
the evaluated selection GPU texture and passes that to the shader.
This reuses the existing generic attribute extraction system because
there currently wouldn't be any benefits to dealing with selection
separately, and because it avoids duplication of the logic that
extracts attributes from curves and evaluates them if necessary.

Differential Revision: https://developer.blender.org/D15219
2022-07-07 08:06:30 -05:00
5d6e7df4a8 GHOST: initialize grab axis for windows
While this didn't cause any user visible bugs, ASAN would report
an error when passing it as an argument.
2022-07-07 21:44:48 +10:00
a27024e36d ID Management: Purge: Make outliner button use recursive purge.
This change the 'Purge' button of the Outliner 'Orphaned' view to use
recursive purge, i.e. it wil not only delete immediately unused IDs (as
listed in the view) anymore, but also all their unused dependencies.
2022-07-07 13:01:02 +02:00
97dd107070 Fix T98029: Support isolated islands of IDs when purging unused ones.
Cases were e.g. an object would use a material, and this material would
use this object (e.g. through a driver), even if both those data-blocks
are technically unused, they would remain forever since they were not
detected as such.

Now this is properly detected and purged as part of the 'recursive
purge' operation.
2022-07-07 13:01:02 +02:00
051a341cf0 Fix T99491: Crash when opening modifiers panel
This crashed because in `get_active_fcurve_channel`, the filter did not
filter out channels with no fcurve.

The fix adds the filter `ANIMFILTER_FCURVESONLY`.

See rB92d7f9ac56e0ff1e65c364487542dfb7c32a0a67 for the new filter.

Maniphest Tasks: T99491

Differential Revision: https://developer.blender.org/D15386
2022-07-07 11:51:38 +02:00
14980c9b3a Fix: Save modified images during file close
Regressed in the following commit due to an inverted conditional:
{rB1159b63a07fd2cbc7fc48e162d57721c9c85b3f6}

Differential Revision: https://developer.blender.org/D15389
2022-07-07 02:36:54 -07:00
f256201876 Fix T99388: Obey relative path option when saving UDIMs
Ensure that the Image maintains the proper file path after saving all
the individual tiles.

The image_save_post function is unaware that the filepath it receives
is only for a single tile, not the entire Image, and happily keeps
setting ima->filepath to the concrete filepath for each tile.

There were 2 problems with the code that attempted to correct the
Image filepath back to the UDIM virtual form:
- It would trample the "relative" directory that might have been set
- It would do the wrong thing if no tiles could be saved at all

The design is now as follows: Example of trying to save to a new PathB
|                                  | all tiles ok     | any tile not ok|
| -------------------------------- | ---------------- | ---------------|
| ima->filepath is currently empty | set to new PathB | keep empty     |
| ima->filepath is currently PathA | set to new PathB | keep PathA     |

Differential Revision: https://developer.blender.org/D15384
2022-07-07 02:12:36 -07:00
50f9c1c09c OBJ: more robust .mtl texture offset/scale parsing (T89421)
As pointed out in a comment on T89421, if a MTL file contained
something like: `map_Ka -o 1 2.png` then it was parsed as having
offset `1 2` and the texture filename just a `.png`. Make it so that
mtl option numbers are parsed in a way where the number is only
accepted only if it's followed by whitespace.

Differential Revision: https://developer.blender.org/D15385
2022-07-07 11:34:13 +03:00
bddcb89cda OBJ: always set eevee blend mode when material "d" is below 1.0
Fixes T97743: the import code was setting EEVEE blending mode whenever
a transparency texture was present (map_d), or when the materials
illum was saying "yo, transparency!". But if only the material's d
was below 1.0, it was not setting the blend mode, which is different
to user expectations.

Differential Revision: https://developer.blender.org/D15383
2022-07-07 11:34:13 +03:00
28105caaa3 Fix T99342: GPencil multiframe falloff is scaling wrongly in rotation
The falloff was applied to scale by error. Now, the falloff is only applied to the rotation.

Differential Revision: https://developer.blender.org/D15364

.
2022-07-07 09:47:59 +02:00
843ad51d18 Cleanup: use arguments for internal wayland cursor grabbing
Pass in arguments for internal grab logic instead of accessing
some values from the window and other values as arguments.
While more verbose it's simpler to reason about.
2022-07-07 16:36:46 +10:00
34c701abbd Fix T99270: bones using empties as custom shapes can't be selected
Regression in [0] which didn't account for the bounds of empty objects.
Add support support calculating bounds from empty draw-type to use in
pose-bone culling.

[0]: 3267c91b4d
2022-07-07 15:24:48 +10:00
3f657e7ef1 Python: show additional context for PyDriver errors in the stderr
Showing the expression alone may not be enough to track down an error
evaluating a py-driver. Show information about the target ID & property
in the error message as well.
2022-07-07 12:30:47 +10:00
83c0f6ac37 Python: clear Py-driver variables on exit
These kinds of leaks are relatively harmless, it reduces the number of
un-freed data reported by valgrind on exit.
2022-07-07 12:30:45 +10:00
5c790fd52b Cleanup: use boolean types & early exit on failure for PyDriver
Also use __func__ for printing the funciton name.
2022-07-07 12:30:44 +10:00
709e620977 Cleanup: format 2022-07-07 12:30:42 +10:00
378f65f7d9 Fix Py-driver byte code access with Python 3.11
Error in [0] which assumed the struct member was renamed however
byte-code access from PyCodeObject now requires an API call.

Thanks to @music for pointing this out.

[0]: 780c0ea097
2022-07-07 12:30:40 +10:00
3354ec3fb3 Fix T99334: Ignore edit-related snap options in Object mode
When in Object Mode, any of the active- and edit-related snapping
options (Include Active, Include Edited, Include Non-Edited) should be
ignored when in Object Mode, otherwise snapping could be effectively
disabled.

This commit forces snap code to ignore the active- and edit-related
options when in Object Mode.

Reviewed By: Germano Cavalcante (mano-wii)

Differential Revision: https://developer.blender.org/D15366
2022-07-06 16:21:56 -04:00
2a60b979cc UI: Adjust and fix shader node descriptions
The tooltips added for shader nodes in D15309 are very helpful already.
This commit makes a few tweaks to make them more consistent, concise,
and includes some fixes. Note that this might move some descriptions
further away from the wording in the manual.

* Make wording more concise
  * Start fewer new sentences
  * Use "For Example" slightly less
  * Avoid repeating the node's name unnecessarily
* Spelling/grammar fixes
  * Don't capitalize some words
  * Use consistent verb conjugation
  * Use ASCII characters/more common quote symbols
* Corrections to information
  * Plural/singular corrections
  * "smoke domains" -> "volume grids"
  * Fix tooltip for separate and combine color nodes
  * Refer to color sockets as colors rather than "images"
* Avoid "advice" in a few places, which should be left for the manual
* Remove information for sockets and could be in their tooltips
* Avoid referring to the locations of a property in the UI
* Avoid manual newlines (mostly reserve for "Note:")
  * Leave UI code in control of wrapping, which is more consistent
* Add some information
  * That the UV map and color attribute nodes use a default
  * That Voronoi is "based on the distance to random points"
  * Add "(Deprecated)" to old color combine and separate nodes

Differential Revision: https://developer.blender.org/D15381
2022-07-06 15:03:21 -05:00
2d041fc468 Object: Speed up duplication of large selections by doing fewer collection syncs
Previous code was doing N collection syncs when duplicating N objects.
New code avoids all the intermediate syncs by using
BKE_layer_collection_resync_forbid and
BKE_layer_collection_resync_allow, and then does one
BKE_main_collection_sync + BKE_main_collection_sync_remap for the
whole operation. There is some complexity involved where the Base
things of newly duplicated objects can't be found yet, without the
sync, so some work on them (marking them selected, active, ...) has
to be deferred until after the sync.

Timings: scene with 10k cubes, each with unique mesh (Windows, VS2022
Release build, AMD Ryzen 5950X):

- Shift+D duplicate: 13.6s -> 9.2s
- Alt+D duplicate: 4.76s -> 1.53s

Reviewed By: Bastien Montagne
Differential Revision: https://developer.blender.org/D14150
2022-07-06 21:30:50 +03:00
190ad73590 Cycles oneAPI: Remove direct dependency on Level-Zero
We used it only to access device id for explicitly allowing Arc GPUs.
It made the backend require ze_loader.dll which could be problematic if
we end up using direct linking.
I've replaced filtering based on PCI device id by using other HW properties
instead (EUs, threads per EU), that are now available through Level-Zero.
2022-07-06 18:55:38 +02:00
debb233787 Cleanup: fix comments in oneAPI kernel.cpp 2022-07-06 18:55:38 +02:00
fae68ec651 Fix T99464: Curves sculpt add 3D brush symmetry broken
The brush transform was not applied to the view direction.
2022-07-06 11:53:18 -05:00
8ea5a5259d Icons: Add each icon to a named group
The objects making up each icon are placed in a group named after the icon
coordinates in the grid. This change has no impact on the current pipeline used
to include icons in a Blender build, but lays the foundation to explore other
workflows to do that, and tidies up the file.

Differential Revision: https://developer.blender.org/D15251
2022-07-06 18:21:20 +02:00
82fc8786ea Fix T99343: Missing RNA_def_property_update for show overlays in UV editor
Reviewed By: jbakker

Maniphest Tasks: T99343

Differential Revision: https://developer.blender.org/D15354
2022-07-06 21:14:34 +05:30
0df574b55e Cycles: Improve an occupancy for Intel GPUs
Initially oneAPI implementation have waited after each memory
operation, even if there was no need for this. Now, the implementation
will wait only if it is really necessary - it have improved
performance noticeble for some scenes and a bit for the rest of them.
2022-07-06 17:26:23 +02:00
6636edbb00 BLI: improve reverse uv sample in edge cases
Allow for a small epsilon to improve handling of uvs that are on edges.
Generally, when using reverse uv sampling, we expect that the sampling
is supposed to succeed.
2022-07-06 15:20:38 +02:00
9d0777e514 Fix T99368: Annotation lines doesn't start where clicked
Caused by [0] which made accessing the drag-start require a function
instead of being the value written into the event cursor coordinates.

[0]: b8960267dd
2022-07-06 21:07:29 +10:00
da85245704 Compositor: Pre-fill active scene movie clip in more nodes
Pre-fills movie clip from the scene to the following nodes:
- Keying Screen
- Plane Track Deform
- Track Position

The rest of tracking related nodes were already doing so.

Differential Revision: https://developer.blender.org/D15377
2022-07-06 12:40:39 +02:00
94323bb427 IO: speed up import of large Alembic/USD/OBJ scenes by optimizing material assignment
The importer parts that were doing assignment of materials to the
imported objects/meshes were essentially having a quadratic complexity
in terms of scene object count. For each material assigned to each
object, they were scanning the whole scene, checking which other
Objects use the same Mesh data, in order to resize their material
arrays to match the size.

Performance details (Windows, Ryzen 5950X):

- Import OBJ Blender 3.0 splash scene (24k objects): 43.0s -> 32.9s
- Import USD Disney Moana scene (260k objects): saves two hours
  (~7400s). Note that later on this crashes when trying to render the
  imported result; crashes in the same way/place both in master and
  this patch.

Implementation details:

The importers were doing "scan the world" basically twice for each
object, for each material: once when creating a new material slot
(assigns an empty material), and then again when assigning the
material.

However, all these importers (USD, Alembic, OBJ) always create one
Object for one Mesh. So that whole quadratic complexity resulting
from "scan the world for possible other users of this obdata" is
completely not needed; it just never finds anything. So add a new
dedicated function BKE_object_material_assign_single_obdata that skips
the expensive part, but should only be used when the caller knows that
the obdata has exactly one user (the passed object).

Reviewed By: Bastien Montagne, Michael Kowalski
Differential Revision: https://developer.blender.org/D15145
2022-07-06 13:30:15 +03:00
4b0e7fe511 Fix T99462: Deleting Missing Libraries Crashes Blender.
Usual same issue with outliner operations, where you apply it on one
item, and then try to apply it again on same item listed somewhere else
in the tree...

Fixed by using the 'multi-tagged deletion' code we now have for IDs,
that way tree-walking function just tags IDs for deletion, and they all
get deleted at once at the end.
2022-07-06 10:53:22 +02:00
26f721b516 OBJ: extend test coverage for parsing MTL scale/offsets (T89421)
The new OBJ/MTL importer was already handling case T89421
correctly, but there was no test coverage to prove it. Extend
the tests to parse various forms of "-o" and "-s" (one, two, three
numbers).
2022-07-06 09:05:20 +03:00
e58e023e1a GHOST/Wayland: support dynamic loading libraries for Wayland
Add intern/wayland_dynload which is used when WITH_GHOST_WAYLAND_DYNLOAD
is enabled (off by default). When enabled, systems without Wayland
installed will fall back to X11.

This allows Blender to dynamically load:
- libwayland-client
- libwayland-cursor
- libwayland-egl
- libdecor-0 (when WITH_GHOST_WAYLAND_LIBDECOR is enabled).
2022-07-06 15:30:47 +10:00
d9505831a4 Cleanup: declare local variables static 2022-07-06 15:28:54 +10:00
db9e08a0d1 Cleanup: spelling in comments 2022-07-06 15:28:54 +10:00
Loren Osborn
1f0048cc2d Cleanup: Fix compiler warnings
Use consistent class/struct declaration in forward declarations.

Differential Revision: https://developer.blender.org/D15382
2022-07-06 00:06:16 -05:00
faac25fefe Fix T99284: Undefined values output from UV nodes
When committing D14389 I assumed that the output arrays didn't need
to be initialized, but the UV parameterizer uses the intial values of UVs.
2022-07-05 18:01:08 -05:00
Iliay Katueshenock
1a820680a1 Fix: Tests: Incorrect curve construction
The offsets were filled with the same value,
but they must be the total accumulated point count.

Differential Revision: https://developer.blender.org/D15374
2022-07-05 17:50:59 -05:00
9435ee8c65 Curves: Port subdivide node to the new data-block
This commit moves the subdivide curve node implementation to the
geometry module, changes it to work on the new curves data-block,
and adds support for Catmull Rom curves. Internally I also added
support for a curve domain selection. That isn't used, but it's
nice to have the option anyway.

Users should notice better performance as well, since we can avoid
many small allocations, and there is no conversion to and from the
old curve type.

The code uses a similar structure to the resample node (60a6fbf5b5)
and the set type node (9e393fc2f1). The resample curves node can be
restructured to be more similar to this soon though.

Differential Revision: https://developer.blender.org/D15334
2022-07-05 16:08:37 -05:00
7688f0ace7 Curves: Move type conversion to the geometry module
This helps to separate concerns, and makes the functionality
available for edit mode.
2022-07-05 15:51:12 -05:00
c52a18abf8 UI: Curves Sculpting - Remove duplicated entry for Curve Length 2022-07-05 17:50:27 +02:00
883d8ea16c Fix: Memleak in sequencer drag and drop code 2022-07-05 16:32:20 +02:00
329efa23d0 Cleanup: Unused headers in generic compositor nodes header
Move headers to node files which actually need those.
There is no need for all nodes to have all those headers
included indirectly.
2022-07-05 15:58:04 +02:00
31f0845b7e Fix tracking header not being self-sufficient
It used size_t type without including any header to define it.
2022-07-05 15:58:04 +02:00
8f0907b797 BLI: add float3x3 * float3 operator overload 2022-07-05 15:38:30 +02:00
d4099465cd Cleanup: extract function to snap curves to surface
This makes it possible to use this function without having
to call an operator. This is currently used by D14864.
2022-07-05 15:37:34 +02:00
b98d116257 BLI: use a slightly less trivial reverse uv sampler
This approach is still far from ideal, but at least it has linear
complexity in the common case instead of quadratic.
2022-07-05 15:36:00 +02:00
7ff054c6d1 Cleanup: use curves surface transform utility in operators 2022-07-05 15:06:31 +02:00
c46d4d9fad Curves: move curves surface transforms to blenkernel
This utility struct is useful outside of sculpting code as well.
2022-07-05 15:06:31 +02:00
7f24d90f11 Fix T99272: Regression: location override ignored when used in a shadertree.
This is not strictly speaking a regression, this worked before partial
resync was introduced purely because the whole override hierarchy was
systematically re-built.

But support for material pointers in obdata (meshes etc.) was simply not
implemented.

NOTE: This commit also greatly improves general support of materials in
liboverrides, although there is still more work needed in that area to
consider it properly supported.
2022-07-05 12:52:21 +02:00
ce1d023667 Fix (unreported) liboverride: incomplete hierarchy when root is not object/collection.
We do not (currently) consider other ID types as 'end points' justifying
to create an override hierarchy, however if the 'root' ID (i.e. the ID
the user selected as base to create the override) is not an object or
collection, we still want to check all of its dependencies.

This fixes e.g. if a material depends on another Empty object, and user
tries to hierarchy-override that material, its Empty dependency not
being overridden.
2022-07-05 12:52:20 +02:00
598a26fd8a NLA: update description of frame_end_ui RNA property
The description incorrectly mentioned it changes the start frame as well,
but it changes the strip's repeats or the action's end frame.
2022-07-05 12:20:59 +02:00
935ef06fd1 NLA: fix punctuation of tooltips 2022-07-05 12:18:20 +02:00
fdb854b932 Cleanup: NLA, reformatting code
No functional changes.
2022-07-05 11:34:40 +02:00
Thibault de Villèle
bd00324c26 NLA: change behavior of 'Frame Start' / 'End' sliders
Change the behavior of the "Frame start" and [Frame] "End" fields of an
NLA Strip in the NLA editor.

Frame Start now behaves like translating with {key G} and moving the
mouse. It also updates the Frame End to ensure the strip remains the
same length.

Frame End changes the length of the strip, based on the Repeat property.
If there are no repeats (i.e. number of repeats = 1) the underlying
Action will change length, such that more or less of its keyframes will
be part of the NLA strip. If there are repeats (i.e. number of repeats
smaller or larger than 1), the number of repeats will change. Either
way, the effective end frame off the strip will be the one set in the
Frame End slider.

The old behavior of stretching time has been removed. It is still
possible to stretch time of a strip, but this no longer automatically
happens when manipulating the Frame Start and Frame End sliders.

**Technical details:** new RNA properties `frame_start_ui` and
`frame_end_ui` have been added. Changing those values (for example via
the sliders, but also via Python) trigger the above behavior. The
behavior of the already-existing `frame_start` and `frame_end`
properties has been simplified, such that these can be set from Python
without many side-effects, simplifying import of data into the NLA.

Reviewed By: sybren, RiggingDojo

Differential Revision: https://developer.blender.org/D14658
2022-07-05 10:51:43 +02:00
322abb2e4b Geometry Nodes: Use alphabetical order for UV nodes in add menu 2022-07-04 23:54:06 -05:00
8c33a53b17 Cleanup: format 2022-07-05 14:34:09 +10:00
9145a4d08f GPU: add missing license header 2022-07-05 13:58:52 +10:00
780c0ea097 Python: support v3.11 (beta) with changes to PyFrameObject & opcodes
- Use API calls to access frame-data as PyFrameObject is now opaque.
- Update opcodes allowed for safe driver evaluation.

**Details**

Some opcodes have been added for safe-driver evaluation.
Python 3.11 removes many opcodes - the number of accepted opcodes in
Blender's listing dropped from 65 to 43) however some new opcodes
also needed to be added. As this relates to security details about newly
added opcodes have been noted below (see [0] for full documentation).

Newly added opcodes:

- CACHE:
  Used to control caching instructions.

- RESUME:
  A no-op. Performs internal checks.

- BINARY_OP:
  Implements the binary and in-place operators,
  replacing specific binary operations.

- CALL, PRECALL, KW_NAMES:
  Used for calling functions, replacing some existing opcodes.

- POP_JUMP_{FORWARD/BACKWARD}_IF_{TRUE/FALSE/NONE/NOT_NONE}.
  Manipulate the byte-code counter.

- SWAP, PUSH_NULL.
  Stack manipulation.

Resolves T99277.

[0]: https://docs.python.org/3.11/library/dis.html
2022-07-05 13:41:55 +10:00
dfa5201763 Python: add opcodes for safe py-drivers
New opcodes added since 3.7 meant some actions such as `len()`
were disabled in safe py-driver execution.

The following opcodes have been added, see [0] for details:

- ROT_FOUR: similar to existing ROT_* opcodes, added v3.8.

- ROT_N: similar to existing ROT_* opcodes, added v3.10.

- GET_LEN: Push len(TOS) onto the stack, added v3.10.

- IS_OP: for ternary operator, added v3.9.

- BUILD_SLICE: access `slice` built-in, doesn't expose new
  functionality beyond existing `__getitem__` access.

[0]: https://docs.python.org/3.10/library/dis.html
2022-07-05 13:41:53 +10:00
7537369498 Python: remove invalid Py_TPFLAGS_HAVE_GC usage
Blender wouldn't start with Python 3.11 because of an error in
Py_TPFLAGS_HAVE_GC usage for `bpy.app.handlers.persistent`.
Remove this flag as it's not necessary.

Part of fix for T99277.
2022-07-05 13:41:49 +10:00
6e879c3998 BLI: Use simpler sliced generic virtual arrays when possible
This is just a theoretical improvement currently, I won't try to justify
it with some microbenchmark, but it should be better to use the
specialized single and span virtual arrays when slicing a `GVArray`,
since any use of `GVArrayImpl_For_SlicedGVArray` has extra overhead.

Differential Revision: https://developer.blender.org/D15361
2022-07-04 15:30:42 -05:00
242bfd28ce METAL: Add license header to new files 2022-07-04 20:11:06 +02:00
dccdc6213e Curves: Expose function to calculate vector handles 2022-07-04 11:51:10 -05:00
8fb8a6529f OBJ: remove "experimental" from C++ based importer/exporter, mark Python legacy
By now I'm not aware of any serious regressions or missing functionality
in the C++ based OBJ importer/exporter. They have more features (vertex colors
support), and are way faster than the Python based importer/exporter.

Reviewed By: Thomas Dinges, Howard Trickey
Differential Revision: https://developer.blender.org/D15360
2022-07-04 19:12:35 +03:00
c63569c0e0 Cleanup: Correct UI view comments 2022-07-04 16:50:46 +02:00
abbc8333ac Fix curves sculpting Selection Paint missing refresh
This was reported as part of D15219 but it is a problem in master, not
in the patch.

EEVEE is drawing with a cheap sampling when navigating or painting, but
we need to clear the painting flag when we are done painting.

For a rainy day: DRW_state_is_navigating() should be renamed to indicate
that it also checks for the painting flag.
2022-07-04 16:08:29 +02:00
af6f3a4020 Cleanup: Remove unused function 2022-07-04 08:50:33 -05:00
1c38bfdc6f Cleanup: Clarify relation name for time relation to modifier 2022-07-04 12:27:45 +02:00
004913dd95 Fix T99381: GPencil Unable to Sculpt last point using Subdivide Modifier
The problem was the last point had the original point, but the previous one not, so the loop ends before checking last point.

The solution is avoid the loop exist if the function is checking the previous point before last one.
2022-07-04 10:58:53 +02:00
3f5073a8e2 Fix T98884: Fix edge case crashes in gpu subdiv cache code 2022-07-04 01:34:54 -07:00
7be07a9d6e Cleanup: use local variable in smear code instead of ss->cache->bstrength 2022-07-04 01:19:14 -07:00
a720a4aabb Fix T98698: Division by zero in smear code when strength is zero 2022-07-04 01:17:19 -07:00
c5d3846b10 Fix use-after-free error when handling events that close windows
Regression in [0] caused operations such as file-load or file-new
from any window besides the first to write into the freed:
`wmWindow.eventstate`.

Resolve by copying the event instead of restoring the region relative
cursor position after modifying it.

[0]: 789b1617f7
2022-07-04 16:24:04 +10:00
cbb897070d Cleanup: remove unused WM_event_is_last_mousemove
This was part of walk-mode logic that implemented it's own cursor-grab,
now this has been moved to use GHOST's cursor grabbing,
it's no longer needed.
2022-07-04 16:04:34 +10:00
148dcb3954 Cleanup: spelling in comments 2022-07-04 15:26:57 +10:00
faa97de208 Cleanup: correct function signature for UI_block_add_view for grid_view 2022-07-04 15:07:02 +10:00
9dd27a2c87 UV: Improve UV Straighten operator
Improves UV Straighten in several ways:
- Operate on entire selection.
- One straighten for each selected island.
- Prefers pins to anchor the endpoints of the resulting line.

Differential Revision: D15121
Resolves: T78553
2022-07-04 13:45:48 +12:00
929811df63 Cleanup(UV): Refactor UV Align and UV Straighten (No user visible changes)
Move functionality into uvedit_uv_align_weld and uvedit_uv_straighten.

Prep for D15121
2022-07-04 13:45:48 +12:00
f4a9a3767e Cleanup: Rename curve segment count function
`curve_segment_num` -> `segments_num`.
The "curve" prefix is reduntant for a function in the curve namespace.
2022-07-03 20:44:56 -05:00
e86c2f7288 UI: Move rename buffer management to new view base class
Renaming is a nice example of a feature that shouldn't need a specific
implementation for a specific view type (e.g. grid or tree view). So it's
something that can be supported in the general view code. Individual views can
use it "for free" then. This ports the view level part of the renaming code,
the view item level part of it can be ported once we have a common base class
for the view items.
2022-07-03 01:55:38 +02:00
c355be6fae UI: Add AbstractView base class for views, unify reconstruction in there
No user visible changes expected.

There's plenty of duplicated code in the grid and the tree view, and I expect
this to become more. This starts the process of unifying these parts, which
should also make it easier to add new views. Complexity in the view classes is
reduced, and some type shenanigans for C compatibility and general view
management can be removed, since there is now a common base type.

For the start this ports some of the view reconstruction, where the view and
its items are compared to the version of itself in the previous redraw, so that
state (highlighted, active, renaming, collapsed, ...) can be preserved.
Notifier listening is also ported.
2022-07-03 01:55:38 +02:00
Iliay Katueshenock
4ffee9a48d Fix T99316: Crash with no font in String to Curves node
If you remove the default font from the project, the node will not
have the selected font. In this case, there is no check that the font
does not exist. This suggestion adds an error message if the font
is not specified.

Differential Revision: https://developer.blender.org/D15337
2022-07-02 18:37:32 -05:00
ab444a80a2 BLI: refactor length parameterization
This refactor had two main goals:
* Simplify the sampling code by using an algorithm with fewer special cases.
* Generalize the sampling to support non-sorted samples.

The `SampleSegmentHint` optimization was inspired by `ValueAccessor` from
OpenVDB and improves performance 2x in my test cases.

Differential Revision: https://developer.blender.org/D15348
2022-07-02 21:51:58 +02:00
69ee9ca90e Fix: Build error with unity builds off after recent cleanup
Mistake in df8d96ab66
2022-07-02 13:04:55 -05:00
01d7dedd74 Revert "Start of Bevel V2, as being worked on with task T98674."
This reverts commit 9bb2afb55e.
Oops, did not intend to commit this to master.
2022-07-02 10:14:26 -04:00
9bb2afb55e Start of Bevel V2, as being worked on with task T98674.
This is the start of a geometry node to do edge, vertex, and face
bevels.

It doesn't yet do anything but analyze the "Vertex cap" around
selected vertices for vertex bevel.
2022-07-02 10:09:18 -04:00
5d9ade27de BLI: improve span access to virtual arrays
* Make the class names more consistent.
* Implement missing move-constructors and assignment-operators.
2022-07-02 11:45:57 +02:00
3c60d62dba BKE: fix wrong recently added assert 2022-07-02 11:40:36 +02:00
d0e3388848 Cleanup: Simplify logic building in length parameterization
We can construct an IndexRange directly rather than retrieving it.
2022-07-01 09:46:27 -05:00
da00d62c49 Fix crash with window decorations (libdecor) in Wayland
Surfaces from window decorations were passed into GHOST's listeners
since libdecor & GHOST share a connection.

This error introduced by recent changes that assumed surfaces passed to
GHOST's handler functions were owned by GHOST.

Tag GHOST surfaces & outputs to ensure GHOST only attempts to access
data it created.
2022-07-01 22:50:58 +10:00
56b218296c Fix T99268: LineArt better handling for dense overlappings.
Two main fixes:
- Split tiles only when we are more sure that it will improve distribution.
- Discard edges and chains that are not gonna be used afterwards before chaining.

This speeds up the whole process and also eliminates unnecessary tile splitting.

Reviewed By: Sebastian Parborg (zeddb)

Differential Revision: https://developer.blender.org/D15335
2022-07-01 20:46:17 +08:00
b683a37824 Fix T99301: RNA_boolean_get warning when saving a file for the first time
Caused by [0], RNA_struct_property_is_set also functioned to check if
the property existed.

[0]: 6a2c42a0d5
2022-07-01 20:54:47 +10:00
5e5fe217ca Cleanup: rename internal cursor grabbing function
This function was named as if it was part of GHOST's API but was
in fact an internal utility.
2022-07-01 20:35:11 +10:00
41c10ac84a Cycles: fix support for multiple Intel GPUs
Identical Intel GPUs ended up with the same id.
Added PCI BDF to the id to make it unique.
2022-07-01 11:20:00 +02:00
e7a21275c0 IO: print import & export times of Alembic & USD
Many existing importers/exporters do log the time it takes to system
console (some others log more information too). In particular, OBJ
(C++ & python), STL (C++ & python), PLY, glTF2 all log the time it
takes. However, neither USD nor Alembic do. And also it's harder to
know the time it takes there from a profiler, since all the work
normally is done on a background job and is split between several
threads (so you can't just find some top-level function and see how
much time it took).

This change:

- Adds import/export time logging to USD & Alembic importer/exporter,
- In the time utility class (also used by OBJ & STL), improve the
  output formatting: 1) print only one decimal digit, 2) for long
  times, print seconds and also produce a hours:minutes:seconds form.

Reviewed By: Michael Kowalski, Kévin Dietrich
Differential Revision: https://developer.blender.org/D15170
2022-07-01 12:17:50 +03:00
Jason Fielder
4527dd1ce4 Metal: MTLMemoryManager implementation includes functions which manage allocation of MTLBuffer resources.
The memory manager includes both a GPUContext-local manager which allocates per-context resources such as Circular Scratch Buffers for temporary data such as uniform updates and resource staging, and a GPUContext-global memory manager which features a pooled memory allocator for efficient re-use of resources, to reduce CPU-overhead of frequent memory allocations.

These Memory Managers act as a simple interface for use by other Metal backend modules and to coordinate the lifetime of buffers, to ensure that GPU-resident resources are correctly tracked and freed when no longer in use.

Note: This also contains dependent DIFF changes from D15027, though these will be removed once D15027 lands.

Authored by Apple: Michael Parkin-White

Ref T96261

Reviewed By: fclem

Maniphest Tasks: T96261

Differential Revision: https://developer.blender.org/D15277
2022-07-01 10:31:57 +02:00
3ffc558341 Sculpt Curves: UI tweaks and shortcut
* Minimum Distance -> Distance Mix
* Max Count -> Count Max
* Shift + A for selection grow

This follows better the names we have in geometry nodes in the Distribute Points
node when using the Poisson Disk method (Distance Min, Distance Max).

The shortcut for the selection grow is the same we use in mesh sculpt
for the Expand Mask operator (which behaves a bit similar).
2022-07-01 10:23:58 +02:00
0554537c3c Cleanup: add missing license headers in Cycles oneAPI implementation 2022-07-01 10:13:07 +02:00
bb8953ab49 GHOST/Wayland: map additional cursors from GHOST_TStandardCursor 2022-07-01 18:11:19 +10:00
5b7e7d67a5 Cleanup: GPUCodegen: Remove unused variables 2022-07-01 10:10:58 +02:00
4cba209edd GPUMaterial: Remove the max attribute check
This is needed to make the GPU_attribute used as generic input mechanism.
2022-07-01 10:10:58 +02:00
ccbf9ee482 Fix un-grab cursor positioning failing for Wayland
UI elements such as sliders & color picker set an un-grab location
which GHOST/Wayland didn't implement.
2022-07-01 18:06:20 +10:00
eff62ea8ab Geometry Nodes: remove warning in Points node
Generating no points in some frames is a perfectly valid use case.
2022-07-01 10:04:35 +02:00
5d57d9f899 Cleanup: remove unused variable 2022-07-01 09:55:20 +02:00
e4bf58e285 Tracking: Image from Plane Marker operators
There are two operators added, which are available via a special
content menu next to the plane track image selector:

- New Image from Plane Marker
- Update Image from Plane Marker

The former one creates an image from pixels which the active plane
track marker "sees" at the current frame and sets it as the plane
track's image.

The latter one instead of creating the new image data-block updates
the image in-place.

This allows to create unwarped texture from a billboard from footage.
The intent is to allow this image to be touched up and re-projected
back to the footage with an updated content.

Available from a plane track image context menu, as well as from the
Track menu.

{F13243219}

The demo of the feature from Sebastian Koenig: https://www.youtube.com/watch?v=PDphO-w2SsA

Differential Revision: https://developer.blender.org/D15312
2022-07-01 09:44:07 +02:00
72b9e07cf2 Add helper function to replace buffer of a single-frame image
Very similar to BKE_image_add_from_imbuf with the exception that no
new image data-block is created, but instead the given one is modified.
2022-07-01 09:44:07 +02:00
dfa5bd689e Fix possible wrong image color space when it is created from image buffer
From quick look it doesn't seem to be leading to real issues yet as the
image buffers are created with the default roles, but valid color space
is needed to be ensured for an upcoming development.
2022-07-01 09:44:07 +02:00
c922b9e2c1 Fix image-from-imbuf resulting in invalid image configuration
The image which source is set to file is not expected to have empty
file path. If it happens it becomes very tricky to save the image on
exit using the standard quit dialog.

This change makes it so if the image buffer does not have file path
then the new image is set to the "generated" source and it behaves
as if the image was created like so and was fully painted on.

Additionally, mark image as dirty, so that quitting Blender after
such image was added will warn about possible data loss.
2022-07-01 09:44:07 +02:00
b872ad037a Fix T99315: Unit plane track deform compositor node leads to unnecessary blur 2022-07-01 09:42:48 +02:00
16264aebe6 Fix sequencer transform test failing.
Issue was caused by using function `SEQ_render_give_stripelem` to obtain
first `StripElem`, but this function now takes retiming into account.

Since first element was meant to be obtained, point to it directly by
using `seq->strip->stripdata`.
2022-07-01 09:02:07 +02:00
b1d3b14711 Fix crash when creating an off-screen context fails in Wayland
This is very unlikely to happen but better not to crash.
2022-07-01 15:33:51 +10:00
650a15fb9b Fix accessing windows from surfaces in Wayland
This is a follow up to [0], where it was assumed flushing the output
would run the appropriate leave handlers & clear the keyboard & pointer
surfaces. While that's mostly true it's not guaranteed.

Resolve this by clearing the pointers when closing windows and add NULL
checks before accessing the windows.

Tested with Gnome, KDE & River compositors.

[0]: 58ccd8338e
2022-07-01 15:16:45 +10:00
bd7b181e10 Cleanup: Remove outdated comments
Point clouds always use geometry_set_eval, and so do volumes.
2022-06-30 21:52:04 -05:00
df8d96ab66 Cleanup: Remove unnecessary includes from geometry nodes header 2022-06-30 21:51:13 -05:00
276e419671 Curves: Avoid initializing offsets when first allocated
The offsets array that encodes the sizes of each curve must be filled
anyway, or the curves will be in an invalid state. Calloc is unnecessary
here. To make that situation clearer, fill the offsets with -1 in debug
builds. Always set the first offset to zero though, since that can save
some boilerplate in other areas.
2022-06-30 21:42:09 -05:00
7e55ff15b0 Fix: Incorrectly sized curves created in set conversion node
The number of points in the source curve was needed, but the offset
(just zero) was passed instead. It's unclear how this worked before.
A mistake in the recent commit 9e393fc2f1.

Also use a common utility for retrieving the sizes of curves
in ranges instead of reimplementing it for this file.
2022-06-30 21:33:11 -05:00
3d3ba9ca8e Cleanup: group public utility functions for Wayland System/Window
GHOST methods were mixed in with Wayland specific utility functions,
making it difficult to navigate or know where to add new functions.
2022-07-01 11:19:01 +10:00
cf64a1d73e Cleanup: spelling in comments 2022-07-01 11:18:58 +10:00
90f4b35bc2 Cleanup: remove unused argument 2022-07-01 11:18:56 +10:00
c15ae2e87b Fix: Correct attribute names in resample curves code 2022-06-30 19:30:06 -05:00
4206b30275 Curves: Adjust "for each curve by type" utility
The first change is reusing the same vector for all types. While we don't
generally optimize for the multi-type case, it doesn't hurt here. The
second change is avoiding calling the corresponding function if there
are no curves of a certain type. This avoids creating attributes for
types that aren't used, for example.
2022-06-30 19:29:32 -05:00
32e9c9802e Cleanup: Add assert for customdata realloc size
This gives a more clear error than finding the error with the signed
to unsigned conversion for size_t.
2022-06-30 19:27:41 -05:00
6161ce6e5d Cleanup: Add assert for unsupported legacy curve type 2022-06-30 19:26:51 -05:00
982d6589a8 Cleanup: Remove duplicate include 2022-06-30 19:25:44 -05:00
a69e5c2348 Cleanup: Avoid assigning constructed VArray to reference
This is clearer about what is actually happening (VArray is small
enough to be a by-value type and is constructed on demand, while
only the generic virtual array is stored).
2022-06-30 19:17:32 -05:00
95055af668 Fix T99309: Duplicate elements deletes instance attributes
The node had incorrect handling of instance attributes. For the instance
component, instead of using the instance domain over the point domain,
it just looked through instances recursively when retrieving attributes.
We never want to do that, since we only work on one geometry at a time.
Instead, just switch out the instance domain for the point domain like
the set position node.
2022-06-30 19:01:02 -05:00
Gaia Clary
106d937a4e COLLADA: Support for alpha color in vertex data.
Many thanks to the original Author of this patch: Christian Aguilera

The COLLADA importer was silently ignoring the alpha component in the
vertex data.

The `stride` variable holds the component count (3 for RGB; 4 for RGBA),
and can be used for honouring the alpha channel in the vertex data.

Test plan:
- Open Blender.
- Clear the scene.
- Add a plane.
- Enter **Vertex Paint** mode.
- Switch to the **Erase Alpha** blending mode.
- Select a tone of gray.
- Turn strength down to less than 1
- Paint [some of] the vertices of the plane.
- Export project as a COLLADA file (`.dae`).
- Clear the scene.
- Re-import the COLLADA file again.
- Export the project again (with different name).

**Without** this patch, the second exported project will have lost the
alpha component in their vertex data:

```lang=xml, counterexample
<float_array id="Plane-mesh-colors-Col-array" count="24">1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1</float_array>
```

**With** the patch, the first and the second exported projects retain
the alpha values painted previously:

```lang=xml
<float_array id="Plane-mesh-colors-Col-array" count="24">1 1 1 1 1 1 1 0.5490196 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0.5490196</float_array>
```

Reviewed By: cristian64, SonnyCampbell_Unity
Authored by: Christian Aguilera

Differential Revision: https://developer.blender.org/D14246
2022-06-30 23:13:37 +02:00
f18067aa03 EEVEE-Next: Add Film and RenderBuffers module
This modules handles renderpasses allocation and filling. Also handles
blitting to viewport framebuffer and render result reading.

Changes against the old implementation:
- the filling of the renderpasses happens all at once requiring
  only 1 geometry pass.
- The filtering is optimized with weights precomputed on CPU and
  reuse of neighboor pixels.
- Only one accumulation buffer for renderpasses (no ping-pong).
- Accumulation happens in one pass for every passes using a single
  dispatch or fullscreen triangle pass.

TAA and history reprojection is not yet implemented.
AOVs support is present but with a 16 AOV limit for now.
Cryptomatte is not yet implemented.
2022-06-30 22:45:42 +02:00
a9696f04a0 Fix T90964: Strip can't be deleted if cursor is at bottom of timeline
Caused by hard-coded width of markers region causing operator to pass
through.

Execute operator if there are no markers.
2022-06-30 20:45:37 +02:00
fbcc00d10d Fix broken Cycles performance benchmark after recent logging changes
Ensure full render report is printed with default verbosity.
2022-06-30 19:51:50 +02:00
c9795102c2 Fix build error with Alembic after 65166e145b 2022-06-30 19:47:21 +02:00
e7c58941b1 Fix pointer to pointer passed where single pointer is expected (VSE versioning) 2022-06-30 18:42:22 +02:00
65166e145b Cleanup: Remove scene frame macros (CFRA et al.)
Removes the following macros for scene/render frame values:
- `CFRA`
- `SUBFRA`
- `SFRA`
- `EFRA`

These macros don't add much, other than saving a few characters when typing.
It's not immediately clear what they refer to, they just hide what they
actually access. Just be explicit and clear about that.
Plus these macros gave read and write access to the variables, so eyesores like
this would be done (eyesore because it looks like assigning to a constant):
```
CFRA = some_frame_nbr;
```

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D15311
2022-06-30 18:38:44 +02:00
66de653784 Fix incorrect strip position if pitch was animated
Commit 302b04a5a3 introduced new retiming system, that unified sound
pitch animation with strip speed control. Because sound playback is
handled in different way, this did not work as expected and old files
were broken. In addition animation was not copied to new property.

Revert length position and offset handling for sound strips so their
position does not change and remap fcurves to new `speed_factor`
property.
2022-06-30 18:33:34 +02:00
Patrick Huang
79fe27b976 Fix T96429: outliner tooltip inconsistent with behavior when linking collections
Previously, it would show "Link inside collection" but move between collections
instead in some cases. Additionally there was no tooltip for the "Link before/
after/between collections" case.

Behavior and tooltip should now be consistent in all cases.

Differential Revision: https://developer.blender.org/D15237
2022-06-30 17:19:48 +02:00
34e04ccde2 Cleanup: fix compiler warnings
"override" should be used either for all methods or none, otherwise Clang gives
warnings. Adding it for all platforms is a bigger change.
2022-06-30 17:17:25 +02:00
ef268c7893 Build: Fix build of library dependencies on Linux aarch64
rBb9c37608a9e959a896f5358d4ab3d3d001a70833 moved evaluation of
`versions.cmake` before `options.cmake`, as a result of which
`BLENDER_PLATFORM_ARM` was no longer defined in `versions.cmake`,
causing it to choose the wrong OpenSSL version for aarch64. This
reverts that. Also fixes a compiler crash when building flex with some
glibc versions.

Differential Revision: https://developer.blender.org/D15319
2022-06-30 16:49:42 +02:00
Andrii Symkin
f00d9e80ae Cycles: add more math functions for float4
Add more math functions for float4 to make them on par with float3 ones. It
makes it possible to change the types of float3 variables to float4 without
additional work.

Differential Revision: https://developer.blender.org/D15318
2022-06-30 16:25:21 +02:00
6bb703a9ee Fix T99266: Crash when dragging file to VSE from file browser
Crash happened because sequencer data was not initialized. Ensure data
is initialized before adding strip.
2022-06-30 15:56:08 +02:00
8bf9d482da Cleanup: colon after params, move text into public doc-strings, spelling 2022-06-30 23:48:22 +10:00
58ccd8338e GHOST/Wayland: clarify window access from surfaces
It wasn't obvious when direct access or lookups should be used.

Add class methods for direct lookups as well as searching from known
windows when windows are accessed outside Wayland's handlers.

This avoids having to check if the window has been removed in some cases.
2022-06-30 23:46:57 +10:00
7c98632289 GHOST/Wayland: use flush instead of roundtrip
Using flush avoids handling new events which complicates logic here.
2022-06-30 23:46:57 +10:00
cfd087673d Fix key/dnd event handling accessing freed memory under Wayland
Closing a window could leave danging pointers which Wayland
callbacks are responsible for clearing.

However, any calls Blender makes that don't originate from Wayland's
handlers don't have that assurance (key-repeat in this case).

Resolve by using a window lookup on each key-repeat event.
2022-06-30 23:46:57 +10:00
1cf64434ed Fix accessing cursor position for GHOST/Wayland
GHOST_GetCursorPosition wasn't working properly under Wayland because
the last focused window didn't necessarily match the window used to call
wm_cursor_position_get(..).

Now the window passed into wm_cursor_position_get is passed to GHOST
so that window is used to access cursor coordinates.
2022-06-30 23:46:57 +10:00
6bd2c6789b GHOST: get/set cursor position now uses client instead of screen coords
Use client (window) relative coordinates for cursor position access,
this only moves the conversion from window-manager into GHOST,
(no functional changes).

This is needed for fix a bug in GHOST/Wayland which doesn't support
accessing absolute cursor coordinates & the window is needed to properly
access the cursor coordinates.

As it happens every caller to GHOST_GetCursorPosition was already making
the values window-relative, so there is little benefit in attempting to
workaround the problem on the Wayland side.

If needed the screen-space versions of functions can be exposed again.
2022-06-30 23:46:57 +10:00
df40e9d0aa Fix memory leak with off-screen buffers under Wayland
Each off-screen buffer created a surface and EGL window which was
only freed when Blender exited.

Resolve by freeing the associated data when disposing the off-screen
context.
2022-06-30 23:46:57 +10:00
e190b70946 Cleanup: declare GHOST/Wayland methods const
Needed when called by functions that are const too.
2022-06-30 23:46:57 +10:00
e75f3e3feb Cleanup: use "use_" prefix for boolean property 2022-06-30 23:46:57 +10:00
90ccb71969 Fix missing argument, avoid instancing function call in macro 2022-06-30 23:44:13 +10:00
547efb6b1e Fix T99133:animating multiply factor on video strips crashes blender
Crash caused by `effect_seq->len` being 0, so frame map was not built.

Get length in timeline using handle positions.
2022-06-30 15:31:58 +02:00
Amélie Fondevilla
92d7f9ac56 Animation: Add GP layers in regular Dopesheet
Grease Pencil animation channels are now also shown in the Dopesheet
mode of the Dopesheet editor and in the Timeline.

Grease pencil related events are now listened not only by container
`SACTCONT_GPENCIL` (Grease Pencil Dopesheet), but also
`SACTCONT_DOPESHEET` (main Dopesheet), and `SACTCONT_TIMELINE`
(timeline).

A new Animation Filter flag was added: `ANIMFILTER_FCURVESONLY`. For now
this only filters out Grease Pencil Layer channels.

**Implemented:**

- Preview range set: now only considers selected Grease Pencil keyframes
  when `onlySel` parameter is true. Not only this allows the operator to
  work with grease pencil keyframes in main dopesheet, but it also fixes
  the operator in the Grease Pencil dopesheet.
- Translation: allocation (and freeing) of specific memory for
  translation of Grease Pencil keyframes.
- Copy/Paste: call to both Fcurve and GPencil operators, to allow for
  mixed selection. Errors are only reported when both the FCurve and
  GPencil functions fail to paste anything.
- Keyframe Type change and Insert Keyframe: removed some code here to
  unify Grease Pencil dopesheet and main dopesheet code.

- Jump, Snap, Mirror, Select all/box/lasso/circle, Select left/right,
  Clickselect: account for Grease Pencil channels within the channels
  loop, no need for `ANIMFILTER_FCURVESONLY` there.

**Not Implemented:**

- Graph-related operators. The filter `ANIMFILTER_FCURVESONLY` is
  naively added to all graph-related operators, meaning more-or-less all
  operators that used `ANIMFILTER_CURVE_VISIBLE`.
- Select linked: is for F-curves channel only
- Select more/less: not yet implemented for grease pencil layers.
- Clean Keys, Sample, Extrapolation, Interpolation, Easing, and Handle
  type change: work on Fcurve-channels only, so the
  `ANIMFILTER_FCURVESONLY` filter is activated

Graying out these operators (when no fcurve keyframe is selected) can be
done with custom poll functions BUT may affect performance. This is NOT
done in this patch.

**Dopesheet Summary Selection:**

The main summary of the dopesheet now also takes into account Grease
Pencil keyframes, using some nasty copy/pasting of code, as explained
[on devtalk](https://devtalk.blender.org/t/gpencil-layers-integration-in-main-dopesheet-selection-issue/24527).
It works, but may be improved, providing some deeper changes.

Reviewed By: mendio, pepeland, sybren

Maniphest Tasks: T97477

Differential Revision: https://developer.blender.org/D15003
2022-06-30 15:20:18 +02:00
416aef4e13 Curves: New tools for curves sculpt mode.
This commit contains various new features for curves sculpt mode
that have been developed in parallel.

* Selection:
  * Operator to select points/curves randomly.
  * Operator to select endpoints of curves.
  * Operator to grow/shrink an existing selection.
* New Brushes:
  * Pinch: Moves points towards the brush center.
  * Smooth: Makes individual curves straight without changing the root
    or tip position.
  * Puff: Makes curves stand up, aligning them with the surface normal.
  * Density: Add or remove curves to achieve a certain density defined
    by a minimum distance value.
  * Slide: Move root points on the surface.

Differential Revision: https://developer.blender.org/D15134
2022-06-30 15:09:13 +02:00
Nate Rupsis
0f22b5599a Normalize Weights: use valid default Subset for current context
For the Normalize Weights operator, dynamically set the default 'Subset'
parameter so that it is applicable to the current context.

When the user's last use of Normalize Weights was set to "Deform Pose
Bones", and then tries to use the operator on a mesh without armature,
Blender would try to use the previous opertor properties and show an
error message. This is resolved by switching to `WT_VGROUP_ACTIVE` in
such cases.

Reviewed By: zanqdo, sybren

Maniphest Tasks: T95038

Differential Revision: https://developer.blender.org/D14961
2022-06-30 12:54:27 +02:00
4a7e1c9209 Constraints: rename and refactor custom space initialization.
Rename and simplify the function for initializing the custom space,
avoiding the need for the calling code to be aware of the internals
of bConstraintOb. This patch should not change any behavior.

This was split off from D9732.

Differential Revision: https://developer.blender.org/D15252
2022-06-30 12:51:26 +03:00
c64d1b23df Fix numerical issues with plane track compositor node with empty input
No changes in the interface, but avoids spam in the console about
inability to find a solution for homography transform from singularity.
2022-06-30 11:10:19 +02:00
b544225202 Fix (unreported) liboverride resync creating garbage data in some cases.
Regression caused by the introduction of partial resync in February 2022
(rB1695d38989fd482d3c). Code was missing adding some existing overrides
to the mapping in some specific cases, causing resync to create 'new'
ones instead of re-using existing ones.

This commit also adds a basic resync testcase that illustrates this
issue.
2022-06-30 10:33:44 +02:00
acdc043c30 Revert "Revert "LibOverride: Handle dependencies in both directions in partial override cases.""
This reverts commit rB31d80ddeaad, and fixes issue introduced in rBf0b4aa5d59e3
by not doing the 'reversed dependency check' in resync case.

Rational here are:
* Supporting reversed dependency in a reliable, coinsistent way in
  resync is likely to be a nightmare, if even possible at all.
* Needs for such reversed dependency in resync should be close to 0% of
  cases, as long as users remain reasonable with their organization of
  their assets (it could only become a problem in extreme bad practice
  and corner cases, like a geometry object being added as a child of a
  rig in a completely new, otherwise un-overridden collection, in
  partial override context).

This decision may need to be re-evaluated later in case we go more
towards a very highly partial-override  workflow, but even then I would
expect current solution to work fine in all reasonable use cases.
2022-06-30 10:33:09 +02:00
edbf04ff37 Fix T99290: Wrong color management of plane track image preview
Always consider images as "View as Render" for the plane track image drawing.
2022-06-30 10:24:33 +02:00
Iyad Ahmed
5c726dd4ef Fix C++ STL importer unused function result warning
Fix unused function result warnings for usages of `fread` in the C++
.stl importer, by actually using the returned error code.

Reviewed By: sybren

Differential Revision: https://developer.blender.org/D15189
2022-06-30 10:14:08 +02:00
c39e932631 Fix T99196: sculpt_update_object calls paint updates for nonpaint tools
Specifically BKE_texpaint_slots_refresh_object was being called, which
causes cycles to reset at strange times (like moving the mouse cursor
in pose, boundary and various other tools).

This (along with some code that checks if the pbvh pixels need
to be rebuilt) is only run if is_paint_mode (which used to be
needs_colors) is true.
2022-06-29 23:31:08 -07:00
2185943235 Sculpt: Fix a few bugs revealed by SCULPT_TOOL_NEEDS_COLOR name change
* Color attributes are no longer auto-created when painting an image.
* Workbench shading type is no longer automatically changed to
  Attribute for image paint.
2022-06-29 23:22:06 -07:00
f7c6d3705d Cleanup: Renamed SCULPT_TOOL_NEEDS_COLOR to SCULPT_tool_is_paint
Old name is confusing since SCULPT_TOOL_PAINT can paint
on images too, and it's planned for smear to as well.
2022-06-29 23:11:24 -07:00
3cefa13770 Fix T98886: PBVH_GRIDS ignores face smooth flag on first gpu build 2022-06-29 21:05:21 -07:00
feeb8310c8 Cleanup: format 2022-06-30 12:14:23 +10:00
b6c28002ac Cleanup: spelling in comments 2022-06-30 12:14:22 +10:00
209f2b85d7 Cleanup: quiet warning, remove punctuation in description 2022-06-30 12:14:20 +10:00
011327224e Transform Snap: nearest face snap mode, snapping options, refactoring.
This commit adds a new face nearest snapping mode, adds new snapping
options, and (lightly) refactors code around snapping.

The new face nearest snapping mode will snap transformed geometry to the
nearest surface in world space. In contrast, the original face snapping
mode uses projection (raycasting) to snap source to target geometry.
Face snapping therefore only works with what is visible, while nearest
face snapping can snap geometry to occluded parts of the scene. This new
mode is critical for retopology work, where some of the target mesh
might be occluded (ex: sliding an edge loop that wraps around the
backside of target mesh).

The nearest face snapping mode has two options: "Snap to Same Target"
and "Face Nearest Steps". When the Snap to Same Object option is
enabled, the selected source geometry will stay near the target that it
is nearest before editing started, which prevents the source geometry
from snapping to other targets. The Face Nearest Steps divides the
overall transformation for each vertex into n smaller transformations,
then applies those n transformations with surface snapping interlacing
each step. This steps option handles transformations that cross U-shaped
targets better.

The new snapping options allow the artist to better control which target
objects (objects to which the edited geometry is snapped) are considered
when snapping. In particular, the only option for filtering target
objects was a "Project onto Self", which allowed the currently edited
mesh to be considered as a target. Now, the artist can choose any
combination of the following to be considered as a target: the active
object, any edited object that isn't active (see note below), any non-
edited object. Additionally, the artist has another snapping option to
exclude objects that are not selectable as potential targets.

The Snapping Options dropdown has been lightly reorganized to allow for
the additional options.

Included in this patch:

- Snap target selection is more controllable for artist with additional
  snapping options.
- Renamed a few of the snap-related functions to better reflect what
  they actually do now. For example, `applySnapping` implies that this
  handles the snapping, while `applyProject` implies something entirely
  different is done there. However, better names would be
  `applySnappingAsGroup` and `applySnappingIndividual`, respectively,
  where `applySnappingIndividual` previously only does Face snapping.
- Added an initial coordinate parameter to snapping functions so that
  the nearest target before transforming can be determined(for "Snap to
  Same Object"), and so the transformation can be broken into smaller
  steps (for "Face Nearest Steps").
- Separated the BVH Tree getter code from mesh/edit mesh to its own
  function to reduce code duplication.
- Added icon for nearest face snapping.
- The original "Project onto Self" was actually not correct! This option
  should be called "Project onto Active" instead, but that only matters
  when editing multiple meshes at the same time. This patch makes this
  change in the UI.

Reviewed By: Campbell Barton, Germano Cavalcante

Differential Revision: https://developer.blender.org/D14591
2022-06-29 20:52:00 -04:00
0ea282f746 Geometry Nodes: Only calculate mesh to volume bounds when necessary
In "size" voxel resolution mode, calculating the bounds of the mesh to
volume node's input mesh isn't necessary. For high poly this can take
a few milliseconds, so this commit skips the calculation unless we need
it for the "Amount" mode.

Differential Revision: https://developer.blender.org/D15324
2022-06-29 12:28:08 -05:00
Aleksi Juvani
4593fb52cf Geometry Nodes: UV Unwrap and Pack Islands Nodes
This commit adds new Unwrap and Pack Islands nodes, with equivalent
functionality to the existing Unwrap and Pack Islands operators. The
Unwrap node uses generic boolean attributes to determine seams instead
of looking at the seam flags in the mesh geometry.

Unlike the Unwrap operator, the Unwrap node doesn't perform aspect
ratio correction, because this is trivial for the user to implement
with a Vector Math node if it is desired.

The Unwrap node implicitly performs a Pack Islands operation upon
completion, because the results may not be generally useful otherwise.
This matches the behaviour of the Unwrap operator.

The nodes use the existing Vector socket type, and do not introduce a
new 2D Vector type (see T92765).

Differential Revision: https://developer.blender.org/D14389
2022-06-29 12:25:46 -05:00
Martijn Versteegh
d23818fcd9 Attributes: Use attribute renaming function for generic mesh layers
The RNA API in rna_mesh.c has a function to rename generic customdata
layers. However for customdata layers which are attributes (i.e. not
specialized types) the attribute renaming function needs to be used,
as that can ensure unique names across domains.

Differential Revision: https://developer.blender.org/D15310
2022-06-29 11:36:46 -05:00
95964444c6 Cleanup: Clang tidy, unused variable warning 2022-06-29 10:57:28 -05:00
1516f7dcde Geometry Nodes: Add Mesh To Volume Node
This adds a Mesh To Volume Node T86838 based on the existing modifier.
The mesh to volume conversion is implemented in the geometry module,
and shared between the node and the modifier.

Currently the node outputs a grid with the name "density". This may
change in the future depending on the decisions made in T91668.

The original patch was by Kris (@Metricity), further implementation
by Geramy Loveless (@GeramyLoveless), then finished by Erik Abrahamsson
(@erik85).

Differential Revision: https://developer.blender.org/D10895
2022-06-29 10:56:17 -05:00
6b508eb012 Spreadsheet: display byte colors as scene linear floats
The compression as sRGB is mostly an implementation detail and showing the
integers does not make it clear what the actual values are that will be used
for computations in geometry nodes. This follows the general convention that
colors in Blender are displayed and edited in scene linear floats.

The raw sRGB bytes can still be viewed as a tooltip.

Ref T99205

Differential Revision: https://developer.blender.org/D15322
2022-06-29 17:08:50 +02:00
6dd8ceef2a LineArt: Shadow and related functionalities.
This patch includes the full shadow functionality for LineArt:

- Light contour and cast shadow lines.
- Lit/shaded region selection.
- Enclosed light/shadow shape calculation.
- Silhouette/anti-silhouette selection.
- Intersection priority based on shadow edge identifier.

Reviewed By: Sebastian Parborg (zeddb)

Differential Revision: https://developer.blender.org/D15109
2022-06-29 22:54:29 +08:00
Arye Ramaty
2ac5b55289 UI: add tooltips for nodes to the shader node add menu
These are based on the descriptions from the manual, with various changes.

Differential Revision: https://developer.blender.org/D15309
2022-06-29 16:19:24 +02:00
b708f45922 Fix T99248: GPencil Sculpt Grab/Push don't work with one point
There were two problems:

1) The checking of the collision was not working with one point only.
2) For one point, the masking was checked always and if the masking was not activated, the stroke was skipped.
2022-06-29 16:07:13 +02:00
a5ac0375b0 Fix T98697: EEVEE: Regression: Missing custom property from volumetrics
The resource binding were missing from the shading group
(`shgroup->uniform_attrs`), leading to no custom property UBO creation
(`drw_uniform_attrs_pool_update`) when issuing the drawcall,
resulting in a missing UBO bind.

The fix make sure to no duplicate the bindings by creating a simple
shader bind instead of a `GPUMaterial` bind.

Candidate for 3.2.1 corrective release.
2022-06-29 14:12:03 +02:00
45fb7a1db5 Fix T98825: EEVEE: Regression: Buffer overflow in sample name buffer
This happened because of the false assumption that `std::array<char, 32>`
would be treated as a container and not relocate their content if the
`Vector` would grow. Replacing with actual object allocation fixes the
issue.

Candidate for 3.2.1 corrective release.
2022-06-29 14:12:03 +02:00
4a9f60ecd2 Fix T99104: EEVEE: Regression: Crash when using Light Output in Materials
Using Light output is supported in Cycles. This patch adds support for it
and remove the crash in `ntree_shader_weight_tree_invert()` by treating
it as any other outputs.

Candidate for 3.2.1 corrective release.
2022-06-29 14:12:03 +02:00
40f40e9931 Fix T99128: EEVEE: Regression: Pixelated Environment Texture
Use view position to retreive world space direction to retain float
precision.

Candidate for 3.2.1 corrective release.
2022-06-29 14:12:03 +02:00
70c6beeafb Fix T99138: EEVEE: Regression: World volume shader incorrect texture coords
The ORCO property was not being properly initialized in this case.

Candidate for 3.2.1 corrective release.
2022-06-29 14:12:03 +02:00
087e95d0fe Cleanup: correct type for sequencer SWAP macro 2022-06-29 22:02:04 +10:00
a02992f131 Cycles: Add support for rendering on Intel GPUs using oneAPI
This patch adds a new Cycles device with similar functionality to the
existing GPU devices.  Kernel compilation and runtime interaction happen
via oneAPI DPC++ compiler and SYCL API.

This implementation is primarly focusing on Intel® Arc™ GPUs and other
future Intel GPUs.  The first supported drivers are 101.1660 on Windows
and 22.10.22597 on Linux.

The necessary tools for compilation are:
- A SYCL compiler such as oneAPI DPC++ compiler or
  https://github.com/intel/llvm
- Intel® oneAPI Level Zero which is used for low level device queries:
  https://github.com/oneapi-src/level-zero
- To optionally generate prebuilt graphics binaries: Intel® Graphics
  Compiler All are included in Linux precompiled libraries on svn:
  https://svn.blender.org/svnroot/bf-blender/trunk/lib The same goes for
  Windows precompiled binaries but for the graphics compiler, available
  as "Intel® Graphics Offline Compiler for OpenCL™ Code" from
  https://www.intel.com/content/www/us/en/developer/articles/tool/oneapi-standalone-components.html,
  for which path can be set as OCLOC_INSTALL_DIR.

Being based on the open SYCL standard, this implementation could also be
extended to run on other compatible non-Intel hardware in the future.

Reviewed By: sergey, brecht

Differential Revision: https://developer.blender.org/D15254

Co-authored-by: Nikita Sirgienko <nikita.sirgienko@intel.com>
Co-authored-by: Stefan Werner <stefan.werner@intel.com>
2022-06-29 12:58:04 +02:00
302b04a5a3 VSE: Improved Retiming system
Patch implements better way to control playback speed than it is
possible to do with speed effect. Speed factor property can be set in
Time panel.

There are 2 layers of control:

Option to retime movie to match scene FPS rate.
Custom speed factor to control playback rate.
Since playback rate is strip property, it is now possible to manipulate
strip as normal one even if it is retimed.

To facilitate manipulation, some functions need to consider speed factor
and apply necessary corrections to strip offset or strip start. These
corrections may need to be float numbers, so start and offsets must be
float as well.

Sound strips now use speed factor instead of pitch. This means, that
strips will change length to match usable length. In addition, it is
possible to group movie and sound strip and change speed of meta strip.
2022-06-29 12:48:34 +02:00
c51b8ec863 BLI: add Vector.append_and_get_index with rvalue parameter
This makes it possible to use this method with `std::unique_ptr`.
2022-06-29 12:07:02 +02:00
43b65150ed Fix uninitialized memory use in key-down events on window activation 2022-06-29 18:21:36 +10:00
930398d5b1 GHOST/Wayland: quiet warning with empty title with libdecor
Set the title before showing the window.
2022-06-29 17:34:43 +10:00
6b2dd3e314 GHOST/Wayland: support older output manager (for Weston support)
Support zxdg_output_manager_v1 v2, as weston only supports this.

Even though it's a reference implementation it can be useful for testing.
2022-06-29 17:34:41 +10:00
b1163d2198 Mantaflow: disable call to MANTA::terminateMantaflow
Effectively revert [0] as it ran when freeing individual modifiers,
causing a crash on exit in one of the cycles_volume_cpu tests.

[0]: 6777c420db
2022-06-29 17:34:39 +10:00
Jeroen Bakker
66f826ae85 Benchmark: Add eevee viewport playback tests.
This commit adds the ability to test Eevee viewport playback performance tests.

Tests should be placed in `lib/benchmarks/eevee/*/*.blend`. {rBL62962} added
initial test files. See https://wiki.blender.org/wiki/Tools/Tests/Performance how
to set it up.

To record the playback performance the test start the viewport playback, and adds
a post frame change handler.

This handler will go over the next steps:

* Ensures the viewport is set to rendered mode.
* Wait for shaders to be compiled. Utilizes `bpy.app.is_job_running` function when
  available (v3.3) to wait for shader compilation to finish. When not available will wait
  for one minute.
* Draw several warmup frames
* Record for 10 seconds tracking the number of frames drawn and performance counters.
* When ready print the result to the console. The results will be extracted when the
  benchmark has run.

## Example report
```
                                         master               v3.0                 v3.1                 v3.2
T88219                                   0.0860s              0.0744s              0.0744s              0.0851s
blender290-fox                           1.3056s              0.8744s              0.7994s              1.2809s
```

{F13232387}

Reviewed By: brecht, fclem

Maniphest Tasks: T99136

Differential Revision: https://developer.blender.org/D15302
2022-06-29 07:55:51 +02:00
eaec01cad5 Sculpt: Fix backwards normals in PBVH_GRIDS raycasting
Winding order of grid quads was backwards.
2022-06-28 22:30:28 -07:00
2d0877ed7e Fix T99231: Wrong anchored mode test for smear brush 2022-06-28 21:35:55 -07:00
3283bc6367 Cleanup(UV): Remove unused parameter (no functional changes)
Prep for D15263
2022-06-29 13:14:39 +12:00
f32d7dd0c8 Cleanup(UV): Store nboundaries on pchart (no functional changes)
Prep for D15263
2022-06-29 12:31:16 +12:00
68d037190f Cleanup: format 2022-06-29 10:19:02 +10:00
e1dc54c8fc Cleanup: Fix mul_v2_v2_ccw for repeated arguments (no functional changes)
Prep for D15263
2022-06-29 12:14:35 +12:00
6777c420db Mantaflow: call MANTA::terminateMantaflow on exit
terminateMantaflow was never called, this leak is more of a technicality
since it's only called on exit.

Also make Py_Initialize/Py_Finalize optional in Pd:setup/finalize
as it caused Blender to crash, finalizing Python twice.

Add a patch to extern/mantaflow to keep track of changes in Blender
from up-stream.
2022-06-29 10:11:01 +10:00
d94d7a5d8f Cleanup: update curve_fit_nd (no functional changes) 2022-06-29 09:55:44 +10:00
45645936e9 Cleanup: spelling in comments 2022-06-29 09:40:16 +10:00
c0e4532331 Fix T78394: In UV Editor, UV Unwrap respects selection
Differential Revision: D14945
2022-06-29 10:57:41 +12:00
2d18dd9309 Fix: Use distance unit for points node radius input 2022-06-28 16:03:04 -05:00
1c61db5346 Fix: Flush mode to evaluated object when exiting curves sculpt mode
Tagging the object for copy on write in order to change the mode on the
evaluated object was already done when entering sculpt mode, it should
happen when exiting sculpt mode as well.

Also use the message system to tag updates of the mode property.
This is commonly done for other "mode switch" operators. It's
best to be consistent here, though I don't know that lacking that
caused any issues.
2022-06-28 15:57:22 -05:00
Siddhartha Jejurkar
33be9c0885 Fix T98924: Skip saving selection properties for UV edge ring operator
Oversight in rB7724251af81f. Skip saving selection properties
for UV edge ring operator as it allows the operator to re-use
the value that was previously set using the key-map.

Reviewed By: campbellbarton

Maniphest Tasks: T98924

Differential Revision: https://developer.blender.org/D15214
2022-06-29 01:18:22 +05:30
c257443192 Fix Cycles assert with mix weights outside of 0..1 range
This could result in wrong skipping of SVM nodes in the graph. Now make the
logic consistent with the clamping in the OSL implementation and constant
folding.

Thanks to Christophe Hery for finding the problem and providing the fix.
2022-06-28 19:13:57 +02:00
814f360c83 UI: Unhide the world mist panel if the mist pass is not enabled
This makes no sense to hide it since we can nowadays preview it inside the
viewport even if the render pass is not enabled.
2022-06-28 18:48:39 +02:00
e127182065 DRW: Curve: Fix wrong UBO alignment
This was preventing correct attribute rendering with multiple attributes.
Since the `CurveInfos` struct is used for data sharing between C++ and
GLSL and inside a UBO it needs to obey the `std140` alignment rules which
states that arrays of scalars are padded to the size of `vec4` for each
array entry.
2022-06-28 18:48:39 +02:00
75ad435ceb Cleanup: GPUShader: Fix missing space in debug message 2022-06-28 18:48:38 +02:00
fde7d39051 Cleanup: DRW: Fix misnamed argument and add more info in a function doc 2022-06-28 18:48:38 +02:00
Sayak Biswas
abfa09752f Cycles: enable Vega GPU/APU support
Enables Vega and Vega II GPUs as well as Vega APU, using changes in HIP code
to support 64-bit waves and a new HIP SDK version.

Tested with Radeon WX9100, Radeon VII GPUs and Ryzen 7 PRO 5850U with Radeon
Graphics APU.

Ref T96740, T91571

Differential Revision: https://developer.blender.org/D15242
2022-06-28 18:35:43 +02:00
270ed1c716 Fix T98882: Regression: Gradient colors in a Grease Pencil material change depending on the visibility of other objects
The material ID was being wrongly passed in the shader.
2022-06-28 13:13:48 -03:00
b8064e3312 Build: add HIP version to buildbot configuration 2022-06-28 16:54:45 +02:00
Christian Rauch
bd6912930f Build: when using Wayland, always enable EGL and disable system GLEW
GLEW does not support GLX and EGL at the same time, and the distribution version
is likely to have GLX.

This also refactors the code so all OpenGL related CMake options are together.

Differential Revision: https://developer.blender.org/D12034
2022-06-28 16:54:45 +02:00
614aa9d8ec Py API Doc: add runtime changelog generation to sphinx_doc_gen.py.
Optionally use `sphinx_changelog_gen.py` to dump current version of the
API in a JSON file, and use closest previous one listed in given index
file to create a changelog RST page for Sphinx.

Part of {T97663}.
2022-06-28 16:53:12 +02:00
f9f73473d6 Py API Doc: refactor changelog generation script.
Main change is to make it use JSON format for its dump files, instead of
some Python code.

It also introduces an index for those API dump files, mapping a blender
version to the relevant file path.

This is then used to automatically the most recent (version-number wise)
previous API dump to compare against current one, when generating the
change log RST file.

Part of {T97663}.
2022-06-28 16:52:46 +02:00
b585872450 Fix frame_final_start/end strip property not setting handle position
This was a mistake in 17a773cdce - I did not notice existing set
function and assumed, that property set DNA directly.

Both get and set functions are now available and readonly flag is
removed.
2022-06-28 15:58:08 +02:00
d5dcbabdd2 Build: remove GLEW version checking from install_deps.sh
Latest OpenSubdiv builds without GLEW by default, which is also what we do
for precompiled libraries. So there is no need for compatibility checking
with system GLEW.

Additionally WITH_SYSTEM_GLEW is turned off by default for Blender, and this
logic was presumably added when it was still on by default a few years ago.

Also remove outdated mention of glew-mx, we use intern/glew-mx and no
external library for this.

Differential Revision: https://developer.blender.org/D15281
2022-06-28 15:57:06 +02:00
luzpaz
4d982cbb5d Cleanup: fix various typos
Differential Revision: https://developer.blender.org/D15304
2022-06-28 15:56:16 +02:00
0124de9d0e Install_deps: Fix several issues with TBB.
* TBB MEX version is now 2021, since this versin introduces 'oneTBB'
  which brings a lot of incompatibilities with previous versions.
* Fix several typos and mistakes in OSD, Embree and OIDN build code that
  prevented proper usage of a local TBB build.
2022-06-28 15:47:41 +02:00
c96f2778f0 Fix: sampling points on mesh surface generates too many points 2022-06-28 13:13:41 +02:00
dfea5e24ad BLI: add kdtree range search method that accepts c++ lambda
This is easier to use in C++ code compared to passing a function
and user-data separately.
2022-06-28 13:13:41 +02:00
c1ffea157c Mask editor: Always use smooth drawing
The mask is expected to be always be displayed smooth, and the
option mainly existed for some legacy drivers. IF smooth drawing
causes issues it should be fixed in the drawing code, not as an
option in the interface.

Differential Revision: https://developer.blender.org/D15266
2022-06-28 10:55:45 +02:00
f9076f3869 Cleanup: Remove redundant theme versioning code
Since we reset the default theme for the 3.0 release, we don't need to
keep these version patches around anymore.

Ref D13131
2022-06-28 16:07:30 +10:00
33fc230ba2 Fix T98799: camera unselectable in camera view below a certain scale
The camera frame (used for selection) was drawn outside the near
clipping plane in those cases.

This has been an issue before as seen in the following commits:
- rB6e7e6832e87
- rB33d322873e6
- rB4f9451c0442

Remaining issue was that the code which ensure the frame isn't behind
the near clipping plane was not taking into account the camera could be
scaled (in Z).
A caller of `BKE_camera_view_frame_ex` (namely
`OVERLAY_camera_cache_populate`) applies scale (also on the depth) which
does not play well with the way `BKE_camera_view_frame_ex` did it.

Now take Z scale into account.

Ref D15178
2022-06-28 15:54:02 +10:00
Red Mser
e6d50cdd43 Fix textview selection rendering in front of text
Selection of Python Console renders in front of the text.
Since the default theme uses a low opacity selection color,
it isn't obvious, but increasing alpha to 100% shows it clearly.

Ref D13111
2022-06-28 15:20:06 +10:00
ca9e1f6391 Cleanup: replace magic number with define for scan-code/key-code offset 2022-06-28 14:43:37 +10:00
dd95deadf3 GHOST/Wayland: avoid creating a keyboard-state each key press/release
Instead, create keyboard two states when the keyboard layout is set
(one with & one without num-lock pressed).
This avoids key-press lookups having to check if num-lock exists and
setting the keyboard state for key press & release events.

No functional changes.
2022-06-28 14:35:14 +10:00
fd7c070861 Fix T96170: keys mis-mapped with NeoQwertz layout under Wayland
Accessing the symbols for keys with no modifiers & num-lock enabled
has unintended consequences for some keyboard layouts that use this
to switch layers.

Resolve by restricting num-locked lookups to keys typically toggled
with num-lock (key-pad home, page up/down ... etc).
2022-06-28 13:48:05 +10:00
40cd041f74 Cleanup: group wayland event codes in their own doxy section
Also don't pass typedef'd ints as references.
2022-06-28 12:01:29 +10:00
b8cc181808 Fix T99202: AccentGrave key doesn't work with Wayland
Implement scan-code fallback when the scan-code used for AccentGrave
on US keyboards doesn't map to a key known to GHOST.

Without this, shortcuts that use AccentGrave are inaccessible and the
key does nothing.

This matches functionality from X11, see [0].

[0]: f3427cbc98
2022-06-28 11:31:12 +10:00
Keith Boshoff
b910114384 UI: add Custom properties panel to collections
Show a custom properties panel in the collections tab,
matching other data-blocks which already support this.

Reviewed by: HooglyBoogly, campbellbarton

Ref D12598
2022-06-28 10:52:31 +10:00
381fe684e2 GHOST: only use GHOST_PRINT when WITH_GHOST_DEBUG is enabled
Revert part of [0] so only assert behavior is changed.

[0]: 9b5dda3b07
2022-06-28 10:16:28 +10:00
65f4f50640 Cleanup: compiler warnings, remove unused functions 2022-06-28 10:13:24 +10:00
7a44f62bdb Fix T99156: UV parameterizer respects both Pins and Seams
Rgression from: e6e9f1ac5a

Reviewed By: Brecht Van Lommel

Differential Revision: D15292
2022-06-28 10:46:10 +12:00
317dfc1735 Fix T96776: Assets dropped upside down when looking through camera
In perspective mode the snap point direction needs to be taken into
account to define which side of the face is being looked at.

If there is no face under the mouse cursor, there is no direction
adjustment and the element normal will be used.
2022-06-27 19:00:24 -03:00
17a773cdce Fix T99216: RNA startdisp and enddisp return unreliable values
Since 7afcfe111a `startdisp` and `enddisp` fields are used as runtime
position storage for effect strips exclusively.

Use getter functon to return handle position and make properties read
only.
2022-06-27 22:22:18 +02:00
36348bf4fc Fix error in previous commit - missed include 2022-06-27 22:17:59 +02:00
8eef98710b Fix meta strip has incorrect range when created
Caused by using `startdisp` and `enddisp` to initialize range.
Use handle position instead.
2022-06-27 22:06:07 +02:00
Germano Cavalcante
67e23b4b29 Fix T84369: Fluid: Missing cache invalidation when properties on non-domain objects change
The `DEG_OB_COMP_TRANSFORM` and `DEG_OB_COMP_GEOMETRY` relations between
the **Domain** object and the **Flow**, **Effector** and **Force Field** objects
are added in the `updateDepsgraph` callback of the Fluid modifier, more
specifically in `DEG_add_collision_relations`.

The node linked to these components is the `POINT_CACHE` whose assigned
function is `BKE_ptcache_object_reset`.

So include the `eModifierType_Fluid` modifier in outdated cache checks.

Reviewed By: sergey, zeddb

Maniphest Tasks: T84369

Differential Revision: https://developer.blender.org/D15210
2022-06-27 16:54:23 -03:00
a571c74e10 Sculpt: Fix backwards normals in PBVH_GRIDS raycasting
Winding order of grid quads was backwards.
2022-06-27 11:16:05 -07:00
31ebe8982e BLI: Math: Add ceil_to_multiple_u()
Standalone version of a function added to `BLI_math_vector.hh`.
2022-06-27 20:06:32 +02:00
Félix
6b35d9e6fb VSE: Add API function to select displayed meta strip
Use function `sequence_editor.display_stack(meta_strip)` to set
displayed timeline content.

To view top-level timeline, that does not belong to any meta strip, pass
`None` as argument.

Differential Revision: https://developer.blender.org/D12048
2022-06-27 19:44:16 +02:00
a2b9b9d3c4 Fix broken build on macOS after recent changes 2022-06-27 17:29:24 +02:00
f0a3d2beb2 FFmpeg: Add VFR media support
Variable frame rate (VFR) files have been difficult to work with.
This is because during sequential decoding, spacing between frames is
not always equal, but it was assumed to be equal. This can result in
movie getting out of sync with sound and difference between preview and
rendered image. A way to resolve these issues was to build and use
timecodes which is quite lengthy and resource intensive process. Such
issues are also difficult to communicate through UI because it is not
possible to predict if timecode usage would be needed.

With this patch, double buffer is used to keep previously decoded frame.
If current frame has PTS greater than what we are looking for, it is not
time to display it yet, and previous frame is displayed instead.

Each `AVFrame` has information about it's duration, so in theory double
buffering would not be needed, but in practice this information is
unreliable.

To ensure double buffer is always used, function
`ffmpeg_decode_video_frame_scan` is used for sequential decoding, even
if no scanning is expected.

This approach is similar to D6392, but this implementation does not
require seeking so it is much faster. Currently `AVFrame` is only
referenced, so no data is copied and therefore no overhead is added.

Note: There is one known issue where seeking fails even with double
buffering: Some files may seek too far in stream and miss requested
PTS. These require preseeking or greater negative subframe offset

Fixes: T86361, T72347

Reviewed By: zeddb, sergey

Differential Revision: https://developer.blender.org/D13583
2022-06-27 16:58:07 +02:00
6f7171525b File Browser UI: Use "Widget" font style instead of "Widget Label"
It didn't make much sense to use the "Widget Label" font style here,
since this is just regular text, not labels for widgets. Checked with
@pablovazquez and we agreed on using the "Widget" font style instead.

Also fixes a mismatch where we used the "Widget Label" font style for
drawing, but the "Widget" font style for string width calculations.
Fixes T99207.
2022-06-27 16:18:57 +02:00
Sonny Campbell
64a3a11e19 Fix T98055: Library Filters do not work in Source Files
The fix is to ensure the filter for id type is run when displaying
assets from an Asset Library.

In the current implementation the id_type filter does not run if a blend
file is opened that also happens to be in an Asset Library directory. If
we have opened a blend file that is in an Asset Library directory, we
now use the same filtering check as for the "Current File" asset
library.

Differential Revision: https://developer.blender.org/D15284

Reviewed by: Julian Eisel
2022-06-27 16:09:38 +02:00
6243972319 UI: Scrollbar Behavior Changes
Changes to scrollbars so that they are always visible, but thin and
dim, and widen and become more visible as your mouse approaches.

See D6505 for details and examples.

Differential Revision: https://developer.blender.org/D6505

Reviewed by Campbell Barton
2022-06-27 06:46:29 -07:00
Pratik Borhade
279e7dac7d Fix T99070: Apply transform fails to clear delta transform values
Clear delta transform value after applying transform.
Include delta location while applying transform.
Use `copy_v3_fl` for resetting object scale

Reviewed By: mano-wii

Maniphest Tasks: T99070

Differential Revision: https://developer.blender.org/D15270
2022-06-27 10:38:34 -03:00
83c2cbb880 Cleanup: Use assert instead of early exit for asset dragging internals
Instead of failing silently, throw a failed assert in debug builds.
2022-06-27 15:36:25 +02:00
36f5967b99 Fix T93650: Asset drag into catalogs broken, Industry Compatible keymap
Issue was that the Industry Compatible keymap wouldn't select files on a
mouse press, and since the dragged items are determined by the
selection, nothing would be considered as dragged.

Selecting items on mouse press happens since c606044157. I haven't
heard of that issue happening in the Industry Compatible keymap. But if
it did happen, it should be fixed too now.
2022-06-27 15:36:25 +02:00
228d79b789 Revert 6de0f29950: BLF: Support for Variable Fonts
Reverting for now, breaks on GCC
2022-06-27 06:32:30 -07:00
6de0f29950 BLF: Add Support for Variable Fonts
Add support for Variable/Multiple Master font features. These are fonts
that contain a range of design variations along multiple axes. This
contains no client-facing options.

See D12977 for details and examples

Differential Revision: https://developer.blender.org/D12977

Reviewed by Brecht Van Lommel
2022-06-27 06:07:55 -07:00
151fc2fcd8 Fix T99171: Crash in mesh vertices positions RNA update function
Solution found by Philipp Oeser (@lichtwerk), thanks.
2022-06-27 08:01:54 -05:00
6a2c42a0d5 Cleanup: remove redundant RNA_struct_property_is_set check
This dates back to [0] from before PROP_SKIP_SAVE existed.
While harmless it's confusing why only one option uses this check.

[0]: ff83a98a07
2022-06-27 21:35:32 +10:00
2b806cb955 Cleanup: DRW: Remove drw_view renaming MACROS 2022-06-27 12:46:47 +02:00
ddc6b86a5b Fix color attribute interpolation with GPU subdivision
Handling of 16-bits compression was missing, which gave values that were
way off.
2022-06-27 12:39:39 +02:00
a617929683 Cleanup: rename misleading/inconsistent GHOST types
Remove mask suffix from:
- GHOST_TButtonMask
- GHOST_TModifierKeyMask
.. neither are used as bit-masks.

Remove 'Grab' from:
- GHOST_kGrabAxisNone
- GHOST_kGrabAxisY
.. matching the existing GHOST_TAxisFlag & GHOST_kAxisX.
2022-06-27 20:36:40 +10:00
3cf6516e7b Cleanup: format 2022-06-27 20:27:34 +10:00
Jason Fielder
9130a60d3d MTLCommandBufferState for coordinating GPU workload submission and render pass coordination.
MTLFrameBuffer has been implemented to support creation of RenderCommandEncoders, along with supporting functionality in the Metal Context.

Optimisation stubs for GPU_framebuffer_bind_ext has been added, which enables specific assignment of attachment load-store ops at the bind level, rather than on a framebuffer object as a whole.

Begin and end frame markers are used to encapsulate frame boundaries for explicit workload submission. This is required for explicit APIs where implicit flushing of work does not occur.

Ref T96261

Reviewed By: fclem

Maniphest Tasks: T96261

Differential Revision: https://developer.blender.org/D15027
2022-06-27 11:45:49 +02:00
7b6b740ace Cleanup: spelling in comments 2022-06-27 17:29:57 +10:00
e1c0d18598 Cleanup: remove redundant has key checks 2022-06-27 17:25:07 +10:00
1cf05f17eb UI: define category for the dope-sheet properties panel
Caused warning on startup, missing from [0].

[0]: 57816a6435
2022-06-27 17:25:07 +10:00
10a2c50733 Fix T99178: Console warning using search (F3) in grease pencil draw mode
The preview data was not available in this context and need to be checked to avoid the warning.
2022-06-27 09:13:40 +02:00
3a8fa77c1f GHOST/Wayland: Add a build time option for DBUS, disable by default
Add WITH_GHOST_WAYLAND_DBUS option, so Blender can be built without
DBUS support. Currently it's only used to access the cursor theme.
Without this the "default" cursors are used instead.

Disabling this since it adds an additional dependency for a minor gain
in functionality, with the benefit of removing a library requirement.

There is also a problem where Blender hangs on startup for ~5 seconds
when DBUS isn't running. Eventually it would be good to be able to avoid
this problem without a build option.
2022-06-27 16:49:21 +10:00
2b6c633b63 GHOST/Wayland: set the minimum window size with libdecor 2022-06-27 16:09:23 +10:00
0e88c2fc59 GHOST/Wayland: split pointer/tablet state into separate structs
For Wayland the mouse & tablet are separate devices with their
own location, button-pressed state and focused window.
Split internal state storage so they're separate.

Also track mouse button press/release state without needing focused
windows.
2022-06-27 15:58:07 +10:00
30273b86c7 Fix T98673: Color attribute fill API didn't support editmode 2022-06-26 17:11:03 -07:00
4c3b984b3d Fix T99100: Undo/redo bugs with paint and gravity
You can now push multiple sculpt undo nodes
of different types.  This is necassary to handle
paint tools that have gravity enabled.
2022-06-26 16:15:40 -07:00
77f10fceb2 Cleanup (UV): Remove unused variable do_aspect 2022-06-27 11:13:06 +12:00
81c5b759d6 Fix T99182: Hard code screen_scale for circle drawing in 3D 2022-06-27 10:59:29 +12:00
a646a4b47e Curves: Port string to curves node to the new data-block
Use the conversion implemented in 5606942c63.
2022-06-25 19:09:57 -05:00
be692cc4fe Cleanup: Clang tidy 2022-06-25 19:05:31 -05:00
ef8bb8c0d5 Functions: improve span buffer reuse in procedure execution
This potentially overallocates buffers so that they are usable
for more data types, which allows buffers to be reused more
easily. That leads to fewer separate allocations and improved
cache usage (in one of my test files the number of separate
allocations went down from 1826 to 1555).
2022-06-25 19:41:44 +02:00
22fc0cbd69 BLI: improve support for trivial virtual arrays
This commits reduces the number of function calls through function
pointers in `blender::Any` when the stored type is trivial.

Furthermore, this implements marks some classes as trivial, which
we know are trivial but the compiler does not (the standard currently
says that any class with a virtual destructor is non-trivial). Under some
circumstances we know that final child classes are trivial though.
This allows for some optimizations.

Also see https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1077r0.html.
2022-06-25 19:27:33 +02:00
3237c6dbe8 Fix: crash when converting zero legacy curves
The issue was that the "radius" lookup below fails, because there is no
curve data. Arguably, it should be possible to add attributes even when
there is no data. However, the rules for that are a bit loose currently.
A simple fix is to just not run the conversion code when there is nothing
to convert.
2022-06-25 19:17:08 +02:00
b513c89e84 Functions: avoid using Map for small values
This leads to a 5-10% performance improvement in my benchmark
that runs a procedure many times on a single element.
2022-06-25 18:53:26 +02:00
ba1e97f1c6 Geometry Nodes: Field on Domain Node
As described in T98943, this commit adds a node that can
evaluate a field on a separate domain in a larger field context.
This is potentially useful in many cases, to avoid relying on
a separate capture attribute node, which can make it easier
to build reusable fields that don't need geometry inputs.

Internally, the node just evaluates the input field in the larger
field context and then uses the generic domain interpolation,
so the code is simple. One future optimization might be using
the input selection to only evaluate part of the input field, but
then the selection has to be interpolated as well, and that might
not always be worth it.

Differential Revision: https://developer.blender.org/D15289
2022-06-25 11:23:19 -05:00
5606942c63 Curves: Skip CurveEval in legacy curve conversion
Currently when converting from the legacy curve type to the new type,
which happens during evaluation of every legacy curve object, the
`CurveEval` type is used as an intermediate step. This involves
copying all data twice, and allocating a bunch of temporary arrays.
It's also another use of `CurveEval` that has to be removed before
we remove the type.

The main user difference besides the subtlety described below
will be improved performance.

**Invalid Handles and Types**
One important note is that there are two cases (that I know of)
where handles and handle types can be invalid in the old curve
type. The first is animation, where animated handle positions don't
necessary respect the types. The second is control points with a
single aligned handle that didn't necessarily align with the other.

In master (partially on purpose) the code corrects the first situation
(which caused T98965). But it doesn't correct the second situation.
It's trivial to correct for the second case with this patch (because of the
eager calculation decided on in D14464), but this patch makes the choice
not to correct for //either//.

Though not correcting the handle types puts curves in an invalid state,
it also adds flexibility by allowing that option. Users must understand
that any deformation may correct invalid handles.

Fixes T98965

Differential Revision: https://developer.blender.org/D15290
2022-06-25 11:11:59 -05:00
2967726a29 Cleanup: add missing override 2022-06-25 18:10:22 +02:00
2a8afc142f BLI: improve check for common virtual array implementations
This reduces the amount of code, and improves performance a bit by
doing more with less virtual method calls.

Differential Revision: https://developer.blender.org/D15293
2022-06-25 17:28:49 +02:00
9a0a4b0c0d Geometry Nodes: Add Points Node
This node takes a point count,a vector field, and float field and creates
a pointcloud with n points at the positions indicated in the vector
field with the radii specified in the float field.The node is placed in
the "Point" menu.

Differential Revision: https://developer.blender.org/D13920
Maniphest Task: https://developer.blender.org/T93044
2022-06-25 08:47:31 -05:00
12bde317f4 Fix T98949: Deleting vertex group in geometry nodes affects others
The vertex group indices stored in the weights need to be accounted for
when the vertex group list on the mesh changes.
2022-06-24 16:39:58 -05:00
35d2a22846 Cleanup: Remove unused argument 2022-06-24 16:16:43 -05:00
fca94c5e0d Fix: Incorrect dirty normal tag after mesh translation
Mistake in 54182e4925. The dirty flag was always cleared,
but we only want to clear it after translating a mesh if it normals
were already non-dirty.
2022-06-24 15:48:48 -05:00
f6290cd2a4 Cleanup: Remove unnecessary includes 2022-06-24 15:47:24 -05:00
35da733e6b Fix T99058: geometry nodes ignore if subdivision surface modifier is disabled
It was looking up the last modifier in the stack, ignoring visibility, instead
of mesh->runtime.subsurf_runtime_data set by the modifier evaluation and used by
the drawing code.
2022-06-24 19:57:28 +02:00
9b6e86ace1 Cycles: stop Metal rendering on command buffer error
If there is an error we should stop rendering, instead of finishing with a
wrong render result or reporting a wrong benchmark time.

Ref T96519

Differential Revision: https://developer.blender.org/D15287
2022-06-24 16:51:56 +02:00
Christian Rauch
29755e1df8 GHOST/Wayland: support client-side window decorations
This implements client-side window decorations for moving and resizing
windows and HiDPI support.

This functionality depends on the external project 'libdecor' that is
currently a build option: WITH_GHOST_WAYLAND_LIBDECOR.

Reviewed by: brecht, campbellbarton

Ref D7989
2022-06-25 00:10:39 +10:00
f1d191120f Fix T99130: Spline factor gets messed up if one hair is too short
In the cases where length is zero, we simply equally distribute the
value based on the control point/curve index.

Differential Revision: https://developer.blender.org/D15285
2022-06-24 15:36:31 +02:00
ad8add5f0c Fix T98427: Crash adding quick effects smoke from Python
Manta flow used the `__main__` namespace which it was executed in,
this caused a bug when calculating fluid from Python, which clears
it's `__main__` name-space after execution.
This caused Manta-flows name space to be cleared too.

Resolve this by creating a separate name-space for manta-flow.

Reviewed by: SonnyCampbell_Unity

Ref D15269
2022-06-24 23:28:55 +10:00
2580d2bab5 PyAPI: Expose event.type_prev, value_prev
Before [0] mouse-motion events left the 'event.value' un-changed,
so a mouse-move would be set to PRESS/RELEASE based on previous events.

Support accessing the previous event value directly
to address feedback from T99102.

Note that the previous cursor location is already exposed.

[0]: 52af3b20d4
2022-06-24 23:19:44 +10:00
77eadbede4 Fix T99037: bpy.ops.transform.rotate fails in background mode
This reverts commit c503c5f756,
alternate fix for T82244.

Scripts that run in background mode expected rotation to be usable,
defaulting to the 3D viewport when there is no active windowing data.

Also resolves T88610.
2022-06-24 22:16:47 +10:00
585d81ba2b Workbench: Increase render tests fail threshold for hair.
When running the render test cases on MacOS/Intel the hair render
test fail. Most likely due to the dense geometry and the low
resolution of the test image.

This patch increases the fail threshold so these tests will pass.
Note that I haven't been able to test whether this is also the case
for Linux/Windows. If that is the case we should remove the platform
specific test.
2022-06-24 14:09:15 +02:00
Jeroen Bakker
f748a81f25 Test/Eevee: Increase failure threshold for image tests.
Makes the current test cases pass on NVIDIA 1080Ti/515.
The tests still fail on other platforms (AMD, Intel). Some are actual failures.
Other require platform specific reference images.

Original patch provided by Brecht van Lommel.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D15264
2022-06-24 13:45:29 +02:00
7927ac2fbe Fix T99129: Eevee Hair Info Length not working (old particle hair).
When using the old particle hair with the hair info length it wasn't
working with AMD GPUs. The reason was that the drw_curves uniform buffer
wasn't initialized what made the shader select the incorrect length.
2022-06-24 13:03:29 +02:00
79973494ec Cleanup: Fix building warnings on gcc 9.4.0
Solution by Jacques Lucke
2022-06-24 11:25:12 +02:00
e08c932482 Fix T98925: Editor panels are broken
Commit 277fa2f441 added channels region to unintended editors if sequencer was
used in area. This caused issues with some editors having 2 tool regions and
non functioning side panel.

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D15253
2022-06-24 10:23:31 +02:00
3323cd9c9a GHOST/Wayland: support for cursor warp with hidden/wrapped grab enabled
As grab already uses it's own virtual coordinates, cursor warping can
be used when grab is enabled.

Currently nothing depends on this however it could be useful in future.
2022-06-24 14:38:17 +10:00
11f38f59e2 Cleanup: remove unused function WM_cursor_compatible_xy 2022-06-24 14:00:36 +10:00
4c4e8cc926 Fix T99021: Walk-mode doesn't work in Wayland
Walk mode implemented it's own grab which relied on WM_cursor_warp
to work (which isn't implemented for wayland).

Resolve this by using WM_cursor_grab_{enable/disable}.

Besides fixing Wayland this removes the need for workarounds:

- Ensure the event received were after the event generated from warping.
- Alternate logic that reset the "center" when using tablets.
- Checking the cursor location was scaled by native-pixels on macOS.

There is a minor change in behavior: on completion the cursor is left
at the location walk-mode began instead of the center of the region.
2022-06-24 13:58:21 +10:00
70648683a2 Cleanup: add C++ compatible WL_ARRAY_FOR_EACH macro 2022-06-24 10:22:46 +10:00
cc09661c4e Cleanup: remove unused cursor struct members in GHOST/Wayland 2022-06-24 09:59:37 +10:00
b3a713fffa Cleanup: use const arguments for GHOST/Wayland 2022-06-24 09:58:27 +10:00
9b5dda3b07 GHOST: use GHOST_ASSERT for non-release builds
GHOST_ASSERT now matches BLI_assert, which is only ignored for release
builds. Otherwise it prints or asserts when WITH_ASSERT_ABORT is enabled.
2022-06-24 09:00:19 +10:00
93de6b912f Docs: correct GHOST_TimerProcPtr time doc-string 2022-06-24 08:46:18 +10:00
4919403c29 Fix outdated pressure/tilt for tablet motions events under GHOST/Wayland
Accumulate tablet data before generating an event using the 'frame'
callback.
2022-06-24 08:19:08 +10:00
41a0411d79 Fix T99083: audio bad in command-line video player (blender -a)
There was a wrong sample size computation in PulseAudioDevice.
The sample format is switched to float32 for the command-line player.
2022-06-23 21:32:34 +02:00
b0fe0e6a30 Cleanup: Make function static 2022-06-23 13:03:31 -05:00
0473462241 Geometry Nodes: Speed up Separate color node in RGB mode
This applies the same optimization as b8bd304bd4 to the separate
color node. I observed about a 50% improvement with 10 million values
when only extracting one channel-- from about 17ms to 11ms.
2022-06-23 12:34:31 -05:00
a5ff46e0fc Cleanup: make format 2022-06-23 19:28:39 +02:00
dc64673f6e Fix T97691: undefined behavior sanitizer warning for alignment in RNA functions
Thanks Loren Osborn for investigating this and proposing solutions.

Ref D14798
2022-06-23 19:22:50 +02:00
Max Edge
56435b3268 Fix T94621: Missing selection indication for virtual node sockets
A small regression as a result of adding a custom outline to the empty
virtual socket, which ended up overriding the colors when selected with
Shift+LMB.

Differential Revision: https://developer.blender.org/D15103
2022-06-23 12:22:23 -05:00
Angel Bueno
792bf82f11 Spreadsheet: Support operations for filtering colors
Support choosing an operation when filtering colors,
like the other types.

Differential Revision: https://developer.blender.org/D15191
2022-06-23 12:16:18 -05:00
9b775ebad7 Cleanup: Remove unused array in vertex paint code
Unused since 4f616c93f7
2022-06-23 12:10:12 -05:00
6dde88c536 Vertex paint mode tried to do a "fast update" by trying to avoid tagging
the mesh ID for a full update. The conditions it uses are troublesome:
 1. There must be an evaluated mesh
 2. The evaluated mesh's active byte color layer must equal the original's

This logic doesn't make sense for a few reasons. First of all, the
`mloopcol` pointer doesn't make sense in the context of color
attributes (rather than the old vertex colors), since it only points
to byte color attribute on face corners. Second, just because the
layer pointers are equal doesn't mean something doesn't depend
on the attribute's values.

I think the best solution currently is to remove this "fast update"
case and instead work on optimizing the general case.

Also, T95842 suggests removing these pointers, and this is one
of the last remaining uses of `Mesh.mloopcol`.

Differential Revision: https://developer.blender.org/D15275
2022-06-23 12:05:48 -05:00
54182e4925 Mesh: Add an explicit "positions changed" function
We store various lazily calculated caches on meshes, some of which
depend on the vertex positions staying the same. The current API to
invalidate these caches is a bit confusing. With an explicit set of
functions modeled after the functions in `BKE_node_tree_update.h`,
it becomes clear which function to call. This may become more
important if more lazy caches are added in the future.

Differential Revision: https://developer.blender.org/D14760
2022-06-23 12:00:25 -05:00
3e5a4d1412 Geometry Nodes: Optimize selection for virtual array input
This makes calculation of selected indices slightly faster when the
input is a virtual array (the direct output of various nodes like
Face Area, etc). The utility can be helpful for other areas that
need to find selected indices besides field evaluation.

With the face area node used as a selection with 4 million faces,
the speedup is 3.51 ms to 3.39 ms, just a slight speedup.

Differential Revision: https://developer.blender.org/D15127
2022-06-23 11:51:33 -05:00
633c2f07da Cyles: switch primitive.h inline hints to forceinline
This change helps decrease Intel GPU binaries compile time by 5-10
minutes without impacting other backends.

Reviewed By: sergey, brecht

Differential Revision: http://developer.blender.org/D15273
2022-06-23 18:36:48 +02:00
2eba15d3e8 Fix T98975: Broken vertex paint mode operators
All of the operators in vertex paint mode didn't work properly with
the new color attribute system. They only worked on byte color type
attributes on the face corner domain.

Since there are four possible combinations of domains and types now,
it mostly ended up being simpler to convert the code to C++ and use
the geometry component API for retrieving attributes, interpolating
between domains, etc. The code changes ended up being fairly large,
but the result should be simpler now.

Differential Revision: https://developer.blender.org/D15261
2022-06-23 11:33:11 -05:00
5c6ffd07e0 Fix T99110: Crash after running view_all operator in VSE
Crash caused by NULL dereference, when `Editing` is not initialized.

Check if data is initialized in poll function.
2022-06-23 18:20:02 +02:00
d1ea39aac7 Fix T99091: Freeze when changing strip source with thumbnails enabled
When input file is changed, `orig_height` and `orig_width` fields are
reset, which causes thumbnail dimensions to be incorrectly calculated.

Only draw thumbnails if both mentioned fields are non 0.
2022-06-23 17:49:26 +02:00
1c83354c63 Fix T99028: crash deleting file output node with color management override
One case of copying image formats was not properly using BKE_image_format_copy.
To fix this for existing .blend file we need to do versioning, ensuring the curve
mapping is properly copied.
2022-06-23 16:35:11 +02:00
Andrii Symkin
c2a2f3553a Cycles: unify math functions names
This patch unifies the names of math functions for different data types and uses
overloading instead. The goal is to make it possible to swap out all the float3
variables containing RGB data with something else, with as few as possible
changes to the code. It's a requirement for future spectral rendering patches.

Differential Revision: https://developer.blender.org/D15276
2022-06-23 15:02:53 +02:00
b8403b065e Fix T99027: Touch typing in text fields results in dropped key presses
Fix by always testing unhandled double-click events as press events,
irrespective of the previous event type.

**Details**

Handling double-click events only ran when the previously pressed-key
matched the current pressed-key.

Originally when double-click support was added the previous type was
compared (ignoring it's press/release value) and while not necessary
it was harmless as it matched the check for double-click events being
generated.

As of [0] the logic for click/drag detection changed to ignore release
events as release this could interrupt dragging.
This made it possible to generate double-click events that failed the
`event->prev_press_type == event->type` comparison.
In these cases it was possible to generate double-click
events that would not fall-back to a 'press' value when unhandled.

[0]: 102644cb8c
2022-06-23 22:25:13 +10:00
e63799e791 Cleanup: fix typo that deactivated clang-format in rna_brush.c 2022-06-23 13:10:26 +02:00
b830263186 Fix T98871: Drivers not updated when joining an armature
If the some driver had been flagged as "invalid", the flag would not be
cleared when joining armatures which could lead to now valid drivers
still being flagged as invalid.

Now we clear this invalid flag on all drivers to force a recheck after
joining the armatures.
2022-06-23 11:47:37 +02:00
Colin Basnett
091100bfd7 Animation: Add function to remove all FCurves from an Action
Add a `BKE_action_fcurves_clear(action)` function, which removes all the
Action's FCurves, and expose it as `ActionFCurves.clear()` in RNA.

This is more ergonomic than calling `remove` on f-curves until the list
is empty.

Reviewed By: sybren

Differential Revision: https://developer.blender.org/D14660
2022-06-23 11:45:53 +02:00
Colin Basnett
2ae4397ec9 Armature: Add poll message explaining bone groups need pose mode
Add a poll message to the bone group operators, to explain they only
work in pose mode. Before, the buttons would be greyed out with no
explanation.

Reviewed By: sybren

Differential Revision: https://developer.blender.org/D15119
2022-06-23 11:37:23 +02:00
Colin Basnett
57816a6435 Dopesheet: Add Custom Properties panel
Adds a custom property panel for the active `Action` to the Dopesheet
editor. There was previously no way to edit these properties outside of
the Python API.

This panel will show up when
`context.active_object.animation_data.action` is set.

Reviewed By: sybren

Differential Revision: https://developer.blender.org/D14646
2022-06-23 11:12:42 +02:00
Michael Jones
d8e9647ae2 Cycles: Add diagnostic tracing of MTLLibrary compilation time
Reviewed By: sergey

Differential Revision: https://developer.blender.org/D15268
2022-06-23 10:06:20 +01:00
d20bad914e Fix key repeat continuing after a window loses focus for GHOST/Wayland
Also remove NULL checks in keyboard enter/leave handlers,
as they didn't serve any purpose.
2022-06-23 15:38:43 +10:00
e4f51b3a6e LineArt: Cleanup minor warnings from variable type changes. 2022-06-23 13:22:56 +08:00
743a027862 Fix key repeat behavior for GHOST/Wayland
- Respect modifier keys (Shift press/release didn't change the case).

- Changing modifiers resets the timer instead of canceling key-repeat.

- Releasing keys (besides the key being repeated) resets the timer
  instead of canceling key repeat.

This makes key-repeat behave the same way as GTK & WIN32 text input.
2022-06-23 15:14:18 +10:00
1160a3a3f8 Cleanup: Clang tidy
Mainly duplicate includes and else after return.
2022-06-22 18:58:25 -05:00
d2a3b99ff7 Cleanup: Use const arguments
Also use Curves as an argument instead of Object,
since it's more specific to this situation.
2022-06-22 16:58:22 -05:00
Michael Jones
532b33973b Cycles: Tidy of KernelData patchup code
Reviewed By: sergey

Differential Revision: https://developer.blender.org/D15267
2022-06-22 22:38:00 +01:00
Michael Jones
328a911379 Cycles: Distinguish Apple GPUs by core count
This patch suffixes Apple GPU device names with `(GPU - # cores)` so that variant GPUs with the same chipset can be distinguished. Currently benchmark scores for these M1 family GPUs are being incorrectly merged:

- M1: 7 or 8 cores
- M1 Pro: 14 or 16 cores
- M1 Max: 24 or 32 cores
- M1 Ultra: 48 or 64 cores

Reviewed By: brecht, sergey

Differential Revision: https://developer.blender.org/D15257
2022-06-22 22:32:56 +01:00
5c0d18f682 Cleanup: remove unused sculpt texture cache generation
This has not been used since 5505697ac in 2010.
2022-06-22 19:52:55 +02:00
Ramil Roosileht
b6a76243cd D14974: Tip roundness - match square and round brush radius
Oneliner for T97961.  Square sculpt brushes no longer fit
inside the radius circle, they now use the radius for
the square size.

{F13082514}

Note: original patch was modified to scale PBVH
      search radius to avoid artifacts.

Differential Revision: https://developer.blender.org/D14974
Reviewed By: Joseph Eagar & Julien Kaspar
Ref: D14974
2022-06-22 10:03:27 -07:00
1cde1562e8 Cleanup: simplify macOS make deps instructions 2022-06-22 18:17:47 +02:00
Patrick Huang
9f4ec73101 Fix T97675: slow zoom in node editor with Continue zoom method
Speed increased by 10x, making it visually similar to other editors.

Differential Revision: https://developer.blender.org/D15209
2022-06-22 16:56:20 +02:00
6c3965c027 Fix T98773: GPU Subdivision breaks auto selection in UV edit mode
When GPU subdivision is used, and the modifier is not set to be applied
on the cage, UV selection is not synced with the face selection in the
viewport.

This happens because the extraction, despite being in edit mode, is set
to `MESH` instead of `BMESH` (or `MAPPED` in some cases) like for CPU
subdivision, and since the mesh is not always synchrnised with the BMesh
the edit mode flags are not always updated.

With GPU subdivision, when creating the `MeshRenderData`, the condition
`has_mdata && do_final && editmesh_eval_final != editmesh_eval_cage` is
true which forces the `MESH` extraction. Following comment in D14485,
this replace the `has_mdata` in the condition with `use_mapped` which
solves the issue.

Differential Revision: https://developer.blender.org/D15248
2022-06-22 16:45:20 +02:00
cebc5531e9 Fix T98956: Crash removing some builtin attributes
For example, the "id" attribute is stored as a named attribute.
If it doesn't exist already, `layer_index` was uninitialized, causing
issues with `CustomData_free_layer`. The fix is to use the generic
function to free a named layer in that case. Eventually the other
case will go away as T95965 is finished.
2022-06-22 09:06:29 -05:00
785931fc3c Fix: Memory leak writing to builtin attribute with wrong type
The store named attribute node creates a new buffer to evaluate
the field into. When creating the attribute with that buffer fails,
if must be freed.
2022-06-22 09:03:27 -05:00
a3d0f77ded Cleanup: Remove unused function arguments
Solves the corresponding compiler warning.
2022-06-22 10:55:08 +02:00
a7b91fc8bc Cleanup: clang-format 2022-06-22 10:55:08 +02:00
31d80ddeaa Revert "LibOverride: Handle dependencies in both directions in partial override cases."
This reverts commit f0b4aa5d59.

This commit was making files to get bigger and bigger every time they
were saved and re-opened.

In the orphaned data in the outliner new collections would show up
there, even after continuously purging it. This would lead to a massive
file which get also very slow.

This problem will fix itself after a few re-open/re-saves of the files.
For anyone also experimenting this you can fix this faster by purging
the unused data multiple times in the file.

Example of file from the Project Heist (rev. 1014):
heist/pro/shots/010_opening/010_0050/010_0050.anim.blend
2022-06-22 10:48:59 +02:00
Simon Lenz
df2ab4e758 Mask Editor: Add toggle for mask spline drawing
Adds an overlay option to show/hide the spline points & lines of masks in the Mask Editor.

It also moves the "smooth" option up (its position left of the selection dropdown was missleading).

{F11847272}

This emerged from a discussion in https://developer.blender.org/D12776

Differential Revision: https://developer.blender.org/D13314
2022-06-22 10:45:18 +02:00
Ramil Roosileht
5946ea938a D14975: Voxel Remesh Size Edit - Constant Size by default
This patch makes constant size a default for size edit operator of voxel remesh.
In turn, pressing CTRL now enables relative scale, the old default.

Patch also changes workspace status text entry with new additions. Note that it is a simple text and not an array of keymaps (for that further changes are needed)

{F13082567}

Reviewed By: Julien Kaspar & Joseph Eagar
Differential Revision: https://developer.blender.org/D14975
Ref D14975
2022-06-22 01:36:13 -07:00
f4d8382c86 Rigid body physics: Move effector force update into substep loop.
The substep loop for rigid bodies causes unequal effects of force fields depedending on the substep setting, larger
substep counts cause a diminishing effect of force fields.
This is because the force to apply on a body is reset in Bullet after each step and needs to be recomputed. Without this
the body will just coast with constant velocity after the first substep. Since the per-step impulse with larger substep
counts is smaller, the effect is that more substeps cause a smaller total impulse.

The fix is to move external force calculation into the substep loop and update forces for each substep.

Note that this may be considered a breaking change, because the breaking commit rB1aa54d4921c2 has been in master for
a long time and after this fix force fields will generally have a much larger effect on rigid bodies (10x for the
default setting of 10 substeps).

Differential Revision: https://developer.blender.org/D15173
2022-06-22 06:37:45 +01:00
75f0aaab3d Cleanup: remove redundant GPU headers 2022-06-22 14:59:42 +10:00
b8289eb1b9 Cleanup: replace BLF defines with enum, formatting 2022-06-22 14:50:22 +10:00
8fab580949 Fix T99078: Crash closing the file selector in Wayland
Ensure wayland handlers run that clear the window immediately after
the window has been removed so dangling pointers to the window
aren't left set.
2022-06-22 13:11:32 +10:00
c08fda3a6b Cleanup: Grammar in comments 2022-06-21 15:47:25 -05:00
256cb68d33 Cleanup: Remove unused argument 2022-06-21 14:17:24 -05:00
d901f8b75b Fix T98960: Baking to active color attribute uses wrong layer
Baking assumed that color attributes could only have two configurations:
float color data type on vertices, or byte color type on face corners.
In reality the options can be combined to make four total options.
This commit handles the four cases explicitly with a somewhat
more scaleable approach (though this should really be C++ code).

This commit also changes some related error messages, tooltips,
and an enum name, in order to make the functionality more obvious.

Differential Revision: https://developer.blender.org/D15244
2022-06-21 14:15:18 -05:00
7140016838 GPencil: Move New Layer option to menu top
The new layer option must be the first in the menu.

Differential Revision: https://developer.blender.org/D15255
2022-06-21 17:04:30 +02:00
d2f47017b9 Fix crash editing anisotropic filter preference from background mode 2022-06-21 16:00:56 +02:00
9622dace3e Cleanup: removed unused Blender Internal bump/normal mapping texture code
The TexResult.nor output does not appear to be used anywhere.
2022-06-21 16:00:56 +02:00
Colin Basnett
d90b320444 Fix T97533: Extrapolation of NLA strips outside current view are not rendered
Do a more thorough search for strips that are not visible themselves,
but still influence the viewed time range.

The problem before was that tracks not immediately visible would not be
drawn at all. The strategy for fixing this was to simply include strips
that are visible only because of their extrapolation mode.

To do this, there is now a new function `get_visible_nla_strips` which
gives a first and last `NlaTrack` that needs to  be drawn.

Tagging along with this is the removal of the strip index indicator from
the name on meta tracks. Because of the new structure of the code, it
would incur a performance penalty to restore the previous behavior
(requiring a linear search for the index). Since this number is of
virtually no utility to the user anyways (it has the look & feel of
developer debugging information), this is something I think we can
safely remove without regret.

Reviewed By: sybren

Differential Revision: https://developer.blender.org/D14738
2022-06-21 15:40:45 +02:00
7f3af2aaee NLA: when searching for active track/strip, shortcut when none is active
In the `update_active_track()` function, add a shortcut that just sets
`NULL`, instead of searching for `NULL` pointers. Should give a tiny
speedup.
2022-06-21 15:28:11 +02:00
15bc3d260d Fix 2 for T98700: Crash when recursively nesting NLA meta strips
When searching for the active NLA strip, avoid overwriting the found strip
pointer with NULL if it was already found in a previous iteration.

The active strip is searched for while looping over the NLA tracks. If the
active strip was found on a previous track, and not on the current track,
this would effectively set `actstrip = NULL`. This is now avoided.

Another benefit is that the search for the active strip is stopped as soon
as it's found, which should increase performance a tiny bit.
2022-06-21 15:28:11 +02:00
d373206c3f NLA: update comment to reflect the current implementation
No functional changes.
2022-06-21 15:28:11 +02:00
3bb34fb7ee NLA: add BLI_assert_msg() to check for assumption
`find_active_strip_from_listbase()` expects two lists of strips with an
equal number of items. This is now not only documented, but also checked
for in an assertion.
2022-06-21 15:22:52 +02:00
ee78c860b8 LineArt: Move style options to top of the modifier.
Reviewed By: Antonio Vazquez (antoniov)

Differential Revision: https://developer.blender.org/D15164
2022-06-21 16:10:35 +08:00
84fc086254 Fix T98919: Eevee unlinked aov output nodes don't render.
Eevee rendered an empty image for aov nodes that weren't linked to
any other nodes. When connected the result was OK. The root cause was
that the AOV nodes were not marked as output node and pruned when not
connected to any other nodes. The pruning process is there to reduce
the complexity of the GLSL and improve compilation time and
execution time.
2022-06-21 09:45:40 +02:00
5d3df1c296 Cleanup: remove unneeded code in eevee_bloom.
This had to be added to the previous commit.
2022-06-21 08:27:20 +02:00
3df6e75a26 Fix T98972: EEVEE Bloom Pass Outputs Final Image Instead of Bloom.
Regression introduced by {rBca37654b6327}. This commit reversed the
order of loading uniforms. The bloom renderpass used the previous
loading order to overwrite an existing uniform (bloomBaseAdd).

Due to the new ordering this doesn't work anymore where the render
pass outputted an image similar to the final image. This was fixed
by loading the correct value for bloomAddBase and remove the rewrite.
2022-06-21 08:20:26 +02:00
beaae4533a Cleanup: use full names for generated wayland headers, use own directory
Instead of providing our own names for wayland headers, use the filename
component as the basis for the header names. This matches most reference
documentation for Wayland.

Also generate client protocols into a sub-directory `libwayland`,
instead of generating headers into the ghost directory. Making the
include path more specific & makes it easier to differentiate generated
headers from other build files.
2022-06-21 16:08:03 +10:00
84315368ef Fix error in GHOST_ASSERT under Wayland 2022-06-21 16:08:03 +10:00
697363545f GPU subdiv: fix hidden faces in paint mode when hidden in edit mode
Pass `use_hide` to the compute shaders so that we can override the
hidden face flags, like CPU extraction is doing.
2022-06-21 07:39:37 +02:00
e42c662723 Cleanup: Fix format on previous commit 2022-06-21 17:37:15 +12:00
1154b45526 UV: Add "Select Similar" operator in UV editor
Resolves T47437.

Differential Revision: https://developer.blender.org/D15164
2022-06-21 17:33:39 +12:00
4144a85bda Cleanup: Type safety and asserts around ED_select_similar_compare 2022-06-21 16:39:47 +12:00
d7fbc5708a Fix T99016: GPU subdiv artifacts in weight paint with smooth shading
Flags in the smooth shading case were not properly set.
2022-06-21 06:25:08 +02:00
95465606b3 Fix T99033: KDTree deduplication can erase values
Differential Revision: https://developer.blender.org/D15220
2022-06-21 13:21:41 +12:00
a18c291435 Cleanup (UV): Use blenlib math utilities 2022-06-21 10:42:05 +12:00
3545d8a500 Cleanup: Move paint_vertex_color_ops.c to C++ 2022-06-20 13:57:21 -05:00
522dcc54af Fix T94969: Crash in Volume to Mesh with 0 voxels
Checks if voxel amount or -size is <= 0 and if so, returns early.

Differential Revision: https://developer.blender.org/D15241
2022-06-20 20:12:44 +02:00
9f8cc1bc34 Cleanup: Grammar: a vs an 2022-06-20 10:14:17 -05:00
549f9a1178 Build Deps: Disallow looking for Python in registry for ISPC
Should prevent accidental use of wrong Python.
2022-06-20 17:11:33 +02:00
df3a67fc52 Build Deps: Pass Python3 root to ISPC
Following what is done for LLVM. Being consistent feels good here.

Not strictly needed as the build here passed anyway, but it does
feel good to be consistent.
2022-06-20 17:10:15 +02:00
f86722afc7 Build Deps: Fix ISPVC and OIDN compilation on fresh Windows
Make them to use self-compiled Python, similar to previous fixes
for other libraries.
2022-06-20 16:50:24 +02:00
6a1cc0d855 Fix T99019 EEVEE: Regression: Specular BSDF does not apply occlusion
Since the occlusion input is going to be removed in EEVEE-Next, I just
added a temporary workaround. The occlusion is passed as SSS radius
as the Specular BSDF does not use it.

The final result matches 3.1 release
2022-06-20 16:33:04 +02:00
3bb8b64c47 Fix T99018: EEVEE: Regression: Specular BSDF apply specular color input twice
This was an oversight. I checked that no other node had the same regression.
2022-06-20 16:33:04 +02:00
d2e4bd7995 Curves: extract surface brush sampling into separate function
This functionality will also be necessary in the Density brush.
2022-06-20 16:27:57 +02:00
af983a3eef BLI: add min_inplace and max_inplace functions 2022-06-20 16:27:57 +02:00
06b212c446 Fix: assert when deleting all curves 2022-06-20 16:27:57 +02:00
Simon Lenz
eca0c95d51 Mask Editor: Add mask blending factor for combined overlay
This adds a new parameter to the "Combined" overlay mode of the mask editor.
The "blending factor" allows users to blend the mask exterior with the original
footage to visualise the content of the mask in a more intuitive way.  The
"Alpha" overlay is unaffected by this change.

The existing "Combined" overlay is used like before (covering everything
outside the mask in black), but can be blended with the slider in the mask
overlay to look at the exterior.

This is part of an effort to make mask editing more intuitive & easy to use:
https://developer.blender.org/T93097

Differential Revision: https://developer.blender.org/D13284
2022-06-20 16:04:15 +02:00
72a5bb8ba9 Fix artefacts with GPU subdiv and weight paint face selection
Addendum to previous fix, which was for point selection, this fixes the
face selection mode. The issue is caused by wrong flags used for paint
mode (the edit mode flag was always used). Also add back flag which was
accidentally removed in 16f5d51109.
2022-06-20 14:42:09 +02:00
ff1883307f Cleanup: renaming and consistency for kernel data
* Rename "texture" to "data array". This has not used textures for a long time,
  there are just global memory arrays now. (On old CUDA GPUs there was a cache
  for textures but not global memory, so we used to put all data in textures.)
* For CUDA and HIP, put globals in KernelParams struct like other devices.
* Drop __ prefix for data array names, no possibility for naming conflict now that
  these are in a struct.
2022-06-20 12:30:48 +02:00
b73a52302e Fix T98913: GPU Subdivision: "Show Wire" overlay glitch
Issue is caused by an off by one error which would map some edge loops to
the loops of some the next polygon in the list of polygon, which may not
be a topological neighbor.
2022-06-20 12:14:03 +02:00
088157e447 Cleanup: Add description of more mask editing poll functions
No functional changes.
2022-06-20 11:25:38 +02:00
e658c8851a Refactor: De-duplicate mask operator poll functions
The poll function with same semantic was defined in both screen and
mask space modules. The only reason for this seems to be that the
image editor needed a mask poll function which was private to the
mask module.

Make the mask editing poll functions public, avoiding code duplication.

Also, added a brief explanation about what the poll functions are
checking for.

No user-level changes are expected to happen.
2022-06-20 11:21:09 +02:00
f8cec1ff30 Cleanup: avoid duplicate lookups when setting the cursor
Also use `const char *` for cursor names as there isn't an advantage
in using `std::string`.
2022-06-20 12:18:36 +10:00
a76c1ddecc Fix setting the custom cursor for Hi-DPI displays in Wayland
Changing the cursor would intermittently close Blender's window
(without crashing).

This happened because the size of a cursor must be the a multiple of the
scale, for themed cursor this is always true but with custom cursors
it's not.

Separate theme scale from custom cursor scale to avoid this bug.
In the future we can support Hi-DPI custom cursors, for now they're
scale is always set to 1.
2022-06-20 12:12:05 +10:00
6e8217d35e GHOST/Wayland: refactor cursor handling & fix errors hiding the cursor
- Support showing & hiding the cursor without setting the buffer,
  needed to switch between software and hardware cursor.
- Track the state of the software/hardware cursor.

This resolves glitches switching between cursors sometimes hiding the
cursor.
2022-06-20 12:09:31 +10:00
Iyad Ahmed
6ad9d8e224 STL: Fix missing space in C++ .stl importer info output
Fixes C++ .stl importer info output having no space between the
number and the word after it.

Reviewed By: Aras Pranckevicius
Differential Revision: https://developer.blender.org/D15240
2022-06-19 17:42:58 +03:00
91b5254598 Fix T98874: new obj importer missing an option to import vertex groups
The old Python OBJ importer had a (somewhat confusingly named) "Keep
Vertex Order -> Poly Groups" option, that imported OBJ groups as
"vertex groups" on the resulting mesh. All vertices of any face were
assigned the vertex group, with a 1.0 weight.

The new C++ importer did not have this option. It was trying to do
something with vertex groups, but failing to actually achieve
anything :) -- the vertex groups were created on the wrong object
(later on overwritten by "nomain mesh to main mesh" operation);
vertex weights were set to 1.0/vertex_count, and each vertex was only
set to be in one group, even when it belongs to multiple faces from
different groups. End result was that to the user, vertex groups were
not visible/present at all (see T98874).

This patch adds the import option (named "Vertex Groups"), which is
off by default, and fixes the import code logic to actually do the
right thing. Tested on file from T98874; vertex groups are imported
just like with the Python importer.

Reviewed By: Howard Trickey
Differential Revision: https://developer.blender.org/D15200
2022-06-19 17:39:54 +03:00
cf8922ef57 Fix T97820: new OBJ importer wrongly producing "sharp" edges in some cases
The new OBJ importer is producing "sharp" edges on some meshes that
should be completely smooth. Only observed on UV-Sphere type meshes
so far (see T97820).

I'm not 100% sure what is the root cause, but my theory was that
maybe due to limited number of float digits that are printed for
vertex normals in the file, the normals that are read in are not
always exactly 1.0 length. And then the Blender's "set custom loop
normals" function (which expects normalized inputs) wrongly marks
some edges as sharp.

Adding explicit normalization for the normals that are read from the
file fixes the wrongly-sharp edges in test cases from T97820. I
have not observed measurable performance impact in importing large
models (e.g. 6-level subdivided Monkey) that contain vertex normals.

Reviewed By: Howard Trickey
Differential Revision: https://developer.blender.org/D15202
2022-06-19 17:38:32 +03:00
b7e193cdad BLI: avoid unnecessary allocation when converting virtual array 2022-06-19 14:52:51 +02:00
d48735cca2 Functions: speedup multi-function procedure executor
This improves performance of the procedure executor on secondary metrics
(i.e. not for the main use case when many elements are processed together,
but for the use case when a single element is processed at a time).

In my benchmark I'm measuring a 50-60% improvement:
* Procedure with a single function (executed many times): `5.8s -> 2.7s`.
* Procedure with 1000 functions (executed many times): `2.4 -> 1.0s`.

The speedup is mainly achieved in multiple ways:
* Store an `Array` of variable states, instead of a map. The array is indexed
  with indices stored in each variable. This also avoids separately allocating
  variable states.
* Move less data around in the scheduler and use a `Stack` instead of `Map`.
  `Map` was used before because it allows for some optimizations that might
  be more important in the future, but they don't matter right now (e.g. joining
  execution paths that diverged earlier).
* Avoid memory allocations by giving the `LinearAllocator` some memory
  from the stack.
2022-06-19 14:25:56 +02:00
575884b827 Update RNA Manual References 2022-06-18 18:14:54 -04:00
7bf306622e Constraints: handle the custom target at the constraint level.
Since the custom target is a feature implemented at constraint
level, it is more appropriate to handle it in the common wrapper
functions, instead of modifying all the type specific callbacks
like get_constraint_targets and flush_constraint_targets.

Also, tag the special target with a flag so other code can
handle it appropriately where necessary.

This was split from D9732, and effectively reverts and refactors
part of D7437. This patch should cause no functional changes.

Differential Revision: https://developer.blender.org/D15168
2022-06-18 18:43:02 +03:00
b8bd304bd4 Geometry Nodes: speedup Separate XYZ node
This speeds up the node ~20% in common cases, e.g. when only the
X axis is used. The main optimization comes from not writing to memory
that's not used afterwards anymore anyway.

The "optimal code" for just extracting the x axis in a separate loop was
not faster for me. That indicates that the node is bottlenecked by
memory bandwidth, which seems reasonable.
2022-06-18 13:41:08 +02:00
7d030213b2 GHOST/Wayland: implement getAllDisplayDimensions 2022-06-18 21:27:23 +10:00
cf3238c1c7 Fix initial window size being scaled down for Hi-DPI displays in Wayland
getMainDisplayDimensions return values were scaled by the UI-scale,
instead of returning pixel values.

Also correct an error accessing the rotated monitor size,
which happened to be harmless as the value isn't used at the moment.
2022-06-18 21:27:23 +10:00
ac4836af6a Cleanup: Remove unused argument, unnecessary struct keyword 2022-06-18 13:08:15 +02:00
30f244d96f Fix: curves have incorrect resolution attribute after realizing instances
If the resolution attribute existed on some curves, but not on others, it
was initialized to zero by default. However, zero is not a valid resolution.
2022-06-18 13:01:41 +02:00
3c2a2a6c96 Cleanup: Always store attribute name in attribute request
Previously the attribute name was only stored in the request for curves.
Instead, pass it as part of the "add request" function, so that it is
always used. Since the whole attribute pipeline is name-based,
this can simplify code in a few places.
2022-06-18 11:48:51 +02:00
8a3ff496a7 Cleanup: Remove unnecessary switch statement
The types are retrieved by the attribute matching above anyway,
there is no reason to have another switch based on the type.
2022-06-18 11:40:46 +02:00
498f079d2c GHOST/Wayland: support displaying custom software cursors
Add a method to access the custom cursor from GHOST which is used
for drawing a software cursor. This means the knife tools cursor now
work as expected.

Although non-custom cursors are still not supported.
2022-06-18 17:16:42 +10:00
881d1c9bc2 Fix crash in wayland when closing a window
The focus_pointer only pointer was only cleared when the window existed,
which caused a dangling focus_pointer when closing a window.
2022-06-18 16:50:25 +10:00
35b2b9b6e6 Fix T98793: Wayland clamps cursor movement fails with gnome-shell
The current gnome-shell (v42.2) has a bug where grabbing the cursor
doesn't scale the region when confining it to the window.

For Hi-DPI displays this means the cursor may be confined to a quarter
of the window, making grab unusable.

Even though this has been fixed up-stream the issue remains in the
latest release - so workaround the problem by implementing window
confined grab using a software cursor.

This is only used gnome-shell for displays that use Hi-DPI scaling.
2022-06-18 15:06:46 +10:00
5c814e75f2 GHOST: add GHOST_Rect.clampPoint method
Method for clamping a point inside a rectangle.
2022-06-18 14:33:50 +10:00
Ray Molenkamp
600c391a65 Cleanup: Compiler Warning of Sign Conversion #2
Second attempt to silence sign-conversion warning on Linux, introduced
in rB524a9e3db810. Confirmed fix on buildbot.
2022-06-17 13:59:25 -07:00
3d3c0dfe30 Cleanup: Compiler Warning of Sign Conversion
rB524a9e3db810 introduced sign-conversion warning on Linux.

Own Code
2022-06-17 12:46:37 -07:00
5b5811c97b USD: speed up large USD imports by not rebuilding material name map for each object
Previous code was rebuilding "name to material" map for each object
being imported. Which means O(N*M) complexity (N=object count,
M=material count). There was already a TODO comment suggesting that
a single map that's maintained for the whole import would be enough.
This commit does exactly that.

While importing Moana USD scene (260k objects, 18k materials) this
saves about 6 minutes of import time.

Reviewed By: Bastien Montagne
Differential Revision: https://developer.blender.org/D15222
2022-06-17 22:28:22 +03:00
230f72347a IO: speed up large Alembic & USD imports by doing fewer collection syncs
Previous code was doing N collection syncs when importing N objects
(essentially quadratic complexity in terms of object count). New
code avoids all the intermediate syncs by using
BKE_layer_collection_resync_forbid and
BKE_layer_collection_resync_allow, and then does one
BKE_main_collection_sync + BKE_main_collection_sync_remap for the
whole operation. The things done on the importer objects that are
dependent on the sync happening (marking them selected) are done in a
separate loop after the sync.

Timings: importing Moana USD scene (480k objects) on Windows, VS2022
Release build, AMD Ryzen 5950X: 12344sec -> 10979sec (saves 22 minutes).

Reviewed By: Bastien Montagne
Differential Revision: https://developer.blender.org/D15215
2022-06-17 22:22:30 +03:00
Patrick Huang
257b4d138c Fix T93446: search box active result does not reset when typing
Whenever the user edits the query in a search box, the active (highlighted)
result resets to the first. Previously, it would remain at the last
highlighted result, jumping around as the results update.

This is better than the previous behavior. If a user highlights a choice either
on purpose or by accidental mouse movement and continues to type, it is likely
that they are not looking for the currently highlighted choice, so setting it
to the top search result is more useful.

Differential Revision: https://developer.blender.org/D15211
2022-06-17 19:51:13 +02:00
Jim Eckerlein
33bad77043 Draco: update to version 1.5.2
Differential Revision: https://developer.blender.org/D15233
2022-06-17 19:40:01 +02:00
524a9e3db8 BLF: Fallback Font Stack
Allow use of multiple fonts acting together like a fallback stack,
where if a glyph is not found in one it can be retrieved from another.

See D12622 for much more detail

Differential Revision: https://developer.blender.org/D12622

Reviewed by Brecht Van Lommel
2022-06-17 10:31:48 -07:00
5485057a27 Cleanup: compiler warnings 2022-06-17 19:18:47 +02:00
0ea173165b Revert "TEST COMMIT: API doc generation changes."
This reverts commit d86af60429.
2022-06-17 18:21:28 +02:00
9bae9d97b1 deps: fix llvm using system python
llvm was using system python, rather than our copy
this went unnoticed on both linux and windows until
sergey tried to build the deps on a clean system with
no system python installed.
2022-06-17 09:38:25 -06:00
d86af60429 TEST COMMIT: API doc generation changes.
This commit is intended to be reverted within a few minutes.

commit 50adc860a652508570dbc7102ef288049a9ffed4
Author: Bastien Montagne <bastien@blender.org>
Date:   Wed Jun 15 15:43:13 2022 +0200

    Py API Doc: add runtime changelog generation to `sphinx_doc_gen.py`.

    Optionally use `sphinx_changelog_gen.py` to dump current version of the
    API in a JSON file, and use closest previous one listed in given index
    file to create a changelog RST page for Sphinx.

commit 88fc683e78f866f1b3cda379c3b90e1f2916ce00
Author: Bastien Montagne <bastien@blender.org>
Date:   Wed Jun 15 15:36:19 2022 +0200

    Py API Doc: refactor changelog generation script.

    Main change is to make it use JSON format for its dump files, instead of
    some Python code.

    It also introduces an index for those API dump files, mapping a blender
    version to the relevant file path.

    This is then used to automatically the most recent (version-number wise)
    previous API dump to compare against current one, when generating the
    change log RST file.
2022-06-17 17:07:37 +02:00
3c0162295f Revert "TEST COMMIT: API doc generation changes."
This reverts commit 52b93c423d.
2022-06-17 17:03:32 +02:00
0d43117a40 Cleanup: deduplicate generating transform matrices in curves brushes 2022-06-17 16:57:36 +02:00
23662a9a84 Cleanup: simplify Add Curves brush 2022-06-17 16:57:36 +02:00
52b93c423d TEST COMMIT: API doc generation changes.
This commit is intended to be reverted within a few minutes.

commit 9442d8ef0f255d3c18b610b42aff71229904aaee
Author: Bastien Montagne <bastien@blender.org>
Date:   Wed Jun 15 15:43:13 2022 +0200

    Py API Doc: add runtime changelog generation to `sphinx_doc_gen.py`.

    Optionally use `sphinx_changelog_gen.py` to dump current version of the
    API in a JSON file, and use closest previous one listed in given index
    file to create a changelog RST page for Sphinx.

commit f7fb537078641d2e2de015c08554f5281ce9debd
Author: Bastien Montagne <bastien@blender.org>
Date:   Wed Jun 15 15:36:19 2022 +0200

    Py API Doc: refactor changelog generation script.

    Main change is to make it use JSON format for its dump files, instead of
    some Python code.

    It also introduces an index for those API dump files, mapping a blender
    version to the relevant file path.

    This is then used to automatically the most recent (version-number wise)
    previous API dump to compare against current one, when generating the
    change log RST file.
2022-06-17 16:39:36 +02:00
b8f489c65b Revert "TEST COMMIT: API doc generation changes."
This reverts commit 510f3fe9a9.
2022-06-17 16:30:42 +02:00
133095fff4 Curves: refactor Add brush
This splits out the code that samples points on a surface and the
code that initializes new curves. This code will be reused by D15134.

Differential Revision: https://developer.blender.org/D15216
2022-06-17 15:31:21 +02:00
18def163f8 Cleanup: Simplify syntax in curves draw cache file
Also remove some unnecessary logic and change a variable name.
2022-06-17 15:11:41 +02:00
f0b4aa5d59 LibOverride: Handle dependencies in both directions in partial override cases.
When creating etc. a liboverride based on a partial hierarchy
pre-selection (e.g: override hierarchy on the rig object of a
character), now all linked data also using that rig (e.g. all meshes
deformed by that armature) will also automatically be overridden.

This si achieved by following dependencies in the reversed order (from
used IDs to using IDs) when we find one tagged for override.
2022-06-17 14:10:51 +02:00
8d61ca5815 BKE_main: Relations: Add TO/FROM variants of processed flags.
In some cases, it can be usefull to distinguish when an entry has been
processed in which direction (`to` when handling ID pointers used by
the entry, `from` when handling ID using this entry).

Previous `MAINIDRELATIONS_ENTRY_TAGS_PROCESSED` tag is now a combination
of the two new ones.
2022-06-17 14:10:51 +02:00
2c1bffa286 Cleanup: add verbose logging category names instead of numbers
And use them more consistently than before.
2022-06-17 14:08:14 +02:00
24246d9870 Cleanup: replace uint4 by AttributeMap struct 2022-06-17 14:08:14 +02:00
Chris Clyne
838c4a97f1 Geometry Nodes: new Volume Cube node
This commit adds a Volume Cube primitive node. It outputs a volume that
contains a single "density" float grid. The density per voxel can be
controlled with a field that depends on the voxel position (using the
existing Position node). Other field inputs are not supported.

The density field is evaluated on every voxel.

Possible future improvements are listed in D15198.

Differential Revision: https://developer.blender.org/D15198
2022-06-17 13:30:44 +02:00
75489b5887 Geometry Nodes: tweak Volume to Mesh threshold declaration
* Remove the minimum value, because that doesn't make sense in general.
* Add a description.
2022-06-17 13:30:44 +02:00
d54eb5ed20 Fix crash invoking layer add/remove operators without mask 2022-06-17 12:14:30 +02:00
510f3fe9a9 TEST COMMIT: API doc generation changes.
This commit is intended to be reverted within a few minutes.

commit 088497c870630d9b0d405aaa5fd796c77b380731
Author: Bastien Montagne <bastien@blender.org>
Date:   Wed Jun 15 15:43:13 2022 +0200

    Py API Doc: add runtime changelog generation to `sphinx_doc_gen.py`.

    Optionally use `sphinx_changelog_gen.py` to dump current version of the
    API in a JSON file, and use closest previous one listed in given index
    file to create a changelog RST page for Sphinx.

commit 91801f47ad03f4739e97ae4b4edee09687e2cb85
Author: Bastien Montagne <bastien@blender.org>
Date:   Wed Jun 15 15:36:19 2022 +0200

    Py API Doc: refactor changelog generation script.

    Main change is to make it use JSON format for its dump files, instead of
    some Python code.

    It also introduces an index for those API dump files, mapping a blender
    version to the relevant file path.

    This is then used to automatically the most recent (version-number wise)
    previous API dump to compare against current one, when generating the
    change log RST file.
2022-06-17 10:46:06 +02:00
10981bc8c0 Fix T98944: Uninitialized XRFrameState can prevent VR/OpenXR viewing
This provides a workaround for the VR session stopping due to an error
in locating controller poses. The problem was that for the actions sync
on the first frame, the session's XrFrameState/predicted display time
had not been initialized yet, which led to an error in xrLocateSpace()
(the error was only observed for some OpenXR runtimes since the first
frame pose state would be inactive for other runtimes, skipping the
call to xrLocateSpace()).

The timing of action updates relative to frame state updates could be
reworked in the future, but for now simply check for a valid display
time to avoid an error on the first frame.
2022-06-17 17:25:48 +09:00
18960c08fd UI: Custom Properties - Rename properties to remove "Use/Is"
There is no need to have use/is in the final name. This is implicitly
represented by the checkbox already.

This does not change the Python API, only the names we show in the user
interface.

* Is Library Overridable -> Library Overridable
* Use Soft Limits -> Soft Limits

Differential Revision: https://developer.blender.org/D15217
2022-06-17 10:08:17 +02:00
96764c3a1f Cleanup: Remove redundant doxygen section
Also remove const for the object argument, since the object data
is logically modified by generating the data.
2022-06-17 09:44:46 +02:00
9830603620 GHOST/Wayland: skip cursor surface operations when hiding the cursor
Also set the buffer scale before setting the cursor (matching SDL).
2022-06-17 17:35:44 +10:00
f59418fd92 Cleanup: use booleans for GHOST C-API
Also use GHOST_ prefix for public functions.
2022-06-17 17:18:06 +10:00
5cda99ff52 Cleanup: clang-tidy for GHOST 2022-06-17 17:15:06 +10:00
c756d08b4a Cleanup: remove redundant string formatting 2022-06-17 17:14:00 +10:00
1152a437e0 Cleanup: remove r_ prefix for non-return values 2022-06-17 17:13:59 +10:00
0ff7a7b3b5 Fix T98663: Eevee compilation error cryptomatte shaders.
On MacOS Eevee cyptomatte shaders fails as it doesn't ignore the `attrib_load`
parameter. I validated that removind the parameter works on Linux/AMD and MacOS
Intel. It could be that there are other platforms that require the dummy parameter.

If this should use a forward declaration and implement an emoty function in the
cryptomatte vertex shader.
2022-06-17 08:25:21 +02:00
62346abc02 Cleanup: spelling in comments 2022-06-17 07:33:06 +10:00
483bc6c9c1 Cleanup: unused variable warning 2022-06-17 07:23:21 +10:00
e2975cb701 Geometry Nodes: add 'Intersecting Edges' output for boolean node
This patch adds a 'Intersecting Edges' output with a boolean selection
that only gives you the new edges on intersections.

Will work on a couple of examples next, this should make some
interesting effects possible (including getting us closer to the "bevel-
after-boolean-usecase")

To achieve this, a Vector is passed to `direct_mesh_boolean` when the
iMesh is still available (and intersecting edges appended), then from
those edge indices a selection will be stored as attribute.

Differential Revision: https://developer.blender.org/D15151
2022-06-16 20:34:27 +02:00
209bf7780e UI: Add file browser operator to edit directory field
This allows using a shortcut from the file browser to edit the directory
path. The shortcut Ctrl + L is quite standard and used in multiple
GNU/Linux desktop desktop environments, Windows, as well as most web
browsers. Safari on macOS uses Cmd + L.

Reviewed by: Jacques Lucke, Julian Eisel

Differential Revision: https://developer.blender.org/D15196
2022-06-16 19:46:37 +02:00
650d2f863d Cleanup: Use const in File Browser filtering operator 2022-06-16 19:46:37 +02:00
b6b5f317a3 Revert "Revert "Revert "TEST COMMIT: API doc generation changes."""
This reverts commit 5a30fe29ef.
2022-06-16 19:35:55 +02:00
23d2e77a54 UI: Add initial "grid view"
Part of T98560.
See https://wiki.blender.org/wiki/Source/Interface/Views

Adds all the basic functionality needed for grid views. They display
items in a grid of rows and columns, typically with a preview image and
a label underneath. Think of the main region in the Asset Browser.

Current features:
- Active item
- Notifier listening (also added this to the tree view)
- Performance: Skip adding buttons that are not scrolled into view
  (solves performance problems for big asset libraries, for example).
- Custom item size
- Preview items (items that draw a preview with a label underneath)
- Margins between items scale so the entire region width is filled with
  column, rather than leaving a big empty block at the right if there's
  not enough space for another column (like the File and current Asset
Browser does it).
- "Data-View Item" theme colors. Not shown in the UI yet.

No user visible changes expected since the grid views aren't used for
anything yet.

This was developed as part of a rewrite of the Asset Browser UI
(`asset-browser-grid-view` branch), see T95653. There's no reason to
keep this part in a branch, continuing development in master makes
things easier.

Grid and tree views have a lot of very similar code, so I'm planning to
unify them to a degree. I kept things separate for the start to first
find out how much and what exactly makes sense to override.
2022-06-16 19:25:50 +02:00
69d3f41d75 Cleanup: Spelling in comment 2022-06-16 17:36:58 +02:00
6562a11c60 Cleanup: use proper variable name
The `SpaceClip *sc` got incorrectly renamed to `SpaceClip *screen`
in the ad85989a3f.
2022-06-16 16:58:33 +02:00
dc11e1164a Fix T98796: avoid unnecessary mesh copy
The call to `get_component_for_write` would sometimes copy the mesh
even when the mesh is replaced with itself. The `replace_mesh` method
handles that case already, so just use that instead.
2022-06-16 16:45:31 +02:00
947ece8d39 LineArt: Variable name cleanups.
Use more descriptive names for some of the two character variables.

Reviewed By: Sebastian Parborg (zeddb)

Differential Revision: https://developer.blender.org/D15192
2022-06-16 22:43:53 +08:00
8b9469ec36 Cleanup: Fix build for make lite and add . to code comments
Issue introduced on e6eefdd402.
2022-06-16 16:37:54 +02:00
5a30fe29ef Revert "Revert "TEST COMMIT: API doc generation changes.""
This reverts commit 502089f275.

Enable again temporarily the new test code for API doc generation.
2022-06-16 16:36:42 +02:00
e0c966a3b9 Fix T98904: GPencil sculpt brushes break after you delete a brush
There were two problems here:

1) Console warnings due to brush was None.
2) It was impossible to recreate a brush.

This patch fixes both issues and it is now possible to recreate any brush.

Differential Revision: https://developer.blender.org/D15213

Reviewed by: @dflelinto
2022-06-16 16:29:11 +02:00
49b068bc63 Fix T98847: missing null check in versioning code
It's perfectly legal for `nmd->settings.properties` to be null if
there are no properties.
2022-06-16 16:23:45 +02:00
Hamdi Ozbayburtlu
e6eefdd402 Fix T86076: MPEG Settings Ignored at Render
Add a RNA update function for output video codec setting to update
properties that are incompatible with defaults.

Previously video output bitrate settings were omitted because of the
Constant Rate Factor (CRF) default. CRF setting for video codec is only
available for H264, MPEG4 and WEBM/VP9 outputs, so for the others
changing encoder quality mode to constant bitrate (CBR) as CRF is not
supported.

Reviewed By: ISS, mano-wii

Differential Revision: https://developer.blender.org/D15201
2022-06-16 16:03:37 +02:00
dce03ecd5c LibOverride: 3DView: simplification and improvements of override creation.
This commit:
* Removes the popup to choose the root collection when called with a
  linked object selected (in typical cases there is only one valid
  option, if more then the operator fails and report to the user).
* Ensures that the linked reference of newly overridden collections are
  also removed from the ViewLayer (i.e. their local parent collections).
2022-06-16 15:58:40 +02:00
798b49109b ID Type: Sort the items alphabetically
This also renames Hair Curves to Curves. Meaning that until we get
rid of the old curve type we will have both of those entires there:

* Curve
* Curves

This rna enum is used among other things in the driver UI to pick
which data-block you want the property from.
2022-06-16 15:25:09 +02:00
9bed68de13 Fix T98860: VectorProperty type renamed to COORDS (breaking scripts)
Regression in [0] unintentionally renamed COORDINATES.
There was a naming discrepancy when two (nearly) identical arrays,
de-duplicating them caused the error.

[0]: 94444aaadf
2022-06-16 18:10:02 +10:00
36307d8fba Fix (studio-reported) broken 'system override' filtering in liboverride view of the Outliner.
Regression from recent rB717ab5aeaecc.
2022-06-16 09:56:15 +02:00
1064bf58c3 Cleanup: differentiate region/screen relative coordinates
- Avoid ambiguity which caused these values to be confused, use `mval`
  for region relative mouse coordinates, otherwise `event_xy`.

- Pass region relative coordinates to sample_detail_dyntopo &
  sample_detail_voxel as there is no reason to use screen-space values.

- Rename invalid use of mval for screen-space coordinates.
2022-06-16 16:32:35 +10:00
b19751bee2 Fix mouse coords for sculpt ignore background click, sample voxel detail
Both operations used screen-relative coordinates when region-relative
coordinates were expected.
2022-06-16 15:57:28 +10:00
65b1b1cd34 GHOST/Wayland: workaround inability to access window position
Wayland doesn't support accessing the position making functionality that
would map events to other windows fail, sometimes considering windows
overlapping when they weren't (as all window positions were zeroed).

Disable dragging between windows when accessing the window the position
isn't supported.
2022-06-16 15:22:46 +10:00
a17f74ab34 Fix memory leak plugging in new keyboards in wayland 2022-06-16 14:55:37 +10:00
0d644e6d06 Cleanup: return const vector for system & window outputs() method
Move the enter/leave logic into methods so the method can return a const
vector which isn't to be manipulated from other functions.
2022-06-16 14:27:57 +10:00
9dd5c2a7ec Fix error selecting the window scale in wayland
Regression in [0] caused all output to be considered when updating
after monitor outputs changed.

[0]: ac2a56d7f3
2022-06-16 14:18:45 +10:00
1fed24de5a GHOST/Wayland: acquire locks before freeing data on exit 2022-06-16 12:29:22 +10:00
409c62aa61 Fix missing free for drag & drop data with GHOST/Wayland 2022-06-16 12:29:20 +10:00
02012b0cce GHOST/Wayland: account for fractional scale when picking the output
Finding the output with the largest scale now checks fractional scaling.

While this is only a minor difference in most cases, it makes the scale
deterministic instead of depending on the order outputs are added.
2022-06-16 12:29:18 +10:00
fa99323f09 Cleanup: quiet compiler warnings 2022-06-16 12:29:10 +10:00
e6e9f1ac5a Fix T98239: During UV Unwrap, create unique indices for each pinned UV
Originally reported in T75007.

Differential Revision: https://developer.blender.org/D15199
2022-06-16 09:53:50 +12:00
Iyad Ahmed
2804497312 io: remove unnecessary transposes when using mat3_from_axis_conversion
Some I/O code paths (Collada, OBJ) were using mat3_from_axis_conversion
followed by transpose_m3, instead of swapping the axis arguments
which achieves exactly the same result.

Reviewed By: Aras Pranckevicius
Differential Revision: https://developer.blender.org/D15158
2022-06-15 21:46:38 +03:00
43ddfdb1a5 Fix T98909: Outliner - "Show Hierarchy" only shows one level
Error in a4a7af4732.

To allow deleting tree elements while iterating, the new iterators would
get needed data out of the tree element before calling the iterator
callback. This included the info if the element is open or collapsed. So
if the callback would open or collapse elements, the iterator wouldn't
respect that change. Luckily the way the open/collapsed state is stored,
we can still query it after the callback is executed, without having to
access the (possibly freed) tree element.
2022-06-15 20:14:29 +02:00
653100cd65 obj: reduce vertex colors to 4 decimal places, reenable tests
OBJ vertex color related tests were not producing identical results
across various platforms, primarily due to sRGB<->Linear color space
conversions.

While D15193 has just made the color space conversion accuracy match
much closer between platforms, it's still not 100% the same.

This change reduces the amount of decimal places used for exporting
vertex colors, to 4 digits (down from 6). Vertex normals were
already always printed with 4 digits, and colors are conceptually
similar (usually 0..1 range etc.).

This makes the vertex color tests pass again, so re-enable them
after adjusting to 4 decimals expectations.
2022-06-15 21:05:35 +03:00
004d858138 math: improve accuracy of Linear->sRGB conversion SIMD path
srgb_to_linearrgb_v3_v3 is using an approximation of powf that is
SIMD. However, while the accuracy of it is ok, a larger issue is that
it produces different results on Intel compared to ARM architectures.

On ARM (e.g. AppleSilicon), the result of the SIMD code path is much
closer to the reference implementation. This seems to be because of
_mm_rsqrt_ps usage in _bli_math_fastpow512. The ARM/NEON code path
emulates inverse square root with a combination of vrsqrteq_f32
followed by two Newton-Raphson iterations, because blender uses the
SSE2NEON_PRECISE_SQRT define.

This commit adds similar NR iterations to the "actual SSE" code path
as well.

Max error of srgb->linear->srgb conversion roundtrip goes from
0.000211 down to about 0.000062.

Reviewed By: Sergey Sharybin
Differential Revision: https://developer.blender.org/D15193
2022-06-15 20:51:25 +03:00
7e89bbb2ff UI: Implement icons for the curve sculpt tools brushes
I'm using the tool icons for the brush themselves.

Note: This includes a few brushes that are only defined in D15134.
Those are simply the icons rendered with a world background of #282828.
2022-06-15 18:59:33 +02:00
0a3650210f UI: Fix sculpt curve not being able to get brush icons
This commit doesn't add the brush icons themselves, but
it fix the code that allow them to be used.
2022-06-15 18:31:13 +02:00
d3edb3cfc7 Fix missing translation hint in tracking code
Is likely harmless due to Camera being covered by other areas,
but is still good to do a proper hint.
2022-06-15 17:15:05 +02:00
502089f275 Revert "TEST COMMIT: API doc generation changes."
This reverts commit 298372fa06.
2022-06-15 17:11:00 +02:00
298372fa06 TEST COMMIT: API doc generation changes.
This commit is intended to be reverted within a few minutes.

commit 39ffb045a52d16994c1c87ccf3249ff3222a8fca
Author: Bastien Montagne <bastien@blender.org>
Date:   Wed Jun 15 15:43:13 2022 +0200

    Py API Doc: add runtime changelog generation to `sphinx_doc_gen.py`.

    Optionally use `sphinx_changelog_gen.py` to dump current version of the
    API in a JSON file, and use closest previous one listed in given index
    file to create a changelog RST page for Sphinx.

commit fbe354d3fcfa2ad1ed430c3c27e19b99a0266dda
Author: Bastien Montagne <bastien@blender.org>
Date:   Wed Jun 15 15:36:19 2022 +0200

    Py API Doc: refactor changelog generation script.

    Main change is to make it use JSON format for its dump files, instead of
    some Python code.

    It also introduces an index for those API dump files, mapping a blender
    version to the relevant file path.

    This is then used to automatically the most recent (version-number wise)
    previous API dump to compare against current one, when generating the
    change log RST file.
2022-06-15 16:48:30 +02:00
f0fa90e156 GPencil: Fix crash when using time offset modifier
This fixes a mistake in 60bf561d37, which did not account for offset
frames by the time offset modifier.
2022-06-15 16:15:45 +02:00
fe988f6c7f depsbuilder: build_deps.cmd look for pythonw rather than python
There is a check to be sure no system python is in the path
on windows to be sure deps do not accidentally build against it.

The problem arises on certain versions of windows that ship a
python.exe that just opens up the MS store to download their
python version. The check takes this to be a real python
installation and refuses to build.

This change fixes the issue by looking for pythonw.exe which a
real python install would have, but the MS store opening one that
windows ships (as of now) would not.
2022-06-15 07:47:28 -06:00
60bf561d37 Fix T98853: Blender crashes when moving grease pencil object has any invisible layers
Whats happening is that the modifier keeps adding new frames to the evaluated object resulting in an exponential increase. This is because when preparing the data for the modifiers we only copy visible strokes to the eval object. But the modifiers do not consider visibility and will generate the mirrored strokes even for layers that are hidden. Because those layers have not been copied (only their structure) we run into this issue.

The solution is always copy the active frame of all layers (even if the layer is hidden).
2022-06-15 15:37:39 +02:00
Kevin Curry
2e33172719 Assets: Don't show duplicated catalog name when dragging assets
While dragging assets over a catalog, we would show both the name and
the full catalog path in the drag tooltip. For catalogs at the root
level (catalogs without parents) the name and the full path are the
same, so it would just display the name twice. This is more confusing
than helpful. Now skip displaying the full path in that case.

Reviewed by: Julian Eisel
Addresses T92855

Differential Revision: https://developer.blender.org/D15190
2022-06-15 15:27:20 +02:00
15b4120064 Make Instance Face: Support instanced collections too
Differential Revision: https://developer.blender.org/D15204
2022-06-15 13:53:37 +02:00
41053deba4 GPencil: Avoid console warnings when no Sculpt brush selected
If the brush is deleted, the panel must not be filled.

To recreate the missing Brush is necessary to use `Reset All`

This fix part of T98904
2022-06-15 13:30:14 +02:00
2e6cd70473 Clip editor: Default to average error sort in dopesheet
This is what we agreed on during the workshop.

Differential Revision: https://developer.blender.org/D15194
2022-06-15 12:37:35 +02:00
216a2c0f37 Clip editor: Use Ascending/Descending order instead of "Inverse"
This is more intuitive for artists.
2022-06-15 12:37:31 +02:00
c1a231f40b Clip editor: Sort tracks alphabetically when they have matched error
Is nice to ensure order of tracks when their error is the same or
is not known yet (the clip was not solved yet).
2022-06-15 12:37:31 +02:00
412c468893 UI: Icons - Rename Density and Slide sculpt curve icons
Those tools will get renamed to follow the standard we have
for the other tools (i.e., add sculpt_ in their name).
2022-06-15 11:46:08 +02:00
7cc8f2743e Cleanup: remove redundant key entry from key_repeat_payload_t 2022-06-15 19:33:41 +10:00
e550e400cd Cleanup: internalize struct members for internal wayland types
Missed from 9978689595.
2022-06-15 19:33:41 +10:00
ea39d808b5 Fix T98765: Regression: Unable to select mask points in clip editor
Re-organize de-selection so that there is less conflict between tracking
and masking operators.

Still not fully ideal: the LMB selection does not de-select everything
now since the `mask.select` with `deselect_all` is only added to the
keymap when the RMB is the select mouse. While this is sub-optimal, this
seems to be how mask selection behaved in the Image Editor in 3.1.

Not sure it worth looking into a more complete fix, as it will likely be
too big to be safe for a corrective release.

Differential Revision: https://developer.blender.org/D15183
2022-06-15 10:24:04 +02:00
fc79b17dce GHOST/Wayland: add NULL pointer checks on window access
There were a few callers that missed checking a NULL return value
which can happen in rare cases.
2022-06-15 18:12:09 +10:00
66483c58eb Cleanup: avoid static_cast when accessing wayland windows
Rename get_window to window_from_surface and return a
GHOST_WindowWayland instead of an GHOST_IWindow since most callers
needed to cast. It also makes sense that an call for accessing windows
would return the native type.
2022-06-15 17:54:28 +10:00
f5dae5844c Fix T98699: Face dot colors in UV editor was using wrong color from theme 2022-06-15 19:41:37 +12:00
9978689595 Cleanup: various minor changes to wayland internal conventions
- Initialize values in the struct declarations
  (help avoid accidental uninitialized struct members).
- Use `wl_` prefix for some types to avoid e.g. `output->output`.
- Use `_fn` suffix for locally defined function variables.
- Use `_handle_` as separator for handlers, making function names easier
  to follow as this separates the handler name from the interface.
- Add doxy sections for listeners in GHOST_WaylandWindow.cpp.
2022-06-15 17:38:54 +10:00
f7bfbc357c Fix T98708: Crash on startup - OpenGL4.2 without conservative depth.
Intel iGPU (HD4000) supports OpenGL 4.4 but doesn't support conservative
depth. (GL_ARB_conservative_depth). This change will only check for the
availability of the extension.
2022-06-15 09:12:22 +02:00
b83f33ffca Cleanup: Miscellaneous improvements to draw attribute extraction
- Remove unnecessary braces in switch statements
- Move `default` to the end of other switch items
- Use camel case for type names
- Use `BLI_assert_unreachable()`
2022-06-15 09:07:26 +02:00
4acbb84efa GHOST/Wayland: resolve glitch drawing the software cursor
When grab was disabled, the software cursor would remain displayed
in the image view. Ensure an additional redraw is done to clear the
cursor.
2022-06-15 15:45:50 +10:00
2770010224 GHOST/Wayland: fractional scaling support
GHOST_GetDPIHint now returns a value that takes fractional scaling into
account. Otherwise the integer scale is used since Wayland's API's use
integer scale values exclusively.

Use the same method as SDL to calculate the fractional scale.
2022-06-15 15:30:44 +10:00
08f5219d1c Cleanup: use int32_t[2] for Wayland display size variables 2022-06-15 14:34:06 +10:00
46f93ac6be Cleanup: unused argument warning 2022-06-15 14:30:07 +10:00
04a75c90d5 Cleanup: Move function definition to correct file
Function `SEQ_transform_handle_overlap` was declared in sequencer module
header file, but it was defined in editor/transform module.

Move definition to sequencer module.
2022-06-14 22:24:36 +02:00
20ba130315 Fix T72831: Incorrect animation handling when strips overlap
Function `SEQ_transform_seqbase_shuffle_time` did not have access to
strip effects, and therefore could not handle their animation. Since
now transformation knows what strips can't be directly moved, but their
position depends on other strips, this collection of strips is passed as
argument, so animation can be offset correctly.
2022-06-14 21:55:59 +02:00
a59fedb0bf Fix T98168: Meta strips do not copy animation to another scene
Copy animation for strips that are inside metas.
2022-06-14 20:13:45 +02:00
6737f89e49 Fix T98718: Face Is Planar Node Not handling Certain Conditions
The comparison between dot products of each point of the poly were
not taking into consideration negative values. FLT_MIN was used rather
than -FLT_MAX due to a misunderstanding of the FLT_MIN definition.

Maniphest Tasks: T98718

Differential Revision: https://developer.blender.org/D15161
2022-06-14 12:53:50 -05:00
7a24fe372c Fix T98879: PBVH active attrs only optimization is buggy
PBVH draw has an optimization where it only sends the
active attribute to the GPU in workbench mode.  This
fails if multiple viewports are open with a mix of
workbench and EEVEE mode; it also causes severe lag
if any workbench viewport is in material mode.

There are two solutions: either add the code in sculpt-dev
that checks for EEVEE viewports at the beginning of each frame,
or integrate pbvh draw properly inside the draw manager
and let it handle which attributes should go to the GPU.
2022-06-14 10:02:30 -07:00
f5e7221fbd Cleanup: Fix const correctness of attribute search function
Retrieving a mutable custom data layer from a const ID
should not be possible.
2022-06-14 17:26:07 +02:00
b690f4c2e6 Fix T98875: Adding camera background image shows error
Don't show an error if no operator property is set at all that can be
used to find an image file or ID for dropping. The caller can decide if
this is an error that needs reporting or a valid case, like it is here.
2022-06-14 17:07:40 +02:00
06780aa4e6 Fix T98797: VSE Slip Strip Contents doesn't work properly
Caused by oversight in 7afcfe111a - code relied on fact, that strip
boundary holds old value until updated.

Calculate new offsets based on stored orignal offsets.
2022-06-14 17:04:19 +02:00
25f18e6c49 Cleanup: Snake case for variable name 2022-06-14 16:41:43 +02:00
0f06de8072 Attributes: Add null check in color attribute duplicate operator
It's potentially possible that the attribute duplication could fail,
for whetever reason. There is no great reason not to be safe in
this high-level code.
2022-06-14 16:41:43 +02:00
58a67e6fb6 Attributes: Adjustments to duplicate attribute API function
Use a name argument, for the same reasons as 6eea5f70e3.
Also reuse the layer and unique name creation in `BKE_id_attribute_new`
instead of reimplementing it. Also include a few miscellaneous cleanups
like using const variables and `std::string`.
2022-06-14 16:41:43 +02:00
3012eca350 Fix T98700: Regression: Crash when recursively nesting NLA meta strips
The `update_active_strip_from_listbase()` function took meta-strips in
the "source" list into account, but didn't recurse into the
corresponding meta-strip of the "destination" list. This is now fixed.

`update_active_strip_from_listbase()` needed a few changes to resolve
the issue:
- It was renamed to `find_active_strip_from_listbase()` to limit its
  reponsibility to just finding the active strip. It now leaves the
  assignment to the caller. This reduces the number of parameters by 1
  and makes recursion simpler.
- The destination strips are now, like the source strips, passed as
  `ListBase`, so that both source & dest can be recursed simultaneously.
2022-06-14 16:25:20 +02:00
67254ea37c Outliner: Sanitize material unlinking callback, report errors
The callback would just assume that it's only called on materials, which
may in fact not be the case. It could also be called for other ID types
and layer collections (see `outliner_do_libdata_operation()`). Properly
check this now.

Also avoid faling silently when the object or object-data to unlink from
couldn't be determined. Report this to the user. Operators that just do
nothing are confusing.
2022-06-14 16:21:12 +02:00
e772087ed6 Fix T98753: Outliner Unlink material in Blender File mode crashes
This issue was only exposed by ba49345705. The ID pointer of the
material's parent tree-element wasn't actually pointing to an ID, but to
the list-base containing the IDs. It was just unlikely to cause issues
in practice, although an assert was thrown.

Just don't do anything if the object or object-data to unlink the
material from could not be found. The following commit will introduce a
error message about this.
2022-06-14 16:21:12 +02:00
c7942c31b2 Fix: Don't allow duplicate color attribute operator in edit mode
The internal function relies on `CustomData_copy_data_layer` currently,
which doesn't work for BMesh. Support could be added as a special case
for BMesh, but in the meantime avoid bugs by just changing the poll.
2022-06-14 16:01:52 +02:00
ca9d65cc97 Fix T98813: crash with GPU subdiv in edit mode and instanced geometry
Instancing with geometry nodes uses just the evaluated Mesh, and ignores the
Object that it came from. That meant that it would try to look up the subsurf
modifier on the instancer object which does not have the subsurf modifier.

Instead of storing a session UUID and looking up the modifier data, store a
point to the subsurf modifier runtime data. Unlike the modifier data, this
runtime data is preserved across depsgraph CoW. It must be for the subdiv
descriptor contained in it to stay valid along with the draw cache.

As a bonus, this moves various Mesh_Runtime variables into the subsurf runtime
data, reducing memory usage for meshes not using subdivision surfaces.

Also fixes T98693, issues with subdivision level >= 8 due to integer overflow.

Differential Revision: https://developer.blender.org/D15184
2022-06-14 14:54:25 +02:00
4e96d71ddb Render report: better wording for reference image updating
The old text was suggesting to run `BLENDER_TEST_UPDATE=1 ctest` for
failed tests. Now it's more clear that this is for the regeneration of
reference (ground truth) images, and that it will not touch passing test
cases.

It now also mentions to commit the new reference images to SVN, driving
the point home that this is for updating those, and not for making
failing tests succeed in general.

Over-the-shoulder reviewed by: @sergey
2022-06-14 13:02:39 +02:00
Sonny Campbell
d209629806 Fix T85729: Crash when exporting for USD and Alembic
Ensure the "null" node graph, which is the root node of the export
graph, always exists.

The crash occured when "Use Settings For" was set to Render, "Visible
Objects Only" was ticked, and a single parent object is in the scene but
disabled for render.

Because the only object attached to the root of the project was disabled
for export, there was no "null" root node added to the export graph.
This change will always add an empty "null" node with no children to the
graph at the start. Other objects will get added to its children as
required.

Reviewed By: sybren

Maniphest Tasks: T85729

Differential Revision: https://developer.blender.org/D15182
2022-06-14 12:29:56 +02:00
28f4fc664f Cleanup: Variable name style in STL importer
Designate private variable names as described by the style guide,
and also add `num` at the end of variable names rather than at
the beginning, as discussed in T85728.
2022-06-14 12:04:58 +02:00
4475c38c5c Fix T98715: Crash drag-dropping collection from outliner to ID property
The value of disabled buttons shouldn't be changed through dropping onto
it. Check for the disabled state in the drop operator poll, so the
dragging code will change the cursor to show that dropping isn't
possible at the given cursor location.
2022-06-14 11:56:51 +02:00
06e0776175 obj: disable vertex color tests until it produces identical results across platforms 2022-06-14 12:53:41 +03:00
e903403b41 Curves: support adding keymap items for operators
* Add a new keymap for `curves.*` operators. This is mainly for
  edit mode operators, but since we don't have edit mode yet,
  these operators are also exposed in sculpt mode currently.
* Fix the naming of the "sculpt curves" keymap.
2022-06-14 10:53:06 +02:00
c654a92237 Fix use after free error in 827fa81767 2022-06-14 18:01:51 +10:00
c1d295e905 Fix crash in 827fa81767
Missing null pointer check.
2022-06-14 17:36:18 +10:00
e1f15e3b32 Fix T98782: ignore OBJ face normal indices if no normals are present
Some OBJ files out there (see T98782) have face definitions that
contain vertex normal indices, but the files themselves don't
contain any vertex normals. The code was doing a "hey, that's an
invalid index" and skipping these faces. But the old python importer
was silently ignoring these normal indices, so do the same here.

Reviewed By: Howard Trickey
Differential Revision: https://developer.blender.org/D15177
2022-06-14 10:23:28 +03:00
1b4f35f6a5 obj: vertex colors support in importer and exporter
Adds support for vertex colors to OBJ I/O.

Importer:

- Supports both "xyzrgb" and "MRGB" vertex color formats.
- Whenever vertex color is present in the file for a model, it is
  imported and a Color attribute is created (per-vertex, full float
  color data type). Color coming from the file is assumed to be sRGB,
  and is converted to linear upon import.

Exporter:

- Option to export the vertex colors. Defaults to "off", since not
  all 3rd party software supports vertex colors.
- When the option is "on", if a mesh has a color attribute layer,
  the active one is exported in "xyzrgb" form. If the mesh has
  per-face-corner colors, they are averaged on the vertices.
  Colors are converted from linear to sRGB upon export.

Reviewed By: Howard Trickey
Differential Revision: https://developer.blender.org/D15159
2022-06-14 10:19:02 +03:00
827fa81767 Fix cursor coordinates being quantized to the window scale in Wayland
- Apply the scale before converting cursor coordinates to int.
- Store sub-pixel cursor coordinates internally since
  this is what Wayland uses.
- Use `wl_fixed_t xy[2]` for storing coordinates as it simplifies
  assigning/passing x/y coordinates to an argument / variable.
- Also fix drag-and-drop coordinates which ignored scale.
2022-06-14 16:59:33 +10:00
f001c85772 Cleanup: don't define wayland window methods as private
This meant the system couldn't call window methods unless the window
was cast to GHOST_Window.
2022-06-14 15:07:24 +10:00
97f894881c GHOST/Wayland add tablet support
Add support for tablet pressure, tilt and type detection
(eraser, pen.. etc).

There is currently an inconsistency where the tablets cursor is scaled
larger than the mouse cursor (when the UI is scaled). Although there
doesn't seem to be a way to control this from the client.
2022-06-14 14:53:41 +10:00
74e9605455 blend_render_info: minor improvements to file parsing
- Stop once `ENDB` is reached, as files could include additional data.

- Prevent the possibility of an infinite loop from malformed BHEAD
  blocks that could seek backwards in the file.
2022-06-14 14:30:15 +10:00
6c31bd80e3 Cleanup: spelling 2022-06-14 14:30:13 +10:00
b5a5c24396 Cleanup: redundant function calls 2022-06-14 14:30:11 +10:00
0bd6b3e5a0 Cleanup: unused argument, variable warnings 2022-06-14 14:30:09 +10:00
f89ea052f7 Cleanup: remove the need for image scale using a context
Scaling an image shouldn't depend on the current context.
2022-06-14 14:30:06 +10:00
9a063e85a5 Cleanup: quiet unused variable warning 2022-06-14 14:30:04 +10:00
67f5596f19 Fix T98866: GPU subdiv crash in edit mode with loose geometry
The BMesh case was missing when extracting the loose edges flags used for
display, so the code was crashing on unitialized `MEdge` pointer.
2022-06-14 01:39:28 +02:00
77b34a00f9 Fix T97987: Can not keyframe strip mirror in Y axis
Property shared row with toggle for mirror in X axis, so clicking on
decorator added only keyframe for X axis toggle.
2022-06-13 22:35:36 +02:00
afde12e066 Outliner performance: Only expand sub-trees if needed
Before this, we would build the sub-trees of some elements, just to
remove them afterwards. In big files, this would sometimes build ten
thousands of elements unnecessarily. Now support not building those
sub-trees in the first place.

Performance tests in a Sprite Fright production file (release build):
- View Layer display mode, reduced Outliner tree rebuilding from ~45ms
  to 12-17ms
- Library Overrides display mode, Hierarchies view, reduced tree
  rebuilding from 5-6s(!) to 220ms
2022-06-13 22:06:08 +02:00
988fc24930 Fix T93500: Sequence.fps returns 0 when proxy is used
Caused by `seq_open_anim_file` early returning if anim struct exists,
exen if it's not initialized. To ensure `anim` struct is initialized
when `openfile` argument is true, don't do early return.
2022-06-13 20:46:39 +02:00
3b7ce70232 Fix T94499: Knife missed clipping check
The knife BVH raycast functionality was missing a check to discard
points which were clipped.
2022-06-13 19:28:48 +01:00
1c5f09e8a8 Fix T93469: Image not moving in proportion to mouse
Apply scale factor when preview aspect ratio is not 1:1.
2022-06-13 20:12:35 +02:00
1243c2bdae Fix VSE: Effect strip has length of 1 frame when added
Length was set properly when added, but it was clamped by function
`seq_time_effect_range_set`

Add early return for generator effects where offsets can be used
normally.
2022-06-13 18:29:51 +02:00
40d700c6fb UI: Use "bl_order" for UI child panels
The "bl_order" property on add-on UI panels can be used to put
them in a specific order regardless of the order of registering.
This patch makes this ordering also possible for panels inside panels.

Differential Revision: https://developer.blender.org/D15174
2022-06-13 18:27:50 +02:00
e2993719a8 IO: update documentation for HierarchyIterator::weak_export
The documentation for `HierarchyIterator::weak_export` mentions a feature
that was removed at some point. Another example is used to illustrate its
functionality.

No functional changes.
2022-06-13 16:17:00 +02:00
5abe127b3d GPencil: Use better sampling limits.
The problem with T98683 is that sampling interval can be set to very small,
resulting in very dense points. This patch attempts to optimize that a little bit.

Reviewed By: Antonio Vazquez (antoniov)

Differential Revision: https://developer.blender.org/D15180
2022-06-13 22:13:16 +08:00
85fde25178 LineArt: General code cleanups.
- Use uintxx_t for all 8/16/64 bit integer types.
- Removed prepend_edge_direct thingy which is no longer needed in current edge iterator model.
- Minor code path adjustments like only copies view vector when necessary etc.
- Correctly handle ies==NULL in edge cutting function.
- White spaces and comments etc.

Reviewed By: Sebastian Parborg (zeddb)

Differential Revision: https://developer.blender.org/D15181
2022-06-13 22:13:16 +08:00
10850f0db9 Cleanup: Use more specific includes for grease pencil modifiers
Also remove unused includes in some cases.
This should make these files recompile less often.
2022-06-13 16:02:44 +02:00
19e0b60f3e Cycles: MetalDeviceQueue - capture of multiple dispatches, and some tidying
This patch adds a new mode of gpu capture (env var `CYCLES_DEBUG_METAL_CAPTURE_SAMPLES`) to capture a block of dispatches between "reset" calls. It also fixes member data naming inconsistencies and adds some missing OS version checks.

Screenshot showing .gputrace capture in Xcode 14.0 beta (using `CYCLES_DEBUG_METAL_CAPTURE_SAMPLES="1"` and `CYCLES_DEBUG_METAL_CAPTURE_LIMIT="10"`):

{F13155703}

Reviewed By: sergey, brecht

Differential Revision: https://developer.blender.org/D15179
2022-06-13 13:42:07 +01:00
5ada2afb6d Cleanup: fix various typos
Found via codespell -q 3 -S ./intern,./extern -L ans,ba,bording,datas,eiter,fiter,hist,inout,lod,ot,parm,parms,pixelx,pres,te

Contributed by luzpaz.

Differential Revision: https://developer.blender.org/D15155
2022-06-13 13:17:32 +02:00
434133a631 Cleanup: Remove unused variable and parameter in pbvh_update_draw_buffers 2022-06-13 02:46:35 -07:00
9634f7fae3 Cleanup: Move dragging code for buttons to own file
Moves code for managing dragging data from buttons to a separate file.
This way all this closely related code is in one location, making it
easier to see how it all relates, and easier to find.
2022-06-13 11:15:39 +02:00
16f5d51109 Fix T98735: GPU subdiv displays normals for all elements
The normals flags were not setup properly which made normals for all
elements (vertices, faces) to be drawn when using the normals overlay.
Also remove usage of uints for the flag in the APIs.
2022-06-13 06:20:46 +02:00
c55dac9904 Fix T98745: Anchored mode not working for sculpt smear brush 2022-06-12 12:30:46 -07:00
afe57c4001 Fix T98784: PBVH gpu layout check being ignored
Moved gpu vert format checking outside of pbvh_update_draw_buffers,
which isn't called in every code path of BKE_pbvh_draw_cb. This led
to the draw cache being partially populated by old draw buffers
that were subsequently freed, causing a crash.
2022-06-12 12:12:41 -07:00
37097ae62a Fix T98714: Cursor grab restores to the initial location in Wayland
While Wayland can't warp the cursor, it can set a hint for the cursor
restore location when removing the lock.
2022-06-13 00:20:31 +10:00
3ac656d367 GHOST/Wayland: set the minimum window size
Setting Blender's window 1x1 can happen by accident & causes problems,
set the minimum size as all other GHOST implementations do.
2022-06-12 18:21:23 +10:00
7a849678c9 Fix GHOST/Wayland setting the window size
Zoom in the animation player wasn't working:

- The internal window size value wasn't being updated.
- The window size event wasn't being sent.
2022-06-12 17:48:56 +10:00
07a5869cf6 Fix GHOST/Wayland accessing Ctrl & Alt modifier keys
Only the Shift key was working with GHOST's getModifierKeys method.
Now all modifiers are accessible, since there is no way of detecting
left/right modifiers both are set.
2022-06-12 17:48:56 +10:00
ac2a56d7f3 Fix GHOST/Wayland display glitches on startup
Address two glitches on window creation:

- The DPI was zero until the `surface_enter` callback ran which happens
  after redrawing, causing the splash to display with incorrect scale
  before refreshing once the callback had run.

- The window scale was always 1, even when all outputs were HI-DPI.
  Now the maximum scale of all outputs is used. This isn't fool proof in
  the case of multiple monitors having different scales, however it
  doesn't seem possible to detect the scale used ahead of time
  (details in code-comment).
2022-06-12 17:46:39 +10:00
019df1fa73 Cleanup: use int[2] for window size & pending window size
Also store 'size_pending' with scale applied as it's confusing to only
apply scale to one of the size values.
2022-06-12 17:45:54 +10:00
4c7b0804f8 Cleanup (GPU): Improve efficiency of circle drawing. 2022-06-12 17:49:25 +12:00
cc4d46d91e Fix unreported: Choose nsegments for 2D rotation gizmo based on screen scale.
This mostly affects large rotation gizmos at high DPI.
Without this patch, they appear as 32-gons instead of circles.
2022-06-12 17:47:15 +12:00
9d7e731444 Fix unreported: 2D Gizmo bounding box updated to use gizmo scale. 2022-06-12 17:39:35 +12:00
f24d32f791 Fix T98517: Curve Fill Node creating extra edges.
The delaunay2d function, with mode CDT_CONSTRAINTS_VALID_BMESH_WITH_HOLES
sometimes didn't eat away all of the edges. Doing a prepass to remove
the outer edges until they hit the constraints solves this problem.
2022-06-11 12:33:27 -04:00
922861c5dc Cleanup: minor changes to GHOST/Wayland window output access
- Use a window method to handle updating the window after scale changes.
  This avoids the need for methods that return mutable references to
  DPI & scale.
- Remove window.outputs() method that returned window->system->outputs
  as it is misleading to expose these as window outputs when the outpurs
  returned are all known outputs.
- Use a vector instead of an unordered_set to store window outputs,
  while a 'set' does make sense, it means the outputs can't be accessed
  in the order they're added which may be useful for further changes.
- Use early returns.
2022-06-11 21:03:58 +10:00
add1da52ad Fix T97362: forward slashes in USD texture paths
Ensuring that relative paths to textures in exported USDs use
forward slash separators, for cross-platform compatibility.
2022-06-10 15:07:45 -04:00
9e622e1d02 LineArt: Clean up LineartRenderBuffer.
This patch does code clean ups in `LineartRenderBuffer` because it's
grown kinda big and we need better way to organize those variables inside.

Reviewed By: Sebastian Parborg (zeddb)

Differential Revision: https://developer.blender.org/D15172
2022-06-10 22:49:37 +08:00
f6268f921a USD import: Handle material name collisions
This is a partial fix for T90535.

Added Material Name Collision USD import menu option, to specify
the behavior when USD materials in different namespaces have the
same name.

The Material Name Collision menu options are

- Make Unique: Import each USD material as a unique Blender material.
- Reference Existing: If a material with the same name already
exists, reference that instead of importing.

Previously, the default behavior was to always keep the existing
material. This was causing an issue in the ALab scene, where
dozens of different USD materials all have the same name,
usdpreviewsurface1, so that only one instance of these materials
would be imported.

Reviewed by: Sybren

Differential Revision: https://developer.blender.org/D14869
2022-06-10 10:15:09 -04:00
717ab5aeae LibOverride: Consider animated/driven properties as part of the 'system override' ones in the Outliner.
Conceptually animated/driven properties are not controlled by the
liboverride system anymore, even though they may generate override
operations. So consider them as part of the 'system overrides' category,
and hide them by default in the Outliner.
2022-06-10 15:56:55 +02:00
4d0f7c3dcd LibOverride: Add util to check if a given Override Property is animated.
Searches in available animdata for fcuve(s) with matching RNA path.
2022-06-10 15:56:55 +02:00
f5d0a40122 RNA path: add util to find the char in an RNA path where the array indexing starts.
Usefull to easily trim away the 'aray index' part of an RNA path, e.g.
when searching for an FCurve (which never contains that index part in
its RNA path).
2022-06-10 15:56:55 +02:00
07341d7b32 Liboverride: Add rna array index return value to BKE_lib_override_rna_property_find.
Very useful e.g. for dealing with FCurves search.
2022-06-10 15:56:55 +02:00
9cad614ad5 Fix T98756: GPencil Set Vertex Color Attribute does not color unpainted
The operator set the color but the factor of the mix value was not updated and as the default value was 0, the color was not vivible and only worked when the stroke was previously painted.
2022-06-10 15:25:56 +02:00
Ramil Roosileht
9670c649d8 Fix regression in the recent unit system change
Resolves unit tests failure since the D15085.
Also addressed API documentation and formatting format.

Differential Revision: https://developer.blender.org/D15162
2022-06-10 11:17:14 +02:00
a24a28db7b Cleanup: inconsistent naming with recent locking checks in Wayland 2022-06-10 18:58:37 +10:00
d83a418c45 Fix T98727: Dynamic Paint does not update normals
Caused by {rB6a3c3c77b3eb}.

Displacement and wave were tagging the original mesh normals dirty,
instead the result's normals need tagging. Seems like a typo in above
commit (similar to rBfe43c170831f).

Maniphest Tasks: T98727

Differential Revision: https://developer.blender.org/D15165
2022-06-10 10:52:42 +02:00
28f852ccc3 Fix T98758: Crash setting the clipboard in Wayland
Accessing the clipboard in wayland wasn't thread safe,
use locks for the clipboard, drag & drop data access and when
setting the systems clipboard.
2022-06-10 18:42:34 +10:00
00aa57594c Fix dropping files in Wayland
There were two problems dropping files into blender:

- The inputs `focus_pointer` was NULL, causing a crash.
- The wl_data_device_manager version was set to 1, causing the Blender
  window to close (when dropping files in gnome-shell 42).

Resolve by storing the drop surface separately from the pointer surface
and bump the device manager version to 3.
2022-06-10 18:36:10 +10:00
178c184825 GHOST/Wayland: define a log handler to help tracking down errors
Many errors involving mis-use or unexpected situations report an
error and close Blender's window buy don't crash, making it difficult
to track down when the error occurs.

Define an error handler prints the error and a back-trace,
it can also be useful for setting a break-point
2022-06-10 18:36:10 +10:00
2601b9832d GHOST: add back-trace handler to the API
Add a back-trace handler to GHOST, so error handlers can include a
back-trace (when supported).

No functional changes.
2022-06-10 18:36:10 +10:00
eb9fa052a1 Clenaup: use early returns in GHOST/Wayland 2022-06-10 18:36:10 +10:00
6a11cd036c Cleanup: Clang tidy 2022-06-10 10:29:35 +02:00
aebca2bd65 Fix: Missing include 2022-06-10 10:11:49 +02:00
e6548c03f9 UI: Sculpt Curves Slide icon 2022-06-09 17:17:58 +02:00
32ee2ffc7d Fix: Crash in selection paint brush with empty curves 2022-06-09 15:40:07 +02:00
14d1ad8dd8 FCurve: optimize search from an RNA path + index.
By checking the index value first instead of a full fledge string
comparision in `BKE_fcurve_find`, we can make that code significatly
faster (from about 10% in a Heist production file to over 45% in a
heavily animated test file).

While this code was already very fast (a few microseconds per call
typically), it gets called a lot from the UI (several hundreds of time
per refresh), among other things.

NOTE: the `UNLIKELY` hint is responsible for 25% to 30% of the
speed improvement.
2022-06-09 15:17:20 +02:00
6d726192be Fix variable being used without being initialized 2022-06-09 10:11:14 -03:00
f37a37cafe Fix GHOST/Wayland memory leak when copying text 2022-06-09 21:32:49 +10:00
41c7c744eb Cleanup: use C-style comments, add missing doxy section 2022-06-09 21:31:08 +10:00
ed15900473 Cleanup: use const variables & arguments 2022-06-09 21:26:48 +10:00
8a6cbcf386 Curves: Port delete geometry node to the new curves type
Add a method to remove points from the new curves type, just like
the existing curve removal function. No functional changes are expected.
The code is simpler because all data is just stored as attributes, but
also different because the point data for all curves is stored in the same
arrays.

Similar performance improvements as other commits in T95443 are
expected, expecially for cases where there are many small curves.

Differential Revision: https://developer.blender.org/D15130
2022-06-09 13:09:04 +02:00
0fddff027e Cleanup: Unused but set variable in Cycles Metal profiler 2022-06-09 10:20:26 +02:00
a91c8d8efa Fix T98686: Cant rename local NLA tracks within a local library override data-block.
We need a specific exception to general rule 'no rename of anim channels
in liboverride data' for the locally-inserted NLA tracks.
2022-06-09 09:50:27 +02:00
62dece5c86 Cleanup: return true/false instead of 0/1 when returnin boolean. 2022-06-09 09:37:19 +02:00
38bfa53081 Fix T78815: Redraw UV Editor on collection visibility change 2022-06-09 17:39:56 +12:00
0926495de4 UI: Tooltip Edit - Copy to selected button
This commit changes the tool tip for the "Copy To Selected Button" operator.
The exiting tool tip for this operator suggests that it will "copy property to selected objects or bones".

However, it will only copies the property value to the selected objects or bones if the property already exists on the selected items.
It does not copy the property.

Differential Revision: https://developer.blender.org/D14528
2022-06-08 23:26:15 -04:00
a632260828 Cleanup: Removed unused variable 2022-06-08 22:28:46 -04:00
96f88511ee Fix T98688: Snapping not working in curve objects with evaluated geometry
It's an old behavior. Not really considered a bug.

But snapping to faces is already supported in this case.
And allowing snapping to other elements is not disruptive.
2022-06-08 21:49:11 -03:00
132e58610d Cleanup: spelling in comments & variables 2022-06-09 10:27:20 +10:00
3bdf1c11fb Cleanup: warnings 2022-06-09 10:17:39 +10:00
84906d47dc Cleanup: format 2022-06-09 10:11:25 +10:00
8b8fbffeea Fix software cursor being used with absolute events in Wayland
The software cursor was being enabled with absolute events,
causing a problem with absolute tablet events.

This caused both cursors to be visible at once when using a tablet
(with D15152 applied).
2022-06-09 10:11:25 +10:00
8a02696724 Fix assert triggered when snapping to evaluated geometry of a Curve
Curves can have a Mesh evaluated, but only objects of type Mesh have
EditMesh.

This bug is harmless because `sctx->editmesh_caches.remove(value)` only
works with pointers and `BKE_editmesh_from_object(ob_eval)`, even though
it doesn't actually return a `BMEditMesh`, it still returns a pointer
that doesn't exist as a key.
2022-06-08 20:52:34 -03:00
530f2abb9b Cleanup: quiet warnings 2022-06-09 09:48:37 +10:00
4ff9c0f4e3 Fix armatures not visible in VR
Now that VR offscreen drawing accounts for object type visibility,
armatures should be displayed when specified.
2022-06-09 06:59:03 +09:00
371fc68678 Paint: Fix Image Editor Cursor Disappearing (T90120)
This patch fixes T90120.  The fundamental problem is that 2d and the old 3d paint modes share a single Paint struct, ToolSettings->imapaint.  This patch is a temporary fix until the new 3d paint mode (which has its own Paint struct) is released.

The patch works by listening for `NC_SCENE|ND_MODE` inside `image_listener` in `space_image.c`.   It does not use `ED_space_image_paint_update` since that requires a `bMain.`  Instead it calls `paint_cursor_start` (which is promoted to `ED_paint_cursor_start`).  `image_paint_poll` is also promoted to an `ED_` function.

Reviewed By: Campbell Barton
Differential Revision: https://developer.blender.org/D14946
Ref D14946
2022-06-08 12:37:29 -07:00
285a68b7bb Sculpt: PBVH Draw Support for EEVEE
This patch adds support for PBVH drawing in EEVEE.

Notes:
  # PBVH_FACES only.  For Multires we'll need an API to get/cache attributes.  DynTopo support will be merged in later with sculpt-dev's DynTopo implementation.
  # Supports vertex color and UV attributes only; other types can be added fairly easily though.
  # Workbench only sends the active vertex color and UV layers to the GPU.
  # Added a new draw engine API method, DRW_cdlayer_attr_aliases_add.  Please review.
  # The vertex format object is now stored in the pbvh.

Reviewed By: Clément Foucault & Brecht Van Lommel & Jeroen Bakker
Differential Revision: https://developer.blender.org/D13897
Ref D13897
2022-06-08 12:30:01 -07:00
Dennis Ranish
9c28f0eb37 D14823: Adds operator to duplicate the active color attribute layer
Fixes T97706

Adds operator to duplicate the active color attribute layer.
Adds `"Color Attribute Specials"` menu to color attribute ui to access the `"geometry.color_attribute_duplicate"` operator.
Internally adds a function that duplicates a referenced CustomDataLayer
- `BKE_id_attribute_duplicate` mostly copies the existing `BKE_id_attribute_new`
- but gets the type and domain from the referenced layer
- and copies the data from the old layer into the new layer

Reviewed By: Joseph Eagar & Hans Goudey & Julien Kaspar
Differential Revision: https://developer.blender.org/D14823
Ref D14823
2022-06-08 12:10:32 -07:00
Ramil Roosileht
f69c565a33 D15085: Fix numbers jumping in edit voxel size widget
Introduces an option for BKE_unit_value_as_string to skip stripping of zeroes, thus reducing flickering when using edit voxel size widget.

{F13125416}

Reviewed By: Julien Kaspar & Joseph Eagar
Differential Revision: https://developer.blender.org/D15085
Ref D15085
2022-06-08 11:51:29 -07:00
fe4e646405 Fix: Incorrect curves and pointcloud bounding boxes
The generic bounds utility used an incorrect initial value. The value
cannot be zero-initialized, because that breaks the case where all
values are greater than zero.
2022-06-08 18:40:14 +02:00
a3e7280bd8 LibOverride: Make 'image/movieclip user` properties editable. 2022-06-08 18:00:42 +02:00
8843705f65 Fix (unreported) missing rna path for some background image properties.
RNA camera code did not handle path for its image/movieclip users
sub-data, and moviclip RNA struct definition did not have a rna path
function at all.
2022-06-08 18:00:42 +02:00
d62e6f1225 RNA nodetree: improve ImageUser path helper.
Refactor the code, and optimize it slightly (no need e.g. to check for
nodes when the nodetree is of a type that cannot have image user nodes).
2022-06-08 18:00:42 +02:00
1a71f9d2b8 Curves: use radius of middle point to determine curve shape
See {rBb69aad60bda23a53482b2c2ae98715c23a715bc8}
for more details.
2022-06-08 16:52:13 +02:00
cc1cc46099 Fix: incorrect curve parameter for catmull rom curves 2022-06-08 16:42:46 +02:00
17971b8a5b Fix: Heap buffer overflow in new curves set type node 2022-06-08 16:16:45 +02:00
9e393fc2f1 Curves: Port set type node to new data-block
This commit ports the "Set Spline Type" node to the new curves type.
Performance should be improved in similar ways to the other refactors
from the conversion task (T95443). Converting to and from Catmull Rom
curves is now supported. There are a few cases where a lot of work can
be skipped: when the number of points doesn't change, and when the
types already match the goal type.

The refactor has a few other explicit goals as well:
 - Don't count on initialization of attribute arrays when they are
   first allocated.
 - Avoid copying the entire data-block when possible.
 - Make decisions about which attributes to copy when changing curves
   more obvious.
 - Use higher-level methods to copy data between curve points.
 - Optimize for the common cases of single types and full selections.
 - Process selected curves of the same types in the same loop.

The Bezier to NURBS conversion is written by Piotr Makal (@pmakal).

Differential Revision: https://developer.blender.org/D14769
2022-06-08 15:37:46 +02:00
Dilith Jayakody
520be607e8 Fix T98624: Curve Pen NURBS extrusion creates duplicates
The initial point count check was only being done for Bezier curves.
This revision fixes T98624 by adding the check for NURBS curves as well.

Reviewed By: HooglyBoogly

Maniphest Tasks: T98624

Differential Revision: https://developer.blender.org/D15140
2022-06-08 18:37:09 +05:30
7a751327fa Fix T98620: Video sequencer screen corruption occurs when resizing.
Added Windows/Intel GPU to the list of work-a-rounds. This will
reduce the performance when using Intel GPUs on all platforms.
2022-06-08 13:15:28 +02:00
ca29376e00 Cleanup: Move sculpt_automasking.c to c++ 2022-06-08 03:33:18 -07:00
b52760a023 Fix T98565: remove unused BRUSH_PAINT icon definition
This could spam the console with errors (potentionally slowing down in
cases).

Was added in rBeae36be372a6, but not used.

Maniphest Tasks: T98565

Differential Revision: https://developer.blender.org/D15113
2022-06-08 11:21:43 +02:00
fe746b2738 Cleanup: Remove unnecessary namespace specification 2022-06-08 11:04:00 +02:00
5b0e9bd975 Cleanup: Use const variables/pointers 2022-06-08 10:48:19 +02:00
6eea5f70e3 Attributes: Use names instead of layers for some functions
This mirrors the C++ attribute API better, separates the implementation
of attributes from CustomData slightly, and makes functions simpler,
clearer, and safer.

Also fix an issue with removing an attribute caused by 97712b018d
meant the first attribute with the given type was removed instead of
the attribute with the given name.
2022-06-08 10:48:19 +02:00
1af652d42e Fix: Improve poll for convert attribute operator
Converting an attribute does not work from edit mode because
there is no attribute API implemented for BMesh, so disable the
operation in that mode and add a poll message.
2022-06-08 10:48:19 +02:00
83fd3767d3 Fix T98618: Drivers don't automatically update when changing active camera
Active camera is a property of Scene, so need to take scene changes into
account for such drivers to work reliably.

The fix covers all the common cases of such configurations, but some of
them might not be yet fully supported. Mainly cases when the target ID
is not covered by the copy-on-write mechanism.

There is a fuller explanation available in the code for the ease of reading
by the future generations.

Differential Revision: https://developer.blender.org/D15146
2022-06-08 09:12:14 +02:00
8d09a12414 Correct missing doxy-sections in 1269bcce81 2022-06-08 16:19:35 +10:00
1269bcce81 Cleanup: use doxy sections for wayland listeners 2022-06-08 16:05:36 +10:00
8edd1d8aa5 CMake: optionally disable OBJ, STL & GPencil SVG support
The following CMake options have been added (enabled by default),
except for the lite build configuration.

- WITH_IO_STL
- WITH_IO_WAVEFRONT_OBJ
- WITH_IO_GPENCIL (for grease pencil SVG importing).
  Note that it was already possible to disable grease pencil export
  by disabling WITH_PUGIXML & WITH_HARU.

This is intended to keep the lite builds fast and small for building,
linking & execution.

Reviewed By: iyadahmed2001, aras_p, antoniov, mont29

Ref D15141
2022-06-08 13:29:32 +10:00
a1d2efd190 GHOST/Wayland: draw a software-cursor when wrapping cursor motion
As Wayland doesn't support moving the cursor, draw a cross-hair cursor
at the location used by Blender.

Without this, the cursor was locked at the location where grab started,
making some actions unusable since the cursor location was invisible.

Resolves T77311.
2022-06-08 13:16:14 +10:00
b3e0101a35 GHOST/Wayland: non-wrapping grab no longer locks the cursor
Grab which didn't wrap would lock the cursor, making actions such
as resizing areas lock the cursor in-place.

Confine the cursor to the window instead.

This behavior was also used for X11 when grabbing the cursor was first
supported but could lock the system if Blender froze while grabbing so
it was disabled [0].

For Wayland this shouldn't be a problem as compositors implement grab
in a way that prevents the client from locking the system.

[0]: 3e3d2b7a4c
2022-06-08 11:45:44 +10:00
173a15bcda BLI: Math: Add description and test to ceil_to_multiple and divide_ceil
I took the decision to assert on unexpected value as the behavior of these
functions are not consistent across the whole integer domain.
2022-06-07 20:08:39 +02:00
a857156578 UI: Curves Sculpt density + smooth brushes
More information in the svn log. But basically the smooth brush
is re-using the previous one we had for hair, and the density is
representing the hair root points that are removed to reach the
desired density.

Those brushes are used by D15134.
2022-06-07 19:08:07 +02:00
3e7d977886 IME Cleanup: Removal of BLT_lang_is_ime_supported
Removal of BLT_lang_is_ime_supported which is always returns true and
is no longer needed.

See D11800 for more details.

Differential Revision: https://developer.blender.org/D11800

Reviewed by Campbell Barton
2022-06-07 10:03:26 -07:00
9fda233897 Cleanup: Use const pointers in attribute API 2022-06-07 18:55:56 +02:00
d39e0f9616 Fix: Incorrect logic in attribute search function
If a geometry does not have CustomData for a certain domain,
it may still have CustomData on other domains. In that case
we need to continue to the other domains instead of returning.
This worked for meshes because the domains are all at the
start of the `info` array. It didn't work for curves.
2022-06-07 18:38:39 +02:00
627d42cd56 Merge branch 'blender-v3.2-release'
# Conflicts:
#	source/blender/draw/engines/eevee/shaders/volumetric_vert.glsl
2022-06-07 18:32:34 +02:00
ec493d79fa BLI: Math: Add math::divide_ceil and math::ceil_to_multiple
`math::divide_ceil` is just the vector implementation of `divide_ceil_u`.

`math::ceil_to_multiple` is similar but finaly multiply by the divisor.
It is handy to handle tile buffers resolutions.
2022-06-07 18:31:06 +02:00
b568f445a5 Fix T98647: EEVEE: Camera Data Node's View Vector Broken
Fix regression and remove duplicated computation.
2022-06-07 18:14:16 +02:00
391485f412 Fix EEVEE: Shader error when using volume temperature or color attributes
This bug was unreported. This was triggering a linking error caused by
the vertex shader not having a local version of `attr_load_temperature_post`
and `attr_load_color_post`.
2022-06-07 18:13:09 +02:00
60442b0292 Fix T98091: EEVEE: Volume: Crash caused by non-present grid
This was caused by the `copy_m4_m4` trying to copy the `object_to_texture`
from `drw_grid` which was `nullptr`.

Fixing this also exposed that rendering such volumes (without any valid
grid attributes) is not supported and we should follow what Cycles does.

Differential Revision: https://developer.blender.org/D15147
2022-06-07 18:12:19 +02:00
7974d2bff6 CustomData: Add function to free a named layer
This can be useful to avoid unnecessary boilerplate in various users
of the CustomData API. Split from D14685 and D14769.
2022-06-07 18:00:30 +02:00
9c029a3eb0 Fix T98621: Image does not update when tweaking strip properties
Problem was caused by `startdisp` and `enddisp` still being used after changes
implemented in rB7afcfe111aac.
2022-06-07 17:02:40 +02:00
Monique Dewanchand
e62a33e572 Nodes: Show node description in Node add menu
Though no nodes have descriptions currently, this patch makes it
possible to add descriptions that display in the add menu, for
custom node systems and existing builtin nodes.

Differential Revision: https://developer.blender.org/D14963
2022-06-07 15:40:31 +02:00
ccf0d22e92 Fix T98626: Mesh Deform modifier stops working on a linked collection upon undo.
Regression from rBb66368f3fd9c, we still need to store all data on undo
writes, since overrides are not re-applied after undo/redo.
2022-06-07 15:30:05 +02:00
b69aad60bd Curves: use root/tip radius of the first curve in the viewport
Viewport drawing does not support a per point radius attribute yet.
Instead, it has a fixed set of radius parameters that are used for all
curves in the same object. Now those radii are retrieved from the
radius attribute of the points on the first curve. This allows users
to control the radius of curves to some degree until proper per-point
radius is supported.
2022-06-07 15:03:58 +02:00
Martijn Versteegh
1203bd58be Fix: Make renaming attributes check uniqueness on all domains
This function only checked for uniqueness in the current domain,
while attribute names should be unique among all domains within
a geometry.

Differential Revision: https://developer.blender.org/D15144
2022-06-07 14:52:27 +02:00
503bcaf1a2 Marker drawing: don't restore GPU line width
Adhere to the documented use of `GPU_line_width()` and don't restore the
previously set line width.
2022-06-07 14:36:45 +02:00
f49efed953 Curves: fix transforms in Add brush
Symmetry should be applied in the space of the curves object,
not in the space of the surface object.
2022-06-07 14:21:02 +02:00
3b7e314a28 Cleanup: remove dead code 2022-06-07 14:21:02 +02:00
d422715094 Fix drawing increments after running Spin gizmo
Caused by {ea182deeb9cdd2a9137e98eb0072f57c0fb1e09f}.
2022-06-07 09:12:20 -03:00
1456f30b02 Cleanup: potential dereferencing of a NULL pointer
If `cancel` is `false`, `NULL` `inter` pointer dereferencing could occur.

Currently I haven't found a case where this can happen.

But it's best to avoid.
2022-06-07 09:01:46 -03:00
2918a3a2a3 Cleanup: spelling in comments, minor formatting tweaks 2022-06-07 21:22:55 +10:00
1e0e1ad20f Cleanup: note that checking only the left modifiers isn't a mistake 2022-06-07 21:22:55 +10:00
2935b6a2ac Add Instance Offset operators to Collections property panel
Add three operators to the Collections properties panel:

- `object.instance_offset_to_cursor`, which is already available from
  the Object properties panel. The operator works on the active
  collection, though, so it's weird to not have it in the Collections
  panel.
- `object.instance_offset_from_object` is a new operator, which performs
  the same operation as above, but then based on the active object's
  evaluated world position.
- `object.instance_offset_to_cursor` is also new, and performs the
  opposite of the first operator: it moves the 3D cursor to the
  collection's instance offset.

The first two operators make it easier to set the instance offset. The
last operator makes it possible to actually see the offset in the 3D
viewport; drawing it using some overlay could also work, but that would
be more effort to get right, and then snapping the 3D cursor would still
be useful.

The operators are placed in a popup menu, as to not clutter the
interface too much with various buttons.

Reviewed By: dfelinto, eyecandy

Differential Revision: https://developer.blender.org/D14966
2022-06-07 13:10:13 +02:00
3a8a44b3f9 Keymap: use both left/right modifier keys
Use both left/right modifier keys for:

- Fly Mode.
- Walk Mode.
- Area Split.
- Sculpt Detail Map.
- Sculpt Expand.
- Standard Modal Map

Resolves T98638.
2022-06-07 21:03:08 +10:00
16934c198a LibOverride: Attempt to improve handling of cyclic deps between libraries.
Those cyclic dependencies (lib_A depends on a texture from lib_B, which
links geometry from lib_A) are bad, but previous code did not always
helped much in idendtifying to actuall issue point.

Now, reduce maximum 'recursion' level to 100 (this should already never
be reached in practice), and additionally report warnings when reaching
level 90, so that user gets more context data to identify more easily
the culprit.
2022-06-07 12:53:04 +02:00
Michael Jones
4412e14708 Cycles: Useful Metal backend debug & profiling functionality
This patch adds some useful debugging & profiling env vars to the Metal backend:

- `CYCLES_METAL_PROFILING`: output a per-kernel timing report at the end of the render
- `CYCLES_METAL_DEBUG`: enable per-dispatch tracing (very verbose)
- `CYCLES_DEBUG_METAL_CAPTURE_KERNEL`: enable programatic .gputrace capture for a specified kernel index

Here's an example of the timing report with `CYCLES_METAL_PROFILING` enabled:

```
---------------------------------------------------------------------------------------------------
Kernel name                                 Total threads   Dispatches     Avg. T/D    Time   Time%
---------------------------------------------------------------------------------------------------
integrator_init_from_camera                   657,407,232          161    4,083,274   0.24s   0.51%
integrator_intersect_closest                1,629,288,440          681    2,392,494  15.18s  32.12%
integrator_intersect_shadow                   751,652,291          470    1,599,260   5.80s  12.28%
integrator_shade_background                   304,612,074          263    1,158,220   1.16s   2.45%
integrator_shade_surface                    1,159,764,041          676    1,715,627  20.57s  43.52%
integrator_shade_shadow                       598,885,847          418    1,432,741   1.27s   2.69%
integrator_queued_paths_array               2,969,650,130          805    3,689,006   0.35s   0.74%
integrator_queued_shadow_paths_array          593,936,619          379    1,567,115   0.14s   0.29%
integrator_terminated_paths_array              22,205,417          155      143,260   0.05s   0.10%
integrator_sorted_paths_array               2,517,140,043          676    3,723,579   1.65s   3.50%
integrator_compact_paths_array                648,912,748          155    4,186,533   0.03s   0.07%
integrator_compact_states                      20,872,687          155      134,662   0.14s   0.29%
integrator_terminated_shadow_paths_array      374,100,675          438      854,111   0.16s   0.33%
integrator_compact_shadow_paths_array         503,768,657          438    1,150,156   0.05s   0.10%
integrator_compact_shadow_states               37,664,941          202      186,460   0.23s   0.50%
integrator_reset                               25,165,824            6    4,194,304   0.06s   0.12%
film_convert_combined_half_rgba                 3,110,400            6      518,400   0.00s   0.01%
prefix_sum                                            676          676            1   0.19s   0.40%
---------------------------------------------------------------------------------------------------
                                                                 6,760               47.27s 100.00%
---------------------------------------------------------------------------------------------------
```

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D15044
2022-06-07 11:08:39 +01:00
4fc7e1a880 Cleanup: Correct comments 2022-06-07 11:55:52 +02:00
4637f3e83c Merge branch 'blender-v3.2-release' 2022-06-07 10:52:38 +02:00
58d350b489 GPUMaterial: Make compilation fail when reusing failed GPUPass
This avoid leaving a `GPUMaterial` in a `GPU_MAT_QUEUED` state which would
block rendering.

Fix T98603: Hang when saving project in material preview mode

Maniphest Tasks: T98603

Differential Revision: https://developer.blender.org/D15135
2022-06-07 10:48:13 +02:00
dcbbdc89ea Cleanup: Fix missing-braces warning in draw manager
Good side effect of the change is that it makes it so that the
size of an array is more likely to be calculated at a compile time.

More ideally we'll be using bli::Array instead of the bare array,
but that is outside of the scope of this change.
2022-06-07 10:35:33 +02:00
9ccc21dde3 VSE preview transform autokeying improvements
NOTE: this patch originated in T98015 which was split into multiple
reports. While it could be split into multiple patches these are very
much related so keeping as one for now

This patch fixes the following issues:

[1] autokeying transforms in preview only creates keyframes if there is
an FCurve already
[2] autokeying transforms in preview only creates keyframes for
rotation/scale if rotating/scaling around cursor (should keyframe
position as well)
[3] autokeying transforms in preview does not work during animation
playback

For [1], a param was added to `ED_autokeyframe_property` which can tweak
its default behavior of only creating keyframes on already keyed
properties (which was fine because this is mostly called from buttons
where this behavior is desired). Callers such as gizmos (or the VSE in
our case) can use this additional param so that keyframes are also
created on "not-yet-keyframed" properties.

For [2], the pivot is checked and position properties also keyed if
necessary (which is also consistent with the way objects are keyed in
the 3DView)

For [3], `animrecord_check_state` was changed to be able to work on
scenes as well and the transform system in the VSE preview was made
aware of the screen's `animtimer`.

NOTE: there are still things to be improved for keyframing in the VSE,
the most obvious is probably a `keyframe_insert` operator (with
keyingsets)

Fixes T98429, T98430, T98431

Maniphest Tasks: T98015, T98431, T98430, T98429

Differential Revision: https://developer.blender.org/D15047
2022-06-07 09:53:11 +02:00
4580c18c56 Correct error in 7c4826d971 2022-06-07 17:42:11 +10:00
Joseph Faulkner
b77494ec61 Fix T98527 : corrected label for Korean language in Blender preferences
Patch changes label from '한국 언어' to '한국어'

Reviewed By: persun, PratikPB2123, mont29

Maniphest Tasks: T98527

Differential Revision: https://developer.blender.org/D15120
2022-06-07 09:35:27 +02:00
7c4826d971 Fix T98552: Experimental Tweak Select: Curve handle tweak is difficult
The previous fix [0] only resolved the issue for RMB select,
this works for the tweak tool with LMB select.

[0]: 0f73a27b76
2022-06-07 16:53:54 +10:00
99847cd642 OBJ: Use filename as the default object name
To match the existing Python .obj importer, and to make it easier for
the user to determine which object is which, use the filename for the
default object name instead of "New object".

Differential Revision: https://developer.blender.org/D15133
2022-06-06 22:38:02 -07:00
b4d3ca624e Logging: remove unnecessary newlines 2022-06-07 15:01:03 +10:00
263371dc4e Cleanup: spelling in comments, additional white space 2022-06-07 15:01:03 +10:00
243891104f Cleanup: use doxy sections for mask add operators & functions 2022-06-07 14:40:51 +10:00
af6a68217f Cleanup: format 2022-06-07 14:40:51 +10:00
ea182deeb9 Remove workaround for drawing the rotation gizmo
Since [0], transform gizmos are no longer hidden during transform.

The same can be observed for rotation gizmos.

However, as a workaround for these rotation gizmos, there was already a
drawing utility running.

With the gizmo and the utility this drawing is now being done twice.

So remove the utility/workaround and update the gizmo accordingly.

[0] {648350e456490f8d6258e7de9bf94d3a6a34dbb2}

Differential Revision: https://developer.blender.org/D9542
2022-06-07 00:38:23 -03:00
b3101abcce blend_render_info: Zstd support, skip redundant file reading & cleanup
- Use a context manager to handle file handlers (closing both in the
  case of compressed files).

- Seek past BHead data instead of continually reading
  (checking for 'REND').

- Write errors to the stderr (so callers can differentiate it from the
  stdout).

- Use `surrogateescape` in the unlikely event of encoding errors
  so the result is always a string (possible with files pre 2.4x).

- Remove '.blend' extension check as it excludes `.blend1` files
  (we can assume the caller is passing in blend files).

- Define `__all__` to make it clear only one function is intended
  to be used.
2022-06-07 13:15:56 +10:00
56ede578e7 Cleanup: compiler warnings: unused args, missing include, parenthesis 2022-06-07 11:50:10 +10:00
Iyad Ahmed
7c511f1b47 STL: Add new C++ based STL importer
A new experimentatl STL importer, written in C++. Roughly 7-9x faster than the
Python based one.

Reviewed By: Aras Pranckevicius, Hans Goudey.
Differential Revision: https://developer.blender.org/D14941
2022-06-06 20:57:38 +03:00
14fc89f38f Geometry Nodes: Add Instance Scale Input Node
A field input node for the scale of each top-level instance transform.
The scale can be set with the "Scale Instances" node, but previously
could not be retrieved.

Differential Revision: https://developer.blender.org/D15132
2022-06-06 12:02:59 -05:00
3a57f5a9cf Geometry Nodes: Instance Rotation Node
A field input node for the rotation of each top-level instance transform.
The rotation can be set with the "Rotate Instances" node, but previously
could not be retrieved.

Differential Revision: https://developer.blender.org/D15131
2022-06-06 11:50:13 -05:00
f700aa67ac Geometry Nodes: Fix Assert in Duplicate Elements
The original assert did not take into account the offset size in the loop being -1. The tests were then run in non-debug mode, so while the mesh regressions still passed, the false positive asserts that happened were not caught.

Differential Revision: https://developer.blender.org/D15136
2022-06-06 11:15:24 -05:00
128aa7f3b0 Geometry Nodes: Fix Assert in Duplicate Elements
The original assert did not take into account the offset size in the loop being -1. The tests were then run in non-debug mode, so while the mesh regressions still passed, the false positive asserts that happened were not caught.

Differential Revision: https://developer.blender.org/D15136
2022-06-06 11:10:27 -05:00
3772dda4ab Refactor: Snap-related. Clarified attribute names and refactored #defines into enums
The transformation snapping code contains a bunch of `#define`s, some ambiguously or incorrectly named attributes.  This patch contains refactored code to improve this.  This patch does (should) not change functionality of snapping.

Clarified ambiguously / incorrectly named attributes.

  - "Target" is used to refer to the part of the source that is to be snapped (Active, Median, Center, Closest), but several other areas of Blender use the term "target" to refer to the thing being snapped to and "source" to refer to the thing getting snapped.  Moreover, the implications of the previous terms do not match the descriptions.  For example: `SCE_SNAP_TARGET_CENTER` does not snap the grabbed geometry to the center of the target, but instead "Snap transforamtion center onto target".
  - "Select" refers to the condition for an object to be a possible target for snapping.
  - `SCE_SNAP_MODE_FACE` is renamed to `SCE_SNAP_MODE_FACE_RAYCAST` to better describe its affect and to make way for other face snapping methods (ex: nearest).

Refactored related `#define` into `enum`s.  In particular, constants relating to...

  - `ToolSettings.snap_flag` are now in `enum eSnapFlag`
  - `ToolSettings.snap_mode` are now in `enum eSnapMode`
  - `ToolSettings.snap_source` (was `snap_target`) are now in `enum eSnapSourceSelect`
  - `ToolSettings.snap_flag` (`SCE_SNAP_NO_SELF`) and `TransSnap.target_select` are now in `enum eSnapTargetSelect`

As the terms became more consistent and the constants were packed together into meaningful enumerations, some of the attribute names seemed ambiguous.  For example, it is unclear whether `SnapObjectParams.snap_select` referred to the target or the source.  This patch also adds a small amount of clarity.

This patch also swaps out generic types (ex: `char`, `short`, `ushort`) and unclear hard coded numbers (ex: `0`) used with snap-related enumerations with the actual `enum`s and values.

Note: I did leave myself some comments to follow-up with further refactoring.  Specifically, using "target" and "source" consistently will mean the Python API will need to change (ex: `ToolSettings.snap_target` is not `ToolSettings.snap_source`).  If the API is going to change, it would be good to make sure that the used terms are descriptive enough.  For example, `bpy.ops.transform.translate` uses a `snap` argument to determine if snapping should be enabled while transforming.  Perhaps `use_snap` might be an improvement that's more consistent with other conventions.

This patch is (mostly) a subset of D14591, as suggested by @mano-wii.

Task T69342 proposes to separate the `Absolute Grid Snap` option out from `Increment` snapping method into its own method.  Also, there might be reason to create additional snapping methods or options.  (Indeed, D14591 heads in this direction).  This patch can work along with these suggestions, as this patch is trying to clarify the snapping code and to prompt more work in this area.

Reviewed By: mano-wii

Differential Revision: https://developer.blender.org/D15037
2022-06-06 10:56:22 -04:00
a094cdacf8 BLI: fix memory error when moving VArray_Span
The issue was that the new span still referenced data that was potentially
stored in the old VArray_Span.
2022-06-06 14:01:25 +02:00
7eb2018a0b Fix Windows compiler error
This error was introduced in 176d7bcc2e

Fix provided by @deadpin
2022-06-06 09:42:36 +02:00
bb9647b703 PyDocs: remove sphinx-intl
Cop paste mistake from rB3cd283a424ec92ef85e1856d66f0baa4d2253fc5
2022-06-05 23:13:26 -04:00
3cd283a424 Py Docs: Update Sphinx and dependencies
- Adds python 3.10 support
- Slightly improves performance
2022-06-05 23:05:48 -04:00
011d9cce19 UI: offset scale gizmos instead of scaling their shape
Scaling handles while dragging could be distracting, especially at
extreme values where handles could become large on-screen.

Now all gizmos are shown while scaling.

GIZMO_GT_arrow_3d now now support changing their length while being
dragged as well as negative lengths.
2022-06-06 12:48:49 +10:00
bb34afac56 Cleanup: quiet compiler warning 2022-06-06 12:45:42 +10:00
8589f60546 Curves: Port bounding box node to the new curves type
Avoid the conversion to and from the old type, which could
be a substantial improvement in somce cases.
2022-06-05 21:05:13 +02:00
c7e4c43072 Cleanup: Remove unused BKE_spline.hh includes 2022-06-05 21:00:03 +02:00
93a68f2a90 Curves: Fix overallocation for curve attributes when deleting curves
Curve attributes were allocated to the size of the point domain, which
wouldn't cause bad behavior, just potentially worse performance.
2022-06-05 20:00:06 +02:00
270a24cc64 Fix: incorrect operator warning 2022-06-05 17:51:37 +02:00
545d469879 Cleanup: Move wm_event_system.c to C++
This allows the use of C++ data structures to simplify code and
improve performance.
2022-06-05 16:47:42 +02:00
c4e11122c5 Geometry Nodes: Use fields for delete geometry inversion
The separate geometry and delete geometry nodes often invert the
selection so that deleting elements from a geometry can be implemented
as copying the opposite selection of elements. This should make the two
nodes faster in some cases, since the generic versions of selection
creation functions (i.e. from d3a1e9cbb9) are used instead
of the single threaded code that was used for this node.

The change also makes the deletion/separation code easier to
understand because it doesn't have to pass around the inversion.
2022-06-05 16:46:20 +02:00
72ea37ae5f UI: align gizmo scale handles to both Y and Z axes
This resolves a minor inconsistency displaying the scale gizmo handles
since they're cubes it's noticeable when they're not axes aligned.
2022-06-05 23:43:07 +10:00
648350e456 UI: show gizmo while transforming
When interacting with translate/rotate/scale gizmo, show the gizmo while
it's in use. There are some exceptions to this, as showing all scale
gizmos while scaling causes the gizmos to become large & distracting so
in this case only the gizmo being dragged is shown.

Resolves T63743.
2022-06-05 23:21:50 +10:00
d450a791c3 Cleanup: assign operator type flags in their initialization
Some operators OR'ed the existing flags in a way that made it seem
the value might already have some values set.
Replace this with assignment as no flags are set and the convention
with almost all operators is to write the value directly.
2022-06-05 23:05:38 +10:00
4e3ce04855 Cleanup: Use shorter variable name 2022-06-05 12:37:45 +02:00
e37eebf16f Cleanup: Comments and formatting in mesh extract headers
Also remove accidentally committed WIP commented code.
2022-06-05 12:15:31 +02:00
899ec8b6b8 Curves: use uv coordinates to attach curves to mesh
This implements the new way to attach curves to a mesh surface using
a uv map (based on the recent discussion in T95776).

The curves data block now not only stores a reference to the surface object
but also a name of a uv map on that object. Having a uv map is optional
for most operations, but it will be required later for animation (when the
curves are supposed to be deformed based on deformation of the surface).

The "Empty Hair" operator in the Add menu sets the uv map name automatically
if possible. It's possible to start working without a uv map and to attach the
curves to a uv map later on. It's also possible to reattach the curves to a new
uv map using the "Curves > Snap to Nearest Surface" operator in curves sculpt
mode.

Note, the implementation to do the reverse lookup from uv to a position on the
surface is trivial and inefficient now. A more efficient data structure will be
implemented separately soon.

Differential Revision: https://developer.blender.org/D15125
2022-06-05 12:14:32 +02:00
176d7bcc2e Cleanup: Move remaining mesh draw code to C++
After this commit, all mesh data extraction and drawing code is in C++,
including headers, making it possible to use improved types for future
performance improvements and simplifications.

The only non-trivial changes are in `draw_cache_impl_mesh.cc`,
where use of certain features and macros in C necessitated larger
changes.

Differential Revision: https://developer.blender.org/D15088
2022-06-05 12:04:58 +02:00
31da775ec2 Fix compiling debug build 2022-06-05 12:04:24 +02:00
Pablo Dobarro
e90ba74d3e D15041: Sculpt: Elastic Transform
This implements transform modes for the transform tool and Elastic
Transform. This mode uses the Kelvinlets from elastic deform to apply
the transformation to the mesh, using the cursor radius to control the
elasticity falloff.

{F9269771}

In order for this to work, the transform tool uses incremental mode when
elastic transform is enabled. This allows to integrate the displacement of
the Kelvinet in multiple steps.

Review By: Sergey Sharbin & Daniel Bystedt & Julian Kaspar & Campbell
Barton

Differential Revision: https://developer.blender.org/D9653

Ref D15041
2022-06-04 13:50:28 -07:00
e230ccaf8c Fix Wintab button tracking logic.
Shifted flag for buttons changed was incorrectly compared with
unshifted packet flag to determine button press state.

Also fix button tracking storage; button flags are 32 bits whereas the
member variable was 8.

Differential Revision: https://developer.blender.org/D14915
2022-06-04 09:39:32 -07:00
db5ffdd1a4 Cleanup: Use const for retrieved custom data layers 2022-06-04 17:12:17 +02:00
6572ad8620 Cleanup: Use const, make format 2022-06-04 16:51:20 +02:00
a5190dce9d Mesh: Only check dirty normals flag of current domain
The code that checked whether vertex normals needed to be recalculated
was checking the dirty tag for face normals and vertex normals, in an
attempt at increased safety. However, those tags are always set
together anyway. Only checking the vertex dirty tag allows potentially
allocating or updating the normals on the two domains independently,
which could allow further skipping of calculations in some cases.
2022-06-04 16:30:57 +02:00
23f8fc38d9 Cleanup: Remove unnecessary struct keywords 2022-06-04 13:31:30 +02:00
9531eb24b3 Fix T98580: image flip/invert/resize don't work on active UDIM tile 2022-06-03 19:42:22 +02:00
8e02b53ae7 Sculpt: Fix zeroing of last position on stroke start
Fixes bug where clicking in empty space resets
viewport pivot in rotate around active mode
to zero.
2022-06-03 10:41:05 -07:00
2681e480ea Fix T98579: image save operators changing file path to absolute 2022-06-03 19:25:57 +02:00
da45c12bef Merge branch 'blender-v3.2-release' 2022-06-03 19:02:46 +02:00
34f94a02f3 Fix use of OpenGL interop breaking in Hydra viewports that do not support it
Rendering directly to a resource using OpenGL interop and Hgi
doesn't work in Houdini, since it never uses the resulting resource
(it does not call `HdRenderBuffer::GetResource`). But since doing
that simultaneously disables mapping (`HdRenderBuffer::Map` is
not implemented then), nothing was displayed. To fix this, keep
track of whether a Hydra viewport does support displaying a Hgi
resource directly, by checking whether
`HdRenderBuffer::GetResource` is ever called and only enable use
of OpenGL interop if that is the case.

Differential Revision: https://developer.blender.org/D15090
2022-06-03 18:56:30 +02:00
3fe7d049d2 Fix new curve objects showing as UNKNOWN in the outliner
The fix is to unify with the name we had for the old Curves objects.

That means that we will see them bothi (old and new curves) in the outliner
(under two different categories but with different names).

This is considered to be a temporary solution until we remove the old
curve system entirely.
2022-06-03 18:40:14 +02:00
5cc118fc09 Merge remote-tracking branch 'origin/blender-v3.2-release' 2022-06-03 17:10:16 +02:00
7f7ed8e098 Fix T98571: corrupted face selection drawing with GPU subdivision
Simple typo in rB55e3930b253e.
2022-06-03 17:09:44 +02:00
6b9a3be03d Cleanup: clang-format 2022-06-03 16:55:21 +02:00
e7156be86e Merge remote-tracking branch 'origin/blender-v3.2-release' 2022-06-03 16:13:51 +02:00
0b38b8dafa Spreadsheet Editor: Support int 8 attribute
This was leading to some crashes and warnings such as:

"Code marked as unreachable has been executed. Please report this as a bug."

Differential Revision: https://developer.blender.org/D15116
2022-06-03 16:13:28 +02:00
e73fd4f0c0 Fix (unreported) important memory leak in Boolean modifier using a Collection operand and Fast mode.
Code handling repetitive boolean operations when using several objects
from a Collection would not handle result mesh properly, re-creating for
each object without properly freeing it.

Further more, existing code was effectively converting the BMesh to mesh
twice, including a modification of the initial (input) mesh, which
modifiers should never do!

Removed the extra useless conversion, which also gives a small
improvement in performances:

With as simple of a scene as four objects (three operands in a
collection, and the modified one) totalling 20k vertices/faces, this
commit:
* Avoids 2MB memory leak per evaluation (!).
* Speeds up boolean evaluation by 5-10%.

Found while investigating some production files of the Project Heist
here at the Blender Studio.
2022-06-03 16:07:05 +02:00
691ab3fc46 Fix (unreported) invalid debug timing code in Boolean modifier code. 2022-06-03 16:07:05 +02:00
1a3ac2f750 Tests: Add basic testing for boolean modifiers.
Test basic Difference operation with both a single Objetc and a
collection of three objects as operands, using BMesh (aka 'FAST') mode.
2022-06-03 16:07:05 +02:00
5d9ebea15d Cleanup: remove unused code 2022-06-03 16:02:04 +02:00
12722bd354 Curves: Add surface UV map name property
In the latest discussions about curves/hair mesh attachement
information (T95776), it was decided to use UV coordinates to
store where on the mesh each root is. For that, we have to specify
which of the UV map attributes to use for UV lookups.

This property isn't used yet, but it will be shortly when refactoring
the attachement information in the add brush and the to particle
system conversion.

Differential Revision: https://developer.blender.org/D15115
2022-06-03 15:54:03 +02:00
2780c7e312 Cleanup: deduplicate resampling curve after moving last point 2022-06-03 15:40:18 +02:00
074010ad6d Fix T98570: Cycles AOVs not working in background shader
Must include the AOV writing feature in background shader evaluation.

Differential Revision: https://developer.blender.org/D15114
2022-06-03 15:34:31 +02:00
9d8fb80f21 Eevee/Workbench: store 8 bit image textures as half float for some color spaces
Same as in Cycles, this is needed for some color space conversions that don't
compress well to byte sRGB, like for example Filmic sRGB.

Ref T68926
2022-06-03 15:25:23 +02:00
4c4056579b Fix typo in colorspace description 2022-06-03 15:25:23 +02:00
d040e1da4f Constraints: introduce wrapper functions to access target lists.
Instead of directly accessing constraint-specific callbacks
in code all over blender, introduce two wrappers to retrieve
and free the target list.

This incidentally revealed a place within the Collada exporter
in BCAnimationSampler.cpp that didn't clean up after retrieving
the targets, resulting in a small memory leak. Fixing this should
be the only functional change in this commit.

This was split off from D9732.

Differential Revision: https://developer.blender.org/D13844
2022-06-03 16:18:26 +03:00
284a3431ae Cycles: Fix rendering of packed UDIM tiles with different sizes
The packed image loader was not aware of the fact that UDIM tiles
can be of a different size.

Exposed Python API required to access this information. It has the
same complexity as the "regular" packed files: in both cases the
ImBuf will be acquired and released to access the information.

While the current workflow of packing UDIMs is not very streamlined,
it is still possible and is something what the studio is using here.

Test file:
{F13130516}

Expected behavior achieved with this patch: a bigger checker board
pattern in viewport render

Actual behavior prior to this patch: either memory corruption, or
wrong/black render result on the plane

Differential Revision: https://developer.blender.org/D15111
2022-06-03 14:23:23 +02:00
fa5cf5360c Merge branch 'blender-v3.2-release' 2022-06-03 14:11:48 +02:00
cf6c8ae01b Fix T98573: Rescaling Image by python wrong
This did not refresh the Image editor, but more importantly this now
appeared cropped (a regression from the partial image updater).

Solved in the RNA function by:
- calling BKE_image_partial_update_mark_full_update
- sending appropriate notifier

Maniphest Tasks: T98573

Differential Revision: https://developer.blender.org/D15110
2022-06-03 14:08:21 +02:00
6b84465352 Cleanup: remove dead code 2022-06-03 13:51:05 +02:00
0a2a8d702a Fix: Curves sculpt mode keymaps missing in preferences
These changes make the curves sculpt mode keymap consistent
with other modes. They now show up in the keymap, for potential
editing of tool shortcuts, etc. I don't fully understand this system,
but at least these changes should make it consistent.

Differential Revision: https://developer.blender.org/D15112
2022-06-03 13:41:16 +02:00
3b51d9065c Cleanup: deduplicate retrieving data from context in curves brushes 2022-06-03 13:39:59 +02:00
5c6053ccb1 Fix misaligned address error when rendering 3D curves in the viewport with Cycles and OptiX 7.4
Acceleration structures in the viewport default to building with the fast
build flag, but the intersection program used for curves was queried with
the fast trace flag. The resulting mismatch caused an exception in the
intersection kernel. Since it's difficult to predict whether dynamic or static
acceleration structures are going to be built at the time of kernel loading,
this fixes the mismatch by always using the fast trace flag for curves.
2022-06-03 12:24:13 +02:00
Angus Stanton
50976657ac Geometry Nodes: Show supported types in geo socket tooltip
Show the supported geometry types returned by geometry
node socket declarations in the socket inspection tooltip.

Differential Revision: https://developer.blender.org/D14802
2022-06-03 10:11:06 +02:00
4eb5163b18 Fix T98459: vertex weight paste/copy inconsistent
In the editmode sidebar, pasting a particular vertex's weight in a
single group was not behaving the same as copying for all groups [in
that the former dis not copy to unassigned vertices whereas the later
did copy to unassigned vertices].

This behaves like this since the introduction in {rB70fd2320c8d2}, but
there does not seem to be a good reason for this?

Now make this consistent and use `BKE_defvert_copy_index` in both cases
(instead of earlying out if unassigned, this will make sure this will
also copy to unassigned).

Maniphest Tasks: T98459

Differential Revision: https://developer.blender.org/D15062
2022-06-03 09:50:45 +02:00
16d329da28 Compositor: add pre/post/cancel handlers and background job info
Main motivation is from T54314 where there was no way to read from a
Viewer image datablock after the compositor has run.
The only solution there was to do a full rerender (which obviously takes
much longer). Adding a handler avoids having to rerender.

This uses new syntax from rBf4456a4d3c97 and also adds "COMPOSITE" as a
job type that can be queried by `bpy.app.is_job_running`.

NOTE: there is another issue when multiple viewers are used and these
get active via RNA (compo execution is not triggered there yet -- unlike
when a viewer is selected in the Editor -- this is an issue of
`ED_node_set_active` vs. only `nodeSetActive`, but this will be tackled
separately)

Maniphest Tasks: T54314

Differential Revision: https://developer.blender.org/D15078
2022-06-03 09:45:08 +02:00
9babe39de9 LineArt: Include minor fixes in branch that's missing in master. 2022-06-03 15:36:27 +08:00
cf5529af12 Cleanup: remove gizmo transform workaround which is no longer needed
Now gizmos forward the original event to transform so assuming an LMB
event is no longer needed.
2022-06-03 15:08:11 +10:00
e87082d8a7 Cleanup: spelling in comments 2022-06-03 15:08:11 +10:00
379672ca0b Cleanup: remove unused, commented MTexFace assignments 2022-06-03 15:08:11 +10:00
9ad19b0453 Merge branch 'blender-v3.2-release' 2022-06-03 13:15:35 +10:00
c4701a027f Fix T98558: island selection in UV editor can crash
Regression in [0]. When zoomed in, we can be within the face of an
island but too far from an edge, in this case
uv_find_nearest_face_multi_ex is used instead of
uv_find_nearest_edge_multi with the consequence that hit.l cannot be
used in uvedit_uv_select_test (it is NULL).

Instead, use uvedit_face_select_test instead in this case.

[0]: d356edf420

Reviewed By: campbellbarton

Ref D15100
2022-06-03 13:14:20 +10:00
1fb36e9a7c Cleanup: DRW: Overlay: Make simple fragment shaders local
This avoids reusing gpu shader files that have different requirements.
2022-06-02 23:50:29 +02:00
4a72b64c7b Cleanup: Split large block of versioning code to separate function
Large blocks of versioning code should be separate to keep
`blo_do_versions_300` more readable.
2022-06-02 22:26:34 +02:00
545b9ddc34 Cleanup: Simplify curves toolbar drawing logic
Use `elif` to clarify that only one case happens.
2022-06-02 22:18:07 +02:00
049e42ef20 Cleanup: DRW: Added basic_ prefix to all *.glsl files in basic/shaders
This is needed to avoid potential naming collision with other engines.
2022-06-02 21:25:38 +02:00
c15e913df8 Cleanup: DRW: Added overlay_ prefix to all *.glsl files in overlay/shaders
This is needed to avoid potential naming collision with other engines
2022-06-02 21:08:05 +02:00
7f47f187c1 EEVEE-Next: Fix compilation of hair domain materials
Also fix formating of `curves_attribute_element_id` which was copy pasted.

# Conflicts:
#	source/blender/draw/engines/eevee_next/shaders/eevee_attributes_lib.glsl
2022-06-02 20:00:05 +02:00
b5fe0f02be Cleanup: DRW: Added overlay_ prefix to all *_info.hh files in overlay 2022-06-02 19:58:10 +02:00
73d8015aa3 Fix T79801: openvdb cache does not support Unicode paths on windows
"Fix" should be taken with a grain of salt, this will fix
the issue on win10 1903 and newer.

OpenVDB uses boosts memory mapped files which call
CreateFileA in the back-end when you feed it a
regular string.

now the encoding for CreateFileA will be whatever the
default is for the system, it internally turns it into
a wide string with said encoding and calls CreateFileW.

This change changes that encoding to UTF-8 for just
blender so we can use utf-8 with any of the narrow
api functions. This is a manifest change and only win10
1903 will look for it, so that sadly limits the fix
to only a subset of users.

While ideally we would have fixed the issue our selves,
some of the calls to openvdb::io::file::open are beyond
our control (ie from inside USD or Mantaflow)

Note: This only changes the behaviour in regard to Win32
API functions, regular CRT functions like fopen or if_stream will
still not accept utf-8 filenames.

Differential Revision: https://developer.blender.org/D14981
Reviewed by: brecht
2022-06-02 11:18:43 -06:00
2b80bfe9d0 Color Management: add Filmic sRGB as an image colorspace
A typical use case is when you want to render with the Filmic view transform, but
composite an existing image in the background that should not be affected by the
view transform.

With this colorspace it's possible to do an inverse Filmic transform, render
everything in scene linear space, and then apply the Filmic transform again.

This is pretty basic in that this is not going to take into account the full view
transform including looks, curves and exposure. But it can be helpful anyway.

Ref T68926
2022-06-02 18:49:04 +02:00
33f5e8f239 Cycles: load 8 bit image textures as half float for some color spaces
For non-raw, non-sRGB color spaces, always use half float even if that uses
more memory. Otherwise the precision loss from conversion to scene linear or
sRGB (as natively understood by the texture sampling) can be too much.

This also required a change to do alpha association ourselves instead of OIIO,
because in OIIO alpha multiplication happens before conversion to half float
and that gives too much precision loss.

Ref T68926
2022-06-02 18:04:38 +02:00
10488d54d9 Cleanup: Use const pointers 2022-06-02 18:02:48 +02:00
91c44920dd Fix: Build error after merge from release branch 2022-06-02 18:02:32 +02:00
3cd6ccd968 Merge branch 'blender-v3.2-release' 2022-06-02 17:54:17 +02:00
2d9c5f3dcf Fix T98556: Crash with extrude node in edit mode
The original index layer was not initialized properly.
Supporting original indices properly for this node is
doable, but for now it is better to simply initialize them
to the "none" value to fix the crash.

Differential Revision: https://developer.blender.org/D15105
2022-06-02 17:53:35 +02:00
96a47af413 Fix T98546: Crash with multires bake and zero levels
The problem was that copying a `CDDerivedMesh` (`CDDM_copy`) doesn't
copy the `vert_normals` reference that it takes from a mesh. Since this
entire area is almost completely broken anyway (mainly in terms of
ownership handling), for now we can just avoid copying the `DerivedMesh`
in the zero levels case.

Longer term, this area should be refactored to remove `DerivedMesh`
and use the newer subdivision evaluation system.

Differential Revision: https://developer.blender.org/D15099
2022-06-02 17:46:38 +02:00
9e43a57d22 Cycles: fix missing attribute update
Differential Revision: https://developer.blender.org/D15102
2022-06-02 16:42:53 +02:00
9580f23596 install_deps: Add support for oneAPI Level Zero library. 2022-06-02 15:53:50 +02:00
1174cdc914 install_deps: raise default ffmpeg version to 5.0, minimum 4.0.
Ref. T98555.
2022-06-02 15:53:50 +02:00
9bb7de274d USD: Enable operator presets when exporting
This patch enables operator presets for USD exports.
The export menu has many options, so enabling the feature
will help users manage their export settings in the same
way they can with other filetypes.

Same as {rB1d668b635632}

Differential Revision: https://developer.blender.org/D14896
2022-06-02 15:07:54 +02:00
432c4c74eb LineArt: Speedup construction of quad trees.
Using multithread for `add_triangles` to speed up quad tree building.
Each thread would lock its respective tile to work on triangle insertion,
intersection calculation, tile splitting and triangle array extension.

Reviewed By: Sebastian Parborg (zeddb), Sergey Sharybin (sergey)

Ref D14953
2022-06-02 20:46:08 +08:00
Bastien Montagne
901791944d Anim: Refactor 'F-curve from rna path' code.
Move into its own new function the the low-level logic to search for a
given RNA path in Action F-curves, then driver F-curves of a given AnimData.

This deduplicates code from `BKE_fcurve_find_by_rna_context_ui` and
`id_data_find_fcurve`, and will allow for future more usages of this
functionality.

Differential Revision: https://developer.blender.org/D15068
2022-06-02 12:28:50 +02:00
3ca76ae0e8 Cleanup: remove "<pep8 compliant>" from headers
It can be assumed that all scripts comply with basic pep8 formatting
regarding white-space, indentation etc.

Also remove note in best practices page & update `tests/python/pep8.py`.

If we want to exclude some scripts from make format,
this can be done by adding them to `ignore_files` in:
source/tools/utils_maintenance/autopep8_format_paths.py

Or using `# nopep8` for to ignore for individual lines.

Ref T98554
2022-06-02 20:16:20 +10:00
48bb144fea PyDoc: reference enum instead of inlining 2022-06-02 20:16:20 +10:00
f4456a4d3c Expose background job info to Python
Add `bpy.app.is_job_running(job_type)` as high-level indicator. Job
types currently exposed are `WM_JOB_TYPE_RENDER`,
`WM_JOB_TYPE_RENDER_PREVIEW`, and `WM_JOB_TYPE_OBJECT_BAKE`, as strings
with the `WM_JOB_TYPE_` prefix removed. The functions can be polled by
Python code to determine whether such background work is still ongoing
or not.

Furthermore, new app handles are added for
`object_bake_{pre,complete,canceled}`, which are called respectively
before an object baking job starts, completes sucessfully, and stops due
to a cancellation.

Motivation: There are various cases where Python can trigger the
execution of a background job, without getting notification that that
background job is done. As a result, it's hard to do things like
cleanups, or auto-quitting Blender after the work is done.

The approach in this commit can easily be extended with other job types,
when the need arises. The rendering of asset previews is one that's
likely to be added sooner than later, as there have already been
requests about this.

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D14587
2022-06-02 11:20:17 +02:00
40ecf9d606 Merge branch 'blender-v3.2-release' 2022-06-02 10:05:56 +02:00
33eeed5b3c Fix T98538 EEVEE: Geometry input node breaks with Displacement Texture
This was due to older drivers not honoring varying attributes shadowing by
local variables. Renaming the input argument fixes the issue.
2022-06-02 10:05:14 +02:00
d73adfdc86 PyDoc: changes to the generated conf.py file
- Set the highlight language to python3 (excludes python2 syntax).
- Set the encoding for code highlighting to utf-8 (no need to detect).
- Update deprecated variable name.
- Remove redundant unicode prefixed string.
2022-06-02 15:02:25 +10:00
0f73a27b76 Fix T98552: Experimental Tweak Select: Curve handle tweak is difficult
When this preference is enabled, use selection behavior matching the
graph editor. We may want to make this default (see T98552).
2022-06-02 13:55:06 +10:00
ef3f33dfd3 Cleanup: quiet warnings, remove unused arguments 2022-06-02 13:47:54 +10:00
7afcfe111a VSE: Make time operations self-contained
This patch makes it possible to manipulate strips without need to use
update functions to recalculate effect and meta strips.

Prior to this change function `SEQ_time_update_sequence` had to be used
to update mainly effects and meta strips. This was implemented in a way
that relied on sorted list of strips, which can't always be done and in
rare cases this approach failed.

In case of meta strips, `seqbase` had to be passed and compared with
"active" one to determine whether meta strip should be updated or not.
This is especially weak system that is prone to bugs when functions are
used by python API functions.

Finally, other strip types had startdisp` and `enddisp` fields updated
by this function and a lot of code relied on these fields even if strip
start, length and offsets are available. This is completely
unnecessary.

Implemented changes:
All effects and meta strips are updated when strip handles are moved or
strip is translated, without need to call any update function.

Function `SEQ_time_update_sequence` has been split to
`SEQ_time_update_meta_strip_range` and
`seq_time_update_effects_strip_range`. These functions should be only
used within sequencer module code. Meta update is used for versioning,
which is only reason for it not being declared internally.

Sequence fields `startdisp` and `enddisp` are now only used for
effects to store strip start and end points. These fields should be
used only internally within sequencer module code.
Use function `SEQ_time_*_handle_frame_get` to get strip start and end
points.

To update effects and meta strips with reasonable performance, cache
for "parent" meta strip and attached effects is added to
`SequenceLookup` cache, so it shares invalidation mechanisms.
All caches are populated during single iteration.

There should be no functional changes.

Differential Revision: https://developer.blender.org/D14990
2022-06-02 03:16:20 +02:00
604409b8c7 Cleanup: undeclared warning 2022-06-02 10:07:07 +10:00
f60ac5068a PyDoc: remove CSS override for scrolling long enum lists
Adding a scroll-bar to in-line lists has the down-side that it cuts
of text including warnings or notes that can be included, see: T87008.

Now enums are referenced [0] this is no longer needed, reverting [1].

[0]: 1c6b66c9cf
[1]: 1e8f266591
2022-06-02 10:03:00 +10:00
fb08353f38 Cleanup: replace ParamBool and PBool with bool for GEO_uv API
Also improve const correctness and type correctness.

Reviewed By: brecht

Ref D15075
2022-06-02 09:52:51 +10:00
b450a8c851 Cleanup: remove unused area smoothing logic for UV unwrap
This used to run when holding Shift while unwrapping until 2006 when it
was removed [0].

[0]: e66b5e5cd5

Reviewed By: brecht

Ref D15075
2022-06-02 09:47:01 +10:00
68150b666c Fix T92952: Knife inconsistent angle printout
Knife could display incorrect snapping angle printout in
header/footer because it was not always updated after angle snapping
calculations.
2022-06-01 21:20:53 +01:00
129ea355c8 GPencil: Add support to name new layer when moving to layer
To make it consistent with collections, now it's possible to name the new layer created using the `Move to Layer` option.

Differential Revision: https://developer.blender.org/D15092
2022-06-01 18:25:12 +02:00
bff9841465 Merge branch 'blender-v3.2-release' 2022-06-01 15:44:19 +02:00
a493956eaa Release schedule: Entering Bcon4 for Blender 3.2 (RC) 2022-06-01 15:39:52 +02:00
a1e6245650 Merge branch 'blender-v3.2-release' 2022-06-01 15:04:54 +02:00
e72b86d3cb Fix T98469: Crash trying to add an object to a linked collection that is linked to multiple scenes.
Crash happened because code could not find a valid base in current scene
after adding the object, added some checks for that.

Root of the issue was wrong assumptions in `BKE_object_add` logic, which
would pick the first valid ancestor collection in case initially
selected collection was not editable. In some case, this could pick a
collection not instanced in the current scene's view layer, leading to
not getting a valid base for the newly added object.

Addressed this by adding a new variant of `BKE_collection_object_add`,
`BKE_collection_viewlayer_object_add`, which ensures final collection is
in given viewlayer.
2022-06-01 15:04:34 +02:00
c667069a12 Merge branch 'blender-v3.2-release' 2022-06-01 14:55:26 +02:00
7dd0258d4a Fix T98536: geometry nodes wrong selection on duplicate edges
Code was using the loop [which is looping over the selection] index as
an index for the lookup into the edges directly, but needs to be a
lookupinto the IndexMask.

Also renamed the variable (as used elsewhere) to make this more clear.

If accepted, would be nice to still get this into 3.2.

Maniphest Tasks: T98536

Differential Revision: https://developer.blender.org/D15089
2022-06-01 14:53:35 +02:00
ae0b68e129 Merge branch 'blender-v3.2-release' 2022-06-01 22:46:17 +10:00
e0f3c23ac0 Fix T98370: Shift+RMB Select nodes doesn't work with the tweak tool
The tweak tool was toggling node selection twice, as the selection
key-map is already accounted for in the node key-map there is no need
to duplicate the actions in the tweak tool.
2022-06-01 22:45:45 +10:00
e9eae1b857 Curves: Avoid optimization to avoid storing selection for now
This optimization should be restored when there is proper vizualization
for the selection attributes.
2022-06-01 11:57:38 +02:00
110c90b3cf LineArt: Adding a intersection timer.
This is for conveinence of perfomance comparison.
2022-06-01 16:59:46 +08:00
d3b3d72303 Fix T98520: Sculpt operators can unintentionally clear multires mask
Typo in {rBcf69652618fe}.

Maniphest Tasks: T98520

Differential Revision: https://developer.blender.org/D15087
2022-06-01 10:48:56 +02:00
e5ab1495e5 Merge branch 'blender-v3.2-release' 2022-06-01 10:30:30 +02:00
da7bc51210 Fix failing Cycles Metal MNEE test on buildbot, by disabling it
It appears that Metal and MNEE are still not working.
2022-06-01 10:28:09 +02:00
38acd14fb7 Tweak Object duplicate_move macro tooltips.
Since we have two macros, we can at least have proper different tooltips
for each.
2022-06-01 09:29:42 +02:00
71ce47a71d LineArt: Temporary fix for object loading iterator.
Use `DEG_OBJECT_ITER_BEGIN`for loading objects, this iterator is
technially unsafe to use *during* depsgraph evaluation,
see https://developer.blender.org/D14997 for detailed explainations.
2022-06-01 14:35:33 +08:00
1bf35f1b19 Cleanup: minor changes to sphinx_doc_gen
- Remove unused pymethod2sphinx.
- Correct exception string formatting.
- Define encoding for file reading with execfile(..).
2022-06-01 15:48:20 +10:00
61a7e5be18 Cleanup: '*' prefix C-comment blocks 2022-06-01 15:38:48 +10:00
4cab98f8be Cleanup: spelling in comments, use doxy sections 2022-06-01 15:38:48 +10:00
0f29f2c3e6 Cleanup: remove redundant const qualifiers for scalar & enum types 2022-06-01 15:38:48 +10:00
44bac4c8cc Cleanup: use 'e' prefix for enum types
- CustomDataType -> eCustomDataType
- CustomDataMask -> eCustomDataMask
- AttributeDomain -> eAttrDomain
- NamedAttributeUsage -> eNamedAttrUsage
2022-06-01 15:38:48 +10:00
ca346d2176 Merge remote-tracking branch 'origin/blender-v3.2-release' 2022-06-01 07:02:32 +02:00
54d076b20d Fix T98526: broken corner attributes with GPU subdivision
Although reusing the same patch coordinate for all corner pointing the
same vertex works for interpolation vertices, it does work for
interpolation face varying attributes. So we need to keep the original
patch coordinates around for face varying interpolation. This was caused
by the previous fix (a5dcae0c64).
2022-06-01 07:02:05 +02:00
46cb24e7c2 Merge branch 'blender-v3.2-release' 2022-06-01 14:31:55 +10:00
0e8d6c2828 Cleanup: conversion from enum/int warning 2022-06-01 14:30:57 +10:00
65e7d49939 Fix T89726: Fix hitbox of axis gizmo in UV Editor
Use the scale from the wmGizmo.matrix_final as a reference for the
arrow head-size.

Reviewed By: campbellbarton

Ref D15056
2022-06-01 14:23:37 +10:00
ee57afe7e1 Merge remote-tracking branch 'origin/blender-v3.2-release' 2022-05-31 21:09:35 -07:00
12642bdeab Fix T96984: Create new image.browse operator for uiTemplateImage layouts
The existing BUTTONS_OT_file_browse operator that's used for
uiTemplateImage layouts fails to work correctly with UDIM textures.

This is mainly due to it not realizing that it must tokenize the
filepath before signaling that an update has been made. It also doesn't
work correctly when executing its SHIFT-click behavior to open the image
in an external application. Lastly, it doesn't set the filters to Images
and Movies which is suboptimal for the user.

The new operator takes the unique features of BUTTONS_OT_file_browse
and creates a customized variant better suited for images.

Differential Revision: https://developer.blender.org/D14824
2022-05-31 20:57:33 -07:00
b38a59881b Merge branch 'blender-v3.2-release' 2022-05-31 16:35:22 -07:00
6cee404914 GPU subdiv: Fix edit mode vertex color not being uploaded properly
Also cleaned up the code a tad bit.  Note that I
found two more bugs:

* GPU subdivision attribute interpolation
  is producing visual artifacts.
* "Show on cage" mode for subdivision surface
  just shows black colors.
2022-05-31 16:32:42 -07:00
75162ab8c2 Fix T97408: Temporary fix for attribute convert undo
Sculpt undo now detects if an attribute layer has
changed type/domain and unconverts it back.  This
is a temporary workaround to a more fundamental
bug in the undo system.

Memfile undo assumes it can always rebuild the
application state from the prior undo step,
which isn't true with incremental undo systems.

The correct fix is to push an extra undo step prior
to running an operator if an incremental undo system
is active and the operator is using memfile undo.
2022-05-31 15:46:09 -07:00
79cee340a8 Merge branch 'blender-v3.2-release' 2022-05-31 12:45:24 -07:00
511a08585d Fix T98364: Remove improper OPTYPE_UNDO flags
Removed OPTYPE_UNDO flags from the swap brush colors and
sample color operators.  These types of operators are
not supposed to be undoable in the first place.  Also
memfile undo is too buggy for it.
2022-05-31 12:43:07 -07:00
b9f29a0f64 Merge branch 'blender-v3.2-release' 2022-05-31 20:44:56 +02:00
0f47506cde Fix T98501: setting node socket default value is very slow
The issue was that the extend socket (the last empty socket in
Input/Output nodes) was repeatedly removed and added again,
which caused more updates than necessary. Now, the extend
socket is kept if it existed already.

Differential Revision: https://developer.blender.org/D15084
2022-05-31 20:43:53 +02:00
5c80bcf8c2 Functions: speedup preparing multi-function parameters
My benchmark which spend most time preparing function parameters
takes `250 ms` now, from `510 ms` before. This is mainly achieved by
doing less unnecessary work and by giving the compiler more inlined
code to optimize.

* Reserve correct vector sizes and use unchecked `append` function.
* Construct `GVArray` parameters directly in the vector, instead of
  moving/copying them in the vector afterwards.
* Inline some constructors, because that allows the compiler understand
  what is happening, resulting in less code.

This probably has negilible impact on the user experience currently,
because there are other bottlenecks.

Differential Revision: https://developer.blender.org/D15009
2022-05-31 20:41:01 +02:00
484ea573af Merge branch 'blender-v3.2-release' 2022-05-31 19:24:56 +02:00
dc389a6152 Fix T98454: subdivision doesn't propagate int attributes
Differential Revision: https://developer.blender.org/D15083
2022-05-31 19:23:52 +02:00
a1830859fa Curves: Add soft selection in sculpt mode
This commit adds a float selection to curve control points or curves,
a sculpt tool to paint the selection, and uses the selection influence
in the existing sculpt brushes.

The selection is the inverse of the "mask" from mesh sculpt mode
currently. That change is described in more detail here: T97903

Since some sculpt tools are really "per curve" tools, they use the
average point selection of all of their points. The delete brush
considers a curve selected if any of its points have a non-zero
selection.

There is a new option to choose the selection domain, which affects how
painting the selection works. You can also turn the selection off by
clicking on the active domain.

Sculpt brushes can be faster when the selection is small, because
finding selected curves or points is generally faster than the
existing brush intersection and distance checks.

The main limitation currently is that we can't see the selection in the
viewport by default. For now, to see the selection one has to add a
simple material to the curves object as shown in the differential
revision. And one has to switch to Material Preview in the 3d view.

Differential Revision: https://developer.blender.org/D14934
2022-05-31 19:00:24 +02:00
96f20ddc1e Geometry Nodes: Don't allow UI attributes as modifier field inputs
This is an extension of 4669178fc3, applying the same changes to
attributes chosen in the field inputs of the geometry nodes modifier.
If a UI/internal attribute is used, the attribute name button will
have a red alert. Adding a disabled hint is currently a bit more complex.

Also hide UI attributes in attribute search for the named attribute node.

Part of D14934
2022-05-31 18:58:54 +02:00
610619c203 Merge branch 'blender-v3.2-release' 2022-05-31 17:35:16 +02:00
a40b611128 Cleanup: Improve const correctness of ID functions
These functions don't change their inputs, so they can be const,
which is a bit more intuitive and clean to use for callers.

Differential Revision: https://developer.blender.org/D14943
2022-05-31 17:31:32 +02:00
f2cd7e08fe Fix Cycles MNEE not working for Metal
Move MNEE to own kernel, separate from shader ray-tracing. This does introduce
the limitation that a shader can't use both MNEE and AO/bevel, but that seems
like the better trade-off for now.

We can experiment with bigger kernel organization changes later.

Differential Revision: https://developer.blender.org/D15070
2022-05-31 17:24:43 +02:00
908dfd5e0d Merge branch 'blender-v3.2-release' 2022-05-31 10:15:40 -05:00
52cb24a779 Fix T98500: Wrong Selection in Duplicate Points
Differential Revision: https://developer.blender.org/D15071
2022-05-31 10:07:56 -05:00
3060b98842 Cleanup: Simplify dependencies for GMP math header
Previously, the base math headers included GMP headers in all cases.
This was problematic because we don't want all modules that use the
math headers to depend on GMP, and the unnecessary includes could
theoretically have detrimental effects to compile times.

Now `BLI_math_mpq.hh` depends on `BLI_math_base.hh`, so if a file
needs to use exact arithmatic, it can just include the former.

Differential Revision: https://developer.blender.org/D15079
2022-05-31 16:55:14 +02:00
a746cef825 Cleanup: Move lib_override.c to C++
This will allow easier const correctness and use of
nicer data structures like `Vector` and `Map`.
2022-05-31 16:19:50 +02:00
d356a4f280 Merge remote-tracking branch 'origin/blender-v3.2-release' 2022-05-31 16:18:42 +02:00
a5dcae0c64 Fix T97877: broken shadows with GPU subdivision
Issues stems from the mesh not being watertight. This was caused by
floating point precision issues when evaluating patch coordinates at
patch boundaries (loops/corners in different patches pointing to the same
vertex). To fix this we ensure that all loops pointing to the same vertex
share the same patch coordinate. This keeps code simple, and does not
require to track precision issues in floating point math all over the
place.
2022-05-31 16:18:08 +02:00
3d66ee8c97 Intern/atomic: Fix const qualifier for atomic_load_ptr. 2022-05-31 21:05:15 +08:00
e37027634b Intern/atomic: Adding atomic_load/store_ptr support.
We need to provide _ptr ones with _z ones on the API level.

Reviewed By: Sergey Sharybin (sergey)

Ref D15076
2022-05-31 20:09:39 +08:00
4669178fc3 Attributes: Hide internal UI attributes and disallow procedural access
This commit hides "UI attributes" described in T97452 from the UI lists
in mesh, curve, and point cloud properties, and disallow accessing them
in geometry nodes.

Internal UI attributes like selection and hiding values should use the
attribute system for simplicity and performance, but we don't want to
expose those attributes in the attribute panel, which is meant for
regular user interaction. Procedural access may be misleading or cause
problems, as described in the design task above.

These attributes are added by two upcoming patches: D14934, D14685

Differential Revision: https://developer.blender.org/D15069
2022-05-31 13:20:16 +02:00
39c14f4e84 Merge branch 'blender-v3.2-release' 2022-05-31 12:29:41 +02:00
765c16bbd0 Fix wrong asset dropped when dragging from loc. of just cleared asset
See previous commit for an explanation of what went wrong. Similar to
the fix there, we also have to update the dragged data (e.g. the
data-block) referenced by the button.

Committing separately since this could cause further issues.
2022-05-31 12:28:58 +02:00
75ef51cc80 Fix T95394: Crash when dragging from location of just cleared asset
In Blender buttons are recreated over redraws, except of the active
button which is kept alive, and replaces the new version of itself in
the new redraw. In order to do that, the button needs to be recognized.
This process of recognizing and matching buttons from different redraws
isn't always bullet-proof. That's okay-ish, but we have to make sure
that the relevant data of the old active button is updated with the
newest data.

Here the matching would go wrong, and the new active button was
recognized as the old active button, which was in fact removed when the
asset was cleared. This patch makes sure the image buffer attached to
the buttons is updated when buttons were recognized as matching.

Note that the dragging will still use the wrong data-block, this will be
fixed in the following commit.
2022-05-31 12:27:52 +02:00
9301cc74ee Merge remote-tracking branch 'origin/blender-v3.2-release' 2022-05-31 12:15:37 +02:00
344a8fb3d4 Fix T97086: corrupted UVs with GPU subdivision
When multiple objects are in edit mode, UVs for the objects, except for
the first one (in rendering order) appear corrupted. The corruption is
because the UVs are not evaluated as the compute shader is not bound,
thus we read unitialized memory.

We keep track of the currently bound shader in the GPU context in order
to avoid unnecessary shader switches in case the same shader is used in
consecutive calls. However, the shader used by the OpenSubdiv evaluator
is not part of Blender and therefore not tracked via the GPU context.

When extracting UVs for multiple objects, we only ever run a single
shader (FVar evaluation). However, between the compute calls, we also
call the OpenSubdiv stencil evaluation shader, which uses `glUseProgram`
modifying the current program, outside of our control, which then also
unbinds the Blender compute shader making the compute dispatch fail ("No
active compute shader").

The fact that extracting the UVs for the first rendered object works is
because another (Blender) shader was bound in the GPU context prior to
our binding of our evaluation shader.

To fix this, we remember, in the OpenSubdiv evaluator, the current
program so that it can be reset after the stencil program is done.

Differential Revision: https://developer.blender.org/D15064
2022-05-31 12:15:02 +02:00
0d7e0ffdb5 Cleanup: tabs to spaces for CMake files & sort file-lists 2022-05-31 18:18:24 +10:00
e82141b6b4 Do not provide python libraries for linking if building python module
When building blender as a python module, such as for inclusion in a
wheel, it is not permitted to link against python libraries.
This diff does so by simply unsetting the library when building blender
as a python module, instead of the more heavyweight solution of
switching to the cmake FindPython module.

Reviewed By: LazyDodo, campbellbarton

Ref D15012
2022-05-31 18:18:24 +10:00
247ceca629 Merge branch 'blender-v3.2-release' 2022-05-31 10:06:22 +02:00
18a17d4291 Fix T98403: Crash applying modifiers on non-mesh objects
The operator assumed it was called on a mesh object, which has
mostly been the case because of lack of support for other object
types, but the new curves object is supported, which is the situation
in the report.

Differential Revision: https://developer.blender.org/D15063
2022-05-31 10:05:48 +02:00
Iyad Ahmed
a30e67813d OBJ: Enable undo for experimental OBJ importer
The new OBJ importer operator didn't register an undo event.
This commit enables the register and undo flags for the operator.

Reviewed By: Bastien Montagne, Aras Pranckevicius, Serhiy Striletksy
Differential Revision: https://developer.blender.org/D15051
2022-05-31 11:00:14 +03:00
a3a138b41b Merge branch 'blender-v3.2-release' 2022-05-31 09:52:32 +02:00
5fdd367786 Merge branch 'blender-v3.2-release' 2022-05-31 09:52:03 +02:00
Julien Kaspar
1ebc0ebdc0 UI: Correct sculpt tooltips
Some of the tools in sculpt mode were still referring to the previously  experimental sculpt vertex colors.
They should instead refer to color attributes.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D15073
2022-05-31 09:51:26 +02:00
993fd985f0 Cleanup: remove UV handling from OBJECT_OT_modifier_convert
It doesn't make sense to merge UV's when applying a particle-system.
2022-05-31 17:42:44 +10:00
c338388354 Cleanup: rename ED_object_modifier_convert to make it's use clearer
This function is specific to particle-systems which wasn't obvious,
leading to an error in [0] which added UV handling which doesn't make
sense.
2022-05-31 17:40:02 +10:00
c8058e51ee RNA: add macros for EnumPropertyItem layout elements
Add the following macros for enums as support for these features wasn't
all that obvious and there were some inconsistencies in their use.

- RNA_ENUM_ITEM_HEADING(name, description)
- RNA_ENUM_ITEM_SEPR
- RNA_ENUM_ITEM_SEPR_COLUMN
2022-05-31 14:19:06 +10:00
1c6b66c9cf PyDoc: replace in-lined enum references with links where possible
Avoid in-lining large enums such as icons and event types, linking
to them instead.

This mitigates T76453, where long enums took a lot of space in the docs,
this was a problem with `UILayout` where each icon argument would list
all icons. [0] worked around the issue using CSS to scroll the list.
However this has the draw-back where some items are clipped in a way
that's not obvious, see: T87008.

The reason this isn't a complete solution is that Python defined enums
aren't written into their own pages which can be linked to, although
currently there are no large Python enums included in the API docs.
All in-lined enums are now under 20 items.

[0]: 1e8f266591
2022-05-31 14:19:06 +10:00
94444aaadf PyDoc: de-duplicate enums for rna_rna.c & bpy_props.c
Lists of items for bpy.props were duplicated 3 times, now all enums are
defined once in rna_rna.c and referenced from bpy.props doc-strings.
2022-05-31 14:19:06 +10:00
fb86f3ee18 PyDoc: document static enums from RNA_enum_items.h
Create a page for every enum in RNA_enum_items.h, which includes
the enum values and the doc-string for each item.

Each page creates a references which the API reference can be linked to
via the same name as the enum, so :ref:`rna_enum_icon_items` links
to the list of icons for e.g.

This has two main advantages:

- No need to manually duplicate enum values in the doc-strings of
  functions defined in Python's C/API (not RNA defined functions),
  `bpy.props` for example.

- The generated Python API docs can reference these instead of including
  the enums in-line - resulting in unreasonably long lists in the case
  if icons and event types (for example).

These changes will be made separately.
2022-05-31 14:18:32 +10:00
ed2a345402 PyAPI: add _bpy.rna_enum_items_static() for accessing internal enum data
This is method is intended for internal use
(introspection for generating API docs).
2022-05-31 14:07:08 +10:00
7056c7520a RNA: avoid non-standard enum item (enum section using single space)
Also removes stray semicolon in RNA_enum_items.h
2022-05-31 14:07:06 +10:00
ca59391704 Cleanup: Remove outdated comment 2022-05-30 19:30:52 +02:00
Dominik Fill
f523fb1dc9 Fix T96157: Make size of Frame Node label independent from Line Width
This commits corrects the calculation of the Frame Node label size,
making it independent of the 'Line Width' user preference.

Since `U.dpi` is actually DPI divided by `U.pixelsize` and `U.pixelsize`
is calculated from line-width multiplying by `U.pixelsize` undoes
the connection between line-width and label size.
It now stays the same, regardless of the line-width setting.

Reviewed By: Julian Eisel, Harley Acheson

Differential Revision: https://developer.blender.org/D14338
2022-05-30 19:26:03 +02:00
Dominik Fill
c8cef83fae Fix T96157: Make size of Frame Node label independent from Line Width
This commits corrects the calculation of the Frame Node label size,
making it independent of the 'Line Width' user preference.

Since `U.dpi` is actually DPI divided by `U.pixelsize` and `U.pixelsize`
is calculated from line-width multiplying by `U.pixelsize` undoes
the connection between line-width and label size.
It now stays the same, regardless of the line-width setting.

Reviewed By: Julian Eisel, Harley Acheson

Differential Revision: https://developer.blender.org/D14338
2022-05-30 19:19:07 +02:00
b24e091c5a Cleanup: Move attribute.c to C++ 2022-05-30 18:06:39 +02:00
3f9376851b Cleanup: Clang tidy
Mostly duplicate includes, also use nullptr, and using default
member initializers.
2022-05-30 17:46:44 +02:00
3437cf155e LibOverride: Add full support for camera's background images.
Add support for adding (inserting) new background images into an
override of a linked Camera ID.

Request from the Blender studio.

This ended up being more involved than expected as it uncovered some
latent issues with existing background images code. Noticiably, a new
`BKE_camera_background_image_copy` had to be added to handle copying
of background images in a proper, generic ID-management way.
2022-05-30 17:43:22 +02:00
a5d9b3442d Cleanup: Move attribute domain count out of enum
The number of attribute domains is not an attribute domain.
This way it doesn't have to be handled in switch statements.

Differential Revision: https://developer.blender.org/D15065
2022-05-30 17:30:37 +02:00
4267c6280a Fix (unreported) missing rna_path function for BackgroundImage struct. 2022-05-30 17:16:13 +02:00
dd2ed1c55c Cleanup: report errors instead of asserting in case of missing local data on file read.
While this should never happen, this is not a critical failure
preventing Blender to work.
2022-05-30 16:58:27 +02:00
fb62fcf071 Fix polling function for background image removal not checking linked ID.
Linked ID is (almost) never editable... Also rename that function to add
the `_poll` suffix.
2022-05-30 16:58:27 +02:00
e7544e3ce4 Fix (unreported) wrong ID usercount handling in background images removal.
Assuming that an ID pointer is NULL because another 'source type'
property has some specific value is utterly wrong and a gateway to
usercounting bugs.
2022-05-30 16:58:27 +02:00
c1277c5d25 Merge remote-tracking branch 'origin/blender-v3.2-release' 2022-05-30 16:44:22 +02:00
6856290514 Fix T98253: Gpencil Lineart crashes when undoing creation of linked copy
These lines were not used now because the handling of copy data has changed.

Assigning the `eval` data can produce unexpected result, especially since everywhere ID_RECALC_TRANSFORM is used, we also do a copy on write. That should take care of `ob->data` for the eval object.
2022-05-30 16:39:27 +02:00
cd6551d4eb Cleanup: use class instead of struct 2022-05-30 16:28:13 +02:00
fc1ae52994 Fix T98444: Image.save_render not using scene output file type
Also simplify logic because (source == IMA_SRC_VIEWER) and
ELEM(type, IMA_TYPE_R_RESULT, IMA_TYPE_COMPOSITE) are the same
thing.
2022-05-30 16:24:12 +02:00
de610d06a6 Cleanup: make format 2022-05-30 16:17:25 +02:00
65bd9974d1 Cleanup: make format 2022-05-30 16:16:25 +02:00
afd81e26af Fix T98446: Spreadsheets filter not working on Name column 2022-05-30 16:11:52 +02:00
a9a4bcc3d1 Fix building: stub for OpenSubdiv
Building problem introduced on 24e74f8bef. It affects `make lite`
and other builds that skip OpenSubdiv.
2022-05-30 16:10:22 +02:00
a775389823 Merge branch 'blender-v3.2-release' 2022-05-30 15:42:38 +02:00
70171cdfdf Fix T98488: GPencil weightpaint not visible if first point is no weight
The problem was because the check was done with the total weights of the first element of the array and if this was null or 0, the weights were not duplicated.

As this bug was introduced fixing T97150 due a problem in the weight data, now instead to duplicate all stroke data to create the perimeter for the PDF/SVG, only the points are duplicated because the weights are not needed. This fix the original bug and also reduce the memory used by the export process.
2022-05-30 15:42:08 +02:00
6a59cf0530 Nodes: add separately allocated runtime data for nodes and sockets
This is a follow up to rBbb0fc675822f313c5546a2498a162472c2571ecb.
Now the same kind of run-time data is added to nodes and sockets.

Differential Revision: https://developer.blender.org/D15060
2022-05-30 15:32:16 +02:00
1f85877263 Fix T98461: Crash running screenshot from the command-line
When launching Blender with a script creating a screenshot, the Outliner
tree wasn't initialized and built properly. That is because at this
stage, all visible regions were only tagged for a non-rebuild redraw,
not a full redraw. So ensure all regions are tagged for a full redraw
immediately after file reading. Usually the full redraw would be caused
by a file-read notifier, but the Python expression/script is executed
before notifiers are handled.

Note that even before this was crashing, the Outliner would be empty in
the created screenshot.

Additionally adds an assert to the Outliner to note assumptions
explicitly, rather than crashing later.
2022-05-30 15:17:50 +02:00
Pratik Borhade
a8471459fd Fix T98445: Knife Tool always cuts through
Minor error in if condition used for early return.

Ref D15050
2022-05-30 22:29:16 +10:00
ec8365b9ed Fix building without opensubdiv 2022-05-30 22:29:16 +10:00
7f877ee042 Merge branch 'blender-v3.2-release' 2022-05-30 14:09:13 +02:00
fbeec91abf Cleanup: fix various typos
Contributed by luzpaz

Differential Revision: https://developer.blender.org/D15057
2022-05-30 14:09:07 +02:00
24e74f8bef Fix T98449: Cycles crash changing frame after recent changes
Subdivision did not properly update when evaluating first without and then with
orco coordinates. Now update the subdivision evaluator settings every time, and
reallocate the vertex data buffer when needed.

there is an additional issue in this file where orco coordinates are not
available immediately on the first frame when they should be, and only appear
on the second frame. However that is an old limitation related to the depsgraph
not getting re-evaluated on viewport display mode changes, here we just fix the
crash.
2022-05-30 14:06:03 +02:00
ddebb0f783 Cleanup: Fix typo
Contributed by @luzpaz

Differential Revision: https://developer.blender.org/D15058
2022-05-30 14:05:15 +02:00
bb0fc67582 Nodes: add separately allocated run-time data for bNodeTree
`bNodeTree` has a lot of run-time embedded in it currently. Having a separately
allocated run-time struct has some benefits:
* Run-time data is not stored in files.
* Makes it easy to use c++ types as run-time data.
* More clear distinction between what data only exists at run-time and which doesn't.

This commit doesn't move all run-time data to the new struct yet, only the data where
I know for sure how it is used. The remaining data can be moved separately.

Differential Revision: https://developer.blender.org/D15033
2022-05-30 12:54:07 +02:00
2f77b2daac Nodes: call init function for new node trees in ntreeAddTree
Issue found in D15033, for some more info see comments there.
2022-05-30 12:44:42 +02:00
ce1dd44c68 Merge branch 'blender-v3.2-release' 2022-05-30 03:22:31 -07:00
Bastien Montagne
878a805ae8 Cleanup/simplify BKE_fcurve_find_by_rna_context_ui code.
From reading the code it looks like at some point the code was expecting
the `tptr` PointerRNA to change during the loop? But currently it did
not make any sense to have this complex looping and multi-checking of
RNA path and animdata, since the RNA pointer (and therefore its
`owner_id`) is never modified...

NOTE: there could be much more cleanup done in that area, goal of this
commit is mainly to simplify the logic by removing all the (seamingly)
dead code.

Differential Revision: https://developer.blender.org/D15026
2022-05-30 12:02:10 +02:00
f1c29b9bd3 Fix T98368: Shading artifacts on paint/mask anchored sculpt brushes
I'm not sure what is causing this.  Vertex normals get corrupted
for paint and mask sculpt brushes but not the normal geometric
ones.  Since we don't actually need to recalculate normals
here to begin with I've just disabled it.  The code now
calls the appropriate node mark update function based on
the sculpt tool.
2022-05-30 02:48:04 -07:00
fc3c589b18 Merge branch 'blender-v3.2-release' 2022-05-30 10:14:00 +02:00
a7bda30ca8 Curves: make tangent computation more robust
Previously, when there were multiple curve points at the same or
almost the same position, the computed tangent was unpredictable.

Now, the handling of this case is more explicit, making it more
predictable. In general, when there are duplicate points, it will just use
tangents from neighboring points now.

Also fixes T98209.

Differential Revision: https://developer.blender.org/D15016
2022-05-30 10:12:06 +02:00
16746e8ec2 Cleanup: Tweak geometry component comments 2022-05-30 08:59:58 +02:00
3c0d7152c8 Merge branch 'blender-v3.2-release' 2022-05-29 14:25:53 -05:00
cc4b6c6476 Fix T98400: Duplicate node crash 2022-05-29 14:25:17 -05:00
32bf6455a0 Fix T98400: Duplicate node crash 2022-05-29 14:19:05 -05:00
218f23935c Fix: Failed assert for evaluated lengths of single point curves
Since 2d80f814cc, curves always have evaluated points,
but single point curves do no have any evaluated segments, and the
leading zero length isn't stored in the curves length cache.
2022-05-29 13:43:25 +02:00
86cfc30aac Cleanup: Fix warning from typo in include directive 2022-05-29 11:02:30 +02:00
3152d68b70 Cleanup: Simplify custom data file writing process
Previously the function had a fair amount of ugly boilerplate to avoid
allocating the temporary layers array, and then free it if necessary.
`blender::Vector` solves that problem more elegantly. Passing a span,
using references in a few cases, and using a switch statement also make
the functions simpler.

This refactoring is in preparation for D14583 and D14685.

Differential Revision: https://developer.blender.org/D15011
2022-05-29 11:02:10 +02:00
93e4b15767 Cleanup: clang-tidy for GHOST X11/SDL/Wayland/NULL backends
Also early exit in some functions.
2022-05-29 13:25:58 +10:00
13373a6ccd Merge branch 'blender-v3.2-release' 2022-05-28 22:25:08 -03:00
49368c734b Fix (unreported): cyclic snap of curve handles
The logic of skipping selected handles was inverted
and confusing.
2022-05-28 22:24:43 -03:00
812a9728f8 Select Similar: hide 'compare' from UI when not used
When the 'compare' is not used for the resulting selection, just hide
it. This is the case for 'Vertex Groups' atm (where only membership is
taken into account).

Similar to rB9dc9692b0979.

Differential Revision: https://developer.blender.org/D14979
2022-05-28 12:32:25 +02:00
314e5cb889 XR: Fix controller flicker when switching action sets
This could happen when switching between custom action sets that both
had controller pose actions. Problem was that controller data is
cleared when changing action sets, and this clearing was done when
handling WM events, which always occurs after XR controller data is
updated from GHOST.

Now, instead of activating the action set immediately, delay activation
until just before the next XR actions sync.
2022-05-28 17:23:27 +09:00
16166f69be Fix pasting text from Blender in GHOST/Wayland
The nil terminator character shouldn't be included, causing an extra
character to be added in some cases.
2022-05-28 16:06:54 +10:00
5dfff02437 Fix switching between different grab types with GHOST/Wayland
Since [0], using the view navigation gizmo crashed with Wayland.
This only worked previously because GHOST_kGrabWrap was ignored.

Now the previous grab state is disabled before switching to a new
grab state.

[0]: da9e14b0b9
2022-05-28 15:56:09 +10:00
138a4846e2 Merge remote-tracking branch 'origin/blender-v3.2-release' 2022-05-27 22:16:14 -07:00
86baf6e3ed Re-fix T97366: Support single-file UDIMs
The original fix for T97366 was too restrictive and breaks real-world
cases of single-file UDIM textures. See D13297 for an example.

This patch effectively reverts the original fix and instead fixes the
downstream code to accept single-file ranges as necessary.

Note: This means it is very important for users to make use of the
"UDIM detection" option during `image.open` or drag n' drop scenarios in
order to declare their intent when loading their files.

Differential Revision: https://developer.blender.org/D14853
2022-05-27 22:11:52 -07:00
3f1f4df3fd Fix unreported misuse of Win32 clipboard API
An ASAN build highlighted a longstanding bug during ctrl+c operations
inside various text widgets. The existing code had mismatched memory
lock/unlock calls and was using the wrong allocator.

Fix the code surrounding `SetClipboardData` to be correct per MSDN:
https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setclipboarddata

Differential Revision: https://developer.blender.org/D15039
2022-05-27 20:52:52 -07:00
712b0496c1 Merge branch 'blender-v3.2-release' 2022-05-27 20:22:12 +02:00
967f96ee2e Fix T98270: Cycles shows black with color values > 65K in GPU render
After recent changes to Nishita sky to clamp negative colors, the pixels ended
up a bit brighter which lead to them exceeding the half float max value. The
CUDA float to half function seems to need clamping.
2022-05-27 20:14:15 +02:00
7b65086fdf Cleanup: Use new macro for deprecated ID types
Uses the macro introduced in b45f410b31 where it makes sense.
2022-05-27 19:15:58 +02:00
da1dd98101 Merge branch 'blender-v3.2-release' 2022-05-27 19:13:59 +02:00
bd2f9a16fb Merge branch 'blender-v3.2-release' 2022-05-27 17:06:58 +02:00
Arye Ramaty
52c1f983cb UI: add missing tooltips for the shader node options
Differential Revision: https://developer.blender.org/D14878
2022-05-27 17:05:48 +02:00
b45f410b31 Fix T97790: Crash in Outliner "Blender File" mode with old files
IPO data-block types are deprecated since 2.5. Don't show them in the
Outliner at all.

Differential Revision: https://developer.blender.org/D15049
2022-05-27 17:03:25 +02:00
Jagannadhan Ravi
74cf22c42c Fix T96397: Cycles missing HIP support for gfx1035 devices
Such as AMD Radeon RX 6700S.

Differential Revision: https://developer.blender.org/D13495
2022-05-27 16:59:40 +02:00
3a4f2131c2 Fix Cycles not rendering byte precision vertex domain colors
Code was not yet updated to use generic attributes for vertex colors. This also
makes generic attributes work for adaptive subdivision.
2022-05-27 16:55:49 +02:00
9fef80c663 Merge branch 'blender-v3.2-release' 2022-05-27 14:23:00 +02:00
bf6aa5d63d GPencil: Fix unreported Bake animation error
This bug was introduced in commit https://developer.blender.org/rB5188c14718c56e4d088d3c5bb3ce3ed9ed8b7bdc because the object transform was not applied when baking the object.

Thanks to @frogstomp for the head up.
2022-05-27 14:22:09 +02:00
abf8750dbc Cleanup: Cycles, fix "parameter unused" warning
Fix "parameter unused" warning that shows up when building without NanoVDB.

No functional changes.
2022-05-27 13:01:01 +02:00
5b40c48f85 Merge branch 'blender-v3.2-release' 2022-05-27 12:58:07 +02:00
5417b8434a Fix T97918: Crash when changing "Frame All" shortcut from context menu
After removing the default 'Home' shortcut for "Frame All", a NDOF (3D
Mouse) default shortcut was still available for the operator. The event
filtering introduced in 4357fb63db was missing the NDOF filtering
logic. So while the context menu correctly found the NDOF keymap item,
its actual shortcut change/removal code incorrectly filtered out the
NDOF keymap items and thus failed to find the item.
2022-05-27 12:55:24 +02:00
802f107e38 Merge branch 'blender-v3.2-release' 2022-05-27 12:16:31 +02:00
e5c65709a2 Fix T98379: Wrong evaluation when deactivating/activating collections
This is a regression caused by a230445cae.

The internal cause of the issue was that the synchronization component
was no longer tagged as visible (and hence not evaluated) as it not
connected to any directly visible IDs.

Changed the logic in a way that if any component of an ID is evaluated
the synchronization component will be evaluated as well.

The naming of the flag in the component node is a bit confusing, but
for the simplicity of the change for the upcoming release left it
unchanged.
2022-05-27 12:09:14 +02:00
Colin Basnett
8d53ead69b Fix T97500: NLA strip names drawn outside strip
Fix T97500 by removing the logic that for some unknown reason draws the
entire string if the min/max were swapped.

This function is only called in two places, once here in the NLA, and
the VSE. The bug only materializes in the NLA though.

Reviewed By: sybren

Differential Revision: https://developer.blender.org/D14742
2022-05-27 11:26:52 +02:00
Colin Basnett
f45a735aad Fix T97974: Marker line affected by NLA strip mute
Fix T97974 by having the marker rendering code explicitly set the
required line width.

Reviewed By: sybren

Differential Revision: https://developer.blender.org/D14890
2022-05-27 11:13:06 +02:00
84189a6340 Merge remote-tracking branch 'origin/blender-v3.2-release' 2022-05-27 11:03:56 +02:00
f41c7723c9 GPU: Remove cached full/scaled image texture.
full scaled image isn't used anymore. It was added to use a different scale when
displaying an image in the image editor. This was replaced by the image engine
redesign.

This change will reduce complexity of {T98375}.
2022-05-27 10:52:49 +02:00
5625a21fc7 Fix fuzzy ID deletion user count check.
`BKE_id_delete` should only check for consistency of user count with
regards to the tags and flags of the ID, not 'protect' nor even warn in
case a 'fake user' ID is deleted (such higher-level checks are to be
handled by higher-level code).

Also replace the assert + debug print by a CLOG error, this avoids
'assert crash' while still failing tests, and always producing a useful
message.

Fixes T98374 and T98260.
2022-05-27 10:49:53 +02:00
da9e14b0b9 Fix GHOST_kGrabHide in Wayland
Dragging number buttons wasn't grabbing the cursor and would stop
when the pointer reached the screen edge & wasn't setting the cursor
visible on completion.
2022-05-27 16:48:20 +10:00
46456a59c4 GHOST/Wayland: support mouse buttons 4-7 2022-05-27 15:55:56 +10:00
7aad4d459e Cleanup: unused argument warnings 2022-05-27 14:51:48 +10:00
6d4f16a776 Fix non-square cursor creation in GHOST/SDL
Currently all cursors are square, so this didn't show up as a bug.
2022-05-27 14:39:21 +10:00
49032a8ca5 Fix error checking the search callback
Error in [0] caused the `set` callback be checked as the search callback.

[0]: 3f3d82cfe9
2022-05-27 14:28:13 +10:00
ae39abe7f3 Fix "day" unit length
The day is currently specified as 90000 seconds which is 25 hours.
Obviously this is wrong, and this commit changes it to 86400s/24 hours.

Differential Revision: https://developer.blender.org/D15034
2022-05-26 18:10:16 +02:00
fdc2b7bfa4 Intern: Adding atomic_load/store support for different types.
Mostly using built-in `__atomic` functions, with a special code path
using `MemoryBarrier()`on windows.

Authored By: Sergey Sharybin (sergey)

Reviewed By: Sergey Sharybin (sergey), Ray molenkamp (LazyDodo)

Ref D15020
2022-05-26 23:06:36 +08:00
bf53956914 Fix T98385: Color attributes not working with GPU subdivision
Contrary to coarse extraction, GPU extraction uses the same buffer for
the coarse data, only the final GPU buffer needs to be offset.
2022-05-26 15:12:30 +02:00
55e3930b25 Fix T98392: GPU subdivision crash with knife tools
The face dots normals may not be always requested, thus leading to a
crash by null pointer dereference.
2022-05-26 14:52:45 +02:00
d6badf6fde Merge branch 'blender-v3.2-release' 2022-05-26 21:25:59 +10:00
2a367689d4 Merge branch 'blender-v3.2-release' 2022-05-26 21:25:54 +10:00
38a2576ace Fix display error after sorting mesh elements
Sorting faces caused the tessellation data to be outdated,
making faces show the wrong materials.

Re-calculate tessellation when re-ordering faces.
2022-05-26 21:23:19 +10:00
790fe55c52 Fix Blender 2.7x keymap faulure to select & drag multiple nodes
A follow up on the fix for T98145 for the 2.7x keymap.
2022-05-26 21:06:44 +10:00
fdb1a7b5e1 Cleanup: struct PHandle merged with alias typedef void ParamHandle
Reviewed By: brecht

Ref D15021
2022-05-26 20:04:54 +10:00
374ce5dcb4 Merge branch 'blender-v3.2-release' 2022-05-26 16:00:15 +10:00
3131107ba3 Fix T94857: 'Gizmo Operator' from python templates spins when dragged
Callbacks used in the gizmo operator template don't support updating
while being dragged, set the EXCLUDE_MODAL flag so the offsets
aren't accumulated. Also fix the offset being applied twice to the
move gizmo.
2022-05-26 15:53:17 +10:00
ae5d3fa2d0 UI: use visible regions when showing candidates for operators data-path
When expanding the data path for the context, use Context.temp_override
to extract context members. Without this, only context-members available
in the preferences were used which misses members which are likely to
be useful.

Iterate over all windows, areas and regions showing unique member as
candidates. The search is limited to WINDOW/PREVIEW region types, the
preferences space type is also excluded. See the doc-string for
rna_path_prop_search_for_context for additional notes on this.
2022-05-26 14:15:59 +10:00
3f3d82cfe9 UI support for showing candidates for string properties
Currently strings are used for cases where a list of identifiers would
be useful to show.

Add support for string properties to reference a callback to populate
candidates to show when editing a string. The user isn't prevented from
typing in text not found in this list, it's just useful as a reference.

Support for expanding the following strings has been added:

- Operator, menu & panel identifiers in the keymap editor.
- WM operators that reference data-paths expand using the
  Python-consoles auto-complete functionality.
- Names of keying sets for insert/delete keyframe operators.

Details:

- `bpy.props.StringProperty` takes an option `search` callback.

- A new string callback has been added, set via
  `RNA_def_property_string_search_func` or
  `RNA_def_property_string_search_func_runtime`.

- Addresses usability issue highlighted by T89560,
  where setting keying set identifiers as strings isn't practical.

- Showing additional right-aligned text in the search results is
  supported but disabled by default as the text is too cramped in most
  string search popups where the feature would make sense. It could be
  enabled as part of other layout tweaks.

Reviewed By: brecht

Ref D14986
2022-05-26 12:16:35 +10:00
11480763b6 Cleanup: format 2022-05-26 12:13:45 +10:00
dc6fe73e70 Outliner: Make use of new C++ based functional iterators
(Not meant to cause user visible changes.)

Makes use of the new iterators introduced in the previous commit. Some
benefits:
- Shorter, simpler, easier to read & understand
- Deduplicates logic
- Centralizes iteration logic, making it easier to replace tree storage
  (as planned), see previous commit.
- Avoids having to pass (sub-)tree to iterate around (often redundant
  since it's just `SpaceOutliner.tree`, even though `SpaceOutliner` is
  already passed).
- Function arguments that are only passed to the recursive call are
  recognized as unused (found and removed a few).

Also does some general cleanups while refactoring the code for the
iterators. Use `const`, use references (signals null is not expected),
early-exit (see 16fd5fa656), remove redundant arguments, etc.
2022-05-25 23:21:15 +02:00
a4a7af4732 Outliner: New C++ based functional tree iterators
(Not meant to cause user visible changes.)

Adds some first new iterators to traverse over tree elements with a
functional syntax. Functional because it meant to be used with C++
lambdas.
For example, this common pattern:
```lang=cpp
void some_recursive_function(SpaceOutliner *space_outliner, ListBase *tree, ...)
{
  LISTBASE_FOREACH (TreeElement *, te, tree) {
    /* ... do something with the element ... */

    /* Recurse into open children. */
    if (TSELEM_OPEN(TREESTORE(te), space_outliner) {
      some_recursive_function(&te->subtree, ...);
    }
  }
}
```
Gets simplified to this:
```lang=cpp
void some_function(SpaceOutliner &space_outliner, ...)
{
  tree_iterator::all_open(space_outliner, [&](TreeElement *te) {
    /* ... do something with the element ... */
  });
}
```

We can add more iterators, e.g. some that support early exiting or
skipping children, returning a custom type, only act on selected
elements, etc.

The following commit will convert a bunch of code to use these. Some
further benefits will become visible there. Not all cases are straight
forward to convert, but hopefully more and more code can be refactored
to work with this. This deduplicates and centralizes the iteration
logic, which will later make it much easier to refactor how the tree
storage is done (e.g. move it to `SpaceOutliner_Runtime` and use a
better container than `ListBase`).
2022-05-25 23:20:05 +02:00
f3c03982e5 Outliner: Fix warning icon not bubbling up correctly to collapsed parent
Design is to have warnings in the sub-tree of a collapsed element show
up next to the collapsed element. But if inside the collapsed element,
there was a uncollapsed one containing yet another element with a
warning, that warning wouldn't "bubble up" to the collapsed parent.

Issue was that the warning lookup would only recurse into collapsed
elements, rather than all elements inside of a collapsed element.

While the actual fix for this could've been simpler, I decided to rework
this code entirely. Recursively querying the warning message is now done
separately from drawing the message once found, which makes the code
easier to follow and implements the single responsibility principle
better.
2022-05-25 20:16:17 +02:00
6feca52349 Outliner: Use general warning mechanics for library overrides
Library overrides were basically using their own system to display
warnings for tree elements, even though for other display elements we
have a more general solution. With the previous commit this has been
generalized further and made trivial to extend.
2022-05-25 20:16:17 +02:00
f1df685f57 Outliner: Refactor element warning and mode column querying
Uses a inheritance based approach for querying warning of tree elements
and the mode column support of display modes.

For the warnings, tree elements can override the
`AbstractTreeElement::getWarning()` method and return a warning string.
The UI will draw the warning column with warning icons. This makes the
warning column more generalized and easier to extend to more use-cases.
E.g. library override elements will use this after a followup commit.

To support mode toggles a display mode can now just return true in the
`AbstractTreeDisplay::supportsModeColumn()` method. This makes it
trivial to add mode columns to other display modes, and less error prone
because there's no need to hunt down a bunch of display mode checks in
different places.
2022-05-25 20:16:17 +02:00
Pablo Dobarro
1a516bb714 Fix T83519: Line Gesture flip state not updating without a mouse move event
The wm_gesture_tag_redraw function was only called on mouse move, so the
flip state preview was not updating just by pressing the F key.

Reviewed By: Severin

Maniphest Tasks: T83519

Differential Revision: https://developer.blender.org/D9779
2022-05-25 18:36:19 +02:00
496394daad UI: Curves Sculpt pinch icon 2022-05-25 17:33:29 +02:00
a337e7738f BLI: use no_unique_address attribute
Even though the `no_unique_address` attribute has only been standardized
in C++20, compilers seem to support it with C++17 already. This attribute
allows reducing the memory footprint of structs which have empty types as
data members (usually that is an allocator or inline buffer in Blender).
Previously, one had to use the empty base optimization to achieve the same
effect, which requires a lot of boilerplate code.

The types that benefit from this the most are `Vector` and `Array`, which
usually become 8 bytes smaller. All types which use these core data structures
get smaller as well of course.

Differential Revision: https://developer.blender.org/D14993
2022-05-25 16:28:07 +02:00
f381c31ac6 UI: Update icons after the latest changes in the generator script
There should be no visible change. The difference is mostly on how we
changed the rounding to handle the conversion from color space to the
new linear space of the attribute colors.

To convert the materials in icon_geom.blend I used:

```
import bpy
from mathutils import Color

def convert_material(material):
  if not material.use_nodes:
    return

  if not material.node_tree:
    return

  node_tree = material.node_tree
  for node in node_tree.nodes:
    if node.type != 'RGB':
      continue

      color_original = node.outputs[0].default_value
      color_new = Color(color_original[:3]).from_srgb_to_scene_linear()
      color = (*color_new, color_original[3])
      node.outputs[0].default_value = color

def main():
  for material in bpy.data.materials:
    convert_material(material)

main()
```
2022-05-25 15:56:48 +02:00
288e7d0af0 Tool Icons: Support curve and objects with modifiers + color space fix
This allows for the new tool icons to use geometry nodes.

In order to do this I also had to use the new API for accessing the
attributes (instead of vertex colors). Which in turn requires a few
changes to use linear color space.

I went ahead and updated the entire code to use the linear space
everywhere. I will update the icon files manually to make sure the final
result is similar to what we have now.

Note: We now use round instead of int. That plus the changes regarding the
color space will lead to some icons to change slightly (no perceived
visual change).

Differential Revision: https://developer.blender.org/D14988
2022-05-25 15:56:48 +02:00
e8eb67bb04 Merge branch 'blender-v3.2-release' 2022-05-25 15:11:06 +02:00
841a354412 Cleanup: Link/append: Remove useless proxy handling code.
This was not effectively doing anything anymore, time to remove it.
2022-05-25 15:09:52 +02:00
b0d2a435a1 Cleanup: Further tweaks to RNA path API const'ness of PointerRNA parameter.
`RNA_path_struct_property_py` cannot get const `ptr` parameter for now
(usage of `RNA_struct_find_property`).

Also make `RNA_path_resolve_` functions take a const PointerRNA
parameter.
2022-05-25 15:09:07 +02:00
a072a264b6 Fix vertex format for mesh attributes with GPU subdivision
A global variable was mistakenly used here which would accumulate the
vertex attributes (leading to an assertion failure after a while), use
the wrong number of components depending on the attribute data type,
among other issues.
2022-05-25 14:51:29 +02:00
ef59c8295f Fix T98355: Line art crash when switch to mesh edit mode.
This fix will ensure not to load any meshes that's being edited, thus
avoiding crashes.

Ref D15022
2022-05-25 20:43:58 +08:00
c27be07d89 Fix T98365: Overlay: Blender 3.2.0 Beta crashes on startup
This was caused by a wrong mass rename on a piece of code used only on
older hardware.
2022-05-25 14:39:58 +02:00
98b66dc040 Fix T96080: hiding elements does not work with GPU subdiv
Faces, edges, and vertices are still shown when GPU subdivision is
actived. This is because the related edit mode flags were ignored by the
subdivision code.

The flags are now passed to the various compute shaders mostly as part of
the extra coarse data, also used for e.g. selection. For loose edges, a
temporary buffer is created when extracting them. Loose vertices are
already taken into account as it reuses the routines for coarse mesh
extraction, although `MeshRenderData.use_hide` was not initialized,
which is fixed now.
2022-05-25 14:31:06 +02:00
MOD
c980ed27f0 Geometry Nodes: skip Capture Attribute node if output is not needed
This results in a speedup if the capture attribute is only needed
under specific circumstances (e.g. when a switch further down the
line is true). Previously, the input field was always evaluated.

Differential Revision: https://developer.blender.org/D15018
2022-05-25 13:58:02 +02:00
53f7c22022 Fix T98359: Handle object that has no feature lines.
In case of line art "occlusion only" or contour not enabled, it's possible for an object
to not produce any feature lines.

This patch checks that to prevent freeing a NULL pointer.
2022-05-25 19:23:23 +08:00
332d87375d UI: Fix ops.sculpt.cloth_filter icon
This icon was using a material with a slightly different shade of
purple. I removed all the duplicated materials in icons_geom.blend
and this was the only "functional" change (though it is not noticeable).
2022-05-25 12:56:51 +02:00
c64e9c6ae2 Cleanup: Add more const'ness to RNA API.
This commit makes PointerRNA passed to RNA path API const.
Main change was in the `path` callback for RNA structs, and indirectly
the `getlength` callback of properties.
2022-05-25 12:23:11 +02:00
4949dd54eb Merge branch 'blender-v3.2-release' 2022-05-25 11:23:53 +02:00
cb3b9358bf Fix T98344: Crash opening file with proxy.
Weird file where the proxy object has a `proxy_group` pointer, which
does not instantiate any collection...
2022-05-25 11:22:17 +02:00
6ec0f62e3f Merge branch 'blender-v3.2-release' 2022-05-25 10:37:14 +02:00
a4e7a5aa4f Fix link/append code not properly setting correct ID in context items.
When appending an already linked data, `BKE_blendfile_append` would not
properly substitute the `item->new_id` pointer of link/append context
items with the local duplicate of the linked ID.

This would cause drag'n'drop of assets to work incorrectly in some
cases. Fixes part of T95706 and T97320.
2022-05-25 10:32:34 +02:00
adaf92b4ab Cleanup: knife tool
- Use early return and continue to reduce right-shift.
- Rename `lv` to `tri_cos` for storing triangle coordinates.
- Reduce variable scope.
2022-05-25 17:49:12 +10:00
80e007fe8c Merge branch 'blender-v3.2-release' 2022-05-25 17:20:10 +10:00
c9a9763e36 Merge branch 'blender-v3.2-release' 2022-05-25 17:20:08 +10:00
aab947eb46 Fix T98349: Knife project resulting selection is wrong
Regression in [0] which removed the call to BVH-tree recalculation
before calculating the selection.

Instead of recalculating the BVH-tree, postpone recalculating mesh data
until after the selection has been calculated.

[0]: 6e77afe6ec
2022-05-25 17:16:25 +10:00
26c6ec5594 Cleanup: remove context argument from EDBM_mesh_knife
Added in [0] but isn't needed as all needed variables are in the
ViewContext. Avoid passing in the context is it makes debugging
issues with MESH_OT_knife_project more difficult to investigate since
it's possible values written to the ViewContext are ignored.

[0]: 6e77afe6ec
2022-05-25 17:16:23 +10:00
8f0612b781 Merge branch 'blender-v3.2-release' 2022-05-25 08:50:15 +02:00
08324ba2c1 Fix T98350: Crash when using clone tool + sequence.
When no image user is known the last used frame of the image is used to
read a frame. When partial updating an image there is always an image user
that would use a zerod out image user, meaning the frame number is set to 0
when using the clone tool.

This fix syncs the frame with the last used frame of the image to ensure
that the buffer exists. There is a bailout in the overlay_edit_uv.c.
2022-05-25 08:46:18 +02:00
e69f3d7db1 GPU: Updated comment about HQ normals workaround. 2022-05-25 08:03:52 +02:00
1ec01b2142 Merge branch 'blender-v3.2-release' 2022-05-25 08:01:58 +02:00
603d3c90a5 GPU: Fix issue that negated HQ normals workaround.
Thanks Germano for pointing it out.
2022-05-25 08:00:53 +02:00
57b87feda1 PyDoc: suppress duplicate object description warning
RenderEngine.render is both a method and an attribute,
while this should be avoided it's not causing a problem in practice
so quiet the warning when generating docs.

Sphinx now builds docs without any warnings.
2022-05-25 13:43:01 +10:00
d46647040d PyDoc: fix generated output for gpu.shader
Inclining built-in shader descriptions used the wrong indentation level.

Link to the built-in shaders instead which avoids the indentation error
and de-duplicates the list which is already shown on the page.
2022-05-25 13:35:39 +10:00
ceff1c2f65 Cleanup: spelling, unbalanced doxy sections 2022-05-25 12:46:55 +10:00
ae73bd3d9e Cleanup: use doxy sections for mathutils types
Also minor improvements & corrections to comments.
2022-05-25 12:37:27 +10:00
b0da080c2c Drag & drop: Use session UUID of IDs instead of name for dropping
Dropping would pass the name of the ID to drop to the properties of the
drop operator. This would then lookup the ID by name. With linking
and/or library overrides, multiple IDs of the same name and type may
exist, which is why the session UUID should be used instead. All
operators used for dropping support this now and the drop code passes
the session UUID instead of the name.

Also see 917c096be6 and 8f79fa9c67.

Some drop operators were already using the session UUIDs. This converts
the remaining ones. The "name" property is kept working as before, since
some scripts use this.

Side-effect: The "Name" property won't show up in the Adjust Last
Operation anymore, which was the case for some of these operators, and
its value won't be remembered over multiple executions of the operator.
Both were not at all useful from what I can tell, and I doubt this was
done intentionally.
2022-05-24 17:08:02 +02:00
7b778166db Cleanup: Use new helpers for passing IDs from drag & drop to operators
There are now some generalized helpers for passing IDs from drag & drop
to operators via operator properties, mostly introduced in 917c096be6
and 8f79fa9c67. These can be used in a bunch of places to reduce
duplicated code and explicitly share a common solution.

Side-effect: The "Name" property won't show up in the Adjust Last
Operation anymore, and its value won't be remembered over multiple
executions of the operator. Both were not at all useful from what I can
tell, and I doubt this was done intentionally.
2022-05-24 17:08:02 +02:00
25d216724b Cleanup: make format 2022-05-24 15:53:16 +02:00
cd412b4454 Drag & drop: Invert priority of name and session UUID in ID lookups
Continuation of 8f79fa9c67 and 917c096be6. The ID's session UUID is
now always priotitized over its name to lookup the ID from drop-box or
operator properties. bc3dbf109c shows what happens if the name happens
to be set for whatever reason and the session UUID isn't prioritized.
2022-05-24 15:36:41 +02:00
961db61fb8 Merge branch 'blender-v3.2-release' 2022-05-24 15:23:13 +02:00
bc3dbf109c Fix T95706: Material asset not applied if appended and then linked
8f79fa9c67 was an attempt to fix this already, but it didn't quite
work. Problem was that the tooltip was messing with the drop-box and
operator properties, setting the name property for its own internal
logic. This name property would then be used rather than the session
UUID to query the material, which gave the wrong material (linking can
result in multiple IDs of the same type with the same name). A followup
commit will further sanitize this.
2022-05-24 15:22:18 +02:00
463077a3d5 Fix possible lingering around of ID after asset dropping failed
More and more of the drop operations are being switched to use the ID's
session UUID rather than the name, but the cleanup after a drop operator
was cancelled assumed they would set the name. They will now first
attempt to use the session UUID and fallback to the name if needed.
2022-05-24 15:21:38 +02:00
258f6cbf93 Merge branch 'blender-v3.2-release' 2022-05-24 15:04:37 +02:00
bfec666dbc Merge remote-tracking branch 'origin/blender-v3.2-release' 2022-05-24 15:04:00 +02:00
a40a269062 Fix (studio-reported) bad re-assigning of new liboverride from ID template widget.
Shift-click on the 'linked' button in an ID template widget would fail
to properly remap that usage of the linked ID to the newly created
liboverride.
2022-05-24 15:03:04 +02:00
10aa2fa902 Redraw Motion Paths panel after creating motion path
Add notifier such that the Motion Paths panel in the Object Properties tab
gets redrawn, after using the Create Motion Path button.

The reason it didn't update was that the button actually triggers a popup,
and then executes in the context of that popup. It now actually emits a
`ND_DRAW_ANIMVIZ` notifier, and ensures that the panel redraws on that.
2022-05-24 14:57:30 +02:00
2da7977e3e Depsgraph: Implement backtrace functionality
The goal is to make it easier to track down sources of errors during
the dependency graph builder.

With this change whenever a relation can not be added a trace to the
entity which requested the relation will be printed. For example:

```
Failed to add relation "Copy Location"
Could not find op_from: OperationKey(type: BONE, component name: 'MissingBone', operation code: BONE_DONE)

Trace:

Depth    Type                     Name
-----    ----                     ----
1        Object                   Armature.001
2        Pose Channel             Bone
3        Constraint               Copy Location
```

On an implementation detail traced places where `checkIsBuiltAndTag`
is called, with some additional places to help tracking pose channels,
constraints, and modifiers.

Further improvements in granularity are possible, but that could happen
as a followup development once the core part is proven to work.

An example of such improvement would be to have entries in the trace
which will indicate NLA and drivers building. Currently it might be
a bit confusing to see IDs in the trace referenced from driver.

Even with such limitation the current state of the patch brings a
very valuable information (some information is much better than no
information at all).

Differential Revision: https://developer.blender.org/D15017
2022-05-24 14:48:51 +02:00
089175bb1f Merge branch 'blender-v3.2-release' 2022-05-24 13:17:20 +02:00
f29ff7fb7e Fix T98152: Named Attribute node changes data type for non-existant attributes
Skip changing the data type in the node if it is not known.
2022-05-24 11:55:44 +02:00
2ca66d541a Cleanup: Correct misleading comment in UI code 2022-05-24 11:31:19 +02:00
bc1eb513ab Fix buttons not being grayed out
Was using the wrong bitfield in flag comparisons for the drawing code.
The input handling wouldn't be affected. Own mistake in 0d73113452.
2022-05-24 11:31:19 +02:00
Jeroen Bakker
cd77bf44d4 Merge branch 'blender-v3.2-release' 2022-05-24 11:16:48 +02:00
Jeroen Bakker
d1340e1bb2 Fix T97828: Split normals not visible on certain platforms.
It is a know issue that split normals aren't supported when using high
quality normals in the viewport. Some AMD platforms were pushed to use
high quality normals to work around a driver bug where 1010102 texture
formats `GL_INT_2_10_10_10_REV` wasn't uploaded to the GPU.

This change will remove commonly used polaris platforms from the
work-around. This has been tested with a RX480 against the latest AMD
whql drivers (22.5.1). Users need to ensure that they use the latest
drivers that are available on their platform.

Although this change doesn't fix the underlying issue to support edit
normals when high quality normals are enabled. It will not force that
common platforms cannot use a feature as their platform is forced into
using a work-around.
2022-05-24 11:14:10 +02:00
b84264fbc5 Merge branch 'blender-v3.2-release' 2022-05-24 10:40:52 +02:00
ec5b53a018 Fix T98247 EEVEE: Regression: Shader To RGB not displaying textures
This was caused by the nodetree branch duplication not handling incoming
links to the copied node, making all bsdfs nodes use their default values.
2022-05-24 10:35:24 +02:00
174c3ffb4a Fix T98268: replace string node des not handle empty strings correctly
Just use an existing function from blenlib instead of implementing a new version.
2022-05-24 10:21:02 +02:00
123f4db9bd Cleanup: Else after return in depsgraph code 2022-05-24 10:07:54 +02:00
2ea6a0dd4d Fix T98328: missing depsgraph update after adding node group
Adding node groups can change depsgraph relations, so the depsgraph
has to be rebuild.
2022-05-24 10:05:52 +02:00
e07b1b8316 Fix T98317: equal vs not-equal modes in compare node are not exact opposites
For vectors and colors to be not equal, it is enough when they are not equal
in one component.
2022-05-24 09:49:58 +02:00
cd968a3273 EEVEE: support Curves attributes rendering
This adds support to render Curves attributes in EEVEE.

Each attribute is stored in a texture derived from a VBO. As the
shading group needs the textures to be valid upon creation, the
attributes are created and setup during its very creation, instead
of doing it lazily via create_requested which we cannot rely on
anyway as contrary to the mesh batch, we do cannot really tell if
attributes need to be updated or else via some `DRW_batch_requested`.

Since point attributes need refinement, and since attributes are all
cast to vec4/float4 to account for differences in type conversions
between Blender and OpenGL, the refinement shader for points is
used as is. The point attributes are stored for each subdivision level
in CurvesEvalFinalCache. Each subdivision level also keeps track of the
attributes already in use so they are properly updated when needed.

Some basic garbage collection was added similar to what is done
for meshes: if the attributes used over time have been different
from the currently used attributes for too long, then the buffers
are freed, ensuring that stale attributesare removed.

This adds `CurvesInfos` to the shader creation info, which stores
the scope in which the attributes are defined. Scopes are stored
as booleans, in an array indexed by attribute loading order which
is also the order in which the attributes were added to the material.
A mapping is necessary between the indices used for the scoping, and
the ones used in the Curves cache, as this may contain stale
attributes which have not been garbage collected yet.

Common utilities with the mesh code for handling requested
attributes were moved to a separate file.

Differential Revision: https://developer.blender.org/D14916
2022-05-24 05:02:57 +02:00
64a5a7ade1 Merge branch 'blender-v3.2-release' 2022-05-23 22:38:05 -03:00
5744e7d247 Fix GPUIndexBuf not working in python
Since rBb47c5505aa37, Batchs containing GPUIndexBuf initialized via
a PyObject with buffer protocol no longer work.

This was because of an unsafe optimization in the GPUIndexBuf module
for Python.

So remove this micro-optimization.
2022-05-23 22:37:30 -03:00
bb6f0b085e Merge branch 'blender-v3.2-release' 2022-05-24 11:01:38 +10:00
d55e1caa75 Fix T98185: Assertion saving while fullscreen
When saving from the menu the region was not set,
causing the last region in `area->regionbase` to be used
as the region was assigned before comparison.
2022-05-24 10:59:48 +10:00
c968dae054 Fix T98141: Strip rotation is limited to +/360 degrees
This limiting prevented visual keyframing from working correctly and is
not consistent with object rotation, so limiting is removed.
2022-05-23 23:28:21 +02:00
8eda776eef Fix T98057: Adjustment layer blend mode not optimal
Since adjustment layer is meant to replace original image, cross blend
mode is more optimal than alpha over. Same goes for multicam type.
2022-05-23 23:27:07 +02:00
770510915c Merge branch 'blender-v3.2-release' 2022-05-23 22:26:27 +02:00
bdab538b30 Fix Eevee blackbody wrong with non-default scene linear color space
* Port over new code tables from Cycles
* Convert Rec.709 to scene linear for lookup table.
* Move code for wavelength and blackbody to IMB so they can access the
  required transforms, which are not in blenlib.
* Remove clamping from blackbody shader to bypass the texture read.
  Since it's variable now easiest to just always read from the texture
  than pass additional parameters.
* Fold XYZ to RGB conversion into the wavelength table.

Ref T68926
2022-05-23 22:09:44 +02:00
a22ad7fbd3 Fix T98036: Cycles blackbody inaccurate for low temperature and wide gamut
Regenerate blackbody RGB curve fit to not clamp values, and extend down to
800K since it does now change below 965K.

Note that as before, blackbody is only defined in the range 800K to 12000K
and has a fixed value outside of that. But within that range there should
be no more unnecessary gamut clamping.
2022-05-23 22:07:59 +02:00
2655f47ca3 Revert "LineArt: Use CAS for add_triangles."
This reverts commit 14a5a91e0e.

This caused build errors on x64+arm mac builds and some versions
of MSVC, reverting for now till a better solution is found.
2022-05-23 13:11:17 -06:00
b2e5fc72c8 Merge branch 'blender-v3.2-release' 2022-05-23 21:08:01 +02:00
8f79fa9c67 Fix further issues when mixing link & append for asset drag & drop
917c096be6 applied to objects only, this also applies the same fix for
the general 3D View drop operations, e.g. used for dragging materials,
images, worlds, etc.

This is needed to fix T95706, but apparently something else is still
going on. Needs further investigation.
2022-05-23 21:00:01 +02:00
0d6dda4555 Cleanup: Move new utilities for ID lookup operator properties
Move them to a more accessible place, so that other operators in
different files can use them. The following commit needs this.
2022-05-23 20:59:55 +02:00
02c5ca2f22 Fix possible issues when mixing link & append for asset drag & drop
The operators to handle object drag and drop (from the asset browser,
outliner, etc.) used the object name to find the object to add and
place. This is problematic with linking and/or library overrides, since
this may lead to multiple objects with the same name. So the wrong
object would be used by the drop operators.

Partially fixes T97320. T95706 probably needs the same fix but for
materials.

As a side-effect, the "Name" button won't show up in the Adjust Last
Operation panel anymore. This isn't really useful, and I doubt this was
ever intentionally exposed in the UI.
2022-05-23 20:59:47 +02:00
9039fbaa9c Asset Browser: Show "Current File" icon in sidebar source field
If the asset is stored in the current file, display the corresponding
icon in the "Source" button in the sidebar. This is a nice indicator and
helps users learn what this icon represents (it's used in the main
region without text too).
2022-05-23 20:11:42 +02:00
917c096be6 Fix possible issues when mixing link & append for asset drag & drop
The operators to handle object drag and drop (from the asset browser,
outliner, etc.) used the object name to find the object to add and
place. This is problematic with linking and/or library overrides, since
this may lead to multiple objects with the same name. So the wrong
object would be used by the drop operators.

Partially fixes T97320. T95706 probably needs the same fix but for
materials.

As a side-effect, the "Name" button won't show up in the Adjust Last
Operation panel anymore. This isn't really useful, and I doubt this was
ever intentionally exposed in the UI.
2022-05-23 20:11:37 +02:00
ffa262c9f8 obj: remove unneeded CTX_data_ensure_evaluated_depsgraph
As discussed on the chat and pointed out in D15015, that call is
not needed there (none of the other importers do it either).
2022-05-23 20:43:53 +03:00
9e45af530a Fix T98293: Scene stats info not updated after new OBJ import
The importer was not doing a notification that the scene has changed, so
the bottom status bar scene stats info was not updated right after the
new OBJ import.

Reviewed By: Julian Eisel
Differential Revision: https://developer.blender.org/D15015
2022-05-23 20:42:27 +03:00
a8c81ffa83 Cycles: Add half precision float support for volumes with NanoVDB
This patch makes it possible to change the precision with which to
store volume data in the NanoVDB data structure (as float, half, or
using variable bit quantization) via the previously unused precision
field in the volume data block.
It makes it possible to further reduce memory usage during
rendering, at a slight cost to the visual detail of a volume.

Differential Revision: https://developer.blender.org/D10023
2022-05-23 19:08:01 +02:00
14a5a91e0e LineArt: Use CAS for add_triangles.
Using the atomic "compare and swap" method in add_triangles stage
dramatically speeds up the add_triangles call and significantly reduced
the overall calculation time. This is currently the fastest method we
have experimented with so far.

Reviewed By: Sebastian Parborg (zeddb)

Differential Revision: https://developer.blender.org/D14953
2022-05-24 00:28:52 +08:00
54f357ed2a Merge branch 'blender-v3.2-release' 2022-05-23 18:17:00 +02:00
ec95f4a5df Fix T96878: When interface translation is enabled, grease pencil layer name is translated in menu.
Those type of entries have to be tagged as not translatable...
2022-05-23 18:16:04 +02:00
0e6d70fec9 Fix "Open Clip" operator in Clip Editor broken
Steps to reproduce were:
- Open Clip Editor
- Call "Open Clip" (e.g. Alt+O)
- Select video file

The file wouldn't be loaded into the Clip Editor.

Caused by 7849b56c3c.
2022-05-23 18:01:11 +02:00
d91711bc85 Fix for crash opening the file selector multiple times
This is part of a fix for T88570, where the file selector would crash
when activated multiple times.

Calling save multiple times would free the operator, leaving a dangling
pointer which was used when panels were visible that accessed the
"active_operator".

Reviewed By: Severin

Ref D14905
2022-05-23 18:01:11 +02:00
bc8e030a84 Fix T88570: Crash when saving after pressing ctrl+S twice.
Existing code to replace the file operation was failing when done from
the window for the file operation itself.

Basically, this patch does two things:
- Implement a well defined window context to use as the "owner" or
  "root" of the File Browser. This will be used for managing the File
  Browser and to execute the file operation, even after the File Browser
  was closed.
- Ensure the context is valid when dealing with file File Browser event
  handlers.

Previously the window context just wasn't well defined and just happened
to work well enough in most cases. Addressing this may unveil further
issues, see T88570#1355740.

Differential Revision: https://developer.blender.org/D13441

Reviewed by: Campbell Barton
2022-05-23 18:01:11 +02:00
2b9dfff6f3 Cleanup: GPU: Remove gpu_shader_common_obinfos_lib.glsl
This has been replaced by `draw_object_infos`.
2022-05-23 17:20:12 +02:00
09b7e141d2 Fix T98251: EEVEE: Regression: Wrong normalmaps on scaled objects
This was caused by a missing `normalize`.
2022-05-23 17:20:12 +02:00
e4de0d28c4 EEVEE: Fix unreported broken normal map node modes
A compilation error was making it impossible to use normal map modes other
than tangent.
2022-05-23 17:20:12 +02:00
bce37bc52a Cleanup: GPU: Remove gpu_shader_common_obinfos_lib.glsl
This has been replaced by `draw_object_infos`.
2022-05-23 17:19:37 +02:00
7542dc460f Fix T98251: EEVEE: Regression: Wrong normalmaps on scaled objects
This was caused by a missing `normalize`.
2022-05-23 17:16:15 +02:00
5565d79057 EEVEE: Fix unreported broken normal map node modes
A compilation error was making it impossible to use normal map modes other
than tangent.
2022-05-23 17:13:57 +02:00
16fd5fa656 Cleanup: Early-exit in button handling code, minor cleanups
This should decrease cognitive load because:
- Intention is more explicit
- Shorter visual scope of branches (no need to search for matching
  closing brackets and `else` blocks)
- Visually less busy code because condition-checks and code that
  "actually does things" are separated, with less indentation
- Avoids chaining together a bunch of conditions to a single `if`

Also: Use `const`, correct comment placement, whitespace improvements.
2022-05-23 16:55:43 +02:00
7f1a5f2567 Merge branch 'blender-v3.2-release' 2022-05-23 16:33:04 +02:00
Johannes J
f4d31fbf6c DRW: Fix signed/unsigned mismatches in shader code
Fix the following error messages on Blender startup
since commit 308a12ac64.

This commit fixes T98194.

Reviewed By: fclem
Differential Revision: https://developer.blender.org/D15007
2022-05-23 16:30:18 +02:00
85e3e3be5b Merge branch 'blender-v3.2-release' 2022-05-23 16:24:50 +02:00
aea59428eb Fix T98128: EEVEE: Regression: Inverted surface normal on MacOS Intel GPU
This seems to be caused by the `!` used in conjunction with a macro.
Using the macro directly as condition does not exhibit this issue.
2022-05-23 16:23:50 +02:00
63cf0d0890 Fix T98196: Crash when moving tweaked NLA strip with empty track below
`BKE_nlastrip_find_active()` and `update_active_strip()` now do a more
thorough search for the active strip, by also recursing into
meta-strips.

There were some assumptions in the NLA code that the active strips is
contained in the active track. This assumption turned out to be false:
when there is a meta-strip, the active strip could be inside that, and
then it's not contained in `active_track.strips` directly.

Apart from the above, there are other situations in which the track
pointed to by `AnimData::act_track` does *not* contain the active strip
(even indirectly).

Both these cases can happen when the transform system is moving a strip
that's in tweak mode. Entering tweak mode doesn't just search for the
active track/strip, but also falls back to the last-selected ones. This
means that the track/strip pointers & flags can be out of sync with
what's being tweaked/transformed. Because of this, the assumption that
there is any relation between "active strip" and "active track" has been
removed from the `update_active_strip()` function.

All this searching could be prevented by passing the `AnimData` to the
code that duplicates tracks & strips. That way, when the active
track/strip is dup'ed, the `AnimData` pointers can be updated as well.
That would require more refactoring and thus could introduce other bugs,
so that's left for later.
2022-05-23 16:12:09 +02:00
Aleš Jelovčan
82d7234ed9 GPencil: A Ping Pong effect to Time modifier
This patch adds 4th option to Time offset modifier Modes.

It loops from start frame to end frame and then back to start in reverse direction.
In other words it is a combination of Normal and Reverse mode.

Especially with offset control it adds the ability to create easy looping animations such as cheering crowds, flowers opening and closing at different offsets.

Reviewed By: #grease_pencil, antoniov, pepeland, mendio

Differential Revision: https://developer.blender.org/D14965
2022-05-23 16:03:04 +02:00
698e394e7e Merge branch 'blender-v3.2-release' 2022-05-23 16:02:52 +02:00
9bb4bf5748 Fix missing 64bit casts when calculating Cycles render buffer offset
Found those missing casts while looking into a crash report made in
the Blender Chat. Was unable to reproduce the crash, but the casts
should totally be there to avoid integer overflow.
2022-05-23 15:59:52 +02:00
3e4f84d10d Merge remote-tracking branch 'origin/blender-v3.2-release' 2022-05-23 15:57:33 +02:00
eb5e7d0a31 Cleanup: clarify what is scene linear color space in conversion conversion
* Rename ambiguous rgb to scene_linear in some places
* Precompute matrices to directly go to scene instead of through XYZ
* Make function signatures more consistent
2022-05-23 15:34:50 +02:00
469ee7ff15 Python API: add mathutils.Color functions to convert color spaces
Between scene linear and sRGB, XYZ, linear Rec.709 and ACES2065-1.

And add some clarifications about color spaces in the docs.

Fixes T98267

Ref T68926

Differential Revision: https://developer.blender.org/D14989
2022-05-23 15:34:50 +02:00
09292b89c3 Fix wrong mouse tolerance in mask editor
There are two issues. The biggest one was that a pixel value was used
to compare a squared distance meaning the tolerance was too strict.
The other issue was that the tolerance in pixels was different to what
the tracking mode is using.

The user-level change is that now it should be easier to tweak the
mask shape.
2022-05-23 15:22:08 +02:00
00506d7a86 Cleanup: Unused field in sculpt DeleteOperation 2022-05-23 15:03:41 +02:00
2f2d13b8c6 Fix T97237: dragging custom node group asset adds broken node
Differential Revision: https://developer.blender.org/D15013
2022-05-23 14:43:20 +02:00
eba6900b08 Fix T98305: Image.save not working for generated images with filepath
This is a place where the API function and operator should differ, for the API
manually setting the filepath and then saving should work. For the UI there is
no filepath visible, so it should open Save As even if there was a filepath set
for example from before changing an image type to Generated.
2022-05-23 12:30:11 +02:00
a833c7f4a5 Fix T98283: Regression: crash when opening file that has Collision modifier on liboverride object
Some RNA property update callbacks can already generate such modifier,
and only one is allowed per object, so had to adapt code actually adding
new modifiers in liboverride apply codebase.
2022-05-23 12:13:33 +02:00
f626fc27f9 Fix T98316: geometry nodes stop updating after duplication
This was a missing depsgraph update.
2022-05-23 12:13:33 +02:00
3fe1079ecf Fix T98258: Duplicated last vertex after GPencil sample.
Also fixed an unreported issue of incorrect interpolation of thickness.

Reviewed By: Aleš Jelovčan (frogstomp), Antonio Vazquez (antoniov)

Differential Revision: https://developer.blender.org/D15005
2022-05-23 12:13:33 +02:00
2d67b375a1 Fix T98231: missing update when material output is in group
Differential Revision: https://developer.blender.org/D14998
2022-05-23 12:13:33 +02:00
62a2b92b6b Fix T98283: Regression: crash when opening file that has Collision modifier on liboverride object
Some RNA property update callbacks can already generate such modifier,
and only one is allowed per object, so had to adapt code actually adding
new modifiers in liboverride apply codebase.
2022-05-23 12:11:09 +02:00
a5409d2b59 Fix T98316: geometry nodes stop updating after duplication
This was a missing depsgraph update.
2022-05-23 11:29:55 +02:00
f4101ba4a1 LineArt: Fix adjacent edge sorting.
The sorting end element should be `start+len` not `start+len-1`.
2022-05-23 16:20:23 +08:00
c4e5a7d59a Fix T98258: Duplicated last vertex after GPencil sample.
Also fixed an unreported issue of incorrect interpolation of thickness.

Reviewed By: Aleš Jelovčan (frogstomp), Antonio Vazquez (antoniov)

Differential Revision: https://developer.blender.org/D15005
2022-05-23 16:17:00 +08:00
f4a01c8a8b Fix T98101: Handle single point curves in delete brush
The 3D brush utility and the delete brush only considered segments,
so they did not handle single points. Fix by adding special cases for
single point curves.

Differential Revision: https://developer.blender.org/D14944
2022-05-23 09:47:17 +02:00
8f3847aef3 Fix: Sample pressure properly for 3D curves sculpt brushes
For the "Sphere" 3D brushes, the depth and radius are only sampled at
the beginning of the stroke. This didn't work when tablet pressure is
used as a factor for the brush radius. Now the 3D brush depth is found
with the max radius (as if the pressure was 1.0), but the pressure
factor is used afterwards.

Restructuring the way the brush executors stored the radius made
the change a bit clearer, which is where most of the diff comes from.

Differential Revision: https://developer.blender.org/D15002
2022-05-23 09:44:12 +02:00
b81f1b8cf1 Fix T98231: missing update when material output is in group
Differential Revision: https://developer.blender.org/D14998
2022-05-23 09:11:17 +02:00
f93b237194 Merge branch 'blender-v3.2-release' 2022-05-23 08:16:50 +02:00
4418536f69 Fix T98321: Image.update doesn't update the image editor.
Missing call to partial update.
2022-05-23 08:14:38 +02:00
ad33e68348 Cleanup: remove "texture" from ED_mesh_uv_texture_* funcitons
This name made sense when UV's and textures were stored in the same
layer (MTFace & TFace).
2022-05-23 12:43:28 +10:00
1e882b8657 PyDoc: quiet output and minor cleanup
Suppress printing unnecessary output when generating docs.
2022-05-23 12:37:28 +10:00
4d509fd6e1 Fix error in sphinx_doc_gen.py when logging
Regression in 45ed325443
2022-05-23 12:37:22 +10:00
c92f137a75 Merge branch 'blender-v3.2-release' 2022-05-23 12:37:08 +10:00
47b0ca85cd Fix float representation for Python API docs
float_as_string(1000000) resulted in 1e+06.0 which isn't valid notation.
2022-05-23 12:35:37 +10:00
341f1e444f Cleanup: formatting 2022-05-22 21:59:46 -04:00
04ed96136b Merge branch 'blender-v3.2-release' 2022-05-22 21:58:45 -04:00
568b692bcf Compositor: Fix Map Range node To/From Max default value
Mistake from rB5ef5a9fc24668aa264fe0558db9c0fb1246aa37f

Fixes T98322
2022-05-22 21:56:32 -04:00
84e55e3dc2 Fix T98320: GPencil Crash with Length and Build Modifiers
The length modifiers creates a NULL strokes and this is not handled by Build modifier.
2022-05-22 21:10:08 +02:00
d095fcd6b4 Cleanup: Fix build error after previous commit
I'm not sure how that happened, sorry for the noise.
2022-05-22 20:26:25 +02:00
e222e19d82 Cleanup: Use const arguments 2022-05-22 20:06:24 +02:00
fff8f969de Cleanup: Remove unused function
Mesh "MFace" is deprecated and shouldn't be used in any new code anyway.
2022-05-22 13:05:12 +02:00
fdb1f70468 Cleanup: fix wrong type
It's a bit surprising that this compiled. That's probably due to the
`GField` constructor, to be investigated!
2022-05-22 12:01:11 +02:00
9d9f2f1a03 GPU subdiv: smoothly interpolate orco layer
This uses the recently introduced evaluator's vertex
data to smoothly interpolate original coordinates instead
of using linear interpolation.

The orcos are interpolated at the same time as positions
and as such, the specific subdivision routine for the
orco extractor has been removed. The patch evaluation
shader uses a definition to enable code specific to
orco evaluation.

Since the orco layer may not have been requested on first
render, and since orco data is now stored in the OpenSubDiv
evaluator, the evaluator needs to be recreated if an
orco layer is suddenly available. For this, a callback
to check if the evaluator has the data was added. This is
added to the evaluator as the `Subdiv` cache stored in the
modifier is invalidated less often than the Mesh batch cache
and so leads to fewer evaluator recreations.

Differential Revision: https://developer.blender.org/D14999
2022-05-22 09:19:55 +02:00
45ed325443 PyDoc: resolve/quiet warnings for pylint
- Duplicate keys in dict.
- Redefining names.
- Unused arguments.
- Use lazy % formatting in logging functions.
2022-05-22 13:31:36 +10:00
84901adec5 PyDoc: cleanup doc-generator
- Full sentences for comments.
- Use double quotes for strings (which aren't enum ID's).
- Reduce right-shift.
2022-05-22 13:08:38 +10:00
dfb8c90324 Cleanup: Remove unused scrollbar drawing flag
Apparently this was used for progressbar drawing, which doesn't share
the code anymore.
2022-05-21 00:53:54 +02:00
0d73113452 UI Code Quality: Resolve frankenstein bit-flag usage for widget drawing
Previously we would pass button state and draw information to widget
draw callbacks in a rather hacky way. Some specific flags from
`uiBut.flag` were masked out, so their bits could be reused for also
passing `uiBut.drawflag` in the same int. Instead this commit introduces
a state-info struct that can properly hold all the relevant data.

This has the advantage that it's now easier to introduce new state data
that needs to be accessible in the widget callbacks. Since we are
running out of button flags, we plan to reorganize button flags, and
split them up into multiple bitfields. In the widget drawing code, this
would have been a hassle earlier.

Also had to add a new widget callback to draw blocks as widgets (popup
backgrounds), since that would pass block flags where we would usually
pass button flags. This wasn't nice, now it's separated more clearly.
2022-05-21 00:53:54 +02:00
029e6b5174 Geometry Nodes: String to Curves rename Max Width
This patch changes the Text Box Width socket to always have that label
instead of switching to "Max Width" when Overflow mode is picked.

Bug report: T97060

Differential Revision: https://developer.blender.org/D14909
2022-05-20 17:11:27 +02:00
bf352df27a Fix wrong USD image color space export with non-default OpenColorIO config
The names of color spaces in OpenColorIO configs can be arbitrary, so don't
use hardcoded names from our default config.
2022-05-20 17:07:37 +02:00
9b082da708 UI: rename Hue/Saturation node to Hue Saturation Value in shaders and textures
This makes it easier to search for and consistent with compositor nodes.

Differential Revision: https://developer.blender.org/D14914
2022-05-20 16:47:11 +02:00
8d65895af8 UI: Get rid of redundant UI_BUT_IMMEDIATE button flag
This flag was used to activate the hotkey input buttons (e.g. for
"Assign Shortcut") when opened in a popup. Since this was added, other
more generalized ways of getting this same behavior were implemented.
Had to tweak the hotkey button event handling a bit, but it seems to
behave exactly as before now.
2022-05-20 16:35:13 +02:00
de561280fc Cleanup: don't use variable name that matches type alias 2022-05-20 16:32:14 +02:00
b215fe82e8 Cleanup: Further simplification of loop syntax for curve segments
The same changes as 019681b984.
2022-05-20 16:00:26 +02:00
f8239cc9a0 Curves: Use only current brush location for delete brush
Currently the delete brush and some other brushes use the line
segment from the current brush position to the previous position
to find curves to interact with. However, this doesn't work well
with more advanced stroke settings that purposefully use
non-contiguous brush sample locations. This commit makes
the delete brush only use the current sample location.

Differential Revision: https://developer.blender.org/D14992
2022-05-20 13:34:30 +02:00
cea37b3127 Curves: Support pressure in sculpt brushes
Multiply the radius and strength of sculpt brushes by the pressure
when "use pressure" is turned on. The brush system isn't responsible
for this, so the pressure needs to be stored in `StrokeExtension`.

Differential Revision: https://developer.blender.org/D14996
2022-05-20 13:33:42 +02:00
a89f829f12 LibOverride: Add option to Hierarchy Creation to get all data user-editable by default.
Avoids having to manually enable data-blocks for user-edition when you
do not care about what should be edited by whom. Similar to default
behavior before introduction of system overrides (aka non-user-editable
overrides).
2022-05-20 12:02:52 +02:00
019681b984 Cleanup: Simplify loop syntax for curve points 2022-05-20 10:56:19 +02:00
47c2a876bf Merge branch 'blender-v3.2-release' 2022-05-20 10:11:09 +02:00
d4cdae29c1 Fix T98266: Crash with empty mesh boolean node
The output mesh can be null. Also reorganize the WITH_GMP
check to avoid compiling the rest of the node with GMP off.
2022-05-20 10:10:46 +02:00
1d65f7ea91 Merge branch 'blender-v3.2-release' 2022-05-20 09:50:54 +02:00
b8bd20d7e0 Fix T96810: Bitmap race condition in PBVH normal calculation
The final normalization step of sculpt normal calculation iterates over
all unique vertices in each node and marks them as done. However,
storing the done mask in a bitmap meant that multiple threads could
write to a single byte at the same time, because the bits for separate
threads could be stored in the same byte. This is not threadsafe

Fixing this issue seems to improve performance as well. First I tested
just clearing the entire bitmap after the normal calculation. Then I
tested using an array of booleans instead, which turned out to be
slightly better, and simplifies code a bit.

I tested on a Ryzen 3800x, on an 8 million polygon subdivided
Suzanne by using the grab brush with a radius large enough to
affect most of the mesh.

| Original  | Clear Entire Bitmap | Boolean Array |
| --------- | ------------------- | ------------- |
| 67.9 ms   | 59.1 ms             | 57.9 ms       |
| 1.0x      | 1.15x               | 1.17x         |

Differential Revision: https://developer.blender.org/D14985
2022-05-20 09:49:29 +02:00
Martijn Versteegh
8e02b0d5d4 Cleanup: make functions for setting clone/stencil layer more consistent
This was missing in rBf1beb3b3f60be45854285935d6bfcedf839b317c.

Differential Revision: https://developer.blender.org/D14991
2022-05-20 09:36:30 +02:00
af7502dd9b Merge branch 'blender-v3.2-release' 2022-05-20 16:46:52 +10:00
d27f4e8493 Fix popup menu memory activating labels when names matched menu items
When labels in popups (typically headings) matched the name of a button,
the label would be activated instead of the button.

This caused the unwrap menu in the UV editor not to re-select "Unwrap"
when opening a second time.
2022-05-20 16:42:35 +10:00
f049591967 Merge branch 'blender-v3.2-release' 2022-05-20 16:11:28 +10:00
f61dd33f50 Merge branch 'blender-v3.2-release' 2022-05-20 16:11:25 +10:00
f68fb81064 Fix T98145: IC keymap can't select & move multiple nodes
Regression from [0] which changed operator properties without
updating this keymap.

[0]: 4c3e91e5f5
2022-05-20 16:07:32 +10:00
838806be28 WM: return the string length from operator name conversion
- In some cases it avoids using strlen on the result.
- Use ATTR_NONNULL for all arguments.
- Remove NULL pointer check for WM_operator_bl_idname src argument.
- Rename from/to to src/dst.
2022-05-20 13:35:28 +10:00
780ad443fd Include __init__.py in bl_console_utils
Failure to include this file caused script_load_modules test to fail.
2022-05-20 12:41:44 +10:00
930e526cae Cleanup: warnings, spelling, formatting
Avoid multiple `sound.bl_rna.properties["channels"].enum_items` in
the same line. Note we might want a way to avoid having to do this.
2022-05-20 11:24:34 +10:00
42a6c226d0 CMake: fix AUDASPACE disabling WITH_PYTHON for Blender
When AUDASPACE couldn't find NUMPY, it would disable WITH_PYTHON for
the rest of Blender. Now setting the value globally is only done for
standalone AUDASPACE builds. Now it's possible to build Blender with
AUDASPACE & PYTHON but without NUMPY.

While this isn't an especially important configuration to support,
having Python mysteriously disabled is a hassle to troubleshoot.

NOTE: extern/audaspace/CMakeLists.txt has become out sync with the
original [0], it seems this is being maintained in our repository.

[0]: https://github.com/neXyon/audaspace/blob/master/CMakeLists.txt
2022-05-20 11:18:49 +10:00
c1dcc64750 CMake: disable WITH_MOD_FLUID when WITH_PYTHON=OFF 2022-05-20 11:17:32 +10:00
74a34d95d6 Cleanup: move 'console' module to 'bl_console_utils.autocomplete'
The name 'console' for a module was too generic, move into a sub-package
of bl_console_utils, so other console utilities can be added
without creating new top-level modules.
2022-05-20 10:00:40 +10:00
a42307eb65 Fix building with OpenEXR on Linux 2022-05-20 10:00:40 +10:00
f600a2aa6d IMBUF: Thumbnails of all EXR files using less RAM
Specialized thumbnailing function to create previews of all EXR image
files, regardless of type, size, or dimensions. Uses less RAM by only
loading a single row of pixels at a time.

See D14663 for more details and examples.

Differential Revision: https://developer.blender.org/D14663

Reviewed by Brecht Van Lommel
2022-05-19 14:55:04 -07:00
1a627d528c Python API: warn that the bgl module is deprecated in the docs
This was already mentioned in the release notes but not the API docs.

Ref T80730
2022-05-19 21:21:28 +02:00
Marcos Perez
89106a695a VSE: Display sound sample rate and channels
Display information about sound media in "Source" category in side panel
similar to movie resolution and framerate.

The specs are stored in the `Sequence` struct, and are extracted at
the moment of struct creation. If the "source file" is changed,
the specs change also.

Reviewed By: ISS

Differential Revision: https://developer.blender.org/D14565
2022-05-19 21:05:23 +02:00
9e9895b055 GPencil: Avoid Automerge with Closed strokes
The algorithm is not designed to be used with Closed strokes (cyclic) and actually the result is arbitrary. In order to avoid this, now the closed strokes never are merged.

Related to T98235

Feedback by: @mendio
2022-05-19 18:05:15 +02:00
65e13cc2d2 Merge branch 'blender-v3.2-release' 2022-05-19 12:23:23 -03:00
bc6965cb98 Fix T98230: Automatic Constraint doesn't work if cursor is not moving
The change was kind of intentional on {rB21e72496a629}.

That commit made mouse movement to "select" the contraint in Auto
Constraint a requirement.

This deduplicated the code a bit, but this requirement is not
comfortable for the first "selection" of the contraint.

So the constraint "selection" is now done in two ways:
- If there is no contraint, the "selection" is done immediately;
- If there is already a constraint, the "selection" is delayed by 1 event to simulate a constraint cancellation if there is no mouse movement.
2022-05-19 12:22:30 -03:00
436a7ee651 Merge branch 'blender-v3.2-release' 2022-05-19 16:54:10 +02:00
2d5b91d6a0 Fix (studio-reported) more possibilities to edit content of linked/override collections.
Existing code for the `Move` operator, and some `Collections` panel
operations (Object properties) was absolutely not override-safe, and
sometimes not even linked-data safe.
2022-05-19 16:51:24 +02:00
eb13072399 Merge branch 'blender-v3.2-release' 2022-05-19 16:22:00 +02:00
f8ebb0e1d5 GPencil: Remove icons in Build modifer mode parameter
The list must not use icons.

Feedback by @pablovazquez
2022-05-19 16:21:25 +02:00
d0fabb318e UI: Expose new tool icon: Selection Paint
This icon will be used by the curves paint select brush.
2022-05-19 15:25:38 +02:00
f5b708d1cf Cleanup: Decrease variable scope 2022-05-19 14:08:54 +02:00
29ca935eb8 Cleanup: Remove redundant function
`BKE_object_get_evaluated_mesh` now looks inside `geometry_set_eval`.
2022-05-19 14:02:16 +02:00
4fc96e5000 Merge branch 'blender-v3.2-release'
Conflicts:
	source/blender/blenkernel/intern/lib_override.c
2022-05-19 12:04:07 +02:00
24745e8d27 Fix liboverride extreme resync times in case of libraries dependency loops.
That max number of `10000` level of recursivity was a typo (should have
been `1000`), but even that is way too high, typical sane situation
should not lead to more than a few tens of levels, so reducing the max
level to 200.

Also improve error message with more context info about the issue.

Found while investigating issues for the Blender Studio's Heist production.
2022-05-19 11:59:58 +02:00
74420d95b3 Revert "Fix liboverride extreme resync times in case of libraries dependency loops."
This reverts commit e42e4e8568.

Wrong commit, sorry for the noise.
2022-05-19 11:51:01 +02:00
e42e4e8568 Fix liboverride extreme resync times in case of libraries dependency loops.
That max number of `10000` level of recursivity was a typo (should have
been `1000`), but even that is way too high, typical sane situation
should not lead to more than a few tens of levels, so reducing the max
level to 200.

Also improve error message with more context info about the issue.

Found while investigating issues for the Blender Studio's Heist production.
2022-05-19 11:47:28 +02:00
c88de1594f Fix T98237: Double free with curve object conversion to mesh
In some cases (when there is an evaluated curve), the conversion code
would try to free the evaluated data-block twice, because freeing the
object would free it from `data_eval` and then the data-block was freed
again explicitly. Now check if the data-block is stored in `data_eval`
before freeing `object.data` manually. This is another area that's made
more complex by the fact that we change the meaning of `object.data`
for evaluated objects. The solution is more complicated than it should
be, but it works whether or not an evaluated mesh or curve exists.
2022-05-19 11:10:17 +02:00
f4cbfaded6 Cleanup: Remove unnecessary indentation 2022-05-19 10:00:12 +02:00
2e06c223cc Fix T73250: Override Library will always return to Object Mode on file opening.
Was an old known annoying issue, since the matching RNA property is
read-only we need a manual handling of this in override applying and
resyncing code.
2022-05-19 09:06:33 +02:00
5d0432a2ea Merge branch 'blender-v3.2-release' 2022-05-19 14:32:59 +10:00
a111aae415 Merge branch 'blender-v3.2-release' 2022-05-19 14:32:54 +10:00
ae11233b65 Merge branch 'blender-v3.2-release' 2022-05-19 14:32:51 +10:00
3ecc03c3d6 Fix T93779: Python is unable to set axis aligned views
It wasn't possible to temporarily orbit the view, then set back to an
axis-aligned view.

Details:

- It was possible to change RegionView3D.view_rotation while the view
  kept the axis alignment value (Top, Left, Front .. etc) which
  displayed in the viewport overlay.

  Now changing the view rotation directly or via "view_matrix" resets
  the axis-alignment - clearing when the view is no longer axis-aligned
  or assigning the newly aligned axis.

- RegionView3D.is_orthographic_side_view added in [0] could be assigned
  but wasn't useful as it treated an enum as a boolean only setting the
  RegionView3D.view to RV3D_VIEW_USER or RV3D_VIEW_FRONT.

  Now enabling this aligns the viewport rotation to it's closest
  axis-aligned orientation setting RegionView3D.view & view_axis_roll
  accordingly. Note that the "orthographic" term is misleading as the
  property only relates to axis-alignment, not to the
  perspective/orthographic setting. We could consider deprecating the
  current naming.

[0]: 63bae864f4
2022-05-19 14:31:22 +10:00
76b6741981 Fix View Roll failure to align the quaternion to the view-axis
View roll checked if the resulting roll was close to a view axis
but didn't write the aligned quaternion back to the final result.
Add ED_view3d_quat_to_axis_view_and_reset_quat since most callers
to ED_view3d_quat_to_axis_view will reset the quaternion when a view
aligned axis is found.
2022-05-19 13:06:45 +10:00
41feaa17f3 Cleanup: suppress 'address' warnings for ./extern/glew
Also add comments noting why some warnings shouldn't be added to
strict-flags.
2022-05-19 11:17:01 +10:00
e9c3af3dd7 Cleanup: always assign return args for SCULPT_paint_image_canvas_get
Asserting the variables weren't NULL raised a warning with GCC 12.1,
instead of suppressing the warning, always assign NULL which is often
expected behavior and makes the function work as documented.
2022-05-19 11:17:01 +10:00
6730c11dd9 Cleanup: quiet deprecated-copy warning with GCC 2022-05-19 11:17:01 +10:00
3e2017491a Cleanup: spelling in comments & move doc-strings to headers 2022-05-19 11:17:01 +10:00
30e666f747 Cleanup: format, reduce line length & strip trailing space 2022-05-19 11:17:01 +10:00
ae2d2c9361 DRW: GPU wrappers: Fix resize routines for StorageArrayBuffer
Resizing was not resizing the `data_` buffer. Also use `power_of_2_max_u`.
2022-05-19 00:35:36 +02:00
b16eff2bb3 EEVEE-Next: Fix error on curve prepass caused by velocity commit 2022-05-19 00:35:36 +02:00
b3e53d6daa EEVEE-Next: Fix display of compiling shader countdown
Also fix naming convention on public variable.
2022-05-19 00:35:36 +02:00
f4028630bf EEVEE-Next: Display error instead of crashing on unsupported hardware
This message will remain in effect until we bump up the minimum
hardware requirement.
2022-05-19 00:35:36 +02:00
769cdccd0e Fix assertion raised in Merge By Distance
Harmless assertion in `r_weld_mesh->wpoly_new[r_weld_mesh->wpoly_new_len++]`
that checks the size even though it has enough space.
2022-05-18 19:06:50 -03:00
22812579bb Cleanup: rename 'WeldPoly' member 'len' to 'loop_len'
This avoids confusion.
2022-05-18 18:46:28 -03:00
7ace6dc496 Fix compilation errors with 'USE_WELD_DEBUG' 2022-05-18 18:40:20 -03:00
89ccff62d2 makesdna: centralize DNA header list.
There's currently 4 places that need to be edited when adding
a DNA header, and as you can imagine, this has gotten out of
sync quite a bit.

source/blender/CMakeLists.txt - 84 headers
source/blender/makesdna/intern/CMakeLists.txt - 33 headers
source/blender/makesdna/intern/makesdna.c@includefiles - 77 headers
source/blender/makesdna/intern/makesdna.c@Disabletypes - 76 headers

This diff makes source/blender/CMakeLists.txt the only place
where we need to keep track of dna headers, less maintenance
less mistakes. For all old places there is now a comment reminding
people of the new location.

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D13048
2022-05-18 15:09:19 -06:00
699944572f EEVEE-Next: Fix memory leak 2022-05-18 23:01:08 +02:00
0fcfc4cc5b EEVEE-Next: Add Velocity module
This module allow tracking of object and geometry data accross time.
This commit adds no user visible changes.

It work in both viewport (*) and render mode, gives correct motion
for any camera projection type and is compatible with displacement (**).

It is a huge improvement upon the old EEVEE velocity which was only used
for motion blur and only available in render.

It is also an improvement for speed as the animated objects do not need to
be rendered a 3rd time. The code is also much cleaner: no GPUVertBuf
duplication, no GPUBatch amendment, no special cases for different geometry
types, no DRWShadingGroup per object, no double buffering of velocity.

The module is still work in progress as the final output may still be
flawed.

(*): Viewport support is already working but there might be some cases where
mapping will fail. For instance if topology changes but not vertex count.

(**): Displacement does not contribute to motion vectors. Surfaces using
displacement will have the same motion vectors as if they were not displaced.
2022-05-18 23:01:08 +02:00
33c5adba62 GPUStorageBuf: Add GPU_storagebuf_copy_sub_from_vertbuf()
This allows using the Graphic API to copy buffer data.
The GPU module do not expose untyped buffers even if that's what most API
do, so the copy function need to be strongly typed.

Contains GL backend implementation.
2022-05-18 23:01:08 +02:00
9631bb1e17 GLShader: Add glsl_shader_defines.glsl to compute shaders 2022-05-18 23:01:08 +02:00
ca780f4406 GL: Fix gl error during debug name setup for shader storage buffers 2022-05-18 23:01:08 +02:00
4fa743af85 GPUSource: Add error message on source not found
Without this, we could have crashes during static compilation of shaders
without knowing where it would come from.
2022-05-18 23:01:08 +02:00
683570c7fe DRW: Wrappers: Use runtime length of the buffer instead of the initial len
This could have produce errors especially in the iterators.
2022-05-18 23:01:08 +02:00
80811c5638 DRW: Replace StorageFlexibleBuffer with explicit get_or_resize()
This is to avoid hiding resize inside the `[]` operator.
2022-05-18 23:01:08 +02:00
790598fa60 Cleanup: BLI_math_base.h: Document power_of_2_max|min() 2022-05-18 23:01:08 +02:00
fe4ae77ded BLI: float4x4: Add == and != operators 2022-05-18 23:01:08 +02:00
c4c6ea7ea9 BLI: float4x4: Add << operator
Use nice formating to have lining up rows.
2022-05-18 23:01:07 +02:00
c34e3f0f19 DRW: Fix DRW_shgroup_buffer_texture naming
We do not need `_ex` suffix.
2022-05-18 23:01:07 +02:00
28316e0810 Cleanup: Move strip handle manipulation to time section 2022-05-18 21:43:14 +02:00
8ca9ce0986 VSE: Remove still frame offsets
To clarify term still frame: This is portion of strip that displays
static image. This area can exist before or after strip movie content.

Still frames were implemented as strip property, but this was never
displayed in panel. Only way to set still frames was to drag strip
handle with mouse or using python API. This would set either
`seq->*still` or `seq->*ofs` where * stands for `start` or `end`.

When strip had offset, it can't have still frames and vice versa, but
this had to be enforced in RNA functions and everywhere in code where
these fields are set directly. Strip can not have negative offset or
negative number of still frames.

This is not very practical approach and still frames can be simply
implemented as applying negative offset. Merging these offsets would
simplify offset calculations for example in D14962 and could make it
easier to also deprecate usage `seq->*disp` and necessity to call
update functions to recalculate strip boundaries.

For users only functional change is ability to set negative strip offset
using property in side panel.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D14976
2022-05-18 21:26:47 +02:00
214e61fc2c Cleanup: fix Cycles asan warning
Not sure why constructing a ustring inside [] is causing issues here, but
it's slightly more efficient to construct it once anyway.
2022-05-18 18:54:57 +02:00
47dbdf8dd5 Merge branch 'blender-v3.2-release' 2022-05-18 17:21:37 +02:00
14a893f20e Fix T98225: file saved with an object in sculptmode that is disabled in viewports crashes on reload
Issue revealed by rB90e12e823ff0. Hidden objects may not be fully
evaluated by the despgraph, do not attempt to restore edit/sculpt/etc.
modes for those.

Should also be backported to 2.93 LTS release.
2022-05-18 17:19:15 +02:00
b712dbe5de Merge branch 'blender-v3.2-release' 2022-05-18 17:03:19 +02:00
c56103356f Fix incorrect track search area election color
It was following the pattern area selection color instead of its own.
2022-05-18 17:03:10 +02:00
2e70af5cd5 Fix T97761: incorrect mixing of integers
Sometimes integers are mixed using float weights. In those cases
the mixed result has to be converted from into float again.
Previously, this was done using a simple cast, which was unexpected
because e.g. 14.999 would be cast to 14 instead of 15.
Now, the values are rounded properly.

This can affect existing files unfortunately without a good option
for versioning. Gladly, very few files seem to depend on the details
of the old behavior.

Differential Revision: https://developer.blender.org/D14892
2022-05-18 17:00:38 +02:00
342e12d6d9 Subdiv: support interpolating orco coordinates in subdivision surfaces
This makes changes to the opensubdiv module to support additional vertex data
besides the vertex position, that is smootly interpolated the same way. This is
different than varying data which is interpolated linearly.

Fixes T96596: wrong generated texture coordinates with GPU subdivision. In that
bug lazy subdivision would not interpolate orcos.

Later on, this implementation can also be used to remove the modifier stack
mechanism where modifiers are evaluated a second time for orcos, which is messy
and inefficient. But that's a more risky change, this is just the part to fix
the bug in 3.2.

Differential Revision: https://developer.blender.org/D14973
2022-05-18 16:45:38 +02:00
f517b3a295 Fix T98157: improve animation fps with better check in depsgraph
Previously, the depsgraph assumed that every node tree might contain
a reference to a video. This resulted noticeable overhead when there
was no video.

Checking whether a node tree contained a video was relatively expensive
to do in the depsgraph. It is cheaper now due to the structure of the new
node tree updater.

This also adds an additional run-time field to `bNodeTree` (there are
quite a few already). We should move those to a separate run-time
struct, but not as part of a bug fix.

Differential Revision: https://developer.blender.org/D14957
2022-05-18 16:42:49 +02:00
708547ab06 Merge branch 'blender-v3.2-release' 2022-05-18 21:48:34 +10:00
136a06285f Fix T88792: WindowManager.clipboard missing in Python API docs
Support RNA types using the Py/C-API PyGetSetDef defined properties.
Currently `WindowManager.clipboard` is the only instance of this.
2022-05-18 21:43:38 +10:00
8fb2a61966 Cleanup: use "filepath" instead of "filename" for full paths, fileops.c
Handle separately as fileops.c had to be tested on multiple platforms.
2022-05-18 20:26:52 +10:00
f937c186de Fix build error on WIN32 from _bpy.context_members
As of [0] which references context arrays from the Python API,
C++ name mangling caused 'node_context_dir' not to be found for WIN32.

[0]: c8edc458d1
2022-05-18 19:40:23 +10:00
3cd3a4abe3 Merge branch 'blender-v3.2-release' 2022-05-18 10:43:17 +02:00
1fcdb1ea28 Fix (unreported) crash in some rare case when making liboverride.
If making liboverride of an empty collection, this (root of override
hierarchy) collection would get untagged in code when checking for
collections that do not need to be overridden, leading to not overriding
this root collection, and later in code to using NULL pointer.
2022-05-18 10:41:01 +02:00
e8e2bdaa86 Cleanup: Naming of private members 2022-05-18 10:25:58 +02:00
c9ae9e1483 Cleanup: suppress dangling-pointer warning for GCC 12.1+ 2022-05-18 18:06:56 +10:00
df8a9648e2 Cleanup: remove redundant sequencer name checks
The `seq->name + 2` check dates back to 2009 [0] but does nothing.

[0]: 6e0c1cd4e5
2022-05-18 17:53:45 +10:00
c536791f36 Cleanup: remove unused variables, redundant assignments 2022-05-18 17:53:45 +10:00
ba2c6c90fa Merge branch 'blender-v3.2-release' 2022-05-18 09:52:53 +02:00
a820ba0d36 Fix T98216: OpenEXR: No difference in file size between ZIP, DWAA, DWAB.
Check in code would not expect major version of OpenEXR > 2.

Investigated by Jesse Yurkovich (@deadpin), thanks!
2022-05-18 09:51:11 +02:00
418184d1c1 Cleanup: 'space between backslash and return' warning. 2022-05-18 09:41:20 +02:00
6f00b1500c LineArt: Use array instead of lists for edges pending occusion query
It turns out there's no practical use for separating different edge types
before final occlusion stage, also using an array should be faster overall.
So changed those lists into one pending array, it also made the
iteration and occlusion task scheduling simpler.

Reviewed By: Sebastian Parborg (zeddb)

Differential Revision: https://developer.blender.org/D14951
2022-05-18 15:34:35 +08:00
9f8254fd34 LineArt: Remove LineartEdge::obindex.
After changing the duplicated edge removal method in D14903,
these two obindex variables are no longer needed.

Reviewed By: Sebastian Parborg (zeddb)

Differential Revision: https://developer.blender.org/D14949
2022-05-18 15:34:35 +08:00
369f652c80 LineArt: Use safe lineart_discard_duplicated_edges
The old method doesn't check e for array boundary.
The new method ensures it only access valid elements.

Reviewed By: Sebastian Parborg (zeddb)

Differential Revision: https://developer.blender.org/D14903
2022-05-18 15:34:35 +08:00
2719869a2a LineArt: Prioritize connecting chains from the same contour loop
This change allows the chaining function to select edges
from the same contour loop first, thus reduced rouge chain
connections (connected different objects instead of chaining
inside the same object first) and improved chaining quality.

This patch also included the default value change for chain
split threshold (Now don't split by default to make initial
result as smooth as possible)

Reviewed By: Sebastian Parborg (zeddb)

Differential Revision: https://developer.blender.org/D14950
2022-05-18 15:34:34 +08:00
c8edc458d1 PyDoc: support building full API docs on macOS & WIN32
Accessing context members depended on `ctypes` to access symbols
which were hidden for macOS & WIN32.

Add an API call that doesn't require the symbols to be exported.

This allows most symbols to be hidden on Linux, see D14971.
2022-05-18 17:06:03 +10:00
88fbe94d70 Merge branch 'blender-v3.2-release' 2022-05-18 15:34:39 +10:00
77f2cb1686 Fix T98192: Crash when apply transforms after deleting an object 2022-05-18 15:33:44 +10:00
5d1cab0c2f Merge branch 'blender-v3.2-release' 2022-05-18 14:42:55 +10:00
d7053ba030 Fix T98191: Alt-LMB for node detach fails with RMB select
Regression caused by [0] which changed node selection to use
PRESS for selection and CLICK_DRAG to transform the selection.

This conflicted with Alt-LMB which would select the node then
pass-though to node.background_sample, preventing the drag event
from being activated.

Resolve by only activating background-sample when the cursor
isn't over a node or socket.

[0]: 4c3e91e5f5
2022-05-18 14:39:48 +10:00
0af772ef8a Merge branch 'blender-v3.2-release' 2022-05-18 12:19:02 +10:00
ffbeb34f5f Cleanup: format 2022-05-18 12:17:42 +10:00
c38187393a Fix T98214: UV selection crash with wire edges
Regression in ffaaa0bcbf
which removed the NULL pointer check.
2022-05-18 12:15:56 +10:00
ebb492a389 Python: log the status of '--python-use-system-env' on initialization
Report when the PYTHONPATH is expected to be used to help debug Python
initialization issues (see T98131).
2022-05-18 11:37:53 +10:00
df26f4f63a Merge branch 'blender-v3.2-release' 2022-05-17 21:23:55 +02:00
35e73aa347 Fix T98021: Crash when using scene strip as sequencer input
Issue was caused by treating such strip as meta and using
`seq->channels` directly, which is not valid for scene strips.

Pointer to channels is now provided by function
`SEQ_get_seqbase_from_sequence`.
2022-05-17 21:22:21 +02:00
Olivier Maury
b48adbc9d7 Fix T97921: Cycles MNEE issue with light path nodes
Ensure the correct total/diffuse/transmission depth is set when evaluating
shaders for MNEE, consistent with regular light shader evaluation.

Differential Revision: https://developer.blender.org/D14902
2022-05-17 21:07:49 +02:00
b3b5d4cabb Merge branch 'blender-v3.2-release' 2022-05-17 17:34:51 +02:00
83349294b1 Fix T98201: Corrution of filepaths in some case during 'make relative' process.
We need to ensure `Main.filepath` is consistent with the current path
where we are saving the .blend file, otherwise some path processing code
can produce invalid results (happens with e.g. the code syncing the two
path storages in Library IDs).
2022-05-17 17:32:23 +02:00
8fdd3aad9b Fix T98163: Cycles OSL rendering normal maps differently
Match SVM and ensure valid reflection when setting up BSDFs.
2022-05-17 16:46:37 +02:00
0609b4bb49 Fix T98052: Eevee / Workbench background render crash with GPU subdivision
The problem is that depsgraph evaluation happens before the OpenGL context
is initialized, and so modifier evaluation happens without GPU subdivision.
Later the BKE_subsurf_modifier_can_do_gpu_subdiv test in the draw code gives
a different result.

This just checks if the mesh has information for GPU subdivision in the draw
code, and if so uses it. This is only set if the test for supported GPU
subdivision passes in the modifier evaluation.

Additionally it may be good to perform OpenGL context initialization earlier
so background render can take advantage of GPU subdivision, but this is more
complicated.

Differential Revision: https://developer.blender.org/D14969
2022-05-17 16:14:15 +02:00
8c9805fc62 Revert "Outliner: Remove the 'Remap data-block usages' operation."
This reverts commit 30534deced.

After discussion and feedback from users, it's better to keep this tool
available until there is time to properly re-think the whole Outliner's
contextual menu.
2022-05-17 16:09:28 +02:00
939c2387a1 Cleanup: blendloader: add logger to writefile.c, remove some asserts.
Properly use CLOG to report info or errors in `writefile.c`, instead of
printf's.

And remove some assert when logging error reports and the issue is not
critical.
2022-05-17 16:06:54 +02:00
b759a3eac0 Cleanup: Remove asserts when logging error messages.
If we produce CLOG_ERROR messages and the error is not actually
critical, there is no point in asserting too.

Mainly related to ID user counts, and a few other ID management areas.
2022-05-17 16:06:54 +02:00
7a31229011 Cleanup: Use BLI_assert_unreachable() as example in comment of _BLI_assert_abort.
Using `BLI_assert(0)` should typically be avoided now that we have
`BLI_assert_unreachable`...
2022-05-17 16:06:54 +02:00
fb2ae6b8c5 Cleanup: Use switch and BLI_assert_unreachable() more.
Replace some `if/else if` chains by proper `switch` statement.

Replace some `BLI_assert(0)` calls by `BLI_assert_unreachable()` ones.
2022-05-17 16:06:54 +02:00
9a4cb7a732 Cleanup: Use switch and BLI_assert_unreachable() more.
Replace some `if/else if` chains by proper `switch` statement.

Replace some `BLI_assert(0)` calls by `BLI_assert_unreachable()` ones.
2022-05-17 16:06:54 +02:00
6d42cd8ff9 Cleanup: Use switch and BLI_assert_unreachable() more.
Replace some `if/else if` chains by proper `switch` statement.

Replace some `BLI_assert(0)` calls by `BLI_assert_unreachable()` ones.
2022-05-17 16:06:54 +02:00
22bf263269 Cleanup: Use switch and BLI_assert_unreachable() more.
Replace some `if/else if` chains by proper `switch` statement.

Replace some `BLI_assert(0)` calls by `BLI_assert_unreachable()` ones.
2022-05-17 16:06:54 +02:00
c6e3242e18 Cleanup: Use switch and BLI_assert_unreachable() more.
Replace some `if/else if` chains by proper `switch` statement.

Replace some `BLI_assert(0)` calls by `BLI_assert_unreachable()` ones.
2022-05-17 16:06:54 +02:00
ff2d6c2ba8 Cleanup: Use switch and BLI_assert_unreachable() more.
Replace some `if/else if` chains by proper `switch` statement.

Replace some `BLI_assert(0)` calls by `BLI_assert_unreachable()` ones.
2022-05-17 16:06:54 +02:00
c8b740cc00 Merge branch 'blender-v3.2-release' 2022-05-17 16:06:27 +02:00
Aleš Jelovčan
dbc439e41a Fix unreported: GPencil Time offset modifier Reverse only plays 2 times
This patch fixes long standing issue of reverse mode only performing loop 2 times and then stops displaying.

Differential revision: https://developer.blender.org/D14921
2022-05-17 15:59:11 +02:00
dbb6016e94 Cleanup: fix compiler warning 2022-05-17 15:36:22 +02:00
200e63b0bf Fix: Copy and paste error in curves RNA
Use a similar solution for meshes for curves symmetry updating.
2022-05-17 14:59:31 +02:00
ed62b65474 Cleanup: Use const in curves sculpt code
This makes it much clearer what data is supposed to be modified
and what data is just used to influence the operation. The new
`BKE_paint_brush_for_read` function isn't great design, but it
can be removed or renamed if similar changes are applied to
more places.

Also pass pointers explicitly to `sample_curves_3d_brush` rather
than reusing the `bContext`. This makes it clearer what data the
function actually needs.

Differential Revision: https://developer.blender.org/D14967
2022-05-17 13:06:14 +02:00
3ad5510427 Cleanup: Order return arguments last 2022-05-17 13:02:41 +02:00
af6765a49c EEVEE-Next: Fix missing break in switch statement 2022-05-17 12:49:00 +02:00
3ccdc362da EEVEE-Next: Add camera module 2022-05-17 12:39:02 +02:00
46114f0a36 DRW: Add DRW_view_camtexco_get() 2022-05-17 12:34:35 +02:00
c7033bdf26 DRWWrapper: Add StorageFlexibleBuffer
This buffer resizes on access.
2022-05-17 12:34:35 +02:00
65fa34f63f DRW: Add SwapChain container to allow easier usage of double buffering
The template also takes the length of the chain to allow triple buffering.
2022-05-17 12:34:35 +02:00
f9ed31b15d Merge branch 'blender-v3.2-release' 2022-05-17 11:31:59 +02:00
4301b6c896 Fix console errors about missing properties in circle select
A regression since 113b8030ce: circle selection operators does not
define properties like deselect_all and a special name callback is to
be used for those.

This is what was already done for circle select in the 3D viewport.
Some other spaces were using the generic pick operator for the circle
selection which causes error prints in the console.
2022-05-17 11:23:04 +02:00
f752eaadbd Remove incorrect poll method from object.instance_offset_from_cursor
Remove poll method from the `OBJECT_OT_instance_offset_from_cursor`
operator. It was checking for `context.active_object`, but not even doing
anything with the active object. It'll get in the way of exposing this
operator in another area of the interface, though.
2022-05-17 11:00:04 +02:00
c582a2dbd9 Merge branch 'blender-v3.2-release' 2022-05-17 18:12:41 +10:00
eddfa811da Preferences: Moved Sculpt texture paint to prototypes.
Sculpt texture paint should not be considered as a new feature just yet. There
are many designs still missing that could drive changes.
2022-05-17 10:12:22 +02:00
bdb5a50682 Update tests to account for Text.as_string not adding a trailing newline
Regression in tests from [0] tests were written to assume a newline was
added to the result of Text.as_string which is no longer the case.

[0]: f4ff36431c
2022-05-17 18:11:16 +10:00
080e506e28 Merge branch 'blender-v3.2-release' 2022-05-17 17:50:50 +10:00
fcc3a68cac Merge branch 'blender-v3.2-release' 2022-05-17 17:50:45 +10:00
a4ed0f51c1 Fix click detection for simulated events
Refactoring event click-drag detection broke click detection for
simulated events. Resolve this by sharing logic for update previous
values in `wmWindow.eventstate` for regular event handling
(no functional changes for non-simulated events). Failure to detect
clicks for simulated events broke the undo test
`test_undo.view3d_multi_mode_select` in `../lib/tests/ui_simulate/run.py`.
All undo tests now pass.
2022-05-17 17:49:40 +10:00
f4ff36431c Fix text.as_string() adding a trailing new-line
Moving Text.as_string() from Python to C [0] added an extra new-line
causing a round-trip from_string/to_string to add a new-line,
this also broke the undo test `test_undo.text_editor_simple` in
`../lib/tests/ui_simulate/run.py`.

[0]: 231eac160e
2022-05-17 17:49:32 +10:00
f11401d32a Cleanup: Deduplicate Alembic procedural bounding box mesh creation
This removes the manual construction of a box mesh in the mesh sequence
cache modifier when the Alembic procedural is enabled. It also removes
the use of `BKE_object_boundbox_get` which doesn't make sense on a
non-evaluated object.

Differential Revision: https://developer.blender.org/D14958
2022-05-17 09:41:32 +02:00
51195c17ac Merge remote-tracking branch 'origin/blender-v3.2-release' 2022-05-17 00:30:54 -07:00
210d0f1b80 Fix T96414: Stencil mapping is incorrect for UDIMs
When texture painting, brush textures and brush texture masks were not
transformed to account for UDIM tiles.

Differential Revision: https://developer.blender.org/D14671
2022-05-17 00:27:23 -07:00
c93f3b4596 Cleanup: spelling in comments 2022-05-17 15:34:02 +10:00
1a740c2541 Fix T98185: Assertion saving while fullscreen
When saving from the menu the region was not set,
causing the last region in `area->regionbase` to be used
as the region was assigned before comparison.
2022-05-17 15:16:54 +10:00
48c4c409b8 Fix DPX/CINEON writing full file paths into image headers on WIN32
Use back-slashes to find the file-name component on windows.
2022-05-17 12:54:05 +10:00
5c9ab3e003 Cleanup: use term 'filepath' for full file paths 2022-05-17 12:54:05 +10:00
77ddcc4717 ImBuf: replace exit(1) with assert when writing IRIS images
In this case memory past the buffer bounds would have been written,
potentially crashing. Replace the check with an assert since this
should never happen.

Also don't call exit as failing to write a file shouldn't exit Blender.
2022-05-17 10:50:21 +10:00
7bbf101082 Cleanup: better doc-string for iris, order args & use const variables 2022-05-17 10:43:40 +10:00
1660eff1a2 Cleanup: format 2022-05-17 10:06:13 +10:00
405d32bc80 Cleanup: compiler warnings 2022-05-17 10:01:30 +10:00
8c4bd02b06 VSE: Delete Strip and Scene Data in one step
Actually, delete the strip only deletes the container, but not the linked data. This patch adds the option to delete the scene also. This is very handy for storyboarding.

Reviewed By: ISS

Maniphest Tasks: T97683

Differential Revision: https://developer.blender.org/D14794
2022-05-16 20:20:44 +02:00
be84fe4ce1 VSE: Add new Scene and Strip
This operator allows to add a new scene at the same time that the strip. This is very handy for storyboarding.

Reviewed By: ISS

Maniphest Tasks: T97678

Differential Revision: https://developer.blender.org/D14790
2022-05-16 19:46:20 +02:00
205c6d8d08 VSE: New Change Scene option in Change menu
This is a new option in `C` key menu.

Reviewed By: mendio, ISS

Maniphest Tasks: T97711

Differential Revision: https://developer.blender.org/D14807
2022-05-16 19:41:50 +02:00
6065fbb543 Fix std::optional value() build error on older macOS SDK
No longer happens on the buildbot, but for users building with an older
Xcode, still need to avoid using value().

Differential Revision: https://developer.blender.org/D14883
2022-05-16 19:08:08 +02:00
4be79da9a7 Merge remote-tracking branch 'origin/blender-v3.2-release' 2022-05-16 18:17:37 +02:00
a2dacefb46 Fix T96289: Crash when accessing mesh via ob.data in a driver
Fix a crash when a driver variable targets an object and uses
`data.shape_keys.key["name"].value` in its expression.

The fix consists of adding an extra relation from the targeted object's
`GEOMETRY` component to the driver evaluation. This ensures that its
`data` pointer has been evaluated by the depsgraph and is safe to
follow.

This also resolves the concern raised on rB56407432a6aa.

Reviewed by: brecht

Differential Revision: https://developer.blender.org/D14956
2022-05-16 18:16:18 +02:00
00af3e9472 Fix: Node editor "Group" panel displays for embedded node trees
Embedded node trees are not groups, since their inputs and outputs
are not exposed anywhere. So these panels should not be displayed.
2022-05-16 17:17:16 +02:00
b8c30fb80a Fix image saving incorrectly overrding non-color data color space
In such cases we should not automatically change the color space.
2022-05-16 17:04:09 +02:00
c729ddd741 LibOverride: Do not write Surface Deform modifier binding data.
Skip writing binding data and similar for override modifiers already
present in reference linked data, as this can use a lot of space, and
is fully useless data typically since we already skip writing Mesh
geometry data itself.

Ref. T97967.
2022-05-16 16:56:27 +02:00
5973950b2a LibOverride: Do not write Laplacian Deform modifier binding data.
Skip writing binding data and similar for override modifiers already
present in reference linked data, as this can use a lot of space, and
is fully useless data typically since we already skip writing Mesh
geometry data itself.

Ref. T97967.
2022-05-16 16:56:27 +02:00
e9d7c05754 LibOverride: Do not write Corrective Smooth modifier binding data.
Skip writing binding data and similar for override modifiers already
present in reference linked data, as this can use a lot of space, and
is fully useless data typically since we already skip writing Mesh
geometry data itself.

Ref. T97967.
2022-05-16 16:56:27 +02:00
b66368f3fd LibOverride: Do not write MeshDeform modifier binding data.
Skip writing binding data and similar for override modifiers already
present in reference linked data, as this can use a lot of space, and
is fully useless data typically since we already skip writing Mesh
geometry data itself.

Ref. T97967.
2022-05-16 16:56:27 +02:00
Bastien Montagne
68d203af0b Refactor modifiers writing code.
This changes is needed to give more control to modifiers' writing
callback when defined. It will allow to implement better culling of
needless data when writing e.g. modifiers from library overrides.

Ref. T97967.

Reviewed By: brecht, JacquesLucke

Differential Revision: https://developer.blender.org/D14939
2022-05-16 16:56:27 +02:00
Martijn Versteegh
f1beb3b3f6 Cleanup: make functions for setting active/render layer more consistent
The active/render layer is indexed from the first layer of that type. These functions
incorrectly subtracted the layer index of *each* layer, instead of the first one.
If there's only a single layer this doesn't matter, but when there are multiple layers
it will set the wrong active layer for consecutive layers.

I'm not aware of any actual errors caused by this, because the active and render layers are
only ever queried from the first layer of that type, but it was confusing during debugging a
related issue. This patch makes the behavior of CustomData_set_layer_active_index()
consistent with CustomData_set_layer_active() and the same for render.

Differential Revision: https://developer.blender.org/D14955
2022-05-16 16:34:25 +02:00
b98175008f Cleanup: Tracking, clarify comment 2022-05-16 15:52:54 +02:00
Jeroen Bakker
00eb7594b1 3D Texturing: Undo.
Blender can only support a single undo system per undo step. As sculpting/vertex colors are mutual exclusive operations
out approach is just to switch the undo system when painting on an image.

PBVHNodes contain a list of areas that needs to be pushed to the undo system.

Currently the undo code is in sculpt_paint_image. We should eventually support undo for color filtering and other nodes.
we might need to place it to its own compile unit so more brushes can invoke the same code.

{F13048942}

Reviewed By: brecht

Maniphest Tasks: T97479

Differential Revision: https://developer.blender.org/D14821
2022-05-16 15:42:54 +02:00
0d80c4a2a6 Merge branch 'blender-v3.2-release' 2022-05-16 15:39:34 +02:00
9bd905e73f GPencil: Refine Tooltip for Noise modifier
Feedback by @HooglyBoogly
2022-05-16 15:38:26 +02:00
9df91654dc Fix T98136: Crash undoing "Make Library Override" in some cases.
The 'OVERRIDE_HIDDEN' extra collection would often be mistakenly added
to a linked collection, which is totally forbidden and guaranteed to
crash on undo/redo.

Reworked the code instantiating that extra collection in a more generic
and hopefully robust way now.
2022-05-16 15:37:07 +02:00
f1c27b383b Merge branch 'blender-v3.2-release' 2022-05-16 15:21:27 +02:00
29a3f43da5 Python API: make Image.save and Image.save_render more consistent with operator
Previously these only supported a subset of what the save operator could do,
for example no multilayer or stereo saving, no proper color management. Now
share code with the image save operator so it's more consistent.
2022-05-16 15:20:23 +02:00
Olivier Maury
48754bc146 Fix T97867: Cycles MNEE blocky artefacts for rough refractive interfaces
Made tangent frame consistent across the surface regardless of the sample,
which was not the case with the previous algorithm. Previously, a tangent
frame would stay consistent for the same sample throughout the walk, but not
from sample to sample for the same triangle. This actually resulted in code
simplification.

Also includes additional fixes:

* Fixed an important bug that manifested itself with multiple lights in the
  scene, where caustics had abnormally low amplitude: The final light pdf did
  not include the light distribution pdf.
* Removed unnecessary orthonormal basis generation function, using cycles'
  native one instead.
* Increased solver max iteration back to 64: It turns out we sometimes need
  these extra iterations in cases where projection back to the surface takes
  many steps. The effective solver iteration count, the most expensive part,
  is actually much less than the raw iteration count.

Differential Revision: https://developer.blender.org/D14931
2022-05-16 15:11:54 +02:00
adf183eeae Fix T98153: bpy.ops.image.save_as not working from Python, after recent changes
Make exec and invoke consistent so they both use operator properties if set.
2022-05-16 13:29:22 +02:00
93bcfd19ba Merge remote-tracking branch 'origin/blender-v3.2-release' 2022-05-16 13:05:57 +02:00
8c24e29338 Fix broken unit test bl_rigging_symmetrize
Fix parameters used in `self.assertAlmostEqual()` call; the code was
passing the error message to the `places` parameter.
2022-05-16 13:03:06 +02:00
cef36f4a95 Cleanup: Remove confirmation poopup from 'make override' 3DView operator.
Inherited from older versions of the code, not needed anymore in most
common cases (like making override from a local empty instantiating a
collection, or if the active object is directly overridable).
2022-05-16 12:24:42 +02:00
717c150eb1 Merge branch 'blender-v3.2-release' 2022-05-16 11:01:01 +02:00
2397287a51 Fix T96503: Assert using PropertyGroup and PointerProperty prop in Panel.
Wrong assert introduced in {rBad63d2f60e24}, added comment in code
explaining why NULL RNA pointer is a valid value to be skipped here.
2022-05-16 10:58:51 +02:00
124aae91e2 Cleanup: shadowing warning 2022-05-16 12:10:38 +10:00
7fc2804f45 Fix: Build error on Windows after recent cleanup 2022-05-15 21:59:10 +02:00
84a7641563 Cleanup: Simplify loop syntax, make function static
Use range based for loops, spans, references, and slice.
Change split from D14685, in order to simplify refactor
to the mesh hide masks.
2022-05-15 20:59:08 +02:00
1c70402c62 Cleanup: Move three mesh editors files to C++
Simplifies refactoring in D14685, allows use of better data structures.
2022-05-15 20:41:11 +02:00
7b091fbb94 Cleanup: Remove includes from DerivedMesh header
Headers should only include other headers when absolutely necessary,
to avoid unnecessary dependencies and increasing compile times.
To make this change simpler, three DerivedMesh functions with a single
use were removed.
2022-05-15 20:27:28 +02:00
024f3ddf61 Cleanup: Clang tidy 2022-05-15 19:33:37 +02:00
ee0c05e886 DRW: Remove accidentaly commited stray global variable 2022-05-15 19:24:10 +02:00
b8de9916ed Fix T98049: crash rendering multilayer EXR with some color spaces 2022-05-15 17:47:20 +02:00
e46a38942a Cleanup: Simplify loop syntax, decrease variable scope
Mostly changes split from D14685, which refactors the hide flags.
2022-05-15 15:41:46 +02:00
3e989e8c8d GPUVertBuf: Add support for binding as buffer texture
This is often needed and somehow cumbersome to set up. This will allow some
code simplifications.
2022-05-15 15:22:47 +02:00
b44cec0eca Cleanup: Remove unused DerivedMesh function 2022-05-15 12:20:13 +02:00
450a190095 Cleanup: Remove unused subsurf ccg functions
This simplifies some refactoring to mesh hide flags (see D14685).
2022-05-15 12:12:14 +02:00
901fc29df1 Cleanup: Fix compile warnings on windows 2022-05-15 11:46:38 +02:00
dcaaa5b6f4 Merge branch 'blender-v3.2-release' 2022-05-15 01:46:42 -07:00
b54abd7ede Fix T80174: Dyntopo not initializing face set values correctly
BMLog was zeroing face sets when creating new faces,
which is not valid.  They're now set to 1.
2022-05-15 01:44:09 -07:00
a46f34d9b3 Merge branch 'blender-v3.2-release' 2022-05-15 00:36:42 -07:00
f9751889df Fix T81715: Unprojected radius mode messes up sculpt texture radius
We really need to fix how unprojected radius (scene unit) works.
What happened is the paint code updates the brush's normal radius
with the current unprojected pixel radius, which was then
used by texture brush tiled mode.

To fix this I just cached the pixel radius at stroke start in
UnifiedPaintSettings->start_pixel_radius.
2022-05-15 00:33:22 -07:00
139a4b6a84 Fix: Build error due to previous commit 2022-05-14 19:46:56 +02:00
ea5bfedb49 Cleanup: Further use of const for retrieved custom data layers
Similar to cf69652618.
2022-05-14 18:57:52 +02:00
e1c8ef551f Cleanup: Use const arguments 2022-05-13 19:20:55 +02:00
c2bbd01b2f Cleanup: Use const arguments 2022-05-13 19:13:43 +02:00
7c9b6cc380 LineArt: Better behavior of smooth tolerance.
This fixes the smooth tolerance feature in master where sometimes you could
get over simplified chains and lose the shape it's supposed to be originally.

Reviewed By: Sebastian Parborg (zeddb)

Differential Revision: https://developer.blender.org/D14929
2022-05-14 00:56:09 +08:00
ee363ee7b3 Cleanup: Use standard variable names for curves 2022-05-13 18:44:09 +02:00
cf69652618 Cleanup: Use const when retrieving custom data layers
Knowing when layers are retrieved for write access will be essential
when adding proper copy-on-write support. This commit makes that
clearer by adding `const` where the retrieved data is not modified.

Ref T95842
2022-05-13 18:35:22 +02:00
fa7224d8ed Merge branch 'blender-v3.2-release' 2022-05-13 18:07:31 +02:00
074c695a0d Fix T98072: Regression: When appending a Scene, the Collections that are excluded get instanced into Current Scene.
This was due to using `BKE_scene_has_object` function, which uses the
cache of bases of the viewlayers, which do not have entries for the
content of excluded collections... Now use
`BKE_collection_has_object_recursive` instead.
2022-05-13 18:05:44 +02:00
870ad7d05d Fix T96781: LineArt proper object iterator.
This patch get rid of the _incorrectly used_ DG iterator in object loading,
and uses scene objects iteration to prevent problems.

Reviewed By: Sebastian Parborg (zeddb)

Differential Revision: https://developer.blender.org/D14907
2022-05-14 00:04:16 +08:00
ca2fb9bae9 Fix possible null-pointer dererence for active button data
The button returned from `UI_region_active_but_get()` is not guaranteed
to have active button data, so code can't rely on that.
2022-05-13 17:56:28 +02:00
8e717ce55a Fix crash when displaying some button tooltips
Steps to reproduce were:
- Factory startup
- Right-click in 3D View
- Move the mouse over "Shade Flat", wait for the tooltip

The changed logic in 4680331749 to lookup an active button was
incorrect. It didn't respect the priority of active button candidates.
2022-05-13 17:56:18 +02:00
Brecht Van Lommel
5baa3ecda6 Color Management: various improvements and fixes for image saving
* Respect the image file color space setitng for saving in various cases where
  it was previously ignored. Previously it would often use the sRGB or Linear
  color space even when not selected.
* For the Save As operator, add a Color Space option in the file browser to
  choose the color space of the file. Previously this was chosen automatically,
  now it's possible to e.g. resave a Linear image as Linear ACES.
* When changing the file format, the colorspace is automatically changed to an
  appropriate color space for the file format. This already happened before, but
  there was no visibility or control in the operator settings for this.
* Don't change color space when using the Save operator to save over the same
  file.
* Fix missing color space conversion for 16 bit PNGs, where it assumed wrongly
  assumed ibuf->rect would be used for saving. Add BKE_image_format_is_byte to
  more accurately test this.

Fixes T74610

Ref T68926

Differential Revision: https://developer.blender.org/D14899
2022-05-13 17:55:54 +02:00
1e4cd98f0a Fix build error without unity build after recent changes
float3 should have been declared within the blender namespace. And forward
declaration is difficult with templated classes so just include header.
2022-05-13 17:55:54 +02:00
8d43ee1b08 Fix T97518: All buttons with eyedropper highlight if one is hovered
Issue is that the operator acts on the active button, and also uses that in the
poll. So the actually active button would affect the poll of a different
button. For the superimposed icons we need to be able to execute these polls
properly for non-active buttons.

This enables temporarily overriding the active button for lookups via context.
While a bit of a hack it makes sense conceptually.

Reviewed By: Campbell Barton

Maniphest Tasks: T97518

Differential Revision: https://developer.blender.org/D14880
2022-05-13 17:55:52 +02:00
7c9c13cf83 Fix possible null-pointer dererence for active button data
The button returned from `UI_region_active_but_get()` is not guaranteed
to have active button data, so code can't rely on that.
2022-05-13 17:54:12 +02:00
908e6c7c4d Fix crash when displaying some button tooltips
Steps to reproduce were:
- Factory startup
- Right-click in 3D View
- Move the mouse over "Shade Flat", wait for the tooltip

The changed logic in 4680331749 to lookup an active button was
incorrect. It didn't respect the priority of active button candidates.
2022-05-13 17:54:12 +02:00
3f952b3ca3 Merge branch 'blender-v3.2-release' 2022-05-13 17:35:18 +02:00
c2d2cd1468 Fix: Incorrect order in geometry nodes add menu 2022-05-13 17:34:11 +02:00
a0748153b4 Tracking: Move all selection logic to operator exec()
Unlikely that users will notice this, but this makes it so that
the operator behaves consistently across its exec() and invoke()
code paths.
2022-05-13 17:21:55 +02:00
a80ad0a545 Refactor: Use coordinate in API for track selection
Currently no functional changes. Prepares for a change which will
allow to more consistently redo the track selection operator.
2022-05-13 17:18:25 +02:00
4680331749 Fix T97518: All buttons with eyedropper highlight if one is hovered
Issue is that the operator acts on the active button, and also uses that in the
poll. So the actually active button would affect the poll of a different
button. For the superimposed icons we need to be able to execute these polls
properly for non-active buttons.

This enables temporarily overriding the active button for lookups via context.
While a bit of a hack it makes sense conceptually.

Reviewed By: Campbell Barton

Maniphest Tasks: T97518

Differential Revision: https://developer.blender.org/D14880
2022-05-13 15:55:11 +02:00
6f3d155293 Merge branch 'blender-v3.2-release' 2022-05-13 23:42:06 +10:00
05b56d55e8 Fix T97386: Node socket labels swallow click/drag events
Regression caused by [0] which made `ui_but_is_interactive` consider
label buttons with tool-tips to be interactive. This prevented
the clicks to pass through to the nodes for selecting/dragging.

Resolve this by allowing buttons to be activated for the purpose
of showing tool-tips but otherwise considering them disabled
(as if the UI_BUT_DISABLED is set when handling events).

[0]: 484a914647

Reviewed By: Severin

Ref D14932
2022-05-13 23:41:03 +10:00
d6c4317f35 Fix jump when switching accurate marker sliding
As a side effect the "sticky" search area on resize/move is also
resolved now: previously attempt to move search area past to where
it could be would make it hard to move it back. Now the search area
will always respond immediately to mouse motion, even after it got
clamped.
2022-05-13 14:12:01 +02:00
7533bee58b Cleanup: Remove dead code in tracking slide operator
The code was there prior pattern area affine transform and was never
used afterwards.

After so long time it should be safe to remove the unused code.
2022-05-13 14:12:01 +02:00
94ad77100c Merge branch 'blender-v3.2-release' 2022-05-13 12:55:24 +02:00
cbc024c3ca MacOS/AMD: Drawing artifacts in VSE.
Related to the partial revert done for T97272. It seems also that the
workaround should be enabled for any MACOS platform.
2022-05-13 12:54:41 +02:00
6e2270f3d3 Merge branch 'blender-v3.2-release' 2022-05-13 12:47:33 +02:00
e30ccb9a34 Fix crash toggling marker translate with marker offset
The shortcut is G-G.

Caused by loop argument "shadowing".
2022-05-13 12:39:40 +02:00
58555ccc7a Cleanup: format (with autopep8 line wrapping applied) 2022-05-13 19:22:52 +10:00
8741cf2038 Cleanup: Proper state check in marker slide operator
The previous code was had confusing logic, but since it was acting
more as a fall-back it did not cause bugs for users.
2022-05-13 10:42:28 +02:00
42d748be34 pyproject: re-enable line wrapping for autopep8
The problem noted in the configuration file no longer occurs,
re-enabling line wrapping (E501).
2022-05-13 18:05:07 +10:00
fa9e878e79 Fix T97330: UV points missing with some modifiers
When extracting UV point indices, only the vertex points coming from the
original geometry should be drawn. For this, the routines (for subdivision
and coarse meshes) would only consider a vertex to be real if the extraction
type is `MAPPED`, and that an origin index layer on the vertices exist
with a valid origin index for the current vertex.

However, if the extraction type is `MESH`, which can happen with for
example an empty Geometry Node modifier, or with deferred subdivision,
this would consider every vertex to not be "real" and therefore hidden from
the UV editor.

This reworks the condition for "realness" to also consider a vertex to be
real if there is no origin layer on the vertices. The check on the extraction
type is removed as it becomes redundant.

This only modifies the check in the UV data extraction for point indices,
however similar checks exist throughout the extraction code, these will
be dealt with separately in master.

Differential Revision: https://developer.blender.org/D14773
2022-05-13 09:26:34 +02:00
0d1b9eabf2 Merge branch 'blender-v3.2-release' 2022-05-13 16:14:29 +10:00
3e5cb7b23e Merge branch 'blender-v3.2-release' 2022-05-13 16:14:26 +10:00
b3938d2a36 Merge branch 'blender-v3.2-release' 2022-05-13 16:14:20 +10:00
113b8030ce Fix T89909: Circle Select tool status bar doesn't match the operations
Assign get_name functions for select picking and circle select
so modifier keys show the result of holding the modifiers.
2022-05-13 16:09:04 +10:00
470cbad51a Fix T97872: Annotation lines lost AA
Since rB2a7a01b339ad, `lineSmooth` has lost its default value of true.

rBa0a99fb25284 only fixed the problem on master.

But thanks to @hitrpr for spotting the bug in version 3.2 too.

Differential Revision: https://developer.blender.org/D14876
2022-05-12 22:22:27 -03:00
427a2c920a Cleanup: spelling in comments, capitalize tags
Also add missing task-ID reference & remove colon after \note as it
doesn't render properly in doxygen.
2022-05-13 09:29:25 +10:00
906b9f55af Cleanup: remove redundant float to byte conversion for stereo image saving
For non-stereo cases this is automatically handled by IMB_saveiff, no reason for
stereo to do this separately.

Ref D14899
2022-05-12 22:58:27 +02:00
c0df1cd1b3 Cleanup: remove redundant code and data copying image save as operator
Store ImageSaveOptions directly in operator custom data instead of copying
to/from a copy on the stack.

Ref D14899
2022-05-12 22:58:27 +02:00
1159b63a07 Cleanup: move image save options init to image_save.cc
The logic here is tightly coupled to the other image saving code.

Ref D14899
2022-05-12 22:58:27 +02:00
6044c6d09b Cleanup: remove unused function declaration 2022-05-12 22:58:27 +02:00
c09cfdb251 DRW: Fix Compilation on OSX
Caused by rBe4bb898e40ee
2022-05-12 22:10:59 +02:00
Jason Fielder
073139e329 Metal: MTLState module implementation.
MTLState module implementation and supporting functionality in MTLContext for state tracking, texture binding and sampler state caching.

Ref T96261

Reviewed By: fclem

Maniphest Tasks: T96261

Differential Revision: https://developer.blender.org/D14827
2022-05-12 20:50:11 +02:00
992ae3f282 DRW: Port draw_shader to C++ 2022-05-12 20:40:23 +02:00
e4bb898e40 DRW: Port draw_hair to C++ 2022-05-12 20:40:23 +02:00
f3f7f8b37b Cleanup: Remove unused gpu_shader_geometry.glsl 2022-05-12 20:40:23 +02:00
17fc8db104 UI: Tweak Sculpting Trim icons
Update the trim icons so they don't show a dashed line. Instead they
have now a continuous red line.

This is important because the sculpting tools are planning to use the
same icons for selection as the regular tools. And those icons use
dashed line to represent selection.

Note the icon file has two new icons which are not used at the moment
(they are in the Unused collection):

* ops.generic.select_paint
* ops.generic.select_line
2022-05-12 18:55:09 +02:00
018acc5688 Build: patch USD to avoid using rdtscp instruction not available on older CPUs
Disable the new more accurate timing code, this is not needed for Blender.
In USD itself this code is disabled on macOS anyway, so it should operate fine
without it.

Ref T97950, T95206

Differential Revision: https://developer.blender.org/D14928
2022-05-12 18:38:51 +02:00
c5b67975cd Cleanup: Fix range loop construct warning 2022-05-12 17:51:03 +02:00
d634194cac Merge branch 'blender-v3.2-release' 2022-05-12 17:45:46 +02:00
2c784f44cf Cleanup: use proper naming in Warp modifier read/write code. 2022-05-12 17:45:16 +02:00
766340856d UI Code Quality: Use derived struct for hot-key buttons
`uiBut` contained a variable that was only used for these hot-key
buttons. This may also help getting rid of the `UI_BUT_IMMEDIATE` flag,
which is also only used for this button type. We are running out of
available bits for flags, so this would be useful.

Continuing the work from 49f088e2d0. Part of T74432.
2022-05-12 17:41:26 +02:00
d1f32b63eb Merge branch 'blender-v3.2-release' 2022-05-12 17:27:18 +02:00
32fd85e6f9 Fix (unreported) bad memory access in read/write code of MeshDeform modifier.
This abuse of one one size value to handle another allocated array of a
different size is bad in itself, but at least now read/write code of
this modifier should not risk invalid memory access anymore.

NOTE: invalid memory access would in practice only happen in case endian
switch would be performed at read time I think (those switches only check
for given length being non-zero, not for a NULL data pointer...).
2022-05-12 17:24:30 +02:00
b24f204e91 Cleanup: Clarify function name and comment logic
This is a bit tricky exceptional case, which originates to an original
motion tracking commit. Took a while to remember what it is ab out so
here is a comment for the future developers.
2022-05-12 17:20:54 +02:00
ccd18691fc Cleanup: Remove another unused hotkey button definition function
See f2c7b56f0f.
2022-05-12 17:05:37 +02:00
f2c7b56f0f Cleanup: Remove unused hotkey button definition function
This isn't used, and I also see any use for it short-term.
2022-05-12 16:56:14 +02:00
3693e1d8e8 Revert commits to increase button flag bitfield size
This reverts the commits 8d9d5da137,
59cd616534 and
98a04ed452.

The commits are causing issues with MSVC, see D14926. I'm working on a
different solution, but that will need some work.
2022-05-12 16:56:14 +02:00
Martijn Versteegh
c31f519954 CMake: Fix missing dependency in bf_editor_curves
curves_ops.cc uses RNA_Prototypes.h. so bf_rna
needs to build before bf_editor_curves.
2022-05-12 08:42:19 -06:00
d9effc1cc6 Fix T98071: Overlay: UV selection inverted bewteen vertex and edge select
Self describing title.

Also remove the layout inside the geometry shader as they are now generated
by the backend.
2022-05-12 15:11:07 +02:00
092cbacd8f Fix T98026 EEVEE: Refression Crash when rendering Cryptomatte passes
This was because the main `surface_vert.glsl` was changed to accomodate the
needs of the `ShaderCreateInfo` but was still used by the cryptomatte
shader. The fix is to include the same libraries as the material shaders
and bypass `attrib_load()`.
2022-05-12 13:58:14 +02:00
65d44093c9 Merge branch 'blender-v3.2-release' 2022-05-12 13:39:17 +02:00
2e8089b6bf Workaround for msvc compiler bug
https://developercommunity.visualstudio.com/t/Alias-template-inside-fold-expression-fa/10040507
2022-05-12 13:38:22 +02:00
dea5d22da1 Cleanup: remove warnings due to maybe-used variables
The variable was only used in some constexpr if-statements.
2022-05-12 13:03:12 +02:00
94a54ab554 Curves: add operator to convert hair particle system to new curves
This creates a new curves object with the name of the particle system.
The generated curves match the current evaluated state of the active hair
particle system.

Attachment information is not transferred currently.

Differential Revision: https://developer.blender.org/D14908
2022-05-12 12:55:50 +02:00
9757b4efb1 OBJ: improve new importer file parsing performance on windows
The OBJ parser was primarily using StringRef for convenience, with
functions like "skip whitespace" or "parse a number" taking an input
stringref, representing an input line, and returning a new stringref,
representing the remainder of the line. This is convenient, but does
more work than strictly needed -- while parsing, only the "beginning"
of the line ever changes by moving forward; the end of the line
always stays the same. We can change the code to take a pair of
pointers (begin of line, end of line) as input, and make the
functions return the new begin of line pointer. This makes the return
value neatly fit into a processor register, which StringRef did not.

On Windows, this does result in non-trivial speedups in the actual
OBJ file parsing part, due to Windows calling convention where return
values larger than 64 bits are returned via memory. Does not
measurably affect performance on Mac/Linux, because the calling
convention there uses a pair of 64-bit registers to return a
StringRef.

End-to-end times of importing several test files, on Windows
(VS2022 build, Ryzen 5950X):

- Monkey subdivided to level 6, no normals (220MB file): 1.25s -> 0.85s
- Rungholt minecraft level (270MB file): 7.0s -> 5.8s
- Blender 3 splash scene (2.4GB file): 49.1s -> 45.5s

The full import process has a lot of other overhead besides actual
OBJ file parsing (mostly creating actual blender objects out of
parsed data). In pure parsing, in the monkey test scene above, the
parsing part goes 1.0s -> 0.6s.

Reviewed By: Howard Trickey
Differential Revision: https://developer.blender.org/D14936
2022-05-12 13:49:05 +03:00
f5077e057b Fix T97380 EEVEE: Weird motion-blur on curves
This was caused by the `mb_data->obmat[]` being wrong because they are
now shared between the particle system and the object.
But Hair need the dupli parent matrix instead of the object matrix.
Disabling `Show Emitter` option fixes the bug.

To avoid this problem, request a different `EEVEE_ObjectMotionData`
for particle systems using a different key pointer in the hash.
This is a bit dirty but there is less code polution using this workaround.

Differential Revision: https://developer.blender.org/D14911
2022-05-12 12:45:56 +02:00
207b0c2a0f Cleanup: De-duplicate region visibility logic in clip editor 2022-05-12 12:40:12 +02:00
dff11551de Merge branch 'blender-v3.2-release' 2022-05-12 20:13:16 +10:00
6f5d172d6c Fix error tagging vertices as loose in the screw modifier
Regression in 90a23dec46.
2022-05-12 20:12:36 +10:00
b04de6d180 Merge branch 'blender-v3.2-release' 2022-05-12 12:00:06 +02:00
77d3e6b439 Curves: Add notifier to update spreadsheet when sculpting 2022-05-12 11:58:11 +02:00
6dcda1b9aa Screw Modifier: avoid unnecessary normal calculation
Normals were being allocated, calculated & freed when the spin modified
merged was enabled.
2022-05-12 19:56:21 +10:00
89306a3a05 Cleanup: Use stronger typing in marker slide operator 2022-05-12 11:37:05 +02:00
87dd8dc740 Cleanup: Hide slide operator specific logic
Use a more semantically clear function in the tracking API.
2022-05-12 11:37:05 +02:00
993d17af90 Cleanup: Reduce indentation level in track slide operator 2022-05-12 11:37:05 +02:00
66dada123c Cleanup: Refactor marker area clamping
Switch from a single function with a lot of branching at its top level
to dedicated function calls with own documentation.
2022-05-12 11:37:05 +02:00
58fe38af9f Cleanup: Remove redundant marker clamping code path
Pattern is expected to be freely resized to any size, and the search
area s to become bigger when needed.

Remove confusing pattern size clamping which was actually clamping
search area.

There should be no functional changes.
2022-05-12 11:37:05 +02:00
a0e63bac02 Cleanup: Strong type for track path clear API
Replace a generic int value with an enum.

Should be no functional changes.
2022-05-12 11:37:05 +02:00
81f23ad57a Cleanup: Move tracking constants to be printable enums
Replace old-style define with an enumerator values. Also move to the
top of the file preparing for making those stronger typed.
2022-05-12 11:37:05 +02:00
ca5f832fe9 Cleanup: More proper sections in tracking code
Follows the code style
2022-05-12 11:37:05 +02:00
0c9892020b Cleanup: More proper sections in subdiv code
Follows the code style.
2022-05-12 11:37:05 +02:00
Ethan Hall
c21cc4dad5 Fix: Paint slot material assignment issues
There are two problems when adding a paint slot to an object without an
existing material. First, the `invoke` method creates a material on the
object. This modifies the object even if the operation is not executed.
Second, the fill color defaults to black when there is no existing
material (even when adding a normal, bump, or displacement layer).

This patch moves the material creation to the `exec` method.
When no material exists on the object, a default Principled BSDF is
referenced for default colors in the `invoke` method.

Differential Revision: https://developer.blender.org/D14828
2022-05-12 11:35:10 +02:00
9599c5415d Merge branch 'blender-v3.2-release' 2022-05-12 11:15:26 +02:00
cb5b33a627 Fix T98056: Screw modifier crash with normal calculation and merging
If merging is enabled, the mesh might be recreated before
the dirty flag can be cleared, which means the normals aren't
valid anymore. To fix this, clearing the dirty flag should happen
before the merging. This is an existing bug, just exposed by
more recent explicit dirty normal tagging.
2022-05-12 11:07:52 +02:00
31202ea628 Merge branch 'blender-v3.2-release' 2022-05-12 01:29:42 -07:00
0eb2244f0a color attributes: Fix broken vertex color node
Fall back onto the old behavior (use the render
color attribute) if the vertex color node's
attribute name is blank.
2022-05-12 01:29:13 -07:00
59637cf073 Merge branch 'blender-v3.2-release' 2022-05-12 17:50:11 +10:00
14175043e5 Merge branch 'blender-v3.2-release' 2022-05-12 17:50:05 +10:00
1242e8b93c Merge branch 'blender-v3.2-release' 2022-05-12 17:49:40 +10:00
295b6e8230 Fix T96367: Crash snapping to instances on an object
In rare cases the mesh has not been evaluated when snapping, this fix
just prevents the crash as is done elsewhere in Blender when the
evaluated mesh isn't available, there is a separate report (T96536)
about evaluation not working properly.
2022-05-12 17:42:43 +10:00
3b0a08b793 Cleanup: format 2022-05-12 14:07:15 +10:00
51fdf4bdfc Cleanup: discarded-qualifier warning, mixing enum/ints 2022-05-12 14:06:35 +10:00
578771ae4d UDIM: Add support for packing inside .blend files
This completes support for tiled texture packing on the Blender / Cycles
side of things.

Most of these changes fall into one of three categories:
- Updating Image handling code to pack/unpack tiled and multi-view images
- Updating Cycles to handle tiled textures through BlenderImageLoader
- Updating OSL to properly handle textures with multiple slots

Differential Revision: https://developer.blender.org/D14395
2022-05-11 20:11:44 -07:00
8d9d5da137 Cleanup (UI): Make space for more internal button flags
Having to manually increase all other flag values to be able to add a
new internal flag is quite annoying. Just make space for a few more
once.
Generally I'd say internal flags are preferable, since it increases
encapsulation. So good to avoid making this a hassle.
2022-05-11 18:29:20 +02:00
Loren Osborn
502e1a44b9 Cleanup: fix compiler warnings on macOS
Differential Revision: https://developer.blender.org/D14917
2022-05-11 18:03:26 +02:00
3e782bba71 Cleanup: Cycles, avoid 'parameter unused' warning
Avoid 'parameter unused' warning when building Cycles without
OpenImageDenoise.

No functional changes.

Over-the-shoulder reviewed by @sergey
2022-05-11 18:00:49 +02:00
007184bcf2 Enable inlining on Apple Silicon. Use new process-wide ShaderCache in order to safely re-enable binary archives
This patch is the same as D14763, but with a fix for unit test failures caused by ShaderCache fetch logic not working in the non-MetalRT case:

```
diff --git a/intern/cycles/device/metal/kernel.mm b/intern/cycles/device/metal/kernel.mm
index ad268ae7057..6aa1a56056e 100644
--- a/intern/cycles/device/metal/kernel.mm
+++ b/intern/cycles/device/metal/kernel.mm
@@ -203,9 +203,12 @@ bool kernel_has_intersection(DeviceKernel device_kernel)

   /* metalrt options */
   request.pipeline->use_metalrt = device->use_metalrt;
-  request.pipeline->metalrt_hair = device->kernel_features & KERNEL_FEATURE_HAIR;
-  request.pipeline->metalrt_hair_thick = device->kernel_features & KERNEL_FEATURE_HAIR_THICK;
-  request.pipeline->metalrt_pointcloud = device->kernel_features & KERNEL_FEATURE_POINTCLOUD;
+  request.pipeline->metalrt_hair = device->use_metalrt &&
+                                   (device->kernel_features & KERNEL_FEATURE_HAIR);
+  request.pipeline->metalrt_hair_thick = device->use_metalrt &&
+                                         (device->kernel_features & KERNEL_FEATURE_HAIR_THICK);
+  request.pipeline->metalrt_pointcloud = device->use_metalrt &&
+                                         (device->kernel_features & KERNEL_FEATURE_POINTCLOUD);

   {
     thread_scoped_lock lock(cache_mutex);
@@ -225,9 +228,9 @@ bool kernel_has_intersection(DeviceKernel device_kernel)

   /* metalrt options */
   bool use_metalrt = device->use_metalrt;
-  bool metalrt_hair = device->kernel_features & KERNEL_FEATURE_HAIR;
-  bool metalrt_hair_thick = device->kernel_features & KERNEL_FEATURE_HAIR_THICK;
-  bool metalrt_pointcloud = device->kernel_features & KERNEL_FEATURE_POINTCLOUD;
+  bool metalrt_hair = use_metalrt && (device->kernel_features & KERNEL_FEATURE_HAIR);
+  bool metalrt_hair_thick = use_metalrt && (device->kernel_features & KERNEL_FEATURE_HAIR_THICK);
+  bool metalrt_pointcloud = use_metalrt && (device->kernel_features & KERNEL_FEATURE_POINTCLOUD);

   MetalKernelPipeline *best_pipeline = nullptr;
   for (auto &pipeline : collection) {

```

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D14923
2022-05-11 16:20:59 +01:00
59cd616534 UI: Update rest of UI code for increased button flag bitfield
Needed after 98a04ed452.
2022-05-11 17:07:02 +02:00
8d528241a9 Merge remote-tracking branch 'origin/blender-v3.2-release' 2022-05-11 16:53:29 +02:00
2001ee6251 Fix T95710: Make Single User > Object Data Animation broken
The operator now not only checks `ob->data` for Actions to duplicate,
but also passes `ob->data` to the duplication function (instead of `ob`).
2022-05-11 16:52:43 +02:00
fa114cc4a0 Merge branch 'blender-v3.2-release' 2022-05-11 16:49:37 +02:00
06a7afb528 Fix T97947: USD will fail to export without file extension
Now add a default ".usdc" file extension if no (or the wrong) extension
is given instead of presenting the user with the error that "no suitable
USD plugin to write is found".

This is in line with how other exporters do this.

Maniphest Tasks: T97947

Differential Revision: https://developer.blender.org/D14895
2022-05-11 16:45:20 +02:00
a4382badb9 Curves: Adjust sculpt mode UI layouts
This patch adjusts the UI layouts for the tool header and the tool
properties in sculpt mode in a few ways. The goals are to better group
related settings, keep fundamental settings easily accessible, fix the
availability of some options, and make better use of space.

1. Remove ID template in tool header
2. Rename "Add Amount" to "Count" for add brush
3. Add "use pressure" toggles to radius and strength sliders
4. Move strength falloff to a popover
5. Move many "Add" brush settings to popover called "Curve Shape"
6. Move two "Grow/Shrink" options to a popover called "Scaling"
7. Don't display "Falloff" panel in properties when it has no effect

See the differential revision for screenshots and more reasoning.

Differential Revision: https://developer.blender.org/D14922
2022-05-11 15:47:49 +02:00
6599d2f03b Fix: Crash with empty curves add interpolate points
The neighbors for an added curve can be empty.
In that case use the constant value instead of interpolating.
2022-05-11 15:40:49 +02:00
e354ba701a Fix T97330: GPU Subdiv compiler error.
GLSL has different max number of ssbo per glsl stage.
This patch checks if the number of compute ssbo blocks matches
our requirements for the GPU Subdiv, before enabling it.

Some platforms allow more ssbo bindings then blocks per stage.
2022-05-11 15:29:52 +02:00
3eb3d363e1 Fix: Build error on windows.
Issue introduced by rBeef98e66cf9e

BLI_math_rotation.h uses M_PI which
gets defined inside BLI_math_base.h
2022-05-11 07:28:48 -06:00
edd892166d Fix T97330: GPU Subdiv compiler error.
GLSL has different max number of ssbo per glsl stage.
This patch checks if the number of compute ssbo blocks matches
our requirements for the GPU Subdiv, before enabling it.

Some platforms allow more ssbo bindings then blocks per stage.
2022-05-11 15:22:01 +02:00
007e95c259 Merge branch 'blender-v3.2-release' 2022-05-11 15:15:45 +02:00
a3f9862262 Fix (unreported) crash in Outliner Overrides Properties view in invalid cases.
We cannot try to get RNA info when the rna path of an override property
is invalid.
2022-05-11 15:14:44 +02:00
87978ff560 Cleanup: rename BLI_str_format_attribute_domain_size
This is useful without any functionality specific to attribute domains,
rename to `BLI_str_format_decimal_unit` to follow naming of a similar
function `BLI_str_format_byte_unit`.
2022-05-11 22:53:02 +10:00
fbf92f5967 Merge branch 'blender-v3.2-release' 2022-05-11 14:03:44 +02:00
b9d02b9ced Fix T97895: Eevee support for Geometry Nodes Color Attributes.
Geometry nodes can generate color attributes that aren't on point or corner domain.
When not found in these domains it will be processed as a common attribute.
2022-05-11 14:01:47 +02:00
Pablo Vazquez
eef98e66cf Mesh: Add Auto Smooth option to Shade Smooth operator
Add a property to the **Shade Smooth** operator to quickly enable the Mesh `use_auto_smooth` option.

The `Angle` property is exposed in the **Adjust Last Operation** panel to make it easy to tweak on multiple objects without having to go to the Properties editor.

The operator is exposed in the `Object` menu and `Object Context Menu`.

=== Demo ===

{F13066173, size=full}

Regarding the implementation, there are multiple ways to go about this (like making a whole new operator altogether), but I think a property is the cleanest/simplest.

I imagine there are simpler ways to achieve this without duplicating the `use_auto_smooth` property in the operator itself (getting it from the Mesh props?), but I couldn't find other operators doing something similar.

Reviewed By: #modeling, mont29

Differential Revision: https://developer.blender.org/D14894
2022-05-11 13:21:59 +02:00
6bd270f3af Fix "Open Clip" operator in Clip Editor broken
Steps to reproduce were:
- Open Clip Editor
- Call "Open Clip" (e.g. Alt+O)
- Select video file

The file wouldn't be loaded into the Clip Editor.

Caused by 7849b56c3c.
2022-05-11 13:18:45 +02:00
8c233cfd78 Merge branch 'blender-v3.2-release' 2022-05-11 20:58:59 +10:00
5045968f24 Revert "Gizmo: optimize intersection tests, fix selection bias"
Manually revert commit [0] as it caused problems macOS (reported T96435).

- Includes fixes from [1] & [2].
- T98037 TODO has been created to keep track of this feature.

Thanks to @jbakker & @sergey for investigating this issue as I wasn't
able to reproduce the bug.

[0]: 0cb5eae9d0
[1]: cb986446e2
[2]: cc8fe1a1cb
2022-05-11 20:55:10 +10:00
61202f6f74 Merge branch 'blender-v3.2-release' 2022-05-11 12:48:23 +02:00
49173399f3 Fix T97173: Color Attributes shading turns black after switching mode.
Sculpt colors tagged the custom data as already created (cd_used), but
should have been tagged as being requested (cd_needed).
2022-05-11 12:44:04 +02:00
b765ea52af Cleanup: Use single quotes for Python enum string 2022-05-11 12:12:11 +02:00
2f799f893e Fix: Hide empty panel in curves sculpt mode tool settings
This panel is empty after rB5b24291be1e0
2022-05-11 12:10:40 +02:00
74a5fb734a Fix: Spline parameter node broken for Catmull Rom curves
Subtracting one from the evaluated index could make the index -1.
That was only necessary for Bezier curves due to the specifics of
the "bezier_evaluated_offsets".
2022-05-11 11:33:52 +02:00
30534deced Outliner: Remove the 'Remap data-block usages' operation.
This feature is very advanced, and the way it was exposed in the
Outliner was very confusing at best.

It remains available through the Python API (`ID.user_remap`) e.g.
2022-05-11 11:25:02 +02:00
2d9a6e4f68 Outliner: Remove 'rename library' feature.
This was historically the only way to change/fix paths of library files
in Blender. However, only changing the path then required a manual
reload of the library, which could be skipped by user, or a save/reload
of the working .blend file, which could lead to corruption of advanced
library usages like overrides.

Prefferred, modern way to change path of a library is to use the
Relocate operation instead. Direct path modification remains possible
through RNA (python console or the Data API view in the Outliner.
2022-05-11 11:25:02 +02:00
be9800e8da Update Ceres to latest upstream version 2.1.0
This release deprecated the Parameterization API and the new Manifolds
API is to be used instead. This is what was done in the Libmv as part
of this change.

Additionally, remove the bundling scripts. Nowadays those are only
leading to a duplicated work to maintain.

No measurable changes on user side is expected.
2022-05-11 09:33:45 +02:00
b30cb05c14 Cleanup: spelling in comments/strings
D14918 from @linux_dr with some other changes included.
2022-05-11 17:02:06 +10:00
Jun Mizutani
195986a719 Fix: Curves interpolate point count option missing from panels
Added in 8852191b77

Differential Revision: https://developer.blender.org/D14919
2022-05-11 08:56:26 +02:00
8650c2b614 Merge branch 'blender-v3.2-release' 2022-05-11 16:34:39 +10:00
82a70ffe40 Merge branch 'blender-v3.2-release' 2022-05-11 16:34:37 +10:00
c0546ff953 Merge branch 'blender-v3.2-release' 2022-05-11 16:34:33 +10:00
0c5a7ca117 Merge branch 'blender-v3.2-release' 2022-05-11 16:34:31 +10:00
ec53e9fa69 Merge branch 'blender-v3.2-release' 2022-05-11 16:34:28 +10:00
ae683a22c6 Merge branch 'blender-v3.2-release' 2022-05-11 16:34:25 +10:00
87d74d03bf Merge branch 'blender-v3.2-release' 2022-05-11 16:34:22 +10:00
8e476c414c Merge branch 'blender-v3.2-release' 2022-05-11 16:34:17 +10:00
690ecaae20 Fix T97153: Knife project crashes
Knife projection BVH-tree lookup could use invalid indices since the
mesh being cut is also used for BVH intersection tests.

Solve by storing triangle indices when knife project is used so a
triangle index can always be used to look up original coordinates of a
triangle.
2022-05-11 16:28:37 +10:00
067f0d40ae Fix knife tool use-after free on completion
Regression in [0] accessed knife data after it had been freed.

[0]: f87029f7b1
2022-05-11 16:28:37 +10:00
a652568570 Cleanup: use 'num' / 'size' suffix instead of 'sz'
GPU code used `sz` as an abbreviation for size, as well as a few other
places. Use size where this represents a size in bytes, see: T85728.
2022-05-11 13:40:09 +10:00
2fa2612b06 Cleanup: use '_num' / '_count' suffix instead of '_ct'
Use num & count (for counters), in drawing code, see: T85728.
2022-05-11 13:38:00 +10:00
42e275a7d4 Cleanup: use '_num' suffix, mostly for curves & spline code
Replace tot/amount & size with num, in keeping with T85728.
2022-05-11 13:38:00 +10:00
8f1a11c35a WM: clear wmEvent.flag for file-select events
Harmless but could cause file-select events to have WM_EVENT_IS_REPEAT
set which logged a warning as this is only intended for keyboard events.
2022-05-11 11:02:01 +10:00
17ab0342ac Cleanup: spelling in comments
Revert change from [0] that assumed UNORM was a mis-spelling of UNIFORM.

[0]: 2c75857f9f
2022-05-11 11:02:01 +10:00
0091c97b32 Cleanup: use '_num' suffix instead of '_size' for CurveGeometry
Follow conventions from T85728.
2022-05-11 11:02:01 +10:00
f9e0b94c2f Cleanup: format 2022-05-11 11:02:01 +10:00
baf8ec2e54 Cleanup: use doxy sections for node_edit.cc 2022-05-11 11:02:01 +10:00
046b45749c Fix cursor snap not acting on selected UVs
Regression in rBd2271cf939.
2022-05-10 21:22:16 -03:00
1bb7fda600 CMake: Fix noisy PUGIXML warning.
When doing a lite build, a warning is displayed
that due to PUGIXML being off WITH_CYCLES_OSL
is being disabled as well.

If WITH_CYCLES is off this is just useless
noise.

this diff changes the warning to only emit when
WITH_CYCLES is on.
2022-05-10 16:38:20 -06:00
b47c5505aa Fix T96892 Overlay: Hiding all of a mesh in edit mode causes visual glitch
This is caused by the geometry shader used by the edit mode line drawing.
If the drawcall uses indexed drawing and if the index buffer only contains
restart indices, it seems the result is 1 glitchy invocation of the
geometry shader.

Workaround by tagging these special case index buffers and bypassing
their drawcall.
2022-05-10 23:36:16 +02:00
74228e2cd2 Fix T97945: Cycles baking max distance is wrong
It was effectively sqrt(max_distance) before this fix.

Thanks to Omar Emara for identifying the solution.
2022-05-10 20:55:03 +02:00
81b797af66 Fix T97908: Cycles missing motion from on pointcloud generated by geometry nodes
Assume geometry is always potentially animated, since we can't use our heuristic
to detect if the object is potentially animated by looking at modifiers on the
object.

The main original reason for this check was to avoid evaluating subdivision
surfaces for many static objects, which is not happening here anyway.
2022-05-10 20:45:30 +02:00
28240f78ce UI: Geometry Nodes Icon
Geometry Nodes (new) icon. So far we were using the generic node-tree
icon for geometry nodes, not anymore.

The new icon is composed of 4 spheres that is a reference to the
original pebbles demo. Scattering points was also the turning point for
the project (which originally was focusing on dynamic effects), and to
this day is one of the first steps for everything procedural such as
hair.

Note that the modifier icon is still showing as white in the outliner.
The alternative is to be blue everywhere.

Patch review and feedback by Hans Goudey.

Icon creation in collaboration with Pablo Vazquez.
2022-05-10 19:33:49 +02:00
Mikhail Matrosov
dcce4a59a0 Fix T97966: Cycles shadow terminator offset wrong for scaled object instances
Differential Revision: https://developer.blender.org/D14893
2022-05-10 18:53:14 +02:00
Olivier Maury
dc55e095e6 Fix T97056: Cycles MNEE not working with glass and pure refraction BSDFs
Differential Revision: https://developer.blender.org/D14901
2022-05-10 18:51:02 +02:00
c171c99fa1 Fix part of T97895: Cycles not rendering edge domain attributes
These aren't really ideal for rendering, but better to show something. Edge
values are averaged at vertices.
2022-05-10 18:29:00 +02:00
8852191b77 Curves: Interpolate point count in add brush
This commit adds an option to interpolate the number of control points
in new curves based on the count in neighboring existing curves. The
idea is to provide a more automatic default than manually controlling
the number of points in a curve, so users don't have to think about
the resolution quite as much.

Internally, some utilities for creating new curves are extracted to a
new header file. These can be used for the various nodes and operators
that create new curves.

The top-bar UI will be adjusted in a separate patch, probably moving
all of the settings that affect the size and shape of the new curves
into a popover.

Differential Revision: https://developer.blender.org/D14877
2022-05-10 18:28:02 +02:00
6f7959f55f Merge branch 'blender-v3.2-release' 2022-05-10 19:12:02 +03:00
3bc037a7eb Fix T96399: New 3.1 OBJ exporter is missing Path Mode setting
New OBJ exporter is missing "Path Mode" setting for exporting .mtl
files. The options that used to be available were: Auto, Absolute,
Relative, Match, Strip Path, Copy. All of them are important. The new
behavior (without any UI option to control it) curiously does not match
any of the previous setting. New behavior is like "Relative, but to the
source blender file, and not the destination export file".

Most of the previous logic was only present in Python based code
(bpy_extras.io_utils.path_reference and friends). The bulk of this
commit is porting that to C++.

Reviewed By: Howard Trickey
Differential Revision: https://developer.blender.org/D14906
2022-05-10 18:58:10 +03:00
9c2613d1b6 Merge branch 'blender-v3.2-release' 2022-05-10 17:57:41 +02:00
1dd1772419 LibOverride: Fix memory leak in resyncing code. 2022-05-10 17:43:01 +02:00
0134ab4b56 LibOverride: Fix bad ID getting hierarchy root updated.
Followup to rB6c679aca1770c37.
2022-05-10 17:42:00 +02:00
6c679aca17 LibOverride: Make process checking validity of hierarchy roots more robust.
Code was not really designed to hanlde corrupted (e.g. local ID) root
hierarchies, now it should handle better those invalid cases and restore
proper sane situation as best as possible.

Fixes crashes with some corrupted files from Blender studio.
2022-05-10 17:32:31 +02:00
cd349dc402 LineArt: Use thread safe bound box.
The old method is not thread safe, which will lead to minor
memory leaks. This patch fixed that.

Reviewed By: Sebastian Parborg (zeddb)

Differential Revision: https://developer.blender.org/D14904
2022-05-10 22:01:07 +08:00
c60b570841 Remove debug code enabled in previous commit. 2022-05-10 15:54:59 +02:00
d9d81cb1ff 3d texture painting: Use center uv pixel as anchor.
Previously the bottom left of a pixel was used during pixel extraction what resulted in
that the pixels were moved a bit to the bottom left. By using the center uv pixel the
extracted pixels are more balanced and would improve future features like seam bleeding.
2022-05-10 15:52:28 +02:00
b4b85c5ce2 Merge branch 'blender-v3.2-release' 2022-05-10 23:04:37 +10:00
de71cdb35d Merge branch 'blender-v3.2-release' 2022-05-10 23:04:26 +10:00
4c3e91e5f5 Fix T96520 Node editor: Tweak fails with unselected nodes
Use the same method for node selection and dragging that is used
in the 3D viewport and UV editor. Instead of relying on a modal
operator - use the keymap to handle click/drag events.

Details:

Failure to transform unselected nodes was caused by [0] & [1] however
detecting drag relied on specific behavior which I don't think we should
be depending on.

This error happened when selection was defined both in the key-map for
the tool and for the node-editor.

- The left mouse button would activate selection in both the tool
  and "Node Editor" keymap.

- The first selection would return `FINISHED | PASS_THROUGH` when
  selecting a previously unselected node.

- The same PRESS would trigger a second selection would return
  `RUNNING_MODAL | PASS_THROUGH`,
  (starting a NODE_OT_select as a modal operator).

  - In 3.1 (with tweak events) the modal operator would then exit and
    fall-back to the tweak event which would transform the selected
    nodes.

  - In 3.2 (as of [0]) the PRESS that starts the modal operator is
    considered "handled" and prevents drag event from being detected.

The correct behavior in this case isn't obvious:
If a modal operator starts on pressing a button, using that same the
release to generate drag/click events is disputable.

Even in the case or 3.1 it was inconsistent as tweak events were
generated but click events weren't.

Note: after investigating this bug it turns out a similar issue already
existed in 2.91 and all releases afterwards. While the bug is more
obscure, it's also caused by the tweak event being interrupted as
described here, this commit resolves T81824 as well.

[0]: 4d0f846b93
[1]: 4986f71848

Reviewed By: Severin

Ref D14499
2022-05-10 23:01:56 +10:00
9173dd24ad Fix for crash opening the file selector multiple times
This is part of a fix for T88570, where the file selector would crash
when activated multiple times.

Calling save multiple times would free the operator, leaving a dangling
pointer which was used when panels were visible that accessed the
"active_operator".

Reviewed By: Severin

Ref D14905
2022-05-10 22:56:22 +10:00
502c3d6c21 Cleanup: remove non-existent include
guardedalloc was already included.
2022-05-10 22:56:03 +10:00
15021968c1 DrawManager: Hide lock acquire behind experimental feature.
The acquire locking of the draw manager introduced other issues.
The current implementation was a hacky solution as we know that the
final solution is something totally different {T98016}.

Related issues:
* {T97988}
* {T97600}
2022-05-10 14:31:20 +02:00
b38cd1bcbe Fix: Missing curves type count cache update in add brush 2022-05-10 14:27:36 +02:00
4ffeb2d449 DrawManager: Hide lock acquire behind experimental feature.
The acquire locking of the draw manager introduced other issues.
The current implementation was a hacky solution as we know that the
final solution is something totally different {T98016}.

Related issues:
* {T97988}
* {T97600}
2022-05-10 14:01:02 +02:00
3893ba5d67 Merge branch 'blender-v3.2-release' 2022-05-10 13:09:12 +02:00
7849b56c3c Fix T88570: Crash when saving after pressing ctrl+S twice.
Existing code to replace the file operation was failing when done from
the window for the file operation itself.

Basically, this patch does two things:
- Implement a well defined window context to use as the "owner" or
  "root" of the File Browser. This will be used for managing the File
  Browser and to execute the file operation, even after the File Browser
  was closed.
- Ensure the context is valid when dealing with file File Browser event
  handlers.

Previously the window context just wasn't well defined and just happened
to work well enough in most cases. Addressing this may unveil further
issues, see T88570#1355740.

Differential Revision: https://developer.blender.org/D13441

Reviewed by: Campbell Barton
2022-05-10 12:36:43 +02:00
061995775f Fix T95298 ImageEditor: Multi-view images fail to display properly
This was because the shader had wrong output slot order.

This also add a note about why the order is reversed compared to the
texture binding.
2022-05-10 12:33:18 +02:00
a74a267767 Cleanup: Move mesh primitive cube to the geometry module
This allows easy reuse elsewhere in Blender.
2022-05-10 10:21:42 +02:00
77c0e79805 Merge branch 'blender-v3.2-release' 2022-05-10 10:01:10 +02:00
2a2e47b20c Curves: Add disabled message for add empty hair operator
Ref 2ba081f59b
2022-05-10 09:41:04 +02:00
439f86ac89 Fix T97272: Lag when resizing viewports.
Viewports where cleared explicitly due to compatibility reasons with Intel iGPUs.
This slowed down other platforms as well, this wasn't noticeable on all platforms.

This patch will be more selective when to enable the workaround.
Currently only for iGPUs on Mac + Linux.
2022-05-10 08:48:51 +02:00
08a39d32a9 Merge branch 'blender-v3.2-release' 2022-05-10 08:30:56 +02:00
11aa237858 Eevee: Fix GLSL compilation error.
Introduced by {35594f4b92fa4cbb5b848f447b7a3323e572b676}.
Some platforms do not support temp variables to be used as inout parameter.

Detected on Mac with Intel iGPU.
2022-05-10 08:30:21 +02:00
bc256a4507 Fix T50398: Constrain to Image Bounds failed with 2D cursor pivot
Use more robust logic for "Constrain to Image Bounds" when scaling UVs.

Reviewed By: campbellbarton

Ref D14882
2022-05-10 14:42:08 +10:00
501ec81d3e Merge branch 'blender-v3.2-release' 2022-05-09 19:52:27 -07:00
Ramil Roosileht
4bb90b8f4c D14887: Fix artifacts in hue filter
The hue color filter now wraps correctly.  Fixes T97768.

Reviewed By: Julien Kaspar & Joseph Eagar
Differential Revision: https://developer.blender.org/D14887
Ref D14887
2022-05-09 19:46:22 -07:00
ccb4e29873 Merge branch 'blender-v3.2-release' 2022-05-10 11:16:27 +10:00
e7464dffbc Merge branch 'blender-v3.2-release' 2022-05-10 11:16:23 +10:00
1c1e842879 Fix T86358: Use per face aspect correction for primitive UV projections
During UV unwrapping, Cube Projection, Sphere Projection, Cylinder
Projection and Project From View (in the 3D Viewport), when "Correct
Aspect" toggle is active, it now uses a query cache to perform a
per-face aspect ratio ("per_face_aspect") correction for the active
image of each face.

Reviewed By: campbellbarton

Ref D14852
2022-05-10 11:14:59 +10:00
a4c2060b91 Fix T97545 GPU: Crash caused by uncommented quote char in source string
Some drivers completely forbid quote characters even in unused
preprocessor directives.

This patch adds a debug build check for all `.glsl` files that need to
be manually handled. For shared headers with `#include` directives, we
need to do runtime patching of the source to remove the quote.

Also fix an instance of the quotes check failing in `eevee_next`.
2022-05-10 00:47:44 +02:00
b468255453 Cleanup: Return early 2022-05-09 23:59:28 +02:00
b6b94f878f Merge branch 'blender-v3.2-release' 2022-05-09 23:52:44 +02:00
7301547ca7 EEVEE: Fix missing CLOSURE_DEFAULT 2022-05-09 23:52:31 +02:00
35594f4b92 Fix T97985 EEVEE: Shader mixing not working correctly when reusing shader nodes
This was caused by the `Closure` members being added to the final contribution
more than once. The workaround is to clear the members once a closure has
been added to the final contribution. I used `inout` on `Closure` inputs
so that the render engine implementation of mix and add closure nodes
can do its own thing. The nodegraph handling of inout was changed for this
to work.
2022-05-09 23:52:31 +02:00
10865c8f34 Deps/CMake: Add missing dependencies for OCIO
OCIO could build before pystring and imath due to
OCIO missing the dependencies on these two projects

No rebuild required as the build would have failed
during the libs build if you ran into this issue.
2022-05-09 13:34:33 -06:00
6e2b0a38f0 Fix T97984: GPUCodegen: crash when loading demo file
This was caused by the name buffer not being ensured in all cases.

Change the behavior and always create the `NameBuffer`.
2022-05-09 20:06:27 +02:00
bfa1c077cb Fix T97983 EEVEE: Tangent Normal of Curves info behaves differently in Eevee
Curve tangent was correctly mistaken with curve normal.

This patch fixes the name of the output in the glsl function and make curve
attributes more explicit (with `curve_` prefix).

This also improve the normal computation by making it per pixel to match
cycles.

Also ports the changes to eevee-next.
2022-05-09 20:06:27 +02:00
bda9a1b103 Cleanup: simplify filling curve batch cache buffers
Write to arrays directly instead of using the "step" utility.
2022-05-09 18:37:39 +02:00
c2e26406c5 Cleanup: use different hardcoded shape to make the root/tip radius useful
Those settings are intended to be removed at some point, but for now they
are still needed because the radius attribute isn't supported.
2022-05-09 18:37:39 +02:00
Brecht Van Lommel
f4827d08bc Build: disable usage of GLEW, CLEW, CUDA, GLFW in OpenSubdiv
The previous 3.1 libraries (accidentally) used glApi instead of GLEW and were
working for GPU subdivision, so revert to that. There's a suspected conflict
with Blender's own bundled GLEW or other issue with GLEW, causing the crash in
T97737.

The current GPU subdivision implementation does not need OpenCL, CUDA or GLFW.
So also remove libraries needed for that. It's simpler to stick to compute
shaders in OpenGL/Vulkan/Metal and not involve additional APIs.

Ref T95206

Differential Revision: https://developer.blender.org/D14898
2022-05-09 18:30:04 +02:00
78f61bf8c1 Fix T97906: OpenEXR files with lower case xyz channel names not read correctly
Adds some utility functions to avoid using toupper() which depends on the
locale and should not be used for this type of parsing.
2022-05-09 18:28:24 +02:00
c2737913db BLI: Avoid invoking tbb for small parallel_reduce calls
Apply a change similar to e130903060 for
`parallel_reduce`, just like `parallel_for`. I measured a performance
improvement in viewport FPS of at least 10% with 1 million small
instances (one bottleneck was computing many small bounding boxes).
2022-05-09 18:21:50 +02:00
892562b7bf Cleanup: Remove incorrect statement after recent refactor 2022-05-09 18:00:47 +02:00
f9d7313bb7 Fix T97853: Crash with edit mode X-ray and subdivision
The mesh drawing code used a different mesh to check whether or not to
draw face dots and to actually retrieve them. The fix is moving the
responsibility of determining whether to use subsurf face dots to the
creation of `MeshRenderData` where the mesh used for drawing is
known, rather than doing it at a higher level.

Differential Revision: https://developer.blender.org/D14855
2022-05-09 17:39:22 +02:00
686abf1850 Fix T97853: Crash with edit mode X-ray and subdivision
The mesh drawing code used a different mesh to check whether or not to
draw face dots and to actually retrieve them. The fix is moving the
responsibility of determining whether to use subsurf face dots to the
creation of `MeshRenderData` where the mesh used for drawing is
known, rather than doing it at a higher level.

Differential Revision: https://developer.blender.org/D14855
2022-05-09 17:36:54 +02:00
e0e95f7895 Refactor: Move resample curves code to the geometry module
This commit moves the code for the resample curves node to the geometry
module, to allow reusing it in any editor. Split from D14870.
2022-05-09 17:33:41 +02:00
9f8f35008c Move particle system modifier to C++
The modifier is supposed to create a Curves data block soon, which
helps with the transition to the new Curves object in drawing code.
Utilities for the new Curves object are mostly in C++.
2022-05-09 16:59:48 +02:00
5823e749dc Merge branch 'blender-v3.2-release' 2022-05-09 16:35:25 +02:00
43e31d26a9 Fix T97927: bpy.utils.units.to_string uses wrong units for velocity, acceleration, lens length, and power
`TEMPERATURE` type was also missing, not only the new-ish
`TIME_ABSOLUTE` one...

Added a static assert on the size of the `bpyunits_ucategories_items`
array, and a comment on anonymous enum of `B_UNIT_`, in the hope this
won't happen again in the future.
2022-05-09 16:34:11 +02:00
6f773b1a4f Cleanup: typo in variable name. 2022-05-09 16:34:11 +02:00
36e330bd9c UI: Layout tweaks to Curve Guide force field min/max distance
For consistency with other force fields and other areas in Blender.

* Align "Use Max" and "Maximum Distance" in one line.
* Rename "Maximum Distance" to "Max Distance"
* Rename "Minimum Distance" to "Min Distance"
* Move "Minimum Distance" below maximum.
2022-05-09 16:08:45 +02:00
865cdff426 Cleanup: Replace UNUSED with comments (CPP style). 2022-05-09 15:08:34 +02:00
17429fe5e5 GPencil: Tooltip and UI text changes
Apply @pablovazquez feedback.
2022-05-09 14:52:52 +02:00
82060c1697 Remove unused compile flag on linux x86 GCC platforms
The "cast-align" warning is only triggered on Arm CPUs when using GCC.
Currently the only officialy supported ARM platform is the Mac platform
where we use Clang. So this warning never triggers.
2022-05-09 14:30:57 +02:00
95ff5e6d89 Merge branch 'blender-v3.2-release' 2022-05-09 13:40:10 +02:00
0f7da9a72f GPU: Unable to compile material shaders.
This fixes a threading issues when material shaders with textures are used.
It localizes the names of the samplers.
2022-05-09 13:32:13 +02:00
Ethan-Hall
719c86c0a6 Fix: compiler warnings due to recent commit
This is a fix for warnings caused by the patch b96cdbcf7a.

Differential Revision: https://developer.blender.org/D14891
2022-05-09 13:06:42 +02:00
b508999d8d Merge branch 'blender-v3.2-release' 2022-05-09 12:45:16 +02:00
b1b6994129 Minor typo fixes in UI messages. 2022-05-09 12:44:21 +02:00
b8432c2c8e Tweak i18n messages extraction script to avoid unwanted messages.
Code would add a bit too often the identifier of an RNA class to
translated messages, this is only needed if there is no valid label
available for it.
2022-05-09 12:40:26 +02:00
025959da23 Fix T97915: Regression: Blender doesn't translate viewpoint menu items.
Another mistake in rBdb3f5ae48aca.
2022-05-09 12:36:56 +02:00
Colin Basnett
4ac6177b8d Fix T97529: NLA track buttons still work when hidden
NLA track option buttons (lock track, etc.) now no longer respond to
clicks when they are hidden.

The bug stems from the fact that there was duplicate input handling
going on for the buttons: once in the normal button UI system, and then
again in the `mouse_nla_channels` function. The logic in
`mouse_nla_channels` does not inspect whether or not the setting button
is there or not, it just assumes that it is.

This function should no longer be handling mouse input for buttons
(there is even comment suggesting that the button handling to be
deprecated) since the button UI system already handles it. Therefore,
the button handling code has been removed from that
`mouse_nla_channels`.

In addition, the redundant mouse button handling for pressing the "Push
Down Action" button has also been removed from this function as well.

Reviewed By: sybren, lichtwerk

Differential Revision: https://developer.blender.org/D14868
2022-05-09 12:15:16 +02:00
9913196470 Geometry Nodes: use .a_ prefix for anonymous attribute names
Ref T97452.
2022-05-09 11:59:27 +02:00
b651754890 Merge branch 'blender-v3.2-release' 2022-05-09 10:38:53 +02:00
6b95e75d2f Silenced compilation warning in freestyle. 2022-05-09 10:38:46 +02:00
cc3c15fbdd GPU: Fix crash deferred shader compilation.
On certain systems when eevee is used in a 3d viewport could crash. It
happened more often on slower systems or systems with slower glsl compilers.

For example an Intel Mac Mini. The cause was that even if a GPUMaterial
was in used it could be freed.
2022-05-09 09:54:26 +02:00
Ethan-Hall
b96cdbcf7a UI: Add color attribute create to canvas selector
The purpose of this patch is to add the option to create a color
attribute paint slot from the canvas selector when in material mode.

See the discussion here: T97346

---
|Add Image Paint Slot|Add Color Attribute Paint Slot|
|{F13016547 size=full}|{F13032911 size=full}|

Reviewed By: HooglyBoogly, joeedh

Differential Revision: https://developer.blender.org/D14724
2022-05-09 08:21:45 +02:00
Shashank Shekhar
90298c24a2 EEVEE & Viewport: Add a built-in shader called 3D_IMAGE, and expose to the python API
Adds an example python script to the documentation for the 3D_IMAGE shader.

The **use-case** is to draw textures with 3D vertex positions, in XR views as well as non-XR views (in a simpler manner).

**Testing**: I've tested that this compiles and works on my Macbook (with the example python script included in this change). I don't have access to a Windows or Linux machine right now, but this change doesn't look platform-specific and no new glsl shaders have been added or edited by this change. I'll try to get access to a Windows machine, but if someone does have one, I'd be really grateful if they could try this change. Thanks!

**Problem addressed**: The existing 2D_IMAGE shader (exposed in the python API) gets near-clipped when drawn in the
XR view, regardless of the near-clip settings. Additionally, the 2D_IMAGE shader only accepts 2D
positions for the image vertices, which means drawing textures in 3D requires providing
2D coordinates and then pushing a transform-rotate-scale matrix to the GPU, even for
non-XR (i.e. WINDOW) views. The 3D_IMAGE shader is simpler: it accepts 3D vertex positions, and doesn't require
any additional work by the scripter.

**Workaround**: The current workaround is to use custom shaders in the python script.

**Non-intrusive change**: No new glsl shaders were added. This change just bundles two existing shaders: the vertex shader used
by the 3D_IMAGE_MODULATE_ALPHA shader, and the fragment shader used by the 2D_IMAGE shader.

Reviewed By: #eevee_viewport, jbakker

Differential Revision: https://developer.blender.org/D14832
2022-05-09 08:07:37 +02:00
78e7b20c0f Fix T96683: Mipmaps are inaccurate for UDIM textures
For some reasons the mipmap count was not set to max during creation.
Probably it was mistaken with the UDIM tilemap texture which is only
1D and has only one mipmap.
2022-05-07 19:11:34 +02:00
90663acfd5 EEVEE: Fix missing function implementation for volumetric materials
This was leading to linking errors.

Fixes T97779 Regression: World volume noise stopped working
2022-05-07 18:47:48 +02:00
014cdd3441 Fix T97600 Regression: rendering in new window displays flickers
This is because some drivers / GPU actually still do double buffer swapping
but others don't. Adding this do ensure the background color of the first
redraw.

Note that this fix was not tested on the problematic hardware and might not
solve the issue.
2022-05-07 17:38:05 +02:00
9f2e995c3e Fix T97796 EEVEE: Regression: Alpha clipped materials rendered as alpha hashed
This was because the alpha clip thresholding was previously done in the
material nodes codegen. Now it is the responsibility of the engine to
implement it.

This adds a loose uniform that is set by EEVEE itself to control the clip
behavior.
2022-05-07 15:00:37 +02:00
3a035a4417 Fix T97881 EEVEE: First Specular and SSS closure not contributing on alpha blended material
This was because the evaluation was still being deferred just like for the
opaque case.
2022-05-07 13:18:16 +02:00
b28e261753 GPUShader: Add static compilation to clipped shader variations
This allows testing them for errors.
2022-05-07 12:25:40 +02:00
2a2261d7e1 Cleanup: Remove the OSL <UVTILE> workaround
Partially reverts rB46ae0831134 now that we have a new version of
OSL/OIIO that supports <UVTILE> directly.

Differential Revision: https://developer.blender.org/D14851
2022-05-06 21:41:31 -07:00
23be3294ff XR: Expose the OpenXR user paths in the event data for XR events
The use-case is to allow an event handler (in C or a plugin) to
distinguish which hand produced the XR event.

The alternative is to register separate actions for each hand (e.g.
"trigger_left" and "trigger_right"), and duplicate the device bindings
(Oculus, HTC Vive, etc) for each action. Other than the problem of code
duplication, this isn't conceptually efficient since "trigger_left" and
"trigger_right" both represent the same event "trigger", and the
identity of the hand that produced that event is just a property of
that event.

Adds two string fields to the XrEventData called user_path and
user_path_other. The user_path_other field will be populated if the
event is a bimanual one (i.e. two-handed). This follows the pattern
used by the rest of the XrEventData struct for bimanual events (e.g.
state, state_other).

Reviewed By: muxed-reality
2022-05-07 11:39:26 +09:00
98a04ed452 UI: Increase bitfield size for button flags
We were running out of bits :) Only one was left (which D14880 proposes to
use).
2022-05-06 23:48:51 +02:00
5e40c342ae UI: Remove weird looking right aligned text in texture properties
The text would start somewhere in the middle of the line, and just look placed
wrong. Plus it would seem like it's cut off (esp. since we don't add a period).
2022-05-06 23:37:28 +02:00
aee8e49031 Fix T97751: New OBJ IO - File Browser doesn't filter by .obj/.mtl
Makes the File Browser filter by .obj and .mtl files by default again. Note
that this commit focuses on fixing this specific bug, further
refactors/tweaks/fixes are planned (see D14863).

Differential Revision: https://developer.blender.org/D14862

Reviewed by: Aras Pranckevicius
2022-05-06 23:05:38 +02:00
aae2ff49f5 Fix T97751: New OBJ IO - File Browser doesn't filter by .obj/.mtl
Makes the File Browser filter by .obj and .mtl files by default again. Note
that this commit focuses on fixing this specific bug, further
refactors/tweaks/fixes are planned (see D14863).

Differential Revision: https://developer.blender.org/D14862

Reviewed by: Aras Pranckevicius
2022-05-06 23:03:59 +02:00
92d0ed3000 Merge branch 'blender-v3.2-release' 2022-05-06 16:44:18 +02:00
Demeter Dzadik
26d375467b bpy_extras: Add utilities for getting ID references
An alternate to D14839, implemented in Python and
relying on bpy.data.user_map(). That function
gives us a mapping of what ID is referenced by
what set of IDs. The inverse of this would also
be useful, which is now available from
bpy_extras.id_map_utils.get_id_reference_map().

From there, we can use get_all_referenced_ids()
to get a set of all IDs referenced by a given ID
either directly or indirectly.

To get only the direct references, we can simply
pass the ID of interest as a key to the dictionary
returned from get_id_reference_map().

Reviewed By: mont29

Differential Revision: https://developer.blender.org/D14843
2022-05-06 16:42:59 +02:00
Jeroen Bakker
a7417ba845 DrawManager: Make instance data persistent.
When resizing a viewport all engine instance data was cleared.
This wasn't the intended design and lead to performance regressions
in the image engine.

This patch makes sure that the instance data isn't cleared when
the viewport size changes. When using instance data, draw engines
are responsible to update the textures accordingly.

This could also reduce flickering/stalling when resizing the viewport
in eevee-next.

Fixes T95428.

Reviewed By: fclem

Maniphest Tasks: T95428

Differential Revision: https://developer.blender.org/D14874
2022-05-06 16:17:39 +02:00
a0a99fb252 Fix T97872: Annotation lines lost AA
Since rB2a7a01b339ad, `lineSmooth` has lost its default value of true.

So set the value when creating the shader.

Differential Revision: https://developer.blender.org/D14876
2022-05-06 11:07:14 -03:00
f23f831e91 Clang-tidy: Don't warn about unrecognized compiler flags
When using GCC, clang-tidy will still use clang under the hood but GCC
flags will still be passed. Therefore we will ignore any warnings about
unrecognized flags as we don't care about this when running clang-tidy.
2022-05-06 15:26:54 +02:00
763b8f1423 Clang-tidy: Ignore variable name length and .c/.cc include warnings
After some internal discussion it was decided that we should ignore name
variable length tidy warnings. Otherwise we would have warnings for
every variable that is under three characters long.

Additionally we will also ignore any warnings when including non header
files as the Unity library in our build system uses this excessively
2022-05-06 15:26:54 +02:00
dd2df5ceb0 Fix: Comments in clang-tidy checks list is not allowed
Clang-tidy will not parse any options after the comment.
2022-05-06 15:26:54 +02:00
2ba081f59b Curves: disable Empty Hair operator when there is no active mesh 2022-05-06 15:17:44 +02:00
cdd2c8bd07 Merge branch 'blender-v3.2-release' 2022-05-06 15:07:00 +02:00
acafc7327e Fix T97466: Assert when pack sound in blender DEBUG.
This was very old code from 2008, totaly invalid with new depgraph &
evaluation system, now we just need to tag the Sound ID for update.
2022-05-06 15:05:26 +02:00
edc92f779e Curves: support converting legacy curves to new curves object
This extends the existing object type conversion operator.

Currently, it is limited to converting to curves when the evaluated
source mesh actually has curves. This might not be the case when
it is converted to a mesh by some modifier during evaluation.

Differential Revision: https://developer.blender.org/D14872
2022-05-06 14:39:36 +02:00
c7bffc8fa2 obj: move parsing utilities out of io_common, since they are fairly obj specific
As pointed out in https://developer.blender.org/rB213cd39b6db387bd88f12589fd50ff0e6563cf56#341113,
the utilities are quite OBJ specific due to treating backslash as a line
continuation character. It's unlikely that other formats need that.

No functionality changes, just pure code move (and renamed tests so that
their names reflect obj).

Reviewed By: Campbell Barton
Differential Revision: https://developer.blender.org/D14871
2022-05-06 14:54:09 +03:00
bdfee6d831 EEVEE: Refactor curve nodes
This patches rewrites the GPU shaders of curve nodes for easier future
development. This is a non-functional change. The new code avoids code
duplication by moving common code into BKE curve mapping functions. It
also avoids ambiguous data embedding into the gradient vectors that are
passed to vectors and reduces the size of uniforms uploaded to the
shader by avoiding redundancies.

This is needed in preparation for the viewport compositor, which will
utilize and extend this implementation.

Reviewed By: fclem

Differential Revision: https://developer.blender.org/D14689
2022-05-06 13:33:23 +02:00
8f6f28a0dc GPU: Move common shaders into a common directory
This patch moves some of the utility library shaders into a common
directory and makes the necessary renames across shaders. Additionally,
material-specific transform functions were moved outside of math utils
into a separate transform_utils.glsl file.

This is needed in preparation for the viewport compositor, which will
make use of some of those utilities and will require all material
specific bit to be removed out of those files.

Reviewed By: fclem

Differential Revision: https://developer.blender.org/D14688
2022-05-06 12:58:14 +02:00
f5428736a7 Cleanup: Trailing white-space 2022-05-06 12:32:11 +02:00
d02b8c1c3b UI: Expand the Snap Curves to Surface operator
The different methods are too different. It is worth having them as
individual choices by the users.

Differential Revision: https://developer.blender.org/D14873
2022-05-06 12:30:46 +02:00
Ramil Roosileht
90042b7d79 Switch viewport shading for color tools in solid mode
This patch implements T97613, switching viewport shading when using Color Filter and Mask By Color

ALSO, this patch makes it so viewport shading color switches only when SOLID mode is chosen, to prevent color switching when using other shading modes, without user noticing it.
{F13049889}

Reviewed By: JulienKaspar, joeedh, jbakker

Maniphest Tasks: T97613

Differential Revision: https://developer.blender.org/D14765
2022-05-06 12:30:09 +02:00
b1517e26e2 Curves: use old Add > Curve menu for new curves object
* Removes the `Curves` menu (leaving only `Curve`).
* The `Curve > Random` option is still useful for testing, but it's under
  the second experimental flag so that it is turned off when only the
  "master ready" features are enabled.

Differential Revision: https://developer.blender.org/D14861
2022-05-06 12:06:57 +02:00
Piotr Makal
ce3dd12371 USD: add volume/VDB export
Add support for volume (OpenVDB) USD export:

- Allows to export both static and animated volumes.
- Supports volumes that have OpenVDB data from files or are generated in
  Blender with 'Mesh to Volume' modifier.
- For volumes that have generated data in Blender it also exports
  corresponding .vdb files. Those files are saved in a new folder named
  "volumes".
- Slightly changes the USD export UI panel. "Relative Texture Paths"
  becomes "Relative Paths" (and has separate UI box) as the
  functionality will now apply to both textures and volumes. Disabling
  of this option due to "Materials" checkbox being turned off has been
  removed.

Reviewed By: sybren, makowalski

Differential Revision: https://developer.blender.org/D14193

Manifest Task: T95407
2022-05-06 11:43:43 +02:00
f3b56246d1 Cleanup: improve const correctness in material API 2022-05-06 11:40:23 +02:00
eac403b6e1 BLI: Add float3x3
This patch adds a float3x3 class that represents a 3x3 matrix. The class
can be used to represent a 2D affine transformation stored in a 3x3
matrix in column major order. The class provides various constructors
and processing methods, which utilizes the existing mat3 utilities in
BLI. Corresponding tests were also added.

This is needed by the upcoming viewport compositor to represent domain
transformations.

Reviewed By: fclem

Differential Revision: https://developer.blender.org/D14687
2022-05-06 11:22:10 +02:00
908976b09a Merge branch 'blender-v3.2-release' 2022-05-06 11:12:58 +02:00
84756b68e6 Add documentation about Image/ImBuf to python/RNA API.
Related to T95616, the relationship between Image ID and ImBuf 'cached'
buffers can be fairly confusing when using the RNA API.

Reviewed By: campbellbarton, jbakker

Differential Revision: https://developer.blender.org/D14833
2022-05-06 11:11:33 +02:00
477066adee Fix: Handle default better in curves type count cache
When the curve types array isn't allocated, the default type
is Catmull Rom. Because the type counts are calculated eagerly,
they must be in a valid state.
2022-05-06 10:58:54 +02:00
12a1fa9cf4 Cleanup: format 2022-05-06 18:27:44 +10:00
2c75857f9f Cleanup: spelling in comments, use doxygen comments 2022-05-06 17:56:59 +10:00
ae9ef28126 Merge branch 'blender-v3.2-release' 2022-05-06 17:49:29 +10:00
62450e8485 WM: suppress assertion when switching tools
Changing the object mode outside the 3D view would trigger this
assertion. This was harmless, only assert for space types that
define the tools mode.
2022-05-06 17:44:32 +10:00
Andrii Symkin
e58b18888c GHOST: Add support for precision touchpad gestures on Windows
This patch adds support for precision touchpad gestures on Windows 8.1
and newer using Direct Manipulation API. Gestures work exactly like on
macOS, with full support for pan/pinch and inertia. This works by
creating a viewport with a fake scrollable which is reset after every
gesture and converts any changes to the content's transform into GHOST
trackpad events (as explained [here](https://bugzilla.mozilla.org/show_bug.cgi?id=890878)).
The code is based on the implementation from the [Chromium project](https://chromium.googlesource.com/chromium/src/+/refs/heads/master/content/browser/renderer_host/direct_manipulation_helper_win.cc).

Tested on Windows 10.

Fixes {T70754}, {T69264}.

Demo:{F8520272}

Reviewed By: nicholas_rishel

Differential Revision: https://developer.blender.org/D7660
2022-05-06 00:40:27 -07:00
4a4f0a70eb Merge branch 'blender-v3.2-release' 2022-05-06 16:22:58 +10:00
693aa573db Fix T96585: Intersect(Knife) tool is selecting wrong edges
Regression caused by [0] which flushed selection from vertices -> edges,
causing additional edges to be selected. Now selected is flushed based
on the mode, instead of all elements. Note that these function names
could be improved to make it clearer how these flushing functions are
different.

Also skip flushing unless selection is performed.

[0]: 55c82d8380
2022-05-06 16:18:04 +10:00
4dc6d14bdc Merge branch 'blender-v3.2-release' 2022-05-06 13:43:57 +10:00
11f3a388ed Merge branch 'blender-v3.2-release' 2022-05-06 13:43:54 +10:00
11a7da675f Merge branch 'blender-v3.2-release' 2022-05-06 13:43:51 +10:00
e1476ca310 Cleanup: quiet missing-declarations warnings 2022-05-06 13:43:20 +10:00
929a210608 Fix T97758: Applying modifiers bakes shape-keys
Regression in [0] which is useful when applying modifiers as a shape-key
but not when applying modifiers which keeps the existing shape-keys.

[0]: 65c5ebf577
2022-05-06 13:40:54 +10:00
fcbd81fb0f Win32: WM_SETTINGCHANGE lParam Check for NULL
Check that lParam is non-NULL in WM_SETTINGCHANGE message handler.

See D14867 for details.

Differential Revision: https://developer.blender.org/D14867

Reviewed by Jesse Yurkovich
2022-05-05 17:48:55 -07:00
1b566b70c1 Fix T95308, T93913: Cycles mist pass wrong with SSS shader
It was wrongly writing passes twice, for both the surface entry and exit points.
We can skip code for filtering closures, emission and holdout also, as these do
nothing with only a subsurface diffuse closure present.
2022-05-05 22:01:45 +02:00
e4931ab86d Cleanup: clang format 2022-05-05 21:57:08 +02:00
108963d508 Merge branch 'blender-v3.2-release' 2022-05-05 21:01:54 +02:00
75a051a6ab Fix T93246: Cycles wrong volume shading after transparent surface
The Russian roulette probability was not taken into account for volumes in all
cases. It should not be left out from the SD_HAS_ONLY_VOLUME case.
2022-05-05 20:51:01 +02:00
4fa71be89a UI: Sort Force Field enums alphabetically
For consistency with the rest of Blender.

* Use a blank icon for "None" type, so the label aligns with the rest.
* Use "None" instead of "Nothing" for Kink type dropdown entry.
2022-05-05 18:00:16 +02:00
26cda38985 Docs: Clarify docs for BMesh methods
The previous docs for `normal_update` methods of `BMVert`, `BMEdge`,
`BMFace`, and `BMesh` were not clear on some behaviors.  These
behaviors are listed in D14370.  This commit updates the docs to be
clearer.

Reviewed By: Blendify

Differential Revision: https://developer.blender.org/D14370
2022-05-05 11:08:01 -04:00
26bc584e01 Cleanup: Better const correctness for DEG_get_eval_flags_for_id
The ID is not modified by this function, so it can be const.

Needed to tweak const correctness for original ID accessor as
well. Additionally, did the same for accessor of evaluated ID
for symmetry.
2022-05-05 15:52:57 +02:00
47ba541853 Merge branch 'blender-v3.2-release' 2022-05-05 15:39:58 +02:00
b891c72d2d Fix T97575: Toggling fullscreen causes compositor recalc
The root of the issue is that compositor is using refresh mechanism
to handle recalc.

The safest fix which does not require deep refactor is to check to
whether node space was tagged for refresh from listener (currently
it is listeners which are responsible for tackling compositor tree
recalc).

Differential Revision: https://developer.blender.org/D14856
2022-05-05 15:35:59 +02:00
b968e2bf48 Outliner: add icons for nodegroups
These were missing in "Blender File" view.

before
{F13053175}
after
{F13053176}

Differential Revision: https://developer.blender.org/D14859
2022-05-05 14:44:31 +02:00
6fa5d520b8 Cycles: Add support for parallel compilation of OptiX module
OptiX 7.4 adds support for splitting the costly creation of an OptiX
module into smaller tasks that can be executed in parallel on a
thread pool.
This is only really relevant for the "shader_raytrace" kernel variant
as the main one is small and compiles fast either way. It sheds of
a few seconds there (total gain is not massive currently, since it is
difficult for the compiler to split up the huge shading entry point
that is the primary one taking up time, but it is still measurable).

Differential Revision: https://developer.blender.org/D14845
2022-05-05 14:35:41 +02:00
5b24291be1 Curves: move curve sculpt settings out of advanced panel 2022-05-05 14:15:09 +02:00
48f7574716 Merge branch 'blender-v3.2-release' 2022-05-05 15:01:28 +03:00
1830a3dfb5 Fix T97863: new OBJ importer issues with extra whitespace after "f" keywords
While possible extra whitespace after all OBJ/MTL keywords was properly
skipped, it was not done for the "f" (face definition) keyword.

While at it, also support indented keywords, i.e. extra whitespace at
the beginning of the line.

There's a tiny bit of performance drop while importing (e.g. importing
blender 3.0 splash scene: 53.38sec -> 54.21sec on my machine). But
correctness is more important.

Reviewed By: Howard Trickey
Differential Revision: https://developer.blender.org/D14854
2022-05-05 14:59:46 +03:00
ad119d327e Curves: change default name of curves object to Curves 2022-05-05 13:01:39 +02:00
bff9bf728e Fix T97774: don't crash when no brush is selected 2022-05-05 12:52:19 +02:00
611b82621d Merge branch 'blender-v3.2-release' 2022-05-05 20:44:48 +10:00
69c7ff1649 Cleanup: unused parameter warning 2022-05-05 12:43:16 +02:00
be0417d690 Cleanup: Move curve length field input to blenkernel
To use in the geometry module when the resample curves code
is moved there (T97448).
2022-05-05 12:41:48 +02:00
756710800c File missing from 78fc5ea1c3 2022-05-05 20:40:56 +10:00
78fc5ea1c3 Workaround T81065: Merge UV's when applying modifiers
Support merging UV's that share the same vertex and are very close when
applying modifiers.

This is needed to prevent UV's becoming "detached" which can happen when
applying the subdivision surface modifier.

This regression was caused by [0] which removed selection threshold for
nearby coordinates. While restoring the UV selection threshold could be
done - some selection operations that walk around connected UV fans
wouldn't behave in a deterministic way (such as select shortest path).
There are also other cases where UV's may be compared without a
threshold such as tangent calculation and exporters which have their own
logic to handling UV's.

Also resolves T86896, T89903.

[0]: b88dd3b8e7

Reviewed By: sergey

Ref D14841
2022-05-05 20:36:15 +10:00
18bcd8321a Curves: show warning when using Add brush without surface 2022-05-05 12:24:24 +02:00
622c4e4953 Cleanup: Further clarification and renaming of curve field inputs
Differentiate the total length of curves and the accumulated length
at each control point.
2022-05-05 12:21:36 +02:00
c7a345bd60 Merge branch 'blender-v3.2-release' 2022-05-05 20:18:44 +10:00
960a1ddd85 Merge branch 'blender-v3.2-release' 2022-05-05 20:18:41 +10:00
598917f49b Fix T97874: Python exception after undo with image space visible
Ensure tools are initialized with the correct area type set.
2022-05-05 20:13:10 +10:00
7e02c90103 Fix WM_toolsystem_refresh_screen_all failing to refresh tools
Error in 3e1baa7d53.
2022-05-05 20:13:10 +10:00
dbba5c4df9 Curves: control number of control points in new curves
Previously, the number of control points in a new curve was hardcoded.

Differential Revision: https://developer.blender.org/D14857
2022-05-05 12:11:50 +02:00
b4fa74e812 Cleanup: Rename field input class name 2022-05-05 12:07:46 +02:00
09f769bde5 Curves: show Front Faces Only option in tools panel 2022-05-05 12:07:35 +02:00
8d78c3152e Curves: unify "Front Faces Only" name with mesh sculpt mode 2022-05-05 12:07:10 +02:00
a85df96b4f Merge branch 'blender-v3.2-release' 2022-05-05 11:59:34 +02:00
94533ca4b8 Cleanup: EEVEE: Fix clang-tidy warnings and unused var warning 2022-05-05 11:55:13 +02:00
3505d948c6 DRW: Hair: Fix shader compilation of transform feedback shader
Introduced by rBadbe71c3faba.
2022-05-05 11:44:31 +02:00
9ebf8a0c35 Cleanup: Use unsigned short for mesh flag
Solves the compilation warning about sign change when the
default flags are cast from int to short.
2022-05-05 11:38:51 +02:00
060c5a7fa2 Cleanup: Remove unnecessary logic for resample curves node
After 2d80f814cc, we can assume that curves always have at least one
evalauted point, so this complication isn't necessary anymore.
2022-05-05 11:30:16 +02:00
b4fb2a6980 Cleanup: Add comment about mininum curve length 2022-05-05 10:22:21 +02:00
8b54e05e33 Cleanup: sort cmake file lists 2022-05-05 17:33:43 +10:00
eb837ba17e Cleanup: format 2022-05-05 17:33:43 +10:00
6513ce258f Geometry Nodes: Improve performance of mesh to points node
There are fancier possibilities for improvements, like taking ownership
of existing arrays in some cases, but this patch takes a simpler brute
force approach for now.

The first change is to move from the previous loop to using the new
`materialize_compressed_to_uninitialized` method on virtual arrays,
which adds only the selected values to the output. That is a nice
improvement in some cases, corresponding to the "Without Threading"
column in the chart below.

The next change is to call that function in parallel on slices of
the output. To avoid generating too much code, we can avoid
templating based on the type and devirtualizing completely.

The test input is a 4 million point grid, generated by the grid
primitive node. Color and 2D vector attributes were also transferred
to the points.

| Test      | Before | Final No Threading | Final  | Change |
| --------- | ------ | ------------------ | ------ | ------ |
| All Verts | 209 ms | 186 ms             | 170 ms | 0.8x   |
| 1%        | 148 ms | 143 ms             | 133 ms | 0.9x   |
| All Faces | 326 ms | 303 ms             | 87 ms  | 0.27x  |
| 1%  Faces | 70 ms  | 68 ms              | 34 ms  | 0.49x  |

Differential Revision: https://developer.blender.org/D14661
2022-05-05 09:28:46 +02:00
0f567ada9d Docs: add doc-string for BMFace.mat_nr struct member 2022-05-05 17:18:50 +10:00
ddbac88c08 Win32: Dark Mode Title Bar Color
Blender will respect Windows "Dark Mode" setting for title bar color.

See D14847 for details.

Differential Revision: https://developer.blender.org/D14847

Reviewed by Ray Molenkamp
2022-05-04 20:19:10 -07:00
836fbb90aa Cleanup: mark library locations as advanced 2022-05-05 11:38:19 +10:00
e33c15951b Cleanup: spelling in comments 2022-05-05 10:55:51 +10:00
d0c2fd0570 Cleanup: use 'r_' prefix for return arguments 2022-05-05 10:44:25 +10:00
d3c895fc41 Cleanup: shadow and format warnings 2022-05-05 10:44:25 +10:00
777b72b5cb Cleanup: unused argument warnings 2022-05-05 10:44:25 +10:00
73fa571598 Merge branch 'blender-v3.2-release' 2022-05-04 21:43:56 -03:00
adbe71c3fa Fix T97835: crash when creating hair particle system on Mac
Recently `gpu_shader_3D_smooth_color_frag.glsl` had the uniform declarations removed.

For shaders without `ShaderCreateInfo` that require this source this results in the error:
```
ERROR (gpu.shader): hair_refine_shader_transform_feedback_workaround_create FragShader:
      |
   54 |   fragColor = finalColor;
      |
      | gpu_shader_3D_smooth_color_frag.glsl:5:0: Error: Use of undeclared identifier 'fragColor'
      | gpu_shader_3D_smooth_color_frag.glsl:5:0: Error: Use of undeclared identifier 'finalColor'
      |
   55 |   fragColor = blender_srgb_to_framebuffer_space(fragColor);
      |
      | gpu_shader_3D_smooth_color_frag.glsl:6:0: Error: Use of undeclared identifier 'fragColor'
      | gpu_shader_3D_smooth_color_frag.glsl:6:0: Error: Use of undeclared identifier 'fragColor'
```

So port that shader to use `ShaderCreateInfo`.
2022-05-04 21:42:38 -03:00
8960c6e060 IMBUF: Faster JPEG Thumbnails
Make preview thumbnails of JPEG files in less time and with less RAM.

See D14727 for more details.

Differential Revision: https://developer.blender.org/D14727

Reviewed by Brecht Van Lommel
2022-05-04 16:55:59 -07:00
Juanfran Matheu
ed0964c976 UI: Add Gizmos toggle to SpaceImage
This patch adds the show_gizmo and show_gizmo_navigate properties to the Image and UV editors.

Image Editor:
{F13026317}
UV Editor:
{F13026319}

VIDEO:
{F13026324}

Reviewed By: #user_interface, campbellbarton

Differential Revision: https://developer.blender.org/D14755
2022-05-05 00:23:25 +02:00
f11dba8892 Fix Cycles world light group confusing UI
Move to a subpanel of the Settings panel. Otherwise it seems like it's a
setting of one of the shader nodes.
2022-05-04 21:23:18 +02:00
0fa1c65ee3 Fix T95644: Cycles doesn't update modified object attributes on GPU
evice_update_preprocess is supposed to detect modified attributes and flag the
device_vector for a copy through device_update_flags. However, since object
attributes are only created in device_update_attributes afterwards, they can't
be included in that check.

Change the function that actually updates the device_vector to tag it as
modified as soon as its content gets updated.

Differential Revision: https://developer.blender.org/D14815
2022-05-04 20:07:19 +02:00
54f447ecde Fix T96718: Cycles invalid pixels when using bump normal for light emission
A shader node setup accidentally used the bump normal as emission. Bump
mapping nodes are excluded from light shader evaluation to reduce kernel size
and register pressure, but in that case should write zero instead of leaving
memory uninitialized.

Thanks to Lukas for helping identify the cause.
2022-05-04 20:01:04 +02:00
ac9ebc9de3 Fix Cycles division by zero in material preview render
If the render gets cancelled before the first sample finishes.
2022-05-04 20:01:04 +02:00
319a772b7f Merge remote-tracking branch 'origin/blender-v3.2-release' 2022-05-04 19:37:48 +02:00
fc0f6d19ad Fix T96845: artifacts with GPU subdivision and mirror modifier
The coarse polygon count was set to the one of the BMesh instead of
the the one of the mesh used for subdivision, which caused the
compute shaders to output wrong data.
2022-05-04 19:31:53 +02:00
5d7ee44406 Fix T95527: wrong motion blur with rigid bodies
This index is not meant for the point cache data array, it's already offset.
2022-05-04 19:28:17 +02:00
1a98bec40e Subdivision node: add input for vertex creases
This adds an input to the Subdivision node to specify a field to use
for controling vertex creases. Common code with edge creasing was
extracted into utility functions to avoid redundancy.

Differential Revision: https://developer.blender.org/D14199
2022-05-04 18:59:08 +02:00
Hallam Roberts
82df48227b Nodes: Add general Combine/Separate Color nodes
Inspired by D12936 and D12929, this patch adds general purpose
"Combine Color" and "Separate Color" nodes to Geometry, Compositor,
Shader and Texture nodes.
- Within Geometry Nodes, it replaces the existing "Combine RGB" and
  "Separate RGB" nodes.
- Within Compositor Nodes, it replaces the existing
  "Combine RGBA/HSVA/YCbCrA/YUVA" and "Separate RGBA/HSVA/YCbCrA/YUVA"
  nodes.
- Within Texture Nodes, it replaces the existing "Combine RGBA" and
  "Separate RGBA" nodes.
- Within Shader Nodes, it replaces the existing "Combine RGB/HSV" and
  "Separate RGB/HSV" nodes.

Python addons have not been updated to the new nodes yet.

**New shader code**
In node_color.h, color.h and gpu_shader_material_color_util.glsl,
missing methods hsl_to_rgb and rgb_to_hsl are added by directly
converting existing C code. They always produce the same result.

**Old code**
As requested by T96219, old nodes still exist but are not displayed in
the add menu. This means Python scripts can still create them as usual.
Otherwise, versioning replaces the old nodes with the new nodes when
opening .blend files.

Differential Revision: https://developer.blender.org/D14034
2022-05-04 18:44:03 +02:00
7d41e1ed40 Merge branch 'blender-v3.2-release' 2022-05-04 17:30:26 +02:00
60772baebf Fix T97709: Compositor: Scenes are being set to no users after doing a full copy.
Similar issue/solution as in rB5188c14718c5 from this Monday actually,
there may be more of those still lurking around... Quite surprising they
all get reported now, this behavior has been in Blender since years.
2022-05-04 17:29:50 +02:00
8ff5836766 Merge branch 'blender-v3.2-release' 2022-05-04 17:19:25 +02:00
b5c3885bf0 Fix T97851: GPencil Bake object transform operator wrong transformation
The problem was the layer transformation was already applied in the layer and if we apply in the bake, we are doing double transformation.

Differential Revision: https://developer.blender.org/D14844
2022-05-04 17:18:58 +02:00
Germano Cavalcante
d2271cf939 Transform: use a threshold for UV snapping
Unlike 3Dview snapping, UV snapping is always done to the UV closest to
the mouse cursor, no matter the distance.

From the user's point of view, this appears to be an inconsistency (See
{T93538}).

Therefore, set a minimum distance for snapping and, as in 3D View and
highlight the snap with a drawing of a circle.

Release Note: https://wiki.blender.org/wiki/Reference/Release_Notes/3.3/Modeling

Reviewed By: #uv_editing, campbellbarton

Maniphest Tasks: T93538

Differential Revision: https://developer.blender.org/D13873
2022-05-04 12:08:17 -03:00
5559ea59a1 Cycles: mark all CUDA 11.x versions as supported
All released versions appear to work fine. Also slightly change wording.
2022-05-04 17:07:39 +02:00
b5b6ae06f9 Build: update outdated description of WITH_TBB option 2022-05-04 17:07:39 +02:00
08daeb9472 LineArt: Clean up file name and license.
lineart_cpp_bridge.cpp changed to .cc
2022-05-04 22:32:50 +08:00
03aba8046e LineArt: Object loading optimization
This patch replaces BMesh conversion into index-based triangle adjacent
lookup method, and use multithread in many steps to speed up object
loading for line art.

Differential Revision: https://developer.blender.org/D14627

Reviewed By: Sebastian Parborg (zeddb)
2022-05-04 22:11:33 +08:00
8bd0ed6bd2 Curves: show direction in panel for Grow / Shrink brush settings 2022-05-04 15:37:59 +02:00
a0d139076c Silenced compilation warning on clang. 2022-05-04 15:04:30 +02:00
a52fbeadb1 Merge branch 'blender-v3.2-release' 2022-05-04 15:02:55 +02:00
54b293237e Fix T97375: changing node tree from Python is very slow
The issue was that the `NodeTreeRef` acceleration data structure was
rebuild much more often than necessary. That happened because the
Map Range node accidentally tagged the node tree for change even
though it did not actually change.

Differential Revision: https://developer.blender.org/D14842
2022-05-04 15:02:19 +02:00
82bf11e73f Cleanup: unused parameter 2022-05-04 14:36:16 +02:00
dc1793e85b Merge remote-tracking branch 'origin/blender-v3.2-release' 2022-05-04 14:33:13 +02:00
d86d7c935e Fix T97827: material preview not displaying textures
Caused by rB281bcc1c1dd6 which did not properly made use
of `vec4` for UVs which are now loaded as attributes.
2022-05-04 14:30:52 +02:00
5162135e14 Curves: add second experimental option for new curves tools
Now there are two experimental feature options:
* "New Curves Type": Enables the new data type and a couple of tools
  that are meant to be in the first release that comes with the new curves object.
* "New Curves Tools": This is only available when the new curve type is available
  as well. It mainly exists to keep some tools experimental even after the initial
  curves object is release officially.
  * For now this only includes the curves edit mode which is not usable yet and
    probably won't be for the initial release.

Differential Revision: https://developer.blender.org/D14840
2022-05-04 14:18:42 +02:00
3bdda67e50 Merge branch 'blender-v3.2-release' 2022-05-04 15:11:25 +03:00
cbeb8770cc Fix T97794: new OBJ importer does not handle quoted MTL paths
Fixes T97794 (which is a reintroduction of an older issue T67266 that
has been fixed in the python importer, but the fix was not in the C++
one). Some software produces OBJ files with mtllib statements like
mtllib "file name in quotes.mtl", and the new importer was not stripping
the quotes away.

While at it, I noticed that MTLParser constructor was taking a StringRef
and treating it as a zero-terminated string, which is not necessarily
the case. Fixed that by explicitly using a StringRefNull type.

Reviewed By: Howard Trickey
Differential Revision: https://developer.blender.org/D14838
2022-05-04 15:10:54 +03:00
48c0738d4a Cleanup: Adjust variable names, miscellaneous changes
Use `src` and `dst` instead of less common variable names,
less redundant logic, simpler use of const, and "typename"
for template arguments instead of "class".
2022-05-04 14:10:22 +02:00
9ee9dd257f Curves: Add method to find indices for curve type in a selection
For example, this can be used to find the indices of all Bezier curves
inside an existing selection. The important part is that it is optimized
for the case when all curves have the same type.
2022-05-04 13:55:13 +02:00
16011e34f0 Curves: Optimize filling all curves with a single type
If all curves are selected for setting the new type,
skip counting the types and just set it directly.
2022-05-04 13:55:13 +02:00
7d7047058a Merge branch 'blender-v3.2-release' 2022-05-04 13:00:04 +02:00
Yann Lanthony
b31f5b8ce7 GPencil: Apply layer transforms to visible frames
Fix regression described in T97799.

Apply layer transform and layer parenting to all visible frames, i.e. active frame + onion skinning frames.

Reviewed By: #grease_pencil, antoniov

Maniphest Tasks: T97799

Differential Revision: https://developer.blender.org/D14829
2022-05-04 12:58:57 +02:00
0f2cc50fc6 Cleanup: Avoid asan overflow warning for RNG seed 2022-05-04 12:58:45 +02:00
caeea212cf Merge branch 'blender-v3.2-release' 2022-05-04 12:28:05 +02:00
302584bd6e Fix T97831: Curve to mesh node can create invalid wire mesh
When the profile only has one control point, its segment count was
determined incorrectly. There needs to be a special case for a single
control point, when there are no segments even if the curve is cyclic.
2022-05-04 12:26:59 +02:00
14d845192a Merge branch 'blender-v3.2-release' 2022-05-04 19:32:12 +10:00
e7ba34599c Merge branch 'blender-v3.2-release' 2022-05-04 19:32:09 +10:00
79e94caa6b Fix error pasting text containing tabs
Regression in [0] which missed updating the string length
when converting tabs to spaces - the pasted string would be shorter.

[0]: e2f4c4db8d
2022-05-04 19:28:11 +10:00
5f8f436dca Allow surface deform when target mesh increases number of vertices
A studio request actually.

The goal is to cover rather typical situation: when the mesh was
bound to target when the target was on subdivision level 0 but
uses a higher subdivision level for rendering. Example of such
setup is a facial hair bound to the face.

The idea of this change is to use first N vertices from the target
where N is the number of vertices on target during binding process.
While this sounds a bit arbitrary it covers typical modifier setup
used for rigging. Arguably, it is not more arbitrary than using a
number of polygons (which is how the modifier was checking for
changes on target before this change).

Quite straightforward change. A bit tricky part was to not break
the behavior since before this change we did not track number of
vertices sued when binding. The naming I'm also not super happy
with and just followed the existing one. Ideally the variables in
DNA will be prefixed with `target_` but doing it for an existing
field would mean compatibility change, and only using prefix for
the new field will introduce weird semantic where the polygons
count will be even more easily confused with a count on the
deforming mesh.

Differential Revision: https://developer.blender.org/D14830
2022-05-04 10:56:33 +02:00
aa1fb4204d Cleanup: More clear name in surface deform modifier
Make it explicit that counter is about target mesh.

Use DNA rename for it so that the files stay compatible.

Also renamed some purely runtime fields to replace `t`
prefix with `target` as the short `t` is super easy
to miss.

Differential Revision: https://developer.blender.org/D14835
2022-05-04 10:56:33 +02:00
2d80f814cc Curves: Use copied original data for invalid NURBS curves
NURBS curves can be invalid when the order is less than the number
of points, or in a few other situations. Currently the evaluated data of
an invalid NURBS curve is empty. This is inconvenient because it
requires checking for empty curves when it otherwise wouldn't be
necessary. This patch replaces that fallback with copying the original
data to the evaluated points. This makes conceptual sense too, as if
the curve couldn't be evaluated-- which wouldn't necessarily delete it.

Usually the UI protects against this happening, but it's currently
possible to create an invalid curve with some operations like the
delete geometry node.

Differential Revision: https://developer.blender.org/D14837
2022-05-04 10:27:46 +02:00
7dc94155f6 Curves: support symmetry in curves sculpting brushes
This adds support for X/Y/Z symmetry for all brushes in curves
sculpt mode. In theory this can be extended to support radial
symmetry, but that's not part of this patch.

It works by essentially applying a brush stroke multiple with
different transforms. This is similiar to how symmetry works in
mesh sculpt mode, but is quite different from how it worked in
the old hair system (there it tried to find matching hair strands
on both sides of the surface; if none was found, symmetry did
not work).

Differential Revision: https://developer.blender.org/D14795
2022-05-04 09:51:32 +02:00
0375720e28 Fix T95165: Custom Normals tools dont update immediately.
Recalc selection count at the end of the circle selection.
This was removed from circle selection as it became a performance
bottleneck, helas some operators rely on it.
2022-05-04 09:22:17 +02:00
aa21087d56 Merge branch 'blender-v3.2-release' 2022-05-04 14:02:23 +10:00
78e8fae346 Merge branch 'blender-v3.2-release' 2022-05-04 14:02:21 +10:00
b1cd3be0d0 Merge branch 'blender-v3.2-release' 2022-05-04 14:02:18 +10:00
f8c8abae38 Merge branch 'blender-v3.2-release' 2022-05-04 14:02:15 +10:00
0383047257 Cleanup: quiet strict-prototypes warning 2022-05-04 14:01:18 +10:00
2a89509e45 License headers: add missing license headers
Add missing license headers based on files in the same directory.
2022-05-04 13:58:53 +10:00
10b1e993f4 Cleanup: make format 2022-05-04 13:52:22 +10:00
8cb30c079d Cleanup: duplicating doc-strings 2022-05-04 13:44:23 +10:00
db63945c36 Docs: add doc-string for ED_view3d_viewcontext_init_object 2022-05-04 11:20:04 +10:00
dc57ab8941 Cleanup: quiet strict-prototypes warning 2022-05-04 11:07:19 +10:00
e86b62f195 Fix wrong task priority for particle distribution and tanget computation
These kinds of depsgraph evaluations should not be marked as low priority as
this could negatively affect playback performance. Low priority should mainly
be used for background tasks.
2022-05-03 23:08:29 +02:00
5b2a6b6ebb Fix T96880: viewport render animation hangs Blender
Isolate frame writing task so that multithreaded image operations don't cause
the thread to start writing another frame. If that happens we may reach the
MAX_SCHEDULED_FRAMES limit, and cause the render thread and writing threads to
deadlock waiting for each other.

Additionally, don't set task priority to low because this may cause the task
scheduler to be slow in scheduling the write and color management tasks.
2022-05-03 23:08:29 +02:00
502c707e0e Merge remote-tracking branch 'origin/blender-v3.2-release' 2022-05-03 22:59:31 +02:00
Ethan-Hall
1d668b6356 Alembic: Enable operator presets when exporting
This patch enables operator presets for Alembic exports.
The export menu has many options, so enabling the feature
will help users manage their export settings in the same
way they can with other filetypes.

This also fixes restoring the default operator value for
setting the frame range.

Differential Revision: https://developer.blender.org/D12849
2022-05-03 22:58:18 +02:00
281bcc1c1d Fix T93179: geonodes UVs and Vertex colors do not work in EEVEE
Overwriting UV map or vertex color data in Geometry nodes will move the
layers to another CustomData channel, and as such, will make attribute
lookup fail from the UVMap and Vertex Color nodes in EEVEE as the
CustomDataType will also be modified (i.e. no longer `CD_MTFACE` or
`CD_MCOL`).

As discussed in T93179, the solution is to use `CD_PROP_AUTO_FROM_NAME`
so that the render engine is able to find the attributes. This also makes
EEVEE emulate Cycles behaviour in this regard. `attr_load_uv` and
`attr_load_color` are also removed in favor of the generic attribute
API in the various GLSL shaders.

Although `CD_PROP_AUTO_FROM_NAME` is now used even for UV maps, the
active UV map is still used in case the attribute name is empty, to
preserve the old behavior.

Differential Revision: https://developer.blender.org/D13730
2022-05-03 22:50:04 +02:00
94205e1d02 Fix T96822: Cycles motion blur + persistent data not updating properly
At the frame before/after an object starts moving, it's transform may not be
modified but its motion would be and requires an update.
2022-05-03 22:16:08 +02:00
947f8ba300 Fix T96338: GPU subdiv crash switching to UV editing
The crash is caused as the data for the UV editor is requested before
the data for the mesh as a separate draw update. Since building the UV
stretch angle buffer requires the position buffer, the latter is not
created yet in this case.

To fix this, create a local position buffer from the subdivision data. An
alternate fix was considered to remove the dependency on the position
buffer by interpolating on the GPU the coarse stretch angle buffer but
this did work. Maybe this will be revisited.
2022-05-03 18:02:10 +02:00
04df0a3b8c Sculpt Curves Puff icon 2022-05-03 17:49:10 +02:00
2062116924 BPY types: add default Geometry Node poll function
Contrary to `CompositorNodeCustomGroup` or `ShaderNodeCustomGroup`,
`GeometryNodeCustomGroups` have to define their own poll function.
This is because their is no predefined poll function for `GeometryNode`,
and it may not be clear for addon developers why `GeometryNode` would
be special here.

This adds `GeometryNode` to `bpy_types.py` and defines such a function
for it like for other builtin node types.

Differential Revision: https://developer.blender.org/D14775
2022-05-03 17:43:03 +02:00
9fb98735ea Refactor: Use boolean array for curves delete brush
No functional or performance changes expected. This change
makes it simpler to run multiple operation "delete" operations
but only reallocate the curves data arrays a single time.
2022-05-03 17:41:09 +02:00
f586c3ba21 Merge branch 'blender-v3.2-release' 2022-05-03 14:49:53 +03:00
5962db093f Fix T97793, Fix T97795: Use correct defaults for missing values in new OBJ importer
- Fix T97793: when a UV coordinate after vt is missing, use zero. While
  at it, also use zeroes for positions & normals, since "maximum
  possible float" is very likely to cause issues in imported meshes.
- Fix T97795: use 1.0 default if -bm value is missing, instead of zero.

Reviewed By: Howard Trickey
Differential Revision: https://developer.blender.org/D14826
2022-05-03 14:45:44 +03:00
5f5e7ac317 Fix T97757: Some MTL import correctness issues in the new OBJ importer
Fix several correctness issues where the new OBJ/MTL importer was not
producing the same results as the old one, mostly because the code for
some reason had slightly different logic. Fixes T97757:

- When .obj file tries to use a material that does not exist, the code
  was continuing to use the previous material, instead of creating new
  default one, as the previous importer did.
- Previous importer was always searching/parsing "foo.mtl" for a
  "foo.obj" file, even if the file itself does not contain
  "mtllib foo.mtl" statement. One file from T97757 repros happens to
  depend on that, so resurrect that behavior.
- When IOR (Ni) or Alpha (d) are not specified in .mtl file, do not
  wrongly set -1 values to the blender material.
- When base (Kd) or emissive (Ke) colors are not specified in the .mtl
  file, do not set them on the blender material.
- Roughness and metallic values used by viewport shading were not set
  onto blender material.
- The logic for when metallic was set to zero was incorrect; it should
  be set to zero when "not using reflection", not when "mtl file does
  not contain metallic".
- Do not produce a warning when illum value is not spelled out in .mtl
  file, treat as default (1).
- Parse illum as a float just like python importer does, as to not
  reintroduce part of T60135.

Reviewed By: Howard Trickey
Differential Revision: https://developer.blender.org/D14822
2022-05-03 14:44:49 +03:00
11d075f07d Cleanup: Move color attribute enums to be reusable
These enum property arrays are used by a few patches
in review. Moving them here means they don't have to
be duplicated.
2022-05-03 12:23:17 +02:00
Nate Rupsis
61e8310b75 NLA: improve visibility of action & active channel
Selecting Action channel in NLA now sets the context in the N-panel. The
actively selected channel is now also drawn in a different way, so that
it's visible which one is selected.

Old:
- The NLA sidebar didn't refresh with the creation of a new action.
- There was no indication of the action channel being selected.

New:
- NLA side bar now refreshed when keyframes are added (new action is created)
- Clicking on the action channel now gives visual indication of being selected

Reviewed By: RiggingDojo, sybren

Maniphest Tasks: T97372

Differential Revision: https://developer.blender.org/D14820
2022-05-03 12:00:42 +02:00
46d7bcc068 Merge branch 'blender-v3.2-release' 2022-05-03 10:56:24 +02:00
a2e3005b42 Fix VSE view clamping not working
Clamping was set up, but `v2d->cur` was never actually modified.
2022-05-03 10:55:05 +02:00
2ea9d1fccf Fix T97720: Fix meta strip shows incorrect mute state.
Caused by only checking mute state for meta strip itself and not the
children.
2022-05-03 10:55:05 +02:00
6b74c8e486 Merge branch 'blender-v3.2-release' 2022-05-03 10:34:46 +02:00
20f819d708 Fix T95541: Broken vertex weight with mirror modifier.
Regression from rB1a7757b0bc69/rBa0acb9bd0cc0. Special handling
(averaging) of weights on merged center vertices also requires to be
'reversed' when new correct merge order is used, compared to previous
behavior.
2022-05-03 10:33:38 +02:00
cd1044fb2b Merge branch 'blender-v3.2-release' 2022-05-03 18:33:24 +10:00
31bf70e35c Merge branch 'blender-v3.2-release' 2022-05-03 18:33:21 +10:00
cfdec85cd9 Cleanup: auto-format 2022-05-03 18:32:12 +10:00
4824cad580 GNUmakefile: include autopep8 in the "make format" target
Run autopep8 as well as clang-format when calling "make format",
the PATHS argument is passed to both utilities which will only operate
on files they support.

For example: `make format PATHS=release/scripts` formats Python scripts,
`make format PATHS=source/blender/blenlib` would format C/C++.
If users really want they can format C/C++ & Python files at the same
time since both formatting utilities filter on file extension.

`make format PATHS="release/scripts/startup/nodeitems_builtins.py source/creator/creator.c"`

A LIBDIR variable has been added to the GNUmakefile to simplify
references to this directory which can be one of 3 possible values.

Reviewed By: sybren, brecht

Ref D14789
2022-05-03 18:32:00 +10:00
61b65e9c9b Merge branch 'blender-v3.2-release' 2022-05-03 18:24:29 +10:00
4196772ae8 Merge branch 'blender-v3.2-release' 2022-05-03 18:24:26 +10:00
3a002bff7a Merge branch 'blender-v3.2-release' 2022-05-03 18:24:22 +10:00
74dfb7ca23 Fix T97731: Python traceback no longer includes line-numbers
Regression caused by [0] that caused the error message to be
created based on a normalized exception (which hid line numbers).

PyC_ExceptionBuffer{_Simple} & BPy_errors_to_report
no longer clears the exception.

This could have been resolved by changing python_script_error_jump
however that would involve changes to reference counting that are more
risky (noted in code-comment).

[0]: 2d2baeaf04
2022-05-03 18:22:54 +10:00
a821a2db3d Cleanup: remove redundant PyErr_Clear calls after PyErr_Fetch 2022-05-03 18:22:54 +10:00
1fc95d829f CMake: fix error building when CUDA_NVCC_EXECUTABLE is missing 2022-05-03 18:22:54 +10:00
f5dc675537 Merge branch 'blender-v3.2-release' 2022-05-03 10:21:35 +02:00
daa9edc9be Fix T97744: Speed effect causes memory leak
Leak was caused because output image buffer was initialized twice. Once
in speed effect strip and then by cross effect strip used for
interpolation feature.
2022-05-03 10:20:41 +02:00
fd98403211 Fix T97733: Crash when adding new scene
Caused by NULL dereference if sequencer data does not exist.
2022-05-03 10:20:41 +02:00
8e71ba12e5 Merge branch 'blender-v3.2-release' 2022-05-03 09:50:32 +02:00
f80e4f0046 Fix T93272: Material index mapping missing for mesh boolean node
This commit implements copying of materials and material indices from
all of the boolean node's input meshes. The materials are added to the
final mesh in the order that they appear when looking through the
materials of the input meshes in the same order of the multi-socket
input node.

All material remapping is done with mesh-level materials. Object-level
materials are not considered, since the meshes don't come from objects.

Merging all materials rather than just the materials on the first mesh
requires a change to the boolean-mesh conversion. This subtly changes
the behavior for object linked materials, but in a good way I think;
now the material remap arrays are respected no matter the number
of materials on the first mesh input.

Differential Revision: https://developer.blender.org/D14788
2022-05-03 09:47:40 +02:00
af2740abc0 Fix T97718: Crash using "Text on Curve"
8e4c3c6a24 mistakenly used the `vec` argument
of `BKE_where_on_path` like it was optional. Fix by
making that argument optional too.
2022-05-03 09:47:40 +02:00
00fb44797a Fix T97543: Changing multipass images doesn't update the image.
Code was partial migrated from the previous image engine. Missing multilayered
images.
2022-05-03 09:47:40 +02:00
cc0c4c17f0 Fix T95752: crash 'Select Linked' after loopcut in multiobject editmode
This was reported explicitly for originally being in face selectmode,
but could also crash when in vertex selectmode (when doing multiple
cuts).

The reason here is that `MESH_OT_loopcut` switches to edge select mode
(needed for `TRANSFORM_OT_edge_slide`, done in `ringsel_finish`), but was
only doing this on the active object's editmesh, all other participating
meshes would keep their selectmode which would now be out of sync with
both the active object's editmesh and scene settings for these.

This causes problems later in 'Select Linked'. Here, a mixture of
objects are used. First the viewcontext is set up with the active
object, then all participating objects are iterated (changing the
viewcontext to another object), then `unified_findnearest` would use that
changed viewcontext which would now contain the last object iterated. To
repeat: this could now have a different selectmode than the active
object which is later **again** used to get the nearest `BMElem` from in
`EDBM_elem_from_selectmode`. So in the failing case, we could get an
edge (but no face because of edge selectmode) from `unified_findnearest`,
`EDBM_elem_from_selectmode` would return NULL though (edge provided, but
in face selectmode), leading to the crash.

To solve this I assume it is best to change selectmode on all
participating meshes in multi-object editmode loopcut if necessary so
these are always in sync for following operations.
Alternatively, `Select Linked` (and probably lots more operators) would
have to be tweaked to pay closer attention which object is really used
to get selectmode from.

Note the selectmode is actually set back from edge selectmode in certain
cases (see `USE_LOOPSLIDE_HACK`), this patch changes that as well to act
on all participating meshes.

Maniphest Tasks: T95752

Differential Revision: https://developer.blender.org/D14791
2022-05-03 09:46:18 +02:00
1a6d0ec71c Fix T93272: Material index mapping missing for mesh boolean node
This commit implements copying of materials and material indices from
all of the boolean node's input meshes. The materials are added to the
final mesh in the order that they appear when looking through the
materials of the input meshes in the same order of the multi-socket
input node.

All material remapping is done with mesh-level materials. Object-level
materials are not considered, since the meshes don't come from objects.

Merging all materials rather than just the materials on the first mesh
requires a change to the boolean-mesh conversion. This subtly changes
the behavior for object linked materials, but in a good way I think;
now the material remap arrays are respected no matter the number
of materials on the first mesh input.

Differential Revision: https://developer.blender.org/D14788
2022-05-03 09:28:35 +02:00
c09c3246eb Fix T97718: Crash using "Text on Curve"
8e4c3c6a24 mistakenly used the `vec` argument
of `BKE_where_on_path` like it was optional. Fix by
making that argument optional too.
2022-05-03 09:25:28 +02:00
3d96fd6fd6 Fix T97543: Changing multipass images doesn't update the image.
Code was partial migrated from the previous image engine. Missing multilayered
images.
2022-05-03 09:12:00 +02:00
56039e30c7 Merge branch 'blender-v3.2-release' 2022-05-03 09:10:57 +02:00
38a4d96a90 Fix T97507: Crash when deleting adjustment layer
Issue was not properly fixed in 3cef9ebaf8 due to oversight.
`SEQ_get_channels_by_seq` returned pointer to `seqbase` instead of `channels`.
2022-05-03 08:47:27 +02:00
e4e5d7781e Fix T97547: Stereo rendering crash.
Viewports weren't drawn as they couldn't get a lock. Resulted in compositing
uninitialized viewports. Fixed by checking that both views were drawn.
2022-05-03 08:21:08 +02:00
e62b5e867d Cleanup: spelling in comments 2022-05-03 15:11:27 +10:00
ab7379ae62 Merge branch 'blender-v3.2-release' 2022-05-03 14:58:09 +10:00
4ee8dfa8b3 Fix use after free error when exiting a temp screen
Regression in [0] caused by checking the screen after event handling.

[0]: d4bdf21929
2022-05-03 14:50:40 +10:00
80c8a7dcb0 Merge branch 'blender-v3.2-release' 2022-05-03 13:27:20 +10:00
8810d0cecd Fix T85379: Cube projection size parameter is wrong
The input size was doubled & inverted.
2022-05-03 13:26:46 +10:00
e5a738af6d Merge branch 'blender-v3.2-release' 2022-05-03 09:49:09 +10:00
ecc2ec724e Cleanup: quiet shadow warning 2022-05-03 09:43:56 +10:00
79d4740eda Cleanup: use context.temp_override
Remove use of deprecated operator context passing.

Also minor clarification in the context.temp_override docs.
2022-05-03 09:32:28 +10:00
309b6319a0 Cleanup: quiet unused variable warning 2022-05-03 09:32:27 +10:00
Henrik Dick
fd7384a751 Merge branch 'blender-v3.2-release' 2022-05-02 22:18:21 +02:00
Henrik Dick
62ef1c08af GPencil: Fix envelope modifier deform mode thickness
The thickness in the deform mode was just correct if the radius when
drawing a stroke was set to 20. Now all factors that influence the
stroke thickness are considered in deform mode.

Differential Revision: https://developer.blender.org/D14691
2022-05-02 22:13:38 +02:00
0d9e22d43c GPencil: New Noise modifier random in Keyframes only
This is for some animation styles that usually copy and paste keyframes and they want avoid that both frames look equal, but they don't want noise randomness changes in the inbetween frames.

The patch adds a new random `Mode` option to select when the noise change.

Reviewed By: pepeland

Maniphest Tasks: T97099

Differential Revision: https://developer.blender.org/D14566
2022-05-02 17:36:58 +02:00
b1e0be0d25 Merge branch 'blender-v3.2-release' 2022-05-02 16:06:42 +02:00
ab5d52a6db GPencil: New Sculpt Auto masking options
Now it's possible to use auto masking at 3 levels:

* Stroke
* Layer
* Material

The masking options can be combined and allows to limit the effect of the sculpt brush.

Diff Revision: https://developer.blender.org/D14589
2022-05-02 16:05:04 +02:00
5188c14718 Fix T97688: Deleting a scene with a scene strip causes the referenced scene to have zero users
Relinking code would weirdly enough allow clearing of extra/fake user
status on IDs used by affected ID, which would be utterly wrong.

Fairly unclear why this was working OK in reported case before rBa71a513def20,
could not spot any obvious reason just from reading code...

Also, in `libblock_remap_data_update_tags`, only transfer fake user
status if `new_id` is not NULL (otherwise that would have removed that
falg from `old_id`, without actually transferring it to anything).
2022-05-02 15:58:53 +02:00
263f56ba49 Add RNA accessor for 'extra user' ID tag,
Not expected to be used directly by users, but very handy to have around
for investigations and debugging.
2022-05-02 15:58:53 +02:00
4c3efb4320 Cleanup: fix "parameter unused" warning
No functional changes.
2022-05-02 14:34:31 +02:00
e07ac34b3f Merge branch 'blender-v3.2-release' 2022-05-02 12:21:15 +02:00
Ethan-Hall
3d5f5c2d9a Color Attributes: Add initial fill color option
This patch adds allows the user to select the initial fill color when
adding a new color attribute layer.

---
{F13035372}

Reviewed By: JulienKaspar, joeedh

Differential Revision: https://developer.blender.org/D14743
2022-05-02 12:18:23 +02:00
38394e1a32 GPU: Remove OCIO workaround for Apple.
OCIO shader was ported to use GPUShaderCreateInfo a while ago. That
made this workaround not needed anymore.

Best to remove it before the release.
2022-05-02 12:15:21 +02:00
d0948dfb17 Merge branch 'blender-v3.2-release' 2022-05-02 11:58:20 +02:00
b54c6a20aa Curves: fix brush position is not under mouse cursor
This was mostly noticable in the case of the Delete brush, when
clicking somewhere in empty space. It used the closest point on
a curve as brush position.
2022-05-02 11:36:42 +02:00
1b0da28038 EEVEE: Fix compiler warning 2022-05-02 11:22:57 +02:00
951fae3578 Revert "Blender 3.2 splashscreen"
This reverts commit d1cbfc81bb.
2022-05-02 11:06:38 +02:00
4f3b562506 Revert "Blender 3.2 - Beta"
This reverts commit da46ed9116.
2022-05-02 11:06:21 +02:00
0c80a0acd8 Merge branch 'blender-v3.2-release' 2022-05-02 11:05:53 +02:00
d1cbfc81bb Blender 3.2 splashscreen
Credits: Oksana Dobrovolska
2022-05-02 10:38:59 +02:00
da46ed9116 Blender 3.2 - Beta
* BLENDER_VERSION_CYCLE set to beta
* Update pipeline_config.yaml to point to 3.2 branches and svn tags
* Update and uncomment BLENDER_VERSION in download.cmake
2022-05-02 10:35:39 +02:00
46b32c9d7b Blender 3.3 bcon1 - alpha
Bump the version number for the new release cycle.
2022-05-02 10:28:30 +02:00
12baea1b8e EEVEE: Fix compilation on MSVC 2022-05-02 10:09:46 +02:00
8ece0816d9 EEVEE: Rewrite: Implement nodetree support with every geometry types
This commit introduce back support for all geometry types and all nodetree support.
Only the forward shading pipeline is implemented for now.

Vertex Displacement is automatically enabled for now.

Lighting & Shading is placeholder.

Related Task: T93220

# Conflicts:
#	source/blender/draw/engines/eevee_next/eevee_engine.cc
#	source/blender/gpu/CMakeLists.txt
2022-05-02 09:35:45 +02:00
f0f44fd92f Curves: support spherical delete brush
Differential Revision: https://developer.blender.org/D14797
2022-05-02 09:18:57 +02:00
a5644f9a28 Cleanup: GPUBuiltinShader: Remove old shader interfaces
This leaves some of the unresolved case where we still need both
implementation.
2022-05-02 01:31:24 +02:00
aaab3c8ad4 Cleanup: GPUShader: Make style consistent in builtin_shader_stages 2022-05-02 01:05:35 +02:00
f0118e9aca GPUShader: Remove GPU_SHADER_INSTANCE_VARIYING_COLOR_VARIYING_SIZE
This had only one use and it was for debugging. Remove the shader for now.
This also simplifies the debug drawing even if slower.
2022-05-02 00:57:32 +02:00
5e5e198bbe GPUShader: Port 3D uniform color clipped shaders to use shaderCreateInfo
This should have no functional changes.
2022-05-02 00:44:58 +02:00
0676963809 GPUShader: Port dashed line shaders to use shaderCreateInfo
This should have no functional changes.

This reduce the complexity of the shader by only supporting 2 colors.
We never use more than 2 color in practice and this makes usage not require
a UBO.
2022-05-02 00:35:49 +02:00
2a7a01b339 GPUShader: Port polyline shaders to use shaderCreateInfo
This should have no functional changes.
2022-05-01 23:54:41 +02:00
aa34706aac Fix T97545 DRW: Crash cause by invalid " char in glsl source
Some old compiler do not like this character even if inside an `#error`
directive.
2022-05-01 22:42:07 +02:00
3f0c09f6dd GPUShaderCreateInfo: Add validation for overlapping vertex attribute
Those are usually not supported but some driver silently fix them and most
just silently fail (rendering error).
2022-05-01 22:28:38 +02:00
fc872d738e GPUShader: Port 2D widget shaders to use shaderCreateInfo
This should have no functional changes.
2022-05-01 21:12:59 +02:00
a330b9b0ea GL: Add attribute-less shader workaround for MacOS to the backend
This workaround and the issue was described in D4490. This makes sure
any shader using `shaderCreateInfo` will benefit from the same workaround.
2022-05-01 20:54:33 +02:00
631506d9c3 External Engine: Reuse depth only shader from Basic engine
This removes the usage of `GPU_shader_create_from_info_name()`.
2022-05-01 19:35:37 +02:00
eba06fee49 Basic Engine: Port depth shader (object selection) to shaderCreateInfo
This should have no functional changes.
2022-05-01 19:35:37 +02:00
3555 changed files with 148451 additions and 78054 deletions

View File

@@ -265,6 +265,7 @@ ForEachMacros:
- SET_SLOT_PROBING_BEGIN
- MAP_SLOT_PROBING_BEGIN
- VECTOR_SET_SLOT_PROBING_BEGIN
- WL_ARRAY_FOR_EACH
StatementMacros:
- PyObject_HEAD

View File

@@ -1,6 +1,8 @@
# The warnings below are disabled because they are too pedantic and not worth fixing.
# Some of them will be enabled as part of the Clang-Tidy task, see T78535.
# NOTE: No comments in the list below is allowed. Clang-tidy will ignore items after comments in the lists flag list.
# This is because the comment is not a valid list item and it will stop parsing flags if a list item is a comment.
Checks: >
-*,
readability-*,
@@ -14,10 +16,9 @@ Checks: >
-readability-make-member-function-const,
-readability-suspicious-call-argument,
-readability-redundant-member-init,
-readability-misleading-indentation,
-readability-use-anyofallof,
-readability-identifier-length,
-readability-function-cognitive-complexity,
@@ -35,6 +36,8 @@ Checks: >
-bugprone-redundant-branch-condition,
-bugprone-suspicious-include,
modernize-*,
-modernize-use-auto,
-modernize-use-trailing-return-type,
@@ -42,8 +45,6 @@ Checks: >
-modernize-use-nodiscard,
-modernize-loop-convert,
-modernize-pass-by-value,
# Cannot be enabled yet, because using raw string literals in tests breaks
# the windows compiler currently.
-modernize-raw-string-literal,
-modernize-return-braced-init-list

View File

@@ -222,6 +222,17 @@ if(UNIX AND NOT (APPLE OR HAIKU))
option(WITH_GHOST_WAYLAND "Enable building Blender against Wayland for windowing (under development)" OFF)
mark_as_advanced(WITH_GHOST_WAYLAND)
if (WITH_GHOST_WAYLAND)
option(WITH_GHOST_WAYLAND_LIBDECOR "Optionally build with LibDecor window decorations" OFF)
mark_as_advanced(WITH_GHOST_WAYLAND_LIBDECOR)
option(WITH_GHOST_WAYLAND_DBUS "Optionally build with DBUS support (used for Cursor themes). May hang on startup systems where DBUS is not used." OFF)
mark_as_advanced(WITH_GHOST_WAYLAND_DBUS)
option(WITH_GHOST_WAYLAND_DYNLOAD "Enable runtime dynamic WAYLAND libraries loading" OFF)
mark_as_advanced(WITH_GHOST_WAYLAND_DYNLOAD)
endif()
endif()
if(WITH_GHOST_X11)
@@ -255,19 +266,11 @@ if(WITH_GHOST_X11)
endif()
if(UNIX AND NOT APPLE)
option(WITH_SYSTEM_GLEW "Use GLEW OpenGL wrapper library provided by the operating system" OFF)
option(WITH_SYSTEM_GLES "Use OpenGL ES library provided by the operating system" ON)
option(WITH_SYSTEM_FREETYPE "Use the freetype library provided by the operating system" OFF)
else()
# not an option for other OS's
set(WITH_SYSTEM_GLEW OFF)
set(WITH_SYSTEM_GLES OFF)
set(WITH_SYSTEM_FREETYPE OFF)
endif()
if(UNIX AND NOT APPLE)
option(WITH_SYSTEM_EIGEN3 "Use the systems Eigen3 library" OFF)
else()
set(WITH_SYSTEM_FREETYPE OFF)
set(WITH_SYSTEM_EIGEN3 OFF)
endif()
@@ -300,6 +303,9 @@ option(WITH_USD "Enable Universal Scene Description (USD) Suppor
# 3D format support
# Disable opencollada when we don't have precompiled libs
option(WITH_OPENCOLLADA "Enable OpenCollada Support (http://www.opencollada.org)" ON)
option(WITH_IO_WAVEFRONT_OBJ "Enable Wavefront-OBJ 3D file format support (*.obj)" ON)
option(WITH_IO_STL "Enable STL 3D file format support (*.stl)" ON)
option(WITH_IO_GPENCIL "Enable grease-pencil file format IO (*.svg, *.pdf)" ON)
# Sound output
option(WITH_SDL "Enable SDL for sound" ON)
@@ -441,7 +447,7 @@ endif()
if(NOT APPLE)
option(WITH_CYCLES_DEVICE_HIP "Enable Cycles AMD HIP support" ON)
option(WITH_CYCLES_HIP_BINARIES "Build Cycles AMD HIP binaries" OFF)
set(CYCLES_HIP_BINARIES_ARCH gfx1010 gfx1011 gfx1012 gfx1030 gfx1031 gfx1032 gfx1034 CACHE STRING "AMD HIP architectures to build binaries for")
set(CYCLES_HIP_BINARIES_ARCH gfx900 gfx906 gfx90c gfx902 gfx1010 gfx1011 gfx1012 gfx1030 gfx1031 gfx1032 gfx1034 gfx1035 CACHE STRING "AMD HIP architectures to build binaries for")
mark_as_advanced(WITH_CYCLES_DEVICE_HIP)
mark_as_advanced(CYCLES_HIP_BINARIES_ARCH)
endif()
@@ -451,6 +457,21 @@ if(APPLE)
option(WITH_CYCLES_DEVICE_METAL "Enable Cycles Apple Metal compute support" ON)
endif()
# oneAPI
if(NOT APPLE)
option(WITH_CYCLES_DEVICE_ONEAPI "Enable Cycles oneAPI compute support" OFF)
option(WITH_CYCLES_ONEAPI_BINARIES "Enable Ahead-Of-Time compilation for Cycles oneAPI device" OFF)
option(WITH_CYCLES_ONEAPI_SYCL_HOST_ENABLED "Enable use of SYCL host (CPU) device execution by oneAPI implementation. This option is for debugging purposes and impacts GPU execution." OFF)
# https://www.intel.com/content/www/us/en/develop/documentation/oneapi-dpcpp-cpp-compiler-dev-guide-and-reference/top/compilation/ahead-of-time-compilation.html
SET (CYCLES_ONEAPI_SPIR64_GEN_DEVICES "dg2" CACHE STRING "oneAPI Intel GPU architectures to build binaries for")
SET (CYCLES_ONEAPI_SYCL_TARGETS spir64 spir64_gen CACHE STRING "oneAPI targets to build AOT binaries for")
mark_as_advanced(WITH_CYCLES_ONEAPI_SYCL_HOST_ENABLED)
mark_as_advanced(CYCLES_ONEAPI_SPIR64_GEN_DEVICES)
mark_as_advanced(CYCLES_ONEAPI_SYCL_TARGETS)
endif()
# Draw Manager
option(WITH_DRAW_DEBUG "Add extra debug capabilities to Draw Manager" OFF)
mark_as_advanced(WITH_DRAW_DEBUG)
@@ -486,7 +507,7 @@ if((UNIX AND NOT APPLE) OR (CMAKE_GENERATOR MATCHES "^Visual Studio.+"))
endif()
option(WITH_BOOST "Enable features depending on boost" ON)
option(WITH_TBB "Enable features depending on TBB (OpenVDB, OpenImageDenoise, sculpt multithreading)" ON)
option(WITH_TBB "Enable multithreading. TBB is also required for features such as Cycles, OpenVDB and USD" ON)
# TBB malloc is only supported on for windows currently
if(WIN32)
@@ -515,20 +536,48 @@ endif()
# OpenGL
# Experimental EGL option.
option(WITH_GL_EGL "Use the EGL OpenGL system library instead of the platform specific OpenGL system library (CGL, GLX or WGL)" OFF)
mark_as_advanced(WITH_GL_EGL)
if(WITH_GHOST_WAYLAND)
# Wayland can only use EGL to create OpenGL contexts, not GLX.
set(WITH_GL_EGL ON)
endif()
if(UNIX AND NOT APPLE)
if(WITH_GL_EGL)
# GLEW can only be built with either GLX or EGL support. Most binary distributions are
# built with GLX support and we have no automated way to detect this. So always build
# GLEW from source to be sure it has EGL support.
set(WITH_SYSTEM_GLEW OFF)
else()
option(WITH_SYSTEM_GLEW "Use GLEW OpenGL wrapper library provided by the operating system" OFF)
endif()
option(WITH_SYSTEM_GLES "Use OpenGL ES library provided by the operating system" ON)
else()
# System GLEW and GLES not an option on other platforms.
set(WITH_SYSTEM_GLEW OFF)
set(WITH_SYSTEM_GLES OFF)
endif()
option(WITH_OPENGL "When off limits visibility of the opengl headers to just bf_gpu and gawain (temporary option for development purposes)" ON)
option(WITH_GLEW_ES "Switches to experimental copy of GLEW that has support for OpenGL ES. (temporary option for development purposes)" OFF)
option(WITH_GL_EGL "Use the EGL OpenGL system library instead of the platform specific OpenGL system library (CGL, glX, or WGL)" OFF)
option(WITH_GL_PROFILE_ES20 "Support using OpenGL ES 2.0. (through either EGL or the AGL/WGL/XGL 'es20' profile)" OFF)
option(WITH_GPU_SHADER_BUILDER "Shader builder is a developer option enabling linting on GLSL during compilation" OFF)
option(WITH_GPU_BUILDTIME_SHADER_BUILDER "Shader builder is a developer option enabling linting on GLSL during compilation" OFF)
mark_as_advanced(
WITH_OPENGL
WITH_GLEW_ES
WITH_GL_EGL
WITH_GL_PROFILE_ES20
WITH_GPU_SHADER_BUILDER
WITH_GPU_BUILDTIME_SHADER_BUILDER
)
if(WITH_HEADLESS)
set(WITH_OPENGL OFF)
endif()
# Metal
if (APPLE)
@@ -765,6 +814,7 @@ endif()
set_and_warn_dependency(WITH_PYTHON WITH_CYCLES OFF)
set_and_warn_dependency(WITH_PYTHON WITH_DRACO OFF)
set_and_warn_dependency(WITH_PYTHON WITH_MOD_FLUID OFF)
if(WITH_DRACO AND NOT WITH_PYTHON_INSTALL)
message(STATUS "WITH_DRACO requires WITH_PYTHON_INSTALL to be ON, disabling WITH_DRACO for now")
@@ -781,7 +831,9 @@ set_and_warn_dependency(WITH_BOOST WITH_OPENCOLORIO OFF)
set_and_warn_dependency(WITH_BOOST WITH_QUADRIFLOW OFF)
set_and_warn_dependency(WITH_BOOST WITH_USD OFF)
set_and_warn_dependency(WITH_BOOST WITH_ALEMBIC OFF)
set_and_warn_dependency(WITH_PUGIXML WITH_CYCLES_OSL OFF)
if(WITH_CYCLES)
set_and_warn_dependency(WITH_PUGIXML WITH_CYCLES_OSL OFF)
endif()
set_and_warn_dependency(WITH_PUGIXML WITH_OPENIMAGEIO OFF)
if(WITH_BOOST AND NOT (WITH_CYCLES OR WITH_OPENIMAGEIO OR WITH_INTERNATIONAL OR
@@ -935,7 +987,10 @@ set(PLATFORM_CFLAGS)
set(C_WARNINGS)
set(CXX_WARNINGS)
# for gcc -Wno-blah-blah
# NOTE: These flags are intended for situations where where it's impractical to
# suppress warnings by modifying the code or for code which is maintained externally.
# For GCC this typically means adding `-Wno-*` arguments to negate warnings
# that are useful in the general case.
set(C_REMOVE_STRICT_FLAGS)
set(CXX_REMOVE_STRICT_FLAGS)
@@ -1455,14 +1510,6 @@ if(WITH_LIBMV OR WITH_GTESTS OR (WITH_CYCLES AND WITH_CYCLES_LOGGING))
endif()
endif()
#-----------------------------------------------------------------------------
# Configure Ceres
if(WITH_LIBMV)
# We always have C++11 which includes unordered_map.
set(CERES_DEFINES "-DCERES_STD_UNORDERED_MAP;-DCERES_USE_CXX_THREADS")
endif()
#-----------------------------------------------------------------------------
# Extra limits to number of jobs running in parallel for some kind os tasks.
# Only supported by Ninja build system currently.
@@ -1539,7 +1586,6 @@ endif()
if(CMAKE_COMPILER_IS_GNUCC)
ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_ALL -Wall)
ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_CAST_ALIGN -Wcast-align)
ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_ERROR_IMPLICIT_FUNCTION_DECLARATION -Werror=implicit-function-declaration)
ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_ERROR_RETURN_TYPE -Werror=return-type)
ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_ERROR_VLA -Werror=vla)
@@ -1624,6 +1670,18 @@ if(CMAKE_COMPILER_IS_GNUCC)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_IMPLICIT_FALLTHROUGH -Wimplicit-fallthrough=5)
endif()
#----------------------
# Suppress Strict Flags
#
# Exclude the following warnings from this list:
# - `-Wno-address`:
# This can give useful hints that point to bugs/misleading logic.
# - `-Wno-strict-prototypes`:
# No need to support older C-style prototypes.
#
# If code in `./extern/` needs to suppress these flags that can be done on a case-by-case basis.
# flags to undo strict flags
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_DEPRECATED_DECLARATIONS -Wno-deprecated-declarations)
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_PARAMETER -Wno-unused-parameter)
@@ -1679,6 +1737,9 @@ elseif(CMAKE_C_COMPILER_ID MATCHES "Clang")
# ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_UNUSED_MACROS -Wunused-macros)
# ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_UNUSED_MACROS -Wunused-macros)
#----------------------
# Suppress Strict Flags
# flags to undo strict flags
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_PARAMETER -Wno-unused-parameter)
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_VARIABLE -Wno-unused-variable)
@@ -1744,6 +1805,7 @@ elseif(CMAKE_C_COMPILER_ID MATCHES "MSVC")
"/wd4828" # The file contains a character that is illegal
"/wd4996" # identifier was declared deprecated
"/wd4661" # no suitable definition provided for explicit template instantiation request
"/wd4848" # 'no_unique_address' is a vendor extension in C++17
# errors:
"/we4013" # 'function' undefined; assuming extern returning int
"/we4133" # incompatible pointer types

View File

@@ -120,7 +120,7 @@ Utilities
Updates git and all submodules but not svn.
* format:
Format source code using clang (uses PATHS if passed in). For example::
Format source code using clang-format & autopep8 (uses PATHS if passed in). For example::
make format PATHS="source/blender/blenlib source/blender/blenkernel"
@@ -130,6 +130,7 @@ Environment Variables
* BUILD_DIR: Override default build path.
* PYTHON: Use this for the Python command (used for checking tools).
* NPROCS: Number of processes to use building (auto-detect when omitted).
* AUTOPEP8: Command used for Python code-formatting (used for the format target).
Documentation Targets
Not associated with building Blender.
@@ -206,6 +207,27 @@ ifeq ($(OS_NCASE),darwin)
endif
endif
# Set the LIBDIR, an empty string when not found.
LIBDIR:=$(wildcard ../lib/${OS_NCASE}_${CPU})
ifeq (, $(LIBDIR))
LIBDIR:=$(wildcard ../lib/${OS_NCASE}_centos7_${CPU})
endif
ifeq (, $(LIBDIR))
LIBDIR:=$(wildcard ../lib/${OS_NCASE})
endif
# Use the autopep8 module in ../lib/ (which can be executed via Python directly).
# Otherwise the "autopep8" command can be used.
ifndef AUTOPEP8
ifneq (, $(LIBDIR))
AUTOPEP8:=$(wildcard $(LIBDIR)/python/lib/python3.10/site-packages/autopep8.py)
endif
ifeq (, $(AUTOPEP8))
AUTOPEP8:=autopep8
endif
endif
# -----------------------------------------------------------------------------
# additional targets for the build configuration
@@ -527,8 +549,8 @@ update_code: .FORCE
@$(PYTHON) ./build_files/utils/make_update.py --no-libraries
format: .FORCE
@PATH="../lib/${OS_NCASE}_${CPU}/llvm/bin/:../lib/${OS_NCASE}_centos7_${CPU}/llvm/bin/:../lib/${OS_NCASE}/llvm/bin/:$(PATH)" \
$(PYTHON) source/tools/utils_maintenance/clang_format_paths.py $(PATHS)
@PATH="${LIBDIR}/llvm/bin/:$(PATH)" $(PYTHON) source/tools/utils_maintenance/clang_format_paths.py $(PATHS)
@$(PYTHON) source/tools/utils_maintenance/autopep8_format_paths.py --autopep8-command="$(AUTOPEP8)" $(PATHS)
# -----------------------------------------------------------------------------

View File

@@ -29,10 +29,12 @@ cmake_minimum_required(VERSION 3.5)
include(ExternalProject)
include(cmake/check_software.cmake)
include(cmake/versions.cmake)
include(cmake/options.cmake)
# versions.cmake needs to be included after options.cmake due to the BLENDER_PLATFORM_ARM variable being needed.
include(cmake/versions.cmake)
include(cmake/boost_build_options.cmake)
include(cmake/download.cmake)
include(cmake/macros.cmake)
if(ENABLE_MINGW64)
include(cmake/setup_mingw64.cmake)
@@ -54,13 +56,9 @@ include(cmake/freetype.cmake)
include(cmake/freeglut.cmake)
include(cmake/glew.cmake)
include(cmake/alembic.cmake)
include(cmake/glfw.cmake)
include(cmake/clew.cmake)
include(cmake/cuew.cmake)
include(cmake/opensubdiv.cmake)
include(cmake/sdl.cmake)
include(cmake/opencollada.cmake)
include(cmake/llvm.cmake)
if(APPLE)
include(cmake/openmp.cmake)
endif()
@@ -78,6 +76,7 @@ include(cmake/osl.cmake)
include(cmake/tbb.cmake)
include(cmake/openvdb.cmake)
include(cmake/python.cmake)
include(cmake/llvm.cmake)
option(USE_PIP_NUMPY "Install NumPy using pip wheel instead of building from source" OFF)
if(APPLE AND ("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "x86_64"))
set(USE_PIP_NUMPY ON)
@@ -99,6 +98,15 @@ include(cmake/fmt.cmake)
include(cmake/robinmap.cmake)
if(NOT APPLE)
include(cmake/xr_openxr.cmake)
if(NOT WIN32 OR BUILD_MODE STREQUAL Release)
include(cmake/dpcpp.cmake)
include(cmake/dpcpp_deps.cmake)
endif()
if(NOT WIN32)
include(cmake/igc.cmake)
include(cmake/gmmlib.cmake)
include(cmake/ocloc.cmake)
endif()
endif()
# OpenColorIO and dependencies.
@@ -131,6 +139,7 @@ if(NOT WIN32 OR ENABLE_MINGW64)
include(cmake/vpx.cmake)
include(cmake/x264.cmake)
include(cmake/xvidcore.cmake)
include(cmake/aom.cmake)
include(cmake/ffmpeg.cmake)
include(cmake/fftw.cmake)
include(cmake/sndfile.cmake)

View File

@@ -42,4 +42,5 @@ endif()
add_dependencies(
external_alembic
external_openexr
external_imath
)

View File

@@ -0,0 +1,45 @@
# SPDX-License-Identifier: GPL-2.0-or-later
if(WIN32)
# The default generator on windows is msbuild, which we do not
# want to use for this dep, as needs to build with mingw
set(AOM_GENERATOR "Ninja")
# The default flags are full of MSVC options given this will be
# building with mingw, it'll have an unhappy time with that and
# we need to clear them out.
set(AOM_CMAKE_FLAGS )
# CMake will correctly identify phreads being available, however
# we do not want to use them, as that gains a dependency on
# libpthreadswin.dll which we do not want. when pthreads is not
# available oam will use a pthreads emulation layer using win32 threads
set(AOM_EXTRA_ARGS_WIN32 -DCMAKE_HAVE_PTHREAD_H=OFF)
else()
set(AOM_GENERATOR "Unix Makefiles")
set(AOM_CMAKE_FLAGS ${DEFAULT_CMAKE_FLAGS})
endif()
set(AOM_EXTRA_ARGS
-DENABLE_TESTDATA=OFF
-DENABLE_TESTS=OFF
-DENABLE_TOOLS=OFF
-DENABLE_EXAMPLES=OFF
${AOM_EXTRA_ARGS_WIN32}
)
# This is slightly different from all other deps in the way that
# aom uses cmake as a build system, but still needs the environment setup
# to include perl so we manually setup the environment and call
# cmake directly for the configure, build and install commands.
ExternalProject_Add(external_aom
URL file://${PACKAGE_DIR}/${AOM_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${AOM_HASH_TYPE}=${AOM_HASH}
PREFIX ${BUILD_DIR}/aom
CONFIGURE_COMMAND ${CONFIGURE_ENV} &&
cd ${BUILD_DIR}/aom/src/external_aom-build/ &&
${CMAKE_COMMAND} -G "${AOM_GENERATOR}" -DCMAKE_INSTALL_PREFIX=${LIBDIR}/aom ${AOM_CMAKE_FLAGS} ${AOM_EXTRA_ARGS} ${BUILD_DIR}/aom/src/external_aom/
BUILD_COMMAND ${CMAKE_COMMAND} --build .
INSTALL_COMMAND ${CMAKE_COMMAND} --build . --target install
INSTALL_DIR ${LIBDIR}/aom
)

View File

@@ -56,10 +56,7 @@ if(UNIX)
"On Debian and Ubuntu:\n"
" apt install autoconf automake libtool yasm tcl ninja-build meson python3-mako\n"
"\n"
"On macOS Intel (with homebrew):\n"
" brew install autoconf automake bison libtool pkg-config yasm\n"
"\n"
"On macOS ARM (with homebrew):\n"
"On macOS (with homebrew):\n"
" brew install autoconf automake bison flex libtool pkg-config yasm\n"
"\n"
"Other platforms:\n"

View File

@@ -1,12 +0,0 @@
# SPDX-License-Identifier: GPL-2.0-or-later
set(CLEW_EXTRA_ARGS)
ExternalProject_Add(external_clew
URL file://${PACKAGE_DIR}/${CLEW_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${CLEW_HASH_TYPE}=${CLEW_HASH}
PREFIX ${BUILD_DIR}/clew
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/clew -Wno-dev ${DEFAULT_CMAKE_FLAGS} ${CLEW_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/clew
)

View File

@@ -1,13 +0,0 @@
# SPDX-License-Identifier: GPL-2.0-or-later
set(CUEW_EXTRA_ARGS)
ExternalProject_Add(external_cuew
URL file://${PACKAGE_DIR}/${CUEW_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${CUEW_HASH_TYPE}=${CUEW_HASH}
PREFIX ${BUILD_DIR}/cuew
PATCH_COMMAND ${PATCH_CMD} --verbose -p 0 -N -d ${BUILD_DIR}/cuew/src/external_cuew < ${PATCH_DIR}/cuew.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/cuew -Wno-dev ${DEFAULT_CMAKE_FLAGS} ${CUEW_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/cuew
)

View File

@@ -39,10 +39,6 @@ download_source(FREETYPE)
download_source(GLEW)
download_source(FREEGLUT)
download_source(ALEMBIC)
download_source(GLFW)
download_source(CLEW)
download_source(GLFW)
download_source(CUEW)
download_source(OPENSUBDIV)
download_source(SDL)
download_source(OPENCOLLADA)
@@ -105,3 +101,19 @@ download_source(ROBINMAP)
download_source(IMATH)
download_source(PYSTRING)
download_source(LEVEL_ZERO)
download_source(DPCPP)
download_source(VCINTRINSICS)
download_source(OPENCLHEADERS)
download_source(ICDLOADER)
download_source(MP11)
download_source(SPIRV_HEADERS)
download_source(IGC)
download_source(IGC_LLVM)
download_source(IGC_OPENCL_CLANG)
download_source(IGC_VCINTRINSICS)
download_source(IGC_SPIRV_HEADERS)
download_source(IGC_SPIRV_TOOLS)
download_source(IGC_SPIRV_TRANSLATOR)
download_source(GMMLIB)
download_source(OCLOC)
download_source(AOM)

View File

@@ -0,0 +1,109 @@
# SPDX-License-Identifier: GPL-2.0-or-later
if(WIN32)
set(LLVM_GENERATOR "Ninja")
else()
set(LLVM_GENERATOR "Unix Makefiles")
endif()
set(DPCPP_CONFIGURE_ARGS
# When external deps dpcpp needs are not found it will automatically
# download the during the configure stage using FetchContent. Given
# we need to keep an archive of all source used during build for compliance
# reasons it CANNOT download anything we do not know about. By setting
# this property to ON, all downloads are disabled, and we will have to
# provide the missing deps some other way, a build error beats a compliance
# violation
--cmake-opt FETCHCONTENT_FULLY_DISCONNECTED=ON
)
set(DPCPP_SOURCE_ROOT ${BUILD_DIR}/dpcpp/src/external_dpcpp/)
set(DPCPP_EXTRA_ARGS
# When external deps dpcpp needs are not found it will automatically
# download the during the configure stage using FetchContent. Given
# we need to keep an archive of all source used during build for compliance
# reasons it CANNOT download anything we do not know about. By setting
# this property to ON, all downloads are disabled, and we will have to
# provide the missing deps some other way, a build or configure error
# beats a compliance violation
-DFETCHCONTENT_FULLY_DISCONNECTED=ON
-DLLVMGenXIntrinsics_SOURCE_DIR=${BUILD_DIR}/vcintrinsics/src/external_vcintrinsics/
-DOpenCL_HEADERS=file://${PACKAGE_DIR}/${OPENCLHEADERS_FILE}
-DOpenCL_LIBRARY_SRC=file://${PACKAGE_DIR}/${ICDLOADER_FILE}
-DBOOST_MP11_SOURCE_DIR=${BUILD_DIR}/mp11/src/external_mp11/
-DLEVEL_ZERO_LIBRARY=${LIBDIR}/level-zero/lib/${LIBPREFIX}ze_loader${SHAREDLIBEXT}
-DLEVEL_ZERO_INCLUDE_DIR=${LIBDIR}/level-zero/include
-DLLVM_EXTERNAL_SPIRV_HEADERS_SOURCE_DIR=${BUILD_DIR}/spirvheaders/src/external_spirvheaders/
# Below here is copied from an invocation of buildbot/config.py
-DLLVM_ENABLE_ASSERTIONS=ON
-DLLVM_TARGETS_TO_BUILD=X86
-DLLVM_EXTERNAL_PROJECTS=sycl^^llvm-spirv^^opencl^^libdevice^^xpti^^xptifw
-DLLVM_EXTERNAL_SYCL_SOURCE_DIR=${DPCPP_SOURCE_ROOT}/sycl
-DLLVM_EXTERNAL_LLVM_SPIRV_SOURCE_DIR=${DPCPP_SOURCE_ROOT}/llvm-spirv
-DLLVM_EXTERNAL_XPTI_SOURCE_DIR=${DPCPP_SOURCE_ROOT}/xpti
-DXPTI_SOURCE_DIR=${DPCPP_SOURCE_ROOT}/xpti
-DLLVM_EXTERNAL_XPTIFW_SOURCE_DIR=${DPCPP_SOURCE_ROOT}/xptifw
-DLLVM_EXTERNAL_LIBDEVICE_SOURCE_DIR=${DPCPP_SOURCE_ROOT}/libdevice
-DLLVM_ENABLE_PROJECTS=clang^^sycl^^llvm-spirv^^opencl^^libdevice^^xpti^^xptifw
-DLIBCLC_TARGETS_TO_BUILD=
-DLIBCLC_GENERATE_REMANGLED_VARIANTS=OFF
-DSYCL_BUILD_PI_HIP_PLATFORM=AMD
-DLLVM_BUILD_TOOLS=ON
-DSYCL_ENABLE_WERROR=OFF
-DSYCL_INCLUDE_TESTS=ON
-DLLVM_ENABLE_DOXYGEN=OFF
-DLLVM_ENABLE_SPHINX=OFF
-DBUILD_SHARED_LIBS=OFF
-DSYCL_ENABLE_XPTI_TRACING=ON
-DLLVM_ENABLE_LLD=OFF
-DXPTI_ENABLE_WERROR=OFF
-DSYCL_CLANG_EXTRA_FLAGS=
-DSYCL_ENABLE_PLUGINS=level_zero
-DCMAKE_INSTALL_RPATH=\$ORIGIN
-DPython3_ROOT_DIR=${LIBDIR}/python/
-DPython3_EXECUTABLE=${PYTHON_BINARY}
-DPYTHON_EXECUTABLE=${PYTHON_BINARY}
-DLLDB_ENABLE_CURSES=OFF
-DLLVM_ENABLE_TERMINFO=OFF
)
if(WIN32)
list(APPEND DPCPP_EXTRA_ARGS -DPython3_FIND_REGISTRY=NEVER)
endif()
ExternalProject_Add(external_dpcpp
URL file://${PACKAGE_DIR}/${DPCPP_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${DPCPP_HASH_TYPE}=${DPCPP_HASH}
PREFIX ${BUILD_DIR}/dpcpp
CMAKE_GENERATOR ${LLVM_GENERATOR}
SOURCE_SUBDIR llvm
LIST_SEPARATOR ^^
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/dpcpp ${DEFAULT_CMAKE_FLAGS} ${DPCPP_EXTRA_ARGS}
#CONFIGURE_COMMAND ${PYTHON_BINARY} ${BUILD_DIR}/dpcpp/src/external_dpcpp/buildbot/configure.py ${DPCPP_CONFIGURE_ARGS}
#BUILD_COMMAND echo "." #${PYTHON_BINARY} ${BUILD_DIR}/dpcpp/src/external_dpcpp/buildbot/compile.py
INSTALL_COMMAND ${CMAKE_COMMAND} --build . -- deploy-sycl-toolchain
PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/dpcpp/src/external_dpcpp < ${PATCH_DIR}/dpcpp.diff
INSTALL_DIR ${LIBDIR}/dpcpp
)
add_dependencies(
external_dpcpp
external_python
external_python_site_packages
external_vcintrinsics
external_openclheaders
external_icdloader
external_mp11
external_level-zero
external_spirvheaders
)
if(BUILD_MODE STREQUAL Release AND WIN32)
ExternalProject_Add_Step(external_dpcpp after_install
COMMAND ${CMAKE_COMMAND} -E rm -f ${LIBDIR}/dpcpp/bin/clang-cl.exe
COMMAND ${CMAKE_COMMAND} -E rm -f ${LIBDIR}/dpcpp/bin/clang-cpp.exe
COMMAND ${CMAKE_COMMAND} -E rm -f ${LIBDIR}/dpcpp/bin/clang.exe
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/dpcpp ${HARVEST_TARGET}/dpcpp
)
endif()

View File

@@ -0,0 +1,61 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# These are build time requirements for dpcpp
# We only have to unpack these dpcpp will build
# them.
ExternalProject_Add(external_vcintrinsics
URL file://${PACKAGE_DIR}/${VCINTRINSICS_FILE}
URL_HASH ${VCINTRINSICS_HASH_TYPE}=${VCINTRINSICS_HASH}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
PREFIX ${BUILD_DIR}/vcintrinsics
CONFIGURE_COMMAND echo .
BUILD_COMMAND echo .
INSTALL_COMMAND echo .
)
# opencl headers do not have to be unpacked, dpcpp will do it
# but it wouldn't hurt to do it anyway as an opertunity to validate
# the hash is correct.
ExternalProject_Add(external_openclheaders
URL file://${PACKAGE_DIR}/${OPENCLHEADERS_FILE}
URL_HASH ${OPENCLHEADERS_HASH_TYPE}=${OPENCLHEADERS_HASH}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
PREFIX ${BUILD_DIR}/openclheaders
CONFIGURE_COMMAND echo .
BUILD_COMMAND echo .
INSTALL_COMMAND echo .
)
# icdloader does not have to be unpacked, dpcpp will do it
# but it wouldn't hurt to do it anyway as an opertunity to validate
# the hash is correct.
ExternalProject_Add(external_icdloader
URL file://${PACKAGE_DIR}/${ICDLOADER_FILE}
URL_HASH ${ICDLOADER_HASH_TYPE}=${ICDLOADER_HASH}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
PREFIX ${BUILD_DIR}/icdloader
CONFIGURE_COMMAND echo .
BUILD_COMMAND echo .
INSTALL_COMMAND echo .
)
ExternalProject_Add(external_mp11
URL file://${PACKAGE_DIR}/${MP11_FILE}
URL_HASH ${MP11_HASH_TYPE}=${MP11_HASH}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
PREFIX ${BUILD_DIR}/mp11
CONFIGURE_COMMAND echo .
BUILD_COMMAND echo .
INSTALL_COMMAND echo .
)
ExternalProject_Add(external_spirvheaders
URL file://${PACKAGE_DIR}/${SPIRV_HEADERS_FILE}
URL_HASH ${SPIRV_HEADERS_HASH_TYPE}=${SPIRV_HEADERS_HASH}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
PREFIX ${BUILD_DIR}/spirvheaders
CONFIGURE_COMMAND echo .
BUILD_COMMAND echo .
INSTALL_COMMAND echo .
)

View File

@@ -10,18 +10,12 @@ set(EMBREE_EXTRA_ARGS
-DEMBREE_RAY_MASK=ON
-DEMBREE_FILTER_FUNCTION=ON
-DEMBREE_BACKFACE_CULLING=OFF
-DEMBREE_MAX_ISA=AVX2
-DEMBREE_TASKING_SYSTEM=TBB
-DEMBREE_TBB_ROOT=${LIBDIR}/tbb
-DTBB_ROOT=${LIBDIR}/tbb
-DTBB_STATIC_LIB=${TBB_STATIC_LIBRARY}
)
if(BLENDER_PLATFORM_ARM)
set(EMBREE_EXTRA_ARGS
${EMBREE_EXTRA_ARGS}
-DEMBREE_MAX_ISA=NEON)
else()
if (NOT BLENDER_PLATFORM_ARM)
set(EMBREE_EXTRA_ARGS
${EMBREE_EXTRA_ARGS}
-DEMBREE_MAX_ISA=AVX2)
@@ -30,23 +24,10 @@ endif()
if(TBB_STATIC_LIBRARY)
set(EMBREE_EXTRA_ARGS
${EMBREE_EXTRA_ARGS}
-DEMBREE_TBB_LIBRARY_NAME=tbb_static
-DEMBREE_TBBMALLOC_LIBRARY_NAME=tbbmalloc_static
-DEMBREE_TBB_COMPONENT=tbb_static
)
endif()
if(WIN32)
set(EMBREE_BUILD_DIR ${BUILD_MODE}/)
if(BUILD_MODE STREQUAL Debug)
list(APPEND EMBREE_EXTRA_ARGS
-DEMBREE_TBBMALLOC_LIBRARY_NAME=tbbmalloc_debug
-DEMBREE_TBB_LIBRARY_NAME=tbb_debug
)
endif()
else()
set(EMBREE_BUILD_DIR)
endif()
ExternalProject_Add(external_embree
URL file://${PACKAGE_DIR}/${EMBREE_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}

View File

@@ -1,9 +1,9 @@
# SPDX-License-Identifier: GPL-2.0-or-later
set(FFMPEG_CFLAGS "-I${mingw_LIBDIR}/lame/include -I${mingw_LIBDIR}/openjpeg/include/ -I${mingw_LIBDIR}/ogg/include -I${mingw_LIBDIR}/vorbis/include -I${mingw_LIBDIR}/theora/include -I${mingw_LIBDIR}/opus/include -I${mingw_LIBDIR}/vpx/include -I${mingw_LIBDIR}/x264/include -I${mingw_LIBDIR}/xvidcore/include -I${mingw_LIBDIR}/zlib/include")
set(FFMPEG_LDFLAGS "-L${mingw_LIBDIR}/lame/lib -L${mingw_LIBDIR}/openjpeg/lib -L${mingw_LIBDIR}/ogg/lib -L${mingw_LIBDIR}/vorbis/lib -L${mingw_LIBDIR}/theora/lib -L${mingw_LIBDIR}/opus/lib -L${mingw_LIBDIR}/vpx/lib -L${mingw_LIBDIR}/x264/lib -L${mingw_LIBDIR}/xvidcore/lib -L${mingw_LIBDIR}/zlib/lib")
set(FFMPEG_CFLAGS "-I${mingw_LIBDIR}/lame/include -I${mingw_LIBDIR}/openjpeg/include/ -I${mingw_LIBDIR}/ogg/include -I${mingw_LIBDIR}/vorbis/include -I${mingw_LIBDIR}/theora/include -I${mingw_LIBDIR}/opus/include -I${mingw_LIBDIR}/vpx/include -I${mingw_LIBDIR}/x264/include -I${mingw_LIBDIR}/xvidcore/include -I${mingw_LIBDIR}/zlib/include -I${mingw_LIBDIR}/aom/include")
set(FFMPEG_LDFLAGS "-L${mingw_LIBDIR}/lame/lib -L${mingw_LIBDIR}/openjpeg/lib -L${mingw_LIBDIR}/ogg/lib -L${mingw_LIBDIR}/vorbis/lib -L${mingw_LIBDIR}/theora/lib -L${mingw_LIBDIR}/opus/lib -L${mingw_LIBDIR}/vpx/lib -L${mingw_LIBDIR}/x264/lib -L${mingw_LIBDIR}/xvidcore/lib -L${mingw_LIBDIR}/zlib/lib -L${mingw_LIBDIR}/aom/lib")
set(FFMPEG_EXTRA_FLAGS --pkg-config-flags=--static --extra-cflags=${FFMPEG_CFLAGS} --extra-ldflags=${FFMPEG_LDFLAGS})
set(FFMPEG_ENV PKG_CONFIG_PATH=${mingw_LIBDIR}/openjpeg/lib/pkgconfig:${mingw_LIBDIR}/x264/lib/pkgconfig:${mingw_LIBDIR}/vorbis/lib/pkgconfig:${mingw_LIBDIR}/ogg/lib/pkgconfig:${mingw_LIBDIR}:${mingw_LIBDIR}/vpx/lib/pkgconfig:${mingw_LIBDIR}/theora/lib/pkgconfig:${mingw_LIBDIR}/openjpeg/lib/pkgconfig:${mingw_LIBDIR}/opus/lib/pkgconfig:)
set(FFMPEG_ENV PKG_CONFIG_PATH=${mingw_LIBDIR}/openjpeg/lib/pkgconfig:${mingw_LIBDIR}/x264/lib/pkgconfig:${mingw_LIBDIR}/vorbis/lib/pkgconfig:${mingw_LIBDIR}/ogg/lib/pkgconfig:${mingw_LIBDIR}:${mingw_LIBDIR}/vpx/lib/pkgconfig:${mingw_LIBDIR}/theora/lib/pkgconfig:${mingw_LIBDIR}/openjpeg/lib/pkgconfig:${mingw_LIBDIR}/opus/lib/pkgconfig:${mingw_LIBDIR}/aom/lib/pkgconfig:)
if(WIN32)
set(FFMPEG_ENV set ${FFMPEG_ENV} &&)
@@ -79,6 +79,7 @@ ExternalProject_Add(external_ffmpeg
--disable-librtmp
--enable-libx264
--enable-libxvid
--enable-libaom
--disable-libopencore-amrnb
--disable-libopencore-amrwb
--disable-libdc1394
@@ -125,6 +126,7 @@ add_dependencies(
external_vorbis
external_ogg
external_lame
external_aom
)
if(WIN32)
add_dependencies(

View File

@@ -1,12 +0,0 @@
# SPDX-License-Identifier: GPL-2.0-or-later
set(GLFW_EXTRA_ARGS)
ExternalProject_Add(external_glfw
URL file://${PACKAGE_DIR}/${GLFW_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${GLFW_HASH_TYPE}=${GLFW_HASH}
PREFIX ${BUILD_DIR}/glfw
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/glfw -Wno-dev ${DEFAULT_CMAKE_FLAGS} ${GLFW_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/glfw
)

View File

@@ -0,0 +1,13 @@
# SPDX-License-Identifier: GPL-2.0-or-later
set(GMMLIB_EXTRA_ARGS
)
ExternalProject_Add(external_gmmlib
URL file://${PACKAGE_DIR}/${GMMLIB_FILE}
URL_HASH ${GMMLIB_HASH_TYPE}=${GMMLIB_HASH}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
PREFIX ${BUILD_DIR}/gmmlib
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/gmmlib ${DEFAULT_CMAKE_FLAGS} ${GMMLIB_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/gmmlib
)

View File

@@ -25,9 +25,6 @@ if(BUILD_MODE STREQUAL Release)
# glew-> opengl
${CMAKE_COMMAND} -E copy ${LIBDIR}/glew/lib/libglew32.lib ${HARVEST_TARGET}/opengl/lib/glew.lib &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/glew/include/ ${HARVEST_TARGET}/opengl/include/ &&
# tiff
${CMAKE_COMMAND} -E copy ${LIBDIR}/tiff/lib/tiff.lib ${HARVEST_TARGET}/tiff/lib/libtiff.lib &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/tiff/include/ ${HARVEST_TARGET}/tiff/include/
DEPENDS
)
endif()
@@ -177,6 +174,7 @@ harvest(opus/lib ffmpeg/lib "*.a")
harvest(vpx/lib ffmpeg/lib "*.a")
harvest(x264/lib ffmpeg/lib "*.a")
harvest(xvidcore/lib ffmpeg/lib "*.a")
harvest(aom/lib ffmpeg/lib "*.a")
harvest(webp/lib webp/lib "*.a")
harvest(webp/include webp/include "*.h")
harvest(usd/include usd/include "*.h")
@@ -192,6 +190,10 @@ harvest(zstd/lib zstd/lib "*.a")
if(UNIX AND NOT APPLE)
harvest(libglu/lib mesa/lib "*.so*")
harvest(mesa/lib64 mesa/lib "*.so*")
endif()
harvest(dpcpp dpcpp "*")
harvest(igc dpcpp/lib/igc "*")
harvest(ocloc dpcpp/lib/ocloc "*")
endif()
endif()

View File

@@ -0,0 +1,126 @@
# SPDX-License-Identifier: GPL-2.0-or-later
unpack_only(igc_vcintrinsics)
unpack_only(igc_spirv_headers)
unpack_only(igc_spirv_tools)
#
# igc_opencl_clang contains patches that need to be applied
# to external_igc_llvm and igc_spirv_translator, we unpack
# igc_opencl_clang first, then have the patch stages of
# external_igc_llvm and igc_spirv_translator apply them.
#
ExternalProject_Add(external_igc_opencl_clang
URL file://${PACKAGE_DIR}/${IGC_OPENCL_CLANG_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${IGC_OPENCL_CLANG_HASH_TYPE}=${IGC_OPENCL_CLANG_HASH}
PREFIX ${BUILD_DIR}/igc_opencl_clang
CONFIGURE_COMMAND echo .
BUILD_COMMAND echo .
INSTALL_COMMAND echo .
PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/igc_opencl_clang/src/external_igc_opencl_clang/ < ${PATCH_DIR}/igc_opencl_clang.diff
)
set(IGC_OPENCL_CLANG_PATCH_DIR ${BUILD_DIR}/igc_opencl_clang/src/external_igc_opencl_clang/patches)
set(IGC_LLVM_SOURCE_DIR ${BUILD_DIR}/igc_llvm/src/external_igc_llvm)
set(IGC_SPIRV_TRANSLATOR_SOURCE_DIR ${BUILD_DIR}/igc_spirv_translator/src/external_igc_spirv_translator)
ExternalProject_Add(external_igc_llvm
URL file://${PACKAGE_DIR}/${IGC_LLVM_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${IGC_LLVM_HASH_TYPE}=${IGC_LLVM_HASH}
PREFIX ${BUILD_DIR}/igc_llvm
CONFIGURE_COMMAND echo .
BUILD_COMMAND echo .
INSTALL_COMMAND echo .
PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${IGC_LLVM_SOURCE_DIR} < ${IGC_OPENCL_CLANG_PATCH_DIR}/clang/0001-OpenCL-3.0-support.patch &&
${PATCH_CMD} -p 1 -d ${IGC_LLVM_SOURCE_DIR} < ${IGC_OPENCL_CLANG_PATCH_DIR}/clang/0002-Remove-__IMAGE_SUPPORT__-macro-for-SPIR.patch &&
${PATCH_CMD} -p 1 -d ${IGC_LLVM_SOURCE_DIR} < ${IGC_OPENCL_CLANG_PATCH_DIR}/clang/0003-Avoid-calling-ParseCommandLineOptions-in-BackendUtil.patch &&
${PATCH_CMD} -p 1 -d ${IGC_LLVM_SOURCE_DIR} < ${IGC_OPENCL_CLANG_PATCH_DIR}/clang/0004-OpenCL-support-cl_ext_float_atomics.patch &&
${PATCH_CMD} -p 1 -d ${IGC_LLVM_SOURCE_DIR} < ${IGC_OPENCL_CLANG_PATCH_DIR}/clang/0005-OpenCL-Add-cl_khr_integer_dot_product.patch &&
${PATCH_CMD} -p 1 -d ${IGC_LLVM_SOURCE_DIR} < ${IGC_OPENCL_CLANG_PATCH_DIR}/llvm/0001-Memory-leak-fix-for-Managed-Static-Mutex.patch &&
${PATCH_CMD} -p 1 -d ${IGC_LLVM_SOURCE_DIR} < ${IGC_OPENCL_CLANG_PATCH_DIR}/llvm/0002-Remove-repo-name-in-LLVM-IR.patch
)
add_dependencies(
external_igc_llvm
external_igc_opencl_clang
)
ExternalProject_Add(external_igc_spirv_translator
URL file://${PACKAGE_DIR}/${IGC_SPIRV_TRANSLATOR_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${IGC_SPIRV_TRANSLATOR_HASH_TYPE}=${IGC_SPIRV_TRANSLATOR_HASH}
PREFIX ${BUILD_DIR}/igc_spirv_translator
CONFIGURE_COMMAND echo .
BUILD_COMMAND echo .
INSTALL_COMMAND echo .
PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${IGC_SPIRV_TRANSLATOR_SOURCE_DIR} < ${IGC_OPENCL_CLANG_PATCH_DIR}/spirv/0001-update-SPIR-V-headers-for-SPV_INTEL_split_barrier.patch &&
${PATCH_CMD} -p 1 -d ${IGC_SPIRV_TRANSLATOR_SOURCE_DIR} < ${IGC_OPENCL_CLANG_PATCH_DIR}/spirv/0002-Add-support-for-split-barriers-extension-SPV_INTEL_s.patch &&
${PATCH_CMD} -p 1 -d ${IGC_SPIRV_TRANSLATOR_SOURCE_DIR} < ${IGC_OPENCL_CLANG_PATCH_DIR}/spirv/0003-Support-cl_bf16_conversions.patch
)
add_dependencies(
external_igc_spirv_translator
external_igc_opencl_clang
)
if(WIN32)
set(IGC_GENERATOR "Ninja")
set(IGC_TARGET Windows64)
else()
set(IGC_GENERATOR "Unix Makefiles")
set(IGC_TARGET Linux64)
endif()
set(IGC_EXTRA_ARGS
-DIGC_OPTION__ARCHITECTURE_TARGET=${IGC_TARGET}
-DIGC_OPTION__ARCHITECTURE_HOST=${IGC_TARGET}
)
if(UNIX AND NOT APPLE)
list(APPEND IGC_EXTRA_ARGS
-DFLEX_EXECUTABLE=${LIBDIR}/flex/bin/flex
-DFLEX_INCLUDE_DIR=${LIBDIR}/flex/include
)
endif()
ExternalProject_Add(external_igc
URL file://${PACKAGE_DIR}/${IGC_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${IGC_HASH_TYPE}=${IGC_HASH}
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/igc ${DEFAULT_CMAKE_FLAGS} ${IGC_EXTRA_ARGS}
# IGC is pretty set in its way where sub projects ought to live, for some it offers
# hooks to supply alternatives folders, other are just hardocded with no way to configure
# we symlink everything here, since it's less work than trying to convince the cmake
# scripts to accept alternative locations.
#
PATCH_COMMAND ${CMAKE_COMMAND} -E create_symlink ${BUILD_DIR}/igc_llvm/src/external_igc_llvm/ ${BUILD_DIR}/igc/src/llvm-project &&
${CMAKE_COMMAND} -E create_symlink ${BUILD_DIR}/igc_opencl_clang/src/external_igc_opencl_clang/ ${BUILD_DIR}/igc/src/llvm-project/llvm/projects/opencl-clang &&
${CMAKE_COMMAND} -E create_symlink ${BUILD_DIR}/igc_spirv_translator/src/external_igc_spirv_translator/ ${BUILD_DIR}/igc/src/llvm-project/llvm/projects/llvm-spirv &&
${CMAKE_COMMAND} -E create_symlink ${BUILD_DIR}/igc_spirv_tools/src/external_igc_spirv_tools/ ${BUILD_DIR}/igc/src/SPIRV-Tools &&
${CMAKE_COMMAND} -E create_symlink ${BUILD_DIR}/igc_spirv_headers/src/external_igc_spirv_headers/ ${BUILD_DIR}/igc/src/SPIRV-Headers &&
${CMAKE_COMMAND} -E create_symlink ${BUILD_DIR}/igc_vcintrinsics/src/external_igc_vcintrinsics/ ${BUILD_DIR}/igc/src/vc-intrinsics
PREFIX ${BUILD_DIR}/igc
INSTALL_DIR ${LIBDIR}/igc
INSTALL_COMMAND ${CMAKE_COMMAND} --install . --strip
CMAKE_GENERATOR ${IGC_GENERATOR}
)
add_dependencies(
external_igc
external_igc_vcintrinsics
external_igc_llvm
external_igc_opencl_clang
external_igc_vcintrinsics
external_igc_spirv_headers
external_igc_spirv_tools
external_igc_spirv_translator
)
if(UNIX AND NOT APPLE)
add_dependencies(
external_igc
external_flex
)
endif()

View File

@@ -6,6 +6,7 @@ if(WIN32)
-DBISON_EXECUTABLE=${LIBDIR}/flexbison/win_bison.exe
-DM4_EXECUTABLE=${DOWNLOAD_DIR}/mingw/mingw64/msys/1.0/bin/m4.exe
-DARM_ENABLED=Off
-DPython3_FIND_REGISTRY=NEVER
)
elseif(APPLE)
# Use bison and flex installed via Homebrew.
@@ -27,7 +28,7 @@ elseif(UNIX)
set(ISPC_EXTRA_ARGS_UNIX
-DCMAKE_C_COMPILER=${LIBDIR}/llvm/bin/clang
-DCMAKE_CXX_COMPILER=${LIBDIR}/llvm/bin/clang++
-DARM_ENABLED=Off
-DARM_ENABLED=${BLENDER_PLATFORM_ARM}
-DFLEX_EXECUTABLE=${LIBDIR}/flex/bin/flex
)
endif()
@@ -43,6 +44,8 @@ set(ISPC_EXTRA_ARGS
-DISPC_INCLUDE_TESTS=Off
-DCLANG_LIBRARY_DIR=${LIBDIR}/llvm/lib
-DCLANG_INCLUDE_DIRS=${LIBDIR}/llvm/include
-DPython3_ROOT_DIR=${LIBDIR}/python/
-DPython3_EXECUTABLE=${PYTHON_BINARY}
${ISPC_EXTRA_ARGS_WIN}
${ISPC_EXTRA_ARGS_APPLE}
${ISPC_EXTRA_ARGS_UNIX}
@@ -61,6 +64,7 @@ ExternalProject_Add(external_ispc
add_dependencies(
external_ispc
ll
external_python
)
if(WIN32)

View File

@@ -25,11 +25,14 @@ set(LLVM_EXTRA_ARGS
-DLLVM_BUILD_LLVM_C_DYLIB=OFF
-DLLVM_ENABLE_UNWIND_TABLES=OFF
-DLLVM_ENABLE_PROJECTS=clang${LLVM_BUILD_CLANG_TOOLS_EXTRA}
-DPython3_ROOT_DIR=${LIBDIR}/python/
-DPython3_EXECUTABLE=${PYTHON_BINARY}
${LLVM_XML2_ARGS}
)
if(WIN32)
set(LLVM_GENERATOR "Ninja")
list(APPEND LLVM_EXTRA_ARGS -DPython3_FIND_REGISTRY=NEVER)
else()
set(LLVM_GENERATOR "Unix Makefiles")
endif()
@@ -74,3 +77,8 @@ if(APPLE)
external_xml2
)
endif()
add_dependencies(
ll
external_python
)

View File

@@ -0,0 +1,18 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# shorthand to only unpack a certain dependency
macro(unpack_only name)
string(TOUPPER ${name} UPPER_NAME)
set(TARGET_FILE ${${UPPER_NAME}_FILE})
set(TARGET_HASH_TYPE ${${UPPER_NAME}_HASH_TYPE})
set(TARGET_HASH ${${UPPER_NAME}_HASH})
ExternalProject_Add(external_${name}
URL file://${PACKAGE_DIR}/${TARGET_FILE}
URL_HASH ${TARGET_HASH_TYPE}=${TARGET_HASH}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
PREFIX ${BUILD_DIR}/${name}
CONFIGURE_COMMAND echo .
BUILD_COMMAND echo .
INSTALL_COMMAND echo .
)
endmacro()

View File

@@ -0,0 +1,24 @@
# SPDX-License-Identifier: GPL-2.0-or-later
set(OCLOC_EXTRA_ARGS
-DNEO_SKIP_UNIT_TESTS=1
-DNEO_BUILD_WITH_OCL=0
-DBUILD_WITH_L0=0
-DIGC_DIR=${LIBDIR}/igc
-DGMM_DIR=${LIBDIR}/gmmlib
)
ExternalProject_Add(external_ocloc
URL file://${PACKAGE_DIR}/${OCLOC_FILE}
URL_HASH ${OCLOC_HASH_TYPE}=${OCLOC_HASH}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
PREFIX ${BUILD_DIR}/ocloc
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/ocloc ${DEFAULT_CMAKE_FLAGS} ${OCLOC_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/ocloc
)
add_dependencies(
external_ocloc
external_igc
external_gmmlib
)

View File

@@ -53,7 +53,8 @@ add_dependencies(
external_opencolorio
external_yamlcpp
external_expat
external_openexr
external_imath
external_pystring
)
if(WIN32)

View File

@@ -9,6 +9,7 @@ set(OIDN_EXTRA_ARGS
-DOIDN_STATIC_RUNTIME=OFF
-DISPC_EXECUTABLE=${LIBDIR}/ispc/bin/ispc
-DOIDN_FILTER_RTLIGHTMAP=OFF
-DPYTHON_EXECUTABLE=${PYTHON_BINARY}
)
if(WIN32)
@@ -38,6 +39,7 @@ add_dependencies(
external_openimagedenoise
external_tbb
external_ispc
external_python
)
if(WIN32)

View File

@@ -18,9 +18,15 @@ if(WIN32)
set(PNG_LIBNAME libpng16_static${LIBEXT})
set(OIIO_SIMD_FLAGS -DUSE_SIMD=sse2)
set(OPENJPEG_POSTFIX _msvc)
if(BUILD_MODE STREQUAL Debug)
set(TIFF_POSTFIX d)
else()
set(TIFF_POSTFIX)
endif()
else()
set(PNG_LIBNAME libpng${LIBEXT})
set(OIIO_SIMD_FLAGS)
set(TIFF_POSTFIX)
endif()
if(MSVC)
@@ -65,7 +71,7 @@ set(OPENIMAGEIO_EXTRA_ARGS
-DZLIB_INCLUDE_DIR=${LIBDIR}/zlib/include
-DPNG_LIBRARY=${LIBDIR}/png/lib/${PNG_LIBNAME}
-DPNG_PNG_INCLUDE_DIR=${LIBDIR}/png/include
-DTIFF_LIBRARY=${LIBDIR}/tiff/lib/${LIBPREFIX}tiff${LIBEXT}
-DTIFF_LIBRARY=${LIBDIR}/tiff/lib/${LIBPREFIX}tiff${TIFF_POSTFIX}${LIBEXT}
-DTIFF_INCLUDE_DIR=${LIBDIR}/tiff/include
-DJPEG_LIBRARY=${LIBDIR}/jpeg/lib/${JPEG_LIBRARY}
-DJPEG_INCLUDE_DIR=${LIBDIR}/jpeg/include

View File

@@ -10,20 +10,16 @@ set(OPENSUBDIV_EXTRA_ARGS
-DNO_OMP=ON
-DNO_TBB=OFF
-DNO_CUDA=ON
-DNO_OPENCL=OFF
-DNO_CLEW=OFF
-DNO_OPENCL=ON
-DNO_CLEW=ON
-DNO_OPENGL=OFF
-DNO_METAL=OFF
-DNO_DX=ON
-DNO_TESTS=ON
-DNO_GLTESTS=ON
-DNO_GLEW=OFF
-DNO_GLFW=OFF
-DNO_GLEW=ON
-DNO_GLFW=ON
-DNO_GLFW_X11=ON
-DGLEW_INCLUDE_DIR=${LIBDIR}/glew/include
-DGLEW_LIBRARY=${LIBDIR}/glew/lib/libGLEW${LIBEXT}
-DGLFW_INCLUDE_DIR=${LIBDIR}/glfw/include
-DGLFW_LIBRARIES=${LIBDIR}/glfw/lib/glfw3${LIBEXT}
)
if(WIN32)
@@ -31,19 +27,12 @@ if(WIN32)
${OPENSUBDIV_EXTRA_ARGS}
-DTBB_INCLUDE_DIR=${LIBDIR}/tbb/include
-DTBB_LIBRARIES=${LIBDIR}/tbb/lib/tbb.lib
-DCLEW_INCLUDE_DIR=${LIBDIR}/clew/include/CL
-DCLEW_LIBRARY=${LIBDIR}/clew/lib/clew${LIBEXT}
-DCUEW_INCLUDE_DIR=${LIBDIR}/cuew/include
-DCUEW_LIBRARY=${LIBDIR}/cuew/lib/cuew${LIBEXT}
)
else()
set(OPENSUBDIV_EXTRA_ARGS
${OPENSUBDIV_EXTRA_ARGS}
-DTBB_INCLUDE_DIR=${LIBDIR}/tbb/include
-DTBB_tbb_LIBRARY=${LIBDIR}/tbb/lib/${LIBPREFIX}tbb_static${LIBEXT}
-DCUEW_INCLUDE_DIR=${LIBDIR}/cuew/include
-DCLEW_INCLUDE_DIR=${LIBDIR}/clew/include/CL
-DCLEW_LIBRARY=${LIBDIR}/clew/lib/static/${LIBPREFIX}clew${LIBEXT}
)
endif()
@@ -75,9 +64,5 @@ endif()
add_dependencies(
external_opensubdiv
external_glew
external_glfw
external_clew
external_cuew
external_tbb
)

View File

@@ -38,6 +38,7 @@ message("BUILD_DIR = ${BUILD_DIR}")
if(WIN32)
set(PATCH_CMD ${DOWNLOAD_DIR}/mingw/mingw64/msys/1.0/bin/patch.exe)
set(LIBEXT ".lib")
set(SHAREDLIBEXT ".lib")
set(LIBPREFIX "")
# For OIIO and OSL
@@ -96,6 +97,7 @@ if(WIN32)
else()
set(PATCH_CMD patch)
set(LIBEXT ".a")
set(SHAREDLIBEXT ".so")
set(LIBPREFIX "lib")
if(APPLE)

View File

@@ -3,6 +3,8 @@
set(TIFF_EXTRA_ARGS
-DZLIB_LIBRARY=${LIBDIR}/zlib/lib/${ZLIB_LIBRARY}
-DZLIB_INCLUDE_DIR=${LIBDIR}/zlib/include
-DJPEG_LIBRARY=${LIBDIR}/jpeg/lib/${JPEG_LIBRARY}
-DJPEG_INCLUDE_DIR=${LIBDIR}/jpeg/include
-DPNG_STATIC=ON
-DBUILD_SHARED_LIBS=OFF
-Dlzma=OFF
@@ -24,10 +26,12 @@ add_dependencies(
external_tiff
external_zlib
)
if(WIN32 AND BUILD_MODE STREQUAL Debug)
ExternalProject_Add_Step(external_tiff after_install
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tiff/lib/tiffd${LIBEXT} ${LIBDIR}/tiff/lib/tiff${LIBEXT}
DEPENDEES install
)
if(WIN32)
if(BUILD_MODE STREQUAL Release)
ExternalProject_Add_Step(external_tiff after_install
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tiff/lib/tiff.lib ${HARVEST_TARGET}/tiff/lib/libtiff.lib &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/tiff/include/ ${HARVEST_TARGET}/tiff/include/
DEPENDEES install
)
endif()
endif()

View File

@@ -45,15 +45,15 @@ set(PTHREADS_HASH f3bf81bb395840b3446197bcf4ecd653)
set(PTHREADS_HASH_TYPE MD5)
set(PTHREADS_FILE pthreads4w-code-${PTHREADS_VERSION}.zip)
set(OPENEXR_VERSION 3.1.4)
set(OPENEXR_VERSION 3.1.5)
set(OPENEXR_URI https://github.com/AcademySoftwareFoundation/openexr/archive/v${OPENEXR_VERSION}.tar.gz)
set(OPENEXR_HASH e990be1ff765797bc2d93a8060e1c1f2)
set(OPENEXR_HASH a92f38eedd43e56c0af56d4852506886)
set(OPENEXR_HASH_TYPE MD5)
set(OPENEXR_FILE openexr-${OPENEXR_VERSION}.tar.gz)
set(IMATH_VERSION 3.1.4)
set(IMATH_VERSION 3.1.5)
set(IMATH_URI https://github.com/AcademySoftwareFoundation/Imath/archive/v${OPENEXR_VERSION}.tar.gz)
set(IMATH_HASH fddf14ec73e12c34e74c3c175e311a3f)
set(IMATH_HASH dd375574276c54872b7b3d54053baff0)
set(IMATH_HASH_TYPE MD5)
set(IMATH_FILE imath-${IMATH_VERSION}.tar.gz)
@@ -98,27 +98,6 @@ set(ALEMBIC_HASH 2cd8d6e5a3ac4a014e24a4b04f4fadf9)
set(ALEMBIC_HASH_TYPE MD5)
set(ALEMBIC_FILE alembic-${ALEMBIC_VERSION}.tar.gz)
# hash is for 3.1.2
set(GLFW_GIT_UID 30306e54705c3adae9fe082c816a3be71963485c)
set(GLFW_URI https://github.com/glfw/glfw/archive/${GLFW_GIT_UID}.zip)
set(GLFW_HASH 20cacb1613da7eeb092f3ac4f6b2b3d0)
set(GLFW_HASH_TYPE MD5)
set(GLFW_FILE glfw-${GLFW_GIT_UID}.zip)
# latest uid in git as of 2016-04-01
set(CLEW_GIT_UID 277db43f6cafe8b27c6f1055f69dc67da4aeb299)
set(CLEW_URI https://github.com/OpenCLWrangler/clew/archive/${CLEW_GIT_UID}.zip)
set(CLEW_HASH 2c699d10ed78362e71f56fae2a4c5f98)
set(CLEW_HASH_TYPE MD5)
set(CLEW_FILE clew-${CLEW_GIT_UID}.zip)
# latest uid in git as of 2016-04-01
set(CUEW_GIT_UID 1744972026de9cf27c8a7dc39cf39cd83d5f922f)
set(CUEW_URI https://github.com/CudaWrangler/cuew/archive/${CUEW_GIT_UID}.zip)
set(CUEW_HASH 86760d62978ebfd96cd93f5aa1abaf4a)
set(CUEW_HASH_TYPE MD5)
set(CUEW_FILE cuew-${CUEW_GIT_UID}.zip)
set(OPENSUBDIV_VERSION v3_4_4)
set(OPENSUBDIV_URI https://github.com/PixarAnimationStudios/OpenSubdiv/archive/${OPENSUBDIV_VERSION}.tar.gz)
set(OPENSUBDIV_HASH 39ecc5caf0abebc943d1ce131855e76e)
@@ -168,7 +147,7 @@ set(OPENIMAGEIO_HASH de45fb38501c4581062b522b53b6141c)
set(OPENIMAGEIO_HASH_TYPE MD5)
set(OPENIMAGEIO_FILE OpenImageIO-${OPENIMAGEIO_VERSION}.tar.gz)
# 8.0.0 is currently oiio's preferred vesion although never versions may be available.
# 8.0.0 is currently oiio's preferred version although never versions may be available.
# the preferred version can be found in oiio's externalpackages.cmake
set(FMT_VERSION 8.0.0)
set(FMT_URI https://github.com/fmtlib/fmt/archive/refs/tags/${FMT_VERSION}.tar.gz)
@@ -176,7 +155,7 @@ set(FMT_HASH 7bce0e9e022e586b178b150002e7c2339994e3c2bbe44027e9abb0d60f9cce83)
set(FMT_HASH_TYPE SHA256)
set(FMT_FILE fmt-${FMT_VERSION}.tar.gz)
# 0.6.2 is currently oiio's preferred vesion although never versions may be available.
# 0.6.2 is currently oiio's preferred version although never versions may be available.
# the preferred version can be found in oiio's externalpackages.cmake
set(ROBINMAP_VERSION v0.6.2)
set(ROBINMAP_URI https://github.com/Tessil/robin-map/archive/refs/tags/${ROBINMAP_VERSION}.tar.gz)
@@ -184,9 +163,9 @@ set(ROBINMAP_HASH c08ec4b1bf1c85eb0d6432244a6a89862229da1cb834f3f90fba8dc35d8c8e
set(ROBINMAP_HASH_TYPE SHA256)
set(ROBINMAP_FILE robinmap-${ROBINMAP_VERSION}.tar.gz)
set(TIFF_VERSION 4.3.0)
set(TIFF_VERSION 4.4.0)
set(TIFF_URI http://download.osgeo.org/libtiff/tiff-${TIFF_VERSION}.tar.gz)
set(TIFF_HASH 0a2e4744d1426a8fc8211c0cdbc3a1b3)
set(TIFF_HASH 376f17f189e9d02280dfe709b2b2bbea)
set(TIFF_HASH_TYPE MD5)
set(TIFF_FILE tiff-${TIFF_VERSION}.tar.gz)
@@ -431,9 +410,9 @@ set(SQLITE_HASH fb558c49ee21a837713c4f1e7e413309aabdd9c7)
set(SQLITE_HASH_TYPE SHA1)
set(SQLITE_FILE sqlite-src-3240000.zip)
set(EMBREE_VERSION 3.13.3)
set(EMBREE_VERSION 3.13.4)
set(EMBREE_URI https://github.com/embree/embree/archive/v${EMBREE_VERSION}.zip)
set(EMBREE_HASH f62766ba54e48a2f327c3a22596e7133)
set(EMBREE_HASH 52d0be294d6c88ba7a6c9e046796e7be)
set(EMBREE_HASH_TYPE MD5)
set(EMBREE_FILE embree-v${EMBREE_VERSION}.zip)
@@ -523,3 +502,140 @@ set(LEVEL_ZERO_URI https://github.com/oneapi-src/level-zero/archive/refs/tags/${
set(LEVEL_ZERO_HASH c39bb05a8e5898aa6c444e1704105b93d3f1888b9c333f8e7e73825ffbfb2617)
set(LEVEL_ZERO_HASH_TYPE SHA256)
set(LEVEL_ZERO_FILE level-zero-${LEVEL_ZERO_VERSION}.tar.gz)
set(DPCPP_VERSION 20220620)
set(DPCPP_URI https://github.com/intel/llvm/archive/refs/tags/sycl-nightly/${DPCPP_VERSION}.tar.gz)
set(DPCPP_HASH a5f41abd5229d28afa92cbd8a5d8d786ee698bf239f722929fd686276bad692c)
set(DPCPP_HASH_TYPE SHA256)
set(DPCPP_FILE DPCPP-${DPCPP_VERSION}.tar.gz)
########################
### DPCPP DEPS BEGIN ###
########################
# The following deps are build time requirements for dpcpp, when possible
# the source in the dpcpp source tree for the version chosen is documented
# by each dep, these will only have to be downloaded and unpacked, dpcpp
# will take care of building them, unpack is being done in dpcpp_deps.cmake
# Source llvm/lib/SYCLLowerIR/CMakeLists.txt
set(VCINTRINSICS_VERSION 984bb27baacce6ee5c716c2e64845f2a1928025b)
set(VCINTRINSICS_URI https://github.com/intel/vc-intrinsics/archive/${VCINTRINSICS_VERSION}.tar.gz)
set(VCINTRINSICS_HASH abea415a15a0dd11fdc94dee8fb462910f2548311b787e02f42509789e1b0d7b)
set(VCINTRINSICS_HASH_TYPE SHA256)
set(VCINTRINSICS_FILE vc-intrinsics-${VCINTRINSICS_VERSION}.tar.gz)
# Source opencl/CMakeLists.txt
set(OPENCLHEADERS_VERSION dcd5bede6859d26833cd85f0d6bbcee7382dc9b3)
set(OPENCLHEADERS_URI https://github.com/KhronosGroup/OpenCL-Headers/archive/${OPENCLHEADERS_VERSION}.tar.gz)
set(OPENCLHEADERS_HASH ca8090359654e94f2c41e946b7e9d826253d795ae809ce7c83a7d3c859624693)
set(OPENCLHEADERS_HASH_TYPE SHA256)
set(OPENCLHEADERS_FILE opencl_headers-${OPENCLHEADERS_VERSION}.tar.gz)
# Source opencl/CMakeLists.txt
set(ICDLOADER_VERSION aec3952654832211636fc4af613710f80e203b0a)
set(ICDLOADER_URI https://github.com/KhronosGroup/OpenCL-ICD-Loader/archive/${ICDLOADER_VERSION}.tar.gz)
set(ICDLOADER_HASH e1880551d67bd8dc31d13de63b94bbfd6b1f315b6145dad1ffcd159b89bda93c)
set(ICDLOADER_HASH_TYPE SHA256)
set(ICDLOADER_FILE icdloader-${ICDLOADER_VERSION}.tar.gz)
# Source sycl/cmake/modules/AddBoostMp11Headers.cmake
# Using external MP11 here, getting AddBoostMp11Headers.cmake to recognize
# our copy in boost directly was more trouble than it was worth.
set(MP11_VERSION 7bc4e1ae9b36ec8ee635c3629b59ec525bbe82b9)
set(MP11_URI https://github.com/boostorg/mp11/archive/${MP11_VERSION}.tar.gz)
set(MP11_HASH 071ee2bd3952ec89882edb3af25dd1816f6b61723f66e42eea32f4d02ceef426)
set(MP11_HASH_TYPE SHA256)
set(MP11_FILE mp11-${MP11_VERSION}.tar.gz)
# Source llvm-spirv/CMakeLists.txt (repo)
# Source llvm-spirv/spirv-headers-tag.conf (hash)
set(SPIRV_HEADERS_VERSION 36c0c1596225e728bd49abb7ef56a3953e7ed468)
set(SPIRV_HEADERS_URI https://github.com/KhronosGroup/SPIRV-Headers/archive/${SPIRV_HEADERS_VERSION}.tar.gz)
set(SPIRV_HEADERS_HASH 7a5c89633f8740456fe8adee052033e134476d267411d1336c0cb1e587a9229a)
set(SPIRV_HEADERS_HASH_TYPE SHA256)
set(SPIRV_HEADERS_FILE SPIR-V-Headers-${SPIRV_HEADERS_VERSION}.tar.gz)
######################
### DPCPP DEPS END ###
######################
##########################################
### Intel Graphics Compiler DEPS BEGIN ###
##########################################
# The following deps are build time requirements for the intel graphics
# compiler, the versions used are taken from the following location
# https://github.com/intel/intel-graphics-compiler/releases
set(IGC_VERSION 1.0.11222)
set(IGC_URI https://github.com/intel/intel-graphics-compiler/archive/refs/tags/igc-${IGC_VERSION}.tar.gz)
set(IGC_HASH d92f0608dcbb52690855685f9447282e5c09c0ba98ae35fabf114fcf8b1e9fcf)
set(IGC_HASH_TYPE SHA256)
set(IGC_FILE igc-${IGC_VERSION}.tar.gz)
set(IGC_LLVM_VERSION llvmorg-11.1.0)
set(IGC_LLVM_URI https://github.com/llvm/llvm-project/archive/refs/tags/${IGC_LLVM_VERSION}.tar.gz)
set(IGC_LLVM_HASH 53a0719f3f4b0388013cfffd7b10c7d5682eece1929a9553c722348d1f866e79)
set(IGC_LLVM_HASH_TYPE SHA256)
set(IGC_LLVM_FILE ${IGC_LLVM_VERSION}.tar.gz)
# WARNING WARNING WARNING
#
# IGC_OPENCL_CLANG contains patches for some of its dependencies.
#
# Whenever IGC_OPENCL_CLANG_VERSION changes, one *MUST* inspect
# IGC_OPENCL_CLANG's patches folder and update igc.cmake to account for
# any added or removed patches.
#
# WARNING WARNING WARNING
set(IGC_OPENCL_CLANG_VERSION bbdd1587f577397a105c900be114b56755d1f7dc)
set(IGC_OPENCL_CLANG_URI https://github.com/intel/opencl-clang/archive/${IGC_OPENCL_CLANG_VERSION}.tar.gz)
set(IGC_OPENCL_CLANG_HASH d08315f1b0d8a6fef33de2b3e6aa7356534c324910634962c72523d970773efc)
set(IGC_OPENCL_CLANG_HASH_TYPE SHA256)
set(IGC_OPENCL_CLANG_FILE opencl-clang-${IGC_OPENCL_CLANG_VERSION}.tar.gz)
set(IGC_VCINTRINSICS_VERSION v0.4.0)
set(IGC_VCINTRINSICS_URI https://github.com/intel/vc-intrinsics/archive/refs/tags/${IGC_VCINTRINSICS_VERSION}.tar.gz)
set(IGC_VCINTRINSICS_HASH c8b92682ad5031cf9d5b82a40e7d5c0e763cd9278660adbcaa69aab988e4b589)
set(IGC_VCINTRINSICS_HASH_TYPE SHA256)
set(IGC_VCINTRINSICS_FILE vc-intrinsics-${IGC_VCINTRINSICS_VERSION}.tar.gz)
set(IGC_SPIRV_HEADERS_VERSION sdk-1.3.204.1)
set(IGC_SPIRV_HEADERS_URI https://github.com/KhronosGroup/SPIRV-Headers/archive/refs/tags/${IGC_SPIRV_HEADERS_VERSION}.tar.gz)
set(IGC_SPIRV_HEADERS_HASH 262864053968c217d45b24b89044a7736a32361894743dd6cfe788df258c746c)
set(IGC_SPIRV_HEADERS_HASH_TYPE SHA256)
set(IGC_SPIRV_HEADERS_FILE SPIR-V-Headers-${IGC_SPIRV_HEADERS_VERSION}.tar.gz)
set(IGC_SPIRV_TOOLS_VERSION sdk-1.3.204.1)
set(IGC_SPIRV_TOOLS_URI https://github.com/KhronosGroup/SPIRV-Tools/archive/refs/tags/${IGC_SPIRV_TOOLS_VERSION}.tar.gz)
set(IGC_SPIRV_TOOLS_HASH 6e19900e948944243024aedd0a201baf3854b377b9cc7a386553bc103b087335)
set(IGC_SPIRV_TOOLS_HASH_TYPE SHA256)
set(IGC_SPIRV_TOOLS_FILE SPIR-V-Tools-${IGC_SPIRV_TOOLS_VERSION}.tar.gz)
set(IGC_SPIRV_TRANSLATOR_VERSION 99420daab98998a7e36858befac9c5ed109d4920)
set(IGC_SPIRV_TRANSLATOR_URI https://github.com/KhronosGroup/SPIRV-LLVM-Translator/archive/${IGC_SPIRV_TRANSLATOR_VERSION}.tar.gz)
set(IGC_SPIRV_TRANSLATOR_HASH 77dfb4ddb6bfb993535562c02ddea23f0a0d1c5a0258c1afe7e27c894ff783a8)
set(IGC_SPIRV_TRANSLATOR_HASH_TYPE SHA256)
set(IGC_SPIRV_TRANSLATOR_FILE SPIR-V-Translator-${IGC_SPIRV_TRANSLATOR_VERSION}.tar.gz)
########################################
### Intel Graphics Compiler DEPS END ###
########################################
set(GMMLIB_VERSION intel-gmmlib-22.1.2)
set(GMMLIB_URI https://github.com/intel/gmmlib/archive/refs/tags/${GMMLIB_VERSION}.tar.gz)
set(GMMLIB_HASH 3b9a6d5e7e3f5748b3d0a2fb0e980ae943907fece0980bd9c0508e71c838e334)
set(GMMLIB_HASH_TYPE SHA256)
set(GMMLIB_FILE ${GMMLIB_VERSION}.tar.gz)
set(OCLOC_VERSION 22.20.23198)
set(OCLOC_URI https://github.com/intel/compute-runtime/archive/refs/tags/${OCLOC_VERSION}.tar.gz)
set(OCLOC_HASH ab22b8bf2560a57fdd3def0e35a62ca75991406f959c0263abb00cd6cd9ae998)
set(OCLOC_HASH_TYPE SHA256)
set(OCLOC_FILE ocloc-${OCLOC_VERSION}.tar.gz)
set(AOM_VERSION 3.4.0)
set(AOM_URI https://storage.googleapis.com/aom-releases/libaom-${AOM_VERSION}.tar.gz)
set(AOM_HASH bd754b58c3fa69f3ffd29da77de591bd9c26970e3b18537951336d6c0252e354)
set(AOM_HASH_TYPE SHA256)
set(AOM_FILE libaom-${AOM_VERSION}.tar.gz)

View File

@@ -1,11 +1,13 @@
# SPDX-License-Identifier: GPL-2.0-or-later
if(WIN32)
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
set(VPX_EXTRA_FLAGS --target=x86_64-win64-gcc --disable-multithread)
else()
set(VPX_EXTRA_FLAGS --target=x86-win32-gcc --disable-multithread)
endif()
# VPX is determined to use pthreads which it will tell ffmpeg to dynamically
# link, which is not something we're super into distribution wise. However
# if it cannot find pthread.h it'll happily provide a pthread emulation
# layer using win32 threads. So all this patch does is make it not find
# pthead.h
set(VPX_PATCH ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/vpx/src/external_vpx < ${PATCH_DIR}/vpx_windows.diff)
set(VPX_EXTRA_FLAGS --target=x86_64-win64-gcc )
else()
if(APPLE)
if("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "arm64")
@@ -18,6 +20,16 @@ else()
endif()
endif()
if(NOT BLENDER_PLATFORM_ARM)
list(APPEND VPX_EXTRA_FLAGS
--enable-sse4_1
--enable-sse3
--enable-ssse3
--enable-avx
--enable-avx2
)
endif()
ExternalProject_Add(external_vpx
URL file://${PACKAGE_DIR}/${VPX_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
@@ -30,11 +42,6 @@ ExternalProject_Add(external_vpx
--enable-static
--disable-install-bins
--disable-install-srcs
--disable-sse4_1
--disable-sse3
--disable-ssse3
--disable-avx
--disable-avx2
--disable-unit-tests
--disable-examples
--enable-vp8
@@ -42,6 +49,7 @@ ExternalProject_Add(external_vpx
${VPX_EXTRA_FLAGS}
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/vpx/src/external_vpx/ && make -j${MAKE_THREADS}
INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/vpx/src/external_vpx/ && make install
PATCH_COMMAND ${VPX_PATCH}
INSTALL_DIR ${LIBDIR}/vpx
)

View File

@@ -37,10 +37,6 @@ graph[autosize = false, size = "25.7,8.3!", resolution = 300, overlap = false, s
external_openimageio -- external_webp;
external_openimageio -- external_opencolorio_extra;
external_openmp -- external_clang;
external_opensubdiv -- external_glew;
external_opensubdiv -- external_glfw;
external_opensubdiv -- external_clew;
external_opensubdiv -- external_cuew;
external_opensubdiv -- external_tbb;
openvdb -- external_tbb;
openvdb -- external_boost;

View File

@@ -36,19 +36,19 @@ getopt \
-o s:i:t:h \
--long source:,install:,tmp:,info:,threads:,help,show-deps,no-sudo,no-build,no-confirm,\
with-all,with-opencollada,with-jack,with-pulseaudio,with-embree,with-oidn,with-nanovdb,\
ver-ocio:,ver-oiio:,ver-llvm:,ver-osl:,ver-osd:,ver-openvdb:,ver-xr-openxr:,\
ver-ocio:,ver-oiio:,ver-llvm:,ver-osl:,ver-osd:,ver-openvdb:,ver-xr-openxr:,ver-level-zero:\
force-all,force-python,force-boost,force-tbb,\
force-ocio,force-imath,force-openexr,force-oiio,force-llvm,force-osl,force-osd,force-openvdb,\
force-ffmpeg,force-opencollada,force-alembic,force-embree,force-oidn,force-usd,\
force-xr-openxr,\
force-xr-openxr,force-level-zero,\
build-all,build-python,build-boost,build-tbb,\
build-ocio,build-imath,build-openexr,build-oiio,build-llvm,build-osl,build-osd,build-openvdb,\
build-ffmpeg,build-opencollada,build-alembic,build-embree,build-oidn,build-usd,\
build-xr-openxr,\
build-xr-openxr,build-level-zero,\
skip-python,skip-boost,skip-tbb,\
skip-ocio,skip-imath,skip-openexr,skip-oiio,skip-llvm,skip-osl,skip-osd,skip-openvdb,\
skip-ffmpeg,skip-opencollada,skip-alembic,skip-embree,skip-oidn,skip-usd,\
skip-xr-openxr \
skip-xr-openxr,skip-level-zero \
-- "$@" \
)
@@ -165,6 +165,9 @@ ARGUMENTS_INFO="\"COMMAND LINE ARGUMENTS:
--ver-xr-openxr=<ver>
Force version of OpenXR-SDK.
--ver-level-zero=<ver>
Force version of OneAPI Level Zero library.
Note about the --ver-foo options:
It may not always work as expected (some libs are actually checked out from a git rev...), yet it might help
to fix some build issues (like LLVM mismatch with the version used by your graphic system).
@@ -226,6 +229,9 @@ ARGUMENTS_INFO="\"COMMAND LINE ARGUMENTS:
--build-xr-openxr
Force the build of OpenXR-SDK.
--build-level-zero=<ver>
Force the build of OneAPI Level Zero library.
Note about the --build-foo options:
* They force the script to prefer building dependencies rather than using available packages.
This may make things simpler and allow working around some distribution bugs, but on the other hand it will
@@ -293,6 +299,9 @@ ARGUMENTS_INFO="\"COMMAND LINE ARGUMENTS:
--force-xr-openxr
Force the rebuild of OpenXR-SDK.
--force-level-zero=<ver>
Force the rebuild of OneAPI Level Zero library.
Note about the --force-foo options:
* They obviously only have an effect if those libraries are built by this script
(i.e. if there is no available and satisfactory package)!
@@ -351,7 +360,10 @@ ARGUMENTS_INFO="\"COMMAND LINE ARGUMENTS:
Unconditionally skip Universal Scene Description installation/building.
--skip-xr-openxr
Unconditionally skip OpenXR-SDK installation/building.\""
Unconditionally skip OpenXR-SDK installation/building.
--skip-level-zero=<ver>
Unconditionally skip OneAPI Level Zero installation/building.\""
# ----------------------------------------------------------------------------
# Main Vars
@@ -453,7 +465,7 @@ TBB_VERSION="2020"
TBB_VERSION_SHORT="2020"
TBB_VERSION_UPDATE="_U3" # Used for source packages...
TBB_VERSION_MIN="2018"
TBB_VERSION_MEX="2022"
TBB_VERSION_MEX="2021" # 2021 introduces 'oneTBB', which has lots of compatibility breakage with previous versions
TBB_FORCE_BUILD=false
TBB_FORCE_REBUILD=false
TBB_SKIP=false
@@ -466,7 +478,7 @@ OCIO_FORCE_BUILD=false
OCIO_FORCE_REBUILD=false
OCIO_SKIP=false
IMATH_VERSION="3.1.4"
IMATH_VERSION="3.1.5"
IMATH_VERSION_SHORT="3.1"
IMATH_VERSION_MIN="3.0"
IMATH_VERSION_MEX="4.0"
@@ -475,7 +487,7 @@ IMATH_FORCE_REBUILD=false
IMATH_SKIP=false
_with_built_imath=false
OPENEXR_VERSION="3.1.4"
OPENEXR_VERSION="3.1.5"
OPENEXR_VERSION_SHORT="3.1"
OPENEXR_VERSION_MIN="3.0"
OPENEXR_VERSION_MEX="4.0"
@@ -555,7 +567,7 @@ OPENCOLLADA_FORCE_BUILD=false
OPENCOLLADA_FORCE_REBUILD=false
OPENCOLLADA_SKIP=false
EMBREE_VERSION="3.13.3"
EMBREE_VERSION="3.13.4"
EMBREE_VERSION_SHORT="3.13"
EMBREE_VERSION_MIN="3.13"
EMBREE_VERSION_MEX="4.0"
@@ -573,14 +585,13 @@ OIDN_SKIP=false
ISPC_VERSION="1.17.0"
FFMPEG_VERSION="4.4"
FFMPEG_VERSION_SHORT="4.4"
FFMPEG_VERSION_MIN="3.0"
FFMPEG_VERSION_MEX="5.0"
FFMPEG_FORCE_BUILD=false
FFMPEG_FORCE_REBUILD=false
FFMPEG_SKIP=false
_ffmpeg_list_sep=";"
LEVEL_ZERO_VERSION="1.7.15"
LEVEL_ZERO_VERSION_SHORT="1.7"
LEVEL_ZERO_VERSION_MIN="1.7"
LEVEL_ZERO_VERSION_MEX="2.0"
LEVEL_ZERO_FORCE_BUILD=false
LEVEL_ZERO_FORCE_REBUILD=false
LEVEL_ZERO_SKIP=false
XR_OPENXR_VERSION="1.0.22"
XR_OPENXR_VERSION_SHORT="1.0"
@@ -590,6 +601,15 @@ XR_OPENXR_FORCE_BUILD=false
XR_OPENXR_FORCE_REBUILD=false
XR_OPENXR_SKIP=false
FFMPEG_VERSION="5.0"
FFMPEG_VERSION_SHORT="5.0"
FFMPEG_VERSION_MIN="4.0"
FFMPEG_VERSION_MEX="6.0"
FFMPEG_FORCE_BUILD=false
FFMPEG_FORCE_REBUILD=false
FFMPEG_SKIP=false
_ffmpeg_list_sep=";"
# FFMPEG optional libs.
VORBIS_USE=false
VORBIS_DEV=""
@@ -607,6 +627,9 @@ WEBP_DEV=""
VPX_USE=false
VPX_VERSION_MIN=0.9.7
VPX_DEV=""
AOM_USE=false
AOM_VERSION_MIN=3.3.0
AOM_DEV=""
OPUS_USE=false
OPUS_VERSION_MIN=1.1.1
OPUS_DEV=""
@@ -615,9 +638,6 @@ MP3LAME_DEV=""
OPENJPEG_USE=false
OPENJPEG_DEV=""
# Whether to use system GLEW or not (OpenSubDiv needs recent glew to work).
NO_SYSTEM_GLEW=false
# Switch to english language, else some things (like check_package_DEB()) won't work!
LANG_BACK=$LANG
LANG=""
@@ -781,6 +801,12 @@ while true; do
XR_OPENXR_VERSION_SHORT=$XR_OPENXR_VERSION
shift; shift; continue
;;
--ver-level-zero)
LEVEL_ZERO_VERSION="$2"
LEVEL_ZERO_VERSION_MIN=$LEVEL_ZERO_VERSION
LEVEL_ZERO_VERSION_SHORT=$LEVEL_ZERO_VERSION
shift; shift; continue
;;
--build-all)
PYTHON_FORCE_BUILD=true
BOOST_FORCE_BUILD=true
@@ -800,6 +826,7 @@ while true; do
ALEMBIC_FORCE_BUILD=true
USD_FORCE_BUILD=true
XR_OPENXR_FORCE_BUILD=true
LEVEL_ZERO_FORCE_BUILD=true
shift; continue
;;
--build-python)
@@ -857,6 +884,9 @@ while true; do
--build-xr-openxr)
XR_OPENXR_FORCE_BUILD=true; shift; continue
;;
--build-level-zero)
LEVEL_ZERO_FORCE_BUILD=true; shift; continue
;;
--force-all)
PYTHON_FORCE_REBUILD=true
BOOST_FORCE_REBUILD=true
@@ -876,6 +906,7 @@ while true; do
ALEMBIC_FORCE_REBUILD=true
USD_FORCE_REBUILD=true
XR_OPENXR_FORCE_REBUILD=true
LEVEL_ZERO_FORCE_REBUILD=true
shift; continue
;;
--force-python)
@@ -933,6 +964,9 @@ while true; do
--force-xr-openxr)
XR_OPENXR_FORCE_REBUILD=true; shift; continue
;;
--force-level-zero)
LEVEL_ZERO_FORCE_REBUILD=true; shift; continue
;;
--skip-python)
PYTHON_SKIP=true; shift; continue
;;
@@ -987,6 +1021,9 @@ while true; do
--skip-xr-openxr)
XR_OPENXR_SKIP=true; shift; continue
;;
--skip-level-zero)
LEVEL_ZERO_SKIP=true; shift; continue
;;
--)
# no more arguments to parse
break
@@ -1128,14 +1165,16 @@ OIDN_SOURCE=( "https://github.com/OpenImageDenoise/oidn/releases/download/v${OID
ISPC_BINARY=( "https://github.com/ispc/ispc/releases/download/v${ISPC_VERSION}/ispc-v${ISPC_VERSION}-linux.tar.gz" )
FFMPEG_SOURCE=( "http://ffmpeg.org/releases/ffmpeg-$FFMPEG_VERSION.tar.bz2" )
XR_OPENXR_USE_REPO=false
XR_OPENXR_SOURCE=("https://github.com/KhronosGroup/OpenXR-SDK/archive/release-${XR_OPENXR_VERSION}.tar.gz")
XR_OPENXR_SOURCE_REPO=("https://github.com/KhronosGroup/OpenXR-SDK.git")
XR_OPENXR_REPO_UID="458984d7f59d1ae6dc1b597d94b02e4f7132eaba"
XR_OPENXR_REPO_BRANCH="master"
LEVEL_ZERO_SOURCE=("https://github.com/oneapi-src/level-zero/archive/refs/tags/v${LEVEL_ZERO_VERSION}.tar.gz")
FFMPEG_SOURCE=( "http://ffmpeg.org/releases/ffmpeg-$FFMPEG_VERSION.tar.bz2" )
# C++11 is required now
CXXFLAGS_BACK=$CXXFLAGS
CXXFLAGS="$CXXFLAGS -std=c++11"
@@ -1154,7 +1193,7 @@ Those libraries should be available as packages in all recent distributions (opt
* libx11, libxcursor, libxi, libxrandr, libxinerama (and other libx... as needed).
* libwayland-client0, libwayland-cursor0, libwayland-egl1, libxkbcommon0, libdbus-1-3, libegl1 (Wayland)
* libsqlite3, libzstd, libbz2, libssl, libfftw3, libxml2, libtinyxml, yasm, libyaml-cpp, flex.
* libsdl2, libglew, libpugixml, libpotrace, [libgmp], [libglewmx], fontconfig, [libharu/libhpdf].\""
* libsdl2, libglew, libpugixml, libpotrace, [libgmp], fontconfig, [libharu/libhpdf].\""
DEPS_SPECIFIC_INFO="\"BUILDABLE DEPENDENCIES:
@@ -1173,7 +1212,7 @@ You may also want to build them yourself (optional ones are [between brackets]):
** [NumPy $PYTHON_NUMPY_VERSION] (use pip).
* Boost $BOOST_VERSION (from $BOOST_SOURCE, modules: $BOOST_BUILD_MODULES).
* TBB $TBB_VERSION (from $TBB_SOURCE).
* [FFMpeg $FFMPEG_VERSION (needs libvorbis, libogg, libtheora, libx264, libmp3lame, libxvidcore, libvpx, libwebp, ...)] (from $FFMPEG_SOURCE).
* [FFMpeg $FFMPEG_VERSION (needs libvorbis, libogg, libtheora, libx264, libmp3lame, libxvidcore, libvpx, libaom, libwebp, ...)] (from $FFMPEG_SOURCE).
* [OpenColorIO $OCIO_VERSION] (from $OCIO_SOURCE).
* Imath $IMATH_VERSION (from $IMATH_SOURCE).
* OpenEXR $OPENEXR_VERSION (from $OPENEXR_SOURCE).
@@ -1187,7 +1226,8 @@ You may also want to build them yourself (optional ones are [between brackets]):
* [OpenImageDenoise $OIDN_VERSION] (from $OIDN_SOURCE).
* [Alembic $ALEMBIC_VERSION] (from $ALEMBIC_SOURCE).
* [Universal Scene Description $USD_VERSION] (from $USD_SOURCE).
* [OpenXR-SDK $XR_OPENXR_VERSION] (from $XR_OPENXR_SOURCE).\""
* [OpenXR-SDK $XR_OPENXR_VERSION] (from $XR_OPENXR_SOURCE).
* [OneAPI Level Zero $LEVEL_ZERO_VERSION] (from $LEVEL_ZERO_SOURCE).\""
if [ "$DO_SHOW_DEPS" = true ]; then
PRINT ""
@@ -1647,7 +1687,7 @@ compile_TBB() {
fi
# To be changed each time we make edits that would modify the compiled result!
tbb_magic=0
tbb_magic=1
_init_tbb
# Force having own builds for the dependencies.
@@ -2656,14 +2696,13 @@ compile_OSD() {
mkdir build
cd build
if [ -d $INST/tbb ]; then
cmake_d="$cmake_d $cmake_d -D TBB_LOCATION=$INST/tbb"
fi
cmake_d="-D CMAKE_BUILD_TYPE=Release"
if [ -d $INST/tbb ]; then
cmake_d="$cmake_d -D TBB_LOCATION=$INST/tbb"
fi
cmake_d="$cmake_d -D CMAKE_INSTALL_PREFIX=$_inst"
# ptex is only needed when nicholas bishop is ready
cmake_d="$cmake_d -D NO_PTEX=1"
cmake_d="$cmake_d -D NO_CLEW=1 -D NO_CUDA=1 -D NO_OPENCL=1"
cmake_d="$cmake_d -D NO_CLEW=1 -D NO_CUDA=1 -D NO_OPENCL=1 -D NO_GLEW=1"
# maya plugin, docs, tutorials, regression tests and examples are not needed
cmake_d="$cmake_d -D NO_MAYA=1 -D NO_DOC=1 -D NO_TUTORIALS=1 -D NO_REGRESSION=1 -DNO_EXAMPLES=1"
@@ -2964,7 +3003,7 @@ compile_ALEMBIC() {
fi
# To be changed each time we make edits that would modify the compiled result!
alembic_magic=2
alembic_magic=3
_init_alembic
# Force having own builds for the dependencies.
@@ -3012,7 +3051,7 @@ compile_ALEMBIC() {
fi
if [ "$_with_built_openexr" = true ]; then
cmake_d="$cmake_d -D USE_ARNOLD=OFF"
cmake_d="$cmake_d -D USE_BINARIES=OFF"
cmake_d="$cmake_d -D USE_BINARIES=ON" # Tests use some Alembic binaries...
cmake_d="$cmake_d -D USE_EXAMPLES=OFF"
cmake_d="$cmake_d -D USE_HDF5=OFF"
cmake_d="$cmake_d -D USE_MAYA=OFF"
@@ -3286,7 +3325,7 @@ compile_Embree() {
fi
# To be changed each time we make edits that would modify the compiled results!
embree_magic=10
embree_magic=11
_init_embree
# Force having own builds for the dependencies.
@@ -3346,7 +3385,7 @@ compile_Embree() {
cmake_d="$cmake_d -D EMBREE_TASKING_SYSTEM=TBB"
if [ -d $INST/tbb ]; then
make_d="$make_d EMBREE_TBB_ROOT=$INST/tbb"
cmake_d="$cmake_d -D EMBREE_TBB_ROOT=$INST/tbb"
fi
cmake $cmake_d ../
@@ -3485,7 +3524,7 @@ compile_OIDN() {
install_ISPC
# To be changed each time we make edits that would modify the compiled results!
oidn_magic=9
oidn_magic=10
_init_oidn
# Force having own builds for the dependencies.
@@ -3541,7 +3580,7 @@ compile_OIDN() {
cmake_d="$cmake_d -D ISPC_DIR_HINT=$_ispc_path_bin"
if [ -d $INST/tbb ]; then
make_d="$make_d TBB_ROOT=$INST/tbb"
cmake_d="$cmake_d -D TBB_ROOT=$INST/tbb"
fi
cmake $cmake_d ../
@@ -3598,7 +3637,7 @@ compile_FFmpeg() {
fi
# To be changed each time we make edits that would modify the compiled result!
ffmpeg_magic=5
ffmpeg_magic=6
_init_ffmpeg
# Force having own builds for the dependencies.
@@ -3651,6 +3690,10 @@ compile_FFmpeg() {
extra="$extra --enable-libvpx"
fi
if [ "$AOM_USE" = true ]; then
extra="$extra --enable-libaom"
fi
if [ "$WEBP_USE" = true ]; then
extra="$extra --enable-libwebp"
fi
@@ -3822,6 +3865,103 @@ compile_XR_OpenXR_SDK() {
}
# ----------------------------------------------------------------------------
# Build OneAPI Level Zero library.
_init_level_zero() {
_src=$SRC/level-zero-$LEVEL_ZERO_VERSION
_git=false
_inst=$INST/level-zero-$LEVEL_ZERO_VERSION_SHORT
_inst_shortcut=$INST/level-zero
}
_update_deps_level_zero() {
:
}
clean_Level_Zero() {
_init_level_zero
if [ -d $_inst ]; then
# Force rebuilding the dependencies if needed.
_update_deps_level_zero false true
fi
_clean
}
compile_Level_Zero() {
if [ "$NO_BUILD" = true ]; then
WARNING "--no-build enabled, Level Zero will not be compiled!"
return
fi
# To be changed each time we make edits that would modify the compiled result!
level_zero_magic=1
_init_level_zero
# Force having own builds for the dependencies.
_update_deps_level_zero true false
# Clean install if needed!
magic_compile_check level-zero-$LEVEL_ZERO_VERSION $level_zero_magic
if [ $? -eq 1 -o "$LEVEL_ZERO_FORCE_REBUILD" = true ]; then
clean_Level_Zero
fi
if [ ! -d $_inst ]; then
INFO "Building Level-Zero-$LEVEL_ZERO_VERSION"
# Force rebuilding the dependencies.
_update_deps_level_zero true true
prepare_inst
if [ ! -d $_src ]; then
mkdir -p $SRC
download LEVEL_ZERO_SOURCE[@] "$_src.tar.gz"
INFO "Unpacking Level-Zero-$LEVEL_ZERO_VERSION"
tar -C $SRC -xf $_src.tar.gz
fi
cd $_src
# Always refresh the whole build!
if [ -d build ]; then
rm -rf build
fi
mkdir build
cd build
# Keep flags in sync with LEVEL_ZERO_EXTRA_ARGS in level-zero.cmake!
cmake_d="-D CMAKE_BUILD_TYPE=Release"
cmake_d="$cmake_d -D CMAKE_INSTALL_PREFIX=$_inst"
cmake $cmake_d ..
make -j$THREADS && make install
make clean
if [ ! -d $_inst ]; then
ERROR "Level-Zero-$LEVEL_ZERO_VERSION failed to compile, exiting"
exit 1
fi
magic_compile_set level-zero-$LEVEL_ZERO_VERSION $level_zero_magic
cd $CWD
INFO "Done compiling Level-Zero-$LEVEL_ZERO_VERSION!"
else
INFO "Own Level-Zero-$LEVEL_ZERO_VERSION is up to date, nothing to do!"
INFO "If you want to force rebuild of this lib, use the --force-level-zero option."
fi
if [ -d $_inst ]; then
_create_inst_shortcut
fi
run_ldconfig "level-zero"
}
# ----------------------------------------------------------------------------
# Install on DEB-like
@@ -3925,7 +4065,6 @@ install_DEB() {
libopenal-dev libglew-dev yasm \
libsdl2-dev libfftw3-dev patch bzip2 libxml2-dev libtinyxml-dev libjemalloc-dev \
libgmp-dev libpugixml-dev libpotrace-dev libhpdf-dev libzstd-dev libpystring-dev"
# libglewmx-dev (broken in deb testing currently...)
VORBIS_USE=true
OGG_USE=true
@@ -4008,33 +4147,37 @@ install_DEB() {
WEBP_USE=true
fi
if [ "$WITH_ALL" = true ]; then
XVID_DEV="libxvidcore-dev"
check_package_DEB $XVID_DEV
if [ $? -eq 0 ]; then
XVID_USE=true
fi
MP3LAME_DEV="libmp3lame-dev"
check_package_DEB $MP3LAME_DEV
if [ $? -eq 0 ]; then
MP3LAME_USE=true
fi
VPX_DEV="libvpx-dev"
check_package_version_ge_DEB $VPX_DEV $VPX_VERSION_MIN
if [ $? -eq 0 ]; then
VPX_USE=true
fi
OPUS_DEV="libopus-dev"
check_package_version_ge_DEB $OPUS_DEV $OPUS_VERSION_MIN
if [ $? -eq 0 ]; then
OPUS_USE=true
fi
XVID_DEV="libxvidcore-dev"
check_package_DEB $XVID_DEV
if [ $? -eq 0 ]; then
XVID_USE=true
fi
# Check cmake/glew versions and disable features for older distros.
MP3LAME_DEV="libmp3lame-dev"
check_package_DEB $MP3LAME_DEV
if [ $? -eq 0 ]; then
MP3LAME_USE=true
fi
VPX_DEV="libvpx-dev"
check_package_version_ge_DEB $VPX_DEV $VPX_VERSION_MIN
if [ $? -eq 0 ]; then
VPX_USE=true
fi
AOM_DEV="libaom-dev"
check_package_version_ge_DEB $AOM_DEV $AOM_VERSION_MIN
if [ $? -eq 0 ]; then
AOM_USE=true
fi
OPUS_DEV="libopus-dev"
check_package_version_ge_DEB $OPUS_DEV $OPUS_VERSION_MIN
if [ $? -eq 0 ]; then
OPUS_USE=true
fi
# Check cmake version and disable features for older distros.
# This is so Blender can at least compile.
PRINT ""
_cmake=`get_package_version_DEB cmake`
@@ -4051,28 +4194,6 @@ install_DEB() {
fi
fi
PRINT ""
_glew=`get_package_version_DEB libglew-dev`
if [ -z $_glew ]; then
# Stupid virtual package in Ubuntu 12.04 doesn't show version number...
_glew=`apt-cache showpkg libglew-dev|tail -n1|awk '{print $2}'|sed 's/-.*//'`
fi
version_ge $_glew "1.9.0"
if [ $? -eq 1 ]; then
version_ge $_glew "1.7.0"
if [ $? -eq 1 ]; then
WARNING "OpenSubdiv disabled because GLEW-$_glew is not enough"
WARNING "Blender will not use system GLEW library"
OSD_SKIP=true
NO_SYSTEM_GLEW=true
else
WARNING "OpenSubdiv will compile with GLEW-$_glew but with limited capability"
WARNING "Blender will not use system GLEW library"
NO_SYSTEM_GLEW=true
fi
fi
PRINT ""
_do_compile_python=false
if [ "$PYTHON_SKIP" = true ]; then
@@ -4436,6 +4557,9 @@ install_DEB() {
if [ "$VPX_USE" = true ]; then
_packages="$_packages $VPX_DEV"
fi
if [ "$AOM_USE" = true ]; then
_packages="$_packages $AOM_DEV"
fi
if [ "$OPUS_USE" = true ]; then
_packages="$_packages $OPUS_DEV"
fi
@@ -4458,6 +4582,18 @@ install_DEB() {
PRINT ""
compile_XR_OpenXR_SDK
fi
PRINT ""
if [ "$LEVEL_ZERO_SKIP" = true ]; then
WARNING "Skipping Level Zero installation, as requested..."
elif [ "$LEVEL_ZERO_FORCE_BUILD" = true ]; then
INFO "Forced Level Zero building, as requested..."
compile_Level_Zero
else
# No package currently!
PRINT ""
compile_Level_Zero
fi
}
@@ -4724,21 +4860,27 @@ install_RPM() {
WEBP_USE=true
fi
if [ "$WITH_ALL" = true ]; then
VPX_DEV="libvpx-devel"
check_package_version_ge_RPM $VPX_DEV $VPX_VERSION_MIN
if [ $? -eq 0 ]; then
VPX_USE=true
fi
VPX_DEV="libvpx-devel"
check_package_version_ge_RPM $VPX_DEV $VPX_VERSION_MIN
if [ $? -eq 0 ]; then
VPX_USE=true
fi
AOM_DEV="libaom-devel"
check_package_version_ge_RPM $AOM_DEV $AOM_VERSION_MIN
if [ $? -eq 0 ]; then
AOM_USE=true
fi
OPUS_DEV="libopus-devel"
check_package_version_ge_RPM $OPUS_DEV $OPUS_VERSION_MIN
if [ $? -eq 0 ]; then
OPUS_USE=true
fi
if [ "$WITH_ALL" = true ]; then
PRINT ""
install_packages_RPM libspnav-devel
OPUS_DEV="libopus-devel"
check_package_version_ge_RPM $OPUS_DEV $OPUS_VERSION_MIN
if [ $? -eq 0 ]; then
OPUS_USE=true
fi
fi
PRINT ""
@@ -5123,6 +5265,9 @@ install_RPM() {
if [ "$VPX_USE" = true ]; then
_packages="$_packages $VPX_DEV"
fi
if [ "$AOM_USE" = true ]; then
_packages="$_packages $AOM_DEV"
fi
if [ "$OPUS_USE" = true ]; then
_packages="$_packages $OPUS_DEV"
fi
@@ -5144,6 +5289,18 @@ install_RPM() {
# No package currently!
compile_XR_OpenXR_SDK
fi
PRINT ""
if [ "$LEVEL_ZERO_SKIP" = true ]; then
WARNING "Skipping Level Zero installation, as requested..."
elif [ "$LEVEL_ZERO_FORCE_BUILD" = true ]; then
INFO "Forced Level Zero building, as requested..."
compile_Level_Zero
else
# No package currently!
PRINT ""
compile_Level_Zero
fi
}
@@ -5300,30 +5457,34 @@ install_ARCH() {
WEBP_USE=true
fi
if [ "$WITH_ALL" = true ]; then
XVID_DEV="xvidcore"
check_package_ARCH $XVID_DEV
if [ $? -eq 0 ]; then
XVID_USE=true
fi
XVID_DEV="xvidcore"
check_package_ARCH $XVID_DEV
if [ $? -eq 0 ]; then
XVID_USE=true
fi
MP3LAME_DEV="lame"
check_package_ARCH $MP3LAME_DEV
if [ $? -eq 0 ]; then
MP3LAME_USE=true
fi
MP3LAME_DEV="lame"
check_package_ARCH $MP3LAME_DEV
if [ $? -eq 0 ]; then
MP3LAME_USE=true
fi
VPX_DEV="libvpx"
check_package_version_ge_ARCH $VPX_DEV $VPX_VERSION_MIN
if [ $? -eq 0 ]; then
VPX_USE=true
fi
VPX_DEV="libvpx"
check_package_version_ge_ARCH $VPX_DEV $VPX_VERSION_MIN
if [ $? -eq 0 ]; then
VPX_USE=true
fi
OPUS_DEV="opus"
check_package_version_ge_ARCH $OPUS_DEV $OPUS_VERSION_MIN
if [ $? -eq 0 ]; then
OPUS_USE=true
fi
AOM_DEV="libaom"
check_package_version_ge_ARCH $AOM_DEV $AOM_VERSION_MIN
if [ $? -eq 0 ]; then
AOM_USE=true
fi
OPUS_DEV="opus"
check_package_version_ge_ARCH $OPUS_DEV $OPUS_VERSION_MIN
if [ $? -eq 0 ]; then
OPUS_USE=true
fi
@@ -5701,6 +5862,9 @@ install_ARCH() {
if [ "$VPX_USE" = true ]; then
_packages="$_packages $VPX_DEV"
fi
if [ "$AOM_USE" = true ]; then
_packages="$_packages $AOM_DEV"
fi
if [ "$OPUS_USE" = true ]; then
_packages="$_packages $OPUS_DEV"
fi
@@ -5721,6 +5885,18 @@ install_ARCH() {
# No package currently!
compile_XR_OpenXR_SDK
fi
PRINT ""
if [ "$LEVEL_ZERO_SKIP" = true ]; then
WARNING "Skipping Level Zero installation, as requested..."
elif [ "$LEVEL_ZERO_FORCE_BUILD" = true ]; then
INFO "Forced Level Zero building, as requested..."
compile_Level_Zero
else
# No package currently!
PRINT ""
compile_Level_Zero
fi
}
@@ -5895,6 +6071,14 @@ install_OTHER() {
INFO "Forced OpenXR-SDK building, as requested..."
compile_XR_OpenXR_SDK
fi
PRINT ""
if [ "$LEVEL_ZERO_SKIP" = true ]; then
WARNING "Skipping Level Zero installation, as requested..."
elif [ "$LEVEL_ZERO_FORCE_BUILD" = true ]; then
INFO "Forced Level Zero building, as requested..."
compile_Level_Zero
fi
}
# ----------------------------------------------------------------------------
@@ -6109,12 +6293,6 @@ print_info() {
fi
fi
if [ "$NO_SYSTEM_GLEW" = true ]; then
_1="-D WITH_SYSTEM_GLEW=OFF"
PRINT " $_1"
_buildargs="$_buildargs $_1"
fi
if [ "$FFMPEG_SKIP" = false ]; then
_1="-D WITH_CODEC_FFMPEG=ON"
PRINT " $_1"
@@ -6137,6 +6315,18 @@ print_info() {
fi
fi
# Not yet available in Blender.
#~ if [ "$LEVEL_ZERO_SKIP" = false ]; then
#~ _1="-D WITH_LEVEL_ZERO=ON"
#~ PRINT " $_1"
#~ _buildargs="$_buildargs $_1"
#~ if [ -d $INST/level-zero ]; then
#~ _1="-D LEVEL_ZERO_ROOT_DIR=$INST/level-zero"
#~ PRINT " $_1"
#~ _buildargs="$_buildargs $_1"
#~ fi
#~ fi
PRINT ""
PRINT "Or even simpler, just run (in your blender-source dir):"
PRINT " make -j$THREADS BUILD_CMAKE_ARGS=\"$_buildargs\""

View File

@@ -1,26 +0,0 @@
--- CmakeLists.txt.orig 2015-12-31 03:46:41 -0700
+++ CMakeLists.txt 2016-04-01 13:28:33 -0600
@@ -22,3 +22,10 @@
add_executable(testcuew cuewTest/cuewTest.c include/cuew.h)
target_link_libraries(testcuew cuew ${CMAKE_DL_LIBS})
+
+install(TARGETS cuew
+ LIBRARY DESTINATION lib COMPONENT libraries
+ ARCHIVE DESTINATION lib/static COMPONENT libraries)
+
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/cuew.h
+ DESTINATION include/)
\ No newline at end of file
--- src/cuew.c 2016-04-01 13:41:43 -0600
+++ src/cuew.c 2016-04-01 13:41:11 -0600
@@ -15,7 +15,9 @@
*/
#ifdef _MSC_VER
+#if _MSC_VER < 1900
# define snprintf _snprintf
+#endif
# define popen _popen
# define pclose _pclose
# define _CRT_SECURE_NO_WARNINGS

View File

@@ -0,0 +1,54 @@
diff -Naur external_dpcpp.orig/sycl/source/CMakeLists.txt external_dpcpp/sycl/source/CMakeLists.txt
--- external_dpcpp.orig/sycl/source/CMakeLists.txt 2022-05-20 04:19:45.067771362 +0000
+++ external_dpcpp/sycl/source/CMakeLists.txt 2022-05-20 04:21:49.708025048 +0000
@@ -66,10 +66,10 @@
target_compile_options(${LIB_OBJ_NAME} PUBLIC
-fvisibility=hidden -fvisibility-inlines-hidden)
set(linker_script "${CMAKE_CURRENT_SOURCE_DIR}/ld-version-script.txt")
- set(abi_linker_script "${CMAKE_CURRENT_SOURCE_DIR}/abi_replacements_linux.txt")
- target_link_libraries(
- ${LIB_NAME} PRIVATE "-Wl,${abi_linker_script}")
- set_target_properties(${LIB_NAME} PROPERTIES LINK_DEPENDS ${abi_linker_script})
+# set(abi_linker_script "${CMAKE_CURRENT_SOURCE_DIR}/abi_replacements_linux.txt")
+# target_link_libraries(
+# ${LIB_NAME} PRIVATE "-Wl,${abi_linker_script}")
+# set_target_properties(${LIB_NAME} PROPERTIES LINK_DEPENDS ${abi_linker_script})
target_link_libraries(
${LIB_NAME} PRIVATE "-Wl,--version-script=${linker_script}")
set_target_properties(${LIB_NAME} PROPERTIES LINK_DEPENDS ${linker_script})
diff -Naur llvm-sycl-nightly-20220501.orig\opencl/CMakeLists.txt llvm-sycl-nightly-20220501\opencl/CMakeLists.txt
--- llvm-sycl-nightly-20220501.orig/opencl/CMakeLists.txt 2022-04-29 13:47:11 -0600
+++ llvm-sycl-nightly-20220501/opencl/CMakeLists.txt 2022-05-21 15:25:06 -0600
@@ -11,6 +11,11 @@
)
endif()
+# Blender code below is determined to use FetchContent_Declare
+# temporarily allow it (but feed it our downloaded tarball
+# in the OpenCL_HEADERS variable
+set(FETCHCONTENT_FULLY_DISCONNECTED OFF)
+
# Repo URLs
set(OCL_HEADERS_REPO
@@ -77,5 +82,6 @@
FetchContent_MakeAvailable(ocl-icd)
add_library(OpenCL-ICD ALIAS OpenCL)
+set(FETCHCONTENT_FULLY_DISCONNECTED ON)
add_subdirectory(opencl-aot)
diff -Naur llvm-sycl-nightly-20220208.orig/libdevice/cmake/modules/SYCLLibdevice.cmake llvm-sycl-nightly-20220208/libdevice/cmake/modules/SYCLLibdevice.cmake
--- llvm-sycl-nightly-20220208.orig/libdevice/cmake/modules/SYCLLibdevice.cmake 2022-02-08 09:17:24 -0700
+++ llvm-sycl-nightly-20220208/libdevice/cmake/modules/SYCLLibdevice.cmake 2022-05-24 11:35:51 -0600
@@ -36,7 +36,9 @@
add_custom_target(libsycldevice-obj)
add_custom_target(libsycldevice-spv)
-add_custom_target(libsycldevice DEPENDS
+# Blender: add ALL here otherwise this target will not build
+# and cause an error due to missing files during the install phase.
+add_custom_target(libsycldevice ALL DEPENDS
libsycldevice-obj
libsycldevice-spv)

View File

@@ -1,30 +1,37 @@
diff -Naur orig/common/sys/platform.h external_embree/common/sys/platform.h
--- orig/common/sys/platform.h 2020-05-13 23:08:53 -0600
+++ external_embree/common/sys/platform.h 2020-06-13 17:40:26 -0600
@@ -84,8 +84,8 @@
////////////////////////////////////////////////////////////////////////////////
diff -Naur org/kernels/rtcore_config.h.in embree-3.13.4/kernels/rtcore_config.h.in
--- org/kernels/rtcore_config.h.in 2022-06-14 22:13:52 -0600
+++ embree-3.13.4/kernels/rtcore_config.h.in 2022-06-24 15:20:12 -0600
@@ -14,6 +14,7 @@
#cmakedefine01 EMBREE_MIN_WIDTH
#define RTC_MIN_WIDTH EMBREE_MIN_WIDTH
+#cmakedefine EMBREE_STATIC_LIB
#cmakedefine EMBREE_API_NAMESPACE
#if defined(EMBREE_API_NAMESPACE)
diff --git a/kernels/CMakeLists.txt b/kernels/CMakeLists.txt
index 7c2f43d..106b1d5 100644
--- a/kernels/CMakeLists.txt
+++ b/kernels/CMakeLists.txt
@@ -201,6 +201,12 @@ embree_files(EMBREE_LIBRARY_FILES_AVX512 ${AVX512})
#message("AVX2: ${EMBREE_LIBRARY_FILES_AVX2}")
#message("AVX512: ${EMBREE_LIBRARY_FILES_AVX512}")
#ifdef __WIN32__
-#define dll_export __declspec(dllexport)
-#define dll_import __declspec(dllimport)
+#define dll_export
+#define dll_import
#else
#define dll_export __attribute__ ((visibility ("default")))
#define dll_import
diff --git orig/common/tasking/CMakeLists.txt external_embree/common/tasking/CMakeLists.txt
--- orig/common/tasking/CMakeLists.txt
+++ external_embree/common/tasking/CMakeLists.txt
@@ -27,7 +27,11 @@
else()
# If not found try getting older TBB via module (FindTBB.cmake)
unset(TBB_DIR CACHE)
- find_package(TBB 4.1 REQUIRED tbb)
+ if (TBB_STATIC_LIB)
+ find_package(TBB 4.1 REQUIRED tbb_static)
+ else()
+ find_package(TBB 4.1 REQUIRED tbb)
+ endif()
if (TBB_FOUND)
TARGET_LINK_LIBRARIES(tasking PUBLIC TBB)
TARGET_INCLUDE_DIRECTORIES(tasking PUBLIC "${TBB_INCLUDE_DIRS}")
+# Bundle Neon2x into the main static library.
+IF(EMBREE_ISA_NEON2X AND EMBREE_STATIC_LIB)
+ LIST(APPEND EMBREE_LIBRARY_FILES ${EMBREE_LIBRARY_FILES_AVX2})
+ LIST(REMOVE_DUPLICATES EMBREE_LIBRARY_FILES)
+ENDIF()
+
# replaces all .cpp files with a dummy file that includes that .cpp file
# this is to work around an ICC name mangling issue related to lambda functions under windows
MACRO (CreateISADummyFiles list isa)
@@ -277,7 +283,7 @@ IF (EMBREE_ISA_AVX AND EMBREE_LIBRARY_FILES_AVX)
ENDIF()
ENDIF()
-IF (EMBREE_ISA_AVX2 AND EMBREE_LIBRARY_FILES_AVX2)
+IF (EMBREE_ISA_AVX2 AND EMBREE_LIBRARY_FILES_AVX2 AND NOT (EMBREE_ISA_NEON2X AND EMBREE_STATIC_LIB))
DISABLE_STACK_PROTECTOR_FOR_INTERSECTORS(${EMBREE_LIBRARY_FILES_AVX2})
ADD_LIBRARY(embree_avx2 STATIC ${EMBREE_LIBRARY_FILES_AVX2})
TARGET_LINK_LIBRARIES(embree_avx2 PRIVATE tasking)

View File

@@ -0,0 +1,44 @@
diff -Naur external_igc_opencl_clang.orig/CMakeLists.txt external_igc_opencl_clang/CMakeLists.txt
--- external_igc_opencl_clang.orig/CMakeLists.txt 2022-03-16 05:51:10 -0600
+++ external_igc_opencl_clang/CMakeLists.txt 2022-05-23 10:40:09 -0600
@@ -126,22 +126,24 @@
)
endif()
-
- set(SPIRV_BASE_REVISION llvm_release_110)
- set(TARGET_BRANCH "ocl-open-110")
- get_filename_component(LLVM_MONOREPO_DIR ${LLVM_SOURCE_DIR} DIRECTORY)
- set(LLVM_PATCHES_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/patches/llvm
- ${CMAKE_CURRENT_SOURCE_DIR}/patches/clang)
- apply_patches(${LLVM_MONOREPO_DIR}
- "${LLVM_PATCHES_DIRS}"
- ${LLVM_BASE_REVISION}
- ${TARGET_BRANCH}
- ret)
- apply_patches(${SPIRV_SOURCE_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/patches/spirv
- ${SPIRV_BASE_REVISION}
- ${TARGET_BRANCH}
- ret)
+ #
+ # Blender: Why apply these manually in igc.cmake
+ #
+ #set(SPIRV_BASE_REVISION llvm_release_110)
+ #set(TARGET_BRANCH "ocl-open-110")
+ #get_filename_component(LLVM_MONOREPO_DIR ${LLVM_SOURCE_DIR} DIRECTORY)
+ #set(LLVM_PATCHES_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/patches/llvm
+ # ${CMAKE_CURRENT_SOURCE_DIR}/patches/clang)
+ #apply_patches(${LLVM_MONOREPO_DIR}
+ # "${LLVM_PATCHES_DIRS}"
+ # ${LLVM_BASE_REVISION}
+ # ${TARGET_BRANCH}
+ # ret)
+ #apply_patches(${SPIRV_SOURCE_DIR}
+ # ${CMAKE_CURRENT_SOURCE_DIR}/patches/spirv
+ # ${SPIRV_BASE_REVISION}
+ # ${TARGET_BRANCH}
+ # ret)
endif(NOT USE_PREBUILT_LLVM)
#

View File

@@ -51,3 +51,52 @@ diff --git a/pxr/usd/sdr/shaderMetadataHelpers.h b/pxr/usd/sdr/shaderMetadataHel
/// \namespace ShaderMetadataHelpers
diff --git a/pxr/base/arch/timing.h b/pxr/base/arch/timing.h
index 517561f..fda5a1f 100644
--- a/pxr/base/arch/timing.h
+++ b/pxr/base/arch/timing.h
@@ -91,6 +91,10 @@ ArchGetTickTime()
inline uint64_t
ArchGetStartTickTime()
{
+ // BLENDER: avoid using rdtsc instruction that is not supported on older CPUs.
+ return ArchGetTickTime();
+
+#if 0
uint64_t t;
#if defined (ARCH_OS_DARWIN)
return ArchGetTickTime();
@@ -123,6 +127,7 @@ ArchGetStartTickTime()
#error "Unsupported architecture."
#endif
return t;
+#endif
}
/// Get a "stop" tick time for measuring an interval of time. See
@@ -132,6 +137,10 @@ ArchGetStartTickTime()
inline uint64_t
ArchGetStopTickTime()
{
+ // BLENDER: avoid using rdtsc instruction that is not supported on older CPUs.
+ return ArchGetTickTime();
+
+#if 0
uint64_t t;
#if defined (ARCH_OS_DARWIN)
return ArchGetTickTime();
@@ -162,11 +171,11 @@ ArchGetStopTickTime()
#error "Unsupported architecture."
#endif
return t;
+#endif
}
-#if defined (doxygen) || \
- (!defined(ARCH_OS_DARWIN) && defined(ARCH_CPU_INTEL) && \
- (defined(ARCH_COMPILER_CLANG) || defined(ARCH_COMPILER_GCC)))
+// BLENDER: avoid using rdtsc instruction that is not supported on older CPUs.
+#if 0
/// A simple timer class for measuring an interval of time using the
/// ArchTickTimer facilities.

View File

@@ -0,0 +1,11 @@
diff -Naur orig/configure external_vpx/configure
--- orig/configure 2022-07-06 09:22:04 -0600
+++ external_vpx/configure 2022-07-06 09:24:12 -0600
@@ -270,7 +270,6 @@
HAVE_LIST="
${ARCH_EXT_LIST}
vpx_ports
- pthread_h
unistd_h
"
EXPERIMENT_LIST="

View File

@@ -48,10 +48,13 @@ if "%4" == "nobuild" set dobuild=0
REM If Python is be available certain deps may try to
REM to use this over the version we build, to prevent that
REM make sure python is NOT in the path
for %%X in (python.exe) do (set PYTHON=%%~$PATH:X)
if EXIST "%PYTHON%" (
echo PYTHON found at %PYTHON% dependencies cannot be build with python available in the path
REM make sure pythonw is NOT in the path. We look for pythonw.exe
REM since windows apparently ships a python.exe that just opens up
REM the windows store but does not ship any actual python files that
REM could cause issues.
for %%X in (pythonw.exe) do (set PYTHONW=%%~$PATH:X)
if EXIST "%PYTHONW%" (
echo PYTHON found at %PYTHONW% dependencies cannot be build with python available in the path
goto exit
)

View File

@@ -0,0 +1,56 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2021-2022 Intel Corporation
# - Find Level Zero library
# Find Level Zero headers and libraries needed by oneAPI implementation
# This module defines
# LEVEL_ZERO_LIBRARY, libraries to link against in order to use L0.
# LEVEL_ZERO_INCLUDE_DIR, directories where L0 headers can be found.
# LEVEL_ZERO_ROOT_DIR, The base directory to search for L0 files.
# This can also be an environment variable.
# LEVEL_ZERO_FOUND, If false, then don't try to use L0.
IF(NOT LEVEL_ZERO_ROOT_DIR AND NOT $ENV{LEVEL_ZERO_ROOT_DIR} STREQUAL "")
SET(LEVEL_ZERO_ROOT_DIR $ENV{LEVEL_ZERO_ROOT_DIR})
ENDIF()
SET(_level_zero_search_dirs
${LEVEL_ZERO_ROOT_DIR}
/usr/lib
/usr/local/lib
)
FIND_LIBRARY(_LEVEL_ZERO_LIBRARY
NAMES
ze_loader
HINTS
${_level_zero_search_dirs}
PATH_SUFFIXES
lib64 lib
)
FIND_PATH(_LEVEL_ZERO_INCLUDE_DIR
NAMES
level_zero/ze_api.h
HINTS
${_level_zero_search_dirs}
PATH_SUFFIXES
include
)
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LevelZero DEFAULT_MSG _LEVEL_ZERO_LIBRARY _LEVEL_ZERO_INCLUDE_DIR)
IF(LevelZero_FOUND)
SET(LEVEL_ZERO_LIBRARY ${_LEVEL_ZERO_LIBRARY})
SET(LEVEL_ZERO_INCLUDE_DIR ${_LEVEL_ZERO_INCLUDE_DIR} ${_LEVEL_ZERO_INCLUDE_PARENT_DIR})
SET(LEVEL_ZERO_FOUND TRUE)
ELSE()
SET(LEVEL_ZERO_FOUND FALSE)
ENDIF()
MARK_AS_ADVANCED(
LEVEL_ZERO_LIBRARY
LEVEL_ZERO_INCLUDE_DIR
)

View File

@@ -175,7 +175,9 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(PythonLibsUnix DEFAULT_MSG
IF(PYTHONLIBSUNIX_FOUND)
# Assign cache items
SET(PYTHON_INCLUDE_DIRS ${PYTHON_INCLUDE_DIR} ${PYTHON_INCLUDE_CONFIG_DIR})
SET(PYTHON_LIBRARIES ${PYTHON_LIBRARY})
IF(NOT WITH_PYTHON_MODULE)
SET(PYTHON_LIBRARIES ${PYTHON_LIBRARY})
ENDIF()
FIND_FILE(PYTHON_SITE_PACKAGES
NAMES

View File

@@ -0,0 +1,88 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2021-2022 Intel Corporation
# - Find SYCL library
# Find the native SYCL header and libraries needed by oneAPI implementation
# This module defines
# SYCL_COMPILER, compiler which will be used for compilation of SYCL code
# SYCL_LIBRARY, libraries to link against in order to use SYCL.
# SYCL_INCLUDE_DIR, directories where SYCL headers can be found
# SYCL_ROOT_DIR, The base directory to search for SYCL files.
# This can also be an environment variable.
# SYCL_FOUND, If false, then don't try to use SYCL.
IF(NOT SYCL_ROOT_DIR AND NOT $ENV{SYCL_ROOT_DIR} STREQUAL "")
SET(SYCL_ROOT_DIR $ENV{SYCL_ROOT_DIR})
ENDIF()
SET(_sycl_search_dirs
${SYCL_ROOT_DIR}
/usr/lib
/usr/local/lib
/opt/intel/oneapi/compiler/latest/linux/
C:/Program\ Files\ \(x86\)/Intel/oneAPI/compiler/latest/windows
)
# Find DPC++ compiler.
# Since the compiler name is possibly conflicting with the system-wide
# CLang start with looking for either dpcpp or clang binary in the given
# list of search paths only. If that fails, try to look for a system-wide
# dpcpp binary.
FIND_PROGRAM(SYCL_COMPILER
NAMES
dpcpp
clang++
HINTS
${_sycl_search_dirs}
PATH_SUFFIXES
bin
NO_CMAKE_FIND_ROOT_PATH
NAMES_PER_DIR
)
# NOTE: No clang++ here so that we do not pick up a system-wide CLang
# compiler.
if(NOT SYCL_COMPILER)
FIND_PROGRAM(SYCL_COMPILER
NAMES
dpcpp
HINTS
${_sycl_search_dirs}
PATH_SUFFIXES
bin
)
endif()
FIND_LIBRARY(SYCL_LIBRARY
NAMES
sycl
HINTS
${_sycl_search_dirs}
PATH_SUFFIXES
lib64 lib
)
FIND_PATH(SYCL_INCLUDE_DIR
NAMES
CL/sycl.hpp
HINTS
${_sycl_search_dirs}
PATH_SUFFIXES
include
include/sycl
)
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SYCL DEFAULT_MSG SYCL_LIBRARY SYCL_INCLUDE_DIR)
IF(SYCL_FOUND)
get_filename_component(_SYCL_INCLUDE_PARENT_DIR ${SYCL_INCLUDE_DIR} DIRECTORY)
SET(SYCL_INCLUDE_DIR ${SYCL_INCLUDE_DIR} ${_SYCL_INCLUDE_PARENT_DIR})
ELSE()
SET(SYCL_SYCL_FOUND FALSE)
ENDIF()
MARK_AS_ADVANCED(
_SYCL_INCLUDE_PARENT_DIR
)

View File

@@ -64,6 +64,7 @@ ENDIF()
MARK_AS_ADVANCED(
USD_INCLUDE_DIR
USD_LIBRARY_DIR
USD_LIBRARY
)
UNSET(_usd_SEARCH_DIRS)

View File

@@ -74,4 +74,9 @@ ENDIF()
MARK_AS_ADVANCED(
WEBP_INCLUDE_DIR
WEBP_LIBRARY_DIR
# Generated names.
WEBP_WEBPDEMUX_LIBRARY
WEBP_WEBPMUX_LIBRARY
WEBP_WEBP_LIBRARY
)

View File

@@ -1,8 +1,6 @@
#!/usr/bin/env python3
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8 compliant>
"""
Example linux usage
python3 ~/blender-git/blender/build_files/cmake/cmake_netbeans_project.py ~/blender-git/cmake

View File

@@ -1,8 +1,6 @@
#!/usr/bin/env python3
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8 compliant>
r"""
Example Linux usage:
python ~/blender-git/blender/build_files/cmake/cmake_qtcreator_project.py --build-dir ~/blender-git/cmake

View File

@@ -1,8 +1,6 @@
#!/usr/bin/env python3
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8 compliant>
import project_source_info
import subprocess
import sys

View File

@@ -1,8 +1,6 @@
#!/usr/bin/env python3
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8 compliant>
import project_source_info
import subprocess
import sys

View File

@@ -1,8 +1,6 @@
#!/usr/bin/env python3
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8 compliant>
CHECKER_IGNORE_PREFIX = [
"extern",
"intern/moto",

View File

@@ -1,8 +1,6 @@
#!/usr/bin/env python3
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8 compliant>
CHECKER_IGNORE_PREFIX = [
"extern",
"intern/moto",

View File

@@ -1,8 +1,6 @@
#!/usr/bin/env python3
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8 compliant>
CHECKER_IGNORE_PREFIX = [
"extern",
"intern/moto",

View File

@@ -37,6 +37,9 @@ set(WITH_IMAGE_TIFF OFF CACHE BOOL "" FORCE)
set(WITH_IMAGE_WEBP OFF CACHE BOOL "" FORCE)
set(WITH_INPUT_NDOF OFF CACHE BOOL "" FORCE)
set(WITH_INTERNATIONAL OFF CACHE BOOL "" FORCE)
set(WITH_IO_STL OFF CACHE BOOL "" FORCE)
set(WITH_IO_WAVEFRONT_OBJ OFF CACHE BOOL "" FORCE)
set(WITH_IO_GPENCIL OFF CACHE BOOL "" FORCE)
set(WITH_JACK OFF CACHE BOOL "" FORCE)
set(WITH_LIBMV OFF CACHE BOOL "" FORCE)
set(WITH_LLVM OFF CACHE BOOL "" FORCE)

View File

@@ -70,7 +70,7 @@ if(NOT WIN32)
set(WITH_JACK ON CACHE BOOL "" FORCE)
endif()
if(WIN32)
set(WITH_WASAPI ON CACHE BOOL "" FORCE)
set(WITH_WASAPI ON CACHE BOOL "" FORCE)
endif()
if(UNIX AND NOT APPLE)
set(WITH_DOC_MANPAGE ON CACHE BOOL "" FORCE)
@@ -86,4 +86,8 @@ if(NOT APPLE)
set(WITH_CYCLES_CUDA_BINARIES ON CACHE BOOL "" FORCE)
set(WITH_CYCLES_CUBIN_COMPILER OFF CACHE BOOL "" FORCE)
set(WITH_CYCLES_HIP_BINARIES ON CACHE BOOL "" FORCE)
set(WITH_CYCLES_DEVICE_ONEAPI ON CACHE BOOL "" FORCE)
# Disable AoT kernels compilations until buildbot can deliver them in a reasonable time.
set(WITH_CYCLES_ONEAPI_BINARIES OFF CACHE BOOL "" FORCE)
endif()

View File

@@ -162,6 +162,9 @@ if(WITH_CODEC_FFMPEG)
mp3lame ogg opus swresample swscale
theora theoradec theoraenc vorbis vorbisenc
vorbisfile vpx x264 xvidcore)
if(EXISTS ${LIBDIR}/ffmpeg/lib/libaom.a)
list(APPEND FFMPEG_FIND_COMPONENTS aom)
endif()
find_package(FFmpeg)
endif()
@@ -467,8 +470,9 @@ string(APPEND CMAKE_CXX_FLAGS " -ftemplate-depth=1024")
# Avoid conflicts with Luxrender, and other plug-ins that may use the same
# libraries as Blender with a different version or build options.
set(PLATFORM_SYMBOLS_MAP ${CMAKE_SOURCE_DIR}/source/creator/symbols_apple.map)
string(APPEND PLATFORM_LINKFLAGS
" -Wl,-unexported_symbols_list,'${CMAKE_SOURCE_DIR}/source/creator/osx_locals.map'"
" -Wl,-unexported_symbols_list,'${PLATFORM_SYMBOLS_MAP}'"
)
string(APPEND CMAKE_CXX_FLAGS " -stdlib=libc++")

View File

@@ -38,9 +38,15 @@ if(EXISTS ${LIBDIR})
message(STATUS "Using pre-compiled LIBDIR: ${LIBDIR}")
file(GLOB LIB_SUBDIRS ${LIBDIR}/*)
# Ignore Mesa software OpenGL libraries, they are not intended to be
# linked against but to optionally override at runtime.
list(REMOVE_ITEM LIB_SUBDIRS ${LIBDIR}/mesa)
# Ignore DPC++ as it contains its own copy of LLVM/CLang which we do
# not need to be ever discovered for the Blender linking.
list(REMOVE_ITEM LIB_SUBDIRS ${LIBDIR}/dpcpp)
# NOTE: Make sure "proper" compiled zlib comes first before the one
# which is a part of OpenCollada. They have different ABI, and we
# do need to use the official one.
@@ -196,6 +202,9 @@ if(WITH_CODEC_FFMPEG)
vpx
x264
xvidcore)
if(EXISTS ${LIBDIR}/ffmpeg/lib/libaom.a)
list(APPEND FFMPEG_FIND_COMPONENTS aom)
endif()
elseif(FFMPEG)
# Old cache variable used for root dir, convert to new standard.
set(FFMPEG_ROOT_DIR ${FFMPEG})
@@ -271,6 +280,18 @@ if(WITH_CYCLES AND WITH_CYCLES_OSL)
endif()
endif()
if(WITH_CYCLES_DEVICE_ONEAPI)
set(CYCLES_LEVEL_ZERO ${LIBDIR}/level-zero CACHE PATH "Path to Level Zero installation")
if(EXISTS ${CYCLES_LEVEL_ZERO} AND NOT LEVEL_ZERO_ROOT_DIR)
set(LEVEL_ZERO_ROOT_DIR ${CYCLES_LEVEL_ZERO})
endif()
set(CYCLES_SYCL ${LIBDIR}/dpcpp CACHE PATH "Path to DPC++ and SYCL installation")
if(EXISTS ${CYCLES_SYCL} AND NOT SYCL_ROOT_DIR)
set(SYCL_ROOT_DIR ${CYCLES_SYCL})
endif()
endif()
if(WITH_OPENVDB)
find_package_wrapper(OpenVDB)
find_package_wrapper(Blosc)
@@ -613,17 +634,42 @@ if(WITH_GHOST_WAYLAND)
pkg_check_modules(wayland-scanner REQUIRED wayland-scanner)
pkg_check_modules(xkbcommon REQUIRED xkbcommon)
pkg_check_modules(wayland-cursor REQUIRED wayland-cursor)
pkg_check_modules(dbus REQUIRED dbus-1)
set(WITH_GL_EGL ON)
if(WITH_GHOST_WAYLAND_DBUS)
pkg_check_modules(dbus REQUIRED dbus-1)
endif()
if(WITH_GHOST_WAYLAND_LIBDECOR)
pkg_check_modules(libdecor REQUIRED libdecor-0>=0.1)
endif()
list(APPEND PLATFORM_LINKLIBS
${wayland-client_LINK_LIBRARIES}
${wayland-egl_LINK_LIBRARIES}
${xkbcommon_LINK_LIBRARIES}
${wayland-cursor_LINK_LIBRARIES}
${dbus_LINK_LIBRARIES}
)
if(NOT WITH_GHOST_WAYLAND_DYNLOAD)
list(APPEND PLATFORM_LINKLIBS
${wayland-client_LINK_LIBRARIES}
${wayland-egl_LINK_LIBRARIES}
${wayland-cursor_LINK_LIBRARIES}
)
endif()
if(WITH_GHOST_WAYLAND_DBUS)
list(APPEND PLATFORM_LINKLIBS
${dbus_LINK_LIBRARIES}
)
add_definitions(-DWITH_GHOST_WAYLAND_DBUS)
endif()
if(WITH_GHOST_WAYLAND_LIBDECOR)
if(NOT WITH_GHOST_WAYLAND_DYNLOAD)
list(APPEND PLATFORM_LINKLIBS
${libdecor_LIBRARIES}
)
endif()
add_definitions(-DWITH_GHOST_WAYLAND_LIBDECOR)
endif()
endif()
if(WITH_GHOST_X11)
@@ -842,8 +888,9 @@ unset(_IS_LINKER_DEFAULT)
# Avoid conflicts with Mesa llvmpipe, Luxrender, and other plug-ins that may
# use the same libraries as Blender with a different version or build options.
set(PLATFORM_SYMBOLS_MAP ${CMAKE_SOURCE_DIR}/source/creator/symbols_unix.map)
set(PLATFORM_LINKFLAGS
"${PLATFORM_LINKFLAGS} -Wl,--version-script='${CMAKE_SOURCE_DIR}/source/creator/blender.map'"
"${PLATFORM_LINKFLAGS} -Wl,--version-script='${PLATFORM_SYMBOLS_MAP}'"
)
# Don't use position independent executable for portable install since file

View File

@@ -104,7 +104,7 @@ string(APPEND CMAKE_MODULE_LINKER_FLAGS " /SAFESEH:NO /ignore:4099")
list(APPEND PLATFORM_LINKLIBS
ws2_32 vfw32 winmm kernel32 user32 gdi32 comdlg32 Comctl32 version
advapi32 shfolder shell32 ole32 oleaut32 uuid psapi Dbghelp Shlwapi
pathcch Shcore
pathcch Shcore Dwmapi
)
if(WITH_INPUT_IME)
@@ -950,3 +950,6 @@ endif()
set(ZSTD_INCLUDE_DIRS ${LIBDIR}/zstd/include)
set(ZSTD_LIBRARIES ${LIBDIR}/zstd/lib/zstd_static.lib)
set(LEVEL_ZERO_ROOT_DIR ${LIBDIR}/level_zero)
set(SYCL_ROOT_DIR ${LIBDIR}/dpcpp)

View File

@@ -1,8 +1,6 @@
#!/usr/bin/env python3
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8 compliant>
"""
Module for accessing project file data for Blender.
@@ -170,7 +168,7 @@ def cmake_advanced_info() -> Union[Tuple[List[str], List[Tuple[str, str]]], Tupl
project_path = create_eclipse_project()
if not exists(project_path):
print("Generating Eclipse Prokect File Failed: %r not found" % project_path)
print("Generating Eclipse Project File Failed: %r not found" % project_path)
return None, None
from xml.dom.minidom import parse

View File

@@ -1,7 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8 compliant>
__all__ = (
"build_info",
"SOURCE_DIR",

View File

@@ -54,6 +54,8 @@ buildbot:
version: '10.1.243'
cuda11:
version: '11.4.1'
hip:
version: '5.2.21440'
optix:
version: '7.3.0'
cmake:

View File

@@ -1,8 +1,6 @@
#!/usr/bin/env python3
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8 compliant>
import os
import shutil
import subprocess

View File

@@ -38,7 +38,7 @@ PROJECT_NAME = Blender
# could be handy for archiving the generated documentation or if some version
# control system is used.
PROJECT_NUMBER = V3.2
PROJECT_NUMBER = V3.4
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a

View File

@@ -11,8 +11,6 @@ where <path-to-blender> is the path to the Blender executable,
and <output-filename> is where to write the generated man page.
'''
# <pep8 compliant>
import argparse
import os
import subprocess

View File

@@ -10,7 +10,7 @@ Notes:
- Temporary context overrides may be nested, when this is done, members will be added to the existing overrides.
- Context members are restored outside the scope of the context.
- Context members are restored outside the scope of the context-manager.
The only exception to this is when the data is no longer available.
In the event windowing data was removed (for example), the state of the context is left as-is.

View File

@@ -0,0 +1,46 @@
"""
Image Data
++++++++++
The Image data-block is a shallow wrapper around image or video file(s)
(on disk, as packed data, or generated).
All actual data like the pixel buffer, size, resolution etc. is
cached in an :class:`imbuf.types.ImBuf` image buffer (or several buffers
in some cases, like UDIM textures, multi-views, animations...).
Several properties and functions of the Image data-block are then actually
using/modifying its image buffer, and not the Image data-block itself.
.. warning::
One key limitation is that image buffers are not shared between different
Image data-blocks, and they are not duplicated when copying an image.
So until a modified image buffer is saved on disk, duplicating its Image
data-block will not propagate the underlying buffer changes to the new Image.
This example script generates an Image data-block with a given size,
change its first pixel, rescale it, and duplicates the image.
The duplicated image still has the same size and colors as the original image
at its creation, all editing in the original image's buffer is 'lost' in its copy.
"""
import bpy
image_src = bpy.data.images.new('src', 1024, 102)
print(image_src.size)
print(image_src.pixels[0:4])
image_src.scale(1024, 720)
image_src.pixels[0:4] = (0.5, 0.5, 0.5, 0.5)
image_src.update()
print(image_src.size)
print(image_src.pixels[0:4])
image_dest = image_src.copy()
image_dest.update()
print(image_dest.size)
print(image_dest.pixels[0:4])

View File

@@ -29,3 +29,36 @@ def draw():
bpy.types.SpaceView3D.draw_handler_add(draw, (), 'WINDOW', 'POST_PIXEL')
"""
3D Image
--------
Similar to the 2D Image shader, but works with 3D positions for the image vertices.
To use this example you have to provide an image that should be displayed.
"""
import bpy
import gpu
from gpu_extras.batch import batch_for_shader
IMAGE_NAME = "Untitled"
image = bpy.data.images[IMAGE_NAME]
texture = gpu.texture.from_image(image)
shader = gpu.shader.from_builtin('3D_IMAGE')
batch = batch_for_shader(
shader, 'TRIS',
{
"pos": ((0, 0, 0), (0, 1, 1), (1, 1, 1), (1, 1, 1), (1, 0, 0), (0, 0, 0)),
"texCoord": ((0, 0), (0, 1), (1, 1), (1, 1), (1, 0), (0, 0)),
},
)
def draw():
shader.bind()
shader.uniform_sampler("image", texture)
batch.draw(shader)
bpy.types.SpaceView3D.draw_handler_add(draw, (), 'WINDOW', 'POST_VIEW')

View File

@@ -1,12 +1,12 @@
sphinx==4.1.1
sphinx==5.0.1
# Sphinx dependencies that are important
Jinja2==3.0.1
Pygments==2.10.0
Jinja2==3.1.2
Pygments==2.12.0
docutils==0.17.1
snowballstemmer==2.1.0
babel==2.9.1
requests==2.26.0
snowballstemmer==2.2.0
babel==2.10.1
requests==2.27.1
# Only needed to match the theme used for the official documentation.
# Without this theme, the default theme will be used.

View File

@@ -4,6 +4,12 @@ OpenGL Wrapper (bgl)
.. module:: bgl
.. warning::
This module is deprecated and will be removed in a future release,
when OpenGL is replaced by Metal and Vulkan.
Use the graphics API independent :mod:`gpu` module instead.
This module wraps OpenGL constants and functions, making them available from
within Blender Python.

View File

@@ -40,15 +40,6 @@ As well as pep8 we have additional conventions used for Blender Python scripts:
- pep8 also defines that lines should not exceed 79 characters,
we have decided that this is too restrictive so it is optional per script.
Periodically we run checks for pep8 compliance on Blender scripts,
for scripts to be included in this check add this line as a comment at the top of the script:
``# <pep8 compliant>``
To enable line length checks use this instead:
``# <pep8-80 compliant>``
User Interface Layout
=====================

View File

@@ -1,7 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8 compliant>
# This is a quite stupid script which extracts bmesh api docs from
# 'bmesh_opdefines.c' in order to avoid having to add a lot of introspection
# data access into the api.

View File

@@ -1,61 +1,111 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8 compliant>
"""
Dump the python API into a text file so we can generate changelogs.
---------------
output from this tool should be added into "doc/python_api/rst/change_log.rst"
Dump the python API into a JSON file, or generate changelogs from those JSON API dumps.
# dump api blender_version.py in CWD
blender --background --python doc/python_api/sphinx_changelog_gen.py -- --dump
Typically, changelog output from this tool should be added into "doc/python_api/rst/change_log.rst"
# create changelog
API dump files are saved together with the generated API doc on the server, with a general index file.
This way the changelog generation simply needs to re-download the previous version's dump for the diffing process.
---------------
# Dump api blender_version.json in CWD:
blender --background --factory-startup --python doc/python_api/sphinx_changelog_gen.py -- \
--indexpath="path/to/api/docs/api_dump_index.json" \
dump --filepath-out="path/to/api/docs/<version>/api_dump.json"
# Create changelog:
blender --background --factory-startup --python doc/python_api/sphinx_changelog_gen.py -- \
--api_from blender_2_63_0.py \
--api_to blender_2_64_0.py \
--api_out changes.rst
--indexpath="path/to/api/docs/api_dump_index.json" \
changelog --filepath-out doc/python_api/rst/change_log.rst
# Api comparison can also run without blender
# Api comparison can also run without blender,
# will by default generate changeloig between the last two available versions listed in the index,
# unless input files are provided explicitely:
python doc/python_api/sphinx_changelog_gen.py -- \
--api_from blender_api_2_63_0.py \
--api_to blender_api_2_64_0.py \
--api_out changes.rst
--indexpath="path/to/api/docs/api_dump_index.json" \
changelog --filepath-in-from blender_api_2_63_0.json \
--filepath-in-to blender_api_2_64_0.json \
--filepath-out changes.rst
# Save the latest API dump in this folder, renaming it with its revision.
# This way the next person updating it doesn't need to build an old Blender only for that
--------------
API dump index format:
{[version_main, version_sub]: "<version>/api_dump.json", ...
}
API dump format:
[
[version_main, vserion_sub, version_path],
{"module.name":
{"parent.class":
{"basic_type", "member_name":
["Name", type, range, length, default, descr, f_args, f_arg_types, f_ret_types]}, ...
}, ...
}
]
"""
# format
'''
{"module.name":
{"parent.class":
{"basic_type", "member_name":
("Name", type, range, length, default, descr, f_args, f_arg_types, f_ret_types)}, ...
}, ...
}
'''
import json
import os
api_names = "basic_type" "name", "type", "range", "length", "default", "descr", "f_args", "f_arg_types", "f_ret_types"
API_BASIC_TYPE = 0
API_F_ARGS = 7
def api_dunp_fname():
import bpy
return "blender_api_%s.py" % "_".join([str(i) for i in bpy.app.version])
def api_version():
try:
import bpy
except:
return None, None
version = tuple(bpy.app.version[:2])
version_key = "%d.%d" % (version[0], version[1])
return version, version_key
def api_dump():
dump = {}
dump_module = dump["bpy.types"] = {}
def api_version_previous_in_index(index, version):
print("Searching for previous version to %s in %r" % (version, index))
version_prev = (version[0], version[1])
while True:
version_prev = (version_prev[0], version_prev[1] - 1)
if version_prev[1] < 0:
version_prev = (version_prev[0] - 1, 99)
if version_prev[0] < 0:
return None, None
version_prev_key = "%d.%d" % (version_prev[0], version_prev[1])
if version_prev_key in index:
print("Found previous version %s: %r" % (version_prev, index[version_prev_key]))
return version_prev, version_prev_key
class JSONEncoderAPIDump(json.JSONEncoder):
def default(self, o):
if o is ...:
return "..."
if isinstance(o, set):
return tuple(o)
return json.JSONEncoder.default(self, o)
def api_dump(args):
import rna_info
import inspect
version, version_key = api_version()
if version is None:
raise(ValueError("API dumps can only be generated from within Blender."))
dump = {}
dump_module = dump["bpy.types"] = {}
struct = rna_info.BuildRNAInfo()[0]
for struct_id, struct_info in sorted(struct.items()):
@@ -157,17 +207,25 @@ def api_dump():
)
del funcs
import pprint
filepath_out = args.filepath_out
with open(filepath_out, 'w', encoding='utf-8') as file_handle:
json.dump((version, dump), file_handle, cls=JSONEncoderAPIDump)
filename = api_dunp_fname()
filehandle = open(filename, 'w', encoding='utf-8')
tot = filehandle.write(pprint.pformat(dump, width=1))
filehandle.close()
print("%s, %d bytes written" % (filename, tot))
indexpath = args.indexpath
rootpath = os.path.dirname(indexpath)
if os.path.exists(indexpath):
with open(indexpath, 'r', encoding='utf-8') as file_handle:
index = json.load(file_handle)
else:
index = {}
index[version_key] = os.path.relpath(filepath_out, rootpath)
with open(indexpath, 'w', encoding='utf-8') as file_handle:
json.dump(index, file_handle)
print("API version %s dumped into %r, and index %r has been updated" % (version_key, filepath_out, indexpath))
def compare_props(a, b, fuzz=0.75):
# must be same basic_type, function != property
if a[0] != b[0]:
return False
@@ -182,15 +240,44 @@ def compare_props(a, b, fuzz=0.75):
return ((tot / totlen) >= fuzz)
def api_changelog(api_from, api_to, api_out):
def api_changelog(args):
indexpath = args.indexpath
filepath_in_from = args.filepath_in_from
filepath_in_to = args.filepath_in_to
filepath_out = args.filepath_out
file_handle = open(api_from, 'r', encoding='utf-8')
dict_from = eval(file_handle.read())
file_handle.close()
rootpath = os.path.dirname(indexpath)
file_handle = open(api_to, 'r', encoding='utf-8')
dict_to = eval(file_handle.read())
file_handle.close()
version, version_key = api_version()
if version is None and (filepath_in_from is None or filepath_in_to is None):
raise(ValueError("API dumps files must be given when ran outside of Blender."))
with open(indexpath, 'r', encoding='utf-8') as file_handle:
index = json.load(file_handle)
if filepath_in_to is None:
filepath_in_to = index.get(version_key, None)
if filepath_in_to is None:
raise(ValueError("Cannot find API dump file for Blender version " + str(version) + " in index file."))
print("Found to file: %r" % filepath_in_to)
if filepath_in_from is None:
version_from, version_from_key = api_version_previous_in_index(index, version)
if version_from is None:
raise(ValueError("No previous version of Blender could be found in the index."))
filepath_in_from = index.get(version_from_key, None)
if filepath_in_from is None:
raise(ValueError("Cannot find API dump file for previous Blender version " + str(version_from) + " in index file."))
print("Found from file: %r" % filepath_in_from)
with open(os.path.join(rootpath, filepath_in_from), 'r', encoding='utf-8') as file_handle:
_, dict_from = json.load(file_handle)
with open(os.path.join(rootpath, filepath_in_to), 'r', encoding='utf-8') as file_handle:
dump_version, dict_to = json.load(file_handle)
assert(tuple(dump_version) == version)
api_changes = []
@@ -251,63 +338,66 @@ def api_changelog(api_from, api_to, api_out):
# also document function argument changes
fout = open(api_out, 'w', encoding='utf-8')
fw = fout.write
# print(api_changes)
with open(filepath_out, 'w', encoding='utf-8') as fout:
fw = fout.write
# :class:`bpy_struct.id_data`
# Write header.
fw(""
":tocdepth: 2\n"
"\n"
"Blender API Change Log\n"
"**********************\n"
"\n"
".. note, this document is auto generated by sphinx_changelog_gen.py\n"
"\n"
"\n"
"%s to %s\n"
"============\n"
"\n" % (version_from_key, version_key))
def write_title(title, title_char):
fw("%s\n%s\n\n" % (title, title_char * len(title)))
def write_title(title, title_char):
fw("%s\n%s\n\n" % (title, title_char * len(title)))
for mod_id, class_id, props_moved, props_new, props_old, func_args in api_changes:
class_name = class_id.split(".")[-1]
title = mod_id + "." + class_name
write_title(title, "-")
for mod_id, class_id, props_moved, props_new, props_old, func_args in api_changes:
class_name = class_id.split(".")[-1]
title = mod_id + "." + class_name
write_title(title, "-")
if props_new:
write_title("Added", "^")
for prop_id in props_new:
fw("* :class:`%s.%s.%s`\n" % (mod_id, class_name, prop_id))
fw("\n")
if props_new:
write_title("Added", "^")
for prop_id in props_new:
fw("* :class:`%s.%s.%s`\n" % (mod_id, class_name, prop_id))
fw("\n")
if props_old:
write_title("Removed", "^")
for prop_id in props_old:
fw("* **%s**\n" % prop_id) # can't link to removed docs
fw("\n")
if props_old:
write_title("Removed", "^")
for prop_id in props_old:
fw("* **%s**\n" % prop_id) # can't link to removed docs
fw("\n")
if props_moved:
write_title("Renamed", "^")
for prop_id_old, prop_id in props_moved:
fw("* **%s** -> :class:`%s.%s.%s`\n" % (prop_id_old, mod_id, class_name, prop_id))
fw("\n")
if props_moved:
write_title("Renamed", "^")
for prop_id_old, prop_id in props_moved:
fw("* **%s** -> :class:`%s.%s.%s`\n" % (prop_id_old, mod_id, class_name, prop_id))
fw("\n")
if func_args:
write_title("Function Arguments", "^")
for func_id, args_old, args_new in func_args:
args_new = ", ".join(args_new)
args_old = ", ".join(args_old)
fw("* :class:`%s.%s.%s` (%s), *was (%s)*\n" % (mod_id, class_name, func_id, args_new, args_old))
fw("\n")
if func_args:
write_title("Function Arguments", "^")
for func_id, args_old, args_new in func_args:
args_new = ", ".join(args_new)
args_old = ", ".join(args_old)
fw("* :class:`%s.%s.%s` (%s), *was (%s)*\n" % (mod_id, class_name, func_id, args_new, args_old))
fw("\n")
fout.close()
print("Written: %r" % api_out)
print("Written: %r" % filepath_out)
def main():
def main(argv=None):
import sys
import os
import argparse
try:
import argparse
except ImportError:
print("Old Blender, just dumping")
api_dump()
return
argv = sys.argv
if argv is None:
argv = sys.argv
if "--" not in argv:
argv = [] # as if no args are passed
@@ -318,42 +408,42 @@ def main():
usage_text = "Run blender in background mode with this script: "
"blender --background --factory-startup --python %s -- [options]" % os.path.basename(__file__)
epilog = "Run this before releases"
parser = argparse.ArgumentParser(description=usage_text, epilog=epilog)
parser = argparse.ArgumentParser(description=usage_text,
epilog=__doc__,
formatter_class=argparse.RawDescriptionHelpFormatter)
parser.add_argument(
"--dump", dest="dump", action='store_true',
help="When set the api will be dumped into blender_version.py")
"--indexpath", dest="indexpath", metavar='FILE', required=True,
help="Path of the JSON file containing the index of all available API dumps.")
parser.add_argument(
"--api_from", dest="api_from", metavar='FILE',
help="File to compare from (previous version)")
parser.add_argument(
"--api_to", dest="api_to", metavar='FILE',
help="File to compare from (current)")
parser.add_argument(
"--api_out", dest="api_out", metavar='FILE',
help="Output sphinx changelog")
parser_commands = parser.add_subparsers(required=True)
args = parser.parse_args(argv) # In this example we won't use the args
parser_dump = parser_commands.add_parser('dump', help="Dump the current Blender Python API into a JSON file.")
parser_dump.add_argument(
"--filepath-out", dest="filepath_out", metavar='FILE', required=True,
help="Path of the JSON file containing the dump of the API.")
parser_dump.set_defaults(func=api_dump)
if not argv:
print("No args given!")
parser.print_help()
return
parser_changelog = parser_commands.add_parser(
'changelog',
help="Generate the RST changelog page based on two Blender Python API JSON dumps.",
)
if args.dump:
api_dump()
else:
if args.api_from and args.api_to and args.api_out:
api_changelog(args.api_from, args.api_to, args.api_out)
else:
print("Error: --api_from/api_to/api_out args needed")
parser.print_help()
return
parser_changelog.add_argument(
"--filepath-in-from", dest="filepath_in_from", metavar='FILE', default=None,
help="JSON dump file to compare from (typically, previous version). "
"If not given, will be automatically determined from current Blender version and index file.")
parser_changelog.add_argument(
"--filepath-in-to", dest="filepath_in_to", metavar='FILE', default=None,
help="JSON dump file to compare to (typically, current version). "
"If not given, will be automatically determined from current Blender version and index file.")
parser_changelog.add_argument(
"--filepath-out", dest="filepath_out", metavar='FILE', required=True,
help="Output sphinx changelog RST file.")
parser_changelog.set_defaults(func=api_changelog)
print("batch job finished, exiting")
args = parser.parse_args(argv)
args.func(args)
if __name__ == "__main__":

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8 compliant>
bpy_types_Operator_bl_property__doc__ = (
"""
The name of a property to use as this operators primary property.

View File

@@ -1,10 +1,3 @@
/* T76453: Prevent Long enum lists */
.field-list > dd p {
max-height: 245px;
overflow-y: auto !important;
word-break: break-word;
}
/* Hide home icon in search area */
.wy-side-nav-search > a:hover {background: none; opacity: 0.9}
.wy-side-nav-search > a.icon::before {content: none}

View File

@@ -450,7 +450,11 @@ if(WITH_COREAUDIO)
if(WITH_STRICT_DEPENDENCIES)
message(FATAL_ERROR "CoreAudio not found!")
else()
set(WITH_COREAUDIO FALSE CACHE BOOL "Build With CoreAudio" FORCE)
if(AUDASPACE_STANDALONE)
set(WITH_COREAUDIO FALSE CACHE BOOL "Build With CoreAudio" FORCE)
else()
set(WITH_COREAUDIO FALSE)
endif()
message(WARNING "CoreAudio not found, plugin will not be built.")
endif()
endif()
@@ -487,7 +491,11 @@ if(WITH_FFMPEG)
list(APPEND DLLS ${FFMPEG_DLLS})
endif()
else()
set(WITH_FFMPEG FALSE CACHE BOOL "Build With FFMPEG" FORCE)
if(AUDASPACE_STANDALONE)
set(WITH_FFMPEG FALSE CACHE BOOL "Build With FFMPEG" FORCE)
else()
set(WITH_FFMPEG FALSE)
endif()
message(WARNING "FFMPEG not found, plugin will not be built.")
endif()
endif()
@@ -536,7 +544,11 @@ if(WITH_FFTW)
list(APPEND DLLS ${FFTW_DLLS})
endif()
else()
set(WITH_FFTW FALSE CACHE BOOL "Build With FFTW" FORCE)
if(AUDASPACE_STANDALONE)
set(WITH_FFTW FALSE CACHE BOOL "Build With FFTW" FORCE)
else()
set(WITH_FFTW FALSE)
endif()
message(WARNING "FFTW not found, convolution functionality will not be built.")
endif()
endif()
@@ -579,7 +591,11 @@ if(WITH_JACK)
list(APPEND DLLS ${JACK_DLLS})
endif()
else()
set(WITH_JACK FALSE CACHE BOOL "Build With JACK" FORCE)
if(AUDASPACE_STANDALONE)
set(WITH_JACK FALSE CACHE BOOL "Build With JACK" FORCE)
else()
set(WITH_JACK FALSE)
endif()
message(WARNING "JACK not found, plugin will not be built.")
endif()
endif()
@@ -615,7 +631,11 @@ if(WITH_LIBSNDFILE)
list(APPEND DLLS ${LIBSNDFILE_DLLS})
endif()
else()
set(WITH_LIBSNDFILE FALSE CACHE BOOL "Build With LibSndFile" FORCE)
if(AUDASPACE_STANDALONE)
set(WITH_LIBSNDFILE FALSE CACHE BOOL "Build With LibSndFile" FORCE)
else()
set(WITH_LIBSNDFILE FALSE)
endif()
message(WARNING "LibSndFile not found, plugin will not be built.")
endif()
endif()
@@ -649,7 +669,11 @@ if(WITH_OPENAL)
list(APPEND DLLS ${OPENAL_DLLS})
endif()
else()
set(WITH_OPENAL FALSE CACHE BOOL "Build With OpenAL" FORCE)
if(AUDASPACE_STANDALONE)
set(WITH_OPENAL FALSE CACHE BOOL "Build With OpenAL" FORCE)
else()
set(WITH_OPENAL FALSE)
endif()
message(WARNING "OpenAL not found, plugin will not be built.")
endif()
endif()
@@ -685,7 +709,11 @@ if(WITH_PULSEAUDIO)
list(APPEND STATIC_PLUGINS PulseAudioDevice)
endif()
else()
set(WITH_PULSEAUDIO FALSE CACHE BOOL "Build With PulseAudio" FORCE)
if(AUDASPACE_STANDALONE)
set(WITH_PULSEAUDIO FALSE CACHE BOOL "Build With PulseAudio" FORCE)
else()
set(WITH_PULSEAUDIO FALSE)
endif()
message(WARNING "PulseAudio not found, plugin will not be built.")
endif()
endif()
@@ -716,8 +744,12 @@ if(WITH_PYTHON)
list(APPEND DLLS ${PYTHON_DLLS})
endif()
else()
set(WITH_PYTHON FALSE CACHE BOOL "Build With Python Library" FORCE)
message(WARNING "Python libraries not found, language binding will not be built.")
if(AUDASPACE_STANDALONE)
set(WITH_PYTHON FALSE CACHE BOOL "Build With Python Library" FORCE)
else()
set(WITH_PYTHON FALSE)
endif()
message(WARNING "Python & NumPy libraries not found, language binding will not be built.")
endif()
endif()
@@ -759,7 +791,11 @@ if(WITH_SDL)
list(APPEND DLLS ${SDL_DLLS})
endif()
else()
set(WITH_SDL FALSE CACHE BOOL "Build With SDL" FORCE)
if(AUDASPACE_STANDALONE)
set(WITH_SDL FALSE CACHE BOOL "Build With SDL" FORCE)
else()
set(WITH_SDL FALSE)
endif()
message(WARNING "SDL not found, plugin will not be built.")
endif()
endif()
@@ -1116,7 +1152,11 @@ if(WITH_DOCS)
add_custom_target(audaspace_doc ALL ${DOXYGEN_EXECUTABLE} Doxyfile COMMENT "Building C++ HTML documentation with Doxygen.")
else()
set(WITH_DOCS FALSE CACHE BOOL "Build C++ HTML Documentation with Doxygen" FORCE)
if(AUDASPACE_STANDALONE)
set(WITH_DOCS FALSE CACHE BOOL "Build C++ HTML Documentation with Doxygen" FORCE)
else()
set(WITH_DOCS FALSE)
endif()
message(WARNING "Doxygen (and/or dot) not found, documentation will not be built.")
endif()
endif()
@@ -1129,7 +1169,11 @@ if(WITH_BINDING_DOCS)
add_custom_target(bindings_doc ALL COMMAND ${PYTHON_EXECUTABLE} setup.py --build-docs ${SPHINX_EXECUTABLE} -q -b html -c "${CMAKE_CURRENT_BINARY_DIR}" -d "${CMAKE_CURRENT_BINARY_DIR}/_doctrees" "${CMAKE_CURRENT_SOURCE_DIR}/bindings/doc" "${CMAKE_CURRENT_BINARY_DIR}/doc/bindings" DEPENDS pythonmodule COMMENT "Building C/Python HTML documentation with Sphinx.")
else()
set(WITH_BINDING_DOCS FALSE CACHE BOOL "Build C/Python HTML Documentation with Sphinx" FORCE)
if(AUDASPACE_STANDALONE)
set(WITH_BINDING_DOCS FALSE CACHE BOOL "Build C/Python HTML Documentation with Sphinx" FORCE)
else()
set(WITH_BINDING_DOCS FALSE)
endif()
message(WARNING "Sphinx not found, binding documentation will not be built.")
endif()
endif()

View File

@@ -270,7 +270,7 @@ AUD_API int AUD_readSound(AUD_Sound* sound, float* buffer, int length, int sampl
return length;
}
AUD_API const char* AUD_mixdown(AUD_Sound* sound, unsigned int start, unsigned int length, unsigned int buffersize, const char* filename, AUD_DeviceSpecs specs, AUD_Container format, AUD_Codec codec, unsigned int bitrate, void(*callback)(float, void*), void* data)
AUD_API int AUD_mixdown(AUD_Sound* sound, unsigned int start, unsigned int length, unsigned int buffersize, const char* filename, AUD_DeviceSpecs specs, AUD_Container format, AUD_Codec codec, unsigned int bitrate, void(*callback)(float, void*), void* data, char* error, size_t errorsize)
{
try
{
@@ -282,15 +282,20 @@ AUD_API const char* AUD_mixdown(AUD_Sound* sound, unsigned int start, unsigned i
std::shared_ptr<IWriter> writer = FileWriter::createWriter(filename, convCToDSpec(specs), static_cast<Container>(format), static_cast<Codec>(codec), bitrate);
FileWriter::writeReader(reader, writer, length, buffersize, callback, data);
return nullptr;
return true;
}
catch(Exception& e)
{
return e.getMessage().c_str();
if(error && errorsize)
{
std::strncpy(error, e.getMessage().c_str(), errorsize);
error[errorsize - 1] = '\0';
}
return false;
}
}
AUD_API const char* AUD_mixdown_per_channel(AUD_Sound* sound, unsigned int start, unsigned int length, unsigned int buffersize, const char* filename, AUD_DeviceSpecs specs, AUD_Container format, AUD_Codec codec, unsigned int bitrate, void(*callback)(float, void*), void* data)
AUD_API int AUD_mixdown_per_channel(AUD_Sound* sound, unsigned int start, unsigned int length, unsigned int buffersize, const char* filename, AUD_DeviceSpecs specs, AUD_Container format, AUD_Codec codec, unsigned int bitrate, void(*callback)(float, void*), void* data, char* error, size_t errorsize)
{
try
{
@@ -328,11 +333,16 @@ AUD_API const char* AUD_mixdown_per_channel(AUD_Sound* sound, unsigned int start
reader->seek(start);
FileWriter::writeReader(reader, writers, length, buffersize, callback, data);
return nullptr;
return true;
}
catch(Exception& e)
{
return e.getMessage().c_str();
if(error && errorsize)
{
std::strncpy(error, e.getMessage().c_str(), errorsize);
error[errorsize - 1] = '\0';
}
return false;
}
}

View File

@@ -70,13 +70,15 @@ extern AUD_API int AUD_readSound(AUD_Sound* sound, float* buffer, int length, in
* \param bitrate The bitrate for encoding.
* \param callback A callback function that is called periodically during mixdown, reporting progress if length > 0. Can be NULL.
* \param data Pass through parameter that is passed to the callback.
* \return An error message or NULL in case of success.
* \param error String buffer to copy the error message to in case of failure.
* \param errorsize The size of the error buffer.
* \return Whether or not the operation succeeded.
*/
extern AUD_API const char* AUD_mixdown(AUD_Sound* sound, unsigned int start, unsigned int length,
extern AUD_API int AUD_mixdown(AUD_Sound* sound, unsigned int start, unsigned int length,
unsigned int buffersize, const char* filename,
AUD_DeviceSpecs specs, AUD_Container format,
AUD_Codec codec, unsigned int bitrate,
void(*callback)(float, void*), void* data);
void(*callback)(float, void*), void* data, char* error, size_t errorsize);
/**
* Mixes a sound down into multiple files.
@@ -91,13 +93,15 @@ extern AUD_API const char* AUD_mixdown(AUD_Sound* sound, unsigned int start, uns
* \param bitrate The bitrate for encoding.
* \param callback A callback function that is called periodically during mixdown, reporting progress if length > 0. Can be NULL.
* \param data Pass through parameter that is passed to the callback.
* \return An error message or NULL in case of success.
* \param error String buffer to copy the error message to in case of failure.
* \param errorsize The size of the error buffer.
* \return Whether or not the operation succeeded.
*/
extern AUD_API const char* AUD_mixdown_per_channel(AUD_Sound* sound, unsigned int start, unsigned int length,
extern AUD_API int AUD_mixdown_per_channel(AUD_Sound* sound, unsigned int start, unsigned int length,
unsigned int buffersize, const char* filename,
AUD_DeviceSpecs specs, AUD_Container format,
AUD_Codec codec, unsigned int bitrate,
void(*callback)(float, void*), void* data);
void(*callback)(float, void*), void* data, char* error, size_t errorsize);
/**
* Opens a read device and prepares it for mixdown of the sound scene.

View File

@@ -41,7 +41,7 @@ double PulseAudioDevice::PulseAudioSynchronizer::getPosition(std::shared_ptr<IHa
void PulseAudioDevice::updateRingBuffer()
{
unsigned int samplesize = AUD_SAMPLE_SIZE(m_specs);
unsigned int samplesize = AUD_DEVICE_SAMPLE_SIZE(m_specs);
std::unique_lock<std::mutex> lock(m_mixingLock);

View File

@@ -1,16 +1,11 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright 2012 Blender Foundation. All rights reserved.
# NOTE: This file is automatically generated by bundle.sh script
# If you're doing changes in this file, please update template
# in that script too
set(INC
.
include
internal
config
../gflags/src
)
set(INC_SYS
@@ -20,279 +15,296 @@ set(INC_SYS
)
set(SRC
internal/ceres/accelerate_sparse.cc
internal/ceres/array_utils.cc
internal/ceres/blas.cc
internal/ceres/block_evaluate_preparer.cc
internal/ceres/block_jacobian_writer.cc
internal/ceres/block_jacobi_preconditioner.cc
internal/ceres/block_random_access_dense_matrix.cc
internal/ceres/block_random_access_diagonal_matrix.cc
internal/ceres/block_random_access_matrix.cc
internal/ceres/block_random_access_sparse_matrix.cc
internal/ceres/block_sparse_matrix.cc
internal/ceres/block_structure.cc
internal/ceres/callbacks.cc
internal/ceres/canonical_views_clustering.cc
internal/ceres/c_api.cc
internal/ceres/cgnr_solver.cc
internal/ceres/compressed_col_sparse_matrix_utils.cc
internal/ceres/compressed_row_jacobian_writer.cc
internal/ceres/compressed_row_sparse_matrix.cc
internal/ceres/conditioned_cost_function.cc
internal/ceres/conjugate_gradients_solver.cc
internal/ceres/context.cc
internal/ceres/context_impl.cc
internal/ceres/coordinate_descent_minimizer.cc
internal/ceres/corrector.cc
internal/ceres/covariance.cc
internal/ceres/covariance_impl.cc
internal/ceres/cxsparse.cc
internal/ceres/dense_normal_cholesky_solver.cc
internal/ceres/dense_qr_solver.cc
internal/ceres/dense_sparse_matrix.cc
internal/ceres/detect_structure.cc
internal/ceres/dogleg_strategy.cc
internal/ceres/dynamic_compressed_row_jacobian_writer.cc
internal/ceres/dynamic_compressed_row_sparse_matrix.cc
internal/ceres/dynamic_sparse_normal_cholesky_solver.cc
internal/ceres/eigensparse.cc
internal/ceres/evaluator.cc
internal/ceres/file.cc
internal/ceres/float_cxsparse.cc
internal/ceres/float_suitesparse.cc
internal/ceres/function_sample.cc
internal/ceres/generated/partitioned_matrix_view_d_d_d.cc
internal/ceres/generated/schur_eliminator_d_d_d.cc
internal/ceres/gradient_checker.cc
internal/ceres/gradient_checking_cost_function.cc
internal/ceres/gradient_problem.cc
internal/ceres/gradient_problem_solver.cc
internal/ceres/implicit_schur_complement.cc
internal/ceres/inner_product_computer.cc
internal/ceres/is_close.cc
internal/ceres/iterative_refiner.cc
internal/ceres/iterative_schur_complement_solver.cc
internal/ceres/lapack.cc
internal/ceres/levenberg_marquardt_strategy.cc
internal/ceres/linear_least_squares_problems.cc
internal/ceres/linear_operator.cc
internal/ceres/linear_solver.cc
internal/ceres/line_search.cc
internal/ceres/line_search_direction.cc
internal/ceres/line_search_minimizer.cc
internal/ceres/line_search_preprocessor.cc
internal/ceres/local_parameterization.cc
internal/ceres/loss_function.cc
internal/ceres/low_rank_inverse_hessian.cc
internal/ceres/minimizer.cc
internal/ceres/normal_prior.cc
internal/ceres/parallel_for_cxx.cc
internal/ceres/parallel_for_nothreads.cc
internal/ceres/parallel_for_openmp.cc
internal/ceres/parallel_utils.cc
internal/ceres/parameter_block_ordering.cc
internal/ceres/partitioned_matrix_view.cc
internal/ceres/polynomial.cc
internal/ceres/preconditioner.cc
internal/ceres/preprocessor.cc
internal/ceres/problem.cc
internal/ceres/problem_impl.cc
internal/ceres/program.cc
internal/ceres/reorder_program.cc
internal/ceres/residual_block.cc
internal/ceres/residual_block_utils.cc
internal/ceres/schur_complement_solver.cc
internal/ceres/schur_eliminator.cc
internal/ceres/schur_jacobi_preconditioner.cc
internal/ceres/schur_templates.cc
internal/ceres/scratch_evaluate_preparer.cc
internal/ceres/single_linkage_clustering.cc
internal/ceres/solver.cc
internal/ceres/solver_utils.cc
internal/ceres/sparse_cholesky.cc
internal/ceres/sparse_matrix.cc
internal/ceres/sparse_normal_cholesky_solver.cc
internal/ceres/split.cc
internal/ceres/stringprintf.cc
internal/ceres/subset_preconditioner.cc
internal/ceres/suitesparse.cc
internal/ceres/thread_pool.cc
internal/ceres/thread_token_provider.cc
internal/ceres/triplet_sparse_matrix.cc
internal/ceres/trust_region_minimizer.cc
internal/ceres/trust_region_preprocessor.cc
internal/ceres/trust_region_step_evaluator.cc
internal/ceres/trust_region_strategy.cc
internal/ceres/types.cc
internal/ceres/visibility_based_preconditioner.cc
internal/ceres/visibility.cc
internal/ceres/wall_time.cc
include/ceres/autodiff_cost_function.h
include/ceres/autodiff_first_order_function.h
include/ceres/autodiff_local_parameterization.h
include/ceres/autodiff_manifold.h
include/ceres/c_api.h
include/ceres/ceres.h
include/ceres/conditioned_cost_function.h
include/ceres/context.h
include/ceres/cost_function.h
include/ceres/cost_function_to_functor.h
include/ceres/covariance.h
include/ceres/crs_matrix.h
include/ceres/cubic_interpolation.h
include/ceres/dynamic_autodiff_cost_function.h
include/ceres/dynamic_cost_function.h
include/ceres/dynamic_cost_function_to_functor.h
include/ceres/dynamic_numeric_diff_cost_function.h
include/ceres/evaluation_callback.h
include/ceres/first_order_function.h
include/ceres/gradient_checker.h
include/ceres/gradient_problem.h
include/ceres/gradient_problem_solver.h
include/ceres/iteration_callback.h
include/ceres/jet.h
include/ceres/jet_fwd.h
include/ceres/line_manifold.h
include/ceres/local_parameterization.h
include/ceres/loss_function.h
include/ceres/manifold.h
include/ceres/manifold_test_utils.h
include/ceres/normal_prior.h
include/ceres/numeric_diff_cost_function.h
include/ceres/numeric_diff_first_order_function.h
include/ceres/numeric_diff_options.h
include/ceres/ordered_groups.h
include/ceres/problem.h
include/ceres/product_manifold.h
include/ceres/rotation.h
include/ceres/sized_cost_function.h
include/ceres/solver.h
include/ceres/sphere_manifold.h
include/ceres/tiny_solver.h
include/ceres/tiny_solver_autodiff_function.h
include/ceres/tiny_solver_cost_function_adapter.h
include/ceres/types.h
include/ceres/version.h
include/ceres/autodiff_cost_function.h
include/ceres/autodiff_first_order_function.h
include/ceres/autodiff_local_parameterization.h
include/ceres/c_api.h
include/ceres/ceres.h
include/ceres/conditioned_cost_function.h
include/ceres/context.h
include/ceres/cost_function.h
include/ceres/cost_function_to_functor.h
include/ceres/covariance.h
include/ceres/crs_matrix.h
include/ceres/cubic_interpolation.h
include/ceres/dynamic_autodiff_cost_function.h
include/ceres/dynamic_cost_function.h
include/ceres/dynamic_cost_function_to_functor.h
include/ceres/dynamic_numeric_diff_cost_function.h
include/ceres/evaluation_callback.h
include/ceres/first_order_function.h
include/ceres/gradient_checker.h
include/ceres/gradient_problem.h
include/ceres/gradient_problem_solver.h
include/ceres/internal/array_selector.h
include/ceres/internal/autodiff.h
include/ceres/internal/disable_warnings.h
include/ceres/internal/eigen.h
include/ceres/internal/fixed_array.h
include/ceres/internal/householder_vector.h
include/ceres/internal/integer_sequence_algorithm.h
include/ceres/internal/line_parameterization.h
include/ceres/internal/memory.h
include/ceres/internal/numeric_diff.h
include/ceres/internal/parameter_dims.h
include/ceres/internal/port.h
include/ceres/internal/reenable_warnings.h
include/ceres/internal/variadic_evaluate.h
include/ceres/iteration_callback.h
include/ceres/jet.h
include/ceres/local_parameterization.h
include/ceres/loss_function.h
include/ceres/normal_prior.h
include/ceres/numeric_diff_cost_function.h
include/ceres/numeric_diff_options.h
include/ceres/ordered_groups.h
include/ceres/problem.h
include/ceres/rotation.h
include/ceres/sized_cost_function.h
include/ceres/solver.h
include/ceres/tiny_solver_autodiff_function.h
include/ceres/tiny_solver_cost_function_adapter.h
include/ceres/tiny_solver.h
include/ceres/types.h
include/ceres/version.h
internal/ceres/accelerate_sparse.h
internal/ceres/array_utils.h
internal/ceres/blas.h
internal/ceres/block_evaluate_preparer.h
internal/ceres/block_jacobian_writer.h
internal/ceres/block_jacobi_preconditioner.h
internal/ceres/block_random_access_dense_matrix.h
internal/ceres/block_random_access_diagonal_matrix.h
internal/ceres/block_random_access_matrix.h
internal/ceres/block_random_access_sparse_matrix.h
internal/ceres/block_sparse_matrix.h
internal/ceres/block_structure.h
internal/ceres/callbacks.h
internal/ceres/canonical_views_clustering.h
internal/ceres/casts.h
internal/ceres/cgnr_linear_operator.h
internal/ceres/cgnr_solver.h
internal/ceres/compressed_col_sparse_matrix_utils.h
internal/ceres/compressed_row_jacobian_writer.h
internal/ceres/compressed_row_sparse_matrix.h
internal/ceres/concurrent_queue.h
internal/ceres/conjugate_gradients_solver.h
internal/ceres/context_impl.h
internal/ceres/coordinate_descent_minimizer.h
internal/ceres/corrector.h
internal/ceres/covariance_impl.h
internal/ceres/cxsparse.h
internal/ceres/dense_jacobian_writer.h
internal/ceres/dense_normal_cholesky_solver.h
internal/ceres/dense_qr_solver.h
internal/ceres/dense_sparse_matrix.h
internal/ceres/detect_structure.h
internal/ceres/dogleg_strategy.h
internal/ceres/dynamic_compressed_row_finalizer.h
internal/ceres/dynamic_compressed_row_jacobian_writer.h
internal/ceres/dynamic_compressed_row_sparse_matrix.h
internal/ceres/dynamic_sparse_normal_cholesky_solver.h
internal/ceres/eigensparse.h
internal/ceres/evaluator.h
internal/ceres/execution_summary.h
internal/ceres/file.h
internal/ceres/float_cxsparse.h
internal/ceres/float_suitesparse.h
internal/ceres/function_sample.h
internal/ceres/gradient_checking_cost_function.h
internal/ceres/gradient_problem_evaluator.h
internal/ceres/graph_algorithms.h
internal/ceres/graph.h
internal/ceres/implicit_schur_complement.h
internal/ceres/inner_product_computer.h
internal/ceres/invert_psd_matrix.h
internal/ceres/is_close.h
internal/ceres/iterative_refiner.h
internal/ceres/iterative_schur_complement_solver.h
internal/ceres/lapack.h
internal/ceres/levenberg_marquardt_strategy.h
internal/ceres/linear_least_squares_problems.h
internal/ceres/linear_operator.h
internal/ceres/linear_solver.h
internal/ceres/line_search_direction.h
internal/ceres/line_search.h
internal/ceres/line_search_minimizer.h
internal/ceres/line_search_preprocessor.h
internal/ceres/low_rank_inverse_hessian.h
internal/ceres/map_util.h
internal/ceres/minimizer.h
internal/ceres/pair_hash.h
internal/ceres/parallel_for.h
internal/ceres/parallel_utils.h
internal/ceres/parameter_block.h
internal/ceres/parameter_block_ordering.h
internal/ceres/partitioned_matrix_view.h
internal/ceres/partitioned_matrix_view_impl.h
internal/ceres/polynomial.h
internal/ceres/preconditioner.h
internal/ceres/preprocessor.h
internal/ceres/problem_impl.h
internal/ceres/program_evaluator.h
internal/ceres/program.h
internal/ceres/random.h
internal/ceres/reorder_program.h
internal/ceres/residual_block.h
internal/ceres/residual_block_utils.h
internal/ceres/schur_complement_solver.h
internal/ceres/schur_eliminator.h
internal/ceres/schur_eliminator_impl.h
internal/ceres/schur_jacobi_preconditioner.h
internal/ceres/schur_templates.h
internal/ceres/scoped_thread_token.h
internal/ceres/scratch_evaluate_preparer.h
internal/ceres/single_linkage_clustering.h
internal/ceres/small_blas_generic.h
internal/ceres/small_blas.h
internal/ceres/solver_utils.h
internal/ceres/sparse_cholesky.h
internal/ceres/sparse_matrix.h
internal/ceres/sparse_normal_cholesky_solver.h
internal/ceres/split.h
internal/ceres/stl_util.h
internal/ceres/stringprintf.h
internal/ceres/subset_preconditioner.h
internal/ceres/suitesparse.h
internal/ceres/thread_pool.h
internal/ceres/thread_token_provider.h
internal/ceres/triplet_sparse_matrix.h
internal/ceres/trust_region_minimizer.h
internal/ceres/trust_region_preprocessor.h
internal/ceres/trust_region_step_evaluator.h
internal/ceres/trust_region_strategy.h
internal/ceres/visibility_based_preconditioner.h
internal/ceres/visibility.h
internal/ceres/wall_time.h
include/ceres/internal/array_selector.h
include/ceres/internal/autodiff.h
include/ceres/internal/disable_warnings.h
include/ceres/internal/eigen.h
include/ceres/internal/fixed_array.h
include/ceres/internal/householder_vector.h
include/ceres/internal/integer_sequence_algorithm.h
include/ceres/internal/jet_traits.h
include/ceres/internal/line_parameterization.h
include/ceres/internal/memory.h
include/ceres/internal/numeric_diff.h
include/ceres/internal/parameter_dims.h
include/ceres/internal/port.h
include/ceres/internal/reenable_warnings.h
include/ceres/internal/sphere_manifold_functions.h
include/ceres/internal/variadic_evaluate.h
internal/ceres/accelerate_sparse.cc
internal/ceres/accelerate_sparse.h
internal/ceres/array_utils.cc
internal/ceres/array_utils.h
internal/ceres/block_evaluate_preparer.cc
internal/ceres/block_evaluate_preparer.h
internal/ceres/block_jacobi_preconditioner.cc
internal/ceres/block_jacobi_preconditioner.h
internal/ceres/block_jacobian_writer.cc
internal/ceres/block_jacobian_writer.h
internal/ceres/block_random_access_dense_matrix.cc
internal/ceres/block_random_access_dense_matrix.h
internal/ceres/block_random_access_diagonal_matrix.cc
internal/ceres/block_random_access_diagonal_matrix.h
internal/ceres/block_random_access_matrix.cc
internal/ceres/block_random_access_matrix.h
internal/ceres/block_random_access_sparse_matrix.cc
internal/ceres/block_random_access_sparse_matrix.h
internal/ceres/block_sparse_matrix.cc
internal/ceres/block_sparse_matrix.h
internal/ceres/block_structure.cc
internal/ceres/block_structure.h
internal/ceres/c_api.cc
internal/ceres/callbacks.cc
internal/ceres/callbacks.h
internal/ceres/canonical_views_clustering.cc
internal/ceres/canonical_views_clustering.h
internal/ceres/casts.h
internal/ceres/cgnr_linear_operator.h
internal/ceres/cgnr_solver.cc
internal/ceres/cgnr_solver.h
internal/ceres/compressed_col_sparse_matrix_utils.cc
internal/ceres/compressed_col_sparse_matrix_utils.h
internal/ceres/compressed_row_jacobian_writer.cc
internal/ceres/compressed_row_jacobian_writer.h
internal/ceres/compressed_row_sparse_matrix.cc
internal/ceres/compressed_row_sparse_matrix.h
internal/ceres/concurrent_queue.h
internal/ceres/conditioned_cost_function.cc
internal/ceres/conjugate_gradients_solver.cc
internal/ceres/conjugate_gradients_solver.h
internal/ceres/context.cc
internal/ceres/context_impl.cc
internal/ceres/context_impl.h
internal/ceres/coordinate_descent_minimizer.cc
internal/ceres/coordinate_descent_minimizer.h
internal/ceres/corrector.cc
internal/ceres/corrector.h
internal/ceres/cost_function.cc
internal/ceres/covariance.cc
internal/ceres/covariance_impl.cc
internal/ceres/covariance_impl.h
internal/ceres/cuda_buffer.h
internal/ceres/cxsparse.cc
internal/ceres/cxsparse.h
internal/ceres/dense_cholesky.cc
internal/ceres/dense_cholesky.h
internal/ceres/dense_jacobian_writer.h
internal/ceres/dense_normal_cholesky_solver.cc
internal/ceres/dense_normal_cholesky_solver.h
internal/ceres/dense_qr.cc
internal/ceres/dense_qr.h
internal/ceres/dense_qr_solver.cc
internal/ceres/dense_qr_solver.h
internal/ceres/dense_sparse_matrix.cc
internal/ceres/dense_sparse_matrix.h
internal/ceres/detect_structure.cc
internal/ceres/detect_structure.h
internal/ceres/dogleg_strategy.cc
internal/ceres/dogleg_strategy.h
internal/ceres/dynamic_compressed_row_finalizer.h
internal/ceres/dynamic_compressed_row_jacobian_writer.cc
internal/ceres/dynamic_compressed_row_jacobian_writer.h
internal/ceres/dynamic_compressed_row_sparse_matrix.cc
internal/ceres/dynamic_compressed_row_sparse_matrix.h
internal/ceres/dynamic_sparse_normal_cholesky_solver.cc
internal/ceres/dynamic_sparse_normal_cholesky_solver.h
internal/ceres/eigensparse.cc
internal/ceres/eigensparse.h
internal/ceres/evaluation_callback.cc
internal/ceres/evaluator.cc
internal/ceres/evaluator.h
internal/ceres/execution_summary.h
internal/ceres/file.cc
internal/ceres/file.h
internal/ceres/first_order_function.cc
internal/ceres/float_cxsparse.cc
internal/ceres/float_cxsparse.h
internal/ceres/float_suitesparse.cc
internal/ceres/float_suitesparse.h
internal/ceres/function_sample.cc
internal/ceres/function_sample.h
internal/ceres/gradient_checker.cc
internal/ceres/gradient_checking_cost_function.cc
internal/ceres/gradient_checking_cost_function.h
internal/ceres/gradient_problem.cc
internal/ceres/gradient_problem_evaluator.h
internal/ceres/gradient_problem_solver.cc
internal/ceres/graph.h
internal/ceres/graph_algorithms.h
internal/ceres/implicit_schur_complement.cc
internal/ceres/implicit_schur_complement.h
internal/ceres/inner_product_computer.cc
internal/ceres/inner_product_computer.h
internal/ceres/invert_psd_matrix.h
internal/ceres/is_close.cc
internal/ceres/is_close.h
internal/ceres/iteration_callback.cc
internal/ceres/iterative_refiner.cc
internal/ceres/iterative_refiner.h
internal/ceres/iterative_schur_complement_solver.cc
internal/ceres/iterative_schur_complement_solver.h
internal/ceres/levenberg_marquardt_strategy.cc
internal/ceres/levenberg_marquardt_strategy.h
internal/ceres/line_search.cc
internal/ceres/line_search.h
internal/ceres/line_search_direction.cc
internal/ceres/line_search_direction.h
internal/ceres/line_search_minimizer.cc
internal/ceres/line_search_minimizer.h
internal/ceres/line_search_preprocessor.cc
internal/ceres/line_search_preprocessor.h
internal/ceres/linear_least_squares_problems.cc
internal/ceres/linear_least_squares_problems.h
internal/ceres/linear_operator.cc
internal/ceres/linear_operator.h
internal/ceres/linear_solver.cc
internal/ceres/linear_solver.h
internal/ceres/local_parameterization.cc
internal/ceres/loss_function.cc
internal/ceres/low_rank_inverse_hessian.cc
internal/ceres/low_rank_inverse_hessian.h
internal/ceres/manifold.cc
internal/ceres/manifold_adapter.h
internal/ceres/map_util.h
internal/ceres/minimizer.cc
internal/ceres/minimizer.h
internal/ceres/normal_prior.cc
internal/ceres/pair_hash.h
internal/ceres/parallel_for.h
internal/ceres/parallel_for_cxx.cc
internal/ceres/parallel_for_nothreads.cc
internal/ceres/parallel_for_openmp.cc
internal/ceres/parallel_utils.cc
internal/ceres/parallel_utils.h
internal/ceres/parameter_block.h
internal/ceres/parameter_block_ordering.cc
internal/ceres/parameter_block_ordering.h
internal/ceres/partitioned_matrix_view.cc
internal/ceres/partitioned_matrix_view.h
internal/ceres/partitioned_matrix_view_impl.h
internal/ceres/polynomial.cc
internal/ceres/polynomial.h
internal/ceres/preconditioner.cc
internal/ceres/preconditioner.h
internal/ceres/preprocessor.cc
internal/ceres/preprocessor.h
internal/ceres/problem.cc
internal/ceres/problem_impl.cc
internal/ceres/problem_impl.h
internal/ceres/program.cc
internal/ceres/program.h
internal/ceres/program_evaluator.h
internal/ceres/random.h
internal/ceres/reorder_program.cc
internal/ceres/reorder_program.h
internal/ceres/residual_block.cc
internal/ceres/residual_block.h
internal/ceres/residual_block_utils.cc
internal/ceres/residual_block_utils.h
internal/ceres/schur_complement_solver.cc
internal/ceres/schur_complement_solver.h
internal/ceres/schur_eliminator.cc
internal/ceres/schur_eliminator.h
internal/ceres/schur_eliminator_impl.h
internal/ceres/schur_jacobi_preconditioner.cc
internal/ceres/schur_jacobi_preconditioner.h
internal/ceres/schur_templates.cc
internal/ceres/schur_templates.h
internal/ceres/scoped_thread_token.h
internal/ceres/scratch_evaluate_preparer.cc
internal/ceres/scratch_evaluate_preparer.h
internal/ceres/single_linkage_clustering.cc
internal/ceres/single_linkage_clustering.h
internal/ceres/small_blas.h
internal/ceres/small_blas_generic.h
internal/ceres/solver.cc
internal/ceres/solver_utils.cc
internal/ceres/solver_utils.h
internal/ceres/sparse_cholesky.cc
internal/ceres/sparse_cholesky.h
internal/ceres/sparse_matrix.cc
internal/ceres/sparse_matrix.h
internal/ceres/sparse_normal_cholesky_solver.cc
internal/ceres/sparse_normal_cholesky_solver.h
internal/ceres/stl_util.h
internal/ceres/stringprintf.cc
internal/ceres/stringprintf.h
internal/ceres/subset_preconditioner.cc
internal/ceres/subset_preconditioner.h
internal/ceres/suitesparse.cc
internal/ceres/suitesparse.h
internal/ceres/thread_pool.cc
internal/ceres/thread_pool.h
internal/ceres/thread_token_provider.cc
internal/ceres/thread_token_provider.h
internal/ceres/triplet_sparse_matrix.cc
internal/ceres/triplet_sparse_matrix.h
internal/ceres/trust_region_minimizer.cc
internal/ceres/trust_region_minimizer.h
internal/ceres/trust_region_preprocessor.cc
internal/ceres/trust_region_preprocessor.h
internal/ceres/trust_region_step_evaluator.cc
internal/ceres/trust_region_step_evaluator.h
internal/ceres/trust_region_strategy.cc
internal/ceres/trust_region_strategy.h
internal/ceres/types.cc
internal/ceres/visibility.cc
internal/ceres/visibility.h
internal/ceres/visibility_based_preconditioner.cc
internal/ceres/visibility_based_preconditioner.h
internal/ceres/wall_time.cc
internal/ceres/wall_time.h
internal/ceres/generated/partitioned_matrix_view_d_d_d.cc
internal/ceres/generated/schur_eliminator_d_d_d.cc
)
set(LIB
@@ -302,48 +314,48 @@ set(LIB
if(WITH_LIBMV_SCHUR_SPECIALIZATIONS)
list(APPEND SRC
internal/ceres/generated/partitioned_matrix_view_2_2_2.cc
internal/ceres/generated/partitioned_matrix_view_2_2_3.cc
internal/ceres/generated/partitioned_matrix_view_2_2_4.cc
internal/ceres/generated/partitioned_matrix_view_2_2_d.cc
internal/ceres/generated/partitioned_matrix_view_2_3_3.cc
internal/ceres/generated/partitioned_matrix_view_2_3_4.cc
internal/ceres/generated/partitioned_matrix_view_2_3_6.cc
internal/ceres/generated/partitioned_matrix_view_2_3_9.cc
internal/ceres/generated/partitioned_matrix_view_2_3_d.cc
internal/ceres/generated/partitioned_matrix_view_2_4_3.cc
internal/ceres/generated/partitioned_matrix_view_2_4_4.cc
internal/ceres/generated/partitioned_matrix_view_2_4_6.cc
internal/ceres/generated/partitioned_matrix_view_2_4_8.cc
internal/ceres/generated/partitioned_matrix_view_2_4_9.cc
internal/ceres/generated/partitioned_matrix_view_2_4_d.cc
internal/ceres/generated/partitioned_matrix_view_2_d_d.cc
internal/ceres/generated/partitioned_matrix_view_3_3_3.cc
internal/ceres/generated/partitioned_matrix_view_4_4_2.cc
internal/ceres/generated/partitioned_matrix_view_4_4_3.cc
internal/ceres/generated/partitioned_matrix_view_4_4_4.cc
internal/ceres/generated/partitioned_matrix_view_4_4_d.cc
internal/ceres/generated/schur_eliminator_2_2_2.cc
internal/ceres/generated/schur_eliminator_2_2_3.cc
internal/ceres/generated/schur_eliminator_2_2_4.cc
internal/ceres/generated/schur_eliminator_2_2_d.cc
internal/ceres/generated/schur_eliminator_2_3_3.cc
internal/ceres/generated/schur_eliminator_2_3_4.cc
internal/ceres/generated/schur_eliminator_2_3_6.cc
internal/ceres/generated/schur_eliminator_2_3_9.cc
internal/ceres/generated/schur_eliminator_2_3_d.cc
internal/ceres/generated/schur_eliminator_2_4_3.cc
internal/ceres/generated/schur_eliminator_2_4_4.cc
internal/ceres/generated/schur_eliminator_2_4_6.cc
internal/ceres/generated/schur_eliminator_2_4_8.cc
internal/ceres/generated/schur_eliminator_2_4_9.cc
internal/ceres/generated/schur_eliminator_2_4_d.cc
internal/ceres/generated/schur_eliminator_2_d_d.cc
internal/ceres/generated/schur_eliminator_3_3_3.cc
internal/ceres/generated/schur_eliminator_4_4_2.cc
internal/ceres/generated/schur_eliminator_4_4_3.cc
internal/ceres/generated/schur_eliminator_4_4_4.cc
internal/ceres/generated/schur_eliminator_4_4_d.cc
internal/ceres/generated/partitioned_matrix_view_2_2_2.cc
internal/ceres/generated/partitioned_matrix_view_2_2_3.cc
internal/ceres/generated/partitioned_matrix_view_2_2_4.cc
internal/ceres/generated/partitioned_matrix_view_2_2_d.cc
internal/ceres/generated/partitioned_matrix_view_2_3_3.cc
internal/ceres/generated/partitioned_matrix_view_2_3_4.cc
internal/ceres/generated/partitioned_matrix_view_2_3_6.cc
internal/ceres/generated/partitioned_matrix_view_2_3_9.cc
internal/ceres/generated/partitioned_matrix_view_2_3_d.cc
internal/ceres/generated/partitioned_matrix_view_2_4_3.cc
internal/ceres/generated/partitioned_matrix_view_2_4_4.cc
internal/ceres/generated/partitioned_matrix_view_2_4_6.cc
internal/ceres/generated/partitioned_matrix_view_2_4_8.cc
internal/ceres/generated/partitioned_matrix_view_2_4_9.cc
internal/ceres/generated/partitioned_matrix_view_2_4_d.cc
internal/ceres/generated/partitioned_matrix_view_2_d_d.cc
internal/ceres/generated/partitioned_matrix_view_3_3_3.cc
internal/ceres/generated/partitioned_matrix_view_4_4_2.cc
internal/ceres/generated/partitioned_matrix_view_4_4_3.cc
internal/ceres/generated/partitioned_matrix_view_4_4_4.cc
internal/ceres/generated/partitioned_matrix_view_4_4_d.cc
internal/ceres/generated/schur_eliminator_2_2_2.cc
internal/ceres/generated/schur_eliminator_2_2_3.cc
internal/ceres/generated/schur_eliminator_2_2_4.cc
internal/ceres/generated/schur_eliminator_2_2_d.cc
internal/ceres/generated/schur_eliminator_2_3_3.cc
internal/ceres/generated/schur_eliminator_2_3_4.cc
internal/ceres/generated/schur_eliminator_2_3_6.cc
internal/ceres/generated/schur_eliminator_2_3_9.cc
internal/ceres/generated/schur_eliminator_2_3_d.cc
internal/ceres/generated/schur_eliminator_2_4_3.cc
internal/ceres/generated/schur_eliminator_2_4_4.cc
internal/ceres/generated/schur_eliminator_2_4_6.cc
internal/ceres/generated/schur_eliminator_2_4_8.cc
internal/ceres/generated/schur_eliminator_2_4_9.cc
internal/ceres/generated/schur_eliminator_2_4_d.cc
internal/ceres/generated/schur_eliminator_2_d_d.cc
internal/ceres/generated/schur_eliminator_3_3_3.cc
internal/ceres/generated/schur_eliminator_4_4_2.cc
internal/ceres/generated/schur_eliminator_4_4_3.cc
internal/ceres/generated/schur_eliminator_4_4_4.cc
internal/ceres/generated/schur_eliminator_4_4_d.cc
)
else()
add_definitions(-DCERES_RESTRICT_SCHUR_SPECIALIZATION)
@@ -351,16 +363,5 @@ endif()
add_definitions(${GFLAGS_DEFINES})
add_definitions(${GLOG_DEFINES})
add_definitions(${CERES_DEFINES})
add_definitions(
-DCERES_HAVE_PTHREAD
-DCERES_NO_SUITESPARSE
-DCERES_NO_CXSPARSE
-DCERES_NO_LAPACK
-DCERES_NO_ACCELERATE_SPARSE
-DCERES_HAVE_RWLOCK
-DCERES_USE_CXX_THREADS
)
blender_add_lib(extern_ceres "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")

596
extern/ceres/ChangeLog vendored
View File

@@ -1,596 +0,0 @@
commit 399cda773035d99eaf1f4a129a666b3c4df9d1b1
Author: Alex Stewart <alexs.mac@gmail.com>
Date: Fri Oct 23 19:36:08 2020 +0100
Update build documentation to reflect detection of Eigen via config mode
Change-Id: I18d5f0fc1eb51ea630164c911d935e9bffea35ce
commit bb127272f9b57672bca48424f2d83bc430a46eb8
Author: Sameer Agarwal <sameeragarwal@google.com>
Date: Mon Oct 19 09:28:34 2020 -0700
Fix typos.
Contributed by Ishamis@, IanBoyanZhang@, gkrobner@ & mithunjacob@.
Change-Id: Iab3c19a07a6f3db2486e3557dcb55bfe5de2aee5
commit a0ec5c32af5c5f5a52168dc2748be910dba14810
Author: Sameer Agarwal <sameeragarwal@google.com>
Date: Sun Oct 18 15:20:36 2020 -0700
Update version history for 2.0.0RC2
Change-Id: I75b7515fbf9880bd8eaea6ecd5e72ce1ae4a3a86
commit 3f6d2736769044e7c08c873c41a184849eea73ab
Author: Taylor Braun-Jones <taylor@braun-jones.org>
Date: Tue Jan 28 12:09:30 2020 -0500
Unify symbol visibility configuration for all compilers
This makes it possible to build unit tests with shared libraries on MSVC.
Change-Id: I1db66a80b2c78c4f3d354e35235244d17bac9809
commit 29c2912ee635c77f3ddf2e382a5d6a9cf9805a3d
Author: Sameer Agarwal <sameeragarwal@google.com>
Date: Tue Oct 13 12:07:06 2020 -0700
Unbreak the bazel build some more
Change-Id: I6bbf3df977a473b9b5e16a9e59da5f535f8cdc24
commit bf47e1a36829f62697b930241d0a353932f34090
Author: Sameer Agarwal <sameeragarwal@google.com>
Date: Tue Oct 13 10:00:22 2020 -0700
Fix the Bazel build.
1. Fix the path to eigen, now that it uses gitlab instead of bitbucket.
2. Remove an unrecognized compiler option.
3. Remove an obsolete benchmark.
This CL only unbreaks the build, it is likely that it is still not
at par with the cmake build.
https://github.com/ceres-solver/ceres-solver/issues/628
Change-Id: I470209cbb48b6a4f499564a86b52436e0c8d98ef
commit 600e8c529ebbb4bb89d5baefa3d5ab6ad923706a
Author: Nikolaus Demmel <nikolaus@nikolaus-demmel.de>
Date: Mon Oct 12 23:00:39 2020 +0200
fix minor typos
all timing values in the summary are initialized to -1, so the one
+1 is likely an oversight.
Change-Id: Ie355f3b7da08a56d49d19ca9a5bc48fe5581dee3
commit bdcdcc78af61a0cb85317ebee52dc804bf4ea975
Author: Nikolaus Demmel <nikolaus@nikolaus-demmel.de>
Date: Mon Sep 7 01:48:50 2020 +0200
update docs for changed cmake usage
- update links to cmake docs to version 3.5
- highlight difference between dependencies with and without custom
find modules
- point out removal of CERES_INCLUDE_DIRS
- point out that TBB might be linked if SuiteSparseQR is found
- added 'Migration' section
- fixed typos
Change-Id: Icbcc0e723d11f12246fb3cf09b9d7c6206195a82
commit 3f69e5b36a49b44344e96a26b39693a914ba80c6
Author: Sameer Agarwal <sameeragarwal@google.com>
Date: Mon Oct 12 11:46:40 2020 -0700
Corrections from William Rucklidge
Change-Id: I0b5d4808be48f68df7829c70ec93ffa67d81315d
commit 8bfdb02fb18551bbd5f222c5472e45eddecd42b9
Author: Sameer Agarwal <sameeragarwal@google.com>
Date: Mon Oct 12 10:07:13 2020 -0700
Rewrite uses of VLOG_IF and LOG_IF.
VLOG_IF's evaluation order is ambiguous - does it mean
`if (cond) VLOG(lvl)` or `if (VLOG_IS_ON(lvl) && cond) LOG(INFO)`?
In particular, the way it works now is inconsistent with the way the
rest of the LOG macros evaluate their arguments.
Fixing this would be hard, and the macro's behavior would still surprise
some people. Replacing it with an if statement is simple, clear, and unambiguous.
Change-Id: I97a92d17a932c0a5344a1bf98d676308793ba877
commit d1b35ffc161fd857c7c433574ca82aa9b2db7f98
Author: Sameer Agarwal <sameeragarwal@google.com>
Date: Mon Oct 12 10:58:05 2020 -0700
Corrections from William Rucklidge
Change-Id: Ifb50e87aa915d00f9861fe1a6da0acee11bc0a94
commit f34e80e91f600014a3030915cf9ea28bcbc576e7
Author: Sameer Agarwal <sameeragarwal@google.com>
Date: Thu Oct 8 12:34:53 2020 -0700
Add dividers between licenses.
Change-Id: I4e4aaa15e0621c5648550cfa622fe0a79f1f4f9f
commit 65c397daeca77da53d16e73720b9a17edd6757ab
Author: Sameer Agarwal <sameeragarwal@google.com>
Date: Wed Oct 7 14:34:52 2020 -0700
Fix formatting
Change-Id: Ib4ca8a097059dbb8d2f3a6a888222c0188cb126e
commit f63b1fea9cfa48ae4530c327b10efa4985e69631
Author: Sameer Agarwal <sameeragarwal@google.com>
Date: Wed Oct 7 14:30:54 2020 -0700
Add the MIT license text corresponding to the libmv derived files.
Change-Id: Ie72fb45ae96a7892c00411eee6873db7f0e365a8
commit 542613c13d8b7469822aff5eec076f2cad4507ec
Author: Nikolaus Demmel <nikolaus@nikolaus-demmel.de>
Date: Tue Oct 6 22:48:59 2020 +0200
minor formatting fix for trust_region_minimizer.cc
Change-Id: I18ba27825fc23dd0e9e3e15dc13fc0833db01b5b
commit 6d9e9843d8c61cfb04cc55b9def9518f823a592a
Author: Sameer Agarwal <sameeragarwal@google.com>
Date: Mon Sep 28 11:35:37 2020 -0700
Remove inclusion of ceres/eigen.h
The initial reason for this is because of a previous reformatting CL
triggered a macro redefinition warning in the schur eliminator. But
actually it was worse because the reordering had caused the macro
definition to be ignored and caused a performance regression.
This simplifies the generated files, fixes some formatting errors
and recovers the performance.
Change-Id: I9dbeffc38743b3f24b25843feec2e26a73188413
commit eafeca5dcb7af8688d40a9c14b0d2fcb856c96fc
Author: Sameer Agarwal <sameeragarwal@google.com>
Date: Mon Sep 28 11:12:59 2020 -0700
Fix a logging bug in TrustRegionMinimizer.
Upon encountering an unsuccessful step (one where the cost goes up)
the the trust region minimizer failed to populate the gradient norm
in the IterationSummary. This would cause the gradient norm to be
logged as zero which is incorrect. Instead it should be the gradient
norm at the current point.
This CL fixes this issue.
Before:
iter cost cost_change |gradient| |step| tr_ratio tr_radius ls_iter iter_time total_time
0 1.115206e+07 0.00e+00 1.90e+07 0.00e+00 0.00e+00 1.00e+04 0 2.72e-01 1.33e+00
1 3.687552e+06 7.46e+06 1.84e+08 2.86e+03 6.91e-01 1.06e+04 1 1.32e+00 2.65e+00
2 3.670266e+10 -3.67e+10 0.00e+00 3.27e+03 -1.07e+04 5.30e+03 1 7.52e-01 3.40e+00
3 4.335397e+07 -3.97e+07 0.00e+00 2.74e+03 -1.16e+01 1.32e+03 1 7.28e-01 4.13e+00
4 1.345488e+06 2.34e+06 4.12e+07 1.55e+03 6.87e-01 1.40e+03 1 9.31e-01 5.06e+00
5 5.376653e+05 8.08e+05 9.99e+06 6.64e+02 7.46e-01 1.59e+03 1 9.64e-01 6.03e+00
After:
iter cost cost_change |gradient| |step| tr_ratio tr_radius ls_iter iter_time total_time
0 1.115206e+07 0.00e+00 1.90e+07 0.00e+00 0.00e+00 1.00e+04 0 2.37e-01 1.13e+00
1 3.687552e+06 7.46e+06 1.84e+08 2.86e+03 6.91e-01 1.06e+04 1 1.08e+00 2.21e+00
2 3.670266e+10 -3.67e+10 1.84e+08 3.27e+03 -1.07e+04 5.30e+03 1 7.50e-01 2.96e+00
3 4.335397e+07 -3.97e+07 1.84e+08 2.74e+03 -1.16e+01 1.32e+03 1 7.13e-01 3.67e+00
4 1.345488e+06 2.34e+06 4.12e+07 1.55e+03 6.87e-01 1.40e+03 1 9.01e-01 4.57e+00
5 5.376653e+05 8.08e+05 9.99e+06 6.64e+02 7.46e-01 1.59e+03 1 9.36e-01 5.51e+00
Change-Id: Iae538fe089be07c7bb219337a6f1392f7213acfe
commit 1fd0be916dd4ff4241bd52264b9e9170bc7e4339
Author: Alex Stewart <alexs.mac@gmail.com>
Date: Mon Sep 28 18:54:33 2020 +0100
Fix default initialisation of IterationCallback::cost
Change-Id: I9f529093fc09424c90dbff8e9648b90b16990623
commit 137bbe845577929a87f8eef979196df6a8b30ee4
Author: Nikolaus Demmel <nikolaus@nikolaus-demmel.de>
Date: Mon Sep 28 02:17:32 2020 +0200
add info about clang-format to contributing docs
Change-Id: I2f4dcbda2e4f36096df217d76de370103ffaa43e
commit d3f66d77f45482b90d01af47938289c32dd2cc08
Author: Nikolaus Demmel <nikolaus@nikolaus-demmel.de>
Date: Mon Sep 28 02:01:43 2020 +0200
fix formatting generated files (best effort)
- update file generator scripts / templates so generated files adhere
to clang-format
- A few exceptions are not fixed, where the file generation results in
lines of different width. To properly fix this would make the code
more complicated and it's not that important for generated files
anyway.
- note that generated files are excluded in ./scripts/format_all.sh
Change-Id: I4f42c83d1fec01242eada5e7ce6c1a5192234d37
commit a9c7361c8dc1d37e78d216754a4c03e8a8f1e74f
Author: Nikolaus Demmel <nikolaus@nikolaus-demmel.de>
Date: Mon Sep 28 02:14:29 2020 +0200
minor formatting fix (wrongly updated in earlier commit)
Change-Id: I544635fd936cb5b7f7bd9255876641cd5a9590c6
commit 7b8f675bfdb1d924af6a2dcc1f79bda5ace7e886
Author: Nikolaus Demmel <nikolaus@nikolaus-demmel.de>
Date: Sun Sep 20 21:45:24 2020 +0200
fix formatting for (non-generated) internal source files
- Change formatting standard to Cpp11. Main difference is not having
the space between two closing >> for nested templates. We don't
choose c++14, because older versions of clang-format (version 9
and earlier) don't know this value yet, and it doesn't make a
difference in the formatting.
- Apply clang-format to all (non generated) internal source files.
- Manually fix some code sections (clang-format on/off) and c-strings
- Exclude some embedded external files with very different formatting
(gtest/gmock)
- Add script to format all source files
Change-Id: Ic6cea41575ad6e37c9e136dbce176b0d505dc44d
commit 921368ce31c42ee793cf131860abba291a7e39ad
Author: Sameer Agarwal <sameeragarwal@google.com>
Date: Wed Sep 9 09:15:37 2020 -0700
Fix a number of typos in covariance.h
Also some minor cleanups in covariance_impl.h
Thanks to Lorenzo Lamia for pointing these out.
Change-Id: Icb4012a367fdd1f249bc1e7019e0114c868e45b6
commit 7b6b2491cc1be0b3abb67338366d8d69bef3a402
Author: Nikolaus Demmel <nikolaus@nikolaus-demmel.de>
Date: Tue Sep 8 17:51:32 2020 +0200
fix formatting for examples
This is mostly just applying the existing clang format config, except:
- Use NOLINT on overlong comment lines.
- Wrap some sections in 'clang-format off' / 'clang format on'.
- Manually split or join some multi-line strings.
Change-Id: Ia1a40eeb92112e12c3a169309afe087af55b2f4f
commit 82275d8a4eac4fc0bd07e17c3a41a6e429e72bfb
Author: Nikolaus Demmel <nikolaus@nikolaus-demmel.de>
Date: Tue Sep 8 02:00:21 2020 +0200
some fixes for Linux and macOS install docs
Linux:
- Remove workaround for Ubuntu 14.04, which is EOL. libsuitesparse-dev
seems to come with a shared library on 16.04 and later, so linking
to a shared build of ceres doesn't seem to be an issue any more.
- Add missing libgflags-dev.
macOS:
- OS X is now called macOS.
- Update homebrew link.
- Mac homebrew the preferred method of installation.
- Fix OpenMP instructions.
- Remove reference to homebrew/science. Everything is in core.
- Add missing gflags.
Change-Id: I633b3c7ea84a87886bfd823f8187fdd0a84737c9
commit 9d762d74f06b946bbd2f098de7216032d0e7b51d
Author: Nikolaus Demmel <nikolaus@nikolaus-demmel.de>
Date: Sun Sep 6 21:04:24 2020 +0200
fix formatting for public header files
- ensure all public headers files adhere to clang-format
- preserve one-per-line for enums by adding trailing comma
- preserve include order for en/disable_warning.h
Change-Id: I78dbd0527a294ab2ec5f074fb426e48b20c393e6
commit c76478c4898f3af11a6a826ac89c261205f4dd96
Author: Nikolaus Demmel <nikolaus@nikolaus-demmel.de>
Date: Sun Sep 6 23:29:56 2020 +0200
gitignore *.pyc
Change-Id: Ic6238a617a3c7ce92df7dcefcc44bae20c32b30b
commit 4e69a475cd7d7cbed983f5aebf79ae13a46e5415
Author: Alex Stewart <alexs.mac@gmail.com>
Date: Tue Sep 1 10:15:23 2020 +0100
Fix potential for mismatched release/debug TBB libraries
- Protect against the case when the user has multiple installs of TBB
in their search paths and the first install does not contain debug
libraries. In this case it is possible to get mismatched versions
of TBB inserted into TBB_LIBRARIES.
- Also suppresses warning about use of TBB_ROOT on modern versions of
CMake due to CMP0074.
Change-Id: I2eaafdde4a028cbf6c500c63771973d85bc4723d
commit 8e1d8e32ad0d28c0d4d1d7b2b1ce7fc01d90b7b0
Author: Sameer Agarwal <sameeragarwal@google.com>
Date: Thu Sep 3 10:49:20 2020 -0700
A number of small changes.
1. Add a move constructor to NumericDiffCostFunction, DynamicAutoDiffCostfunction
and DynamicNumericDiffCostFunction.
2. Add optional ownership of the underlying functor.
3. Update docs to reflect this as well as the variadic templates that allow an
arbitrary number of parameter blocks.
Change-Id: I57bbb51fb9e75f36ec2a661b603beda270f30a19
commit 368a738e5281039f19587545806b7bc6f35e78f9
Author: Julian Kent <jkflying@gmail.com>
Date: Thu May 7 12:54:35 2020 +0200
AutoDiffCostFunction: optional ownership
Add Ownership semantics to the AutoDiffCostFunction
This allows several benefits, such as pointer ordering always being the
same for numerical repeatability (due to blocks being ordered by
pointer address), memory adjacency for better cache performance, and
reduced allocator pressure / overhead.
This is then made use of in libmv by preallocating the errors and
cost functions into vectors
Change-Id: Ia5b97e7249b55a463264b6e26f7a02291927c9f2
commit 8cbd721c199c69f127af6ef7c187ddf7e8f116f9
Author: Morten Hannemose <morten@hannemose.dk>
Date: Thu Sep 3 17:54:20 2020 +0200
Add erf and erfc to jet.h, including tests in jet_test.cc
erf is necessary for evaluating Gaussian functions.
erfc was added because it is so similar to erf.
Change-Id: I5e470dbe013cc938fabb87cde3b0ebf26a90fff4
commit 31366cff299cf2a8d97b43a7533d953ff28fdc29
Author: Sameer Agarwal <sameeragarwal@google.com>
Date: Tue Sep 1 09:23:34 2020 -0700
Benchmarks for dynamic autodiff.
This patch is from Clement Courbet. courbet@google.com
Change-Id: I886390663644733bfa5b7b52b0c883079e793726
commit 29fb08aeae1ce691851724af7209fea6127523a9
Author: Alex Stewart <alexs.mac@gmail.com>
Date: Tue Sep 1 10:23:31 2020 +0100
Use CMAKE_PREFIX_PATH to pass Homebrew install location
- Passing HINTS disables the MODULE mode of find_package() which
precludes users from creating their own find modules to provide
Ceres' dependencies.
Change-Id: I6f2edf429331d13fe67bf61ac4b79d17579d9a57
commit 242c703b501ffd64d645f4016d63c8b41c381038
Author: Sameer Agarwal <sameeragarwal@google.com>
Date: Tue Aug 4 21:02:11 2020 -0700
Minor fixes to the documentation
Change-Id: I65e6f648d963b8aa640078684ce02dcde6acb87d
commit 79bbf95103672fa4b5485e055ff7692ee4a1f9da
Author: Sameer Agarwal <sameeragarwal@google.com>
Date: Tue Aug 4 18:26:02 2020 -0700
Add changelog for 2.0.0
Change-Id: I8acad62bfe629454ae5032732693e43fe37b97ff
commit 41d05f13d0ffb230d7a5a9d67ed31b0cfb35d669
Author: Sameer Agarwal <sameeragarwal@google.com>
Date: Tue Aug 4 14:56:33 2020 -0700
Fix lint errors in evaluation_callback_test.cc
Change-Id: I63eb069544ad0d8f495490fe4caa07b9f04f7ec2
commit 4b67903c1f96037048c83a723028c5d0991c09cf
Author: Sameer Agarwal <sameeragarwal@google.com>
Date: Tue Aug 4 14:40:50 2020 -0700
Remove unused variables from problem_test.cc
Change-Id: Ia1a13cfc6e462f6d249dcbf169ad34831dd93ec2
commit 10449fc3664c96d4b5454c092195432df79412f8
Author: Sameer Agarwal <sameeragarwal@google.com>
Date: Tue Aug 4 14:30:25 2020 -0700
Add Apache license to the LICENSE file for FixedArray
FixedArray implementation comes from ABSL which is Apache
licensed.
Change-Id: I566dbe9d236814c95945732c6347d3bf7b508283
commit 8c3ecec6db26d7a66f5de8dc654475ec7aa0df14
Author: Sameer Agarwal <sameeragarwal@google.com>
Date: Tue May 26 04:44:11 2020 -0700
Fix some minor errors in IterationCallback docs
Change-Id: Id3d7f21a523ff8466868cdec542921c566bbbfa9
commit 7d3ffcb4234632dc51ee84c8a509d9428263070b
Author: Alex Stewart <alexs.mac@gmail.com>
Date: Sun Jul 26 19:42:16 2020 +0100
Remove forced CONFIG from find_package(Eigen3)
- Ceres will fail to configure if Eigen3::Eigen target is not found, and
the minimum required Eigen version specified (3.3) exports Eigen as
a CMake package and this is reflected in the default Ubuntu 18.04
packages.
- This permits users to specify their own Eigen3 detection should they
choose to do so, but they must do so via an imported target.
Change-Id: I5edff117c8001770004f49012ac1ae63b66ec9c1
commit a029fc0f93817f20b387b707bc578dc1f1a269ae
Author: Alex Stewart <alexs.mac@gmail.com>
Date: Sun Jul 26 18:44:59 2020 +0100
Use latest FindTBB.cmake from VTK project
- Retrieved from [1], SHA: 0d9bbf9beb97f8f696c43a9edf1e52c082b3639b on
2020-07-26
- [1]: https://gitlab.kitware.com/vtk/vtk/blob/master/CMake/FindTBB.cmake
Change-Id: I953a8c87802a974d30ccc7c80f5229683826efbd
commit aa1abbc578797c6b17ee7221db31535dc249ae66
Author: Alex Stewart <alexs.mac@gmail.com>
Date: Sun Jul 26 19:57:31 2020 +0100
Replace use of GFLAGS_LIBRARIES with export gflags target
- As our minimum required version of gflags (2.2) exports itself as
a CMake package and this is the case for the default 18.04 package
we can use the gflags target directly.
- Replaces forced use of CONFIG in find_package(gflags) with a check
that the gflags imported target exists to avoid ambiguity with
libgflags if installed in a default location. This permits users to
override the gflags detection should they so choose, provided that
they do so via an imported target.
- Also removes some previously removed legacy GLAGS_ vars from the
installation docs.
Change-Id: I015f5a751e5b22f956bbf9df692e63a6825c9f0d
commit db2af1be8780bbe88944775400baa2dbd3592b7d
Author: Sameer Agarwal <sameeragarwal@google.com>
Date: Mon Aug 3 04:57:08 2020 -0700
Add Problem::EvaluateResidualBlockAssumingParametersUnchanged
Simplify the semantics for Problem::EvaluateResidualBlock to
not ignore the presence of EvaluationCallback and add another method
EvaluateResidualBlockAssumingParametersUnchanged to handle the case
where the user has an EvaluationCallback but knows that the parameter
blocks do not change between calls.
Updated the documentation for the methods and EvaluationCallback to
reflect these semantics.
Also added tests for Evaluation related methods calling i
EvaluationCallback when its present.
https://github.com/ceres-solver/ceres-solver/issues/483
Change-Id: If0a0c95c2f1f92e9183a90df240104a69a71c46d
commit ab4ed32cda004befd29a0b4b02f1d907e0c4dab7
Author: Sameer Agarwal <sameeragarwal@google.com>
Date: Mon Aug 3 04:17:33 2020 -0700
Replace NULL with nullptr in the documentation.
Change-Id: I995f68770e2a4b6027c0a1d3edf5eb5132b081d7
commit ee280e27a6140295ef6258d24c92305628f3d508
Author: Sameer Agarwal <sameeragarwal@google.com>
Date: Fri Jul 31 16:48:06 2020 -0700
Allow SubsetParameterization to accept an empty vector of constant parameters.
Thanks to Frédéric Devernay for reporting this and providing an initial fix.
Change-Id: Id86a2051ab7841ecafdcfb00f4634b353a7ef3b4
commit 4b8c731d8a4f3fda53c642ff14a25fab6c233918
Author: Sameer Agarwal <sameeragarwal@google.com>
Date: Fri Jul 31 10:05:52 2020 -0700
Fix a bug in DynamicAutoDiffCostFunction
DynamicAutoDiffCostFunction::Evaluate when provided with a jacobians
array that was non-empty but all its entries are nullptr, would
compute num_active_parameters = 0, and then skip over all the loops
that evaluated the CostFunctor.
The fix is to check if num_active_parameters == 0, and then treat
it as the case where jacobians array is null.
Thanks to Ky Waegel for reporting and providing a reproduction for this.
Change-Id: Ib86930c2c3f722724d249f662bf88238679bbf98
commit 5cb5b35a930c1702278083c75769dbb4e5801045
Author: Alex Stewart <alexs.mac@gmail.com>
Date: Sun Jul 26 20:42:12 2020 +0100
Fixed incorrect argument name in RotationMatrixToQuaternion()
- Raised as: https://github.com/ceres-solver/ceres-solver/pull/607 by
Frank Dellaert
Change-Id: Id3e9f190e814cf18206e2f8c3b1b67b995c21dd5
commit e39d9ed1d60dfeb58dd2a0df4622c683f87b28e3
Author: Carl Dehlin <carl@dehlin.com>
Date: Tue Jun 16 09:02:05 2020 +0200
Add a missing term and remove a superfluous word
Change-Id: I25f40f0bf241302b975e6fc14690aa863c0728b0
commit 27cab77b699a1a2b5354820c57a91c92eaeb21e3
Author: Carl Dehlin <carl@dehlin.com>
Date: Mon Jun 15 20:01:18 2020 +0200
Reformulate some sentences
Change-Id: I4841aa8e8522008dd816261d9ad98e5fb8ad1758
commit 8ac6655ce85a4462f2882fcb9e9118a7057ebe09
Author: Carl Dehlin <carl@dehlin.com>
Date: Mon Jun 15 19:10:12 2020 +0200
Fix documentation formatting issues
Change-Id: Iea3a6e75dc3a7376eda866ab24e535a6df84f8ea

234
extern/ceres/LICENSE vendored
View File

@@ -1,6 +1,6 @@
Ceres Solver - A fast non-linear least squares minimizer
Copyright 2010, 2011, 2012 Google Inc. All rights reserved.
http://code.google.com/p/ceres-solver/
Copyright 2015 Google Inc. All rights reserved.
http://ceres-solver.org/
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@@ -25,3 +25,233 @@ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
----------------------------------------------------------------------------------------------------------------------------
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-------------------------------------------------------------------------------------------------------------------------------
Some of the code in the examples directory derives from libmv, which is
distributed under the MIT license as described below
Copyright (c) 2007-2011 libmv authors.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.

3
extern/ceres/README vendored
View File

@@ -1,3 +0,0 @@
Ceres Solver - A non-linear least squares minimizer
==================================================
Please see ceres.pdf in docs/ for a tutorial and reference.

View File

@@ -1,5 +1,5 @@
Project: Ceres Solver
URL: http://ceres-solver.org/
License: BSD 3-Clause
Upstream version 2.0.0
Upstream version 2.1.0
Local modifications: None

18
extern/ceres/README.md vendored Normal file
View File

@@ -0,0 +1,18 @@
[![Android](https://github.com/ceres-solver/ceres-solver/actions/workflows/android.yml/badge.svg)](https://github.com/ceres-solver/ceres-solver/actions/workflows/android.yml)
[![Linux](https://github.com/ceres-solver/ceres-solver/actions/workflows/linux.yml/badge.svg)](https://github.com/ceres-solver/ceres-solver/actions/workflows/linux.yml)
[![macOS](https://github.com/ceres-solver/ceres-solver/actions/workflows/macos.yml/badge.svg)](https://github.com/ceres-solver/ceres-solver/actions/workflows/macos.yml)
[![Windows](https://github.com/ceres-solver/ceres-solver/actions/workflows/windows.yml/badge.svg)](https://github.com/ceres-solver/ceres-solver/actions/workflows/windows.yml)
Ceres Solver
============
Ceres Solver is an open source C++ library for modeling and solving
large, complicated optimization problems. It is a feature rich, mature
and performant library which has been used in production at Google
since 2010. Ceres Solver can solve two kinds of problems.
1. Non-linear Least Squares problems with bounds constraints.
2. General unconstrained optimization problems.
Please see [ceres-solver.org](http://ceres-solver.org/) for more
information.

165
extern/ceres/bundle.sh vendored
View File

@@ -1,165 +0,0 @@
#!/bin/sh
if [ "x$1" = "x--i-really-know-what-im-doing" ] ; then
echo Proceeding as requested by command line ...
else
echo "*** Please run again with --i-really-know-what-im-doing ..."
exit 1
fi
repo="https://ceres-solver.googlesource.com/ceres-solver"
#branch="master"
tag="2.0.0"
tmp=`mktemp -d`
checkout="$tmp/ceres"
GIT="git --git-dir $tmp/ceres/.git --work-tree $checkout"
git clone $repo $checkout
if [ $branch != "master" ]; then
$GIT checkout -t remotes/origin/$branch
else
if [ "x$tag" != "x" ]; then
$GIT checkout $tag
fi
fi
$GIT log -n 50 > ChangeLog
for p in `cat ./patches/series`; do
echo "Applying patch $p..."
cat ./patches/$p | patch -d $tmp/ceres -p1
done
find include -type f -not -iwholename '*.svn*' -exec rm -rf {} \;
find internal -type f -not -iwholename '*.svn*' -exec rm -rf {} \;
cat "files.txt" | while read f; do
mkdir -p `dirname $f`
cp $tmp/ceres/$f $f
done
rm -rf $tmp
sources=`find ./include ./internal -type f -iname '*.cc' -or -iname '*.cpp' -or -iname '*.c' | sed -r 's/^\.\//\t/' | \
grep -v -E 'schur_eliminator_[0-9]_[0-9d]_[0-9d].cc' | \
grep -v -E 'partitioned_matrix_view_[0-9]_[0-9d]_[0-9d].cc' | sort -d`
generated_sources=`find ./include ./internal -type f -iname '*.cc' -or -iname '*.cpp' -or -iname '*.c' | sed -r 's/^\.\//\t\t/' | \
grep -E 'schur_eliminator_[0-9]_[0-9d]_[0-9d].cc|partitioned_matrix_view_[0-9]_[0-9d]_[0-9d].cc' | sort -d`
headers=`find ./include ./internal -type f -iname '*.h' | sed -r 's/^\.\//\t/' | sort -d`
src_dir=`find ./internal -type f -iname '*.cc' -exec dirname {} \; -or -iname '*.cpp' -exec dirname {} \; -or -iname '*.c' -exec dirname {} \; | sed -r 's/^\.\//\t/' | sort -d | uniq`
src=""
for x in $src_dir $src_third_dir; do
t=""
if test `echo "$x" | grep -c glog ` -eq 1; then
continue;
fi
if test `echo "$x" | grep -c generated` -eq 1; then
continue;
fi
if stat $x/*.cpp > /dev/null 2>&1; then
t="src += env.Glob('`echo $x'/*.cpp'`')"
fi
if stat $x/*.c > /dev/null 2>&1; then
if [ -z "$t" ]; then
t="src += env.Glob('`echo $x'/*.c'`')"
else
t="$t + env.Glob('`echo $x'/*.c'`')"
fi
fi
if stat $x/*.cc > /dev/null 2>&1; then
if [ -z "$t" ]; then
t="src += env.Glob('`echo $x'/*.cc'`')"
else
t="$t + env.Glob('`echo $x'/*.cc'`')"
fi
fi
if [ -z "$src" ]; then
src=$t
else
src=`echo "$src\n$t"`
fi
done
cat > CMakeLists.txt << EOF
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# The Original Code is Copyright (C) 2012, Blender Foundation
# All rights reserved.
# ***** END GPL LICENSE BLOCK *****
# NOTE: This file is automatically generated by bundle.sh script
# If you're doing changes in this file, please update template
# in that script too
set(INC
.
include
internal
config
../gflags/src
)
set(INC_SYS
\${EIGEN3_INCLUDE_DIRS}
\${GFLAGS_INCLUDE_DIRS}
\${GLOG_INCLUDE_DIRS}
)
set(SRC
${sources}
${headers}
)
set(LIB
\${GLOG_LIBRARIES}
\${GFLAGS_LIBRARIES}
)
if(WITH_LIBMV_SCHUR_SPECIALIZATIONS)
list(APPEND SRC
${generated_sources}
)
else()
add_definitions(-DCERES_RESTRICT_SCHUR_SPECIALIZATION)
endif()
add_definitions(\${GFLAGS_DEFINES})
add_definitions(\${GLOG_DEFINES})
add_definitions(\${CERES_DEFINES})
add_definitions(
-DCERES_HAVE_PTHREAD
-DCERES_NO_SUITESPARSE
-DCERES_NO_CXSPARSE
-DCERES_NO_LAPACK
-DCERES_NO_ACCELERATE_SPARSE
-DCERES_HAVE_RWLOCK
-DCERES_USE_CXX_THREADS
)
blender_add_lib(extern_ceres "\${SRC}" "\${INC}" "\${INC_SYS}" "\${LIB}")
EOF

View File

@@ -1,5 +1,5 @@
// Ceres Solver - A fast non-linear least squares minimizer
// Copyright 2015 Google Inc. All rights reserved.
// Copyright 2022 Google Inc. All rights reserved.
// http://ceres-solver.org/
//
// Redistribution and use in source and binary forms, with or without
@@ -28,21 +28,98 @@
//
// Author: alexs.mac@gmail.com (Alex Stewart)
// Default (empty) configuration options for Ceres.
// Configuration options for Ceres.
//
// IMPORTANT: Most users of Ceres will not use this file, when
// compiling Ceres with CMake, CMake will configure a new
// config.h with the currently selected Ceres compile
// options in <BUILD_DIR>/config, which will be added to
// the include path for compilation, and installed with the
// public Ceres headers. However, for some users of Ceres
// who compile without CMake (Android), this file ensures
// that Ceres will compile, with the user either specifying
// manually the Ceres compile options, or passing them
// directly through the compiler.
// Do not edit this file, it was automatically configured by CMake when
// Ceres was compiled with the relevant configuration for the machine
// on which Ceres was compiled.
//
// Ceres Developers: All options should have the same name as their mapped
// CMake options, in the preconfigured version of this file
// all options should be enclosed in '@'.
#ifndef CERES_PUBLIC_INTERNAL_CONFIG_H_
#define CERES_PUBLIC_INTERNAL_CONFIG_H_
// If defined, use the LGPL code in Eigen.
#define CERES_USE_EIGEN_SPARSE
// If defined, Ceres was compiled without LAPACK.
#define CERES_NO_LAPACK
// If defined, Ceres was compiled without SuiteSparse.
#define CERES_NO_SUITESPARSE
// If defined, Ceres was compiled without CXSparse.
#define CERES_NO_CXSPARSE
// If defined, Ceres was compiled without CUDA.
#define CERES_NO_CUDA
// If defined, Ceres was compiled without Apple's Accelerate framework solvers.
#define CERES_NO_ACCELERATE_SPARSE
#if defined(CERES_NO_SUITESPARSE) && \
defined(CERES_NO_ACCELERATE_SPARSE) && \
defined(CERES_NO_CXSPARSE) && \
!defined(CERES_USE_EIGEN_SPARSE) // NOLINT
// If defined Ceres was compiled without any sparse linear algebra support.
#define CERES_NO_SPARSE
#endif
// If defined, Ceres was compiled without Schur specializations.
// #define CERES_RESTRICT_SCHUR_SPECIALIZATION
// If defined, Ceres was compiled to use Eigen instead of hardcoded BLAS
// routines.
// #define CERES_NO_CUSTOM_BLAS
// If defined, Ceres was compiled without multithreading support.
// #define CERES_NO_THREADS
// If defined Ceres was compiled with OpenMP multithreading.
// #define CERES_USE_OPENMP
// If defined Ceres was compiled with modern C++ multithreading.
#define CERES_USE_CXX_THREADS
// If defined, Ceres was compiled with a version MSVC >= 2005 which
// deprecated the standard POSIX names for bessel functions, replacing them
// with underscore prefixed versions (e.g. j0() -> _j0()).
#ifdef _MSC_VER
#define CERES_MSVC_USE_UNDERSCORE_PREFIXED_BESSEL_FUNCTIONS
#endif
#if defined(CERES_USE_OPENMP)
#if defined(CERES_USE_CXX_THREADS) || defined(CERES_NO_THREADS)
#error CERES_USE_OPENMP is mutually exclusive to CERES_USE_CXX_THREADS and CERES_NO_THREADS
#endif
#elif defined(CERES_USE_CXX_THREADS)
#if defined(CERES_USE_OPENMP) || defined(CERES_NO_THREADS)
#error CERES_USE_CXX_THREADS is mutually exclusive to CERES_USE_OPENMP, CERES_USE_CXX_THREADS and CERES_NO_THREADS
#endif
#elif defined(CERES_NO_THREADS)
#if defined(CERES_USE_OPENMP) || defined(CERES_USE_CXX_THREADS)
#error CERES_NO_THREADS is mutually exclusive to CERES_USE_OPENMP and CERES_USE_CXX_THREADS
#endif
#else
# error One of CERES_USE_OPENMP, CERES_USE_CXX_THREADS or CERES_NO_THREADS must be defined.
#endif
// CERES_NO_SPARSE should be automatically defined by config.h if Ceres was
// compiled without any sparse back-end. Verify that it has not subsequently
// been inconsistently redefined.
#if defined(CERES_NO_SPARSE)
#if !defined(CERES_NO_SUITESPARSE)
#error CERES_NO_SPARSE requires CERES_NO_SUITESPARSE.
#endif
#if !defined(CERES_NO_CXSPARSE)
#error CERES_NO_SPARSE requires CERES_NO_CXSPARSE
#endif
#if !defined(CERES_NO_ACCELERATE_SPARSE)
#error CERES_NO_SPARSE requires CERES_NO_ACCELERATE_SPARSE
#endif
#if defined(CERES_USE_EIGEN_SPARSE)
#error CERES_NO_SPARSE requires !CERES_USE_EIGEN_SPARSE
#endif
#endif
#endif // CERES_PUBLIC_INTERNAL_CONFIG_H_

View File

@@ -0,0 +1,42 @@
#ifndef CERES_EXPORT_H
#define CERES_EXPORT_H
#ifdef CERES_STATIC_DEFINE
# define CERES_EXPORT
# define CERES_NO_EXPORT
#else
# ifndef CERES_EXPORT
# ifdef ceres_EXPORTS
/* We are building this library */
# define CERES_EXPORT
# else
/* We are using this library */
# define CERES_EXPORT
# endif
# endif
# ifndef CERES_NO_EXPORT
# define CERES_NO_EXPORT
# endif
#endif
#ifndef CERES_DEPRECATED
# define CERES_DEPRECATED __attribute__ ((__deprecated__))
#endif
#ifndef CERES_DEPRECATED_EXPORT
# define CERES_DEPRECATED_EXPORT CERES_EXPORT CERES_DEPRECATED
#endif
#ifndef CERES_DEPRECATED_NO_EXPORT
# define CERES_DEPRECATED_NO_EXPORT CERES_NO_EXPORT CERES_DEPRECATED
#endif
#if 0 /* DEFINE_NO_DEPRECATED */
# ifndef CERES_NO_DEPRECATED
# define CERES_NO_DEPRECATED
# endif
#endif
#endif /* CERES_EXPORT_H */

318
extern/ceres/files.txt vendored
View File

@@ -1,318 +0,0 @@
include/ceres/autodiff_cost_function.h
include/ceres/autodiff_first_order_function.h
include/ceres/autodiff_local_parameterization.h
include/ceres/c_api.h
include/ceres/ceres.h
include/ceres/conditioned_cost_function.h
include/ceres/context.h
include/ceres/cost_function.h
include/ceres/cost_function_to_functor.h
include/ceres/covariance.h
include/ceres/crs_matrix.h
include/ceres/cubic_interpolation.h
include/ceres/dynamic_autodiff_cost_function.h
include/ceres/dynamic_cost_function.h
include/ceres/dynamic_cost_function_to_functor.h
include/ceres/dynamic_numeric_diff_cost_function.h
include/ceres/evaluation_callback.h
include/ceres/first_order_function.h
include/ceres/gradient_checker.h
include/ceres/gradient_problem.h
include/ceres/gradient_problem_solver.h
include/ceres/internal/array_selector.h
include/ceres/internal/autodiff.h
include/ceres/internal/disable_warnings.h
include/ceres/internal/eigen.h
include/ceres/internal/fixed_array.h
include/ceres/internal/householder_vector.h
include/ceres/internal/integer_sequence_algorithm.h
include/ceres/internal/line_parameterization.h
include/ceres/internal/memory.h
include/ceres/internal/numeric_diff.h
include/ceres/internal/parameter_dims.h
include/ceres/internal/port.h
include/ceres/internal/reenable_warnings.h
include/ceres/internal/variadic_evaluate.h
include/ceres/iteration_callback.h
include/ceres/jet.h
include/ceres/local_parameterization.h
include/ceres/loss_function.h
include/ceres/normal_prior.h
include/ceres/numeric_diff_cost_function.h
include/ceres/numeric_diff_options.h
include/ceres/ordered_groups.h
include/ceres/problem.h
include/ceres/rotation.h
include/ceres/sized_cost_function.h
include/ceres/solver.h
include/ceres/tiny_solver_autodiff_function.h
include/ceres/tiny_solver_cost_function_adapter.h
include/ceres/tiny_solver.h
include/ceres/types.h
include/ceres/version.h
internal/ceres/accelerate_sparse.cc
internal/ceres/accelerate_sparse.h
internal/ceres/array_utils.cc
internal/ceres/array_utils.h
internal/ceres/blas.cc
internal/ceres/blas.h
internal/ceres/block_evaluate_preparer.cc
internal/ceres/block_evaluate_preparer.h
internal/ceres/block_jacobian_writer.cc
internal/ceres/block_jacobian_writer.h
internal/ceres/block_jacobi_preconditioner.cc
internal/ceres/block_jacobi_preconditioner.h
internal/ceres/block_random_access_dense_matrix.cc
internal/ceres/block_random_access_dense_matrix.h
internal/ceres/block_random_access_diagonal_matrix.cc
internal/ceres/block_random_access_diagonal_matrix.h
internal/ceres/block_random_access_matrix.cc
internal/ceres/block_random_access_matrix.h
internal/ceres/block_random_access_sparse_matrix.cc
internal/ceres/block_random_access_sparse_matrix.h
internal/ceres/block_sparse_matrix.cc
internal/ceres/block_sparse_matrix.h
internal/ceres/block_structure.cc
internal/ceres/block_structure.h
internal/ceres/callbacks.cc
internal/ceres/callbacks.h
internal/ceres/canonical_views_clustering.cc
internal/ceres/canonical_views_clustering.h
internal/ceres/c_api.cc
internal/ceres/casts.h
internal/ceres/cgnr_linear_operator.h
internal/ceres/cgnr_solver.cc
internal/ceres/cgnr_solver.h
internal/ceres/compressed_col_sparse_matrix_utils.cc
internal/ceres/compressed_col_sparse_matrix_utils.h
internal/ceres/compressed_row_jacobian_writer.cc
internal/ceres/compressed_row_jacobian_writer.h
internal/ceres/compressed_row_sparse_matrix.cc
internal/ceres/compressed_row_sparse_matrix.h
internal/ceres/concurrent_queue.h
internal/ceres/conditioned_cost_function.cc
internal/ceres/conjugate_gradients_solver.cc
internal/ceres/conjugate_gradients_solver.h
internal/ceres/context.cc
internal/ceres/context_impl.cc
internal/ceres/context_impl.h
internal/ceres/coordinate_descent_minimizer.cc
internal/ceres/coordinate_descent_minimizer.h
internal/ceres/corrector.cc
internal/ceres/corrector.h
internal/ceres/covariance.cc
internal/ceres/covariance_impl.cc
internal/ceres/covariance_impl.h
internal/ceres/cxsparse.cc
internal/ceres/cxsparse.h
internal/ceres/dense_jacobian_writer.h
internal/ceres/dense_normal_cholesky_solver.cc
internal/ceres/dense_normal_cholesky_solver.h
internal/ceres/dense_qr_solver.cc
internal/ceres/dense_qr_solver.h
internal/ceres/dense_sparse_matrix.cc
internal/ceres/dense_sparse_matrix.h
internal/ceres/detect_structure.cc
internal/ceres/detect_structure.h
internal/ceres/dogleg_strategy.cc
internal/ceres/dogleg_strategy.h
internal/ceres/dynamic_compressed_row_finalizer.h
internal/ceres/dynamic_compressed_row_jacobian_writer.cc
internal/ceres/dynamic_compressed_row_jacobian_writer.h
internal/ceres/dynamic_compressed_row_sparse_matrix.cc
internal/ceres/dynamic_compressed_row_sparse_matrix.h
internal/ceres/dynamic_sparse_normal_cholesky_solver.cc
internal/ceres/dynamic_sparse_normal_cholesky_solver.h
internal/ceres/eigensparse.cc
internal/ceres/eigensparse.h
internal/ceres/evaluator.cc
internal/ceres/evaluator.h
internal/ceres/execution_summary.h
internal/ceres/file.cc
internal/ceres/file.h
internal/ceres/float_cxsparse.cc
internal/ceres/float_cxsparse.h
internal/ceres/float_suitesparse.cc
internal/ceres/float_suitesparse.h
internal/ceres/function_sample.cc
internal/ceres/function_sample.h
internal/ceres/generated/partitioned_matrix_view_2_2_2.cc
internal/ceres/generated/partitioned_matrix_view_2_2_3.cc
internal/ceres/generated/partitioned_matrix_view_2_2_4.cc
internal/ceres/generated/partitioned_matrix_view_2_2_d.cc
internal/ceres/generated/partitioned_matrix_view_2_3_3.cc
internal/ceres/generated/partitioned_matrix_view_2_3_4.cc
internal/ceres/generated/partitioned_matrix_view_2_3_6.cc
internal/ceres/generated/partitioned_matrix_view_2_3_9.cc
internal/ceres/generated/partitioned_matrix_view_2_3_d.cc
internal/ceres/generated/partitioned_matrix_view_2_4_3.cc
internal/ceres/generated/partitioned_matrix_view_2_4_4.cc
internal/ceres/generated/partitioned_matrix_view_2_4_6.cc
internal/ceres/generated/partitioned_matrix_view_2_4_8.cc
internal/ceres/generated/partitioned_matrix_view_2_4_9.cc
internal/ceres/generated/partitioned_matrix_view_2_4_d.cc
internal/ceres/generated/partitioned_matrix_view_2_d_d.cc
internal/ceres/generated/partitioned_matrix_view_3_3_3.cc
internal/ceres/generated/partitioned_matrix_view_4_4_2.cc
internal/ceres/generated/partitioned_matrix_view_4_4_3.cc
internal/ceres/generated/partitioned_matrix_view_4_4_4.cc
internal/ceres/generated/partitioned_matrix_view_4_4_d.cc
internal/ceres/generated/partitioned_matrix_view_d_d_d.cc
internal/ceres/generated/schur_eliminator_2_2_2.cc
internal/ceres/generated/schur_eliminator_2_2_3.cc
internal/ceres/generated/schur_eliminator_2_2_4.cc
internal/ceres/generated/schur_eliminator_2_2_d.cc
internal/ceres/generated/schur_eliminator_2_3_3.cc
internal/ceres/generated/schur_eliminator_2_3_4.cc
internal/ceres/generated/schur_eliminator_2_3_6.cc
internal/ceres/generated/schur_eliminator_2_3_9.cc
internal/ceres/generated/schur_eliminator_2_3_d.cc
internal/ceres/generated/schur_eliminator_2_4_3.cc
internal/ceres/generated/schur_eliminator_2_4_4.cc
internal/ceres/generated/schur_eliminator_2_4_6.cc
internal/ceres/generated/schur_eliminator_2_4_8.cc
internal/ceres/generated/schur_eliminator_2_4_9.cc
internal/ceres/generated/schur_eliminator_2_4_d.cc
internal/ceres/generated/schur_eliminator_2_d_d.cc
internal/ceres/generated/schur_eliminator_3_3_3.cc
internal/ceres/generated/schur_eliminator_4_4_2.cc
internal/ceres/generated/schur_eliminator_4_4_3.cc
internal/ceres/generated/schur_eliminator_4_4_4.cc
internal/ceres/generated/schur_eliminator_4_4_d.cc
internal/ceres/generated/schur_eliminator_d_d_d.cc
internal/ceres/generate_template_specializations.py
internal/ceres/gradient_checker.cc
internal/ceres/gradient_checking_cost_function.cc
internal/ceres/gradient_checking_cost_function.h
internal/ceres/gradient_problem.cc
internal/ceres/gradient_problem_evaluator.h
internal/ceres/gradient_problem_solver.cc
internal/ceres/graph_algorithms.h
internal/ceres/graph.h
internal/ceres/implicit_schur_complement.cc
internal/ceres/implicit_schur_complement.h
internal/ceres/inner_product_computer.cc
internal/ceres/inner_product_computer.h
internal/ceres/invert_psd_matrix.h
internal/ceres/is_close.cc
internal/ceres/is_close.h
internal/ceres/iterative_refiner.cc
internal/ceres/iterative_refiner.h
internal/ceres/iterative_schur_complement_solver.cc
internal/ceres/iterative_schur_complement_solver.h
internal/ceres/lapack.cc
internal/ceres/lapack.h
internal/ceres/levenberg_marquardt_strategy.cc
internal/ceres/levenberg_marquardt_strategy.h
internal/ceres/linear_least_squares_problems.cc
internal/ceres/linear_least_squares_problems.h
internal/ceres/linear_operator.cc
internal/ceres/linear_operator.h
internal/ceres/linear_solver.cc
internal/ceres/linear_solver.h
internal/ceres/line_search.cc
internal/ceres/line_search_direction.cc
internal/ceres/line_search_direction.h
internal/ceres/line_search.h
internal/ceres/line_search_minimizer.cc
internal/ceres/line_search_minimizer.h
internal/ceres/line_search_preprocessor.cc
internal/ceres/line_search_preprocessor.h
internal/ceres/local_parameterization.cc
internal/ceres/loss_function.cc
internal/ceres/low_rank_inverse_hessian.cc
internal/ceres/low_rank_inverse_hessian.h
internal/ceres/map_util.h
internal/ceres/minimizer.cc
internal/ceres/minimizer.h
internal/ceres/normal_prior.cc
internal/ceres/pair_hash.h
internal/ceres/parallel_for_cxx.cc
internal/ceres/parallel_for.h
internal/ceres/parallel_for_nothreads.cc
internal/ceres/parallel_for_openmp.cc
internal/ceres/parallel_utils.cc
internal/ceres/parallel_utils.h
internal/ceres/parameter_block.h
internal/ceres/parameter_block_ordering.cc
internal/ceres/parameter_block_ordering.h
internal/ceres/partitioned_matrix_view.cc
internal/ceres/partitioned_matrix_view.h
internal/ceres/partitioned_matrix_view_impl.h
internal/ceres/partitioned_matrix_view_template.py
internal/ceres/polynomial.cc
internal/ceres/polynomial.h
internal/ceres/preconditioner.cc
internal/ceres/preconditioner.h
internal/ceres/preprocessor.cc
internal/ceres/preprocessor.h
internal/ceres/problem.cc
internal/ceres/problem_impl.cc
internal/ceres/problem_impl.h
internal/ceres/program.cc
internal/ceres/program_evaluator.h
internal/ceres/program.h
internal/ceres/random.h
internal/ceres/reorder_program.cc
internal/ceres/reorder_program.h
internal/ceres/residual_block.cc
internal/ceres/residual_block.h
internal/ceres/residual_block_utils.cc
internal/ceres/residual_block_utils.h
internal/ceres/schur_complement_solver.cc
internal/ceres/schur_complement_solver.h
internal/ceres/schur_eliminator.cc
internal/ceres/schur_eliminator.h
internal/ceres/schur_eliminator_impl.h
internal/ceres/schur_eliminator_template.py
internal/ceres/schur_jacobi_preconditioner.cc
internal/ceres/schur_jacobi_preconditioner.h
internal/ceres/schur_templates.cc
internal/ceres/schur_templates.h
internal/ceres/scoped_thread_token.h
internal/ceres/scratch_evaluate_preparer.cc
internal/ceres/scratch_evaluate_preparer.h
internal/ceres/single_linkage_clustering.cc
internal/ceres/single_linkage_clustering.h
internal/ceres/small_blas_generic.h
internal/ceres/small_blas.h
internal/ceres/solver.cc
internal/ceres/solver_utils.cc
internal/ceres/solver_utils.h
internal/ceres/sparse_cholesky.cc
internal/ceres/sparse_cholesky.h
internal/ceres/sparse_matrix.cc
internal/ceres/sparse_matrix.h
internal/ceres/sparse_normal_cholesky_solver.cc
internal/ceres/sparse_normal_cholesky_solver.h
internal/ceres/split.cc
internal/ceres/split.h
internal/ceres/stl_util.h
internal/ceres/stringprintf.cc
internal/ceres/stringprintf.h
internal/ceres/subset_preconditioner.cc
internal/ceres/subset_preconditioner.h
internal/ceres/suitesparse.cc
internal/ceres/suitesparse.h
internal/ceres/thread_pool.cc
internal/ceres/thread_pool.h
internal/ceres/thread_token_provider.cc
internal/ceres/thread_token_provider.h
internal/ceres/triplet_sparse_matrix.cc
internal/ceres/triplet_sparse_matrix.h
internal/ceres/trust_region_minimizer.cc
internal/ceres/trust_region_minimizer.h
internal/ceres/trust_region_preprocessor.cc
internal/ceres/trust_region_preprocessor.h
internal/ceres/trust_region_step_evaluator.cc
internal/ceres/trust_region_step_evaluator.h
internal/ceres/trust_region_strategy.cc
internal/ceres/trust_region_strategy.h
internal/ceres/types.cc
internal/ceres/visibility_based_preconditioner.cc
internal/ceres/visibility_based_preconditioner.h
internal/ceres/visibility.cc
internal/ceres/visibility.h
internal/ceres/wall_time.cc
internal/ceres/wall_time.h
config/ceres/internal/config.h

View File

@@ -151,7 +151,8 @@ namespace ceres {
template <typename CostFunctor,
int kNumResiduals, // Number of residuals, or ceres::DYNAMIC.
int... Ns> // Number of parameters in each parameter block.
class AutoDiffCostFunction : public SizedCostFunction<kNumResiduals, Ns...> {
class AutoDiffCostFunction final
: public SizedCostFunction<kNumResiduals, Ns...> {
public:
// Takes ownership of functor by default. Uses the template-provided
// value for the number of residuals ("kNumResiduals").
@@ -178,7 +179,7 @@ class AutoDiffCostFunction : public SizedCostFunction<kNumResiduals, Ns...> {
SizedCostFunction<kNumResiduals, Ns...>::set_num_residuals(num_residuals);
}
explicit AutoDiffCostFunction(AutoDiffCostFunction&& other)
AutoDiffCostFunction(AutoDiffCostFunction&& other)
: functor_(std::move(other.functor_)), ownership_(other.ownership_) {}
virtual ~AutoDiffCostFunction() {
@@ -215,6 +216,8 @@ class AutoDiffCostFunction : public SizedCostFunction<kNumResiduals, Ns...> {
jacobians);
};
const CostFunctor& functor() const { return *functor_; }
private:
std::unique_ptr<CostFunctor> functor_;
Ownership ownership_;

View File

@@ -102,7 +102,7 @@ namespace ceres {
// seen where instead of using a_ directly, a_ is wrapped with T(a_).
template <typename FirstOrderFunctor, int kNumParameters>
class AutoDiffFirstOrderFunction : public FirstOrderFunction {
class AutoDiffFirstOrderFunction final : public FirstOrderFunction {
public:
// Takes ownership of functor.
explicit AutoDiffFirstOrderFunction(FirstOrderFunctor* functor)
@@ -110,8 +110,6 @@ class AutoDiffFirstOrderFunction : public FirstOrderFunction {
static_assert(kNumParameters > 0, "kNumParameters must be positive");
}
virtual ~AutoDiffFirstOrderFunction() {}
bool Evaluate(const double* const parameters,
double* cost,
double* gradient) const override {
@@ -119,7 +117,7 @@ class AutoDiffFirstOrderFunction : public FirstOrderFunction {
return (*functor_)(parameters, cost);
}
typedef Jet<double, kNumParameters> JetT;
using JetT = Jet<double, kNumParameters>;
internal::FixedArray<JetT, (256 * 7) / sizeof(JetT)> x(kNumParameters);
for (int i = 0; i < kNumParameters; ++i) {
x[i].a = parameters[i];
@@ -142,6 +140,8 @@ class AutoDiffFirstOrderFunction : public FirstOrderFunction {
int NumParameters() const override { return kNumParameters; }
const FirstOrderFunctor& functor() const { return *functor_; }
private:
std::unique_ptr<FirstOrderFunctor> functor_;
};

View File

@@ -40,6 +40,10 @@
namespace ceres {
// WARNING: LocalParameterizations are deprecated, so is
// AutoDiffLocalParameterization. They will be removed from Ceres Solver in
// version 2.2.0. Please use Manifolds and AutoDiffManifold instead.
// Create local parameterization with Jacobians computed via automatic
// differentiation. For more information on local parameterizations,
// see include/ceres/local_parameterization.h
@@ -106,7 +110,8 @@ namespace ceres {
// seen where instead of using k_ directly, k_ is wrapped with T(k_).
template <typename Functor, int kGlobalSize, int kLocalSize>
class AutoDiffLocalParameterization : public LocalParameterization {
class CERES_DEPRECATED_WITH_MSG("Use AutoDiffManifold instead.")
AutoDiffLocalParameterization : public LocalParameterization {
public:
AutoDiffLocalParameterization() : functor_(new Functor()) {}
@@ -114,7 +119,6 @@ class AutoDiffLocalParameterization : public LocalParameterization {
explicit AutoDiffLocalParameterization(Functor* functor)
: functor_(functor) {}
virtual ~AutoDiffLocalParameterization() {}
bool Plus(const double* x,
const double* delta,
double* x_plus_delta) const override {
@@ -133,7 +137,7 @@ class AutoDiffLocalParameterization : public LocalParameterization {
}
const double* parameter_ptrs[2] = {x, zero_delta};
double* jacobian_ptrs[2] = {NULL, jacobian};
double* jacobian_ptrs[2] = {nullptr, jacobian};
return internal::AutoDifferentiate<
kGlobalSize,
internal::StaticParameterDims<kGlobalSize, kLocalSize>>(
@@ -143,6 +147,8 @@ class AutoDiffLocalParameterization : public LocalParameterization {
int GlobalSize() const override { return kGlobalSize; }
int LocalSize() const override { return kLocalSize; }
const Functor& functor() const { return *functor_; }
private:
std::unique_ptr<Functor> functor_;
};

View File

@@ -0,0 +1,259 @@
// Ceres Solver - A fast non-linear least squares minimizer
// Copyright 2022 Google Inc. All rights reserved.
// http://ceres-solver.org/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
// * Neither the name of Google Inc. nor the names of its contributors may be
// used to endorse or promote products derived from this software without
// specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
//
// Author: sameeragarwal@google.com (Sameer Agarwal)
#ifndef CERES_PUBLIC_AUTODIFF_MANIFOLD_H_
#define CERES_PUBLIC_AUTODIFF_MANIFOLD_H_
#include <memory>
#include "ceres/internal/autodiff.h"
#include "ceres/manifold.h"
namespace ceres {
// Create a Manifold with Jacobians computed via automatic differentiation. For
// more information on manifolds, see include/ceres/manifold.h
//
// To get an auto differentiated manifold, you must define a class/struct with
// templated Plus and Minus functions that compute
//
// x_plus_delta = Plus(x, delta);
// y_minus_x = Minus(y, x);
//
// Where, x, y and x_plus_y are vectors on the manifold in the ambient space (so
// they are kAmbientSize vectors) and delta, y_minus_x are vectors in the
// tangent space (so they are kTangentSize vectors).
//
// The Functor should have the signature:
//
// struct Functor {
// template <typename T>
// bool Plus(const T* x, const T* delta, T* x_plus_delta) const;
//
// template <typename T>
// bool Minus(const T* y, const T* x, T* y_minus_x) const;
// };
//
// Observe that the Plus and Minus operations are templated on the parameter T.
// The autodiff framework substitutes appropriate "Jet" objects for T in order
// to compute the derivative when necessary. This is the same mechanism that is
// used to compute derivatives when using AutoDiffCostFunction.
//
// Plus and Minus should return true if the computation is successful and false
// otherwise, in which case the result will not be used.
//
// Given this Functor, the corresponding Manifold can be constructed as:
//
// AutoDiffManifold<Functor, kAmbientSize, kTangentSize> manifold;
//
// As a concrete example consider the case of Quaternions. Quaternions form a
// three dimensional manifold embedded in R^4, i.e. they have an ambient
// dimension of 4 and their tangent space has dimension 3. The following Functor
// (taken from autodiff_manifold_test.cc) defines the Plus and Minus operations
// on the Quaternion manifold:
//
// NOTE: The following is only used for illustration purposes. Ceres Solver
// ships with optimized production grade QuaternionManifold implementation. See
// manifold.h.
//
// This functor assumes that the quaternions are laid out as [w,x,y,z] in
// memory, i.e. the real or scalar part is the first coordinate.
//
// struct QuaternionFunctor {
// template <typename T>
// bool Plus(const T* x, const T* delta, T* x_plus_delta) const {
// const T squared_norm_delta =
// delta[0] * delta[0] + delta[1] * delta[1] + delta[2] * delta[2];
//
// T q_delta[4];
// if (squared_norm_delta > T(0.0)) {
// T norm_delta = sqrt(squared_norm_delta);
// const T sin_delta_by_delta = sin(norm_delta) / norm_delta;
// q_delta[0] = cos(norm_delta);
// q_delta[1] = sin_delta_by_delta * delta[0];
// q_delta[2] = sin_delta_by_delta * delta[1];
// q_delta[3] = sin_delta_by_delta * delta[2];
// } else {
// // We do not just use q_delta = [1,0,0,0] here because that is a
// // constant and when used for automatic differentiation will
// // lead to a zero derivative. Instead we take a first order
// // approximation and evaluate it at zero.
// q_delta[0] = T(1.0);
// q_delta[1] = delta[0];
// q_delta[2] = delta[1];
// q_delta[3] = delta[2];
// }
//
// QuaternionProduct(q_delta, x, x_plus_delta);
// return true;
// }
//
// template <typename T>
// bool Minus(const T* y, const T* x, T* y_minus_x) const {
// T minus_x[4] = {x[0], -x[1], -x[2], -x[3]};
// T ambient_y_minus_x[4];
// QuaternionProduct(y, minus_x, ambient_y_minus_x);
// T u_norm = sqrt(ambient_y_minus_x[1] * ambient_y_minus_x[1] +
// ambient_y_minus_x[2] * ambient_y_minus_x[2] +
// ambient_y_minus_x[3] * ambient_y_minus_x[3]);
// if (u_norm > 0.0) {
// T theta = atan2(u_norm, ambient_y_minus_x[0]);
// y_minus_x[0] = theta * ambient_y_minus_x[1] / u_norm;
// y_minus_x[1] = theta * ambient_y_minus_x[2] / u_norm;
// y_minus_x[2] = theta * ambient_y_minus_x[3] / u_norm;
// } else {
// // We do not use [0,0,0] here because even though the value part is
// // a constant, the derivative part is not.
// y_minus_x[0] = ambient_y_minus_x[1];
// y_minus_x[1] = ambient_y_minus_x[2];
// y_minus_x[2] = ambient_y_minus_x[3];
// }
// return true;
// }
// };
//
// Then given this struct, the auto differentiated Quaternion Manifold can now
// be constructed as
//
// Manifold* manifold = new AutoDiffManifold<QuaternionFunctor, 4, 3>;
template <typename Functor, int kAmbientSize, int kTangentSize>
class AutoDiffManifold final : public Manifold {
public:
AutoDiffManifold() : functor_(std::make_unique<Functor>()) {}
// Takes ownership of functor.
explicit AutoDiffManifold(Functor* functor) : functor_(functor) {}
int AmbientSize() const override { return kAmbientSize; }
int TangentSize() const override { return kTangentSize; }
bool Plus(const double* x,
const double* delta,
double* x_plus_delta) const override {
return functor_->Plus(x, delta, x_plus_delta);
}
bool PlusJacobian(const double* x, double* jacobian) const override;
bool Minus(const double* y,
const double* x,
double* y_minus_x) const override {
return functor_->Minus(y, x, y_minus_x);
}
bool MinusJacobian(const double* x, double* jacobian) const override;
const Functor& functor() const { return *functor_; }
private:
std::unique_ptr<Functor> functor_;
};
namespace internal {
// The following two helper structs are needed to interface the Plus and Minus
// methods of the ManifoldFunctor with the automatic differentiation which
// expects a Functor with operator().
template <typename Functor>
struct PlusWrapper {
explicit PlusWrapper(const Functor& functor) : functor(functor) {}
template <typename T>
bool operator()(const T* x, const T* delta, T* x_plus_delta) const {
return functor.Plus(x, delta, x_plus_delta);
}
const Functor& functor;
};
template <typename Functor>
struct MinusWrapper {
explicit MinusWrapper(const Functor& functor) : functor(functor) {}
template <typename T>
bool operator()(const T* y, const T* x, T* y_minus_x) const {
return functor.Minus(y, x, y_minus_x);
}
const Functor& functor;
};
} // namespace internal
template <typename Functor, int kAmbientSize, int kTangentSize>
bool AutoDiffManifold<Functor, kAmbientSize, kTangentSize>::PlusJacobian(
const double* x, double* jacobian) const {
double zero_delta[kTangentSize];
for (int i = 0; i < kTangentSize; ++i) {
zero_delta[i] = 0.0;
}
double x_plus_delta[kAmbientSize];
for (int i = 0; i < kAmbientSize; ++i) {
x_plus_delta[i] = 0.0;
}
const double* parameter_ptrs[2] = {x, zero_delta};
// PlusJacobian is D_2 Plus(x,0) so we only need to compute the Jacobian
// w.r.t. the second argument.
double* jacobian_ptrs[2] = {nullptr, jacobian};
return internal::AutoDifferentiate<
kAmbientSize,
internal::StaticParameterDims<kAmbientSize, kTangentSize>>(
internal::PlusWrapper<Functor>(*functor_),
parameter_ptrs,
kAmbientSize,
x_plus_delta,
jacobian_ptrs);
}
template <typename Functor, int kAmbientSize, int kTangentSize>
bool AutoDiffManifold<Functor, kAmbientSize, kTangentSize>::MinusJacobian(
const double* x, double* jacobian) const {
double y_minus_x[kTangentSize];
for (int i = 0; i < kTangentSize; ++i) {
y_minus_x[i] = 0.0;
}
const double* parameter_ptrs[2] = {x, x};
// MinusJacobian is D_1 Minus(x,x), so we only need to compute the Jacobian
// w.r.t. the first argument.
double* jacobian_ptrs[2] = {jacobian, nullptr};
return internal::AutoDifferentiate<
kTangentSize,
internal::StaticParameterDims<kAmbientSize, kAmbientSize>>(
internal::MinusWrapper<Functor>(*functor_),
parameter_ptrs,
kTangentSize,
y_minus_x,
jacobian_ptrs);
}
} // namespace ceres
#endif // CERES_PUBLIC_AUTODIFF_MANIFOLD_H_

View File

@@ -39,7 +39,7 @@
#define CERES_PUBLIC_C_API_H_
// clang-format off
#include "ceres/internal/port.h"
#include "ceres/internal/export.h"
#include "ceres/internal/disable_warnings.h"
// clang-format on

View File

@@ -1,5 +1,5 @@
// Ceres Solver - A fast non-linear least squares minimizer
// Copyright 2019 Google Inc. All rights reserved.
// Copyright 2022 Google Inc. All rights reserved.
// http://ceres-solver.org/
//
// Redistribution and use in source and binary forms, with or without
@@ -35,7 +35,9 @@
#define CERES_PUBLIC_CERES_H_
#include "ceres/autodiff_cost_function.h"
#include "ceres/autodiff_first_order_function.h"
#include "ceres/autodiff_local_parameterization.h"
#include "ceres/autodiff_manifold.h"
#include "ceres/conditioned_cost_function.h"
#include "ceres/context.h"
#include "ceres/cost_function.h"
@@ -47,19 +49,25 @@
#include "ceres/dynamic_cost_function_to_functor.h"
#include "ceres/dynamic_numeric_diff_cost_function.h"
#include "ceres/evaluation_callback.h"
#include "ceres/first_order_function.h"
#include "ceres/gradient_checker.h"
#include "ceres/gradient_problem.h"
#include "ceres/gradient_problem_solver.h"
#include "ceres/iteration_callback.h"
#include "ceres/jet.h"
#include "ceres/line_manifold.h"
#include "ceres/local_parameterization.h"
#include "ceres/loss_function.h"
#include "ceres/manifold.h"
#include "ceres/numeric_diff_cost_function.h"
#include "ceres/numeric_diff_first_order_function.h"
#include "ceres/numeric_diff_options.h"
#include "ceres/ordered_groups.h"
#include "ceres/problem.h"
#include "ceres/product_manifold.h"
#include "ceres/sized_cost_function.h"
#include "ceres/solver.h"
#include "ceres/sphere_manifold.h"
#include "ceres/types.h"
#include "ceres/version.h"

View File

@@ -71,18 +71,18 @@ namespace ceres {
// ccf_residual[i] = f_i(my_cost_function_residual[i])
//
// and the Jacobian will be affected appropriately.
class CERES_EXPORT ConditionedCostFunction : public CostFunction {
class CERES_EXPORT ConditionedCostFunction final : public CostFunction {
public:
// Builds a cost function based on a wrapped cost function, and a
// per-residual conditioner. Takes ownership of all of the wrapped cost
// functions, or not, depending on the ownership parameter. Conditioners
// may be NULL, in which case the corresponding residual is not modified.
// may be nullptr, in which case the corresponding residual is not modified.
//
// The conditioners can repeat.
ConditionedCostFunction(CostFunction* wrapped_cost_function,
const std::vector<CostFunction*>& conditioners,
Ownership ownership);
virtual ~ConditionedCostFunction();
~ConditionedCostFunction() override;
bool Evaluate(double const* const* parameters,
double* residuals,

View File

@@ -31,6 +31,8 @@
#ifndef CERES_PUBLIC_CONTEXT_H_
#define CERES_PUBLIC_CONTEXT_H_
#include "ceres/internal/export.h"
namespace ceres {
// A global context for processing data in Ceres. This provides a mechanism to
@@ -39,13 +41,13 @@ namespace ceres {
// Problems, either serially or in parallel. When using it with multiple
// Problems at the same time, they may end up contending for resources
// (e.g. threads) managed by the Context.
class Context {
class CERES_EXPORT Context {
public:
Context() {}
Context();
Context(const Context&) = delete;
void operator=(const Context&) = delete;
virtual ~Context() {}
virtual ~Context();
// Creates a context object and the caller takes ownership.
static Context* Create();

View File

@@ -48,7 +48,7 @@
#include <vector>
#include "ceres/internal/disable_warnings.h"
#include "ceres/internal/port.h"
#include "ceres/internal/export.h"
namespace ceres {
@@ -63,11 +63,11 @@ namespace ceres {
// when added with AddResidualBlock().
class CERES_EXPORT CostFunction {
public:
CostFunction() : num_residuals_(0) {}
CostFunction();
CostFunction(const CostFunction&) = delete;
void operator=(const CostFunction&) = delete;
virtual ~CostFunction() {}
virtual ~CostFunction();
// Inputs:
//
@@ -92,8 +92,8 @@ class CERES_EXPORT CostFunction {
// jacobians[i][r*parameter_block_size_[i] + c] =
// d residual[r] / d parameters[i][c]
//
// If jacobians is NULL, then no derivatives are returned; this is
// the case when computing cost only. If jacobians[i] is NULL, then
// If jacobians is nullptr, then no derivatives are returned; this is
// the case when computing cost only. If jacobians[i] is nullptr, then
// the jacobian block corresponding to the i'th parameter block must
// not to be returned.
//

View File

@@ -94,10 +94,11 @@
#include "ceres/cost_function.h"
#include "ceres/dynamic_cost_function_to_functor.h"
#include "ceres/internal/export.h"
#include "ceres/internal/fixed_array.h"
#include "ceres/internal/parameter_dims.h"
#include "ceres/internal/port.h"
#include "ceres/types.h"
#include "glog/logging.h"
namespace ceres {

View File

@@ -35,8 +35,9 @@
#include <utility>
#include <vector>
#include "ceres/internal/config.h"
#include "ceres/internal/disable_warnings.h"
#include "ceres/internal/port.h"
#include "ceres/internal/export.h"
#include "ceres/types.h"
namespace ceres {
@@ -145,7 +146,7 @@ class CovarianceImpl;
// a. The rank deficiency arises from overparameterization. e.g., a
// four dimensional quaternion used to parameterize SO(3), which is
// a three dimensional manifold. In cases like this, the user should
// use an appropriate LocalParameterization. Not only will this lead
// use an appropriate LocalParameterization/Manifold. Not only will this lead
// to better numerical behaviour of the Solver, it will also expose
// the rank deficiency to the Covariance object so that it can
// handle it correctly.

View File

@@ -34,17 +34,17 @@
#include <vector>
#include "ceres/internal/disable_warnings.h"
#include "ceres/internal/port.h"
#include "ceres/internal/export.h"
namespace ceres {
// A compressed row sparse matrix used primarily for communicating the
// Jacobian matrix to the user.
struct CERES_EXPORT CRSMatrix {
CRSMatrix() : num_rows(0), num_cols(0) {}
CRSMatrix() = default;
int num_rows;
int num_cols;
int num_rows{0};
int num_cols{0};
// A compressed row matrix stores its contents in three arrays,
// rows, cols and values.

Some files were not shown because too many files have changed in this diff Show More