105776 Commits

Author SHA1 Message Date
Dalai Felinto
ee51e73355 "File > External Data" menu improvements and cleanup
All changes:
* Include `file.pack_libraries` and `file.unpack_libraries` to the menu
[1].
* Rename "Pack Blender Libraries" → "Pack Linked Libraries" [2].
* Rename "Unpack Blender Libraries" → "Unpack Linked Libraries" [2].
* Rename "Pack All Into .blend" → "Pack Resources" [3]
* Rename "Unpack All Into Files" → "Unpack Resources" [3]
* Rename "☑ Automatically Pack Into .blend" → "☑  Automatically Pack
Resources" [3]
* Rename "Make All Paths Relative" → "Make Paths Relative" [4]
* Rename "Make All Paths Absolute" → "Make Paths Absolute" [4]
* Add separators accordingly

---

[1] - This was never exposed since its original commit rB16411da41e40.
Now that operator not listed in menus don't
show up in the search, this became even more hidden.

[2] - The original name (Pack Blender Library) was not clear enough.
Pose Libraries and Asset Libraries are also technically Blender
libraries.

[3] - The term All was misleading since it didn't include the Linked
Libraries.

[4] - No need to use "All". It is not used in the Report/Find Missing
Files either.

This commit put this in the File > External Data menu.

Differential Revision: https://developer.blender.org/D11109
2021-05-04 16:20:56 +02:00
Sebastian Parborg
57b94cf34b Merge branch 'blender-v2.93-release' 2021-05-04 15:20:33 +02:00
Sebastian Parborg
d0b3f9c81b Fix T87489: Text Data-Blocks get deleted on Recursive Purge
Text data block were not considered special in the recursive purge
function.  So they would get deleted if they had no actual users.

To fix this we instead make text data block use "fake user" so that
addon authors can specify script files that should be removed if nothing
is using it anymore.

Per default, new text object have "fake user" set. So functionality
wise, the user has to explicitly specify that they want the text object
to be purge-able.

Reviewed By: Bastien

Differential Revision: http://developer.blender.org/D10983
2021-05-04 15:11:20 +02:00
Sebastian Parborg
756c9b2219 Fix T87489: Text Data-Blocks get deleted on Recursive Purge
Text data block were not considered special in the recursive purge
function.  So they would get deleted if they had no actual users.

To fix this we instead make text data block use "fake user" so that
addon authors can specify script files that should be removed if nothing
is using it anymore.

Per default, new text object have "fake user" set. So functionality
wise, the user has to explicitly specify that they want the text object
to be purge-able.

Reviewed By: Bastien

Differential Revision: http://developer.blender.org/D10983
2021-05-04 14:47:35 +02:00
Jacques Lucke
4599cea15d Geometry Nodes: refactor instances component
The main goal of this refactor is to not store Object/Collection
pointers for every individual instance. Instead instances now
store a handle for the referenced data. The actual Object/Collection
pointers are stored in a new `InstanceReference` class.

This refactor also allows for some better optimizations further down
the line, because one does not have to search through all instances
anymore to find what data is instanced.

Furthermore, this refactor makes it easier to support instancing
`GeometrySet` or any other data that has to be owned by the
`InstancesComponent`.

Differential Revision: https://developer.blender.org/D11125
2021-05-04 10:16:24 +02:00
Germano Cavalcante
e6bf272abd Merge branch 'blender-v2.93-release' 2021-05-03 20:07:03 -03:00
Germano Cavalcante
b874c152a8 Fix (unreported): 'CoInitializeEx' being called without 'CoUninitialize'
Problem introduced in {rB1f223b9a}.

This was possibly causing random crashes in Blender file browser when
compiled with ASAN.

Microsoft documents indicate that any call to `CoInitializeEx` must be
balanced by a corresponding call to `CoUninitialize`.

https://docs.microsoft.com/en-us/windows/win32/api/combaseapi/nf-combaseapi-coinitializeex#remarks
2021-05-03 19:58:13 -03:00
Brecht Van Lommel
874c70d088 Fix errors in Cycles comments 2021-05-03 22:45:58 +02:00
Brecht Van Lommel
7149ccee57 Fix T85287: Cycles deadlock loading Blender images in some cases 2021-05-03 22:10:26 +02:00
Brecht Van Lommel
472765d44d Fix T88001: persistent data render wrong when changing camera border 2021-05-03 22:10:26 +02:00
Brecht Van Lommel
8ce11c8b66 Fix T87982: crash switching render slots while render is in progress 2021-05-03 22:10:26 +02:00
Stefan Werner
042df5fd6a Cycles standalone: Fixed macOS dependencies.
Added IOKit and Accerelate as linked frameworks where necessary.
2021-05-03 22:07:09 +02:00
Hans Goudey
8216b759e9 Geometry Nodes: Initial basic curve data support
This patch adds initial curve support to geometry nodes. Currently
there is only one node available, the "Curve to Mesh" node, T87428.

However, the aim of the changes here is larger than just supporting
curve data in nodes-- it also uses the opportunity to add better spline
data structures, intended to replace the existing curve evaluation code.
The curve code in Blender is quite old, and it's generally regarded as
some of the messiest, hardest-to-understand code as well. The classes
in `BKE_spline.hh` aim to be faster, more extensible, and much more
easily understandable. Further explanation can be found in comments in
that file.

Initial builtin spline attributes are supported-- reading and writing
from the `cyclic` and `resolution` attributes works with any of the
attribute nodes. Also, only Z-up normal calculation is implemented
at the moment, and tilts do not apply yet.

**Limitations**
 - For now, you must bring curves into the node tree with an "Object
   Info" node. Changes to the curve modifier stack will come later.
 - Converting to a mesh is necessary to visualize the curve data.

Further progress can be tracked in: T87245
Higher level design document: https://wiki.blender.org/wiki/Modules/Physics_Nodes/Projects/EverythingNodes/CurveNodes

Differential Revision: https://developer.blender.org/D11091
2021-05-03 12:29:17 -05:00
Antonio Vazquez
c9d81678d7 Merge branch 'blender-v2.93-release' 2021-05-03 17:10:54 +02:00
Antonio Vazquez
55bf704427 Fix T88005: GPencil inverse fill leaves unwanted line at viewport edge.
There was a function to set 2 pixels wide for inverse filling, but this must not be done in the borders of the image.

Now, the borders are checked before set 2 pixels.
2021-05-03 17:10:29 +02:00
Philipp Oeser
73a76608c8 Merge branch 'blender-v2.93-release' 2021-05-03 16:57:34 +02:00
Philipp Oeser
29e5504331 Fix T87926: Transform menu has operators guaranteed to not pass poll in certain modes
Reported for ops.transform.vertex_warp and ops.transform.vertex_random.
Polling will check with ED_transverts_check_obedit, if we know it will
fail e.g. for pose mode, we can do the same check in the UI already.

Maniphest Tasks: T87926

Differential Revision: https://developer.blender.org/D11128
2021-05-03 16:49:08 +02:00
Campbell Barton
888a697e24 Cleanup: spelling 2021-05-04 00:44:53 +10:00
Campbell Barton
12d8720b9b WM: disable idle event handling timer when simulating events 2021-05-04 00:39:49 +10:00
Sergey Sharybin
0ac6852a42 Movieclip: Use first clip frame for size detection
Using scene frame 1 is not reliable in cases when there is a
frame offset is involved. Using frame 1 seems more reliable,
although might still fail under certain circumstances.

More reliable fix would require a deeper change in the data
structure and the logic about frame loading and size detection.
2021-05-03 16:30:19 +02:00
Sergey Sharybin
2f615ad3a9 Fix wrong tracking curves after changing clip offset
The issue was caused by frame start/offset change triggering clip
reload, which was happening with a hardcoded scene frame index of 1,
which could be outside of the actual clip frames.

Solved by removing source change tag from the frame start/offset
update. The source doesn't really change: the resolution will stay
the same, as well as media type, its duration. So the tag was not
needed.
2021-05-03 16:30:19 +02:00
Kévin Dietrich
9f1e20e74f Alembic Procedural: precompute vertex normals
This precomputes vertex normals in the procedural and caches them in case none
are found in the archive. This only applies to polygon meshes, as subdivision
meshes are yet to be subdivided, so it is useless to do this computation.

The goal here is to speed up data updates between frames, as computing normals
shows up in profiles even for large objects. This saves around 16% of update time
for a production file.
2021-05-03 16:20:06 +02:00
Kévin Dietrich
e2c671e34c Alembic Procedural: refactor data reading
This splits the data reading logic from the AlembicObject class and moves it to
separate files to better enforce a separation of concern. The goal was to simplify
and improve the logic to read data from an Alembic archive.

Since the procedural loads data for the entire animation, this requires looping
over the frame range and looking up data for each frame. Previously those loops
would be duplicated over the entire code causing divergences in how we might
skip or deduplicate data across frames (if only some data change over time and
not other on the same object, e.g. vertices and triangles might not have the
same animation times), and therefore, bugs.

Now, we only use a single function with callback to loop over the geometry data
for each requested frame, and another one to loop over attributes. Given how
attributes are accessed it is a bit tricky to simplify further and only use a
ingle function, however, this is left as a further improvement as it is not
impossible.

To read the data, we now use a set of structures to hold which data to read.
Those structures might seem redundant with the Alembic schemas as they are
somewhat a copy of the schemas' structures, however they will allow us in the
long run to treat the data of one object type as the data of another object
type (e.g. to ignore subdivision, or only loading the vertices as point clouds).

For attributes, this new system allows us to read arbitrary attributes, although
with some limitations still:
* only subdivision and polygon meshes are supported due to lack of examples for
  curve data;
* some data types might be missing: we support float, float2, float3, booleans,
  normals, uvs, rgb, and rbga at the moment, other types can be trivially added
* some attribute scopes (or domains) are not handled, again, due to lack of example
  files
* color types are always interpreted as vertex colors
2021-05-03 16:19:50 +02:00
Campbell Barton
3e4863376e Cleanup: use boolean for has_event variable & return value 2021-05-04 00:17:45 +10:00
Philipp Oeser
efe9928545 Merge branch 'blender-v2.93-release' 2021-05-03 15:56:28 +02:00
Philipp Oeser
04905c5652 Fix T87969: crash accesing FaceMaps / PaintMask data in editmode
Workaround for crash when accessing FaceMaps / PaintMask data in
editmode, just disallow access in editmode as is done with UVs.

Same fix as in {rB3e2619b3e72a}.

Maniphest Tasks: T87969

Differential Revision: https://developer.blender.org/D11146
2021-05-03 15:50:02 +02:00
Sergey Sharybin
2e9dc2b999 Merge branch 'blender-v2.93-release' 2021-05-03 15:40:58 +02:00
Sergey Sharybin
04b90ee18a Fix compilation error after recent compositor fix
Apparently, there is no emplace semantic available in the Vector in
the stable branch.
2021-05-03 15:37:41 +02:00
Sergey Sharybin
2b78d3d7f3 Merge branch 'blender-v2.93-release' 2021-05-03 15:11:23 +02:00
Sergey Sharybin
1b4f0bf32a Fix T87989: Crash using OpenCL in compositor
Initial report was mentioning the Classroom demo scene, but this is
probably because the scene was pre-configured to be used with OpenCL.
Would expect any OpenCL compositing to be failing prior to this fix.

The reason why crash was happening is due to OpenCL queue being
released from OpenCLDevice destructor. Is not that obvious, but
when Vector (including std::vector) is holding elements by value
a destructor will be called on "old" memory when vector capacitance
changes.

Solved by making forbidding copy semantic for compositor devices and
forcing move semantic to be used.

Also use emplace semantic in the devices vector initialization.
2021-05-03 15:07:14 +02:00
Hans Goudey
1d7ee50fef Geometry Nodes: Parallelize attribute nodes
This commit significantly speeds up many of the attribute nodes when
multiple threads are available in linear situations when parallelism
cannot be achieved elsewhere.

See the differential for a table of timing comparisons tested on a
Ryzen 3700x. For an attribute with 4 million elements, the nodes were
about 3 to 9 times faster.

The changes are not exhaustive, other nodes could still be parallelized
in the future. Also, it would be possible to further optimize the grain
size in `parallel_for`, but I'd rather make sure it isn't too small.
I tested some different values, but also relied on intuition--
increasing grain size for less complex operations and vice versa.

Differential Revision: https://developer.blender.org/D11139
2021-05-03 08:00:09 -05:00
Alexander Gavrilov
2b46606af1 Merge branch 'blender-v2.93-release' 2021-05-03 14:03:00 +03:00
Alexander Gavrilov
6899dbef77 LibOverride: temporarily fix the material driver workaround with a hack.
Currently overriding properties within material node trees is not
supported. However there is a workaround that allows feeding values
through drivers via an intermediate custom property, as described
in T82404. The workaround relies on the behavior of the ID copying
code that always patches datablock self-references even without any
overrides.

Unfortunately, this broke during development of 2.93. This happened
because a call RNA_struct_override_matches added in rB2281db72b0157
detects that no override exists, and 'restores' the self-reference
to point to the original datablock.

To avoid this, mark the Material.node_tree property with the
PROPOVERRIDE_IGNORE flag to stop RNA_struct_override_matches
from recursing into the currently unsupported node tree sub-block.
This flag should be removed when this is properly supported.

This was confirmed to fix the workaround and discussed with @mont29.
2021-05-03 14:02:13 +03:00
Bastien Montagne
a53d34a28a Minor updates to i18n spellcheck tool. 2021-05-03 12:22:46 +02:00
Jacques Lucke
ee8593fe76 Cleanup: clang-tidy 2021-05-03 10:23:15 +02:00
Jacques Lucke
da9b1b9636 Cleanup: clang-tidy 2021-05-03 10:22:12 +02:00
Kévin Dietrich
8884385afb Cleanup: format 2021-05-03 04:42:39 +02:00
Kévin Dietrich
3bc44233c0 Cycles: use reference count to detect used shaders
Shaders are only compiled if they are used by some other Node (Geometry, Light, etc.).
This usage detection is done before updating the Scene, however it fails at detecting
Shaders used by Procedurals not known to Cycles (e.g. ones defined by third party
applications), as Procedurals are only updated after the shaders are compiled.

To remedy this, we now use the Node reference counting mechanism to detect whether a
Shader is used and therefore should be compiled.

This removes `ShaderManager::update_shaders_used` as it is not needed anymore, however,
since it would also update the Shader ids, this is now performed in
`ShaderManager::device_update`, and a new virtual `device_update_specific` method was
added to handle device updates for SVM and OSL.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D10965
2021-05-03 01:21:12 +02:00
Kévin Dietrich
5a964664d6 Cycles: add reference counting to Nodes
This adds a reference count to Nodes which is incremented or decremented
whenever they are added to or removed from a socket, which will help us
track used Nodes throughout the scene graph generically without having to
add an explicit count or flag on specific Node types. This is especially
useful to track Nodes defined through Procedurals out of Cycles' control.

This also modifies the order in which nodes are deleted to ensure that
upon deletion, a Node does not attempt to decrement the reference
count of another Node which was already freed or deleted.

This is not currently used, but will be in the next commit.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D10965
2021-05-03 01:20:33 +02:00
Howard Trickey
5ffab01930 Merge branch 'blender-v2.93-release' 2021-05-02 16:40:40 -04:00
Howard Trickey
28bf1d4037 Fix T87554 Exact Boolean performance bug.
There was a quadratic algorithm extracting triangles from a coplanar
cluster. This is now linear.
Also found and fixed a bug in the same area related to the triangulator
added recently: it didn't get the right correspondence between new
edges and original edges.
2021-05-02 16:37:05 -04:00
Antonio Vazquez
d8fdb06a81 Merge branch 'blender-v2.93-release' 2021-05-02 15:56:38 +02:00
Antonio Vazquez
52e977d518 GPencil: Fix unreported problem when save file in Curve Edit mode
This is related to T87905
2021-05-02 15:51:46 +02:00
Robert Guetzkow
6b6ae92436 Merge branch 'blender-v2.93-release' 2021-05-02 11:20:27 +02:00
Robert Guetzkow
018cca94b8 Fix T82824: Draw sensor size with correct alpha
Previously the option in the camera's //Object Data Properties > Viewport Display
 > Sensor// would not display the sensor in camera view. This seemed to be caused
by the theme color `TH_VIEW_OVERLAY` having zero set for the alpha channel and
alpha blending being active, resulting in no visible output. Hence
`immUniformThemeColorShade(TH_VIEW_OVERLAY, 100);` is replaced with
`immUniformThemeColorShadeAlpha(TH_VIEW_OVERLAY, 100, 255);`.

Reviewed By: mano-wii

Differential Revision: https://developer.blender.org/D11075
2021-05-02 11:13:15 +02:00
Harley Acheson
ecc7a83798 UI: Object Thumbnails Orientation Change
Object orientation for thumbnail creation changed to be slightly
oblique (tilted to one side and from above) to better show shape,
especially when axis-aligned. Camera lens changed to 85 to avoid
distortion of close objects like human heads.

see D9940 for details and examples.

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

Reviewed by Julian Eisel
2021-05-01 09:15:03 -07:00
Antonio Vazquez
06af6a9efa Merge branch 'blender-v2.93-release' 2021-05-01 17:23:39 +02:00
Antonio Vazquez
7c5e009655 Fix T87905: GPencil modifiers not applied if saved with multiframe
When saving a file in Edit mode with Multiframe enabled, the render did not include the modifiers.

Now the multiframe is not enabled if it's doing a render.
2021-05-01 17:22:00 +02:00
Germano Cavalcante
6fff2427d6 Python GPU: Replace a few calls of the bgl module with gpu
Concludes these files:
[x]bpy_types.py
[x]operator_modal_draw.py

Reviewed By: fclem

Differential Revision: https://developer.blender.org/D11129
2021-05-01 12:12:58 -03:00
Tomasz Kaye
6111ec8bd3 GPencil: Auto lock layers, tooltip grammar fix
Reviewed By: #grease_pencil, antoniov

Differential Revision: https://developer.blender.org/D11136
2021-05-01 16:41:14 +02:00