1
1

Compare commits

...

7101 Commits

Author SHA1 Message Date
85ca4e33a6 disable other link highlights 2021-08-24 14:47:09 +02:00
3aee13b349 cleanup 2021-08-24 13:41:16 +02:00
ec5160ee94 change link colors slightly 2021-08-24 13:38:53 +02:00
7be52f6985 field state inferencing 2021-08-24 13:16:24 +02:00
b4c49e595f initial visualization 2021-08-24 12:53:38 +02:00
ea3ee04fa8 Merge branch 'master' into temp-geometry-nodes-fields-prototype 2021-08-20 12:42:11 +02:00
4838436387 fix extrude node 2021-08-20 12:42:07 +02:00
7d8c71e800 Geometry Nodes: add missing versioning for subdivision surface node
This was missing from rBfecec1644ce54ea386eaeed5ca6748d4a7b2737b.
2021-08-20 12:19:24 +02:00
c1227fd408 Cleanup: remove duplicate line 2021-08-20 12:05:03 +02:00
d217b34214 Functions: add utility methods to parameter builder 2021-08-20 11:48:31 +02:00
fd51b05a02 Functions: add clear method to vector array 2021-08-20 11:48:31 +02:00
2b6f0cc836 BLI: add utility methods to IndexMask 2021-08-20 11:48:31 +02:00
e95b197e98 Cleanup: Add CLOG to wm_files_link.c 2021-08-20 11:27:42 +02:00
cea24b4b4a Cleanup: use "free_data" suffix when the argument isn't freed
Avoid API misuse that caused leaks in T90791 &
2788b0261c.
2021-08-20 16:37:50 +10:00
e05db0c26b Cleanup: rename BKE_mesh_free_data -> BKE_mesh_free_data_for_undo
This function only makes sense for undo which doesn't
initialize the meshes ID. Otherwise BKE_id_free should be used.
2021-08-20 16:21:29 +10:00
40f0783d51 Cleanup: remove BKE_mesh_free_data use for lineart mesh copies
Even though this didn't leak memory, BKE_mesh_free_data doesn't
handle freeing data that is part of the ID making it error prone.
2021-08-20 16:08:35 +10:00
15a46a8b72 Cleanup: accidentally included printf 2021-08-20 16:02:39 +10:00
9e2cd6b077 Fix memory leak with building springs in the cloth simulator
Error in 2788b0261c.
2021-08-20 16:00:12 +10:00
a48df97ada Fix T90791: Knife project leaks memory with curve/text cutter 2021-08-20 15:19:58 +10:00
ce3a6d7989 Cleanup: rename BKE_mesh_free -> BKE_mesh_free_data
It wasn't obvious this didn't free the memory of the mesh it's self
leading to memory leaks.
2021-08-20 15:08:27 +10:00
44b25b0ea5 Cleanup: unused warnings 2021-08-20 15:03:32 +10:00
fca6b2780f Cleanup: clang-format 2021-08-19 19:27:49 -07:00
f8637cd8af Alembic Procedural: only subdivide if subsurf modifier is present
As subdivision objects are first class citizens in Alembic, to
differentiate them with non-subdivided polygon meshes, the Alembic
Procedural automatically sets up subdivision properties on the generated
Cycles Mesh.

However, for real-time playback subdivision is far too slow, so this
modifies the detection of a MeshSeqCache modifier used to activate the
procedural to allow for a Subsurf modifier right after the cache one. If
present, the procedural will tag the object for subdivision, if absent, the
object will be treated as a regular mesh.

This is a temporary measure for until subdivision surface settings are part
of the Mesh datablock (see T68891).

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D11162
2021-08-20 02:40:37 +02:00
5b51df0f33 Cleanup, format 2021-08-20 02:30:11 +02:00
962153dbed Cycles: missing case for ignoring subdivision vertex normals
This was missing from rBb8ecdbcd964a.
2021-08-19 20:36:34 +02:00
c0dd6f1164 Fix T90776: Cycles normal map node produces artifacts
This is caused by a typo in rBb8ecdbcd964a `sd->prim` is the primitive
index, but was used to discriminate the primitive type (stored in `sd-
>type`).
2021-08-19 20:36:34 +02:00
72f73c0b71 UI: Use theme's alpha for Summary instead of a hardcoded value 2021-08-19 20:24:46 +02:00
dbc4f6fdc9 Fix error rendering Cycles shader nodes from before 2013
After the recent changes to use socket identifiers instead of names.
2021-08-19 20:12:50 +02:00
871f7f4ad8 GPencil: Cleanup old printf debug lines
These lines were very old debug code and now it's not required because the code is very tested.
2021-08-19 19:23:13 +02:00
3febcb98ed Image blendwrite: Fix handling of packedfiles.
Packedfiles need some special attention when writing Image to disk.

Source: D12242, Jeroen Bakker (@jbakker), thanks.
2021-08-19 18:00:00 +02:00
0896457c59 Partially fix T90593: Image ID wrongly seen as changed on undos.
Several pure runtime data in this ID type were not properly cleared by
write/read processes.

Note that the initial undo step (the one leading back to initial read
file state) is still forcing re-load of image, for some reasons.

Common investigation together with Jeroen Bakker (@jbakker), thanks. See
also D12242.
2021-08-19 18:00:00 +02:00
214e4aac97 Fix Python error in ./benchmark init after recent changes 2021-08-19 17:45:37 +02:00
479cc9a83e UI: Match row color for Summary in Mask animation editor
The back color of the row was missing.
2021-08-19 17:06:49 +02:00
71655ff8df GPencil: Match row color for Summary in Grease Pencil animation editor
The background of the summary row was different in Grease Pencil mode.

Reviewed by: Pablo Vazquez, Matias Mendiola
2021-08-19 17:06:41 +02:00
7192e57d63 Fix the value in the graphical editor header when transforming
The header did not display the actual value when transforming with snapping
2021-08-19 10:34:13 -03:00
b0d9e6797f Fix T87173: wrong Auto-Snap in animation editors
This was partially broken with {rBde9ea94fc6f}.

The `Frame Step` and `Second Step` snapping options were working as if
they were `Nearest Frame` and `Nearest Second` respectively in the
`Dope Sheet` and `NLA` editors.

In the `Graph Editor` the problem was more serious:
"Second Step: ... The keyframe itself moves along as though in snapping
were active at all, while its handles 'stay behind' until it reaches
the next second boundary, at which point the teleport handles to
'catch up'".

The snapping code for these modes was spread across the transform
mode code and `recalcData` of each data type. Therefore, create a
unified snapping code for these options so that all issues are fixed in
one place.

Differetial Revision: https://developer.blender.org/D12241
2021-08-19 10:34:13 -03:00
119d53263f Transform Convert Action: conventionalize TransData creation
`td2d->loc`, `td2d->loc2d`, `td->loc` and `td->iloc` were not being
initialized as is done with the other conversion types.

This avoids problems with transform modes becoming incompatible.

This avoids problems with incompatible transform modes that could
result in a crash.
2021-08-19 10:34:13 -03:00
Germano Cavalcante
85b044b3ef Fix incremental snap in animation editors
Animation editors have their own snap types and incremental is not
supported.
2021-08-19 10:34:13 -03:00
46aafbbf66 Cleanup: move animation snap utilities to a separate compilation unit
The snap functions of animation editors were scattered in
`transform_mode` and `transform_snap`.
2021-08-19 10:34:13 -03:00
e648e38887 Undo: Clear more ID runtime data on filewrite.
This should help reducing false 'changed' status detection when reading
back a memfile undo step.

Related to T90593 & D12242.
2021-08-19 15:09:33 +02:00
0f49e4832c Cleanup: Blendwrite: Move code deciding if an ID should be written out of ID callbacks.
This was not really useful, and added estra useless steps in case and ID
should not actually be written.

Further more, it prevented clearing the usercount on write, which can be
cause a false positive 'chanhged' detection in undo/redo case.
2021-08-19 15:09:33 +02:00
d5776f4829 LibOverride: Tag all embedded IDs RNA opinters as overridablei, part II.
Not sure how I failed to include those files in rBe5f8db92b696...
2021-08-19 15:09:33 +02:00
51862c8445 Cycles: experimental integration of Alembic procedural in viewport rendering
This patch exposes the Cycles Alembic Procedural through the MeshSequenceCache
modifier in order to use and test it from Blender.

To enable it, one has to switch the render feature set to experimental and
activate the Procedural in the modifier. An Alembic Procedural is then
created for each CacheFile from Blender set to use the Procedural, and each
Blender object having a MeshSequenceCache modifier is added to list of objects
of the right procedural.

The procedural's parameters derive from the CacheFile's properties which are
already exposed in the UI through the modifier, although more Cycles specific
options might be added in the future.

As there is currently no cache controls and since we load all the data at the
beginning of the render session, the procedural is only available during
viewport renders at the moment. When an Alembic procedural is rendered, data
from the archive are not read on the Blender side.

If a Cycles render is not active and the CacheFile is set to use the Cycles Procedural,
bounding boxes are used to display the objects in the scene as a signal that the
objects are not processed by Blender anymore. This is standard in other DCCs.
However this does not reduce the memory usage from Blender as the Alembic data
was already loaded either during an import or during a .blend file read.

This is mostly a hack to test the Cycles Alembic procedural until we have a
better Blender side mechanism for letting renderers load their own geometry,
which will be based on import and export settings on Collections (T68933).

Ref T79174, D3089

Reviewed By: brecht, sybren

Maniphest Tasks: T79174

Differential Revision: https://developer.blender.org/D10197
2021-08-19 14:40:51 +02:00
5b97c00e9f Alembic import: option to always add a cache reader
The current behavior of the Alembic importer is to only create a
`MeshSequenceCache` modifier or a `Transform Cache` constraint to imported
objects if they have some animated properties.

Since static objects do not have a cache reader, when reloading files those
objects are not updated. Currently, the only way to properly reload a file
because of this is to reimport it.

This adds an option to the importer to always add a cache reader, even if
there is no animated data, to ensure that all objects coming from Alembic
archive are linked to them and updated properly upon reloads.

Reviewed by: brecht, sybren

Ref D10197.
2021-08-19 14:29:42 +02:00
4db4123409 Correct assert from 22ab0159a9 2021-08-19 17:56:25 +10:00
cf72194214 Fix T71137: curve minimum twist producing wrong geometry
Originally D11886 by @ghaspias with minor edits applied.
2021-08-19 17:10:34 +10:00
22ab0159a9 Refactor: BLF Without Kerning Modes
Simplification of BLF code after removal of kerning modes.

See D12262 for more details.

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

Reviewed by Campbell Barton
2021-08-18 20:31:47 -07:00
4734de1093 Cleanup: correction to unused warning removal
This broke building without opensubdiv
2021-08-19 13:18:51 +10:00
594790d8a5 UI: add function to access the buttons text without it's shortcut 2021-08-19 12:50:50 +10:00
7a4ef5256a Cleanup: reduce indentation in loops that check region visibility 2021-08-19 12:50:50 +10:00
feaa61a968 UI: Remove "Unfitted" Kerning Style Option
This patch removes the "Kerning Style" option for UI widget font
drawing and uses only the current default of "Fitted", since the other
option of "Unfitted" is just the result of truncation errors.

see D12231 for much more information.

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

Reviewed by Campbell Barton
2021-08-18 19:48:30 -07:00
ac09411368 Cleanup: unused warning 2021-08-19 12:15:15 +10:00
a217e043be Audaspace: porting PulseAudio fixes from upstream. 2021-08-18 22:22:21 +02:00
55f9014616 Alembic procedural: remove Generated attribute creation
The main reason for this is to speed up updates by avoid unnecessary
copies as the Generated coordinates are a copy of the vertices.

Creating this attribute may become optional in the future, with UI
parameters to select which attribute to use from the Alembic archive as
reference.
2021-08-18 21:27:52 +02:00
6b041ad3d0 Cycles: use object coordinates when generated coordinates are missing
This modifies the attribute lookup to use object coordinates if no
generated coordinates are found on the geometry.

This is useful to avoid creating and copying this attribute, thus saving
a bit of time and memory.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D12238
2021-08-18 21:20:39 +02:00
b8ecdbcd96 Cycles: avoid copying vertex normals attribute twice to the devices
Vertex normals are needed for normals maps and therefore are packed and send
to the device alongside the other float3 attributes. However, we already pack
and send vertex normals through `DeviceScene.tri_vnormal`.

This removes the packing of vertex normals from the attributes buffer, and
reuses `tri_vnormal` in the kernel for normals lookup for normal maps, which
reduces memory usage a bit, and speeds up device updates.

This also fixes potential missing normals updates following rB12a06292af86,
since the need for vertex normals for normals maps was overlooked.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D12237
2021-08-18 21:12:39 +02:00
e5f8db92b6 LibOverride: Tag all embedded IDs RNA opinters as overridable.
Followup to previous commit, rBfffe219bdb8drBfffe219bdb8d

Again this is only for sake of sane ID/overrides managment for now,
the nodetrees themselves are not overridable from user PoV yet.
2021-08-18 17:05:49 +02:00
fffe219bdb LibOverride: Make nodetree of material overrideable again.
This reverts rB6899dbef77cd and makes the pointer explicitely
processable by override & diffing code.

Previous changes & fixes have fixed the 'driver-workaround' case afaict.

Note that this only enables proper generic handling of overrides and
their ID pointers, no node property is actually overridable currently.
2021-08-18 16:49:20 +02:00
1d06d35034 LibOverride: Do not report embedded IDs as non-overridable in 'foreach_id' code.
Embedded IDs (root nodetrees, master collection, etc.) pointer itself is
not editable, but their content may be overridden.

LibOverride code is supposed to know how to handle those embedded IDs.
2021-08-18 16:49:20 +02:00
ba71eb467e LibOverride: Add several missing 'OVERRIDABLE' flags to NodeTrees RNA.
This should be a no-change commit for now, but is required to enable
initial basic support of nodetrees in library override.

NOTE: Proper full support of liboverrides in nodes is yet to be designed
(has UX unresolved issues, since we likely do not want to expose/make
overridable ALL settings of ALL nodes).
2021-08-18 16:49:20 +02:00
9bfd4ae222 LibOverride: tweak resync detection code at apply phase.
This code checks whether an ID pointer property of an override does not
match its linked reference when it is expected to do so.

This is a goiod indication that a resync is needed.

Previous code would falsy detect overrides of IDs referencing themselves
as needing a resync, when this is not effectively the case.
2021-08-18 16:49:20 +02:00
Charlie Jolly
04376c3bac Geometry Nodes: Add shader Color Mix node
Port color mix shader node to Geometry Nodes.

Differential Revision: https://developer.blender.org/D10585
2021-08-18 14:50:52 +01:00
62d485e470 initial evaluate curve node 2021-08-18 14:53:34 +02:00
cd6eb65482 cleanup 2021-08-18 14:44:16 +02:00
787350dde8 Fix T90737: VSE adding nested strips could have non-unique names
Caused by {rBbbb1936411a5}.

When adding strips via the new SEQ_add_XXX_strip functions, the
`Editing->seqbasep` pointer was passed around.
Following in `seq_add_generic_update` this `seqbasep` pointer was used
to ensure a unique name.
But `seqbasep` is the pointer to the current list of seq's being edited
(**which can be limited to the ones within a meta strip**).

We need unique names across all strips though (since these are used for
RNA paths, FCurves as reported), so now use the scene's `Editing-
>seqbase` (**which is the list of the top-most sequences**) instead.

Unfortunately this might have screwed files to a borked state, not sure
if this could easily be fixed...

Maniphest Tasks: T90737

Differential Revision: https://developer.blender.org/D12256
2021-08-18 14:43:16 +02:00
7bffafab7b Fix T90718: Object selection toggle do not work inside edit mode
The object was not deselected as it was expected that it would be
activated.

But this activation does not happen in edit mode.
2021-08-18 09:39:45 -03:00
d337c20cf9 fix use after free in socket inspection
For now I just evaluate constant fields immediately. The issue was that
parts of the fields was freed already when socket inspection runs.
2021-08-18 13:31:41 +02:00
a715aec6a3 initial sample mesh surface
This is a field based alternative for the attribute transfer node.
The main goal here is to experiment with how attribute transfer
should be done with fields.
2021-08-18 12:53:23 +02:00
eba32b5f4a cleanup 2021-08-18 10:29:40 +02:00
1d859c9183 fix after merge 2021-08-18 10:20:59 +02:00
a3d02965da fix after merge 2021-08-18 10:17:28 +02:00
45e58a7e92 Merge branch 'master' into temp-geometry-nodes-fields-prototype 2021-08-18 10:17:15 +02:00
Jeroen Bakker
c0f600cad1 T73434: Improve Weight Paint Overlay Drawing.
Master multiplied the weight paint on top of the rendered image. This
reduced readability.

This patch removes the multiplication for weight painting and adds a
hint of the geometry below the overlay.

Reviewed By: Mets, pablodp606, campbellbarton

Maniphest Tasks: T73434

Differential Revision: https://developer.blender.org/D12170
2021-08-18 07:32:23 +02:00
400cb25fc7 UDIM: Support tile sets that do not start at 1001
Removes the artificial requirement that UDIM tile sets start at 1001.
Blender was already capable of handling sparse tile sets (non-contiguous
tiles) so the restriction around starting at 1001 was unnecessary in
general.

This required fixing a few UDIM-related python bugs around manually
updating the `tile_number` field on images as well. See the differential
for details. No script changes are necessary but they will now work,
correctly, in many more cases.

Differential Revision: https://developer.blender.org/D11859
2021-08-17 21:44:36 -07:00
f41beca977 Fix T90695: Lower tile splitting limit for lineart
Lowers tile splitting limit so models with extremely dense mesh
portions could still have reasonable performance while for more
common cases the performance impact should be minimal.

Reviewed By: Sebastian Parborg (zeddb), Antonio Vazquez (antoniov)

Differential Revision: https://developer.blender.org/D12236
2021-08-18 12:02:53 +08:00
24c16f5457 Fix wireframe overlay not blending over paint overlay correctly
When using wireframe opacity, the paint overlay needs to be drawn
before the wireframes in order to alpha blend correctly.
Sculpt overlays were also affected by this, so this commit refactors
this part of the code in case other overlays needs to be added in
the future.

Reviewed By: Mets

Differential Revision: https://developer.blender.org/D12235
2021-08-17 23:54:45 +02:00
809dce5bde Cleanup: move 'recalcData' to 'transform_convert.h'
The `recalcData` function is defined in `transform_convert.c`, so the
header is most expected to be `transform_convert.h`.
2021-08-17 17:23:57 -03:00
Henrik Dick
e3098de2a1 GPencil: Fix unreported switch direction not flipping weights
There was an unreported bug that switch direction would not switch the order of the vertex group weights. This caused join to do it wrong as well.

Changed to use `BLI_array_reverse` function here to reverse both the normal points and the weights, therefore simplifying the code.

Differential Revision: https://developer.blender.org/D12251
2021-08-17 22:20:26 +02:00
23132fcdc1 Fix T77307: Particle Info Node Does Not Consider Time Remapping
`frame_current_final()` should be used to access the Scene time after
remapping, which also matches how the particles system handles time.

Reviewed By: brecht

Maniphest Tasks: T77307

Differential Revision: https://developer.blender.org/D12239
2021-08-17 21:41:18 +02:00
60d6333b80 Fix T82336: Cycles standard attributes missing in displacement shaders
Standard attributes are not added to the attributes requests when
shaders only have displacement. This is because nodes are only
considering the case when the surface socket is connected.

To support this, added `Shader.has_surface_link()` which checks for both
cases (`has_surface` and `has_displacement`) and replaces all checks on
`Shader.has_surface`.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D12240
2021-08-17 21:38:04 +02:00
Henrik Dick
88dc274d05 GPencil: Convert from Mesh copying Vertex Groups
This patch adds the missing ability to keep the vertex groups when converting to a grease pencil object. This is increadible useful to create rigged grease pencil objects which move together with rigged meshes.

Differential Revision: https://developer.blender.org/D12249
2021-08-17 20:20:47 +02:00
96d0cd57dc Fix T90719: Boost sources dowload address needed to be updated. 2021-08-17 18:01:42 +02:00
e98824d6c4 CMake: add missing headers 2021-08-18 00:37:04 +10:00
7f38872533 RNA: de-duplicate enums in generated source
Reuse existing enums instead of expanding them since it bloats the binary.

The icons enum for example contains over 900 items and was being
expanded 17 times (once for each function that takes an icon argument).
Similar with the event type enum which contains over 200 items and was
duplicated 7 times.

makesrna.c now matches enum definitions from declarations in
RNA_enum_items.h, using their identifiers when found.

The overall space saving on my system is 776kb
(tested with a stripped release build).

Reviewed By: brecht

Ref D12245
2021-08-18 00:23:50 +10:00
0246128b7f Fix wrong Anim Auto-Snap Ctrl toggle
This was not working like elsewhere in both NLA and Graph Editor
(meaning that when snapping was already enabled, {key Ctrl} during
transform did not disable it).

Now use getAnimEdit_SnapMode() for this in NLA and GE as well.

Maniphest Tasks: T87173

Differential Revision: https://developer.blender.org/D12244
2021-08-17 15:52:28 +02:00
f8dd0080a9 Cleanup: clang tidy
The parameter name was inconsistent between declaratation
and implementation.
2021-08-17 11:12:59 +02:00
6028ac44a1 Cleanup: unused defines 2021-08-17 17:45:57 +10:00
7304541f66 Edit Mesh: skip unselected meshes for "Tris to Quads"
Also move property assignment out of the object loop.
2021-08-17 17:12:36 +10:00
32844d32c1 Edit Mesh: skip unselected meshes for "Set Normals from Faces" 2021-08-17 17:12:24 +10:00
4443831c6b Edit Mesh: skip normals to vector with unselected meshes for "Delete"
Meshes with unselected elements are skipped but still called
BM_custom_loop_normals_to_vector_layer.
2021-08-17 17:11:49 +10:00
6baa62245f Edit Mesh: skip flipping custom normals for meshes with no selection
Also split out normal calculation into functions.
2021-08-17 17:10:59 +10:00
cb40c7ca1f Fix memory leak in edit-mesh dissolve degenerate 2021-08-17 16:46:52 +10:00
4c8d68c032 Cleanup: replace degenerate check with assert
Use an assert since this should never happen.
2021-08-17 15:16:34 +10:00
736b6a70a4 Docs: improve word wrap comment 2021-08-17 15:11:54 +10:00
nutti
69fdcea978 Docs: add API docs for gpu.capabilities
Adds Python API documentations for gpu.capabilities module.

Ref D12226
2021-08-17 15:04:35 +10:00
ba055493a0 Cleanup: clang-format 2021-08-17 14:46:46 +10:00
nutti
d60e28093f Docs: add API docs for gpu.platform
Adds Python API documentations for gpu.platform module.

Ref D12222
2021-08-17 14:45:40 +10:00
869b84452a Cleanup: compiler warnings 2021-08-17 14:42:12 +10:00
eaa1527385 UDIM: Fix tile number calculation when adding a range of image tiles
When adding a range of tiles, the operator could incorrectly calculate
the end_tile. It would not account for the start_tile itself and the
IMA_UDIM_MAX value was 1 too small. This is most noticeable when
attempting to fill the entire supported range of tiles.

Differential Revision: https://developer.blender.org/D11857
2021-08-16 21:19:39 -07:00
4dba206011 PyAPI: GPUShader: make 'uniform_vector_*' less restricted
Buffers larger than required may be allowed without restriction.
2021-08-16 13:57:25 -03:00
b5117660da PyAPI: GPU Buffer: Buffer protocol support
The code was commented due to lack of testing and short release deadline.
2021-08-16 13:57:25 -03:00
035d4c28ab Add sanity NULL checks when loading sound sequences
Would cause crashes in files that had lingering invalid sound sequences around.
For example our tests/render/volume/fire.blend test file.
2021-08-16 16:52:38 +02:00
df3884d512 Fix T90689, T90705: Cycles math node with 3 inputs broken after recent changes
Thanks Charlie Jolly for finding the fix.
2021-08-16 15:54:18 +02:00
7db3746033 Cleanup: spelling 2021-08-16 23:46:28 +10:00
394a0b0da5 Fix building without audaspace 2021-08-16 23:19:54 +10:00
118946d195 Fix T87967: M2T video seeking is broken
Bug caused by integer overflow in ffmpeg_generic_seek_workaround().
Function max_ii() was used to limit int_64tvalue.

After fixing the issue there was another issue, where near-infinite loop
was caused by requested_pos being very large and stream being cut in a
way, that it was missing keyframe at beginning.
This was fixed by checking if we are reading beyond file content.

Reviewed By: zeddb

Differential Revision: https://developer.blender.org/D11888
2021-08-16 15:12:19 +02:00
2946f72a2a VSE: Use lines to draw waveform
Refactor and improve waveform drawing.

Drawing now can use line strips to draw waveforms instead of only
triangle strips. This makes us able to properly visualize thin waveforms
as they would not be visible before. We now also draw the RMS value of
the waveform.

The waveform drawing is now also properly aligned to the screen pixels
to avoid flickering when transforming the strip.

Reviewed By: Richard Antalik

Differential Revision: https://developer.blender.org/D11184
2021-08-16 15:12:19 +02:00
ded68fb102 VSE: Fix audaspace not reading ffmpeg files with start offset correctly
The duration and start time for audio strips were not correctly read in
audaspace.

Some video files have a "lead in" section of audio that plays before the
video starts playing back. Before this patch, we would play this lead in
audio at the same time as the video started and thus the audio would not
be in sync anymore.

Now the lead in audio is cut off and the duration should be correctly
calculated with this in mind.

If the audio starts after the video, the audio strip is shifted to
account for this, but it will also lead to cut off audio which might not
be wanted. However we don't have a simple way to solve this at this
point.

Differential Revision: http://developer.blender.org/D11917
2021-08-16 15:10:58 +02:00
6df81ddb84 VSE: Fix seeking issues.
The seek pts was not correctly calculated.
In addition to that we were not seeking in the video pts time base.

Reviewed By: Richard Antalik

Differential Revision: http://developer.blender.org/D11921
2021-08-16 14:52:57 +02:00
a01cf90fd8 VSE: Fix video strip duration calculation
The video duration was not read correctly from the video file.

It would use the global duration of the file which does in some cases
not line up with the actual duration of the video stream.
Now we take the video stream duration and start time into account when
calculating the strip duration.

Reviewed By: Richard Antalik

Differential Revision: http://developer.blender.org/D11920
2021-08-16 14:52:57 +02:00
43ad345caa VSE: Fix memory leak when adding bad image/movie strips
If the add strip operator errored out, we wouldn't free custom data allocated

Reviewed By: Richard Antalik

Differential Revision: http://developer.blender.org/D11919
2021-08-16 14:52:57 +02:00
e314260fa7 VSE: Fix "off by one" error when encoding audio
Before we didn't encode the audio up until the current frame.
This lead to us not encoding the last video frame of audio.

Reviewed By: Richard Antalik

Differential Revision: http://developer.blender.org/D11918
2021-08-16 14:52:57 +02:00
08af3e6e92 VSE: Flush audio encode after finishing video export
We didn't flush audio after encoding finished which lead to audio
packets being lost.

In addition to this the audio timestamps were wrong because we
incremented the current audio time before using it.

Reviewed By: Richard Antalik

Differential Revision: http://developer.blender.org/D11916
2021-08-16 14:52:56 +02:00
Eitan
fecec1644c Geometry Nodes: Add UV Smooth, Boundary Smooth options to subdivision node
Replaces the boolean option with enum menus for consistency
with the subdivision modifier (rB66151b5de3ff,rB3d3b6d94e6e).
Adds all UV interpolation options.
Original patch by Eitan. Updated by Himanshi Kalra <calra>.
{F9883204}

Reviewed By: HooglyBoogly

Differential Revision: https://developer.blender.org/D10417
2021-08-16 14:31:50 +05:30
ddecd7aaca Cleanup: shadow variable warning 2021-08-16 18:06:10 +10:00
Himanshi Kalra
c48a01a88a Add cutom data color property for mesh comparison
Add color data type comparison for meshes, adding it as
part of comparing meshes with geometry nodes applied.

Reviewed By: JacquesLucke

Differential Revision: https://developer.blender.org/D12192
2021-08-16 12:28:12 +05:30
c0016a8581 BLF: avoid unnecessary lookups in blf_kerning_cache_new
blf_kerning_cache_new was performing many unnecessary hash lookups,
calling blf_glyph_search 32768 times. Use a lookup table to reduce this
to the number of ASCII characters (128 calls).
2021-08-16 14:35:38 +10:00
4300050e20 Cleanup: rename kerning table to ascii_table
It wasn't obvious this was only for ASCII characters.
2021-08-16 14:35:38 +10:00
87adcbc94f BLF: use fast ASCII kerning for word-wrap calculations
While this wasn't a bottleneck, using the fast version of this function
removes some duplicate code that doesn't use the look-up table.
2021-08-16 14:35:38 +10:00
6aebbe6a0a Cleanup: replace macros with inline functions for font drawing
Also assert blf_font_ensure_ascii_kerning has been called in
blf_kerning_step_fast.
2021-08-16 14:35:38 +10:00
eb278f5e12 XR: Color Depth Adjustments
This addresses reduced visibility of scenes (as displayed in the VR
headset) that can result from the 8-bit color depth format currently
used for XR swapchain images.

By switching to a swapchain format with higher color depth (RGB10_A2,
RGBA16, RGBA16F) for supported runtimes, visibility in VR should be
noticeably improved.

However, current limitations are lack of support for these higher
color depth formats by some XR runtimes, especially for OpenGL.

Also important to note that GPU_offscreen_create() now explicitly
takes in the texture format (eGPUTextureFormat) instead of a
"high_bitdepth" boolean.

Reviewed By: Julian Eisel, Clément Foucault

Differential Revision: http://developer.blender.org/D9842
2021-08-16 11:46:09 +09:00
899935d5d0 Fix wrong usage of 'sizeof'
The intention was to use `ARRAY_SIZE`.

No functional changes.
2021-08-15 20:08:17 -03:00
3f0d785d23 Fix T90658: selection of some 3D gizmos failing
Small error due to wrong variable usage.

Introduced in rBfcd2d63b644e.
2021-08-15 17:55:09 -03:00
d5261e973b BLF: Do Not Preload Glyph Cache
This patch turns off the preloading of ascii glyphs and instead caches
each glyph the first time it is actually used.

See D12215 for much more detail.

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

Reviewed by Campbell Barton
2021-08-14 13:50:51 -07:00
8f2b60ddbf Cleanup: Variable names, formatting, reduce indentation 2021-08-13 21:46:59 -05:00
6a4533dd02 BLF Cleanup: Size Defines, Comments, etc
This patch makes some non-functional changes to BLF code. Some size
defines added, comments changed, simplification of macro
BLF_KERNING_VARS.

See D12200 for more details.

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

Reviewed by Campbell Barton
2021-08-13 14:31:10 -07:00
ae3472998a Cleanup: rearrange includes
Bring the includes from the same project together.
2021-08-13 17:36:35 -03:00
Germano Cavalcante
0ed2df81cc Fix T90637: Outliner: VSE context menu options are not working
Some of the enum options in the context menu operations are not
supported for all element types.

`TSE_SEQUENCE`, for example, only supports the `Select` option.

So, populate the enum list dynamically depending on the type.

Also add some calls that were missing for the `TSE_SEQUENCE` type.
(`WM_event_add_notifier` and `ED_undo_push`).
2021-08-13 17:28:46 -03:00
5655b3d1c5 Cleanup: fix typos in static variables
_desps --> _deps
2021-08-13 15:45:07 -03:00
5225e459da Fix T86883: Add/fix suport of liboverrides in relocate/reload library case.
There was already some code for that, but it was broken, and proper
resync was completely missing.

There might still be more resync needed in library linking operators
though.
2021-08-13 16:37:29 +02:00
bb0e29c922 Blendloader: Option to reports to skip list of recursively liboverride-resynced libs.
This extra info is not always needed/convinient to use, and requires
special attention to free the list, so allow not generating it.
2021-08-13 16:37:29 +02:00
7772880d69 ViewLayer resync: Add sanity checks for objects/bases mappings.
Add a debug-only check regarding consistency of the cache (mapping from
objects to their bases) for a given ViewLayer.

Issues can happen otherwise when some code does remapping of objects,
and forgets to call `BKE_main_collection_sync_remap()` (which clears
those caches) instead of `BKE_main_collection_sync()`.
2021-08-13 16:37:29 +02:00
77744b581d Fix T90595: some VSE strip properties do not identify strip name in anim
channel names

Working with multiple strips keyframes was unneccessarily difficult in
Animation Editors (since some anim channels could not be distinguished).

Namely `Crop` and `Transform` are nested structs (nested under
`Sequence`), so these were just displaying the raw struct name.
Also strip modifiers did not have their strip name in their channel
names. Now include the strip name for these.

before
{F10277439}

after
{F10277441}

Maniphest Tasks: T90595

Differential Revision: https://developer.blender.org/D12193
2021-08-13 15:17:00 +02:00
Matteo F. Vescovi
0b3c7544b5 Fix FTBFS on mips64el architecture
While trying to get Blender 2.93.x LTS to build fine on all release architectures in Debian, I noticed that the misleading use of "mips" as integer variable caused problems when compiling on mips64el. The patch should fix the issue.

Reviewed By: fclem

Differential Revision: https://developer.blender.org/D12194
2021-08-13 14:33:50 +02:00
4cadccebfa Revert "Mesh: replace saacos with acosf for normal calculation"
This reverts commit 41e6509818.

This broke "CubeMaskFirst" test.

Any value even slightly outside the [-1.0..1.0] range
caused the result to be nan, which can happen when calculating
the dot-product between two unit length vectors.
2021-08-13 19:45:01 +10:00
b9486c39bc Cleanup: Unused function parameter warning 2021-08-13 11:16:01 +02:00
fd29a161cc Fix Action Editor unlink button when in tweak mode
When in NLA tweak mode, the action unlink button in the Dopesheet /
Action Editor should be a mere shortcut to exiting tweak mode [nothing
else].

Instead, it was also clearing the action fully, not returning to the
previous edited action before going into tweak mode.

Now dont "flush" by clearing the action, instead exit tweakmode, clear
the scenes SCE_NLA_EDIT_ON flag (if this isnt done some NLA operators
like pushdown were not immediately available because their poll checked
this flag) and send appropriate notifier to have everything update nicely.

Part of T87681 (Bug 4/5/6).

Maniphest Tasks: T87681

Differential Revision: https://developer.blender.org/D11052
2021-08-13 11:07:27 +02:00
00f264ea42 Cleanup: correct comment exiting NLA tweakmode
Comment was pasted from entering tweakmode.
2021-08-13 10:52:53 +02:00
0ae23636e7 Fix missing animation UI update in the Properties Editor
Animation indicators as well as decorators for properties were not
updating correctly in the following cases:
- NLA pushdown (this was reported in T87681)
- NLA enter/exit tweakmode
- Outliner unlinking/setting action

These actions all send a ND_NLA_ACTCHANGE notifier which the Properties
Editor was not listening to [which is now added].

part of T87681.

Maniphest Tasks: T87681

Differential Revision: https://developer.blender.org/D11040
2021-08-13 10:09:12 +02:00
5f6033e091 Keyframe: Reduce GPU context switches.
This change reduces the GPU context switches when drawing keyframes.
In the previous situation the keyframe blocks and keyframe keys were
drawn per channel. With this patch first all the keyframe blocks are
drawn for all channels and after that the keyframe keys are collected
for all channels and send to the GPU in a single draw call.
2021-08-13 09:37:38 +02:00
7b5acc8009 Cleanup: remove unused draw_gpencil_channel.
Code is integrated with draw_scene_channel since 2.80.
2021-08-13 08:34:10 +02:00
160d57d33c Docs: tooltip update missing from 3e775a4fc5 2021-08-13 16:01:45 +10:00
3e775a4fc5 PyAPI: remove the .py extension requirement for startup registration
This was left over from when these scripts were loaded as modules,
where their names needed to be compatible with Pythons module naming.

Version patch existing files so text with register enabled
without a `.py` extension wont start executing on startup.

Resolves T89532.
2021-08-13 15:51:08 +10:00
41e6509818 Mesh: replace saacos with acosf for normal calculation
The clamped version of acos isn't needed as degenerate (nan) coordinates
result in zeroed vectors which don't need clamping.
2021-08-13 15:39:39 +10:00
8fa05efe0a Docs: note that normalize_v# functions zero out input containing nan 2021-08-13 15:15:54 +10:00
92f4abc37f Cleanup: remove unused BKE_mesh_calc_normals_mapping functions
This supported calculating normals for MPoly array which was copied to
an MFace aligned array.

Remove the functions entirely since MFace use is being phased out and
these function isn't used anywhere.
2021-08-13 14:41:42 +10:00
b51a473e29 Cleanup: remove use of BKE_mesh_calc_normals_mapping_simple
Use BKE_mesh_calc_normals instead of
BKE_mesh_calc_normals_mapping_simple for curve modifier calculation.

This only made sense for derived-mesh which is no longer used.
2021-08-13 14:37:30 +10:00
ab344775c2 Cleanup: code-comments
Use capitalization, remove unnecessary ellipsis.
2021-08-13 13:55:25 +10:00
ed38d0c25d Cleanup: split BKE_mesh_calc_normals_poly function in two
Remove the 'only_face_normals' argument.

- BKE_mesh_calc_normals_poly for polygon normals.
- BKE_mesh_calc_normals_poly_and_vertex for poly and vertex normals.

Order arguments logically:

- Pair array and length arguments.
- Position normal array arguments (to be filled) last.
2021-08-13 13:33:03 +10:00
399b6ec76c Mesh: optimize normal calculation
Optimize mesh normal calculation.

- Remove the intermediate `lnors_weighted` array, accumulate directly
  into the normal array using a spin-lock for thread safety.
- Remove single threaded iteration over loops
  (normal calculation is now fully multi-threaded).
- Remove stack array (alloca) for pre-calculating edge-directions.

Summary of Performance Characteristics:

- The largest gains are for single high poly meshes, with isolated
  normal-calculation benchmarks of meshes over ~1.5 million showing
  2x+ speedup, ~25 million polygons are ~2.85x faster.

- Single lower poly meshes (250k polys) can be ~2x slower.

  Since these meshes aren't normally a bottleneck,
  and this problem isn't noticeable on large scenes,
  we considered the performance trade-off reasonable.

- The performance difference reduces with larger scenes,
  tests with production files from "Sprite Fight" showing
  the same or slightly better overall performance.

NOTE: tested on a AMD Ryzen TR 3970X 32-Core.

For more details & benchmarking scripts, see the patch description.

Reviewed By: mont29

Ref D11993
2021-08-13 10:21:30 +10:00
1275ce61b1 Cleanup: Remove unused includes
I noticed this file was recompiling when adding a node.
2021-08-12 14:12:14 -05:00
e0fd5fef12 Geometry Nodes: tag normals dirty after join
Under some circumstances the normals were not tagged dirty
even though they are.
2021-08-12 17:36:53 +02:00
f801d40daf Fix T89241: 3D Text "Scale to Fit" wraps onto the second line
Disable wrapping when "scale to fit" is used, assert the error is
small so an invalid scale-to-fit value wont go by unnoticed.
2021-08-13 01:07:30 +10:00
3930b8c69e Fix NLA action cannot be unlinked in certain cases
The poll for unlinking calls `nla_panel_context` without providing an
adt pointer, and there is a check for this pointer in
`nla_panel_context` leading to never returning true if it is not
provided. (this is fine if there are tracks already, poll would succeed
in this case, `nla_panel_context` goes a different code path then)

Same call to `nla_panel_context` is also done in the beginning of the
corresponding unlink exec function (but this time providing the pointer
because it is used later), so it makes sense to do the same thing in the
poll function. Equal check is also done in the panel poll function, so
now these are all in sync.

Part of T87681.

Maniphest Tasks: T87681

Differential Revision: https://developer.blender.org/D11041
2021-08-12 16:46:28 +02:00
333c3c92ab Fix T89805: NLA crash without active track
Was reported for a file which does not have an active track set in
AnimData even though it was in strip twek mode (but this was accessed in
is_nlatrack_evaluatable()).

Root cause for this is not totally clear, but I assume the situation is
described as part T87681 (and is fixed in D11052).

This patch here just prevents the crash for files that are already in the
borked state.

Reviewers: sybren

Maniphest Tasks: T89805

Differential Revision: https://developer.blender.org/D12085
2021-08-12 16:41:49 +02:00
dc8844f8ef Fix T88498: 'Clear Parent' does not clear parent_bone
Clearing the parent from the UI using the X (or from python) clears the
`parsubstr` and set `partype` back to `PAROBJECT`.

Using the Clear Parent operator would leave the `parsubstr` (and thus
`parent_bone`) untouched even though this operator claims to "clear
parenting relationship completely" (it also removes parent deform
modifiers for example).

So now, also clear `parsubstr` and set back to `PAROBJECT` [which is
default].

Maniphest Tasks: T88498

Differential Revision: https://developer.blender.org/D11503
2021-08-12 16:33:20 +02:00
Henrik Dick
d6891d9bee Add Extras Dropdown Menu to Constraints
Add Apply Constraint, Duplicate Constraint, and Copy To Selected
operators, and include them in a menu similar to the menu for modifiers.
The shortcuts in the extras menu are also matched to modifiers.

All the here added operators are intended to work exactly like the
analogous ones for modifiers. That means the apply operator should apply
a constraint as if it was first in the list, just like modifiers do. I
have added the same warning message as for modifiers when that happens.

The decision to use this approach of appling the constraint as if it was
first, was made for consistency with modifiers. People are already used
to how it works there. Is also provides more intricate control over the
applied transforms, then just applying all constraints up to that one.
Apply all constraints is already kinda implemented in Bake Animation.

Reviewed By: HooglyBoogly, sybren, #user_interface

Differential Revision: https://developer.blender.org/D10914
2021-08-12 14:24:27 +02:00
215734bc52 Fix T88386: Continuous Grab occasionally jumping on Arm64 MacOS
During the processing of a continuous drag event, other mouse move
events may be in the queue waiting to be processed.

But when a mouse wrapping happens, these waiting mouse move events
become out of date as they report a mouse position prior to wrapping.

The current code ignores these events by comparing their `timestamp` to
the time recorded in the last mouse wrapping.

The bug happens because the computed value in
`mach_absolute_time() * 1e-9` for some reason is incompatible with the
value of `[event timestamp]`.

Since macOS 10.6, we have a new way to get the amount of time the
system has been awake. `[[NSProcessInfo processInfo] systemUptime]`.

Using this updated method fixed the problem.

Differential Revision: https://developer.blender.org/D12202
2021-08-12 08:52:50 -03:00
6293cf6131 Fix T90630: Crash loading certain user preferences
Clearing the window was done in wm_file_read_post which was deferred.

This was needed as it left the context in an invalid state
where the window was set but the screen wasn't.

Crashing when setting up keymaps that attempted to access the
scene from the window in the property update function.

Regression in 497bc4d199
2021-08-12 20:43:16 +10:00
ad2fb92e9c Cleanup: remove redundant variable 2021-08-12 17:42:04 +10:00
04ef718226 RNA: include base types in RNA_struct_type_find_property search
Add RNA_struct_type_find_property_no_base for use in the rare situations
when this isn't desired.

Resolves T90617, where sequence strip sub-types weren't detecting
properties that exist in the base "Sequence" types.
2021-08-12 17:14:15 +10:00
806bf3f452 datadoc: add newlines to generated source files 2021-08-12 16:23:08 +10:00
83603ba26a Cleanup: comments/disabled code
- Remove old comment for editors with weak syntax highlighting.
- Remove disabled code to initialize Blender with a file path.
- Remove file name references to function names since these
  were outdated, modern development environments can look up this info.
2021-08-12 16:15:01 +10:00
497bc4d199 Fix T89046: Startup file with Python drivers crashes on load
Resolve order of initialization error reading startup file,
support postponing running wm_file_read_post until Blender
has been initialized.

Deferring updates allows duplicate initialization
to be removed from WM_init.

Reviewed By: mont29

Ref D12184
2021-08-12 14:59:08 +10:00
216414c65a Cleanup: use parameters struct for wm_homefile_read
Also add wm_homefile_read_ex which is only needed for the first
execution at startup.
2021-08-12 14:38:58 +10:00
c741558509 Cleanup: spelling in comments 2021-08-12 14:34:43 +10:00
1ef275963d Cleanup: use C++ style comments for disabled code 2021-08-12 14:34:41 +10:00
4f61843a7e Cleanup: remove *.orig file from 6a9d7139f7 2021-08-12 14:34:39 +10:00
45d100208e Makesdna: Fix detecting 32 bit padding issues.
Makesdna fails to detect issues in 32 bit code that can
only be resolved by adding a padding pointer.

We never noticed since we ourselves no longer build for
32 bit, but debian's 32 bit builds got bitten by this

A rather extensive explanation on why this is alignment
requirement is there can be found in this comment:

https://developer.blender.org/D9389#233034

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

Reviewed by: sergey, campbellbarton
2021-08-11 19:20:51 -06:00
48c8f9fc9a Fix: DNA struct alignment on 32 bit
Some of the dna structs were not properly
aligned for 32 bit builds causing issues
for some of the 32 platforms Debian builds
for.

Reviewed By: sergey, brecht
Differential Revision: https://developer.blender.org/D9389
2021-08-11 16:57:56 -06:00
cd1bb63159 BLF: Do Not Cache Unused Rendered Glyphs
The loading of a font size or style renders bitmaps of the characters
0-255 and stores them in a cache. But glyphs 128-255 in this cache are
not accessible. What used to be ansi high-bit characters are now multi-
byte UTF-8 sequences.

Therefore this patch reduces the glyph_ascii_table size to 128 and
only caches characters 32-127, the visible portion of ASCII, which
greatly reduces the time to load a font.

See D12189 for more details.

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

Reviewed by Campbell Barton
2021-08-11 13:55:58 -07:00
Jeroen Bakker
bb487bc2bc Fix T89984: Improve Icon previews reflective and transmissive materials.
Before this commit rendering material icons the floor will is hidden.
This reduces the readability of reflective/refractive materials.

check patch for additional screenshots and notes.

This patch will switch the floor material that uses ray visibility tricks to render a floor for reflective rays.

Eevee uses screen space reflections that makes this a different problem. There is nothing else drawn in
the scene in screen space so we need a different trick. Using math we convert a reflective ray to UV space
and generate a world that projects a checker pattern to infinity.

As now the floor is in the world it is being reflected via
a cubemap. As the film is transparent the background (including the floor isn't rendered)

In the future when Eevee supports vulkan raytracing we can re-evaluate and perhaps remove this
approximation.

We tried lightprobes but that wasn't able to do the trick.
Using the compositor would lead to more memory usage (render layers and intermediate buffers) and slower performance.
Solution has been validated with Simon

Reviewed By: sybren, Severin

Differential Revision: https://developer.blender.org/D11988
2021-08-11 16:59:57 +02:00
e53afad241 Cleanup: moved keyframe drawing to a draw list.
In preparation to do threaded drawing preparation. There should not be any
functional changes.
2021-08-11 16:47:12 +02:00
c9a9d5332b PyAPI: GPU: Expose builtin shaders
Expose `3D_POLYLINE_SMOOTH_COLOR` and
`3D_POLYLINE_FLAT_COLOR` builtins.

Requested by addon developers.
2021-08-11 11:39:51 -03:00
Pedro A
e6bbbd965a Cycles: OSL metadata support for UI labels and checkboxes
To improve the presentation of nodes in the node editor. Recognize the
following metadata from the OSL specification:

* [[ string label = "UI Label" ]]
* [[ string widget = "checkBox" ]]
* [[ string widget = "boolean" ]]

Ref T89741

Differential Revision: https://developer.blender.org/D12074
2021-08-11 16:12:27 +02:00
6d24017529 Cleanup: use socket identifier instead of names in Cycles shader export
Will be required when we support setting different names and identifiers
for OSL.

Ref D12074
2021-08-11 16:12:27 +02:00
6a9d7139f7 Cleanup: ID management: remove unused old BKE_libblock_copy_for_localize function. 2021-08-11 14:49:56 +02:00
Michael Kowalski
bbcb60fb22 Fix T90519: USD Exporter Error
Fixes: `Error: metersPerUnit does not match retrieved type float`
2021-08-11 09:40:27 -03:00
62cb5c5c4a Enable Asset Browser by default for poses, rest stays experimental
Idea for 3.0 is to disable all functionality that isn't well polished
and focus on those parts first. Starting with poses.

* Adds a new experimental option "Extended Asset Browser", replacing
  "Asset Browser".
* Unlike the previous option, this isn't enabled by default anymore.
  This didn't work well in practice and caused plenty of confusion.
* "Mark as Asset" and "Clear Asset" are hidden if the option is
  disabled.
* Same for the category selection in the Asset Browser.
* Always show display the "Only Assets" option in the File Browser while
  browing inside .blend files. That way you can hide data-blocks that
  are not pose assets.
* The Asset Library setup UI in the Preferences is always visible now,
  it's needed for pose library access.

Addresses T90181, T90180 and T90300.

Differential Revision: https://developer.blender.org/D12120
2021-08-11 14:32:07 +02:00
48ba341d15 Cleanup: Keylist Drawing - Split up in multiple functions. 2021-08-11 13:34:11 +02:00
6aae140278 Cleanup: Minor comment update on LIB_TAG_NEW. 2021-08-11 11:23:31 +02:00
f3e26c847b PyAPI: report unreleased ID's with WITH_PYTHON_SAFETY enabled
This would have made T88033 more straightforward to track down.
2021-08-11 17:37:38 +10:00
cbc671947a Fix T88033: Python reference memory leaks for non main data-blocks
ID data-blocks that could be accessed from Python and weren't freed
using BKE_id_free_ex did not release the Python reference count.

Add BKE_libblock_free_data_py function to clear the Python reference
in this case.

Add asserts to ensure no Python reference is held in situations
when ID's are copied for internal use (not exposed through the RNA API),
to ensure these kinds of leaks don't go by unnoticed again.
2021-08-11 17:10:02 +10:00
18fbcaf7b9 Cleanup: rename BKE_collection_{free => free_data}
This function doesn't free the collection, only it's memory.
2021-08-11 16:09:23 +10:00
Henrik Dick
2f39f7f815 Modifier: use high quality normals for vertex offset
Using high quality normals for vertex offset when set
for higher precision offsets.

This was only used for calculating even-offset.

Reviewed By: campbellbarton

Ref D12176
2021-08-11 10:26:49 +10:00
d480f03952 Cleanup: clang-format 2021-08-11 10:11:12 +10:00
55615e2600 Cleanup: trailing space, remove BOM 2021-08-11 10:11:11 +10:00
fcd2d63b64 Fix 'GPU_matrix_unproject_3fv' not working with out-of-bounds points
To solve this, the unproject code was redone in order to simplify and optimize.
2021-08-10 18:06:52 -03:00
8652e69d8b Fix T90447: 3D view transform locks do not use driver colors
Caused by rB6942dd9f4900.
2021-08-10 12:33:47 -05:00
32c687b5ec Clean-up: Remove UTF8-BOM markers
Done at the request of Sergey.
2021-08-10 11:27:18 -06:00
c920b83b84 Fix curve parameter node with multiple splines 2021-08-10 12:09:19 -05:00
34e0d8079f Add 1D noise to noise texture node 2021-08-10 11:58:11 -05:00
a376073f1e Fix curve length node (output a field, otherwise it crashes) 2021-08-10 11:57:42 -05:00
29ac510198 Merge branch 'master' into temp-geometry-nodes-fields-prototype 2021-08-10 10:56:57 -05:00
d7cf8babf2 Merge branch 'temp-geometry-nodes-fields-prototype' of git.blender.org:blender into temp-geometry-nodes-fields-prototype 2021-08-10 10:56:23 -05:00
3becd4cb61 Fix curve parameter field with cyclic poly splines 2021-08-10 10:56:17 -05:00
946da86e02 Win32 IME: Replace Usage of Language IDs
This is a slight refactoring of the Win32 IME code to remove the use of
Language IDs, which is now strongly deprecated. Instead this uses the
new recommended Locale Names, ie ISO-639-1 2-letter abbreviated names
like "en" for English rather than ID 0x09.

See D12143 for more details.

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

Reviewed by Ray Molenkamp
2021-08-10 08:54:03 -07:00
6806459246 UI: hide Viewport Display Bounds for object types that dont have
bounding boxes

These are namely 'LIGHT', 'CAMERA', 'EMPTY', 'SPEAKER' and 'LIGHTPROBE'.

Note that Empties are included here despite the fact that they have
instancing capabilities ('Display As' can be 'Bounds' for example which
then displays all instanced geometry with boundingboxes -- this however
is not meant to work with the 'Bounds' checkbox and the display bounds
type, these are only affective for the object itself, not its instances)

Issue came up in T88443.

Maniphest Tasks: T88443

Differential Revision: https://developer.blender.org/D11344
2021-08-10 17:30:43 +02:00
52bb0d42b3 correct socket shape 2021-08-10 17:23:15 +02:00
acae8f430d simplify switching between value and attribute in modifier 2021-08-10 16:55:41 +02:00
b6538e1492 Fix T90572: "Render Region" is broken due to compositing
It was using viewer instead of render border. A copy-paste error.
2021-08-10 16:16:23 +02:00
eb03529ab9 Compositor: Full frame output nodes
Adds full frame implementation to "Composite", "File Output" and
"Split Viewer" nodes.
The other nodes in "Output" submenu are implemented separately.
No functional changes.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D12091
2021-08-10 16:16:23 +02:00
d481c6651d Compositor: Full frame color nodes
Adds full frame implementation to "Alpha Over",
"Hue Saturation Value", "Invert", "Tonemap" and "ZCombine" nodes.
The other nodes in "Color" submenu are implemented separately.
No functional changes.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D12092
2021-08-10 16:16:23 +02:00
8f6cc16490 Compositor: Full frame curve nodes
Adds full frame implementation to "RGB Curves",
"Vector Curves" and "Hue Correct" nodes.
No functional changes.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D12093
2021-08-10 16:16:23 +02:00
b81d88a8e2 Compositor: Fix memory leaks when initializing tiles multi-threaded
It was only affecting tiled fallback on full frame mode. If tiles from a
constant operation were multi-thread initialized, its buffer
was inflated multiple times.
2021-08-10 16:16:23 +02:00
1a9b9dd64d Compositor: Full frame input nodes
Adds full frame implementation to "Bokeh Image" node, "Track Position"
node, `SetVectorOperation` and `MovieClipAttribute`.
The other nodes in "Input" submenu are implemented separately.

`MovieClipAttribute` needs resolution to calculate its constant value, it can't be constant folded,
which requires it to be a `ConstantOperation`. Now `ConstantOperation` contemplate this case
and any operation that is always constant without depending on inputs should implement it.
If in the future an operation needs to get an input constant element during
`determineResolution` it must first determine its input resolution.

The nodes have no functional changes.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D12090
2021-08-10 16:16:22 +02:00
5deb3229a0 Compositor: Full frame Mask node
Adds full frame implementation to this node operations.
No functional changes.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D11751
2021-08-10 16:16:22 +02:00
079f35572b Compositor: Full frame Bilateral Blur node
Adds full frame implementation to this node operation.
No functional changes.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D11634
2021-08-10 16:16:22 +02:00
0116a567dd Compositor: Full frame Sun Beams node
Adds full frame implementation to this node operation.
No functional changes.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D11694
2021-08-10 16:16:22 +02:00
bbb692ffb5 add Set Position node 2021-08-10 16:10:06 +02:00
6c0c766bca UI: hide instancing options for empties which cannot be used
Empties can only instance a collection, instancing on "Vertices" or
"Faces" does not make sense for empties, make that clear in the UI.

ref D11348

Maniphest Tasks: T88443

Differential Revision: https://developer.blender.org/D11349
2021-08-10 16:05:01 +02:00
4599748962 UI: hide object instancing panel for object types that dont support instancing
Basically, only meshes, empties and pointclouds support direct
instancing atm., no need to have the panel for other types.

note: prior to rB2eca054e14b1, collection instancing was possible on all
types (but that was removed in said commit)

note2: for empties, rna_Object_instance_type_itemf should also be
tweaked so we dont get "Vertices" and "Faces" options, but that can be
done in a separate commit

Maniphest Tasks: T88443

Differential Revision: https://developer.blender.org/D11348
2021-08-10 16:04:45 +02:00
df6a819982 rename to Attribute Freeze 2021-08-10 15:53:41 +02:00
Himanshi Kalra
e38de11f05 Refactor: Custom data comparison in meshes
Added the comparison of non-generic attributes with generic
attributes in the same loop to avoid issues with different
order in layer->types of the two meshes.

Reviewed By: JacquesLucke

Differential Revision: https://developer.blender.org/D12149
2021-08-10 19:22:29 +05:30
9c0f11344e Fix T90564: Crash when linking 2 node inputs
Caused by {rB37570a73170e}.

Above commit wasnt taking into account that at this point the link could
still be NULL.

Maniphest Tasks: T90564

Differential Revision: https://developer.blender.org/D12180
2021-08-10 15:44:53 +02:00
48f2643556 remove dead code 2021-08-10 15:42:15 +02:00
d4b441851f new Position node 2021-08-10 15:33:19 +02:00
e0406d029d Merge branch 'master' into temp-geometry-nodes-fields-prototype 2021-08-10 15:11:56 +02:00
05879f2c36 File/Asset Browser: Select/Activate File on Right Click for Context Menu
Right clicking would spawn the context menu under the cursor, but some
operators would actually act on the active asset/file which wasn't
the one clicked on.

When multiple files are selected and one of them is right-clicked on,
selection is not changed to allow operations on multiple files. E.g.
deletion.

This makes the File/Asset Browser match the Outliner (in behavior, not
implementation).

For the right-click selection keymap:
* The context menu still only spawns on W.
* Bonus: Right click now does something, it actually selects files!
  I could have done additional changes here to avoid this, but it seems
  like a good addition.

This is also a better alternative to rB5edfde58fe60, which didn't work
properly either. Using rename from the context menu would only work if
the clicked on file was also active...

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

Reviewed by: Campbell Barton
2021-08-10 13:04:49 +02:00
fe1740ae6a Cleanup: use give_object_under_cursor when dragging materials.
It used to invoke give_base_under_cursor, but only accessed the `object` from the base.
2021-08-10 12:07:13 +02:00
aab7540b7a Fix crash: mouse is over file space during startup.
When blender starts and the mouse is over a file/asset browser it
crashes. This is because blender wants to highlight a file, but the
layout isn't initialized yet.
2021-08-10 12:03:40 +02:00
895d3cd11e Fix T89253: template_list allows arbitrary data changes
Blender forbids property changes in .draw() methods. But they weren't
caught after a call to .template_list() with a custom list type.

Support nested calls that disallow writes.
2021-08-10 19:53:08 +10:00
182edd4c35 Fix T89284: Greasepencil top bar draw tool settings missing
Caused by {rBe3faef686d38}.

Error was getting the preview [which wasnt there yet]
These only appeared once the material tab in the Properties Editor was
used (since this ensured a valid preview icon).

Above commit changed behavior for RNA icon getter (this does not create
data anymore), so ensure the preview by hand here.

Maniphest Tasks: T89284

Differential Revision: https://developer.blender.org/D12178
2021-08-10 11:37:03 +02:00
c5c82f801a Merge remote-tracking branch 'origin/temp-geometry-nodes-fields-prototype' into temp-geometry-nodes-fields-prototype 2021-08-10 10:45:30 +02:00
78c0e7c015 Fix: Extrude and Move Edge out selection 2021-08-10 10:45:23 +02:00
fd0ac1aec5 fix node id 2021-08-10 10:08:06 +02:00
76d52cbcb4 Cleanup: Comment COW/LOCALIZED ID tags.
This was really missing there (some COW tags behavior was also
documented in some code using them, like in `sound.c`, but not in their
definition).

Ref. T88555.
2021-08-10 10:07:10 +02:00
7c2c66cdb8 Fix T90268: Mesh.from_pydata error using numpy array for edges/faces
Technically not a bug but worth supporting.
2021-08-10 17:51:48 +10:00
0827cce9de Merge remote-tracking branch 'origin/temp-geometry-nodes-fields-prototype' into temp-geometry-nodes-fields-prototype
# Conflicts:
#	source/blender/blenkernel/BKE_node.h
2021-08-10 09:34:04 +02:00
2bba77045f Extrude and Move Node
This adds an additional version of the extrude node, which operates on
vertices, edges and faces and moves the extruded region by a given
offset vector.
2021-08-10 09:33:24 +02:00
61040a36aa PyDoc: fix for renamed context member
Missing change from 9cff9f9f5d.
2021-08-10 17:28:09 +10:00
128ca8c7f6 Fix T90551: Dopesheet displays keyframes differently.
Regression introduced by {rB73b047bcd431}. Missing a check when
converting the file to use LISTBASE_FOREACH.
2021-08-10 08:42:06 +02:00
00ecf29ec4 fix curve parameter type 2021-08-10 08:25:33 +02:00
692e926b18 Silensed compilation warning in gpu test case. 2021-08-10 07:57:41 +02:00
49ea8e4fea Edit Mesh: multi-object edit-mode support for knife project 2021-08-10 15:10:20 +10:00
b83ee724a4 Fix T90418: macOS codesign fails with dylib next to executable
Change the dylib folder relative to `Blender` executable to be
the same as before rB652fbc200500497a67bd11d18b786587ba34e3d9 and same
as bpy.so : `@loader_path/../Resources/${BLENDER_VERSION}/lib`
2021-08-10 10:30:55 +05:30
4ca19c7153 Fix T90493: Undo a knife-project operation crashes
The crash occurred calling because mesh_get_eval_final in edit-mode
freed all derived mesh data without tagging the object for updating.

However meshes in edit-mode weren't meant to be used as knife-project
source-data, adding support for multi object edit-mode  caused this.
2021-08-10 14:44:36 +10:00
3335f852a1 Cleanup: mixing enum/non-enum type warning in conditional expression 2021-08-10 12:04:17 +10:00
26fea4de63 Cleanup: unused function warning 2021-08-10 11:57:33 +10:00
d9930cddfd Fix invalid string comparison in cd692c6954 2021-08-10 11:47:09 +10:00
cb7b4064d6 VSE: Fix cache invalidation
Blend mode replace is done in preprocessing stage, but property update
function invalidated composite cache.
2021-08-10 01:26:49 +02:00
Wannes Malfait
cd692c6954 Geometry Nodes: Add labels for switch node texture sockets
This makes texture sockets have a label by default. This can be changed
by adding the SOCK_HIDE_LABEL flag to the socket. With this change the
switch node now shows the labels "True" and "False" like for the other
types of sockets.
2021-08-09 17:30:44 -05:00
172e713cc6 Add curve parameter node 2021-08-09 17:12:19 -05:00
5c32227025 Merge branch 'master' into temp-geometry-nodes-fields-prototype 2021-08-09 15:35:06 -05:00
3b87fd376a Cleanup: Remove unecessary RNA get and set functions 2021-08-09 15:25:05 -05:00
Rob Ranieri
8e3dea27ec Docs: Blend-File: Fix typo
Reviewed By: Blendify

Differential Revision: https://developer.blender.org/D12162
2021-08-09 15:36:42 -04:00
2d867426b1 UI: Clip Editor: Expose 2D Cursor Location to RNA and UI
To be consistent with the image editors and 3D viewport
the cursor location can be changed from the sidebar.
This was missing from the clip editor, but support has been added in this commit.
Previously, the only way to precisely set the cursor was
to call the set cursor operator then use the redo panel to adjust the value.
2021-08-09 15:33:06 -04:00
ce95a2b148 UI: Clip Editor: Move Annotation Panel to new View tab
To be consistent with all other editors the annotation
layers pannel should be placed in a "View Tab".
In my next commit, this tab will be expanded to include other options.
2021-08-09 15:33:06 -04:00
b04997cca4 Fix T90547: Add node errors when compiled without OpenVDB or Bullet
These were added in other places but were overlooked here.
2021-08-09 13:42:19 -05:00
fa9d1cb2a9 properly adapt selection domain 2021-08-09 19:31:32 +02:00
fddd5eb692 UI: Image Editor: Fix missing 2D cursor in mask edit mode
The 2D cursor should be visible in both mask and uv edit modes.

This was likely and oversight when splitting the image editor
into the UV and Image editors
2021-08-09 11:53:28 -04:00
ff594715b8 Build: macOS library upgrade fixes
* Revert back to OpenMP 9.0.1 due to bug causing cloth physics test to fail.
* Skip flex build on macOS to avoid link error, only reason we build this is
  due to old flex version on Linux CentOS 7.
* Fix PNG cmake argument that expects lowercase on instead of ON.

 Ref T90507, T88438
2021-08-09 16:50:31 +02:00
71e2c366f7 Cleanup: Fix compiler warning 2021-08-09 15:28:12 +02:00
6fe00939b0 PyAPI: resolve build error with Python 3.10
Resolves T89931
2021-08-09 22:55:41 +10:00
6deb37474e Cleanup: spelling in comments 2021-08-09 22:55:38 +10:00
e2a411570e Cleanup/fixes in UI messages. 2021-08-09 14:42:47 +02:00
3886ab05b4 Cleanup: Spelling and typos in comment 2021-08-09 14:32:12 +02:00
73b047bcd4 Cleanup: Changed keyframe_keylist to CPP.
Just a straight-forward change. Not utilizing CPP features.
2021-08-09 13:00:30 +02:00
22ed1c7b61 Cleanup: filelist, pass FileListReadJob to job functions
Pass `FileListReadJob` to the `read_job_fn` callback, instead of exploding
the struct into its individual fields, passing those as parameters, and
marking a bunch of those as unused again.

No functional changes.
2021-08-09 12:37:23 +02:00
0e4a250279 Fix invalid helps and description of session UUID verification
A copy-paste error.
2021-08-09 12:09:02 +02:00
7ea577eef3 Fix depsgraph check for tag during evaluation
- Only do print when asked for tags debugging.
- Add missing newline to the message.
2021-08-09 12:09:02 +02:00
d6f162dfa9 Fix T90540: NoneType object error with entering grease pencil draw mode
The preview was not ready when the panel was displayed.

Just need to check if None.
2021-08-09 12:08:08 +02:00
0986992dbd Cleanup: document FileListReadJob::tmp_filelist
Add a comment to document what `FileListReadJob::tmp_filelist` is for,
and how it's freed.

No functional changes.
2021-08-09 11:32:16 +02:00
577a12f840 add Normal node 2021-08-09 11:29:04 +02:00
8dad29d0ea new Attribute Extract node 2021-08-09 11:10:57 +02:00
909e0819ae Fix T90532: Crash editing meshes with auto-smooth
Caused by fix for T90256 and a misunderstanding in D11928.

Don't skip tagging edges when the auto-smooth angle is 180 degrees
since this skips topology checks which are needed for properly
calculating edge loop normals.
2021-08-09 18:32:53 +10:00
52c349cfcd Fix T90511: Cycles preview does not update once preview is done
Caused by 4f64fa4f86.

Was a bad backport from the Cycles X branch: the fact that CPU and GPU
has different reset code paths was not taken into account.
2021-08-09 10:28:54 +02:00
4eda4fd49a support field in point separate node 2021-08-09 09:49:53 +02:00
1db53a8923 Merge branch 'master' into temp-geometry-nodes-fields-prototype 2021-08-09 09:12:48 +02:00
b417fb9251 Cleanup: return True/False from gpencil toolbar function
This was returning None/False which could cause problems in the future.
2021-08-09 15:05:04 +10:00
64d750fb73 Cleanup: indentation 2021-08-09 15:03:47 +10:00
d3a699925d Cleanup: use 'cls' for class methods first argument 2021-08-09 15:03:32 +10:00
eb165f574b Cleanup: remove redundant imports
The module was importing it's own functions.
2021-08-09 15:02:31 +10:00
Yuki Hashimoto
8830cfe541 Fix text object inserting multiple characters with a selection
`bpy.ops.font.text_insert(text="multiple characters")` wasn't working.

When the text is selected does not correctly insert multiple characters.

- When the text was selected from left to right,
  the cursor only move one position next to the selected text.
- When the text is selected from right to left,
  a part of the selected text remain.

Ref D12161
2021-08-09 14:31:57 +10:00
ff9bc901f4 Cleanup: grease pencil app-template versioning
- Remove check for screens being None as this would raise an error.
- Replace loop over `area.spaces` with `area.spaces.active`.
- Loop over grease pencil data directly instead of accessing
  through the scenes objects.
- Split versioning into functions.
- Use `update_factory_startup_*` prefix for function names
  as this isn't versioning existing files.
2021-08-09 12:45:06 +10:00
3ea6cf7d41 Cleanup: avoid using context in versioning code
Also extract versioning into a function that makes it's purpose clear.
2021-08-09 12:01:11 +10:00
4c26bb0232 UI: Show Mask Display Options Conistently
This commit makes the display options for mask only show in the header for the clip and image editors.
Prior to this change they would display in the header for the clip editor and in the sidebar for the image editors.
2021-08-08 16:09:23 -04:00
Aaron Carlisle
0be26f563e UI: Sequencer: Fix placement of display options in sequencer & preview mode
This commit does two things, first it removes the proportional editing tool settings.
This is not accessible code and is has not been used since the grease pencil/annotations changes in 2.8.

Second, this patch reorders the if statements so that the display options are always shown on the rightside.

Reviewed By: antoniov

Differential Revision: https://developer.blender.org/D12163
2021-08-08 13:30:52 -04:00
76e24609fd Cleanup: Remove stale/dead code
This seems to be really old code from 2.4 or earlier.
I was unable to find when it was removed gitk and git blame both couldnt find anything.
However, it is safe to say that this code is long gone.
2021-08-08 13:29:29 -04:00
3f1873111e Cleanup: Fix comment typo 2021-08-08 15:11:50 +02:00
b541b5f875 GPencil: Fix memory leak in previous commit 2021-08-08 15:09:34 +02:00
a7aeec2655 GPencil: New Select Random operator
Select strokes or points randomly (similar to meshes).

Reviewed By: pepeland

Differential Revision: https://developer.blender.org/D12157
2021-08-08 14:56:33 +02:00
20aba8a4c0 Merge remote-tracking branch 'origin/temp-geometry-nodes-fields-prototype' into temp-geometry-nodes-fields-prototype 2021-08-08 04:59:25 +02:00
a7bb537a61 Cleanup: unnecessary double pointers in XR module
No functional changes.
2021-08-07 21:30:15 +09:00
nutti
b33b70ed07 PyDoc: Fix poll_message_set API documentation to consistent with Python style
Fix poll_message_set API documentation to consistent with Python style

Reviewed By: Blendify

Differential Revision: https://developer.blender.org/D12150
2021-08-06 20:18:31 -04:00
1d53bf0412 Cleanup: Remove unused variable 2021-08-06 19:00:58 -05:00
1177debb01 Support selection in the point translate node 2021-08-06 17:56:41 -05:00
047daf5442 Don't draw special "constant" sockets in more cases 2021-08-06 17:33:58 -05:00
f2112199a4 Add utilities to enable and disable output sockets with a type 2021-08-06 17:08:22 -05:00
36de290807 Fix incorrect SOCK_FIELD cases 2021-08-06 16:58:24 -05:00
c09a535333 Cleanup: Rename flag
This tends to fit on one line more often
2021-08-06 16:24:22 -05:00
4e78bb3f0c Draw constant input sockets that don't support fields differently
This is a really incomplete way to do this (it doesn't propogate to
linked nodes, and I haven't though about outputs), but it still provides
a very nice benefit to readability.
2021-08-06 16:23:34 -05:00
49f33e9820 Merge remote-tracking branch 'origin/temp-geometry-nodes-fields-prototype' into temp-geometry-nodes-fields-prototype
# Conflicts:
#	source/blender/blenkernel/BKE_node.h
#	source/blender/bmesh/intern/bmesh_mesh.h
#	source/blender/nodes/geometry/nodes/node_geo_extrude.cc
2021-08-06 22:36:31 +02:00
6f525e0d98 Upgrade extrude node with field inputs and selection outputs 2021-08-06 14:55:32 -05:00
963448a2af Cleanup: Remove unused code 2021-08-06 14:53:35 -05:00
9506ef320e Merge branch 'soc-2021-porting-modifiers-to-nodes-extrude' into temp-geometry-nodes-fields-prototype
# Conflicts:
#	source/blender/blenkernel/BKE_node.h
#	source/blender/blenkernel/intern/node.cc
#	source/blender/bmesh/intern/bmesh_mesh.c
#	source/blender/bmesh/intern/bmesh_mesh.h
#	source/blender/nodes/CMakeLists.txt
#	source/blender/nodes/NOD_geometry.h
#	source/blender/nodes/NOD_static_types.h
#	source/blender/nodes/geometry/nodes/node_geo_extrude.cc
2021-08-06 20:25:44 +02:00
d245782b80 Windows: Add support to compile python api docs from make file
This adds support to compile the html python api docs from the command line by running `make doc_py` matching support between windows and unix.

This patch also makes it so the compiler is not needed if you set the `blender_bin` variable, this affects icon generation as well.

In the future, I want to move away from generating the build output in the build directory but that can come in a later change.

Reviewed By: LazyDodo

Differential Revision: https://developer.blender.org/D12144
2021-08-06 13:55:14 -04:00
1700fde0dc Output anonymous attribute in select by handle node 2021-08-06 12:45:21 -05:00
d5a83a5a32 Merge branch 'master' into temp-geometry-nodes-fields-prototype 2021-08-06 12:33:00 -05:00
3fab16fe8e Fix T90477: Cursor vertex snapping not working in UV editor
`t->obedit_type` is read to indicate if we are in uv edit mode.

Also fixes a crash introduced in {rBdd14ea18190ff27082009f73a556569a43377a71}.
2021-08-06 11:44:26 -03:00
4f64fa4f86 Cycles: Fix for possible viewport dead-lock
This is a backport of recent development in the Cycles X branch.

Fixes possible dead-lock in viewport rendering when exiting at an
exact bad moment (couldn't reproduce in master branch, but in the
cycles-x branch it was happening every now and then).

Differential Revision: https://developer.blender.org/D12154
2021-08-06 16:26:51 +02:00
69c9363e39 Cleanup: Use conventional naming for private Session members
Makes it consistent with the guidelines and the Cycles X branch, and
allows to backport fix for the viewport update from the branch. Will
cause a merge conflict, which should be simple accept-ours in the
branch.
2021-08-06 15:56:00 +02:00
335379d8fc Cleanup: Add missing newline at end of file 2021-08-06 15:32:28 +02:00
3fbe6f513d Move NanoSVG lib to extern
The library has some modifications and it has been included in a diff.

Reviewed By: campbellbarton

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

(Some minor changes done in the patch)
2021-08-06 15:29:54 +02:00
9cff9f9f5d Cleanup: rename FileList::asset_libraryasset_library_ref
In the `FileList` struct, rename the `AssetLibraryReference
*asset_library` field to `asset_library_ref` -- it's a description of
which asset library is used, and not the asset library itself.

This is to make space for a future `AssetLibrary *asset_library` field,
which will point to an actual asset library struct/class.

No functional changes.

Reviewed by: Severin

Differential Revision: https://developer.blender.org/D12151
2021-08-06 15:20:39 +02:00
2796ee7da0 Fix error setting the ID name in disabled alembic nurbs importe
This corrects code that's currently disabled, see `USE_NURBS` define.

The name passed to `BKE_curve_add` was overwritten,
bypassing uniqueness and utf8 encoding checks.

Longer names would cause a buffer overrun as the length of the source
data was passed to `BLI_strncpy` instead of the destination.

Reviewed By: sybren

Ref D12125
2021-08-06 23:01:57 +10:00
01c1b1e82e Fix shortcut for Asset Details not showing in Asset Browser pulldown
The shortcut wouldn't show up in the Asset Browser's "View" pulldown for
the "Asset Details" item. It's the "N" key to toggle the right sidebar.
2021-08-06 14:39:09 +02:00
f4adb35f28 Fix T90476: intermittent wrong generated texture coordinates with modifiers
This caused Cycles texture_space_mesh_modifier and panorama_dicing tests to
randomly fail.

The issue was introduced with D11377, due to a missing dependency. Now ensure
we first copy the texture space parameters, and only then use or recompute then.

In general it seems like this dependency should have already been there, since
parameter evaluation includes animation and drivers, and geometry evaluation
may depend on that (even if you would not typically animate e.g. an autosmooth
angle).

Thanks Campbell for tracking this one down.
2021-08-06 13:59:25 +02:00
b0df8f53ba Cleanup: rna_xr.c
- Rename functions to use RNA identifiers
- Use SET_FLAG_FROM_TEST macro
- Specify max string length for relevant function params
2021-08-06 17:56:06 +09:00
4c675bc356 Fix missing function param definition in rna_xr.c
Was accidentally left out in rBe844e9e8f3bb.
2021-08-06 17:55:32 +09:00
151eed752b Fix invalid XR action map indices after alloc
Although the relevant structs (wmXrRuntime/XrActionMap/
XrActionMapItem) are zero-allocated, the selected and active action
map indices need to be initialized to -1 to prevent potential
out-of-bounds list access.
2021-08-06 17:55:00 +09:00
d98791a106 Cleanup: clang tidy
`bugprone-signed-char-misuse`
2021-08-06 10:20:24 +02:00
6188c29603 Cleanup: use const result in ED_keyframes_find_* functions. 2021-08-06 09:54:56 +02:00
1ab75c1d49 Cleanup: use range2f in ED_keylist_find_any_between. 2021-08-06 09:46:36 +02:00
bb8ce95b5e Cleanup: const pass keyframes_keylist. 2021-08-06 09:10:28 +02:00
a7dc3d1e90 Merge remote-tracking branch 'origin/soc-2021-porting-modifiers-to-nodes-extrude' into soc-2021-porting-modifiers-to-nodes-extrude 2021-08-06 07:53:56 +02:00
6fd836f53b Merged Master 2021-08-06 07:48:40 +02:00
bc97d78329 Cleanup: use MEM_SAFE_FREE macro 2021-08-06 14:24:16 +10:00
99738fbfdc Fix memory leak from rB263fa406cd2b 2021-08-05 21:10:54 -05:00
1f8485ae82 Geometry Nodes: Select by Handle Type Node
Just like the "Select by Material" node, this node outputs a
boolean attribute for control points that have a matching handle
type. By default left and right handles are considered, but it's
possible to only check one side with the toggle in the node.

Differential Revision: https://developer.blender.org/D12135
2021-08-05 18:42:20 -05:00
Mattias Fredriksson
bc0d55e724 Fix: Avoid floating point error in some mesh primitive nodes
Some mesh primitives created using geometry nodes use loops to create
vertices and accumulates positions/angles in FP variables. This allows
rounding errors to accumulate and can introduce significant errors.

To minimize changes from original implementation, variables allowing
errors to accumulate are replaced by: delta * index. Affected Mesh
Primitives nodes are Line, Grid, Cylinder, Circle, Cone, and UV-Sphere.

Differential Revision: https://developer.blender.org/D12136
2021-08-05 18:34:32 -05:00
263fa406cd Fix T90087: Assigning object data doesn't copy vertex groups
Assigning a mesh seems to do its own parameter copying, which
means we need to manual copy its vertex groups here, which was
just overlooked in rB3b6ee8cee708.

Differential Revision: https://developer.blender.org/D12110
2021-08-05 18:27:07 -05:00
40455c21fa Support switching between two fields in the switch node 2021-08-05 18:10:28 -05:00
2d0442e943 Use "true" defaults for selection fields 2021-08-05 17:50:33 -05:00
d55046b167 Support field for curve set spline type selection 2021-08-05 17:50:23 -05:00
4233128fa5 Add a node to store a field in a geometry and output an anonymous attribute 2021-08-05 17:43:15 -05:00
798496233a Rename the "Attribute Fill" node to "Store Persistent Attribute" 2021-08-05 17:42:57 -05:00
991f6b15f3 Merge branch 'master' into soc-2021-porting-modifiers-to-nodes-extrude
# Conflicts:
#	source/blender/blenkernel/BKE_node.h
2021-08-05 23:50:08 +02:00
aef45a4ef2 Merge remote-tracking branch 'origin/soc-2021-porting-modifiers-to-nodes-extrude' into soc-2021-porting-modifiers-to-nodes-extrude
# Conflicts:
#	source/blender/bmesh/intern/bmesh_mesh.c
#	source/blender/bmesh/intern/bmesh_mesh.h
#	source/blender/nodes/NOD_static_types.h
#	source/blender/nodes/geometry/nodes/node_geo_extrude.cc
2021-08-05 23:48:58 +02:00
504e3c563f added side selection. 2021-08-05 23:47:44 +02:00
8645ea16de Remove attribute nodes that have been made redundant 2021-08-05 14:48:18 -05:00
5e292d923f Merge branch 'master' into temp-geometry-nodes-fields-prototype 2021-08-05 14:13:16 -05:00
Himanshi Kalra
92edf37997 Add custom data comparison for generic attributes
Generic attributes CD_PROP_* comparison is added in customdata_compare
Checks for built-in as well as user created attributes.

Reviewed By: JacquesLucke

Differential Revision: https://developer.blender.org/D12137
2021-08-06 00:07:40 +05:30
Germano Cavalcante
89014b51f1 Xcode: support cmake options for grouping in folders
The Xcode IDE can also benefit from the options:
- WINDOWS_USE_VISUAL_STUDIO_SOURCE_FOLDERS
- WINDOWS_USE_VISUAL_STUDIO_PROJECT_FOLDERS

So add suport to these options and also renames them as they are no
longer limited to just Windows and Visual Studio.

Reviewed By: brecht, ankitm

Differential Revision: https://developer.blender.org/D12132
2021-08-05 15:31:41 -03:00
cf10eb54cc Action Constraint: add Split Channels Mix choices from Copy Transforms
Practice shows that when combining actions and direct animation
it is usually best to combine location, rotation and scale
separately, which is implemented by the Split Channels modes
recently introduced in D9469 for Copy Transforms. This completes
the same set of 6 choices for the Action Constraint.

The default for new constraints is changed to the newly
added Before Original (Split Channels) mode.

The original patch is motivated by Loic Pinsard, who created
an addon that does the equivalent of this feature by splitting
the action into two, separating location and rotation+scale.

Differential Revision: https://developer.blender.org/D7547
2021-08-05 21:21:29 +03:00
d01781129f Fix T90235: Smooth Brush not working with interior vertices with two adjacent edges
The exception to automatically pin vertices of grid corners also
has to take into account that the vertex is in a boundary.

Reviewed By: JacquesLucke

Maniphest Tasks: T90235

Differential Revision: https://developer.blender.org/D12044
2021-08-05 20:10:02 +02:00
4dd6c9ad45 Fix T90236: Sculpt automasking failing when the stroke does not start over the mesh
The active geometry element are usually updated by the cursor drawing
code (as they are needed for the cursor preview) and when an sculpt
operator starts. For brushes, this was not happening. This was making
brushes rely by default on the last cursor drawing update, which can
be incorrect if the mouse moved after starting the stroke without
hovering the active geometry.

Reviewed By: JacquesLucke

Maniphest Tasks: T90236

Differential Revision: https://developer.blender.org/D12045
2021-08-05 20:08:36 +02:00
6844f7bedb PyDoc: document how parameter are used for 3D and 2D textures
Improves on rB171433e841379e7efad069bbda9880fb271e2fc4
2021-08-05 13:06:13 -04:00
Eitan
bd44e82b25 Geometry Nodes: Add more warnings for out of bounds parameters
Add warning(info) to nodes that don't work when an input value is
out of range. For example, the grid node doesn't work with Vertices X
or Verices Y less than 2.

These are purposefully added as "Info" warnings, because they don't
show in the modifier and they aren't printed to the terminal.

Differential Revision: https://developer.blender.org/D11923
2021-08-05 10:44:59 -05:00
c15635bd8d BMesh: support laplacian smooth for n-gons
Follow the same logic already used by the modifier.
2021-08-06 01:43:13 +10:00
04c24bec07 Cleanup: replace short with boolean for zero area array
Also remove redundant fabsf on the area of a quad/tri &
reduce indentation using continue in for loop.
2021-08-06 01:42:01 +10:00
ff2265f0a9 Cleanup: comment blocks & spelling 2021-08-06 01:36:43 +10:00
8158211198 Cleanup: quiet array-parameter warning 2021-08-06 01:32:04 +10:00
ca64bd0aac Render: move Cycles visibility, holdout and shadow catcher properties to Blender
The immediate reason for this is that we want to be able to initialize them
to different defaults for light objects, which is hard with Python properties.
But in general it is useful to be able to share these with other renderers.

As a side effect, Eevee now supports a per-object holdout instead of only
per-collection.

Differential Revision: https://developer.blender.org/D12133
2021-08-05 17:22:38 +02:00
6c326ba0a2 Fix T83164: Spline IK joint_bindings parameter is broken.
Code freeing the array would not properly reset its length value to
zero.

Note that this corrupted data could also be saved in .blend files, so
had to bump fileversion and add some doversion code too.

Fix T90166: crash when creating a liboverride.
2021-08-05 17:21:25 +02:00
834523e239 Cleanup/Fix RNA array length accessors returning non-zero values in invalid cases.
This was apparently done in two places only, with a very cryptic comment
(`/* for raw_access, untested */`), and... I cannot see how returning a
non-zero length value for an array that does not exist or is not
accessible at least, would be anything but an obvious source of issues.

Note that both commits adding those lines are from stone ages (2009):
rBcbc2c1886dee and rB50e3bb7f5f34.
2021-08-05 17:21:25 +02:00
27b9cb7a1e GPencil: New Merge Layer keymap: Shift+Ctrl+M
The keymap is available in: Draw, Edit, Sculpt, Weight Paint and Vertex Paint modes.

The keymap is not available in Object mode to avoid any conflict.

Reviewed By: pepeland

Differential Revision: https://developer.blender.org/D12128
2021-08-05 17:12:34 +02:00
03d7561708 Fix build error when WITH_XR_OPENXR not defined 2021-08-06 00:08:56 +09:00
b4f950cbbe GPencil: New Caps icons
These icons are used to define the type of caps.

Designed by: Matias Mendiola
Reviewed by: Pablo Vazquez
2021-08-05 17:07:21 +02:00
Germano Cavalcante
cc4e674e41 DRW: New Select Debug Engine
This is a simple engine used only to debug the texture of select ids.

It is only used when the `WITH_DRAW_DEBUG` option is enabled and the
debug value is 31.

Reviewed By: fclem

Differential Revision: https://developer.blender.org/D5490
2021-08-05 11:56:51 -03:00
e844e9e8f3 XR Controller Support Step 2: Action Maps
Addresses the remaining portions of T77137 (Python API for Controller
Interaction), which was partially completed by D10942.

Adds an XR "action maps" system for loading XR action data from a
Python script. Action maps are accessible via the Python API, and are used
to pass default actions to the VR session during the
xr_session_start_pre() callback.

Since action maps are stored only as runtime data, they will be
cleaned up with the rest of the VR runtime data on file read or exit.

Reviewed By: Julian Eisel, Hans Goudey

Differential Revision: https://developer.blender.org/D10943
2021-08-05 23:40:17 +09:00
0cff7c2a22 LibOverride: Make it reasonably impossible for users to create overrides of scenes.
This is not supported currently,doing so through RNA API remains
possible, but from regular UI operations it should not be doable
anymore.

Ref. T90459.
2021-08-05 15:26:08 +02:00
720ea8a67d Fix T89963: crash when library override is applied to an object from a linked scene.
LibOverride of scenes is not really supported currently, there are many
issues with it.

Will disable most user-accessible ways to create such overrides in a
following commit.
2021-08-05 15:26:08 +02:00
be6409a748 Fix fix invalid index use for edit-mesh laplacian smooth
Only vertex indices were ensured to be correct.
2021-08-05 22:39:24 +10:00
fb1822ddeb XR: Controller Data Improvements
Provides two key improvements to runtime controller data.

1. Separates controller poses into two components, "grip" and "aim",
which are both required to accurately represent the controllers
without manual offsets.

Following their OpenXR definitions, the grip pose represents the
user's hand when holding the controller, and the aim pose represents
the controller's aiming source.

2. Runtime controller data is now stored as a dynamic array instead
of a fixed array. This makes the API/functionality more adaptable to
different systems.

Does not bring about any changes for users since only internal
runtime functionality is currently affected.

Reviewed By: Julian Eisel

Differential Revision: http://developer.blender.org/D12073
2021-08-05 21:11:01 +09:00
f45860fba9 Cleanup: Remove unused members in FileSelectParams 2021-08-05 12:52:58 +02:00
ed9759349b Fix T89214: Smooth Vertices (Laplacian) produces NaN coordinates
Vertices with no connected faces would attempt to divide by the combined
face area causing a divide by zero.

Use the same weight for wire vertices as vertices connected
to zero area faces.
2021-08-05 20:49:20 +10:00
02e0c6f42e Fix T90430: Crash when dragging material
Was trying to get asset information even when there was none, i.e. when
the material wasn't an asset or not dragged from the Asset Browser.
2021-08-05 12:14:11 +02:00
317f09ebf9 Fix T90170: RNA_property_pointer_get creating data in non-thread-safe way.
Protect this accessor with a local static mutex when it needs to
create/write data.

Ideally accessors should never create or modify data, but there are some
cases where this bad behavior is currently unavoidable.

This is the case of the Pointer accessor when the actual IDProperty has
not yet been created.

NOTE: this fixes a memory leak in liboverride diffing process when
several different overrides use a same linked reference ID.

Differential Revision: https://developer.blender.org/D12060
2021-08-05 12:12:13 +02:00
03e2f11d48 Fix T89835: Crash after Instancing to Scene after making linked Collection local.
Even though the ID itself remain the same after being made local, from
depsgraph point of view this is a different ID. Hence we need to tag all
of its users for COW update, as well as rebuild depsgraph relationships.

Should be also backported to LTS 2.93 (and 2.83 if possible).
2021-08-05 11:31:49 +02:00
647a8bff06 Fix T90256: faces are flat shaded in edit mode with auto smooth
Regression in 39b2a7bb7e.
2021-08-05 18:21:17 +10:00
f5acfd9c04 Cleanup: remove redundant parenthesis 2021-08-05 16:54:34 +10:00
d8582d966f Fix slicing with negative indices
Negative indices that remained negative after adding the sequence length
caused incorrect slicing.

With the default scene for example:

   bpy.context.scene.objects[-4:2]

Gave a different result to:

   tuple(bpy.context.scene.objects)[-4:2]

Clamp indices above zero so loops that step forward works as intended.
2021-08-05 16:44:03 +10:00
2b51124d6a Fix T89450: Crash slicing BMEditSelSeq
Slicing with indices greater than the length of the sequence would crash.
2021-08-05 16:44:01 +10:00
450593ddf0 Cleanup: Fix Clang braced-scalar-init warning 2021-08-05 11:00:56 +05:30
d3d4be1db3 XR: Action Binding Improvements
Provides several important improvements to the runtime action
bindings operation and internal API.

Moves input-specific action data (input thresholds, input regions,
pose offsets/spaces) from actions to more granular action bindings.
This allows a single action to be mapped to a variety of inputs,
without having to share a single input threshold, region, or space.

Also removes the need for action space creation API, as spaces for
pose actions will be automatically created with the bindings.

The correct action data for the current inputs is set by calling
xrGetCurrentInteractionProfile() to get the current profile and then
retrieving the corresponding mapped data.

Does not bring about any changes for users since only internal
runtime functionality is currently affected.

Reviewed By: Julian Eisel

Differential Revision: http://developer.blender.org/D12077
2021-08-05 13:14:26 +09:00
d1c5e2e050 Cleanup: license headers
These were removed globally in 65ec7ec524.

Some files re-introduced these conventions since.
2021-08-05 12:03:41 +10:00
604ae5f7b6 Cleanup: tab indentation for CMake / GNUmakefile 2021-08-05 12:03:41 +10:00
1def985d78 Windows: Add icons and icons_geom to make.bat
This adds support for building the icons from make.bat
unlike bash there is no passing environment variables
on the command line.

The scripts go out of their way to locate both blender
and inkscape however if they are not found, the user is
given a helpful error message telling them how to set
the variables.

Although some extra help can be given there, if your
normal build is a 2019 full build running

`make 2019 full icons`

will help it find the blender executable as well.

finally if you know the name of your build folder
running

`make builddir build_windows_Lite_x64_vc16_Release icons`

will also work, if all fails you can point directly to
the blender executable by running

`set BLENDER_BIN=c:\where\blender\lives\blender.exe`

before running `make icons` or `make icons_geom`

The python scripts needed some small modifications since
without the PATHEXT, SystemRoot and SystemDrive
environment variables python will not initialize properly
on windows. (Not blender related, even mainline python
won't start without those)
2021-08-04 19:32:24 -06:00
438d645a36 PyDoc: Update GPU Example of draw_view3d
This function was changed in rBc8004ab4078c98c54a70113c12bbb186403e90cf but didnt update the example.

Part of T84227
2021-08-04 20:25:50 -04:00
171433e841 PyDoc: Improve description of texture.evaluate
Inspired by the old 2.49 docs: https://docs.blender.org/api/249PythonDoc/Texture.Texture-class.html#evaluate
2021-08-04 19:26:01 -04:00
d6ca7ab20e Cleanup: make format 2021-08-04 19:24:19 -04:00
1ab1d6665c Merge branch 'master' into temp-geometry-nodes-fields-prototype 2021-08-04 18:13:45 -05:00
07b702f828 Win32 IME: Rename SetInputLanguage()
GHOST_ImeWin32::SetInputLanguage() has a confusing name because it does
not set the input language. It actually retrieves the current input
locale from the OS and caches the value of the current input language
ID. Therefore this patch renames it to "UpdateInputLanguage"

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

Reviewed by Ray Molenkamp
2021-08-04 14:30:16 -07:00
1d1020b79f Win32 IME: Remove ime_status_
This removes one member of GHOST_ImeWin32 that is not used and cannot
be used in the future. It is holding the result of ImmIsIME, which is
whether an input language supports IME. It does not indicate that one
is in use, turned on, composing, in English mode, etc.

see D12131 for more information.

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

Reviewed by Ray Molenkamp
2021-08-04 13:20:45 -07:00
49acc52e02 Cycles: make object Fast GI Approximation panel a subpanel of Shading 2021-08-04 20:52:29 +02:00
8abf6efcf6 Cleanup: rename restrict to hide/visibility in Object, Collection, MaskLayer
This makes the internal naming consistent with the public API. And also gives
us a visibility_flag rather than restrictflag that can be extended with more
flags.
2021-08-04 19:18:34 +02:00
Romain Toumi
10b9621079 Fix Cycles material slots list being too short
Bring it in line with Eevee.

Differential Revision: https://developer.blender.org/D11982
2021-08-04 18:43:39 +02:00
ae920d789e VSE: Allow Wingdings and Symbol Fonts
This patch makes us less restrictive on the allowed types of FreeType
font character maps we allow, rather than primarily unicode-only. This
allows us to use some legacy, symbol, specialty, and proprietary fonts
like Wingdings. Note we were a little less restrictive with vfonts,
used for 3D Text Objects, so this patch primarily helps VSE.

See D12124 for details and examples.

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

Reviewed by Brecht Van Lommel
2021-08-04 09:31:01 -07:00
b5bfb5f34c UI: VFont Display Names
When displaying the names of fonts for 3D Text objects, use the same
format as shown in File Browser: Family name + Style name. They are
currently shown with Postscript Name, which doesn't match well.

see D12069 for more details.

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

Reviewed by Campbell Barton
2021-08-04 08:34:28 -07:00
c18d91918f Cycles: More flexible GI Approximation AO distance control
The goal: allow to easily use AO approximation in scenes which combines
both small and large scale objects.

The idea: use per-object AO distance which will allow to override world
settings. Instancer object will "propagate" its AO distance to all its
instances unless the instance defines own distance (this allows to
modify AO distance in the shot files, without requiring to modify props
used in the shots.

Available from the new Fats GI Approximation panel in object properties.

Differential Revision: https://developer.blender.org/D12112
2021-08-04 17:26:24 +02:00
58ba75f9e3 LibOverride RNA API: add removal of properties and operations.
This should complete the basics of RNA API for library overrides.

Ref. T86656.
2021-08-04 16:57:08 +02:00
a8185d2d74 LibOverride: Add RNA API to reset/delete overrides.
Ref. T86656.
2021-08-04 16:57:08 +02:00
2af789d1f3 Added some TODO remarks. 2021-08-04 16:05:49 +02:00
c1730ed165 GPencil: New Brush option to define Caps type
This is used to set the default caps type for the stroke. Before always was rounded and only could be changed later in Edit mode

Two new buttons has been added to topbar.

NOTE: New icons are been designed (T90414)

The buttons are expanded to list in Properties panel.

Reviewed By: mendio, HooglyBoogly

Differential Revision: https://developer.blender.org/D11999
2021-08-04 15:54:54 +02:00
145270d8d7 Fix T90427: Center View to Mouse broken
rBfb87d236edb7 made the values returned by `projmat_dimensions` more
standardized following the documentations. But the functions in Blender
that called `projmat_dimensions` followed a proposal that these values
corresponded to a distance of 1m of clip.

Adjust these functions to follow the new algorithm.
2021-08-04 10:46:54 -03:00
e5d4a0c559 BLI: add double version of 'scaleform'
No functional changes. New utility.
2021-08-04 10:46:54 -03:00
26c2c617b4 Fix T90421: edit-mode auto-smooth crash when angle set to 180degrees
Error in 39b2a7bb7e
which failed to set edge flags with single threaded calculation,
used for low poly models.
2021-08-04 22:40:25 +10:00
Gavin Li
76dcf70dac Fix transparent faces on certain AMD cards
This patch fixes an issue with missing faces when assigning a material slot other than the first to faces on AMD TAHITI cards. Refer to T78390 and T74024 for a description of this issue.

This patch also incorporates fix from T78390 for KAVERI.

{F9029258}

Reviewed By: fclem

Differential Revision: https://developer.blender.org/D9305
2021-08-04 13:22:44 +02:00
d2130c5327 Cleanup: remove *.rej from cb67bfdba2 2021-08-04 21:09:21 +10:00
add719e31a Tweak to recent liboverride API addition: naming.
Rename new API function introduced in recent rB3b0fab6dfaa0 to match our
convention to put the action (verb) at the end of names:
`operations_update`.

Sorry for not catching that during review.
2021-08-04 12:38:13 +02:00
ac6b263906 Cleanup: inconsistent parameter name 2021-08-04 12:32:25 +02:00
557e7f135e Cleanup: initialize variable to quiet warning 2021-08-04 12:31:48 +02:00
051141acde Outliner/LibOverrides: Fix logic of checks for drag'n'drop of Collections.
Previous check was too blunt, preventing e.g. re-organization of
collection overrides inside a local parent collection, which is
perfectly valid operation.

Reported by @hjalti from the studio, thanks!
2021-08-04 11:42:13 +02:00
d9a530c55e Fix compile error without WITH_OCEANSIM enabled
Was changed in 218df99410.
2021-08-04 11:30:24 +02:00
Pratik Borhade
8c21076add Fix T87635: Rename shader node "Specular" to "Specular BSDF"
Node name edited in Specular node definition

Reviewed By: fclem

Maniphest Tasks: T87635

Differential Revision: https://developer.blender.org/D11022
2021-08-04 11:21:44 +02:00
Gottfried Hofmann
c8004ab407 Expose Color Management as argument for gpu.types.GPUOffScreen.draw_view3d()
Fix for https://developer.blender.org/T84227

The problem was that https://developer.blender.org/rBe0ffb911a22bb03755687f45fc1a996870e059a8 turned color management for offscreen rendering off by default, which makes it non-color-managed in some cases. So the idea here is that script authors get the choice wether they want color managed non-color-managed output. Thus this patch introduces a new argument do_color_management as a bool to gpu.types.GPUOffScreen.draw_view3d().

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D11645
2021-08-04 11:20:22 +02:00
Anthony Edlin
b867df903f Make loopcut drawing consistent between gizmo and operator.
Loopcut drawing from gizmo had thicker lines because
it was using line smoothing without alpha blend, compared
to thin jagged lines from operator.

Make the drawing anti aliased and consistent by using
3D_POLYLINE/3D_POINT shaders, and making sure alpha
blending is on.

Reviewed By: #eevee_viewport, fclem

Differential Revision: https://developer.blender.org/D11333
2021-08-04 11:19:24 +02:00
cb67bfdba2 Viewport normal drawing with constant length
Patch for: T37878

{F10169694}

Reviewed By: fclem

Differential Revision: https://developer.blender.org/D11487
2021-08-04 10:55:05 +02:00
218df99410 Modifier: warn if the ocean simulation fails to allocate memory
While most modifies don't handle out of memory cases, ocean simulation
could attempt huge allocations: 2048 gb at the maximum resolution.

Resolves T83952.
2021-08-04 18:29:43 +10:00
3b0fab6dfa Override: API update_operations.
The update_operations function will update the override structure of the
local object. When working with overrides the override structure is only
updated when the work-file is stored. When using scripts you might want
to enforce the update of override properties and operations.

This function removes a hack on the test cases.

Reviewed By: mont29

Maniphest Tasks: T86656

Differential Revision: https://developer.blender.org/D10848
2021-08-04 09:28:18 +02:00
effc048710 T90371: Asset: Drop Material Tooltip.
This patch changes the drop named material tooltip to give feedback to
the user what is going to happen when they invoke the change.

There are 3 states:
* "": Operator will be canceled as not all data is present (dropping on
  background.)
* "Drop <named material> on <object name> (slot <slot number>, replacing
  <current material in slot>).
* "Drop <named material> on <object name> (slot <slot number).

Reviewed By: Severin

Maniphest Tasks: T90371

Differential Revision: https://developer.blender.org/D12106
2021-08-04 08:58:39 +02:00
cd92b2350f Cleanup: use C comments for descriptive text 2021-08-04 13:34:02 +10:00
10464843dd Cleanup: add comment to fix for T90417 2021-08-04 13:34:02 +10:00
Johnny Matthews
0f45576590 Geometry Nodes: Curve Set Spline Type
This node sets the selected (or all) splines in curve to a chosen target
spline type. Poly, Bezier, and NURB splines can be converted to any of
the other types. This is meant to be a building block node, useful in
many procedural situations.

In the future the node could be optimized with multi-threading, or by
avoiding copying in many cases, either by retrieving the curve for write
access or by passing the raw vectors to the new splines where possible.

With edits from Hans Goudey (@HooglyBoogly)

Differential Revision: https://developer.blender.org/D12013
2021-08-03 23:14:03 -04:00
26f1a5e2c8 Fix T90417: font loading creates duplicate ID names
Also repair any errors in existing files.

Error from e0dd3fe587.
2021-08-04 13:02:59 +10:00
5950b3ab73 Cleanup: de-duplicate ID renaming utility for versioning 2021-08-04 12:43:07 +10:00
71dc134f89 Icons: add license headers to utilities 2021-08-04 11:45:43 +10:00
7389fd9a35 Icons: resolve various issues for generating icons
- INKSCAPE_BIN environment variable was ignored by
  alert_icons_update & prvicons_update.
- `make icons` wasn't regenerating alert icons.
- Updating SVG icons failed using blender built with ASAN.
2021-08-04 11:35:05 +10:00
8a1c1279b3 Icons: update alert icon script
Missed from c549d736cf.
2021-08-04 11:03:23 +10:00
0d2589d08c Cleanup: spelling 2021-08-04 10:03:07 +10:00
b1c98ad8ee Fix compile warning 2021-08-03 16:51:01 -04:00
fb87d236ed Fix calculation of 'projmat_dimensions'
`r_left`, `r_right`, `r_bottom` and `r_top` were ignoring `clip_near` value
when in perspective view.

Also rename `projmat` to `winmat` in these cases.
2021-08-03 17:35:35 -03:00
e9d95fddf9 Add tweaked mesh extrude node from Fabian 2021-08-03 16:30:48 -04:00
782d240a1b Fix crash in the Is Viewport node 2021-08-03 16:12:18 -04:00
36055ba366 Remove density max socket from the point distribute node 2021-08-03 16:05:10 -04:00
18d900caca macOS: Fix OpenMP dynamic loader error. 2021-08-04 01:22:27 +05:30
236576fc91 Support anonymous attributes in the proximity node 2021-08-03 15:49:20 -04:00
e7d57e84bb Move "Align Rotation to Vector" to a function node without geometry
The node is still slightly finnicky, I may have done something wrong here.
But it generally works.
2021-08-03 15:07:55 -04:00
b5573bfbf4 Merge branch 'master' into soc-2021-porting-modifiers-to-nodes-extrude 2021-08-03 21:02:56 +02:00
41357d556f Fix broken logic in Windows directory query function
Mistake in a5bbdd6998
2021-08-03 19:37:34 +02:00
3b2522650b Don't show face corner domain in the geometry delete node 2021-08-03 12:56:26 -04:00
eacc1f1ff4 Fix raycast and geometry delete node for multi-spline curves 2021-08-03 12:51:13 -04:00
39e914cee7 Fix select engine buffer having wrong vertex size
The theme used was wrong and the vertex size is twice as set in the theme.
2021-08-03 13:37:55 -03:00
57281b73c4 Install_deps: Always re-create shortcuts to installed lib paths.
For some reasons looks like those shortcuts could get out of sync, which
created weird hard to understand building errors.

So for sake of simplicity and security, just re-create them all the
time, just like we update ld paths.
2021-08-03 17:22:48 +02:00
652fbc2005 macOS: Portable builds with dynamic libraries.
For Blender.app: dropping libomp.dylib next to Blender executable is
enough for it getting picked up since `@executable_path` is an rpath.

For non-distributed binaries datatoc, makesdna, tests etc, code for
copying libomp.dylib to build folder is removed and replaced by
CMake's rpath option for *build* tree.

For bpy.so, the post build rpath change has also been replaced by CMake
rpath option for *install* tree.

Since -id has been changed in D11748, remove the
`install_name_tool -change ...` command.

Any dylib can just be dropped at `MAC_BLENDER_TARGET_DYLIBS_DIR`
hereafter. Appending dylib path to `CMAKE_BUILD_RPATH` will be needed
for datatoc etc if linked against one (instead of copying the
dylibs around).

Reviewed By: #platform_macos, brecht
Differential Revision: https://developer.blender.org/D11997
2021-08-03 20:49:40 +05:30
a25a1f39aa Cleanup: interface, reduce indentation of copy_to_selected_button()
Reduce cognitive complexity of `copy_to_selected_button()` by flipping
conditions, returning early, and using `continue`.

No functional changes.
2021-08-03 17:12:08 +02:00
4e1a1821e0 Fix T90313: Align to Transform Orientation Axis Property Doesn't Work
`Orientation Axis` is a property incompatible with `Align` mode and
should not be visible.
2021-08-03 11:29:36 -03:00
391af6bea2 Cleanup: Replace int with bool for pointcache function
Was using an int for boolean return value.
2021-08-03 15:51:25 +02:00
7724251af8 WM: don't store selection properties typically set in the key-map
While this was already the case for the most part
some selection operators stored common settings for reuse such as
"toggle", "extend" & "deselect".

Disabling storing these settings for later execution
as it means failure to set these options in the key-map re-uses
the value of the shortcut that was last called.

Skip saving these settings since this is a case where reusing them
isn't helpful.

Resolves T90275.
2021-08-03 23:33:40 +10:00
9562a90632 Merge branch 'master' into temp-geometry-nodes-fields-prototype 2021-08-03 09:01:23 -04:00
d3dd735fea UI: building without Python again
Also quiet some warnings.
2021-08-03 22:45:37 +10:00
cec103d5a9 Silenced clang-tidy warnings. 2021-08-03 13:56:46 +02:00
0342fb5d20 Fix T90387: division by zero when trying to invert scale
Fix division by zero when `BKE_bone_parent_transform_invert()` inverts a
scale vector with zero components.

Zero values in the to-be-inverted vector are now simply skipped, i.e.
remain zero after inversion. This at least ensures that
`invert_v3_safe(invert_v3_safe(vector))` results in the same vector.

This commit does NOT fix the conceptual problem that an inversion of a
potentially non-invertible vector is relied upon. It just avoids the
division by zero.
2021-08-03 13:43:42 +02:00
dbd34a5acb Fix T90364: buttons (partially) behind animchannel search block search
When channels are scrolled to be (partially) behind the search bar,
their widget buttons would still be interactive, preventing the seach
buttons to be usable.

We have to make sure the events are consumed from the search and dont
reach other UI blocks.
We can do so by flagging the block `UI_BLOCK_CLIP_EVENTS` -- but also
have to make sure the bounds are calculated correctly (otherwise the
check relating `UI_BLOCK_CLIP_EVENTS` in `ui_but_find_mouse_over_ex` wont
trigger properly.

Maniphest Tasks: T90364

Differential Revision: https://developer.blender.org/D12103
2021-08-03 13:20:50 +02:00
b35a96e195 Fix T90346: particle force field self effect amount off by one
When calculating the particle step in `get_effector_tot`, we have to
round up (otherwise we might get an extra round in the for-loop in
`BKE_effectors_apply` for certain cases).

Example from the report:
- 10.000 particles, Effector Amount 3
- was rounding the step down to 3333
- going into the for-loop for 0, 3333, 6666 and 9999 (4 times)
- now rounding the step up to 3334
- going into the for-loop for 0, 3334 and 6668 (3 times as desired)

Maniphest Tasks: T90346

Differential Revision: https://developer.blender.org/D12113
2021-08-03 13:07:46 +02:00
20d5d7b8ec Blender Readfile: Fix annoying useless Object reading error messages.
Extend the 'reading error' container to produce the generic short
message in the popup directly visible by the user, and move all detailed
info the `INFO` reports that only show up in the console and Info
editor.
2021-08-03 12:54:05 +02:00
c6f64d46ed Cleanup: USD importer, consistent naming of function parameter
Rename function parameter `flags` to `read_flag` in the declaration, to
be consistent with the definition.

No functional changes.
2021-08-03 12:44:16 +02:00
Michael Kowalski
ea54cbe1b4 USD: add USD importer
This is an initial implementation of a USD importer.

This work is comprised of Tangent Animation's open source USD importer,
combined with features @makowalski had implemented.

The design is very similar to the approach taken in the Alembic
importer. The core functionality resides in a collection of "reader"
classes, each of which is responsible for converting an instance of a
USD prim to the corresponding Blender Object representation.

The flow of control for the conversion can be followed in the
`import_startjob()` and `import_endjob()` functions in `usd_capi.cc`.
The `USDStageReader` class is responsible for traversing the USD stage
and instantiating the appropriate readers.

Reviewed By: sybren, HooglyBoogly

Differential Revision: https://developer.blender.org/D10700
2021-08-03 12:33:36 +02:00
28b9dd7b1f Cleanup: Remove redundant checks in File Browser UI script
Was already checking these preconditions in the poll method.
2021-08-03 12:25:38 +02:00
c0900a64ce Fix T90341: Crash opening 2.4 file with File Browser editor open
The file selection parameters (e.g. `context.space_data.params`) are
expected to be unset in certain cases. Reading 2.4 files seems to be one
of them. Hence, code using it should check it's set first. Also added an
assert to a File Browser UI template printing a message when the
parameters are unset, to help debugging the issue.
2021-08-03 12:25:38 +02:00
2ceeaf95a1 Merge branch 'master' into temp-geometry-nodes-fields-prototype 2021-08-03 10:44:41 +02:00
b1a607ce04 Cleanup: deduplicate type conversion logic 2021-08-03 10:38:37 +02:00
f8abc3fb2f Fix T85436: Separate by loose parts doesn't show new objects
Only the "changed" state from the last edit-object was used,
this meant the operator would not perform the necessary update
with multi-object edit-mode.

Use "changed" & "changed_multi" naming convention.
2021-08-03 18:13:06 +10:00
d6e97a53ab Correct task ID in 00b57136e4 2021-08-03 18:13:06 +10:00
b54e741a8b UI: Add light count to viewport statistics
Even though lights were part of `SceneStats`, they were not used when
rBfd10ac9acaa0 was committed.

This patch adds the light count back into the statistics. When a light is
the active object, it will display the total number of lights in the
scene, as well as how many lights are currently selected.

{F10141354}

Reviewed By: #user_interface, Severin, Blendify, harley

Maniphest Tasks: T88512

Differential Revision: https://developer.blender.org/D11387
2021-08-03 09:42:53 +02:00
00b57136e4 Revert "Fix spin-gizmo not allowing click events to select vertices"
This reverts commit 0b903755a9.

This caused T86030, left-mouse selection override clicking,
which is used for creating a full revolution.
2021-08-03 16:34:26 +10:00
Jeroen Bakker
6f50969406 Cleanup: Hide implementation details for ED_keyframe_keylist.
For T78995 we want to change the data structure of keylists to
improve performance. (Probably a Vector with bin-search capabilities).

This patch hides the internal structure of the keylists behind `AnimKeylist`
structure. This allows us to change the internals without 'breaking' where it is
being used.

The change adds functions to create, free, find and walk over the
keylist.

Reviewed By: sybren

Maniphest Tasks: T78995

Differential Revision: https://developer.blender.org/D11974
2021-08-03 08:10:21 +02:00
Jeroen Bakker
ebd55b4acd T90372: Assets: When dropping material use active material slot.
Currently when dropping an asset the first material slot is always updated.
This patch changes that logic to update the active material slot.

In future the behavior will be updated to use the material slot of the face under the cursor.
That requires better feedback tot he user.

Reviewed By: Severin

Maniphest Tasks: T90372

Differential Revision: https://developer.blender.org/D12056
2021-08-03 08:08:20 +02:00
Miguel G
a53feb0aff Fix T89691: Solidify modifier simple/complex inconsistency
Maintain the sign when clamping non zero offset.

Reviewed By: campbellbarton, weasel

Ref D11832
2021-08-03 16:00:32 +10:00
c1a477b497 Cleanup: use C++ comments or 'if 0' for commented code 2021-08-03 15:27:20 +10:00
1973fd89df Fix crash adding custom normals
Caused by error converting this file to C++
eccdced972.
2021-08-03 15:01:39 +10:00
c8de9dc2a4 Cleanup: Unused variable warning 2021-08-03 00:28:03 -04:00
f8f2873b44 Support fields in the curve set handles node 2021-08-03 00:11:20 -04:00
648fa6d89e Support fields in the curve subdivide node 2021-08-02 23:58:33 -04:00
d24419564e Fix unhandled switch cases 2021-08-02 23:58:19 -04:00
184be40aa1 Support field selection in the mesh to curve node 2021-08-02 23:49:33 -04:00
6131506689 Support anonymous attributse in the select by material node 2021-08-02 23:42:01 -04:00
e5f43cf4b7 Support fields in the material assign node 2021-08-02 23:33:36 -04:00
770d70127f Support fields and anonymous attributes in the raycast node 2021-08-02 23:29:32 -04:00
801034ba6a Support field selection in the geometry delete node 2021-08-02 22:42:34 -04:00
04c75c5ce7 Edit Mesh: Correct normal calculation for "Set From Faces"
Setting normals from faces wasn't weighting the faces contribution
by the corner angle, giving lop-sided results in some cases.

This removes the epsilon check for CLNORS_VALID_VEC_LEN,
in favor of matching the behavior of vertex normals exactly.
2021-08-03 12:22:11 +10:00
17442bcb7b Merge branch 'master' into temp-geometry-nodes-fields-prototype 2021-08-02 21:54:16 -04:00
223f048138 Fix annotations placement option in the Movie Clip editor
In rB6ee14c966d05362228511756c4906e043b87e346 the enum items were renamed/removed, this change was not propagated to this setting
2021-08-02 20:15:11 -04:00
efd7c95bb2 Cleanup: Remove duplicate special case check 2021-08-02 15:45:25 -04:00
a4813379f9 Fix T90042: Spline tangent calculation assert with coincident points 2021-08-02 15:43:37 -04:00
4f6f445120 Cleanup: Make spline settings copy function public
It will be useful in the spline type conversion node. Theoretically it
could become protected again if that conversion moves out of a node,
which might be a nice improvement after an initial version.
2021-08-02 14:21:19 -04:00
8b93265c19 Mesh: Tag normals dirty instead of calculating
Because mesh vertex and face normals are just derived data, they can
be calculated lazily instead of eagerly. Often normal calculation is
a relatively expensive task, and the calculation is often redundant
if the mesh is deformed afterwards anyway.

Instead, normals should be calculated only when they are needed. This
commit moves in that direction by adding a new function to tag a mesh's
normals dirty and replacing normal calculation with it in some places.

Differential Revision: https://developer.blender.org/D12107
2021-08-02 13:47:32 -04:00
ba9561ab0d Geometry Nodes: Extrude
Differential Revision: https://developer.blender.org/D12108
2021-08-02 19:04:04 +02:00
c659af0c13 Geometry Nodes: Extrude 2021-08-02 19:02:38 +02:00
a2203a27d9 Fix T90356: Frame selected includes active strip
Don't include active strip in this operator.

This was confusing due to name of operator and inconsistent with other
editors.
2021-08-02 18:51:00 +02:00
67d56eb71e Cleanup: Remove unused/unecessary OpenVDB C API
This commit uses OpenVDB more directly for the voxel remesher, without
the extra indirection of copying to a Blender API. This makes the code
simpler, shorter, and easier to understand (though I didn't observe any
performance improvement).

This also removes the rest of the unused and undocumented OpenVDB C API,
which was written when Blender's code didn't really use C++, and doesn't
serve a purpose anymore. Those features will be implemented as nodes in
the future anyway (see D12100).

Differential Revision: https://developer.blender.org/D12097
2021-08-02 12:26:28 -04:00
77187718e4 Fix T78469: Output Metadata: Strip Name no longer accessible
Caused by rB7fc60bff14a6.

This has actually been reported and closed, but that was clearly a
misunderstanding (above commit changed a checkbox to be an enum, but a
second checkbox was simply removed)

Maniphest Tasks: T78469

Differential Revision: https://developer.blender.org/D12084
2021-08-02 17:26:50 +02:00
eccd8af828 Revert "GHOST/X11: enable EGL"
This is causing issues for some users launching Blender, because EGL indirectly
requires GLVND, which is not installed by default on e.g. Ubuntu.

This reverts commit 0b18a618b8.

Fixes T90374

Ref D12034
2021-08-02 17:19:17 +02:00
1062649b5e Fix T87041: Driver Editor not updated in realtime
Caused by {rBbbb2e0614fc3}

Since above commit only the playhead is updated as an overlay in
animation playback (was moved out of drawing of the main region for
perfomance reasons).
The driver value "debug" visualization is very useful to have during
playback though but was left in main region drawing as part of
`draw_fcurve` (thus does not update in realtime anymore).

Moving `graph_draw_driver_debug` into the overlay is not feasible
because it requires animation filtering which has significant overhead
which needs to be avoided in the overlay which is redrawn on every UI
interaction.

Now tag the whole main region for updates in the Driver Editor during
playback instead (which will make the Drivers Editor as slow during
playback as before rBbbb2e0614fc3 -- but with realtime updates of the
debug visualization).

Maniphest Tasks: T87041

Differential Revision: https://developer.blender.org/D12003
2021-08-02 17:11:58 +02:00
3ff5d8f719 Asset Browser: Proper context menu for assets
Add a context menu dedicated to asset operations to the Asset Browser.
There are two separate context menus to keep things separated well and
avoid confusing if-else logic (similar to D12057 & D12059). Their polls
make sure they are displayed for the right contexts only.

Also (to be committed as followup cleanup): Remove now unused special
handling for assets in file delete operator.

Differential Revision: https://developer.blender.org/D12062
2021-08-02 17:00:20 +02:00
ceb049133c Asset Browser: Don't show inapplicable filter and display settings
So far the Asset Browser just showed the same popups and settings as the
File Browser. Not all of them made sense for the Asset Browser though.

* Don't show inapplicable recursion toggle.
* Don't show sorting options, which don't work with assets anyway.
* Don't show the Filter popover, there are currently no applicable items
  in there.

Just like in D12057, I decided to add separate classes for the Asset
Browser case.

Differential Revision: https://developer.blender.org/D12059
2021-08-02 17:00:20 +02:00
d8bf332f86 Asset Browser: Adjust header pulldowns to be Asset Browser specific
So far the Asset Browser just showed the same menus as the File Browser.
Not all of their entries made sense for the Asset Browser though. I
decided to just give them entirely different classes to avoid confusing
if-else checks everywhere. I think the code duplication this adds is a
minor issue, it's better to keep things seperated clearly IMO.

* View menu: Add "Asset Details" toggle for the sidebar region.
* View menu: Remove recursion sub-menu
* View menu: Remove "File Path" region toggle, which doesn't apply for
  the Asset Browser.

Differential Revision: https://developer.blender.org/D12057
2021-08-02 17:00:20 +02:00
James Monteath
0e4f7b4a4b Delete pipeline_config.json file. The yaml file is now used.
Update README.md.
2021-08-02 16:57:29 +02:00
11cfa6c718 Fix T90332: Auto-smooth crashes in edit-mode
Regression in 39b2a7bb7e
that meant non-manifold edges were not being tagged
when they should have been.
2021-08-02 23:58:55 +10:00
d60a7a8744 WindowManager: Support Dynamic tooltips when dragging.
Originally the operator name was drawn next to the dragging content.
After that there was an option to add custom, static text with the
dragging content. This patch allows dynamic text to be drawn.

The custom text was implemented as out parameter of the poll function
what made the code unclear. This patch introduces a tooltip function
that separates tooltip generation from the poll function.

NOTE: the text should always be returned in its own memory block. This
block will be freed after it is copied in the drag struct.

Reviewed By: Severin

Differential Revision: https://developer.blender.org/D12104
2021-08-02 15:13:21 +02:00
dd8be48466 cleanup after merge 2021-08-02 13:07:31 +02:00
5914b8ed6b Merge branch 'master' into temp-geometry-nodes-fields-prototype 2021-08-02 12:56:18 +02:00
8edb2222ae Cleanup: simplify subclassing CPPType
`CPPType` can wrap any C++ type so that code can work
with the wrapped type in a generic way. The goal of subclassing
`CPPType` is to provide additional methods for some types.
For example, the `CPPType` for `Array<int>` could have a `.element_type()`
method that returns the `CPPType` for `int`.
2021-08-02 12:44:17 +02:00
aa60416361 Revert "Asset Catalogs: loading a catalog definition file"
This reverts commit 1f0d6f7635 and the
cleanup 06cb48e1b2. Committed too early on
Monday morning, still has issues that should be resolved first.
2021-08-02 12:07:55 +02:00
06cb48e1b2 Cleanup: Asset catalogs, C++ to C-style comments
No functional changes.
2021-08-02 11:15:50 +02:00
1f0d6f7635 Asset Catalogs: loading a catalog definition file
Initial, limited implementation of loading a single asset catalog
definition file. These files are structured as follows:

  CATALOG_ID virtual/path/of/catalog
  SUBCATALOG_ID virtual/path/of/catalog/child
  SOMETHING_ELSE some/unrelated/hierarchy

These virtual paths will be used to show the catalog in a tree
structure; the tree structure itself is not part of this commit. Each
asset will have one catalog ID that determines where in that tree the
asset shows up.

Currently only a single catalog definition file can be read; merging
data from multiple such files, and writing them out again after changes
are made, is for future commits.

This commit only contains the code to load a single file, and unittests
to check that this actually works. No UI, no user-facing functionality
yet.
2021-08-02 11:08:02 +02:00
50da3cfbd6 Merge branch 'master' into temp-geometry-nodes-fields-prototype 2021-08-02 10:39:37 +02:00
3fd5c93f9c Geometry Nodes: increase threshold to make regression tests pass
The real fix here is to use some kind of relative error in `customdata_compare`
instead of the absolute error used now. If vertex coordinates get larger in magnitude,
the allowed error should increase as well.
2021-08-02 10:38:11 +02:00
de91cdd930 Cleanup: separate base and geometry nodes specific socket cpp type
This simplifies changing how geometry nodes handles different socket types
without affecting other systems.
2021-08-02 10:34:50 +02:00
131e8c0d59 Merge branch 'master' into temp-geometry-nodes-fields-prototype 2021-08-02 10:00:49 +02:00
48722e8971 LineArt: Prevent depsgraph warning when camera is NULL. 2021-08-02 13:45:30 +08:00
1cf45fe10f Cleanup: spelling 2021-08-02 15:22:54 +10:00
Takahiro Shizuki
836aeebf70 IME Win32: Fix Duplicated Initial Character
When entering characters using IME on Windows, Japanese and Chinese
will both usually result in the first keystroke being duplicated. The
problem is that we are informed too late, after the first key is
pressed, that we are IME composing. This patch ensures we are entering
non-English characters using ImmGetConversionStatus() and then deals
with editing keys (like arrows and backspace) on a per-language basis.

see D11929 for more details.

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

Reviewed by Brecht Van Lommel
2021-08-01 11:52:22 -07:00
79277986c2 Cleanup: Sort node types alphabetically 2021-07-31 23:22:36 -04:00
17243337d7 Cleanup: Remove unecessary helper function
Retrieving a mesh's looptris now take's a const mesh after
rB5f8969bb4b4, which removes the need for this function.
Since it's only two lines, avoiding the use of a separate function
in this case is simpler.
2021-07-31 14:26:01 -04:00
2f63303e25 Cleanup: Use const mesh arguments
These functions do not change their source or input mesh,  so it can
be passed with const, which means in one case that a function doesn't
have to be responsible for freeing its argument mesh, which is a clearly
better separation of concerns.
2021-07-30 23:26:35 -04:00
8063f10166 Cleanup: Remove unused includes 2021-07-30 22:28:25 -04:00
37e2fec090 Cleanup: Voxel remesh function naming
- Remove BKE prefix for static functions
- Make specific intermediate functions static
- Avoid unecessary "_to_mesh_nomain" suffix
2021-07-30 22:18:44 -04:00
7c961e716d LineArt: Fix(unreported): Child object respect collection visibility. 2021-07-31 10:02:47 +08:00
524908146c Cleanup: Reorder functions
The Quadriflow remeshing was in the middle of the voxel remesh code.
2021-07-30 21:51:47 -04:00
d91c266986 LineArt: Material flag versioning correction.
By the patch made it in master the version value already advanced (see https://developer.blender.org/D11839), so this versioning code needs to be moved down to that point.
2021-07-31 09:29:39 +08:00
e9dc6a0e09 UI: Show a notification when saving preferences
So far the only way to know if they were saved properly was
to check the terminal.

Also notify when preferences fail to save.
2021-07-31 03:15:10 +02:00
35894dc700 Cleanup: Simplify logic, follow style guide for integer types
- Use `int` instead of `unsigned int` for mesh indices
- Use C++ types (Array, float3, IndexRange)
- Use range based for loops
2021-07-30 15:08:43 -04:00
54bd5efa68 Fix build error in debug builds and uninitialized structs
This BMesh iterator hadn't been used in C++ code yet, and needed
a macro for a proper cast. The parameter structs need to be initialized
when declared without designated initializers.
2021-07-30 14:28:55 -04:00
549e2b7539 Compositor: Buffer iterators tests
See D11882 for a description of the iterators.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D12001
2021-07-30 20:20:27 +02:00
d2675c3c5d Cleanup: unneeded default constructor definitions 2021-07-30 20:20:27 +02:00
5762e7a679 Compositor: Fix wrong number of threads during constant folding
The variable was uninitialized at that point of execution.
2021-07-30 20:20:27 +02:00
4dbf4eb100 Assets: Rename "Mark Asset" operator to "Mark as Asset"
This naming change was agreed on during the asset workshop. See
https://code.blender.org/2021/06/asset-browser-workshop-outcomes/#terms-definitions.
2021-07-30 20:18:22 +02:00
96fb21f3af UI: Move Mark/Clear asset out of ID Data in Outliner context menu
They are now always shown in the top-level of the Outliner context menu.
Having them in the ID Data submenu was just a hassle to work with, and
often confusing to users - even if technically correct (the asset status
is part of the ID data).

Part of T82680.
2021-07-30 19:41:19 +02:00
a9ea310d30 Cleanup: Move remesh files to C++
This will be helpful for some cleanups I'd like to do, including
removing the unecessary C API for OpenVDB and unifying some
attribute transfer code.
2021-07-30 13:15:01 -04:00
0b10a96474 Assets: Disable File Browser only operators for asset browsing
These operators shouldn't be available in the Asset Browser.

https://developer.blender.org/T83556

Added a comment to each operator poll assignment to explicitly mention
the intention. That should also remind devs to decide if the operator
should apply for both file & asset browsing when copy & pasting operator
definition code.
2021-07-30 19:07:51 +02:00
f7836019b3 Fix incorrect poll function used for file path dropping
The operator to drop file paths into the File Browser was just checking
if there's an active window. This wasn't really an issue since the
operator was only used as drop-operator for the File Browser. But the
operator would show up in the operator search. Plus, for asset browsing,
we'll also have to check the file browsing mode, so the more specific
poll function will be needed.
2021-07-30 19:07:51 +02:00
9ac782b823 Fix EGL version being printed on every startup
After the switch to enable EGL over GLX. No need to print this debugging
information always.
2021-07-30 18:44:26 +02:00
c1ec2e9d5f Cleanup: compiler warnings 2021-07-30 18:44:26 +02:00
3848507511 Cleanup: clarify license and origin of voronoi and dithering code 2021-07-30 18:44:26 +02:00
b90887da5a Cleanup: Refactor logic of file deletion poll callback
* Early exit instead of complex if-else blocks.
* Avoid iterating over entire file list.
* Use `true`/`false` for boolean values.
* Declare variables in smaller scopes.
2021-07-30 18:42:38 +02:00
aedd43b33f support field in Points to Volume node 2021-07-30 17:37:07 +02:00
adb437ad3f support socket inspection for fields 2021-07-30 17:16:00 +02:00
3b2a6bf8e8 UI: Don't show Windows file association operator in search on other OSes
The Windows-specific "Register File Association" operator would show in
the search menu of other platforms. Decided to not disable it at
compile-time, like we do it with "Toggle System Console" (another
Windows-only operator), because that would require workarounds for the
translation tools. Instead the operator poll function always returns
false on unsupported platforms now.
2021-07-30 16:43:05 +02:00
3316e28418 Preferences: Move "Register File Association" to preferences level
The operator was register as a "file" operator, which are by convention
used for File Browser operators only. Move it to the "preferences"
operators, where it's displayed in the UI too.
2021-07-30 16:25:34 +02:00
e7e9364d23 Cleanup: remove disabled code from property lookup
This allowed custom ID-properties to share a name-space
with regular properties which won't work well as the names may collide.
2021-07-31 00:23:23 +10:00
4c3d4ebefc Cleanup: remove redundant ifdef check
The define that was tested no longer exists.
2021-07-31 00:15:23 +10:00
eb2a6f454b Fix T90318: Dragging asset while Asset Browser is still loading crashes
This partially reverts cb0b017d8f: We can't store the asset handle in
the drag data, because the file pointer it wraps may be freed as the
Asset Browser generates its file list.
2021-07-30 15:54:54 +02:00
c106ed8fcd fix 2021-07-30 15:22:03 +02:00
11a6a56982 support fields in point translate node 2021-07-30 15:10:41 +02:00
0a7ab583a5 fix noise node 2021-07-30 15:04:14 +02:00
4647ffd918 Cleanup: Remove unused file description storage
This isn't used at all in the current File and Asset Browser design.
2021-07-30 14:34:33 +02:00
c8b7745172 Cleanup: headers, use 'pragma once', remove argument to '\file' 2021-07-30 22:29:30 +10:00
5aa45c43f2 Cleanup: missing leading '*' from comment blocks 2021-07-30 22:20:31 +10:00
09009ce062 automatically change type in attribute node when selecting attribute 2021-07-30 13:56:40 +02:00
88e774aa34 Cleanup: workaround for unstable formatting in clang-format
Running multiple times would re-indent differently.
2021-07-30 21:56:14 +10:00
Flix
a787bcbf5c Fix: script.reload() operator reloads current app template
Ref D12040
2021-07-30 21:43:22 +10:00
dc502fad43 support passing attribute field from modifier 2021-07-30 13:42:07 +02:00
James Monteath
8796a2827f Update REAME.md file 2021-07-30 13:40:48 +02:00
b98735ec29 Kernel: include header file in BKE_appdir.h defining size_t
In `BKE_appdir.h`, include `<stddef.h>` as that defines `size_t`. This
follows the "include what you use" principle, and makes it possible to
use `BKE_appdir.h` without having to bother with its dependencies.

No functional changes.
2021-07-30 13:16:14 +02:00
3abce9e633 support modifier inputs again 2021-07-30 12:30:32 +02:00
dad5c3991c cleanup 2021-07-30 12:23:19 +02:00
dab3a07659 cleanup 2021-07-30 12:02:05 +02:00
53a724c804 Merge branch 'master' into temp-geometry-nodes-fields-prototype 2021-07-30 11:39:59 +02:00
020431408f Cleanup: limit scope of temporary variables
Also remove early return as it duplicates cleanup calls.
2021-07-30 16:44:39 +10:00
93eb460dd0 Cleanup: clang-format (re-run after v12 version bump) 2021-07-30 16:19:19 +10:00
f81a6a2ff1 Cleanup: spelling in comments 2021-07-30 16:16:38 +10:00
63f7eceb53 PyAPI: defer freeing existing properties on registration
Registering a property could remove the existing property,
then fail to parse one of the arguments of the new property -
leaving the struct without a property.

Now freeing the existing property is deferred until immediately
before the new property is registered.
2021-07-30 16:04:08 +10:00
d06b03f80d PyAPI: include the property name & type in registration errors
This gives useful context in errors,
also remove newline endings from exceptions.
2021-07-30 16:04:00 +10:00
9764d90fda Cleanup: use pyrna_enum_value_parse_string parser for enum args 2021-07-30 16:03:56 +10:00
228edcaedd Cleanup: bpy.props variable names
- Use `default` instead of `def` abbreviation.
- Rename `BPYPropArrayLength` to `BPyPropArrayLength`
  in keeping with other local structs.
- Remove _PyArg_Parser.fname value accidentally left in
  (harmless as it's not used).
2021-07-30 16:03:52 +10:00
a2b8dad469 PyAPI: support accessing the original value for RNA enum parsing
Needed in siturations when the input argument is needed for exception messages.
2021-07-30 16:03:47 +10:00
ddcb6b1023 Cleanup: replace macros with converter callbacks for bpy.props
Macros were used for expanding shared logic for some properties.

Replace this with Python converters & a funciton that handles
deferred registration.

Add generic converter functions for RNA enums:

- pyrna_enum_value_parse_string
- pyrna_enum_bitfield_parse_set
2021-07-30 11:57:43 +10:00
5280d4bf0b GPencil: Fix unreported problems painting after import SVG
After doing an import, the bounding box of the stroke was not calculated and any operation related to brushes (Sculpt, Weight Paint and Vertex Paint) was not working as expected because the bounding box of the stroke was wrong.

This problem was solved automatically after any edit operation, but must be solved in the import process.
2021-07-29 22:30:48 +02:00
8f05520083 Fix T89213: Some modifier properties have wrong subtype
This commit resolves these RNA warnings:
```
offset: "", WARN (bpy.rna): ...\source\blender\python\intern\bpy_rna.c:1505 pyrna_enum_to_py: current value '65536' matches no enum in 'FloatProperty', 'offset', 'subtype'
project_limit: "", WARN (bpy.rna): ...\source\blender\python\intern\bpy_rna.c:1505 pyrna_enum_to_py: current value '65536' matches no enum in 'FloatProperty', 'project_limit', 'subtype'
falloff_radius: "", WARN (bpy.rna): ...\source\blender\python\intern\bpy_rna.c:1505 pyrna_enum_to_py: current value '65567' matches no enum in 'FloatProperty', 'falloff_radius', 'subtype'
```
2021-07-29 17:16:08 -03:00
bacde38b67 refactor point distribute node 2021-07-29 21:41:01 +02:00
d9b128baf2 don't show anonymous attributes in attribute search 2021-07-29 21:40:50 +02:00
ae6c063b33 don't show anonymous attributes in spreadsheet 2021-07-29 21:03:52 +02:00
67e7aee853 fixes 2021-07-29 20:56:59 +02:00
302ab3ff7c cleanup 2021-07-29 19:56:54 +02:00
4352d1beb5 support anonymous attribute field input 2021-07-29 19:38:39 +02:00
32cb953b9b anonymous attribute fields 2021-07-29 19:28:58 +02:00
1d92a4d1a0 initial anonymous attributes implementation 2021-07-29 19:16:09 +02:00
0b18a618b8 GHOST/X11: enable EGL
This will replace GLX with EGL for X11. GLEW does not support GLX and EGL
at the same time. Most distributions build GLEW with GLX support, so we
have to use the externally provided GLEW and build with EGL support.
This effectively sets WITH_SYSTEM_GLEW to OFF for all Linux configurations.

Differential Revision: https://developer.blender.org/D12034
2021-07-29 17:39:55 +01:00
c7b12e31e6 Fix T89976: Mirror Keys By Value performs wrong scale conversion
In the graph editor, Mirror Keys by Value would convert the value to mirror
over, to account for different units for linear & rotational properties.
The conversion was done in the different direction, though, resulting in
values that were too large by a factor of (180/pi)^2.
2021-07-29 18:34:10 +02:00
cae18abef4 deps/win: Remove media foundation dep for ffmpeg
This caused a blender load error on windows N,
given we do not use these codecs they can safely
be disabled.

This will fix T90200 once the new libraries are
in SVN
2021-07-29 10:21:43 -06:00
8f12457c25 Fix T90295: inconsistent render pass order between Cycles and Eevee 2021-07-29 17:59:03 +02:00
0b0c2901f6 Render: remove unused Blender Internal view layer settings
These should have been removed earlier but were forgotten.
2021-07-29 17:59:03 +02:00
646f7ef73c Render: disable Z pass by default, leave only Combined
It was somewhat arbitrary to have this one pass enabled that adds a bit of
additional memory and render time overhead, even though it's not necessarily
more important than others.
2021-07-29 17:59:03 +02:00
2d3e5eda3f Assets/UI: Resolve major asset view UI template limitation
Before this, all asset view templates showing the same asset library
would show the same assets, even if they should show different ID types.
That was a major limitation since the design did forsee that this
template can be put anywhere in the UI to display various sub-sets of
assets.

Initially I did the ID type filtering close to the asset-list reading,
because I wanted to optimize reading so that we would only actually read
asset information from disk of the ID type to be shown. But this will be
quite complex and I'm not sure if I'll get to work on this anytime soon.
So this commit moves the filtering to the template display level solving
this limitation.

Note: This also adds the code to filter by tags, together with the ID
type. But it's not actually used anywhere yet.
2021-07-29 17:35:06 +02:00
8cb4e3d046 Cleanup: Remove unnecessary code for asset view UI template
From what I can tell there is no reason anymore to do this. The design
has changed since this was added.
2021-07-29 17:35:06 +02:00
49c0b9ec43 Assets/UI: Sanity check argument for UILayout.template_asset_view()
Was already doing some sanity checks, but wasn't checking if the passed
property actually is a collection property, which is important.
2021-07-29 17:35:06 +02:00
5be54cce36 Cleanup: Pass asset handle to asset iterator, rather than wrapped file
This iterator was introduced before `AssetHandle` existed, so it was
dealing with the file data directly. Now we want as little code as
possible to deal with the file data, all access should happen via the
`AssetHandle`.
2021-07-29 17:35:06 +02:00
b361b2f214 Cleanup: Consistent indent style for asset CMakeLists file
Was mixing 4 and 2 space indent in a single file.
2021-07-29 17:35:06 +02:00
33322086f6 install_deps: update OIDN to 1.4.1, and ISPC to 1.16.0.
Ref. T88438.
2021-07-29 17:00:49 +02:00
ceec7cabf5 install_deps: Update OSL to 1.11.14.1.
This has been a huge pain to get working, for several reasons (new flags
needed, patching is now mandatory, etc.).

Further more, discovered that debian OIIO package is now silently
relying on OpenCV, without even proper handling of this dependency (at
least in the `-dev` package), so had to revert to force-build own OIIO
again on that distro for the time being.

Ref. T88438.
2021-07-29 17:00:48 +02:00
b60e72100b Cleanup: OSL buildlib patch: Remove .rej part.
This patch contained changes for an `.rej` rejection file generated by
failed patch apply... Definitly nothing to do here.
2021-07-29 17:00:48 +02:00
21b4799793 install_deps: Update OIIO to 1.1.15.1.
Ref. T88438.
2021-07-29 17:00:48 +02:00
bd2bfa469f install_deps: Update llvm to 12.0 (with minimal now being 11.0).
Ref T88438.
2021-07-29 17:00:48 +02:00
12d93e44d0 Install_deps: add flex dependency.
Was already installed on Debian-like and Fedore/Suse actually, now also
explicitely required on Arch and listed in docs.

Ref. T88438.
2021-07-29 17:00:48 +02:00
4d28703277 Install_deps: Add zstd dependency.
Ref T88438.
2021-07-29 17:00:48 +02:00
Germano Cavalcante
1775c39986 Fix 'BLI_task_parallel_mempool' keeping 'user_chunk' unchanged
When `BLI_task_parallel_mempool` does not use threading, the
`userdata_chunk` is allocated locally simulating a TLS.

However `func_reduce` is not called so the original chunk is ignored.

`task_parallel_iterator_no_threads` is another function that doesn't call
`func_reduce`. It also ignores `userdata_chunk_local` in the main iterator.

The solution in these cases is not to create a `userdata_chunk_local`.

This fixes T90131

Differential Revision: https://developer.blender.org/D12067
2021-07-29 11:37:10 -03:00
0f1c84f171 deps: Reduce llvm/clang footprint for windows
We shipped the whole bin folder for llvm/clang
while we only needed clang-format, by shipping
just the bits we need we save about 700 megabytes
off our svn lib download.
2021-07-29 07:45:38 -06:00
cafb1bc47f Data-block Preview: Create preview using current frame
The preview was always using frame 1, but maybe the object has changed and it's better create preview using the current frame.

Reviewed By: Severin

Differential Revision: https://developer.blender.org/D12018
2021-07-29 15:08:12 +02:00
24ba931f40 Cleanup: Remove debug-only code 2021-07-29 14:46:54 +02:00
810c88b5f1 Fix building without Cycles logging
Ideally can use assert() checks instead of suppressing the check entirely,
but for now just fix compilation error quickly.
2021-07-29 14:32:10 +02:00
3f84f0123e Cleanup: Fix build warning
Introduced in 3964785a14
2021-07-29 13:11:55 +02:00
jim man
9cc8d50a04 cleanup: editor_image : Remove unused draw functions
These functions are unused currently..

Reviewed By: deadpin, jbakker

Differential Revision: https://developer.blender.org/D11968
2021-07-29 12:46:24 +02:00
5116b7a4c2 Fix Cycles crash with fluid object motion blur disabled
Motion attributes expects mesh to have non-zero number of motion steps,
which was violated in the case when fluid mesh had motion blur disabled.

This is a bit of annoying fix, because of the order of updates. More
ideal solution would be to handle cached and fluid velocities in the
sync_mesh_motion() which ensures all the dependencies between settings.
2021-07-29 12:28:46 +02:00
0491052a96 VSE: Change grid line drawing
Add overlay option to disable grid drawing.
Reuse drawing code from other editors (timeline editor)
Add argument `display_minor_lines` to function
`UI_view2d_draw_lines_x__discrete_frames_or_seconds`
This way minor line drawing can be disabled and so it doesn't cause
too much visual noise. Also spacing seems to be too fine, so VSE uses 3x
what is defined in preferences.

Reviewed By: fsiddi, Severin

Differential Revision: https://developer.blender.org/D11790
2021-07-29 11:38:43 +02:00
5c9979ff03 VSE: don't snap by default
Snapping by default goes against convention, so this setting was
re-evaluated. Also snapping by default can conflict with new image
transform system, see T90156

There wasn't consensus, so disable snapping by default to follow
established convention.

ref T89665

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D12054
2021-07-29 11:38:43 +02:00
3964785a14 UI: Fix time labels drawing
Calculate frequency of time/frame label drawing, such that labels have
at least 10px margin and don't overlap.

Change timecode format:
- Use at least `mm:ss` format
- Don't display frames if all labels would end with +00

Reviewed By: Severin

Differential Revision: https://developer.blender.org/D11792
2021-07-29 11:38:43 +02:00
a70f37bd8a Fix T89952: GPencil channel box selection offset
The channel box selection was offset for grease pencil layers.

This is a proposed fix by @yann-lty

Before:
{F10227973}

After:
{F10227974}

Reviewed By: #grease_pencil, antoniov

Maniphest Tasks: T89952

Differential Revision: https://developer.blender.org/D11962
2021-07-29 10:42:05 +02:00
2472b0f0ef Merge branch 'master' into temp-geometry-nodes-fields-prototype 2021-07-29 10:21:22 +02:00
d5fd09ab58 Fix memory leaks in Python gizmo get/set handlers 2021-07-29 14:32:25 +10:00
3c50687073 Fix gpu.types.GPUTexture crash when the size argument was too big
Missing length check on the size argument before copying it
into a fixed size buffer.
2021-07-29 14:11:37 +10:00
fd0b2b8dfd Cleanup: use PyC_AsArray_FAST function where possible
Oversight in 2453dc1b0e.
2021-07-29 13:41:48 +10:00
bc0a7d3fae PyAPI: support multi-dimensional arrays for bpy.props vector types
- Multi-dimensional boolean, int and float vector types are supported.
- A sequence of int's for the "size" is used to declare dimensions.
- Nested sequences are required for default arguments.

Now it's possible to define matrix properties, for e.g:

  bpy.props.FloatVectorProperty(size=(4, 4), subtype='MATRIX')
2021-07-29 11:09:21 +10:00
2453dc1b0e PyAPI: add multi-dimensional array conversion utility functions
Add array conversion functions that take dimension arguments.

- PyC_AsArray_Multi (version of PyC_AsArray).
- PyC_Tuple_PackArray_Multi_* (version of PyC_Tuple_Pack_*).
2021-07-29 11:04:33 +10:00
0358951b9e Cleanup: spelling 2021-07-29 10:52:08 +10:00
8aa1c0a326 Fix T75028: Improved Font Names in File Manager
When viewing font files in the File Manager, this patch uses the font's
family and style names to show the same type of string shown to users
in operating system lists. For example "Book Antiqua Regular" instead
of "BKANT.ttf"

see D12020 for details and examples.

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

Reviewed by Campbell Barton and Julian Eisel
2021-07-28 11:16:04 -07:00
073bf8bf52 Cycles: remove WITH_CYCLES_DEBUG, add WITH_CYCLES_DEBUG_NAN
WITH_CYCLES_DEBUG was used for rendering BVH debugging passes. But since we
mainly use Embree an OptiX now, this information is no longer important.

WITH_CYCLES_DEBUG_NAN will enable additional checks for NaNs and invalid values
in the kernel, for Cycles developers. Previously these asserts where enabled in
all debug builds, but this is too likely to crash Blender in scenes that render
fine regardless of the NaNs. So this is behind a CMake option now.

Fixes T90240
2021-07-28 19:27:57 +02:00
3bf9675849 Cleanup: Remove unnecesary undefs
Macros `SEQ_ALL_END` and `SEQ_ALL_BEGIN` no longer use `seq->tmp`.
Therefore they are safe to use regardless from where they are called.
2021-07-28 18:16:48 +02:00
40ef71f465 Assets: Improve error message when "Clear Asset" fails
When using "Clear Asset" from the Asset Browser but with an asset
selected that is not stored in the current file, we can show a more
informative error message.
2021-07-28 18:05:25 +02:00
0088b412ff VSE: Fix audio not recalculated
Changing strip offsets with RNA properties didn't tag depsgraph to
update for new strip start/end points.
2021-07-28 17:45:22 +02:00
08154d237f Cleanup: VSE cache invalidated twice
Multiple RNA update function invalidated cache twice.
2021-07-28 17:20:23 +02:00
Wannes Malfait
b304616f2a Fix T90221: geometry viewer node links to other socket types
The viewer node in geometry node trees only supports geometry nodes.
This patch ensures that when ctrl shift clicking on a node, it will only
link to geometry sockets.

Differential Revision: https://developer.blender.org/D12055
2021-07-28 15:54:17 +02:00
3db37075f6 Remove the code in BKE_collection_move to preserve LayerCollection flags.
This code was actually buggy (forcefully re-enabling excluded layers in some
cases).

Further more, it should not be needed now that layerCollection resync code
reuses as much as possible existing layers instead of deleting and
re-creating them all the time.

Differential Revision: https://developer.blender.org/D12016
2021-07-28 15:51:06 +02:00
b18d0244fc LayerCollection: Refactor of resync-with-Collection-hierarchy process.
The goal of this refactor is to improve resync of LayerCollections
hierarchy to match again Collection one.

Current code would destroy and re-create valid layers whenever a parent
collection would be removed, which leads to losing way too often
layer-related settings when editing collection hierarchies.

While this could be partially addressed from operators side, there was
no way to fix those issues from lower level, more generic ID management
code like ID remapping or library override resync processes.

The new code builds a shallow wrapper around existing (aka old) layers
hierarchy, does a set of checks to define the status of all existing
layers, and try to find the closest matching unused layer in cases where
layers and collections hierarchies do not match anymore.

The intent is to both re-use as much as possible existing layers, and
to pick the 'best' possible layer to re-use, following those heuristics:
 * Prefer layers children of current one first (in old hierarchy), and only
   use those from other higher-level hierarchies if no (grand-)child is found.
 * Prefer to use closest layers available in the old hierarchy.

NOTE: The new code is about 12%-15% slower than the previous one, which is
expected given the increased complexity. Note that this would not be an
issue in practice if this code was not called way too often (needs to
be converted to lazy update instead, which is a long known TODO).

NOTE: The LayerCollectionResync code uses its own built-in version of
FIFO queue, as performances in this code is currently a critical point
(it can get called tens of thousands of times during a single (heavy)
ID management operation currently, in a production file e.g.).

Differential Revision: https://developer.blender.org/D12016
2021-07-28 15:51:06 +02:00
Wannes Malfait
31fcb934a4 Fix T89415: update multi input indices after deleting a node
When deleting a node, links attached to that node are deleted, but if one
of those links was connected to a multi input socket, the indices of the
other links connected to it were not updated. This adds updates both in
the case of a normal delete as well as after a delete with reconnect.

Differential Revision: https://developer.blender.org/D11716
2021-07-28 15:43:24 +02:00
626be25646 support attribute search in Attribute node 2021-07-28 15:41:00 +02:00
8132383662 new index node and fixes 2021-07-28 15:12:53 +02:00
f9308a585e Fix particle system duplication duplicates all systems
Followup to rB3834dc2f7b38 (where getting the proper particle system was
fixed for the Adjust Last Operation panel in the Properties Editor). But
since this operator can also be called from the 3DView, get a current
particle system there as well.

Without this, _all_ particle systems would be copied when executing from
the 3DView (which was never really intended [operator description uses
singular] -- it just happens to use `copy_particle_systems_to_object`
internally as well -- same as the `Copy Active/All to Selected Objects`
operators)).

ref. T83317

Maniphest Tasks: T83317

Differential Revision: https://developer.blender.org/D12033
2021-07-28 15:06:35 +02:00
dfc597202f Fix T90154, T90213: curve issues since recent cleanup commit
Caused by {rB8cbff7093d65}.

Since above commit only one modifier would get calculated and the
displaylist boundingbox was calculated wrong.

Maniphest Tasks: T90154

Differential Revision: https://developer.blender.org/D12037
2021-07-28 14:59:50 +02:00
7d0765cbdc Fix menu poll function being ignored for UILayout.menu
Using `UILayout.menu()` [1] or `UILayout.menu_contents() [2], the menu
would just always be added, the `poll()` check not being executed. As
API user I would expect the `poll()` to deterimine visiblity of the
menu.

[1] https://docs.blender.org/api/current/bpy.types.UILayout.html#bpy.types.UILayout.menu
[2] https://docs.blender.org/api/current/bpy.types.UILayout.html#bpy.types.UILayout.menu_contents

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

Reviewed by: Campbell Barton
2021-07-28 14:44:45 +02:00
f95214e9ae support implicit conversion of fields 2021-07-28 14:04:14 +02:00
8e9d06f5a0 LineArt: Camera Overscan
Expand camera effective region to a portion beyond image frame so strokes won't end right at the border.

Reviewed By: Antonio Vazquez (antoniov)

Differential Revision: https://developer.blender.org/D12049
2021-07-28 19:55:29 +08:00
dde42e19e3 support cpptype inheritance for templates 2021-07-28 13:37:29 +02:00
544ddcdaac Fix (studio-reported) liboverride resync crash after recent changes.
Recent own rBabf3ce811f6e prevented any LayerCollection update during
the whole liboverride resync process, for both performances and feature
reasons.

However that means that the various runtime caches like the Base GHash
are not cleared anymore during ID remapping process, so we need to call
`BKE_main_collection_sync_remap` instead of `BKE_main_collection_sync`
when we finally are ready for this update.

Reported by @eyecandy (Andy Goralczyk) from Blender studio, thanks!
2021-07-28 12:33:16 +02:00
f90a83f816 support field in Point Instance node 2021-07-28 12:30:56 +02:00
433b4ae22a better field support in attribute fill node 2021-07-28 12:05:53 +02:00
23e217eafc support position input in noise node 2021-07-28 11:49:30 +02:00
87153cf019 progress 2021-07-28 11:33:00 +02:00
08122a7794 Merge branch 'master' into temp-geometry-nodes-fields-prototype 2021-07-28 10:54:16 +02:00
91dd1a1ba3 VSE: Add tooltips for add_effect_strips operator
This patch adds propper tooltips to the effect strips in the "Add" menu.
Note that not all effect strips are actually in the "Effect Strips"
submenu like color strips, text strips or transitions. For these types
of effect strips, a dediacted tooltip is especially useful.

Reviewed By: ISS

Differential Revision: https://developer.blender.org/D11714
2021-07-28 10:16:43 +02:00
ce68888d1b Cleanup: reduce indentation in bpy.props
Remove unnecessary NULL checks.
2021-07-28 13:38:35 +10:00
f5cc348610 VSE: Draw strips transparent during transform overlap
While transforming a strip, draw the background semi-transparent
if it overlaps with another strip. It's convenient to see what's
underneath, especially with the upcoming Overwrite feature.

Thanks to @iss for the help and review.
2021-07-27 20:14:22 +02:00
ae034d27d2 Deps: ensure osl/bin/oslc is using static libpng
Pass `-DLINKSTATIC=ON` to the OSL CMake, to ensure it statically links to
our libpng. Previously this was only applied on Windows, it's now on all
platforms.
2021-07-27 19:49:29 +02:00
7e91a60be6 Add StringRef::trim() functions
Add three functions that trim characters from the front & end of a
`StringRef`. All functions return a new `StringRef` that references a
sub-string of the original `StringRef`.

- `trim(chars_to_remove)`: strips all characters from the start and end
  that occur in `chars_to_remove`.
- `trim(char_to_remove)`: same, but with a single character to remove.
- `trim()`: remove leading & trailing whitespace, so same as
  `trim(" \r\n\t")`

Reviewed By: JacquesLucke

Differential Revision: https://developer.blender.org/D12031
2021-07-27 19:49:29 +02:00
c6ba7359ae Fix LLVM 12 symbol conflict with Mesa drivers, after recent Linux libs update 2021-07-27 17:45:17 +02:00
f4abd3cfc4 Fix LibOverride crashing in some cases where reference linked data gets MIA.
When the root of an override hierarchy disapears, there is no way to do
a proper resync, just abort.

Reported by studio, thx.
2021-07-27 17:41:15 +02:00
Himanshi Kalra
4a02b9ffeb Regression Testing: Running tests based on blend files
Runs tests based on blend files with minimum python interaction.
Developed as part of GSoC 2021 - Regression Testing of Geometry Nodes.
Earlier, tests were built from scratch by adding a modifier/operation
from the Python API.
Now, tests can also be created inside blender and are compared using
Python script.

Features: Automatically adding expected object if it doesn't exist.
This patch adds tests for the following Geometry Nodes category:
* Curves
* Geometry
* Mesh
* Points

The implemented UML diagram for refactoring of mesh test framework.
{F10225906}

Technical Changes:
SpecMeshTest: It adds the modifier/operation based on the Spec provided.
BlendFileTest: It applies already existing modifier/operation from the blend file.

Test folders hierarchy with tests. This folder should be extracted to `lib\tests\modeling`
{F10240651}
Note: The `geometry_nodes` folder might lie under another `geometry_nodes` folder while extracting, please double check. Use the inner-most one.
The hierarchy should be:
-`lib\tests\modeling\geometry_nodes\mesh`
-`lib\tests\modeling\geometry_nodes\points`
and so on.

* From `ctest` the tests should be run as `ctest -R geo_node -C [Configuration]` on Windows.
* Each single test can be run with its entire name e..g `ctest -R geo_node_geometry_join_geometry`.(just an example). Run `ctest -N -R geo_node` to see all tests.
* From blender, the tests can be run `blender -b path\to\blend\file --python path\to\geo_node_test.py`

Reviewed By: zazizizou, JacquesLucke

Differential Revision: https://developer.blender.org/D11611
2021-07-27 21:01:15 +05:30
58af171bc0 initial support for noise node 2021-07-27 17:15:13 +02:00
d6d44faff0 Fix memory leak with Python RNA property get callback errors
Failure to return a list of the expected size & type wasn't
decrementing the value, leaking a reference.

Caused by 127b5423d6 a workaround for the
real error that was fixed f5e020a7a6.
2021-07-28 01:12:26 +10:00
c98a535f5f fix 2021-07-27 17:06:57 +02:00
8262e6a0c1 progress 2021-07-27 17:00:37 +02:00
c00cc9fd60 improve 2021-07-27 16:29:34 +02:00
0a31b1f044 initial attribute field 2021-07-27 16:01:37 +02:00
5e3b33dfe8 Merge branch 'master' into temp-geometry-nodes-fields-prototype 2021-07-27 15:49:46 +02:00
Charlie Jolly
766e67e55d Geometry Nodes: Add node labels to Attribute maths nodes
This adds the operator name to the node label which is consistent with the shading nodes.
The vector node has `Vector` as a prefix.

The Attribute nodes already have a different coloured header.

The same label is used when collapsing nodes, this helps readability.

Reviewed By: pablovazquez

Differential Revision: https://developer.blender.org/D10749
2021-07-27 14:34:08 +01:00
07688ca2d2 Added YAML builtbot config file.
Builtbot is switching over from json to yaml. Both
configuration files should be kept in sync for now.

The json file will be removed when everything works as expected.
2021-07-27 15:06:43 +02:00
db4fe8e322 BlenRead: Add GHash-based search for already read linked IDs.
Ths commit adds a new `IDNameLibMap` to `Main`, used during file reading
to quickly find already read linked IDs.

Without that, search would use string-based search over list of linked
data, which becomes extremely slow and inneficient in cases where a lot
of IDs are linked from a same library. See also {T89194}.

Extrem-usecase reported in T89194 is now about 4 times faster in linked
data reading (about 2 times faster for the whole .blend file loading).

More normal cases (like Sprites studio production files) have barely
measurable speed improvements, a few percents at best.

NOTE: `main_idmap` API was extended to support insertion and removal of
IDs from the mapping, avoids having to re-create the whole thing several
time during libraries expansion in readcode.

Differential Revision: https://developer.blender.org/D11757
2021-07-27 14:53:49 +02:00
e37c876cd7 PyAPI: support different int sizes for PyC_AsArray 2021-07-27 22:38:50 +10:00
58eacb8e7c Cleanup: pass sizeof array element to PyC_AsArray
Replace the is_double argument which was only used for single/double
precision floats.

This allows supporting different sized int types more easily.
2021-07-27 22:36:01 +10:00
f716060408 improve 2021-07-27 14:33:35 +02:00
aa092f4e6f Merge branch 'master' into temp-geometry-nodes-fields-prototype 2021-07-27 13:54:17 +02:00
b1a2abd6b2 Fix missing passes update on Use Denoising change
Makes it so Render Layers node in the compositor is updated as soon
as Use Denoising is changed for the final render.

Differential Revision: https://developer.blender.org/D12010
2021-07-27 11:48:14 +02:00
c5e5ac4a17 Deps builder: OIIO/OSL/ISPC/OIDN/LLVM/Flex updates
This diff somewhat snowballed out of updating OIDN to 1.4.1 it had some
changes that allowed us to remove the arm hacks we had in place and
revert to using identical versions for a whole bunch of deps. But that
required an update to ISPC which needed a newer LLVM and if we're
updating LLVM we may as well update OSL, and when we update OSL, OIIO
may as well be dragged in soo......anyhow...

This diff updates:

LLVM 9.0.0 (11.0.1 for mac/arm) -> 12.0.0
OIIO 2.1.15.0 -> 2.2.15.1
OSL 1.11.10.0 -> 1.11.14.1
winflex_bison 2.5.5-> 2.5.24 (ispc needed newer bison, windows only dep)
OIDN 1.4.0 -> 1.4.1
ISPC v1.14.1(random hash for mac/arm) -> v1.16.0
Flex 2.6.4 (ISPC needed newer Flex than available on CentOS 7)

and removes most of the "special arm/mac" versions. I think just ssl and
embree are left with special versions.

notable changes:
@LazyDodo included some clang headers in the linux/mac harvest which are
needed to start writing custom clang based tooling like D9465 these were
already shipping on windows, but not the other platforms.

[macOS] Change the `LC_ID_DYLIB` of OpenMP  for {D11997}. This changes
where the executables look for dylibs.

Reviewed By: sebbas, LazyDodo

Differential Revision: https://developer.blender.org/D11748
2021-07-27 10:15:31 +02:00
5a07174ce3 Cleanup: add note from T85517 fix 2021-07-27 18:14:08 +10:00
b331acf477 Cleanup: comment spelling & punctuation 2021-07-27 18:06:29 +10:00
675d8a9c43 LineArt: Occlusion accuracy fix.
This patch fixes occlusion function to handle one specific case (when an edge shares a point with triangle) better,especially when there's overlapping edges in this case.
2021-07-27 14:02:34 +08:00
Aaron Carlisle
6ee14c966d Anotations: Fix a several issues with stroke placement
Previously, this option was not exposed in the UI, only for the clip editor.
There were also multiple rna properties that did the same thing for each of the 2D editors.

There was also an issue where the property enum items were the same as the 3d view which didnt make much sense.

Reviewed By: antoniov

Differential Revision: https://developer.blender.org/D12027
2021-07-26 18:53:30 -04:00
05315af81d Fix compile error on macos introduced in last commit
std::optional::value() is not available on macos.
2021-07-26 22:44:56 +02:00
Christoph Lendenfeld
6a903d9088 Fix: Instantly hide bones after hitting H key in pose sliding
When using a pose slider it is possible to hide bones with the 'H' key.
Before this patch the screen didn't update, so you had to move the mouse 1 pixel to update.
This patch makes it so it updates right away

Reviewed by: Sybren A. Stüvel
Differential Revision: https://developer.blender.org/D12024
Ref: D12024
2021-07-26 21:42:04 +01:00
a4a72bffd3 Compositor: Full frame Box Mask node
Adds full frame implementation to this node operation.
No functional changes.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D11627
2021-07-26 21:43:30 +02:00
e33814ef6b Compositor: Full frame Levels node
Adds full frame implementation to this node operations.
No functional changes.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D11749
2021-07-26 20:13:55 +02:00
883fb49d4f Compositor: Fix memory leak when exporting operations on debug 2021-07-26 20:13:03 +02:00
a117794f8c Compositor: Full frame Scale node
Adds full frame implementation to this node operations.
No functional changes.

Includes a new operation method `init_data` used to initialize any data
needed after operations are linked and resolutions determined.
Once tiled implementation is removed `initExecution` may be renamed
to `init_rendering` and `init_data` to `init_execution`.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D11944
2021-07-26 20:13:03 +02:00
cf74cd9367 Cycles: upgrade CUDA to 11.4
This fixes a performance regression on Ampere cards, on specific scenes like
classroom. For cycles-x there is little difference, but this is still helpful
for LTS releases, and we need to upgrade at some point anyway.
2021-07-26 19:46:51 +02:00
ad8dfb3823 cleanup 2021-07-26 18:18:11 +02:00
Nikhil Shringarpurey
6eb94d8df2 Cleanup: fix compiler warnings due to implicit cast
Differential Revision: https://developer.blender.org/D11950
2021-07-26 18:04:40 +02:00
22b03e1c68 Fix Python error in benchmark executable detection after recent changes 2021-07-26 18:04:40 +02:00
abf3ce811f LayerCollections: Add a way to prevent their resync with Collection hierarchy.
This is an easy & safe, yet not-so-nice way to address the
LayerCollections vs. Collections hierarchy resync problem.

Currently this resync is enforced everytime something changes in the
Collections hierarchy, which is extremely inneficient, and can even
produce 'loss' of LayerCollection data during complex Collection
processes.

Current example is during Library Overrides resync process. New code:
 * Makes resync significantly faster (between 10 and 15%).
 * Fixes 'disappearing' layer collections settings on sub-collections'
   layers.

NOTE: This is not a proper fix for the underlying issue. However,
implementing and testing the 'lazy update' solution as proposed by
{T73411} requires a significant amount of time (especially in testing
and tracking all places where code would need to ensure LayerCollections
are up-to-date), which is not possible currently.

Differential Revision: https://developer.blender.org/D11889
2021-07-26 17:36:46 +02:00
cee67f3be2 Cleanup: Fix compiler warning in previous commit 2021-07-26 17:25:56 +02:00
a14ee85ccd Fix T90127: Merge Down layer doesn't take the transform location into account
Now the layer transformation is applied before the merge.
2021-07-26 17:20:00 +02:00
bb0e0fde32 cleanup 2021-07-26 17:17:23 +02:00
3472f83f00 cleanup 2021-07-26 17:07:45 +02:00
231b313c55 Mantaflow: Remove Noise Type Option
Mantflow only supports wavelet noise, thus the parameter with only one option is no longer useful.

Differential Revision: https://developer.blender.org/D6770
2021-07-26 10:59:49 -04:00
1b2b07fb18 progress 2021-07-26 16:34:28 +02:00
Germano Cavalcante
3059853732 Cleanup: Rearrange mesh extraction files
In the draw module, it's not easy to identify what its header is, and
where the shared functions are.

So move `draw_cache_extract_mesh_extractors.c` and
`draw_cache_extract_mesh_private.h` to the same folder as the extractors
and rename these files to make them more identifiable.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D11991
2021-07-26 10:25:39 -03:00
64a11ba6a2 progress 2021-07-26 15:21:15 +02:00
a9121640be macOS Cleanup: Remove old version specific code
Reviewed By: #platform_macos, brecht
Differential Revision: https://developer.blender.org/D12021
2021-07-26 18:39:08 +05:30
14f94fd1ca VSE: Fix snapping bugs
Fix hold offset check causing missing snapping point when strip have
only still frames.

Fix effect strips of transformed strips causing snapping to prevoius
strip positions.

Reviewed By: mano-wii

Differential Revision: https://developer.blender.org/D11948
2021-07-26 14:57:13 +02:00
1b53fde9fc Cleanup: missed comment in D12029
No functional change.
2021-07-26 13:25:57 +01:00
71d7505487 Geometry Nodes: Fix vector math project bug
Implementation is incorrect compared to Cycles/Eevee.

Reported by @DrDubosc in comments of T88922.

Differential Revision: https://developer.blender.org/D12029
2021-07-26 13:06:15 +01:00
a0cba9fb95 VSE: Fix truncated label
Label for snapping current frame to strips was cut off and not very readable.

Reviewed By: HooglyBoogly

Differential Revision: https://developer.blender.org/D11951
2021-07-26 12:57:48 +02:00
faa65f151d Revert "cmake: enable Wayland by default"
This reverts commit a2ccd0e495.

This change was part of the still-under-review patch D11489, which
hasn't been accepted yet.
2021-07-26 12:18:53 +02:00
c17a266e29 Revert "GHOST/wayland: use Wayland only when 'BLENDER_WAYLAND' is set"
This reverts commit c971c851d3.

This change was part of the still-under-review patch D11489, which
hasn't been accepted yet.
2021-07-26 12:16:42 +02:00
Stefan Werner
1a3cb90e4e Cycles: Fixed memory leak in ColorSpaceManager
Cached OCIO processors were not freed, instead the color spaces were freed twice.

Reviewed By: brecht, sergey

Differential Revision: https://developer.blender.org/D12011
2021-07-26 11:45:29 +02:00
26d8d2884c Merge branch 'master' into temp-geometry-nodes-fields-prototype 2021-07-26 11:44:31 +02:00
12afb19959 Cleanup: clang tidy 2021-07-26 11:43:51 +02:00
Himanshi Kalra
6abf63f463 Fix T85517: Cannot type Space while holding Shift key in text-field like spaces.
Fix for T85517
Bug: Couldn't type space while holding down the shift key in text spaces (e.g. when saving a file, changing the name of object).

Changes: Removing the key combination of Shift + space in `WM_event_is_ime_switch` method.

Reviewed By: harley, mont29

Maniphest Tasks: T85517

Differential Revision: https://developer.blender.org/D10452
2021-07-26 09:33:03 +02:00
501bca9f5b Cleanup: clang-format 2021-07-26 12:41:49 +10:00
828c66f393 Cleanup: spelling in comments 2021-07-26 12:32:42 +10:00
471d4b105a Cleanup: use doxy comments 2021-07-26 12:32:40 +10:00
a77d203932 UI: Line Art: Rename "Baking" panel to "Bake"
Avoid using verbs for panel names, and be consistent with the
"Bake" panel in Cycles, Ocean Modifier, etc.
2021-07-26 00:03:17 +02:00
0cb25a51de UI: Line Art: Always use Material icon on picker
The Material picker shouldn't change icon based on it's state,
it should always display the Material icon.
2021-07-25 23:59:53 +02:00
6a673b6000 UI: Fix button alignment on Grease Pencil modifiers 2021-07-25 23:57:32 +02:00
8fda1f363a UI: Line Art Modifier: Tweaks to labels and tooltips
- Clearer tooltips for Source Object/Collection.
- Remove redundant Source/Target on labels.
- Always write Grease Pencil with title case.
2021-07-25 23:55:23 +02:00
4886ed2863 Fix T86768, bevel doesn't loop slide sometimes.
Six years ago, Bug T44961 about unwanted spikes had me not do a loop
slide if the angle was too extreme, to avoid unwanted spikes.
The current bug showed that that angle was much too big, and limited
desired behavior in many cases. Changing the angle from 0.25 radians
to 0.0001 radians (about 0.006 degrees) still fixes the original bug
and seems very unlikely to be limiting desired behavior now.
2021-07-25 15:14:37 -04:00
0aad8100ae Fix T89391, etc. Boolean bugs when objects have negative scale.
The old modifier code, now just used for Fast, has code in it to
flip faces of arguments when their tranform's negativity differs
from the main object's transform's negativity.
I had neglected to put that logic in when I made the change that
skipped the round trip through BMesh.
Fixing this means that the results are more what the user expects
when some or all operands have negative scales.
2021-07-25 13:29:45 -04:00
Christoph Lendenfeld
aa32121174 Fix: Remove automatic hiding of bones when using the pose slider
This patch addresses the issue raised in T88340.
When entering a pose sliding operator bones would automatically get hidden.
While technically not a bug it was decided that it is too confusing.
Hiding with 'H' is still possible though, just won't happen automatically

Reviewed by: Sybren A. Stüvel
Differential Revision: https://developer.blender.org/D11883
Ref: D11883
2021-07-24 21:25:23 +01:00
c971c851d3 GHOST/wayland: use Wayland only when 'BLENDER_WAYLAND' is set 2021-07-24 12:30:14 +01:00
a2ccd0e495 cmake: enable Wayland by default 2021-07-24 12:30:14 +01:00
1029577a51 GHOST/wayland: explicitly delete 'GHOST_SystemWayland' when fallback to X11 2021-07-24 12:30:13 +01:00
05c7d935e7 Cleanup: fix warning -Wparentheses 2021-07-24 19:16:13 +09:00
8fe0aecfde UI: Do not abbreviate/shorten wording
Abbreviations are harder to read and understand thus it is best to be direct.
For example without understanding and context it is hard to know exactly what "Len" means.
2021-07-23 20:46:09 -04:00
ede1ce6e9a GTest: Use INC/INC_SYS for Libmv/OSD tests
This change transitions libmv/osd tests to our
blender_add_test_executable macro that explicitly
takes the include directories as a parameter.

This is in preparation for future clean-up of
global include directories.

Differential Revision: https://developer.blender.org/D12012
Reviewed By: sergey
2021-07-23 16:50:13 -06:00
8031326262 Revert "VSE UX: Make Speed Effect strips more user friendly."
This reverts commit 3123f33380 and
a092baa7f9.
2021-07-23 19:00:13 -03:00
Fredrik Hansson
2beff6197e Weld Modifier: add "loose_edges" option
This improve the cloth modeling workflow by allowing you to weld only the
edges that are used for the sewing forces.

Reviewed By: mano-wii, weasel

Differential Revision: https://developer.blender.org/D10710
2021-07-23 18:52:25 -03:00
3123f33380 Many tweaks to f-curve drawing code 2021-07-23 18:47:07 -03:00
Germano Cavalcante
a092baa7f9 VSE UX: Make Speed Effect strips more user friendly.
**Drawing Changes:**
- F-curve drawing for Stretch, Multiply, Length and Frame Number.
- Value drawing when no keyframes for Stretch, Length and Frame Numbers.

General view of the new drawing for each speed effect mode:
{F9796642, size=full}

Detail of the horizontal zero (blue) line in the new `Multiply` mode:
{F9798520, size=full}

Nice to have (but I don't know how):
- Auto adjusting of endframe when using Multiply or Boost.

Differential Revision: https://developer.blender.org/D6110
2021-07-23 18:47:07 -03:00
5e3d0840a3 PyDocs: Fix syntax errors resulting in warnings 2021-07-23 16:50:10 -04:00
c41b93bda5 XR: Fix for Viewport Denoising Artifacts
Addresses T76003. When using VR with Eevee and viewport denoising,
scene geometry could sometimes be occluded for one eye. Solution is
to use a separate GPUViewport/GPUOffscreen for each VR view instead
of reusing a single one for rendering.

Reviewed By: Julian Eisel, Clément Foucault

Differential Revision: http://developer.blender.org/D11858
2021-07-24 00:12:17 +09:00
eb43477851 Fix T89393: crash when selecting edges when geometry nodes has "on cage" turned on
The core problem is that the geometry nodes modifier sometimes support
"mapping" (i.e. it remembers which new vertices correspond to edit mode
vertices) and sometimes it does not, depending on what the nodes are doing.
Also see rB07ce9910f7cc.

The solution here is that the fallback case in `BKE_mesh_foreach_mapped_edge`
does not call the callback with "invalid" indices.

Differential Revision: https://developer.blender.org/D12007
2021-07-23 16:15:18 +02:00
239a74a130 Fix T90065: disable attribute search in places where there is too little context
Differential Revision: https://developer.blender.org/D12008
2021-07-23 16:13:04 +02:00
6ac378e685 Fix: avoid creating improper rotation matrix
This might change the rotation of some instances after a Curve to Points.
Unfortunately, there is not much we can do about that, the math before
was just wrong. The forward and up axis stayed the same though.

Differential Revision: https://developer.blender.org/D12006
2021-07-23 16:10:03 +02:00
25fc77f46c Fix T89829: wrong active context path check in spreadsheet
The problem was that the modifier was reevaluated all the time, even
between showing the attribute search and clicking on the attribute
name. This freed the data referenced by attribute search. The real bug
here was that the dependency graph was tagged for update even
though nothing changed. This was because the spreadsheet thought
its active context has changed and it wanted to compute the new
value to be shown in the spreadsheet.

The reason for the bug was that I confused how the tree-path of a
node editor works. The second element in the tree path contains
the name of the group node in the root tree that we're in (instead
of the first element).

Differential Revision: https://developer.blender.org/D12009
2021-07-23 16:06:41 +02:00
de2c4ee587 Another slight increase in speed for Delaunay CDT.
When the new "need_ids" flag is false and the output type is not
one of the valid BMesh kinds, there is no need to propagate even
a dummy id to all of the faces.
2021-07-23 08:31:40 -04:00
f23b14091f Cleanup: double spaces in strings 2021-07-23 17:04:21 +10:00
ced94bc11c Cleanup: code comments punctuation / spacing 2021-07-23 17:03:51 +10:00
7ce0d9d791 Cleanup: de-duplicate code for edge-split tagging
Share functionality for single and multi-threaded edge-split tagging.

Remove logic that ensured vert & loop indices in bm_mesh_edges_sharp_tag
(missing from fd9fc809b7).
2021-07-23 16:40:51 +10:00
36c0649d32 XR: Reference Space Improvements
Improves control over the XR reference space by using the stage ref
space (user-defined tracking bounds) instead of local ref space
(position at application launch), if available. Also adds an
"absolute tracking" session option to skip applying eye offsets that
are normally added for placing users exactly at landmarks.

By enabling absolute tracking, users can define the tracking origin
in a way that is not linked to the headset position. Instead, the
tracking values given by the XR runtime are left unadjusted and a
user can manually calibrate an "origin" landmark object to adjust to
their real world space.

Can be useful for applications that use external tracking systems
and those that primarily only need to use controllers and not the
headset (e.g. motion capture).

The absolute tracking option requires an update to the VR
Scene Inspection addon to be accessible by regular users.

Reviewed By: Julian Eisel

Differential Revision: http://developer.blender.org/D10946
2021-07-23 14:54:56 +09:00
66548007a8 Cleanup: "position tracking" typo in enum member 2021-07-23 14:54:24 +09:00
eea65cbd42 Cleanup: remove unused BM_mesh_loop_normals_update function
The only difference with BM_loops_calc_normal_vcos was passing in
custom coordinates which may be NULL.
2021-07-23 15:10:59 +10:00
66dfef10a7 Fix error setting sharp edges in recent normal calculation changes
bm_mesh_edges_sharp_tag was called with setting sharp edges enabled.
Error in 39b2a7bb7e.
2021-07-23 15:02:04 +10:00
fd9fc809b7 Cleanup: remove normal assignment from bm_mesh_edges_sharp_tag
This was added in 0b7f581397
but seems not to be needed as the assignment was never correct
since only one corner on either side of the smooth edge had the
vertex normal written to it.
2021-07-23 14:36:40 +10:00
39b2a7bb7e Edit Mesh: multi-thread auto-smooth sharp-edge calculation
Merge the sharp edge tagging into bm_mesh_loops_calc_normals,
this has the advantage that edge tagging can be performed as part of
walking over each vertices edges - instead of tagging in a separate loop.

Even though this will tag edges twice (once for each vertex),
the computation isn't heavy as it's only calculating a dot-product
between the two face users to compare the angle.

This change combined with 4ba06ad0a8
makes BM_loops_calc_normal_vcos around 5.68x faster,
with an overall speedup over 2.6x when transforming a high poly mesh.
(tested on a system with 32 cores).

Reviewed By: mont29

Ref D11970
2021-07-23 12:55:58 +10:00
4ba06ad0a8 Edit Mesh: multi-thread auto-smooth & custom normal calculations
Supported multi-threading for bm_mesh_loops_calc_normals.

This is done by operating on vertex-loops instead of face-loops.

Single threaded operation still loops over faces since iterating
over vertices adds some overhead in the case of custom-normals
as the order used for accessing loops must be the same as iterating
of a faces loops.

From isolated timing tests of bm_mesh_loops_calc_normals on high
poly models, this gives between 3.5x to 10x speedup,
with larger gains for meshes with custom-normals.

NOTE: this is part one of two patches for multi-threaded auto-smooth,
tagging edges as sharp is still single threaded.

Reviewed By: mont29

Ref D11928
2021-07-23 12:54:17 +10:00
3fb47956c0 Man Page: Fix spelling 2021-07-22 20:13:14 -04:00
Christoph Lendenfeld
fafd21b14c Animation: Generic Slider implementation
Extract the slider gui implemented for the pose slide tools.
Generalise it so it can be used by other tools as well.

Reviewed by: Sybren A. Stüvel
Differential Revision: https://developer.blender.org/D9314
Ref: D9314
2021-07-22 23:44:53 +01:00
49e68f15f2 Geometry Nodes: Display Node Warnings in Modifier
With this commit, node warnings added to nodes during evaluation
(not "Info" warnings) will also draw in the modifier. In the future
there could be a "search for this node" button as well.

Differential Revision: https://developer.blender.org/D11983
2021-07-22 17:53:35 -04:00
f76dfe8fb4 Cleanup: Add function to check a curve's spline types
The need for this has come up a few times.
2021-07-22 17:20:04 -04:00
524d172742 Fix: "Bake" automatically calculated handles in set handle node
Because these handles are calculated lazily, we need to make sure they
are calculated before switching to a manually positioned mode.
I doubt it would ever be necessary, but theoretically this could happen
on a per-point level, to avoid calculating handles not in the selection.
2021-07-22 17:11:26 -04:00
Germano Cavalcante
f013e3de81 VSE: Speed Effect layout updates
**Changes:**
- New enums correspond to 4 modes: `Stretch`, `Multiply`, `Frame Number` and `Length`.
- "`Multiply Factor`" has been removed;
- Value corresponding to "`use as speed`" enabled is now the value appended to the `Multiply` enum;
- Value corresponding to "`use as speed`" disabled is now the value appended to the `Frame Number` enum;
- Value corresponding to "`Scale to Length`" enabled is now the value appended to the `Length` enum;
- Except `Stretch` each mode has now its respective control values.

Differential Revision: https://developer.blender.org/D11856
2021-07-22 17:51:07 -03:00
e77a1dc6b0 Fix name used when parsing arguments 2021-07-22 15:29:09 -03:00
1b44b47f69 PyGPU: new method 'GPUFrameBuffer.read_depth'
Method requested by users in order to port addons to new API.
2021-07-22 15:17:48 -03:00
1a91c57320 Compositor: Fix crash when using empty input sources
It's the case of Image or Movie Clip node when not selecting any
source or an empty one.
Render methods expect an output buffer with size, only render
operations with resolution.
2021-07-22 18:51:51 +02:00
b1bf4c2a05 Compositor: Full frame Texture node
Adds full frame implementation to this node operation.
No functional changes.
2021-07-22 18:51:51 +02:00
48e27ad122 Compositor: Full frame Movie Clip node
Adds full frame implementation to this node operation.
No functional changes.
2x faster than tiled fallback.
2021-07-22 18:51:51 +02:00
91e2b1dcaf Compositor: Fix buffer area iterating past the end 2021-07-22 18:51:51 +02:00
5f28a90b34 Compositor: Add coordinates to BuffersIterator
Allows to cover many use cases where iterating both buffers and
coordinates is needed.
2021-07-22 18:05:55 +02:00
97712b018d Fix T90026: attributes added in editmode are lost on modeswitch
When exiting editmode, customdata [and thus attributes] are copied from
**BMesh** to **Mesh** (in `BM_mesh_bm_to_me`).
When adding attributes, these were always added via
`CustomData_add_layer_named` only.
Instead (if we are in mesh editmode), we need to go through
`BM_data_layer_add_named` to properly update the **BMesh** (see
`update_data_blocks`) so we have stuff available to copy back to
**Mesh** when exiting editmode.
Same is done for removing (also going through BMesh).

This is now done, DomainInfo is updated to point to BMesh (instead of
Mesh) customdata when in editmode.

Maniphest Tasks: T90026

Differential Revision: https://developer.blender.org/D11998
2021-07-22 17:57:46 +02:00
Johnny Matthews
0e8d1c6bcf Geometry Nodes: Set Bezier Handle Type Node
This node takes a curve and a point selection and allows you to set the
specified (or all) points left/right or both handles to a given type.

Differential Revision: https://developer.blender.org/D11992
2021-07-22 10:55:50 -04:00
320f34af86 Tests: continue running benchmarks if some tests fail to build or run
Convenient when testing many revisions where some might be broken.
2021-07-22 16:35:00 +02:00
19b597c55d Tests: improve finding of Blender executables in benchmarking
* Allow specifying a folder and automatically setting the proper executable
  name depending on the operating system
* Use executables from configs for listing devices instead of a blender
  command being available
2021-07-22 16:34:57 +02:00
f2cce48698 Versioning: move "until next subveresion bump" code
Move "until next subveresion bump" code into the 300.13 version block.
This should have happened in rB8d5b9478a25.
2021-07-22 15:19:58 +02:00
0eccf57161 Cleanup: Silence warning - unused parameter 2021-07-22 08:59:43 -03:00
Yann Lanthony
574995478a Fix T89733: Py API: bpy.data.orphans_purge argument parsing
On Windows, using `bpy.data.orphans_purge` with some arguments (eg: `do_recursive=True`) does not produce the expected results. This is due to arguments not being parsed correctly on this platform with the current code.

The proposed fix is based on how other functions with boolean attributes are exposed to the Python API.

Reviewed By: #python_api, mont29

Maniphest Tasks: T89733

Differential Revision: https://developer.blender.org/D11963
2021-07-22 12:52:37 +02:00
Philipp Oeser
57668d84cf Make polls for removing mesh data layers consistent
This was reported in T90026 for attributes, but was also true for:
- UVMaps
- Vertex Colors
- Sculpt Vertex Colors
- Face Maps

For Vertex groups and Shapekeys this was already done (in that their
remove poll would check if there is a vertex group or shapekey to begin
with), now make this consistent across all mentioned types.

Thx @vvv for the initial patch (where this was done for attributes only)

ref T90026

Reviewed By: HooglyBoogly

Maniphest Tasks: T90026

Differential Revision: https://developer.blender.org/D11990
2021-07-22 10:11:44 +02:00
8d5b9478a2 Bump subversion to avoid infinite enabling pose_library add-on
Bump Blender's sub-version to make sure the pose_library add-on isn't
auto-enabled on every run of Blender.
2021-07-22 09:51:52 +02:00
64bb49fa4e Cleanup: Move reorganize asset files
I'm trying to move away from general files with lots of things in them,
and instead have many small & focused files. I find that easier to
work with since everything has clear responsibilities, even if there is
some minor overhead in managing all these files.
I also try to differentiate more clearly between public and internal
files. So source files and internal headers are in a `intern/`
sub-directory, public functions are in a number of headers one level
higher.
For convenience and to make this compatible with our existing general
headers in `editors/include`, I made the `ED_asset.h` there include all
these public headers.
This is of course a bit of an experiment, let's see how it works in
practice.

Also corrected the name of `ED_asset_can_make_single_from_context()`.
2021-07-21 20:41:29 +02:00
Germano Cavalcante
178086d581 Draw Cache: extract tris in parallel ranges
The `ibo.tris` extraction in multithread is currently only done if the
mesh has only 1 material.

Now we cache a map indicating the index of each polygon after sort and
thus allow the extraction of tris with materials in multithreaded.

As caching is a heavy operation and was already being performed in
multi-thread for triangle offsets, no significant improvements are
expected.

The benefit will be much greater when we can skip updating the cache
while transforming a geometry.

**Profiling:**
||master:|PATCH:
|---|---|---|
|large_mesh_editing_materials:|Average: 13.855380 FPS|Average: 15.525684 FPS
||rdata 9ms iter 36ms (frame 71ms)|rdata 9ms iter 29ms (frame 64ms)
|subdiv_mesh_final_only_materials:|Average: 28.113742 FPS|Average: 28.633599 FPS
||rdata 0ms iter 1ms (frame 36ms)|rdata 0ms iter 1ms (frame 35ms)

1.1x overall speedup

Differential Revision: https://developer.blender.org/D11445
2021-07-21 15:09:43 -03:00
785d87ee42 Fix T90017: Bone widget drawing inconsistent with editing
The `lines_loose` extractor did not trigger loose geometry caching.
2021-07-21 14:46:53 -03:00
c830c5b16b Cleanup: Move loose geometry cache creation to render data task
This centralizes caching functions.
2021-07-21 14:46:53 -03:00
e850c2b06d Cleanup: Centralize/unify asset library reference from/to enum code
This was an open TODO, I wanted to have code for translating asset
library references from and to enum values in a central place, and
access that in the same way from both the Asset Browser and the
Workspace RNA code.

* Adds own file for the related functions.
* Adds doxygen comments.
* Updates RNA callbacks to properly use these functions.
* Let these functions call each other, avoid duplicating logic.
2021-07-21 19:35:39 +02:00
10e28bd270 Assets: Replace duplicated asset library reference type from DNA
Since recently it's possible to access assets from outside the
File/Asset Browser, via the asset view template. So we are slowly
moving away from file space specific code to dedicated asset system
code. I introduced `AssetLibraryReference` as a duplicate of
`FileSelectAssetLibraryUID`, with a plan to delete the latter in a
separate cleanup commit. That's exactly what this commit is.

This will cause Asset Browsers to open with the default "Current File"
Asset Library. We could avoid that, but it's a minor issue really.
2021-07-21 19:35:39 +02:00
8de2b6a020 Assets: Rename workspace active asset library DNA variable
This new variable was introduced with 7898089de3. We don't usually use
an `active` prefix variable. Plus, this makes the name match the one of
the Asset Browser active library variable, so we can use the
`rna_def_asset_library_reference_common()` helper for both.

This will cause Asset Views to open with the default "Current File"
Asset Library. We could avoid that, but it's a minor issue really.
2021-07-21 19:35:39 +02:00
952ded57de Cleanup: Add missing doxygen file/group comment in new asset file 2021-07-21 19:35:39 +02:00
581a6da804 Fix incorrect use of BLI_assert with error strings
Some asserts were never raised because of invalid checks.
2021-07-22 00:47:29 +10:00
63da2c4082 Cleanup: replace BLI_assert(test || !"text") with BLI_assert_msg(test, text) 2021-07-22 00:46:45 +10:00
Yuki Hashimoto
22bef356ae Cleanup: correct the comment in ghost
The same comments were written in clientToScreen and screenToClient in
GHOST. I corrected them.

Ref D11986
2021-07-21 23:14:03 +10:00
3cfd6439c6 Fix bug in assert in delaunay test.
Assert was trying to say x coords of arcs lined up, and didn't do that.
2021-07-21 08:33:29 -04:00
16804297e6 Cleanup: Split set_preview_visibilty. 2021-07-21 14:12:24 +02:00
d1e1d6c491 Cleanup: replace BLI_assert(!"text") with BLI_assert_msg(0, "text") 2021-07-21 20:59:19 +10:00
bbcc8330f7 Cleanup: spelling 2021-07-21 20:42:11 +10:00
e7082fbdb0 Cleanup: replace BLI_assert(0 && "text") with BLI_assert_msg 2021-07-21 20:39:51 +10:00
ab101d444d Fix T89881: ignore unavailable sockets when searching for link cycles 2021-07-21 11:28:26 +02:00
8b0fac4116 Fix compile issue. 2021-07-21 11:09:52 +02:00
82ff5dd911 Fix i18n utils_cli mistake.
Reported by James Monthea (@jmonteath), thanks.
2021-07-21 10:37:45 +02:00
9aa0a3f533 Cleanup Preview rendering: Separate world preparation.
Small cleanup that moves world preparation out of scene preparation.
2021-07-21 09:35:21 +02:00
75e41b1279 Cleanup: use named enum types.
Added ePreviewRenderMethod and ePreviewType.
2021-07-21 08:18:34 +02:00
265c3a4724 Cleanup: replace NB with NOTE in comments 2021-07-21 13:10:32 +10:00
Smitty van Bodegom
dc8a924efa UI: Use more descriptive wording for particle modifier conversions
Currently the wording is a bit unclear: it doesn't specify //what// the particles will be converted into. This clarifies it by stating what the particles will be converted into: they will either be converted to a mesh or the instances will be made real.

Reviewed By: Blendify

Differential Revision: https://developer.blender.org/D11795
2021-07-20 17:39:25 -04:00
Romain Toumi
14d5a45750 UI: Fix Cycles Materials menu Layout
Fix an incoherence between the Eevee Materials menu and the Cycles Materials menu :

Eevee :
{F10230448}

Cycles :
{F10230449}

Simply Fixed by replacing the Cycles UI code by the Eevee UI code.

Thanks to @Brainzman for helping me create this diff and translate

Reviewed By: Blendify

Differential Revision: https://developer.blender.org/D11979
2021-07-20 17:23:34 -04:00
807bb450a0 Fix API doc generation after recent context additions 2021-07-20 22:07:41 +02:00
bfe6b55aa7 Fix T89827: Attribute transfer node crash on mesh with no faces
Just add a check for whether the mesh has faces when retrieving an
attribute on the corner domain. In the future there could be an info
message in the node in this case, since maybe it's not intuitive.
2021-07-20 15:56:36 -04:00
d3445496b1 Fix memory leak with asset view template operator properties 2021-07-20 21:50:09 +02:00
cb0b017d8f Cleanup: Store asset-handle in drag data
Would previously pass a few properties that are available via the
asset-handle now. This asset-handle is also required for some of the
asset API, e.g. the temporary ID loading. This will probably be needed
before too long.
2021-07-20 21:30:04 +02:00
0af08cea40 Cleanup: Use asset utility function to get the asset .blend path
For this to work, the utility function needs to be callable without
context, which is only needed for a File Browser specific hack anyway
(doesn't apply to this usage of it).
2021-07-20 21:30:04 +02:00
e99801390c Cleanup: Move asset-handle functions to own file
Keeps files minimal and focused. I much prefer that over having all
kinds of stuff in general files like `asset_edit.cc`.
2021-07-20 21:30:03 +02:00
5a1b1c0ed2 Cleanup: Getters for asset-handle data
While the asset-handle design is supposed to be temporary (see
35affaa971), I prefer keeping the fact that it's nothing but a file
entry pointer an implementation detail that is abstracted away. So this
introduces getters for the file data we typically access for
asset-handles.
2021-07-20 21:30:03 +02:00
207df439e1 Cleanup: Use const for internal file data of asset-handle
Note that the current asset-handle design is temporary, see
35affaa971. I still prefer this to be const, as code outside the
asset-list/file-list code should never mess with the file data of an
asset.
2021-07-20 21:30:03 +02:00
36fb03e2b9 Asset: Clearly describe RNA property description as temporary
The asset handle design is only temporary (see 35affaa971) and this
RNA property is only needed for internal, technical reasons of the asset
view template. So although not nice, at least make it clear in the RNA
property description that this should not be used.
2021-07-20 21:30:03 +02:00
8ffc3ee257 Cleanup: Correct asset TODO comment, move setter next to getter 2021-07-20 21:30:03 +02:00
aeee7f390d Fix T89993: Failed assert drawing single point cyclic splines
The same check used for the curve to mesh node.
2021-07-20 14:54:01 -04:00
cf28398471 Fix T89687: Curve to mesh node incorrect face orientation
The new faces should have a winding direction that points them outward,
the fix was swapping the order of each face's edge and vertex indices.
2021-07-20 14:39:24 -04:00
1e063a0242 Cleanup: Use const arguments and less sequential iteration
Using const indexes and offsets helps to make the logic less sequential,
which is hopefully easier to understand and possibly easier to parallelize
in the future. Also order return arguments last.
2021-07-20 14:28:33 -04:00
b65ec08bbb Armature test: properly initialize bone hierarchy
Fix segfault in `BKE_armature_find_selected_bones_test` by property
initializing the bone hierarchy listbases.

No functional changes to Blender.
2021-07-20 19:02:43 +02:00
Jagannadhan Ravi
26b2a35dd4 Speedup rigid body "Copy from Active" operator
If there were lots of selected objects without an existing rigid body,
we would add rigid bodies to them one by one.

This would be slow in python, now we instead do this as a batch
operation in C.

On my (Intel) MacBook it used to take 60 seconds and with this change it
takes about 0.3 seconds.

Reviewed By: Sebastian Parborg

Differential Revision: http://developer.blender.org/D11957
2021-07-20 18:57:12 +02:00
f53ca7e41c Cleanup: Fix missing braces warning on Clang 2021-07-20 21:03:47 +05:30
6754d7aef6 Pose Library: remove assumption about Action group names
Remove the assumption of the pose library that Action groups are named
after the bones in the armature. Even though this assumption is correct
when the keys are created by Blender, action groups can be renamed. Keys
created by Python scripts can also use arbitrary group names.

Since there is more code in Blender making this assumption, and looping
over selected bones is also a common occurrence, this commit contains
some generic functionality to aid in this:

- `BKE_armature_find_selected_bones`: function that iterates over all
  bones in an armature and calls a callback for each selected one. It
  returns a struct with info about the selection states (all or no bones
  selected).
- `BKE_armature_find_selected_bone_names(armature)` uses the above
  function to return a set of selected bone names.
- `BKE_pose_find_fcurves_with_bones()` calls a callback for each FCurve
  in an Action that targets a bone, also passing it the bone name.
2021-07-20 17:12:01 +02:00
c4f71f3193 Cleanup: fix clang-tidy warning readability-qualified-auto
No functional changes.
2021-07-20 17:11:29 +02:00
3e4c98429b Cleanup: fix clang-tidy readability-else-after-return
No functional changes
2021-07-20 17:11:29 +02:00
f763929486 Cleanup: fix clang-tidy warning modernize-use-nullptr
No functional changes.
2021-07-20 17:11:29 +02:00
3ea4c6b9c9 Pose backup: convert from C to C++
Convert `pose_backup.c` (in C) to `pose_backup.cc` (in C++). This will
make future improvements easier. For now, it's the same code with just
some additional explicit casts (C++ doesn't allow implicitly casting
`void *`), `NULL` changed into `nullptr`, and some other simple changes.

No functional changes.
2021-07-20 17:11:29 +02:00
f164188a6d Fix T89981: missing refresh on the compositors render layer node when adding/removing AOVs
Just refresh the node's outputs via ntreeCompositUpdateRLayers().

Maniphest Tasks: T89981

Differential Revision: https://developer.blender.org/D11973
2021-07-20 17:00:01 +02:00
3e29175af3 Fix T89982: Geometry Nodes: 'New' Button tries to create node_tree on active modifier, rather than button context
When done from the Properties Editor, the context's modifier should be
used (this is where the button is located), when done from elsewhere,
the active modifier is still the way to go (since the context modifier is
not available then)

Maniphest Tasks: T89982

Differential Revision: https://developer.blender.org/D11972
2021-07-20 16:53:34 +02:00
Johnny Matthews
83b6fcc70c Fix: Bezier segment node adds handles incorrectly
This caused the "cyclic" attribute to appear dysfunctional.
2021-07-20 09:58:24 -04:00
76a3ff70d5 Fix T89979: Assert in edit mode with curve to mesh node
The node tagged polys normals dirty,  but the function to calculate the
normals didn't clear the dirty flags for polys. Now clear the poly and
corner dirty normal flags.
2021-07-20 09:37:40 -04:00
c3a400b73f Cleanup: use single back-tick quoting in comments
While doxygen supports both, conform to our style guide.

Note that single back-tick's are already used in a majority of comments.
2021-07-20 22:58:14 +10:00
48a45c43e4 Cleanup: use doxygen style parameters in noise.c
These used their own ad-hoc syntax.
2021-07-20 22:54:48 +10:00
9e1fdd1f14 Cleanup: added const keyword to BLI_dlrbTree search functions. 2021-07-20 14:49:49 +02:00
6c5f8bf5aa Cleanup: Remove redundant forward declarations. 2021-07-20 14:49:49 +02:00
9471715720 Fix crash in delaunay C interface test.
The test forgot to set the new need_ids field, which luckily
exposed a bug in the C api for delaunay when that field is false.
Fixed the bug and the test, and added a test for the need_ids false
case.
2021-07-20 07:28:46 -04:00
75c9788c27 Compositor: Fix crash when connecting multiple constant inputs
Operation receiving inputs was being folded more than once
when it was constant foldable.
2021-07-20 12:31:40 +02:00
d218ba8009 LineArt: UI cleanups.
Wording on the UI, slider consistency and material mask switches layout.

Reviewed By: Sebastian Parborg (zeddb)

Differential Revision: http://developer.blender.org/D11839
2021-07-20 13:06:45 +08:00
77e927b58f Cleanup: reserve C++ comments for disabled code
Use C comments for plain text.
2021-07-20 15:01:05 +10:00
fe2f43a15c Cleanup: use '#if 0' for disabling multiple lines 2021-07-20 15:01:03 +10:00
59eb71afa1 Cleanup: Make function static, use const object argument
Also use `const Curve *` instead of `const Object *`, since the
function works at a lower level than objects anyway.

And also remove another unused function. Since this section of code
for converting curves to meshes will likely be replaced, it's nicer to
see which parts actually remain used at this point.
2021-07-19 21:19:59 -04:00
0e9c04a3ea Cleanup: spelling 2021-07-20 11:12:24 +10:00
cf8ea741f2 Cleanup: quiet GCC maybe-uninitialized warning
Function signatures for snap callbacks used `const` incorrectly
which was hidden by casting function types.

This made it seem as if the input arguments wouldn't be change and
wouldn't be initialized.

Name return arguments with an `r_` prefix, order them last,
remove function casts and correct `const` usage.
2021-07-20 11:12:24 +10:00
0733926a34 Cleanup: Remove unused function 2021-07-19 20:51:57 -04:00
24aae7ed63 Docs: Update RNA to user manual mappings 2021-07-19 18:41:58 -04:00
3021f9b48c Cleanup: Clang format 2021-07-19 17:12:01 -04:00
468765d29e Compositor: Export operation results as debug option
When fixing issues, seeing operation results can be helpful for
detecting which operation went wrong.

This commit adds an option for exporting all operations results to
image files.
Exceptions are:
- Output operations: They are already exported or can be seen in UI.
- Constant operations: There are too many and is rarely useful.

They are exported to "<temp session folder>/COM_operations/"
with filenames "<operation class name>_<operation id>.png".
Only works on full frame execution mode.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D11722
2021-07-19 22:05:39 +02:00
9aa88a6604 Compositor: Full frame Brightness node
Adds full frame implementation to this node operation.
No functional changes.
2.4x faster than tiled fallback.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D11677
2021-07-19 22:05:39 +02:00
b35efa932e Compositor: Full frame Mix node
Adds full frame implementation to this node operations.
No functional changes.
2.3x faster than tiled fallback on average.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D11686
2021-07-19 22:05:39 +02:00
300fe84bf0 Compositor: Full frame Viewer node
Adds full frame implementation to this node operation.
No functional changes.
No performance changes.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D11698
2021-07-19 22:05:39 +02:00
b848d5cdf5 Compositor: Full frame Double Edge Mask node
Adds full frame implementation to this node operation.
No functional changes.
No performances changes.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D11750
2021-07-19 22:05:39 +02:00
0a0c2c0217 Compositor: Full frame Ellipse Mask node
Adds full frame implementation to this node operation.
No functional changes.
3x times faster than tiled fallback.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D11635
2021-07-19 21:26:58 +02:00
45b46e5de9 Compositor: Buffer iterators
Currently we mostly iterate buffer areas using x/y loops or through
utility methods extending from base classes.

To simplify code in simple operations this commit adds wrappers for
specifying buffer areas and their iterators for raw buffers with any
element stride:
- BufferRange: Specifies a range of contiguous buffer elements from a
 given element index.
- BufferRangeIterator: Iterates elements in a BufferRange.
- BufferArea: Specifies a rectangle area of elements in a 2D buffer.
- BufferAreaIterator: Iterates elements in a BufferArea.
- BuffersIterator: Simultaneously iterates an area of elements in an
 output buffer and any number of input buffers.
- BuffersIteratorBuilder: Helper for building BuffersIterator adding
 buffers one by one.
For iterating areas coordinates it adds `XRange` and `YRange` methods
that return `IndexRange`.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D11882
2021-07-19 20:06:21 +02:00
582c5530b6 Cleanup: Move asset library reference C++ wrapper to own files
Although currently only the asset list code uses the asset library
reference wrapper, it can stand on its own and may be used in more
places in the future. So I prefer to give it its own source & header
file.

Also removed unused includes, added proper namespaces as per our C++
style guidelines, and removed an unnecessary TODO comment.
2021-07-19 18:28:27 +02:00
ebe32e01e1 Cleanup: Remove unused function, unused declaration 2021-07-19 11:56:52 -04:00
07a77816a1 Fix some mesh edition macro operators incorrectly setting an empty description string.
No operator or macro should be missing description. But if they do, then
they should use NULL pointer, and not an empty string.

This behavior was already enforced (through an assert) for operators,
previous commit made it the same for macros.
2021-07-19 16:05:24 +02:00
bae1b64525 Fix broken 'undocumented' case in registration of Macro opertators.
Code dealing with macro operators missing description field was slightly
different than the one from Operator registration.

This lead to invalid memory accesses in some python introspection cases
like the i18n messages extraction code in `bl_i18n_utils` module.
2021-07-19 16:05:24 +02:00
132522cba8 Cleanup: Separate keyframes_draw and keyframes_keylist.
The keylist functions are used in other places for none drawing related
stuff. Fe pose_slide uses it.
2021-07-19 15:53:04 +02:00
ceb612a79c Revert "Depsgraph: Implement 'ID_RECALC_GEOMETRY_DEFORM'"
This reverts commits
 bfa3dc91b7,
 52b94049f2,
 ae379714e4,
 a770faa811,
 4ed029fc02,
 101a493ab5 and
 62a2faa7ef.

And fixes T89955.

Changing the dependency graph is a can of worms and the result is
a kind of unpredictable.

A different solution will be planned.
2021-07-19 10:17:38 -03:00
62a2faa7ef Object update: Remove fallback from batch_cache_deform_tag
Falback is not really necessary, and causes
`BKE_object_data_batch_cache_dirty_tag` to run multithreaded in an
unsafe way.

No functional changes.
2021-07-19 09:50:53 -03:00
101a493ab5 Fix T89941: No path`s bevel update, when I change bevel profile curve
Update was skipping the batch cache.
2021-07-19 09:47:56 -03:00
ff01070b5c Cleanup: minor correction to delaunay_2d_cdt doc-string
Use more conventional syntax for default arguments.
2021-07-19 11:57:28 +10:00
ee857cc266 Cleanup: remove unused pathlib import 2021-07-19 11:30:27 +10:00
ad7455cd14 Cleanup: remove unused MTex.pmapto, pmaptoneg & defines
These have not been in use since 2.57
fafbd9d71b.
2021-07-19 11:24:24 +10:00
83883ae66a Fix: memcpy overlapping region ASAN warning in curve trim node 2021-07-18 19:24:11 -04:00
75ae328d62 Cleanup: Make curve trim node code more semantically correct
The code used `Spline::LookupResult` in a way that referred to evaluated
points and control points interchangeably. That didn't affect the logic,
but the code became harder to read. Instead, introduce a local struct
to contain the data in a more obvious way.
2021-07-18 19:20:57 -04:00
76f0ef294a Update documentation string for mathutils.geometry.delaunay_2d_cdt. 2021-07-18 15:24:12 -04:00
72d1ddfc9c Make it optional to track input->output mapping in delaunay_2d_calc.
Some uses of delaunay_2d_calc don't need to know the original verts,
edges, and faces that correspond to output elements.
This change adds a "need_ids" value to the CDT input spec, default true,
which tracks the input ids only when true.
The python api mathutils.geometry.delaunay_2d_cdt gets an optional
final bool argument that is the value of need_ids. If the argument
is not supplied, it is true by default, so this won't break old uses
of the API.

On a sample text test, not tracking ids save about 30% of the runtime.
For most inputs the difference will not be so dramatic: it only really
kicks in if there are a lot of holes.
2021-07-18 15:10:34 -04:00
4ed029fc02 Fix T89929: Crash when hiding in the render a previously keyframed volume
Regression introduced in {rBbfa3dc91b754}.

`ID_RECALC_GEOMETRY` should tag all operations of the `GEOMETRY`
component and not just the operation of node `GEOMETRY_EVAL_INIT`.
2021-07-18 15:11:44 -03:00
Angus Stanton
e7a800c52f Geometry Nodes: Curve Trim Node
This node implements shortening each spline in the curve based on
either a length from the start of each spline, or a factor of the
total length of each spline, similar to the "Start & End Mapping"
panel of curve properties.

For Bezier curves, the first and last control points are adjusted
to maintain the shape of the curve, but NURB splines are currently
implicitly converted to poly splines.

The node is implemented to avoid copying where possible, so it outputs
a changed version of the input curve rather than a new one.

Differential Revision: https://developer.blender.org/D11901
2021-07-18 14:09:38 -04:00
24801e0a4a Speed up Delaunay raycast.
From Erik Abrahamsson, this uses parallel loops for raycasting.
It speeds up one example with many crossings of a bezier curve,
from 0.68s to 0.28s.
2021-07-18 12:13:41 -04:00
fc32567cda Versioning: fix vertex group name loss in linked duplicates.
After rB3b6ee8cee708 by @HooglyBoogly vertex groups were moved
to mesh data, and versioning code was provided to upgrade old
files. However, it fails to consider the case of linked duplicates
having different name lists, and dependent on the object order
can cause some of the names to be lost. This can even be all of
them, if there is a duplicate without any names, which can be
easily created by lazy Python code.

To fix this, change the code to use the longest available name list.

Differential Revision: https://developer.blender.org/D11958
2021-07-18 19:09:56 +03:00
Angus Stanton
9eafdb985d Fix: Incorrect logic in spline lookup function
This section of code deals with evaluated points,
so that is the size it should use.
2021-07-18 11:59:23 -04:00
3c8d261557 Greatly improve speed of Delaunay when have a lot of holes.
Using part of a patch from Erik Abrahamsson, this replaces the
use of linked lists for original id tracking by Sets.
I had thought that the lists were unlikely to grow to more than
a few elements, but when the mesh has a lot of holes (whose
original ids go *outside* the hole, and therefore, most of the
mesh), this assumption can be very wrong.
On a Text regression test, the time went from 11.67s to 0.16s
with this fix. I also tested to make sure that Boolean didn't
slow down with this, and found it actually had a very slight speedup.

Using Sets exposed a dependency on the ordering of the items
in the id lists, luckily caught by a mesh intersect regression test,
so fixed that.
2021-07-18 10:48:57 -04:00
Jesse Yurkovich
e82c5c6607 Fix T89868: Crash showing thumbnail of wide-aspect image
Scaling down images could create images with a width or height of zero.

Clamp at 1 to prevent a crash, also add an assert to scaling functions.

Ref D11956
2021-07-18 10:44:02 +10:00
118803893e Cleanup: Simplify realizing of pointcloud instances
Just a small change to make the function slightly shorter.
2021-07-16 15:29:42 -04:00
0793ced8ad Fix T89624: Vertex painting causes mesh to flicker
The `ibo.lines_paint_mask` extractor doesn't have a callback to iterate
bmesh faces, this made `filter_into` ignore the extractor.
2021-07-16 16:20:05 -03:00
e7b441a05c Cleanup: Simplify logic, use C++ types
Also remove an unecessary null check, and make inner loop simpler.
2021-07-16 13:32:25 -04:00
53743adc29 VSE: Fix multicam splitting all selected strips
`split_multicam` used split operator, where if more strips than
multicam were selected, all would be split, which is undesirable.

Add `Sequence.split()` RNA API function. to split individual strips.
Function accepts `frame` and `split_method arguments`. Returns right
strip after splitting.

In case when strip being split have effects, these will be split too, so
no invalid state should be created.

Selection is not handled, this is by design up to user.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D11926
2021-07-16 19:16:35 +02:00
1dcf0f9cf1 Fix T89722: Duplicate macro can cause strips to overlap
Bug caused by 78693d524c accidentally removing overlap handling when
transform operator is canceled.

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D11899
2021-07-16 19:16:35 +02:00
feba1fe974 Cleanup: Move gpencil_geom.c to C++
This will help enable development on optimizations to the perimeter
calculation here. Using C++ data structures like Array can make the
code easier to read as well.

Longer term, this can help improve integration with attributes
and possibly the new curve code (since strokes and curves are
quite similar in theory).

Differential Revision: https://developer.blender.org/D11941
2021-07-16 13:00:33 -04:00
c4df8ac1a4 Fix T89899: Crashes when accessing vertex groups from objects
We need to be more strict about trying to retrieve a list of vertex group
names from objects now, as only three object types support them.
This commit adds a check for vertex group support in a few places, the
data transfer operator/modifier, copying vertex groups to selected
objects, and the vertex group remove and clear functions.

Differential Revision: https://developer.blender.org/D11947
2021-07-16 12:23:55 -04:00
6025897cd6 Cleanup: Get vertex group names directly from grease pencil data 2021-07-16 12:05:21 -04:00
802a59a58a Cleanup: Remove redundant logic
The object type was checked twice unnecessarily. Also use a function
for the check to be more explicit.
2021-07-16 12:02:38 -04:00
1ab6d5c1dc Surface Deform: support sparse binding mode for improving performance.
When a vertex group is used to limit the influence of the modifier
to a subset of vertices, binding data for vertices with zero weight
is not needed. This wastes memory, disk space and CPU cycles.

If the vertex group contents is known to be final and constant,
it is reasonable to optimize by only storing data group vertices.
This has to be an option in case the group can change.

Supporting this requires adding a vertex index field and spliting
the vertex count into mesh and bind variants, but both happen to
fit in available padding. The old numverts field is renamed to the
new bound vertex count field to maintain the array length invariant.
Versioning is used to initialize the other new fields.

If a file with sparse binding is opened in an old blender version,
it is corrupted into a non-sparse bind with vertex count mismatch,
preventing the modifier from working until rebind.

Differential Revision: https://developer.blender.org/D11924
2021-07-16 16:12:00 +03:00
a770faa811 Fix T89875: False dependency cycle on particle systems
`POINT_CACHE_RESET` pointed to `GEOMETRY_EVAL_INIT` while
`GEOMETRY_EVAL_INIT` pointed to `POINT_CACHE_RESET`.

Now `POINT_CACHE_RESET` points to the same nodes pointed to by
`GEOMETRY_EVAL_INIT` thus avoiding the dependency cycle.
2021-07-16 09:53:00 -03:00
15cfb375a3 Fix T89782: Segfault populating popup menu with dimensions above the opengl limit
The crash happens because `GPU_offscreen_create` is called with `err_out` `NULL`.

This patch proposes a solution within the `GPU_offscreen_create` itself
and raises an error report in the interface if a menu is called with
dimensions beyond what is supported.

Ref T89782

Maniphest Tasks: T89782

Differential Revision: https://developer.blender.org/D11927
2021-07-16 09:53:00 -03:00
e78e235cc5 Cleanup: preview rendering, update assumptions in comment
The `action_preview_render()` function used to just render, but now it
also temporarily applies the pose. Its comment is now updated for this.

No functional changes.
2021-07-16 14:48:03 +02:00
3ec9681ac4 Rename UI error message on attributes panel for name collisions
* Name Collisions > Name collisions
* Info icon > Error icon
2021-07-16 14:36:44 +02:00
038345fa56 Fix T89861: Checking face selection breaks UV stitch operator 2021-07-16 17:47:42 +10:00
38131cc5e5 Fix T70356: Scaling up 1x1 pixel image reads past buffer bounds
Also resolve a crash when when displaying thumbnails, see T89868.
2021-07-16 16:58:06 +10:00
f61f4c89bb Cleanup: reduce variable scope in task_iterator.c
Would have prevented the error in
15cdcb4e90.
2021-07-16 14:39:57 +10:00
e26887598f Fix error using uninitialized state in BLI_task_parallel_mempool
Single threaded operation used the state before it had variables
written into it.

Error in 15cdcb4e90.
2021-07-16 12:07:03 +10:00
42017b006e Cleanup: sort struct declarations 2021-07-16 11:48:54 +10:00
bf5b1fa726 Cleanup: remove redundant parentheses 2021-07-16 11:45:52 +10:00
09b89da349 Cleanup: spelling in comments 2021-07-16 11:45:51 +10:00
d3c454d66c Cleanup: compiler warnings 2021-07-16 11:45:03 +10:00
Aidan Haile
98c4224ff0 Fix T49944: Compositor ID Mask Anti-Aliasing not working
Replaces current ID Mask node Anti-Aliasing operation by SMAA
operations with default settings as proposed by Jeroen Bakker.
SMAA produces smoother edges.

Reviewed By: manzanilla

Differential Revision: https://developer.blender.org/D11881
2021-07-15 22:23:31 +02:00
Red Mser
eccd03a826 UI: Flip driver editor debug lines
In driver editor, vertically flip the value debug lines to align
them with the timeline header values. This makes it easier to read
the values. Also set the line width explicitly, which was incorrect
in some cases.

Differential Revision: https://developer.blender.org/D8877
2021-07-15 15:20:37 -04:00
7d618b4dde Cleanup: Clang tidy 2021-07-15 13:40:30 -04:00
a566dc25aa Cleanup: Remove use of designated initializers in C++ code
Does not compile on Windows.
2021-07-15 13:36:40 -04:00
9d9c879f4b Cleanup: Move UI list template code to own file (C++)
This move was already prepared with 788d380460 and 26b098c04f. The
template is quite big already, better to give it its own file. Plus it
could use some C++ features like RAII and maybe some more object
oriented code. I plan further refactoring there.
2021-07-15 19:09:49 +02:00
0cc2a72f94 Fix failing tests from vertex group name parameter copy
It turns out `BKE_mesh_copy_parameters` can be called while other
tools are running calculations, which meant that it was called at the
same time as `armature_deform_coords_impl`. Beause of that, we
shouldn't do any freeing (of the old vertex group names) there.

Since the materials are copied in the "for_eval" version anyway,
it seems to make sense to copy the vertex group name list there also.

Fixes T89877, and also the failing `deform_modifiers` test.

Differential Revision: https://developer.blender.org/D11936
2021-07-15 12:25:36 -04:00
3af0e1f6fd Cleanup: unused variable capture 2021-07-15 18:07:03 +02:00
34771cc9f5 Animation/add-ons: Enable the poselib add-on by default
The new Asset Browser-based pose library is partially implemented in an
add-on. This commit enables the add-on by default, as the old pose
library was built-in and thus always enabled.

The ability to disable the add-on is there mostly for cases where
people/studios want to use their own custom pose library.
2021-07-15 16:19:08 +02:00
72c34068cb Fix T88281: Pose Library 'flip pose' sometimes flips wrong
Correct cases where the X-axis of the bone (in pose space) aligns with
the pose-space Y or Z-axis. In these cases the decomposition of the
matrix fails, and a negative scale of the X-axis turns into a 180°
rotation around the Y-axis. An extra -1 scale to the X and Z axes of the
resulting matrix seems to fix things.
2021-07-15 16:12:37 +02:00
f52e3aa210 Asset Browser: Python mixin utility for category-specific panels
Using this mixin for a panel definition, it's possible to set in which
categories the panel should appear. This is used by the Pose Library
add-on.
2021-07-15 16:12:36 +02:00
8925d3b7bf UI/Assets: Initial Asset View UI template
The asset view UI template is a mini-version of the Asset Browser that
can be placed in regular layouts, regions or popups. At this point it's
made specifically for placement in vertical layouts, it can be made more
flexible in the future.
Generally the way this is implemented will likely change a lot still as
the asset system evolves.

The Pose Library add-on will use the asset view to display pose
libraries in the 3D View sidebar.

References:
* https://developer.blender.org/T86139
* https://code.blender.org/2021/06/asset-browser-project-update/#what-are-we-building
* https://code.blender.org/2021/05/pose-library-v2-0/#use-from-3d-viewport

Notes:
* Important limitation: Due to the early & WIP implementation of the
  asset list, all asset views showing the same library will show the
  same assets. That is despite the ID type filter option the template
  provides. The first asset view created will determine what's visible.
  Of course this should be made to work eventually.
* The template supports passing an activate and a drag operator name.
  The former is called when an asset is clicked on (e.g. to apply the
  asset) the latter when dragging (e.g. to .blend a pose asset). If no
  drag operator is set, regular asset drag & drop will be executed.
* The template returns the properties for both operators (see example
  below).
* The argument list for using the template is quite long, but we can't
  avoid that currently. The UI list design requires that we pass a
  number of RNA or custom properties to work with, that for the Pose
  Libraries should be registered at the Pose Library add-on level, not
  in core Blender.
* Idea is that Python scripts or add-ons that want to use the asset view
  can register custom properties, to hold data like the list of assets,
  and the active asset index. Maybe that will change in future and we
  can manage these internally.

As an example, the pose library add-on uses it like this:
```
activate_op_props, drag_op_props = layout.template_asset_view(
    "pose_assets",
    workspace,
    "active_asset_library",
    wm,
    "pose_assets",
    workspace,
    "active_pose_asset_index",
    filter_id_types={"filter_action"},
    activate_operator="poselib.apply_pose_asset",
    drag_operator="poselib.blend_pose_asset",
)
drag_op_props.release_confirm = True
drag_op_props.flipped = wm.poselib_flipped
activate_op_props.flipped = wm.poselib_flipped
```
2021-07-15 16:12:36 +02:00
6bd42baaeb Cleanup: Use const for UI icon getter function 2021-07-15 16:12:36 +02:00
26b098c04f UI: Support defining UI lists in C
So far all UI lists had to be defined in Python, this makes it possible
to define them in C as well. Note that there is a whole bunch of special
handling for the Python API that isn't there for C. I think most
importantly custom properties support, which currently can't be added
for C defined UI lists.

The upcoming asset view UI template will use this, which needs to be
defined in C.

Adds a new file `interface_template_list.cc`, which at this point is
mostly a dummy to have a place for the `ED_uilisttypes_ui()` definition.
I plan a separate cleanup to move the UI-list template to that file.
2021-07-15 16:12:36 +02:00
bc4f99aa86 UI: New button/widget type for Asset Browser like preview tiles
This button type shows a preview image above centered text, similar to
the File Browser files in Thumbnail Display Mode or the default Asset
Browser display. In fact we may want to port these over to use the new
button type at some point.

Will be used by the asset view UI template that will be added in a
following commit. That is basically a mini version of the Asset Browser
that can be displayed elsewhere in the UI.
2021-07-15 16:12:36 +02:00
0c83ef567c UI: Auto-scroll to keep active text buttons in view
If a text button is activated that is not in view (i.e. scrolled away),
the scrolling will now be adjusted to have it in view (with some
small additional margin). While entering text, the view may also be
updated should the button move out of view, for whatever reason. For the
most part, this feature shouldn't be needed and won't kick in, except
when a clicked on text button is partially out of view or very close to
the region edge. It's however quite important for the previously
committed feature, that is, pressing Ctrl+F to start searching in a UI
list. The end of the list where the scroll button appears may not be in
view. Plus while filtering the number of visible items changes so the
scrolling has to be updated to keep the search button visible.

Note that I disabled the auto-scrolling for when the text button spawned
an additional popup, like for search-box buttons. That is because
current code assumes the button to have a fixed position while the popup
is open. There is no code to update the popup position together with the
button/scrolling.

I also think that the logic added here could be used in more places,
e.g. for the "ensure file in view" logic the File Browser does.
2021-07-15 16:12:36 +02:00
89fd3afd1e UI: Support pressing Ctrl+F over UI lists to search
Adds an operator invoked by default with Ctrl+F that while hovering a UI
list, opens the search field of the list and enables text input for it.
With this commit the search button may actually be out of view after
Ctrl+F still. The following commit adds auto-scroll to solve that.

A downside is that in the Properties, there also is Ctrl+F to start
the editor-wide search. That's not unusual in Blender though (e.g.
scolling with the mouse over a UI list also scrolls the list, not the
region).
2021-07-15 16:12:36 +02:00
87c1c8112f UI: Support UI list tooltips, defined via Python scripts
Makes it possible to create tooltips for UI list rows, which can be
filled in .py scripts, similar to how they can extend other menus. This
is used by the (to be committed) Pose Library add-on to display pose
operations (selecting bones of a pose, blending a pose, etc).

It's important that the Python scripts check if the UI list is the
correct one by checking the list ID.
For this to work, a new `bpy.context.ui_list` can be checked. For
example, the Pose Library add-on does the following check:
```
def is_pose_asset_view() -> bool:
  # Important: Must check context first, or the menu is added for every kind of list.
  list = getattr(context, "ui_list", None)
  if not list or list.bl_idname != "UI_UL_asset_view" or list.list_id != "pose_assets":
    return False
  if not context.asset_handle:
    return False
  return True
```
2021-07-15 16:12:36 +02:00
8edcb3af96 UI: Support left-right arrow key walk navigation in UI lists
Add improved arrow key walk navigation in grid layout UI List templates.
Pressing up or down walks the active item to the adjacent row in that
direction, while left and right walk through the items along the columns
wrapping at the rows.

Note from Julian:
In combination with the following commit, this has the important
limitation that the list's custom activate operator won't be called when
"walking over" an item that is scrolled out of the list. That is because
we don't actually create any buttons for those that could be used for
the handling logic. For our purposes of the pose libraries that should
be fine since the asset view list is always made big enough to display
all items. Solving this might be difficult, we don't properly support
nesting boxes with proper scrolling in regular layouts. It's all just
hacked a bit for UI-lists to work. Overlaps quite a bit with T86149.

Differential Revision: https://developer.blender.org/D11063
2021-07-15 16:12:36 +02:00
ae1dc8f5f9 UI: Internal support for custom UI list item drag & activate operators
For pose libraries, we need to be able to apply a pose whenever
activating (clicking) an item in the Pose Library asset view and blend
it by dragging (press & move). And since we want to allow Python scripts
to define what happens at least when activating an asset (so they can
define for example a custom "Apply" operator for preset assets), it
makes sense to just let them pass an operator name to the asset view
template. The template will be introduced in a following commit.
2021-07-15 16:12:36 +02:00
00c7ea68a8 UI: New UI list layout type for big preview tiles
This new layout type is meant for the upcoming asset view UI template.
With it it is possible to show big asset previews with their names in a
responsive grid layout.

Notes:
* The layout is only available for C defined UI lists. We could expose
  it to Python, but I think there are still some scrolling issues to be
  fixed first. (The asset view template doesn't use scrolling for the UI
  list.)
* I'd consider this a more usable version of the existing `GRID` layout
  type. We may remove that in favor of the new one in future.
2021-07-15 16:12:36 +02:00
788d380460 UI: UI list refactor & preparations for asset view template
This is more of a first-pass refactor for the UI list template. More
improvements could be done, but that's better done separately. Main
purpose of this is to make the UI list code more manageable and ready
for the asset view template.

No functional changes for users.

* Split the huge template function into more manageable functions, with
  clear names and a few structs with high coherency.
* Move runtime data management to the template code, with a free
  callback called from BKE. This is UI data and should be managed at
  that level.
* Replace boolean arguments with bit-flags (easily extendable and more
  readable from the caller).
* Allow passing custom-data to the UI list for callbacks to access.
* Make list grip button for resizing optional.
* Put logic for generating the internal UI list identifier (stored in
  .blends) into function. This is a quite important bit and a later
  commit adds a related function. Good to have a clear API for this.
* Improve naming, comments, etc.

As part of further cleanups I'd like to move this to an own file.
2021-07-15 16:12:36 +02:00
6e01b52100 Assets: temporarily apply pose when generating preview image
When generating a preview image for a pose, temporarily apply it to the
armature. Contrary to the usual pose application, this ignores the
selected bones and always applies the entire pose.
2021-07-15 16:12:36 +02:00
f3610a23d1 Animation: new pose library based on Asset Browser
Introduce new pose library, based on the Asset Browser. Contrary to the
old pose library (in `editors/armature/pose_lib.c`), which stored an
entire library of poses in an `Action`, in the new library each pose is
its own `Action` datablock. This is done for compatibility with the
asset browser, and also to make it easier to attach preview images,
share datablocks, etc. Furthermore, it opens the door to having
animation snippets in the pose library as well.

This commit contains the C code for the pose library; in order to fully
use it, an addon is required as well (which will be committed shortly).
2021-07-15 16:12:36 +02:00
28dc07a153 Animation: add function to blend Action into pose
Add function `BKE_pose_apply_action_blend()`, which blends a given
Action into current pose. The Action is evaluated at a specified frame,
and the result is applied to the armature's pose.

A blend factor can be given to blend between the current pose and the
one in the Action. Quaternions are interpolated with SLERP; it is
assumed that their FCurves are consecutively stored in the Action.

This function will be used in the upcoming new Pose Library.
2021-07-15 16:12:36 +02:00
9473c61b36 Animation: apply pose to all or selected bones of armature
New function `BKE_pose_apply_action_all_bones()`, which will be
necessary for the upcoming pose library v2.0.

This renames the function `BKE_pose_apply_action` to
`BKE_pose_apply_action_selected_bones`, to reflect that it only works on
selected bones, to contrast it to the new function.
2021-07-15 16:12:36 +02:00
b40e05fcd1 Assets: Open Blend File operator
Add operator 'Open Blend File' to the Asset Browser. This operator:
- starts a new Blender process,
- opens the blend file containing the asset,
- monitors the new Blender process, and when it stops,
- reloads the assets to show any changes made.
2021-07-15 16:12:36 +02:00
637731dc61 Assets: Abstraction for temporary loading of asset data-blocks
This is an editor-level abstraction for the `BLO_library_temp_xxx()`
API for temporary loading of data-blocks from another Blend file. It
abstracts away the asset specific code, like asset file-path handling
and local asset data-block handling.

Main use-case for this is applying assets as presets that are based on
data-blocks, like poses. Such preset assets are an important part of the
asset system design, so such an abstraction will likely find more usage
in the future.
2021-07-15 16:12:36 +02:00
55d48defc5 File/Asset Browser: Extend file-entry and asset handle Python API
Adds the following to `bpy.types.FileSelectEntry`:
* `id_type`: The data-block type the file represenets, if any.
* `local_id`: The local data-block it represents, if any (assets only).

And the following to `bpy.types.AssetHandle`:
* `local_id`: The local data-block the asset represents, if any.

This kind of information and the references are important for asset related
operators and UIs. They will be used by upcoming Pose Library features.
2021-07-15 16:12:36 +02:00
a26a059244 Assets: Initial Asset List as part of the Asset System design
Implements a basic, WIP version of the asset list. This is needed to
give the asset view UI template asset reading and displaying
functionality.

See:
* Asset System: Data Storage, Reading & UI Access - https://developer.blender.org/T88184

Especially the asset list internals should change. It uses the
File/Asset Browser's `FileList` API, which isn't really meant for access
from outside the File Browser. But as explained in T88184, it does a lot
of the stuff we currently need, so we (Sybren Stüvel and I) decided to
go this route for now. Work on a file-list rewrite which integrates well
with the asset system started in the `asset-system-filelist` branch.

Further includes:
* Operator to reload the asset list.
* New `bpy.types.AssetHandle.get_full_library_path()` function, which
  gets the full path of the asset via the asset-list.
* Changes to preview loading to prevent the preview loading job to run
  eternally for asset views. File Browsers have this issue too, but
  should be fixed separately.
2021-07-15 16:12:36 +02:00
add6fa0924 Assets: Show asset path in asset browser sidebar
It's useful to know where an asset is stored in, before this there was no way
to tell this. This could probably be displayed nicer in the UI but we're
currently unsure how. But at least the information is there now.
2021-07-15 16:12:36 +02:00
35affaa971 Assets: AssetHandle type as temporary design to reference assets
With temporary I mean that this is not intended to be part of the
eventual asset system design. For that we are planning to have an
`AssetRepresentation` instead, see T87235. Once the `AssetList` is
implemented (see T88184), that would be the owner of the asset
representations.

However for the upcoming asset system, asset browser, asset view and
pose library commits we need some kind of asset handle to pass around.
That is what this commit introduces.
Idea is a handle to wrap the `FileDirEntry` representing the asset, and
an API to access its data (currently very small, will be extended in
further commits). So the fact that an asset is currently a file
internally is abstracted away. However: We have to expose it as file in
the Python API, because we can't return the asset-handle directly there,
for reasons explained in the code. So the active asset file is exposed
as `bpy.context.asset_file_handle`.
2021-07-15 16:12:36 +02:00
3feb3ce32d Assets: Expose active asset library in context
For the Asset Browser, this returns the active asset library of the
Asset Browser, otherwise it returns the one active in the workspace.

This gives simple access to the active asset library from UI code and
Python scripts. For example the upcoming Pose Library add-on uses this,
as well as the upcoming asset view template.
2021-07-15 16:12:36 +02:00
7898089de3 Assets: Add an active asset library per workspace, for the UI to use
This per-workspace active asset library will be used by the asset views
later. Note that Asset Browsers have their own active asset library,
overriding the one from the workspace.

As part of this the `FileSelectAssetLibraryUID` type gets replaced by
`AssetLibraryReference` which is on the asset level now, not the
File/Asset Browser level. But some more work is needed to complete that,
which is better done in a separate commit.
This also moves the asset library from/to enum-value logic from RNA to
the editor asset level, which will later be used by the asset view.
2021-07-15 16:12:36 +02:00
Robert Sheldon
59f9a5e6ac Fix T88188: Allow keyframing vertex mass in cloth sim
Update vertex weights between simulation steps if they have changed.
This allows for animated vertex weights in the cloth sim.

Reviewed By: Sebastian Parborg

Differential Revision: http://developer.blender.org/D11640
2021-07-15 16:09:24 +02:00
60fee69682 Library loading: Fix access of out-of-scope memory in py context manager
The `__enter__` function of the `bpy.data.libraries.load` context manager
was storing a pointer to a stack-allocated variable, which was subsequently
used in the `__exit__` function, causing a crash. This is now fixed.

Thanks @Severin for the patch.
2021-07-15 16:04:22 +02:00
Paul Golter
3df40cc343 Fix: Subtitles: Order of channels in the .blend file will be kept in the .rst file.
If text strips have the same start frame but are stacked on top of each
other in different channels the order in which they are written in the
.rst file was random before.

Reviewed By: Richard Antalik

Differential Revision: https://developer.blender.org/D11903
2021-07-15 15:49:25 +02:00
Heinrich Schuchardt
468d59e496 Add support for RISC-V architecture
* On RISC-V GCC 10.3 does not define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_n.
* Avoid a build error
  "Please add support for your platform in build_config.h"
  Cf: https://github.com/sergeyvfx/libNumaAPI/pull/3

Differential Revision: https://developer.blender.org/D11910
2021-07-15 14:22:35 +02:00
709e443152 Cleanup: LayerCollection resync: Proper r_ prefix for return function parameter. 2021-07-15 14:06:09 +02:00
ddc7e5f1b6 Cleanup: improve comments, remove debug printf 2021-07-15 21:09:39 +10:00
e509f9c3a0 Keymap: use Shift-Tab to toggle snap in the sequencer
Match the same shortcut for the 3D view & UV editor.
2021-07-15 20:58:13 +10:00
e7e5fd96c4 Cleanup: LayerCollection resync code.
Mainly naming (also droping the `layer_collection`  in favor of just
`layer` for internal code, this is clear enough and much shorter). Add
proper parent/child identifiers, `r_` prefix for parameters also used as
return values, etc.

Also made some parameters const.
2021-07-15 12:49:43 +02:00
2e8641e45e Fix: crash when creating new node links
This was a regression in rBc27ef1e9e8e663e02173e518c1e669e9845b3d1f.
2021-07-15 12:43:59 +02:00
ae30f72c80 Fix T89870: Vertex groups lost when opening 3.0 files in 2.93
The original refactor for vertex groups (3b6ee8cee7)
forgot to bump the minimum file requirement.

I'm also bumping the subversion to 12 so everyone can switch to a
working subversion number.

Differential Revision: https://developer.blender.org/D11931
2021-07-15 12:23:34 +02:00
49b798ca7e macOS/glog: Silence syscall deprecation warning
Upstream will release the fix in 0.6 which will take time.
Silence two warnings.

Differential Revision: https://developer.blender.org/D11246
2021-07-15 15:23:06 +05:30
c614eadb47 Keymap: use Alt-Q instead of D for transfer mode operator
This now works in all modes (not just sculpt) and activates on press
instead of release. See design task T89757.
2021-07-15 19:13:22 +10:00
757ec00f83 Revert "Keymap: use D-Key for view-pie menu"
This reverts commit f92f5d1ac6.

See: T89757 for rationale for reverting this change.
2021-07-15 19:13:22 +10:00
de913516dd Fix: missing null check
This was a regression in rB3b6ee8cee7080af200e25e944fe30d310240e138.
2021-07-15 11:07:41 +02:00
c27ef1e9e8 Geometry Nodes: dim links whose start and end sockets are not visible
This makes node trees with long links that cross other nodes easier to work with.
Dimmed links will be ignored by various modal operators like cut and reroute insertion.

Differential Revision: https://developer.blender.org/D11813
2021-07-15 11:00:23 +02:00
d5e626b243 Cleanup: use raw strings, quiet clang-tidy warnings 2021-07-15 18:29:20 +10:00
8e8a6b80cf Cleanup: replace BLI_assert(!"text") with BLI_assert_msg(0, "text")
This shows the text as part of the assertion message.
2021-07-15 18:29:01 +10:00
a63a0ee24b Cleanup: clang-format 2021-07-15 18:14:51 +10:00
d35b14449e Cleanup: ensure one newline at end of file, strip trailing space 2021-07-15 17:53:26 +10:00
41e0a5b5ed CMake: update config for checking utility 2021-07-15 17:52:27 +10:00
15cdcb4e90 BLI_task: add a callback to initialize TLS
Useful when TLS requires it's own allocated structures.
2021-07-15 14:45:46 +10:00
5cd1aaf080 BLI_memarena: support merging memory arenas
Useful when thread-local storage has it's own memory arena containing
data which is kept after the multi-threaded operation has finished.
2021-07-15 14:37:26 +10:00
4be166b6b5 deps_builder: zstd 1.5.0
Having zstd available is a requirement for landing D5799

Reviewed By: sybren

Differential Revision: https://developer.blender.org/D11079
2021-07-14 18:22:23 -06:00
4e65b1ef6c GHOST/wayland: create mmap-ed file manually if memfd_create is unavailable 2021-07-14 23:15:00 +01:00
ebf7673f83 CMake: Have CMake Control the C++ version.
We were manually setting the compiler flags
for C++17 support for this previously. CMake
can do this for us in a uniform way without
having to worry about compiler specifics.

Setting these flags manually somehow brought
out some unwanted behaviour (CMake switching
back to C++14) in the nightly CMake builds.

Unsure if that's a CMake bug or planned
new behaviour for future version, but best
to play it safe.

These flags are supported since CMake 3.1
so should not break anything.

Reviewed by: Campbell Barton

Differential Revision: https://developer.blender.org/D11891
2021-07-14 15:17:02 -06:00
093074aefe Bezier Spline: Add a more generalized insertion utility
This logic is from the curve sundivide node, used to add points with
proper handles in between two existing points. However, the same logic
is used for trimming of Bezier splines, and possibly interactive point
insertion in the future, so it's helpful as a general utility.

The logic is converted to depend on a bezier spline instead of being
static. A temporary segment spline can be used for the latter use case.
2021-07-14 15:13:17 -04:00
2829caa9f8 Cleanup: Layer resync: Split object/base resync part in own function.
No behavioral change expected here.
2021-07-14 17:49:57 +02:00
c202d38659 Python API: Add functions to ensure and clear IDProperties
This adds id_properties_clear() and id_properties_ensure() functions
to RNA structs. This is meant as an initial change based on discussion
in review of D9697. However, they may be useful in other situations.

The change requires refactoring the internal idproperties callback to
return a pointer to the IDProperty pointer, which actually turns out
to be quite a nice cleanup.

An id_properties attribute could be added in the future potentially.

Differential Revision: https://developer.blender.org/D11908
2021-07-14 10:51:28 -04:00
37a5ff4a84 Tests: support graphing peak memory in Cycles performance tests
The general graphing mechanism will create one graph for each output
variable. So it's not limited to time and memory, but that is what the
Cycles tests now output.
2021-07-14 16:12:10 +02:00
2acebcae24 Cleanup: Avoid duplication in line art stroke generation
The BKE_gpencil_stroke_add_points API function worked well for
creating the primitives in the add object menu, but it expected a
specific data format that doesn't make sense in a dynamic context.
As evidence of that we can see the way source data was duplicated
in the line art file just to use this API function.

This commit solves that problem in two ways:
 - Clean up the line art function (this should make it faster too).
 - Move/rename the function so its intended use is more clear.

Differential Revision: https://developer.blender.org/D11909
2021-07-14 10:11:41 -04:00
3de3c3c23a Fix (unreported) LibOverride diffing generating operations for non-editable properties.
Non-pointer-like properties that are not editable should never generate
override operations.

While harmless (those would never be applied back anyway), better not
clutter override operations list, and also enjoy the symbolic
performances improvement here.

NOTE: Pointer-like properties (pointers and collections) remain
processed as usual here since they usually imply recursivity. We could
make an exception to the exception for ID pointers, but for now I don't
think this is worth it.
2021-07-14 14:23:19 +02:00
c9e9a42215 Fix T89771: Cloth disk cache is not read on library overrides in some cases.
Issue would happen when the original, linked data already had 'Disk Cache'
setting enabled. Override would then see no difference with linked data,
and not create any rule for it (as expected).

Root of the issue was that in Cloth modifier copy code, those disk cache
settings were not copied at all, so every time local overrides were
re-generated by copying linked data, those flags would be reset to their
default values.

NOTE: this might exist in other PointCache usages as well, but this code is
in such a bad state that I'd rather do minimal strictly needed changes
there, on a case-by-case basis. Proper recode of that whole system is
wayyyyy out of scope here.
2021-07-14 14:23:19 +02:00
f0ddbcb31d Cleanup: Turn PointCache flags defines into an anonymous enum. 2021-07-14 14:23:19 +02:00
7cd91a06eb Fix T88908: Incorrect path handling in adding strips
When image strip is added from python using `image_strip_add` operator
and directory path is not terminated with slash, last part of directory
was ignored.

Use `BLI_join_dirfile` instead of simple string concatenation.
2021-07-14 13:56:09 +02:00
efe90944ee Fix crash displaying invalid enum value with translations enabled
Found loading a cycles-x .blend file saved with different integer values for
enum items.
2021-07-14 13:54:52 +02:00
765406cb51 Fix T88088: Cycles and Eevee Vector Rotate node inconsistent with zero axis
Pass along the unmodified vector in this case.
2021-07-14 13:54:52 +02:00
2761679180 Fix T89826: VSE snapping with constrained axis
Constraining to X axis caused snapping to not work at all. Constraining
to Y axis caused snapping indicator to be drawn, when snapping doesn't
occur.

Reviewed By: mano-wii

Differential Revision: https://developer.blender.org/D11898
2021-07-14 13:22:40 +02:00
5583d51773 Fix T89851: Geometry nodes: wrongly detected "Node group has unidentified
nodes or sockets" error

rBfe22635bf664 introduced a utility to check for this (but it was always
returning true).

This wasnt a problem in master (since it is unused there), but in the
2.93 branch, this utility is actually used and the error results in all
geometry nodetrees to appear with the "Node group has unidentified nodes
or sockets" message (and being unusable).

Now return false in has_undefined_nodes_or_sockets if all nodes and
sockets have been successfully checked.

This commit then needs to end up in the 2.93 branch.

Maniphest Tasks: T89851

Differential Revision: https://developer.blender.org/D11911
2021-07-14 11:55:07 +02:00
192f0c9e17 Fix T89734: incorrect dependency cycle with id property on modifier
Differential Revision: https://developer.blender.org/D11851
2021-07-14 11:25:15 +02:00
271f34f77e Geometry Nodes: initial socket inspection
Socket inspection helps with debugging a geometry node group.
Now, when hovering over a socket, a tooltip will appear that provides
information about the data in the socket. Note, socket inspection only
works for sockets that have been computed already. Nodes that are not
connected to an output are not computed.

Future improvements can include ui changes to make the tooltip look
more like in the original design (T85251). Furthermore, additional
information could be shown if necessary.

Differential Revision: https://developer.blender.org/D11842
2021-07-14 11:21:10 +02:00
3e125d12af Fix T89849: Time offset not working with Bake Object transform to Grease pencil
The bake animation was not using the remap of time done by grease pencil time modifier.
2021-07-14 11:09:25 +02:00
6644e96f01 Cleanup: use BMLoop.next/prev for BMesh auto-smooth logic
Use more direct access to next/previous vertices.

- `BM_edge_other_vert(l_curr->e, l_curr->v)` -> `l_curr->next->v`.
- `BM_edge_other_vert(l_curr->prev->e, l_curr->v)` -> `l_curr->prev->v`.

Add asserts to keep the intention clear.
2021-07-14 14:22:13 +10:00
ae379714e4 Transform: Identify more safely when the mesh is deform only
Depending on the modifiers, geometry can be destructive which is not safe.
2021-07-13 18:59:42 -03:00
96a4b54cfb Compositor: Full frame Render Layers node
Adds full frame implementation to this node operations.
No functional changes.
2.5x faster than tiled fallback on average.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D11690
2021-07-13 22:34:28 +02:00
538f452ea9 Compositor: Full frame Translate node
Adds full frame implementation to this node operation.
No functional changes.
2021-07-13 22:34:28 +02:00
2ea47057d3 Compositor: Fix pixels being wrapped outside buffer area
Not causing issues in current master because all buffer areas are at
(0, 0) position and `Extend` is not used. But areas may be at any
position in future developments and it will crash.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D11784
2021-07-13 22:34:28 +02:00
209aff0a35 Compositor: Fix convert resolutions linking different socket datatypes
Link sockets are always connected to inserted translate or scale
operation `Color` sockets even when they have different data type.
This causes crashes on full frame mode when operations read inputs 
with non expected datatypes.

Because data type conversions need to be executed before, convert
resolutions must ensure same datatypes are linked.
2021-07-13 22:32:53 +02:00
3b6ee8cee7 Refactor: Move vertex group names to object data
This commit moves the storage of `bDeformGroup` and the active index
to `Mesh`, `Lattice`, and `bGPdata` instead of `Object`. Utility
functions are added to allow easy access to the vertex groups given
an object or an ID.

As explained in T88951, the list of vertex group names is currently
stored separately per object, even though vertex group data is stored
on the geometry. This tends to complicate code and cause bugs,
especially as geometry is created procedurally and tied less closely
to an object.

The "Copy Vertex Groups to Linked" operator is removed, since they
are stored on the geometry anyway.

This patch leaves the object-level python API for vertex groups in
place. Creating a geometry-level RNA API can be a separate step;
the changes in this commit are invasive enough as it is.

Note that opening a file saved in 3.0 in an earlier version means
the vertex groups will not be available.

Differential Revision: https://developer.blender.org/D11689
2021-07-13 12:10:34 -04:00
52b94049f2 Fix 'Correct Face Attributes' option
With this option enabled, updating the geometry is no longer deform only.
2021-07-13 12:51:29 -03:00
2373a2196e Cleanup: duplicate checks, unused initialization 2021-07-13 22:41:48 +10:00
6a0fe79db5 Cleanup: replace BKE_customdata.h in BKE_editmesh.h
Only DNA_customdata_types.h is needed for BMEditMesh.
2021-07-13 22:23:17 +10:00
10428ca472 Cleanup: reduce indentation 2021-07-13 22:14:42 +10:00
d31abfef2c Fix x/y mismatch in retract region tracker
Correct X/Y mismatch in RetrackRegionTracker.

NOTE: This isn't used at the moment.

Reviewed By: sergey

Ref D11895
2021-07-13 21:58:45 +10:00
6a5e1bf9a1 Cleanup: improve BMEditMesh docstrings
Also remove white-space added last commit.
2021-07-13 21:24:46 +10:00
488690c864 Cleanup: minor changes to recent sequencer clipboard addition
- Make the variable to store the name 'static'.
- Use STRNCPY macro.
- Set the first character to nil instead of memset for the while string.
2021-07-13 21:23:35 +10:00
d374469f4c VSE: Make pasted strip active
When adding texts or various simple effects I often copy-paste strips
to reuse properties from a template such as font or position. I assume
this is common workflow. Issue with this workflow is, that active strip
is not changed after pasting, so when adjusting property, it is original
strip that is being modified.

This is not issue when duplicating strips - selection state is
transfered to duplicate strips, such that duplicate of active strip is
set to be active and duplicate of selected strip is set to selected.

Implement same selection transfering behavior in paste operator, that
exists in duplicate operator.

Since strip can be deleted after copying, it is not possible to rely
on sequencer state. This is true even when pasting strips to different
scene. Therefore active strip name must be stored in clipboard.

Reviewed By: sergey, Severin

Differential Revision: https://developer.blender.org/D11781
2021-07-13 12:53:56 +02:00
af42b35e53 Fix UV snapping broken
Caused by fba9cd019f, then fixed by 0e4245bc28, but without
subversion bump, so some files were still broken after fix.

Repeat fix again, but this time also bump subversion.

Reviewed By: mont29

Differential Revision: https://developer.blender.org/D11864
2021-07-13 12:52:57 +02:00
71b4a1687e Cleanup: clang-tidy, comments 2021-07-13 20:51:24 +10:00
25c2875e0f Edit Mesh: use partial updates editing vertices with number buttons
Use the same partial-update functions used by transform when
editing vertex locations with the number buttons.

This avoids unnecessary calculations for normals and tessellation.

This gives around 1.44x overall speedup on high poly meshes.
2021-07-13 20:17:30 +10:00
8839b4c32a UI: support persistent state during number/slider interaction
Support for begin/update/end callbacks allowing state to be cached
and reused while dragging a number button or slider.

This is done using `UI_block_interaction_set` to set callbacks.

- Dragging multiple buttons at once is supported,
  passing multiple unique events into the update function.

- Update is only called once even when multiple buttons are edited.

- The update callback can detect the difference between click & drag
  actions so situations to support skipping cache creation and
  freeing for situations where it's not beneficial.

Reviewed by: Severin, HooglyBoogly

Ref D11861
2021-07-13 20:03:40 +10:00
1b4d5c7a35 Undo System: avoid redundant decoding on undo
In most cases the undo system was loading undo steps twice.

This was needed since some undo systems (sculpt, paint, text)
require stepping out of the current undo step.

Use a flag to limit this to the undo systems that need it.

This improves performance for other undo systems.
This gives around 1.96x speedup in edit-mesh for high-poly objects.

Reviewed by: mont29

Ref D11893
2021-07-13 19:43:05 +10:00
f9c9e000ca Undo: optimize edit-mode undo
- Tag the object data instead of the object when decoding
  (this avoids duplicating mesh object-data on each undo-step).
- Calculate face normals as part of multi-threaded tessellation.

This gives ~11% speedup with 1.5x million polygons.
2021-07-13 17:10:30 +10:00
7a4fc9f59d Cleanup: quiet stringop-overflow compiler warning 2021-07-13 16:54:25 +10:00
22c4323b21 Cleanup: remove commented code
Replace with brief note in warning.
2021-07-13 15:27:38 +10:00
7a084c2eee Cleanup: minor changes to edit-mesh API calls
Rename:

- EDBM_mesh_free -> EDBM_mesh_free_data
  BKE_editmesh_free -> BKE_editmesh_free_data

  Since this doesn't free the edit-mesh pointer.

- BKE_editmesh_free_derivedmesh -> BKE_editmesh_free_derived_caches

  Since this no longer uses derived-mesh, match naming for the related
  object function BKE_object_free_derived_caches.

Also remove `do_tessellate` argument from BKE_editmesh_create,
since the caller can explicitly do this if it's needed,
with the advantage that it can be combined with normal calculation
which is faster on high-poly meshes.
2021-07-13 15:13:33 +10:00
b90b1af25c Event Simulate: and a --time-actions command line argument
When enabled, print the time taken between running actions.
2021-07-13 14:50:52 +10:00
5098678308 Cleanup: Use correct _WIN32/64 defines for MSVC
Docs: https://docs.microsoft.com/en-us/cpp/preprocessor/predefined-macros

Differential Revision: https://developer.blender.org/D11460
2021-07-12 21:01:18 -07:00
dc679f6247 Cleanup: Use C99 format string for the SIZET_FORMAT macro
All platforms support the proper format string and it's already used in
various other places.

Differential Revision: https://developer.blender.org/D11460
2021-07-12 20:32:37 -07:00
2e7e7a6fb6 Fix object "Set Origin" operating on linked library data
Regression in d25747ee75
2021-07-13 13:03:39 +10:00
d6b1d35bf8 Cleanup: Use C++ float3 type, use prefix for return argument 2021-07-12 17:24:45 -04:00
Germano Cavalcante
bfa3dc91b7 Depsgraph: Implement 'ID_RECALC_GEOMETRY_DEFORM'
During a mesh transformation in edit mode (Move, Rotate...), only part of
the batch cache needs to be updated.

This commit allows only update only the drawn batches seen in
`BKE_object_data_eval_batch_cache_deform_tag` if the new
`ID_RECALC_GEOMETRY_DEFORM` flag is used.

This new flag is used in the transforms operation for edit-mesh and
results in 1.6x overall speedup in heavy subdiv cube.

Differential Revision: https://developer.blender.org/D11599
2021-07-12 18:05:13 -03:00
7b6c77aa84 Fix T88015: Round end caps on Freestyle lines not shaped as documented
This might be an artistic choice, but round end caps are supposed to be
a "half circle centered at the end point of the line" as documented
here: https://docs.blender.org/manual/en/dev/render/freestyle/
parameter_editor/line_style/strokes.html#caps

They are a shashed half circle instead.

This patch makes this pure half circles [and also fixes the case where
thickness of beginning was used for both beginning and end of the
stroke]

Maniphest Tasks: T88015

Differential Revision: https://developer.blender.org/D11340
2021-07-12 22:14:57 +02:00
7b954ba7a1 GHOST/wayland: remove unused 'input-event-codes.h' header
This was accidentally committed by rBecbf838feefc.
2021-07-12 20:20:08 +01:00
5e1702e7a5 Fix T87844: Cycles losing 1 bit of precision when loading packed byte images
This could lead to colors that are supposed to be exactly white to be slightly
darker.
2021-07-12 19:19:04 +02:00
Johnny Matthews
2a41ab5e6c Geometry Nodes: Curve Primitive Quadrilateral
This commit adds a curve primitive node for creating squares,
rectangles, trapezoids, kites, and parallelograms. It also includes
a mode where the four points are just vector inputs.

Differential Revision: https://developer.blender.org/D11665
2021-07-12 13:11:52 -04:00
a072e87e04 Fix T89040: dependency graph not handling time remapping correctly
In this bug report it resulted in rendering animations stopping too early,
but this affected more areas.

After the previous cleanup commit, it becomes clear that frame and ctime
values were mixed up.
2021-07-12 17:41:26 +02:00
2ea565b0ec Cleanup: improve naming and comments of scene frame/ctime functions
Confusingly, BKE_scene_frame_get did not match the frame number as expected by
BKE_scene_frame_set. Instead it return the value after time remapping, which
is commonly named "ctime".

* Rename BKE_scene_frame_get to BKE_scene_ctime_get
* Add a new BKE_scene_frame_get that matches BKE_scene_frame_set
* Use int/float depending if fractional frame is expected
2021-07-12 17:41:15 +02:00
f709f12d93 Fix T89736: Cycles error with persistent data, displacement and motion blur 2021-07-12 15:56:31 +02:00
45a47142fc Fix T89396: Cycles missing passes with multiple view layers and persistent data 2021-07-12 15:40:45 +02:00
5f3f5db95d Cleanup: Clang format
Sorry, missed this in 53cf8e83b3.
2021-07-12 14:40:26 +02:00
8e69409eed Fix T89775: geometry nodes logging crash during render
Under some circumstances (e.g. when rendering) the geometry
nodes logger is not used. This was missing a simple null check.
2021-07-12 14:29:28 +02:00
280dac323c Blenlib: Add BLI_assert_msg() for printing an extra string if the assert fails
It always bothered me that we'd do the `BLI_assert(... || !"message")` trick to
print a message alongside the assert, while it should be trivial to have a way
to pass an extra string as additional argument.

This adds `BLI_assert_msg()` with a second argument for a message. E.g.:
```
BLI_assert_msg(
    params->rename_id == NULL,
    "File rename handling should immediately clear rename_id when done, because otherwise it will keep taking precedence over renamefile.");
```

On failure this will print like this:
```
0   Blender                             0x00000001140647a3 BLI_system_backtrace + 291
[...]
13  Blender                             0x00000001092647a6 main + 3814
14  libdyld.dylib                       0x00007fff203d8f5d start + 1
BLI_assert failed: source/blender/editors/space_file/file_ops.c:2352, file_directory_new_exec(), at 'params->rename_id == ((void*)0)'
  File rename handling should immediately clear rename_id when done, because otherwise it will keep taking precedence over renamefile.
```

Reviewed by: Sybren Stüvel, Jacques Lucke, Sergey Sharybin, Campbell Barton

Differential Revision: https://developer.blender.org/D11827
2021-07-12 11:46:24 +02:00
c4f9bfcf5e Fix T89765: boolean modifier collection refcount issue
The 'collection' property is flagged PROP_ID_REFCOUNT, so the
modifiers foreachIDLink functions should walk with IDWALK_CB_USER
(instead of IDWALK_CB_NOP).

Otherwise the modifier wont be included as a user for the collection
(e.g. on file read); removing the collection from the modifier will
decrement usercount though (which in worst case scenario makes the
collection orphan and will result in data loss)

Maniphest Tasks: T89765

Differential Revision: https://developer.blender.org/D11877
2021-07-12 10:48:27 +02:00
2289e26fa3 Cleanup: correct spelling in comments, remove profanity 2021-07-11 15:31:36 +10:00
0f201049b4 Edit Mesh: tag the object data for updating instead of the object
When editing vertices with number buttons, tag the mesh, not the object.

This prevents the evaluated mesh being re-created for the object
and is correct as the mesh is being edited not the object.

Note that all tags for updating object geometry should be checked
to see if this change should be applied there too.

From a simple test on a high-poly mesh this gives around 1.3x
overall speedup.
2021-07-11 15:22:20 +10:00
49a363f0e0 LineArt: Fix edge type panel use_cache prop.
The name was mistakenly written as `use_cached_result`. Fixed.
2021-07-10 21:52:35 +08:00
12014ccfbc progress 2021-07-10 12:14:48 +02:00
34cebfbb78 progress 2021-07-10 11:22:48 +02:00
77a28f34d5 LineArt: Fix modifier apply.
After cache implementation line art apply will not show strokes properly, now fixed.

# Conflicts:
#	source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c
2021-07-10 14:04:23 +08:00
62d9dabc7d UI: Clip: Fix checkbox wrongly greying out entire column
The Pattern and Search display options in the Clip Editor display settings
are independent and should not be grayed out since those options
remain relevant even with path display turned off.

Alternative solution were propoesed in D11630 and D11715
but each of those patches had downsides.
This solution is the simplest and does not break muscle memory.
2021-07-09 19:23:08 -04:00
d5e91ae883 make.bat: Update detection order of MSVC
VS2019 is the preferred version to use these
days, look for it before looking for 2017
and 2022.
2021-07-09 15:17:05 -06:00
53cf8e83b3 Fix channel packed images display in the Image/Node editor
Channel packed images should not have their RGB affected by alpha.
rendering in Cycles and Eevee was fine already, but displaying these was
not right in the Image and Node editors.

Not 100% sure what to do for the "Color and Alpha" mode, but I guess
this should stay like it was before (applying the alpha).

"Color", "R", "G", and "B" modes were changed to not have color be
affected by alpha though.

ref. T89034

Maniphest Tasks: T89034

Differential Revision: https://developer.blender.org/D11871
2021-07-09 22:00:04 +02:00
Johnny Matthews
d7f88982a8 Geometry Nodes: fix direction mode in curve primitive line node
Differential Revision: https://developer.blender.org/D11872
2021-07-09 18:34:40 +02:00
2cc4e1572a progress 2021-07-09 18:32:57 +02:00
ceb9e7d71e initial commit 2021-07-09 17:48:51 +02:00
4c716ced09 Fix a compiler warning on Windows for Exact Boolean.
For some reason, the Windows compiler didn't like the
static function being used in the parallel_reduece.
2021-07-09 09:29:33 -04:00
09082f6e85 Fix: crash when using empty attribute search 2021-07-09 15:21:25 +02:00
c749c24682 Walk Navigation: Z axis correction
Fly navigation has always had this option. They is particularly useful
when users use "Trackball" as their orbit method.

For walk navigation this works as a one off option. Not as a toggle like
for fly navigation.

Differential Revision: https://developer.blender.org/D11863
2021-07-09 15:03:50 +02:00
Sybren A. Stüvel
c04cceb40e Fix T89435: Reordering FCurves can cause crash or corruption
Correctly reset `prev` and `next` pointers of action group FCurves when
separating them into distinct `ListBase`s per `bActionGroup`.

These `NULL` pointers are necessary to temporarily demarcate the start &
end of the `bActionGroup::channels` list. Having them still point to
other FCurves caused ordering issues when moving curves towards the
start/end of a group.

This commit corrects the above issue and adds versioning code to rectify
any ordering issues that may have been caused. For this purpose the
`BKE_action_groups_reconstruct()` function is rewritten to avoid relying
on the `bAction::curves` list order or `prev` link integrity.

Differential Revision: https://developer.blender.org/D11811
2021-07-09 12:21:12 +03:00
b69ab42982 Deps: upgrade OpenXR 1.0.14 → 1.0.17
Simple upgrade of OpenXR to 1.0.17. A version bump was enough, no
Blender code had to change.

Reviewed By: LazyDodo, mont29

Differential Revision: https://developer.blender.org/D11848
2021-07-09 11:06:40 +02:00
16099c00d0 Fix cycles crash when changing viewport display pass
It was possible that render buffers and scene kernel data will be out
of sync because reset and scene update happens in different locks.

This is similar issue we've fixed in the Cycles X branch, so backported
relevant changes from there.

This change removes what seems to be unused feature kernel.

Differential Revision: https://developer.blender.org/D11828
2021-07-09 10:43:47 +02:00
8dd941cac0 Tracking: Fix "Lock to Selection" option from header causing jump
This change makes the behavior consistent between shortcut and
option from space clip's header.

The only caveat is that the "Lock to Selection" is removed from the
Display popover. This is because it is rather hard to make operator
to render same as regular checkbox. However, shouldn't be a problem
because the setting in popover was redundant.

Differential Revision: https://developer.blender.org/D10423
2021-07-09 10:37:36 +02:00
249a7e2307 Cleanup: Walk Navigation define remame
WALK_MODAL_TOGGLE > WALK_MODAL_GRAVITY_TOGGLE
2021-07-09 10:27:29 +02:00
8225b610dd Fix typo in Fly mode tooltip
The bug was always around and was introduced with the original code
e2a7168e96 (2009).
2021-07-09 10:21:02 +02:00
07faa3c5ac Nodes: Moved group interface panel code to python.
The node group interface panels were still implemented in C.
Now they ported over to python for easier maintenance.

Differential Revision: https://developer.blender.org/D11834
2021-07-09 07:57:29 +01:00
d0c5c67e94 Make Single User: support object data animation
In addition to _object_ animation, now _object data_ (mesh, curve, ...)
animation can now be made single user as well.

This came up in T89369 and while it is possible to do this via the
Outliner [where all actions have to be selected individually], this
seems to be more convenient to be done from the 3DView.

note: usercount of the action is checked now, if it single-user already,
no copy takes place (same thing could/should be done for
single_object_action_users as well).

note2: obdata is made single user as well (otherwise duplicated actions
will be assigned to the same shared obdata - which does not result in
unique animadata which is what we are after here)

ref. T89369

Maniphest Tasks: T89369

Differential Revision: https://developer.blender.org/D11683
2021-07-09 08:09:43 +02:00
0416aa767f Cleanup: use 'uint' for BLI_array 2021-07-09 13:37:52 +10:00
7592a5097c BLI_array: add BLI_array_deduplicate_ordered utility & tests 2021-07-09 13:35:54 +10:00
ab70133db0 Cleanup: rename BKE_animdata_{add=>ensure}_id
Use the term `ensure` as existing data is used when present.
2021-07-09 11:53:16 +10:00
af8fb707da BLI: avoid calling deleted copy constructor in some compilers
Previously, this did not compile in VS 2017, because
`new T(initializer_())` would try to call the copy constructor of `T`.

Now, `initializer_` will construct the `T` inplace.
2021-07-08 19:54:09 +02:00
Pratik Borhade
4e5537d0ed Fix T89169: Rename Compositor Node "View Switch" to "Switch View" in search panel
Renaming compositor node in search panel "View Switch" to "Switch View"
for better consistency.

Reviewed By: dfelinto

Differential Revision: https://developer.blender.org/D11717
2021-07-08 14:59:26 +02:00
80d0b68290 GPencil: Support camera "Frame Selected" and object previews
Using the "Camera Fit Frame to Selected" operator didn't work for Grease Pencil
objects. The same issue caused grease pencil preview thumbnails to be useless
(e.g. when using "Mark Asset" on a Grease Pencil object).
Reason was that there was no logic to handle grease pencil data and its strokes
for the object display-point iterators used for the "Frame Selected" logic.

Addresses T89656.

Reviewed by: Antonio Vazquez, Campbell Barton

Differential Revision: https://developer.blender.org/D11833
2021-07-08 14:20:14 +02:00
5d54f38949 Fix: instances are made real when they shouldn't be
The original assumption that the `modifyMesh` function is only
called when the modifier is applied was wrong. There are still a
couple of other places calling it through `BKE_modifier_modify_mesh`.

Now there is an extra check that makes sure instances are only
realized when the modifier is actually applied.
2021-07-08 13:11:21 +02:00
c304807099 Fix compositor backdrop gizmo refresh problem when toggling sidebar
The backdrop image gizmo was not following the backdrop image, it
needs to be refreshed whenever the view changes. The region init
callback is executed whenever the region size changes, so that should be
a reliable place to do that.

Reported as part of T87591.
2021-07-08 13:08:10 +02:00
4c8a8950cf Cleanup: remove trailing spaces from install_deps.sh
No functional changes.
2021-07-08 11:38:48 +02:00
b6a35a8153 Outliner: use 'compacted' row for bones as well
In a collapsed hierarchy, some type of data are listed as one icon per
item (2.79 did this for all data),
others are 'compacted' as a single icon with a counter (also indicating
if the active item is down that collapsed hierarchy) from 2.80 on.

Not quite sure if {rB92dfc8f2673e} was meant to do this (if it was, this
was not working though because relevant code would only get executed for
object hierarchies it seems), so now this is done for bones as well.

Fixes T88413.

Maniphest Tasks: T88413

Differential Revision: https://developer.blender.org/D11404
2021-07-08 10:41:38 +02:00
7489427e4d Cleanup: spelling 2021-07-08 13:31:38 +10:00
c3cb565250 CMake: add missing headers, sort file lists 2021-07-08 13:21:22 +10:00
8346417d09 Fix crash displaying the sequencer without a valid 'scene->ed'
Regression in 45d54ea67f
2021-07-08 10:15:03 +10:00
nutti
695e025c82 Docs: Fix minor incorrect syntax errors
This patch fixes the incorrect syntax in documentations.

Reviewed By: Blendify

Differential Revision: https://developer.blender.org/D11822
2021-07-07 19:41:46 -04:00
51019fbfce Cleanup: Consolidate tablet walk mode rotate factors.
Walk rotate speed for tablets was being modified at runtime by scaling
the user preference mouse_speed by a constant factor; this consolidates
scaling into the the compile time tablet scale factor in walkApply.

No change in behavior.
2021-07-07 16:33:50 -07:00
139c3f791e Cleanup: Remove wrong File Browser comment
Accidentally included this in rB01e1944cd455, it came from a merge
conflict.
2021-07-07 19:49:28 +02:00
54fa5041e2 Cleanup: Correct comment in earlier commit (f4cb3ccd9c)
Comment was based on an older version of the patch.
2021-07-07 19:38:37 +02:00
2b41b2f05b Cleanup: Code-style correction in Ghost (Clang-format) 2021-07-07 19:26:47 +02:00
f4cb3ccd9c Assets: Keep assets active after renaming, ensure they are scrolled into view
When renaming an ID somewhere in the UI after marking it as asset, it would
often get lost in the Asset Browser (scrolled out of view). It would also get
deactivated.
This patch makes sure that if an asset is active whose ID gets renamed, it is
kept active and visible. That is important for a fast, uninterrupted asset
creation workflow, where users often rename assets while working in the asset
browser.

Old code stored the new file-name to identify a file after re-reading the
file-list after the rename. For assets that doesn't work because there may be
multiple assets with the same name. Here the simple solution of just storing
the pointer to the renamed ID is chosen, rather than relying on the file-name
in this case. (Should be fine with undo, since the ID * reference is short
lived, it's not stored over possible undo steps. If it turns out to have
issues, I rather switch to a rename_id_uuid, but keep that separate from the
file->uid).

Reviewed by: Sybren Stüvel

Differential Revision: https://developer.blender.org/D11119
2021-07-07 19:24:06 +02:00
fb98f22ddd MSVC: Fix build issue with TBB
TBB includes in windows.h which will by
default define min/max macro's by default,
which collide with stl's min/mac functions.

this change instructs windows.h not to
add the offending macros
2021-07-07 10:55:27 -06:00
6b0869039a File Browser: Select files and directories after renaming
(Note: This is an alternative version for D9994 by @Schiette. The commit
message is based on his description.)

Currently, when a new directory is created it is not selected.
Similarly, when renaming an existing file or directory, it does not
remain active/highlighted blue after renaming.

This change makes sure the file or directory is always selected after
renaming, even if the renaming failed or was cancelled.
This has some usability advantages:
 - Open the newly created directory without having to select it (ENTER).
 - If you make a naming mistake, you can immediately fix that (F2)
   without having to click it again.
 - If you create a directory and forget to name it, you can fix that
   (F2) without having to select it.
 - This is consistent with many common File Browsers.

Further, selecting the item even after renaming failed or was cancelled
helps keeping the file in focus, so the user doesn't have to look for it
(especially if the renaming just failed which the user may not notice).
In other words, it avoids disorienting the user.

Also see D11119 which requires this behavior.

We could also always select the file/directory on mouse press. This
would make some hacks unnecessary, but may have further implications. I
think eventually that's what we should do though.
2021-07-07 18:41:27 +02:00
13672f8b32 Cleanup: Move file deselection function to more appropriate file
`filesel.c` seems like the place that should contain file selection
functions. Previously it was in `file_ops.c` because that was the only
file that actually used it. But a followup commit needs it from a
different file.
2021-07-07 18:41:27 +02:00
cffbfe5568 Fix crash accessing sequencer strips
Was caused by recent clange sequences_all iterator in RNA (D11793).
2021-07-07 14:22:52 +02:00
ecbf838fee Cleanup: comment on source of button event codes 2021-07-07 13:21:57 +01:00
0153e99780 Geometry Nodes: refactor logging during geometry nodes evaluation
Many ui features for geometry nodes need access to information generated
during evaluation:
* Node warnings.
* Attribute search.
* Viewer node.
* Socket inspection (not in master yet).

The way we logged the required information before had some disadvantages:
* Viewer node used a completely separate system from node warnings and
  attribute search.
* Most of the context of logged information is lost when e.g. the same node
  group is used multiple times.
* A global lock was needed every time something is logged.

This new implementation solves these problems:
* All four mentioned ui features use the same underlying logging system.
* All context information for logged values is kept intact.
* Every thread has its own local logger. The logged informatiton is combined
  in the end.

Differential Revision: https://developer.blender.org/D11785
2021-07-07 11:20:19 +02:00
77834aff22 Fix T89397: animation in geometry nodes modifier does not update
The geometry nodes modifier uses id properties for the inputs to node groups.
That is because the set of properties changes depending on which geometry
node group is selected.

The animation was not updated correctly because the `ANIMATION_EVAL`
depsgraph node was not evaluated, because nothing depended on it in the
depsgraph. This patch makes sure that the proper link to the geometry
component is inserted.

Differential Revision: https://developer.blender.org/D11831
2021-07-07 10:56:45 +02:00
3fe0088cab Fix T89559: Outliner shows extra view layer column when it shouldn't
This issue happened because of some miscommunication during the original
patch review. Since we have the parent element in other outliner modes
(Blender File, Data API) I was on the fence here. Rolling this back now
so that when Show All View Layers is off we don't see the current View
Layer top element.

The fix is simple, but it was better to format the code around to
follow the style in this file.

Differential Revision: https://developer.blender.org/D11830
2021-07-07 10:41:12 +02:00
8f94724f22 Cleanup: Sort nodes alphabetically 2021-07-06 23:33:02 -05:00
89831fae0c Cleanup: update filename references 2021-07-07 14:08:47 +10:00
0b1050bf09 Geometry Nodes: Rename nodes for clarity between mesh and curve
Rename the mesh circle to "Mesh Circle", mesh line to "Mesh Line",
and mesh subdivide to "Mesh Subdivide". Previously they looked exactly
the same in the search menu, and the nodes themselves had the same
label. This is a "deep" rename that also renames internal defines and
function names to match the UI.
2021-07-06 23:00:27 -05:00
Jagannadhan Ravi
eccdced972 Cleanup: Moving mesh_evaluate and mesh_normals to C++
No functional changes.

Reviewed By: HooglyBoogly

Ref D11744
2021-07-07 13:58:18 +10:00
5bbbc98471 Cleanup: spelling in comments 2021-07-07 13:42:46 +10:00
Angus Stanton
63a8b3b972 Geometry Nodes: Curve Endpoints Node
This node is quite similar to the curve to points node, but creates
points for only the start and end of each spline. This is a separate
node because the sampling from the curve to points node don't apply,
and just for ease of use.

All attributes from the curves are copied, including the data for
instancing: tangents, normals, and the derived rotations. One simple
use case is to make round caps on curves by instancinghalves of a
sphere on each end of the splines.

Differential Revision: https://developer.blender.org/D11719
2021-07-06 22:24:04 -05:00
31e6f0dc7a makesdna: fix parsing 'const', 'struct', 'unsigned' as a prefix
DNA parsing assumed any identifier which starts with
(`struct`, `unsigned`, `const`) was that identifier.

So a struct called `constTest foo;` would be parsed as `est foo;`.

Add utility function to check identifiers are not
part of a larger identifier.

This also supports skipping these identifiers in any order.

Reviewed By: LazyDodo

Ref D11837
2021-07-07 12:35:03 +10:00
f85ef3d442 Cleanup: clang-tidy, unused function 2021-07-07 12:34:00 +10:00
cd38daeff4 Fix T89702: Curve to points node assert on single point spline
This function could be refactored slightly if we assumed the input was
always sorted, but a special for a single point input is also fine.
2021-07-06 21:09:01 -05:00
0521272ab3 Fix: Curve Resample Node: Copy attributes to 1 point results
The curve resample node neglected to copy attributes to single point
result splines. That could have caused errors if some of the splines
in the result had only one point but others had more.
2021-07-06 20:42:33 -05:00
4e80573a76 VSE: Use snapping settings for scrubbing
Use "Snap Playhead to Strips" option to enable playhead snapping.
Change behavior of CTRL key to invert snapping similar to transform operator.

Currently this option is disabled by default. It makes editing quite unpleasant
for me personally, but ideally I should gather feedback from more users.

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D11745
2021-07-07 03:26:14 +02:00
c5b2381703 VSE: Remove seq->tmp usage from RNA code
This field was used to reference "parent" meta strips in `sequences_all`
RNA collection iterator functions.

Use `SeqIterator` wrapped in `BLI_Iterator` to iterate over elements.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D11793
2021-07-07 03:14:05 +02:00
45d54ea67f VSE: Fix cache bar not visible
Cache bar was only visible when Frame overlay was enabled

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D11779
2021-07-07 03:02:01 +02:00
6ac3a10619 Compositor: Fix constant folded operations not being rendered
Many operations do not expect single element buffers as output.
Use full buffers with a single pixel instead.
2021-07-07 01:09:43 +02:00
1657fa039d Compositor: Fix crash when executing works in constant folding
Work scheduler needed initialization and execution models are
not created during constant folding. This moves work execution
method to execution system.
2021-07-07 01:09:31 +02:00
f49f406f67 GPencil: Rename BKE_gpencil_visible_stroke_iter
Renamed to  BKE_gpencil_visible_stroke_advanced_iter

Also created a simple version of the iterator to be used without multiframe and onion skin.
2021-07-06 22:18:49 +02:00
Vincent Blankfield
4a24c6fe37 UI: Center the Status Bar Progress Text
This patch horizontally centers the text inside the progress bar
widget. It is currently left-aligned and offset to the middle, which
doesn't center properly.

see D11205 for details and examples.

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

Reviewed by Julian Eisel
2021-07-06 12:17:42 -07:00
46a261e108 Compositor: Fix execution system unset during constant folding 2021-07-06 20:22:43 +02:00
40de5742af Fix: Crash when geometry nodes NURB spline has no evaluated points 2021-07-06 13:12:27 -05:00
586cf8b190 Nodes: Adds button to groups to change type of sockets.
The menu lists all socket types that are valid for the node tree.
Changing a socket type updates all instances of the group and keeps
existing links to the socket.
If changing the socket type leads to incorrect node connections the
links are flagged as invalid (red) and ignored but not removed. This is
so users don't lose information and can then fix resulting issues.
For example: Changing a Color socket to a Shader socket can cause an
invalid Shader-to-Color connection.

Implementation details:
The new `NODE_OT_tree_socket_change_type` operator uses the generic
`rna_node_socket_type_itemf` function to list all eligible socket types.
It uses the tree type's `valid_socket_type` callback to test for valid
types. In addition it also checks the subtype, because multiple RNA
types are registered for the same base type. The `valid_socket_type`
callback has been modified slightly to accept full socket types instead
of just the base type enum, so that custom (python) socket types can be
used by this operator.

The `nodeModifySocketType` function is now called when group nodes
encounter a socket type mismatch, instead of replacing the socket
entirely. This ensures that links are kept to/from group nodes as well
as group input/output nodes. The `nodeModifySocketType` function now
also takes a full `bNodeSocketType` instead of just the base and subtype
enum (a shortcut `nodeModifySocketTypeStatic` exists for when only
static types are used).

Differential Revision: https://developer.blender.org/D10912
2021-07-06 18:36:11 +01:00
933eddc9a1 cmake: use harvested 'wayland-protocols' if system version is insufficient 2021-07-06 18:17:27 +01:00
c26b46ddca cmake: add 'wayland-protocols' to 'make deps' 2021-07-06 18:17:27 +01:00
257bfb65b2 doc: add Wayland dependencies
The wayland support requires the following development packages:
libwayland-dev, wayland-protocols, libegl-dev, libxkbcommon-dev,
libdbus-1-dev, linux-libc-dev
2021-07-06 18:17:21 +01:00
a069fffcc4 GHOST/wayland: define BTN event codes manually 2021-07-06 18:17:21 +01:00
9182c882fe Geometry Nodes: Allow 3 points in curve star primitive 2021-07-06 12:11:09 -05:00
1364f1e35c Fix T89592: Can't remove keyframes without active keying set
Partially revert 7fc220517f, as it
introduced two issues:

- Deleting keys without active keying set was no longer possible, and
- there was no more confirmation popup.

Pressing {key Alt I} in the 3D Viewport now executes
`ANIM_OT_keyframe_delete_v3d`, adjusted to suit both T88068 and T89592:

- If there is an active keying set, delete keys according to that keying
  set.
- Otherwise, behave as `ANIM_OT_keyframe_delete_v3d` did before, that
  is, delete all keyframes of the selected object and in pose-mode also
  of selected bones.
2021-07-06 18:20:26 +02:00
563ef943c7 Cleanup: Keyframing, remove duplicate code
Remove duplicate code from the `ANIM_OT_keyframe_delete` operator. The
actions of the removed code are already performed by the preceding
`keyingset_get_from_op_with_error()` call.

No functional changes.
2021-07-06 18:20:26 +02:00
e2c4a4c510 Compositor: Graphviz improvements
Graphs are usually large, needing a lot of horizontal scrolling and
they can include more information for debugging.

This patch makes graph more compact horizontally by splitting
labels in lines and removing namespaces.
Furthermore it adds following information:
- Operation ID.
- SetValueOperation float value.
- Optionally, operation node name.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D11720
2021-07-06 18:11:49 +02:00
5780de2ae0 Compositor: Enable constant folding on operations
Only on current full frame operations that can be constant.
2021-07-06 18:11:49 +02:00
fc5be0b598 Compositor: Constant folding
Currently there is no clear way to know if an operation is constant
(i.e. when all rendered pixels have same values). Operations may 
need to get constant input values before rendering to determine 
their resolution or areas of interest. This is the case of scale, rotate
and translate operations. Only "set operations" are  known as 
constant but many more are constant when all their inputs are so.
Such cases can be optimized by only rendering one pixel.

Current solution for tiled implementation is to get first pixel
from input. This works for root execution groups, others
need previous groups to be rendered.

On full frame implementation this is not possible, because buffers
are created on rendering to reduce peak memory and there is
no per pixel calls.

This patch evaluates all operations that are constant into primitive
operations (Value/Vector/Color) before determining resolutions.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D11490
2021-07-06 18:11:49 +02:00
a070dd8bdd Cleanup: Set execution system as operations member in Compositor 2021-07-06 18:04:37 +02:00
1af722b819 Deps builder: macOS/ ffmpeg: Fix linker warning
ld: warning: could not create compact unwind for _ff_rl_init_vlc: stack
subq instruction is too different from dwarf stack size
Similar to rB2de5de57c58521862e0fecc95fc474ea347b7468

Differential Revision: https://developer.blender.org/D11796
2021-07-06 21:13:31 +05:30
Bastien Montagne
b05ba2ef0e Rename Scene's embeded collections from "Master Collection" to "Scene Collection"
Note that this name is essentially never used anywhere, besides as 'information'
mostly accessible from python console. Those embedded IDs are not in Main, so they
are not accessible by name ever, and mostly unusable from animation perspective
(either drivers or fcurves).

Therefore, no breakage is expected in user scripts or addons, nor when
loading in older versions of Blender.

Reviewed By: dfelinto, brecht

Differential Revision: https://developer.blender.org/D11812
2021-07-06 17:24:26 +02:00
7af40ccf5f GPU: Fix crash when using EGL with --gpu-debug flag.
During initialization of the platform a debug message is generated and
interpreted by de callback. Here the platform is checked what requires
an initialized platform.

Fixed by giving the platform check less priority in the check.
2021-07-06 14:24:42 +02:00
8f5a4a2453 Alembic export: evaluation mode option
This option will determine visibility on either render or the viewport
visibility. Same for modifer settings. So it will either evaluate the
depsgrah with DAG_EVAL_RENDER or DAG_EVAL_VIEWPORT.
This not only makes it more flexible, it is also a lot
clearer which visibility / modfier setting is taken into account (up
until now, this was always considered to be DAG_EVAL_RENDER)

This option was always present in the USD exporter, this just brings
Alembic in line with that.

ref. T89594

Maniphest Tasks: T89594

Differential Revision: https://developer.blender.org/D11820
2021-07-06 13:22:22 +02:00
834e87af7b Alembic: remove non-functional "Renderable Objects" only option
When introduced in {rB61050f75b13e} this was actually working (meaning
it checked the Outliner OB_RESTRICT_RENDER flag and skipped the object if
desired).

Behavior has since then been commented in rBae6e9401abb7 and apparently
refactored out in rB2917df21adc8.

If checked, it seemed to be working (objects marked non-renderable in
the Outliner were pruned from the export), however unchecking that
option did not include them in the export.

Now it changed - for the worse if you like - in rBa95f86359673 which
made it so if "Renderable Objects" only is checked, it will still export
objects invisible in renders. So since we now have the non-functional
option with a broken/misleading default, it is better to just remove it
entirely.

In fact it has been superseeded by the "Visible Objects" option (this
does the same thing: depsgraph is evaluated in render mode) and as a
second step (and to make this even clearer) a choice whether
Render or Viewport evaluation is used can be added (just like the USD
exporter has). When that choice is explicit, it's also clear which
visibility actually matters.

This is breaking API usage, should be in release notes.

ref. T89594

Maniphest Tasks: T89594

Differential Revision: https://developer.blender.org/D11808
2021-07-06 13:22:07 +02:00
ae8fa7062c Fix incompatible type passed to XR haptic
Likely caused by recent fixed-size types changes.
Seems to be no-functional-changes since the function is unused.
2021-07-06 12:36:42 +02:00
3382b07ad6 Cleanup: rename 'count' to 'len'
Reserve the term count for values that require calculation
(typically linked lists).
2021-07-06 12:09:52 +10:00
432bfbf7a3 Cleanup: pep8 2021-07-06 12:05:27 +10:00
36584bbc2d Cleanup: quiet discarded-qualifiers warning 2021-07-06 12:05:25 +10:00
4eeec6e9b5 Fix macOS builds after removing Ghost integral types. 2021-07-05 15:24:39 -07:00
ceff86aafe Various Exact Boolean parallelizations and optimizations.
From patch D11780 from Erik Abrahamsson.
It parallelizes making the vertices, destruction of map entries,
finding if the result is PWN, finding triangle adjacencies,
and finding the ambient cell.
The latter needs a parallel_reduce from tbb, so added one into
BLI_task.hh so that if WITH_TBB is false, the code will still work.

On Erik's 6-core machine, the elapsed time went from 17.5s to 11.8s
(33% faster) on an intersection of two spheres with 3.1M faces.
On Howard's 24-core machine, the elapsed time went from 18.7s to 10.8s
for the same test.
2021-07-05 18:09:36 -04:00
cf17f7e0cc Fix T89671: Crash when using Denoise node on Full Frame mode
Tiled fallback doesn't support single element buffers.
Ensure tiles are initialized as full buffers.
2021-07-05 23:36:43 +02:00
3d9ecf1cf2 Compositor: Full frame Color Balance node
Adds full frame implementation to this node operations.
No functional changes.
1.3x faster than tiled fallback.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D11764
2021-07-05 23:36:43 +02:00
0c90aa097d Compositor: Full frame Color Correction node
Adds full frame implementation to this node operation.
No functional changes.
1.4x faster than tiled fallback.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D11765
2021-07-05 23:36:43 +02:00
bf75106ae9 Compositor: Full frame Exposure node
Adds full frame implementation to this node operation.
No functional changes.
1.7x faster than tiled fallback.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D11766
2021-07-05 23:36:43 +02:00
c94877ae3d Compositor: Full frame Gamma node
Adds full frame implementation to this node operation.
No functional changes.
1.5x faster than tiled fallback.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D11767
2021-07-05 23:36:43 +02:00
00c6cbb985 Compositor: Add base operation for updating buffer rows
Simplifies code for operations with correlated
coordinates between inputs and output.
2021-07-05 23:36:43 +02:00
61afbf55f1 Cleanup: Use enum for UI block emboss type 2021-07-05 14:52:21 -05:00
Nicholas Rishel
f3ec0d8e58 Replace Ghost integrals with stdint fixed width integers.
Also replace integer with bool in Ghost API when only used as boolean,
and uint8* with char* in Ghost API when variable is a string.

Reviewed By: brecht

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

Signed-off-by: Nicholas Rishel <rishel.nick@gmail.com>
2021-07-05 11:00:45 -07:00
b66c21f8b0 Geometry Nodes: Use same shape as mesh line in curve line node
The line starts at the origin and ends at (0,0,1m), just like the mesh node.
2021-07-05 12:42:33 -05:00
Johnny Matthews
29d6750134 Geometry Nodes: Curve Primitive Line
This node creates a poly spline line in one of 2 modes:
 - Line between two points
 - Start Point, Direction, and Length

Both modes create splines with only start and endpoints.
A resample node can be used afterward to increase the point count.

Differential Revision: https://developer.blender.org/D11769
2021-07-05 12:27:12 -05:00
de70bcbb36 Cleanup: Clang tidy, unused include
Also a stupidly-included change I made when committing the patch.
2021-07-05 12:05:28 -05:00
Nikhil Shringarpurey
fd0370acc2 Geometry Nodes: Add explicit Float to Int conversion node
This patch adds a very simple node that explicitly converts a float to
an int. While this may seem redundant, it would offer 2 benefits to the
current requirement to use implicit float conversions:
 1. It makes the node tree's intent more clear and self-documenting
    (especially if changes in the future require integer inputs).
 2. It eliminates undefined behavior in current/future nodes from float
    inputs by guaranteeing that the input is an integer.

The node offers a variety of rounding techniques to make it more flexible.

Differential Revision: https://developer.blender.org/D11700
2021-07-05 11:52:10 -05:00
08241b313c Fix (studio reported) missing object's parent handling in readfile expand code.
This would prevent loading a parent that would only be referenced by
children during a linking operation.

Looks like this missing bit of code has been there since the stone ages,
it is fairly baffling to find that such critical low-levels mistakes can
survive decades in a codebase...

Note that such fully-indirectly linked parent object is not instantiated
in scene currently, this is fairly bad I think, but kind of a different
issue.
2021-07-05 18:07:02 +02:00
Yuki Hashimoto
0ef794b553 macOS: support Chinese and Korean input for text buttons
This patch extends D11695 to provide full support for Chinese and Korean
input on macOS.

Chinese input notes:

You can input symbolic characters (such as '! , '$') during Chinese input.

The difference from Japanese input is that multiple `insertText` may be
called with a single key down (`keyDown` method). This happens when you input
a symbolic character (such as '! , '$') during conversion.

The conversion is confirmed (`insertText`) and the symbolic character is
entered (`insertText`). To solve this problem, I have `result_text` to
concatenate the strings and store them in `result`.

Korean input notes:

Korean does not display a conversion suggestion window.

Like Chinese, Korean input may call multiple `insertText` methods. Also,
in Korean, the previous confirmation (`setMarkedText` and `insertText`) and
the next conversion is processed (`setMarkedText`) may be called
simultaneously with a single key down (`keyDown` method).

For example:
1. press g ㅎ (`setMarkedText`)
2. press k 하 (`setMarkedText`)
3. press t 앗 (`setMarkedText`)
4. press k 하세 (`setMarkedText`, `insertText`, `setMarkedText`)

Fixed so that the `insertText` and the last `setMarkedText` are processed.

Also, if a control character (such as Arrow, Enter) is input during Korean
input, the conversion will be confirmed (`setMarkedText`, `insertText`) and
the original control character will be processed.

In other words, if you press the left arrow key while typing in Korean, the
cursor will move to the left after the character is confirmed. Therefore, I
modified the `keyDown` method so that the `handleKeyEvent` is called again
after the `insertText` is processed in the `interpretKeyEvents` method.

Differential Revision: https://developer.blender.org/D11699
2021-07-05 17:24:34 +02:00
Yuki Hashimoto
83e2f8c993 macOS: support Japanese input for text buttons
Blender did not support to input East Asian characters (Chinese, Japanese,
Korean) on macOS. This patch adds support for Japanese input, by implementing
the appropriate processing for the NSTextInputClient protocol.

Technical notes:
* The conversion candidate window is drawn by the input method program calling
  `firstRectForCharacterRange`.
* The string before confirmation (called `composite` in blender) is handled in
  the `setMarkedText` method called by the input method program.
* The string after confirmation (called `result` in the blender) is processed
  in the `insertText` method called by the input method program.

Ref T51283

Differential Revision: https://developer.blender.org/D11695
2021-07-05 17:24:27 +02:00
Yuki Hashimoto
ac1ed19eae Fix: macOS wrong IME candidate window position on first display
IME conversion candidate window was displayed at the mouse position, instead of
below the cursor or text selection.

Blender need to tell the input method program where the conversion candidate
window is during Japanese and Chinese input.

In macOS, the `firstRectforCharacterRange` is called when input by the input
method starts, and the position of the conversion candidate window is
specified. Therefore, it is necessary to set the position of the conversion
candidate window before input starts. This patch changes it so that the position
of the conversion candidate window is always set when the cursor is drawn.

Differential Revision: https://developer.blender.org/D11697
2021-07-05 17:20:05 +02:00
673c254c7d Cleanup: Rename ambiguous "params" variable in File Browser notifier listeners
File Browser code uses the term "params" for its file selection parameters a
lot. Avoid confusion/ambiguity by calling the notifier listener parameters
"listener_params".
2021-07-05 16:45:15 +02:00
cadda7aa5c Assets: Disable file renaming operator for Asset Browsers
This operator only works with renaming files, not assets.
2021-07-05 16:06:47 +02:00
b8115f0c5b Fix performance regression in Exact boolean due to exact triangulation.
Went back to using Blender's polyfill for triangulation, which is much
faster (time for a 3.1M face boolean went from 103s to 48s).
Had to put in detection for the case that needs the exact triangulator
(bug T86805), and also a fix for non-convex quads (bug T89330).
2021-07-05 10:00:29 -04:00
dac81ad71b EditMesh: extract restore logic out of EDBM_redo_state_free
Split mesh restore logic into a new function:
`EDBM_redo_state_restore_and_free`.
2021-07-05 23:45:21 +10:00
d27db03444 LineArt: Fix occlusion effectiveness for culled triangles. 2021-07-05 20:43:03 +08:00
Yuki Hashimoto
2d0b9faaf6 Fix: IME conversion candidate window not correctly placed on macOS
Blender needs to tell the input method program where the conversion
candidate window is during Japanese and Chinese input.

In macOS, there are displays where the window size and the native pixel size
are different, so the candidate window may appear in an unnatural position.

This patch converts the cursor position x and y for matching macOS window
coordinate. On Windows, GHOST_GetNativePixelSize returns 1, so it has no effect.

Differential Revision: https://developer.blender.org/D11696
2021-07-05 14:32:35 +02:00
Yuki Hashimoto
32124b940e Fix: IME input displays text after cursor before cursor
When inserting text using IME on a button, the character after the cursor is
displayed before the cursor.

This bug seems to have occurred during the refactoring in D765.

Differential Revision: https://developer.blender.org/D11072
2021-07-05 14:32:35 +02:00
bd0de99b52 Cleanup: spelling, punctuation 2021-07-05 22:27:03 +10:00
2ecc33d84b Cleanup: move repeated assignment out of nested for loop 2021-07-05 22:02:57 +10:00
6eb8340ef4 Cleanup: use const arguments 2021-07-05 22:02:57 +10:00
416e006a2a Cleanup: use 'use_' prefix for RNA booleans 2021-07-05 22:02:57 +10:00
92b775d319 Cleanup: remove unnecessary bmesh operator comments 2021-07-05 22:02:57 +10:00
ab6a011b3b GPencil: Fix memory leak in trim and split functions.
`dvert->dw` from old strokes are not freed properly, fixed.
2021-07-05 19:56:41 +08:00
aad8b8405c Fix T89655: tweak Cycles transparent bounces UI for clarity
Transparent bounces are independent of other bounces, so don't group
them together.
2021-07-05 13:42:54 +02:00
2eca9c7ed4 Cleanup: Move common File Browser renaming code into functions
Code would manually do the same things in a couple of places, obvious case of
unnecessary code duplication.
2021-07-05 13:35:41 +02:00
Yuki Hashimoto
2c6c1b6cc0 Cleanup: replace NSTextInput with NSTextInputClient
This revision replaces the deprecated protocol NSTextInput with
NSTextInputClient in Cocoa Text View. No functional changes.

For more information of the methods, please see:
https://developer.apple.com/documentation/appkit/nstextinputclient

Differential Revision: https://developer.blender.org/D11407
2021-07-05 13:10:08 +02:00
Yuki Hashimoto
c1ba68dd04 Cleanup: use arrayWithObject to reduce the code
Similar code is found in Apple's code samples.

Differential Revision: https://developer.blender.org/D11434
2021-07-05 13:10:08 +02:00
24a77745a4 Functions: add utility to create string from value of generic type 2021-07-05 13:02:16 +02:00
fb46c047bd BLI: wrap more features off tbb::enumerable_thread_specific
* Make the wrapper enumerable.
* Support an initializer function.
2021-07-05 13:02:16 +02:00
ded4dc7761 BLI: add conversion constructor for destruct_ptr
This allows converting between different `destruct_ptr` types (which is
just a `std::unique_ptr` with a custom deleter).

The most common use case is to convert from a derived type to
the type of the base class.
2021-07-05 13:02:16 +02:00
dc3f46d96b Tests: performance testing framework
These are scripts for benchmarking Blender features on real-world .blend
files. They were originally written for benchmarking Cycles performance, and
were made generic so they can be used for more Blender features.

The benchmarks can be run locally by developers. But the plan is to also run
these as part of continuous integration to track performance over time.

Currently there are tests for Cycles rendering and .blend file loading.

Documentation:
https://wiki.blender.org/wiki/Tools/Tests/Performance

Main features:
* User created configurations to quickly run, re-run and analyze a selected
  subset of tests.
* Supports both benchmarking with existing builds, and automatic building of
  specified git commits, tags and branches.
* Generate HTML page with bar and line graphs from test results.
* Controlled using simple command line tool.
* For writing tests, convenient abstraction to run a Python function in Blender
  with arguments and return value.

Ref T74730

Differential Revision: https://developer.blender.org/D11662
2021-07-05 12:32:32 +02:00
bb971bead9 Fix T89523: Cycles OpenCL compile error after shadow terminator changes 2021-07-05 11:26:40 +02:00
e785569c95 Cleanup: clang-tidy 2021-07-05 19:09:24 +10:00
c9eaf04afb Cleanup: remove outdated comment 2021-07-05 19:08:19 +10:00
a87593e62a Fix early return in reverse-color where continue was intended 2021-07-05 18:54:53 +10:00
9009ac2c3d Geometry Nodes: new Viewer node
This adds a viewer node similar to the one in the compositor.
The icon in the headers of nodes is removed because it served
the same purpose and is not necessary anymore.

Node outputs can be connected to the active viewer using
ctrl+shift+LMB, just like in the compositor. Right now this collides
with the shortcut used in the node wrangler addon, which will
be changed separately.

As of now, the viewed geometry is only visible in the spreadsheet.
Viewport visualization will be added separately.

There are a couple of benefits of using a viewer node compared
to the old approach with the icon in the node header:
* Better support for nodes that have more than one geometry output.
* It's more consistent with the compositor.
* If attributes become decoupled from geometry in the future,
  the viewer can have a separate input for the attribute to visualize.
* The viewer node could potentially have visualization settings.
* Allows to keep "visualization points" around by having multiple
  viewer nodes.
* Less visual clutter in node headers.

Differential Revision: https://developer.blender.org/D11470
2021-07-05 10:46:36 +02:00
04313f1bb5 BMesh: remove redundant mesh-backups from EDBM_op_* API
Using BMesh operators through the edit-mesh API created a full copy
of the mesh so it was possible to restore the mesh in case
one of the operators raised an error.

Remove support for automatic backup/restore from the EDBM_op_* API's
as it adds significant overhead and was rarely used.

Operators that need this can use the BMBackup API to backup & restore
the mesh in case of failure.

Add warning levels to BMO_error_raise so operators can report problems
without it being interpreted as a request to cancel the operation.

For high-poly meshes creating and freeing a full copy is an expensive
operation, removing this gives a speedup of ~1.77x for most operators
except for "connect_verts" / "connect_vert_pair"
which still uses this functionality.
2021-07-05 18:36:33 +10:00
afe7387be8 BMesh: remove redundant copy-on-write tagging
The evaluated meshes no longer store a copy of the edit-mesh
so tagging when a BMesh operator fails can be removed.
2021-07-05 18:31:44 +10:00
b29a8a5dfe BMesh: dissolve faces no longer fails when some faces can't dissolve
Previously, any face groups that could not be merged into a face
caused the entire operation to report an error and do nothing.

Now these cases are skipped over, dissolving faces where possible.
2021-07-05 18:31:44 +10:00
9075f63e8f Cleanup: unused variable 2021-07-05 10:29:21 +02:00
76f7b22989 Cleanup: minor improvements to BMesh dissolve faces
- Only create arrays with groups of two or more faces.
- Remove raising exception for zero length arrays.
- Remove redundant exception check (assert there is no exception).
- Use a struct for face array & it's length instead of a NULL
  terminated array (removes the need to count faces in a loop).
2021-07-05 15:54:57 +10:00
dccadc9e78 Cleanup: update comment formatting
- Replace '[mce]' with "Mike Erwin".
- Remove references to turn-table author as it isn't useful information,
  the author was credited in the commit message.
2021-07-05 15:54:57 +10:00
5b2d2b2319 Cleanup: remove temporary header 2021-07-05 15:54:57 +10:00
2929cfe5de Cleanup: remove unused defines 2021-07-05 15:54:57 +10:00
f0f7282d9d Cleanup: spelling in comments 2021-07-05 15:54:57 +10:00
b73dc36859 GPencil: Add weight factor to Offset randomize
Now, The weight is used in the randomize parameters of the offset modifier. 

This is useful to generate effects like explosions.

Related to the new Vertex Weight modifiers.
2021-07-03 17:41:12 +02:00
9b89de2571 Cleanup: consistent use of tags: NOTE/TODO/FIXME/XXX
Also use doxy style function reference `#` prefix chars when
referencing identifiers.
2021-07-04 00:43:40 +10:00
05f970847e GPencil: Fix unreported PDF export offset
When exporting a PDF, the image was displaced towards top right a few pixels.

Also removed is_orthographic variable because is not needed now.
2021-07-03 12:32:44 +02:00
2d146b61d8 Cleanup: Use simpler method to retrieve attribute domain 2021-07-02 23:16:39 -05:00
5f5cf21a83 Cleanup: Remove unused transform matrix from objects
This was the only reference to this matrix.

https://developer.blender.org/D11770
2021-07-02 13:27:56 -05:00
55f27617cf Geometry Nodes: Add mesh input warning to curve to mesh node
A point of confusion about this node is that it doesn't work on the
output of the mesh circle primitive node. This patch adds a warning to
help with that. This avoids adding a warning when the geometry set
input has no mesh.

Differential Revision: https://developer.blender.org/D11771
2021-07-02 13:24:42 -05:00
00e30f122b Build: upgrade NanoVDB library to latest revision
This includes improved handling of OpenVDB trees with inactive voxels,
which previously could throw an error.

Ref T89581, T88438
2021-07-02 19:06:08 +02:00
82466ca2e5 Fix T89581: Cycles crash rendering some OpenVDB files with inactive voxels
Print an error message instead.
2021-07-02 19:01:53 +02:00
0c84939117 Cleanup: use template utility function to handle OpenVDB grid types in Cycles 2021-07-02 19:01:53 +02:00
8221d64844 Cleanup: Further use of const when accessing evaluated mesh
Also resolve a warning from the previous commit. The next blocker to
using const is `BKE_mesh_wrapper_ensure_mdata`.
2021-07-02 11:56:29 -05:00
5f8969bb4b Cleanup: Use const mesh to ensure BVH and triangulation cache
As noted in a comment now, these functions only update a cache, so they
don't change the logical state of the mesh, which is "it will have the
data when necessary." Using a const argument will help const correctness
when accessing an object's evaluated mesh.
2021-07-02 11:37:01 -05:00
a1609340b4 Cleanup: Fix variable redeclaration warning 2021-07-02 10:07:43 -05:00
a96b52e37f GPencil: Fix compiler warnings in previous commit 2021-07-02 16:32:57 +02:00
88c855174d Cleanup: Remove unused/unneeded code from old Asset Engine design
This code was written for the File Browser together with the Asset Engine
design, that is not part of the Asset Browser/System design anymore. Updated
comments accordingly.

`FileDirEntryRevision` was actually used, but I removed it and moved the used
members to the parent `FileDirEntry`, since there is no concept of revisions
currently.

There should be no functional changes.
2021-07-02 15:42:22 +02:00
5a693ce9e3 Constraints: support a new Local Space (Owner Orientation) for targets.
Add a new transformation space choice for bone constraints, which
represent the local transformation of the target bone in the constraint
owner's local space.

The use case for this is transferring the local (i.e. excluding the
effect of parents) motion of one bone to another one, while ignoring
the difference between their rest pose orientations.

The new option replaces the following setup:

* A `child` bone of the `target`, rotated the same as `owner` in rest pose.
* A `sibling` bone of the `target`, positioned same as `child` in rest
  pose and using Copy Transforms in World Space from `child`.
* The `owner` bone constraint uses Local Space of `sibling`.

(This analogy applies provided both bones use Local Location)

Differential Revision: https://developer.blender.org/D9493
2021-07-02 15:15:05 +03:00
bc8ae58727 Copy Transforms: implement Remove Target Shear and more Mix options.
This constraint can be naturally viewed as a prototype for a future
4x4 matrix math node (or subset thereof), since its basic semantics
already is matrix assignment. Thus it makes sense to add math options
to this constraint to increase flexibility in the meantime.

This patch adds support for several operations that would be useful:

- An option to remove shear in the incoming target matrix.

  Shear is known to cause issues for various mathematical operations,
  so an option to remove it at key points is useful.

  Constraints based on Euler like Copy Rotation and Limit Rotation
  already have always enabled shear removal built in, because their
  math doesn't work correctly with shear.

  In the future node system shear removal would be a separate node
  (and currently Limit Rotation can be used as a Remove Shear constraint).
  However removing shear from the result of the target space conversion
  before mixing (similar to Copy Rotation) has to be built into
  Copy Transforms itself as an option.

- More ways to combine the target and owner matrices.

  Similar to multiple Inherit Scale modes for parenting, there are
  multiple ways one may want to combine matrices based on context.
  This implements 3 variants for each of the Before/After modes
  (one of them already existing).

  - Full implements regular matrix multiplication as the most basic
    option. The downside is the risk of creating shear.
  - Aligned emulates the 'anti-shear' Aligned Inherit Scale mode,
    and basically uses Full for location, and Split for rotation/scale.
    (This choice already existed.)
  - Split Channels combines location, rotation and scale separately.

  Looking at D7547 there is demand for Split Channels in some cases,
  so I think it makes sense to include it in Copy Transforms too, so that
  the Mix menu items can be identical for it and the Action constraint.

Differential Revision: https://developer.blender.org/D9469
2021-07-02 15:15:05 +03:00
01e1944cd4 File Browser: Refactor file "UUID" code (which wasn't really a "UUID")
To some degree these are changes in preparation of further Asset Browser
related changes, see D11119. But also, the current UUID design was written for
the old Asset Engine design, which isn't part of the current Asset
Browser/System design anymore.
And lastly, "UUID" are a well established standard
(https://en.wikipedia.org/wiki/Universally_unique_identifier) which this
implementation didn't follow. What we have here is more of an index, or a
unique identifier (https://en.wikipedia.org/wiki/Unique_identifier).

So this does the following changes:
* Renames "UUID" to "UID"
* Changes the type of the UID to (a typedef'ed) `uint32_t`, which is more than
  enough for our current asset system design and simplifies things.
* Due to the new type, we can avoid allocations for hash-table storage.
* Add/use functions for UID handling

Note that I am working on a major rewrite of the file-list code. Meanwhile we
want to keep things sensible.
2021-07-02 13:49:30 +02:00
29b65f5345 GPencil: New modifier to generate weights dynamically
his new modifier allows to generate weights base on:

* Angle of the stroke relative to object or world orientation. For example, if the value is 90, the maximum weights will be for vertical lines and minimum for horizontal lines.

* Distance to Target object. The distance calculated is normalized to get valid weights between 0 and 1.0.

The weights are created in an existing vertex group and the data can be replaced or mixed with the existing value to combine different weight effects. The minimum parameter, allows to define the minimum weight generated. This is useful to avoid very low weights.

The generated weights can be used in any modifier. For example, the angle weight value can be used to mimic FreeStyle Caligraphy modifier using the weight with the thickness modifier.

Also some modifier has been changed to inlude a new option to use the weights as factor of the effect.
As result of this change, the fading option has been removed from Thickness and Opacity modifiers because this can be done using the new modifier, it's not logic to repeat the same.

Reviewed By: mendio, filedescriptor

Differential Revision: https://developer.blender.org/D11604
2021-07-02 12:04:07 +02:00
9f5c0ffb5e Cleanup: Use const variables for object's evaluated mesh
Generally the evaluated mesh should not be changed, since that is the
job of the modifier stack. Current code is far from const correct in
that regard. This commit uses a const variable for the reult of
`BKE_object_get_evaluated_mesh` in some cases. The most common
remaining case is retrieving a BVH tree from the mesh.
2021-07-01 23:03:27 -05:00
016a2707f5 Cleanup: refactor edit-mesh copy functions into functions 2021-07-02 12:51:44 +10:00
841b2cea7b Cleanup: compiler & clang-tidy warnings 2021-07-02 12:15:29 +10:00
addb1a5c9a Cleanup: spelling in comments 2021-07-02 12:15:29 +10:00
b39d66adde Fix T88909: Win32 getTitle() UTF8 Support
In the Win32 platform our setTitle() can properly assign a Unicode
utf-8 window title. Unfortunately our getTitle() will only read regular
8-bit character strings. This means that we can never compare what we
set to what we get. This patch updates getTitle() to use Unicode-aware
GetWindowTextLengthW and GetWindowTextW.

see T88909 for an example of this affecting user experience.

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

Reviewed by Ray Molenkamp
2021-07-01 18:08:29 -07:00
0ff1c38fcc Cleanup: Move bvhutils.c to C++
This will be useful when adding a utility to create a BVH tree from a
`CurveEval` for the attribute proximity and attribute transfer nodes.
2021-07-01 16:46:55 -05:00
7eecf77f0b VSE: Fix handle size calculation
Handle width calculation was incorrect in drawing code. This caused
handles to be invisible when zoomed out.

After fixing math, handles become too large, so now they are constrained
to quarter of strip width, which feels more natural and represents
clickable area more closely.

`sequence_handle_size_get_clamped()` did not return size in pixels, but
in 2D-View space, this comment was corrected.
2021-07-01 23:38:06 +02:00
fd1fec5600 Cleanup: Clang tidy, remove typedef 2021-07-01 16:33:07 -05:00
b7b5c23b80 Fix memory leak in VSE transform code
SeqCollection wasn't freed.

It wasn't easy to find culprit so added argument to
SEQ_collection_create() to pass function name.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D11746
2021-07-01 22:14:29 +02:00
519c12da41 VSE: Snapping feedback
Address initial feedback:
 - Use checkboxes instead of radio buttons
 - Hide snapping distance control from UI
 - Tweak snapping line color - use selected strip color, 50% transparency. Similar to other editors
 - Draw 2px thick line, since strip outline is also 2px thick

Reviewed By: HooglyBoogly

Differential Revision: https://developer.blender.org/D11759
2021-07-01 22:08:11 +02:00
4a7951fede Cleanup: Separate each extractor into specific compile units
Makes code cleaner and easier to find.
2021-07-01 11:13:58 -03:00
4617172740 Fix race condition when loading multiple File/Asset Browsers at once
When multiple File or Asset Browsers would load at once (e.g. when loading a
file with two File Browsers open) and they would load multiple directories or
.blend files (using the Recursions option in the File Browser or loading an
asset library with multiple .blends), often only one File/Asset Browser would
correctly load all files. Others would be incomplete or entirely empty. That
was because of a race condition, where the directories or .blend files would be
loaded concurrently and the first one that finished would cancel the other
ones. This again happened because they used the job system with the same
"owner", which by design makes all jobs with the same owner cancel as soon as
the first is finished.
Address this by making sure they have different owners. That is, not the scene
anymore, but the filelist the job belongs to. Doesn't make much sense to use
the scene as owner for scene-unrelated file loading anyway.

Steps to reproduce were:
* Open two File Browsers as regular editors.
* In the Display Settings popover, set "Recursions" to 2 or 3 levels.
* Navigate to a directory with plenty of subdirectories in both File Browsers.
* Save the file.
* Reload the file, one of the File Browsers likely has an incomplete file list.

Alternatively, use Asset Browsers and open an asset library containing multiple
.blends.
2021-07-01 15:22:12 +02:00
a112adf16a Audaspace: porting pulseaudio fixes from upstream. 2021-07-01 14:26:13 +02:00
19d19970e4 Fix T88887: Audio causes issues with Playback when PC put to Sleep, Hibernate or when Screensaver appears
Porting WASAPI device reinitialization from upstream.
2021-07-01 14:26:13 +02:00
8c3855dc6e Fix broken physics modifiers after cleanup commits
4f3ec0110 and 5a64c687dd should have removed the entire conditional to skip
time depedent modifiers, rather than always enable it.
2021-07-01 12:58:42 +02:00
Paul Golter
229c0580e2 Fix: Export subtitles timecode relative to scene start frame, ignore muted strips
This patch writes the timecode in the .srt file relative to the start
frame of the scene. If the timecode is global but scene does not start
at frame 0 the subtitles don't match if they get loaded in an external
video player. Muted strips will be ignored. Don't allow negative
timecodes in .srt.

Reviewed By: Richard Antalik
Differential Revision: http://developer.blender.org/D11762
2021-07-01 12:21:31 +02:00
96d487b3ae Cleanup: remove redundant calls to BMO_error_clear 2021-07-01 17:25:27 +10:00
aaa8ee1307 Cleanup: remove bmesh-operator error code
The error codes could be used to look up messages from a table
of messages however this wasn't especially useful.

Now all calls to BMO_error_raise must inclue a message.
2021-07-01 17:01:19 +10:00
927456491a Fix edit-mesh partial update regression when snapping to normals
Edit-mesh partial update logic assumed translate didn't need normals
to be recalculated (for faces with all vertices being transformed).

However translate can optionally rotate which requires
all transformed normals to be updated.

Check for this case and use the previous partial-update method
when it modified extra geometry, so the normals are properly reset.
Further updates need not recalculate them.
2021-07-01 14:53:01 +10:00
02df67875a Cleanup: replace booleans with enum for storing translate rotation 2021-07-01 13:30:19 +10:00
f578e31a8e Correction to T89571 fix 4546f176eb
Supporting both object & edit-mode is more involved.
Both cases are now supported with object mode tracking the last-used
state for rotation so it's only reset once when rotation is disabled.
2021-07-01 12:58:10 +10:00
4546f176eb Fix T89571: Align Orientation to Target keeps rotation when toggled 2021-07-01 11:54:05 +10:00
1e532eb37a BLI_linklist_stack: use cast to prevent warnings when used in C++ 2021-07-01 11:24:54 +10:00
aa112dc77c Cleanup: spelling 2021-07-01 11:16:25 +10:00
39188f3c99 Cleanup: rename playhead to current-frame 2021-07-01 11:06:04 +10:00
930ecef9b5 Cleanup: outdated IPO references in comments 2021-07-01 11:06:04 +10:00
753806c731 Cleanup: spelling 2021-07-01 10:25:49 +10:00
a689b5932d Cleanup: remove unused internal grease pencil definitions 2021-07-01 10:25:49 +10:00
dba675fb65 Cleanup: split normal calculation into it's own file
Normals now includes many functions including normal splitting &
custom normal manipulation split this into it's own file
to centralize related functions.
2021-07-01 10:25:49 +10:00
924596abad Cleanup: clang-format, clang-tidy 2021-07-01 10:25:49 +10:00
Johnny Matthews
c1fc180861 Geometry Nodes: Curve Primitive Circle
This node has two modes: the first mode computes a circle from three
locations and a resolution. The second takes radius and resolution.
The first mode also outputs the center of the computed circle as
a vector.

Differential Revision: https://developer.blender.org/D11650
2021-06-30 19:22:13 -05:00
5a64c687dd Cleanup: Fix compiler warning from previous commit
The use_deform argument was always passed as zero or one, so the "< 0"
check is no longer necessary.
2021-06-30 18:03:45 -05:00
4f3ec01101 Cleanup: Use bool instead of int, rename variable
The "useDeform" argument was only passed as 1 or 0, so even though
there was an odd "< 0" comparison, it can be passed as a boolean.
2021-06-30 16:41:53 -05:00
17a67bf778 UI: custom free function improvements
This changes `UI_but_func_tooltip_set` so that it allows passing a custom free function, which has two benefits:

* The caller can pass `null` to indicate that the value should not be freed.
* Arbitrary c++ data can be passed to the callback (before the struct had to be trivially destructible).

I added `uiFreeArgFunc` and used it in other places where appropriate.

Differential Revision: https://developer.blender.org/D11738
2021-06-30 17:46:59 +02:00
ca12d70af0 Cleanup: variable naming for texture/material SocketPropertyType
Copy-Pasting error in rB3025c348253a

Maniphest Tasks: T88701

Differential Revision: https://developer.blender.org/D11755
2021-06-30 17:29:14 +02:00
5737193d81 Fix bad versioning of snapping flags
If the value of a macro has changed. We need to change all references to
that macro in the versioning code.
2021-06-30 10:42:09 -03:00
8de8ab38f6 Fix T89535: FCurve.mute UI text wrong
Copy-paste mistake in rB4e9817a4fb29 (copied from fmodifier).

Maniphest Tasks: T89535

Differential Revision: https://developer.blender.org/D11753
2021-06-30 15:38:06 +02:00
0e4245bc28 Fix T89554: UV snapping broken
Caused by {rBfba9cd019f21}.

Above commit reordered toolsettings snapping flags but missed remapping
these for the UV toolsettings in versioning code.

Differential Revision: https://developer.blender.org/D11756
2021-06-30 15:15:32 +02:00
be451354c9 Fix T89153: Follow Path for empty works only in negative values
The old code only clamped cyclic curves
2021-06-30 11:20:42 +02:00
918d9291d6 Cleanup: store the result of isLockConstraint for reuse
This was being called for every element in some situations.
2021-06-30 18:40:16 +10:00
c57b0cae28 Cleanup: rename transform mode variables
Use the term 'mat_final' for calculated matrices used for transforming.
Also rename 'pivot' to 'pivot_local'.
2021-06-30 18:18:30 +10:00
4f9ef65dac Transform: support multi-threading for bend 2021-06-30 18:01:14 +10:00
2d4ec90497 Transform: support multi-threading for most modes
Multi-threading support for transform modes: bevel-weight, crease,
push-pull, rotate, shear, shrink-fatten, skin-resize, to-sphere,
trackball & translate.

This is done using a parallel loop over transform data.

From testing a 1.5million polygon mesh on a 32 core system
the overall performance gains were between ~20-28%

To ensure the code is thread-safe arguments to shared data are const.

Reviewed By: mano-wii
2021-06-30 16:53:55 +10:00
501d2443d0 Cleanup: use const arguments for accessor functions 2021-06-30 16:42:19 +10:00
df9597cfba Cleanup: use const for datatoc declarations 2021-06-30 16:42:19 +10:00
Johnny Matthews
8884d2d61b Geometry Nodes: Curve Primitive Bezier Segment
Creates a Curve with 1 Bezier Spline from four positions (start,
start handle, end handle, end) and a resolution. The handles are
aligned and mirrored automatically. An "Offset" mode is also included
to allow specifying the handles relative to the control points.

The default settings recreate the existing default Bezier Curve in the
3D viewport add menu.

Differential Revision: https://developer.blender.org/D11648
2021-06-30 00:03:55 -05:00
c36d2a9a7a Cleanup: rename 'count' to 'len'
Reserve the term count for values that require calculation
(typically linked lists).

Without this convention it's difficult to know if using a length
accessor function in a loop will be O(N^2) without inspecting the
underlying implementation.
2021-06-30 14:39:32 +10:00
77ac1f39c4 Cleanup: unused arg warnings 2021-06-30 14:32:53 +10:00
Johnny Matthews
d3788207aa Geometry Nodes: Curve Primitive Quadratic Bezier Segment
This patch is for a node that creates a poly spline from a
3 point quadratic Bezier. Resolution is also specified.

Curve primitives design task: T89220

Differential Revision: https://developer.blender.org/D11649
2021-06-29 22:39:26 -05:00
Johnny Matthews
21ebee2580 Geometry Nodes: Curve Primitive Spiral
This node creates a curve spline and gives control for the number of
rotations, the number of points per rotation, start and end radius,
height, and direction. The "Reverse" input produces a visual change,
it doesn't just change the order of the control points.

Differential Revision: https://developer.blender.org/D11609
2021-06-29 22:22:28 -05:00
Johnny Matthews
86c6769e20 Geometry Nodes: Curve Primitive Spiral
This patch adds a Curve Primitives menu in Geometry nodes with an
initial entry of a star primitive.

The node is a basic star pattern node that outputs a poly spline.
Options control the inner and outer radius, the number of points,
and the twist of the valleys.

Differential Revision: https://developer.blender.org/D11653
2021-06-29 22:00:29 -05:00
2d35eed34d Cleanup: split uses of _snap_sequencer_apply according to transform mode
The `applySnap` callback of each mode was overwriting the value
calculated in `transform_snap_sequencer_apply`.
2021-06-29 18:08:41 -03:00
929d9ec0c7 Cleanup: Deduplicate code 2021-06-29 17:42:48 -03:00
dd14ea1819 Cleanup: split CalcSnapGeometry in smaller functions 2021-06-29 17:38:34 -03:00
fba9cd019f VSE: Improved Snapping
Change snapping behavior to snap strip edges when they are close to snap point.
Default behavior is, that each transformed strip is snapped to any other strip.

Implement snapping controls in sequencer tool settings. These controls include:

 - Snapping on/off
 - Ability to snap to playhead and strip hold offset points
 - Filter snap points by excluding sound or muted strips
 - Control snapping distance

Snapping controls are placed in timeline header similar to 3D viewport

Reviewed By: mano-wii

Differential Revision: https://developer.blender.org/D11646
2021-06-29 20:30:31 +02:00
ea43ae4194 Fix crash on link/append for asset data-blocks in Thumbnails mode
Same fix as 03a83b4eb5, but for the Thumbnails display mode.
2021-06-29 20:09:07 +02:00
516a060bb3 Fix T89523: Cycles OpenCL compile error after recent changes
Also correctly used inverse transposed matrix for normal transform.
2021-06-29 19:47:11 +02:00
999f1f7504 Win32: Window Placement DPI and Scale Adjustment
When using multiple monitors that differ in scale and/or dpi, the
varying sizes of the window titles and borders can cause the placement
of those windows to be out by a small amount. This patch adjusts for
those differences on Windows 10 and newer.

see D10863 for details and examples.

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

Reviewed by Ray Molenkamp
2021-06-29 09:29:40 -07:00
2ff714269e UI: Support setting operator properties for UILayout.operator_menu_enum()
`UILayout.operator_menu_enum()` now returns the operator properties, just like
`UILayout.operator()`. This makes it possible to set options for the operator
displayed in the menu. In C it can be done through the new
`uiItemMenuEnumFullO()` or `uiItemMenuEnumFullO_ptr()`.

It's reasonable to have this, probably just a small thing never bothered to
add. D10912 could use it, the following comment can be addressed now too:
https://developer.blender.org/diffusion/B/browse/master/source/blender/editors/space_nla/nla_buttons.c$583-586
2021-06-29 18:20:56 +02:00
63aa6dd845 Cleanup: Win32 Window Creation
This is just some cleanup of the Win32 window creation code. After
CreateWindowExW() this patch uses some early exits to replace some
potentially confusing if blocks. No functional changes.

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

Reviewed by Ray Molenkamp
2021-06-29 08:51:51 -07:00
ae636994cd Fix Cycles hair render error on GPU after recent changes
Volumes primitive needs to be part of traceable primitives.
2021-06-29 16:35:06 +02:00
037035921b Cleanup: Remove unused function in lineart_cpu.c 2021-06-29 22:32:38 +08:00
e7fc15e2ef Fix T70615: Cycles ignores BSDF inputs when nodes are optimized
When compiling BSDF nodes, we only assing stack space to the normal and
tangent inputs if they are linked. However, it could be that the
ConstantFolder removed the link, so checking if there is a link fails
to take this into account.

To fix this, added a flag to ShaderInput to keep track of whether a
constant was folded into the input, and use it as well to verify that
the socket is linked when assigning stack space.

Reviewed By: brecht

Maniphest Tasks: T70615

Differential Revision: https://developer.blender.org/D11731
2021-06-29 16:24:21 +02:00
d1e0059eac LineArt: Filtering intersection lines using mask numbers
Mask value works just like transparency mask.

You are able to select intersection lines inside a
collection or, between collections.

Reviewed By: Sebastian Parborg (zeddb)

Differential Revision: https://developer.blender.org/D11309
2021-06-29 20:47:55 +08:00
5d5cf53081 Fix T89484: NLA "Remove Empty Animation Data" missing Outliner refresh
Similar to rBb4530deec478, just add appropriate notifier.

Maniphest Tasks: T89484

Differential Revision: https://developer.blender.org/D11724
2021-06-29 14:37:00 +02:00
8f6a9c5176 Fix T89526: "Toggle Maximize Area" clears context screen properties
Removed in b787581c9c as it's comment
noted it was bad code, the reason for it's necessity was no longer valid.

Add this back with comment explaining why it's still needed.
2021-06-29 21:09:00 +10:00
5130bb116a Cleanup: unused warnings 2021-06-29 21:09:00 +10:00
df7db41e1b LineArt: Use separate sub panel for line types.
Reviewed By: Sebastian Parborg (zeddb)

Differential Revision: https://developer.blender.org/D11735
2021-06-29 18:48:59 +08:00
f2c52aa0e1 Cleanup: use 'const' arguments in transform calculation
Use const arguments to simplify further optimizations.

Transforming elements shouldn't need to change their containers
data-structures.
ElementResize for grease pencil stroke thickness was
modifying TransInfo.num & TransInfo.values_final.

Now copies are operated on to preserve const correctness although
it's worth investigating if this can be avoided altogether.
2021-06-29 20:23:30 +10:00
855f7fee63 Cleanup: clang-format 2021-06-29 20:13:24 +10:00
203d405299 Cleanup: spelling 2021-06-29 20:12:51 +10:00
66d48b272e Cleanup: GPU Shader Log Parsing.
- Added functions to check if the cursor is at a number.
- Added function to parse a number.
- Joined skip_separator functions.
- Added function to check if cursor is at any given set of characters.
2021-06-29 09:52:31 +02:00
ee0c3081b0 Fixed issue in previous commit.
During development a test was disabled. Enabling it again.
2021-06-29 09:08:33 +02:00
2262d6c45a Fix T89405: Viewport Render Preview glitching (AMD)
AMD Drivers didn't report an additional space in the rendered. This made
testing for the HQ workaround fail and the issue appeared back on
certain cards.

This fix will test with surrounding spaces or if the renderer name
endswith the given string. If any of these are the case the hq normals
workaround will be enabled.
2021-06-29 09:04:24 +02:00
28135c06bb Typo in function identifier: mutli -> multi
Fixing small typo of word "multi" in function identifier by renaming
"count_mutli_input_socket_links" to "count_multi_input_socket_links"

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

Reviewed by Hans Goudey
2021-06-28 20:58:17 -07:00
24c321cfe9 Cleanup: Use function name for allocation strings
This is simpler, more consistent, and takes up less space.
2021-06-28 22:45:02 -05:00
91b31173e9 LineArt Cleanup: Rename floating->loose
see comment in https://developer.blender.org/rB841df831e89dfc4011c323203c2efb8265dc1878
2021-06-29 11:40:59 +08:00
34b213d604 Cleanup: use "use_" prefix for boolean types 2021-06-29 13:31:53 +10:00
c109a39995 Cleanup: translate comments
It wasn't so clear why the POINT_INIT check was disabled,
move this into the code comment.
2021-06-29 13:31:53 +10:00
f8d8f28e2c Curves: Avoid duplication of control points during evaluation
This commit avoids duplicating the deformed control point
list twice by modifying the list in the object curve cache directly.

For curves, the original control point data was duplicated into a
local listbase, deformed, used to create the "bevel list" data, and
then duplicated again for the object-level storage of deformed
control points. Text objects and surface objects had a similar
unnecessary duplication.
2021-06-28 22:22:06 -05:00
a3a7e19f07 Cleanup: Avoid freeing curve evaluation data twice
The curve bevel list was freed, and then freed again in a call to the
function that recalulates it. The curve "anim path" data was freed
only to be freed again in its calculation function as well. Also move
the anim_path calculation directly after the bevel list creation to
make its requirements more explicit.
2021-06-28 21:46:12 -05:00
3471ff1a5c Cleanup: Split curve and surface data evaluation functions, rename
Surface objects were already handled by an early return in the main
"curve types" function. This commit splits them, renames the funtions
to match (and be more consistent with other names), and sanitizes the
checking of object types.
2021-06-28 21:31:59 -05:00
d6480167ad Cleanup: Order return arguments last, use r_ prefix 2021-06-28 21:17:19 -05:00
60a2038fba Cleanup: clang-tidy 2021-06-29 10:37:00 +10:00
515d9f9a35 Cleanup: resolve discarded-qualifier warning 2021-06-29 10:23:22 +10:00
e1a719c043 Fix T89465: Loss of mouse movement when window left with pen.
When a window is left with a WinPointer pen, the inrange check
prevents resetting pen info.
2021-06-28 15:09:59 -07:00
2271b9b584 Cleanup: Avoid ASAN report when converting displist to mesh
Don't call `memcpy` with a null destination (and 0 size).
2021-06-28 16:56:30 -05:00
d0e6b59cd1 Cleanup: Replace paranoid check with assert
Every call to `BKE_displist_make_curveTypes` already checks the object
type beforehand, there is no need to check it again. Also removed an
outdated comment.
2021-06-28 15:21:14 -05:00
d2e473a2dd Cleanup: Remove unused "for_orco" argument to curve evaluation
`BKE_displist_make_curveTypes` had a `for_orco` argument that was
always false in calls to the function. Removing it allows the curve
displist and modifier evaluation code to become simpler. There are
some related cleanups in rBdf4299465279 and rB93aecd2b8107.
2021-06-28 15:14:43 -05:00
a0c45a2d54 Cleanup: Add function to create a CurveEval from a nurbs list
Sometimes the current spline list isn't part of the original curve, like
when using the deformed control points, etc. This will be helpful in
the curve modifier stack.
2021-06-28 14:28:52 -05:00
790cb28766 Curve: Add functions to retrieve const access to spline list
While the const correctness of `ListBase` is quite limited, it's helpful
to have a way to retrieve the `Nurb` list from curve object data without
casting away const from the curve.
2021-06-28 14:15:58 -05:00
dc0c81337d Cleanup: Use const arguments 2021-06-28 13:47:48 -05:00
Jesse Y
643720f8ab UI: Do Not Resize Already-Open Temporary Windows
There is no longer a need to resize windows that are _already_ open,
since temporary windows can no longer take over the space used by other
already-open temporary windows. This primarily affects Preferences and
Render windows.

see D11721 for more details.

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

Reviewed by Julian Eisel
2021-06-28 11:43:45 -07:00
c0fb8375f6 Fix T89515: Clicking on Favorites in File Browser will rename them
Likely uncovered by 6c97c7f767, the actual mistake would be from
6942dd9f49.

The hacks to display text buttons for renaming in UI-Lists used the emboss of
the text button for handling logic. It relied on the emboss `NONE` but we also
introduced `NONE_OR_STATUS` with 6942dd9f49. Both values need to be treated
equally for the logic of this hack to work.

The change in `interface_layout.c` is actually not needed for this exact issue,
but it's the correct thing to do. There may actually be more cases where `NONE`
and `NONE_OR_STATUS` need to be treated equally. Something to be checked still.
2021-06-28 19:47:13 +02:00
578ccdf75b Fix T89516: Crash on append
Caused by 37458798fa, was doing a NULL-pointer dereference because it used
the wrong pointer to check if the data-block is linked.
2021-06-28 19:30:56 +02:00
a5ed075110 Fix T87194: custom attributes not accessible with Cycles Volume
Custom properties defined on objects are not accessible from the
attribute node when rendering a volume in Cycles. This is because
this case is not handled.

To handle it, added a primitive type for volumes in the kernel,
which is then used in the initialization of ShaderData and to
check whether an attribute lookup is for a volume.

`volume_attribute_float4` is also now checking the attribute
element type to dispatch to the right lookup function.

Reviewed By: #cycles, brecht

Maniphest Tasks: T87194

Differential Revision: https://developer.blender.org/D11728
2021-06-28 19:09:15 +02:00
afb17552e1 Fix T89449: File Browser preview image not responsive to click
Logic in the main `switch` for button handling was wrong and would execute for
other button types than the new data-set row button type.
2021-06-28 18:38:53 +02:00
37458798fa LibOverride: Fix crash in ShapeKeys when making a mesh override local.
Weird 'embedded for overrides' flag of embedded IDs (including ShapeKeys
in override context) was not properly cleaned up when making an override
fully local.

Reported by studio, thanks.

@jbakker should be backported to 2.93LTS if possible.
2021-06-28 17:03:10 +02:00
e8d75b957f Fix UI glitch in outliner when hiding excluded collections.
In ViewLayer view, overrides of excluded collections would then show one
level higher, due to bad handling of those excluded collection in draw
code.

Reported by studio, thanks.

@jbakker should be backported to 2.93LTS.
2021-06-28 17:02:50 +02:00
6c97c7f767 Fix T89350: Emboss color missing from icon buttons without emboss
Passing `emboss=False`set `UI_EMBOSS_NONE` in the layout, which
completely disables button background colors for things like animation
state. This commit changes that to `UI_EMBOSS_NONE_OR_STATUS`,
which effectively restores the behavior to what it was prior to the
addition of that flag, with the added option to completely disable
the status emboss with `UI_EMBOSS_NONE`.
2021-06-28 10:00:15 -05:00
6ce4d39e6b Geometry Nodes: initial attribute list for meshes
This adds a new Attributes panel in the mesh properties editor.
It shows a list of all the generic attributes on the mesh.
In the future, we want to show built-in and other attributes in the
list as well. Related technical design tasks: T88460, T89054.

There is also a new simple name collision check that warns the user
when there are multiple attributes with the same name. This can be
problematic when the attribute is supposed to be used in geometry
nodes or during rendering.

Differential Revision: https://developer.blender.org/D11276
2021-06-28 16:53:25 +02:00
0afe4e81cb Fix name of UI emboss RNA enum item
This was a stupid mistake in my original commit that added this item.
While this is an API breakage, the name is simply wrong, and it is only
6 months old, and slightly niche.

Differential Revision: https://developer.blender.org/D11701
2021-06-28 09:51:39 -05:00
222c39fe70 Transform: Move "Proportional Size" and "AutoIK-Len" values to the beginning of the header
This prevents the text from shaking while transforming.
2021-06-28 11:48:32 -03:00
8de878e202 Draw: make 'ibo.lines_loose' extracting safer
No functional changes.
2021-06-28 11:48:32 -03:00
413bd71aaf Cleanup: remove unused macro parameters 2021-06-28 11:48:32 -03:00
cf21ba37ef LineArt: Occlusion effectiveness support
This patch adds a function where you can specify occlusion effectiveness from 0 to 255 layers per face for a given mesh material.

Reviewed By: Sebastian Parborg (zeddb)

Ref D11308
2021-06-28 22:26:23 +08:00
Mikhail Matrosov
9c6a382f95 Cycles: reduce shadow terminator artifacts
Offset rays from the flat surface to match where they would be for a smooth
surface as specified by the normals. In the shading panel there is now a
Shading Offset (existing option) and Geometry Offset (new).

The Geometry Offset works as follows:
* 0: disabled
* 0.001: only terminated triangles (normal points to the light, geometry
  doesn't) are affected
* 0.1 (default): triangles at grazing angles are affected, and the effect
  fades out
* 1: all triangles are affected

Limitations:
* The artifact is still visible in some cases, it could be that some quads
  require to be treated specifically as quads.
* Inconsistent normals cause artifacts.
* If small objects cast shadows to a big low poly surface, the shadows can
  appear to be in a wrong place - because the surface moved slightly above
  the geometry. This can be noticed only at grazing angles to light.
* Approximated surfaces of two non-intersecting low-poly objects can overlap
  that causes off-the-wall shadows.

Generally, using one or a few levels of subdivision can get rid of artifacts
faster than before.

Differential Revision: https://developer.blender.org/D11065
2021-06-28 14:05:22 +02:00
ce25b5812b Fix Cycles not rendering motion vector passes after recent changes
Causing regression tests to fail.
2021-06-28 13:57:12 +02:00
7d281a4f7d Functions: improve CPPType
* Reduce code duplication.
* Give methods more standardized names (e.g. `move_to_initialized` -> `move_assign`).
* Support wrapping arbitrary C++ types, even those that e.g. are not copyable.
2021-06-28 13:16:32 +02:00
f7e2559fd6 BLI: improve enum operators
* Use unsigned integer types for bit operations.
* Use 64 bit integer instead of 32 bit.
* Support scoped enumes (aka `enum class`) by adding some more casts.
2021-06-28 13:16:32 +02:00
2dbb492268 Fix T89455: Cycles crash when rendering a Mesh with autosmooth
The crash was caused by a mistake in 5f9677fe0c
where the pointers to the custom data layers would be overwritten with the one
for the first layer, as CustomData_duplicate_referenced_layer is only about the
first layer. customData_duplicate_referenced_layer_index should be used instead
to duplicate the right layer.
2021-06-28 13:12:07 +02:00
1b942ef90c GPU: Refactored +cleanup compilation log parsing.
Old implementation has a single parser of many different
formats. With the introduction of Vulkan this would lead
to another parser in the same function. This patch
separates the log parsing using a visitor pattern so the
log parsing can be configured per GPU backend or even
per driver.

With Vulkan we manage the compiler our self so the parsing
will become more straight forward. The OpenGL part depends
on many factors (OS, Driver) and perhaps even GPU.
2021-06-28 12:23:10 +02:00
dbd4ff4163 GPU: Separate compiler log from shader.
Current compiler log parser is to complex to follow. Moving it to its
own compile unit before refactoring.
2021-06-28 12:23:10 +02:00
c4d56199cc Cleanup: use doxy sections for editcurve_select.c
Signed-off-by: Campbell Barton <ideasman42@gmail.com>
2021-06-28 20:19:47 +10:00
Piotr Makal
98cd0fed36 Fix edit-mesh random select regression in random seed use
Fix regression in 9c20228128
that wasn't using the random seed correctly.
2021-06-28 19:57:46 +10:00
Piotr Makal
1c8c91384c Apply random selection precisely for curves, lattices & objects
This patch is part of: T87228.
Support accurate random selection for:

- CURVE_OT_select_random
- LATTICE_OT_select_random
- OBJECT_OT_select_random

Ref D11685
2021-06-28 19:51:49 +10:00
Piotr Makal
ab31c24322 BLI_rand: support for randomizing bitmaps
Add utility functions:

- BLI_bitmap_randomize
- BLI_rng_shuffle_bitmap

Part of D11685
2021-06-28 19:35:43 +10:00
addb2034a7 Cleanup: Fix const warnings in buttons_context.c 2021-06-28 17:34:15 +08:00
c297769d22 UI: Hide collection tab when scene master collection is active
CollectionLineart does not care about the configurations
in master collection.
Other options are not applicaple for master collection as well.
Hence hiding it.

Reviewed by Dalai Felinto (dfelinto)

Differential Revision: https://developer.blender.org/D11702
2021-06-28 15:51:34 +08:00
bb2648ebf0 Outliner: View Layers filter for View Layer Mode
This option allow users to see the view layer in context to the
others. It is particularly useful to see which view layers have which
collections enabled, and their render settings (holdout, ...).

This option is off by default.

Differential Revision: https://developer.blender.org/D11708
2021-06-28 09:34:44 +02:00
2ff490f9e3 Fix: Crash Requesting GPU_SHADER_GPENCIL_FILL builtin shader.
Shader doesn't have any shader code. Requesting the shader
would crash blender. Solved by removing the enum_value.
2021-06-28 08:55:13 +02:00
b2cd225623 GPU: Testcases for builtin shaders.
Adding compiler test (does it compile?) test for all builtin shaders.
2021-06-28 08:55:13 +02:00
f53bd31690 Cleanup GPU/Draw test cases.
In preparation of supporting vulkan. Draw/GPU tests should use
GPU_TEST or DRAW_TEST macros. These macros will run the test
on available drawing context backends like OpenGL or Vulkan.

As in master there is only an OpenGL backend nothing changed.
2021-06-28 08:55:13 +02:00
e94ec79341 Cleanup: use view3d_navigate prefix for walk/fly operators
Use matching file-name prefix as these operators are closely related.
2021-06-28 16:13:01 +10:00
7beb57f3bd Cleanup: update comments 2021-06-28 16:11:18 +10:00
6f42e69b58 Cleanup: de-duplicate 3D-view depth calculation function 2021-06-28 15:46:16 +10:00
7efc87dcd2 Cleanup: typos in RNA enums 2021-06-28 15:46:16 +10:00
1d8648b13a Cleanup: repeated terms in code comments & error messages 2021-06-28 15:46:08 +10:00
23c4854f45 UI: Cleanup: Phrasing of tooltips in line art modifier
Start the tooltip with a verb instead of a gerund, other small changes
for consistency and readability.
2021-06-27 23:48:46 -05:00
7223a0348f Fix T89330 Exact Boolean fails on a simple model.
The problem was an optimization I put in to triangulate quads.
It was wrong if the quad, after projecting onto a 2d plane, was
not convex. Handling quads the same as other faces fixes the bug.
Unfortunately, this will slow down Exact Boolean when the input has
many quads (the usual case, of course).
Will attempt to fix that with a later change, but for now, this
at least restores correctness.
2021-06-26 17:49:52 -04:00
abc6200331 Cleanup: spelling 2021-06-26 21:50:48 +10:00
46a222afd7 Cleanup: remove redundant/outdated comments 2021-06-26 21:50:48 +10:00
624bce6b4d Cleanup: redundant use of static constant 2021-06-26 21:50:48 +10:00
f1e4903854 Cleanup: full sentences in comments, improve comment formatting 2021-06-26 21:50:48 +10:00
fae5a907d4 GPencil: Duplicate Masks when separate Layer/Strokes
Now, the mask layers are copied and later a cleanup is done in order to verify all mask layer exist in destination object. If the layer mask does not exist, it's removed from the list.

This is related to T89234.
2021-06-26 11:38:37 +02:00
b5542c1ea4 Edit Mesh: optimize common use-cases for partial updates
Skip updating normals & tessellation for contiguous geometry regions
for operations such as translate & uniform scale.

This means when all geometry is selected, no updates are needed
as the relative locations of vertices aren't being modified.

Performance:

As this is skipping a multi-threaded operation,
larger improvements are noticeable on systems with fewer cores.

- ~1.15x to ~1.3x overall gain for 32 cores.
- ~1.7x to ~2.2x overall gain for 1 core (limited using `-t 1` argument).

Details:

- Rotate & non-uniform scale only skip tessellation.

- Proportional editing and axis-mirror have special handling
  ensure geometry is properly grouped before considering
  a face part of a single group that can be skipped.

- Loose vertices always need their normals to be recalculated
  since they're calculated based on the location.

- Non-affine transform operations such as shrink-fatten & bend,
  don't take advantage of this optimization.

- Snap projection also disables the optimization.
2021-06-26 17:07:05 +10:00
c1fe582446 Cleanup: move snap with projection check into a function 2021-06-26 16:57:03 +10:00
a287c8d3c1 BMesh: skip partial updates when there is nothing to do 2021-06-26 16:55:14 +10:00
3826fcf035 Cleanup: RNA warning 2021-06-26 16:53:48 +10:00
5759bbe9f9 Fixes a bug where the instances count in the spreadsheet
editor dataset region always showed 0. This was caused by a conditional
statement that needed a domain to be set, which is not the case for
Instances component type.

Reviewer: Hans Goudey (Hoogly Boogly)

Differential Revision: https://developer.blender.org/D11710
2021-06-25 22:57:47 +02:00
eae7090464 Fixes a warning where dst array size was wrong in the
signiture of BLI_str_format_attribute_domain_size.

Reviewer: Hans Goudey (Hoogly Boogly)

Differential Revision: https://developer.blender.org/D11710
2021-06-25 22:56:50 +02:00
cb548329ea UI: Improved File Browser Preview Image Scaling
This patch enables sample filtering when scaling preview images in File
Browser, improving the result a bit. Reduces blockiness and other
artifacts when enlarging the images.

see D11706 for details and examples.

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

Reviewed by Julian Eisel
2021-06-25 10:37:43 -07:00
9586472b9a Cleanup: Clang format 2021-06-25 12:11:13 -05:00
23042a3fb1 Cycles: add view layer option to disable motion blur, in the Filter panel 2021-06-25 18:47:54 +02:00
f863ef8a34 Cleanup: make format
string.c still needs cleanup, but I will leave to the original
author of the latest chagnes to do it since it needs
some tags to skip formatting.
2021-06-25 18:42:30 +02:00
74450265d0 Fix T87185: value assigned to modal Scale does not work properly
`t->values` does not necessarily represent a final value of the
transformation, as each mode treats this value differently.

So, unfortunately, we cannot have a generic offset solution for modal
transform operations. Offset needs to be handled by each mode.

Note: Currently only, `Move`, `Rotate` and `Resize` support this.
2021-06-25 12:52:27 -03:00
20e68d848e Fix T89430: Realizing NURBS curve instances is broken
The "copy_data" function for nurbs splines was incorrect,
it always set the destination's knots vector as "not dirty,"
even if the source's was.
2021-06-25 08:56:40 -05:00
Mihnea Stoian
5ec6c8d267 Linux: prefer using dedicated GPU when launching Blender
Adds "PrefersNonDefaultGPU" and "X-KDE-RunOnDiscreteGpu" to the .desktop file.
Similar hints for macOS and Windows exist already, to prefer using a dedicated
GPU over a slower integrated GPU.

See: https://gitlab.freedesktop.org/xdg/xdg-specs/-/merge_requests/13

Differential Revision: https://developer.blender.org/D11643
2021-06-25 15:28:19 +02:00
5f9677fe0c Fix T88756: crash when baking with autosmooth
When baking some data, we create a new Mesh with edits and modifiers applied.
However, in some cases (e.g. when there is no modifier), the returned Mesh is
actually referencing the original one and its data layers. When autosmooth is
enabled we also split the Mesh. However, since the new Mesh is referencing the
original one, although `BKE_mesh_split_faces` is creating new vertices and edges,
the reallocation of the custom data layers is preempted because of the
reference, so adding the new vertices and edges overwrites valid data

To fix this we duplicate referenced layers before splitting the faces.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D11703
2021-06-25 14:16:07 +02:00
3558bb8eae LineArt: Filtering feature lines with face mask
User can specify filtering options inside line art modifier,
like inverting selection and including face mark region border.

Reviewed By: Sebastian Parborg (zeddb)

Differential Revision: https://developer.blender.org/D11307
2021-06-25 18:48:20 +08:00
ae085e301c Spreadsheet: Dataset region for spreadsheet editor
This patch adds a left aligned sidebar to the spreadsheet editor. This
Sidebar can be used to navigate the geometry component types and
attribute domains. It also provides a quick overview of domain sizes.
It replaces the two dropdowns in the regions header.
Next step will be to add the domain cycling shortcut
using the CTRL + mouse wheel.

Reviewer: Dalai Felinto (dfelinto), Julian Eisel (Severin),
Hans Goudey (HooglyBoogly).

Differential Revision: https://developer.blender.org/D11046
2021-06-25 07:57:24 +02:00
841df831e8 LineArt: More type & related chaining improvements
This patch includes: Floating edge type support,
Special chaining option for floating edge,
Chaining option for reducing jagged edges when floating
edges are involved.

Reviewed By: Sebastian Parborg (zeddb)

Differential Revision: https://developer.blender.org/D11306
2021-06-25 13:15:25 +08:00
3d7021b4ec GHOST/XR: support Wayland via XrGraphicsBindingOpenGLWaylandKHR 2021-06-24 18:40:05 +01:00
b129a0b397 GHOST: remove unused EGL context includes in Win32 and Cocoa 2021-06-24 18:40:05 +01:00
5f27a5fff7 GHOST/EGL: store pointer to GHOST_System for downcast tests 2021-06-24 18:40:05 +01:00
b801db1181 GHOST/Wayland: auto-select highest supported OpenGL version 2021-06-24 18:40:05 +01:00
b5840f9b5b Cleanup: compiler warnings with clang
* Mark either all or no class methods with override
* Don't use zero sized array since it has a different size in C and C++.
  Using a little more memory here is not significant.
* Don't use deprecated mechanism to mark private GSet members in clang
  just like we don't for MSVC, it warns even for simple zero initialization.
2021-06-24 19:35:23 +02:00
Leon Zandman
beb6399ae5 Fix T89129: file dialog displays in-progress Safari downloads as a folder
In-progress Safari download files/packages are now recognized as bundles
and therefore not treated as directories.

Differential Revision: https://developer.blender.org/D11613
2021-06-24 19:05:49 +02:00
Thomas Lachmann
15868b1ff4 Fix wrong default value for RenderEngine.bl_use_image_save
Differential Revision: https://developer.blender.org/D11680
2021-06-24 19:03:07 +02:00
7b524d9b71 Cleanup: move and simplify some draw_cache macros 2021-06-24 10:54:08 -03:00
a13314a03f Fix T89390: crash when join geometry node has only muted inputs 2021-06-24 15:45:43 +02:00
cbdddc5648 Workaround for assert from 27da305a40
This worked for existing scenes but adding new objects was asserting
needs further investigation.
2021-06-24 21:01:48 +10:00
51568030e9 Depsgraph: remove redundant mesh data duplication in edit-mode
This resolves a bottleneck where every update while transforming
copied the entire mesh data-block, which isn't needed as the edit-mesh
is the source of the data being edited.

Testing shows a significant overall speedup when transforming:

- ~1.5x with a subdivided cube 1.5 million vertices.
- ~3.0x with the spring mesh (edit-mode with modifiers disabled,
  duplicated 10x to drop performance).

Reviewed By: sergey

Ref D11337
2021-06-24 20:23:00 +10:00
27da305a40 Depsgraph: support flushing parameters without a full COW update
Avoid computationally expensive copying operations
when only some settings have been modified.

This is done by adding support for updating parameters
without tagging for copy-on-write.

Currently only mesh data blocks are supported,
other data-blocks can be added individually.

This prepares for changing values such as edit-mesh auto-smooth angle
in edit-mode without duplicating all mesh-data.
The benefit will only be seen when the user interface no longer tags
all ID's for copy on write updates.

ID_RECALC_GEOMETRY_ALL_MODES has been added to support situations
where non edit-mode geometry is modified in edit-mode.
While this isn't something user are likely to do,
Python scripts may change the underlying mesh.

Reviewed By: sergey

Ref D11377
2021-06-24 20:23:00 +10:00
67b352f9c5 Fix T87486: Can't open file with modifiers to a grease pencil library override
Very stupid typo in override apply code on GP modifiers (typical
copy/paste mistake from original modifiers code).

@jbakker this should be back-ported to 2.93LTS.
2021-06-24 12:10:38 +02:00
8cdb99d51c Fix linking code after own recent commit.
More stupid mistake in recent enhanced reports for file load code,
rB82c17082ba0e left some read-after-free situations.
2021-06-24 12:10:06 +02:00
3a8347f823 CMake: link bf_blenkernel from bf_depsgraph
Without this tests fail to lknk in D11377. Commit separately as the
depsgraph is using BKE it should link to it.
2021-06-24 19:38:26 +10:00
6570159929 Cleanup: update clang-format so PyObject_HEAD indents properly 2021-06-24 17:12:04 +10:00
1f778dbefc Cleanup: use Blender's code style for doxygen commetns in freestyle 2021-06-24 15:59:34 +10:00
4b9ff3cd42 Cleanup: comment blocks, trailing space in comments 2021-06-24 15:59:34 +10:00
2e99a74df9 Cleanup: use '#if 0' for commented code-block 2021-06-24 15:53:26 +10:00
879b89e967 Cleanup: correct variable name in comments 2021-06-24 15:53:26 +10:00
0469f2392f Cleanup: remove outdated/redundant comments 2021-06-24 15:53:26 +10:00
55bffa82da Cleanup: clang-format, spelling 2021-06-24 15:53:26 +10:00
de6c6501f0 LineArt: Bound box visibility check when loading
This patch enables bound box check when loading geometry
into line art. Works with overscan as well. Will discard
object if its bbox completely lies in one side of the
clipping space frustum.

Reviewed by: Sebastian Parborg (zeddb)

Differential Revision: https://developer.blender.org/D11545
2021-06-24 13:17:29 +08:00
de05e261ec Line Art: Discard out of frame edges.
For scenes that have a lot of edges, this could potentially
save some time generating individual strokes that are outside
camera frustum.

Reviewed By: Sebastian Parborg (zeddb)

Differential Revision: https://developer.blender.org/D11525
2021-06-24 13:09:25 +08:00
f7fbb518c8 Fix failure when baking actions with Bendy Bones
682a74e090 renamed Bendy Bones properties and replaced existing float
properties with float-vector properties. This updates the property names used
by the action baking operator (`NLA_OT_bake`).
2021-06-24 00:10:11 +02:00
d6212f67a9 Remove window iteration in WM_DISPLAYCHANGE.
Iteration was incorrectly calling the same object. Had it called every
window it would still be unnecessary as WM_DISPLAYCHANGE is sent to all
broadcast receiving windows.
2021-06-23 10:12:21 -07:00
ef7fcaf8e6 Voxel Remesher: Make smooth shading output automatic
Previously the smooth shading of the voxel remesher was controlled by a
mesh property. With this change, the output will try to match the
current shading of the object. This only takes into consideration the
shading mode of the first polygon of the model, but it is probably what
most users expect as it works as intended with the shade smooth/flat
object mode options.

Reviewed By: JulienKaspar, JacquesLucke

Differential Revision: https://developer.blender.org/D11626
2021-06-23 18:42:40 +02:00
6e4b9f5836 Fix T89221: Sculpt tools symmetry failing with non symmetrical meshes
SCULPT_nearest_vertex_get expects a distance, not a distance squared.
This should make symmetry work as expected, but it still can fail if the
mesh topology is not completely symmetrical.

Reviewed By: JacquesLucke

Maniphest Tasks: T89221

Differential Revision: https://developer.blender.org/D11642
2021-06-23 18:17:46 +02:00
c9f12b21e2 Compositor: Full frame ID Mask node
Adds full frame implementation to this node operations.
No functional changes.
1.2x faster than tiled fallback.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D11638
2021-06-23 17:46:54 +02:00
35db01325f Compositor: Full frame Image node
Adds full frame implementation to Image node operations.
Mostly refactored into buffer utility methods for reuse in other
operations.
No functional changes.
1.8x faster than tiled fallback.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D11559
2021-06-23 17:46:53 +02:00
8f4d991594 Cleanup: remove unused parameter 2021-06-23 17:46:53 +02:00
a50a51eef0 Fix T88769: GPencil smooth incorrect behavior in cyclic strokes
When use smooth tool in a cyclic stroke, the smoothing algorithm was not using the adjacent points if these are the end or start of stroke.

Now, the smooth uses the other extreme of the stroke to compute smoothness.
2021-06-23 17:28:01 +02:00
276790cbfa LibOverride: Also override owner collection in Outliner hierarchy override.
This change will ensure at least one 'local' collection can host the new
'local' override of all objects (indirectly) overridden by this
operation, such that no new override of object ends up in master
collection (which can become extremely messy in production files).

In practice, it means often at least one of the linked collection owning
those objects also has to be overridden.

NOTE: This only affect cases where root overridden linked object has
some dependencies outside of its own root linked collection. While this
situation should be avoided, it cannot always be, so we try to support
it as best as we can.
2021-06-23 17:07:35 +02:00
7dd7849ddd Memfile Undo: aslo tag embedded IDs for update.
This is again in the fuzzy area of how embedded IDs are handled
respectively by partial undo code and depsgraph... Should not be
necessary currently, but better be safe and explicit, and also tag
those embeded IDs from re-used owner ID.
2021-06-23 17:00:17 +02:00
7561e3dad0 CMake/win: Fix linker issue with OCIO
In certain CMake configurations it was possible
that OCIO gave linker errors due to it thinking
it was using the shared library rather than the
static library we ship.
2021-06-23 08:45:37 -06:00
354ecc2f1e Fix T89269: Memory corruption during extrusions of overlapping edges
The "extrude" operator with the "use_dissolve_ortho_edges" option assumed
the edges were connected.
2021-06-23 11:37:35 -03:00
157081069d Fix (studio reported) crash on Undo in some cases.
Would crash when adding or removing a collection directly to the master
collection of a scene.

Consequence of change to handle depsgraph-controlled evaluation of some
IDs (like excluded collections which do not get evaluated and do not get
a COW anymore). See rBcf4258673755 and D10907.

Note that this mostly demonstrates once again how weak and flacky our
handling of embedded IDs still remains, with some part of the code
handling them as independent IDs, some as fully local/private data, some
as a mix of both... and lots and lots of custom handling code and corner
cases that are a bottomless pit of issues.

Also quiet incredible that this was not reported already, luckily this
original change did not make it to 2.93 release.
2021-06-23 16:16:29 +02:00
befb9d99f8 Fix T89331: Cycles lights flicker when transformed
The check on the transformation introduced in rBb313525c1bd0 to fix
T88515 would sometimes prevent to update the light if the Blender object
changed. To fix this, reverse the order in which the checks happen so
that we do not shortcuit the object change check.
2021-06-23 16:07:06 +02:00
b964f73e7d Readfile: use CLOG instead of printf's.
Note that this commit uses a second LogRef (`blo.readfile.undo`) for undo
specific meassages. Allows to use `--log "*undo*"` cli option to match
all undo reporting.

Also did some minor tweaks to some reports on the way.
2021-06-23 14:23:54 +02:00
eed9ac5b6e Fix Scene/MasterCollection handling in BKE_main_collection_sync_remap().
Those were missing proper (explicit) object cache clear, and DEG
tagging.

Note that this was most likely not an common issue in practice (Collection
object cache clearing recursively goes into all parents, so master
collection would only miss it in case they had no child collections at
all, and tagging of those happens almost always at other steps on
remapping). But better to be explicit and consistent here in any case.
2021-06-23 12:15:09 +02:00
e291432f5f Fix T89342: Select mirror with a zero length central edge asserts 2021-06-23 20:07:19 +10:00
635b4db162 Fix T89367: Crash running edit-mesh select_linked_pick from Python 2021-06-23 19:45:48 +10:00
Pratik Borhade
a6f275cad3 Fix T88808: Set Origin missing from Text object in 2.93
Fix T88808.
Caused by {rB5f2c5e5bb8c15bf0d6679351e3482f9c38c00935}

object type for `TEXT object` was missing in following check
that's why `Set Origin` option was lost from object context menu.

Reviewed By: lichtwerk

Maniphest Tasks: T88808

Differential Revision: https://developer.blender.org/D11495
2021-06-23 11:12:13 +02:00
82c17082ba Revert "Revert "Enhanced stats/reports for blendfile reading.""
This reverts commit rB3a48147b8ab92, and fixes the issues with linking
etc.

Change compared to previous buggy commit (rBf8d219dfd4c31) is that
new `BlendFileReadReports` reports are now passed to the lowest level
function generating the `FileData` (`filedata_new()`), which ensures
(and asserts) that all code using it does have a valid non-NULL pointer
to a `BlendFileReadReport` data.

Sorry for the noise, it's always when you think a change is trivial and
do not test it well enough that you end up doing those kind of
mistakes...
2021-06-23 10:37:00 +02:00
071799d4fc Fix T89265: Crash when tabbing through num inputs
Fix by reverting the part of ec30cf0b74
that assigned `but->editval` in `ui_numedit_begin_set_values`.

Causing access freed memory when using tab to switch
to a numeric input and then leaving the textbox by clicking outside.
This was because `ui_numedit_begin_set_values` shouldn't need to set
`but->editval` and overwrite the pointer.
This would set a pointer that had previously been freed,
causing a `NULL` check to fail later on.

Ref D11679
2021-06-23 14:56:36 +10:00
61b22d27c8 Fix T89249: incorrect mesh validate error with zeroed vertex normals
It's not an error for centered vertices to have a zero normal.
2021-06-23 13:57:23 +10:00
5cc8e7ab53 Cleanup: reformat trailing comments that caused line wrapping 2021-06-23 13:54:12 +10:00
2c916c97ac Cleanup: clang-tidy quiet equals-default, nullptr warnings 2021-06-23 12:04:19 +10:00
0f427f4eb1 Cleanup: suppress clang-tidy warnings 2021-06-23 11:48:08 +10:00
58e58310b7 Cleanup: compiler warning for invalid argument type 2021-06-23 11:44:02 +10:00
a8f37763ca RNA Manual Reference: Update Mapping File 2021-06-22 19:37:45 -04:00
dbc054bb88 Fix T89374: Erasing/cutting in Grease Pencil makes Blender shut down
When cut a stroke of 1 point, the clean up done to avoid keep 1 point strokes removes the memory, but the pointer to the first stroke was not set to NULL. As this pointer is invalid now, any use of this produces a segment fault because the pointer is corrupted..
2021-06-22 23:12:04 +02:00
abb07a38b8 GHOST/XR: fix code format 2021-06-22 22:05:47 +01:00
c88c331384 PyDoc: Update Sphinx and pin dependencies
Sphinx has rather loose dependency requirements which can cause issues if we aren't careful.
As a solution they recommend that you pin sphinx dependency versions
2021-06-22 16:30:07 -04:00
Leon Leno
187e217b5a UI: Fix widget emboss: Also fade on the right side
Currently the emboss is only fading on left side of the widget,
resulting in the emboss extending vertically on the right side
and ending abruptly. This patch fixes this by also fading the
emboss on the right side and making it symmetric.

Differential Revision: https://developer.blender.org/D10810
2021-06-22 15:21:53 -05:00
fa1868ae97 Transform: display units for proportional edit value
This fixes T88346.

The code is also more readable by making a better distinction between
the texts used for Distances, "Proportional Size" and "AutoIK-Len".

And the text used to translate the "Proportional Size" is reused.
2021-06-22 17:17:44 -03:00
c3b641613c Cleanup: deduplicate code and rename variables
This makes it clearer that variables are strings and how they are used
in the Move header code.
2021-06-22 16:51:34 -03:00
0732a9f1b2 GHOST/XR: enable X11-EGL context for OpenXR 2021-06-22 20:00:40 +01:00
87833f8f95 GHOST/EGL: add GHOST_XrGraphicsBindingOpenGL as friend 2021-06-22 20:00:40 +01:00
b35ba22d84 GHOST/EGL: getters for display, config and context 2021-06-22 20:00:40 +01:00
c6e6a9046e GHOST/EGL: ignore unused variables 2021-06-22 20:00:40 +01:00
ee8b284d11 Fix T89327: Cube and ico sphere nodes do not create UVs
It turns out you have to add the UV custom data layer manually before
calling the BMesh primitive operators, even if you pass `calc_uvs=true`.
2021-06-22 13:22:40 -05:00
Leon Zandman
c317f111c1 Cleanup: Spelling Mistakes
This patch fixes many minor spelling mistakes, all in comments or
console output. Mostly contractions like can't, won't, don't, its/it's,
etc.

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

Reviewed by Harley Acheson
2021-06-22 10:54:50 -07:00
2fcd3f0296 Cleanup: Remove extra blank line 2021-06-22 19:52:16 +02:00
1917d0345e Fix T89366: GPencil hide layers above parented layer
The problem was the flag was not reset by layer in the loop.
2021-06-22 19:49:03 +02:00
ebfad93039 Fix T89343: Point cloud instances not transformed when realized
This problem has surprisingly been there for quite a few months.
For point clouds all attributes were handled the same, even "position",
which should be transformed when combining source points into the
destination.
2021-06-22 12:19:34 -05:00
3a48147b8a Revert "Enhanced stats/reports for blendfile reading."
This change crashes library linking operators, related tests and probably more.

This reverts commit f8d219dfd4.

Ref D11583
2021-06-22 19:13:50 +02:00
0b15353baa Geometry Nodes: Join curve attributes when realizing instances
Previously the code assumed that curve instances had no attributes.
This is true when the data came from curve objects, which don't support
attributes currently, but it isn't necessarily true when retrieving curves
from evaluated geometry sets.
2021-06-22 11:35:00 -05:00
f3eecfe386 Cleanup: Refactor spline copying functions
Make the virtual functions protected and simpler, so that the logic is
better contained in the base class's implementation. Also introduce a
`copy_without_attributes` method to be used for realizing instances.
2021-06-22 11:32:50 -05:00
026de343e3 Fix deadlock with shrinkwrap and other modifiers
More code that needs task isolation. Encountered in sprite fright production
file.

Ref D11603
2021-06-22 18:26:58 +02:00
f8d219dfd4 Enhanced stats/reports for blendfile reading.
Add direct user feedback (as a warning report) to user when recursive
resync of overrides was needed.

And some timing (as CLOG logs) about main readfile process steps.

This is essentially adding a new BlendFileReadReport structure that wraps
BKE_reports list, and adds some extra info (some timing, some info about
overrides and (recursive) resync, etc.).
2021-06-22 17:28:19 +02:00
6ff0d59967 Minor cleanup to previous commit introducing BLI_math_time.
Forgot to address latest review comments, sorry for the noise.`:wq
2021-06-22 17:02:45 +02:00
feaf309de7 Add initial BLI_math_time with a 'seconds decompose' function.
Allows to decompose a given amount of seconds into a random set of
days/hours/minutes/seconds/milliseconds values.

Also add matching test.

Differential Revision: https://developer.blender.org/D11581
2021-06-22 17:00:18 +02:00
f4e3b1e573 Fix T89360: Eevee transforms geometry when using "High Quality Normals"
Offset missed in rB44d2479dc36f
2021-06-22 10:14:13 -03:00
e3bdb189a7 Cleanup: split BKE_object_batch_cache_dirty_tag
Create a more specialized function `BKE_object_data_batch_cache_dirty_tag`
2021-06-22 09:06:33 -03:00
ab063db34d Cleanup: deduplicate free code
It is more appropriate that `depths` is freed in `ED_view3d_depths_free`.
2021-06-22 08:25:32 -03:00
3f1111b2a8 Draw: Added testcases for hair refine shaders. 2021-06-22 11:11:31 +02:00
ad9fd47d7b Fix T89347: Edit-mesh make planar faces doesn't update face normals
Invalid face normals were used for tessellation.
2021-06-22 18:32:51 +10:00
01234b430b Fix T89345: Edit-mesh decimate doesn't update face normals
Invalid face normals were used for tessellation.
2021-06-22 18:27:52 +10:00
956c539e59 Fix T89196: Depsgraph use-after-free after scene switching undo
Delay depsgraph visibility update tagging until it is known that
graph relations are up to date, and until it is known that the graph
is actually needed to be evaluated.

Differential Revision: https://developer.blender.org/D11660
2021-06-22 09:52:45 +02:00
d3a792431e Cleanup: Use more clear visibility tag function name
No functional changes. Just makes it clear this is not an immediate
update, and will make an upcoming change more localized.
2021-06-22 09:52:45 +02:00
53ba9f01e2 Fix error in context menu when built without freestyle 2021-06-22 17:19:02 +10:00
1725bfc3cb Cleanup: remove unused menu VIEW3D_MT_edit_mesh_edges_data
8aa17c5b12 missed removing the
menu definition when removing from the UI.
2021-06-22 17:18:28 +10:00
6a3bd04e42 Cleanup: rename playhead in the UI and code
Current convention is not to use this term, use "current frame",
and "timeline frame" in render.c as this is the argument passed in.
2021-06-22 17:03:22 +10:00
8af2c87f7e 3D View: adjust order of planes for occlusion check
Move far plane last since it's the least likely to intersect edges.
2021-06-22 15:59:15 +10:00
cd39e3dec1 OptiX: select BVH build options from Scene params
Currently, the OptiX BVH build options are selected based on whether
we are in background mode (final renders) or not (viewport renders).
In background mode, the BVH is built for fast path tracing and low
memory footprint, while in viewport, it is built for fast updates.

However, on platforms without OpenGL support, the background flag is
always set to true and prevents using fast BVH builds in the viewport.

Now, the BVH options derive from the Scene BVH settings:
* if BVH is static, a fast to trace BVH is built
* if BVH is dynamic, a fast to update BVH is built

Reviewed By: #cycles, brecht

Differential Revision: https://developer.blender.org/D11154
2021-06-22 07:38:28 +02:00
338be95874 Fix bone select failing with end-points outside the view
Apply the same fix for T32214 (edge-select failing) to bones
which also failed when their end-points were outside of the view.

- Add V3D_PROJ_TEST_CLIP_CONTENT support for edit & pose bone iterator
  and use for selection operators.
- Remove unnecessarily complicated checks with pose-mode lasso tagging.
- Correct error in pose-mode LassoSelectUserData.is_changed
  (currently harmless as it's not read back).
2021-06-22 14:23:37 +10:00
9ac56bad4c Cleanup: use early return for selection callbacks 2021-06-22 14:23:37 +10:00
67ee87a6e9 Cleanup: spelling 2021-06-22 14:23:37 +10:00
53e1442ac2 Cleanup: comment use C comment-blocks for GHOST_Types.h
Also use full sentences, and correct typos.
2021-06-22 14:23:37 +10:00
e1d6219731 Cleanup: Use "size" instead of "points_len" in spline code
Previously this was mostly consistent, but not completely. It's helpful
to use the same name for the same meaning everywhere in this area.
2021-06-21 23:07:26 -05:00
dc3b7602ee Cleanup: Rename variables, use shorter names
`src` and `dst` are perfectly clear, and avoid repeating unecessary
characters when writing the variables many times, allowing more space
for everything else.
2021-06-21 23:02:00 -05:00
d086570c7a UI: Sequencer: add refresh_all operator to all sequencer view menus
This commit piggybacks on rB3e695a27cdfad560d0b28e742cfa069d098200d6
2021-06-21 22:29:58 -04:00
4947aa29db CMake: Improve python version mismatch error
When CMake detects and incompatible Python version
it errors out with an error saying at-least python 3.9
is required, but doesn't mention the version it detected.

This makes troubleshooting the problem harder than it
needs to be.

This diff changes the error message to include the python
version CMake detected.

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

Reviewed By: Ray Molenkamp
2021-06-21 18:19:07 -06:00
d443dcc733 Build/Windows: Preliminary VS 2022 support.
This adds preliminary VS 2022 support, since
there currently is no CMake version that
supports the VS2022 IDE only ninja support
was tested.

IDE support should work without any additional
changes as soon as an updated CMake becomes
available.

As VS2022 appears to keep binary compatibility
with earlier MSVC versions, the current SVN
libraries will work for this version.
2021-06-21 18:11:30 -06:00
6f158f834d Refactor of Wintab to use Wintab supplied mouse movement once verified against system input.
Reviewed By: brecht, LazyDodo

Maniphest Tasks: T88852

Differential Revision: https://developer.blender.org/D11508
2021-06-21 14:38:51 -07:00
445d506ac9 Geometry Nodes: Use multithreading for the curve to mesh node
This commit optimizes the node for the case where it works on many
splines by allowing it to generate mesh data from their combinations
in parallel. By itself, this made the node around twice as fast in my
test file with a result of 20 million vertices, around 600ms instead of
1.2s before.

That isn't actually a very good result; it reveals another bottleneck,
a single threaded loop over all face corners in the mesh normal
calculation code. As a simple change that might improve performance
in some situations, this commit moves normal calculation out of this
node, so at least the work isn't wasted if the mesh is changed later
on in the node tree anyway.
2021-06-21 16:17:02 -05:00
Germano Cavalcante
b11a463e4f Refactor: Do not keep a copy of depth buffer in RegionView3D
The depth cache (located in `RegionView3D::depths`) is used for quick
and simple occlusion testing in:
- particle selection,
- "Draw Curve" operator and
- "Interactive Light Track to Cursor" operator,

However, keeping a texture buffer in cache is not a recommended practice.

For displays with high resolution like 8k this represents something
around 132MB.

Also, currently, each call to `ED_view3d_depth_override` invalidates
the depth cache. So that depth is never reused in multiple calls from
an operator (this was not the case in blender 2.79).

This commit allows to create a depth cache and release it in the same
operator. Thus, the buffer is kept in cache for a short time, freeing
up space.

No functional changes.
2021-06-21 16:41:50 -03:00
b665ad8621 Fix T89291: Objects with rotation deltas don't rotate in correct axes
Quaternion correction was not implemented and Euler values were being
incorrectly combined.
2021-06-21 14:31:45 -03:00
41af27c582 Fix deadlocks in mesh modifier evaluation and particles
The recent task isolation changes missed two mutex locks that also need task
isolation.

Ref D11603, T89194
2021-06-21 19:25:12 +02:00
47473bee34 GPencil: Disable Lights when duplicate layer
Missing to disable default light ON when use separate operator.
2021-06-21 16:59:20 +02:00
b9ccfb89ce Performance: Flush selection to edges/faces.
This patch uses threading to flush selection from verts to edges and
from edges to faces. The solution is lockless and should scale well on
modern CPU architectures.

Master:{F10185359}
Patch:{F10185361}

End user performance went from 3.9 to 4.6 FPS (Stanford Dragon) but that
was measured on a Intel Core i7-6700 CPU and AMD RX480 Gpu. The more
cores the better improvements you get.

Reviewed By: mano-wii

Differential Revision: https://developer.blender.org/D11644
2021-06-21 16:35:28 +02:00
ce64cfd6ed Fix T89306: GPencil selection doesn't work correctly with modifiers
The problem was introduced with Bezier modification because the selection code was using the original stroke and not the evaluated version.
2021-06-21 16:08:26 +02:00
3cf39c09bf Cleanup: improve naming in Compositor 2021-06-21 13:51:51 +02:00
4246898ad3 Cleanup: move function parameter to member
Get current pass only when needed.
2021-06-21 13:51:51 +02:00
2851602052 Add a reason for why an Addon can not be loaded. This change gives a more detailed explanation of the issue and may help the Addon Developer to identify what exactly needs to be changed.
The current message 'addon not loaded' is a bit too sparse.

Differential Revision: https://developer.blender.org/D11655
2021-06-21 12:51:46 +02:00
4968a0bdf9 Fix T89122: crash when multi input is connected to multiple group inputs
The early `return` was wrong when there are multiple origin sockets
that need to be loaded.
2021-06-21 12:15:32 +02:00
Daniel Salazar
f383cad329 Fix T89329: icosphere subdivisions can be set to 0
Differential Revision: https://developer.blender.org/D11658
2021-06-21 11:11:11 +02:00
002d563bbb Cleanup: use doxy sections in view3d iterators 2021-06-21 18:17:02 +10:00
4d91808710 Cleanup: variable naming in view3d_iterators
Consistently use a/b instead of 0/1.
2021-06-21 18:01:12 +10:00
4044c29069 Fix T32214: Wireframe edge select fails with verts behind the view
This resolves a long standing bug in edge selection
(picking, circle, box & lasso).

Now when one of the edges vertices fails to project into screen space,
the edge is clipped by the viewport to calculate an on-screen location
that can be used instead.

This isn't default as it may be important for the on the screen location
not to be clipped by the viewport.
2021-06-21 17:27:56 +10:00
54d651c344 Cleanup: pass objects as const arguments 2021-06-21 17:25:10 +10:00
19df0e3cfd Cleanup: swap top/bottom args to planes_from_projmat
X & Z were ordered min/max, where as Y was max/min.
2021-06-21 17:25:09 +10:00
b2510b9e20 Fix T89271: Selecting all vertices doesn't select all edges.
Mistake in recent commit {rBea4309925f1d2d2a224bd1dce12269a58ade9b62}.
2021-06-21 07:55:49 +02:00
feb6fd632f Cleanup: Rename spline interpolation functions
The names were slightly longer than they needed to be clear,
and when they are shorter they tend to fit on one line better.
2021-06-20 22:05:57 -05:00
a1c3e45100 Geometry Nodes: Multithread curve resample node
Optimize the node for the case of many splines. In a test file with
14000 splines, the node is 3x faster (72ms to 24ms) on an 8 core CPU.
2021-06-20 21:57:47 -05:00
b45cee1aaf Cleanup: use early return in view3d iterator callbacks 2021-06-21 12:52:08 +10:00
5df6b4004c Docs: improve imbuf.write docstring
The file path wasn't documented as being optional.
2021-06-21 12:25:36 +10:00
5f71b1edd5 Delaunay add support for detecting and removing holes from output.
Adds two new output modes to the CDT api which detect and remove
holes. A hole is a face from which a ray shot to the outside
intersects an even number of constraint edges, except we don't
count constraint edges in the same connected region of faces,
where a region is connected via non-constraint edges.

These modes are useful for filling in outlines meant to represent
text characters and the like.

Original patch was from Erik Abrahamsson, modified by me to work
with the "valid Bmesh" output type too. I also added tests
for the new modes.
2021-06-20 20:57:22 -04:00
80083ac773 Fix T89310: Industry Compatible keymap not working
Caused by improper testing on my part, assuming a helper function
existed in the industry compatible keymap file, and also assuming it
also used the N and T keys for the left and right side-regions.
2021-06-20 18:52:01 -05:00
0cd34967c0 Curves: Multithread Curve to CurveEval conversion
A different data structure / implementation is used for curves in the
node tree currently. Converting from the DNA `Curve` structure to this
wasn't slow, but it's nice to decrease overhead. In a test of 14000
splines with 128000 points, this halves the runtime from about 5ms
to about 2.5ms.
2021-06-20 18:42:02 -05:00
6afafc46f6 Fix: Spreadsheet selection filter crash on non-mesh components
The spreadsheet filter tried to apply the mesh selection filter on non-
mesh geometry components. Add a check for the component type,
and also refactor the function to be more easily readable.
2021-06-20 17:39:18 -05:00
2d75b39b64 Fix T89302: Broken normals after mesh to curve node
The normals were broken because the normal calculation mode wasn't set.
This patch adds a default normal mode so all code creating a spline does
not necessarily have to set it manually. In the future there should be a
way to change this value in the node tree.
2021-06-20 13:07:49 -05:00
eee3529eaf Docs: improve poly_to_tri_count doc-string
It wasn't obvious this can be used for calculating the triangle index
from the polygon and loop index.
2021-06-21 00:05:26 +10:00
859b3ff346 Cleanup: remove contents of endif() in cmake
This convention is no longer used for Blender's CMake files.
2021-06-20 23:59:07 +10:00
bce482f476 Cleanup: use eSpace_Type enum type 2021-06-20 23:59:07 +10:00
d9b1592c88 Cleanup: make BKE_mesh_loops_to_tessdata a static function 2021-06-20 17:21:50 +10:00
3462b4c7ae Docs: add additional notes on tessellation, update comments 2021-06-20 17:18:53 +10:00
2d60c496a2 Mesh: minor optimization to concave quad check for tessellation
Use the face normal (when available) for a faster concave quad test.
2021-06-20 14:39:13 +10:00
513f566b40 Mesh: optimize object mode face tessellation
- Multi-thread BKE_mesh_recalc_looptri.

- Add BKE_mesh_recalc_looptri_with_normals,
  this skips having to calculate normals for ngons.

Exact performance depends on number of faces, size of ngons and
available CPU cores.

For high poly meshes the isolated improvement to BKE_mesh_recalc_looptri
in my tests was between 6.7x .. 25.0x, with the largest gains seen in
meshes containing ngons with many sides.

The overall speedup for high poly meshes containing quads and triangles
is only ~20% although ngon heavy meshes can be much faster.
2021-06-20 14:39:13 +10:00
b5e5fbcfc8 Cleanup: clang-format 2021-06-20 13:12:27 +10:00
3da25dc625 Cleanup: use doxy sections 2021-06-19 19:41:44 +10:00
f3c5a84bb9 Cleanup: clang-tidy 2021-06-19 18:42:57 +10:00
033641aa74 VSE: Remove seq->tmp usage
Remove `seq->tmp` usage from transform code. It was used to tag strips
that need to be "shuffled". Pass these strips in `SeqCollection`
instead.

Reviewed By: sergey, mano-wii

Differential Revision: https://developer.blender.org/D11631
2021-06-19 05:07:00 +02:00
f9aea19d98 Spreadsheet Editor: Row Filters
This patch adds support for filtering rows based on rules and values.
Filters will work for any attribute data source, they are a property
of the spreadsheet rather than of the attribute system. The properties
displayed in the row filter can depend on data type of the currently
visible column with that name. If the name is no longer visible, the
row filter filter is grayed out, but it will remember the value until
a column with its name is visible again.

Note: The comments in `screen.c` combined with tagging the sidebar
for redraw after the main region point to a lack of understanding
or technical debt, that is a point to improve in the future.

**Future Improvements**
* T89272: A search menu for visible columns when adding a new filter.
* T89273: Possibly a "Range" operation.

Differential Revision: https://developer.blender.org/D10959
2021-06-18 16:33:02 -05:00
d52b7dbe26 Fix T89261: Crash when calculating bmesh tessellation
Error passing `false` instead of a `BMeshCalcTessellation_Params` struct.
2021-06-18 15:20:36 -03:00
3e6f2c7a99 Cleanup: Remove dead code
This code was disabled in 2.8 and all other associated code/comments 
have been removed/cleared. These rna properties have been replaced with 
`seq_prev_type`
2021-06-18 13:54:00 -04:00
f7022fc73f Fix Build Warning
Removal of unused local variable. Calculation of underline thickness
no longer needed with change to text output of underscore character.

Introduced in aee04d4960

Differential Revision: https://developer.blender.org/D11641
2021-06-18 09:22:52 -07:00
8a048593ca Fix T89259: GPencil Duplicate point doesn't work for last point
The loop was checking the len of the island, but if the island started in the last point the copy was not executed.
2021-06-18 18:16:38 +02:00
b6030711a2 Armature: add automatic B-Bone Scale toggles.
Currently B-Bone scaling can only be controlled via their
properties, thus requiring up to 8 drivers per joint between
B-Bones to transfer scaling factors from the handle bone.

A Scale Easing option is added to multiply the easing value
by the Y scale channels to synchronize them - this produces a
natural scaling effect where both the shape of the curve and
the scale is affected.

In addition, four toggles are added for each handle, which
multiply each of the X, Y, Z and Ease values by the matching
Local Scale channel of the handle bone, thus replacing trivial
drivers. The Scale Easing option has no effect on this process
since it's easy to just enable both Length and Ease buttons.

Differential Revision: https://developer.blender.org/D9870
2021-06-18 18:56:04 +03:00
638c16f410 Armature: implement lengthwise scaling of B-Bone segments.
Implement actual behavior for the B-Bone Y Scale channels added
to DNA and UI in the previous commit in addition to the existing
X and Z Scale inputs.

The two length scale inputs control the ratio between the lengths
of the start and end segments of the bone: although for convenience
two inputs are provided, the whole chain is still uniformly scaled
to fit the curve.

Differential Revision: https://developer.blender.org/D9870
2021-06-18 18:56:03 +03:00
682a74e090 Armature: add B-Bone Y scale channel and extra flag fields to DNA.
In addition to the base bone transformation itself, B-Bones have
controls that affect transformation of its segments. For rotation
the features are quite complete, allowing to both reorient the
Bezier handles via properties, and to control them using custom
handle bones. However for scaling there are two deficiencies.

First, there are only X and Y scale factors (actually X and Z),
while lengthwise all segments have the same scaling. The ease
option merely affects the shape of the curve, and does not cause
actual scaling.

Second, scaling can only be controlled via properties, thus
requiring up to 6 drivers per joint between B-Bones to transfer
scaling factors from the handle bone. This is very inefficient.

Finally, the Z channels are confusingly called Y.

This commit adds a B-Bone Y Scale channel and extra B-Bone flag
fields to DNA with appropriate versioning (including for F-Curves
and drivers) in preparation to addressing these limitations.

Functionality is not changed, so the new fields are not used
until the following commits.

Differential Revision: https://developer.blender.org/D9870
2021-06-18 18:56:03 +03:00
aee04d4960 Fix T89246: No Mnemonic Underlines in Dialogs
When drawing mnemonic underlines for hotkeys, use text output of
underscore character instead of direct drawing a line. Otherwise these
are not visible in dialog buttons.

Introduced in 0fcc063fd9

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

Reviewed by Campbell Barton
2021-06-18 08:32:07 -07:00
4c19fe4707 UI: Sequencer: Use ampersand instead of slash for "Sequencer/Preview"
Using an ampersand here is more semantically correct. A slash indicates "or" while an ampersand indicates "and".
An ampersand here is best because the view type shows both the Sequencer and the Preview.
2021-06-18 11:13:00 -04:00
4998ceebfc GPencil: Missed flag in previous Copy Settings commit 2021-06-18 16:47:08 +02:00
408726000a GPencil: Move copy layer settings to function
Better to have a function that can be reused to duplicate the settings that need to be copied.
2021-06-18 16:40:44 +02:00
Jeroen Bakker
e0f2f07d1e DrawManager: Multithreaded counting of material buckets.
When having multiple materials in a mesh the triangles are sorted based
on material index. This sorting is done single threaded, but needs two
loops over the data. One to count the bucket size and the second one to
add the triangles to the right position in the buckets.

This patch will do the counting in a multithreaded approach that would
speed up the cache creation. It has been measured that this part is the
most blocking part of the cache creation.

Reviewed By: mano-wii

Differential Revision: https://developer.blender.org/D11615
2021-06-18 16:10:28 +02:00
Jeroen Bakker
6d73d98fb6 BMesh: use threading to count total selection.
During selections the total selection is refreshed at the end. This
process was done single threaded. This patch will do a parallel iter
approach.

Master: 0.043612s Threaded 0.017964s.

Master: {F10179586}
This patch: {F10179587}

Reviewed By: mano-wii

Differential Revision: https://developer.blender.org/D11622
2021-06-18 16:06:36 +02:00
03a83b4eb5 Fix T89262: Crash in regular FileBrowser ID listing of 'asset' .blend files.
`ED_fileselect_get_asset_params` would only return actual data pointer
when file browser is in ASSET mode.

Calling that whole section only makes sense if filebrowser is in asset
mode anyway.

Regression introduced in rBf6c5af3d4753 I think.

@Severin committing this fix now as this is a fairly critical bug for
the studio, feel free to revert and do proper fix if this one is not the
best solution.
2021-06-18 15:49:50 +02:00
Jeroen Bakker
ea4309925f Performance: Limit recounting during selection mode flushing.
This patch ensures that selection mode flushing updates total selection
counts internally. This reduces recounting when we are sure that the
input total selection counts were up to date.

For example for circle selection the total selection counts were
correct. But during flushing the selection could have been changed and
therefore the selection was always recounted.

This increased the performance on selected system from 6.90 FPS to 8.25
FPS during circle selection operations.

Before: {F10179981}
After: {F10179982}

Reviewed By: mano-wii

Differential Revision: https://developer.blender.org/D11647
2021-06-18 15:44:08 +02:00
a9d5c8f97f Fix error passing in false as instead of a struct
Error in 8a1860bd9a.
2021-06-18 23:40:28 +10:00
847b66e81d Fix T88394: crash when editing animated Alembic properties
When an object, whose mesh gets loaded from Alembic, gets animated in
Blender and the Alembic CacheFile datablock also gets animated, editing
keyframes causes both datablock to be re-copied for evaluation. This
caused a threading issue and a double-free of some memory. This is fixed
by expanding the scope of the spin lock in
`BKE_cachefile_reader_free()`.
2021-06-18 13:57:46 +02:00
b8cf8e0bc2 Fix T89240: Crash when moving vertices on a linked duplicate
There is an attempt to free an illegal pointer in `extract_edge_fac_finish`.
2021-06-18 08:25:51 -03:00
80bc819d50 Fluid: Clang-format cleanup
Updated fluid source files in extern with clang-format.
2021-06-18 12:28:17 +02:00
adefdbc9df Fluid: Optimization for FLIP neighbor search radius
Contributed by @erik85 in D11400. The idea from this patch was placed in
a more generic context: A new FOR macro has been added that loops
over the neighbors of a cell within a given radius.
2021-06-18 12:18:21 +02:00
7c68147709 Fix T88605: Alembic import crashes when missing arbGeomParams
Add check for the `arbGeomParams` property being valid, before attempting
to access a sub-property from it.
2021-06-18 11:21:13 +02:00
060d668ae6 Cleanup: clang format 2021-06-18 10:50:19 +02:00
6c1fdd52c1 Fix invalid polygon normal array access building bake data
Pre computed normals index wasn't properly aligned.
Regression from 2ec00ea0c1.
2021-06-18 18:00:47 +10:00
3caafd24a9 Cleanup: use 'bmesh' prefix for BMesh tessellation utilities 2021-06-18 16:37:43 +10:00
c4958bc540 Cleanup: rename test_index_face -> BKE_mesh_mface_index_validate 2021-06-18 15:13:52 +10:00
2e8d7fa7ee Cleanup: remove unused MFace custom-data utilities
Remove:

- BKE_mesh_loops_to_mface_corners
- BKE_mesh_tangent_loops_to_tessdata
2021-06-18 15:08:23 +10:00
253c5d25f7 Cleanup: move mesh tessellation into it's own file
This matches BMesh which also has tessellation in it's own file.

Using a separate file helps with organization when
extracting code into smaller functions.
2021-06-18 15:03:31 +10:00
c290ac2ab1 CMake: remove workaround for version that's no longer supported 2021-06-18 14:41:24 +10:00
af4167441b Cleanup: clang-tidy 2021-06-18 14:41:24 +10:00
50a4b9d502 Cleanup: replace 'unsigned in' with 'uint' 2021-06-18 14:27:41 +10:00
5f0d4fef91 Cleanup: use standard identifier for uint64_t string formatting 2021-06-18 14:27:39 +10:00
68b06208d2 Fix undefs from previous commit 2021-06-17 22:27:09 -03:00
f3c88f8ba5 Fix T89210: Box selection can fail in graphics editor
Test the intersection of segment instead of point.
2021-06-17 22:20:50 -03:00
Fen
e178a273fa Fix T89247: Dereference arguments to comparison function correctly
`bm_face_len_cmp` incorrectly interpreted its arguments as `BMFace *`
instead of `BMFace **`, causing an out-of-bounds read.

Ref D11637
2021-06-18 11:13:09 +10:00
94c4a9995e Fix T89233: Incorrect attribute remove warning for curves
The curve attribute delete function didn't return whether it was
successful or not.
2021-06-17 17:22:09 -05:00
4b673ebb99 Raycast geometry node.
The //Raycast// node intersects rays from one geometry onto another.
It computes hit points on the target mesh and returns normals, distances
and any surface attribute specified by the user.

A ray starts on each point of the input //Geometry//. Rays continue
in the //Ray Direction// until they either hit the //Target Geometry//
or reach the //Ray Length// limit. If the target is hit, the value of the
//Is Hit// attribute in the output mesh will be true. //Hit Position//,
//Hit Normal//, //Hit Distance// and //Hit Index// are the properties of the
target mesh at the intersection point. In addition, a //Target Attribute//
can be specified that is interpolated at the hit point and the result
stored in //Hit Attribute//.

Docs: D11620

Reviewed By: HooglyBoogly

Differential Revision: https://developer.blender.org/D11619
2021-06-17 21:11:32 +01:00
577d6d3f87 Fix T89234: Gpencil Separate doesn't copy settings in Stroke/Point mode
Some values were not copied from the old layer to the new one as Tint or Opacity factor.

The error affected to Strokes and Point mode
2021-06-17 20:41:53 +02:00
ed4222258e Geometry Nodes: Add Curve Subdivision Node
This node creates splines with more control points in between the
existing control points. The point is to give the splines more
definition for further tweaking like randomization with white noise,
instead of deforming a resampled poly spline with a noise texture.

For poly splines and NURBS, the node simply interpolates new values
between the existing control points. However, for Bezier splines,
the result follows the existing evaluated shape of the curve, changing
the handle positions and handle types to make that possible.

The number of "cuts" can be controlled by an integer input, or an
attribute can be used. Both spline and point domain attributes are
supported, so the number of cuts can vary using the value from the
point at the start of each segment.

Dynamic curve attributes are interpolated to the result with linear
interpolation.

Differential Revision: https://developer.blender.org/D11421
2021-06-17 11:39:23 -05:00
7c1bb239be Geometry Nodes: support minimum twist normal mode
The minimum twist mode is important because it allows creating
normals without sudden changes in direction. The disadvantage
of minimum twist normals is that the normals depend on all control
points. So changing one control point can change the normals
everywhere. The computed normals do not match the existing
code exactly, although they do match quite well on non-cyclic and
on some cyclic curves. I also noticed that the existing implementation
has some fairly simple failure cases that I haven't found in the new
implementation so far.

Differential Revision: https://developer.blender.org/D11621
2021-06-17 15:23:01 +02:00
56db09e2fd Geometry Nodes: fix ownership issue in spline to points conversion
Previously, `VArray_For_SplineToPoint` did not take ownership of the
virtual array leading to use-after-free errors.
2021-06-17 13:40:08 +02:00
1388e9de8a Geometry Nodes: improve node locking in evaluator
This makes the parts where a node is locked more explicit. Also, now the thread
is isolated when the node is locked. This prevents some kinds of deadlocks
(which haven't happened in practice yet).
2021-06-17 10:43:39 +02:00
a971409d5a Cleanup: use doxy sections for rna_mesh.c 2021-06-17 16:44:43 +10:00
ccd5f80550 Cleanup: rename rna_Mesh_update_data to rna_Mesh_update_data_deg_all
It's ambiguous what rna_Mesh_update_data does compared with functions
that use `rna_Mesh_update_data_*` as a prefix.

Noticed by @sybren D11377 review.
2021-06-17 16:38:19 +10:00
8ff6322152 Cleanup: improved comment for skipping updated with zero user meshes
Noticed by @sybren D11377 review.
2021-06-17 16:32:08 +10:00
6db290641e Cleanup: split BKE_mesh_copy_settings into two functions
- BKE_mesh_copy_parameters_for_eval to be used for evaluated meshes only
  as it doesn't handle ID user-counts.

- BKE_mesh_copy_parameters is a general function for copying parameters
  between meshes.
2021-06-17 15:08:19 +10:00
286bd87445 Cleanup: spelling 2021-06-17 14:43:25 +10:00
eb85de027c Cleanup: unused argument, function & shadow variable warning 2021-06-17 14:43:13 +10:00
78693d524c VSE: Refactor transform operator code
Refactor function `freeSeqData` so it is readable.

One strip can have multiple transform operations defined. To prevent
processing strip multiple times, build `SeqCollection` and use
sequencer iterator instead of iterating `TransData` directly.

No functional changes.

Differential Revision: https://developer.blender.org/D11618
2021-06-17 04:04:01 +02:00
e7003bc965 VSE: Reduce transform code complexity
Reduce complexity of sequencer transform code by removing recursivity.
This is possible by treating meta strips (mostly) as any other strip and
containing all transform code within SEQ_ functions.

Unfortunately internally meta strips still require special treatment,
but all complexity from code all over transform code seems to be
possible to contain within one function.

Functional change:
Previously adjusting handle of single image strip moved animation.
Now animation is not moved, which is behavior for all other strips.

Reviewed By: sergey, mano-wii

Differential Revision: https://developer.blender.org/D11493
2021-06-17 03:42:04 +02:00
c73be23e17 Revert "Fix T89204: slow repeated rendering with GPUOffscreen.draw_view3d"
This reverts commit d03b26edbd. There is some
refresh issue that needs to be solved before this can be enabled.
2021-06-17 02:06:26 +02:00
845f4cebad Fix T88342: 'To Sphere' and 'Push/Pull' not working in Pose mode
Some modes don't take into account that `TransData` may be in data space.
2021-06-16 16:47:46 -03:00
d03b26edbd Fix T89204: slow repeated rendering with GPUOffscreen.draw_view3d
Cache the GPUViewport so the framebuffers and associated textures are not
reallocated each time.
2021-06-16 20:19:34 +02:00
a1cc7042a7 Edge-scrolling for node editor
Starts scrolling when dragging a node or node link and going outside the current window.
Largely copied from the VIEW2D_OT_edge_pan operator.

Edge panning operator customdata and supporting functions now in
UI_view2d.h, so they could be used by operators in other editor
libraries. The VIEW2D_OT_edge_pan operator also uses this customdata and
shared functions now. Operators properties can be used to configure
edge panning margins and speed for each use case, rather than using
hardcoded values.

The speed function for edge panning has been tweaked somewhat:
* "Speed per pixel" has been replaced with a "speed ramp" distance.
  This is more intuitive and also creates an upper bound for the speed,
  which can otherwise become extreme with large cursor distance.
* "Max speed" is reached at the end of the speed ramp.
* Padding the region inside and outside is applied as before, but both
  values are operator properties now.

Node transform operator also supports edge panning. This requires
an offset for changes in the view2d rect, otherwise nodes are "stuck"
to the original view.

Transform operator had cursor wrapping categorically enabled, but this
gets quite confusing with the edge scrolling mechanism. A new TransInfo
option T_NO_CURSOR_WRAP has been introduced to disable this behavior.
The double negative is a bit annoying, but want to avoid affecting the
existing transform modes, so by default it should still set the
OP_IS_MODAL_GRAB_CURSOR flag (which then sets the WM_CURSOR_WRAP_XY
flag during modal execution).

Reviewed By: HooglyBoogly, JacquesLucke

Differential Revision: https://developer.blender.org/D11073
2021-06-16 18:35:52 +01:00
247abdbf41 LineArt: Cached calculation for modifiers in the same stack.
This allows line art to run only once for each modifier stacks,
with an option to toggle a specific line art modifier should
use cache or re-do their own calculations.

Reviewed By: Sebastian Parborg (zeddb), Hans Goudey (HooglyBoogly)

Differential Revision: https://developer.blender.org/D11291
2021-06-16 22:38:47 +08:00
b37093de7b BLI: add C++ wrapper for task isolation
This makes it easier to use task isolation in c++ code.
Previously, one either had to check `WITH_TBB` (possibly indirectly
through `WITH_OPENVDB`) or one had to use the C function which
is less convenient.
2021-06-16 16:29:21 +02:00
45d59e0df5 BLI: add threading namespace
This namespace groups threading related functions/classes. This avoids
adding more threading related stuff to the blender namespace. Also it
makes naming a bit easier, e.g. the c++ version of BLI_task_isolate could
become blender::threading::isolate_task or something similar.

Differential Revision: https://developer.blender.org/D11624
2021-06-16 16:14:02 +02:00
0cebe554d1 ShaderFX operators: Tweak a bit poll functions, forbid in liboverride cases.
Similar to what we do for constraints and modifiers, except that
currently adding or editing shaderfx in liboverride objects is
completely unsuported.

Fix T88974.
2021-06-16 16:09:28 +02:00
af3d7123c9 ShaderFX/LibOverride: Add BKE_shaderfx_is_nonlocal_in_liboverride util.
Used to detect if a shaderfx is purely local, or comes from linked data,
in case of a liboverride.

Not actually used yet since we do not currently support adding
shaderfx's to overrides, but will be in the future, and matches
constraints and modifiers code.
2021-06-16 16:09:28 +02:00
3953b82030 Tweaks to Constraints operators poll functions.
Mainly:
* Make `ED_operator_object_active_editable_ex` properly report poll
  messages on failure.
* Add `ED_operator_object_active_local_editable_posemode_exclusive` for
  bone constraints requiring pure local Object (non-override one).
* General cleanup and adding more poll messages on failures.
2021-06-16 16:09:28 +02:00
88aa056d1a Fix: Image node alpha socket converted to operations twice
On selecting a multi-layer image with a combined pass, a "Combined"
socket is created and default combined pass socket "Image" is
disabled by setting `SOCK_UNAVAIL` flag. When converting into
operations, `ImageNode` converts alpha socket on finding any socket with
a combined pass without checking the flag.

Since commit rB93e2491ee724 an assertion fails when mapping sockets
twice because now map `add_new` is used.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D11566
2021-06-16 14:04:24 +02:00
b66600b9f3 Compositor: Full frame Value node
Adds full frame implementation to Value node operation.
No functional changes.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D11594
2021-06-16 14:02:08 +02:00
b406b6717f Compositor: Full frame RGB node
Adds full frame implementation to RGB node operation.
No functional changes.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D11593
2021-06-16 14:00:05 +02:00
94084b2d3c Geometry Nodes: fix z-up spline normal calculation
Previously it didn't work when the tangents were collinear to the z axis.
2021-06-16 12:20:28 +02:00
00fc110d3f Alembic procedural: support reading per-vertex UV sets
This adds support for importing UV sets which are defined per vertex,
instead of per face corners. Such UV sets can be generated when the
mesh is split according to UV islands, or when there is only one UV
island, in which cases only a single UV value can be stored per
vertex since vertices will never be on a seam.
2021-06-16 09:39:39 +02:00
1c0a490d0e Cleanup: minor simplification to status allocation 2021-06-16 17:17:15 +10:00
c3fa7b7e4f Fix pose-mode statistics with multi-object editing
- Include all objects in pose mode.
- Show the number of objects in pose mode.
- Show the number of objects in edit mode for all types of objects
  (not just meshes).
2021-06-16 17:17:15 +10:00
4b36c5b1a7 Cleanup: sculpt mode checks when calculating stats
Sculpting dynamic topology used to code-path for counting object
then never used the result.

Match object mode checks in string access & drawing.
2021-06-16 17:17:15 +10:00
3385c04598 Alembic: support reading per-vertex UV sets
This adds support for importing UV sets which are defined per vertex,
instead of per face corners. Such UV sets can be generated when the
mesh is split according to UV islands, or when there is only one UV
island, in which cases only a single UV value can be stored per
vertex since vertices will never be on a seam.

Reviewed By: sybren

Differential Revision: https://developer.blender.org/D11584
2021-06-16 08:22:10 +02:00
9fed00341e Cleanup: reduce warnings when compiling release builds. 2021-06-16 08:00:52 +02:00
Johnny Matthews
ed4b2ba75a Geometry Nodes: Separate Components Node
Implementation of T86970. This node takes a geometry input with
multiple components and outputs them by component type. Meshes,
Curves, and Point Clouds support combining multiple input instances,
while volumes will only output the first volume component input until
suitable instance realization for multiple volumes is finished.

When direct geometry instancing is implemented it will be possible to
avoid realizing instances in this node.

Differential Revision: https://developer.blender.org/D11577
2021-06-15 22:31:57 -05:00
2209321f78 Screen: simplify internal logic for new full-screen areas
Creating a new full screen area had it's area initialized as empty,
updating the screen then set the area to a 3D view (as a fallback),
before the actual area type was set.

This made setting the intended space-type run the 3D views exit callback
on a 3D view without a View3D struct allocated, which the exit callback
needed to account for.

Resolve by calling ED_screen_change after the area type has been set.
2021-06-16 12:50:00 +10:00
be8a201a16 Cleanup: unused warning 2021-06-16 12:29:44 +10:00
0b0c7ca017 Cleanup: Fix inconsistent parameter name warning 2021-06-15 21:11:18 -05:00
c8e331f450 UI - LOCAL View3D overlay stats
This patch improves the 3DView statistics overlay to show LOCAL stats
while in local view. This means the stats can vary between 3DViews and
the statusbar when views are in local view, but this gives a much more
accurate count of the objects, and their components, that you are
directly working with rather than just scene values.

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

Reviewed by Campbell Barton
2021-06-15 19:01:53 -07:00
4891da8ae2 Fix T88263: Incorrect image offset from old file
Versioning code for converting strip offset property doesn't work, when
property was animated and disabled or when crop was used.

When offset property is animated and offset is enabled, animation is
converted to be used with new transform design. When offset is disabled,
animation is left untouched. New transform design doesn't have option
to disable offset, and therefore old unconverted animation is used
instead of converted static value.

Remove animation from propery if it was unused.

Another issue was that both X and Y offset animation was being corrected
by factor caluclated for X channel.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D11370
2021-06-16 00:44:37 +02:00
1a5fa2b319 VSE: Improve animation evaluation performance
Use lookup string callback function for `sequences_all` RNA property
`rna_SequenceEditor_sequences_all_lookup_string` using a GHash for faster lookups.

When names are changed or strips are added/removed the lookup is tagged invalid.
The next time the lookup is used it will rebuild it.

Reviewed By: sergey, jbakker

Differential Revision: https://developer.blender.org/D11544
2021-06-16 00:29:17 +02:00
143a81ccce Geometry Nodes: Allow int attribute input fields with single value
Just like the way we often have a choice between an attribute input and
a single float, this adds the ability to choose between attribute and
integer input sockets, useful for D11421.
2021-06-15 16:38:28 -05:00
c29afa5156 Cleanup: Expose function publicly, rename
There is no particular reason these two functions shouldn't be used
outside of the bezier spline implementation since they don't do anything
particularly controversial.
2021-06-15 16:31:08 -05:00
732e8c723e Splines: Add resize method to CurveEval
This helps when adding splines to a new curve in parallel.
2021-06-15 16:24:11 -05:00
Germano Cavalcante
6bb980b0f4 DRW: sanitize 'DRW_mesh_batch_cache_dirty_tag'
Create maps that specify which batches have vbo or ibo as a reference
and use these maps to discard batches along with buffers.

Differential Revision: https://developer.blender.org/D11588
2021-06-15 17:03:19 -03:00
8e84938dd0 Cleanup: Add files for version independent versioning helpers
Adds `source/blender/blendloader/intern/versioning_common.cc` and
`versioning_common.h` for version independent versioning functions.

I only placed `do_versions_add_region_if_not_found()` in there for now.
`blo_do_version_old_trackto_to_constraints()` could also be added, but
that's so old, I prefer keeping that in `versioning_legacy.c`.
2021-06-15 19:33:00 +02:00
a4f840e15b UI: Support right aligned non-shortcut hints in widgets
Widget drawing code already supported drawing right-aligned, grayed out
shortcut strings. This patch generalizes things a bit so this can also
be used to draw other hints in the same way. There have been a few
instances in the past where this would've been useful, D11046 being the
latest one.

Note that besides some manual regression testing, I didn't check if this
works yet, as there is no code actually using it (other than the
shortcuts). Can be checked as part of further development for D11046.

A possible further improvement would be providing a way to define how
clipping should be done. E.g. sometimes the right-aligned text should be
clipped first (because it's just a hint), in other cases it should be
left untouched (like current code explicitly does it for shortcuts).

Removes the `UI_BUT_HAS_SHORTCUT` flag, which isn't needed anymore.
2021-06-15 19:13:09 +02:00
fcc844f8fb BLI: use explicit task isolation, no longer part of parallel operations
After looking into task isolation issues with Sergey, we couldn't find the
reason behind the deadlocks that we are getting in T87938 and a Sprite Fright
file involving motion blur renders.

There is no apparent place where we adding or waiting on tasks in a task group
from different isolation regions, which is what is known to cause problems. Yet
it still hangs. Either we do not understand some limitation of TBB isolation,
or there is a bug in TBB, but we could not figure it out.

Instead the idea is to use isolation only where we know we need it: when
holding a mutex lock and then doing some multithreaded operation within that
locked region. Three places where we do this now:
* Generated images
* Cached BVH tree building
* OpenVDB lazy grid loading

Compared to the more automatic approach previously used, there is the downside
that it is easy to miss places where we need isolation. Yet doing it more
automatically is also causing unexpected issue and bugs that we found no
solution for, so this seems better.

Patch implemented by Sergey and me.

Differential Revision: https://developer.blender.org/D11603
2021-06-15 17:28:44 +02:00
Germano Cavalcante
b3f0dc2907 Draw Cache: avoid recalculating 'poly_normals'
Call `BKE_mesh_ensure_normals_for_display` to avoid recalculating
poly_normals.

**Benchmark**
||master:|PATCH:
|---|---|---|
|looptris_test:|Average: 3.995076 FPS|Average: 4.047470 FPS
||rdata 11ms iter 91ms (frame 235ms)|rdata 11ms iter 86ms (frame 233ms)
|subdiv_mesh_cage_and_final:|Average: 1.884492 FPS|Average: 1.900114 FPS
||rdata 7ms iter 42ms (frame 268ms)|rdata 7ms iter 39ms (frame 265ms)
||rdata 7ms iter 44ms (frame 259ms)|rdata 7ms iter 42ms (frame 257ms)
|subdiv_mesh_final_only:|Average: 6.245944 FPS|Average: 6.289000 FPS
||rdata 3ms iter 23ms (frame 153ms)|rdata 3ms iter 21ms (frame 154ms)
|subdiv_mesh_final_only_ledge:|Average: 6.263482 FPS|Average: 6.187218 FPS
||rdata 3ms iter 23ms (frame 156ms)|rdata 3ms iter 22ms (frame 154ms)

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D11527
2021-06-15 11:45:39 -03:00
71997921c4 Cleanup: use back-slash for doxygen comments 2021-06-16 00:08:34 +10:00
0c75a98561 CMake: disable TBB when not found 2021-06-16 00:08:34 +10:00
Jeroen Bakker
174ed69c1b DrawManager: Cache material offsets.
When using multiple materials in a single mesh the most time is spend in
counting the offsets of each material for the sorting.

This patch moves the counting of the offsets to render mesh data and
caches it as long as the geometry doesn't change.

This patch doesn't include multithreading of this code.

Reviewed By: mano-wii

Differential Revision: https://developer.blender.org/D11612
2021-06-15 15:31:34 +02:00
7c8b9c7a9a Fix warning treated as an error
"void' function returning a value".
2021-06-15 09:57:57 -03:00
62906cdbea Cleanup: Added hierarchy in MeshBufferExtractionCache. 2021-06-15 12:34:13 +02:00
7f570a7174 Cleanup: Split mesh_render_data_loose_geom into multiple functions. 2021-06-15 11:39:36 +02:00
9cd2e80d5d Fix: wrong size check
This fixes a bad mistake by myself. Thanks Lukas Tönne for telling me.
2021-06-15 10:26:31 +02:00
462bd81399 Fix: Sequencer backdrop not updated during playback.
Caused by recent optimization in {7b76a160a4}.
2021-06-15 09:31:03 +02:00
819152527f BMesh: assert that face normals have been updated for tessellation
This catches missing normal updates that may cause invalid tessellation.
2021-06-15 14:54:34 +10:00
89e2b441ed Cleanup: remove return value from face normal calculation
This value is always 'sides - 2', no need to return this value.
2021-06-15 14:38:10 +10:00
ae34808114 Fix missing normal update in edit-mesh blend-from shape operator 2021-06-15 14:35:43 +10:00
fdad77d73d BMesh: use faster normal update method for edit-mesh coordinates
This wasn't included in the previous fix so it'd be 2.93 compatible.
2021-06-15 13:52:00 +10:00
0a361eb5ec Fix outdated face tessellation use when editing edit-mesh coodinates 2021-06-15 13:31:33 +10:00
2ba804d7b7 Screen: clear runtime structures on file-read & data-copy
Clear the runtime data structs instead of individual members,
this simplifies adding new runtime members as there are at least
two places they would need to be cleared.

Resolves error in D8883.
2021-06-15 12:52:59 +10:00
5dc0fd08a7 Cleanup: correct incomplete comment 2021-06-15 10:59:57 +10:00
2053e1f533 Fix image space missing mask display panel 2021-06-15 10:50:48 +10:00
4ae06b6123 Cleanup: remove "_" prefix for used arguments 2021-06-15 10:50:43 +10:00
013fc69ea8 Cleanup: unused argument & variable warnings 2021-06-15 10:50:43 +10:00
3bf98d1cec Cleanup: use private methods for internal operator utilities
Also remove unused argument.
2021-06-15 10:08:57 +10:00
9ce49af32e Cleanup: use doxygen comments for DNA_color_types
Also use enum instead of defines for Scopes.wavefrm_mode
2021-06-15 09:34:58 +10:00
1f251b7a27 Win8 cleanup, remove dead function pointer and macro. 2021-06-14 14:41:58 -07:00
61fdc45034 Geometry Nodes: Join dynamic curve attributes in the join geometry node
This commit lets the join geometry node transfer dynamic attributes
to the result, the same way that point cloud and mesh attributes are
joined. The implementation is different though, because of an
optimization implemented for curves to avoid copying splines.

The result attribute is added with the highest priority domain (points
over splines), and the highest complexity data type. If one curve had
the attribute on the spline domain but not others, the point domain
values will be used.

Generally this is a bit lower level than I would have liked this code
to be, but should be efficient, and it's really not too complicated.

Differential Revision: https://developer.blender.org/D11491
2021-06-14 15:13:43 -05:00
bf7f918a0e Geometry Nodes: Parallelize curve reverse node
Each spline can be handled separately here. This gives approximately a
2x speedup on my 8 core processor on an input of 80000 2 point splines.
2021-06-14 14:28:57 -05:00
fe0fa7cec6 Cleanup: Refactor join geometry node attribute gathering
Instead of building a set and then determining the final domain and
type for every attribute separately in the loop, construct a map with
the necessary data in the first place. This is simpler and should be
slightly more efficient.

Split from D11491
2021-06-14 13:58:11 -05:00
Johnny Matthews
4a540b9b48 Geometry Nodes: Curve Reverse Node
This is an implementation of T88722. It accepts a curve object and
for each spline, reverses the order of the points and all attributes.
This is more of a foundational node to support other nodes in the
future (like curve deform)

Selection takes spline domain attributes to determine which splines
are selected. If no selection is present all splines are reversed.

Differential Revision: https://developer.blender.org/D11538
2021-06-14 13:28:38 -05:00
fcbb20286a Geometry Nodes: Curve to Points Node for Evaluated Data
This node implements the second option of T87429, creating points
along the input splines with the necessary evaluated information
for instancing: `tangent`, `normal`, and `rotation` attributes.
All generic curve point and spline attributes are copied to the
result points as well.

The "Count" and "Length" methods are just like the current options
in the resample node, but the output is points instead of a curve.
The "Evaluated" method uses the points you see on the curve directly,
and therefore should be the fastest.

The rotation data is retrieved from a transform matrix built with the
same method that the curve to mesh node uses. The radius attribute is
divided by 10 so the points don't look absurdly huge in the viewport.
In the future that could be an option.

For the implementation, one thing that could use an improvement
is the amount of temporary allocations while resampling to evaluated
points before the final points. I expect that reusing a buffer for
each thread would give a nice improvement.

Differential Revision: https://developer.blender.org/D11539
2021-06-14 12:52:08 -05:00
d08e925ef1 Fix Build Warning
Marking unused function argument.

Introduced in bcff0ef9ca

Differential Revision: https://developer.blender.org/D10887
2021-06-14 10:42:28 -07:00
bcff0ef9ca UI: Windows Blend File Association
This patch allows Windows users to specify that their current blender
installation should be used to create thumbnails and be associated
with ".blend" files. This is done from Preferences / System. The only
way to do this currently is from the command-line and this is sometimes
inconvenient.

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

Reviewed by Brecht Van Lommel
2021-06-14 10:22:03 -07:00
2e5671a959 Fix: VSE seeking with proxy strips would fail on certain frames
If the last decoded frame had the same timestamp as the GOP current
packet, then we would skip over this frame when fast forwarding and we
would seek until the end of the file.

This would could only be triggered reliably in single threaded mode.

Reviewed By: Richard Antalik

Differential Revision: http://developer.blender.org/D11601
2021-06-14 19:08:51 +02:00
aadd355028 Fix possible C-linkage warning on Clang
The warning would appear when using the `ENUM_OPERATORS()` macro inside
of an `extern "C"` block.
Didn't cause a warning in master currently, but in the
`asset-browser-poselib` branch.

After macro expansion, there would be C++ code in code with C linkage
(`extern "C"`). So make sure the expanded C++ code always uses C++
linkage.
The syntax used is totally C++ compliant: the C++ standard requires that
in such nested linkage specifications, the innermost one determines the
linking language (e.g. see
https://timsong-cpp.github.io/cppwp/n4659/dcl.link#4).
2021-06-14 19:00:13 +02:00
3de6fe0b3e Error Messages Creating Thumbnail Folders
On the Windows platform there will be some errors printed to the
console if the user's thumbnail cache folder doesn't already exist.
While creating those folders there is an attempt to do so multiple
times and so we get errors when trying to create when exists. This
is caused by paths that have hard-coded forward slashes, which causes
our path processing routines to not work correctly. This patch defines
those paths using platform-varying separator characters.

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

Reviewed by Brecht Van Lommel
2021-06-14 09:17:27 -07:00
e9b4de43d8 Cleanup: rename id to owner_id for python id properties
This is consistent with the naming in `PointerRNA`.
2021-06-14 18:13:27 +02:00
90b0fb135f PyAPI: remove deprecated bpy.app.binary_path_python 2021-06-14 23:52:08 +10:00
8a1860bd9a BMesh: support face-normal calculation in normal & looptri functions
Support calculating face normals when tessellating. When this is done
before updating vertex normals it gives ~20% performance improvement.

Now vertex normal calculation only needs to perform a single pass on the
mesh vertices when called after tessellation.

Extended versions of normal & looptri update functions have been added:

- BM_mesh_calc_tessellation_ex
- BM_mesh_normals_update_ex

Most callers don't need to be aware of this detail by using:

- BKE_editmesh_looptri_and_normals_calc
- BKE_editmesh_looptri_and_normals_calc_with_partial

- EDBM_update also takes advantage of this,
  where calling EDBM_update with calc_looptri & calc_normals
  enabled uses the faster normal updating logic.
2021-06-14 23:01:19 +10:00
6bef255904 BMesh: remove unit-length edge-vector cache from normal calculation
Bypass stored edge-vectors for ~16% performance gains.

While this increases unit-length edge-vector calculations by around ~4x
the overhead of a parallel loop over all edges makes it worthwhile.

Note that caching edge-vectors per-vertex performs better and may be
worth investigating further, although in my tests this increases code
complexity with barley measurable benefits over not using cache at all.

Details about performance and possible optimizations are noted in
bm_vert_calc_normals_impl.
2021-06-14 22:56:02 +10:00
8083527f90 Edit Mesh: use params arg for update function, add calc_normals arg
Rename function EDBM_update_generic to EDBM_update, use a parameters
argument for better readability.

Also add calc_normals argument, which will have benefits when
calculating normals and tessellation together is optimized.
2021-06-14 22:56:01 +10:00
1d2eb461b5 Cleanup: clang-format 2021-06-14 22:56:00 +10:00
Thomas Lachmann
b84707df17 Python API: option for render engines to disable image file saving
For some custom rendering engines it's advantageous not to write the image files to disk.
An example would be a network rendering engine which does it's own image writing.

This feature is only supported when bl_use_postprocess is also disabled, since render
engines can't influence the saving behavior of the sequencer or compositor.

Differential Revision: https://developer.blender.org/D11512
2021-06-14 14:20:04 +02:00
ada47c4772 Fix build error in release builds after recent changes 2021-06-14 13:22:11 +02:00
748475b943 BLI_math: Cleanup: Use mul_/madd_ functions.
Better to avoid explicit vectors components direct manipulation when a
generic operation for whole vector exists, if nothing else it avoids
potential mistakes in indices.
2021-06-14 12:32:38 +02:00
b21db5e698 BLI_math: Fix several division-by-zero cases.
Those were caused by various tools used on degenerate geometry, see
T79775.

Note that fixes are as low-level as possible, to ensure they cover as
much as possible of unreported issues too.

We still probably have many more of those hidden in BLI_math though.
2021-06-14 12:32:38 +02:00
Leon Zandman
5add6f2ed9 Fix T87867: file open dialog triggers OneDrive file downloads on macOS
Until OneDrive supports macOS's native placeholder file implementation, detect
the com.microsoft.OneDrive.RecallOnOpen extended file attribute.

Differential Revision: https://developer.blender.org/D11466
2021-06-14 12:26:07 +02:00
c9dc55301c Fix T88494: add missing depsgraph relation update tags
Adding e.g. a Collection Info node creates a new depsgraph relation.
Therefore the relations should be updated.
2021-06-14 11:35:36 +02:00
a19c9e9351 Fix T88947: invalid normals when converting point cloud to mesh 2021-06-14 11:07:42 +02:00
Campbell Barton
2db09f67a4 Nodes: remove redundant increment node tree current socket index
`ntree->cur_index` was being incremented twice in make_socket_interface.

Reviewed By: JacquesLucke

Ref D11590
2021-06-14 18:46:39 +10:00
03544ed54f Fix T88807: crash when there are multiple links between the same sockets
This commit does two things:

* Disallows creating more than one link from one socket to a multi socket input.
* Properly count links if there happen to be more than one link between the same sockets.

The new link counting should also be more efficient asymptotically.

Differential Revision: https://developer.blender.org/D11570
2021-06-14 10:04:52 +02:00
54a03d4247 Cleanup: Reduce indentation from redundant check 2021-06-13 18:56:52 -05:00
84adc23941 Cleanup: Order return argument last 2021-06-13 18:22:31 -05:00
0f68e5c30a Fix libmv new[]/delete[] mismatch 2021-06-13 15:13:08 +10:00
5181bc46b3 Cleanup: allocation size mismatch warning
While harmless, use fixed size int type for pixel data.
2021-06-13 14:54:54 +10:00
452590571c Cleanup: rename 'unsigned int' -> 'uint' 2021-06-13 14:54:54 +10:00
ab38223047 Cleanup: redundant initialization
These were limited to obvious cases. Some less obvious cases
were kept as refactoring might make them necessary in future.
2021-06-13 14:54:54 +10:00
f731bce6cd Cleanup: use ATTR_RETURNS_NONNULL function attribute 2021-06-13 14:47:19 +10:00
4c3bb60d0f Cleanup: use return arg prefix for ED_object_add_generic_get_opts 2021-06-13 14:47:18 +10:00
9ff4e0068f Cleanup: avoid the possibility of 'enter_editmode' being left unset
While in practice this isn't an issue currently, always set
'enter_editmode' in ED_object_add_generic_get_opts
to avoid problems in the future.
2021-06-13 14:47:07 +10:00
84e98ba182 Cleanup: misleading return argument for hair_create_input_mesh
- The argument with named with an `r_` prefix when it was in fact
  also read from.
- The argument passed in had to be 'psys->clmd->hairdata',
  if it was not - the function would not worked.
2021-06-13 14:47:04 +10:00
8e58f93215 Cleanup: remove redundant NULL check, reduce scope 2021-06-13 14:47:03 +10:00
aab4794512 Cleanup: missing include 2021-06-13 14:47:01 +10:00
952d6663e0 Fix modifier deform by armature check ignoring virtual modifiers
Regression in f00cb93dbe (fix for T63125)
2021-06-13 14:46:59 +10:00
7b0c8097a7 Fix missing directory in CMakeLists.txt 2021-06-12 00:00:29 -03:00
b313525c1b Fix T88515: Cycles does not update light transform from linked collections
When moving a linked collection, we seem to only receive a depsgraph update
for an empty object so the Blender synchronization cannot discriminate it
and tag the object(s) (light or geometry) for an update through
id_map.set_recalc.

This missing transform update only affects lights since we do not check
manually if the transformations were modified like we do for objects.

To fix this, add a check to see if the transformation is different provided
that a light was already created.

Reviewed By: brecht

Maniphest Tasks: T88515

Differential Revision: https://developer.blender.org/D11574
2021-06-12 04:13:43 +02:00
d75e45d10c Fix T88812: Child Windows on Vertical Monitors
This patch improves the positioning of child windows when on monitors
that are arranged vertically (any above any other). When calculating a
window position in Ghost coordinates from GL coordinates we were using
monitor height, which can give incorrect values when desktop is taller
than any single monitor. So use desktop height instead.

See D10637 for more details and examples.

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

Reviewed by Brecht Van Lommel
2021-06-11 14:39:19 -07:00
bd87ba90e6 Render Window as Non-Child on Win32 platform
This patch makes the "Render" window a top-level window, not a child of
the main window, which was the case in blender versions prior to 2.93.
This means it is no longer "on top", nor is the icon grouped on the
taskbar in the same way, but you can Alt-Tab between it and the main
window. This change only affects the Windows platform as the other
platforms behave this way.

See D11576 for links to negative feedback that prompts this change.

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

Reviewed by Brecht Van Lommel
2021-06-11 13:07:30 -07:00
Pablo Dobarro
7bc5246156 Overlays: Make flash on mode transfer an operator property
This moves the flash on mode transfer effect option from the overlays to
an operator property of the mode transfer operator.

- This effect is intended to show the target object when no overlays or
a minimal set of overlays is enabled. Making it part of the whole set of
overlays invalidates this use case.

- The effect is not intended to be configurable per viewport, it should
be a global option.

The effect is still implemented using the overlay engine (instead of a
draw modal callback) due to performance and drawing artifacts. Having it
implemented as an overlay with runtime timer data in the objects makes
also possible to run multiple animations at the same time without any
visual glitches.

Reviewed By: campbellbarton, JulienKaspar

Differential Revision: https://developer.blender.org/D11519
2021-06-11 21:48:59 +02:00
f6c5af3d47 Add option to link assets on drag & drop
Note: Linking in this case as in link vs. append. Easily confused with linking
a data-block to multiple usages (e.g. single material used by multiple
objects).

Adds a drop-down to the Asset Browser header to choose between Link and Append.
This is probably gonna be a temporary place, T54642 shows where this could be
placed eventually.

Linking support is crucial for usage of the asset browser in production
environments. It just wasn't enabled yet because a) the asset project currently
focuses on single user, not production assets, and b) because there were many
unkowns still for the workflow that have big impact on production use as well.
With the recently held asset workshop I'm more confident with enabling linking,
as design ideas relevant to production use were confirmed.

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

Reviewed by: Bastien Montagne
2021-06-11 16:46:20 +02:00
c8fcea0c33 Fix object assets getting duplicated after dropping
The operator run when dropping objects would duplicate the dropped object and
place that in the scene, even though that was just appended. Addressed by
making the duplication optional for the operator. If the duplication is not
requested, the object is just added to the scene (if needed), repositioned
based on the drop location and selected (deselecting other objects).
This makes the operator work as expected when using it to drop assets.

Reviewed as part of https://developer.blender.org/D11536.

Reviewed by: Bastien Montagne
2021-06-11 16:46:20 +02:00
20ece8736f Fix T89001: node search not working anymore 2021-06-11 16:27:56 +02:00
Maxime Casas
b4adb85933 Fix T89033: segfault reordering animation channels
Fix segmentation fault that can occur when reordering animation
channels.

Under some specific conditions, the list "act->curves" is empty in the
"join_groups_action_temp" function. In particular, this happens when a
scene contains an action that has not been pushed down, and with no
keyframe in it.

Reviewed By: sybren

Differential Revision: https://developer.blender.org/D11569
2021-06-11 16:27:04 +02:00
605ce623be Nodes: cache socket identifier to index mapping
While this preprocessing does take some time upfront,
it avoids longer lookup later on, especially as nodes get
more sockets.

It's probably possible to make this more efficient in some cases
but this is good enough for now.
2021-06-11 16:21:23 +02:00
Jeroen Bakker
7b30a3e98d Performance: Use parallel range for ImBuf scanline processor.
Scanline processor did its own heurestic what didn't scale well when
having a multiple cores. In stead of using our own code this patch will
leave it to TBB to determine how to split the scanlines over the
available threads.

Performance of the IMB_transform before this change was 0.002123s, with
this change 0.001601s. This change increases performance in other areas
as well including color management conversions.

Reviewed By: zeddb

Differential Revision: https://developer.blender.org/D11578
2021-06-11 15:55:22 +02:00
Jeroen Bakker
7b76a160a4 Sequencer: Do not redraw during playback.
When using large sequences including audio the drawing of the audio on
top of the strip takes a lot of time. This effects the playback
performance heavily.

During the animation playback performance there was a solution for this
by only drawing the playhead overlay. This was reverted for the sequence
editor as it didn't update the color strips when they were animated.

This patch checks if there are animated color strips if so the full
screen is redrawn, otherwise only the playhead is redrawn.

Reviewed By: ISS

Differential Revision: https://developer.blender.org/D11580
2021-06-11 15:51:26 +02:00
0eb9351296 Refactor: use 'BLI_task_parallel_range' in Draw Cache
One drawback to trying to predict the number of threads that will be
used in the `task_graph` is that we are only sure of the number when the
threads are running.

Using `BLI_task_parallel_range` allows the driver to
choose the best thread distribution through `parallel_reduce`.

The benefit is most evident on hardware with fewer cores.

This is the result on an 4-core laptop:
||before:|after:
|---|---|---|
|large_mesh_editing:|Average: 5.203638 FPS|Average: 5.398925 FPS
||rdata 15ms iter 43ms (frame 193ms)|rdata 14ms iter 36ms (frame 187ms)

Differential Revision: https://developer.blender.org/D11558
2021-06-11 10:49:50 -03:00
Germano Cavalcante
2330cec2c6 Refactor: Draw Cache: use 'BLI_task_parallel_range'
This is an adaptation of {D11488}.

A disadvantage of manually setting the iter ranges per thread is that
we don't know how many threads are running in the background and so we
don't know how to best distribute the ranges.

To solve this limitation we can use `parallel_reduce` and thus let the
driver choose the best distribution of ranges among the threads.

This proved to be especially beneficial for computers with few cores.

**Benchmarking:**
Here's the result on an 4-core laptop:
||master:|PATCH:
|---|---|---|
|large_mesh_editing:|Average: 5.203638 FPS|Average: 5.398925 FPS
||rdata 15ms iter 43ms (frame 193ms)|rdata 14ms iter 36ms (frame 187ms)

Here's the result on an 8-core PC:
||master:|PATCH:
|---|---|---|
|large_mesh_editing:|Average: 15.267482 FPS|Average: 15.906881 FPS
||rdata 9ms iter 28ms (frame 65ms)|rdata 9ms iter 25ms (frame 63ms)
|large_mesh_editing_ledge: |Average: 15.145966 FPS|Average: 15.520474 FPS
||rdata 9ms iter 29ms (frame 65ms)|rdata 9ms iter 25ms (frame 64ms)
|looptris_test:|Average: 4.001917 FPS|Average: 4.061105 FPS
||rdata 12ms iter 90ms (frame 236ms)|rdata 12ms iter 87ms (frame 230ms)
|subdiv_mesh_cage_and_final:|Average: 1.917769 FPS|Average: 1.971790 FPS
||rdata 7ms iter 37ms (frame 261ms)|rdata 7ms iter 31ms (frame 258ms)
||rdata 7ms iter 38ms (frame 252ms)|rdata 7ms iter 33ms (frame 249ms)
|subdiv_mesh_final_only:|Average: 6.387240 FPS|Average: 6.591251 FPS
||rdata 3ms iter 25ms (frame 151ms)|rdata 3ms iter 16ms (frame 145ms)
|subdiv_mesh_final_only_ledge:|Average: 6.247393 FPS|Average: 6.596024 FPS
||rdata 3ms iter 26ms (frame 158ms)|rdata 3ms iter 16ms (frame 148ms)

**Notes:**
- The improvement can only be noticed if all extracts are multithreaded.
- This patch touches different areas of the code, so it can be split into another patch if the idea is accepted.

These screenshots show how threads behave in a quadcore:
Master:
{F10164664}
Patch:
{F10164666}

Differential Revision: https://developer.blender.org/D11558
2021-06-11 10:45:12 -03:00
fe22635bf6 Nodes: add utilities to check if there are undefined nodes/sockets 2021-06-11 14:55:10 +02:00
c0367b19e2 Fix: VSE search in mpegts files would fail
ffmpeg_generic_seek_workaround did work properly and our start pts
calculation was wrong.

Reviewed By: Richard Antalik

Differential Revision: http://developer.blender.org/D11562
2021-06-11 14:05:07 +02:00
4adbe31e2f Fix: VSE indexer seeking not working correctly
Because of the added sanity checks in rB14508ef100c9 (D11492), seeking
in proxies would not work correctly any more. This is because it wasn't
working as intended before, but in most cases this wouldn't be
noticeable. However now when the sanity checks are tripped it is very
noticeable that something is wrong

The indexer tried to use dts values for time stamps when we used pts in
our decode functions to get the time positions. This would make it
start in the wrong GOP frames when searching. Now that we enforce no
crossing of GOP frames when decoding after seek, this would lead to
issues.

Now we correctly use pts (or dts if pts is not available) and thus we
don't have any seeking issues because of time stamp format missmatch.

Reviewed By: Richard Antalik

Differential Revision: http://developer.blender.org/D11561
2021-06-11 14:04:48 +02:00
1fb2eaf1c5 Fix: VSE timecodes being used even when turned off.
Reviewed By: Richard Antalik

Differential Revision: http://developer.blender.org/D11567
2021-06-11 14:04:35 +02:00
2f280d4b92 LineArt: Fix crash due to empty duplicollection. 2021-06-11 17:55:33 +08:00
e9c8ae767a Performance: Split ImBuf sampling.
When sampling ImBuf can be a char or a float buffer. Current sampling
functions added overhead by checking which kind of buffer was passed
every pixel that was sampled. When performing image processing this
check can be removed outside the inner loop adding 5% of performance
increase in the `IMB_transform` operator.
2021-06-11 11:37:39 +02:00
Xing Liu
7fc220517f Fix T88068: Alt+I now respects keying set
Remap {key Alt I} from `anim.delete_key_v3d` to `anim.delete_key`. This
makes it keyframe removal symmetrical with keyframe insertion ({key I}).

Both the default keymap {key Alt I} and the Industry Compatible keymap
{key Alt S} have been updated.

Reviewed By: sybren, #animation_rigging

Maniphest Tasks: T88068

Differential Revision: https://developer.blender.org/D11528
2021-06-11 11:13:20 +02:00
Jeroen Bakker
28617bb167 Sequencer: Transform ImBuf Processor.
Inside the sequencer the cropping and transform of images/buffers were
implemented locally. This reduced the optimizations that a compiler
could do and added confusing code styles. This patch adds
`IMB_transform` to reduce the confusion and increases compiler
optimizations as more code can be inlined and we can keep track of
indices inside the inner loop.

This increases end-user performance by 30% when playing back aa video
in VSE.

Reviewed By: ISS, zeddb

Differential Revision: https://developer.blender.org/D11549
2021-06-11 09:34:44 +02:00
84f025c6fd Cleanup: use sentences for pose slide comments 2021-06-11 16:27:55 +10:00
Christoph Lendenfeld
066f5a4469 Cleanup: pose slider rename region to region_header
Reviewed By: sybren, campbellbarton

Ref D11365
2021-06-11 15:53:34 +10:00
Christoph Lendenfeld
d07cc5e680 Cleanup: pose slider use enum types
use enum types in `tPoseSlideOp` instead of `short`

Reviewed By: sybren, campbellbarton

Ref D11364
2021-06-11 15:40:07 +10:00
Christoph Lendenfeld
162cf8e81d Cleanup: pose slider use strncpy
use `STRNCPY` instead of `BLI_strncpy`

Reviewed By: sybren, campbellbarton

Ref D11363
2021-06-11 15:38:27 +10:00
Christoph Lendenfeld
fd5c94c48a Cleanup: pose slider data types
- change vec2f to float[2]
- pass rctf as pointer
- change `const struct rctf` to `const rctf`
2021-06-11 15:36:41 +10:00
Christoph Lendenfeld
2724d08cf5 Cleanup: pose slider rename "percentage" to "factor"
This patch changes occurrences of percentage to factor.

There are some usages of percentage left in there on purpose.
They are distinguished as follows:

- factor is 0-1 float
- percentage is 0-100 int

Ref D11361

Reviewed by: sybren, campbellbarton
2021-06-11 15:29:52 +10:00
Charlie Jolly
461ba4438f Nodes: move mix rgb node to C++
Prepare node for conversion to Geometry Nodes.

There should be no functional changes.

Reviewed By: HooglyBoogly

Differential Revision: https://developer.blender.org/D11506
2021-06-11 00:01:13 +01:00
d581c1b304 UI: Correct label naming mistake for VSE text strip box background
Seems to be a copy/paste error from 
rB235c309e5f86e84fb08e1ff2c5c11eb0b775c388
2021-06-10 17:45:16 -04:00
e8a4bddef4 deps/windows: add missing tbbmalloc_debug.lib
This file is being linked by blender without
it existing causing issues for debug builds.
2021-06-10 12:03:12 -06:00
fbd889ec28 Fix T86544: better cleanup of path given as command line argument.
When using non-default system separator in filename path, code would end up
with an absolute path mixing regular and alternative separator,
confusing the rest of the path manipulations later on.

So this commit add proper replacements of alternative separators, and
path normalization.
2021-06-10 18:37:46 +02:00
509e0c5b76 Cleanup: BLI_path_slash_native: use separator defines instead of literal values.
Even though this function is alredy using system-specific code, it's
still cleaner to use `SEP` and `ALTSEP` here.
2021-06-10 18:35:35 +02:00
7b62a54230 Fix T88578: crash when loading value from group output node
It remembered the wrong origin socket and couldn't find the value
anymore later on.
2021-06-10 17:24:53 +02:00
Eitan
53c98e45cf Geometry Nodes: Add Texture and Material options to switch node
These new socket types can be supported in the switch node
along with the others.

Differential Revision: https://developer.blender.org/D11560
2021-06-10 10:16:37 -05:00
bcefce33f2 BLI_mempool: split thread-safe iteration into the private API
Splitting out thread safe iteration logic means regular iteration
isn't checking for the thread-safe pointer each step.

This gives a small but measurable overall performance gain of 2-3%
when redrawing a high-poly mesh.

Ref D11564

Reviewed By: mont29
2021-06-11 00:31:16 +10:00
9df1e0cad5 Fix: Build error with MSVC
rB4f81b4b4ce29 mistakenly left out the changes
to platform_win32.cmake causing a linker error
when WITH_GMP and WITH_TBB_MALLOC_PROXY were on.
2021-06-10 06:50:05 -06:00
aa0bd29546 Docs: remove deprecated parameter from bmesh docs
The perimeter itself was removed but the documentation wasn't updated.

Resolves T89013
2021-06-10 21:32:30 +10:00
1a72ee4cbe Cleanup: move endian values from BKE_global into BLI_endian_defines
This change was prompted by D6408 which moves thumbnail extraction into
a shared function that happens use these endian defines but only links
blenlib.

There is no need for these defines to be associated with globals
so move into their own header.
2021-06-10 21:10:28 +10:00
e4ef8cbf7e Cleanup: add comment 2021-06-10 13:05:57 +02:00
5fa6cdb77a Add unit for time stored in seconds
Allows to define properties which will have proper units displayed
in the interface. The internal storage is expected to be seconds
(which matches how other times are stored in Blender).

Is not immediately used in Blender, but is required for the upcoming
feature in Cycles X (D11526)

The naming does not sound very exciting, but can't think of anything
better either.

For test it probably easiest to define FloatProperty with subdtype
of TIME_ABSOLUTE.

Differential Revision: https://developer.blender.org/D11532
2021-06-10 12:15:59 +02:00
5304c6ed7d DataTransfer: Fix vertices being wrongly added to vgroup.
Previously, a vertex from destination mesh would always be added to all
transferred vgroup (with a 0.0 weight), even if none of its matching
sources in source mesh belonged to the matching source vgroups.

Now a destination vertex is only added to a given destination vgroup if
at least one of its source vertices belong to the matching source
vgroup.

Issue found and initial investigation by @pls in D11524, thanks!
2021-06-10 11:33:53 +02:00
b669fd376a Cleanup: spelling in comments 2021-06-10 17:04:25 +10:00
4d4608363c Cleanup: quiet array-parameter warning from GCC11 2021-06-10 16:51:09 +10:00
7141eb75ef Docs: update oxygen configuration to v1.9.1 2021-06-10 16:34:58 +10:00
b282a065f1 Docs: Add preprocessor define for doxygen
Doxygen by default leaves out any functions inside
#ifdef blocks that it thinks are disabled.

This change adds a DOXYGEN symbol, so you can
still get the functions included in the
documentation even if the #ifdef would
have normally excluded them.

before

#if defined(_WIN32)

after

#if defined(_WIN32) || defined(DOXYGEN)

Patch provided by Campbell Barton on chat.
2021-06-09 18:44:39 -06:00
Erik Abrahamsson
4f81b4b4ce Windows: Use TBBMalloc for GMP
TBBmalloc_proxy already takes care of any allocations
being done from MSVC compiled code, some of the dependencies
like GMP cannot be build with MSVC and we have to use
mingw to build them. mingw however links against the older
msvcrt.dll for its allocation needs, which TBBMallocProxy
does not hook.

GMP has an option to supply your own allocation functions
so we can still manually redirect them to TBBMalloc.

In a test-file with a boolean geometry node, this patch
uses 32s effective CPU time compared to 52s before.

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

Reviewed by Campbell Barton, Ray Molenkamp
2021-06-09 18:34:17 -06:00
a3226bdf3e Fix: Point translate and point scale don't execute on curve data 2021-06-09 16:51:07 -05:00
Christoph Lendenfeld
d96e9de9de Fix T88546: Pose slider typed input not working
Remove an unnecessary call to pose_slide_mouse_update_percentage
That call was overriding the typed value

Reviewed By: #animation_rigging, Sybren A. Stüvel

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

Ref D11395
2021-06-09 22:31:10 +01:00
93fd07e19c Geometry Nodes: Copy spline attributes in the curve resample node
Previously only point domain attributes were copied to the result curve.
2021-06-09 15:54:26 -05:00
5f19646d7e Fix T88799: 3DViewport Stats Column Measurements
To draw the overlay stats in columns the strings must be measured to
find the longest one. In some circumstances this measurement can be
incorrect. We draw the text with a specific size yet do not explicitly
set the size before calling BLF_size. This patch properly sets the size
so that the measurement will match what will be used for output.

See T88799 for examples of measurement failure.

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

Reviewed by Hans Goudey
2021-06-09 13:39:08 -07:00
675677ec67 Splines: Add API functions for interpolating data
First, expand on the interpolation to evaluated points with a templated
helper function, and a function that takes a GSPan. Next, add a set of
functions to `Spline` for interpolating at arbitrary intervals between
the evaluated points. The code for doing that isn't that complicated
anyway, but it's nice to avoid repeating, and it might make it easier
to unroll the special cases for the first and last points if we require
the index factors to be sorted.
2021-06-09 14:53:39 -05:00
Henrik Dick
df2a19eac7 Geometry Nodes: Add Convex Hull Node
This commit adds a node to output the convex hull of any input geometry
as a mesh, which is an enclosing geometry around a set of points.
All geometry types are supported, besides volumes.

The code supports operating on instances to avoid copying all input
geometry before the operation. The implementation uses the same backend
as the operation in edit mode, but uses Mesh directly instead of BMesh.

Attribute transfer is not supported currently, but would be a point of
improvement for the future if it can work in a predictable way on
different geometry input types.

Differential Revision: https://developer.blender.org/D10925
2021-06-09 11:58:08 -05:00
2856f3b583 Fix T88974: Add missing liboverrides to GP modifiers and shaderfx.
Proper RNA code was simply never added for those...
2021-06-09 18:48:55 +02:00
965bd53e02 Cleanup: use doxy sections for task_iterator.c 2021-06-10 02:22:46 +10:00
05f15645ec Cleanup: missing NULL check in assert 2021-06-10 02:22:46 +10:00
cb0cab48ef Cleanup: redundant/unused assignments 2021-06-10 02:22:46 +10:00
029fb002dd Cleanup: replace 'else if' with 'else' 2021-06-10 02:22:46 +10:00
4443c4082e Cleanup: remove redundant checks which have already been tested
Note that these changes are limited simple cases as these kinds of
changes could allow for errors when refactoring code when the known
state is not so obvious.
2021-06-10 02:22:45 +10:00
bda8887e0c Cleanup: simplify grease pencil preset set logic 2021-06-10 02:22:45 +10:00
5575aba025 Cleanup: simplify grease pencil type checks 2021-06-10 02:22:45 +10:00
25d8ce16b5 Cleanup: spelling in comments 2021-06-10 02:22:45 +10:00
59553d47c0 Cleanup: quiet array-parameter warning 2021-06-10 02:22:45 +10:00
84af1eaa92 Fix invalid return value assignment in getEdgeVertexIndices 2021-06-10 02:22:45 +10:00
059f19d821 Fix uninitialized variable in task.MempoolIterTLS test
Error in 14f3b2cdad.
2021-06-10 02:21:59 +10:00
0f156a2436 LineArt: Camera marker update fix.
The original fix was probably flushed by some newer
line art commits. Fixed.

See https://developer.blender.org/T88464
2021-06-10 00:14:34 +08:00
f42a501c61 Revert "GPencil: Add custom normal entry to bGPDspoint."
This reverts commit f546b0800b.
2021-06-10 00:11:14 +08:00
d8b8b4d7e2 BMesh: multi-thread face tessellation
Use BM_iter_parallel for face tessellation, this gives around
6.5x speedup for BM_mesh_calc_tessellation on high poly meshes in my
tests, although exact speedup depends on available cores.
2021-06-10 01:19:58 +10:00
14f3b2cdad BLI_task: add TLS support to BLI_task_parallel_mempool
Support thread local storage for BLI_task_parallel_mempool,
as well as support for the reduce and free callbacks.

mempool_iter_threadsafe_* functions have been moved into a private
header thats only shared between task_iterator.c and BLI_mempool.c
so the TLS can be made part of the iterator array without having to
rely on passing in struct offsets.

Add test task.MempoolIterTLS that ensures reduce and free
are working as expected.

Reviewed By: mont29

Ref D11548
2021-06-10 00:55:04 +10:00
f546b0800b GPencil: Add custom normal entry to bGPDspoint.
Also modified existing utility functions to take
care of the new surface normal interpolation and so on.

Reviewed By: Antonio Vazquez (antoniov)

Differential Revision: https://developer.blender.org/D11543
2021-06-09 22:46:08 +08:00
92ae3ff84c Fix assigning material to linked object being forbidden in BKE.
While this should not be allowed in general, there are some cases
(library overrides at least) where supporting this is mandatory.

Further more, comment stating that this could crash is from 2011, could
not reproduce any issue with current code. Commit comment was referring
to undo/redo, but in use cases here those should not affect things.

Note that in general, such relatively high-level checks should be
handled by high-level, close to user code (like in ED area e.g.), not in
low-level BKE code anyway.
2021-06-09 16:33:34 +02:00
5954b351f0 Cleanup: Removed unused definition. 2021-06-09 16:31:28 +02:00
33c4eefabb Cleanup: Comment formatting 2021-06-09 09:28:23 -05:00
Jeroen Bakker
6e999e08ab T88352: Use threaded ibo.tris extraction for single material meshes.
This patch adds a specific extraction method when the mesh has only
one material. This method is multi-threaded.

There is a trade-off in this patch as the ibo isn't compressed (it adds
restart indexes for hidden faces). So it depends if threading is faster
than the additional GPU buffer upload.

# Subdivided cube
I used a cube subdivided 7 times, modifiers applied. that gives around 400000 faces.

The test is selecting some vertices and move them. During this test the next buffers are updated on each frame:
* vbo.pos_nor
* vbo.lnor
* vbo.edit_data
* ibo.tris
* ibo.points

System info:
|platform| Linux-5.11.0-7614-generic-x86_64-with-glibc2.33|
| renderer|      AMD SIENNA_CICHLID (DRM 3.40.0, 5.11.0-7614-generic, LLVM 11.0.1)|
|vendor|         AMD|
|version|        4.6 (Core Profile) Mesa 21.0.1|
|cpu|              Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz|
|compiler|     gcc version 10.3.0|

Timing have been measured using DEBUG_TIME in `draw_cache_extract_mesh`.

master: `rdata 8ms iter 45ms (frame 153ms)`
this patch `rdata 6ms iter 36ms (frame 132ms)`

Reviewed By: mano-wii

Maniphest Tasks: T88352

Differential Revision: https://developer.blender.org/D11290
2021-06-09 16:20:53 +02:00
ec98bb318b UI: Add the option to not display some socket labels
This commit adds a flag to disable displaying some socket labels which
just redundant eye sores. We still want to have a label, because that
information can potentially be accessed elsewhere in the UI.

The flag is used in a few geometry nodes.

Differential Revision: https://developer.blender.org/D11540
2021-06-09 09:13:09 -05:00
3a7ab62eac Fix T88885: Circle select deselects first selections after moving cursor
`is_active_prev` is always set after the first operation.
But this was not the case with `wait_for_input` `false`.
2021-06-09 10:59:33 -03:00
1f55e12206 Tests: temporarily increase threshold for OpenImageDenoise test
Until all platforms have the same version, this helps the tests pass.
2021-06-09 15:28:19 +02:00
ea3895558d Fix T88998: GPencil not projecting to the most front surface
It was projecting from the stroke position.

The behavior has changed in {rB5400be9ffee2}.
2021-06-09 09:32:50 -03:00
Germano Cavalcante
e4c6da29b2 Draw Cache: use threading for Mesh extract lines
This is an optimization, but the difference is still not that
significant as some extractions are still done in single thread.

**Benchmarking**
||before:|after:
|---|---|---|
|large_mesh_editing:|Average: 14.246502 FPS|Average: 15.438118 FPS
||rdata 9ms iter 31ms (frame 69ms)|rdata 9ms iter 27ms (frame 65ms)
|large_mesh_editing_ledge: |Average: 14.913622 FPS|Average: 15.856538 FPS
||rdata 9ms iter 30ms (frame 67ms)|rdata 9ms iter 26ms (frame 63ms)
|looptris_test:|Average: 3.970774 FPS|Average: 4.095200 FPS
||rdata 11ms iter 90ms (frame 235ms)|rdata 12ms iter 87ms (frame 229ms)

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D11467
2021-06-09 08:58:08 -03:00
4ced8900f5 Fix T88983: GPencil toggle caps error in python enum
The value for default option was wrong in the python definition.
2021-06-09 12:52:44 +02:00
f087a225dc GPencil: Hide Brush panels for some tools
Some tools don't use brush and the panel must be hidden.

Reviewed By: mendio

Differential Revision: https://developer.blender.org/D11518
2021-06-09 12:52:44 +02:00
dd98f6b55c Fix missing free calls for task iterator
A single threaded task with thread data over 8192 bytes would leak.
While this didn't happen in practice, it could cause issues in the
future.

The free call for `task_parallel_iterator_do` wasn't running
if callbacks weren't set, also not an issue in practice but avoids
potential problems in the future too.
2021-06-09 20:33:40 +10:00
b18a214ecb Fix: Compositor test desintegrate failing on arm64
Changes introduced in commit rBe9f2f17e8518
can create different render results when there is
a Math or Mix operation after TextureOperation
on tiled execution model.
This is due to WriteBufferOperation forcing a single pixel
resolution when these operations use a preferred
resolution of 0 to check if their inputs have resolution.
Fixing this behaviour creates different renders too.

This patch keeps previous tiled implementation and
adds the new implementation only for full frame execution.

Reviewed By: Jeroen Bakker (jbakker)

Differential Revision: https://developer.blender.org/D11546
2021-06-09 11:21:23 +02:00
d7c812f15b Compositor: Refactor recursive methods to iterative
In order to reduce stack size this patch converts full frame 
recursive methods into iterative.
- No functional changes.
- No performance changes.
- Memory peak may slightly vary depending on the tree because
 now breadth-first traversal is used instead of depth-first.

Tests in D11113 have same results except for test1 memory peak:
360MBs instead of 329.50MBs.

Reviewed By: Jeroen Bakker (jbakker)

Differential Revision: https://developer.blender.org/D11515
2021-06-09 11:02:40 +02:00
3ba16afa1e Fix failing test case sequence_transform. 2021-06-09 08:12:04 +02:00
8c3f4f7edf Fix: Incorrect node bezier spline tangent calculation for end points
The code was using the useless dangling handle at each end of the spline
rather than the handle pointing inwards.
2021-06-08 23:52:29 -05:00
307f8c8e76 Fix: Prevent small memory leak in VSE indexer
We need to unref the packet to tell ffmpeg it is ok to free it after
use.
2021-06-08 23:18:31 +02:00
8bd09b1d77 Build: upgrade OpenImageDenoise to 1.4.0
CMake builder and install deps changes, precompiled libraries are still to be
committed.

Ref T88438, T88434

Differential Revision: https://developer.blender.org/D11486
2021-06-08 19:22:59 +02:00
f29a738e23 PyAPI: use keyword only arguments
Use keyword only arguments for the following functions.

- addon_utils.module_bl_info 2nd arg `info_basis`.
- addon_utils.modules 1st `module_cache`, 2nd arg `refresh`.
- addon_utils.modules_refresh 1st arg `module_cache`.
- bl_app_template_utils.activate 1nd arg `template_id`.
- bl_app_template_utils.import_from_id 2nd arg `ignore_not_found`.
- bl_app_template_utils.import_from_path 2nd arg `ignore_not_found`.
- bl_keymap_utils.keymap_from_toolbar.generate 2nd & 3rd args `use_fallback_keys` & `use_reset`.
- bl_keymap_utils.platform_helpers.keyconfig_data_oskey_from_ctrl 2nd arg `filter_fn`.
- bl_ui_utils.bug_report_url.url_prefill_from_blender 1st arg `addon_info`.
- bmesh.types.BMFace.copy 1st & 2nd args `verts`, `edges`.
- bmesh.types.BMesh.calc_volume 1st arg `signed`.
- bmesh.types.BMesh.from_mesh 2nd..4th args `face_normals`, `use_shape_key`, `shape_key_index`.
- bmesh.types.BMesh.from_object 3rd & 4th args `cage`, `face_normals`.
- bmesh.types.BMesh.transform 2nd arg `filter`.
- bmesh.types.BMesh.update_edit_mesh 2nd & 3rd args `loop_triangles`, `destructive`.
- bmesh.types.{BMVertSeq,BMEdgeSeq,BMFaceSeq}.sort 1st & 2nd arg `key`, `reverse`.
- bmesh.utils.face_split 4th..6th args `coords`, `use_exist`, `example`.
- bpy.data.libraries.load 2nd..4th args `link`, `relative`, `assets_only`.
- bpy.data.user_map 1st..3rd args `subset`, `key_types, `value_types`.
- bpy.msgbus.subscribe_rna 5th arg `options`.
- bpy.path.abspath 2nd & 3rd args `start` & `library`.
- bpy.path.clean_name 2nd arg `replace`.
- bpy.path.ensure_ext 3rd arg `case_sensitive`.
- bpy.path.module_names 2nd arg `recursive`.
- bpy.path.relpath 2nd arg `start`.
- bpy.types.EditBone.transform 2nd & 3rd arg `scale`, `roll`.
- bpy.types.Operator.as_keywords 1st arg `ignore`.
- bpy.types.Struct.{keyframe_insert,keyframe_delete} 2nd..5th args `index`, `frame`, `group`, `options`.
- bpy.types.WindowManager.popup_menu 2nd & 3rd arg `title`, `icon`.
- bpy.types.WindowManager.popup_menu_pie 3rd & 4th arg `title`, `icon`.
- bpy.utils.app_template_paths 1st arg `subdir`.
- bpy.utils.app_template_paths 1st arg `subdir`.
- bpy.utils.blend_paths 1st..3rd args `absolute`, `packed`, `local`.
- bpy.utils.execfile 2nd arg `mod`.
- bpy.utils.keyconfig_set 2nd arg `report`.
- bpy.utils.load_scripts 1st & 2nd `reload_scripts` & `refresh_scripts`.
- bpy.utils.preset_find 3rd & 4th args `display_name`, `ext`.
- bpy.utils.resource_path 2nd & 3rd arg `major`, `minor`.
- bpy.utils.script_paths 1st..4th args `subdir`, `user_pref`, `check_all`, `use_user`.
- bpy.utils.smpte_from_frame 2nd & 3rd args `fps`, `fps_base`.
- bpy.utils.smpte_from_seconds 2nd & 3rd args `fps`, `fps_base`.
- bpy.utils.system_resource 2nd arg `subdir`.
- bpy.utils.time_from_frame 2nd & 3rd args `fps`, `fps_base`.
- bpy.utils.time_to_frame 2nd & 3rd args `fps`, `fps_base`.
- bpy.utils.units.to_string 4th..6th `precision`, `split_unit`, `compatible_unit`.
- bpy.utils.units.to_value 4th arg `str_ref_unit`.
- bpy.utils.user_resource 2nd & 3rd args `subdir`, `create`
- bpy_extras.view3d_utils.location_3d_to_region_2d 4th arg `default`.
- bpy_extras.view3d_utils.region_2d_to_origin_3d 4th arg `clamp`.
- gpu.offscreen.unbind 1st arg `restore`.
- gpu_extras.batch.batch_for_shader 4th arg `indices`.
- gpu_extras.batch.presets.draw_circle_2d 4th arg `segments`.
- gpu_extras.presets.draw_circle_2d 4th arg `segments`.
- imbuf.types.ImBuf.resize 2nd arg `resize`.
- imbuf.write 2nd arg `filepath`.
- mathutils.kdtree.KDTree.find 2nd arg `filter`.
- nodeitems_utils.NodeCategory 3rd & 4th arg `descriptions`, `items`.
- nodeitems_utils.NodeItem 2nd..4th args `label`, `settings`, `poll`.
- nodeitems_utils.NodeItemCustom 1st & 2nd arg `poll`, `draw`.
- rna_prop_ui.draw 5th arg `use_edit`.
- rna_prop_ui.rna_idprop_ui_get 2nd arg `create`.
- rna_prop_ui.rna_idprop_ui_prop_clear 3rd arg `remove`.
- rna_prop_ui.rna_idprop_ui_prop_get 3rd arg `create`.
- rna_xml.xml2rna 2nd arg `root_rna`.
- rna_xml.xml_file_write 4th arg `skip_typemap`.
2021-06-09 03:05:44 +10:00
c18ff180e3 Cleanup: Apply clang-format (make format) 2021-06-08 18:53:39 +02:00
22ee056c3a Geometry Nodes: Rename bounding box mesh output to "Bounding Box"
This was decided by the geometry nodes team, because the
important part of this output is not that it's a mesh.
2021-06-08 11:11:49 -05:00
f5a2d93224 Geometry Nodes: Support curve instances in the bounding box node
Currently curve instances are misleading, since `CurveEval` is created
from scratch from the original `Curve`, but this won't always be true.
2021-06-08 10:51:52 -05:00
a31bd2609f Cleanup: Remove duplicate call to function
Missed in rBa2ebbeb836ae765
2021-06-08 09:55:14 -05:00
Jeroen Bakker
2e19649bb9 Sequencer: Performance image crop transform.
During transforming an image, a matrix multiplication per pixel was done.
The matrix in itself is always linear so it could be replaced by two additions.

During testing in debug builds playing back a movie went from 20fps to
300 fps.

Reviewed By: zeddb

Differential Revision: https://developer.blender.org/D11533
2021-06-08 16:46:57 +02:00
7124c66340 Fix T87703: Failed assert when dragging object data-block into 3D View
Talked with Bastien and we ended up looking into this. Issue is that the
dupliation through drag & drop should also be considered a
"sub-process", like Shift+D duplicating does. Added a comment explaining
why this is needed.
2021-06-08 16:45:34 +02:00
Jeroen Bakker
259b9c73d0 GPU: Thread safe index buffer builders.
Current index builder is designed to be used in a single thread.
This makes all index buffer extractions single threaded.
This patch adds a thread safe solution enabling multithreaded
building of index buffers.

To reduce locking the solution would provide a task/thread local
index buffer builder (called sub builder).
When a thread is finished this thread local index buffer builder
can be joined with the initial index buffer builder.

`GPU_indexbuf_subbuilder_init`: Initialized a sub builder. The
index list is shared between the parent and sub buffer, but the
counters are localized. Ensuring that updating counters would
not need any locking.

`GPU_indexbuf_subbuilder_finish`: merge the information of the
sub builder back to the parent builder. Needs to be invoked outside
the worker thread, or when sure that all worker threads have been
finished. Internal the function is not thread safe.

For testing purposes the extract_points extractor has been migrated to
the new API. Herefore changes to the mesh extractor were needed.

* When creating tasks, the task number of current task is stored in
  ExtractTaskData including the total number of tasks.
* Adding two functions  in `MeshExtract`.
** `task_init` will initialize the task specific userdata.
** `task_finish` should merge back the task specific userdata back.
* adding task_id parameter to the iteration functions so they can
  access the correct task data without any need for locking.

There is no noticeable change in end user performance.

Reviewed By: mano-wii

Differential Revision: https://developer.blender.org/D11499
2021-06-08 16:36:06 +02:00
08b0de45f3 Geometry Nodes: new Select by Material node
This node creates a boolean face attribute that is "true" for
every face that has the given material.

Differential Revision: https://developer.blender.org/D11324
2021-06-08 16:01:54 +02:00
Maxime Casas
2246d456aa Animation: Allow selection of FCurve + its keys
Selection of an FCurve with box/circle select now selects the entire
curve and all its keys:

- Box selecting a curve selects all the keyframes of the curve.
- Ctrl + box selecting of the curve deselects all the keyframes of the
  curve.
- Shift + box selecting of the curve extends the keyframe selection,
  adding all the keyframes of the curves that were just selected to the
  selection.
- In all cases, if the selection area contains a key, nothing is
  performed on the curves themselves (the action only impacts the
  selected keys).

Reviewed By: sybren, #animation_rigging

Differential Revision: https://developer.blender.org/D11181
2021-06-08 15:45:53 +02:00
9553ba1373 Fix compile error with 'WITH_CXX_GUARDEDALLOC'
Seen with msvc
2021-06-08 10:35:04 -03:00
a2ebbeb836 Fix T88934: Crash with line node count input < 0
Some of the primitive nodes can return null in an error condition.
This is confusing mixed with adding a maderial slot in calling
functions. This is the second crash caused by that confusion. It's
simpler to add the slot right when allocating the mesh, and it will
lend itself better to copy & paste coding in the future.

Differential Revision: https://developer.blender.org/D11530
2021-06-08 08:27:13 -05:00
5b014911a5 Revert "Cleanup: use cpp new/delete."
This reverts commit 43464c94f4.
2021-06-08 15:08:09 +02:00
23fd576cf8 Cleanup: replace NULL with nullptr. 2021-06-08 13:14:18 +02:00
43464c94f4 Cleanup: use cpp new/delete. 2021-06-08 13:12:49 +02:00
322a614497 Cleanup: replace typedef structs with structs. 2021-06-08 12:03:06 +02:00
340c535dbf Cleanup: Separate compile unit edituv. 2021-06-08 12:03:06 +02:00
088ea59b7e Cleanup: Separate compile unit lines_adjacency. 2021-06-08 12:03:06 +02:00
cac9828ae3 Cleanup: Separate compile unit lines_paint_mask. 2021-06-08 12:03:06 +02:00
9e9d45ae16 Cleanup: Separate fdots extraction in own compile unit. 2021-06-08 12:03:06 +02:00
89d0cc3a0c Fix T88719: Attribute Remove node input field does nothing
An unlinked multi-input socket was not handled correctly.
2021-06-08 11:51:45 +02:00
e54a4b355e CMake: Fix FindClang not finding system clang on linux in some cases.
In Debian e.g. Clang is part of LLVM, so we need to also check its root
directory sometimes to find Clang files.
2021-06-08 11:16:45 +02:00
933c2cffd6 Geometry Nodes: enable multi-threading in evaluator again
This reverts rB223c6e1ead2940a89465ff66765d16ac14a992b7
because T88598 is resolved now.
2021-06-08 10:43:57 +02:00
ed1fc9d96b BLI: support disabling task isolation in task pool
Under some circumstances using task isolation can cause deadlocks.
Previously, our task pool implementation would run all tasks in an
isolated region. Now using task isolation is optional and can be
turned on/off for individual task pools.

Task pools that spawn new tasks recursively should never enable
task isolation. There is a new check that finds these cases at runtime.
Right now this check is disabled, so that this commit is a pure refactor.
It will be enabled in an upcoming commit.

This fixes T88598.

Differential Revision: https://developer.blender.org/D11415
2021-06-08 10:39:33 +02:00
496045fc30 BMesh: simplify normal calculation, resolve partial update error
Simplify vertex normal calculation by moving the main normal
accumulation function to operate on vertices instead of faces.

Using faces had the down side that it needed to zero, accumulate and
normalize the vertex normals in 3 separate passes, accumulating also
needed a spin-lock for thread since the face would write it's normal
to all of it's vertices which could be shared with other faces.

Now a single loop over vertices is performed without locking.
This gives 5-6% speedup calculating all normals.

This also simplifies partial updates, fixing a problem where
all connected faces were being read from when calculating normals.
While this could have been resolved separately,
it's simpler to operate on vertices directly.
2021-06-08 17:13:15 +10:00
f651cc6c4e Cleanup: Silent compile warning in interface_widgets.c. 2021-06-08 08:25:39 +02:00
0efb627bbd Cleanup: Soilent compile warning in curve_bevel.c. 2021-06-08 07:45:53 +02:00
1b07b7a068 LineArt: Threaded Object Loading.
Move BMesh conversion and all loading code into worker.

Reviewed By: Sebastian Parborg (zeddb)

Differential Revision: https://developer.blender.org/D11288
2021-06-08 13:03:37 +08:00
0abce91940 Fix test failure caused by earlier cleanup commit
rB8cbff7093d65 neglected to move the "pre-tesselation" modifier to the
next before calculating the second part of the curve modifier stack.
2021-06-07 22:33:05 -05:00
2e46a8c864 Remove noop code from WM_MOUSEWHEEL processing.
ChildWindowFromPoint retrieves the child of the provided window at a
point. In this case it always returns 0 because HWND_DESKTOP is flag
defined as 0, which is never a valid window handle and is not intended
for use in place of a window handle.

Forwarding of mousewheel events was added in adb08def61, and later
modified to the current unworking state in e9645806f5. Sending mouse
wheel events to the window under the cursor is a system preference and
therefore should not be overridden by Blender, therefore the noop code
has been removed.
2021-06-07 20:15:28 -07:00
ef5a362a5b Improve multires performance.
Added a new api function to stich multires grids
on specific faces in a mesh,
subdiv_ccg_average_faces_boundaries_and_corners,
and changed multires normal calc to use it.

VTune profiling showed that this was a major
performance hit once you get above 10,000 or so
base mesh faces and/or have a high number of
subdivision levels.

Here's a video comparing the difference. Note the
bpy.app_debug switch is not in the final commit.

{F10145323}

And the .blend file:

{F10145346}

Reviewed By: Sergey Sharybin (sergey)

Differential Revision:
https://developer.blender.org/D11334
2021-06-07 15:19:19 -07:00
a6715213c3 Revert "Improve multires performance."
. . .because I accidentally committed
submodule references.

This reverts commit 482465e18a.
2021-06-07 15:16:03 -07:00
482465e18a Improve multires performance.
Added a new api function to stich multires grids
on specific faces in a mesh,
subdiv_ccg_average_faces_boundaries_and_corners,
and changed multires normal calc to use it.

VTune profiling showed that this was a major
performance hit once you get above 10,000 or so
base mesh faces and/or have a high number of
subdivision levels.

Here's a video comparing the difference. Note the
bpy.app_debug switch is not in the final commit.

{F10145323}

And the .blend file:

{F10145346}

Reviewed By: Sergey Sharybin (sergey)

Differential Revision:
https://developer.blender.org/D11334
2021-06-07 15:11:31 -07:00
b0ec1d2747 Cleanup: Order return argument last 2021-06-07 17:04:31 -05:00
1ef33be2d4 UI: Remove property descriptions exactly the same as names
These two descriptions are exactly the same as the property names,
which only wastes people's time when reading tooltips
2021-06-07 16:47:13 -05:00
d2aee304e8 Cleanup: Use const arguments, return by value
Also use Curve as an argument instead of Object, since the object was
only used to retrieve the curve, and the calling code is already working
with curve data.
2021-06-07 13:58:47 -05:00
6e56b42faa Fix T77651: Black screen on Blender startup on ChromeOS
Apparently `textureSize` doesn't work with
`sampler1DArray` on this OS.

Thanks to @dave1853 for finding the source of the
problem.
2021-06-07 15:51:08 -03:00
1c6e338d59 Cleanup: Make function static
This was not used in any other file, and it's not likely to be used
elsewhere in the future anyway.
2021-06-07 13:42:41 -05:00
7313b243f2 Cleanup: Remove outdated/useless comments
Some of the comments referenced code that was no longer there, or even
defines that were removed. Other comments were more confusing and
vague than helpful. Also adjust formatting in a few cases.
2021-06-07 13:29:37 -05:00
1182c26978 Cleanup: Remove unused function, make function private 2021-06-07 13:12:06 -05:00
8cbff7093d Cleanup: Decrease variable scope
Also use const and bool in a few places.
2021-06-07 13:08:03 -05:00
0fcc063fd9 Fix T88801: Positioning of Menu Underlines
This patch improves the positioning of the little mnemonic underlines
shown under some hotkey letters in menus, especially when using custom
fonts.

see D11521 for details and examples.

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

Reviewed by Campbell Barton
2021-06-07 10:56:20 -07:00
1949643ee5 Fix: Wrong logic for checking if we can reuse decoded frame
We should only check if the new pts value lies inside the duration of
the current frame.
2021-06-07 18:16:33 +02:00
7bf9d2c580 Cleanup: use doxy groups for bmesh_mesh_normals.c 2021-06-08 01:19:18 +10:00
4a9c5c60b7 Cleanup: Move extract lines to compile unit. 2021-06-07 16:57:21 +02:00
0e285fa23c Cleanup: Move extract tris in own compile unit. 2021-06-07 16:55:09 +02:00
214a78a46f Revert most of rB93a865dde775e.
This revert went too far, only one line (the minimal version of FFMPEG
for `install_deps.sh` script`) actually needed to be reverted...

Sorry for the noise.
2021-06-07 16:54:02 +02:00
f87f8532c3 Cleanup: split bmesh normal calculation into separate files 2021-06-08 00:50:25 +10:00
3da0b52c97 Cleanup: compiler warnings signed/unsigned mismatch 2021-06-08 00:50:25 +10:00
785a518ebe Cleanup: silence warnings 2021-06-07 11:30:25 -03:00
2bf56f7fbb Fix: do not use threading for 'extract_points'
`extract_points` doesn't support multithreading yet.
2021-06-07 11:30:17 -03:00
93a865dde7 Revert "Bump FFmpeg version from 4.2.3 to 4.4"
This reverts commit 95690dd362.

Such high version restriction is no more needed after rB9225fe933ae990.

Missing bit in https://developer.blender.org/D11417.
2021-06-07 16:25:34 +02:00
72d2355af5 Cleanup: remove redundant cast, use const casts 2021-06-08 00:23:09 +10:00
dfac5a63bd Cleanup: remove unused value 2021-06-08 00:09:07 +10:00
c87327ddeb Cleanup: use keyword only argument in bpy.props argument parsing
No functional changes as logic elsewhere already ensured this.

This just makes it obvious to anyone reading over the code that
these arguments are keyword only.
2021-06-08 00:07:19 +10:00
7ca5ba14b5 Cleanup: use keywords for unit tests
Prepare for function calls to be keyword only.
2021-06-08 00:07:19 +10:00
51bf1680bd Cleanup: quiet warning accessing deprecated attribute in bl_test 2021-06-08 00:07:19 +10:00
91d3a54869 Fix build error, remove duplicate include. 2021-06-07 19:11:36 +05:30
ee0000b8bb LineArt: Shifting fix for different camera fitting.
FOV was expanded to cover the shifting range,
rather than to precisely cut at the image border. Now fixed.

Reviewed By: Sebastian Parborg (zeddb)

Differential Revision: https://developer.blender.org/D11523
2021-06-07 21:07:17 +08:00
7f1d1b03ad Cleanup: Fix uninitialized variable warning 2021-06-07 07:54:49 -05:00
abee9a85d4 Cleanup: renamed function to extract_run_single_threaded. 2021-06-07 13:51:47 +02:00
Germano Cavalcante
223016a408 GPUIndexBuf: Find the minimum and maximum index through the builder
Moving the bounds code to the builder can be useful
for future optimizations like building multithreaded.

Reviewed By: fclem, jbakker

Differential Revision: https://developer.blender.org/D11455
2021-06-07 08:41:38 -03:00
6e6a1838ea Cleanup: Added Guarderalloc deallocators to CPP structs. 2021-06-07 13:34:30 +02:00
1d3ffc93ec Added TODO comment for putting parameters into struct. 2021-06-07 13:31:09 +02:00
e517aaa136 Cleanup: move extract points into own compile unit. 2021-06-07 13:27:38 +02:00
8b8c3c34dd Fix T88900: Crash when setting Edge Weight/Crease
The `recalcData` of "convert_mesh_edge" did more
than it was supposed to.
2021-06-07 07:52:34 -03:00
4f6cab176a Cleanup: remove trailing space from pipeline_config.json
Remove trailing spaces from `pipeline_config.json`

No functional changes.
2021-06-07 11:36:26 +02:00
98876d46ef Fix T88899: __file__ not set for text.as_module() 2021-06-07 14:04:26 +10:00
7ef2b760dc Event Simulate: and a --keep-open command line argument
It can be useful to investigate the state of the file
after event simulation runs.
2021-06-06 23:05:46 +10:00
c27b7df563 Cleanup: unused argument 2021-06-06 23:03:34 +10:00
a496af8680 LineArt: Fix edge clipping index error.
Small bug that's causing edge count to be incorrect in
final culled list, just being offset exactly 1 entry.

Reviewed By: Sebastian Parborg (zeddb)

Differential Revision: https://developer.blender.org/D11513
2021-06-06 11:18:18 +08:00
54ce344bc7 VSE: Remove seq->tmp usage from transform code
This field was used for extend feature to get handle position of
metastrip children. Since D9972 extend feature works only on meta
strip itself, not it's children.
So `SEQ_transform_get_left_handle_frame()` second argument is always
false and can be removed.

Another instance of `seq->tmp usage` is hack to distinguish strips to be
shuffled, which is not covered by this patch.

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D10321
2021-06-06 03:05:45 +02:00
dbfde0fe70 Exact Boolean: fix last commit: pass an arg by reference instead of value. 2021-06-05 14:17:15 -07:00
8e43ef5f31 Exact Boolean: speed up when there are many separate components.
Use bounding box tests quickly tell that two components cannot
have a containment relation between each other. This change
cut about 0.6s off a test with 25 big icospheres.
2021-06-05 11:31:08 -07:00
edaaa2afdd Limit Rotation: explicitly orthogonalize the matrix before processing.
Add a call to orthogonalize the matrix before processing for the
same reasons as D8915, and an early exit in case no limits are
enabled for a bit of extra efficiency.

Since the constraint goes through Euler decomposition, it would
in fact remove shear even before this change, but the resulting
rotation won't make much sense.

This change allows using the constraint without any enabled limits
purely for the purpose of efficiently removing shear.

Differential Revision: https://developer.blender.org/D9626
2021-06-05 16:29:46 +03:00
d2dc452333 Limit Rotation: add an Euler Order option.
Since Limit Rotation is based on Euler decomposition, it should allow
specifying the order to use for the same reasons as Copy Rotation does,
namely, if the bone uses Quaternion rotation for its animation channels,
there is no way to choose the order for the constraint.

Ref D9626
2021-06-05 16:29:46 +03:00
2cd1bc3aa7 Fix T88859: Assert when changing view modes
The `loose_lines`' ibo was not being initialized.
2021-06-05 09:49:48 -03:00
1a912462f4 BMesh: avoid extra faces-of-edges loop building partial update data 2021-06-05 21:33:15 +10:00
bcf9c73cbc Fix assert check in BLI_polyfill_beautify 2021-06-05 17:16:37 +10:00
3c9c557580 Fix assert in gpencil_batches_ensure 2021-06-05 17:13:12 +10:00
c7fee64dea Cleanup: use ternary operator for icon argument 2021-06-05 17:05:11 +10:00
ca3891e83b Fix T88828: View/Navigation(Walk/Fly) disappeared from keymap
This was unintentionally removed in
f92f5d1ac6.
2021-06-05 15:06:48 +10:00
a5114bfb85 Cleanup: indentation 2021-06-05 15:06:47 +10:00
022f8b552d Cleanup: spelling in comments
Also remove reference to function that never existed for adding `bNode`.
2021-06-05 15:03:59 +10:00
14508ef100 FFmpeg: Fix seeking not returning the correct frame when not using TC index
Fixed the logic for seeking in ffmpeg video files.
The main fix is that we now apply a small offset in ffmpeg_get_seek_pos
to make sure we don't get the frame in front of the seek position when
seeking backward.

The rest of the changes is general cleanup and untangling code.

Reviewed By: Richard Antalik

Differential Revision: http://developer.blender.org/D11492
2021-06-05 02:48:09 +02:00
bfaf09b5bc Fix T88813: Scalable allocator not used on win10
Due to the way we ship the CRT on windows TBB's
malloc proxy was unable to attach it self to
the memory management functions on windows 10.

This change moves ucrtbase.dll out of the blender.crt
folder and back into the main blender folder to side
step some undesirable behaviour on win10 making TBB
once more able to attach it self.

Having this work again, should give a speed
boost in memory allocation heavy workloads
such as mantaflow.

For details on how this only failed on Win10
see T88813
2021-06-04 17:22:31 -06:00
c2fa36999f Edit Mesh: partial updates for normal and face tessellation
This patch exposes functionality for performing partial mesh updates
for normal calculation and face tessellation while transforming a mesh.

The partial update data only needs to be generated once,
afterwards the cached connectivity information can be reused
(with the exception of changing proportional editing radius).

Currently this is only used for transform, in the future it could be
used for other operators as well as the transform panel.

The best-case overall speedup while transforming geometry is about
1.45x since the time to update a small number of normals and faces is
negligible.

For an additional speedup partial face tessellation is multi-threaded,
this gives ~15x speedup on my system (timing tessellation alone).
Exact results depend on the number of CPU cores available.

Ref D11494

Reviewed By: mano-wii
2021-06-05 08:35:31 +10:00
Charlie Jolly
00073651d4 Nodes: Add Multiply Add to Vector Math nodes
Cycles, Eevee, OSL, Geo, Attribute

This operator provides consistency with the standard math node. Allows users to use a single node instead of two nodes for this common operation.

Reviewed By: HooglyBoogly, brecht

Differential Revision: https://developer.blender.org/D10808
2021-06-04 16:59:28 +01:00
eb030204f1 windows/deps: Fix TBB build issues.
rB847579b42250 updated the TBB build script
which had some unintended consequences for
windows as the directory layout slightly
changed.

This change adjusts the builder to the new
structure, there are no version/functional
changes.
2021-06-04 09:16:03 -06:00
Philipp Oeser
56005ef499 Texture Paint: changing paint slots and viewport could go out of sync
When changing to another texture paint slot, the texture displayed in
the viewport should change accordingly (as well as the image displayed
in the Image Editor).

The procedure to find the texture to display in the viewport
(BKE_texpaint_slot_material_find_node) could fail
though because it assumed iterating nodes would always happen in the
same order (it was index based). This is not the case though, nodes can
get sorted differently based on selection (see ED_node_sort).

Now check the actual image being referenced in the paint slot for
comparison.

ref T88788 (probably enough to call this a fix, the other issue(s)
mentioned in the report are more likely a feature request)

Reviewed By: mano-wii

Maniphest Tasks: T88788

Differential Revision: https://developer.blender.org/D11496
2021-06-04 16:02:02 +02:00
b6d6d8a1aa LibOverride: Fix early break in some of the resync code.
This `break` moved out of its braces at some point in the previous
fixes/refctors... :(
2021-06-04 15:54:07 +02:00
0037e08b06 GPencil: Change Fill Boundary icon
The icon has been changed to `eye` because is more consistent with other areas.
2021-06-04 12:44:34 +02:00
b6b20c4d92 GPencil: Change Fill extend lines icon
The icon has been changed to `eye` because is more consistent with other areas.
2021-06-04 12:44:34 +02:00
Fynn Grotehans
d486ee2dbd Update Camera presets
The (tracking) camera presets have not been updated in the last 7 or
more years, so they are very outdated. I found it pointless to have a
few specific camera models in the list and instead add the most commonly
used sensor sizes/film sizes. This way the list is shorter, easier to
maintain/becomes later outdated, and is more user friendly for most people
who don't own any of the specific cameras. I added the Crop Factor to the
Beginning of the name, so it gets sortet in the correct order and presets
are easier to find based on the size.

Reviewed By: #render_cycles, #motion_tracking, brecht, sergey

Differential Revision: https://developer.blender.org/D10739
2021-06-04 12:19:58 +02:00
9ba6b64efa Greasepencil: show pressure curve widgets in the sidebar
These were only showing in the Properties Editor, but there is no reason
to have the panels be different in the sidebar (they should not show in
the top bar though).

agreed upon by both @anoniov and @mendio

ref T88787
2021-06-04 12:17:33 +02:00
e4ca6b93ad BlenLoad: Ensure linked IDs are properly sorted.
So far, linked IDs were not properly sorted at all, only the ones
explicitely linked from WM code would be, but any indirectly linked
data-blocks would end up in some random order in their lists.

While not ideal, this is not a huge issue in itself, but it had bad
side-effects, e.g. causing (recursive) resync of overrides to happen in
random order, leading to mismatches between name indices of newly-generated
override IDs and the one existings e.g.

And in general, it is much better to be consistent here.

Note that the file sub-version is bumped for this commit, since some
sorting (the directly linked IDs which we keep a reference to) should
never need to be re-done after relevant doversion process.
2021-06-04 12:09:05 +02:00
77d7cae266 GPencil: Cleanup unneeded variable assign
The variable is assigned below again and the initial value is not used.
2021-06-04 10:44:01 +02:00
f4e0a19d4f Fix T88803: GPencil Thickness modifier produces thicker lines
There was a double apply of the thickness due a bug in the fading new parameter.

Differential Revision: https://developer.blender.org/D11483
2021-06-04 10:34:05 +02:00
053082e9d8 Math: Added max_uu/min_uu variations. 2021-06-04 09:14:15 +02:00
Johnny Matthews
ddd4b2b785 Geometry Nodes: Curve Length Node
This commit adds a node that outputs the total length of all
evalauted curve splines in a geometry set as a float value.

Differential Revision: https://developer.blender.org/D11459
2021-06-03 19:12:38 -04:00
e5a1cadb2f Geometry Nodes: Support curve data in the geometry delete node
This commit implements support for deleting curve data in the geometry
delete node. Spline domain and point domain attributes are supported.

Differential Revision: https://developer.blender.org/D11464
2021-06-03 18:33:37 -04:00
c18675b12c Cleanup: Add comment explaining assert
This triggers fairly often during development, so it might save some
frustration at some point to have a comment here.
2021-06-03 18:06:31 -04:00
dba3fb9e09 Overlay: Flash on Mode Transfer overlay
This implements T87633

This overlay renders a flash animation on the target object when
transfering the mode to it using the mode transfer operator.
This provides visual feedback when switching between objects without
extra overlays that affect the general color and lighting in the scene.

Differences with the design task:

- This uses just a fade out animation instead of a fade in/out animation.
The code is ready for fade in/out, but as the rest of the overlays
(face sets, masks...) change instantly without animation, having a fade
in/out effect gives the impression that the object flashes twice (once
for the face sets, twice for the peak alpha of the flash animation).

- The rendering uses a flat color without fresnel for now, but this can
be improved in the future to make it look more like the shader in the
prototype.

- Not enabled by default (can be enabled in the overlays panel), maybe
the defaults can change for 3.0 to disable fade inactive and enable this
instead.

Reviewed By: jbakker, JulienKaspar

Differential Revision: https://developer.blender.org/D11055
2021-06-03 20:17:17 +02:00
3e695a27cd VSE: Add refresh_all operator to all sequencer regions
This operator is needed in some cases to update image preview.
In workspaces with smaller timelines this is limiting, because users
need to first check that mouse cursor is in correct place, then press
CTRL+R shortcut.
2021-06-03 19:58:36 +02:00
a1063fc6c2 VSE: Remove JPEG reference from proxy panel
Proxies doesn't use MJPEG codec anymore, but text still referenced it.
2021-06-03 19:44:00 +02:00
b414322f26 GHOST/wayland: fix restoring hidden cursor 2021-06-03 18:18:27 +01:00
899eefd1bb GHOST/wayland: fix non-moving normal cursor 2021-06-03 18:18:27 +01:00
72607feb91 GHOST/wayland: add 'xdg-decoration' support 2021-06-03 18:18:27 +01:00
870bcf6e1a GHOST/wayland: adapt window and cursor surface scale to support HiDPI screens 2021-06-03 18:18:27 +01:00
8b78510fc4 GHOST/wayland: handle return values for data sources 2021-06-03 18:18:27 +01:00
e0bc5c4087 GHOST/wayland: set parent relation only for dialogs to mimic X11 behaviour 2021-06-03 18:18:27 +01:00
1fd653dd82 GHOST/wayland: handle missing relative-pointer and pointer-constraints support 2021-06-03 18:18:27 +01:00
d9aae38bc8 GHOST/wayland: get cursor settings via D-Bus 2021-06-03 18:18:27 +01:00
efad9bcdda GHOST/wayland: inhibit warning 2021-06-03 18:18:27 +01:00
b5d7fb813f cmake: use absolute path for Wayland libraries 2021-06-03 18:18:27 +01:00
bb16f96973 GHOST/wayland: set swap interval to 0
The Wayland server will not update hidden surfaces. This will block the
main event loop and thus also block updates to visible windows in a multi-
window setup.
2021-06-03 18:18:27 +01:00
7197017ea9 WM: only use the tablet drag threshold for mouse button events
Keyboard click-drag events now use the "Drag Threshold".
This resolves a problem where keyboard click drag events
used a much smaller threshold when using a tablet.
2021-06-04 01:18:23 +10:00
ed6fd01ba9 LibOverride: fix previous commit (rB826bed4349fa). 2021-06-03 16:44:20 +02:00
826bed4349 LibOverride: Fix some fail cases with auto-resync.
In some cases e.g. only objects would actually need resync, so
collections on the override character would not be resynced, and if some
objects were sharing relationships with others those could be
lost/destroyed.
2021-06-03 16:12:26 +02:00
797f6e1483 Fix missing updates in RNA override create functions. 2021-06-03 15:44:23 +02:00
e011e4ce76 LibOverride: Add override_hierarchy_createto ID's RNA API. 2021-06-03 15:00:50 +02:00
92f8a6ac21 Fix T88762: UI using tab to enter next button could clamp the hard min/
max unneccessarily

Since rB298d5eb66916 [which was needed to update buttons with custom
property range functions correctly], using tab would always clamp
(hardmin/hardmax) properties which were using FLT_MAX / INT_MAX as range
in their property definitions.

The clamping of rB298d5eb66916 was copied over from rB9b7f44ceb56c
[where it was used for the softmin/softmax], and while the re-evaluation
of hardmin/hardmax is needed for custom property range functions, the
clamping should actually not take place.

There are many properties using FLT_MAX / INT_MAX etc. and while it
probably would be good to update these with ranges that make more sense
-- not using FLT_MAX / INT_MAX would not have done the clamping here --
there should not be an arbitrary limit to these and they should stay as
they are.

Maniphest Tasks: T88762

Differential Revision: https://developer.blender.org/D11473
2021-06-03 14:16:53 +02:00
7b8d812277 Cleanup: make format 2021-06-03 13:33:09 +02:00
2ae4e860f6 LibOverride: ensure proper indirect tag for 'virtual' linked IDs.
Ensure 'virtual' linked override IDs generated by the recursive resync
process are tagged as indirectly linked data.

This is needed to avoid the 'missing data' messages on those virtual
data-blocks after saving and reloading.
2021-06-03 10:27:05 +02:00
2ef192a55b IDManagement: Collection: Fix several issues in relationships building code.
`BKE_main_collections_parent_relations_rebuild`,
`BKE_collection_parent_relations_rebuild` anf their internal
dependencies had two issues fixed by this commit:

* Main one was that a same collection could be processed several times,
  sometimes even in an infinite loop (in some rare corner cases), by
  `collection_parents_rebuild_recursive`.
* More exotic, code here would not ensure that the collections it was
  processing were actually in Main (or a master one from a scene in
  Main), which became an issue with some advanced ID management
  processes involving partially out-of-main remapping, like liboverride
  resync.
2021-06-03 10:27:05 +02:00
a51f8f94d5 Cleanup: use ascii characters instead of unicode where possible
Follow own code style docs.
2021-06-03 11:32:53 +10:00
17f72be3cb Cleanup: spelling in comments, correct outdated comments 2021-06-03 10:47:02 +10:00
2a868d277e Cleanup: use doxy sections for node_relationships.cc 2021-06-03 10:35:46 +10:00
b60a72eaab Fix invalid return values from file_execute
Error in 6c8c30d865
2021-06-03 10:23:40 +10:00
2dcb6782e0 Draw Mesh Extractor: Fix used thread count
Some threads were always idle because of this.
2021-06-02 18:05:58 -03:00
4d64de2853 Cleanup: Remove unused 'ExtractTaskData's members 2021-06-02 17:55:25 -03:00
5af7225816 Cleanup: Fix build warnings 2021-06-02 21:52:36 +02:00
925df8ef26 VSE: Add strip-time intersection test function
Use SEQ_time_strip_intersects_frame function to test if strip intersects with frame.

Note: There are cases where this function should not be used. For example splitting
strips require at least 1 frame "inside" strip. Another example is drawing, where
playhead technically doesn't intersect strip, but it is rendered, because current
frame has "duration" or "thickness" of 1 frame.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D11320
2021-06-02 21:41:38 +02:00
2ee575fc1f Cleanup: Strip duplication code
Remove unused flag `SEQ_DUPE_ANIM` and code used by this flag.
Remove flag `SEQ_DUPE_CONTEXT` and refactor code, to split operator
logic from duplication code.
Reduce indentation level in for loop.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D11318
2021-06-02 21:41:17 +02:00
1f55786791 Fix T57397: Movies are blurred after sws_scale
Images with 4:2:2 and 4:4:4 chroma subsampling were blurred when
`SWS_FAST_BILINEAR` interpolation is set for `anim->img_convert_ctx`.

Use `SWS_BILINEAR` interpolation for all movies, as performance is
not impacted by this change.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D11457
2021-06-02 21:29:38 +02:00
a9dfde7b49 FFmpeg: Update proxy settings
Changes in rBce649c73446e, affected established proxy codec preset.
Presets were not working and all presets were similar to `veryfast`.
Tunes are now working too, so `fastdecode` tune can be used. I have
measured little improvement, but I tested this only on 2 machines and
I have been informed that `fastdecode` tune does influence decoding
performance for some users.

Change preset from `slow` to `veryfast` and add tune `fastdecode`

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D11454
2021-06-02 21:25:37 +02:00
0ea0ccc4ff FFmpeg: Fix H264 lossless render not lossless
While encoder parameters for lossless encoding are set correctly,
output is not lossless due to pixel format being set to
`AV_PIX_FMT_YUV420P` which is inherently lossy due to chroma subsampling.

This was reported in T61569 and was merged to T57397, but there were
2 bugs - one for encoding and one for decoding.

Set pixel format to `AV_PIX_FMT_YUV444P` when rendering lossless H264
files. This format isn't available in `codec->pix_fmts[0]` and it looks,
that it has to be hard-coded.

Reviewed By: sergey

Differential Revision: D11458
2021-06-02 21:24:09 +02:00
81366b7d2c Boolean exact: speedup by parallelizing a plane calculation.
This patch is from erik85, who says:
This patch makes populate_plane inside polymesh_from_trimesh_with_dissolve run in parallel.
On a test file with a boolean between two subdivided cubes (~6 million verts) this gives a 10% speed increase (49.5s to 45s) on my 6 core CPU.

Also there is an optimization of other_tri_if_manifold to skip the contains-call and get the pointer directly.
This reduces CPU time for find_patches from 5s to 2.2s on the same test file.
2021-06-02 12:08:46 -07:00
dc960a81d1 Boolean exact: speedup when there are many components.
When there are many components (separate pieces of connected mesh),
a part of the algorithm to determine component containment was slow.
Using a float version of finding the nearest point on a triangle
as a prefilter sped this up enormously. A case of 25 icospheres
subdivided twice goes 11 seconds faster on my Macbook pro with this
change.
2021-06-02 11:18:00 -07:00
4f8edc8e7f Nodes: move some files to C++
This just moves a couple of files in `space_node` to C++ and fixes
related errors.

The goal is to be able to use C++ data structures to simplify the code.

Differential Revision: https://developer.blender.org/D11451
2021-06-02 17:20:46 +02:00
b8ae30e9e3 Cleanup: unused variable 2021-06-03 01:12:00 +10:00
ae28ceb9d8 Fix swapped x/y in event simulation script
Incorrect area center calculation, also correct comments.
2021-06-03 01:11:47 +10:00
05b685989b Fix T88732: Curve to mesh node crash with empty input curve
The mesh to curve node generated an empty curve because no edges were
selected. This commit changes that node to not add a curve in that case.

This also changes the curve to mesh node to not add a material when
no mesh was created. Even though we don't expect null curves or meshes
in this case, the change is harmless.
2021-06-02 11:11:34 -04:00
7654203cc8 EEVEE: AOVs not same as cycles.
EEVEE uses hashing to sync aov names and types with the gpu.
For the type a hashed value was overridden making `decalA`
and `decalB` choose the same hash. This patches fixes this
by removing the most significant bit.
2021-06-02 16:58:36 +02:00
2489f72d79 Revert "EEVEE: AOVs not same as cycles."
This reverts commit 730a46e87d.
2021-06-02 16:56:10 +02:00
730a46e87d EEVEE: AOVs not same as cycles.
EEVEE uses hashing to sync aov names and types with the gpu. For the type a hashed value was overridden making `decalA` and `decalB` choose the same hash. This patches fixes this by removing the most significant bit.
2021-06-02 16:54:01 +02:00
f944121700 GPencil: New operator to Normalize strokes
Sometimes is required to reset the thickness or the opacity of the strokes. Actually this was done using a modifier, but this operators solves this.

Reviewed By: mendio, filedescriptor

Maniphest Tasks: T87427

Differential Revision: https://developer.blender.org/D11453
2021-06-02 16:43:37 +02:00
21de669141 Splines: Function to copy spline settings without data
Often you need to copy a spline to do an operation, but don't want
to manually copy over all of the settings. I've already forgotten to
do it once anyway. These functions copy a spline's "settings" into a
new spline, but not the data. I tried to avoid duplicating any copying
so this is easier to extend in the future.

Differential Revision: https://developer.blender.org/D11463
2021-06-02 09:11:35 -04:00
5b176b66da LineArt: Tolerance for faces perpendicular to view
This is due to cam->obmat precision issue,
where it affects view vector precision.

Reviewed by Sebastian Parborg (zeddb)

Differential Revision: https://developer.blender.org/D11461
2021-06-02 20:55:54 +08:00
a55b73417f Cleanup: Correct comments
This corrects an outdated comment in the vector header and a typo
in the index mask header.
2021-06-02 08:28:46 -04:00
ea6d099082 Cleanup: Clang format 2021-06-02 08:27:53 -04:00
34f99bc6be Geometry Nodes: Allow reading converted attribute directly from spline
Often it would be beneficial to avoid the virtual array implementation
in `geometry_component_curve.cc` that flattens an attribute for every
spline and instead read an attribute separately for every input spline.
This commit implements functions to do that.

The downside is some code duplication-- we now have two places handling
this conversion. However, we can head in this general direction for the
attribute API anyway and support accessing attributes in smaller
contiguous chunks where necessary.

No functional changes in this commit.

Differential Revision: https://developer.blender.org/D11456
2021-06-02 08:24:42 -04:00
6cd64f8caa Add workaround for gcc 11 compiler bug
Differential Revision: https://developer.blender.org/D11462
2021-06-02 14:13:55 +02:00
f92f5d1ac6 Keymap: use D-Key for view-pie menu
Use the D-key to access the view menu instead of the Tilda key,
which isn't accessible on some international layouts.

To resolve the conflicts the following changes have been made.

- `D` (motion) opens the view menu.
- `D` (mouse-button) uses grease-pencil (as it does currently).
- `Tilda` is used to for "Object Mode Transfer" instead of the View menu.

See T88092 for details.

Reviewed By: Severin

Ref D11189
2021-06-02 21:34:30 +10:00
69e15eb1e4 Object: support running transfer mode in any object mode
There is no need to limit this to sculpt mode,
prepare for key short cut changes, see: T88092.
2021-06-02 21:29:15 +10:00
facc62d0d5 Docs: 2.93 release description for Linux appdata 2021-06-02 13:22:16 +02:00
46447594de Fix T88567: Cryptomatte only works for the first View Layer.
The view layer was always set to 0. This patch increments it.
2021-06-02 10:05:39 +02:00
507c19c0f7 Docs: formalize naming for generic callbacks in BKE_callbacks.h
Add a doc-string explaining the purpose of each call back and
how they should be used.

Also add a currently unused callback 'POST_FAIL' that is to be used in
cases the action fails - giving script authors, a guarantee that a
call to `pre` will always have a matching `post/post_fail` call.

- D11422: adds a callback that can use 'post_fail'.
- T88696: proposed these conventions.
2021-06-02 17:35:24 +10:00
3b3742c75f Cleanup: trailing commas to avoid right shift
This matches most declarations already in this file.
2021-06-02 17:06:12 +10:00
b5a883fef9 Cleanup: spelling in comments 2021-06-02 17:04:57 +10:00
711ddea60e Fix assert with geometry node output
The previous commit (my own) returned early without providing a value
for the node's output geometry set, which is required.
2021-06-01 23:50:23 -04:00
6b5bbd22d9 Cleanup: Avoid duplicating node input retrieval
Pass the selection name and the invert argument to each component
instead of retrieving them every time.
2021-06-01 17:51:21 -04:00
Wannes Malfait
464797078d Geometry Nodes: Add Delete Geometry Node
This node is similar to the mask modifier, but it deletes the elements
of the geometry corresponding to the selection, which is retrieved as
a boolean attribute. The node currently supports both mesh and point
cloud data. For meshes, which elements are deleted depends on the
domain of the input selection attribute, just like how behavior depends
on the selection mode in mesh edit mode.

In the future this node will support curve data, and ideally volume
data in some way.

Differential Revision: https://developer.blender.org/D10748
2021-06-01 17:32:03 -04:00
3400ba329e VSE: Use own category for metadata panel
Metadata panel was visible in each category. In other editors, this
panel is usually placed in category with other source media properties.
In sequencer, metadata is transfered over while compositing and relation
to particular strip is lost, therefore separate category for metadata
seems to be best option. Since Metadata panel is alone in this category,
it will be open by default.
2021-06-01 23:06:31 +02:00
17b09b509c Geometry Nodes: Skip calculating normals in transform node
This commit skips the eager recalculation of mesh normals in the
transform node. Often another deformation or topology-altering
operation will happen after the transform node, which means the
recalculation was redundant anyway.

In one of my test cases this made the node more than 14x faster.
Though depending on the situation the cost of updating the normals
may just be shifted elsewhere.
2021-06-01 12:03:59 -04:00
5b6e0bad1b Fix T88715: particle size influence texture not working for 'keyed' or 'none' physics types
This was reported for the special case of mapping with "Strand /
Particle" coords, but was not working with other coordinates either.

Dont see a reason for not supporting Size influence textures for these
kinds of particles (and since these types of particles have an "age"
like all others as well, even the "Strand / Particle" coords are
supported here as well)

Maniphest Tasks: T88715

Differential Revision: https://developer.blender.org/D11449
2021-06-01 17:54:20 +02:00
404b946ac0 LibOverride: Fix again infinite loop in resync in some complex/degenerated cases.
Broken in recent refactor of (recursive)resync, reported by studio,
thanks.
2021-06-01 17:37:22 +02:00
6583fb67c6 Geometry Nodes: add empty material slot to new meshes
This fixes T88455 by adding an empty material slot to newly
generated meshes. This allows the object to overwrite the
"default" material without any extra nodes. Technically,
all polygons reference the material index 0 already, so it
makes sense to add a material slot for this material index.

Differential Revision: https://developer.blender.org/D11439
2021-06-01 15:25:01 +02:00
James Monteath
8a63466ca3 BuildBot: Cleanup
Removing scripts that were placed in the source tree that would drive
the old buildbot. With the new buildbot in place these scripts aren't
being used anymore.

The buildbit is currently driven by
`build_files/config/pipeline_config.json`. In the near future make
update would also use this config.

Overview of the new buildbot: https://wiki.blender.org/wiki/Infrastructure/BuildBot

Work done by James Monteath.
2021-06-01 15:18:11 +02:00
6899dcab53 Fix T88658: Force Fields of curve shape can crash if curve has only one point
`bvhtree_from_mesh_edges_create_tree` can actually leave the BVHTree
NULL (e.g. if no edges are present).

Now dont allocate `BVHTreeFromMesh` on the `SurfaceModifierData` at all
in case the tree would be NULL anyways.
Places like `get_effector_data` check for `SurfaceModifierData`-
>`BVHTreeFromMesh` and dont try to stuff like getting a closest point on
surface, which would crash as soon as BVHNodes would need to be accessed
(from the NULL BVHTree).

Maniphest Tasks: T88658

Differential Revision: https://developer.blender.org/D11443
2021-06-01 13:38:29 +02:00
c078540512 Cleanup: remove unused parameter. 2021-06-01 13:18:41 +02:00
6f1af44695 Cleanup: remove unused parameter. 2021-06-01 13:18:41 +02:00
633b70905a Cleanup: NULL->nullptr. 2021-06-01 13:18:41 +02:00
f0d93a71df Cleanup: API for MeshExtractRunTimeData. 2021-06-01 13:18:41 +02:00
98c6626729 DrawManager: Use CPP for Mesh Extraction Scheduling.
More cleanups will come to make this more CPP-like.
2021-06-01 13:18:41 +02:00
4b57bbac22 Cleanup: LibOverride: rename 'local' group tagging functions to 'overrides'.
Since we use them on linked data now as well, 'local' does not fit them
anymore.
2021-06-01 12:29:56 +02:00
bf8659930f Fix libOverride resync issues in some corner-cases.
This commit fixes two different issues:
* In some cases, when an object was added to a sub-collection and used
  into a different subcollection, and the root common collection would
  not need to be resynced, it would end up creating multiple overrides
  of the new object. This was affecting both normal and recursive
  resync.
* In recurisve resync case, the barrier code to define what is part or
  not of a override group/hierarchy was wrong.

Note that the current solution for the first issue is sub-optimal (it
goes back to the root of the override hierarchy and resync the whole
thing), a better solution is TODO for now.
2021-06-01 12:01:06 +02:00
f25316e97a IDManagement: BKE_libblock_rename: assert we get local ID.
For now at least, linked data should never be renamed that way.
2021-06-01 12:01:06 +02:00
84e16c4992 Fix BLI_libblock_ensure_unique_name not ignoring linked IDs.
This function would considere that there was a name conflict even in
case existing ID would be a linked one.

This is only a (symbolic) perforance improvement and logical fix, since
`BKE_id_new_name_validate` would not do that mistake anyway.
2021-06-01 12:01:06 +02:00
db15c9d1bd ID Management: Allow unique name check for linked IDs too.
This is mandatory for liboverride resync, since this feature may imply
we have to create linked overrides in libraries, and there may be
several copies of those.

This is also a first step to a more general support of IDmanagement-editing
library data.

Note that this commit should have absolutely no effect on current code,
as the only function allowed to check unique names for linked IDs
currently is `BKE_libblock_management_main_add`, which is unused.

This commit also adds some basic testing for `BKE_id_new_name_validate`.
2021-06-01 12:01:06 +02:00
27910ccce6 Cleanup: clang-tidy
* `readability-redundant-member-init`
* `readability-inconsistent-declaration-parameter-name`
* Remove constructor that can be defaulted.
2021-06-01 12:00:16 +02:00
9adfd278f7 Compositor: Full-frame base system
This patch adds the base code needed to make the full-frame system work for both current tiled/per-pixel implementation of operations and full-frame.

Two execution models:
- Tiled: Current implementation. Renders execution groups in tiles from outputs to input. Not all operations are buffered. Runs the tiled/per-pixel implementation.
- FullFrame: All operations are buffered. Fully renders operations from inputs to outputs. Runs full-frame implementation of operations if available otherwise the current tiled/per-pixel. Creates output buffers on first read and free them as soon as all its readers have finished, reducing peak memory usage of complex/long trees. Operations are multi-threaded but do not run in parallel as Tiled (will be done in another patch).

This should allow us to convert operations to full-frame in small steps with the system already working and solve the problem of high memory usage.

FullFrame breaking changes respect Tiled system, mainly:
- Translate, Rotate, Scale, and Transform take effect immediately instead of next buffered operation.
- Any sampling is always done over inputs instead of last buffered operation.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D11113
2021-06-01 10:51:53 +02:00
930ad9257d Cleanup: Split draw_cache_extract_mesh into multiple files.
draw_cache_extract_mesh for task scheduling. Will be refactored to draw_cache_extract_mesh_scheduling later on after migrating to CPP.

draw_cache_extract_mesh_render_data extraction of mesh render data from edit mesh/mesh into a more generic structure.

draw_cache_extract_mesh_extractors containing all the extractors. This will be split up further into a single file per extractor.
2021-06-01 09:23:37 +02:00
13deb5088a Cleanup: split face tessellation into inline functions
Prepare for multiple code-paths that recalculate tessellation.
2021-06-01 15:30:53 +10:00
b8d0f28f70 Cleanup: split bmesh tessellation into it's own file
Prepare for further refactoring for these functions.
2021-06-01 14:04:00 +10:00
3a18e304be Cleanup: remove disabled face tessellation logic
This was kept since these blocks are easier to follow.
Remove as the overall result wasn't so readable
(especially with nested ifdef's).

Replace disabled code with comment on the indices used for quads/tris.
2021-06-01 13:26:26 +10:00
5e7fb77dc4 BMesh: remove checks for tessellating 2 sided faces
2 sided faces aren't supported and will cause problems in many areas
of Blender's code.

Removing (implied) support for faces with fewer than 3 sides
means the total number of triangles is known ahead of time.

This simplifies adding support for multi-threading and partial updates
to an existing tessellation - as the face and loop indices can be used
to access the range of triangles associated with a face.

Also correct outdated comments.
2021-06-01 13:25:00 +10:00
f8ce744c83 Cleanup: correct sculpt quat argument size 2021-06-01 12:50:01 +10:00
f71cf99616 GPU: add 2D projection function
When projecting into screen space Z value isn't always needed.
Add 2D projection functions, renaming them to avoid accidents
happening again.

- Add GPU_matrix_project_2fv
- Add ED_view3d_project_v2
- Rename ED_view3d_project to ED_view3d_project_v3
- Use the 2D versions of these functions when the Z value isn't used.
2021-06-01 12:49:53 +10:00
c145cb7998 Fix buffer overrun in paint_line_strokes_spacing
Error in 87cafe92ce
2021-06-01 12:49:20 +10:00
e7b8a3cb0a Cleanup: spelling in comments 2021-06-01 12:49:18 +10:00
c59d2c739d Cleanup: spelling in comments 2021-06-01 01:45:17 +02:00
f253e59221 Docs: Limit the OCIO env vars that we document
Brecht mentioned that these are a bit obscure and don't make much sense 
to override these.
2021-05-31 19:19:00 -04:00
8180d478e1 Speedup exact boolean by avoiding some mallocs and frees.
This is from patch D11432 from Erik Abrahamsson. He found that
in some mpq3 functions called frequently from loops, passing in
buffers for termporary mpq3 values can save substantial time.
On my machine, his example in that patch went from 9.48s to 7.50s
for the boolean part of the calculation. On his machine, a running
time went from 17s to 10.3s.
2021-05-31 17:03:48 -04:00
73967e2047 Fix undeclared identifiers with 'DEBUG_TIME'
These identifiers were accidentally removed in rB44d2479dc36f.
2021-05-31 16:28:14 -03:00
09fb81f66d Merge branch 'blender-v2.93-release' 2021-05-31 19:23:49 +02:00
25316ef9d7 Cycles: optimize 3D viewport rendering with camera passepartout
If the area outside the camera is fully opaque, don't render it.

Contributed by Kdaf.

Differential Revision: https://developer.blender.org/D11182
2021-05-31 19:23:44 +02:00
875a8a6c79 Cleanup: Replace fseek() calls with BLI_fseek()
The fseek() function on Windows only accepts a 32-bit long offset
argument. Because of this we have our own version, BLI_fseek(), which
will use 64-bit _fseeki64() on Windows. This patch just replaces some
fseek() calls with BLI_fseek().

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

Reviewed by Brecht Van Lommel
2021-05-31 10:08:58 -07:00
James Monteath
ee54a8ace7 Update all README to clearify intention or usage
Add snap configuration file used by Buildbot snap store steps1
2021-05-31 18:58:42 +02:00
261a10edb0 Display source video fps in the VSE
Now FPS is displayed in the video source for videos to provide easy
access.

Reviewed By: Richard Antalik

Differential Revision: http://developer.blender.org/D11441
2021-05-31 18:22:24 +02:00
d647e730fb Win: Fix warnings as errors being off for bmesh
bf_bmesh historically always build with the /WX flag
on windows making all warnings errors, somewhere along
the way this has broken for msbuild, ninja still exhibits
the expected behaviour.

The flags are still passed to the target, and I've validated
they are there when the add_library call fires, but they
somehow never make it to the generated msbuild project files.

I suspect this is a cmake bug but I'm seemingly unable
to extract a repro case to file a bug upstream.

Setting the same options target_compile_options seems to work,
I'm not happy about the unexplained nature of the breakage
but this will have to do for now.
2021-05-31 09:59:29 -06:00
46a14bd6a3 Fix T88670: Load Previous Settings does not copy symlinks
The same code existed in 2.82 and earlier so this should be safe. Removing the
custom implementation of shutil.copytree in f34d5d9 did not correctly add back
the option to copy symlinks.
2021-05-31 17:30:04 +02:00
b862916eaf VSE: Fix missing cache invalidation
Fixes T88606
2021-05-31 17:28:49 +02:00
Jeroen Bakker
44d2479dc3 Refactor: DRW Mesh Extractor: Join the extractors in a same loop
This patch replaces / redoes the entire MeshExtractors system.
Although they were useful and facilitated the addition of new buffers, they made it difficult to control the threads and added a lot of threading overhead.

Part of the problem was in traversing the same loop type in different threads. The concurrent access of the BMesh Elements slowed the reading.

This patch simplifies the use of threads by merging all the old callbacks from the extracts into a single series of iteration functions.

The type of extraction can be chosen using flags.

This optimized the process by around 34%.

Initial idea and implementation By @mano-wii.
Fine-tuning, cleanup by @atmind.

MASTER:
large_mesh_editing:
- rdata 9ms iter 50ms (frame 155ms)
- Average: 6.462874 FPS

PATCH:
large_mesh_editing:
- rdata 9ms iter 34ms (frame 136ms)
- Average: 7.379491 FPS

Differential Revision: https://developer.blender.org/D11425
2021-05-31 17:11:25 +02:00
aebeb85fe0 Windows: Clean-up win 8/8.1 API use
For 2.93 we bumped the minimum windows requirement
to windows 8.1, but did not do any clean-up of any
win 8/8.1 API usage we dynamically accessed though
LoadLibrary/GetProcAddress.

This patch bumps _WIN32_WINNT to 0x0603 (win 8.1)
and cleans up any API use that was accessed in a
more convoluted way than necessary

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

Reviewed by: harley, nicholas_rishel
2021-05-31 08:56:57 -06:00
d67c13ca76 Cleanup: else-after-return 2021-05-31 15:48:06 +02:00
d94ba979d8 Fix T88569: UI VSE: Menu-based range change, doesn't update the Timeline scrollbar width
Use the appropriate notifier, listeners were already doing the rest
properly.

Maniphest Tasks: T88569

Differential Revision: https://developer.blender.org/D11436
2021-05-31 15:32:33 +02:00
e0a1c3da46 Fix T88666: Cryptomatte: EXR sequence does not update when scrubbing the timeline.
Cause is that initializing the cryptomatte session would reset the
current frame of an image sequence. The solution is to always use the
scene current frame so it resets to the correct frame.

This was a todo that wasn't solved after it landed in master.
Needs to be backported to 2.93.
2021-05-31 14:32:39 +02:00
e9f2f17e85 Fix (unreported): TextureOperation inputs have no resolution
When compositor node tree has a texture node, TextureOperation vector inputs  has always {0, 0} resolution instead of having same resolution as TextureOperation which is the expected behaviour for resolutions propagation.

Current TextureOperation determineResolution implementation doesn't determine inputs resolution, breaking propagation of preferred resolution and that's the reason why they are always 0. Setting scene resolution always would mean it is its own resolution and could make sense, but setting it only when preferred resolution is 0, breaks preferred resolution logic affecting other operations as explained in D10972. In any case scene resolution is already the default preferred resolution on viewer and compositor nodes.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D11381
2021-05-31 12:26:46 +02:00
83fe479c7f Merge branch 'blender-v2.93-release' 2021-05-31 11:56:17 +02:00
ce649c7344 Fix T88623, T87044: Make encoded videos play correctly in VLC
The issue was two fold. We didn't properly:

1. Initialize the codec default values which would lead to VLC
   complaining because of garbage/wrong codec settings.

2.Calculate the time base for the video. FFmpeg would happily accept
  this but VLC seems to assume the time base value is at least somewhat
  correct and couldn't properly display the frames as the internal time
  base was huge. We are talking about 90k ticks (tbn) for one second of
  video!

This patch initializes all codecs to use their default values and fixes
the time base calculation so it follows the guidelines from ffmpeg.

Reviewed By: Sergey, Richard Antalik

Differential Revision: http://developer.blender.org/D11426
2021-05-31 11:29:08 +02:00
2161840d07 Fix (studio-reported) crash in collection management code.
Code checking for potential collection loop dependencies can be called
in cases where we cannot guarantee that there is no NULL pointers, so we
need to check those. Was already done for objects.

NOTE: doubled-checked by @jbakker, thanks.
2021-05-31 11:25:08 +02:00
2534609262 Revert "Added v2.93 pipeline config for new buildbot."
This reverts commit 632bfee0a5.
This config is only intended for 2.93. Master will get its own config
file after testing that 2.93 is correct.
2021-05-31 11:16:13 +02:00
86eaddb3ca Merge branch 'blender-v2.93-release' 2021-05-31 11:15:50 +02:00
632bfee0a5 Added v2.93 pipeline config for new buildbot. 2021-05-31 11:15:03 +02:00
26fb7b9474 Geometry Nodes: do not create unnecessary geometry components
Previously, making instances real would always create an (empty)
volume and curve component, even when not necessary.

This also fixes T88653.
2021-05-31 11:12:39 +02:00
421c0b45e5 Fix (studio-reported) crash in collection management code.
Code checking for potential collection loop dependencies can be called
in cases where we cannot guarantee that there is no NULL pointers, so we
need to check those. Was already done for objects.
2021-05-31 10:20:23 +02:00
Jeroen Bakker
5f749a03ca Fix T88456: DrawManager: Keep subset RenderMeshData around when geometry does not change.
Reuse loose geometry during selection (and other operations) from
previous calculation. Loose geometry stays the same, but was
recalculated to determine the size of GPU buffers. This patch would
reuse the previous loose geometry when geometry wasn't changed.

Although not the main bottleneck during selection it is measurable.

Master.
`rdata 46ms iter 55ms (frame 410ms)`

This patch.
`rdata 5ms iter 52ms (frame 342ms)`

Reviewed By: mano-wii

Differential Revision: https://developer.blender.org/D11339
2021-05-31 09:33:31 +02:00
a1556fa05c Boolean: applying patch D11431 to speed up hole-tolerant raycast.
This patch from Erik Abrahamsson uses a parallel_for to speed up
the case where the input is not manifold and the "hole_tolerant"
option is set.
In a test case on a 24 core (48 thread) machine, this sped up a
the boolean part on an object with 221k triangles from 12.06s to 0.46s.
2021-05-30 16:37:49 -04:00
e6a69f7653 Docs: Capitalize first word of sentence 2021-05-30 11:09:01 -04:00
7b5796dcaa Docs: clarify description and usage of 'bpy.app.version_file'
Fixes T88669
2021-05-30 11:07:38 -04:00
f5d14e36e8 PyDoc: Use em dash instead of comma for enum items 2021-05-29 12:16:13 -04:00
870aaf3fb6 Docs: Add documentation for 'material_index'
Fixes T88485
2021-05-29 11:22:58 -04:00
6f86d50b92 UI: Match tooltip with interface name 2021-05-29 11:22:58 -04:00
30f7acfffa Docs: Add relevant OCIO envvars to Blender's help message 2021-05-29 11:22:58 -04:00
115547991a Merge branch 'blender-v2.93-release' 2021-05-29 15:29:42 +02:00
3c02e648f3 GPencil: Fix unreported random rotation for single point with texture
When using ``Path`` alignment, if the stroke has one point the texture rotates randomly when move the viewport. This was because with one point is impossible to calculate a path.

Now, if the stroke has only one point, the texture for this stroke is aligned to Object.
2021-05-29 15:29:08 +02:00
James Monteath
ffe7a41540 Fix typos 2021-05-28 20:50:52 +02:00
James Monteath
74c7e21f6c Add and update README.md files for CI script removal 2021-05-28 19:46:53 +02:00
9225fe933a Make encoded video fps correct with ffmpeg < 4.4
Before the FFmpeg commit: github.com/FFmpeg/FFmpeg/commit/1c0885334dda9ee8652e60c586fa2e3674056586
FFmpeg would use deprecated variables to calculate the video fps.

We don't use these deprecated variables anymore, so ensure that the
duration is correct in ffmpeg versions without this fix.

Reviewed By: Sergey, Richard Antalik

Differential Revision: http://developer.blender.org/D11417
2021-05-28 18:37:36 +02:00
3311350670 Fix T87932: Failure to build movie strip proxy
We didn't initialize the scaled proxy frame properly.
This would lead to issues in ffmpeg 4.4 as they are more strict that the API is properly used.

Now we initialize the size and format of the frame.
2021-05-28 18:35:26 +02:00
5b8a41d387 Merge branch 'blender-v2.93-release' 2021-05-28 18:19:07 +02:00
653bbaa246 Geometry Nodes: Polish switch node UI
Based on the task T88006, there are a few simple changes
to make to improve the switch node:
- Change the label to "False" / "True" for clarity
- Change default to geometry, as it's the basic data container in
  geometry nodes.
- Change node class to `NODE_CLASS_CONVERTOR`, which was an oversight
  in the original patch.

I will add the new socket types (material and texture) in a separate commit.
Thanks to @EitanSomething for the original patch.

Differential Revision: https://developer.blender.org/D11165
2021-05-28 12:17:04 -04:00
c369382977 EEVEE: Fix NaN caused by ensure_valid_reflection()
This was caused by unsafe sqrt calls.

Fixes T86578 white artifacts in EEVEE

Reviewed By: brecht, dfelinto

Differential Revision: https://developer.blender.org/D11428
2021-05-28 18:16:56 +02:00
c0ce7fce89 Merge branch 'blender-v2.93-release' 2021-05-28 12:09:08 -04:00
20e250dae3 Fix T88601: Attribute Compare boolean doesn't expose socket
While we could make this node work for boolean inputs in the future,
currently it's really just designed to compare "float-like" inputs.
Many comparison modes don't even make sense for boolean inputs.
Therefore, the simplest fix for this bug is just to disable the
boolean attribute input modes for this node.

Differential Revision: https://developer.blender.org/D11427
2021-05-28 12:04:52 -04:00
James Monteath
fc2b56e68c Add branch based pipeline config file used by buildbot and make_update.py script. 2021-05-28 17:53:02 +02:00
a4700549e0 GPencil: Fix unreported random rotation for single point with texture
When using ``Path`` alignment, if the stroke has one point the texture rotates randomly when move the viewport. This was because with one point is impossible to calculate a path.

Now, if the stroke has only one point, the texture for this stroke is aligned to Object.
2021-05-28 17:15:44 +02:00
c65f4b3d76 DrawManager: Early return for buffer cache creation
No real functional changes.

This is useful for benchmark cases when `cache->uv_cage` is passed but
has no buffers are requested.
2021-05-28 11:51:13 -03:00
11e32332dd Geometry Nodes: Add Mesh to Curve Node
This node creates poly curve splines from mesh edges. A selection
attribute input allows only using some of the edges from the mesh.
The node builds cyclic splines from branchless groups of edges where
possible, but when there is a three-way intersection, the spline stops.

The node also transfers all attributes from the mesh to the resulting
control points. In the future we could add a way to limit that to a
subset of the attributes to improve performance.

The algorithm is from Animation Nodes, written by @OmarSquircleArt.
I added the ability to use a selection, attribute transferring, and
used different variable names, etc, but other than that the algorithm
is the same.

Differential Revision: https://developer.blender.org/D11265
2021-05-28 10:42:22 -04:00
080623b8ac Fix incorrect Denoise node SSE 4.1 warning on macOS Intel 2021-05-28 16:02:43 +02:00
418888f1c9 MSVC: Fix build error with 16.10/11
Not entirely sure why this was not an issue for 16.9
but TBB includes the Windows.h header which by default
will define min and max macro's

These collide with the stl versions in <algorithm>

This patch requests Windows.h not to define the
problematic macro's, resolving the conflict.
2021-05-28 07:57:21 -06:00
bdac47f8d4 Merge branch 'blender-v2.93-release' 2021-05-28 15:47:38 +02:00
adafd7257d Fix T88635: VSE: Select Linked gives unpredictable results
Caused by {rB66923031e6f2}.

Code would process unselected sequences and skip selected, needs to be
the other way around.

Maniphest Tasks: T88635

Differential Revision: https://developer.blender.org/D11424
2021-05-28 15:41:56 +02:00
97ccd592ce Fix crash in liboverride resync.
Reported by studio (@andy), thanks.
2021-05-28 15:33:04 +02:00
James Monteath
51bbdfbef3 Moved to new git repo 2021-05-28 12:16:45 +02:00
63e50cf265 Fix T88499: Copy data path operator does not consider library affiliation
When using the operator `ui.copy_data_path_button(full_path=True)` ({key
ctrl shift Alt C} on hover) the copied path does not consider the
library origin. That means that when there is a name clash the data path
is not accurate and refers to the local item instead.

This patch adds the library (if the ID is linked) of the returned string
from RNA_path_full_ID_py.

bpy.data.objects["Cube", "//library.blend"] instead of
bpy.data.objects["Cube"]

note: parsing this happens in
pyrna_prop_collection_subscript_str_lib_pair_ptr

Maniphest Tasks: T88499

Differential Revision: https://developer.blender.org/D11412
2021-05-28 11:06:55 +02:00
James Monteath
5baf1dddd5 Buildbot related files have been moved to own repository 2021-05-28 10:16:39 +02:00
3ec57ce6c7 Tests: add utility to generate interactive user actions
A utility that supports passing in actions as command line arguments for
writing reproducible interactions, benchmarking, profiling and testing.

Unlike regular scripts this is able to control model operators usefully.

Typical ways of controlling Blender using this utility are via
operator id's, menu search and explicit events.
Others methods can be added as needed.

See the doc-string for example usage.
2021-05-28 16:59:38 +10:00
3bee77bb7c Cleanup: use static set syntax 2021-05-28 16:58:50 +10:00
6b03621c01 DrawManager: Use Compute Shader to Update Hair.
This patch will use compute shaders to create the VBO for hair.
The previous implementation uses transform feedback.

Timings before: between 0.000069s and 0.000362s.
Timings after:  between 0.000032s and 0.000092s.

Speedup isn't noticeable by end-users. The patch is used to test
the new compute shader pipeline and integrate it with the draw
manager. Allowing EEVEE, Workbench and other draw engines to
use compute shaders with the introduction of `DRW_shgroup_call_compute`
and `DRW_shgroup_vertex_buffer`.

Future improvements are possible by generating the index buffer
of hair directly on the GPU.

NOTE: that compute shaders aren't supported by Apple and still use
the transform feedback workaround.

Reviewed By: fclem

Differential Revision: https://developer.blender.org/D11057
2021-05-28 08:16:26 +02:00
4a1ba155d5 Merge branch 'blender-v2.93-release' 2021-05-27 21:27:48 -04:00
02395fead7 Docs: Update RNA to User Manual mappings 2021-05-27 21:25:31 -04:00
0a83f32d79 Fix T86465: Annotation Tool is missing in VSE Preview toolbar
Added missing topbar in VSE.

Also added the Stabilizer options to Topbar for all modes.

Reviewed By: mendio, pepeland

Maniphest Tasks: T86465

Differential Revision: https://developer.blender.org/D11347
2021-05-27 19:53:23 +02:00
758c115103 Fix own crash in today's rBf68288a8746f. 2021-05-27 19:32:35 +02:00
311ffd967b LibOverride: refactor recursive resync.
We need to re-evaluate what needs to be resynced after each step of
processing overrides from a given 'indirect level' of libraries.
Otherwise, recusrive overrides (overrides of linked overrides) won't
work.

Note that this should not change too much in practice currently, since
there are other issues with recursive overrides yet.

Also, checks (CLOG errors) added show that some ID (node trees) seem to
be detected as needing resynced even after beig just resynced, this
needs further investigation still. Could be though that it is due to
limit currently set on nodetrees, those are always complicated
snowflakes to deal with...
2021-05-27 19:32:35 +02:00
530f2994e9 Fix T88614: Mixdown crashes Blender 2.92.0 and 3.0.0 Alpha
The problem is caused by the most recent ffmpeg version (4.4) which
needs channels to be set when submitting a frame for encoding.
2021-05-27 19:05:17 +02:00
dfa3dcbab9 Fix T88625: Multiobject UV hiding/unhiding does not work with UV_SYNC_SELECTION
Oversight in {rB470f17f21c06}.

Hiding was only done for the first mesh, then the operator finished (in
case of UV_SYNC_SELECTION).
Now just continue to the next.

Maniphest Tasks: T88625

Differential Revision: https://developer.blender.org/D11413
2021-05-27 17:27:38 +02:00
8590cb26a9 Merge branch 'blender-v2.93-release' 2021-05-27 17:15:39 +02:00
ba4228bcf7 Revert "EEVEE: Ensure Reflection: Use new implementation"
Both before and after can have artifacts with some normal maps, but this seems to give
worse artifacts on average which are not worth the minor performance increase.

This reverts commit 5c4d24e1fd.

Ref T88368, D10084
2021-05-27 17:12:23 +02:00
3025c34825 Geometry Nodes: Expose texture and material inputs to modifier
This allows choosing material and texture sockets for the group input
node in the modifier. Note that currently grease pencil materials are
displayed in the list, even though grease pencil data is not supported
yet by geometry nodes. That is more complicated to fix in this case,
since we use IDProperties to store the dynamic exposed inputs.

Differential Revision: https://developer.blender.org/D11393
2021-05-27 11:06:08 -04:00
24b2482ad9 Cleanup: Fix forward declaring class with "struct" 2021-05-27 11:00:00 -04:00
a3edf4a381 Fix build error: Make CurveEval a struct
We need a pointer to this in DNA, which means it cannot be a class.
2021-05-27 10:50:43 -04:00
e8ca635e43 Cleanup: rename blender-launcher source file.
blender-laucher.c was not an ideal name for this file
since it's not directly clear it is windows only.

This change renames it to blender_launcher_win32.c
to be more in line with other win32 specific files
we have.
2021-05-27 08:10:31 -06:00
ac833108db Geometry Nodes: Draw curve data in the viewport
This patch adds relatively small changes to the curve draw
cache implementation in order to draw the curve data in the
viewport. The dependency graph iterator is also modified
so that it iterates over the curve geometry component, which
is presented to users as `Curve` data with a pointer to the
`CurveEval`

The idea with the spline data type in geometry nodes is that
curve data itself is only the control points, and any evaluated
data with faces is a mesh. That is mostly expected elsewhere in
Blender anyway. This means it's only necessary to implement
wire edge drawing of `CurveEval` data.

Adding a `CurveEval` pointer to `Curve` is in line with changes
I'd like to make in the future like using `CurveEval` in more places
such as edit mode.

An alternate solution involves converting the curve wire data
to a mesh, however, that requires copying all of the data, and
since avoiding it is rather simple and is in-line with future plans
anyway, I think doing it this way is better.

Differential Revision: https://developer.blender.org/D11351
2021-05-27 10:08:40 -04:00
5621a8ed7f Fix T88452: Point Separate crash on curve component
The point separate node should create a point cloud from control points
in this case, but for now disable the node on curves to avoid the crash.
2021-05-27 09:37:19 -04:00
a12fd5c3ad Cleanup: Use consistent variable names 2021-05-27 09:27:08 -04:00
5721c89ba8 Cleanup: rename BKE_main_id_{clear_newpoins => newptr_and_tag_clear}
It wasn't obvious this function cleared the tag as well.
2021-05-27 22:44:02 +10:00
Erik Abrahamsson
9200e73136 Cleanup: remove duplicate LIB_TAG_NEW untag code
This patch removes unnecessary calls to `BKE_main_id_tag_all` where the
same job is done by `BKE_main_id_clear_newpoins` on the following line.

Reviewed By: campbellbarton, mont29

Ref D11379
2021-05-27 22:42:41 +10:00
6ad4b8b764 LineArt: List Optimization for tile linked data.
Use array instead of ListBase for line art
bounding area linked triangles and edges.

Reviewed By: Sebastian Parborg (zeddb)

Differential Revision: https://developer.blender.org/D11302
2021-05-27 20:33:02 +08:00
f45270b4fb Cleanup: Line art variable naming.
Change `reln` to `eln`.

Reviewed By: Sebastian Parborg (zeddb)

Differential Revision: https://developer.blender.org/D11411
2021-05-27 18:47:13 +08:00
42fba7f0d2 LibOverride: Add heuristic protection against infinite loop due to libraries inter-dependencies.
This is not supposed to happen, but better be safe than sorry, and
assume it is beyond unlikely that someone would use chains of over 10k
linked libraries.
2021-05-27 11:55:31 +02:00
ac2266fe57 Cleanup: Unused include in Cycles 2021-05-27 11:36:30 +02:00
2414a5787d Refactor: Move display pass to Cycles viewport parameters
Allows to centralize storage and modification checks in a single place,
avoiding duplication in the synchronization code.

Ideally we would somehow be able to more granularly modify Cycles side
objects. Leaving this for a future decision, because it might be better
to implement it as a graph on the sync side.
2021-05-27 11:36:30 +02:00
7b5f4c8837 Cleanup: Redundnat member init in Cycles viewport parameters 2021-05-27 11:36:30 +02:00
616b071c4f Refactor: Naming in Cycles viewport methods
Makes it more explicit they operate on shading/light.

Gives room to move more viewport related settings into this class and
cover with specific or generic modification checks.
2021-05-27 11:36:30 +02:00
15df83e9c9 Cleanup: Use logical OR in Cycles background shader 2021-05-27 11:36:30 +02:00
8f43e31a71 Cleanup: const qualifier of return type 2021-05-27 11:36:30 +02:00
4ea7742973 Refactor: Remove friend class from Cycles viewport parameters
Such pattern should only be used when it is really needed. Otherwise
just stick to a more regular design, without worrying who is the user
of the class. Otherwise it will be annoying to subclass or unit test.
2021-05-27 11:36:30 +02:00
bf7a67c5c6 Refactor: Rename pass accessor in viewport parameters
No need to state that it is a viewport display pass, since the method
is within viewport parameters it is implied that parameters do belong
to the viewport.

Brings this code closer to the Cycles-X branch.
2021-05-27 11:36:30 +02:00
06d48367fa Fix (studio-reported) infinite loop in resync code.
Very stupid mistake in libraries indirect-level building code, was not
skipping 'loop-back' ID pointers.

Note that we also need some level of checks for the case where there
would be an actual dependency loop between libraries, this is not
supposed to be possible, but better be safe than sorry. Will add in next
commit.
2021-05-27 10:49:31 +02:00
46e1ad711c Cleanup: inconsistent parameter name 2021-05-27 10:46:43 +02:00
ffa2a1771e Cleanup: inconsistent parameter name 2021-05-27 10:41:40 +02:00
fd0bb24e4a Cleanup: simplify logic for copying vector button as text
An arbitrary size offsets was used in float_array_to_string,
simplify the loop, use exact size limits.

Also rename variables so it's clear which array the length apply to.
2021-05-27 17:59:21 +10:00
41f2ea4045 Fix incorrect BLI_snprintf usage
Event though in practice this wasn't causing problems as the fixed size
buffers are generally large enough not to truncate text.

Using the result from `snprint` or `BLI_snprintf` to step over a fixed
size buffer allows for buffer overruns as the returned value is the size
needed to copy the entire string, not the number of bytes copied.

Building strings using this convention with multiple calls:

    ofs += BLI_snprintf(str + ofs, str_len_max - ofs);

.. caused the size argument to become negative,
wrapping it to a large value when cast to the unsigned argument.
2021-05-27 17:59:21 +10:00
1276d0024f Cleanup: specify array sizes, remove warnings in comments 2021-05-27 17:59:21 +10:00
f0342065b1 Cleanup: spelling 2021-05-27 17:59:21 +10:00
2ad3a1c318 Nodes: fix material node copied over when socket is copied
This was missing from rB207472930834a2916cf18bbdff51bcd77c6dd0c0.
2021-05-27 09:58:45 +02:00
223c6e1ead Geometry Nodes: disable multi-threading in evaluator for now
A deadlock could happen under certain circumstances when
geometry nodes is used on multiple objects.
Once T88598 is resolved, multi-threading can be enabled again.

Differential Revision: https://developer.blender.org/D11405
2021-05-27 09:43:11 +02:00
7d20cf92dd Cleanup: use UndoMesh as links instead of allocating LinkData
While the advantage isn't large,
it's simpler to skip the intermediate link.

Also remove unused next and previous struct members
from MeshUndoStep_Elem.
2021-05-27 16:44:21 +10:00
deb71cef38 Undo: resolve inefficient edit-mesh memory use with multiple objects
When editing more than 1 object at a time, complete copies of each mesh
were being stored. Now the most recent undo-data for each mesh is used
(when available).
2021-05-27 16:44:21 +10:00
a10e41b02e Cleanup: Remove completed "TODO" comment
Since rBb67fe05d4bea, the dependency graph supports relations
on collection geometry, and the nodes modifier uses that.
2021-05-26 22:32:53 -04:00
b132dd042e Cleanup: Simplify spline point attribute materialize functions
- Iterate over the mask directly instead of using an index.
- Use Span slice and copy_from instead of a lower level function.
2021-05-26 22:22:09 -04:00
c97b6215a3 Geometry Nodes: Support interpolation between curve domains
This commit adds interpolation from the point domain to the spline
domain and the other way around. Before this, spline domain attributes
were basically useless, but now they are quite helpful as a way to use
a shared value in a contiguous group of points.

I implementented a special virtual array for the spline to points
conversion, so that conversion should be close to the ideal performance
level, but there are a few ways we could optimize the point to spline
conversion in the future:
 - Use a function virtual array to mix the point values for each spline
   on demand.
 - Implement a special case for when the input virtual array is one of
   the virtual arrays from the spline point attributes. In other words,
   decrease curve attribute access overhead.

Differential Revision: https://developer.blender.org/D11376
2021-05-26 22:14:59 -04:00
f3944cf503 Win: Add launcher to hide the console window flash
This patch fixes a long-standing complaint from users:
the console window shortly flashing when they start
blender.

This is done by adding a new executable called
blender-launcher.exe which starts blender.exe while
hiding the console.

Any command line parameters given to blender-launcher
will be passed on to blender.exe so it'll be a drop
in replacement.

Starting blender.exe on its own will still function as
a proper console app so no changes required here for
users that use blender for batch processing.

Notable changes:

Registering blender (-R switch) will now register
blender-launcher as the preferred executable.

This patch updates the installer and updates the
shortcuts to start blender-launcher.exe rather
than blender.exe

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

Reviewed by: brecht, harley
2021-05-26 20:02:35 -06:00
Germano Cavalcante
6fc9ec9257 Cleanup: Specify amount of buffers through preprocessor directives 2021-05-26 22:52:59 -03:00
e5b51cb511 Fix T88603: Crash with spline attributes after curve resample
The output curve's spline attribute domain custom data needs to be
reallocated with the correct length after adding the splines.
2021-05-26 21:12:38 -04:00
2c607ec2f6 Revert "DrawManager: Use Compute Shader to Update Hair."
This reverts commit 8f9599d17e.

Mac seems to have an error with this change.
```
                 ERROR: /Users/blender/git/blender-vdev/blender.git/source/blender/draw/intern/draw_hair.c:115:44: error: use of undeclared identifier 'shader_src'
                 ERROR: /Users/blender/git/blender-vdev/blender.git/source/blender/draw/intern/draw_hair.c:123:13: error: use of undeclared identifier 'shader_src'
                 ERROR: make[2]: *** [source/blender/draw/CMakeFiles/bf_draw.dir/intern/draw_hair.c.o] Error 1
                 ERROR: make[1]: *** [source/blender/draw/CMakeFiles/bf_draw.dir/all] Error 2
                 ERROR: make: *** [all] Error 2

```
2021-05-26 20:32:05 +02:00
7438f0c6c0 Cleanup: array-parameter warning with GCC 11
Pass the string size as this is less error prone in general.
2021-05-27 02:32:44 +10:00
c07c7957c6 Revert "Cycles: optimize ensure_valid_reflection(), reduces render time by about 1%"
Both before and after can have artifacts with some normal maps, but this seems to give
worse artifacts on average which are not worth the minor performance increase.

This reverts commit 21bc1a99ba.

Ref T88368, D10084
2021-05-26 18:27:21 +02:00
f12e2ec088 Fix buildbot CUDA/OptiX warnings on macOS
Explicitly disable these, rather than relying on them not being found.
Also, don't duplicates the architectures list.
2021-05-26 18:27:17 +02:00
de3d54eb9a GPencil: Cleanup - Conform with RNA naming scheme
The newly added `disable_masks_viewlayer` RNA property did not conform
with the RNA naming scheme. This renames it to `use_viewlayer_masks`.
2021-05-26 18:23:31 +02:00
df32b50344 Fix T88111: Skin modifier assets within invalid face normals
The skin modifier was moving vertices without updating normals for the
connected faces, this happened when smoothing and welding vertices.

Reviewed By: mont29

Ref D11397
2021-05-27 01:52:45 +10:00
6b00df1105 Cleanup: shadow warning
Move reproject_type into an extern, to avoid declaring multiple times.
2021-05-27 01:52:45 +10:00
72d660443b LibOverride: add recursive resync.
Recursive resync means also resyncing overrides that are linked from
other library files into current working file.

Note that this allows to get 'working' files even when their
dependencies are out of sync. However, since linked data is never
written/saved, this has to be re-done every time the working file is
loaded, until said dependencies are updated properly.

NOTE: This is still missing the 'report' side of things, which is part
of a larger task to enhance reports regarding both linking, and
liboverrides (see T88393).

----------

Technical notes:

Implementing this proved to be slightly more challenging than expected,
mainly because one of the key aspects of the feature was never done in
Blender before: manipulating, re-creating linked data.

This ended up moving the whole resync code to use temp IDs out of bmain,
which is better in the long run anyway (and more aligned with what we
generally want to do when manipulating temp ID data). It should also
give a marginal improvement in performances for regular resync.

This commit also had to carefully 'sort' libraries by level of indirect
usage, as we want to resync first the libraries that are the least directly
used, i.e. libraries that are most used by other libraries.
2021-05-26 17:05:01 +02:00
51ca9833d9 LibOverride: add helper to retrieve override data from an ID.
Embedded IDs do not own their own override data, but rather use the one
from their owner.
2021-05-26 17:05:01 +02:00
daf39af70a IDManagement: Shapekey: add a owner_get callback.
Even though shepkeys are not strictly speaking an embedded data, they
share quiet a few points with those, and from liboverride perspective
they are embedded, so...
2021-05-26 17:05:01 +02:00
653d39cec3 LibOverride: Do not try to generate override data of linked data.
This is obviously not saved, and should never be editable, so was only a
waste of time.
2021-05-26 17:05:01 +02:00
6cbe5dd1c3 ID management: remapping: add flag to enforce refcounting handling.
While indeally we should only skip refcounting when relevant tag is set,
doing this in remapping code is too risky for now.

Related to previous commit and T88555.
2021-05-26 17:05:01 +02:00
ee849ca0f8 ID management: Do not assume that NO_MAIN means NO_USER_REFCOUNT
While this is still very fuzzy in current code, this old behavior makes
it close to impossible to efficiently use out-of-main temp data, as it
implies that we'd need to update refcounts everytime we add something
back into BMain (an 'un-refcount' ID usages when removing from BMain).

Now that we have two separate flags/tags for those two different things,
let's not merge them anymore.

Note that this is somewhat on-going process, still needs more checks and
cleanup. Related to T88555.
2021-05-26 17:05:00 +02:00
Jeroen Bakker
8f9599d17e DrawManager: Use Compute Shader to Update Hair.
This patch will use compute shaders to create the VBO for hair.
The previous implementation uses tranform feedback.

Timings master (transform feedback with GPU_USAGE_STATIC between 0.000069s and 0.000362s
Timings transform feedback with GPU_USAGE_DEVICE_ONLY. between 0.000057s and 0.000122s
Timings compute shader between 0.000032 and 0.000092s

Future improvements:
* Generate hair Index buffer using compute shaders: currently done single threaded on CPU, easy to add as compute shader.

Reviewed By: fclem

Differential Revision: https://developer.blender.org/D11057
2021-05-26 17:03:37 +02:00
Jeroen Bakker
87055dc71b GPU: Compute Pipeline.
With the compute pipeline calculation can be offloaded to the GPU.
This patch only adds the framework for compute. So no changes for users at
this moment.

NOTE: As this is an OpenGL4.3 feature it must always have a fallback.

Use `GPU_compute_shader_support` to check if compute pipeline can be used.
Check `gpu_shader_compute*` test cases for usage.

This patch also adds support for shader storage buffer objects and device only
vertex/index buffers.

An alternative that had been discussed was adding this to the `GPUBatch`, this
was eventually not chosen as it would lead to more code when used as part of a
shading group. The idea is that we add an `eDRWCommandType` in the near
future.

Reviewed By: fclem

Differential Revision: https://developer.blender.org/D10913
2021-05-26 16:49:30 +02:00
e459a25e6c GPencil: Add option to disable masks in view layer
This patch adds an option in the Layers > Relations panel called "Disable Masks in Render".
When checked, no masks on this layer are included in the render.

Example:
| {F10087680} | {F10087681} |

See T88202 for why this is needed.

Reviewed By: antoniov

Maniphest Tasks: T88202

Differential Revision: https://developer.blender.org/D11234
2021-05-26 16:46:20 +02:00
a6f3bb36df Merge branch 'blender-v2.93-release' 2021-05-26 16:34:03 +02:00
d5a5575685 Fix: GPencil mask shows in view layer render
Currently when rendering the view layer of a grease pencil layer that has
a mask layer attached, the mask layer would show in the rendered image.
This is inconsistent with the default behaviour with no mask on the
grease pencil layer, because it would only render what's on that
particular layer and not anything from any other layer.

This patch makes the masks invisible in the render.

Note: This might seem like not the best solution, but because masks are
just regular grease pencil layers, it's tricky to pass this edge-case to the
drawing code. The way it is handled right now is the best I could come
up with, without making changes that could affect something else.

Reviewed By: antoniov

Maniphest Tasks: T88202

Differential Revision: https://developer.blender.org/D11403
2021-05-26 16:32:58 +02:00
3f27efd31e Merge branch 'blender-v2.93-release' 2021-05-26 16:20:24 +02:00
ba5b4d1bd6 Fix T88250: crash when instancing object in disabled collection
This issue was that `BKE_object_eval_uber_data` was not called for
the text object, because its geometry was not dependent upon
and its `is_directly_visible` tag was `false`. The crash happens in
rendering code, because the evaluated data is missing.

This not only affects text objects, but all object types that have a
geometry component that geometry nodes does not support yet.

The solution is to just add the missing dependencies.

Differential Revision: https://developer.blender.org/D11385
2021-05-26 16:06:01 +02:00
06f86dd4d9 GPencil: Bake GPencil object transforms into a new GPencil object
This operator is a common request of animators to convert the transformation (inluding modifiers) of one grease pencil object, into a new object, generating strokes.

Reviewed By: pepeland

Maniphest Tasks: T87424

Differential Revision: https://developer.blender.org/D11014
2021-05-26 15:43:40 +02:00
b67423f806 Nodes: fix threading issues with node ui storage
Calling BKE_nodetree_attribute_hint_add from multiple threads still
was not safe before..
One issue was that context_map embedded its values directly. So
when context_map grows, all NodeUIStorage would move as well.
I could patch around that by using std::unique_ptr in a few places,
but that just becomes too complex for now.
Instead I simplified the locking a bit by adding just locking a mutex
in NodeTreeUIStorage all the time while an attribute hint is added.

Differential Revision: https://developer.blender.org/D11399
2021-05-26 14:19:01 +02:00
afec66c024 Fix T88588: crash when muting node with multi input socket
The bug existed before the new evaluator already, but the new evaluator
is more sensitive to this kind of error.
2021-05-26 12:25:48 +02:00
12a06292af Cycles: optimize attributes device updates
When an `AttributeSet` is tagged as modified, which happens after the addition or
removal of an `Attribute` from the set, during the following GeometryManager device
update, we update and repack the kernel data for all attribute types. However, if we
only add or remove a `float` attribute, `float2` or `float3` attributes should not
be repacked for efficiency.

This patch adds some mechanisms to detect which attribute types are modified from
the AttributeSet.

Firstly, this adds an `AttrKernelDataType` to map the data type of the Attribute to
the one used in the kernel as there is no one to one match between the two since e.g.
`Transform` or `float4` data are stored as `float3s` in the kernel.

Then, this replaces the `AttributeSet.modified` boolean with a set of flags to detect
which types have been modified. There is no specific flag type (e.g.
`enum ModifiedType`), rather the flags used derive simply from the
`AttrKernelDataType` enumeration, to keep things synchronized.

The logic to remove an `Attribute` from the `AttributeSet` and tag the latter as modified
is centralized in a new `AttributeSet.remove` method taking an iterator as input.

Lastly, as some attributes like standard normals are not stored in the various
kernel attribute arrays (`DeviceScene::attribute_*`), the modified flags are only
set if the associated standard corresponds to an attribute which will be stored
in the kernel's attribute arrays. This makes it so adding or removing such attributes
does not trigger an unnecessary update of other type-related attributes.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D11373
2021-05-26 12:18:28 +02:00
2a09634d41 Fix particlesystem not duplicating their pointcache in NO_MAIN case.
Sharing data between duplicated IDs should be restricted to depsgraph
(CoW) cases, not all NO_MAIN ones...

While this was probably not an issue currently, we aim at using more and
more out-of-main IDs for temp data processing.

NOTE: Somewhat related to T88555, and similar issue as the one fixed in
rBdfb963c70df5.
2021-05-26 11:25:51 +02:00
534fcab994 Fix T88552: Cycles changing Render Passes in viewport does not work 2021-05-26 11:16:47 +02:00
a72a580948 Cleanup: Simplify Cycles viewport parameters
Use early output and access shading RNA object only once.
2021-05-26 11:10:56 +02:00
e6c0e6c2a9 Compositor: Use BLI_color in convert alpha node.
Recently the CPP colors module landed in master. This patch will use the
new module in the convert alpha node.
2021-05-26 10:46:46 +02:00
1e6b028580 Cleanup: Remove unused argument in Cycles sync
Makes it easier to see where exactly the viewport is used.
2021-05-26 10:45:27 +02:00
09e77f904d Fix T88534: Unable to add a Geometry Node Tree on Volume object
Volumes are supported, poll corrected.

Maniphest Tasks: T88534

Differential Revision: https://developer.blender.org/D11378
2021-05-26 10:28:16 +02:00
03c0fa1cdb Fix T88531: Mantaflow problem with geometry nodes
Objects modified by geometry nodes modifiers were not caught as being
"dynamic".

Now add this modifier type to the list of modifiers making them "dynamic"
in the eyes of mantaflow.

(noticed by @sebbas in chat)

Maniphest Tasks: T88531

Differential Revision: https://developer.blender.org/D11389
2021-05-26 10:21:39 +02:00
b813007a0f Fix T88566: Mantaflow inflow with shapekeys is not working anymore
(regression)

Code was actually checking for shapekeys, but these were not detected
properly (some effects like shape keys are added as virtual modifiers
before the user created modifiers)

Now go over virtual modifiers as well.

Maniphest Tasks: T88566

Differential Revision: https://developer.blender.org/D11388
2021-05-26 10:17:55 +02:00
ff35332610 Merge branch 'blender-v2.93-release' 2021-05-26 09:55:47 +02:00
ebde6e1852 Fix T88251: "Operator Cheat Sheet" Crash
Caused by {rB919558854d62}.

Same fix as in {rBdc8a43c8755a} -- let RNA enum item callbacks check
for NULL context.

The NULL context is used to extract items for document generation.

Maniphest Tasks: T88251

Differential Revision: https://developer.blender.org/D11391
2021-05-26 09:51:55 +02:00
c0bb7d9cb7 Cleanup: Fix short comparison with bool warning
For some reason the hide status is stored in a short and a char
(we cannot have bools in DNA).
2021-05-25 14:37:58 -04:00
95690dd362 Bump FFmpeg version from 4.2.3 to 4.4
Bump FFmpeg version to 4.4 to fix a problem where it would write the
wrong frame rate. Their old API was deprecated and Blender moved to the
new one in rB8d6264ea12bfac0912c7249f00af2ac8e3409ed1. The new one
produced files with the wrong frame rate, which was fixed in FFmpeg 4.4.

Manifest Task: T88568

Reviewed By: LazyDodo, zeddb

Differential Revision: https://developer.blender.org/D11392
2021-05-25 18:58:28 +02:00
490dd279cc deps: Fix broken boost link 2021-05-25 10:27:48 -06:00
45b28c0f88 GPencil: Add a use_light option when creating object.
This option is default off when creating line art objects
because line art seldom use lighting and the normal data
would be all over the place anyway.

Reviewed By: Antonio Vazquez (antoniov)

Differential Revision: https://developer.blender.org/D11372
2021-05-25 23:45:47 +08:00
9f60188cd8 Cleanup: Use ListBase in various places in line art.
This clarifies the data structures for storing edges
for different calculation stages.

Reviewed By: Sebastian Parborg (zeddb)

Differential Revision: https://developer.blender.org/D11386
2021-05-25 23:32:04 +08:00
Jeroen Bakker
cb8a6814fd Blenlib: Explicit Colors.
Colors are often thought of as being 4 values that make up that can make any color.
But that is of course too limited. In C we didn’t spend time to annotate what we meant
when using colors.

Recently `BLI_color.hh` was made to facilitate color structures in CPP. CPP has possibilities to
enforce annotating structures during compilation and can adds conversions between them using
function overloading and explicit constructors.

The storage structs can hold 4 channels (r, g, b and a).

Usage:

Convert a theme byte color to a linearrgb premultiplied.
```
ColorTheme4b theme_color;
ColorSceneLinear4f<eAlpha::Premultiplied> linearrgb_color =
    BLI_color_convert_to_scene_linear(theme_color).premultiply_alpha();
```

The API is structured to make most use of inlining. Most notable are space
conversions done via `BLI_color_convert_to*` functions.

- Conversions between spaces (theme <=> scene linear) should always be done by
  invoking the `BLI_color_convert_to*` methods.
- Encoding colors (compressing to store colors inside a less precision storage)
  should be done by invoking the `encode` and `decode` methods.
- Changing alpha association should be done by invoking `premultiply_alpha` or
  `unpremultiply_alpha` methods.

# Encoding.

Color encoding is used to store colors with less precision as in using `uint8_t` in
stead of `float`. This encoding is supported for `eSpace::SceneLinear`.
To make this clear to the developer the `eSpace::SceneLinearByteEncoded`
space is added.

# Precision

Colors can be stored using `uint8_t` or `float` colors. The conversion
between the two precisions are available as methods. (`to_4b` and
`to_4f`).

# Alpha conversion

Alpha conversion is only supported in SceneLinear space.

Extending:
- This file can be extended with `ColorHex/Hsl/Hsv` for different representations
  of rgb based colors. `ColorHsl4f<eSpace::SceneLinear, eAlpha::Premultiplied>`
- Add non RGB spaces/storages ColorXyz.

Reviewed By: JacquesLucke, brecht

Differential Revision: https://developer.blender.org/D10978
2021-05-25 17:16:54 +02:00
00955cd31e Revert "Blenlib: Explicit Colors."
This reverts commit fd94e03344.
does not compile against latest master.
2021-05-25 17:03:54 +02:00
Jeroen Bakker
fd94e03344 Blenlib: Explicit Colors.
Colors are often thought of as being 4 values that make up that can make any color.
But that is of course too limited. In C we didn’t spend time to annotate what we meant
when using colors.

Recently `BLI_color.hh` was made to facilitate color structures in CPP. CPP has possibilities to
enforce annotating structures during compilation and can adds conversions between them using
function overloading and explicit constructors.

The storage structs can hold 4 channels (r, g, b and a).

Usage:

Convert a theme byte color to a linearrgb premultiplied.
```
ColorTheme4b theme_color;
ColorSceneLinear4f<eAlpha::Premultiplied> linearrgb_color =
    BLI_color_convert_to_scene_linear(theme_color).premultiply_alpha();
```

The API is structured to make most use of inlining. Most notable are space
conversions done via `BLI_color_convert_to*` functions.

- Conversions between spaces (theme <=> scene linear) should always be done by
  invoking the `BLI_color_convert_to*` methods.
- Encoding colors (compressing to store colors inside a less precision storage)
  should be done by invoking the `encode` and `decode` methods.
- Changing alpha association should be done by invoking `premultiply_alpha` or
  `unpremultiply_alpha` methods.

# Encoding.

Color encoding is used to store colors with less precision as in using `uint8_t` in
stead of `float`. This encoding is supported for `eSpace::SceneLinear`.
To make this clear to the developer the `eSpace::SceneLinearByteEncoded`
space is added.

# Precision

Colors can be stored using `uint8_t` or `float` colors. The conversion
between the two precisions are available as methods. (`to_4b` and
`to_4f`).

# Alpha conversion

Alpha conversion is only supported in SceneLinear space.

Extending:
- This file can be extended with `ColorHex/Hsl/Hsv` for different representations
  of rgb based colors. `ColorHsl4f<eSpace::SceneLinear, eAlpha::Premultiplied>`
- Add non RGB spaces/storages ColorXyz.

Reviewed By: JacquesLucke, brecht

Differential Revision: https://developer.blender.org/D10978
2021-05-25 17:01:26 +02:00
b046bc536b Fix T88096: Baking with OptiX and displacement fails
Using displacement runs the shader eval kernel, but since OptiX modules are not loaded when
baking is active, those were not available and therefore failed to launch. This fixes that by falling
back to the CUDA kernels.
2021-05-25 16:56:16 +02:00
8cd506639a Geometry Nodes: Add Shader Curve Nodes
Convert curve vec and curve rgb shader nodes to geometry nodes, based on node_shader_valToRgb.cc implementation.
2021-05-25 15:43:51 +01:00
54ae7baa4c Cleanup: Line art naming changes.
Make variable naming consistent with struct names.

Reviewed By: Sebastian Parborg (zeddb)

Differential Revision: https://developer.blender.org/D11382
2021-05-25 22:11:06 +08:00
c3c576c8c4 Cleanup: Convert to static type directly from CPPType 2021-05-25 09:52:08 -04:00
a20ef4207d Fix T86956: VSE shading mode ignores Grease Pencil Vertex colors.
Issue is that due to the strange definition of render in grease pencil
(meaning should be rendered similar to rendering). This included normal
viewport rendering in OB_RENDER and OpenGL render in OB_RENDER.

For other rendering modes the overlay vertex opacity would be used. This
patch sets this value to 1 when rendering via a scene strip override.

NOTE: that this isn't a good solution as I expect that users want to use
the opacity of the Grease pencil object. Perhaps the GPencil team has a
better solution for it.
2021-05-25 15:18:06 +02:00
1bdd5becc7 Unreported fix: vertex colors overlay not set for new 3d views.
Found during researching {T86956}.
2021-05-25 15:18:06 +02:00
5fddb5ab62 Merge branch 'blender-v2.93-release' 2021-05-25 15:09:54 +02:00
0f7becece7 Fix T88551: Crash accessing uninitialized tool settings
Tool settings for sequencer were not initialized, which caused crash
when adding strips.

There was fix for same issue in versioning rB0f81dafe6cec, but
subversion was not bumped, so files with uninitialized tool settings
may still exist.

Add `SEQ_tool_settings_get()` accessor function that will initialize
tool settings if they are missing. Change operator code to use
`SEQ_tool_settings_fit_method_get()` function instead of accessing
tool settings directly

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D11383
2021-05-25 15:08:32 +02:00
cccfcca33d Cleanup: use nullptr 2021-05-25 13:37:50 +02:00
067587e329 Cleanup: remove unused function 2021-05-25 13:12:54 +02:00
405534c756 Cleanup: remove unnecessary lambda capture 2021-05-25 13:10:44 +02:00
768d4c6cfe Fix T88549: ID sorting tests.
Forgot to initialize the ID types array...

Weird though that this only failed on Windows!

Thanks a lot to @deadpin for helping investigating this.
2021-05-25 12:16:24 +02:00
0a7bd3b6d2 Fix T88464: Incorrect baking with camera markers.
This will update active camera based on the maker for each frame.

Reviewed By: Sebastian Parborg (zeddb), Antonio Vazquez (antoniov)

Differential Revision: https://developer.blender.org/D11358
2021-05-25 16:51:26 +08:00
e3faef686d Fix/Refactor RNA ID preview getter creating preview data.
Same as with forcefields, accessors should never generate data.
2021-05-25 10:38:56 +02:00
ad447705c0 Cleanup: spelling 2021-05-25 18:25:55 +10:00
8c7766dc03 Cleanup: clang-format 2021-05-25 18:25:44 +10:00
Pratik Borhade
0606a37e1a Fix T88500: Constrain window top position (Win32)
Do not allow a window to be created that has a top position that
can obscure all or part of title bar. Right and Left edges can
still be specified slightly outside of monitor bounds, but top
edge must be clamped to monitor top.

see D11371 for more details.

https://developer.blender.org/D11371

Reviewed by Ray Molenkamp
2021-05-24 11:46:35 -07:00
9c53690b30 Merge branch 'blender-v2.93-release' 2021-05-24 12:30:24 -03:00
1a69d491e5 Fix T88478: Fallback to dolly not working when moving the camera in camera view
This fallback is an old hack.

It is difficult to have an orientation convention when several random
factors determine which one should be used.

In this case, to "fix" the problem, a new behavior had to be implemented.
Now the redo when moving the camera in `Camera View` has the default
orientation as `View`.
2021-05-24 12:29:37 -03:00
2265104f0b Fix (unreported): Automatic transform contraint not being disabled
It does not make sense to maintain automatic constraint selection when
you manually set the constraint.
2021-05-24 11:39:50 -03:00
197fa644ee Cleanup: Rename transform enum items
Make them more descriptive.
2021-05-24 11:35:33 -03:00
1318cb26fe Cleanup: Refactor PlaneTrack and PlaneDistort operations
Deduplicates code by introducing a PlaneDirtortBaseOperation for common logic.

Reviewed By: #compositing, jbakker

Differential Revision: https://developer.blender.org/D11273
2021-05-24 14:31:55 +02:00
Charlie Jolly
6c2c16b5f8 Nodes: move shader curves node to C++
Prepare node for conversion to Geometry Nodes.

There should be no functional changes.

Reviewed By: JacquesLucke, LazyDodo

Differential Revision: https://developer.blender.org/D11226
2021-05-24 12:02:49 +01:00
24004e74fa Fix T88524: GPencil PDF does not take into account the marker camera
The camera was not checked before doing the export.
2021-05-24 12:36:13 +02:00
43153e2324 Fix T88466: Sound strips prevent strip rendering
When sound strip is above another strip such as movie strip, it prevents
from rendering movie strip.

This bug was introduced in 0b7744f4da. Function `must_render_strip()`
checks if there is any strip with `SEQ_BLEND_REPLACE` blending and
considers this strip as lowest strip in stack. Sound strips do have this
blend mode set, which caused the bug.

Remove all sound strips and muted strips from stack collection before
checking with `must_render_strip()` function
2021-05-24 05:57:53 +02:00
7e841c797f UI: Use title case for labels 2021-05-23 15:31:54 -04:00
9dcbc195ad Docs: Add readme for mikktspace 2021-05-23 13:57:22 -04:00
f7b22fc3d2 Cleanup: remove redundant property for transfer_mode key-map item
As the property isn't saved and defaults to disabled,
there is no need to set it.
2021-05-22 14:53:41 +10:00
7adbe62a09 Cleanup: tweaks for Object Non-modal keymap
Simplify adding non-legacy keymap items.
2021-05-22 13:14:28 +10:00
2175cbe2ce Cleanup: Move curve draw cache implementation to C++
I'd like to use this file to draw curves from geometry nodes, which
would otherwise require implementing a C API. The changes in this
commit are minimal, mostly just casts and changing to nullptr.

Differential Revision: https://developer.blender.org/D11350
2021-05-21 17:28:29 -04:00
2521e17a58 Merge branch 'blender-v2.93-release' 2021-05-21 14:44:17 -04:00
d5c3bff6e7 Fix T87357: Missing update after removing socket
The CoW copy of the node group was not updated correctly after it
changed. Arguably, tagging the node tree could also be part of
`ntreeUpdateTree` (which needs to be called after changes to the
node tree anyway). However, there are many instances where the
depsgraph is tagged explicitly after `ntreeUpdateTree` is called,
so it should be fine here as well. This is similar to what is done
in `snode_dag_update`.

Differential Revision: https://developer.blender.org/D11342
2021-05-21 14:43:26 -04:00
Wayde Moss
9c4ecef62f Fix T88375: Bone Size Small After V3D.View_All
The wrong matrix function was used and overwrote the custom bone shape
scale instead of reading from it.

Reviewed By: sybren

Differential Revision: https://developer.blender.org/D11330
2021-05-21 13:24:55 -04:00
4fb052f08d Fix T88384: Improved Win32 Window Sizing and Positioning
When creating Win32 windows, the sizes and placements can be out by a
small amount, mostly noticeable near monitor edges. This is because
Windows 10 includes a thin invisible border (typically 7 pixels) when
determining position. Therefore the correct values can sometimes be
just outside the monitor bounds, but we clamp them at those bounds.

This patch fixes this by first clamping the requested values to monitor
bounds, adjusting for window chrome with AdjustWindowRectEx(), and then
using those adjusted values in CreateWindowExW().

see D11314 for more details.

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

Reviewed by Ray Molenkamp
2021-05-21 09:34:58 -07:00
24deeee09e Fix some RNA physics accessors creating data.
Accessing data through RNA should never implicitely create it. Objects'
and particles' forcefields and collision settings were doing this.

Note that UI code also had to be tweaked to properly handle `None`
(NULL) cases.

Differential Revision: https://developer.blender.org/D11341
2021-05-21 17:22:43 +02:00
adf2f146d8 Fix particle ID init not creating particle deflect data.
This data (the force fields) are expected to always be there, but they
are currently created on the fly by RNA accessors (typically from UI
draw code), which is extremely wrong way to do it.

Differential Revision: https://developer.blender.org/D11341
2021-05-21 17:22:43 +02:00
305b08b521 GPencil: Speed up Occlude Eraser
This is an initial change to speed up the calculation of the Occlude eraser. In the future, we can add more optimizations, but at least this increase speed.

Intead to check always the 3 points, the check is skipped if it's not required.

Base in a solution by Philipp Oeser.

This is related to T88412
2021-05-21 17:00:33 +02:00
5158d1b42d Cleanup: use nullptr 2021-05-21 15:09:22 +02:00
Leon Zandman
865d1889da Cleanup: spelling
Includes fixes to misspelled function names.

Ref D11280
2021-05-21 22:23:07 +10:00
cf42586737 Fix T85752: Collection Instance Crash when instancing collections with disabled subcollections
Root of the issue was actually hidden deep in depsgraph itself: it would
not properly update all of its COW IDs using a datablock when depsgraph
decides to evaluate or un-evaluate it.

This would lead to evaluated IDs pointing to either:
 - orig IDs when there was an evaluated version of those (annoying bug,
   but not a crashing one).
 - old address of previously evaluated IDs that no longer exists in the
   depsgraph (causing the crash from the report e.g.).

This commit adds an extra step at the end of nodes building, that goes
over all of already existing IDs in the depsgraph to check whether they
do one of the two things above, and tag them for COW update if so.

NOTE: This only affects depsgraph (re-)building, not its evaluation.
This remains consistent with the fact that operations that may change
the depsgraph content (like Collection exclusion etc.) need to trigger a
rebuild.

NOTE: Performances: Worst case scenarii, like (un-)excluding a whole
character collection in a production file, lead to 5% to 10% extra
processing time in depsgraph building. Most of it comming from extra COW
processing (in depsgraph's update in `build_step_finalize`), the detection
loop itself only accounts for 1% to 2% of the whole building time.

Maniphest Tasks: T85752

Differential Revision: https://developer.blender.org/D10907
2021-05-21 12:43:32 +02:00
ff51c2e89a Cleanup: Use named unused arguments in Cycles Device 2021-05-21 11:19:33 +02:00
c154b078b5 Geometry Nodes: new Material Replace node
This node can change all faces that use a specific material to use a
different material. Using this node is significantly more efficient
than creating a selection from all faces with a specific material
index and then using the Material Assign node.

Ref T88055.

Differential Revision: https://developer.blender.org/D11325
2021-05-21 09:43:55 +02:00
aa6f0f3d1f Depsgraph: remove mesh edit-mode pointer duplication
Share the pointer with the original mesh instead, this matches behavior
of all other objects edit-mode data.

Duplicating the edit-mesh pointer makes updates to edit-mesh require
a COPY_ON_WRITE update, which is currently an expensive operation
(copying the entire mesh).

Notes:

- This change is from 802027f3f8
  so the edit-meshes object pointer `BMEditMesh.ob` referenced the COW
  version of the object. This pointer has since been removed, so the
  copy is no longer needed.

- Having a separate edit-mesh pointer could be used so linked duplicates
  could have their own generated meshes. For this to be supported,
  many other changes would be needed: see D10920.
2021-05-21 16:23:42 +10:00
12a91f7f5d Fix T88227: Eevee not working on AMD 535 cards.
Enabled HQ normals workaround for this specific configuration.
2021-05-21 07:46:20 +02:00
2b640622ff Transform: use ID_RECALC_GEOMETRY flag when updating object data
While this doesn't provide any noticeable benefits at the moment,
it allows for geometry updates skipping copy-on-write in edit-mode
in the future.
2021-05-21 15:45:25 +10:00
b13953b1f2 Cleanup: quiet -Warray-parameter warnings from GCC11
Some warnings remain that require larger changes.
2021-05-21 15:45:25 +10:00
6c6551c398 Cleanup: conversion warning 2021-05-21 15:45:23 +10:00
9bbee7dd92 Fix T88227: Eevee not working on AMD 535 cards.
Enabled HQ normals workaround for this specific configuration.
2021-05-21 07:44:25 +02:00
Iyad Ahmed
a43c7538b8 Eevee Wavelength Node Support
This patch adds wavelength node support to Eevee, similar to how
Eevee Blackbody node works, thus it is a little off from Cycles.

Reviewed By: #eevee_viewport, fclem, brecht
Differential Revision: https://developer.blender.org/D11326
2021-05-21 10:25:47 +05:30
b18d5dac53 Transform: remove ID_RECALC_SELECT for edit-mode armatures
This was added in 9516921c05
so overlays would redraw, as far as I can see it's no longer needed.

Reviewed By: fclem

Ref D11322
2021-05-21 10:58:07 +10:00
ba9cf91736 Cleanup: spelling 2021-05-21 01:06:20 +02:00
695fa3a4a1 Merge branch 'blender-v2.93-release' 2021-05-20 20:48:44 +02:00
6a0906c09a Fix T87854: Add clamp option to Path Animation
Previously, the "follow path constraint" and "follow parented curve"
were clamped.  This restriction was lifted in rBcf2baa585cc8

Add back an option to get the old behavior in the "Path animation" settings.

Reviewed By: Sybren

Differential Revision: http://developer.blender.org/D11263
2021-05-20 20:41:10 +02:00
1400fdf558 Fix petty comment.
I'm embarrassed this was in our codebase for 18 years
2021-05-20 12:38:01 -06:00
ef04fd9571 GPencil: Fix missing annotations in VSE strip
Since version 2.80, the annotations of the Scene strip were not displayed in VSE. Also, the UI panel was`Grease Pencil` and must be `Annotation`

The problem was the offscreen render hasn't evil_CTX and the section of the annotation was never called.

Differential Revision: https://developer.blender.org/D11329
2021-05-20 20:16:59 +02:00
677909cdc3 Merge branch 'blender-v2.93-release' into master 2021-05-20 21:58:34 +05:30
2e7d3ad7b5 macOS build: set minimum deployment target correctly
Make `CMAKE_OSX_DEPLOYMENT_TARGET` independent of buildbot settings and
always set to `OSX_MIN_DEPLOYMENT_TARGET`. That fixes the launch error
on OS older than buildbot's.
Remove unused `MACOSX_DEPLOYMENT_TARGET`.

Fix T88419
Diff D11323
2021-05-20 21:55:58 +05:30
9fef934530 Merge branch 'blender-v2.93-release' 2021-05-20 12:20:05 -04:00
991a1cdf5d Fix T87316: No undo push for clicking on attribute name
Since there is a special callback for assigning the name from the
search box, and the callback doesn't call an operator or something
else that would do an undo push, I think the solution is to do it
manually here.

Another option would be adding the button flag "UI_BUT_UNDO", which
isn't set by default for search buttons, but that gives us ugly names for
the undo steps, so an explicit push is better in this case.

Differential Revision: https://developer.blender.org/D11190
2021-05-20 12:17:54 -04:00
cd16123761 GPencil: Adding length modifier.
Reviewed By: Antonio Vazquez (antoniov)

Differential Revision: https://developer.blender.org/D8264
2021-05-20 23:35:53 +08:00
ee5bfde9e6 Fix T87947: Trasnform: Keyboard input uses view orientation
When activated in modal, `translate`, `resize`, `rotate`, `shear` and
`edge_rotate_normal` use a different orientation than the set in scene.

This orientation needed to match since some of these modes can be switched
during operation.

The default orientation for these modes was `V3D_ORIENT_VIEW`.

And this changed when finishing the `translate` and `resize` to
`V3D_ORIENT_GLOBAL`.

But this could cause inconsistencies when inputting values from the
keyboard.

The solution now is to change the orientation when you change the mode.

---
Note: Although the user can expect the value entered to reflect the
orientation set in the scene, it would require a lot of changes and would
not be really useful.
2021-05-20 11:05:44 -03:00
47f4f3c932 Cleanup: Use enum to indicate the current orientation
Improves readability.
2021-05-20 11:05:28 -03:00
4bb2a5b5cb Fix T88345: Blender crash on GPUFrameBuffer creation
Misuse of indexes.

`color_attachements` has only color ones while `config` has color and depth.
2021-05-20 11:04:04 -03:00
92178c7e0e Fix T88365: GPUTexture.read returning a buffer with wrong size
The pixel components were not being considered.
2021-05-20 11:03:47 -03:00
729c579030 Fix T88313: GPencil reproject operator projecting on the wrong surface
`ray_start` must start at the position of the gpencil point.
2021-05-20 11:03:24 -03:00
933999db75 Cleanup: rename incorrectly named experimental feature flag
The `WITH_GEOMETRY_NODES` flag does not make sense anymore,
it is just protecting the `Simulation` data block that is not used
currently.
2021-05-20 14:39:30 +02:00
0745afeddb Merge remote-tracking branch 'origin/blender-v2.93-release' 2021-05-20 13:00:07 +02:00
dreamertooth
a1954e3807 Fix T86193: Bake Action, wrong rotation order for bones
Use bone rotation order to compute the baked rotation. This fixes a bug
introduced in rB0e85d701c654, where the object rotation order was
applied to the bone.

Maniphest Tasks: T88359, T86193

Reviewed By: sybren, GuiltyGhost, #animation_rigging

Differential Revision: https://developer.blender.org/D11282
2021-05-20 12:57:05 +02:00
3e3ecc329c Geometry Nodes: new Material input node
This node is similar to the Value and Vector node.
It just provides a way to use the same material in multiple nodes
without exposing it outside of a node group.

Differential Revision: https://developer.blender.org/D11305
2021-05-20 12:29:06 +02:00
f41a753e75 Geometry Nodes: new Material Assign node
This adds a new Material Assign node. It can be used to change the
material used by an existing mesh or to assign a material to a mesh
that has been generated from scratch.

Differential Revision: https://developer.blender.org/D11155
2021-05-20 12:22:13 +02:00
f3a0267016 Materials: support materials when applying modifier
This fixes the `Apply Modifier` and `Visual Geometry to Mesh` operator
when a modifier changed materials on the evaluated geometry.

This is necessary since rB1a81d268a19f2f1402f408ad1dadf92c7a399607.

Differential Revision: https://developer.blender.org/D11303
2021-05-20 12:15:57 +02:00
b51bd859fd Fix: wrong rna pointer for material slot
This was missing from rB1a81d268a19f2f1402f408ad1dadf92c7a399607.
2021-05-20 12:14:31 +02:00
b084b57fbf Geometry Nodes: new geometry nodes evaluator
The old geometry nodes evaluator was quite basic and missed many features.
It was useful to get the geometry nodes project started. However, nowadays
we run into its limitations from time to time.

The new evaluator is more complex, but comes with new capabilities.
The two most important capabilities are that it can now execute nodes in
parallel and it supports lazy evaluation.

The performance improvement by multi-threading depends a lot on the specific
node tree. In our demo files, the speedup is measurable but not huge. This
is mainly because they are bottlenecked by one or two nodes that have to be
executed one after the other (often the Boolean or Attribute Proximity nodes)
or because the bottleneck is multi-threaded already (often openvdb nodes).

Lazy evaluation of inputs is only supported by the Switch node for now.
Previously, geometry nodes would always compute both inputs and then just
discard the one that is not used. Now, only the input that is required
is computed.

For some more details read D11191, T87620 and the in-code documentation.

Differential Revision: https://developer.blender.org/D11191
2021-05-20 11:35:13 +02:00
44e7192745 Cleanup: spelling 2021-05-20 17:55:35 +10:00
a5ac062c51 Cleanup: inconsistent parameter names 2021-05-20 09:00:42 +02:00
7655cc45eb VSE: Fix select strips at current frame feature
This feature of `select_side_of_frame` was disabled by removing option
from operator property enum but functional code was never removed.

Add back option to use this feature.

Feature was disabled due to keymap issue. Currently this feature doesn't
have keymap assigned.
2021-05-20 05:06:32 +02:00
acba8f617b Cleanup: Remove unused define
References to `SEQ_CACHE_COST_MAX` were removed in 38b77ef8b2.
2021-05-20 04:25:56 +02:00
47e88345a1 VSE: Fix animation duplication in split operator
Due to misunderstanding of how strip duplication works, animation data
was duplicated on all strips when any strip was split.

`SEQ_sequence_base_dupli_recursive()` duplicated data on strip that was
being split, and `SEQ_ensure_unique_name()` duplicated animation on all
strips.

Only duplication should be done with `SEQ_ensure_unique_name()` and only
on right side split strips, because only these strips are duplicated.
2021-05-20 01:27:12 +02:00
d1c9a99c07 Splines: Optimize interpolation in special case virtual array
When the input data is a virtual array for a single value, we don't need
to run any of the interpolation, instead just copy the input data.
2021-05-19 17:17:16 -04:00
0b7744f4da VSE: Fix rendering inconsistency
Fix issue described in T87678, which was partially a bug and partially
change in intended(at least as far as I can tell) behaior.

Function `evaluate_seq_frame_gen` that was partially responsible for
filtering strips in stack for rendering wasn't working correctly.
Intended functionality seems to be removing all effect inputs from stack
as it is unlikely that user would want these to be blended in. However
there was logic to exclude effects placed into same input, which because
of weak implementation caused, that any effect input, that is effect as
well will be considered to be part of stack to be blended in.
This bug was apparently used to produce effects like glow over original
image.

Even though this is originally unintended, I have kept this logic, but
I have made it explicit.

Another change is request made in T87678 to make it possible to keep
effect inputs as part of stack when they are placed above the effect,
which would imply that blending is intended. This change is again
explicitly defined.

Whole implementation has been refactored, so logic is consolidated
and code should be as explicit as possible and more readable.
`must_render_strip function` may be still quite hard to read, not sure
if I can make it nicer.

Last change is for remove gaps feature code - it used same rendering
code, which may be reason why its logic was split in first place.
Now it uses sequencer iterator, which will definitely be faster than
original code, but I could have used `LISTBASE_FOREACH` in this case.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D11301
2021-05-19 22:59:33 +02:00
97cf2a9fb1 VSE: Refactor sorting functions
Recently `SEQ_sort()` function was split so functionality is provided
on per-seqbase basis. After discussion about this split, it turned out,
that per-seqbase operation is only that should be provided, because
RNA API functions need to be able to access arbitrary seqbase

Remove recently introduced function `seq_sort_seqbase` and change
`SEQ_sort` function to operate on seqbase.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D11297
2021-05-19 22:52:57 +02:00
58893eaef8 Cleanup: Use consistent order for functions in node files
After this commit, all geometry node "init" and "update" functions are
at the top of each file, right below the "layout" function. This means
you can always scroll to the bottom of the file to see the entry point,
and the boring boilerplate code is grouped in one section.
2021-05-19 16:13:05 -04:00
3d604ba867 Geometry Nodes: Execute point rotate node on curve component
When adding attributes on the curve component, I missed calling this
node's execute function on the curve component, like the other nodes.
2021-05-19 15:58:34 -04:00
627f357127 Geometry Nodes: Support for dynamic attributes on curve splines
With this patch you will be able to add and remove attributes from curve
data inside of geometry nodes. The following is currently implemented:
* Adding attributes with any data type to splines or spline points.
* Support for working with multiple splines at the same time.
* Interaction with the three builtin point attributes.
* Resampling attributes in the resample node.

The following is not implemented in this patch:
* Joining attributes when joining splines with the join geometry node.
* Domain interpolation between spline and point domains.
* More efficient ways to call attribute operations once per spline.

Differential Revision: https://developer.blender.org/D11251
2021-05-19 13:22:09 -04:00
192a3f1a05 Cleanup: Use copy constructor for CurveEval
There is no need for a special "copy" method with a copy constructor,
which will be necessary to explicitly copy attributes anyway.
2021-05-19 13:02:53 -04:00
0456223cde Fix T87793: Cycles OptiX crash hiding objects in viewport render 2021-05-19 18:30:43 +02:00
3e472d87a8 Cycles OpenCL: disable AO preview kernels
These seem to be causing some stability issues, and really are just not that
useful in practice. Compiling them is slow already, so it does not improve
the user experience much to show an AO preview if it's not nearly instant.
2021-05-19 18:30:43 +02:00
Severin
330fecc9b7 Assets: Use textures (and shadows) for automatic object previews
Textures may be important to be able to identify an object. They are also a way
to make many objects look more like when rendered with an advanced render
engine, without being that expensive.
So this seems like a simple way to increase usefulness of the automatic
previews.
2021-05-19 17:57:51 +02:00
857f39a3d7 GPencil: Apply NanoSVG fix
This fix is ported from official NanoSVG git
2021-05-19 17:56:26 +02:00
23b642cbb4 IDManagement: Enable ID sorting test for linked IDs. 2021-05-19 17:50:22 +02:00
ca74ebc96e IDManagement: Do not prevent sorting of linked IDs in BKE_id_new_name_validate.
While this function should (currently) not be called on linked ID, there
is no reason to treat those differently than local IDs, for the part
that they have in common: needs to be properly sorted.
2021-05-19 17:50:22 +02:00
3620dbbe97 IDManagement: Fix ID sorting in case of linked IDs.
`id_sort_by_name` would simply not deal properly with linked IDs, could
lead to mixing IDs from different libraries, and unsorted IDs within the
same library.
2021-05-19 17:50:22 +02:00
c810672ea7 IDManagement: Add basic test regarding id sorting in their listbase.
Note that while sorting of local IDs is fine, currently sorting of
linked IDs is a total unpredictable failure.

Next commit will fix this, ensuring that linked IDs are grouped by their
library, and properly name-sorted within this library group.
2021-05-19 17:50:22 +02:00
ee5ad46a0e Fix T87621: Win32 Do Not Create Preview Thumbnails for Offline Files
This patch turns off the creation of file thumbnails for files that are
offline and therefore not fully-present on the file system. These types
of files - typically cloud-based or stored on slower backup media -
only have their contents available when actually accessed, at which
point there will be a short delay. If we allow thumbnail creation in
this state then all offline files in a folder will be downloaded just
to view a listing, which can take a long time.

Files in this state will instead get a more generic thumbnail that
still indicates file type (icon in center) and that shows offline state
will a special icon at the bottom-left.

Although this currently only affects Windows users, most of this patch
is platform-agnostic. So other platforms inherit this behavior if they
only add FILE_ATTR_OFFLINE attribute to files in this state.

See D11101 for more information.

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

Reviewed by Julian Eisel
2021-05-19 08:40:00 -07:00
41b912925c Blender LTS: match download urls with latest changes in buildbot. 2021-05-19 16:41:51 +02:00
0fa4286ade Blender LTS: match download urls with latest changes in buildbot. 2021-05-19 16:39:22 +02:00
38450fc916 Merge branch 'blender-v2.93-release' 2021-05-19 13:58:16 +02:00
Pratik Borhade
9e6c4be731 Fix T88167: Regression: no tooltip for syringe/picker, during picking object
Fix T88167.

Caused by {rB97defd9cd79b6e3ed0e52481a7078107dbe0522b}

`(BLI_rcti_isect_pt` used here to confirm if cursor position is in between active region boundary.
Subtracting min region boundary from the mouse position before the check, fails the condition.

`mval[2]` introduced to hold the region relative mouse position.

Reviewed By: Severin

Maniphest Tasks: T88167

Differential Revision: https://developer.blender.org/D11224
2021-05-19 13:47:40 +02:00
afb66b3c3a Cleanup: use nullptr 2021-05-19 13:04:12 +02:00
c5a898bcac Merge branch 'blender-v2.93-release' 2021-05-19 12:32:06 +02:00
d67223ca29 EEVEE: Subsurface Node: Fix inverted texture blur input
Fixes T86097 EEVEE Subsurface Node give blurry edges
2021-05-19 12:27:38 +02:00
81e3d904db Merge branch 'blender-v2.93-release' 2021-05-19 12:17:23 +02:00
Mikhail Matrosov
a294670bac EEVEE: Geometry info -> tangent: Make consistent with Cycles for hair
Changes output for geometry info node in Eevee to be consistent with Cycles (w/o osl)

Before this patch Eevee outputs Z-tangent even for hair. This patch changes it to output hair tangent (growth direction). Hair tangent is impossible to derive otherwise from normal or view direction.

Reviewed By: fclem, brecht
Differential Revision: https://developer.blender.org/D10841
2021-05-19 12:14:07 +02:00
7adb415070 Geometry Nodes: don't show grease pencil materials for now
Those materials cannot be on geometry handled by geometry nodes yet.
So it makes sense not to show those materials in the material socket.
2021-05-19 11:44:10 +02:00
5e6f3b8564 Geometry Nodes: take materials into account when joining geometries
Materials are now kept intact when using the Join Geometry node
or when realizing instaces.
2021-05-19 11:02:25 +02:00
02b80276b3 Fix issue in previous commit
When `PointerRNA->data` was null, it was interpreted as being
`None` in Python. This caused the materials slots to not show
correctly in the ui.
2021-05-19 10:51:36 +02:00
1a81d268a1 Materials: support changing materials during evaluation
This commit allows that the evaluated geometry of an object has
different materials from the original geometry. This is needed
for geometry nodes.

The main thing that changes for render engines and exporters
is that the number of material slots on an object and its geometry
might not match anymore. For original data, the slot counts are
still equal, but not for evaluated data.

Accessing material slots though rna stays the same. The behavior
adapts automatically depending on whether the object is evaluated.

When accessing materials of an object through `BKE_object_material_*`
one has to use a new api for evaluated objects:
`BKE_object_material_get_eval` and `BKE_object_material_count_eval`.
In the future, the different behavior might be hidden behind a more
general C api, but that would require quite a few more changes.

The ground truth for the number of materials is the number of materials
on the geometry now. This is important in the current design, because
Eevee needs to know the number of materials just based on the mesh in
`mesh_render_mat_len_get` and similar places.

In a few places I had to add a special case for mesh edit mode to get it
to work properly. This is unfortunate, but I don't see a way around that
for now.

Differential Revision: https://developer.blender.org/D11236
2021-05-19 10:23:09 +02:00
5239198f17 Fix T88362: Lineart countour rendering error
This is caused by lacking of consideration of
OB_DUPLICOLLECTION in updateDepsgraph() in the
modifier.

Reviewed by: Antonio Vazquez (antoniov)

https://developer.blender.org/D11292
2021-05-19 15:09:40 +08:00
d373b43f07 VSE: Better handling of effect strip splitting
Splitting of effect strip alone wasn't handled properly. Previously
this resulted in duplicating effect strip, and it was broken at least
from 2.79.

Change in rB8ec6b34b8eb2 was intended to allow splitting strips
individually, so it can be used as RNA API function but also so it
requires as little glue logic as possible.

This is fixed by splitting all dependent strips at once in 2 separate
ListBases for left and right strips. Strips can be finally moved into
original `ListBase`.

With this fix it is still possible to split strips individually with
little glue logic. RNA API function could return list of split strips
as well, currently at least one strip in chain will be provided so
chain can be reconstructed on python side.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D10209
2021-05-18 23:41:47 +02:00
f7a14c116c VSE: Move whole strip chain to meta
Python API function Sequence.move_to_meta() did delete effect chain
when strip with effects was moved.

Use iterator API to query effect strips and move whole chain to meta.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D11206
2021-05-18 23:41:47 +02:00
748b5f025d Merge branch 'blender-v2.93-release' 2021-05-18 22:37:38 +02:00
8dd43ac23e Fluid: Updated Mantaflow source files
Includes update for OpenVDB file IO, i.e. fixes an issue with
compression flag combination that resulted in random segfaults.

Other changes: Cleanup and formatting.
2021-05-18 22:36:51 +02:00
5400be9ffe Fix T88313: GPencil reproject operator projecting on the wrong surface
`ray_start` must start at the position of the gpencil point.
2021-05-18 17:31:10 -03:00
f9567f6c63 Alembic: read/write generated coordinates of meshes
Read and write generated coordinates (also known as "original
coordinates", "reference coordinates", or "orcos") from and to Alembic.
A custom geometry property named "Pref" is used for (hopefully)
interoperability with Maya and Houdini. For now it's only guaranteed for
Blender-to-Blender.

Export: writing generated coordinates is optional (on by default).

Import: generated coordinates are always read whenever the reading of
vertex data is enabled.

Manifest Task: T88081
2021-05-18 19:01:57 +02:00
a881b5272b Fix ID copying outside of Main affecting 'directly linked' status of other IDs.
Copying an ID outside of BMain should not assume that the datablocks it
uses are now directly linked. This would be wrong e.g. in case that new
no-main ID is copied from a linked data-block and is supposed to remain
a linked data.
2021-05-18 18:44:39 +02:00
3826c161ad Cleanup: typo in comment. 2021-05-18 18:44:39 +02:00
019ab774d4 Merge branch 'blender-v2.93-release' 2021-05-18 16:17:29 +02:00
1b909c726b Fix build warning
Value of the size argument in `strncat` is too large, might lead to a
buffer overflow.

Change the argument to be the free space in the destination buffer
minus the terminating null byte.

Introduced in 5368859a66

Reviewed By: Sergey

Differential Revision: https://developer.blender.org/D11289
2021-05-18 16:15:08 +02:00
7aa7cc4ca1 Merge branch 'blender-v2.93-release' 2021-05-18 15:43:06 +02:00
a9da73ab95 Fix T88370: GPencil render crash when use viewlayer and masking
When filtering the render using view layer, could be possible the mask is NULL and just need to be ignored.
2021-05-18 15:42:26 +02:00
2b660e825b Fix T88365: GPUTexture.read returning a buffer with wrong size
The pixel components were not being considered.
2021-05-18 10:01:29 -03:00
b158477551 Fix ocean modifier giving different result on Arm than x86
And re-enable the test on macOS Arm.

Ref T78710
2021-05-18 14:40:22 +02:00
ea7b00c64f Fix T88345: Blender crash on GPUFrameBuffer creation
Misuse of indexes.

`color_attachements` has only color ones while `config` has color and depth.
2021-05-18 09:39:31 -03:00
4402c3006b WM: check missing space-data & constraints in poll functions
Without this, menu search prints many errors in some contexts.
2021-05-18 20:57:40 +10:00
eaf3160f13 Merge branch 'blender-v2.93-release' 2021-05-18 12:52:29 +02:00
53376ec7fc Tests: Disabled physics ocean test on macOS arm64
Test is failing and needs further investigation.
2021-05-18 12:48:35 +02:00
f4eae747f9 Tests: Remove threshold param from physics ocean mesh test
This was not the reason for the test failure on macOS arm64.
2021-05-18 12:44:53 +02:00
1f9eb7e2c6 Merge branch 'blender-v2.93-release' 2021-05-18 19:59:20 +10:00
aa06be9148 Fix error calling select-camera without a 3D view 2021-05-18 19:58:11 +10:00
97f1e4782a Cycles: Avoid unnecessary data updates in viewport
The BlenderSync will do quite a bit of work on every sync_data() call
even if there is nothing changed in the scene. There will be early
outputs done deeper in the call graph, but this is not really enough to
ensure best performance during viewport navigation.

This change makes it so sync_data() is only used when dependency graph
has any update tags: if something changed in the scene the dependency
graph will know it. If nothing changed there will be no IDs tagged for an
update in the dependency graph.

There are two weak parts in the current change:

- With the persistent data there is a special call to ignore the check
  of the dependency graph tags. This is more of a safety, because it is
  not immediately clear what the correct state of recalc flags is.

- Deletion of objects is detected indirectly, via tags of scene and
  collections.

It might not be bad for the first version of the change.

The test file used: {F10117322}

Simply open the file, start viewport render, and navigate the viewport.
On my computer this avoids 0.2sec spend on data_sync() on every
up[date of viewport navigation.

We can do way more granular updates in the future: for example, avoid
heavy objects sync when it is only camera object which changed. This
will need an extended support from the dependency graph API. Doing
nothing if nothing is changed is something we would want to do anyway.

Differential Revision: https://developer.blender.org/D11279
2021-05-18 10:13:09 +02:00
1c1fa15ce1 Merge branch 'blender-v2.93-release' 2021-05-18 17:48:14 +10:00
b236653f8a Fix error in grease pencil flip color operator
- Used try/except instead of a poll function.
- The error case referenced a non-existent error handling module.

Prefer poll functions over exception handling where possible,
also having an operators logic in a try block isn't good practice
as it can hide more serious errors in the code.

Note that duplicate pencil settings access should be moved into a
utility function. This can be part of a separate cleanup.
2021-05-18 17:38:54 +10:00
8a26fec6ea Cleanup: use const casts in mathutils API 2021-05-18 14:16:34 +10:00
4dfbaa34c9 PyAPI: allow any vector sequence for poly_3d_calc(..)
Previously only vectors were accepted for the second point argument:
mathutils.interpolate.poly_3d_calc()
2021-05-18 14:16:34 +10:00
5e67dcf3d2 Cleanup: format 2021-05-18 06:09:46 +02:00
52e53d61f5 Merge branch 'blender-v2.93-release' 2021-05-18 13:39:39 +10:00
dfb963c70d Fix T88026: Repeated switch to rendered viewport crashes
Resolve ownership ambiguity with shared physics pointers.

Previously, LIB_ID_CREATE_NO_MAIN allowed pointer sharing with
the source ID so physics caches can be shared between original and
evaluated data: (Object.soft.shared & Object.rigidbody_object.shared).

This only worked properly for LIB_TAG_COPIED_ON_WRITE ID's,
as LIB_TAG_NO_MAIN can be used in situations where the original ID's
lifetime limited by it's original data.

This commit adds `LIB_ID_COPY_SET_COPIED_ON_WRITE` so ID's only share
memory with original data for ID's evaluated in the depsgraph.

For all other uses, a full copy of physics data is made.

Ref D11228#287094
2021-05-18 13:35:00 +10:00
cdc1ddf20b Cleanup: clang-format 2021-05-18 12:53:27 +10:00
8057b98572 Alembic procedural: fix wrong property used as base for attribute
lookups

We use the schema so that we can access top level attributes as well.
This is already done for polygon meshes and curves, so this only
modifies the behavior for subdivision objects.
2021-05-18 00:59:29 +02:00
38fe8d8b38 Alembic procedural: fix crash accessing invalid ICompoundProperties
Although it is not a pointer, accessing an ICompoundProperty
dereferences a pointer under the hood, so check for validity.
2021-05-18 00:56:45 +02:00
73080ddf38 Add comment regarding Fade Inactive Geometry property in overlays popover
Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D11249
2021-05-18 00:51:35 +02:00
f96a0f384d Merge branch 'blender-v2.93-release' 2021-05-18 00:32:48 +02:00
ea11b4e10c Fix T88230: Properly handle Face Set visibility in Expand Face Sets editing
Expand is not expected to update the visibility state of the PBVH, only
the Face Sets IDs. If visibility updates are made accidentally, PBVH
rendering breaks.

In order for this to work properly, the following fixes are needed:

- Expand should always check for active component before attempting to
 modify a Face Set ID

- Expand should always check the visibility state on original_face_sets, as
it is the array that contains the visiblilty state that corresponds with the
current state used for PBVH rendering. This implies that after any modification
done by Expand, the visibility state of ss->face_sets and
expand_cache->original_face_sets should match (like in any other tool that
does not modify visibility).

- Expand should never modify the Face Set ID of a poly that is hidden in
expand_cache->original_face_sets.

- When deleting an ID, hidden Face Sets should be skipped when picking IDs for
content filling. This avoids introducing hidden IDs back into the visible
geometry even after updating its visibility state.

Reviewed By: JulienKaspar, JacquesLucke

Maniphest Tasks: T88230

Differential Revision: https://developer.blender.org/D11243
2021-05-18 00:30:24 +02:00
c17433bb55 Tests: Increased threshold param for physics_ocean test
Adjusting threshold to see what the buildbot will make of this.
2021-05-17 23:21:16 +02:00
c9afea5bbf Tests: Added threshold to physics ocean mesh test
The physics_ocean test is currently failing on macOS arm.
This is one attempt to fix this issue.
2021-05-17 21:13:35 +02:00
43046d82b7 Collada import: use black for Base Color when missing <diffuse>
Treat a missing <diffuse> the same as a black diffuse color.

The easiest way to see this bug is with a Collada shader like

```
          <constant>
            <emission>
              <color sid="emission">1 0 0 1</color>
            </emission>
          </constant>
```

The Collada spec says this should be just

```
color = <emission>
```

ie. red everywhere. The importer slots the red into the Principled Emission socket, but since it leaves the Base Color as the default off-white, this is added to red, and the material looks white-pink in the light and red only in the shadows.

Putting black in the Base Color makes it look red everywhere.

D10939 will also eliminate the much-less-noticeable specular term for this case.

Reviewed By: gaiaclary

Differential Revision: https://developer.blender.org/D10941
2021-05-17 21:10:05 +02:00
542b8da831 Merge branch 'blender-v2.93-release' 2021-05-17 20:18:39 +02:00
1b0ecb2f89 refactor: minor changes to previous commit
- rename boolean is_zero by more descriptive has_specularity
- add some clarifying comments (and TODO)
2021-05-17 20:04:56 +02:00
Scurest
1a4e7b16b2 Collada import: respect zero-specularity
Collada shaders with black <specular> should import with Specular=0.
(A missing <specular> is the same as black.)

The general specular conversion is hard, but this case is common and easy.
Fixes the specular for all <constant>/<lambert> shaders, and <blinn>/<phong>
shaders with black/omitted <specular>. Before this they all looked too "shiny".

Reviewed By: gaiaclary

Differential Revision: https://developer.blender.org/D10939
2021-05-17 19:56:01 +02:00
85be72c1cc Fix T86278: vertex color baking not working with modifiers
As in the old Blender Internal baking code, this still relies on there being a
good mapping to the original vertices.
2021-05-17 19:41:11 +02:00
912f2b1a29 Fix T85892: disable progressive refine when using adaptive sampling
This is giving too bright pixel values, as the sample scaling and random number
sample are wrong. The proper fix for this is complicated. It will be solved in
Cycles X, for now we disable this combination.
2021-05-17 19:41:11 +02:00
e48cdf3d0d Fix T88216: Cycles persistent data fails with animated object transform in instance 2021-05-17 19:41:11 +02:00
88e884bfc6 Fix T88210: Cycles persistent data failing with image sequences 2021-05-17 19:41:11 +02:00
91a5dbbd17 Fix OpenCL group size performance issue on Intel GPUs
Contributed by Intel. On some scenes like classroom with particular integrated
GPUs this speeds up rendering 1.97x. With other benchmarks and GPUs it's
between 0.99-1.14x.
2021-05-17 19:40:57 +02:00
a86e815dd8 Mathutils: add a Matrix.LocRotScale constructor for combining channels.
Combining location, rotation and scale channels into a matrix is
a standard task, so while it is easily accomplished by constructing
and multiplying 3 matrices, having a standard utility allows for
more clear code.

The new constructor builds a 4x4 matrix from separate location,
rotation and scale values. Rotation can be represented as a 3x3
Matrix, Quaternion or Euler value, while the other two inputs
are vectors. Unneeded inputs can be replaced with None.

Differential Revision: https://developer.blender.org/D11264
2021-05-17 19:12:40 +03:00
f09606cc68 File List: micro optimization in the icon preview
No real functional changes.

When `i` is zero, `filelist_cache_previews_push` was called twice with
the same icon.

This caused the preview to be computed twice when only once is needed.
2021-05-17 09:09:12 -03:00
6cfa8531cc Cleanup: reduce indentation in filelist_cache_previews_push 2021-05-17 08:54:53 -03:00
50eceb2a37 Merge branch 'blender-v2.93-release' 2021-05-17 13:06:59 +02:00
bb32ecadb5 GPencil: Fix unreported error exporting to PDF/SVG with animated camera
Before, the camera parameters were calculated only for first frame. 

If the camera is animated, these values need to be recalculated in order to get the new camera view position and export the strokes as expected.

Also fixed the export of PDF when the view is not in camera view. PDF export, needs to be done in camera view.
2021-05-17 13:05:38 +02:00
Wannes Malfait
ba698f0812 Geometry Nodes: update callbacks with 2 new socket types 2021-05-17 11:11:25 +02:00
7e552b356d Merge branch 'blender-v2.93-release' 2021-05-17 18:04:22 +10:00
e3a76feeef Fix PyAPI doc generation error in 43369ca80e
Files without doc-strings were not included.
2021-05-17 18:02:56 +10:00
Henrik Dick
e95f71bf15 UI: use non-linear sliders
* Boolean Modifier > Fast > Overlap Threshold (Logarithmic).
* Remesh Modifier > Voxel > Voxel Size (Logarithmic).
* Sculpt > Dyntopo > Detail Size (Cubic).

Ref D9074
2021-05-17 17:33:59 +10:00
Henrik Dick
0447aedb96 UI: add non-linear slider support
This patch introduces non linear sliders. That means, that the movement
of the mouse doesn't map linearly to the value of the slider.

The following changes have been made.

- Free logarithmic sliders with maximum range of (`0 <= x < inf`)
- Logarithmic sliders with correct value indication bar.
- Free cubic sliders with maximum range of (`-inf < x < inf`)
- Cubic sliders with correct value indication bar.

Cubic mapping has been added as well, because it's used for brush sizes
in other applications (Krita for e.g.).

To make a slider have a different scale type use following line in RNA:
 `RNA_def_property_ui_scale_type(prop, PROP_SCALE_LOGARITHMIC);`
or:
 `RNA_def_property_ui_scale_type(prop, PROP_SCALE_CUBIC);`

Test the precision, step size and soft-min if you change the scale type
of a property as it will feel very different and may need tweaking.

Ref D9074
2021-05-17 17:33:55 +10:00
45863059f7 Cleanup: remove commented code, use function to access header region 2021-05-17 15:55:00 +10:00
67c40cc51c Cleanup: missing declaration warning 2021-05-17 15:22:19 +10:00
27c0d29138 Cleanup: clang-format 2021-05-17 15:12:41 +10:00
6a771175b6 Cleanup: Fix missing-braces warning on Linux / GCC 2021-05-17 15:05:14 +10:00
0e581f6196 Cleanup: Fix missing-braces warning on macOS Clang 2021-05-16 11:19:21 +05:30
49cb30bb0c Cleanup: Fix inconsistent-missing-override warning
macOS Clang
2021-05-16 11:19:04 +05:30
9dabb342ba Cleanup: Improve comments 2021-05-15 18:00:20 -05:00
4da16a0707 Cleanup: Use helper function
Use the `CurveEval` function introduced in the last commit.
2021-05-15 17:50:29 -05:00
038c6e229c Splines: Convenience methods for point offsets of multiple splines
Since spline data is stored separately for each spline, the data often
needs to be flattened into a separate array. It's helpful to have the
necessarily-sequential part of that split off into a separate method.
I've found myself using functions like these in quite a few places.
2021-05-15 17:44:33 -05:00
cb12fb78ca XR Controller Support Step 1: Internal Abstractions for OpenXR Actions
Adds internal API for creating and managing OpenXR actions at the
GHOST and WM layers. Does not bring about any changes for users since
XR action functionality is not yet exposed in the Python API (will be
added in a subsequent patch).

OpenXR actions are a means to communicate with XR input devices and
can be used to retrieve button/pose states or apply haptic feedback.
Actions are bound to device inputs via a semantic path binding
(https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#semantic-path-interaction-profiles),
which serves as an XR version of keymaps.

Main features:

- Abstraction of OpenXR action management functions to GHOST-XR,
  WM-XR APIs.
- New "xr_session_start_pre" callback for creating actions at
  appropriate point in the XR session.
- Creation of name-identifiable action sets/actions.
- Binding of actions to controller inputs.
- Acquisition of controller button states.
- Acquisition of controller poses.
- Application of controller haptic feedback.
- Carefully designed error handling and useful error reporting
  (e.g. action set/action name included in error message).

Reviewed By: Julian Eisel

Differential Revision: http://developer.blender.org/D10942
2021-05-16 03:36:31 +09:00
3e6609a0dc Cleanup: silence unused parameter warnings
Introduced in rB48fa029dd11b.
2021-05-15 14:13:22 -03:00
a56cc26b48 Merge branch 'blender-v2.93-release' 2021-05-15 18:34:28 +02:00
610c0ecc3b Fix T88204 EEVEE: Animated world light doesnt work during render
This was a bug uncovered by rB50782df42586.

Previously, the lightcache was always discarded between redraw and forced
to be updated again.

Now we check for update inside the render loop making it compatible with
accumulation motion blur and long exposure.
2021-05-15 18:29:14 +02:00
c2ee7ab2e3 Merge branch 'blender-v2.93-release' 2021-05-15 17:52:26 +02:00
5d97e293c3 EEVEE: Depth of Field: Fix tile artifacts in mixed focus regions
This was caused by the slight focus gather not being wide enough
for small radii. Now the cast to int will properly round the radius to
the nearest integer.

This is related to T86244 Black Artefacts in EEVEE on Transparent BSDF
2021-05-15 17:52:09 +02:00
45d3303ae4 Fix T85845 EEVEE: Depth Of Field: Artifacts with slight out of focus
This was caused by the bokeh LUT being sampled outside the valid range.
But `texelFetch` is only valid if the sample actually exists. This lead to
undefined behavior.

The fix is to increase `DOF_MAX_SLIGHT_FOCUS_RADIUS` (which just offsets the
LUT along the X=Y axis) to avoid any sample outside the defined range.
2021-05-15 17:52:09 +02:00
6e8685e1fd GPencil: Add parameter removed by error in previous commit
This fix the compiler warning too.
2021-05-15 15:53:58 +02:00
65997a058f Merge branch 'blender-v2.93-release' 2021-05-15 02:55:25 +02:00
f432b5ccf5 RigidBodies: Clarify usage of the custom density in the calculate mass
operator

This is only used when the preset is set to 'Custom', make that clear in
the tooltip and disable editing the value if another preset is used.

Issue came up in T88155.

Maniphest Tasks: T88155

Differential Revision: https://developer.blender.org/D11210
2021-05-15 02:53:42 +02:00
ccb22740c1 Merge branch 'blender-v2.93-release' 2021-05-15 02:34:47 +02:00
4707c86179 Fix T88188: Keyframing Vertex Mass in Cloth Simulation doesn't have any
effect

The way it is now, `ClothVertex->mass` is setup once for the clothObject
and then reused if it already exists [so does not change across frames/
steps] which happens in`cloth_from_object` / `do_init_cloth`, where
`SIM_cloth_solver_init` / `SIM_mass_spring_set_vertex_mass` are called
and set up masses in `Implicit_Data`.

Seems possible to update `ClothVertex->mass` every step in
`do_step_cloth`, however it seems more involved to update the masses in
`Implicit_Data` there as well. The masses from `Implicit_Data` are
accessed in many places, so it would be mandatory to have these masses
kept up-to-date (and even then it is unclear if the solver was designed
to work with these animated or if there are assumptions about this being
stable across the sim).

So propose to remove the (broken/not implemented) animation capabilities
on the property instead.

Maniphest Tasks: T88188

Differential Revision: https://developer.blender.org/D11225
2021-05-15 02:32:43 +02:00
3458d09a74 Merge branch 'blender-v2.93-release' 2021-05-15 02:06:02 +02:00
baf7f78f9f Fix T87715: Eevee: Holdout options not available in Outliner Collection context menu
Collection holdouts are now supported by eevee.

Maniphest Tasks: T87715

Differential Revision: https://developer.blender.org/D11233
2021-05-15 01:55:30 +02:00
e7e183aa2b Cleanup: Update / improve comments 2021-05-14 16:37:05 -05:00
3c978a73d1 Docs: PyAPI: Replace use of the bgl module in the RenderEngine example
The bgl module will be discontinued.

This example is seen at:
https://docs.blender.org/api/current/bpy.types.RenderEngine.html uses it.

Differential Revision: https://developer.blender.org/D11262
2021-05-14 18:29:23 -03:00
782ccbde70 Cleanup: Move attribute code to attribute header
This code in the geometry set header was not directly related to
geometry sets, it makes more sense in the attribute access header.
This makes it clearer that code for geometry components uses attribute
code, rather than the other way around. It also allows adding more
functionality to `BKE_attribute_access.hh` that depends on these things
without including `BKE_geometry_set.hh` there.
2021-05-14 15:53:43 -05:00
db59f0b943 Fix T88262: Curve to mesh crash with vector last segment
The code incorrectly used the size of the second to last segment rather
than the last segment's size. That was a problem when the last segment
is a vector segment but the second to last isn't.

I also used the opportunity to slightly refactor the control point
offsets cache, making it one longer so it also contains information
about the size of the last segment, simplifying other code.
2021-05-14 11:26:42 -05:00
7178e54122 Merge branch 'blender-v2.93-release' 2021-05-14 18:18:24 +02:00
d4a36c7ad5 Fix T88234: Crash with Eevee when shader displacement socket connection is muted
In {rB266cd7bb82ce}, support for muting links was added. It might be
debatable if we define a shader as "having" displacement even if the link
is muted, but after said commit, shader_has_displacement() would return
true but still leave the returned node as NULL.

Now also return false if the link is muted (otherwise the caller would
need to additionally check the returned node as well.)

Maniphest Tasks: T88234

Differential Revision: https://developer.blender.org/D11256
2021-05-14 18:16:35 +02:00
7efe92f63b Merge branch 'blender-v2.93-release'
Conflicts:
	source/blender/editors/object/object_add.c
2021-05-14 18:10:12 +02:00
f6cb9433d4 GPencil: Refactor Append operators
Now the operators work like other areas of Blender using the list of selected objects.

Also, the name has been changed to:

```Layers:
- Copy Layer to Selected
- Copy All Layers to Selected

Materials:
- Copy Material to Selected
- Copy All Materials to Selected```

Reviewed By: mendio, pablovazquez, pepeland

Differential Revision: https://developer.blender.org/D11216
2021-05-14 18:02:04 +02:00
8c80267352 CLOG: Fix memleak in own recent improvement to CLOG filter.
Mistake in rBef5782e29744.
2021-05-14 17:50:55 +02:00
Germano Cavalcante
b11499939c Python GPU: Replace part of the code that uses 'bgl' with 'gpu'
This is part of the process described in T80730.

The aim is to deprecate the bgl module.

Reviewed By: fclem, brecht, campbellbarton

Revision: D11147
2021-05-14 12:26:40 -03:00
Germano Cavalcante
48fa029dd1 Python GPU: New 'platform' module
This module exposes the platform utils defined in the GPU module in C.

This will be useful for porting existing code with `bgl` to `gpu`.

Reviewed By: fclem, brecht, campbellbarton

Maniphest Tasks: T80730

Part of D11147
2021-05-14 12:26:40 -03:00
Germano Cavalcante
3f4f109646 Python GPU: New 'capabilities' module
This module exposes the capabilities defined in the GPU module in C.

This will be useful for porting existing code in `bgl` to `gpu`.

Reviewed By: fclem, brecht, campbellbarton

Maniphest Tasks: T80730

Part of D11147
2021-05-14 12:26:40 -03:00
c3e13d5a2b GPencil: fix separate points/strokes freezing with empty selection
Code would still create an object (without setting up materials), code
for removing unused material slots would then freeze.

Now return/cancel early in case of empty selection.

This came up in T88269 [which is still not fully fixed, transforming
curve edit points clear their GP_STROKE_SELECT flag which now results in
the early exit, should be looked at separately]

Maniphest Tasks: T88269

Differential Revision: https://developer.blender.org/D11252
2021-05-14 17:16:05 +02:00
079f415deb Cleanup: use enum types for screen direction variables
The term direction was used in 3 different ways in screen editing code,
making it hard to follow:

- 0-3 for as magic numbers mapped to [west,north,east,south].
- `h`, `v` characters for [horizontal,vertical] axes.
- Cycle direction SPACE_CONTEXT_CYCLE_PREV, SPACE_CONTEXT_CYCLE_NEXT

The following changes have been made:

- Add `eScreenDir` for [west,north,east,south], use variable name `dir`.
- Add `eScreenAxis` for [horizontal,vertical] values, use variable name
  `dir_axis`.
- Add `eScreenCycle` for existing enum `SPACE_CONTEXT_CYCLE_{PREV/NEXT}`.
- Add macros `SCREEN_DIR_IS_VERTICAL(dir)`,
  `SCREEN_DIR_IS_HORIZONTAL(dir)`.
  Replacing `ELEM(dir, 1, 3)`, `ELEM(dir, 0, 2)`.
- Move `ED_screen_draw_join_highlight`, `ED_screen_draw_split_preview`
  to `screen_intern.h`.

Reviewed By: Severin

Ref D11245
2021-05-15 00:49:49 +10:00
d19d79c5a6 LineArt: Custom UI for adding GP object.
This allows extra options (in-front and stroke order) to be shown when adding line art kind of grease pencil object.

Reviewed by: Antonio Vazquez (antoniov)

Diff: https://developer.blender.org/D11130
2021-05-14 22:40:47 +08:00
265d97556a PyAPI: use iterators for ID property methods (keys, values & items)
- Matches changes in Python 3.x dictionary methods.

- Iterating now raises a run-time error if the property-group changes
  size during iteration.

- IDPropertyGroup.iteritems() has been removed.

- IDPropertyGroup View & Iterator types have been added.

- Some set functionality from dict_keys/values/items aren't yet
  supported (isdisjoint method and boolean set style operations).

Proposed as part of T85675.
2021-05-15 00:36:49 +10:00
65f9550813 Nodes: fix connecting wrong sockets when inserting node
Differential Revision: https://developer.blender.org/D11231
2021-05-14 16:01:55 +02:00
a4f0780acf Merge branch 'blender-v2.93-release' 2021-05-14 13:45:48 +02:00
Pratik Borhade
16bcf7dc8e Fix T87417: crash when evaluating geo nodes without window manager
Differential Revision: https://developer.blender.org/D11240
2021-05-14 13:43:30 +02:00
bd5bab961e Merge branch 'blender-v2.93-release' 2021-05-14 19:27:30 +10:00
3c09beb3b1 Fix memory leak in IDPropertyGroup.pop()
When popping ID-property groups/arrays,
ID-property was removed but not freed.

Now the value is converted to a native Python type and freed.
2021-05-14 19:25:29 +10:00
2871fadcad Geometry Nodes: use texture socket in Attribute Sample Texture node
There is a new Texture data-block socket that we can use in Geometry
Nodes now. This commit replaces the texture property of a node and
gives it a texture input socket instead. That increases flexibility.

The texture socket still has some limitations that will be lifted in the
next couple of days (e.g. it's not supported by the switch node and
cannot be exposed the a modifier yet).

Differential Revision: https://developer.blender.org/D11222
2021-05-14 11:23:25 +02:00
a939317862 Cleanup: sort include dirs in CMakeLists.txt
Sort include dirs in just one file, not a big change
(`source/blender/editors/armature/CMakeLists.txt`).

No functional changes.
2021-05-14 11:12:35 +02:00
26b4ef6823 Geometry Nodes: remove some unnecessary updates
This fixes a few "obvious" places where we do unnecessary updates.
Those special cases were added in the early days of geometry nodes
when many updates were missing and we tried to get it to work at all.
There is a fairly high risk that with this change some required updates
will be missing again. Those can be fixed when we find thme.
Some of the update issues might have been fixed by rB58818cba40794905f9323080e60884e090f2d388
and similar changes we added over time.

Differential Revision: https://developer.blender.org/D11238
2021-05-14 11:06:00 +02:00
Christoph Lendenfeld
9797b95f61 Animation: Pose sliding tools improvements
Improve the "In Betweens" tools:
- Push Pose from Rest Pose
- Relax Pose to Rest Pose
- Push Pose from Breakdown
- Relax Pose to Breakdown
- Pose Breakdowner

These all now use the same new sliding tool:
- Actual visual indication of the blending/pushing percentage applied.
- Mouse wrapping to allow for extrapolation without having to worry
  about the initial placement of the mouse. This also means these tools
  are actually usable when chosen from the menu.
- Precision mode by holding {key Shift}.
- Snapping to 10% increments by holding {key Ctrl}.
- Overshoot protection; by default the tool doesn't allow overshoot
  (lower than 0% or higher than 100%), and it can be enabled by pressing
  {key E}.
- Bones are hidden while sliding, so the pose itself can be seen more
  clearly. This can be toggled by pressing {key H} while using the tool.

Reviewed By: #animation_rigging, zeddb, sybren, #user_interface, brecht, Severin, looch

Maniphest Tasks: T81836

Differential Revision: https://developer.blender.org/D9054
2021-05-14 11:00:17 +02:00
a156843112 Cleanup: spelling, rename metas to meta-strips / meta-balls 2021-05-14 17:38:16 +10:00
c1c0b661c0 Cleanup: clang-format 2021-05-14 17:35:08 +10:00
20c3db6604 DrawTest: Make setup method public.
This allows other tests to override it.
2021-05-14 08:34:13 +02:00
55b9b1ff50 Draw: Put DrawTest in its own compile unit.
DrawTest will be used by other tests as well.
2021-05-14 07:55:01 +02:00
bd76184966 Fix sculpt neighbor iterator not taking visibility into account
Sculpting tools are designed to ignore hidden geometry and behave like
hidden geometry does not exist.
When getting the neighbors of a vertex, now this takes into account
hidden geometry to avoid returing neighbors which connected edge is not
visible. This should make corner cases of a lot of tools work properly,
especially when working in low poly meshes when is common to have a
single face loop hidden.

Reviewed By: JacquesLucke

Differential Revision: https://developer.blender.org/D11007
2021-05-14 03:08:01 +02:00
01718ad952 Merge branch 'blender-v2.93-release' 2021-05-14 02:42:19 +02:00
fce795415a Fix T87929: Cycles, missing update when visibility is modified
This issue originates from a missing BVH packing for visibility data
when it is modified.

To fix this, this adds update flags to the managers to carry the
modified visibility information from the Objects' modified flag to the
GeometryManager.

Another set of flags is added to determine which data need to be packed:
geometry, vertices, or visibility. Those flags are then used when
packing the primivites.

Reviewed By: brecht

Maniphest Tasks: T87929

Differential Revision: https://developer.blender.org/D11219
2021-05-14 02:40:43 +02:00
Pablo Dobarro
d70cfb90e0 Fix Sculpt tools showing the cursor of the previous active brush
When using a tool that is not a brush, the previously used brush
preset will still be active in the tool settings, so the cursor will
draw its custom reviews.
This checks if the current active tool is a brush before drawing its
previews. If it is not a brush tools, it draws a default white cursor.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9418
2021-05-14 00:56:13 +02:00
01a614c699 Fix build after last commit
Part of a rename change in rBc5d38a2be8 was lost when committing.
2021-05-13 17:52:30 -05:00
c5d38a2be8 Functions: Expose set_all method for generic virtual arrays
This is very similar to rB5613c61275fe6 and rB0061150e4c90d, basically
just exposing a `VMutableArray` method to its generic counterpart. This
is quite important for curve point attributes to avoid a lookup for
every point when there are multiple splines.
2021-05-13 17:47:46 -05:00
88aee2986f Cleanup: Clang format 2021-05-13 17:37:51 -05:00
Scurest
2953732fc5 Collada import: connect Emission texture to Emission socket
An emission texture is currently connected to the Base Color socket. It should connect to the Emission socket, like a constant does.

Reviewed By: gaiaclary

Differential Revision: https://developer.blender.org/D10990
2021-05-13 23:43:37 +02:00
d889e9684a Merge branch 'blender-v2.93-release' 2021-05-13 23:07:05 +02:00
37570a7317 Fix T87360 Multi input links aren't placed correctly when created with python
link->multi_input_socket_index, which is used to calculate the links
position on the multi-input socket, was not set.
Now it is set to the sockets current link count.

Review: Jacques Lucke (JacquesLucke)
Differential Revision: https://developer.blender.org/D11082
2021-05-13 23:05:38 +02:00
b90fec5d46 BLI: simplify supporting heterogeneous lookup for new types
Heterogeneous lookup is useful when constructing a key in a
map/set is relatively expensive (e.g. `std::string`). When doing
lookups in the map/set, one usually does not want to construct
the type to avoid overhead. Instead, heterogeneous lookup
allows for using a different type (such as `StringRef`) as key.

This change makes it easier to implement heterogeneous
lookup for custom types. Before, one had to specialize
`blender::DefaultHash`. Now, one just has to implement
a `static uint64_t hash_as(value)` on the type itself.
One still has to provide the equality operator in addition
to the hash function of course.
2021-05-13 14:14:14 +02:00
23a788b8bd Modifiers: allow usage of tbb
Before, any usage of tbb wrappers used in modifier code would
just fall back to the non-threaded non-tbb version.

We ran into this issue a couple of times in patches.
2021-05-13 13:45:05 +02:00
64f1d5e7c1 Nodes: add utility method to get input/output of a DNode
This is a fairly common operation, so there should be a method
that does it to avoid unnecessary complexity at the caller site.
2021-05-13 13:42:38 +02:00
d288eeb79a BLI: support looking up a key stored in Map or VectorSet
Sometimes it is useful to find the key that compares equal
to a known key. Typically that happens when the key itself
has additional data attached that is not part of its hash.

Note that the returned key reference/pointer is const, because
the caller must not change the key in a way that changes its
hash or how it compares to other keys.
2021-05-13 13:39:23 +02:00
522868001c Functions: simplify adding a single input to a multi-function
This is used by the upcoming new geometry nodes evaluator.
2021-05-13 13:23:53 +02:00
8b87fc1c77 BLI: add initial wrapper for tbb::enumerable_thread_specific
The wrapper is necessary to support building without TBB.
This class is used by the upcoming new evaluator for
geometry nodes.
2021-05-13 13:20:16 +02:00
2fb0eeb707 Nodes: ignore unavailable sockets in logically linked sockets iterator
Unavailable sockets should generally be ignored during evaluation.
They mainly exist because we don't have a better mechanism to turn
some sockets on/off depending on node parameters.

Currently, it is still possible that a link connects an available with an
unavailable socket. This link is not displayed in the ui and should
generally be ignored.
2021-05-13 13:11:28 +02:00
777ba780a6 Cleanup: inconsistent parameter name 2021-05-13 13:06:42 +02:00
d4bca00a47 Cleanup: missing override 2021-05-13 13:06:28 +02:00
6b33dafb64 Geometry Nodes: add mutex for node ui storage
Previously, multiple threads adding information to node ui storage
at the same time resulted in memory corruption. The lock prevents
that, but might potentially become a bottleneck in the future.
For now favour correctness over a potential performance bottleneck.
2021-05-13 13:06:09 +02:00
250a5442cf BLI: add LinearAllocator.construct_array method
Previously, one could allocate an array, but not construct its
elements directly. This method just adds some convenience.
2021-05-13 12:58:02 +02:00
df07188750 Cleanup: use boolean argument 2021-05-13 12:44:58 +10:00
bddc987ba3 Cleanup: clang format 2021-05-13 12:44:28 +10:00
f1ecbf26b7 UI: Use term 'Preferences' instead of 'User Prefs'
'Preferences' is the term used elsewhere in Blender so this commit makes 
the option more consistent.

In the future, the "default" target could be changed to something more 
descriptive.
2021-05-12 21:10:17 -04:00
a5d2c19a5c PyAPI Docs: Cleanup Formatting 2021-05-12 21:10:17 -04:00
06e62adfb8 UI: Improved "Area Close" Neighbor Selection
The new "Close Area" operator can let any neighbor replace the area to
be closed. This patch improves the selection of the best, and most-
aligned, neighbor.  It maximizes the ratio of the shared edge lengths,
rather than minimize the absolute amount of misalignment. This follows
our expectations closer because it takes into account the relative
sizes of the areas and their edges.

see D11143 for details and examples.

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

Reviewed by Campbell Barton
2021-05-12 16:52:43 -07:00
fa472d46fc Merge branch 'blender-v2.93-release' 2021-05-12 20:25:16 +02:00
5368859a66 VSE: Fix disk cache potentially overwriting blend file
When disk cache path is same as blend file path, with Unix-like systems
blend file can be overwritten by disk cache directory.
This was caused by `BLI_delete(path, false, true)` when path points to
file. On Windows this would result in error message and file would not
be deleted. On Linux, file is deleted and then overwritten with cache
directory.

To further minimize chance of removing blend file, append disk cache
path with `_seq_cache` suffix.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D11217
2021-05-12 20:18:45 +02:00
7bccdfd8d2 Fix T88194: Animation player displays washed out colors
Byte images used `ibuf->float_colorspace` as source colorspace.
This was oversight - `ibuf->rect_colorspace` should be used as source
colorspace.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D11223
2021-05-12 20:18:45 +02:00
41c0c79e31 VSE: Fix meta strip boundary can not be changed
In e1f3996d74, logic for changing metastrip start and end frame based
on contained strips was removed. This was done intentionally and
incorrect functionality wasn't noticed as drawing code reflected
seemingly correct state.

Original code was mostly correct, because meta strip doesn't store its
internal start and end points. This code was restored with minor
modifications so function `SEQ_time_update_sequence()` is fully self
contained as it is used not only by transform operator.

In addition, drawing glitches that happen when meta content is outside
of meta boundaries were fixed. These glitches were not caused by
e1f3996d74.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D11215
2021-05-12 20:18:45 +02:00
1a94ae9e47 Cleanup: Simplify public/private specifiers
By rearranging a few variables we can remove redundant specifiers
2021-05-12 11:50:35 -05:00
50bf033d3f Cleanup: Splines: Add accessors to spline vector
Not allowing external direct access to the vector of splines in the
curve will help for things like reallocating custom data when a spline
is added or removed.
2021-05-12 11:46:13 -05:00
3ef01692c8 UI: Colors for Texture/Material node sockets and small tweaks
* Set colors for the new texture and material sockets
  * Material uses the same color used for shading icons
  * Texture uses a plum color desaturated enough to not be confused with Vector's violet
* Image socket adjusted to be closer to Texture sockets but darker
* Integer socket toned down in saturation to not stand out so much
  (and be closer to float sockets which are gray)

Making this change now during bcon1 to gather feedback from the community,
and because Geometry Nodes needs to use the new texture/material sockets.
2021-05-12 18:00:03 +02:00
1892b131ed Geometry Nodes Curves: Expose first builtin point attributes
This commit exposes the first spline control point attributes. The
implementation incorporates the attributes into the virtual array
system, providing efficient methods to flatten the data into a
contiguous array and to apply changes from a flattened array. This
is only part of the eventual goal, which includes changes to run
attribute nodes separately for each spline to completely avoid copying.

So far `tilt` and `radius`, the two generic attributes common to
all spline types, are implemented. The more complex `position`
attribute is also added. It requires some special handling for Bezier
splines, where the control point handles need to be moved along with
the control points. To make that work I also added automatic handle
recalculation to the Bezier spline.

Differential Revision: https://developer.blender.org/D11187
2021-05-12 10:21:32 -05:00
d4783e019e Fix T87851 EEVEE: Performance regression with baked lighting & transparency
This was caused by the drivers not optimizing the shader enough to remove
the samplers and data used by closure eval. Removing the lighting loops
from the depth shader fixes the perf regression.
2021-05-12 17:20:08 +02:00
Siddhartha Jejurkar
c1f7f18a8e Fix T81247: Constrain selected UVs to correct UDIM
With Constrain to Image Bounds selected, UVs will be constrained to the
correct/closest UDIM if the image is tiled.
UVs will be constrained to the 0-1 UV space if the image is not tiled.
This will override the present behavior of always constraining selected
UVs to the 0-1 UV space (UDIM 1001).

Reviewed By: campbellbarton

Ref D11202
2021-05-13 00:12:56 +10:00
8dc95f61f3 Merge branch 'blender-v2.93-release' 2021-05-12 22:20:51 +10:00
79b7c46eec Fix: IC keymap V-key view pie doesn't work in Weight Paint mode
Remove the V key for switching to vertex mode in Weight Paint mode
as it caused a key-conflict.

Ref D11192
2021-05-12 22:19:47 +10:00
ead084b6e1 PyAPI: remove deprecated & unused BMesh.from_object deform argument
Ref T85675
2021-05-12 22:04:06 +10:00
44db4e50b2 PyAPI: remove context.active_base
All other access to the Base structure from Python was removed,
it seems this was left in by accident.

Ref T85675
2021-05-12 22:02:18 +10:00
aaa07a3a8f PyAPI: remove deprecated 'wiki_url' for add-ons 'bl_info'
This was only kept for compatibility with older add-ons and has been
deprecated since 2.83.

Ref T85675
2021-05-12 22:02:12 +10:00
bf23083852 Cleanup: use our own code style for doxy-gen comment blocks 2021-05-12 21:58:25 +10:00
3836d10faf Builder: updated download urls with upcoming naming scheme. 2021-05-12 13:17:06 +02:00
21bed44001 Fix custom bone shape scale affecting normal bone display
Also some clang-format changes.
2021-05-12 12:56:43 +02:00
2074729308 Nodes: add boilerplate for texture and material sockets
The sockets are not exposed in any nodes yet.
They work similar to the Object/Collection sockets, which also
just reference a data block.

This is part of D11222.
2021-05-12 12:41:30 +02:00
a43a455fdd Merge branch 'blender-v2.93-release' 2021-05-12 11:18:43 +01:00
47dd23694c Fix incorrect labels for math node wrap function
Found in T88151, labels are swapped. Vector math node is not affected.
2021-05-12 11:15:56 +01:00
2e750a42a1 Merge branch 'blender-v2.93-release' 2021-05-12 10:16:01 +02:00
7e823969b5 Fix non-finite tangent in Cycles with missing UV map
Was causing calculation issues later on in the kernel.

This change catches the most obvious case: missing attribute. The old
code was trying to set tangent to 0, but because it was transformed as
a normal it got converted to non-finite value. This change makes it so
that no transform is involved and 0 is written directly to the SVM
stack.

To cover all cases it will require using safe_normalize() in this node
and in the normal transform function. This is more involved change from
performance point of view, would be nice to verify whether we really want
to go this route.

I've left asserts in the BSDF allocation functions. Don't have strong
connection to them, but think they are handy and are not different from
having an assert in the path radiance checks.

Differential Revision: https://developer.blender.org/D11235
2021-05-12 10:06:11 +02:00
93b7c9595b Merge branch 'blender-v2.93-release' 2021-05-12 10:01:14 +02:00
7f34363633 Cycles X: Fix possible use of uninitialized ShaderClosure
It is possible that BSDF allocation will advance pointer in the
allocation "pool" but will return null pointer if the weight is
too small.

One artist-measurable issue this change fixes is random issues
with denoising: normal pass for denoising could have accessed
non-initialized normal of a closure.

Differential Revision: https://developer.blender.org/D11230
2021-05-12 09:41:02 +02:00
0d21228dce Cleanup: rename 'rt' to '_pad#' in DNA structs 2021-05-12 16:44:59 +10:00
193425ce1d Cycles: fix inconsistent-missing-override warnings
LLVM Clang 13, macOS.

Reviewed By: brecht
Differential Revision: https://developer.blender.org/D11207
2021-05-12 10:27:37 +05:30
9a6fd69993 Fix T87947: Trasnform: Keyboard input uses view orientation
When activated in modal, `translate`, `resize`, `rotate`, `shear` and
`edge_rotate_normal` use a different orientation than the set in scene.

This orientation needed to match since some of these modes can be switched
during operation.

The default orientation for these modes was `V3D_ORIENT_VIEW`.

And this changed when finishing the `translate` and `resize` to
`V3D_ORIENT_GLOBAL`.

But this could cause inconsistencies when inputting values from the
keyboard.

The solution now is to change the orientation when you change the mode.

---
Note: Although the user can expect the value entered to reflect the
orientation set in the scene, it would require a lot of changes and would
not be really useful.
2021-05-11 23:45:55 -03:00
cb385a117b Cleanup: Use enum to indicate the current orientation
Improves readability.
2021-05-11 23:44:50 -03:00
Wayde Moss
cbeeca8167 NLA: Extract ..get_inverted_upper_snapshot()
Extracts `nlasnapshot_blend_get_inverted_upper_snapshot()` from
`BKE_animsys_nla_remap_keyframe_values()`

This introduces a new struct member:
`NlaEvalChannelSnapshot->remap_domain` and marks which values of
`blended_snapshot` are processed for remapping/used-for-inverting.
Effectively, it marks which values have successfully been remapped and
can be further used for remapping.

`nlasnapshot_blend_get_inverted_upper_snapshot()`:
output snapshot `r_upper_snapshot` has each channel's `remap_domain`
written to which effectively marks the successfully remapped values.
The only reason a value is not in the remap domain is if inversion
failed or it wasn't marked to be remapped.

`..get_inverted_upper_snapshot()` has a variant `nlasnapshot_blend()`
from {D10220}, but this patch doesn't depend on it at all. A third
variant will later be added `..get_inverted_lower_snapshot()`.
Altogether, these three functions allow solving for any of
(lower_snapshot, upper_snapshot, blended_snapshot) given the other two.
The function `..get_inverted_lower_snapshot()` will also similarly
process the remap domain of the blended and lower snapshot.

added assertions within `nlasnapshot_blend()` and
`..get_inverted_upper_snapshot()` to future proof branches dealing with
blendmode and mixmodes. (suggested by sybren)

No user functional changes

Reviewed By: sybren

Differential Revision: https://developer.blender.org/D10222
2021-05-11 22:00:07 -04:00
Wannes Malfait
65244ac1c3 Geometry Nodes: Link error when implicit conversion isn't possible
This turns links red if no implicit conversion can be made between the
from socket and the to socket. For geometry nodes this happens with
object, geometry, collection, and string sockets that are connected to
a different type. The change is simply implementing a callback that is
already implemented for other node tree types.

Differential Revision: https://developer.blender.org/D11229
2021-05-11 16:46:02 -05:00
2770d43da6 Merge branch 'blender-v2.93-release' 2021-05-11 23:35:49 +02:00
0e3475a0ec Fix wrong loop count in Sculpt Expand code
Introduced when refactoring the function in
8815e3e330
2021-05-11 23:31:43 +02:00
96bcd80c5a Merge branch 'blender-v2.93-release' 2021-05-11 23:05:57 +02:00
Chris Eveleigh
e637149166 Fix T72791: Cycles wrong results when mixing multiple random walk BSSRDFs
Take into account the closure sample weight for the throughput.

Differential Revision: https://developer.blender.org/D10936
2021-05-11 22:24:51 +02:00
0830458bcc Fix T88093: persistent data and particle object instancing not working 2021-05-11 22:19:44 +02:00
6796ff5880 Cleanup: unused variable warning 2021-05-11 14:03:40 +01:00
15b180b240 Fix T88099: error with persistent data and motion blur 2021-05-11 14:24:36 +02:00
Charlie Jolly
93933ee8bb Geometry Nodes: Add Attribute Vector Rotate node
Port vector rotate node to geo attributes.

Request by @simonthommes

Reviewed By: simonthommes, HooglyBoogly
2021-05-11 11:15:06 +01:00
Yuki Shirakawa
fc5bf09fd8 Rigging: Add transform for custom bone shapes
Add translation/rotation/scale parameters for custom bones shapes. The
new scale is a 3D vector `custom_shape_scale_xyz`, and replaces the
`custom_shape_scale` float.

Reviewed By: #animation_rigging, sybren, zeddb

Differential Revision: https://developer.blender.org/D10974
2021-05-11 11:31:58 +02:00
a02be602f9 Merge branch 'blender-v2.93-release' 2021-05-11 10:25:12 +02:00
a63d6a97f0 Fix T88160: GPencil Remove B key to create Blank Keyframe in Drawing mode
Now, we have the new `I` menu for that. The `B`keymap  was part of the old code.
2021-05-11 10:24:37 +02:00
1151adf62d Cleanup: unnecessary extra lines for doxy sections 2021-05-11 16:04:03 +10:00
091d7336e6 Cleanup: remove unused baking struct members from soft-body 2021-05-11 16:00:38 +10:00
4226f19a03 Cleanup: Sort node type definitions alphabetically
Previously we had a lot merge conflicts since we always put the most
recently added node at the bottom. By sorting the list we will have
one fewer merge conflict when a node is added in most cases.
2021-05-10 23:10:56 -05:00
5bae9d4e38 Merge branch 'blender-v2.93-release' 2021-05-11 12:30:51 +10:00
cc7691797c Cleanup: remove unused BPy_IDProperty struct member 2021-05-11 12:30:06 +10:00
5950208f04 Merge branch 'blender-v2.93-release' 2021-05-11 12:26:34 +10:00
9801735b67 Fix T88190: Freed memory use when iterating over id-properties
The id-property iterator referenced a PyObject pointer without
increasing it's user count - allowing for errors if the value
goes out of scope during iteration.
2021-05-11 12:20:06 +10:00
7d187e91bb Merge branch 'blender-v2.93-release' 2021-05-11 11:28:46 +10:00
5aee4ba143 Fix memory leak in Python IDproperty iterator
Looping over IDProperty keys or calling iteritems leaked memory.

Error in original Python idproperty support from
8768707610
2021-05-11 11:15:49 +10:00
4333991b7b Cleanup: Reorder class variable declarations
The order was arbitrary, and rearranging the declarations
makes the class look less messy, and makes room for future comments.
2021-05-10 19:33:12 -05:00
a5761bbde2 Cleanup: Whitespace, add doxygen sections
The sections aren't helpful at the moment, but I will add more code
here soon that will benefit more from the visual separation.
2021-05-10 19:30:23 -05:00
6b1034d520 Cleanup: Use a helper function for repetitive code
Retrieving data from the component can be done in a separate function
to save some repetition.
2021-05-10 19:17:15 -05:00
5613c61275 Functions: Add materialize methods for generic mutable virtual array
Similar to how `GVArray_For_VArray` implements `materialize_impl` to
forward the work to its non-generic virtual array, we can do the same
thing for the mutable version, `GVMutableArray_For_VMutableArray`.

This commit should have no visible changes, since as far as I can tell
the only user of this class does not implement special materialize
methods anyway.
2021-05-10 19:12:04 -05:00
e19ee2e212 Merge branch 'blender-v2.93-release' 2021-05-11 00:19:39 +02:00
Pablo Dobarro
ce62d65094 Fix T82155: Fade inactive geometry overlay not working with instanced geometry
This enables the overlay for instanced geometry.

After this change, objects that are an instance of the current active
object (which are also being modified in the current active mode) won't
fade, which is different from the previous behavior.

Reviewed By: fclem

Maniphest Tasks: T82155

Differential Revision: https://developer.blender.org/D9362
2021-05-11 00:16:28 +02:00
3a5f3fb7e4 Merge branch 'blender-v2.93-release' 2021-05-10 19:21:39 +02:00
8815e3e330 Fix T88060: Expand freezing when deleting a Face Set with multiple loose parts
When checking if the mesh has only one Face Set only the current active
component for expand needs to be checked. Otherwhise other components
that won't be modified by Expand that contain other IDs will be taken
into account, making the Face Set deletion go into an infinite loop.

Reviewed By: JacquesLucke

Maniphest Tasks: T88060

Differential Revision: https://developer.blender.org/D11169
2021-05-10 19:19:52 +02:00
e76b43efcf Fix T88180: Enable HQ normal workaround for RX 580X cards.
This needs to be backported to 2.83.
2021-05-10 16:49:26 +02:00
0467979425 GPencil: Remove B key to create Blank Keyframe in Drawing mode
We have the `I` menu for that. This is part of the old code.
2021-05-10 16:34:27 +02:00
c3de3c2749 GPencil: Rename prop dilate_pixels to dilate
Better avoid units in name.
2021-05-10 16:26:50 +02:00
1ef5604e8c Merge remote-tracking branch 'origin/blender-v2.93-release' 2021-05-10 16:00:43 +02:00
Pratik Borhade
1b0890ccda Fix T54339: Shapekey Max value doesn't clamp existing value
Update the "current value" of the Shape Key blend amount when value is
not within the min/max range. New function `rna_ShapeKey_update_minmax`
used to update and clamp the current value.

Reviewed By: mano-wii, lichtwerk, #animation_rigging, sybren

Maniphest Tasks: T54339

Differential Revision: https://developer.blender.org/D11071
2021-05-10 15:53:37 +02:00
cacfa75e67 Merge branch 'blender-v2.93-release' 2021-05-10 13:34:05 +02:00
6cd4bb9435 Fix T87764: Mem-leak during viewport rendering.
When a scene uses cryptomatte the viewport rendering would lead to a
memory leak. The reason was that all image renders (viewport+final)
activated cryptomatte. But is only used for final rendering.

This patch only activates cryptomatte when doing final rendering.
2021-05-10 13:33:34 +02:00
bc868f7b52 Merge branch 'blender-v2.93-release' 2021-05-10 14:16:38 +03:00
caf92a647f Animation: move Cycle-Aware Keying to the Keying popover.
The Cycle-Aware Keying option was added in 2.8 and is used
to allow keyframing over cyclic F-Curves without disturbing
the cycle (e.g. overwriting an end keyframe updates both ends).

This effect is not limited to auto keyframing and is applied
to any key insertion, but when the popovers were rearranged
it was put in the Auto-Keyframing related one for some reason.

This is misleading, especially since because of that the
option is incorrectly greyed out when auto keyframing is
disabled, so move it to the generic Keyframing popover.

Differential Revision: https://developer.blender.org/D11213
2021-05-10 14:16:16 +03:00
Severin
273db9294a Fix warning on Apple Clang, missing override specifier
Was giving a warning:
```
BKE_spline.hh:293:35: warning: 'interpolate_to_evaluated_points' overrides a
member function but is not marked 'override' [-Winconsistent-missing-override]
```
2021-05-10 12:06:54 +02:00
0aa05c7fbb Merge branch 'blender-v2.93-release' 2021-05-10 12:00:34 +02:00
78316ac50e Fix T88145: Dynamic Paint initial color using vertex color not working as expected
Mistake in {rBe48c4d73d378}.

Was using the vertex index as a lookup for the loop color (instead of
the loop index).
(Issue was not present in original D1429 btw).

Maniphest Tasks: T88145

Differential Revision: https://developer.blender.org/D11212
2021-05-10 11:53:44 +02:00
f966f6ed55 Compositor: Add vars and methods for easier image looping
These variables and methods should make it easier to loop through buffers elements/pixels. They take into account single element buffers.
Single element buffers can be used for set operations to reduce memory usage.

Usage example: P2078

Reviewed By: #compositing, jbakker

Differential Revision: https://developer.blender.org/D11015
2021-05-10 11:16:06 +02:00
eba9404cc7 Cleanup: too small loop variable type
Clang-Tidy: bugprone-too-small-loop-variable
2021-05-10 10:52:33 +02:00
0061150e4c Functions: support materialize virtual array to initialized span 2021-05-10 10:28:24 +02:00
f2370bb22d Cleanup: spelling 2021-05-10 16:19:40 +10:00
3b7df2e157 Cleanup: unused variable warning 2021-05-10 16:16:29 +10:00
1d6425cb64 Cleanup: Remove double import in previous commit. 2021-05-10 08:01:20 +02:00
c63d40c165 Enable CLog for GPU test cases. 2021-05-10 07:59:10 +02:00
2f61602497 Cleanup: correct/clarify PlayAnim comments 2021-05-10 15:32:18 +10:00
d800470ac2 LineArt: Custom UI for adding GP object.
This allows extra options (in-front and stroke order) to be shown when adding line art kind of grease pencil object.

Reviewed by: Antonio Vazquez (antoniov)

Diff: https://developer.blender.org/D11130
2021-05-10 09:15:33 +08:00
f694321db0 Fix: Curve resample duplicates last point for cyclic splines
The last point of the output was at the same location as the
first point of a cyclic spline. The fix is simple, just account for
the cyclic when choosing the sample edge length, and don't
hard code the last sample.
2021-05-09 01:33:34 -05:00
7029cc2f8a Fix T88126: Curve resample crash for single point input
The spline `length` function assumed that the curve always had evaluated
edges. That is clearly false. This commit adds a check to `length` and a
special case for a single point in the curve resample node.
2021-05-09 01:13:06 -05:00
518c5ce4cd Geometry Nodes: Improve point instance node performance
This commit uses two changes to improve the performance of the point
instance node.

**Prevent Reallocations**
At 64 bytes, the transform matrix for every instance is rather large,
so reallocating the vector as it grows can become a performance bottle-
neck. This commit reserves memory for the instances that will be added
to prevent unecessary reallocations as the instance vector grows.

In a test with 4 million instances of 3 objects in a collection, the
node was about 40% faster, from 370ms to 270ms for the node.

**Parallelization**
Currently the instances are added by appending to a vector. By changing
this slightly to fill indices instead, we can parallelize the operation
so that multiple threads can fill data at the same time. Tested on a
Ryzen 3700x, this reduced the runtime from the above 270ms to 44ms
average, bringing the total speedup to ~8x.

Note that displaying the instances in the viewport is still much slower
than the calculations in node, this change doesn't affect that.
2021-05-08 23:57:36 -05:00
b7afb8ea70 Merge branch 'blender-v2.93-release' 2021-05-09 01:52:33 +02:00
3c7b80ae2c GPencil: Sort Line Art modifier alphabetically 2021-05-09 01:52:00 +02:00
1325e95ad5 GPencil: Name Scene Line Art objects "Line Art"
Matching Object and Collection line art type objects.
2021-05-09 01:51:43 +02:00
9569a522f2 Geometry Nodes: Refactor point instance node
This patch refactors the instance component to make use of the earlier
refactoring in rB4599cea15dcf. Now we don't have to build an array of
instance references the size of the point domain, and we can gather the
possible instances only once and use the same vector for all component
types. Generally the node should be a bit faster and use less memory.

The logic is moved around a bit, especially the hashing of the ID
attribute to pick from the instance list, but the result is unchanged.

Differential Revision: https://developer.blender.org/D11203
2021-05-08 14:53:32 -05:00
34439f05ab Cleanup: remove use of persistent data handles in geometry nodes
Those were mostly just left over from previous work on particle nodes.
They solved the problem of keeping a reference to an object over
multiple frames and in a cache. Currently, we do not have this problem
in geometry nodes, so we can also remove this layer of complexity
for now.
2021-05-08 14:54:48 +02:00
39044e68c2 Cleanup: correct PlayState.stopped state which was inverted 2021-05-08 16:13:17 +10:00
e1e23595f0 Cleanup: remove unused turbo struct member from PlayAnim
This was never used (since 2.25 at least).
2021-05-08 16:13:17 +10:00
9708215611 Cleanup: comment PlayAnim struct members 2021-05-08 16:13:17 +10:00
124572a6e5 Merge branch 'blender-v2.93-release' 2021-05-08 16:12:48 +10:00
a9eea6d9dc Fix PlayAnim cache size increasing when playing multiple animations
Error in 0499dbc5c1
2021-05-08 16:10:07 +10:00
57b473a10a Merge branch 'blender-v2.93-release' 2021-05-08 14:59:30 +10:00
5ec6bcd474 Fix PlayAnim X/Y flipping
This functionality was missed in recent GLSL drawing update
fd3e44492e.
2021-05-08 14:32:03 +10:00
e46b9de6ab Fix: Curve to mesh node assert when last profile segment is vector
We need to always add a single point to the last cyclic segment that
completes the loop, because that includes the starting point of the
evaluated edge. The existing code forgot about that point.
2021-05-07 18:16:15 -05:00
3185084efb Geometry Noes: Curve Resample Node
This node generates a naturally parametarized (even length edge) poly
spline version of every spline in the input. There are two modes,
"Count", and "Length". These are similar to the same options for the
line primitive node in end points mode.

I implemented this instead of a "Sample Points" node, because for this
operation it's trivial to keep the result as a curve, which is nice
since it increases flexibility, and because it can make instancing
simpler, i.e. using the transforms of each evaluated point rather than
requiring the construction of a "rotation" attribute.

Differential Revision: https://developer.blender.org/D11173
2021-05-07 15:37:06 -05:00
960535ddf3 GPencil: New Append operators
Now it's possible to append materials of one grease pencil object into another one. The operator allows active material or all materials.

Also, the Layer Copy To Object has been renamed to Layer Append to Object to keep consistency and now allows to append all layers at once.
2021-05-07 18:27:58 +02:00
c2b6dc7e53 Cleanup: Fix deinterlace code block style 2021-05-07 17:22:12 +02:00
9c509a7219 UI: Display indicator in the 3D Viewport when Clipping Region is on
Small addition inspired by [this tweet](https://twitter.com/Vorundor/status/1390645286624763909) of a user in a situation I also saw myself in the past.

Showing "(Clipped)" next to the view name in the `Text Info` overlay fits well since it's a per-viewport setting.

{F10059921, size=full}

While on Local view:
{F10059925, size=full}

Multiple viewports:
{F10059946, size=full}

Reviewed By: Severin

Differential Revision: https://developer.blender.org/D11193
2021-05-07 17:17:29 +02:00
8f04ddbbc6 Node Editor: Show frame label only when a label is set
Avoids having frames with the word "Frame" on top, resulting in less visual noise.
(users were working this around by adding a space as label name).

Differential Revision: D11193
2021-05-07 17:12:39 +02:00
8d6264ea12 Cleanup: Remove deprecated variables and functions calls from our ffmpeg code
There need to be more cleanup for ffmpeg 4.5 (ffmpeg master branch).

However this now compiles on ffmpeg 4.4 without and deprication
warnings.

Reviewed By: Sergey, Richard Antalik

Differential Revision: http://developer.blender.org/D10338
2021-05-07 17:12:25 +02:00
5bfd5e77b7 Fix: Curve to mesh node fails with one point and no profile
Just because the spline is cyclic does not necessarily mean that it has
an edge.
2021-05-07 09:55:32 -05:00
36ffa5b915 Merge branch 'blender-v2.93-release' 2021-05-07 16:53:24 +02:00
9cdf11676e Fix: No sound is exported with ffmpeg 4.4
We were not assigning the amount of sound channels to the output frames.
Newer ffmpeg releases has sanity checks in place and doesn't fall back
to two channels anymore.
2021-05-07 16:51:28 +02:00
Charlie Jolly
7d90b0ab11 Geometry Nodes: Parallelize Attribute Curve Map node
This adds `parallel_for` to the Attribute Curve Map node to improve performance.
Grain size set to 512.

Reviewed By: HooglyBoogly

Differential Revision: https://developer.blender.org/D11194
2021-05-07 15:27:15 +01:00
8e3a73bf81 Merge branch 'blender-v2.93-release' 2021-05-07 16:14:39 +02:00
8241678e6e LibOverride: more tweaking to handling of obsolete overrides during resync.
this is a followup to rB2bd85d9cc623, we cannot forcefully delete
obsolete overrides of object data (meshes etc.), as this implies also
deleting their user object, which might still be a perfectly valid
override, albeit in conflict regarding its obdata ID pointer...
2021-05-07 16:07:37 +02:00
bcfdbbf4b4 Cleanup: clang tidy
readability-inconsistent-declaration-parameter-name
2021-05-07 15:57:35 +02:00
94838ba661 Silence warnings 2021-05-07 15:45:52 +02:00
a932b9eab7 Cleanup: make format (clang-format) 2021-05-07 15:45:52 +02:00
b78a1c05a3 Merge remote-tracking branch 'origin/blender-v2.93-release' 2021-05-07 15:45:25 +02:00
d0c63a2abe Cleanup: make format (clang-format) 2021-05-07 15:41:42 +02:00
c58bf31aed GPencil: Add Bracket keymaps to increase/decrease brush size
This add the missing keymaps.

Requested by Jukien Kaspar.

Differential Revision: https://developer.blender.org/D11183
2021-05-07 15:30:57 +02:00
e7312effb1 Merge branch 'blender-v2.93-release' 2021-05-07 12:54:30 +02:00
a54253f335 LibOverride: Add proper reports when deleting user-edited overrides as part of resync.
Logs are not enough here, we need proper warning visible for the user.
2021-05-07 12:54:13 +02:00
aa8e058a59 LibOverride: Do not preserve local overrides when their linked data disappear.
This is the opposite of previous code, which would keep those
'deprecated' overrides arround (often in a dedicated collection), when
they were detected as user-edited.

While this is a safe-ish way to (try to) preserve user-edited data, this
tends to add too much 'trash' data to production scenes, which cleaning
becomes a burden.

Note that user will get warnings in thos cases, and can always choose
not to save the current blend file and go fix the library issue instead.
2021-05-07 12:54:13 +02:00
2bd85d9cc6 LibOverride: Fix many 'obsolete' overrides not being properly deleted.
Code detecting overrides which reference linked data is missing was
actually missing many cases, leading to too much garbage data being kept
around after resync process.
2021-05-07 12:52:34 +02:00
23acca0c32 Fix T88100: Crash going to shading tab 2021-05-07 12:43:43 +02:00
6b46e9e524 Fix strict compiler warning in sequencer code 2021-05-07 12:39:11 +02:00
700fe73560 VSE: New iterator design
This iterator design provides means to create simple and flexible API
to query and work with collection of strips. It should be used in cases
when conditions require multiple stages of recursive iteration of all
strips or similar complex scenarios.

Quick API overview:
Basic queries are standalone functions that return SeqCollection
Use SEQ_collection_create() and SEQ_collection_free() to construct
such query functions.
Use these functions to get strips of known conditions, like selected
strips, movie strips, muted strips and so on.

Use SEQ_reference_query() when querying strips with relation to
some reference strip. For example to get its effects, strips that have
same type or use same input file and so on.
These aren't standalone functions because often you need to query strips
relative to each strip in collection.

Use SEQ_collection_expand() to query strips relative to each strip
in collection. These will be merged to original collection.

Use SEQ_collection_merge() to merge 2 collections

To iterate collection elements use macro SEQ_ITERATOR_FOREACH()

This API is quite specific, but I think it is best suited for tasks
that are usualy solved in sequencer codebase.

Old sequencer iterator has been completely removed.
SEQ_ALL_BEGIN and SEQ_ALL_END macros re-use new iterator design.

As initial use for this iterator select_grouped_effect_link()
function has been rewritten. It was not only broken, but also it used
DNA fields to aid iterating strips.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D10337
2021-05-07 10:26:39 +02:00
232b10f663 Merge branch 'blender-v2.93-release' 2021-05-07 18:18:21 +10:00
cfc644186a Merge branch 'blender-v2.93-release' 2021-05-07 18:18:18 +10:00
5d7de5745b Merge branch 'blender-v2.93-release' 2021-05-07 18:18:15 +10:00
eaffa83fec Merge branch 'blender-v2.93-release' 2021-05-07 18:18:11 +10:00
f81dca971d Merge branch 'blender-v2.93-release' 2021-05-07 18:18:08 +10:00
3ee49c8711 Fix PlayAnim issue with images gradually loading into cache
Instead of only drawing images on first start, load them into cache.

This resolves a logical problem when images don't load fast enough,
where the animation would load some frames each time until all images
loaded into cache.

In practice this could play back with severe frame skipping many times
times before all images were loaded making playback smooth.

Part of a fix for T81751.
2021-05-07 18:15:14 +10:00
8cd0ac8223 Cleanup: move frame caching into functions 2021-05-07 18:15:14 +10:00
5052ab7558 Cleanup: extract image loading into it's own function 2021-05-07 18:15:09 +10:00
ac2941fb15 Fix use of imbuf that was never valid in animation player
Resizing the window would always draw the image with an empty imbuf.
2021-05-07 18:13:23 +10:00
a7b72e624c Cleanup: minor changes from master to avoid merge conflicts 2021-05-07 18:13:23 +10:00
c8cbaeb329 Merge branch 'blender-v2.93-release' 2021-05-07 10:05:19 +02:00
0f769edafe VSE: Fix freeing display buffer cache before use
`IMB_display_buffer_release()` was called before `display_buffer` was
used by drawing code. This should not be done as it may cause problems.
2021-05-07 09:57:09 +02:00
fd3e44492e Fix T81751: Use GLSL for better anim player performance
Originally colorspace of float images was converted using CPU.
GLSL will render images much faster.

Originally image was converted to `global_role_default_byte` space,
disregarding view transform and also display device, which now is
possible to specify. These parameters could be set via commandline to
settings used in Blender, however if they are to be set by users, these
needs to be sanitized.
Right now defaults are assumed for device given for
`COLOR_ROLE_DEFAULT_BYTE`. This should produce same behavior as
implemented before.

Together with D11167 animation player performance should be much better.

This code was mostly copy-pasted from sequencer.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D11178
2021-05-07 09:43:26 +02:00
Charlie Jolly
ba06bc16ae Geometry Nodes: Add Attribute Curve Map Node
This node has the same functionality as the color and vector curve
mapping nodes in the shader editor. Here is works on every value for
the selected attribute, and it can also output a float value. Other
than that, the implementation is quite straightforward-- almost
completely boilerplate code.

Differential Revision: https://developer.blender.org/D10921
2021-05-06 23:47:51 -05:00
026a9cdc21 Cleanup: move UV element keymap items into a loop
Also add explanation for non-obvious dummy key-map item.
2021-05-07 13:36:29 +10:00
5a3307230e Cleanup: de-duplicate checks in object-mode item callback 2021-05-07 11:23:09 +10:00
ff1b35af39 Cleanup: remove OB_MODE_EDIT from GPencil compatibility check
All callers replace this with OB_MODE_EDIT_GPENCIL.
2021-05-07 11:23:09 +10:00
eb9762a159 Cleanup: remove redundant NULL check in ED_object_mode_compat_test 2021-05-07 11:23:09 +10:00
4243ee7d19 Object Mode: avoid error message with particle-edit mode switch
Mode switching passed through when the mode wasn't supported for all
modes except particle edit-mode.

Add a check to ED_object_mode_compat_test to prevent the error message.
2021-05-07 11:23:09 +10:00
78b2b5fc0e Merge branch 'blender-v2.93-release' 2021-05-07 10:54:52 +10:00
7b9c865afc Fix inconsistency setting particle edit-mode
The check to include particle edit mode in the object-mode drop-down
didn't match the poll function to edit particle edit mode.

Share the check between both functions.
2021-05-07 10:52:14 +10:00
72cefdfd59 Update RNA to User Manual mapping 2021-05-06 17:23:39 -04:00
51b8032c70 Merge branch 'blender-v2.93-release' 2021-05-06 19:23:34 +02:00
Pablo Dobarro
ee0ec0f2af Fix T83398: Fade inactive geometry overlay option not visible depending on the mode
This option should always be available. Even if it does not affect the
current object depending on its mode, it affects the rest of the geometry
of the scene.

The rest of the options also work this way. For example, a grease pencil
object does not have face orientation, but the ovelay option is still
there for the rest of the scene.

Reviewed By: JulienKaspar, HooglyBoogly

Maniphest Tasks: T83398

Differential Revision: https://developer.blender.org/D10215
2021-05-06 19:16:40 +02:00
20a878158f Merge branch 'blender-v2.93-release' 2021-05-06 19:02:38 +02:00
b0271e4f05 Fix T88065: Spline-IK bone position calculation fails in some cases
Fix trying to use cross product on parallel vectors.

Fix intersection checks failing because we run into floating point
issues with very small numbers.
2021-05-06 18:55:22 +02:00
529de3d6f8 Merge branch 'blender-v2.93-release' 2021-05-06 18:21:43 +02:00
7cade013c1 LibOverride: Better handling of 'orphaned' Objects in override creation.
One of current annoying limitations of Blender re Collections/Objects is
that objects are forbidden to not be instantiated in at least one
collection.

Code ensuring that as a pst-processing step of override creation/resync
operations would be a bit too eager to add those objects to an external
'ad-hoc' collection, which poses several issues (both in term of keeping
the scene well organized, and related to override hierarchy handling).

So now be very conservative and only generate and use  external 'storage'
collection for those objects when it is absolutely mandatory.

In pratice, it means this should never happen anymore on any decently
organized data source.
2021-05-06 18:21:20 +02:00
568d55d4bc Merge branch 'blender-v2.93-release' 2021-05-06 17:11:58 +02:00
98a1540627 Fix T88030: operator showing options it shouldnt
Caused by {rB0d9f79b163ee}.

IDP_SyncGroupTypes was now syncing from src to src (leading to
unexpected operator properties).

Assume this is rather critical, dont know the part of the code well, but
above commit clearly shows a change from 'dest->data.group' to 'src-
>data.group' which shouldnt be there.

Maniphest Tasks: T88030

Differential Revision: https://developer.blender.org/D11171
2021-05-06 16:59:38 +02:00
ec30cf0b74 Fix T88058: Hover+return doesn't accept 0 as input
When the user hovered over a number input field, pressed Enter and then
typed in '0', confirming the input would always cancel the action. This
is because in this particular case `ui_textedit_begin` is called
instead of `ui_numedit_begin`. This function will not set
`data->startvalue` (leaving it at `0`) which will then trigger the
cancel in `ui_apply_but_NUM` which checks if the input changed (by
comparing the entered value with `data->startvalue`).

The fix makes sure that when `ui_textedit_begin` is called on a number
button, the `data->startvalue` is set correctly like in
`ui_numedit_begin`.

Breaking commit: rBSeb06ccc32462beaacbb114d6d0e450b6fc911047

Note: This also affects pressing tab to move to a new number field and
entering '0'. The fix will also cover this case.

Reviewed By: Severin, #user_interface

Maniphest Tasks: T88058

Differential Revision: https://developer.blender.org/D11168
2021-05-06 13:10:05 +02:00
3e77f747c0 Alembic export: export UV maps on every frame
Export UV maps to Alembic on every frame. This makes the export of UV
maps consistent with mesh normals. In the case of static UV maps it may
cause a slight slowdown (since they're exported on every frame now), but
due to the deduplication performed by the Alembic library, the resulting
files will be the same size anyway.

Thanks to @CodyWinch for providing the solution to the problem, and
writing the original patch D8397.

Differential Revision: https://developer.blender.org/D8397
2021-05-06 12:19:24 +02:00
47d76e0903 Merge branch 'blender-v2.93-release' 2021-05-06 11:01:21 +02:00
b24b197cec Fix T87983: Motion tracker button tooltips identical
The tooltips for the tracker buttons were all equal (because they all
use the same operator).

This adds the `get_description` operator callback to the
`CLIP_OT_track_markers` operator and returns a more descriptive
tooltip for the different buttons.

Reviewed By: mont29

Maniphest Tasks: T87983

Differential Revision: https://developer.blender.org/D11145
2021-05-06 11:00:22 +02:00
42e350b9a5 Merge branch 'blender-v2.93-release' 2021-05-06 08:44:23 +02:00
a1069b6c66 Fix T86314: materials not updated correctly after collada import (again)
While rB6b18678e34bf did the correct updates, it did it a bit early (not
covering all possible node tree changes).

Now do the ntreeUpdateTree() at the very end of the material import
instead.

Thx @scurest investigating.

Maniphest Tasks: T86314

Differential Revision: https://developer.blender.org/D11159
2021-05-06 08:30:54 +02:00
89858e1c5d Fix radius not taken into account when adding curve guide force field
Wrong usage of ED_curve_add_nurbs_primitive from {rBe8f3fa99de81}.

Differential Revision: https://developer.blender.org/D11166
2021-05-06 08:29:26 +02:00
59df16e2e4 Merge branch 'blender-v2.93-release' 2021-05-06 15:34:16 +10:00
e83a8e9083 Fix memory leak in object.mode_set_with_submode 2021-05-06 15:09:49 +10:00
11b50b2b77 Cleanup: VSE: move functions from incorrect file
`SEQ_recursive_apply` and `SEQ_seqbase_recursive_apply` were incorrectly
refactored into `iterator.c` file, but they aren't part and don't use
sequencer iterator.

Functions are moved to `utils.c` file.
2021-05-06 05:57:39 +02:00
f74b7e6ce9 Cleanup: Move PlayAnim frame-cache variables into a struct
Naming was inconsistent and hard to follow.
2021-05-06 12:02:23 +10:00
c17792a709 Merge branch 'blender-v2.93-release' 2021-05-06 11:35:10 +10:00
0499dbc5c1 PlayAnim: support limiting the cache by memory instead of frames
Partial fix for T81751 which exposes multiple playback performance
issues. Previously the cache was limited to 30 frames, without a way to
increase the cache for smooth playback with files that are slow to load.

Now the animation plays back smoothly once loaded into cache.

The cache limit from the system preference is used
when the player is launched from Blender.

A new player argument `-c <cache_limit>` was added to support this.
2021-05-06 11:31:44 +10:00
0433bc7e4e Merge branch 'blender-v2.93-release' 2021-05-06 03:23:16 +02:00
2d3379e243 VSE: Fix wrong flag value
`SEQPROP_VIEW_TRANSFORM` value was set incorrectly.
Introduced in 9576612d45
2021-05-06 03:18:42 +02:00
efc6f4675d Cleanup: spelling 2021-05-06 08:09:05 +10:00
832f7170dc Cleanup: link directly to stackexchange URL 2021-05-06 08:08:12 +10:00
Severin
6c8c30d865 Fix T82002: ENTER does nothing when mouse cursor is over save dialog text field
The `file.execute` operator would early-exit because the mouse wasn't hovering
the file list. Caused by 4ba9d7d71e.

Although simpler solutions would have been possible, I decided it's better to
split add a new operator for executing based on the mouse (for double-clicking
files), to separate that from the window level execute operator
(`file.execute`). This allows more control and we can get rid of the implicit
assumption that the keymap would call `file.select` on mouse-press, and
`file.execute` on double-click, for the double-click behavior to work. The cost
is that we execute the file selection & activation logic twice on the
double-click, but that shouldn't be an issue at all.
Also removes the `need_active` property from the `file.execute` operator.
That's ancient and wasn't implemented well anyway.

To be clear, reason this fixes the bug is that `file.execute` works entirely
with the `execute()` callback now and doesn't early-exit based on the mouse
position anymore.

Might trigger warnings about the `need_active` property not being found for
custom keymaps. These can be ignored and the property can safely be removed
from the keymap. I don't expect other keymap breakages.
2021-05-05 20:53:06 +02:00
ebd912ca8f Merge branch 'blender-v2.93-release' 2021-05-05 18:40:58 +02:00
ccb5caef08 Remove printfs 2021-05-05 18:40:50 +02:00
c8293d6258 Fix T86037 EEVEE: SSR option changes render passes result
This was caused by the SSR option resetting the accumulation. But the
render passes were only cleared in the init phase. This means that
when SSR was resetting the `taa_render_sample` the actual renderpasses
would still contains 1 sample. This means the renderpasses were always
divided by the wrong number of samples.

The fix is to clear just before accumulation if the sample is 1.

The fact that it works for motion blur is kind of a blessing. This is because
we check `stl->effects->ssr_was_valid_double_buffer` before resetting the
sampling. So this only happens on the first motion step and does not affect
the rest of the rendering.

Differential Revision: https://developer.blender.org/D11033
2021-05-05 18:40:50 +02:00
a1a9f8e6c3 Fix T87068 EEVEE: Moire effect with particle hair and subsurface
This artifact was already present in previous version but was hidden
by the faulty SSS scale.

The issue comes from the translucence using the geometric normal
(computed using fragment shader derivative) leading to poor precision at
depth discontinuity.

Replacing using the same geometric normal reconstruction as the ambient
occlusion pass removes most of the issue.
2021-05-05 18:40:20 +02:00
95889fe071 Fix T86823 Eevee: refraction depth shared between different materials
This was caused by the material grouping system which was missing
a per material uniform update in the opaque case.
2021-05-05 18:40:20 +02:00
a7b7f67fc4 Fix T86037 EEVEE: SSR option changes render passes result
This was caused by the SSR option resetting the accumulation. But the
render passes were only cleared in the init phase. This means that
when SSR was resetting the taa_render_sample the actual renderpasses
would still contains 1 sample. This means the renderpasses were always
divided by the wrong number of samples.

The fix is to clear just before accumulation if the sample is 1.

The fact that it works for motion blur is kind of a blessing. This is
because we check stl->effects->ssr_was_valid_double_buffer before
resetting the sampling. So this only happens on the first motion step
and does not affect the rest of the rendering.

Reviewed by: jbakker

Differential Revision: https://developer.blender.org/D11033
2021-05-05 18:40:20 +02:00
5f7f90d5a2 Merge branch 'blender-v2.93-release' 2021-05-05 16:42:37 +02:00
0e5f58b68e LibOverride: More fixes to properly ignore non-overridable ID pointers. 2021-05-05 16:41:41 +02:00
cbb057e378 LibOverride: Tag base's object pointer as not overridable. 2021-05-05 16:41:41 +02:00
632c3304bc Merge branch 'blender-v2.93-release' 2021-05-05 15:09:41 +02:00
d9d7169837 Fix kernel loading time accounted twice in render progress
The render session is keeping track of the scene update, which includes
kernel loading time.

This fixes negative render times reported when CUDA kernels are compiled
at runtime.

A bit fragile logic, can be re-implemented using some user-counted
scope utility classes, so that only outer-most time skip is applied.
2021-05-05 14:50:03 +02:00
1f184066ba Merge branch 'blender-v2.93-release' 2021-05-05 14:21:49 +02:00
fff80afe39 LibQuery: Cleanup: Document more fields of LibraryForeachIDData struct. 2021-05-05 12:51:59 +02:00
693a215dc4 LibOverride: Fix usage of IDProps that are not overridable.
Not all python-defined ID properties are overridable (yet), this needs
to be detected by libquery 'foreach id' code, such that those ID
pointers can be ignored by override code when working on override
hierarchies.

Fixes part of the issues found while investigating studio files (namely,
some py-defined ID pointer properties from rigify that are not currently
overridable would cause issues and false detections during resync).
2021-05-05 12:51:59 +02:00
b616c522d9 LibOverride/LibQuery: Refactor 'non-overridable' status management.
Move the detection/decision of whether an ID pointer should be taken
into account in library override hierarchy processing to the LibQuery
area of code, by introducing a new callback flag.

This allows to factorize the test logic, be explicit in liboverride code
about ID relationships that can be ignored when exploring the override
hierarchy, and adds the possibility to do more checks about pointers to
be tagged as non-overridable in the future.

Note that all but the 'special' ID pointers (loop-back, embedded, etc.)
should be overridable. If some is not, relevant IDType 'foreach_id'
callback code is reponsible to tag it properly.

Python-defined IDProperties however are not systematicaly overridable
(yet), so this should allow us to detect that case and act accordingly
in an incomming commit.

No behavioral change expected in this commit.
2021-05-05 12:51:59 +02:00
8e0995d006 Merge branch 'blender-v2.93-release' 2021-05-05 12:29:24 +02:00
f7a14b2ac0 Cleanup: clang format
Missing from rB04905c56523a, sorry for the noise.
2021-05-05 12:24:29 +02:00
515afeb11b Merge branch 'blender-v2.93-release' 2021-05-05 18:09:37 +10:00
20b6f7abb2 Fix PlayAnim error applying cache limiter
Each frame display would add an item to the cache limiting list
without checking if it was already in the list.

Limiting would then free image buffers when the length of the list
exceeded USE_FRAME_CACHE_LIMIT (currently 30).

In practice this meant short animations would free and reload
frames during playback.
2021-05-05 18:07:49 +10:00
736a7dcca9 PlayAnim: add in missing define check 2021-05-05 18:04:32 +10:00
89bc6b5508 Merge branch 'blender-v2.93-release' 2021-05-05 07:22:10 +02:00
9576612d45 VSE: Set view transform based on strip colorspace
In some cases, users start video editing work from General template,
where Filmic view transform is chosen by default. Currently, this causes
issue when working with sRGB footage, which are not properly decoded
into linear working space and final render looks miscolored.

When adding first strip, check it's colorspace and if it corresponds to
colorspace for byte images, ensure that view transform is set to
default value, which is Standard.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D11151
2021-05-05 07:19:30 +02:00
08f4bab658 System info: add OS version to sys_info.py
Match the output to the prefilled bug report script's output.
Make the output file self-contained.

Reviewed By: lichtwerk
Differential Revision: https://developer.blender.org/D11144
2021-05-05 10:08:04 +05:30
20aed341ee Cleanup: use doxy sections for info_ops.c 2021-05-05 12:12:20 +10:00
909506200a Cleanup: quiet warning about description ending with '.' 2021-05-05 12:11:39 +10:00
d08cc63e2f Nodes Splines: Apply tilt to normal evaluation
This patch makes the spline tilts (interpolated to the evaluated points)
affect the evaluated normals, allowing manual control of the rotation of
each profile in the curve to mesh node.

The method is based on Animation Nodes code, which keeps the data in
direction vector form, and rotates around the tangent vector.

Differential Revision: https://developer.blender.org/D11152
2021-05-04 17:35:48 -05:00
1f5710326f Fix: Splines: Use consistent bezier linear interpolation method
While the method of interpolating based on the curve length at each
evaluated point may be useful in some situations, for now it's best to
be consistent with the existing methods in Blender, so this commit adds
a simple linear-based-on-resolution sampling method to bezier splines.
2021-05-04 17:27:20 -05:00
d18be66a54 Fix T86871: Mesh.mesh_from_object creates empty mesh from curve
Regression in 2b723abea0
2021-05-05 08:08:33 +10:00
7ab7ae80c5 Fix: Incorrect cyclic interpolation for nodes bezier spline
The special case for the interpolation to the last point was being used
for every point in the last segment, because of the rounding. Instead,
make the function slightly more complicated to properly handle the
correct interolation in the cyclic and non-cyclic cases.
2021-05-04 16:28:22 -05:00
96abe5ebbc DRW: Fix issue with batch reusing freed VBO indices.
Some discard of vertbuf were not correctly followed by discards of
the GPUBatches that were using them. This lead to a use-after-free
situation where GPUBatches would reuse old VBO information. This did
not crash immediatly because the VBO indices were cached by our VAO
caching system. It kept working on some implementation because VBO
reference in the VAO (probably) preventing the VBO from being freed
by reference counting.

This fixes T85977 NVidia: Random crashes in 'DrvPresentBuffers'
2021-05-04 22:58:43 +02:00
441160930b Fix: Incorrect type used for geometry nodes poly splines 2021-05-04 14:34:16 -05:00
d28c46183d Fix missing header & footer toggle chevrons in Spreadsheet
The little chevron tab to open a hidden region wouldn't show up in the
Spreadsheet editor. Cause was an incorrect GPU-scissor usage:
While drawing regions, the scissors should be kept enabled, just the
scissor rectangle should be updated - and afterwards reset to what it
was before.
2021-05-04 20:31:33 +02:00
5ea113a555 Fix missing header & footer toggle chevrons in Spreadsheet
The little chevron tab to open a hidden region wouldn't show up in the
Spreadsheet editor. Cause was an incorrect GPU-scissor usage:
While drawing regions, the scissors should be kept enabled, just the
scissor rectangle should be updated - and afterwards reset to what it
was before.
2021-05-04 20:20:15 +02:00
b3ba41ecd1 Fix missing background of buttons after reports
Reports would change the active emboss of the Block, to make some of its
buttons appear without background. But it didn't reset it so that
buttons added afterwards wouldn't use the correct embossing.
2021-05-04 18:17:16 +02:00
87ee8ddfe3 Fix compile error without Alembic
Thanks to @Severin for noticing and providing a little patch.
2021-05-04 17:30:49 +02:00
f8f6e0b256 GPencil: New Dilate parameter for Fill brush
Internally, when using Fill brush a dilate of the filled area was done, but this was hardcoded to 1 pixel.

In some situations, this was not enough, so now the value is accesible in the UI and can be set with different values.

Also, as this value is more used than `Leak Size`, the new Dilate is on Topbar, and Leak Size has been moved to Advanced panel.
2021-05-04 16:46:33 +02:00
Cody Winchester
7904899d02 Gpencil - Fix stroke normal from D10171
In my previous patch https://developer.blender.org/D10171 some code changing the direction the strokes normal was accidentally included. This patch reverts that back to the original normal calculation.

Reviewed By: #grease_pencil, antoniov

Differential Revision: https://developer.blender.org/D11148
2021-05-04 16:31:15 +02:00
d2311de218 Fix T87935: allow library overrides on NLA/FCurve modifiers
Mark NLA/FCurve modifier properties as library-overridable.

It was already allowed to add such modifiers to a library-overridden
object, but then the properties of those modifiers were read-only,
limiting their use.
2021-05-04 16:25:50 +02:00
46d56bd956 Animation: correct active track/strip pointers after copying NLA tracks
After copying NLA tracks from one `AnimData` to another, also ensure
that the `AnimData::act_track` and `AnimData::actstrip` pointers are
pointing to the copy rather than the original.

This is a necessary step to allow library overrides on NLA modifiers
without crashing Blender.

The remapping of the pointers is done by looping over the tracks/strips
and comparing pointers. Alternatively, I could update the copy functions
themselves to keep track of those pointers and return them, but IMO that
would produce more spaghetti (they're also used in cases where this
pointer-remapping is not desired).
2021-05-04 16:23:57 +02:00
191664acd2 Docs: "File > External Data pack operator" lookup for the manual 2021-05-04 16:20:56 +02:00
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
57b94cf34b Merge branch 'blender-v2.93-release' 2021-05-04 15:20:33 +02:00
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
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
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
e6bf272abd Merge branch 'blender-v2.93-release' 2021-05-03 20:07:03 -03:00
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
874c70d088 Fix errors in Cycles comments 2021-05-03 22:45:58 +02:00
7149ccee57 Fix T85287: Cycles deadlock loading Blender images in some cases 2021-05-03 22:10:26 +02:00
472765d44d Fix T88001: persistent data render wrong when changing camera border 2021-05-03 22:10:26 +02:00
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
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
c9d81678d7 Merge branch 'blender-v2.93-release' 2021-05-03 17:10:54 +02:00
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
73a76608c8 Merge branch 'blender-v2.93-release' 2021-05-03 16:57:34 +02:00
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
888a697e24 Cleanup: spelling 2021-05-04 00:44:53 +10:00
12d8720b9b WM: disable idle event handling timer when simulating events 2021-05-04 00:39:49 +10:00
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
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
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
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
3e4863376e Cleanup: use boolean for has_event variable & return value 2021-05-04 00:17:45 +10:00
efe9928545 Merge branch 'blender-v2.93-release' 2021-05-03 15:56:28 +02:00
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
2e9dc2b999 Merge branch 'blender-v2.93-release' 2021-05-03 15:40:58 +02:00
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
2b78d3d7f3 Merge branch 'blender-v2.93-release' 2021-05-03 15:11:23 +02:00
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
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
2b46606af1 Merge branch 'blender-v2.93-release' 2021-05-03 14:03:00 +03:00
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
a53d34a28a Minor updates to i18n spellcheck tool. 2021-05-03 12:22:46 +02:00
ee8593fe76 Cleanup: clang-tidy 2021-05-03 10:23:15 +02:00
da9b1b9636 Cleanup: clang-tidy 2021-05-03 10:22:12 +02:00
8884385afb Cleanup: format 2021-05-03 04:42:39 +02:00
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
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
5ffab01930 Merge branch 'blender-v2.93-release' 2021-05-02 16:40:40 -04:00
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
d8fdb06a81 Merge branch 'blender-v2.93-release' 2021-05-02 15:56:38 +02:00
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
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
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
06af6a9efa Merge branch 'blender-v2.93-release' 2021-05-01 17:23:39 +02:00
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
503dc97708 Merge branch 'blender-v2.93-release' 2021-05-02 00:13:02 +10:00
b7f3ebe014 Fix T86450: Random dark UI elements when redrawing
Resolves occasional glitch/flicker drawing dark buttons in the UI.

Regression in 405a5d3bd7
which removed shader unbinding when the batch is drawn.

GPU_shader_bind could run with the sRGB uniform in an unexpected state.

Reviewed By: fclem

Ref D11124
2021-05-02 00:11:16 +10:00
37e16e3589 Docs: PyAPI: Fix css selector failing on some pages 2021-05-01 01:54:05 -04:00
d540a858d8 Merge branch 'blender-v2.93-release' 2021-05-01 01:53:34 -04:00
f11a3c36e3 Docs: PyAPI: Fix css selector failing on some pages 2021-05-01 01:28:31 -04:00
5e53504b3b Merge branch 'blender-v2.93-release' 2021-04-30 18:49:44 +02:00
e61020049a LibOverride: Make drivers' 'mute' flag overridable.
Request from Blender studio for cached pipeline.
2021-04-30 18:49:01 +02:00
a8e7c8d59b LibOverride: Fix infinite resync loop in some invalid file cases.
Multi-overrides of a same linked ID in a same override hierarchy are
currently not supported and can cause all kind of issues.

In some cases they could lead to infinite loop trying to resync the same
ID over and over, this is now prevented.

Found in some Blender studio production files.
2021-04-30 18:49:01 +02:00
436529d4f6 Merge branch 'blender-v2.93-release' 2021-04-30 18:04:56 +02:00
aadfa31cf0 Fix "use after free" issue in clog
Keep track of clog_refs so we can null the pointers when calling
CLG_exit. Otherwise we will run into issues where the code will try to
access freed data.
2021-04-30 18:01:47 +02:00
75536b5a61 Cleanup: compiler warnings 2021-05-01 00:49:55 +10:00
405c3b59e4 Merge branch 'blender-v2.93-release' 2021-05-01 00:46:03 +10:00
99eca899c0 Revert "Fix crash running constraint, modifier, fx from missing NULL check"
This reverts commit f4d5a69cf8.

This causes bpy.ops.object.modifier_apply.poll() to fail as
well as modifier binding operators (breaking tests).
2021-05-01 00:44:39 +10:00
313a1c072d BLI: support removing Map elements during iteration
While it was technically safe to call Map.remove while iterating over
a map, it wasn't really designed to work. Also it wasn't very efficient,
because to remove the element, the map would have to search it
again. Now it is possible to remove an element given an iterator
into the map. It is safe to remove the element while iterating over
the map. Obviously, the removed element must not be accessed
anymore after it has been removed.
2021-04-30 16:23:02 +02:00
e7274f9f2d BLI: add a common base class for Map iterators
This is useful for an upcoming commit that allows removing
an element based on an iterator.
2021-04-30 16:23:02 +02:00
2bd9a28ff8 Cleanup: Rename #if GPU_USE_PY_REFERENCES to #ifndef GPU_NO_USE_PY_REFERENCES
This is safer for incremental build.

And there was already a macro `GPU_USE_PY_REFERENCES` used elsewhere.
2021-04-30 11:20:39 -03:00
a711aa5b3c Fix accidental lines removed in the last commit 2021-04-30 11:03:39 -03:00
a35d33d520 Fix gross errors in previous commit 2021-04-30 11:00:57 -03:00
c3a980436d Documentation: Replace the bgl API in the gpu module exemples 2021-04-30 10:50:50 -03:00
2510bd3a5f Python GPU: Add new methods to port the code templates in the manual
This commit adds a new API tha allow to replace the bgl API in the exemples on:
https://docs.blender.org/api/current/gpu.html

**Overview (New API):**
```
gpu.state:      active_framebuffer_get
GPUFramebuffer: read_color
GPUOffscreen:   texture_color
```

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D11031
2021-04-30 10:49:54 -03:00
Germano Cavalcante
04b6296e81 Python GPU: Add reference of PyObject GPU object to the GPU object itself
Instead of creating different python wrappers for the same GPU object,
return the same `PyObject` created earlier.

This also allows for more secure access to existing GPU objects.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D11044
2021-04-30 10:42:13 -03:00
c96506d54a Merge branch 'blender-v2.93-release' 2021-04-30 23:41:05 +10:00
Henrik Dick
a58a8296d9 Fix T85470: Simple deform modifier causes artifacts at low angles
The formula used to compute the bend did subtraction of two big numbers
to get the position. Changed to find the delta and add that,
by rearranging the formula into a more numerically stable form.

Reviewed By: mano-wii, campbellbarton

Ref D11074
2021-04-30 23:40:17 +10:00
8f27ea40d6 Merge branch 'blender-v2.93-release' 2021-04-30 23:13:34 +10:00
0d07cfd940 Fix/Workaround T87511: snap gizmo flickers on Ctrl-Drag
Hack to bypass drag events, eventually the gizmo API
should support this use case without hacks.
2021-04-30 23:11:52 +10:00
Charlie Jolly
95d2d0d35a Geometry Nodes: Add an "Auto" option for Attribute Convert data type
Currently there is an "Auto" option for the domain, this commit adds a
similar option for "Auto" data type, that uses the data type from the
target attribute or the source attribute (in that order).

Ref T87347

Differential Revision: https://developer.blender.org/D10932
2021-04-30 08:11:45 -05:00
6cf28e98fb Object: rename BKE_object_runtime_free, leave data cleared
Rename BKE_object_runtime_free -> BKE_object_runtime_free_data,
since the runtime pointer is part of the object, only the data is freed.

Leave the data cleared to avoid accidental use,
this is in keeping with other `*_free_data()` functions.
2021-04-30 22:38:40 +10:00
3182844914 Fix: missing return 2021-04-30 13:11:49 +02:00
a79b09e762 Merge branch 'blender-v2.93-release' 2021-04-30 20:50:08 +10:00
f4d5a69cf8 Fix crash running constraint, modifier, fx from missing NULL check
None of these generic poll functions had NULL pointer checks,
since all operators that use these functions expect a valid constraint,
modifier .. etc. Add the NULL check to the poll function.

Ref D11126

Reviewed By: mont29, Severin
2021-04-30 20:48:41 +10:00
7f208be929 Fix all objects getting selected sometimes when droppping object
If no other object was selected while dragging one in (e.g. from the Outliner
or an object asset from the Asset Browser), all visible objects in the active
view layer would get selected.
Issue was caused by a wrong enum type use.

Mistake in bcdba7c34d.
2021-04-30 12:37:26 +02:00
7041568ff9 BLI: improve VectorSet data structure
This adds two new methods:
* `clear` just removes all keys from the vector set.
* `index_of_or_add` returns the index of a key and adds it if has not
  been added before.
2021-04-30 11:09:19 +02:00
2b723abea0 Object: improve on fix for Object.to_mesh() crash T86871
While fa7ddd0f43 fixed the reported issue,
the possibility of reusing runtime data during curve-to-mesh conversion
remained. Instead of treating the bounding-box as a special case,
clear all run-time data for temporary objects.

Ref D11026

Reviewed By: sergey
2021-04-30 16:29:03 +10:00
ea17a92cd7 Cleanup: interface_intern.h doc-strings
Also clarify some vague comments & add doxygen section for menu-memory.
2021-04-30 16:17:12 +10:00
67cd6beea0 Cleanup: correct comment 2021-04-30 15:58:04 +10:00
4d7d1b5dae Cleanup: comments in BMesh bisect, use doxygen sections 2021-04-30 15:49:33 +10:00
c51720a6ad Cleanup: rename BKE_pose_channel_{verify => ensure}
The term `verify` doesn't fit with what this function does
and is sometimes used to check data is valid or to control validity
checking as with `RNA_define_verify_sdna`.
use more common term `ensure`.
2021-04-30 15:30:41 +10:00
af3eda8185 Cleanup: rename BKE_pose_channels_hash_{make => ensure}
Use the term `ensure` since it makes it clear the data is
not manipulated if it already exists.
2021-04-30 15:28:13 +10:00
0dde73b4fc Cleanup: use early return in edittranslation_exec 2021-04-30 15:26:17 +10:00
b316aaa0d2 Cleanup: use const variables 2021-04-30 15:24:46 +10:00
5806d7ef54 Cleanup: avoid ambiguous parenthesis 2021-04-30 15:24:24 +10:00
d5ae0290e8 Cleanup: duplicate break 2021-04-30 15:22:59 +10:00
4a82df366f Cleanup: use 'else if' 2021-04-30 15:22:44 +10:00
d286adc26e Cleanup: remove redundant assignments & NULL pointer check 2021-04-30 15:20:44 +10:00
8a1d3bf2b1 Merge branch 'blender-v2.93-release' 2021-04-30 15:16:08 +10:00
a636909aa7 Merge branch 'blender-v2.93-release' 2021-04-30 15:16:06 +10:00
452f32dcb3 Merge branch 'blender-v2.93-release' 2021-04-30 15:16:05 +10:00
5a40c79520 Merge branch 'blender-v2.93-release' 2021-04-30 15:16:04 +10:00
a9a048c726 Merge branch 'blender-v2.93-release' 2021-04-30 15:16:02 +10:00
0959618c2e Merge branch 'blender-v2.93-release' 2021-04-30 15:15:14 +10:00
1597eb82d6 Merge branch 'blender-v2.93-release' 2021-04-30 15:14:47 +10:00
093ab05bcd Merge branch 'blender-v2.93-release' 2021-04-30 15:14:36 +10:00
d1cdbbc5fd Merge branch 'blender-v2.93-release' 2021-04-30 15:14:34 +10:00
3be50c849a Merge branch 'blender-v2.93-release' 2021-04-30 15:14:32 +10:00
d6b26b3fa0 Fix potential buffer overrun in drw_shader_dependencies_get
Logical error let this function to write one past the buffer bounds.
2021-04-30 15:08:28 +10:00
Wannes Malfait
47aca2b4c4 Nodes: Add a callback to check for valid socket type
This adds a callback to bNodeTreeType to check which socket types are
valid for the tree type. Function has been implemented for the normal
tree types, and can be implemented for custom node trees with python,
by adding a `classmethod` to the tree. However, only builtin socket
types are supported.

This is relevant for T87049, but it also has the advantage that it is
now clear which node trees support which sockets. Previously this
was assumed to be known by all developers.

Differential Revision: https://developer.blender.org/D10938
2021-04-29 23:36:46 -05:00
0eef9df355 Fix missing NULL check in grease-pencil clear strokes 2021-04-30 14:26:55 +10:00
bf8962e442 Fix sculpt mask operator crash running without a 3D view
Add missing operator poll, depend on the 3D view for all
sculpt paint/mask operators.
2021-04-30 14:22:13 +10:00
2ed847317e Fix crash running window operators in background mode 2021-04-30 14:16:50 +10:00
ddaeaa4b98 Geometry Nodes: Add a template utility to mix two attribute values
This is just linear interpolation, but it's nice to have an equivalent
to `mix3` for only two values. It will be used for interpolation of
values between bezier spline control points.
2021-04-29 21:52:34 -05:00
caf1643f4a Fix uninitialized memory use in GLDrawList
GLDrawList::init() used MDI_INDEXED which checks base_index_.
2021-04-30 12:31:52 +10:00
45a14a20de Cleanup: Mismatched array bounds in function declaration 2021-04-29 21:25:34 -05:00
c195c061d5 Fix uninitialized local-view flag on object creation
Local view return argument to ED_object_add_generic_get_opts
was left uninitialized.
2021-04-30 11:39:13 +10:00
e5c2e5e9e5 Cleanup: quiet shadow variable warning 2021-04-30 11:21:31 +10:00
8dd5fdca3b Cleanup: Remove unecessary variable
The value of this variable was incremented, but never used.
2021-04-29 15:11:35 -05:00
39226cd437 Fix T87317: Cycles XML parsing broken after bugfix for initialization order 2021-04-29 19:14:57 +02:00
b4f0d52473 Fix: crash when creating GPU texture from image fails 2021-04-29 19:14:57 +02:00
f0eda57392 Fix error in Python UI script 2021-04-29 19:14:57 +02:00
Antonio Vazquez
41820e8a8e GPencil: Add "Convert Text to Gpencil"
Currently when you try to convert a Text-object to Grease pencil from the Object-menu or via the operator in some other way, the Text-object is only converted to a Curve.

This commit converts that curve to a Grease pencil object.

Differential Revision: https://developer.blender.org/D11117
2021-04-29 17:58:18 +02:00
c9d1143b33 Cleanup: Reduce indentation by returning early 2021-04-29 10:46:55 -05:00
48b8b17da0 Merge branch 'blender-v2.93-release' 2021-04-30 01:43:04 +10:00
9f1a409f3a Fix T86335: Knife tool fails on object with zero scaled axis
Use invert_m4_m4_safe_ortho for the knife tool to support
operating on objects with a single zero scaled axis.
2021-04-30 01:42:11 +10:00
Pratik Borhade
9291128bff Clean-up: Edit and comments
- Corrected spellings
- Comments added and edited

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D10991
2021-04-29 12:02:11 -03:00
bcf524328f Fix T87297: Gpencil - Disable Frames and Start delay when use Factor
After talking with the GP team, we agree in disable these options when the factor is used in Build modifier.
2021-04-29 17:01:39 +02:00
3e3363a6ed Merge branch 'blender-v2.93-release' 2021-04-30 00:59:52 +10:00
315582f28c Fix T86799: Boolean crashes duplicating object with "Fast" solver
BMesh intersect could leave invalid items in the selection list,
causing a crash. The list is now cleared since boolean is such a
destructive operation, it's unlikely the selection order would be useful.

Thanks to @lukastoenne for finding the root cause.
2021-04-30 00:51:14 +10:00
97923d9b98 GPencil: glow fx, add threshold value color mode
This patch adds a threshold value to the glow effect in color mode.
Currently, the threshold is hardcoded to 5%.
You can select a color and specify a higher threshold to include
similar colors in the effect.

Note: depends on D10670

Reviewed By: #grease_pencil, pepeland

Differential Revision: https://developer.blender.org/D10672
2021-04-29 16:50:21 +02:00
Himanshi Kalra
7134b9daca Added Operator tests: unsubdivide, shading, vertex connect and mark seam
Added tests for:
* Mark Seam
* Shade flat
* Shade smooth
* Unsubdivide
* Vertex Connect Path
* select nth (Checkered Deselect)

Notes:
1) Shade flat, shade smooth are base test cases (to check mesh doesn't change for real)

Updated blend file: tests/modeling/operators.blend

Reviewed By: zazizizou, mont29

Differential Revision: https://developer.blender.org/D10893
2021-04-29 20:15:11 +05:30
738a890025 Merge branch 'blender-v2.93-release' 2021-04-30 00:25:35 +10:00
5946352ae2 Fix T87779: Asymmetric position vertices in circles primitives.
Incrementing a floating point value in a loop resulted in the vertex
locations for circles in primitives being slightly asymmetric.
2021-04-30 00:24:25 +10:00
dcf2c6e225 Fix build error after recent changes to CPU name detection 2021-04-29 16:22:53 +02:00
9bdb2f5e0b Cleanup: Use BLI_findindex instead of loop 2021-04-29 16:04:50 +02:00
734c8f9a77 Merge branch 'blender-v2.93-release' 2021-04-29 16:00:05 +02:00
Christian Baars
87ba01dba9 Fix missing Cycles CPU name on macOS Arm
Differential Revision: https://developer.blender.org/D11061
2021-04-29 15:58:51 +02:00
ffa70e7690 Fix missing Cycles CPU name for Arm processors 2021-04-29 15:58:51 +02:00
cd05a05bca Fix T87686: Cycles persistent data not updating correctly with hair 2021-04-29 15:58:51 +02:00
Matteo Falduto
8b9b87aee8 Cleanup: removed unnecessary multiplications in area light importance sampling
Differential Revision: https://developer.blender.org/D11114
2021-04-29 15:58:51 +02:00
db021ee2ea Fix macOS arm crash in scaling images with ffmpeg
Ref T78710
2021-04-29 15:58:51 +02:00
a5fdff26b1 Fix ASAN warnings with Cycles OSL 2021-04-29 15:58:51 +02:00
1ace224c63 Fix: missing AO factor from Cyclest Fast GI panel
The AO distance was already there, but I forgot the factor also has an impact
on this.
2021-04-29 15:58:51 +02:00
7627e0980d Merge branch 'blender-v2.93-release' 2021-04-29 23:57:42 +10:00
933de8201e Cleanup: Add float format 2021-04-29 15:45:03 +02:00
Cody Winchester
6a2bc40e01 Gpencil Offset Modifier - Add randomize offset options
This patch adds the Randomize options that exist in the Array modifier to the offset modifier.

Currently the patch uses
```
BLI_findindex(&gpf->strokes, gps);
```
to get the index of the current stroke for making each stroke a different seed value. This is how the noise modifier also gets the stroke seed value and it is noted there as well that this method is slow, and should be fixed in the future with another method of getting the stroke index.
Other methods were explored such as using the total number of points of the stroke, but that makes the randomize options incompatible with other modifiers before it such as Multiple Strokes, Array, Build, and Simplify.

{F9591325}

Differential Revision: https://developer.blender.org/D10171
2021-04-29 15:45:03 +02:00
d8cdc80263 Fix T87808: Connected proportional editing includes hidden geometry
Regression in 21b9231d7f
2021-04-29 23:44:50 +10:00
4225a18b35 Function: add method to create shallow copy of virtual array
Creating a shallow copy is sometimes useful to get a unique ptr
for a virtual array when one only has a reference. It shouldn't
be used usually, but sometimes its the fastest way to do correct
ownership handling.
2021-04-29 15:42:32 +02:00
41945454f7 Correction to own previous commit: Add missing break
Small mistake in 88400f0c03.
Not having this break would be harmless, but we can avoid some unnecessary work
with it.
2021-04-29 13:37:06 +02:00
88400f0c03 Fix incorrect sorting in Asset Browser after renaming local asset
When renaming a data-block that is an asset, while the asset is visible in the
Asset Browser ("Current File" asset library), the list wouldn't re-sort items,
breaking the alphabetical sorting.
This was easily possible while changing the data-block name throught the Asset
Browser's sidebar, while in the "Current File" asset library.
2021-04-29 13:15:42 +02:00
4e10b196ac Functions: make copying virtual arrays to span more efficient
Sometimes functions expect a span instead of a virtual array.
If the virtual array is a span internally already, great. But if it is
not (e.g. the position attribute on a mesh), the elements have
to be copied over to a span.

This patch makes the copying process more efficient by giving
the compiler more opportunity for optimization.
2021-04-29 12:59:44 +02:00
Wannes Malfait
8c73f44a01 Fix build error: use of unintialized variable
Differential Revision: https://developer.blender.org/D11115
2021-04-29 15:12:38 +05:30
Wannes Malfait
f903e3a3fd Fix build error: use of unintialized variable
Differential Revision: https://developer.blender.org/D11115
2021-04-29 14:49:19 +05:30
868c8e8617 Merge branch 'blender-v2.93-release' 2021-04-29 17:54:58 +10:00
73af884df0 Fix T87592: Mirror fail with bisect, axis object & non-uniform scale
Bisect-plane calculation needed to take non-uniform scale into account.
2021-04-29 17:54:16 +10:00
b10649f27b Cleanup: unused variable, spelling 2021-04-29 17:22:26 +10:00
816fc5a308 Merge branch 'blender-v2.93-release' 2021-04-29 17:21:28 +10:00
737a1a85b4 Merge branch 'blender-v2.93-release' 2021-04-29 17:21:25 +10:00
7a475a89eb Fix T87823: Select similar doesn't work with small faces
FLT_EPSILON was added to the threshold when comparing values,
this caused problems selecting similar small faces since the areas
can be very small in this case.

Also increase the displayed precision so it's easier to use
smaller numbers.
2021-04-29 17:16:23 +10:00
d83f5f0f01 UI: increase precision of bisect threshold
The default value of `0.0001` was displaying as `0.000`,
increase the display precision to 5 since this value often needs
to be small.
2021-04-29 17:14:44 +10:00
4338595a97 Add break statement missing from 5cb1e18f72 2021-04-29 16:57:33 +10:00
4a2c92ea9c Merge branch 'blender-v2.93-release' 2021-04-29 16:24:10 +10:00
27370aef8f Cleanup: unused warning 2021-04-29 16:22:44 +10:00
d31d5523d5 Fix T87863: Bisect fails when edges of an N-gon lie on the plane
Logic for bisect handled edges in the face crossing the plane,
but not concave N-gons containing multiple edges that lie on the plane.
2021-04-29 16:15:48 +10:00
14f59a0349 Merge branch 'blender-v2.93-release' 2021-04-28 18:27:47 -04:00
48bbeaf383 Docs: PyAPI: Improve website responsiveness on narrow displays
- Allow long enums to break early
- Allow long titles to wrap
- Colloapse hlist to few collumns if needed

This fixes a few of the bigger issues, some more tweaks are still needed 
in some places
2021-04-28 18:25:47 -04:00
38ebac86cc Cleanup: Use const argument for context 2021-04-28 16:58:43 -05:00
a71d8ecb69 Docs: PyAPI: More specific css selector for long enums
Fixes T87008
2021-04-28 17:57:58 -04:00
5cb1e18f72 GPencil: Add Layer and Material to Blank objects
Instead to create only the Blank object, now a new Layer and a simple material is added.

This is a common request of artists.

Reviewed By: mendio, pepeland

Differential Revision: https://developer.blender.org/D11110
2021-04-28 23:42:13 +02:00
baa51666ed Merge branch 'blender-v2.93-release' 2021-04-28 20:31:01 +02:00
ba755ea677 Fix T87718: Fill triangles wrongly calculated
The algorithm that calcualted the direction (inside/outside) of the
polyline was not always returing the correct result. This mean that the
polyline was filled "inside-out".

The fix uses the winding number to calculate the inside and outside.

Reviewed By: antoniov, pepeland

Maniphest Tasks: T87718

Differential Revision: https://developer.blender.org/D11054
2021-04-28 20:30:03 +02:00
1012e9bbfa Cleanup: Fix inconcistent array lengths in function declarations
In some cases functions were defined with arguments of different array
lengths in headers vs. implementations. This commit fixes some of the
cases I ran into, but probably not all of them.
2021-04-28 13:13:43 -05:00
cb09d34fde Merge branch 'blender-v2.93-release' 2021-04-28 17:22:55 +02:00
c704ddcb5f VSE: Fix slow prefetching when strips are animated
Issue was caused by anim handle being reset by
`DEG_evaluate_on_framechange()`

Preserve anim handle by backing it up in
`blender::deg::SequenceBackup`

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D11059
2021-04-28 17:19:44 +02:00
d20f399239 VSE: Fix colorbleed on scaled images
When frame is rendered to file, bilinear interpolation on scaled images
caused blurred edges.

This is fixed by not doing interpolation with pixels outside of source
buffer.

Such fix doesn't cover cropped images which are currently cropped by
filling area of image with black transparent color, because image buffer
has bigger size than visible image area.

This is fixed by offsetting range used in previous fix by amount, that
would correspond to crop distance. Because of this, image area doesn't
even need to be filled with transparency.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D11058
2021-04-28 17:16:27 +02:00
4273ec04be Cleanup: Add float format 2021-04-28 17:10:51 +02:00
YimingWu
f8f7c0ca6d GPencil: Fading based on distance to reference object in Opacity and Thickness modifiers
This patch allows you to dynamically control stroke's opacity and thickness using an object for distance reference in the modifier. Fading range is adjustable, and it is compatible with current curve/vertex group selection.

Reviewed By: #grease_pencil, antoniov, mendio

Maniphest Tasks: T82177, T80194

Differential Revision: https://developer.blender.org/D9091
2021-04-28 16:53:19 +02:00
bb2f959a07 Fix T87832: Incorrect FOV in line art when sensor fit is not Auto.
Reviewed by Sebastian Parborg

https://developer.blender.org/D11095
2021-04-28 22:40:14 +08:00
67a52c8a40 Merge branch 'blender-v2.93-release' 2021-04-28 16:30:20 +02:00
e0fa295bc6 Fix T86881: Curve Edit handle offset when snapping
When an aligned (or auto) handle was snapped with only the control
point selected, it would not snap to the correct point, but offset. This
was because the handles were not considered selected. The `TD_SELECTED`
flag was not being set.

The fix makes sure that we include the handles in the selection when
the handle is aligned or auto.

Reviewed By: antoniov

Maniphest Tasks: T86881

Differential Revision: https://developer.blender.org/D11111
2021-04-28 16:28:23 +02:00
Erik Abrahamsson
11dc674c78 Gpencil: Fix for SVG import arc and float errors
Fix for the Arc commands (A/a) to successfully parse the 4th and 5th arguments.
Fix for floats without a specified integer part, like `.123`

File for testing:
{F10042021}

Reviewed By: filedescriptor

Differential Revision: https://developer.blender.org/D11099
2021-04-28 15:53:12 +02:00
c4bebc03e0 Fix T87464 EEVEE: Crash with deformation Motion Blur
This was caused by the new depsgraph persistence.

The GPUbatches we got from the cache being the same for each frame
means that we need to be more careful about cleanning the additional
VBOs references.

Moving the `EEVEE_motion_blur_swap_data` function call at the end of
the loop makes sure the references are cleaned.
2021-04-28 15:42:02 +02:00
1b5b4b067e Spreadsheet: Add instance IDs from geometry set
Mostly the interesting information about the instances IDs whether they
are -1 or not, but it's still worth displaying them in the editor.
In the future when we can hide or show colums, we could decide to hide
this one by default.

Differential Revision: https://developer.blender.org/D11104
2021-04-28 08:22:10 -05:00
54c5835293 Merge branch 'blender-v2.93-release' 2021-04-28 15:08:19 +02:00
0b7bda808e Merge branch 'blender-v2.93-release' 2021-04-28 23:03:47 +10:00
73913ed845 Fix T87767: spreadsheet not updating on texture changes
Differential Revision: https://developer.blender.org/D11108
2021-04-28 15:02:59 +02:00
7254463194 Fix T87876: vertex groups missing when mesh is in edit mode
Differential Revision: https://developer.blender.org/D11107
2021-04-28 15:02:59 +02:00
55590bf7a6 Fix T87526: poor contrast in attribute search
Differential Revision: https://developer.blender.org/D11106
2021-04-28 15:02:59 +02:00
0b6892f0ba Fix T85688: ExportHelper adds multiple file name extensions
Replace the existing extension instead of adding it.
2021-04-28 23:00:53 +10:00
85d4a733cf WM: quiet event warning when unknown keys are pressed 2021-04-28 22:31:23 +10:00
d71f96073f BLI: improve Vector.remove_and_reorder
The old version was correct as well but did a move even when not necessary.
2021-04-28 10:27:49 +02:00
718109e7f0 Remove SMAA generating message during compilation. 2021-04-28 08:38:10 +02:00
8a41a12c71 Merge branch 'blender-v2.93-release' 2021-04-28 08:37:10 +02:00
Manuel Castilla
05b1f966fd Fix Compositor: WorkScheduler task model deletes works
WorkScheduler task model deletes work packages after executing them. The other models don't do so. All models should handle packages the same way.

Reviewed By: #compositing, jbakker

Differential Revision: https://developer.blender.org/D11102
2021-04-28 08:36:13 +02:00
Manuel Castilla
3d902b4b04 Fix Compositor: WorkScheduler task model deletes works
WorkScheduler task model deletes work packages after executing them. The other models don't do so. All models should handle packages the same way.

Reviewed By: #compositing, jbakker

Differential Revision: https://developer.blender.org/D11102
2021-04-28 08:35:31 +02:00
1128258c03 Merge branch 'blender-v2.93-release' 2021-04-28 16:09:19 +10:00
36863cf129 Fix T87864: Context is None for draw method
Use WM_operator_properties_create_ptr so the owner_id is
set to the window manger which is now required.

Regression in 919558854d.
2021-04-28 16:05:53 +10:00
Tyler
a5bb028e78 Replace COM_DEBUG #define with constexpr. Fixes T87035
Reviewed By: jbakker

Maniphest Tasks: T87035

Differential Revision: https://developer.blender.org/D11068
2021-04-28 08:03:30 +02:00
1b6f655abe Merge branch 'blender-v2.93-release' 2021-04-27 23:38:49 -05:00
7e678c3096 Fix T87165: Join geometry node doesn't copy instance IDs
This makes motion blur work incorrectly. With a similar fix to
rBf2d70c02f88cc00, just copy over the instance IDs in this case.
2021-04-27 23:37:27 -05:00
581f79e734 Merge branch 'blender-v2.93-release' 2021-04-28 13:37:17 +10:00
28828e0041 Add NULL check to Object.pose from 6eb2f71875 2021-04-28 13:36:10 +10:00
2bf3a960bd Remove include accidentally added in 6eb2f71875 2021-04-28 13:29:04 +10:00
6eb2f71875 Fix T87631: Crash undoing edit-mode bone duplication
Edit mode could leave pose channels in the object that didn't
have an associated bone.

These are now cleared when freeing edit-mode data.
2021-04-28 13:20:12 +10:00
6a664cc945 UI: Change "Int" to "Integer" in enum item names
We shouldn't abbreviate words like this in the UI. "Int" is just a
programming term.
2021-04-27 19:49:22 -05:00
ac6f6d218c Merge branch 'blender-v2.93-release' 2021-04-27 21:42:31 +02:00
a4191c2d18 Fix T87474: Face Set visibility updates failing with single face loop
Face set visibility is already flushed to all mesh elements in the right
way in SCULPT_visibility_sync_all_face_sets_to_vertices, calling
BKE_mesh_flush_hidden_from_verts is legacy code from the previous
visibility system that was causing the vertex visibility to take
priority over face sets. When hidding a single loop, all vertices of
those faces are still visibile, so this line was tagging all loop faces
visible. This was leaving mesh/face set visibiltiy in an unconsistent
state.

Reviewed By: JacquesLucke

Maniphest Tasks: T87474

Differential Revision: https://developer.blender.org/D11008
2021-04-27 21:40:54 +02:00
cc72dd7376 Fix T87596: Pose brush not using automasking options
Automasking cache factors were missing in the pose brush deform function.

Reviewed By: JacquesLucke

Maniphest Tasks: T87596

Differential Revision: https://developer.blender.org/D11005
2021-04-27 21:38:06 +02:00
9cd9b35779 Fix T87816: Sculpt curve & line stroke hides dash settings
These settings are used though for these strokes (see
'paint_stroke_use_dash'), should be visible in the UI as well.

This was correctly added when dashing was introduced in rB15f82278d5d4
btw., but then messed up in rBfb74dcc5d69d.

Maniphest Tasks: T87816

Differential Revision: https://developer.blender.org/D11096
2021-04-27 21:20:01 +02:00
aede740c8a Fix T87816: Sculpt curve & line stroke hides dash settings
These settings are used though for these strokes (see
'paint_stroke_use_dash'), should be visible in the UI as well.

This was correctly added when dashing was introduced in rB15f82278d5d4
btw., but then messed up in rBfb74dcc5d69d.

Maniphest Tasks: T87816

Differential Revision: https://developer.blender.org/D11096
2021-04-27 21:04:00 +02:00
8a786fad01 Merge branch 'blender-v2.93-release' 2021-04-27 21:02:31 +02:00
eecaa59513 Fix: Self object missing from geometry nodes evaluator params
This was an oversight in the previous refactoring commit in this file.
2021-04-27 11:42:40 -05:00
6150dbb5bb Fix T87815: Sculpt: Curve stroke scene spacing not working
This was just not implemented for curve strokes when world spacing was
introduced in rB87cafe92ce2f.

Now do the equivalent of what was done in said commit in
'paint_space_stroke', now in 'paint_line_strokes_spacing' as well.

Maniphest Tasks: T87815

Differential Revision: https://developer.blender.org/D11098
2021-04-27 17:23:47 +02:00
4ddff574d7 Fix T87832: Incorrect FOV in line art when sensor fit is not Auto.
Reviewed by Sebastian Parborg

https://developer.blender.org/D11095
2021-04-27 22:34:20 +08:00
Stefan Werner
e714b3a1c3 Cycles: Removed unused macros.
These were leftovers from an earlier way of indexing textures.
2021-04-27 14:30:13 +02:00
3c269f01c3 Cleanup: clang format 2021-04-27 13:11:08 +02:00
908bb03630 Geometry Nodes: improve geometry nodes evaluator internal api
This is a first step towards T87620.
It should not have any functional changes.

Goals of this refactor:
* Move the evaluator out of `MOD_nodes.cc`. That makes it easier to
  improve it in isolation.
* Extract core input/out parameter management out of `GeoNodeExecParams`.
  Managing this is the responsibility of the evaluator. This separation of
  concerns will be useful once we have lazy evaluation of certain inputs/outputs.

Differential Revision: https://developer.blender.org/D11085
2021-04-27 13:03:40 +02:00
a022cffb72 Geometry Nodes: initial Attribute Transfer node
This is a first version of an Attribute Transfer node. It only supports two
modes for mapping attributes from one geometry to another for now.
More options are planned for the future.

Ref T87421.

Differential Revision: https://developer.blender.org/D11037
2021-04-27 12:56:13 +02:00
e240d94191 Merge branch 'blender-v2.93-release' 2021-04-27 12:35:48 +02:00
7eb9b7976f Fix T85889: recursive instances result in crash
Generally, it would be good to not allow this from happening in the
first place but that is quite tricky because an object does not know
which other object instances it. Similar checks might be necessary
in other places, but this fixes the bug already.

Differential Revision: https://developer.blender.org/D11086
2021-04-27 12:33:40 +02:00
542f022afd Merge branch 'blender-v2.93-release' 2021-04-26 22:23:55 -05:00
f682812f41 Fix T87749: Fix text jitter in buttons with icons
This patch fixes the remaining issues described in T87749. The jitter
was caused by inconsistent rounding when using the floats icon_size
and icon_padding to offset the bound for the text drawing. Using
`round_fl_to_int` leads to consistent results and fixes the jitter
that remained in some buttons with icons, UI lists, and breadcrumbs.

Differential Revision: https://developer.blender.org/D11062
2021-04-26 22:23:23 -05:00
77aac42fbc Cleanup: Make function static 2021-04-26 22:19:39 -05:00
2841d225a9 Merge branch 'blender-v2.93-release' 2021-04-26 22:17:00 -05:00
fe79935f00 Fix T87401: Drop-down can apply the wrong modifier
The trouble was that there was a context pointer "modifier" in the
property editor context that returned the active modifier. But the
"modifier" variable was already used in many places, for pointers
that are *not* equivalent to the active modifier.

The context pointer for the active modifier was unecessary anyway.
If we need to access a context pointer for the active modifier in the
property editor then we can add it. Until then it only adds confusion.
2021-04-26 22:16:30 -05:00
f5123b1fc9 Merge branch 'blender-v2.93-release' 2021-04-26 20:55:01 -04:00
51c13be820 Update RNA/User Manual Mappings 2021-04-26 20:53:15 -04:00
676ef58a89 Cleanup: Fix unused variable warning in lite build 2021-04-26 17:03:06 -05:00
cb3ea6636e Merge branch 'blender-v2.93-release' 2021-04-26 17:02:15 -05:00
14b26fc976 Fix T87702: Cannot generate one point with line node in end points mode
Counts of less than one weren't allowed in end points mode mostly to
avoid a division by zero when calculating the delta. It's trivial to
allow a count of one, so this commit does that, with the point placed
at the start location.
2021-04-26 17:01:56 -05:00
7e17dbfcf3 Cleanup: Move displist.cc to C++
This is a change split from the geometry nodes curves branch. Since
curve object modifier evaluation happens in this file, moving it to C++
will be quite helpful to support the `GeometrySet` type. Other than
that, the code in the branch intends to replace a fair amount of this
file anyway, so I don't plan to do any further cleanup here.

Differential Revision: https://developer.blender.org/D11078
2021-04-26 15:11:53 -05:00
e032ca2e25 Cleanup: Replace modifyVolume with modifyGeometrySet
This allows us to remove a callback from the modifier type info struct.
In the future the these modifiers might just be replaced by nodes
internally anyway, but in the meantime it's nice to unify the handling
of evaluated geometry a bit.

Differential Revision: https://developer.blender.org/D11080
2021-04-26 14:42:03 -05:00
a7bda03516 Fix T87842: Outliner in Blender File mode has large performance impact
The Outliner was doing a full rebuild of its tree in response to transform
notifiers. I don't see any reason for this, a simple redraw without rebuilding
should be just fine.
The same optimization could be done for other object notifiers, but I'll check
on them separately.
2021-04-26 19:30:31 +02:00
607cd463b3 Merge branch 'blender-v2.93-release' 2021-04-26 19:21:24 +02:00
49b3d00c10 Fix: crash after recent commit
This was a mistake in rBb67fe05d4bea2d3c9efbd127e9d9dc3a897e89e6.
2021-04-26 19:19:44 +02:00
eb0d680851 Merge branch 'blender-v2.93-release' 2021-04-26 18:05:10 +02:00
38bfa8902b Fix T87771: Immediate Crash on "Edit Source" in Compositor
Caused by {rB278011e44d43}.

Framebuffer management since above commit now seems to require region
bind/unbind in for the operator to be able to redraw correctly without
using the same framebuffer in multiple contexts.

Maniphest Tasks: T87771

Differential Revision: https://developer.blender.org/D11084
2021-04-26 18:00:26 +02:00
c266632ff6 LineArt: UI fixes to match the content for 2.93 manual.
Reviewed by: Sebastian Parborg

Differential Revision: https://developer.blender.org/D11089
2021-04-26 23:40:46 +08:00
d89d53b453 Merge branch 'blender-v2.93-release' 2021-04-26 16:44:06 +02:00
b67fe05d4b Depsgraph: support depending on collection geometry
This fixes T87666 and T83252.

The boolean modifier and geometry nodes can depend on the geometry
of an entire collection. Before, the modifiers had to manually create relations
to all the objects in the collection. This worked for the most part, but was
cumbersome and did not solve all issues. For example, the modifiers were not
properly updated when objects were added/removed from the referenced collection.

This commit introduces the concept of "collection geometry" in the depsgraph.
The geometry of a collection depends on the transforms and geometry of all
the objects in it. The boolean modifier and geometry nodes can now just depend
on the collection geometry instead of creating all the dependencies themselves.

Differential Revision: https://developer.blender.org/D11053
2021-04-26 16:35:22 +02:00
bac9562f15 Cleanup: spelling 2021-04-26 22:58:35 +10:00
8f03c9b19a Cleanup: compiler warning 2021-04-26 22:58:35 +10:00
e12a8aedce Cleanup: remove use of deprecated uint32, utin16 types 2021-04-26 22:58:35 +10:00
94960250b5 Cycles: Fix build with OptiX 7.3 SDK 2021-04-26 14:55:39 +02:00
d7c762d2f7 Cleanup: Rearrange the functions in 'transform_convert_mesh.c'
The creation of `TransCustomData` is best located at the beginning of the
file as it is a specific struct of the file and can be used a lot locally.
2021-04-26 09:35:03 -03:00
Erik Abrahamsson
a65d5dadeb DeprecationWarning fix
This gets rid of a `DeprecationWarning` in bpy_types.py caused by invalid escape sequences.
More info here: https://docs.python.org/3/library/re.html

Reviewed By: mont29

Differential Revision: https://developer.blender.org/D10998
2021-04-26 09:47:03 +02:00
9b64927a8a Merge branch 'blender-v2.93-release' 2021-04-26 09:16:53 +02:00
a17ea1a669 Spreadsheet: combine vector/color spreadsheet columns
Differential Revision: https://developer.blender.org/D11056
2021-04-26 09:09:50 +02:00
c63142ca8f Remove print during compilation. 2021-04-26 07:52:46 +02:00
a200a8cf59 Cleanup: inconsistent naming for screen editing variables & args 2021-04-26 13:47:04 +10:00
36c4b79c30 Merge branch 'blender-v2.93-release' 2021-04-25 21:45:02 -05:00
f2d70c02f8 Fix (unreported): Geometry nodes instance ids not copied or cleared
Though to my knowledge we haven't had a report about this yet, this
looks like a clear oversight-- the ids are just more data stored by the
instances component, and should be cleared and copied like other data.

This might have resulted in incorrect random IDs for instances in
renderers in some cases where the component had to be copied.
2021-04-25 21:42:14 -05:00
Pratik Borhade
5341482064 Fix T87777: Fix typo in Prefs Scripts Dir tooltip
Correction to Prefs tooltip mention of 'add-ons' folder in Scripts Dir.

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

Reviewed by Harley Acheson
2021-04-25 18:39:32 -07:00
c76141e425 UI: Adding Constraint to the Area Join Operations
Removing mid-operation area re-targeting for safety and predictability.

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

Reviewed by Campbell Barton
2021-04-25 17:55:00 -07:00
db3b610040 Fix T87170 Multi-Input socket activation zone error with lots of inputs
Calculation of bounding rect for multi-input socket was wrong.

Reviewer: Hans Goudey (HooglyBoogly)

Differential Revision: https://developer.blender.org/D11077
2021-04-26 00:55:55 +02:00
c204e0c385 Fix T87170 Multi-Input socket activation zone error with lots of inputs
Calculation of bounding rect for multi-input socket was wrong.

 Reviewer: Hans Goudey (HooglyBoogly)

 Differential Revision: https://developer.blender.org/D11077
2021-04-25 23:32:41 +02:00
16b2b33d01 BLI: Add "first" method to MutableSpan and Vector
This is convenient because having a uniform interface is nice, and
because of the similarity to "last".

Differential Revision: https://developer.blender.org/D11076
2021-04-25 15:06:38 -05:00
20142b0823 Merge branch 'blender-v2.93-release' 2021-04-25 18:40:04 +02:00
Erik Abrahamsson
f1cf706758 Fix unreported "Convert Mesh to Gpencil" when fill material already exists
If an object named for example `Suzanne` is converted to Gpencil, a material called `Suzanne_Fill` will be created for the gpencil fill.
When this material already exists, the new material will be called `Suzanne_Fill.001` and the operator will not see that this material is already present the next iteration. This leads to a new material being created for every polygon.

This commit changes the code to search for a material starting with `ObjectName_Fill` instead of being equal to.

Reviewed By: filedescriptor, antoniov

Differential Revision: https://developer.blender.org/D11067
2021-04-25 18:31:36 +02:00
ae58db91a2 Fix T87799: Crash when switching to Info Editor
Use of uninitialized variable.

Problem introduced in 87a70801c6.
2021-04-25 10:41:28 -03:00
87a70801c6 Fix build issue due to previous commit
Revert in rB05dddb71b098 did a poor job and left some
rubbish.
2021-04-24 18:18:43 -06:00
05dddb71b0 Revert "Info Editor: move to c++"
This reverts commit 9cce18a585.

rB9cce18a5858c broke the build in unforeseen ways, not easily fixable.
revert for now, so master will at least build again.
2021-04-24 18:14:15 -06:00
3a6f481d5a Fix windows build: Don't use designated initializers in C++
Removes a cast in an argument followed by an initializer list, and
designated initializers, which are only part of the C++20 standard.
2021-04-24 14:15:57 -05:00
c96f9bd340 Fix T87682 Boolean Exact crash.
The triangulator I made (using CDT) doesn't work if the face
self-intersects. Fall back to the polyfill triangulator when
that happens.
2021-04-24 14:48:44 -04:00
f7afd78b80 Fix T87682 Boolean Exact crash.
The triangulator I made (using CDT) doesn't work if the face
self-intersects. Fall back to the polyfill triangulator when
that happens.
2021-04-24 14:46:48 -04:00
9cce18a585 Info Editor: move to c++
I'm currently doing some experiments in the info editor and
for that it is easier if the info editor is in c++ already.
2021-04-24 17:00:37 +02:00
82328797cf Cleanup: Remove unused flag 2021-04-24 11:46:41 -03:00
b6542f71e1 Cleanup/Refactor: Unify similar flags 2021-04-24 11:46:41 -03:00
f8d5d03ebc Cleanup/Refactor: Move FOREACH_TRANS_DATA_CONTAINER to outside of some functions
So we can reuse the same loop for different corrections.
2021-04-24 11:46:07 -03:00
b06d9069ad Cleanup: Add a common prefix for some transform functions 2021-04-24 11:46:06 -03:00
c2a0ca622b Cleanup: Move transform recaldata functions to their respective files 2021-04-24 11:35:05 -03:00
536a2fe7cc Cleanup: Add a common prefix for some transform functions 2021-04-24 11:35:05 -03:00
86ff35c7fc Merge branch 'blender-v2.93-release' 2021-04-24 23:52:15 +10:00
0f1ee611d4 Fix T85567: Crash accessing gizmo group on __del__
- Re-order freeing so an instances __del__ method runs before the
  `ExtensionRNA` has been freed.

- "remove" functions no longer free the gizmo/gizmo-group memory,
  needed so the identifier used when freeing the extension
  doesn't use the freed identifier.
2021-04-24 23:37:32 +10:00
17fca62fff Merge branch 'blender-v2.93-release' into master 2021-04-24 01:55:49 +05:30
aa95f8019e macOS: Fix unknown -Wsuggest-override warning
Added in rB7cef01b090c4c2d2703274edb91886ae37d3ce82
and rB87bfa2b207b90b5e34ebd835a23c2a82afbed878

Reviewed by: jbakker, #platform_macos
Differential Revision: https://developer.blender.org/D11012
2021-04-24 01:54:30 +05:30
2e513afe80 GPencil: Fix unreported reproject error
This bug was introduced in e1acefd45e
2021-04-23 17:42:56 +02:00
e4cebec647 GPencil: Add Multiframe support to Move to Layer
Reviewed By: mendio

Maniphest Tasks: T87426

Differential Revision: https://developer.blender.org/D11013
2021-04-23 17:27:27 +02:00
be68d00c36 GPencil: Change maximum value for Fill precission
The old value of 5 was not enough for some situations.
2021-04-23 16:58:40 +02:00
17afa86336 Merge branch 'blender-v2.93-release' 2021-04-23 09:56:50 -05:00
Leon Leno
c463675188 Fix T87749 (partially): Text jitter in buttons and spreadsheet editor
This patch fixes jittering text when resizing regions of the UI as
described in T87749. The jitter was caused by the text padding
being stored as an integer which lead to inconsistent rounding.

Most notably this patch fixes the jitter in the new spreadsheet editor,
but not all occurrences of jitter described in T87749 (e.g. in UI lists)
are addressed.

Differential Revision: https://developer.blender.org/D11060
2021-04-23 09:55:58 -05:00
8aa8537632 VSE: reset strip transform with "Set Render Size" operator
Reset the active strip offset and scale, in the "Set Render Size"
operator (`SEQUENCER_OT_rendersize`). This ensures that the active strip
will actually fit the new render size, which is what the operator is
intended to achieve.
2021-04-23 16:39:21 +02:00
5e509f966f Cleanup: VSE, reduce cognitive complexity of sequencer_rendersize_exec()
Reduce the cognitive complexity of the `sequencer_rendersize_exec()`
function by flipping some conditions and returning early.

No functional changes.
2021-04-23 16:28:37 +02:00
23185262ab Cleanup: clang-format 2021-04-24 00:03:14 +10:00
877711e9e4 Cleanup: use const arguments, reduce right shift 2021-04-24 00:02:44 +10:00
8adeac7c27 Merge branch 'blender-v2.93-release' 2021-04-23 14:35:40 +02:00
9afa738542 Fix bug/crash in ID bulk deletion code.
This is complex situation. Tagged ID deletion (used to delete several
data-blocks at once) removes IDs to be deleted from Main.

But when we remove deleted IDs' usages of other IDs (using
`BKE_libblock_relink_ex`), some specific post-process is required on
some types, like Collections. Those post-processes would in some cases
rely on data actually being in Main.

That failing condition would lead in existing code on missing processing
the very ID (collection) we were working on, leading to missing removing
some child collection pointers, leading to the crash (later on in
LayerCollection resync process).

For now we go with an optimization & fix that avoids processing all
collections in Main when we actually know which one we are working one
(case of `BKE_libblock_relink_ex`, but not of
`BKE_libblock_remap_locked`).

This is however yet another demonstration of the need to rework that
whole collection/layer resync process, since it is not only extremely
inneficient currently, but it also requires valid Main/ID state way too
deep into the remapping code.

NOTE: This fix may very well not catch/address all possible fail cases
here, dealing with the double parent/child relationships of collections
is challenging...

Issue reported by @eyecandy from the studio, thanks.
2021-04-23 14:34:47 +02:00
361579c86a Merge branch 'blender-v2.93-release' 2021-04-23 13:09:41 +02:00
5441f5fc90 Fix T87582: incorrect interpolation from edge to corner domain 2021-04-23 13:07:38 +02:00
4cb8438e08 Geometry Nodes: warn when output attribute has not been saved 2021-04-23 12:44:59 +02:00
f8e1526fa6 Fix T87661: Attribute Combine XYZ node can't overwrite existing attribute 2021-04-23 12:44:21 +02:00
ffa8563429 Merge branch 'blender-v2.93-release' 2021-04-23 10:17:25 +02:00
Jagannadhan Ravi
425e19bc1f Modifiers: Performance Simple Deformation
Use multiprocessing with simple deform modifiers.

Master 2.92 fps this patch 3.13 fps on Ryzen 1700X With Vega 64 GPU.

3970X: 2.85 fps -> 2.95 fps
3990X: 3.15 fps -> 3.41 fps
3995WX: 3.21 fps -> 3.38 fps

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D10609
2021-04-23 10:07:06 +02:00
Jeroen Bakker
2f6219c48d Fix T78845: Eevee wrong material selection.
In cases where the same node tree is used in different materials with
small changes, the wrong material could be selected.

Cause: Hair shaders GPU resources weren't updated and used the previous bound data.

Reviewed By: fclem

Differential Revision: https://developer.blender.org/D11036
2021-04-23 10:04:17 +02:00
dc1e98d8a0 Fix T86765: Custom properties are included in __dir__
Remove custom properties from `__dir__` method result since these
can't be accessed using `__getattr__`.

Introduced in the 2.5x Python API update.
2021-04-23 17:25:49 +10:00
cfa20ff03b Fix T86566: Do Not Close if File Cannot Be Saved
If saving a file using CloseSave dialog, do not close if there is an error doing so, like if read-only.

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

Reviewed by Julian Eisel
2021-04-22 20:08:17 -07:00
8b049e4c2a UI: Join or Close Any Screen Area
Corner action zones allow joining any neighbors. New 'Area Close' operator. Improved Header Context Menu.

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

Reviewed by Campbell Barton
2021-04-22 19:57:49 -07:00
5a33965627 Merge branch 'blender-v2.93-release' 2021-04-23 11:33:22 +10:00
0817763624 Fix for building with MSVC 2021-04-23 11:32:32 +10:00
76fcf58cdd Merge branch 'blender-v2.93-release' 2021-04-23 10:02:46 +10:00
a23e49c696 Fix T86170: Memory leak clearing the Python instance for COW id data
As Python can access COW ID's, ensure it's instance is kept on update.

This could happen when the "Use Self" argument was enabled for a driver.
2021-04-23 09:02:49 +10:00
3cb09f7a83 Cleanup: quiet clang-tidy warning 2021-04-23 09:02:46 +10:00
47892d6695 Fix too big grid plane for Add Object tool on Retina displays
The grid plane was drawn too big on retina displays compared to other screens,
because the factor was multiplied by the native pixel-size, which is 2 for
Retina displays.
2021-04-22 19:45:44 +02:00
6ebe0b8cf0 Assets: Correct name of own recently added BPY functions
Makes the functions (introduced in 557b3d2762) follow existing naming
conventions for the API.

Changes:
`bpy.types.ID.mark_asset` to `bpy.types.ID.asset_mark`
`bpy.types.ID.clear_asset` to `bpy.types.ID.asset_clear`
2021-04-22 19:26:09 +02:00
bbb52a462e Fix T87688: Crash entering valid text into number field
When the user entered a driver expression like `#frame` into a number
field, Blender would crash sometime after. This is because
e1a9ba94c5 did not handle this case properly and ignored the fact
that the user can enter text into the field.

The fix makes sure that we only cancel if the value is a *number* equal
to the previous value in the field.

Note that this could also be handled by `ui_but_string_set` which would
be a bit nicer potentially. However, I was unable to find a clean way of
passing `data->startvalue` into that function. `uiHandleButtonData` is
only known locally inside `interface_handlers.c`.

Reviewed By: Severin

Maniphest Tasks: T87688

Differential Revision: https://developer.blender.org/D11049
2021-04-22 19:02:48 +02:00
d1ccc5b969 Geometry Nodes: Add initializer for attribute creation
Previously we always had to set attribute values after creating
the attribute. This patch adds an initializer argument to
`attribute_try_create` which can fill it in a few ways, which
are explained in code comments.

This fixes T87597.

Differential Revision: https://developer.blender.org/D11045
2021-04-22 09:20:03 -05:00
f240b5e5f7 Fix T87701: debug assert generating scene preview render 2021-04-22 15:23:48 +02:00
9fccbe2d13 Fix missing include 2021-04-22 10:09:15 -03:00
b9a7b40924 Geometry Nodes: Get attribute domain and type without allocation
Because we use virtual classes (and for other reasons), we had to do a
small allocation when simply retrieving the data type and domain of an
existing attribute. This happened quite a lot actually-- to determine
these values for result attributes.

This patch adds a simple function to retrieve this meta data without
building the virtual array. This should lower the overhead of every
attribute node, though the difference probably won't be noticible
unless a tree has very many nodes.

Differential Revision: https://developer.blender.org/D11047
2021-04-22 08:05:02 -05:00
e0852368bc Fix missing include 2021-04-22 10:04:59 -03:00
f6efacfec7 Merge branch 'blender-v2.93-release' 2021-04-22 09:58:52 -03:00
80536e8bae Fix T87615: No snapping to objects instanced by Geometry nodes
The code of the snapping system to interact the objects in the scene only
considers instances what comes from "DUPLI" objects.

This commit adds instances coming from Geometry nodes.

Differential Revision: https://developer.blender.org/D11020
2021-04-22 09:57:45 -03:00
c3701e2303 Merge branch 'blender-v2.93-release' 2021-04-22 14:26:29 +02:00
0ba0d27d36 Fix T87090: VSE scrubbing locks up blender
Speed effect caused, that some raw frames are re-used for multiple
final frames. When cached final frame is freed due to memory being
full, it tried to free also lower level cached frames that were used
during compositing. Some lower level cached frames were already freed
by different final frame and `BLI_ghash_remove()` failed.

Check if key still exists in hash or if linked keys were overwritten
before removing them.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D10909
2021-04-22 14:16:32 +02:00
8c146d5efc Merge branch 'blender-v2.93-release' 2021-04-22 12:49:34 +02:00
71db02ed88 Fix: geometry nodes logs incorrect preview data
Under some circumstances, modifiers are evaluated more than once.
One time to compute the actual output geometry and another time
with `MOD_APPLY_ORCO`. This design probably has to be revisited
at some point in the context of geometry nodes. However, that would
be much more involved than a bug fix.

The issue was that during the second evaluation, the node tree is
evaluated based on a slightly different input geometry. The data
generated during the second evaluation overwrote the cached
data from the first evaluation, resulting in incorrect data that is
shown in the spreadsheet.

The fix for now is to simply not log any data in the second evaluation.
2021-04-22 12:48:59 +02:00
1095d5964d Cleanup: doversion for 3.0 is using FileData 2021-04-22 12:19:01 +02:00
7192ab614b Animation: add "LocRotScaleCProp" keying set
Add a keying set that includes location, rotation, scale, and custom
properties.

The keying set is intentionally not based on the "Whole Character"
keying set. Instead, it is generic enough to be used in both object and
pose animation, making it possible to quickly switch between animating
characters and props without switching keying sets.

This is, according to @rikkert, what the Blender Studio animators need
99.9% of the time.
2021-04-22 10:33:07 +02:00
91c652e39a Fix: Deactivate audio settings when output is None 2021-04-22 10:23:02 +02:00
33d9a0c951 Merge branch 'blender-v2.93-release' 2021-04-22 16:33:37 +10:00
00ec99050e Fix T85051: Add bisect distance as a parameter to the mirror modifier
The `bisect_distance` in the mirror modifier was hard-coded to `0.001`.
This would result in some unexpected behavior like vertices close
to the mirror plane being deleted or merged.

The fix now adds a parameter to the mirror modifier to expose the
bisect distance to the user. The default is set to the previous
hard-coded value to not "change" previous files.

Ref D10201
2021-04-22 16:31:41 +10:00
a4bd0fcabf Merge branch 'blender-v2.93-release' 2021-04-22 08:25:40 +02:00
a43d644dec VSE: Fix movies are reloaded after invalidation
When cache is strip is invalidated, movie file was reloaded even if it
isn't necessary. This caused significant performance issues when strip
is being dragged under playhead.

This was caused by calling `SEQ_relations_sequence_free_anim()` and it
was introduced as fix for T36124.

When it is necessary to reload file because another API holds reference
to ImBuf, do this explicitly besides cache invalidation.

In `rna_ColorManagedColorspaceSettings_reload_update()` this was already
done, so no change is needed there.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D11024
2021-04-22 08:16:52 +02:00
6944521d7e Fix T87337: Text strip draws white outline
Math for drawing font over byte buffer was incorrect. Effect can be seen
when target buffer is fully black and transparent - this results in font
color being effectively premultiplied, which causes problems when image
is composited further.

Use `blend_color_mix_byte()` and `blend_color_mix_float()` for blending.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D11035
2021-04-22 08:16:16 +02:00
4554f27adf Fix T86682: Scene strip DOF not evaluated correctly
Camera object used for rendering reffered to original not evaluated data.

Use `DEG_get_evaluated_object()` to get evaluated camera.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D11039
2021-04-22 08:15:12 +02:00
48c5129d1f Fix errors in Buffer.dimensions setter
- Error accessing the length from a sequence.
- Error comparing a boolean to -1.

Issues introduced in 19360c2c1c
2021-04-22 12:34:26 +10:00
932b23782a Merge branch 'blender-v2.93-release' 2021-04-21 17:15:46 -03:00
0f66dbea90 Fix wrong flag for 'GPUFrameBuffer.viewport_get'
`GPUFrameBuffer.viewport_get` has no args.
2021-04-21 17:15:13 -03:00
19360c2c1c Python GPU Buffer: Add a 'setter' to Buffer.dimensions
The attribute `Buffer.dimensions` does not need to be readonly.
2021-04-21 17:07:11 -03:00
ef9551afd1 Merge branch 'blender-v2.93-release' 2021-04-21 18:00:26 +02:00
aed9b6faee Fix some Cycles random walk SSS precision issues with small radius 2021-04-21 17:42:47 +02:00
3da74c1c18 Geometry Nodes: add method to get attribute by name and type
This is needed by the upcoming Attribute Transfer node. It changes
its behavior based on what domain the attribute is on.
2021-04-21 17:07:00 +02:00
1dd17726f2 Geometry Nodes: extract mesh surface sampling functions to separate file 2021-04-21 17:02:19 +02:00
d5309bf4cf Functions: add slice method for generic spans 2021-04-21 16:59:22 +02:00
b9cbf7fc80 Geometry Nodes: add utility to convert CPPType to static type 2021-04-21 16:57:43 +02:00
9fa9854e2a Merge branch 'blender-v2.93-release' 2021-04-21 16:22:40 +02:00
b1fcc8e6ba Fix T87659: crash when creating reroute loop in geometry nodes
This was a regression introduced in rB0ff3f96a1b0193d69dae5ca69e7c93d6cdf34558.
2021-04-21 16:21:54 +02:00
7aa6444a65 UI: Use proper close file dialog for "Restore Last Session"
Was showing a simple confirm dialog, even if the file didn't contain
unsaved changes. The confirm dialog would also show up when choosing
"Restore Last Session" from the splash screen right after startup, which
is weird.

Instead show the proper file closing dialog that allows saving, but only
if there are actually unsaved changes.
2021-04-21 15:18:05 +02:00
e9e2805573 Cleanup: Deduplicate file closing dialog logic
Was doing almost the same thing in two places, plus I need the same for
a third case. So better have a helper function for it.
2021-04-21 15:18:05 +02:00
0b458e8322 Cleanup: Create/use types for generic WM callbacks
Makes it less of a hassle to pass these callbacks around as function
arguments, and deduplicates their signature when doing so.
2021-04-21 15:18:05 +02:00
2e3f072d5d Merge branch 'blender-v2.93-release' 2021-04-21 13:14:26 +02:00
b72d9216f1 Fix T87677: Add primitive tools produce wrong sized objects after changing values in 'Adjust Last Operation'
Always use the defaults here (radius, depth etc), since desired bounds
have been set interactively, it does not make sense to use a different
value from a previous command.

The Cube tool has already seen a fix for this in rB26e5718e29a7, but
Cone/UVSphere/Cylinder/IcoSphere havent.

Maniphest Tasks: T87677

Differential Revision: https://developer.blender.org/D11038
2021-04-21 13:01:32 +02:00
183e3f6bb9 Fix T86968: Last UV factor in cyclic strokes
The UV factor of the last point of a cyclic stroke was using the factor of
the first point leading to unwanted scaling artifacts.

The fix sets the uv factor of the last point to the currect value (last UV
factor + length between last and first point).

Reviewed By: antoniov, fclem

Maniphest Tasks: T86968

Differential Revision: https://developer.blender.org/D10850
2021-04-21 12:16:32 +02:00
d17bff849d Merge branch 'blender-v2.93-release' 2021-04-21 11:19:57 +02:00
26ab90e49b Fix T87640: Grease Pencil layer visibility/locking not synchronized from Dope Sheet to Properties
Properties Editor is a bit more picky (compared to the Outliner for
example) when it comes to listening to grease pencil notifiers -- it
requires the action to be set.
So when adding the notifier in the dopesheet from the channels (done in
`achannel_setting_flush_widget_cb`), now add the `NA_EDITED` action.

Maniphest Tasks: T87640

Differential Revision: https://developer.blender.org/D11025
2021-04-21 11:15:53 +02:00
5fe3d2dc7d Merge branch 'blender-v2.93-release' 2021-04-21 11:05:40 +02:00
1a6b51e175 Curve modifiers: Disable 'Apply on Spline' option if not available
Some curve modifiers (namely Hook, SoftBody and MeshDeform) can only work
on pre-tesselated spline points.

Before the modifier UI refactor in rB9b099c86123f, users would get the
'Apply on Spline' option, but disabled and with a tip explaining why
this cant be changed. After rB9b099c86123f though, this button was
always enabled [but disfunctional] leaving the user without an
explanation why this has no effect.

Now restore this functionality since it is quite important information.
Additionally, this button now appears to be ON in these cases which
makes more sense from the user perspective (so it does not represent the
actual setting on the modifier -- this would internally be switched ON in
the modifier calculation anyways though, see
'curve_get_tessellate_point')

Differential Revision: https://developer.blender.org/D11029
2021-04-21 11:02:45 +02:00
79d2f2c2f9 Merge branch 'blender-v2.93-release' 2021-04-21 17:43:55 +10:00
f9867c1f11 Merge branch 'blender-v2.93-release' 2021-04-21 17:43:51 +10:00
a6cd20716e Fix T87562: Keymap preferences from 2.92x ignored
Renaming presets in 01d49d1542
caused them to be treated as separate key-maps.
2021-04-21 17:39:02 +10:00
06c682423a BLI_string: add a utility to replace strings using a table
Useful to simplify versioning code when identifiers need updating
in multiple places.
2021-04-21 17:34:18 +10:00
3003fbbecf Merge branch 'blender-v2.93-release' 2021-04-21 13:48:10 +10:00
5da3177190 Fix logging "bke.appdir" messages
Logging was initialized after BKE_appdir paths were initialized,
making it impossible to see paths which are checked on startup.
2021-04-21 13:44:23 +10:00
c5cabb6eb7 Correction to previous commit: Avoid unnecessary notifier
Not a big deal, but nice to avoid notifiers when no change was done.
2021-04-20 22:43:43 +02:00
557b3d2762 Assets: Add BPY function to mark and clear assets
Adds `mark_asset()` and `clear_asset()` to ID data-blocks, e.g.
`bpy.context.active_object.mark_asset()`. They essentially do the same as the
mark and clear asset operators.

Scripts are generally discouraged from using operators where possible, but we
need to provide API functions to use instead. In this case it means scripts
don't have to override context to pass an ID to the operator.
2021-04-20 22:36:48 +02:00
847579b422 Add support for building on Linux aarch64
Differential Revision: https://developer.blender.org/D10958
2021-04-20 18:45:46 +02:00
f2626f1420 Merge branch 'blender-v2.93-release' 2021-04-20 17:45:36 +02:00
3735986e87 Fix T87440 EEVEE: Specular Light Viewport Render Pass wrong behavior
This was caused by the closure refactor. The radiance being masked
for SSR, we need to not enable SSR when trying to render the specular
color pass.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D11028
2021-04-20 17:45:07 +02:00
f1b61f5e7d Core: Add do_versions file for 3.0
Differential Revision: https://developer.blender.org/D11030
2021-04-20 17:13:20 +02:00
e2af5030b9 Cleanup: comments
- Restore comment removed by accident in
  8c5c55b8c9
- Use doxygen syntax.
2021-04-21 00:51:27 +10:00
3d994b26ba EEVEE: Fix unreported memory leak when toggling AO on/off
The `filtered_radiance` is not a texture form the texture pool.
It needs manual freeing if not used.
2021-04-20 16:33:57 +02:00
2c1a2c9a99 Merge branch 'blender-v2.93-release' 2021-04-21 00:21:29 +10:00
fa7ddd0f43 Fix T86871: Crash with to_mesh() on tapered bezier curve 2021-04-21 00:20:47 +10:00
4cf60a2abf Fix T87369 EEVEE: Ambient Oclussion: Firefly caused by degenerated normal
This was caused by some sort of degenerated normals.
2021-04-20 16:07:45 +02:00
eca5cf1460 Cleanup: keying sets, move common code to mix-in class
Move code common to the Whole Character keying sets ("Whole Character" and
"Whole Character (Selected Bones Only)" into a mix-in class. This avoids
the need to use direct assignments like
`poll = BUILTIN_KSI_WholeCharacter.poll`.

No functional changes.
2021-04-20 15:52:43 +02:00
26d778cd8a Cleanup: keying sets, use self as self-parameter
Use `self` as self-parameter of methods, instead of the non-standard and
cryptic `ksi`.

No functional changes.
2021-04-20 15:52:43 +02:00
e1a9ba94c5 Fix T87637: Dragging button value cancel not working
Dragging a number button, then holding the value and pressing escape
would not reset the value correctly.
This was because eb06ccc324 assumed that `data->value` and
`data->startvalue` were set during dragging which they are not.

The fix moves the if statement into the section where we check if a
number was entered (number edit) making sure that we only cancel
if the button was in "string enter" mode and that the value entered
was the same as before.

Reviewed By: HooglyBoogly, Severin

Maniphest Tasks: T87637

Differential Revision: https://developer.blender.org/D11021
2021-04-20 15:46:52 +02:00
7834fcc67d Merge branch 'blender-v2.93-release' 2021-04-20 11:19:43 +02:00
2125ee4305 Geometry Nodes: skip attribute conversion if src and dst are the same 2021-04-20 11:17:35 +02:00
b2c6eb8640 Merge branch 'blender-v2.93-release' 2021-04-20 11:02:29 +02:00
27cfc1ea11 Fix T87541 EEVEE: AO causes black outline around objects and NaN pixels
It seems the pow result is unstable on some implementations.

Also avoid undefined behavior by clamping aoFactor to strict positive values.
2021-04-20 10:59:07 +02:00
2efd3509ee Merge branch 'blender-v2.93-release' 2021-04-20 10:06:30 +02:00
db0b1cab1f Fix T86809: Action Editor header not display the right action in certain scenarios
If a new action is created (e.g. by inserting keyframes), the header was
not garuanteed to display the right action.
Notifiers were fine here, redraw took place, the editors action was just
not set soon enough for the drawing.

Now make sure this is set correctly by ensuring the animation context is
right (same as the other editor regions do before drawing).

Maniphest Tasks: T86809

Differential Revision: https://developer.blender.org/D10796
2021-04-20 09:56:02 +02:00
8c0f7d1772 Geometry Nodes: support geometry nodes modifier on volume objects
Differential Revision: https://developer.blender.org/D11011
2021-04-20 09:30:53 +02:00
5d2ec2bc08 Cleanup: clang tidy readability-inconsistent-declaration-parameter-name 2021-04-20 09:25:15 +02:00
8c5c55b8c9 Cleanup: uiBut.flag had an internal flag out of the documented range
Increase range of internal flags & order UI_SEARCH_FILTER_NO_MATCH
within this range, so public button flags aren't accidentally added
that overlap with internal flags.
2021-04-20 15:44:21 +10:00
5e82e77112 Cleanup: remove redundant code/comments from BKE_mesh_nomain_to_mesh 2021-04-20 15:28:27 +10:00
b760481f8d Merge branch 'blender-v2.93-release' 2021-04-20 15:21:25 +10:00
72fec0f7c5 Fix T87055: Crash applying modifier on mesh with multires data 2021-04-20 15:17:48 +10:00
7ccd19fc12 PyAPI: update docs to include poll_message_set reference
Part of D9738
2021-04-20 12:29:04 +10:00
ebe04bd3ca PyAPI: support Operator.poll functions 'disabled' hint
Python scripts can now define the reason it's poll function fails using:

`Operator.poll_message_set(message, ...)`

This supports both regular text as well as delaying message creation
using a callback which should be used in situations where constructing
detailed messages is too much overhead for a poll function.

Ref D11001
2021-04-20 12:07:01 +10:00
985ccba77c Cleanup: add CTX_wm_operator_poll_msg_clear
Call this function instead of `CTX_wm_operator_poll_msg_set(C, NULL)`
2021-04-20 11:42:00 +10:00
795f024558 Merge branch 'blender-v2.93-release' 2021-04-19 22:49:14 +02:00
0566ebdebe Fix crash with Alembic export after recent persistent data bugfix
We weren't clearing the recalc flags for that case.
2021-04-19 22:39:36 +02:00
2d1d6fbb23 Merge branch 'blender-v2.93-release' 2021-04-19 21:07:42 +02:00
d1fbf1599f Cycles: include more transparency and emission in fast GI approximation
For indirect light rays, don't assume any hit is opaque, rather if it has
transparency or emission do the shading but don't do any further bounces.

Naturally this is slower when there are transparent surfaces, however
without this cutout opacity doesn't give sensible results.

Differential Revision: https://developer.blender.org/D10985
2021-04-19 21:07:40 +02:00
b42454be8b Cleanup: move BVH utility functions into own file 2021-04-19 21:07:34 +02:00
68cbf0a2be Cleanup: Clang tidy, clang format 2021-04-19 13:48:25 -05:00
cedd8b8c56 Fix T87535, T87295: issues with new persistent data option
Some persistent data code was disable due to a deeper design issue, which
meant some updates were not communicated to renderers.

Dependency graph updates work in two passes, once where Blender scene
animation updates are done, then app handler scripts can run to make further
scene modifications, and then the depsgraph is updated again to take those
into account.

Previously the viewport would update renderers twice when such app handler
scripts were present. Now both viewport and persistent data rendering update
the renderers only once, accumulating updates from both passes.
2021-04-19 20:00:00 +02:00
c13b3dd168 Merge branch 'blender-v2.93-release' 2021-04-19 12:32:14 -05:00
d7caae56c4 Fix T87567: Crash adding item in empty attribute search
The function applying the search used the dummy search info for when
the item doesn't exist even when there was no UI data associated with
the node at all.

A fix is to only add the search menu when there is attribute info
stored for the node. This is something I wanted to do anyway, since
it makes it look more purposeful when there are no attribute info
for a node, less like a bug.

Differential Revision: https://developer.blender.org/D11016
2021-04-19 12:31:18 -05:00
2dc5961874 Merge branch 'blender-v2.93-release' 2021-04-19 12:25:45 -05:00
b8b7b47a00 Fix T85223: Some modifier panels can dissapear in old files
The problem is that each uiBlock needs to be assigned a unique name,
but when there can be multiple modifiers of the same type, we use the
panel sort order for the unique part of the string. However, the most
recent test file has 1200+ panels in the property editor, so 4
characters isn't enough for a unique string.

That's not a situation I expected, but it makes sense, because we don't
remove legacy panels with unused types when loading old files. So they
tend to accumulate a bunch of unused panels. That's why this works fine
with a new property editor, it doesn't all of the extra old panels.

These panels must be stored for the expansion status and order, but
arguably we could cull unused panels on save. However, simply increasing
the length of the unique panel string is a valid fix in this situation.
In the future, we can look into removing unused panels when saving.
2021-04-19 12:25:25 -05:00
458cbcbfea Merge branch 'blender-v2.93-release' 2021-04-19 11:12:42 -05:00
6f761c7110 Fix T87392: Copy modifier to selected does not do anything
This was caused by a stupid copy & paste error in rB9f323e9bf79fbf4157a.
2021-04-19 11:11:48 -05:00
8032bd98d8 GPencil: Add Layer Mask ordering buttons
Now the list of masks can be ordered as is done in Layers.

This can be used to organize list and in the future refquired for new masking options.
2021-04-19 17:44:40 +02:00
f99f884444 GPencil: Rename Draw" mode to Draw Mode` 2021-04-19 17:12:39 +02:00
feedf28549 Changes missed from 4402c2324b 2021-04-20 00:25:54 +10:00
4402c2324b Cleanup: use 'wmOperator.ptr' in draw functions
Draw functions used RNA_pointer_create to create the pointer,
however this already exists in the operator.
2021-04-20 00:14:37 +10:00
e1acefd45e GPencil: Add multiframe support to Reproject operator
Before only active frame was supported

Related to T87425
2021-04-19 15:58:41 +02:00
46a13482cb Cleanup: spelling 2021-04-19 23:56:12 +10:00
33440760a6 Merge branch 'blender-v2.93-release' 2021-04-19 23:54:06 +10:00
8245805ce3 Fix creating operator properties without an owner_id
Any dynamic enum access would not use the callback.
Always set the owner_id to avoid this causing problems.

Oversight in 919558854d
2021-04-19 23:52:59 +10:00
33f218fa3f Fix T86530: crash with Cycles OSL on Arm64
Bug in OSL itself, fix is submitted upstream.
2021-04-19 14:41:14 +02:00
eb06ccc324 Fix T87448: Avoid uiBut update if value was same
Previously, clicking into a number field, changing nothing and then
clicking outside the field again would trigger an update (RNA prop
would be set to the same value again). This could potentially cause
an expensive operation (like a modifer) to run again, even if all the
parameters were identical.

The fix prevents this by treating unchanging values in the field as a
cancel operation.

Reviewed By: Severin

Maniphest Tasks: T87448

Differential Revision: https://developer.blender.org/D10976
2021-04-19 12:20:05 +02:00
c75b2019e1 Fix incorrect compositor denoise node message about SSE on macOS Arm
Ref T78710
2021-04-19 12:12:23 +02:00
Eitan
799f532f46 Geometry Nodes: new Switch node
This is a first iteration of a switch node. It can only switch between
two inputs values based on a boolean. A more sophisticated switch
node that has an integer selector will probably come later.

Currently, the geometry nodes evaluator does not support lazy evaluation
of individual inputs. Therefore, all inputs will be computed currently.
An improvement to the evaluator will be worked on separately.

Ref: T85374

Differential Revision: https://developer.blender.org/D10460
2021-04-19 10:38:50 +02:00
112fb77157 Merge branch 'blender-v2.93-release' 2021-04-19 17:36:59 +10:00
1d96493c2f Merge branch 'blender-v2.93-release' 2021-04-19 17:36:56 +10:00
969cc22a89 Merge branch 'blender-v2.93-release' 2021-04-19 17:36:54 +10:00
eae39a4973 Merge branch 'blender-v2.93-release' 2021-04-19 17:36:51 +10:00
6dffdb02fa Fix drag event leaving the gizmo not under the cursor highlighted
Prevent drag events from changing the highlighted gizmo
unless the drag event activates the gizmo.

This resolves a glitch where testing a drag event would highlight
at the point the drag was initiated even when the event was not handled.
2021-04-19 17:18:59 +10:00
3b4b231be5 Cleanup: re-order gizmo handling checks
Non-functional change in preparation for fix.
2021-04-19 17:18:57 +10:00
0b903755a9 Fix spin-gizmo not allowing click events to select vertices 2021-04-19 17:18:52 +10:00
9175911ffa Fix spin-gizmo button tool-tip placement
gizmo_button2d_bounds result wasn't valid when the gizmo was part
of a 3D gizmo group.

Regression in cf6d17a6aa
2021-04-19 17:17:49 +10:00
0af28f007f Cleanup: Rename variables to indicate what is evaluated
`ob` --> `ob_eval`
`me` --> `me_eval`
`em` --> `em_eval`
2021-04-19 00:24:43 -03:00
950d8360f8 Fix typo in previous commit
`has_loose_edge` -> `has_loose_vert`
2021-04-18 20:45:06 -03:00
1825e67dea Transform Snap Object: Improve code that detects updates
The previous code had unclear hacks to avoid updating while transforming,
it was also duplicated in two functions causing an inconsistent
initialization of the looptris bvhtree (which could even generate
unpredictable snapping results).

Now, detection update and inicializatiom of common members are contained in
`snap_object_data_mesh_get` and `snap_object_data_editmesh_get`.

Also, the "Hack to avoid updating while transforming" is more evident.
2021-04-18 20:07:05 -03:00
c8dd684b65 Cleanup: Use utility to init userdata in 'transfrom_snap_object.c'
This deduplicates the code making it easier to edit.
2021-04-18 20:07:05 -03:00
6879868814 Merge branch 'blender-v2.93-release' 2021-04-18 20:06:32 -03:00
063c9938f1 Fix snap mixed with vertices ignored for meshes with vertices only
The logic assumed that there were only 3 basic snapping modes.
2021-04-18 20:04:58 -03:00
9a69653b42 Merge branch 'blender-v2.93-release' 2021-04-18 11:59:36 -05:00
06888a8970 Fix compile warning
The order of the two parameters was incorrect.
2021-04-18 11:58:44 -05:00
76eae59648 Cleanup: make format 2021-04-18 09:51:03 +02:00
01448ee7ce Cleanup: clang tidy readability-else-after-return 2021-04-18 09:49:14 +02:00
8d30a7a1cf Merge branch 'blender-v2.93-release' 2021-04-17 17:13:12 -03:00
4bce9c5283 Fix memory leak in the BLI_bitmap created in 'looptri_no_hidden_map_get' 2021-04-17 16:55:59 -03:00
1544bcfc37 Measure Tool: Snap to Cage Geometry
For Measure tool, it is more useful to snap to what is really visible.

So use the cage instead of the geometry that may be hidden with Bmesh.
2021-04-17 16:51:19 -03:00
4e1507bd3b Snap Gizmo Refactor: Implement options for the gizmo behavior
The Snap Gizmo now has options for occlusion, selection filter and edit
geometry.

It will be useful to implement in current tools.
2021-04-17 16:51:19 -03:00
1fc446a908 Fix recent snap refactor
It is important to check if editmesh eval cage is also bmesh.
2021-04-17 16:50:49 -03:00
aca9a1bac3 Transform Snap Refactor: Use enum for cage snap options
This allows the addition of the `SNAP_GEOM_CAGE` option.
Currently unused.
2021-04-17 15:45:08 -03:00
ebcf49fe1a Merge branch 'blender-v2.93-release' 2021-04-17 14:22:57 -04:00
2d5a715f44 Fix T86805 Inconsistent results for exact boolean.
The fast triangulator from Blenlib could leave a non-manifold mesh
after removing degenerate triangles. Switched to an exact triangulator.
2021-04-17 14:18:03 -04:00
3516ee5a14 Merge branch 'blender-v2.93-release' 2021-04-17 19:23:12 +02:00
ddbfae7a0d Cleanup: quiet compiler warning on macos 2021-04-17 19:19:46 +02:00
1a010450bc BLI: add unit tests for recently added methods 2021-04-17 19:06:48 +02:00
eff2b89446 BLI: support multiple parameters in Stack.push_as 2021-04-17 19:06:48 +02:00
686452fb1b BLI: add Vector.append_as method
This method is similar to `std::vector::emblace_back` in that it constructs
the new object inplace in the vector, removing the need for a move.

The `_as` suffix is consistent with similar behavior in Map and Set data structures.
2021-04-17 19:06:48 +02:00
e4990a5658 Fix wrong logic used in 'ED_view3d_depth_read_cached'
It is important to limit the pixels read on `BLI_array_iter_spiral_square`.

Fortunately `ED_view3d_depth_read_cached` was not being called with a
`margin` parameter.

Wrong logic introduced in rB44c76e4ce310.
2021-04-17 13:52:31 -03:00
fa2c00ae91 Fix wrong logic used in 'ED_view3d_depth_read_cached'
It is important to limit the pixels read on `BLI_array_iter_spiral_square`.

Fortunately `ED_view3d_depth_read_cached` was not being called with a
`margin` parameter.

Wrong logic introduced in rB44c76e4ce310.
2021-04-17 13:51:33 -03:00
d0d85742fc BLI: support multiple arguments for value in *_as methods of Map
This allows us to build more complex values in-place in the map.
Before those values had to be build separately and then moved into the map.

Existing calls to the Map API remain unchanged.
2021-04-17 18:39:35 +02:00
5cf6f570c6 Geometry Nodes: use virtual arrays in internal attribute api
A virtual array is a data structure that is similar to a normal array
in that its elements can be accessed by an index. However, a virtual
array does not have to be a contiguous array internally. Instead, its
elements can be layed out arbitrarily while element access happens
through a virtual function call. However, the virtual array data
structures are designed so that the virtual function call can be avoided
in cases where it could become a bottleneck.

Most commonly, a virtual array is backed by an actual array/span or
is a single value internally, that is the same for every index.
Besides those, there are many more specialized virtual arrays like the
ones that provides vertex positions based on the `MVert` struct or
vertex group weights.

Not all attributes used by geometry nodes are stored in simple contiguous
arrays. To provide uniform access to all kinds of attributes, the attribute
API has to provide virtual array functionality that hides the implementation
details of attributes.

Before this refactor, the attribute API provided its own virtual array
implementation as part of the `ReadAttribute` and `WriteAttribute` types.
That resulted in unnecessary code duplication with the virtual array system.
Even worse, it bound many algorithms used by geometry nodes to the specifics
of the attribute API, even though they could also use different data sources
(such as data from sockets, default values, later results of expressions, ...).

This refactor removes the `ReadAttribute` and `WriteAttribute` types and
replaces them with `GVArray` and `GVMutableArray` respectively. The `GV`
stands for "generic virtual". The "generic" means that the data type contained
in those virtual arrays is only known at run-time. There are the corresponding
statically typed types `VArray<T>` and `VMutableArray<T>` as well.

No regressions are expected from this refactor. It does come with one
improvement for users. The attribute API can convert the data type
on write now. This is especially useful when writing to builtin attributes
like `material_index` with e.g. the Attribute Math node (which usually
just writes to float attributes, while `material_index` is an integer attribute).

Differential Revision: https://developer.blender.org/D10994
2021-04-17 16:41:39 +02:00
4dca44086f Merge branch 'blender-v2.93-release' 2021-04-17 15:40:22 +02:00
d9224f64a1 Fix T87321: GPencil Arrange strokes not consistent with industry standards
Now if one stroke in the extremes of the stack is selected, other strokes are moved.

Reviewed By: pepeland, Dantti

Maniphest Tasks: T87321

Differential Revision: https://developer.blender.org/D10997
2021-04-17 15:38:36 +02:00
3608891282 Functions: extend virtual array functionality
This adds support for mutable virtual arrays and provides many utilities
for creating virtual arrays for various kinds of data. This commit is
preparation for D10994.
2021-04-17 15:13:20 +02:00
e524a6ecf7 Snap Gizmo: Improve event comparison code
Better distinction between modifier key events and mouse position events.

No functional changes.
2021-04-16 14:44:10 -03:00
fc37b265c8 Merge branch 'blender-v2.93-release' 2021-04-16 11:42:36 -05:00
b2a0f69275 Fix T87555: Incorrect view transform default in startup file
This was another error in rBac90c8a7743f. It turns out it's quite
important to use a full build to save the file, which I didn't do then.
2021-04-16 11:41:49 -05:00
7eda4cde71 Merge branch 'blender-v2.93-release' 2021-04-16 18:00:38 +02:00
463b38b0e0 GPencil: Remove Grease Pencil menu options in UV editor
Differential Revision: https://developer.blender.org/D10993
2021-04-16 18:00:18 +02:00
cf6d10ef46 Merge branch 'blender-v2.93-release' 2021-04-16 17:44:36 +02:00
0f81dafe6c Fix T87010: VSE: adding strips crashes in certain files
Caused by {rB571362642201} where versioning code for new sequencer tool
settings was only done for scenes already having sequencer scene->ed.

If scene->ed was not present, sequencer tool settings were never
initalized for this scene [if the VSE was then used later], leading to
crashes in some places.

Now just use the versioning code to initalize sequencer tool settings
for all scenes not having them yet.

Maniphest Tasks: T87010

Differential Revision: https://developer.blender.org/D10996
2021-04-16 17:42:10 +02:00
537460b86d Merge branch 'blender-v2.93-release' 2021-04-17 01:32:28 +10:00
0bf630493f Fix missing owner_id values from 919558854d
This prevented dynamic enum callbacks being called.
2021-04-17 01:29:51 +10:00
c7a8bcfa37 Merge branch 'blender-v2.93-release' 2021-04-17 00:21:30 +10:00
fa4b2d25cb WM: remove redundant click-drag offset for gizmo highlight checking
Tweak and click-drag events already apply this offset, this was a no-op.
2021-04-17 00:20:19 +10:00
bfc0f483c6 Merge branch 'blender-v2.93-release' 2021-04-16 23:53:04 +10:00
7bbead1e87 WM: prevent drag events being continually tested
Click-drag events that weren't handled would continually be tested
for each mouse-motion event.

As well as being redundant, this added the overhead of querying
gizmos twice per motion event.

Now click-drag is only tested once when the drag threshold is reached.

This mitigates T87511, although the single drag test still causes
the snap gizmo to flicker.
2021-04-16 23:50:05 +10:00
7aa38de085 Merge branch 'blender-v2.93-release' 2021-04-16 22:14:56 +10:00
0edfa5350e Merge branch 'blender-v2.93-release' 2021-04-16 22:14:53 +10:00
278b19745b Cleanup: clang-format 2021-04-16 22:13:05 +10:00
afd8e4bce7 Fix BLO_library_temp_load_id loading temporary ID's into G.main
The intention with this API function was to temporarily load
ID's tagged LIB_TAG_TEMP_MAIN,
however the way the `real_main` was used,
these ID's were loaded into the G.main.
2021-04-16 22:13:05 +10:00
be34d14575 Merge branch 'blender-v2.93-release' 2021-04-16 13:46:21 +02:00
68c4ba3482 Fix T87522: frame selected does not take instances into account
`ob->runtime.geometry_set_eval` can contain instances as well.

This only affected instances generated by geometry nodes.
We should probably have a separate function that tells us if an object
has instances or not..
2021-04-16 13:43:29 +02:00
1266df87c8 Fix unreported: instances disappear when instanced mesh is in edit mode
The issue is that for historic reasons, `geometry_set_eval` does not contain
the mesh component when the object is in edit mode.
2021-04-16 13:05:49 +02:00
bb9c83b9ff Remove unneeded code from previous commit. 2021-04-16 13:04:45 +02:00
ea7eff1cc8 Fix OCIO Shader Compilation Error.
Compilation fails when our OCIO wrapper creates a shader that
transfer first to scene ref and directly after that to display.
This cause is that the GPU resources of both transfers had the same
name. This is fixed by prefixing the resources.

This can be reproduced by loading a movie file (mkv) in the VSE editor.
Reported by Sergey Sharybin.
2021-04-16 12:54:53 +02:00
4bef49e32b Fix T87169: support attribute search on group nodes 2021-04-16 11:56:04 +02:00
ca37d8485c Fix T87217: improve impact of seed in point distribute node
Incrementing the seed just by one did not mix things up enough.
2021-04-16 11:43:16 +02:00
Wannes Malfait
58818cba40 Fix T87359: set group output in geometry node tree update callback
This also fixes T85511.

Differential Revision: https://developer.blender.org/D10970
2021-04-16 11:37:49 +02:00
a2e4d81849 Fix T87441: don't remove custom attributes automatically
In the past, custom attributes were rarely used in practice, because the
only way to use them was from Python. Since geometry nodes, more
users started to add their own attributes. Those attributes should not
be removed automatically. It is still possible to remove them in
geometry nodes explictly to improve performance.
2021-04-16 11:28:23 +02:00
382b06c80c Fix T85691: attributes used by geometry nodes were removed automatically
This has technically been fixed by rB3e87d8a4315d794efff659e40f0bb9e34e2aec8a,
but the fix there is questionable, because it disables an optimization for vertex groups
entirely. This fix is a little bit more precise in that it only disables the optimization when
the object is used by some geometry nodes modifier.
2021-04-16 11:23:28 +02:00
45eafd6562 Merge branch 'blender-v2.93-release' 2021-04-16 15:10:57 +10:00
073ef4d265 Merge branch 'blender-v2.93-release' 2021-04-16 15:10:52 +10:00
919558854d Fix T65064: Keymaps items controlling dynamic enums fail to export
Keymap UI and import/export could depend on the current
context for dynamic enum's.

Use STRUCT_NO_CONTEXT_WITHOUT_OWNER_ID for OperatorProperties.
2021-04-16 15:08:49 +10:00
43b08d0578 RNA: add STRUCT_NO_CONTEXT_WITHOUT_OWNER_ID flag
This flag is needed so PointerRNA structs that aren't
part of the current context can access enum values
without inspecting the context.

This is needed for keymap access, so the keymap UI and keymap
export doesn't depend on the current context.
2021-04-16 15:04:37 +10:00
cb4646a6df Merge branch 'blender-v2.93-release' 2021-04-16 12:20:38 +10:00
dc8a43c875 Fix RNA enum item callbacks not checking for NULL context
The NULL context is used to extract items for document generation.
2021-04-16 12:19:02 +10:00
0567f2b0bb Merge branch 'blender-v2.93-release' 2021-04-15 23:15:24 -03:00
43baf38758 Snap Gizmo: Minor optimization in detecting toggle inversion
Do not compare the x and y values of the mouse to check inversion.

Also remove "Lazy Initialization".
2021-04-15 23:13:59 -03:00
62bff15377 Fix various Blender 3.0 versioning issues
This changes the following items:

- package name is now `blender-3.0.0-git.09eb04c0a865-windows64`
  rather than `blender-3.00.0-git.09eb04c0a865-windows64`
- Fix version resource for blender.exe not building
- Data directories are now `3.0\...` rather than `3.00\....`
- User prefs are now in:
  `c:\Users\users\AppData\Roaming\Blender Foundation\Blender\3.0\`
  rather than:
  `c:\Users\users\AppData\Roaming\Blender Foundation\Blender\3.00\`
- Updating startup & preferences from previous release
  has a special exception for 3.0 to check for 3.93 and older.

See T87532

Ref D10986
2021-04-16 11:23:34 +10:00
ec241eb0d0 Merge branch 'blender-v2.93-release' 2021-04-15 19:14:23 +02:00
fa8d566c3b GPencil: Avoid invisible strokes in PDF export
There were still some invisible strokes.
2021-04-15 19:14:00 +02:00
018fa1fce3 Cleanup: Use correct float format 2021-04-15 19:14:00 +02:00
32d3b07b03 RNA: Silence warning when building without audaspace
`make lite` does not use audaspace, so some files will pollute the console with
tons of warnings about audio values not defined.

Reviewed By: nexyon, campbellbarton

Differential Revision: https://developer.blender.org/D10981
2021-04-15 17:50:58 +02:00
09eb04c0a8 Merge branch 'blender-v2.93-release' 2021-04-15 17:26:18 +02:00
5425388e60 GPencil: Fix unreported error exporting big files in PDF
The exporting was creating a pdf state for each stroke, but this was necessary only for strokes with opacity.

Now, the state is only created when needed and remove the state variable from class.

Also, avoid exporting invisible strokes.
2021-04-15 17:25:24 +02:00
ced26bacb7 Merge branch 'blender-v2.93-release' 2021-04-15 09:17:12 -05:00
a4877f9e54 Fix text in startup file python console
This was a mistake in rBac90c8a7743f6d0
2021-04-15 09:16:00 -05:00
27005f58c5 Blender Python version string to use the new version number system 2021-04-15 16:01:50 +02:00
bd8fd78b40 Merge branch 'blender-v2.93-release' 2021-04-15 15:52:44 +02:00
5b2353b230 Blender 2.93 splascreen
Credit: Erindale Woodford - youtube.com/erindale /
twitter.com/erindale_xyz
2021-04-15 15:47:07 +02:00
51991ffd38 Blender 2.93 bcon3 (beta) version bump 2021-04-15 15:46:45 +02:00
6e39da7948 Blender 3.0 version bump
Blender 3.0 is now in bcon1 (alpha).

There are likely a few places in Blender and the automated building pipeline
that may fail since we are switching our versioning number system.

For example, at the moment the splash and the status bar are showing
3.00.0, and it should show 3.1.0.

I suspect the Python API, version used to report a bug, buildname, are
all wrong too. These will be handled later.
2021-04-15 15:42:41 +02:00
d169314f9b Bump subversion before starting the next release cycle 2021-04-15 15:32:48 +02:00
61c3d7aa2c Bump subversion before starting the next release cycle 2021-04-15 15:32:17 +02:00
ecc2db8a3a UI: Rename itmes in point cloud add attribute menu
Since these were added, we decided that builtin and reserved name
attributes start with a lowercase letter. We also use "id" already in
a few nodes, so this change will be consistent with that.
2021-04-15 07:53:45 -05:00
27e13a608f GPencil: Change UI text and tooltip
The text was not changed in the refactor and had the old text.
2021-04-15 14:22:57 +02:00
5c067189e3 Fix T87434: spreadsheet shows same column more than once 2021-04-15 13:19:27 +02:00
4cf3010714 Fix T87171: Update multi input socket indices
When inserting a node on top of a link, the multi input socket
indices weren't updated. This fixes that and keeps the relative
order of the links the same.

Author: Wannes Malfait

Reviewed By: Fabian Schempp

Differential Revision: https://developer.blender.org/D10969
2021-04-15 11:38:46 +02:00
05dbbd83f0 Geometry Nodes: refactor implicit conversions
This refactor simplifies having standalone function pointer that
does a single conversion. It also speeds up implicit type conversion
of attributes.
2021-04-15 11:21:48 +02:00
2c3a9caffe Fix T87356 & T87358: Small multi-input socket issues
T87356 occured because last_node_hovered_while_dragging_a_link was not
set on node_link_init.
The assert in T87358 failed because the sorting operation was called even
if the drag link contained a link to another socket.
A little one frame jump was caused because frame was refreshed after
picking a link and before sorting happened.

Reviewer: Hans Goudey

Differential Revision: https://developer.blender.org/D10940
2021-04-15 10:00:25 +02:00
5ec39fc2e4 Cleanup: rename file
Internally we use the name "context (path)" instead of "breadcrumb".
This was missing from a rename in the original patch.
2021-04-15 09:37:50 +02:00
bbea79ce5e Cleanup: move type conversions to separate file 2021-04-15 09:35:56 +02:00
3810bcc160 Spreadsheet: breadcrumbs and node pinning
This introduces a context path to the spreadsheet editor, which contains
information about what data is shown in the spreadsheet. The context
path (breadcrumbs) can reference a specific node in a node group
hierarchy. During object evaluation, the geometry nodes modifier checks
what data is currently requested by visible spreadsheets and stores
the corresponding geometry sets separately for later access.

The context path can be updated by the user explicitely, by clicking
on the new icon in the header of nodes. Under some circumstances,
the context path is updated automatically based on Blender's context.

This patch also consolidates the "Node" and "Final" object evaluation
mode to just "Evaluated". Based on the current context path, either
the final geometry set of an object will be displayed, or the data at
a specific node.

The new preview icon in geometry nodes now behaves more like
a toggle. It can be clicked again to clear the context path in an
open spreadsheet editor.

Previously, only an object could be pinned in the spreadsheet editor.
Now it is possible to pin the entire context path. That allows two
different spreadsheets to display geometry data from two different
nodes.

The breadcrumbs in the spreadsheet header can be collapsed by
clicking on the arrow icons. It's not ideal but works well for now.
This might be changed again, if we get a data set region on the left.

Differential Revision: https://developer.blender.org/D10931
2021-04-15 09:00:47 +02:00
0bac768223 Fix missing NULL checks in adb21faa83 2021-04-15 15:07:36 +10:00
adb21faa83 Fix T70286: Dissolve vertices/edges creates duplicate face 2021-04-15 14:20:21 +10:00
2cc3a89cf6 CMake/deps: Remove CPP11 option for OpenImageIO
This flag is obsolete. In its current state (missing -D) it also
results in a CMake unknown argument error on macOS.
2021-04-14 21:33:12 +02:00
788a28251b Geometry Nodes: Realize instances when applying modifiers
The fact that geometry from instnances isn't realized when applying
a nodes modifier can be very confusing, especially for new users.
Nodes themselves realize geometry instances implicitly whenever they
need to. We also currently make instances real and convert points to
mesh when a modifier is added after the nodes modifier. With this
commit, we simply do the same thing when applying the modifier.

There are a few downsides though:
 - This can be an extremely heavy operations in some cases where
   geometry nodes is used to instance heavy geometry.
 - We will still have the issues with materials, since instances use
   materials from their original objects, but real geometry uses
   materials from the modifier object.

It was decided to live with the potential performance downsides
for now, the idea is the upsides of the change are more important,
and people making complicated setups will be more likely to know not
to apply the modifier. In the future there could be a warning if it's
necessary though.

Ref T87083
2021-04-14 14:23:48 -05:00
ac90c8a774 UI: Add a workspace for geometry nodes in the default startup file
This will hopefully make it faster to start using the node editor.
The workspace also includes the spreadsheet. Note that while
existing startup files won't have this workspace added, it will be
in the list of options when clicking on the "add workspace" button.

Ref T86499
2021-04-14 13:53:32 -05:00
4dd32f94aa GPencil: Invert color offsetting for Single and Object mode
Now, instead to offset the stroke color to make it visible over fill, the stroke keeps the original color and the fill is offset.

Related to the issue in T87406.
2021-04-14 19:00:18 +02:00
Falk David
7c18fb062d Fix T87406: Stroke color when using object color mode
The color of the strokes was shifted when using `Single Color` or
`Object Color`in Solid Display Mode. This was originally done so
that it was still possible to differentiate strokes and fills.

The fix allows for a completly flat shading by checking if the
Lighting Mode is set to `Flat`. If it is, then the colors are not
shifted for the strokes and everything will use the same color.

Reviewed By: antoniov, fclem

Maniphest Tasks: T87406

Differential Revision: https://developer.blender.org/D10957
2021-04-14 18:52:42 +02:00
71eaf872c2 Geometry Nodes: Add domain and data type to attribute search
This patch adds domain and data type information to each row of the
attribute search menu. The data type is displayed on the right, just
like how the list is exposed for the existing point cloud and hair
attribute panels. The domain is exposed on the left like the menu
hierarchy from menu search.

For the implementation, the attribute hint information is stored as a
set instead of a multi-value map so that every item (which we need to
point to descretely in the search process) contains the necessary data
type and domain information by itself. We also need to allocate a new
struct for every button, which requires a change to allow passing a
newly allocated argument to search buttons.

Note that the search does't yet handle the case where there are two
attributes with the same name but different domains or data types in
the input geometry set. That will be handled as a separate improvement.

Differential Revision: https://developer.blender.org/D10623
2021-04-14 11:11:51 -05:00
Adrian Newton
d705335c2b UI: 2D Animation: Fix Labelling issue within the 'Cursor' dropdown
Within the 2D Animation workspace, the 'Cursor' dropdown currently displays the 'Display Cursor' incorrectly aligned.

This change fixes the alignment issue.

Reviewed By: #user_interface, #grease_pencil, antoniov

Differential Revision: https://developer.blender.org/D10614
2021-04-14 17:56:22 +02:00
b9207fb43d FFmpeg: Adjust default proxy settings
GOP size and quality are adjusted for h264 codec.

These new values are based on result of benchmark on 9 random files:
https://docs.google.com/spreadsheets/d/1nOyUGjoVWUyhQ2y2lAd8VtFfyaY1wQNGj1krCCNbk7Y/edit?usp=sharing

Reducing quality to 50 reduces proxy filesize by about 2x on average
and has no significant impact on decoding performance.

Increasing GOP size from 2 to 10 also reduces proxy filesize 2x-3x
while scrubbing is only about 8% slower. It is still around 100FPS
with 1920x1080 media.
This is unfortunately about 50% slower than MJPEG, but this can be
improved with `fastdecode` tune applied to libx264 encoder

Quite surprisingly h264 codec presets had little influence on proxy
building performance as well as proxy filesize. So far it looks that
FFmpeg does initialize encoder in different way then Blender.
This applies mot only for presets but for tune and profile libx264
setting.
Once this issue is resolved, performance of proxies may be optimized
further.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D10897
2021-04-14 14:25:34 +02:00
9ca55b10b8 Fix T87479: GPencil SVG export outside of camera
When trying to export a GPencil object to SVG from outside the camera
view, the expoted file would contain invalid data. This was because the
calculation of the bounding box did not have any objects to
iterate over.

The fix makes sure we create the object list before trying to calculate
the bounding box.

Reviewed By: antoniov

Maniphest Tasks: T87479

Differential Revision: https://developer.blender.org/D10975
2021-04-14 10:14:04 +02:00
Manuel Castilla
a425b2b25c Fix (unreported) compositor resolution propagation broken by some nodes
Some operations may use no preferredResolution ({0, 0}) when calling determineResolution on inputs to check if they have resolution on their own. See MixOperation or MathOperation determineResolution implementation. In such cases {0, 0} resolution ends up being set when an input doesn't have own resolution, breaking propagation of the original preferredResolution. They don't mean to set it as resolution, it's just a check.

This patch only allows to set valid resolutions (>0). When it's 0 it may be understood as "No preferred or determined resolution" so it should not be set to give output operations another chance of finding a proper resolution by calling determineResolution again with a different preferredResolution.

Test file:
{F9932526}

Reviewed By: #compositing, jbakker

Differential Revision: https://developer.blender.org/D10972
2021-04-14 08:18:44 +02:00
6776b74d0a Cleanup: remove unused BLANK_PYTHON_TYPE define 2021-04-14 12:19:06 +10:00
937b843944 Cleanup: spelling 2021-04-14 12:11:03 +10:00
74cbe6d52c Cleanup: resolve type hinting error with make_source_archive 2021-04-14 11:41:39 +10:00
e45a57656c GNUmakefile: add 'check_mypy' convenience target 2021-04-14 11:36:46 +10:00
d63b72e9f9 Fix T78803: Bad widget drawing with the R600g driver
The SB back-end optimizer for the mesa R600g driver corrupts the vertex
shader for widget drawing. This will not be fixed upstream because SB is
getting replaced as part of the new NIR path. This was thought to be an
issue with instancing and an attempted fix was submitted in D8374, but
it did not fix the issue.

This patch reimplements the array look-up part of the code using switch
case as a workaround and removes the old workaround implemented as part
of D8374.

Reviewed By: Clement Foucault

Differential Revision: https://developer.blender.org/D10967
2021-04-13 22:36:24 +02:00
170293475c Nodes: Tooltip for Group Input properties
With this patch, users can define custom tooltips for the exposed
properties of their Geometry Nodes Groups.
Currently this custom tooltips are only used in the modifier panel,
but its a long term goal to use it in the node editor.

Reviewer: Hans Goudey

Differential Revision: https://developer.blender.org/D10884
2021-04-13 22:11:58 +02:00
86915d04ee Object: Enable transfer mode functionality for switching objects in Sculpt Mode
This implements the changes discussed in T87134 for including switch
object funcionality in 2.93. This includes:

- Remove the switch object operator experimental option
- Remove the option for switching objects in Edit Mode.
- Rename switch_object to transfer_mode.
- Enable the operator only in sculpt mode.
- Expose the operator in the Sculpt menu with an eyedropper modal
option.

On later releases, we could revisit enabling the operator in other mode
and object types as well as its place in the UI.

Reviewed By: JulienKaspar, JacquesLucke

Differential Revision: https://developer.blender.org/D10953
2021-04-13 20:31:50 +02:00
1a81693d38 Sculpt: Update menu entries for new Expand operator
Sculpt menus were using the legacy expand operator. This updates all
entries to use the new one.

It does not make sense to use Expand from the menus as it relies on the
brush cursor position, but now all Expand shortcuts are listed in the
UI.

Reviewed By: JacquesLucke

Differential Revision: https://developer.blender.org/D10952
2021-04-13 20:18:33 +02:00
4baf3964ae Revert 87aa514611: Removal of Lock Camera Gizmo Button
Differential Revision: https://developer.blender.org/D10968

Reviewed by Julian Eisel
2021-04-13 11:09:28 -07:00
d851fc3ad6 Fix T77330, T81704: Spline IK doesn't preserve bone scale correctly
Previously, the bone position outside of "fit to curve length" mode was
incorrect.

It assumed that the curve was completely straight with no bends or
turns. This would lead to bones being scaled down as their final
position would be servery underestimated in some cases.

The solution is to do a sphere -> curve intersection test to see where
to put the bones while still preserving their length. As we are using
the tessellated curve data this essentially boils down to us doing a
sphere -> line intersection check.

Reviewed By: Sybren

Differential Revision: http://developer.blender.org/D10849
2021-04-13 19:18:48 +02:00
5936ef986a deps_builder: Bump download time out to 30 mins
The timeout was set to 60 seconds, which was problematic
for some of the larger files like boost from the blender
svn mirror.
2021-04-13 10:19:09 -06:00
b8479a70c9 Add make source_archive_complete target
Add a `source_archive_complete` target for `make` that creates a source
archive including the source packages of Blender's dependencies.

This expands `make_source_archive.py` to include files from
`${BUILD_DIR}/source_archive/packages/` as well.

Reviewed By: dfelinto

Maniphest Tasks: T86124

Differential Revision: https://developer.blender.org/D10727
2021-04-13 17:47:48 +02:00
1f2a801044 Spreadsheet: rename Point to Vertex
Ref T86821.

Differential Revision: https://developer.blender.org/D10962
2021-04-13 14:49:00 +02:00
7cbd66d42f Cycles: Initialize all OptiX structs to zero before use
This is done to ensure building with newer OptiX SDK releases that add new struct fields gives
deterministic results (no uninitialized fields and therefore random data is passed to OptiX).
2021-04-13 13:56:15 +02:00
93d8c7516a Geometry Nodes: realize instances in subdivide node
This makes it consistent with the Subdivision Surface node.
2021-04-13 13:48:10 +02:00
961b6a6f7e Cleanup: sort cmake file lists 2021-04-13 21:44:20 +10:00
8c2c49ff9f Cleanup: redundant struct declarations 2021-04-13 21:43:07 +10:00
1534da457e Fix snap gizmo flickering while dragging
Ignore click-drag for non-mouse button drag events

Alternative to fix issue detailed in D10886.
2021-04-13 21:36:38 +10:00
2f367db2cc Cleanup: preview rendering, push bContext a bit further down the call stack
Pass `bContext *C` a bit further down the call stack, to prevent
exploding the number of parameters of `ED_preview_icon_render()`. An
upcoming change will require access to yet another context member, and
this can now be done without adding yet another parameter.

No functional changes.
2021-04-13 13:14:49 +02:00
Jesse Y
5b08cbae51 Fix T71960: Malformed .bmp files lead to crash
Adds appropriate checks/guards around all the untrusted parameters
which are used for reading from memory.

Validation:
- All the crashing files within the bug have been checked to not causes
  crashes any longer>
- A handful of correct .bmp were validated: 3 different files at each
  of 1, 4, 8, 24, 32 bpp depth along with a random variety of other 24
  bpp files (around 20 in total).
- ~280 million iterations of fuzzing using AFL were completed with 0
  crashes. The old code experienced several dozen crashes in first
  minutes of running {F8584509}.

Ref D7945
2021-04-13 21:13:09 +10:00
c50d55dd34 Cleanup: use typing for checking utilities 2021-04-13 21:13:09 +10:00
30ee57be60 Motion Tracking: setting Keyframe A & B was not updating UI indicators
Entering the numbers in the keyframe field was not triggering a viewport
update, so the little green lines down in the cache area were only
change when the user e.g. changed the frame.

Now send appropriate notifiers.

Issue spotted in T86456 by sebastian_k.

Maniphest Tasks: T86456

Differential Revision: https://developer.blender.org/D10963
2021-04-13 09:49:14 +02:00
721ff6ad12 Fix compile error: Missing include paths
rB8d9fd0427dd6 added the `WITH_GMP` definition but did not append the
include paths.
2021-04-13 09:47:58 +02:00
e9c548c3c3 CMake: fix error building with the version set to 300
When Blender's minor version was single digits, it wasn't properly
extracted. Resolve by adding zero padding.

Issue raised by @harley in D10954.
2021-04-13 17:43:05 +10:00
9b15c552cc DNA: support int8_t type in DNA structs
Differential Revision: https://developer.blender.org/D8908
2021-04-13 09:39:20 +02:00
7b9d94e073 Fix T87400: GPencil change Select Alternate defaults
Now, the Unselect Ends is disabled by default.
2021-04-13 09:24:34 +02:00
f5060bc901 PyAPI: support retrieving the exception when running a string
- Optionally get the error as a single line.
- Support access the error as an allocated string.
- PyC_ExceptionBuffer_Simple was always printing to the `stdout` while
  PyC_ExceptionBuffer didn't, now either print to the output.

Without this, callers are unable to do anything with the error string.
2021-04-13 15:28:43 +10:00
8d9fd0427d Cleanup: Nodes: Use consistent errors for nodes built without features 2021-04-12 17:43:36 -05:00
1e8a808910 Cleanup: Use C++ types in object_dupli.cc
Using alloca in C++ is not recommended, especially when we have the
blender::Array type that can contain an inline buffer.
2021-04-12 16:24:51 -05:00
ec20b21d04 Fix Cycles broken motion blur pass after recent bugfix 2021-04-12 20:59:05 +02:00
1c357a3c5f UI: Use Consistent name for select mirror
This commit cleans up the RNA names of select mirror operators so that 
they are all "Select mirror".

This makes the select menu in edit/pose mode consistent regardless of 
object type.

Differential Revision: https://developer.blender.org/D7356
2021-04-12 14:52:29 -04:00
2b9e6943cd Fix T86880: Cycles bevel shader not working after editing world 2021-04-12 20:10:30 +02:00
d2f55be7bb Fix T87283: crash with persistent data and motion blur 2021-04-12 20:10:30 +02:00
ce259ca382 Cleanup: fix address sanitizer warning 2021-04-12 20:10:30 +02:00
e45389c1a1 Fix T87324: incorrect parametric coordinates with light spread 2021-04-12 20:10:30 +02:00
2bd9f9d976 UI/Nodes: Improve feedback when adding node fails (e.g. on drag & drop)
This is especially useful when trying to add a node group instance, e.g. via
drag & drop from the Outliner or Asset Browser.
Previously this would just silently fail, with no information why. This is a
source of confusion, e.g. earlier, it took me a moment to realize I was
dragging a node group into itself, which failed of course.
Blender should always try to help the user with useful error messages.

Adds error messages like: "Nesting a node group inside of itself is not
allowed", "Not a compositor node tree", etc.

Adds a disabled hint return argument to node and node tree polling functions.
On error the hint is reported, or could even be shown in advance (e.g. if
checked via an operator poll option).

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

Reviewed by: Jacques Lucke
2021-04-12 18:48:22 +02:00
cbd1932619 Previews: allow undo'ing datablock preview generation
Allow users to undo the effect of the "Generate Preview" operator in the
asset browser (`ED_OT_lib_id_generate_preview`). Without this, the
button is too dangerous.
2021-04-12 18:08:25 +02:00
Damien Picard
15253d18b7 UI: Fix a few RNA description strings
A few strings describing RNA objects were wrong, including copy/paste errors, spelling and case.

Reviewed By: Blendify

Differential Revision: https://developer.blender.org/D10899
2021-04-12 11:30:11 -04:00
c037a02096 Win32: Fix fullscreen errors using Taskbar system menu
Changing window state using taskbar system menu could result in a titleless window.

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

Reviewed by Ray Molenkamp
2021-04-12 07:52:14 -07:00
e96f0d2e2b Fix unreported: Flat Surface objects
Before rBf674976edd88, the flag indicating whether a curve was 2D or 3D was
ignored by Surfaces objects.

So it can be said that Surfaces objects were always 3D.

We could remove updates to 2D on Surface objects, so the behavior is
identical to what it was before.

But this would also cause the return of `data.dimensions` to be misleading,
complicate the code a bit and add a micro overhead.

So the solution here is just to init all Surface objects as 3D.

Surface objects can now be constrained to 2D with the command:
```
data.dimensions = '2D'
```
2021-04-12 11:08:54 -03:00
Szymon Ulatowski
95e010a22e Fix T74680: Incorrect mixing in Glare node
The mixing function was designed to give correct results for Mix values of
-1, 0, and +1, but the behavior between these points was not linear. This is
unavoidable, because the function depends on both Mix and Mix^2 (by
multiplying value and mf) so they could not cancel out completely.

The new formula simply calculates the weighted sum without trying to invent
a smooth function.
Value for MixGlareOperation is now passed directly without scaling because
it is then easier to use.
Note that the previous formula performed max() twice for both input image
and the result, now there is just one max() per channel because the glare
input can't be negative.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D7138
2021-04-12 14:42:13 +02:00
53f277a2e6 Compositor: Allocate OIDN memory after receiving lock.
Related to {T77023}. When using many Denoise nodes the memory in OIDN
are allocated up front. A mutex could stall the process until. This
change will allocate the memory after it received the lock.
2021-04-12 14:29:49 +02:00
71cb0bdc43 Fix: File output uses incorrect resolution when first socket unused.
File output node always received the resolution from the first socket.
When that socket didn't had a link it would use a resolution of 0,0.
What lead to not saving the file at all.

This only effected Multi layer OpenEXR files.
This change would go over all the links to find the first valid
resolution.
2021-04-12 09:50:04 +02:00
75642b4cfd Fix T87252: File output node broken with more than 4 inputs.
In recent refactor the operator sockets were migrated from a std::list to a blender::Vector.
The way how the file output node created the sockets along mapping the sockets could
lead to storing incorrect pointers.

This patch fixes this by defining and mapping the sockets in separate loops.
2021-04-12 09:50:04 +02:00
175c1382da Fix T87348: convert vertex colors to linear color space
Differential Revision: https://developer.blender.org/D10956
2021-04-12 09:18:35 +02:00
1a4d0fa72d Spreadsheet: add spreadsheet width unit
This also fixes the issue that the width of the "Name" column
when viewing instances does not resize correctly.

Differential Revision: https://developer.blender.org/D10926
2021-04-12 09:14:41 +02:00
59f49072d0 Fix T87308: don't show columns when there are no instances 2021-04-12 09:10:26 +02:00
2a14ab998a Fix T87259: Un-Subdivide creates duplicate faces
Add argument to BM_vert_collapse_faces to remove any faces that become
duplicate as result of the collapse.
2021-04-12 14:24:09 +10:00
3a05135e12 Cleanup: defer 'os' imports in startup scripts 2021-04-12 13:36:55 +10:00
b58c1f6b1c project_info: use type hints
'mypy --strict' passes without errors.
2021-04-12 12:23:05 +10:00
b60c168e43 cmake_consistency_check: use type hints
'mypy --strict' passes without errors.
2021-04-12 12:22:20 +10:00
cf8773b525 Cleanup: remove make_quicky and enum generation utilities
- Remove `make_quicky` as on modern systems linking is the main
  bottleneck, and there isn't such a gain from partial builds.

- Remove enum generator as `PyC_StringEnumItems` & `EnumPropertyItem`
  are used in most places to access enums from Python, otherwise macros
  are added via macros.
2021-04-12 12:04:29 +10:00
09d7d88cc4 Fix T87157: GPencil subdivide last segment
Previously it was not possible to subdivide the last segment of a cyclic
stroke.

The fix makes sure that the correct number of new points is calculated
correctly and adds the new points to the last segment.

Reviewed By: antoniov

Maniphest Tasks: T87157

Differential Revision: https://developer.blender.org/D10902
2021-04-11 22:10:54 +02:00
d3cb1d845b Fix error extracting date in manpage generator
Error from recent cleanup 0e3bc2e321
2021-04-11 16:02:00 +10:00
1241e91707 Cleanup: use ELEM, STREQ macros 2021-04-11 14:43:05 +10:00
f9c0d7261a Cleanup: clang-format 2021-04-11 14:37:37 +10:00
1198b187b5 Cleanup: spelling 2021-04-11 13:09:27 +10:00
947ba0d27b Fix T87355: Crash using menu search from the top bar
Menu search used an area with a NULL data pointer,
replace this with a dummy pointer.

Caused by 3f3b4745b6.
2021-04-11 12:14:42 +10:00
0e3bc2e321 Cleanup: further cleanup to man page generator
- Raw strings (since backslashes were used for un-escaped characters).
- Parse the version string, avoiding color management errors being
  included.
2021-04-11 12:00:44 +10:00
ed5507de8a LibOverride: Fix resync bug on recursive overrides.
Linked override were not properly ignored in some part of the code,
leading to invalid resync results in some cases with recursive overrides
(i.e. overrides of overrides).

Reported by Andy @eyecandy from the studio.
2021-04-10 18:36:43 +02:00
3bd892a74c LibOverride: Fix (unreported) assert when creating overrides of linked overrides.
We do not want to copy exiting overrides data from linked ID when
creating its local override (be it either a template, or because linked
ID is itself an override of another lib data).

Note that this was not a very serious issue, would just cause some memory
leak since override data is re-created on newly copied local data
anyway.

These use cases have been very little tested so far, but both complex
production pipeline and future restrictive workflow will make them fairly
common...
2021-04-10 15:25:58 +02:00
c9e054c5de LibOverride: Add own flag to copy or not overrides to ID copy code.
Relying on only no-main for that was weak, and inn the end it turns out
we sometimes also need to ifnore override data during copy of Main
data-blocks.

NOTE: The new `LIB_ID_COPY_NO_LIB_OVERRIDE` is also added to the
`LIB_ID_COPY_LOCALIZE` set of flags.

NOTE: The fact that we may now copy liboverrides in some non-main cases
may cause issues in some cases, pretty impossible to track all possible
ones from reading the code... Would not expect too many problem though,
usages of `LIB_ID_CREATE_NO_MAIN` by itself are not so common.
2021-04-10 15:25:32 +02:00
f337310b43 Cleanup: minor improvements & type hints for man-page generator
- Use main() function.
- Use argparse for parsing arguments.
- Keep under 120 column width.
- Use type hints (passes `mypy --strict`).
2021-04-10 17:54:42 +10:00
0515ff70ec Transform: Use "orient_matrix" as a default when available
The "orient_matrix" parameter was only used when contraint was defined.

This change will hardly be noticed by the user, but it can be useful for
addon developers.

Possibly resolves T85734.
2021-04-09 18:26:27 -03:00
a272eb38f4 Fix T87167: Object dragged from Outliner into Geo Nodes doesn't auto update
Add call to `DEG_relations_tag_update`

Differential Revision: https://developer.blender.org/D10928
2021-04-09 16:05:12 +01:00
e3a06420b2 Compositor: Output where debug is stored. 2021-04-09 16:26:34 +02:00
a631a9eb1f Fix T86928: OSL script compilation failed
Tell `FindOSL.cmake` where to find the shader header files. These have
moved from `${LIBDIR}/osl/shaders` to `${LIBDIR}/osl/share/OSL/shaders`
when OSL was upgraded (T85365).
2021-04-09 13:48:56 +02:00
7ab8a3838c Cleanup: use nullptr. 2021-04-09 13:09:15 +02:00
87bfa2b207 GPU: Enable suggest-override for CPP. 2021-04-09 13:07:53 +02:00
e4a2fc57d5 Blender README: Fix the full license name.
Patch suggested and reviewed by Sergey Sharybin.
2021-04-09 12:39:33 +02:00
Jeroen Bakker
7cef01b090 Compositor: Enable suggest-override warning.
Compostior relies heavilly on overridden methods. The override keyword has been added
in this module and is desired. The benefit of the override keyword is
that it reports an error when not applied to a (base) virtual method and report
what will not match when refactoring the code to be closer to blender style guide.

Reviewed By: sybren

Differential Revision: https://developer.blender.org/D10846
2021-04-09 12:04:45 +02:00
27dcccb20f Cleanup: defer importing nodeitems_utils (missed last commit) 2021-04-09 20:03:04 +10:00
3515036319 Cleanup: defer importing nodeitems_utils 2021-04-09 19:00:04 +10:00
bae66609b4 Cleanup: use our own code style for doxy-gen comment blocks 2021-04-09 19:00:04 +10:00
Charlie Jolly
b08394d57a Fix T87117: Geometry Nodes: Add missing Map Range modes to shader node
Add missing modes as reported in T87117 bug report.

Reviewed By: JacquesLucke

Differential Revision: https://developer.blender.org/D10885
2021-04-09 09:26:37 +01:00
75491fe100 Spreadsheet: persistent column storage and data source
A `DataSource` provides columns for the spreadsheet to display.
Every column has a SpreadsheetColumnID as identifier. Columns
are not generated eagerly anymore, instead the main spreadsheet
code can request a column from a data source with an column
identifier. The column identifiers can be stored in DNA and allow us
to store persistent data per column.

On the user level the only thing that changes is that columns are
not shown in alphabetical order anymore. Instead, new columns
are always added on the left. The behavior can be changed,
however I'd prefer not to automate this too much currently. I think
we should just add operators to hide/reorder/resize columns soonish.

Differential Revision: https://developer.blender.org/D10901
2021-04-09 10:20:46 +02:00
22574f741c Geometry Nodes: quiet warning when using object info node
Some object types don't have a geometry component in the depsgraph.
Before, there always was a warning printed when such an object was
used in the object info node (e.g. to get its location).
2021-04-09 10:07:49 +02:00
2110239547 Fix T87150: bad points appearance in orthographic view
Points are drawn as half octahedron (aligned to the camera).
Getting the appropriate matrix for facing the camera would fail in in
orthographic view, points were not facing the camera (revealing their
missing other half octahedron)

Maniphest Tasks: T87150

Differential Revision: https://developer.blender.org/D10923
2021-04-09 09:14:53 +02:00
3f91591c1d Cleanup: use const for BKE_where_on_path and related structs 2021-04-09 15:00:03 +10:00
71da3f31d4 Fix use of uninitialized memory in BKE_scene_objects_as_gset
Share macro for setting BLI_Iterator defaults to ensure
this doesn't happen again in cases the ITER_* macros aren't used.

Oversight in 14d74fb341.
2021-04-09 14:49:32 +10:00
3d7e3d5ad0 Fix: Missing GeometryNodeCustomGroup
This is a minor change to add some plumbing code
to support custom geo nodes. This is working the
same way as the custom cycles and compositor nodes.

An example add-in is attached to D10784

Reviewed By: JacquesLucke

Differential Revision: http://developer.blender.org/D10784
2021-04-08 16:25:09 -06:00
500045a0d3 Geometry Nodes: Support volumes in the bounding box node
Where possible, nodes in the "Geometry" category should support all
geometry component types. This adds support for volumes in the
recently added bounding box node, based on functions added in the
previous two commits.

Differential Revision: https://developer.blender.org/D10906
2021-04-08 14:32:41 -05:00
57fe650b76 BKE: Refactor volume bounding box code
This commit splits of the function that generates a bounding box for a
volume into a new function, so that the min and max coordinate can
be retrieved from volume data without an object. Also some cleanup:
using the float3 type.
2021-04-08 13:44:54 -05:00
0e2a1ef132 BKE: Add a utility to transform a shallow copy of a volume grid
Often you need to apply a transformation to a grid without changing the
original, and it's necessary to avoid a deep copy of the actual data.
OpenVDB has a function to do this, this commit simply adds a wrapper
to transform and use that function with blender's `float4x4` data type.

Split from D10906
2021-04-08 13:28:35 -05:00
223093ed17 Cleanup: Remove unused includes, use consistent order 2021-04-08 13:07:25 -05:00
1ec9ac2016 Geometry Nodes: Support instances in attribute search
Previously only attributes of "real" geometry were displayed in
attribute search. This commit adds code to look through attributes
on instances and add those to the search drop-down too.

This required implementing the same sort of recursive traversal as
the realize instances code. The situation is a bit different though,
this can return early and doesn't need to keep track of transforms.

I added a limit so that it doesn't look through the attributes of
too many instanced geometry sets. I think this is important, since
this isn't a trivial operation and it could potentially happen for
every node in a large node tree. Currently the limit is set at 8
geometry sets, which I expect will be enough, since the set of
attributes is mostly not very unique anyway.

Fixes T86282

Diffrential Revision: https://developer.blender.org/D10919
2021-04-08 12:19:09 -05:00
fd414b4906 Cleanup: Use const arguments for volume code
The problem was that you could getting write access to a grid from a
`const Volume *` without breaking const correctness. I encountered this
when working on support for volumes in the bounding box node. For
geometry nodes there is an important distinction between getting data
"for read" and "for write", with the former returning a `const` version
of the data.

Also, for volumes it was necessary to cast away const, since all of
the relevant functions in `volume.cc` didn't have const versions. This
patch adds `const` in these places, distinguising between "for read"
and "for write" versions of functions where necessary.

The downside is that loading and unloading in the global volume cache
needs const write-access to some member variables. I see that as an
inherent problem that comes up with caching that never has a beautiful
solution anyway.

Some of the const-ness could probably be propogated futher in EEVEE
code, but I'll leave that out, since there is another level of caching.

Differential Revision: https://developer.blender.org/D10916
2021-04-08 12:00:26 -05:00
b51562ed76 Fix T87232: Crash when evaluating object with unsupported modifier
Fix `nullptr` redeference when setting 'orig_data' pointers on CoW copies,
by stopping the loop also when `element_cow == nullptr`. This avoids a
crash of Blender when the original list of pointers is longer than the
CoW list of pointers.

I've also added a `BLI_assert()` that checks for equal lengths of the
two `ListBase`s, so that problems like these aren't hidden away completely.

The root cause of the crash was actually a modifier that was assigned to
an object of the wrong type (an Armature object doesn't support modifiers).
This caused the list of modifiers on the CoW copy to be shorter than the
list of modifiers on the original Object. It's still a mystery how that
object got that modifier in the first place.
2021-04-08 18:59:22 +02:00
8777a44ccb VSE: Fix crash when building proxy
When video file for strip doesn't exist, building crashes on NULL
dereference.

This check was removed by 04e1feb830.
2021-04-08 18:51:47 +02:00
a19aa090d2 VSE: Fix building image proxies
Broken by 04e1feb830

Caused by accidentaly moving `SEQ_proxy_rebuild_finish` outside of
`if (nseq->type == SEQ_TYPE_MOVIE)` condition in function
`SEQ_proxy_rebuild_context()`.
2021-04-08 18:44:38 +02:00
18dca6911b Cleanup: 2021-04-08 13:19:02 -03:00
dbb4d51971 Fix previous commit: wrong is_mesh_verts_only check 2021-04-08 13:12:43 -03:00
Germano Cavalcante
3d6798962c Fix T86762: Inconsistent show of result of modifier Screw in edit mode
To check if an "is_mesh_verts_only" mesh, the overlay engine checks if the
mesh has no "totedge" and has "totvert".

However, sometimes this engine can check the wrong mesh since editmesh
works on `embm->mesh_eval_final`.

Reviewed By: fclem

Differential Revision: https://developer.blender.org/D10917
2021-04-08 13:07:47 -03:00
08ae545de4 Fix T87107 EEVEE: Principled BSDF doesn't handle negative specular
Negative speculars are evil.
2021-04-08 17:45:16 +02:00
2e3b0e8a99 Fix: Dragging a modifier to the same index recalculates modifier stack
The fix is to simply check if the final index is the same as the start
index and not call the "reorder" callback in that case.
2021-04-08 10:44:33 -05:00
c6ff722a1f Spreadsheet: support showing data of specific node
Previously, the spreadsheet editor could only show data of the original
and of the final evaluated object. Now it is possible to show the data
at some intermediate stages too.

For that the mode has to be set to "Node" in the spreadsheet editor.
Furthermore, the preview of a specific node has to be activated by
clicking the new icon in the header of geometry nodes.

The exact ui of this feature might be refined in upcoming commits.
It is already very useful for debugging node groups in it's current
state though.

Differential Revision: https://developer.blender.org/D10875
2021-04-08 17:35:37 +02:00
5e77ff79cc Add ability to get a selection list of bones
This adds the ability to get a selection list for both edit mode bones
and pose mode bones.

To do this the selection menu list logic had to be reworked a bit.
Before it only stored the names of objects. This might work will of
objects, however as stated in the code, it might fail for linked objects
(so multiple object can have the same name in some corner cases).

For bones it is a very common occurance where you can have multiple
armature that has the same bone names. So now it also stores the object
and bone pointers for this case.

Reviewed By: Sybren

Differential Revision: http://developer.blender.org/D10570

Fix T85796
2021-04-08 17:26:33 +02:00
5c4d24e1fd EEVEE: Ensure Reflection: Use new implementation
Use same implementation as Cycles. Is also a bit faster.

Should also fix T86578 at the same time.
2021-04-08 17:09:59 +02:00
cf2baa585c Fix T81707: Spline IK Joints "Floating" above curve
The issue was that where_on_path uses a resampled curve to get the data
from the curve. This leads to disconnects between the curve the user
sees and the evaluated location data.

To fix this we simply use the actual curve data the user can see.

The older code needed a cleanup either way as there were hacks in other
parts of the code trying to work around some brokenness. This is now
fixed and we no longer need to clamp the evaluation range to 0-1 or make
helper functions to make it do what we actually want.

Reviewed By: Campbell, Sybren

Differential Revision: http://developer.blender.org/D10898
2021-04-08 15:52:33 +02:00
f031791185 Cleanup: modernize-use-equals-default
This was missing from rB19dfb6ea1f6745c0dbc2ce21839c30184b553878.
2021-04-08 15:51:39 +02:00
89b3c9da48 Text Editor: don't force other views to follow the cursor
While the existing behavior worked as intended,
it wasn't possible to have two views on the same file at different
locations.

Since there isn't much use in having two views open at the same location
allow one view to be at a different scroll location.

UI edit-source and selecting a text data block now need explicit calls
to scroll to the cursor location.

Resolves T87284
2021-04-08 22:15:51 +10:00
945b1143df Cleanup: renaming, comments and removing unused code in render pipeline 2021-04-08 13:13:07 +02:00
d244067d12 Fix T87291: assert on exit with preview render
Don't keep around persistent data in this case.
2021-04-08 13:13:07 +02:00
76cc8e8436 Fix T85974: Edit-mode undo/redo causes assertion
Without legacy-undo, loading memfile undo only cleared edit-mode data
for mesh and armature object types.
This causes an assertion when loading edit-mode undo steps afterwards
for other object types as the existence of this data made entering
object mode fail.

Resolve this by freeing all objects types undo data from ED_editors_exit
2021-04-08 20:39:56 +10:00
ed2639c722 Object: add ED_object_editmode_free_ex utility function 2021-04-08 20:39:44 +10:00
5e7331f12b Cleanup: rename variable (using underscore separator)
Prepare for adding another variable that
reads poorly without a separator.
2021-04-08 20:35:13 +10:00
0c0e9390d1 Revert "Fix entering edit-mode when object mode and edit-data don't match"
Before this change, object-data could only have
one of the objects referencing it in edit-mode.

Reverting since multiple meshes in edit-mode (for the same object data)
isn't thread-safe as the evaluated edit-meshes are created in the
original edit-mesh, causing a crash updating the depsgraph
for linked duplicates, see: T86767.

While we could support this case, it's a bigger project without
significant benefits, so reinstate the limitation of only
allowing a single object to be in edit-mode for each object data.

This adds back the error from T85974 which caused an assertion
but didn't crash in release builds.

This reverts commit 2b60d7d09c.
2021-04-08 20:34:29 +10:00
3249ab70ef Cleanup: spelling 2021-04-08 20:22:45 +10:00
4d43683899 PyAPI: ImBuf.copy now copies the underlying imbuf
Without this, copy wasn't useful.
2021-04-08 20:19:26 +10:00
e92a7800b5 LibOverride: Fix several issues with resync code.
This commit essentially touches to post-processing of collections and
objects after resync itself has been done, to ensure their proper
instantiation in the scene:

 - Remove a lot of the process in resync case (resynced data are assumed
   to be already instantiated in the scene, unlike override creation
   case).

 - For auto-resync, only do post-processing once after all overrides
   have been resynced (doing it after each individual resynced was
   causing a lot of instantiation glitches, with a lot of unwanted
   extra objects and collections being added to the master collection).

It also deals in a much more reliable way with detection of objects
missing from the scene, by using the new `BKE_scene_objects_as_gset`
utils.

As a bonus this makes auto-resync process slightly faster (only by a few
percents, but that's always good to get).
2021-04-08 11:45:55 +02:00
c1b1ed4d5b Minor cleanup to scene_collection_array.
Use array allocation, and remove useless check.
2021-04-08 11:45:44 +02:00
14d74fb341 BKE_collection: Add a util returning a gset with all objects in given scene's collections.
This is internaly using the code of `BKE_scene_objects_iterator` and
steals its gset. More efficient than using that iterator directly to
rebuild another GSet...
2021-04-08 11:45:44 +02:00
b4d6fe1f87 Cleanup: Typos in comments. 2021-04-08 11:45:44 +02:00
89e353354f Outliner Override: Tweak to order of error messages. 2021-04-08 11:45:44 +02:00
92dfc8f267 Outliner: regroup more type of entries under a single icon.
In folded view, some type of data are listed as one icon per item,
others are 'compacted' as a single icon with a counter.

This commit adds bones (edit, normal and pose ones), pose groups and
vertex groups as 'compacted' ones in folded view.

Part of D10855.
2021-04-08 11:45:37 +02:00
e1ae5bd45f LibOverride: Add a dedicated view in the Outliner.
This is a minimal, information-only view currently, listing by default
all the override data-blocks, with their user-edited override
properties.

System-generated overrides (like the overrides of pointers to other
override data-blocks) can be shown through a filter option.

Finally, potential info or warning messages from (auto-)resync propcess
are also shown, as an icon + tooltip next to the affected items.

Part of D10855.
2021-04-08 11:45:28 +02:00
8b68a75872 LibOverride: Add a new 'leftover' flag to ID.
This flag is set for liboverride IDs that are detected as no longer
needed by resync process, while having been user-edited, so
auto-handling code cannot silently delete them.

Exposing those to users will be part of the new incoming Override
Outliner view.

Part of D10855.
2021-04-08 11:31:24 +02:00
de6f19ce22 Cleanup: modernize-use-equals-default
This was missing from rB19dfb6ea1f6745c0dbc2ce21839c30184b553878.
2021-04-08 11:24:02 +02:00
19dfb6ea1f Cleanup: enable modernize-use-equals-default check
This removes a lot of unnecessary code that is generated by
the compiler automatically.

In very few cases, a defaulted destructor in a .cc file is
still necessary, because of forward declarations in the header.

I removed some defaulted virtual destructors, because they are not
necessary, when the parent class has a virtual destructor already.

Defaulted constructors are only necessary when there is another
constructor, but the class should still be default constructible.

Differential Revision: https://developer.blender.org/D10911
2021-04-08 11:07:27 +02:00
0ea66039dd Fix T87267: Texture Paint stencil texture not drawing
Typo in {rBafcfc6eb0842}.

Maniphest Tasks: T87267

Differential Revision: https://developer.blender.org/D10915
2021-04-08 08:36:23 +02:00
b7b1b2325c Fix T87274: Curve 2D resets to 3D on reload
This code is incompatible with .blend files from subversion 16 and 17.

The ideal would be to create a new subversion when landed rBf674976edd88.

But for now, due to the delay, moving the code to the previous subversion
can solve it.
2021-04-07 18:03:10 -03:00
79ba4fde15 Cleanup: Rename function, switch order of arguments
The function name was not very specific, this makes it clearer that it
works on instances rather than only real geometry. Also use `r_`
prefix for the return argument.
2021-04-07 15:49:02 -05:00
1a8db9ec04 Geometry Nodes: Rename grid output UV attribute
During review of D10730 it was discovered that the "uv" name causes
issues for cycles, which uses it as a default internal data name. While
that could be fixed in the future, there was no particular reason to use
"uv" instead of "uv_map", so we use the latter instead here, which
is consistent with the lowercase naming scheme chosen for attributes.
2021-04-07 13:23:32 -05:00
22ba85b510 Geometry Nodes: Greatly improve speed of some mesh primitives
Some of the BMesh primitive operators have a lot of overhead due to the
fact that they use other operators like extrusion, removing doubles,
and rotation, to build each shape rather than filling arrays directly.

Implementing the primitives directly with the Mesh data structure is
much more efficient, since it's simple to fill the result data based
on the known inputs. It also allows also skip the conversion from BMesh
to Mesh after the calculations.

Speed matters more for procedural operations than for the existing
operators accessible from the add menu, since they will be executed
every evaluation rather than once before a destructive workflow.

| Shape    |  Before (ms) |  After (ms) | Speedup (x times faster) |
| -------- | -------------| ------------| -------------------------|
| Cylinder | 1.1676       | 0.31327     | 3.72                     |
| Cone     | 4.5890       | 0.17762     | 25.8                     |
| Sphere   | 64213.3      | 13.595      | 4720                     |

The downside of this change is that there will be two implementations
for these three primitives, in these nodes and in `bmo_primitive.c`.
One option would be re-implementing the BMesh primitives in terms of
this code, but that would require `BMesh` to depend on `Mesh`, which
is currently avoided. On the other hand, it will be easier to add new
features to these nodes like different fill types for the top and the
bottom of a cylinder, rings for a cylinder, and tagging the output with
boolean attributes. Another factor to consider is that the add mesh
object operator could be implemented with these nodes, just providing
more benefit for a faster implementation.

As a future cleanup, there is room to share code that generates the
"rings" topology between different nodes that generate meshes.

Differential Revision: https://developer.blender.org/D10730
2021-04-07 13:15:43 -05:00
7c04ef210e Fix T87263: Animation decorator not working on Grease Pencil Build modifier Factor value
When having a checkbox and a value both in one row together with an
animation decorator it is questionable whether the decorator should act
on animating the checkbox or the corresponding value. At the moment,
usage in modifiers does not seem to be very consistent:

Here the animation decorator works for animating the checkbox:
- `Build` (greasepencil) > `Factor` (this was reported and is changed in
this patch to act on the value instead of the checkbox)
- `DataTransfer` > `Topology Mapping` > `Max Distance` (this I guess
should also act on the value instead of the checkbox)
- `Edge Split` > `Edge Angle` (questionable)
- `Mirror` > `Merge` (questionable)
- `Screw` > `Merge` (questionable)
- `Wireframe` > `Crease Edges` (questionable)

Here the animation decorator works for animating the value:
- `VertexWeightEdit` > `Group Add/Remove Threshold`
- `Decimate` > `Symmetry`

So in this patch only the behavior in the greasepencil Build modifier UI
is changed, since I think it is quite obvious that one would more often
use the decorator for animating the factor value than for animating the
checkbox.

Maniphest Tasks: T87263

Differential Revision: https://developer.blender.org/D10910
2021-04-07 18:44:15 +02:00
554d921124 UI: Remove confusing "Unset" context menu entry
This was added in 37b82a2d26, doesn't have much purpose and doesn't even do
anything in the vast majority of cases. It only affects custom properties. So
at the very least it shouldn't be shown for regular RNA property buttons. But
even for cases where it may do something, we couldn't find a good use-case. If
this operator has use-cases with some add-ons, the add-ons can expose it
differently, e.g. with a little 'x' icon next to the button, like it's done in
the keymap editor.

So removing the context menu entry now. Should this turn out to be a problem,
it can be brought back but much more selectively (only where it actually does
something). Or we could combine it with "Reset to Default".

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

Reviewed by: Brecht Van Lommel, Hans Goudey
2021-04-07 18:04:43 +02:00
Leon Leno
965425bcbc Fix T86463: Colored collection icons don't scale with zoom level
This patch fixes the issue in T86463 that colored collection icons in
the collection search box don't scale according to the zoom level.

The issue was caused by the drawing function for the colored
collection icons not allowing to change the size of the icons.
This patch addresses that by scaling the icon based on the drawing
width.

Reviewed By: #user_interface, natecraddock, Severin

Differential Revision: https://developer.blender.org/D10708
2021-04-07 08:54:05 -06:00
02a7289fe3 Fix T87264: Button to remove physics modifier doesn't work
This is caused by rB9f323e9bf79f. When hover shortcuts are used,
we cannot use the modifier from the context (which will be the
active modifier), or they won't be hover shortcuts anymore!

There didn't use to be an editor-level "modifier" context variable,
which is why this worked before.

The fix is simple, just specify the modifier name for this particular
remove button.

Differential Revision: https://developer.blender.org/D10870
2021-04-07 09:12:34 -05:00
15670ebb95 Cleanup: Fix pessimizing move warning. 2021-04-07 15:20:45 +05:30
2fbee4598c Fix T87195: Boolean node multi-input socket only accepts one link
The default insert link callback for nodes was trying to move the
existing link away, since it didn't properly handle multi-input sockets
(though the problem wasn't exposed for the join node). We can basically
skip all of this "moving existing links" for multi-input sockets, unless
we are at the link limit.
2021-04-07 00:32:16 -05:00
fd0a0096dd Cleanup: Various cleanup of node link handling functions
Use LISTBASE_FOREACH macro, rename variables, comment formatting,
simplification of logic, etc.
2021-04-07 00:26:03 -05:00
e0a1a2f49d Geometry Nodes: Bounding Box Node
This commit adds a simple node to output the min and max of an
axis-aligned bounding box for the input geometry, as well a rectangular
prism mesh created from these values for convenience.

The initial use case for this node is a "bounding box boolean", where
doing the boolean with just a bounding box could be signigicantly
faster, for cases like cutting a hole in a wall for a window. But it's
easy to imagine other cases where it could be useful.

This node supports mesh and point cloud data right now, volume support
will come as a separate patch. Also note that there is plenty of room
to improve the performance of this node through parallelization.

Differential Revision: https://developer.blender.org/D10420
2021-04-06 16:02:55 -05:00
Wannes Malfait
93114180d7 Geometry Nodes: Use distance units for socket values
This adds the property subtybe `PROP_DISTANCE` where appropriate.

Differential Revision: https://developer.blender.org/D10900
2021-04-06 12:02:28 -05:00
b61b34a5d2 Fix T87236: crash reading file with grease pencil palettes
Caused by typo in {rB76689e851700}.

Since Palettes and bGPDpalette are not the same size, this would not
only cause a crash in versioning code, but could only go downhill from
here on.

Maniphest Tasks: T87236

Differential Revision: https://developer.blender.org/D10903
2021-04-06 17:01:06 +02:00
b93c445809 BLI: return pointer to added resource
Without this, the caller often has to get the pointer to the
resource before adding it to the resource scope.
2021-04-06 15:49:43 +02:00
Germano Cavalcante
490801ba1d Fix T86889: Rotation with top plane view glitches
The `InputAngle` function uses a flawed algorithm to fix precision issues.

This commit refactor the logic of that function by using BLI utilities.

Differential Revision: https://developer.blender.org/D10880
2021-04-06 10:41:45 -03:00
24d71acd86 Fix Cycles rendering files with Simplify wrong after recent changes
The versioning code was not taking into account the old default for AO
bounces.
2021-04-06 15:34:13 +02:00
9676a1f61e Fix render crash in some .blend files after Persistent Data changes
Must always clear recalc flags, even if no editors use them, the depsgraph
execution itself also depends on them.
2021-04-06 15:02:30 +02:00
19ff2479cf Compositor: Add Streaming Operator for NodeOperationBuilder.
For debugging purposes to convert the internal state of the
NodeOperationBuilder to a graphviz.

Usage:

	std::cout << *this << "\n";

Inside any method of the NodeOperationBuilder.
2021-04-06 12:06:47 +02:00
663a82b10d Fix T86932: Curve: pick shortest path missing update of active point drawing
For curves, we need to tag the curve ID_RECALC_COPY_ON_WRITE for batch
cache update (same as in {rB24b2fe50f3ec}).

Maniphest Tasks: T86932

Differential Revision: https://developer.blender.org/D10826
2021-04-06 11:14:38 +02:00
e71408d0d7 Fix T84623: Curve/Surface force not working in normal direction
Tweaking e.g. a field strength would then not use the curve/surface
normal anymore [but the object center instead].

If a curve has a forcefield with effector shape Curve (in code its shape
is PFIELD_SHAPE_SURFACE then), it wil get a SurfaceModifier.

Changing properties will free the SurfaceModifierData's bvhtree and mesh
And these dont get copied along when doing the CoW copy, these are
explicitly set to NULL. So this was also failing for meshes, not just
curves.

Without the mesh & bvhtree though, get_effector_data() will not set the
EffectorData's normal correctly (it is closest_point_on_surface() which
does this). And without the right EffectorData's normal, the effector
will of course work unexpected.

Going in and out of editmode made this work because that goes down this
route:
- BKE_object_handle_data_update
- BKE_displist_make_curveTypes
- do_makeDispListCurveTypes
- curve_calc_modifiers_post
-- BKE_mesh_new_nomain_from_curve_displist
-- we then have our desired updated mesh from the curve
-- this will also call the SurfaceModifiers deformVerts [which - given we
have a valid mesh - will update the bvhtree properly]

Also note that _animating_ the effector actually works, (have not done
the deep dive why this works, assume the curve geometry is updated in
this case)

So, now just carefully tag the curve ID_RECALC_GEOMETRY in
rna_FieldSettings_update for this specific case.

Maniphest Tasks: T84623

Differential Revision: https://developer.blender.org/D10092
2021-04-06 11:06:24 +02:00
Evan Wilson
7334c481c0 Fix T86175: Missing viewport update when toggling HDRI preview
Caused by rB0f95f51361d7.

Similar to T85515, T84717, T85543 and their related fixes.
In this case, add missing shading notifier as in rB9274bd457a25.

Reviewed By: brecht, lichtwerk

Maniphest Tasks: T86175

Differential Revision: https://developer.blender.org/D10604
2021-04-06 09:57:40 +02:00
c6ddc2abd3 Suppress compiler warning. 2021-04-06 08:39:41 +02:00
9c20228128 Fix T48167: Mesh select random factor is not accurate
Selecting random percentage would not reliably guarantee the precise
percentage of selected elements now randomize an index array instead
and use the precise number of elements from this array.

Note that this change has only been made to edit-mesh
and should be applied to all random selection operators.
2021-04-06 14:59:10 +10:00
3f3b4745b6 Fix T87187: Area.type & ui_type empty area access fails
Reading Area.type & ui_type printed an error from `pyrna_enum_to_py`
and returned an empty string.

As empty is a valid value, include it in the property enum list.
2021-04-06 13:08:35 +10:00
074b0b6da0 Py API Docs: Update sphinx and theme versions 2021-04-05 17:28:36 -04:00
cf0e7af07e BLI: fix axis order in 'BLI_array_iter_spiral_square'
x and y were inverted.
2021-04-05 14:28:43 -03:00
44c76e4ce3 3D View Utils: Add 'margin' parameter to 'ED_view3d_depth_read_cached'
Matches the alternative function ED_view3d_autodist_depth, but is more
efficient since it uses the cache.

No functional changes.
2021-04-05 10:48:37 -03:00
50782df425 Render: faster animation and re-rendering with Persistent Data
For Cycles, when enabling the Persistent Data option, the full render data
will be preserved from frame-to-frame in animation renders and between
re-renders of the scene. This means that any modifier evaluation, BVH
building, OpenGL vertex buffer uploads, etc, can be done only once for
unchanged objects. This comes at an increased memory cost.

Previously there option was named Persistent Images and had a more limited
impact on render time and memory.

When using multiple view layers, only data from a single view layer is
preserved to keep memory usage somewhat under control. However objects
shared between view layers are preserved, and so this can speedup such
renders as well, even single frame renders.

For Eevee and Workbench this option is not available, however these engines
will now always reuse the depsgraph for animation and multiple view layers.
This can significantly speed up rendering.

These engines do not support sharing the depsgraph between re-renders, due
to technical issues regarding OpenGL contexts. Support for this could be added
if those are solved, see the code comments for details.
2021-04-05 14:05:01 +02:00
3fa580866e Cycles: update Light Paths preset
* Add Fast GI / AO bounces to presets
* Add Default preset matching defaults
* Add Fast Approximate GI preset
* Lower Full GI depths to 32
2021-04-05 14:05:01 +02:00
edd2f51b4e Cycles: make AO bounces settings more discoverable
* Move out of Simplify panel, into Light Paths > Fast Global Illumination
* Add separate boolan setting to enable/disable it separate from Simplify
* Default AO bounces to 1
* Put ambient occlusion distance in this panel as well
2021-04-04 15:20:23 +02:00
8681504f06 Fix inversion of snapping failing in measure tool
Comparison of event change has to be more specific and compare the x and y
values of the mouse as well.
2021-04-03 13:32:42 -03:00
62f8d9e478 Fix T87162: Measure Tool Not Working
The non-enabled gizmo was overwriting the projected coordinate value.
2021-04-03 12:48:46 -03:00
321eef6a0c UI: Align Spreadsheet Booleans to Center
Aligning spreadsheet Booleans to the middle of their cells.

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

Reviewed by Hans Goudey
2021-04-02 14:26:16 -07:00
46d75052eb Geometry Nodes: Separate grid primitive X and Y size
Since you can already specify a separate size for X and Y with the
grid node, it makes sense to be able to specify the size separately
for each axis also.

This also avoids some awkward math with a Transform node afterwards
when you want a specific size for each direction.

Versioning (except for animation and drivers) is handled in this commit.

Differential Revision: https://developer.blender.org/D10834
2021-04-02 14:35:48 -05:00
e0a07700bf GPencil: Prevent RNA assignment of invalid materials in modifiers
Materials used in grease pencil modifiers have the requirement that they
are already used on the object. In the UI dropdown, this restriction is
ensured by calling uiItemPointerR with appropriate searchptr and
searchpropname, so only giving the user the choice of materials already
used on the object.

From python though, it was still possible to assign materials outside of
this this restriction. This led to reports like T86981 [which have been
partially solved by clamping the material index in the modifier code to
be in the valid range].

Now make sure we dont assign "invalid" materials through RNA by
appropriate RNA pointer functions.

This also adds a proper warning (red, alert) in case of the LineArt
modifier if such a invalid material is still in the file [same as other
modifiers already do].

Differential Revision: https://developer.blender.org/D10873
2021-04-02 21:23:37 +02:00
fcc3227efd Fix T86654: wrong Vertex Interpolation option default when importing alembic caches
This resulted in bad motion blur from alembic animation when imported
after rB83980506957c (because it was now OFF by default).
When imported in a version prior to rB83980506957c and saved, this was
still working fine.

Vertex interpolation option introduced in rBbab2260b59c7 was defaulting
to ON (correct) in that commit, but was lost in rB83980506957c.

Now switch this to ON by default again.

Note: if you have a file that was (incorrectly) imported with a version
after rB83980506957c you'll have to enable Vertex Interpolation option
on every MeshSequenceCache modifier by hand.

Maniphest Tasks: T86654

Differential Revision: https://developer.blender.org/D10876
2021-04-02 21:18:34 +02:00
0e8fa1d44b Geometry Nodes: Allow float input for point scale node
This allows easily changing the scale attribute with a uniform scale
within a single simple node.
2021-04-02 12:03:27 -05:00
bd9c479475 Geometry Nodes: Change point translate and scale node defaults
Since these nodes are usually used for more basic operations and the
attribute nodes are used when more complexity is necessary, it makes
sense to give these nodes more accessible defaults-- hopefully this can
make learning about the core concepts of geometry nodes a bit easier.
2021-04-02 11:45:05 -05:00
8bd0bde012 UI: Align Spreadsheet Reals and Integers to Right
Aligning spreadsheet cell numbers to the right to aid readability.

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

Reviewed by Hans Goudey
2021-04-02 09:03:36 -07:00
8aff86a0c7 Cleanup: Remove blender namespace from Map. 2021-04-02 16:16:33 +02:00
36427a8d03 Cleanup: remove loading blender namespace from Vector. 2021-04-02 16:13:27 +02:00
b6ab1107c2 Cleanup: Added leading e to enum types. 2021-04-02 16:11:13 +02:00
5a491adc17 Cleanup: rename eChunkExecutionState to eWorkPackageState. 2021-04-02 16:07:46 +02:00
210f7f0f8e Compositor: stream operators for WorkPackages.
Helps developers during debugging.
2021-04-02 15:41:16 +02:00
a0f705f18c Compositor: Debug stream operator.
Stream operators for NodeOperator and ExecutionGroup to help during
debugging.
2021-04-02 15:24:34 +02:00
fa9b05149c Fix T84520: Make the different weight paint code paths exclusive to each other
Before this change, you could have the new sculpt symmetry code and the
older weight paint symmetry code active at the same time. This would
lead to users easily trashing their weigh paint data if they were not
careful when switching between modes.

Now the specific weight paint symmetry code is an exclusive toggle so
the user can't accidentally mirror strokes and vertex groups at the same
time. This also paves the way of supporting Y and Z symmetry in the
future for weight groups mirroring if we decide to add it in the future.

Reviewed By: Sybren

Differential Revision: http://developer.blender.org/D10426
2021-04-02 14:44:26 +02:00
e7a0a75919 Fix T87131: SVG as GPencil elements with both Stroke and Fill fails
The importer was not checking if both were enabled. Now a new material is created if it's needed.
2021-04-02 13:45:58 +02:00
548d16d4a5 BKE: attempt to fix build error on windows 2021-04-02 17:06:24 +05:30
Kris
3fcac26362 Fix T86874: Wireframe not drawing for geometry node mesh primitives
The following primitives needed ME_EDGEDRAW, ME_EDGERENDER edge flags:
* Grid
* Circle

Set flags on the inside edges for grid and circle triangle fan (mesh primitive nodes)
so they are visible and selectable.

Reviewed By: HooglyBoogly
Differential Revision: https://developer.blender.org/D10878
2021-04-02 10:43:43 +02:00
6578f9d1e9 Modifiers: Fix build error with GMP 2021-04-02 13:48:22 +05:30
a0e1080428 Cleanup: Remove unecessary C API for direct mesh boolean
The main goal here is to remove the need for a C API to the code in
`mesh_boolean_convert.cc`. This is achieved by moving `MOD_boolean.c`
to C++ and making the necessary changes for it to compile. On top of
that there are some other slight simplifications possible to the
direct mesh boolean code: it doesn't need to copy the material
remaps, and the modifier code can use some other C++ types directly.
2021-04-02 00:16:23 -05:00
77f6857740 Cleanup: Use const arguments 2021-04-02 00:04:53 -05:00
d91fec1a85 Cleanup: Remove unused code in boolean modifier
The old path that didn't skip the conversion to and from BMesh for
the exact solver was not yet removed from this file. At this point no
problems have came up in the new implementation, so it's safe
to remove it.
2021-04-01 16:49:10 -05:00
c5d9968392 Cleanup: Remove unecessary part of instances component C API
Now that object_dupli.cc is a C++ file, we don't have to have a specific
function to retrieve the instance data from the geometry set.
2021-04-01 16:23:16 -05:00
3ca1cf2b51 Cleanup: Move object_dupli.cc to C++
This will hopefully allow more refactoring in the future to improve
the instancing system, especially how it relates to geometry nodes
instances.
2021-04-01 15:54:48 -05:00
e8573a59f6 Geometry Nodes: Improve speed of boolean node, use multi-input socket
This commit improves the performance of the node by up to 40% in some
cases when there are only two input meshes, mainly by skipping the
conversion to and from BMesh.

When there are more than two input meshes (note the distinction from
"Geometries", a geometry set can have many mesh instances), the
performance is actually worse, since boolean currently always does
self intersection in that case. Theoretically this could be improved
in the boolean code, or another option is automatically realizing
instances for each input geometry set.

Another improvement is using multi-input sockets for the inputs, which
removes the need to have a separate boolean node for every operation,
which can hopefully simplify some node trees.

The changes necessary for transforms in `mesh_boolean_convert.cc` are
somewhat subtle; they come from the fact that the collecting the
geometry set instances already gives transforms in the local space
of the modifier object. There is also a very small amount of cleanup
to those lines, using `float4x4::identity()`.

This commit also fixes T87078, where overlapping difference meshes
makes the operation not work, though I haven't investigated why.

Differential Revision: https://developer.blender.org/D10599
2021-04-01 15:00:47 -05:00
76cdcc2bca Cleanup/Refactor: Use flags instead of bool to configure the snap gizmo
This simplifies the addition of future improvements.

Also make it more practical to expose as a parameter of gizmo for Python.
2021-04-01 12:32:59 -03:00
5da5fb31db Cleanup: Remove unused enum value in editmesh_knife.c 2021-04-01 12:15:00 -03:00
2dc16223de Fix compilation error: "too many arguments to function"
Seem on linux.

Caused by rB6ec463a4b754bf69baf94ba6b3683655f6834ccd
2021-04-01 12:12:31 -03:00
6ec463a4b7 Cleanup/Refactor: Transform Orientation: Use 'orient_index' instead 'orient_type'
`orient_index` is a more comprehensive value as it reveals both the type and index.

Differential Revision: https://developer.blender.org/D9595
2021-04-01 11:20:32 -03:00
952c4e41bb Fix T87065: Deformed Lattice undeforms after setting keyframe
Handle Lattice object the same way as Mesh objects. This is mostly to
execute the `object->data = data_eval;` line, which ensures that the
evaluated mesh is assigned to the evaluated object, and thus prevents
the lattice from un-deforming.
2021-04-01 15:59:52 +02:00
75b675ceab Cleanup: typo fix in comment
No functional changes.
2021-04-01 15:59:52 +02:00
b5c2c3aba8 BLI: rename resource collector to resource scope
Differential Revision: https://developer.blender.org/D10857
2021-04-01 15:55:23 +02:00
Germano Cavalcante
f674976edd Curve: Remove 'CU_2D' flag used for nurbs
This fixes T86440

As the CU_2D flag is set for nurbs, a Curve can have 2D nurbs mixed with 3D.

But the UI does not allow this mixing. It updates all nurbs to 2D or 3D when set.

So remove this specific flag for nurbs.

This may break old files, since 2D curves with mixed 3D are now set as 3D.

Differential Revision: https://developer.blender.org/D10738
2021-04-01 10:54:49 -03:00
7a757662bc Cleanup: use bool instead of int 2021-04-01 15:45:56 +02:00
6be964e267 Cleanup: Remove unused code
There was a note about reusing this for "texture nodes", but that will
probably not be implemented in this way anyway.
2021-04-01 08:42:03 -05:00
2a2a4c8a27 Cleanup: move node_exec.c to c++
Doing this, because it might make it easier to replace the implementation
of `bNodeInstanceHash`.
2021-04-01 15:14:53 +02:00
b00727950c Nodes: separate node name and display name in bNodeTreePath
Previously, `node_name` was rarely actually a name of a node. It is set
correctly as node name in `ED_node_tree_push`. However, later on it
was overwritten by the name of an id data block in `node_draw_space`.

Now, the node_name stays the name of the "parent" node. Whereas
display_name is the name that will be displayed in the breadcrumbs.

With this change, the `node_name` can be used to reconstruct the
actual path from the root node tree to the currently visible tree.

Differential Revision: https://developer.blender.org/D10874
2021-04-01 14:39:12 +02:00
1bdceb813c Cleanup: spelling 2021-04-01 22:20:53 +11:00
2a5c0c3491 Geometry Nodes: add socket value logging capability
The node tree evaluator now calls a callback for every used socket with
its corresponding value(s). Right now the callback does nothing.
However, we can use it to collect attribute name hints, socket values
for debugging or data that will be displayed in the spreadsheet.

The main difficulty here was to also call the callback for sockets in
nodes that are not directly executed (such as group nodes, muted
nodes and reroutes).

No functional changes are expected.
2021-04-01 13:10:22 +02:00
328b39335e BLI: add call_safe method for FunctionRef
This is useful to avoid nullity checks in some places.
2021-04-01 12:38:14 +02:00
fa50edc999 BLI: return early when copying empty array 2021-04-01 12:38:14 +02:00
0ffbcc4416 Fix "unused variable" warning when compiling without nanovdb 2021-04-01 12:36:23 +02:00
496df39e6f LineArt: Remove "soft selection" option.
After some back and forth with the GP module and some artists, this
option was deemed not that useful. The use case was considered too
obscure so we'll remove it.

It is still posible to have this functionality by using the vertex
weight modiifers or manually clamping the weights.
2021-04-01 12:36:23 +02:00
e1b2cf887f LineArt: Remove resampling settings.
This can be done with an other GP modifier already.
2021-04-01 12:36:23 +02:00
d5cefc1844 Fix T50103: Transform not working if scale is zero
If any axis of the scale of an object was zero, transforming failed.
This was because `td->smtx` was set to a zero matrix.

orthogonalize_m3_zero_axes is used to fill in the zeroed axes.

Thanks to @filedescriptor for the initial fix: D10869.
2021-04-01 21:35:19 +11:00
8a144b73c0 BLI_math: add orthogonalize_m#_zero_axes
Expose a this function to initialize any zeroed axes
to an orthogonal vector based on other non-zeroed axes.

This functionality already existed for `invert_m#_m#_safe_ortho`,
expose as a public function as it's useful to be able to fill in zeroed
axes of transformation matrices since they may be used in matrix
multiplication which would create degenerate matrices.
2021-04-01 21:34:35 +11:00
3f24cfb958 Cycles: light spread importance sampling for rectangular area lights
Compute a subset of the area light that actually affects the shading point
and only samples points within that.

It's not perfect as the real subset is a circle instead of a rectangle, and
the attenuation is not accounted for. However it massively reduces noise for
shading points near the area light anyway.

Ellipse shaped area lights do not have this importance sampling, but do not
have solid angle importance sampling either.

Ref D10594
2021-04-01 12:31:01 +02:00
Matteo Falduto
a4260ac219 Cycles: add a spread setting for area lights
This simulates the effect of a honeycomb or grid placed in front of a softbox.
In practice, it works by attenuating rays coming off-angle as a function of the
provided spread angle parameter.

Setting the parameter to 180 degrees poses no restrictions to the rays, making
the light behave the same way as before this patch.

The total light power is normalized based on the spread angle, so that the
light strength remains the same.

Differential Revision: https://developer.blender.org/D10594
2021-04-01 12:31:01 +02:00
c859e1afa0 Fix: incorrect versioning code for lights properties
Due to T64791 we must still use the old Lamp name rather than Light, work
around that for now.
2021-04-01 12:31:01 +02:00
Nikita Sirgienko
b30cc7071b Fix Cycles build error with "make developer" on some CPUs
The combination of building unit tests and WITH_CYCLES_NATIVE_ONLY did not
correctly detect when AVX/AVX2 support is available.

Differential Revision: https://developer.blender.org/D8201
2021-04-01 12:31:01 +02:00
64538532d4 Fix T87056: Segfault in GPU_batch_clear() involing Lattice evaluation
Fix a segfault by setting the `batch_cache` pointer to `NULL` when copying
a Lattice. That way the copy can get its own batch cache when needed,
preventing a use-after-free.
2021-04-01 12:28:26 +02:00
d904271d09 Libmv: Add clang-format for third party sources
Got ignored in the initial commit of clang-format support to the Libmv.
2021-04-01 11:32:47 +02:00
7faf5b0e02 Fix condition for ffmpeg seek workaround
This condition was in contradiction with comment for function
`ffmpeg_generic_seek_workaround()`.

I have noticed, that formats that seeked well used this workaround.
Problem was that I misunderstood code from `av_seek_frame()` - formats
with `read_seek()` function stil don't use generic seeking method.
This is defined in `seek_frame_internal()`
2021-04-01 11:30:11 +02:00
546fa9a759 Fix T87037: Add tooltip for "Paste Flipped"
The "Paste Flipped" operator was missing its own tooltip.

This patch adds the tooltip by implementing the `get_description` callback for
`GRAPH_OT_paste` and `ACTION_OT_paste`.

Reviewed By: sybren

Maniphest Tasks: T87037

Differential Revision: https://developer.blender.org/D10859
2021-04-01 11:04:05 +02:00
6fe2d6b8c8 Fix freezed proxy frames
`ffmpeg_generic_seek_workaround()` applied negative offset for seqrched
packet timestamp, but proxies always start from 0 and timestamp can be
 negative.

Limit timestamp value to 0, because `av_seek_frame()` doesn't accept
negative timestamps and returns with error. This prevents seeking from
working correctly.
2021-04-01 10:45:53 +02:00
a9fc5be5fa Fix T86331: Preferences menu inaccessible until window resize
The RGN_TYPE_EXECUTE region was zero height - with the "Load & Save"
button drawing outside of those bounds - so it didn't respond to events.

This is because the region started off this size and does not change
with simply adding the buttons. Although it has RGN_FLAG_DYNAMIC_SIZE,
delayed reinit of regions is only currently supported on headers.

This gives the execute region an initial (minimum) vertical size but
also makes the region **hidden** by default.

- Showing Prefs as an editor among others it will show the header
  but not the execute region.

- Showing the Prefs in a popup window, hides the header region
  and shows the execute region.

Ref D10636
2021-04-01 17:42:01 +11:00
ab652c2c90 Cleanup: method naming. 2021-04-01 08:16:43 +02:00
4b595de5e6 Cleanup: Split up methods. 2021-04-01 08:16:43 +02:00
d5c6485372 Cleanup: clang format 2021-04-01 11:18:26 +11:00
93972c8910 Clang Format: bump the minimum version to 8
Make use of `StatementMacros` so Python structs are formatted correctly.

The comment about STRINGIFY doesn't seem to be valid anymore,
so this has been left out.
2021-04-01 11:18:05 +11:00
a641e08227 Cleanup: Use const arguments in curve code 2021-03-31 18:07:15 -05:00
1a100d2d78 Cleanup/CMake: tweak messages in platform_apple 2021-04-01 01:13:22 +05:30
f061de9b3e Cleanup/CMake: warning to status to reduce noise
Correction in e5f0d176d4
2021-04-01 01:12:48 +05:30
910469eccf Cleanup: Remove remaining unused code for DispList "bevel_split"
This was added in rB93aeb6b318a7, last changed in rB8f0a44a5d55d,
and removed in rB51b796ff1528. I assume it was a way for curves to
have split edges at corners. As far as I can tell it only ever worked
in Blender Internal, and that has been gone for years.

Another possible route here would be restoring this functionality,
but it's generally preferrable to reduce complexity in this
area of curve code than adding it back, especially in the context
of other improvements planned related to curves in geometry nodes.

Differential Revision: https://developer.blender.org/D9966
2021-03-31 11:37:21 -05:00
46ee9b599a Fix T87094: Transforming geometry instances component is broken
Caused by an incorrect transformation order in cleanup commit
rBd037fef3bd1dc2e. The fix is to simply reverse the order.
2021-03-31 11:32:52 -05:00
94bfb1ab62 Alembic procedural: fix missing update when editing shaders 2021-03-31 17:18:32 +02:00
6f2e9e9f90 Alembic procedural: comment, speficy the behavior of a function 2021-03-31 17:18:32 +02:00
5580f64d80 Alembic procedural: cleanup, make add_object private
This should only be accessed from within the procedural.
2021-03-31 17:18:32 +02:00
b4e584949c Alembic procedural: fix out of bound access when editing object properties or shaders
The index_data_map was not cleared when clearing a cache, so this would just append
the new correct data to the end of the array instead of overwriting it, which would
cause us to then use outdated indices.
2021-03-31 17:18:32 +02:00
4fd7b1f3db Geometry Nodes: Rename "Grid" to "Density"
For other "Attribute Name" fields we usually give a more specific name
that relates to what the attribute is actually used for, like "Mask" in
the point separate node. This is a similar situation, and would also
be consistent with the naming planned in D10506.
2021-03-31 10:10:44 -05:00
482a42c0f6 Fix T87087: attributes were removed automatically even though they are still needed
The geometry nodes modifier did not specify that it needs all custom data layers.
Therefore the modifier evaluation code tagged some layers so that they will not be
copied later on by calling `mesh_set_only_copy` in `mesh_calc_modifiers`.
2021-03-31 16:25:39 +02:00
23bd6cff81 GPencil: Avoid LineArt modifier uses negative material index
In some situations the material index could be negative, and this is wrong.
2021-03-31 16:17:31 +02:00
d55d4fee30 Fix compiler error in Windows
C7555	use of designated initializers requires at least '/std:c++latest'

This is not supported by the current Windows compiler version.
2021-03-31 16:01:18 +02:00
10272ca788 GPencil: Remove flag PROP_ID_SELF_CHECK from materials
This flag was used by error when the code of RNA object was used as base, but it's not logic in materials.
2021-03-31 15:50:48 +02:00
94079ffc7f Fix T86879 Boolean exact crash with dependency loop.
When boolean's Object also has a modifier that depends back on
the target Object, a crash occurred.
In a case like this, BKE_modifier_get_evaluated_mesh_from_evaluated_object
returns NULL, so just have to protect against that case.
2021-03-31 09:35:40 -04:00
23c1e48e19 Cleanup: naming for edit-mesh nearest distance values
- Don't use `r_` prefix for an argument that's also read from
  (this is meant for return only arguments).
- Rename variables to make it clear the distance is pixels,
  using manhattan length measurement.
2021-04-01 00:01:23 +11:00
5f787b290c Cleanup: Removed Unused Definition. 2021-03-31 14:47:38 +02:00
bc837ad14e Fix: Cryptomatte Picker on Legacy Node Failing.
The new Cryptomatte workflow assumes that the picker is used in the new
workflow. The legacy node wasn't working as it would never find a
correct cryptomatte layer. This fix will use the color sampling like we
used to do.
2021-03-31 14:43:14 +02:00
1a7b94236e Compositor: Keep WorkPackages and Data Around.
WorkPackages struct was created when scheduled. This patch keeps the
WorkPackages around and stores additional data with the workpackages.

The speedup is to small to notice, but it is needed as preparation
to introduce a faster scheduling method.
2021-03-31 14:43:14 +02:00
14901e3774 Fix T87080: Select shortest path fails in face mode
Regression in 80cbbd2843.

Unfortunately keeping selection picking behavior as well as
supporting finding the nearest face within a radius requires an
inconsistency between x-ray and back-buffer selection that
doesn't work well using the current arguments.

Resolve by adding an argument that causes the input distance
to be ignored for back-buffer selection.

This is used by selection picking but not the knife tool.

This changes behavior for path-selection in face mode,
which now uses a margin for back-buffer selection.

From my own testing this doesn't seem to be a problem like it could be
for regular selection picking.
2021-03-31 23:36:51 +11:00
d97dca5106 Fix T86947: Drag & Drop tooltip in Scene mode
The tooltip while dragging a collection in Scene mode in the Outliner
was always "Link inside Collection" even if the action performed was
different. This was because the `collection_drop_init` set the
`from_collection` always to `NULL` if the Outliner display mode was
currently set to Scene.
Commit that introduced this issue:
rB0f54c3a9b75be8f8db9022fb0aeb0f8d0d4f0299

The fix removes the check of the display mode and only sets the
`from_collection` to `NULL` if the ctrl (linking) key is held.

Reviewed By: JacquesLucke

Maniphest Tasks: T86947

Differential Revision: https://developer.blender.org/D10864
2021-03-31 14:23:08 +02:00
8d45a96789 Fix T87082: Smooth thickness not working
When using the smooth operator, the thickness would not be
smoothed on the first iteration. This was becasue the inner loop
was set to run `r * 20` times but `r` starts at 0.

The fix makes sure that "Smooth Thickness" works on the first
iteration by using  a fixed value of `20` as the loop limit. This
makes sure that for every iteration, we run the smoothing of the
thickness 20 more times.

Reviewed By: antoniov

Maniphest Tasks: T87082

Differential Revision: https://developer.blender.org/D10867
2021-03-31 14:19:01 +02:00
f02e1a77c9 Makefile: add update_code target
Convenience target for updating the code, skipping SVN.

The Python script supports it, but this wasn't exposed in the makefile.

Ref D10457
2021-03-31 22:34:11 +11:00
4d856ecb11 Cleanup: Fix warnings
Introduced in b128ffd539
2021-03-31 12:34:44 +02:00
e9616c82bd Cleanup: use constexpr for num channels.
Don't assume all compilers are smart. MSVC doesn't inline the call away like CLANG and GCC did.
2021-03-31 11:00:07 +02:00
645fc0c767 Fix build error on windows
Error was caused by using `#if` directive in `PyDoc_STRVAR` macro.

This partially reverts 1e4c35d910
2021-03-31 09:46:38 +02:00
b128ffd539 Cleanup: Remove SEQ_CURRENT_BEGIN macro
Use LISTBASE_FOREACH instead.
SEQ_CURRENT_BEGIN did null checks, so now these must be explicit.

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D10823
2021-03-31 09:27:31 +02:00
43369ca80e PyDoc: quiet warning with literalinclude including blank lines
Files that only contain a doc-string still included the last blank line,
since this normally contains code examples.

There are some cases where only a docstring exists
which made sphinx report warnings.
2021-03-31 17:47:31 +11:00
d5f2043ab3 PyDoc: fix indentation with multi-line property descriptions
New lines were written without indentation,
causing invalid RST to be generated.
2021-03-31 17:43:30 +11:00
1e4c35d910 PyDoc: correct sphinx syntax for gpu.state.blend_set 2021-03-31 17:42:21 +11:00
b547ac32d9 Cleanup: use early return for imbuf image loader functions
Most imbuf loaders already did this, use early exit for the remaining
loaders that didn't.
2021-03-31 17:05:57 +11:00
e7f890aa59 WM: use data-path utility functions for WM operators
Use utility functions to decompose data paths and resolve the
RNA property from a data-path.
Replaces in-line string manipulation and RNA access.

This allows more complex data paths to be used, where previously string
literals in a data path could break the simple data-path handling logic.
2021-03-31 15:29:50 +11:00
1beca76934 PyAPI: add bl_rna_utils.decompose_data_path
Utility function for splitting an RNA path, to be used by `bpy.ops.wm.*`
2021-03-31 15:03:19 +11:00
c59a7f44a1 Fix bl_rna_utils._TokenizeDataPath function argument extraction error
Converting functions with single arguments to a string
added an additional comma.
2021-03-31 15:01:44 +11:00
5678e6c2bc Cleanup: improve navigation gizmo flag use
Flag check for V3D_LOCK_CAMERA used boolean style assignment to a char,
which worked with this flag but could fail if other flags are added
that use this convention in the future.

- Add static type checks for values so any change to DNA types
  will need to be made in the navigation gizmo too.
- Move camera lock check from `rv3d` to `v3d`,
  as this isn't stored in the region data.
2021-03-31 13:04:12 +11:00
87aa514611 UI: Gizmo Button to Lock Camera to View
2D gizmo navigation button that toggles 'Lock Camera to View' while in Camera View.

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

Reviewed by Campbell Barton
2021-03-30 14:09:26 -07:00
1425411249 Cleanup/Refactor: Unify functions that redraw the depth buffer
Now `ED_view3d_backbuf_depth_validate`, `ED_view3d_draw_depth` and
`ED_view3d_draw_depth_gpencil` are unified in `ED_view3d_depth_override`.

This new function replaces `ED_view3d_autodist_init`.

Also, since `ED_view3d_depth_update` depends on the render context, and
changing the context is a slow operation, that function also was removed,
and the depth buffer cached is now updated inside the new unified drawing
function when the "bool update_cache" parameter is true.

Finally `V3D_INVALID_BACKBUF` flag has been renamed and moved to
`runtime.flag`.

Differential revision: https://developer.blender.org/D10678
2021-03-30 16:23:58 -03:00
da1b002c8d UI: Skip undo steps when changing properties of the 3d cursor
Differential revision: https://developer.blender.org/D10695
2021-03-30 16:13:21 -03:00
54d7dea283 Fix: buttons whose property contains an 'owner_id' ignore rna undo check
Introduced in rBce462fa1 but harmless since curretly only `StructRNA`
without `owner_id` have the `STRUCT_UNDO` flag cleared.

So this commit does not bring any functional changes but it will be
useful for {D10695}.
2021-03-30 16:10:58 -03:00
67b40f829e Fix T87058: GPencil Cutter delete all strokes if they are selected and the layer is locked
The problem was produced because the strokes were selected, but the loop to clear this flag before applying cutter was using unlocked layers only, and the protected layer flag was not reset.

Now, the flag is reset for all layers, locked and unlocked.
2021-03-30 19:43:45 +02:00
Wannes Malfait
6ddd280b21 Nodes: Expose multi input socket in python API
It was not possible to determine if a socket was multi input previously
with BPY. This patch exposes the flag as a read-only property of a node
socket. This is important for addons which automatically add connections
between nodes.

Differential Revision: https://developer.blender.org/D10847
2021-03-30 10:15:23 -05:00
6ea09db7a1 Cleanup: Improve comment 2021-03-30 10:03:11 -05:00
e5f0d176d4 CMake: issue warnings when changing options
Only done in top level CMakeLists, and platform_apple.

Reviewed By: campbellbarton
Differential Revision: https://developer.blender.org/D10343
2021-03-30 20:28:45 +05:30
9f323e9bf7 UI: Bring back hover shortcuts for mesh modifiers
Earlier last year, the shortcuts on hover were built as a way to regain
speed lost by removing the "Apply" and "Copy" buttons from the panel.
For the active modifier concept introduced for geometry nodes, the
shortcuts were changed to only affect the active modifier.

Based on feedback, this change slowed down many people's interaction
with the modifier stack so the UI team decided to return hover shortcuts
for modifier panels.

The downside of this change is that it looks like the active modifier is
"selected" and it could be confusing that the modifier shortcuts don't
apply to it. We can explore different ways to display the active status
to address this.

Ref T87012
2021-03-30 09:56:04 -05:00
1f58a0ea3c Cleanup: use doxy sections and rearrange editmesh_knife.c 2021-03-30 11:50:05 -03:00
b1380101df Geometry Nodes: Set default grid vertices to 3 by 3
This is a relatively arbitrary value, but a good starting point-- it's
simple while also showing the possibility of the subdivisions.

Ref T86819
2021-03-30 09:33:42 -05:00
a4b6c222fa Fix unused variable warning caused by recent cleanup
Caused by a cleanup, rBd037fef3bd1dc.
2021-03-30 09:18:33 -05:00
88b5d7f5f3 Cleanup: remove unneeded method.
size can be accessed via instance attribute.
2021-03-30 16:03:43 +02:00
094c950915 Cleanup: clang-format. 2021-03-30 16:03:43 +02:00
88e0ed3288 Cleanup: Use constexpr. 2021-03-30 16:03:43 +02:00
b48a573adb Compositor: Fix Incorrect Attaching NodeSockets.
Introduced by recent commit.
2021-03-30 16:03:43 +02:00
04a92297dd Cleanup: Replace std::vector with blender::Vector. 2021-03-30 16:03:43 +02:00
d4e76712d4 Cryptomatte: Fix When Image based Cryptomatte Aren't On The First Render Layer.
The image user wasn't updated to reflect the correct render layer.
2021-03-30 16:03:43 +02:00
e125c9329d Fix: Compile Error COM_Debug.
We should replace `ifdef COM_Debug` with a constexpr function.
2021-03-30 16:03:43 +02:00
3ead9b2b36 Cleanup: Replace virtual methods with bitflags. 2021-03-30 16:03:43 +02:00
5a6d5d20de UI: add description methods for wm.context_* operators
Generic context operators now look-up the RNA properties to extract
their description (when it's available).

Add `bl_rna_utils.data_path.property_definition_from_data_path()`
to handle the details of accessing the RNA property definition.
2021-03-31 01:02:08 +11:00
88d94d89fa Fix T87007: Cycles Background not updated if strength is initially null
When the strength is initially set to zero, the shader graph is
optimized out to remove any node which will not be executed because of
this, which removes pretty much every single node, except for the
output. As the graph is empty, the world shader is made invisible to
rays so it is not evaluated in the kernel.

However, when the strength is then modified, the Background is not
updated as the modification happens on the Shader Node and not on the
Background Node, so it is never tagged as modified.

To fix this, we need to tag the Background as modified when its shader
is also modified so the Kernel data is properly updated.

Regression caused by rBbbe6d44928235cd4a5cfbeaf1a1de78ed861bb92.
2021-03-30 15:41:33 +02:00
f1fe42d912 Cycles: Do not allocate tile buffers on all devices when peer memory is active and denoising is not
Separate tile buffers on all devices only need to exist when denoising is active (so any overlap
being rendered simultaneously does not write to the same memory region).
When denoising is not active they can be distributed like all other memory when peer
memory support is available.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D10858
2021-03-30 14:04:56 +02:00
7fd3b07da1 Build Environment: set MAKE_THREADS as per the CPU
It is a better default.

Reviewed By: sebbas, sybren
Differential Revision: https://developer.blender.org/D10652
2021-03-30 16:42:19 +05:30
681a7d724b PyAPI: replace repr with our own escape function in animsys_refactor
Use the same string escaping logic shared by RNA path resolving code.
2021-03-30 21:57:23 +11:00
5da5a1cc2d Geometry Nodes: support multiple group input nodes
Previously this was only supported within nested node groups.
Now it is also supported for the root node group that is referenced
by the modifier.
2021-03-30 12:34:16 +02:00
05fa5ca337 Cleanup: Typo in comment. 2021-03-30 12:15:19 +02:00
Scott Wilson
74d5a93b2b Armature: Add Display Axis Offset
Display the bone axes at the head (root) of the bone by default, instead
of the tail (tip), and add a slider so that it's possible to adjust this
position.

Versioning code is in place to ensure existing files behave the same
(axes shown at tail), whereas new Armatures will be using the new
default (axes shown at head).

Reviewed By: #animation_rigging, #user_interface, Severin, Sybren

Differential Revision: https://developer.blender.org/D7685
2021-03-30 11:40:26 +02:00
0d65d27386 Python: clarify error message when accessing datablock by library
When using `bpy.data.actions[action_name, "nonexistant-library"]`,
use the term `filepath` instead of `name` in the error message.

Also increase the size to match the file path length.

Ref D10253
2021-03-30 19:31:50 +11:00
Henrik Dick
39bead4d51 Fix simple solidify wrong custom data on large ngons
Fixes an unreported issue that vertex data on large ngons (>255)
is messed up due to type conversion to char and back to int.

Ref D10734
2021-03-30 19:13:36 +11:00
fd10c21f51 Cleanup: animation, remove BONE_UNKEYED flag
Remove the `BONE_UNKEYED` flag. It was only written (set/cleared) but
never actually read.

Also remove `framechange_poses_clear_unkeyed()` as its only function was
to clear the `BONE_UNKEYED` flag. It wasn't used anywhere either.

The only code that used the flag was the `extract_pose_from_action()`,
which was removed in 2869ce6cfa (2009).

No functional changes.
2021-03-30 09:46:26 +02:00
563d513e37 Cleanup: clang-tidy warning. 2021-03-30 08:08:43 +02:00
89e46f578f Cleanup: clang-tidy warning. 2021-03-30 08:08:15 +02:00
52d09dad9c Knife: snap refactor, prepare for snap gizmo
Minor changes preparing for snap gizmo inclusion.

- Extract `knife_snap_edge_in_angle` into a utility function.
- Check the snap vertex on closest edge instead of the face.
- Add MODE_INVOKING state.
- Remove unnecessary NULL checks.
- Control 'ignore_edge_snapping' while dragging instead of checking
  dragging in `knife_snap_update_from_mval`.

Ref D8220
2021-03-30 16:19:33 +11:00
73b5afd352 Cleanup: Fix incorrect socket list name 2021-03-29 22:41:34 -05:00
d037fef3bd Cleanup: Use float4x4 type and constructor 2021-03-29 22:15:07 -05:00
f9eaf93d37 MSVC: ASAN support for VS 16.9
This enables ASAN support when used with VS 16.9
enable as usual in cmake with the WITH_COMPILER_ASAN
option, or when using make.bat just tag on `asan'
to the invocation, ie: `make lite 2019 asan`

MSVC: Asan support for 16.9

This enables ASAN support when used with VS 16.9
enable as usual in cmake with the WITH_COMPILER_ASAN
option, or when using make.bat just tag on `asan'
to the invocation, ie: `make lite 2019 asan`

Differential Revision: https://developer.blender.org/D7794
Reviewed By: brecht, sergey
2021-03-29 19:11:17 -06:00
6c33d3d01b Fix T86944: Incorrect seeking in some movies
`av_seek_frame()` failed to seek to nearest I-frame. This seems to be
a bug or not implemented feature in FFmpeg. Looks like same issue as
ticket https://trac.ffmpeg.org/ticket/1607 on ffmpeg tracker.

If seeking is done using format specific function (`read_seek2`)
field of `AVInputFormat` is set, `see av_seek_frame()`, use
`av_seek_frame()` function. Otherwise use wrapper that actively searches
for I-frame packet.

Searching is flexible and tries to do minimum amount of work. Currently
it is limited to equivalent of 25 frames, which may not be enough for
some files, but there may be files with no I-frames at all, so it is
best to keep this limit as low as possible. Previously this problem was
masked by preseek, which was hard-coded to 25 frames. This was removed
in rB88604b79b7d1.

If this approach would be unnecessary for some formats, in worst case
file would be seeked 2 times which is very fast, so there will be no
visible impact on performance.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D10845
2021-03-30 02:58:53 +02:00
ffbe803505 VSE: Add fit method to RNA API
Add fit_method argument to new movie and image RNA API functions.
This argument is optional.

ref T86925

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D10816
2021-03-30 02:58:53 +02:00
6c6f3baaa8 VSE: Fix image adding inconsistency
When adding images with operator, image file path is split into filename
and directory passed to load function in name and path fields of
SeqLoadData struct. This is because when loading images directory
and filenames are split.

RNA API function passes whole path in path filed.

Apart from loading API inconsistency, this causes initial image loading
to fail, so strip resolution is not set. Also name field of SeqLoadData
should be reserved for strip name.

Let operator code concatenate and split filepath when needed so loading
API can be consistent with RNA API and also between strip types.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D10818
2021-03-30 02:58:53 +02:00
7d467915a4 Cleanup: Decrease variable scope 2021-03-29 18:48:34 -05:00
91c44fe885 Cycles: disable NanoVDB for AMD OpenCL
It is causing issue with AMD OpenCL drivers, due to a potential driver bug.

Ref T84461
2021-03-30 00:00:17 +02:00
661e6e0966 Gizmo: Use a utility function to read snap gizmo values
No functional changes.

This makes the `ED_gizmotypes_snap_3d_update` function more specialized.
2021-03-29 14:32:48 -03:00
Germano Cavalcante
d0dd85a820 Snap Gizmo: Minor optimization when updating gizmo properties
As the Snap Gizmo properties are used as return of snapping values and
therefore updated with each change, use callbacks to get these values
through RNA properties.

Differential Revision: https://developer.blender.org/D8525
2021-03-29 14:07:51 -03:00
a702ca3faa Tests/bpy: Add installation verification test
Makes it slightly easier to test whether the installed module works
or not. Depends on D10656

Ref T86579
Reviewed By: mont29, campbellbarton
Differential Revision: https://developer.blender.org/D10665
2021-03-29 22:26:54 +05:30
fbe2c3f422 Tests: disable python tests for blender as python module
Avoid CTest errors and exit codes due to test failures which depend
on Blender executable.

Ref T86579
Reviewed By: mont29, campbellbarton
Differential Revision: https://developer.blender.org/D10656
2021-03-29 22:25:52 +05:30
241f05d53c macOS/bpy: accommodate portable builds, and multi-config generators.
Old code's `install` step did not guarantee that all script files
will be copied from source folder to build folder _before_ copying from
build folder to site-packages. That caused incomplete installation.
Fixed by copying scripts etc., only once. Also match the behavior on
Linux: install to site-packages only if `WITH_INSTALL_PORTABLE` is OFF.

Also fix install and launch issues with Xcode.
2021-03-29 22:25:13 +05:30
77ac67dae4 Cleanup/CMake: remove trailing /; whitespace. 2021-03-29 22:24:33 +05:30
2db2b7de55 Cleanup: Replace is...Operation() methods with a flag. 2021-03-29 17:10:01 +02:00
fe60062a99 Cleanup: Use Bitflags For Booleans. 2021-03-29 17:10:01 +02:00
ca516e78c4 Fix T87013: GPencil SVG export wrong svg xml header settings
The attribute was missing.
2021-03-29 17:02:25 +02:00
f99e703df3 Fix T86975: GPencil interpolate wrong stroke order
When interpolate, the stroke order was not correct because it was assumed the GHash iter would return the items in the same order of insertion, but this is false.

Now, a list is used to keep the order of the strokes and the Hash is used to get the relationship between strokes as before.
2021-03-29 17:02:25 +02:00
81fae56cb9 Fix T86298: crash when loading "corrupted" geometry node tree
The file was not really corrupted (as in, Blender did everything
correctly while saving). I only did not consider the case when
a .blend file is resaved in an older version before.
2021-03-29 16:57:03 +02:00
bc872e0c8e Fix: Line Art panel in properties showing in the wrong order with add-ons
It should set bl_order to show below panels registered by render engine add-ons
like Cycles.
2021-03-29 16:40:31 +02:00
2e7e13442c Fix T76872: Mask created after existing keyframe gets broken handles
The issue was caused by handles not being written to the new mask
spline shape: it was always written as (0, 0), which was making the
handle calculation go wrong later on.

Solved by allocating a temporary array of bezier points and calculating
handles for them. While this is an extra array allocation it is only
done for a small amount of points and it is not in the critical code
path. Having this as an extra array helps to overcome a limitation of
the current mask shape API.

Additionally, disable the interpolation for the shape change:
the spline is brand new, there is nothing to be interpolated there.
2021-03-29 16:19:22 +02:00
51f8dbe081 Mask: Fix possible nan values in the weight interpolation
Noticed while looking into animation data being created as per
steps to reproduce bug in T76872.
2021-03-29 16:19:22 +02:00
10e05bb413 GPencil Cleanup: Remove legacy key to cancel drawing
The 'E' key was set to cancel drawing. This was a change in the
old grease pencil system and is no longer used.
2021-03-29 15:56:25 +02:00
fa8269cc4e Animation: add PBONE_SELECTED macro
Add `PBONE_SELECTED` macro to determine selection state of bones, while
also taking visibility into account.
2021-03-29 15:01:45 +02:00
4d3a2ba6a9 Cleanup: clang-format. 2021-03-29 15:01:09 +02:00
8f38534300 Tracking: Avoid integer overflow in dopesheet update
Straightforward check to discard cases when dopesheet is being updated
for a movie clip which has no markers at all.

Possible bugfix for T86847.
2021-03-29 14:43:58 +02:00
e0ce76f1c5 Fix T86983: bl_description = None crash on RNA class registration 2021-03-29 22:05:05 +11:00
Jeroen Bakker
1ea5157051 Fix: Cryptomatte Metadata Trimmed to 1024.
When reading metadata from image files the metadata is trimmed to 1024.
For cryptomatte the metadata can contain json data and should not be
trimmed. Resulting additional checks in the manifest parser for
incomplete json data.

You could argue to add an exception for cryptomatte, but that would
still allows misuse. When the direction of this patch is accepted we
should consider removing `maxlen` from `IDP_AssignString` as it
doesn't seem to be used anywhere else.

Reviewed By: #images_movies, mont29, sergey

Differential Revision: https://developer.blender.org/D10825
2021-03-29 12:16:39 +02:00
35cf34de6d Fix T86851: PulseAudio randomly asserts in background rendering
Upstream fix from Audaspace with simplified PulseAudio code.

Maniphest Tasks: T86851

Differential Revision: https://developer.blender.org/D10840
2021-03-29 12:16:01 +02:00
Élie Michel
ae9d61e7fe Python API: add template for image processing
Since a few releases it is possible to process Blenders images much
more effficiently than before thanks to the `foreach_get`/`foreach_set`
methods. This new template shows how those methods can be used together
with numpy.

Differential Revision: https://developer.blender.org/D9400
2021-03-29 12:08:41 +02:00
075a19049f Cleanup: Updated Documentation Library Overrides. 2021-03-29 12:04:29 +02:00
ac6d8241fb Fix: Override Test Cases Failing With Asserts. 2021-03-29 11:51:34 +02:00
Sergey Sharybin
19f1c52269 Cleanup: Remove no-op id recalc statement
Initially this is a typo when solving merge conflict back in 2017
in commit rBf4140f2c8138.

The code was so for 3 years, so it is safer to assume that this is
the new expected design. The affected codepath only comes from the
BKE_object_modifier_update_subframe() which is discouraged from use
and have other issues.

Eventually those offending codepaths will be removed completely.

The grade-schema for now is more localized: remove ID_RECALC_ALL
which seems to be misused and is causing issues like the ones which
are described and discussed in T81340.

On user level there should be no measurable changes. In fact, no
functional changes at all are expected to happen.

Reviewed By: sybren

Differential Revision: https://developer.blender.org/D9220
2021-03-29 11:37:30 +02:00
f56fddbf9a Clang Tidy: disable WarningsAsErrors
This makes regular development more pleasant, because one does not have
to fix unrelated clang tidy mistakes when one is in the middle of something.
Before this change, I would usually turn clang-tidy off entirely, but then
forget to turn it on again.

This change has been agreed on by Sergey as well.
2021-03-29 11:04:34 +02:00
3681a619de Fix T78650: Lattice evaluation writes to shared data
Fix the data management bug where evaluation of lattice objects would
write back to the CoW copy of the Lattice ID, even when that copy was
shared between objects.

Each lattice object evaluation now stores its own evaluated data copy
via `BKE_object_eval_assign_data()`.

Reviewed By: sergey

Maniphest Tasks: T78650

Differential Revision: https://developer.blender.org/D10790
2021-03-29 11:00:32 +02:00
8034b276ba Fix T86876: cannot modify float properties of geometry nodes modifier from Python
Previously, the code expected the id property to have the `IDP_FLOAT` type.
However, when assigning a Python float (which is a double internally)
to an id property, it would change the type to `IDP_DOUBLE`.
The fix is to allow both types in the geometry nodes modifier.
2021-03-29 10:54:04 +02:00
fa1569a072 Fix T86966: crash when rendering with geometry nodes
UI hints should only be modified when the depsgraph is active.
Otherwise two threads evaluating the same object in different depsgraphs
can conflict with each other.
2021-03-29 10:14:54 +02:00
4e34baddb9 Overrides: Make Experimental API Fail On Usage.
It used to give a warning so test cases couldn't fail. This has been
changed in the test case so we could use an error here.
2021-03-29 09:57:06 +02:00
87f9405c9a Overrides: API to create an override template.
This is functionality that isn't accessible via the user interface. The
API allows the creation and modification of an override template that
holds rules that needs to be checked when overriding the asset.

The API is setup that it cannot be changed after creation. Later on when
the system is more mature we will allow changing overrides operations.

NOTE: This is an experimental feature and should not be used in productions.

Reviewed By: mont29, sebbas

Differential Revision: https://developer.blender.org/D10792
2021-03-29 09:54:34 +02:00
27fa2507a1 Fix T86972: transform node transforms shape keys 2021-03-29 09:35:19 +02:00
240f15c1b6 Comments: improve docstring for ED_view3d_clipping_test
The meaning of the return value wasn't obvious.
2021-03-29 18:30:45 +11:00
b9734f7716 Cleanup: Remove unused node.c.
Was wrongly added back with the anti aliasing node patch.
2021-03-29 09:25:08 +02:00
80cbbd2843 Knife: support vert/edge snapping when not directly over a face
Respect the distance argument to EDBM_face_find_nearest,
when zero, sample a single pixel, otherwise sample a region.

Knife uses the selection-buffer to pick a face when the ray-cast failed.
This was meant to allow snapping to nearby faces however as the margin
was ignored, it was only used in edge cases where the ray-cast missed
but the pixel didn't.

Now the face-picking threshold is working as expected.

Note that other callers to EDBM_face_find_nearest have been updated
so set their distance argument to zero so this only impacts the knife.
Regular selection and path select could be modified separately if users
prefer this behavior.
2021-03-29 18:08:57 +11:00
3659340571 Cleanup: logical error in path select picking
Resolve logical error in edbm_shortest_path_pick_invoke
where any discrepancy between EDBM_unified_findnearest and
edbm_elem_find_nearest caused the active-object to be cleared.

While it's not a problem at the moment, using a larger threshold
for path picking exposes the error.
2021-03-29 18:08:57 +11:00
8994f09a4a Knife: scale points & snapping threshold by the DPI factor
The points were too small on hi-dpi displays.
2021-03-29 18:08:57 +11:00
fc889615f7 Fix vert/edge knife snapping when the cursor wasn't over a face
In this case, the cage location was left zeroed which was then
projected back onto the screen to find the nearest screen space
edge/vertex.

This made snapping to the vertex/edge fail in some corner-cases
where it was intended to work.
2021-03-29 18:08:57 +11:00
ab26be8ff7 Cleanup: use pragma once. 2021-03-29 08:20:21 +02:00
25c02ea703 Cleanup: Add namespace to compositor. 2021-03-29 08:18:33 +02:00
9975af5ffa Cleanup: Add override Keyword. 2021-03-29 08:04:58 +02:00
Habib Gahbiche
805d947810 Compositor: Add Anti-Aliasing node
This is an implementation of Enhanced Subpixel Morphological Antialiasing (SMAA)

The algorithm was proposed by:
  Jorge Jimenez, Jose I. Echevarria, Tiago Sousa, Diego Gutierrez

This node provides only SMAA 1x mode, so the operation will be done with no spatial
multisampling nor temporal supersampling. See Patch for comparisons.

The existing AA operation seems to be used only for binary images by some other nodes.
Using SMAA for binary images needs no important parameter such as "threshold", so we
perhaps can switch the operation to SMAA, though that changes existing behavior.

Notes:
1. The program code assumes the screen coordinates are DirectX style that the
   vertical direction is upside-down, so "top" and "bottom" actually represent bottom
   and top, respectively.

Thanks for Habib Gahbiche (zazizizou) to polish and finalize this patch.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D2411
2021-03-29 07:56:58 +02:00
6af4163a3f Knife: reduce redundant face picking queries
Reduce the maximum number of queries to find the face under the
mouse cursor from 6x to 2x on cursor motion.

Calculating the screen-space detail could perform 2x look-ups
which have already been calculated.
2021-03-29 14:31:05 +11:00
27a7b2e27a Fix T83391: Knife sometimes snaps to object center
Knife snapping logic assumed having a face under the cursor meant
the projected positions were set.

This is not always the case as failure to ray-cast uses the back-buffer
as a fallback.
2021-03-29 13:29:14 +11:00
e47f5cf197 Cleanup: deduplicate attribute creating code 2021-03-28 12:50:14 +02:00
9289c358fb Cleanup: use parentheses in macro 2021-03-28 12:50:14 +02:00
afcfc6eb08 Fix T86060: Texture Paint clone tool misleading texture UI
For projection painting tools besides the `DRAW` tool:

- Don't show the texture from viewport stencil drawing.
- Don't show the texture panel.

Based on D10564 by @lichtwerk with own changes.
2021-03-28 19:45:56 +11:00
3944560b4a Cleanup: re-order expensive checks for indirect ID use
Check for indirect ID use after other simple user count checks are made.

Also assert ED_object_base_free_and_unlink_no_indirect_check object
argument isn't indirectly used.
2021-03-28 18:48:57 +11:00
0a6bca1f75 Cleanup: revert part of da160dc32d
The grease-pencil parent check was enabled when deleting objects,
when previously it was only done when unlinking.

While harmless, the previous logic is correct.
2021-03-28 18:48:57 +11:00
46d980228b Fix T86992: Tagged ID deletion conflicts with freeing objects
Check LIB_TAG_COPIED_ON_WRITE instead of LIB_TAG_NO_MAIN,
matching the behavior of rigid-body shared data.
2021-03-28 18:16:07 +11:00
5b1980859a Workaround T86992: Tagged ID deletion conflicts with freeing objects
da160dc32d exposed a bug in
`BKE_id_multi_tagged_delete` causing a memory leak in soft-body that
made `physics_softbody` test fail.

Use a loop to remove ID's to keep tests working until T86992 is fixed.
2021-03-28 17:32:37 +11:00
a9e7d503dd Cleanup: Apply clang format 2021-03-27 15:01:41 +01:00
Marcelo Demian Gómez
e7c4c9e538 Fix T86967 : Artifacts when tracing image to Grease Pencil
Tracing images to grease pencil objects creates sometimes artifacts, as seen, for example, when tracing the attached image.  {F9910821}
I have found the same behavior both in the 2.92 release and in the current 2.93 master.
The artifacts are caused by a variable that's not initialized or updated when finding a point tagged as POTRACE_CORNER.
This patch solves this issue.

Maniphest Tasks: T86967

Differential Revision: https://developer.blender.org/D10832
2021-03-27 15:01:36 +01:00
dc873c4a7b Fix T86975: GPencil interpolate sequence error when strokes are not selected
If the selection order is not used, need to put the strokes in inverse order because the Hash Iter returns the strokes in inverse order.
2021-03-27 12:51:18 +01:00
c4ab1891cc Automated testing: selection operators test cases
added 22 more test cases for following operators:
    - edges select sharp
    - loop multi select
    - select all
    - select faces by sides
    - select interior faces
    - select less
    - select linked

{F9853218}

Reviewed By: calra, mont29

Differential Revision: https://developer.blender.org/D10400
2021-03-27 09:48:54 +01:00
Pratik Borhade
99dabc156a Cleanup: spelling and comments
- comment added in struct `KnifeTool_OpData`
- struct pointer name `lst` updated to `list` ( Guess its more readable )
- `KNF_MODEL_IGNORE_SNAP_ON` updated to `KNF_MODAL_IGNORE_SNAP_ON`
- `KNF_MODEL_IGNORE_SNAP_OFF` updated to `KNF_MODAL_IGNORE_SNAP_OFF`

Ref D10824
2021-03-27 16:21:37 +11:00
Siddhartha Jejurkar
9f3d41d4ee Fix T86924: UV Sync selection breaks individual origin calculation
Use uvedit_uv_select_test which accounts for UV Sync selection.

Ref D10830
2021-03-27 15:58:31 +11:00
a6ec2de96a Correct header rename error 10cfa75e1d 2021-03-27 15:48:59 +11:00
Fabrício Luis
8e6e8dd871 UV Editor: Add cursor center operator
This matches cursor center operator from the 3D view.

Reviewed By: campbellbarton

Resolves T70142

Ref D8271
2021-03-27 15:07:26 +11:00
414017ac86 Cleanup: clang-format 2021-03-27 14:49:59 +11:00
ee367084a7 Comment: note that structs are zeroed instead of using defaults 2021-03-27 14:48:26 +11:00
10cfa75e1d Cleanup: use .hh extension for C++ headers
Follow documented convention for file naming.
2021-03-27 14:05:30 +11:00
da160dc32d Object: faster object deletion
The `object_delete_exec` lead to `BKE_library_ID_is_indirectly_used`
being called twice. With this patch deleting is around 20% faster.

Example when deleting 10000 objects:
Current: 35.6s
This patch: 18.8s (updated, last rev 29.7s)

Reviewed By: campbellbarton

Ref D9857
2021-03-27 13:38:44 +11:00
Vincent Blankfield
9b87d3f029 Win32: Allow return from fullscreen to maximized
If window is maximized when toggling fullscreen, go back to maximized when done.

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

Reviewed by Harley Acheson
2021-03-26 14:30:57 -07:00
0ec82477af macOS/bpy: install into site-packages
Reviewed By: #platform_macos, brecht
Maniphest Tasks: T86579
Differential Revision: https://developer.blender.org/D10664
2021-03-27 01:14:45 +05:30
ad31b13f91 macOS/bpy: add support for OpenMP
Changes made:
* Add OpenMP linker flags.
* Copy the libomp.dylib to `2.93/lib/libomp.dylib`.
* Change the `LC_LOAD_DYLIB` item such that
  the lib is found at `bpy.so/../../Resources/2.93/lib/libomp.dylib`.
Installation is done by D10664.

Reviewed By: #platform_macos, brecht
Maniphest Tasks: T86579
Differential Revision: https://developer.blender.org/D10657
2021-03-27 01:08:51 +05:30
35d5cc8982 Cleanup: Use enum for "in" vs. "out" node sockets 2021-03-26 14:25:52 -04:00
Vincent Blankfield
12193035ed Fix T86859: Allow covering of Taskbar when Fullscreen from Maximized
When the window is already maximized allow covering Windows Taskbar when toggling fullscreen.

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

Reviewed by Harley Acheson
2021-03-26 10:19:50 -07:00
8408a8fda2 LibOverride: Fix outliner menu showing 'override editing' entries for linked overrides.
One can only resync, reset, delete etc. locl overrides, linked ones are
basically regular linked IDs and fully not editable.

Reported by Demeter from the Studio, thanks.
2021-03-26 18:15:20 +01:00
80530edcae Geometry Nodes: Rename "Plane" primitive to "Grid"
Although "Grid" may not be techincally correct since a grid could be 3D,
it was decided to rename the "Plane" primtive to "Grid". The primitive
node allows subdivisions, so the name is more consistent with the
operator in the 3D view.

Ref T86819

This commit includes a file subversion bump for the versioning.
2021-03-26 13:09:35 -04:00
Yevgeny Makarov
e684c170f9 UI: Change Usages of 'WPaint' to 'Weight Paint'
Changing to a more informative 'Weight Paint' rather than 'WPaint'.

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

Reviewed by Julian Eisel
2021-03-26 09:58:07 -07:00
Charlie Jolly
70061c69b7 Geometry Nodes: Implicit conversion change for float/int/color to bool
Change `float to boolean` and `int32 to boolean` to return false for zero and negative values.

This aligns with how artists would expect these values to work. This is in contrast to what a coder would expect. It was determined on blender.chat that this was a better default. This means that a negative float value would give a boolean false.

Change `Color4f to boolean` to return false for zero and negative grayscale values.

Likewise, for color to boolean, to account for negative value colors, the grayscale value would be used for determining if a colour was false or not.

See {T86454}

Reviewed By: JacquesLucke

Differential Revision: https://developer.blender.org/D10685
2021-03-26 16:29:48 +00:00
1e855149b2 Nodes: match Multi-input socket activation distance
Activation distance for multi input sockets had different length
dependend of dpi factor. That caused jumping when activation distance
became shorter than snapping distance.

Fixed by removing activation distance and using same function
which is used to evaluate snapping.

Reviewer: Dalai Felinto

Differential Revision: https://developer.blender.org/D10809
2021-03-26 17:29:10 +01:00
f560bc90c7 OSL: add basic OSL shader template
Add a basic OSL shader that shows how inputs
and outputs work and do some simple math with
them.

This template is a happy medium between the
templates we already ship, empty_shader is a
little too bare, and the other templates are
a little "too much" and you end up having to
delete a whole bunch of stuff.

a great starting point for some experimentation!

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

reviewed by: brecht
2021-03-26 10:27:31 -06:00
689d6032ff Compositor: Fix array out of bounds. 2021-03-26 17:23:14 +01:00
William Reynish
dcd90bf188 UI: Remove "Enable physics for:" text in physics properties
The "Enable physics for:" text makes no semantic sense- i.e.
"Enable physics for Fluid". Additionally, the leading text is just not
necessary, this section is just as clear without it.

Differential Revision: https://developer.blender.org/D10537
2021-03-26 12:21:03 -04:00
Leon Leno
97e212f52e Geometry Nodes: Add remaining operations to the Vector Math node
This patch adds support for the remaining operations of the Vector Math
node within Geometry Nodes.  While the operations are already available
in the UI, they hadn't been implemented, yet. With this patch the node
uses the implementation that was added for the Attribute Vector Math
node - similar to how it's handled with the Math node and Attribute
Math node.

Differential Revision: https://developer.blender.org/D10650
2021-03-26 12:15:33 -04:00
Yevgeny Makarov
63a6268e83 UI: Use unified format for "Warning" in descriptions
Warnings in tooltips were using inconsistent formatting, some in
parantheses, some not, some in caps, others not, some on new lines,
some not, etc.

This patch uses a consistent new line and no capitals for these cases.

Differential Revision: https://developer.blender.org/D9904
2021-03-26 12:07:50 -04:00
3d25669486 Cleanup: Geometry Nodes: Allow using "Auto" domain to avoid adapting
Now that we have `ATTR_DOMAIN_AUTO`, it makes sense to use it to skip
automatic domain interpolation. This can make code that depends on the
non-interpolated domain of the attribute a bit simpler.
2021-03-26 11:38:46 -04:00
Habib Gahbiche
252c87b9e8 Compositor automated testing
Added support for compositor tests. Compositor tests can be added, executed and viewed in a similar way to cycles
and other render engines tests.

Running test:
`ctest -R compositor`

Updating test:
`BLENDER_TEST_UPDATE=1 ctest -R compositor`

Viewing test results:
typically saved under `build_folder/tests/compositor/report.html`

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D6334
2021-03-26 16:15:02 +01:00
39ecf90185 LibOverride optimization; Do not compare bound box of objects.
This is runtime only data, no need to deal with it.
2021-03-26 16:13:16 +01:00
921d0851b5 Fix T86942: GPencil does not export SVG or PDF in orthographic camera
The calculation of the 2D point was wrong when using orthographic mode.

Also small cleanup in float3 variable.

Differential Revision: https://developer.blender.org/D10828
2021-03-26 16:07:02 +01:00
2371454b2d Cleanup: Replace Methode Overloading With Default Value. 2021-03-26 16:02:59 +01:00
6524ceb8cf Cleanup: Remove ptr For Owned Children. 2021-03-26 15:51:06 +01:00
930b8a3932 Cleanup: Replace std::vector With blender::Vector. 2021-03-26 15:51:06 +01:00
9d80b3a69c Cleanup: Replaced Typedef Enum With Enum Class. 2021-03-26 15:51:06 +01:00
f725f42af5 Cleanup: Remove SocketReader.
SocketReader was added as an easier to understand interface on top of
the NodeOperation. It was implemented as a base class of the
NodeOperation and adds an additional hierarchy level.

Ths change replaces the abstract class with a typedef. In the end we
want to remove the typedef but will wait for some new nodes before doing
so.
2021-03-26 15:51:06 +01:00
e5fb7eac85 Cleanup: Use Enum Class For PixelSampler. 2021-03-26 15:51:06 +01:00
23b1872d6e Cleanup: Replace std::vector with blender::Vector. 2021-03-26 15:51:06 +01:00
acc6e5c315 LineArt: Fix unreported material user count error when apply modifier
The number of users was 0 after applying the modifier.
2021-03-26 15:48:54 +01:00
4bb70e0ba5 Geometry-Nodes: Sort the Nodes Categories alphabetically
The exception is still Group and Layout to be consistent with the
other node editors. This could use a separator though.
2021-03-26 14:44:15 +01:00
1614795ae2 FFmpeg: improve threading settings
Generalize threading settings in proxy building and use them for encoding
and decoding in general. Check codec capabilities, prefer FF_THREAD_FRAME
threading over FF_THREAD_SLICE and automatic thread count over setting it
explicitly.

ffmpeg-codecs man page suggests that threads option is global and used by
codecs, that supports this option. Form some tests I have done, it seems that

`av_dict_set_int(&codec_opts, "threads", BLI_system_thread_count(), 0)`

has same effect as

```
pCodecCtx->thread_count = BLI_system_thread_count();
pCodecCtx->thread_type = FF_THREAD_FRAME;
```

Looking at `ff_frame_thread_encoder_init()` code, these cases are not
equivalent. It is probably safer to leave threading setup on libavcodec than
setting up each codec threading individually.

From what I have read all over the internet, frame multithreading should be
faster than slice multithreading. Slice multithreading is mainly used for low
latency streaming.

When running Blender with --debug-ffmpeg it complains about
`pCodecCtx->thread_count = BLI_system_thread_count()` that using thread count
above 16 is not recommended. Using too many threads can negatively affect image
quality, but I am not sure if this is the case for decoding as well - see
https://streaminglearningcenter.com/blogs/ffmpeg-command-threads-how-it-affects-quality-and-performance.html
This is fine for proxies but may be undesirable for final renders.

Number of threads is limited by image size, because of size of motion vectors,
so if it is possible let libavcodec determine optimal thread count.

Performance difference:
Proxy building: None
Playback speed: 2x better on 1920x1080 sample h264 file
Scrubbing: Hard to quantify, but it's much more responsive
Rendering speed: None on 1920x1080 sample h264 file, there is improvement with codecs that do support FF_THREAD_FRAME for encoding like MPNG

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D10791
2021-03-26 12:43:46 +01:00
847002e1f8 FFMPEG: refactor seeking
Split seeking section of `ffmpeg_fetchibuf()` function into multiple
smaller functions.

Conditional statements are moved to own funtions with human readable
names, so code flow is more clear.

To remove one branch of seeking, first frame is now decoded by
scanning, which will do only one iteration. So nothing has technically
changed.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D10638
2021-03-26 12:43:46 +01:00
Charlie Jolly
43455f3857 Geometry Nodes: Add Attribute Clamp Node
This adds a Clamp node for Geometry Nodes Attributes.

Supports both Min-Max and Range clamp modes.

Float, Vector, Color and Int data types supported.

Reviewed By: HooglyBoogly, simonthommes

Differential Revision: https://developer.blender.org/D10526
2021-03-26 10:52:50 +00:00
e867f40611 Cleanup: Replaced unneeded branch with assert. 2021-03-26 11:27:28 +01:00
fb6c29f59c Cleanup: redundant expression 2021-03-26 10:50:34 +01:00
ea12df51b8 Fix T86939: Cycles objects bounds not updated when transforming objects
As a rather premature optimization from rBbbe6d4492823, Object bounds
were only computed when either the Object or its Geometry were modified.
Prior to rB42198e9eb03b, this would work, as the Geometry was tagged as
modified if the Object's transform was also modified.

Since this tagging is not done anymore due to side effects, and since at
the time bounds are computed Objects were already processed and tag as
unmodified, the check on the modified status was always false.

For now remove this check, so the bounds are always unconditionally
updated. If this ever becomes a performance problem in large scenes with
motion blur, we will then try to find a way to nicely optimize it.

This would only affect BHV2 as OptiX and Embree handle object bounds
themselves.
2021-03-26 10:50:34 +01:00
d982ea9a9e Fix error when an addon has no __init__.py
When an addon has been removed, but its `.pyc` files are still there,
the Python module can still be loaded. However, because `__init__.py` is
missing, it becomes a namespace instead of a module, and its `__file__`
will be set to `None`. As a result, it's impossible to get the mtime
from the file (because there is none).

This should not influence any regularly uninstalled add-on, as that
would just remove the add-on's directory; I ran into the problem when
switching Git branches caused an add-on's Python files to disappear
while keeping the `__pycache__` directory around.
2021-03-26 10:46:26 +01:00
fda50625cd Cryptomatte: Fix error loading incomplete metadata.
When rendering with cycles at some point the manifest is trimmed. This
leads to incomplete/corrupted metadata. This patch will make sure that
the manifest parser doesn't crash.

This solved the issue when the manifest is trimmed at the start of a
hash. Eg '"Name":"'.
2021-03-26 09:13:46 +01:00
4425bacec4 Cleanup: Fix clang-tidy errors. 2021-03-26 08:38:58 +01:00
64d4e722a0 UV: warn when unwrapping fails
Report an error when unwrapping can't solve some UV islands,
note that edge-seams may need to be set.

Address T86936
2021-03-26 17:59:36 +11:00
8adeab4b0e Cleanup: use code doxy command for Python snippet 2021-03-26 14:58:30 +11:00
ce528d02e1 Cleanup: spelling 2021-03-26 14:55:55 +11:00
Victor-Louis De Gusseme
dda02a448a Geometry Nodes: Add Attribute Map Range Node
This commit adds a node with a "Map Range" operation for attributes
just like the non-attribute version of the node. However, unlike the
regular version of the node, it also supports operations on vectors.

Differential Revision: https://developer.blender.org/D10344
2021-03-25 23:29:33 -04:00
e18091650b Animation: action mirror RNA API using pose contents
This adds a new RNA method `Action.flip_with_pose(ob)` to flip the
action channels that control a pose.
The rest-pose is used to properly flip the bones transformation.

This is useful as a way to flip actions used in pose libraries,
so the same action need not be included for each side.

Reviewed By: sybren

Ref D10781
2021-03-26 13:37:40 +11:00
ff017df318 Animation: add BKE_fcurve_pathcache_find API
Support a cache for fast RNA path look-ups for RNA-path + index.

Unlike a regular hash lookup, this supports using a single lookup
for the RNA path which is then used to fill an array of F-curves.

Reviewed By: sybren

Ref D10781
2021-03-26 13:37:40 +11:00
6fd799c72c Animation: add BKE_fcurves_calc_keyed_frames utility
This function returns an array of keyed frames with rounding,
to avoid duplicates caused by subtle floating point difference.

Reviewed By: sybren

Ref D10781
2021-03-26 13:37:40 +11:00
758c2210ae Cleanup: clang-format 2021-03-26 12:28:49 +11:00
62f5a6bfa7 CMake: add headers to source lists, sort file-lists 2021-03-26 12:24:41 +11:00
Leon Leno
2f77252086 Fix: Geometry Nodes: Incorrect offsets for plane primitive
The recent commit that changed the size (rB83df3545246aada) left out
a few changed. This patch also adjusts the positioning and UV scale of
the generated plane accordingly.

Differential Revision: https://developer.blender.org/D10822
2021-03-25 20:59:29 -04:00
de1eeaa3d2 LibOverride: fix bad ID relationships handling during resync.
Purely local IDs would not always be used as proper barriers when
generating override hierarchy data, leading to imporperly trying to
resync override IDs from other hierarchies, which would break/cause
issues in case they would be duplicate overrides of the same linked
data.

Reported by Pablo from Sprite team, thanks.
2021-03-25 22:32:04 +01:00
2281db72b0 LibOverride: Fix mistake in recent commit.
We do not want to re-generate auto-overrides until everything that
needed to be resynced has been resynced. Otherwise it's a waste of time
and guaranteed loss of some override properties.

Mistake in rB9947f2095610 earlier today.
2021-03-25 22:32:04 +01:00
64ca286540 Cleanup: Pass instance group result vector as an argument
This will allow retrieving the instance groups from multiple geometry
sets and avoiding needing vectors of vectors to store the results.
This is useful when retrieving instances from a multi-input socket
of geometries.
2021-03-25 14:54:27 -04:00
926f7612fd Fix T86867: Node Editor: Avoid deselect-all triggering on every box-
select

In 'Set/Replace' mode this is not a problem, but 'Extend' or 'Subtract'
modes were useless with the current behavior.
The problem here is that 'node.select' fires before 'node.select_box'
(which is fine) but deselects immediately on click.

This issue has come up before in other editors, see
{T70457}
{rB395dfff103e1}
{rBa8ea1ea1b7d5}

Now delay deselection in empty space to mouse release (same as done in
before mentioned report).

also related:
ref T57918
ref T63994

Maniphest Task: T86867

Differential Revision: https://developer.blender.org/D10801
2021-03-25 17:05:35 +01:00
25c4118651 LibOverride: Silence noisy warnings in console.
That one skiped the move to CLOG a few weeks ago, could spam a lot in
the console in some cases.
2021-03-25 16:57:32 +01:00
0f13bded46 Fix T86852: Allow Font Style Changes to Affect Spreadsheet Text Size
Replacing a hard-coded font size with font style widget size so it can be set by user.

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

Reviewed by Dalai Felinto
2021-03-25 08:35:36 -07:00
5ebe74e779 GPencil: Fix compiler warning when HARU and PUGIXML are disabled
The function only must be included if Haru or Pugixml is enabled.
2021-03-25 16:06:31 +01:00
1d7adb6d8a BLI: simplify using DefaultHash 2021-03-25 16:01:41 +01:00
9b42626918 BLI: fix Set.lookup_key_or_add 2021-03-25 16:01:41 +01:00
56df673be2 Fix T86796: moving the cursor in the UV Editor does not take aspect into
account

UV coords are scaled by aspects (see UVsToTransData). This also applies
for the Cursor in the UV Editor which also means that for display and
when the cursor coords are flushed (new 'recalcData_cursor_image' was
added for this), these need to be converted each time.

Maniphest Tasks: T86796

Differential Revision: https://developer.blender.org/D10817
2021-03-25 15:36:53 +01:00
a9cd90135a Make moving the cursor in UV Editor a 2d edit transform
This flags moving the cursor in the Image Editor T_2D_EDIT with the
following benefits:

- dissallowing e.g. Z constraints
- improving the header display:
-- it should not use scene units
-- now respects if we are moving in pixel coords or not

part of upcoming fix for T86796
ref D10817
2021-03-25 15:36:53 +01:00
Erik Abrahamsson
5ffbe439c6 Fix for T86613: Renaming in outliner doesn't trigger rename event
When subscribing to name-changes through the API,
the event doesn't trigger if the object is renamed in the outliner.
Fixed by publishing the RNA changes.

Reviewed By: lichtwerk

Ref D10732
2021-03-26 00:39:35 +11:00
543becac36 Fix T86921: Executing "Operator Cheat Sheet" Crashes Blender
This was only happening without an active object.

The "Operator Cheat Sheet" operator collects info about all operators,
and as part of that executes the callbacks to create dynamic enums. The
callback to enumerate the geometry operators (introduced in
rB370d6e50252b) attribute domains depends on a context object. If this
isn't available, we just have to return `DummyRNA_NULL_items`.

Maniphest Tasks: T86921

Differential Revision: https://developer.blender.org/D10814
2021-03-25 14:03:20 +01:00
0083a7615e Revert "Cleanup: Fix unused-private-field warning."
This reverts commit 43c48965d7.
It created a new warning on GCC: -Wattribute (ignored attribute) as
GCC doesn't warn about unused private fields.
2021-03-25 17:23:46 +05:30
9947f20956 LibOverride; Fix missing re-creation of auto-generated override rules after resync.
While not useful for the override system itself, this is rather
important for user feedback.
2021-03-25 12:45:01 +01:00
51b316dbc2 Fix T83390: Remove temporary, for-one-release deprecation hints
Revert "Point users to new location of "Show Group Colors" option",
commit rB6ed6741ee35930bf81fad9a5eb6bb17eea168725.

These deprecation hints were intended for one release only, and thus can
be removed now.
2021-03-25 12:15:28 +01:00
f7fa0d3974 Geometry Nodes: change order of domains in drop down
This has been requested in D10803.
2021-03-25 12:04:38 +01:00
28cf851a5c Geometry Nodes: rename attribute domains
This patch renames two domains:
* `Polygon` -> `Face`
* `Corner` -> `Face Corner`

For the change from `polygon` to `face` I did a "deep rename" where I updated
all (most?) cases where we refere to the attribute domain in code as well.
The change from `corner` to `face corner` is only a ui change. I did not see
a real need to update all code the code for that. It does not seem to improve
the code, more on the contrary.

Ref T86818.

Differential Revision: https://developer.blender.org/D10803
2021-03-25 12:02:50 +01:00
150e0553da Fix T86853: Critical bug in write code of CacheFile ID.
CacheFile writing code would not write generic ID data (call for it has
been missing since the initial commit, rB61050f75b13e).

While potentially affecting other areas (mostly CustomProperties/IDProperties),
this was a critical failure for liboverrides. Also added some workaround
code to allow opening broken files (though the override of the CacheFile
data-block will be lost).
2021-03-25 11:21:15 +01:00
3b0531154e UI: rename node editor sidebar categories
* `Node` -> `Group`
* `Item` -> `Node`

Differential Revision: https://developer.blender.org/D10804
2021-03-25 09:16:03 +01:00
9ac7946dd0 GPencil: Fix wrong file extension when exporting SVG
Due a code cleanup it was using .PDF all times.
2021-03-24 18:47:33 +01:00
43c48965d7 Cleanup: Fix unused-private-field warning. 2021-03-24 22:45:43 +05:30
e2d362757f Cleanup: Add override keyword. 2021-03-24 17:56:29 +01:00
9ad3d1d36b Cleanup: Remove unecessary enum funcs
The separator can be added directly in the enum items rather than in
a callback.

Differential Revision: https://developer.blender.org/D10806
2021-03-24 12:44:48 -04:00
a363d64b93 UI: Use correct property split ratio for node socket buttons
This makes the buttons drawn on nodes for unconnected string and color
sockets draw with the correct 40% ratio for the label split rather than
the old 50% ratio not used elsewhere in Blender anymore. The benefit is
a cleaner look, because the button edges line up better with others, and
a bit more space to type in attribute names.
2021-03-24 12:36:19 -04:00
d0d0d9d7c6 Fix broken compilation after recent GPencil commit.
rBa8a92cd15a52 was adding external libraries includes to `INC`, which is
reserved to internal project includes.

`INC` does not allow duplicates, and when using system libs both PugiXML
and Haru headers are under the same path.
2021-03-24 17:01:19 +01:00
a6664383c6 Fix (unreported) Outliner: missing override tree items for collections in Viewlayer view.
Probably lost at some point in recent refactor moving the whole tree
building towards a more modular, C++ code.
2021-03-24 16:38:03 +01:00
bf0454b78b Fix build error and warnings in new grease pencil IO code 2021-03-24 11:33:39 -04:00
80450331c7 Fix T86884: Don't remove the "line art object add" enum item
We would not add the "object line art" enum to the operator enum list,
if there were no active object in the scene.

This would make it impossible to call this operator from python code as
the enum would we hidden when we were not in a viewport context.

Always make the operator available, having no active object is not a
strict requirement for the operator to work, so expose it always.
2021-03-24 16:23:32 +01:00
8060293656 Fix T86875: "Show on Cage" crash for geometry nodes primitives
Without `calc_object_remap` turned off in the conversion to and from
BMesh for the primitive nodes, the `CD_ORIGINDEX` custom data layer
has incorrect values. By using a different function to do the conversions,
we can avoid this problem.

Thanks to Jacques for finding the fix here.

Differential Revision: https://developer.blender.org/D10805
2021-03-24 11:05:55 -04:00
a478d502dd GPencil: Fix unreported crash when apply Lattice modifier
This error was produced because now it is possible to have several Lattice modifiers and the Bake was removing the lattice data of all modifiers.

Now the data is only recalculated and removed for the current modifier.

Also some cleanup of comments.
2021-03-24 16:01:44 +01:00
a8a92cd15a GPencil: New modules for Import and Export
This patch adds support to export and import grease pencil in several formats.

Inlude:

* Export SVG
* Export PDF (always from camera view)

* Import SVG

The import and export only support solid colors and not gradients or textures.

Requires libharu and pugixml.

For importing SVG, the NanoSVG lib is used, but this does not require installation (just a .h file embedded in the project  folder)

Example of PDF export: https://youtu.be/BMm0KeMJsI4

Reviewed By: #grease_pencil, HooglyBoogly

Maniphest Tasks: T83190, T79875, T83191, T83192

Differential Revision: https://developer.blender.org/D10482
2021-03-24 15:28:58 +01:00
ce359da5b3 Fix T86894: Geometry nodes drag and drop creates a duplicate node
Added a condition to the poll so that it ignores drag and drop on the button. The Paste Name operator is just not implemented. Doesn't work for shading nodes either.

Reviewed By: HooglyBoogly

Differential Revision: https://developer.blender.org/D10769
2021-03-24 14:24:56 +00:00
Charlie Jolly
337a122e44 Fix T86722: Missing updates after geometry nodes drag and drop
Add missing call to ED_node_tag_update_nodetree which solves the missing update on initial drag.

Reviewed By: HooglyBoogly

Differential Revision: https://developer.blender.org/D10769
2021-03-24 14:24:55 +00:00
8bbd6ba8b7 Tweak default ID types processing order, step 17: Group and comments.
Regroup ID type indices by categories, and add some comments about
reasoning of current order.
2021-03-24 15:11:54 +01:00
c1f5a56e32 Tweak default ID types processing order, step 16: Palettes.
Move Palettes type with other weird, not-really-data ID types (like
PaintCurves and Brushes), higher in the process.

Those preset-like types may use a lot of other ID types, but should only
be used by UI-related (and Scene, for tool settings) types.
2021-03-24 15:11:54 +01:00
fd75a4cbd8 Tweak default ID types processing order, step 15: ShapeKeys.
Move shape keys type just after all obdata types, since they are some
sort of sub-geometry data.
2021-03-24 15:11:54 +01:00
7db4ef98fe Tweak default ID types processing order, step 14: Fonts.
Move Font type toward the end of the list, this is a file-wrapper type
with typically no dependency to any other ID.
2021-03-24 15:11:54 +01:00
55683fafc5 Tweak default ID types processing order, step 13: Texts.
Move Texts type toward the end of the list, this is a file-wrapper type
with typically no dependency to any other ID.
2021-03-24 15:11:54 +01:00
fe55ede5ce Tweak default ID types processing order, step 12: Sounds.
Move Sound type toward the end of the list, this is a file-wrapper type
with typically no dependency to any other ID.
2021-03-24 15:11:54 +01:00
f3fe3d965f Tweak default ID types processing order, step 11: Worlds.
Move World type with the other shading types.
2021-03-24 15:11:54 +01:00
ae84a1363d Tweak default ID types processing order, step 10: LineStyles.
Move LineStyles (Freestyle) type with the rest of the shading types.
2021-03-24 15:11:54 +01:00
0e6088f467 Tweak default ID types processing order, step 09: Particles.
Move Particles next to the other physics/simulation types, after obdata
types.
2021-03-24 15:11:54 +01:00
be073d8baf Tweak default ID types processing order, step 08: CacheFiles.
Move them with the rest of the simulation types.
2021-03-24 15:11:54 +01:00
a35d145b72 Tweak default ID types processing order, step 07: MovieClips.
Move them with the other shading/image types, just before Images.
2021-03-24 15:11:54 +01:00
72fa0d48ea Tweak default ID types processing order, step 06: Brushes.
Move Brushes type with other weird, not-really-data ID types (like
Palette and Brushes), higher in the process.

Those preset-like types may use a lot of other ID types, but should only
be used by UI-related (and Scene, for tool settings) types.
2021-03-24 15:11:54 +01:00
c0f5f9ad6e Tweak default ID types processing order, step 05: PaintCurve.
Move PaintCurve type with other weird, not-really-data ID types (like
Palette and Brushes), higher in the process.

Those preset-like types may use a lot of other ID types, but should only
be used by UI-related (and Scene, for tool settings) types.
2021-03-24 15:11:54 +01:00
e96c286e53 Tweak default ID types processing order, step 04: Screen.
Move Screen data type higher in the list, just after the other
UI-related types, and before Scenes.
2021-03-24 15:11:54 +01:00
950f0b8b97 Tweak default ID types processing order, step 03: Mask.
Move it with the rest of the image/shading related types.
2021-03-24 15:11:54 +01:00
39bf5e5022 Tweak default ID types processing order, step 02: Simulations.
This is a fairly low-level ID type, so it needs to be higher in the
list, for now put it just before the shading-related types.
2021-03-24 15:11:54 +01:00
4d18fa268c Tweak default ID types processing order, step 01: Collections.
Move `OB_GR` processing just after scenes, and before objects.

This is much more sensible in general, and fixes glitches in auto-resync
process of library overrides in particular.
2021-03-24 15:11:54 +01:00
93bedcb96a Fix T86895: bpy.ops.curve.select_all(action='INVERT')
The operator should not assume v3d is valid.
2021-03-24 15:00:17 +01:00
c06042afc6 Spelling: getRenderPriotrity -> getRenderPriority 2021-03-24 14:30:22 +01:00
b2246d25a2 Cleanup: Removed commented out code. 2021-03-24 14:30:22 +01:00
31f8d894b9 Cleanup: replace index based forloops with iterators. 2021-03-24 14:30:22 +01:00
0d5cef9898 Cleanup: removed unnecessary allocations. 2021-03-24 14:30:22 +01:00
392efc7d76 Cleanup: Use const in region queries 2021-03-24 14:28:25 +01:00
d37deb19be Cleanup: Move button context based operator poll into utility function
Using the button context for operators is useful for other cases as well (where
the operator isn't the button operator itself). For example we'll need this for
the asset view UI template, where there will be additional operators that
should be able to act on button context.
2021-03-24 14:28:25 +01:00
781f41f633 Alembic procedural: deduplicate cached data accross frames
Currently the procedural will add an entry to the cache for every frame
even if the data only changes seldomly. This means that in some cases we
will have duplicate data accross frames.

The cached data is now stored separately from the time information, and
an index is used to retrieve it based on time. This decoupling allows
for multiple frames to point to the same data.

To check if two arrays are the same, we compute their keys using the
Alembic library's routines (which is based on murmur3), and tell the
cache to reuse the last data if the keys match.

This can drastically reduce memory usage at the cost of more processing
time, although processing time is only increased if the topology may
change.
2021-03-24 14:18:51 +01:00
9b8262021b Geometry Nodes: add versioning for attribute fill
The attribute domain of old nodes should be set to `ATTR_DOMAIN_AUTO`.
2021-03-24 13:27:47 +01:00
Dirk
c0a4c8c3fa Fix T86891: only sort query results for shortest string if there is a query
Differential Revision: https://developer.blender.org/D10802
2021-03-24 12:53:58 +01:00
26b45448ab Fix: Memory Leak When Using Compositor.
When using the compositor inlined static vectors could allocate
memory. This memory wasn't freed. This patch would make them inline
again.
2021-03-24 11:57:04 +01:00
715c746296 Cleanup: clang-tidy errors. 2021-03-24 11:00:31 +01:00
665d8c0e34 Cleanup: unused variable 2021-03-24 10:41:29 +01:00
42198e9eb0 Fix T86601: Cycles accumulates displacement when transforming an Object
In order to update the BVH when only the transformations are changing,
we would tag the Object's Geometry as modified. However, when
displacement is used, and the vertices were not themselves modified,
this would cause us to redo the displacement on already displaced
vertices.

To fix this, use a specific update flag for detecting and notifying that
transformations were modified.

Regression caused by rBbbe6d44928235cd4a5cfbeaf1a1de78ed861bb92.
2021-03-24 10:41:29 +01:00
6b18678e34 Fix T86314: materials not updated correctly after collada import
Make sure we have valid links and link pointers using
'ntreeUpdateTree()'.

Maniphest Tasks: T86314

Differential Revision: https://developer.blender.org/D10793
2021-03-24 10:29:34 +01:00
865025c343 Cleanup: remove stdio.h header from MEM_guardedalloc.h
This was included for `FILE *` which isn't used in the header.

Ref D10799
2021-03-24 19:34:44 +11:00
3f47df577d Cleanup: use new BLI_assert_unreachable macro 2021-03-24 12:38:08 +11:00
3ea1779365 Fix T86753: Connected Proportional editing with individual origins using different orientation than set
The problem happened when the selection only allowed "single_islands"
(only vertices are selected, no edges or faces).

The result of `is_zero_v3(v->no)` was erroneously being compared to `0.0f`

This commit corrects the wrong condition and optimizes it by adding a
earlier return when the islands don't need to be calculated.

(It also improves the code's readability by joining some variables in the
`struct TransIslandData`).
2021-03-23 15:34:31 -03:00
3a68dcb1e6 Cleanup: allow looking up size of unsupported domains
There isn't really a reason for not supporting it.
2021-03-23 16:56:38 +01:00
9a2e623372 Cleanup: use BLI_assert_unreachable in some places 2021-03-23 16:49:47 +01:00
433fb9326e BLI: add macro to indicate unreachable code
This adds a `BLI_assert_unreachable()` macro, that should be used instead
of `BLI_assert(false)` in many places.

* `BLI_assert_unreachable` provides more information than `BLI_assert(false)`
  to people reading the code.
* `BLI_assert_unreachable` will print an error to `stderr` in a release build.
  This makes it more likely that we will get bug reports when the assumptions
  of a developer were wrong.

Differential Revision: https://developer.blender.org/D10780
2021-03-23 16:45:44 +01:00
7046e37ede Cleanup: WorkScheduler.
- Use constexpr for better readability.
- Split in functions per backend.
- Split work scheduler global struct in smaller structs.
- Replaced std::vector with blender::Vector.
- Removed threading defines in COM_defines.h
2021-03-23 16:14:11 +01:00
83df354524 Geometry Nodes: Make plane primitive size consistent
This means the "Size" input is treated as a "diameter" instead of
a "radius", just like the 3D view primitives.
2021-03-23 11:05:18 -04:00
29c0b34b20 Fix (unreported) object duplicate code wrongly duplicating linked objects.
Linked data should only be duplicated if relevant `eDupli_ID_Flags` flag
is set (`USER_DUP_LINKED_ID`), this is being taken care of by generic
`BKE_id_copy_for_duplicate` function, but for some reasons (?)
`BKE_object_duplicate` was directly using `BKE_id_copy` for itself...

Note that this had especially bad consequences when duplicating
overrides of collections...
2021-03-23 16:03:12 +01:00
9f19d01e3c Geometry Nodes: Move mesh primitives to their own category
It makes more sense to avoid mixing the primitives with other mesh
operations. We considered adding a "Mesh" prefix to the names too,
but decided to prioritize improvements to the node search menu instead,
and only consider that if there is an overlapping prefix name for
another data type.
2021-03-23 11:02:38 -04:00
96e60cc22c Fix T86567: Cycles crashes when playing back animated volumes
The crash is caused by an out of bound access in the kernel due to
missing data update when a Volume's voxel data changes. Although the
previous bounding mesh is cleared, the Volume Node was not tagged as
modified, and therefore never rebuilt.

To fix this, tag the Geometries (not just Volumes, to be more robust) as
modified in Geometry.clear().

Regression caused by rBbbe6d44928235cd4a5cfbeaf1a1de78ed861bb92.
2021-03-23 15:59:29 +01:00
9e206039d4 Fix T86073 : Ctrl clicking 3 times without selecting any of the verts in NurbsPath leads crash.
Crash occurs at `assert(builder->index_len < builder->max_index_len)`.

Non-bezier nurbs were being created with abnormal values causing the
causing edge count in the draw manager to be incorrect.

This commit also deduplicates and adds descriptions to the code.

Thanks @PratikPB2123 for pointing out where the error is.
2021-03-23 11:33:53 -03:00
6d97fdc37e Outliner: Do not crash when drawing unknown view type.
Instead default to Viewlayer view.
2021-03-23 14:59:30 +01:00
0fabd045a5 LibOverride: Also consider RNA Collection in 'need resync' detection.
RNA collections can store lists of ID pointers, so they require a similar handling for RNA pointers.
2021-03-23 14:59:19 +01:00
19da44f869 Cleanup: remove internal functions from interface. 2021-03-23 12:05:37 +01:00
Manuel Castilla
9fb5559a0f Compositor: Display generated inputs in Viewers and Previews
Currently viewers and previews only display node trees that have at least one node with fixed resolution size. When all inputs are generated, nothing is displayed in most cases (RGB Node is displayed as a single pixel on previews). By generated I mean inputs not having resolution on their own, they create content dynamically given an output resolution.

This patch adds support for those cases by using an appropriate preferred resolution on Viewers/Previews which propagates to generated inputs as output resolution. Now:
- Viewers will display generated inputs with scene render resolution.
- Previews will display them with scene aspect ratio.
This is consistent with final render result and respects relative space.

The benefit for the user is being able to compose images without any input source. For example for creating mask images or simple backgrounds.

Reviewed By: Jeroen Bakker

Differential Revision: https://developer.blender.org/D10611
2021-03-23 12:04:51 +01:00
8cac85abfe Cleanup: Silence compile warning. 2021-03-23 11:59:42 +01:00
36cb66384d Cleanup: remove unused include. 2021-03-23 11:59:07 +01:00
eed45b655c RNA: support automatically mapping string property to char pointer
The goal of this patch is to remove the boilerplate code required to get
a string property that maps to an allocated char pointer in dna.
Previously, one to to provide three callbacks, all of which are not necessary
anymore for a simple string property.

Currently, when an empty string is assigned, the `set` function will always
allocate it as well, instead of assigning `NULL` to the pointer. Some structs
might support `NULL` while others don't, so this is the safer option for now.

Differential Revision: https://developer.blender.org/D10773
2021-03-23 11:47:09 +01:00
4e0fd7fff1 VSE: Sanitize move_to_meta usage
There were multiple cases that could lead to problems like moving meta
strip into itself or into it's children meta strips.

Print error string to console when invalid action is requested.
2021-03-23 11:23:20 +01:00
Charlie Jolly
d375889298 Nodes: Add Refract and Faceforward functions to Vector Maths nodes
Cycles, Eevee, OSL, Geo, Attribute

Based on outdated refract patch D6619 by @cubic_sloth

`refract` and `faceforward` are standard functions in GLSL, OSL and Godot shader languages.
Adding these functions provides Blender shader artists access to these standard functions.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D10622
2021-03-23 09:59:20 +00:00
4c19fcacc0 Cryptomatte: Node Size.
Made it just a bit smaller (same size as renderlayers node).
2021-03-23 10:50:39 +01:00
028ca67a8d Spreadsheet: show comma separators in number of rows 2021-03-23 10:41:04 +01:00
1dea9701e6 Cryptomatte: Default Node Size.
Set the min/max and default node size of the cryptomatte node.
2021-03-23 10:39:47 +01:00
9c7492e2e0 Geometry Nodes: show domain in attribute fill node
Differential Revision: https://developer.blender.org/D10789
2021-03-23 10:28:52 +01:00
Omar Emara
ec97450ac6 Curves: add taper mode option
Currently, when a taper object is specified, the radius of the spline is
ignored. This patch adds a new option to control how the taper object
affect the effective radius of the spline. The option allow three modes
of operation:

- Override: The old method. The radius of the spline is ignored and
  overridden.
- Multiply: The radius of the spline is multiplied by the taper radius.
- Add: The radius of the spline is added to the taper radius.

Ref D10779
2021-03-23 18:34:46 +11:00
f2f796e623 FIX: Incorrect link drawing after link cutting tool
Sorting of links on multi-input sockets where not recalculated after
 using the knife operator. Added call to resort function before
 cutting operator finishes.

Reviewer: Jacques Lucke

Differential Revision: https://developer.blender.org/D10783
2021-03-23 08:14:29 +01:00
2600b27d26 Cleanup/CMake: Fix comment, sort order of options. 2021-03-23 12:11:46 +05:30
08151b52a2 Fix error in clip.setup_tracking_scene with cycles
Regression in e9182a0f5d
2021-03-23 16:49:38 +11:00
70d2456ff1 Cleanup: unused variables, imports 2021-03-23 16:21:51 +11:00
bb78f38bd1 Cleanup: single quotes for Python enums, spelling 2021-03-23 16:08:53 +11:00
3117de3a73 Cleanup: import operator class directly for Python operators 2021-03-23 16:08:02 +11:00
32301a0700 Fix sequencer text leaving bold & italic flags enabled
Regression in 913b71bb8b
2021-03-23 16:06:02 +11:00
ee07bfa3a0 Fix crash transforming sequences
Regression in 3d9ee83d88
2021-03-23 15:11:38 +11:00
e5b973100d Update RNA to Manual Map 2021-03-22 23:23:47 -04:00
38b7563a4f Cleanup: de-duplicate gpencil logic to ensure materials
- Rename:
  `BKE_gpencil_object_material_get_index_name`, to
  `BKE_gpencil_object_material_index_get_by_name`
  Matching `BKE_gpencil_layer_get_by_name`.
- Move logic to ensure named materials into a new function:
  `BKE_gpencil_object_material_ensure_by_name`
2021-03-23 13:58:09 +11:00
a7239c2bad Fix incorrect flag usage in line art modifier 2021-03-23 13:29:20 +11:00
db5d9ddb1a Cleanup: use e prefix for enum, comment on misleading flag values
Also replace "Feature" with "LineArt" in enum names.
2021-03-23 13:27:17 +11:00
80c86e274d Cleanup: move line art panel into properties_objects
No need for a module to define a single panel, since this is an
object panel it can be included with other object panels.

If centralizing line-art properties is needed in the future,
this can be done in a `*_common` module.
2021-03-23 12:41:45 +11:00
b787581c9c WM: don't set the area when toggling full-screen
The stated reason for this no longer applies.
2021-03-23 11:57:41 +11:00
4820f16b7f RNA: correction to a05cbc9914
The clipping plane bias is an implementation detail,
don't use this in the RNA name.
2021-03-23 11:31:40 +11:00
62987a6f98 Cleanup: lattices, use bool is_editmode instead of int editmode
Replace `int editmode` with `const bool is_editmode`.

No functional changes.
2021-03-22 18:02:02 +01:00
7d4dcfe879 Fix T86822: context.collection not available in Object/Object Data Properties
We need to return the global context collection if it is not found in
the data path.

Also fix pinning of the collection tab.
2021-03-22 17:37:44 +01:00
Jishan Singh
2c427d594f Fix T83638: mirror modifier with mirror object renders wrong motion blur
In this case both the mirror object and object itself moving in time may
change the geometry and must be checked.

Differential Revision: https://developer.blender.org/D10757
2021-03-22 17:22:45 +01:00
21268ad20a Functions: devirtualize virtual arrays in simple functions
In some multi-functions (such as a simple add function), the virtual method
call overhead to access array elements adds significant overhead. For these
simple functions it makes sense to generate optimized versions for different
types of virtual arrays. This is done by giving the compiler all the information
it needs to devirtualize virtual arrays.

In my benchmark this speeds up processing a lot of data with small function 2-3x.

This devirtualization should not be done for larger functions, because it increases
compile time and binary size, while providing a negilible performance benefit.
2021-03-22 17:06:27 +01:00
6cec782970 Cleanup: Collection check return type in button_context 2021-03-22 16:59:08 +01:00
23d2174d6b Geometry Nodes: Remove location and rotation from mesh primitives
Following some discussion among the geometry nodes team, it was decided
that keeping the primitive nodes simpler and requiring a separate
transform node to move the generated geometry from the origin would
be better.
 - It's more consistent with the current general idea of "building
   block nodes"
 - It makes more sense for the future when it will be possible to
   use instancing to control the transforms.
 - It reduces UI clutter when the controls are not necessary.
2021-03-22 11:58:46 -04:00
2d1120c171 BLI: Add "identity" constructor to float4x4 type 2021-03-22 11:52:44 -04:00
9baf39c8da Fix T86666: Lasso and Circle select tools selecting objects behind clip_min
Although it works well in most cases, the algorithm to detect if a point
is within the limits of the camera does not work well in othographic mode.

This commit also adds the option `V3D_PROJ_TEST_CLIP_FAR` (currently unused).

Differential Revision: https://developer.blender.org/D10771
2021-03-22 12:46:29 -03:00
fb1265c5cf Tracking: Fix movie file prefetch freezing interface
The issue was caused by the prefetch code having LOCK_MOVIECLIP lock
acquired while reading frames from the movie files. The need of the
lock was coming from the fact that `clip->anim` can not be accessed
from multiple threads, so that was guarded by a lock. The side effect
of this lock was that the main thread (from which drawing is happening)
did not have any chance passing through it in the cache code because
the prefetch happens so quickly.

The solution is to create a local copy of the clip with its own
anim handler, so that read can happen without such lock.

The prefetch is slower by an absolute number in seconds (within 10%
in tests here), but it is interactive now.
2021-03-22 16:27:35 +01:00
Johannes Jakob
4b9c9a7bea Fix missing document icons on macOS 10.4 and earlier
Re-adds a legacy document icon for macOS 10.14 Mojave that is
consistent with the system generated document icon on macOS 11
Big Sur. It uses the old-style document sheet icon, but includes the
file extension underneath the Blender icon (unlike the previous
legacy document icon that was removed in D10267).

Adds the missing description for the exported type identifier.
Finder now correctly displays “Blender File” instead of “data”
for Blender files.

Differential Revision: https://developer.blender.org/D10746
2021-03-22 16:05:10 +01:00
3e44221b57 Fix build error on macOS/clang 2021-03-22 16:05:10 +01:00
a31b162c6e GPencil: Hide Interpolate Only Selected in Draw Mode
This option is only valid in Edit mode. Also changed the space between options to improve UI.

Reviewed by: @mendio
2021-03-22 15:58:59 +01:00
2889d8dca9 GPencil: Move Automerge button position in topbar
This helps to keep animation buttons grouped.
2021-03-22 15:47:59 +01:00
d955ce1170 Fix T86591: Tracking backwards is slower
The root of the issue was caused by the PredictMarkerPosition()
always returning false when tracking backwards. This was making
it so tracker always had to run brute initialization, which is
an expensive operation.

From own timing here:

- Tracking forward takes 0.667637 seconds
- Tracking backward used to take 2.591856 seconds
- Tracking backward now takes 0.827724 seconds

This is a very nice speedup, although the tracking backwards is
still somewhat slower. Will be investigated further as part of
a regular development.
2021-03-22 15:20:13 +01:00
e3f2c94d39 Fix T86741: Remapping could create doublons of collections in hierarchy.
Code rebuilding/ensuring the sanity of the collection hierarchy was not
checking for a same collection being child of the same parent multiple
times.

This was already prevented to happen in code adding collections to other
collections, but not for the remapping case.
2021-03-22 15:10:27 +01:00
56dabfac5c Fix (unreported) memleak in collection/viewlayer code.
In collection/viewlayer synchronization code, in some cases, there are
extra unused view layer collections left in old list after all needed
ones have been moved to the new list.

Found while working on T86741.
2021-03-22 15:10:27 +01:00
7b7b554f94 Fix: wrong use of assert in recent commit. 2021-03-22 14:11:58 +01:00
1a7f9b5005 UI: Remove text for add and remove buttons in cryptomatte node
The text is unecessary and it's always cut off anyway.
2021-03-22 08:58:20 -04:00
c4c195672d Cleanup: remove unexposed nodes
Those nodes are leftovers from my work on particle nodes and are not needed currently.
They can be added back easily if they become necessary.
2021-03-22 12:23:25 +01:00
77887f95cc Geometry Nodes: make random float node more consistent with other nodes
Previously, different Random Float nodes would generate different values
depending on where they are in the node group hierarchy. This can be useful,
but should definitely not be the default behavior, because it is very inconsistent
with other nodes.
2021-03-22 12:09:06 +01:00
01b6c4b32b Functions: make multi functions smaller and cheaper to construct in many cases
Previously, the signature of a `MultiFunction` was always embedded into the function.
There are two issues with that. First, `MFSignature` is relatively large, because it contains
multiple strings and vectors. Secondly, constructing it can add overhead that should not
be necessary, because often the same signature can be reused.

The solution is to only keep a pointer to a signature in `MultiFunction` that is set during
construction. Child classes are responsible for making sure that the signature lives
long enough. In most cases, the signature is either embedded into the child class or
it is allocated statically (and is only created once).
2021-03-22 12:01:07 +01:00
ccb372d17c Fix regression in bd79691599
The sequencer header needs to be drawn, even if the returned
variables aren't used.
2021-03-22 21:59:55 +11:00
Jeroen Bakker
36fdbed2f0 LibraryOverrides: Initial Test Case.
Added a first test case for review. This will be the base for future test cases.

The current API is sufficient for what is expected for such a low level API.
One concern is that you need to trigger a save in order to update the library overrides
structure. Not expected from TD/Dev point of view.

Test cases are very important when implementing restrictive mode as it is a second evaluation mode that
has impact on the (current) permissive mode.

Reviewed By: Sebastián Barschkis, Bastien Montagne

Differential Revision: https://developer.blender.org/D10747
2021-03-22 11:51:44 +01:00
7a05ebf84b Fix T86405: Always translate when in en_US locale too.
The impact of translations on UI performances is neglectable, and this
gives better handling of some odd cases where original language of an
add-on is not English.
2021-03-22 11:50:15 +01:00
2e213003b8 Cleanup: add comment
See rBb9cd2f4531ca670c196b0b14b1359d0f375103c2 for more info.
2021-03-22 11:35:19 +01:00
Nikhil Shringarpurey
414596cd83 Cleanup, LineArt: Fix MSVC compiler warnings.
Currently 3 of the printf lines use the format specifier "%lu" for data
of type size_t instead of "%zu". While this works, this creates compiler
warnings.

This diff fixes those warnings by using the correct format specifier.
Tested using MSVC, but should be correct on any compliant compiler.

Reviewed By: Sebastian Parborg

Differential Revision: http://developer.blender.org/D10761
2021-03-22 11:30:36 +01:00
a506f87c90 Clang Tidy: disable modernize-raw-string-literal again
This check does not work when gtests are enabled yet.
See rBb9cd2f4531ca670c196b0b14b1359d0f375103c2 for more details.
2021-03-22 11:26:48 +01:00
82d3b0f927 Fix UI (and code!) typos. 2021-03-22 10:56:25 +01:00
14caab7257 Cleanup: check the space type instead of the operators poll function
The poll function may fail for reasons other than the space type,
as this menu is selected based on space-type, check this instead.
2021-03-22 20:12:08 +11:00
a05cbc9914 RNA: rename recently added line-art properties
- Use `use_` prefix for boolean properties.
- Use `_all` instead of `_everything`,
  following existing conventions and the properties UI text.
- Use `object_instances` instead of old term `dupli` / `duplication`.
- Use `clip_plane` instead of `clipping_boundaries`,
  matching the RegionView3D property naming.
2021-03-22 18:09:19 +11:00
958e3a8cc1 RNA: use boolean array for transarency masks
There is no need to expose this as multiple properties,
also use `use_` prefix for boolean properties.
2021-03-22 18:04:12 +11:00
cb521bd37b Cleanup: spelling, expand on comments 2021-03-22 14:48:36 +11:00
f051146ae6 Cleanup: clang-format 2021-03-22 14:39:39 +11:00
dfbaf96753 Revert "Disable clang-format for objective-C bits in GHOST."
This reverts commit 1cb9612d73.

We can now rely on the clang-format version as it's distributed
with pre-compiled binaries.
2021-03-22 14:38:45 +11:00
e6cf74515f Cleanup: disable clang-format for 'intern/libmv/third_party' headers 2021-03-22 14:35:20 +11:00
544b3ab1de Cleanup: clang-format, trailing space
Minor manual tweak to prevent wrapping an array into columns.
2021-03-22 14:25:42 +11:00
2a06657eca Cleanup: Don't use class method to override equality operator
This won't make a difference in this case, but it's consider better
practice since there is no vagueness about implicit conversion.
2021-03-21 20:21:05 -04:00
54bbaa26de Cleanup: compile errors on macos 2021-03-21 19:49:29 +01:00
4fe8d0419c Functions: refactor virtual array data structures
When a function is executed for many elements (e.g. per point) it is often the case
that some parameters are different for every element and other parameters are
the same (there are some more less common cases). To simplify writing such
functions one can use a "virtual array". This is a data structure that has a value
for every index, but might not be stored as an actual array internally. Instead, it
might be just a single value or is computed on the fly. There are various tradeoffs
involved when using this data structure which are mentioned in `BLI_virtual_array.hh`.
It is called "virtual", because it uses inheritance and virtual methods.

Furthermore, there is a new virtual vector array data structure, which is an array
of vectors. Both these types have corresponding generic variants, which can be used
when the data type is not known at compile time. This is typically the case when
building a somewhat generic execution system. The function system used these virtual
data structures before, but now they are more versatile.

I've done this refactor in preparation for the attribute processor and other features of
geometry nodes. I moved the typed virtual arrays to blenlib, so that they can be used
independent of the function system.

One open question for me is whether all the generic data structures (and `CPPType`)
should be moved to blenlib as well. They are well isolated and don't really contain
any business logic. That can be done later if necessary.
2021-03-21 19:33:13 +01:00
68c31c41e5 UI: Title case for Proxy Setup and fix typo 2021-03-21 18:40:38 +01:00
2ddbb2c64f Functions: move CPPType creation related code to separate header
This does not need to be included everywhere, because it is only
needed in very few translation units that actually define CPPType's.
2021-03-21 15:33:30 +01:00
9e437aabdb Cleanup: fix compiling with older compiler on macos
We cannot use `std::variant` yet, because not all of the compilers
we support have a working version of it yet. For now, I just replaced
it with multiple `std::option` which is good enough, because currently
`CellValue` is only used for the cells that are actually drawn in
the spreadsheet.
2021-03-21 14:29:26 +01:00
dcf1a1045d Cleanup: move some headers from MOD_lineart.h to source files 2021-03-21 14:51:37 +11:00
b8cc8b30ec Cleanup: redundant headers in 'source/blender/gpencil_modifiers' 2021-03-21 14:30:08 +11:00
9c0eb1700e Cleanup: correct variable name mixup in BLI_str_quoted_substrN
Also expand doc-string for `BLI_str_escape_find_quote`
2021-03-21 14:22:14 +11:00
dfefafa814 Fix uninitialized memory use loading movie sequence strips
When the movie wasn't found, uninitialized values would be used for
the original width/height.

Also use int instead of float as the image size is stored as an int.
2021-03-21 14:12:58 +11:00
fce3e6646e Fix failure to set transform rotate around single
Regression in 201ab7c540
2021-03-21 14:01:41 +11:00
87b6283918 Cleanup: remove redundant NULL checks 2021-03-21 14:00:40 +11:00
bf13a4d3ff Cleanup: unused return statements 2021-03-21 14:00:40 +11:00
6d97f9a5c1 Cleanup: use static local variables 2021-03-21 14:00:40 +11:00
4abafa2062 Cleanup: remove window manager headers from MOD_lineart
This was only used to return success, which is currently never checked.
2021-03-21 13:47:05 +11:00
dcd9945ebe Cleanup: replace 'unsigned char' with 'uchar' 2021-03-21 13:25:31 +11:00
31e7bc6869 Cleanup: remove redundant casts 2021-03-21 13:24:42 +11:00
6db1fb197c Cleanup: spelling, doxygen comment formatting 2021-03-21 13:18:20 +11:00
b4e96550ce Fix T86643: Win32 Entering Full Screen While Maximized
SetWindowPos must be called after SetWindowLongPtr in order to see changes to window frame style.

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

Reviewed by Ray Molenkamp
2021-03-20 17:24:06 -07:00
9ca67c47a1 Fix T86660 EEVEE: Undefined behaviour in specular_occlusion
Define visibility error to be 1 by default to avoid undefined behaviour.
2021-03-20 22:00:08 +01:00
057292e75a Bevel code: add a null pointer check. 2021-03-20 13:03:43 -04:00
90959c2372 Cleanup: quiet warning 2021-03-20 15:54:52 +01:00
98721c8543 BLI: improve support for generic algorithms with c++ containers
Some generic algorithms from the standard library like `std::any_of`
did not work with all container and iterator types. To improve the
situation, this patch adds various type members to containers
and iterators.

Custom iterators for Set, Map and IndexRange now have an iterator
category, which soe algorithms require. IndexRange could become
a random access iterator, but adding all the missing methods can
be done when it is necessary.
2021-03-20 15:42:35 +01:00
59d3ec1eef Cleanup: quiet warning 2021-03-20 15:38:17 +01:00
56da5ae2ac LineArt: Fix blank baking for when source type is object. 2021-03-20 14:07:51 +01:00
b19bd3692d Fix T86746: Description missing from Quick Liquid
The description was missing from the Quick Liquid operator.

The fix adds the following description:
"Make selected objects liquid"

Reviewed By: sebbas

Maniphest Tasks: T86746

Differential Revision: https://developer.blender.org/D10777
2021-03-20 13:44:36 +01:00
95a2549d90 Fix T86745: trace sequence keyframe offset
The offset when creating the keyframes was set to `frame_target + i` but
`i` starts iterating from the current frame number.

The fix uses just `i` as the frame number.

Reviewed By: antoniov

Maniphest Tasks: T86745

Differential Revision: https://developer.blender.org/D10772
2021-03-20 13:43:00 +01:00
d0f05bfbcd LineArt: Fixed source selection for nested-instanced collection. 2021-03-20 12:36:35 +01:00
3d5239ff40 Fix T86730: LineArt: keep contour when there's perpendicular faces. 2021-03-20 12:36:27 +01:00
d5a705873e Join curves: compensate for different bevel depths
When joining curves, the resulting curve will inherit the bevel depth of
the active curve, but the radii would stay the same which leads to
changed appearance when joining.

Now compensate for this taking the different bevel depths into account
(if present).

Was a feature request here (and I also think we had reports about this
-- which were usually turned down as not-a-bug):
https://blender.community/c/rightclickselect/bhhbbc/

Differential Revision: https://developer.blender.org/D10752
2021-03-20 08:14:49 +01:00
f65a3172a8 Fix issues introduced strip loading refactoring
- Adding effect strip resulted in strip with no name
 - Adding sound strip attempted to read `fit_method` RNA property,
   that did not exist, causing error messages in console

These issues were introduced in bbb1936411.
2021-03-20 01:53:03 +01:00
3433d1b7f4 Fix T86355: Added effect strip has wrong length
SEQ_add_effect_strip used SeqLoadData.image.end_frame to set end
frame. This was mistake introduced in last refactoring patch.

Use effect data, not image data, when adding effect strips.

Reviewed By: sergey

Differential Revision: D10633
2021-03-20 01:40:53 +01:00
c81dfa2426 Fix T85824: Transition between adjustment regression
When transition effect is placed between 2 adjustment layer strips,
only first adjustment layer was rendered by effect.

Limit timeline_frame range to adjustment strip frame range.

This timeline configuration is technically invalid, because strips
should overlap when using transition effect. This was never restricted
and instead of producing no image, transition effect used first and
last frame of source strip. Many users got used to this "feature" so
I think it make sense to fix this case so it behaves like other strip
types.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D10562
2021-03-20 01:40:53 +01:00
Peter Fog
8b3f5f755e VSE UI: Cleanup scene panel style
- Make properties alligned
 - Add decorate to volume
 - Add heading to Grease Pencil and Transparent

Reviewed By: ISS

Differential Revision: https://developer.blender.org/D10663
2021-03-20 01:40:53 +01:00
Peter Fog
3d9ee83d88 VSE: Preview images when moving strip handles
Add option to override current frame whem transforming strip handles.
Option can be found in View menu of VSE preview, or in timeline when
using backdrop.

Reviewed By: ISS

Differential Revision: https://developer.blender.org/D10424
2021-03-20 01:40:53 +01:00
Peter Fog
1c095203c2 VSE: Text strip improvements
- Position text in center of image
 - Increase default font size so it's more visible
 - Increase font size limit
 - Increase limit for location, so text can be scolled off screen
 - Wrap text by default
 - Tweak default box and shadow color
 - Change text shadow position
 - Text box no longer casts shadow

Reviewed By: ISS

Differential Revision: https://developer.blender.org/D10571
2021-03-20 01:40:53 +01:00
Peter Fog
913b71bb8b VSE: Add bold and italic option for text strip
Bold and italic fonts can be switched quickly by presing corresponding
button.

Reviewed By: ISS

Differential Revision: https://developer.blender.org/D10542
2021-03-20 01:40:53 +01:00
Eitan
7bf977e9f0 Fix T54395: Original image size set incorrectly
`SequenceElement` type `orig_height` and `orig_width` members were
set to incorrect size when using proxies and not set when strip was
added which caused value to be unset.

Since now image dimensions must be read when strip is created,
these members can be initialized. When proxies are used, do not set
original size since it is not guaranteed, that proxies are exact size.

These values are not guaranteed to be up to date or exact. They should
be used for strictly informative purposes.

Reviewed By: ISS

Differential Revision: https://developer.blender.org/D6506
2021-03-20 01:40:53 +01:00
Félix
bfad8deb0b VSE: Add new_meta RNA API function
This function can be used to create empty meta strip, which is not
straightforward when using operators. Very useful for import/export
scripts.

Reviewed By: ISS

Differential Revision: https://developer.blender.org/D10661
2021-03-20 01:40:53 +01:00
Félix
4158405c0b VSE: Add move_to_meta RNA API function
This function can be used to move strips into meta strips with no
side effects like change of selection state.

Reviewed By: ISS

Differential Revision: https://developer.blender.org/D10759
2021-03-20 01:40:53 +01:00
01f028a677 Theme: Use curved noodles in the nodes editor.
Curved noodles increase readability especially in nodes with multiple input sockets.
2021-03-20 01:12:49 +01:00
3494946560 Nodes: implement dot graph exporter for derived node tree
This visualization of nested node groups makes it easier to debug
some issues. Muted nodes, muted links, reroute nodes and unavailable
sockets are removed from the visualization to keep it clean.

Nested node groups are visualized using colored clusters.
2021-03-19 22:37:48 +01:00
087f8a78f8 Nodes: expose tree name and whether a node is a frame in node tree ref 2021-03-19 22:33:43 +01:00
2dd055b2d4 Geometry Nodes: fix crash when inserting certain invalid links
For example, it would crash when connecting a float to a geometry socket,
under some circumstances.
2021-03-19 22:26:55 +01:00
250a69ee82 Fix T86728: Blender freezes when playhead is dragged in this .blend
Porting the deadlock bugfix in WASAPI from upstream Audaspace.
2021-03-19 21:42:55 +01:00
00215692d1 Nodes: make distinction between directly and logically linked sockets more clear
This also moves the handling of muted nodes from derived node tree to
node tree ref.
2021-03-19 21:13:10 +01:00
48731f45c2 Nodes: provide access to type specific data through node tree ref 2021-03-19 21:13:10 +01:00
b96acd0663 EEVEE: Volumetrics: Add back support for light clamp
The new clamping works by modifying the lamp internal radius which
then soften the light contribution.

However this does remove more light compare to the old solution.
This is because the clamp now affects the light over a much larger
distance since it is smoother. Old scene needs manual tweaking.
2021-03-19 21:11:06 +01:00
89ef0da551 EEVEE: Volumetrics: Add support for soft volumetric shadows
Soft surface shadows were already supported but now we support
soft shadows of the volume themselves.

This is only enabled if the light casts shadow and the scene soft
shadows toggle is enabled.
2021-03-19 21:11:06 +01:00
355f884b2f EEVEE: Volumetrics: Add Area light shape support
Previously area lights were just considered as point lights.
We now use a "most representative point" technique that make the
light shape appearant and gives more homogenous result.

This technique is quite cheap but it is not physically correct.

So I came up with a power function to have almost the same intensity
output as cycles in the general case.
2021-03-19 21:11:06 +01:00
0a0f737f91 EEVEE: Volumetrics: Add special attenuation volume for lights
This makes volume lights more efficient if they have lower power.
2021-03-19 21:11:06 +01:00
54f52cac7c EEVEE: Volumetrics: Fix sun volumetric shadow
Sun lights are treated as distant light source and need to gather
shadowing from the full frustum.

This might have performance impact on certain scenes.
2021-03-19 21:11:06 +01:00
884f934a85 EEVEE: Lights: Add Volume and diffuse light power slider
This adds 2 new sliders for light objects that modulates the diffuse
light and the volume light intensities.

This also changes the way volume light is computed using point lamp
representation. We use "Point Light Attenuation Without Singularity"
from Cem Yuksel instead of the usual inverse square law.
2021-03-19 21:11:06 +01:00
fb3e5b7f98 LineArt: Add missing modifer and sanity checks to bake operator
Previously we could crash because we would not check if the modifier in
question actually was a line art modifier. We also did not query if the
modifier was disabled.
2021-03-19 21:02:21 +01:00
17a5db7303 Geometry Nodes: Add geometry instances data to the spreadsheet
This patch adds data about instances generated by geometry nodes
to the spreadsheet. The transform data is decomposed into position,
rotation, and scale, and there is a name column to display the name
of the instanced object or collection.

This data is implemented specifically for the spreadsheet, because
we're not sure that we want to expose this data as attributes for the
use elsewhere.

Differential Revision: https://developer.blender.org/D10770
2021-03-19 15:30:41 -04:00
9de8c2fa18 BLI: Add accessors for translation, rotation, and scale of float4x4 2021-03-19 15:28:58 -04:00
dd7feb09c9 Cleanup: rename x1/x2/y1/y2 to x/y/width/height 2021-03-19 20:24:56 +01:00
9b806c49d0 Geometry Nodes: Refactor / fix point separate node
The point separate node was failing in situations where one of the
outputs was empty. In addition, the code was not structured very well.
This new implementation stores less temporary information, is more
geometry component type agnostic, and is more self-descriptive.
It also solves the problems mentioned above.

Fixes T86573

Differential Revision: https://developer.blender.org/D10764
2021-03-19 15:09:17 -04:00
a6ab232f8a LineArt: Added back the missing "allow_clipping_boundaries" option.
This option was missing from the UI.
Also add missing camera settings depsgraph relation.
2021-03-19 18:56:26 +01:00
cff4445a86 LineArt: Modifier defaults settings optimization.
Make options that are usually only useful in edge cases off by default.
These settings would requite extra work and thus the modifier evaluation
would be needlessly slower as most users do not need these options to be
on.
2021-03-19 18:31:03 +01:00
3420c3d8c6 LineArt: Remove geometry space chaining
It caused some chaining errors when used in combination with image space
chaining. After some internal discussion, we realized it is not
useful as chaining in image space essentially does the same thing.
2021-03-19 18:26:33 +01:00
a00249dd22 LibOverride: Stash away 'leftover' objects/collections from auto-resync process.
Instead of storing those in scne's master collection, which is fairly
annoying, we now add them to a (hidden) specific collection. Easy to
ignore, or check and cleanup.
2021-03-19 17:33:08 +01:00
a9e64d8613 Cleanup: Use uint8_t for num of channels. 2021-03-19 17:11:47 +01:00
b9d2e2ec97 Cleanup: Use enum class for MemoryBufferExtend. 2021-03-19 17:11:47 +01:00
9f86933f2e Cleanup: Remove unused states and vars from MemoryBuffer. 2021-03-19 17:11:47 +01:00
31d5c5078c Cleanup: MemoryBuffer do not store width and height. 2021-03-19 17:11:47 +01:00
8cb1089795 Cleanup: Rename copyContentFrom to fill_from. 2021-03-19 17:11:47 +01:00
dc9aea9903 Cleanup: Add copy constructor to MemoryBuffer. 2021-03-19 17:11:47 +01:00
260e50ed82 Cleanup: Use ref to read from encapsuled data.
MemoryBuffer->getRect was returning a ptr.
2021-03-19 17:11:47 +01:00
c905dd24b6 Cleanup: Replace ptr with ref (COM_MemoryBuffer). 2021-03-19 17:11:47 +01:00
b9447ab053 Cleanup: Replace ptr with ref. 2021-03-19 17:11:47 +01:00
e5ffefe606 Cleanup: Use enum class for DataType. 2021-03-19 17:11:47 +01:00
b5f70d92c2 Cleanup: enum class ChunkOrdering. 2021-03-19 17:11:47 +01:00
9c2d4ffbc1 Cleanup: Use enum class for CompositorQuality. 2021-03-19 17:11:47 +01:00
de504e6dec Cleanup: Use enum class for CompositorPriority. 2021-03-19 17:11:47 +01:00
50c5435438 Cleanup: compositor - chunk order
No functional changes.
2021-03-19 17:11:47 +01:00
18b87e2e0b Cleanup: Remove unneeded complexity
`determineDependingMemoryProxies` was mapping a value in a temp vector.
2021-03-19 17:11:47 +01:00
eb7a601e1b Geometry Nodes: Make cone primitive 2m tall by default
This gives the cone mesh primitive more pleasing proportions by default.
2021-03-19 11:22:39 -04:00
dbe45073d2 Geometry Nodes: Move cone primtive to rest on its base by default
This is generally what people expect when generating a cone. Note that
this translation currently happens after the rotation, but since the rotation
will likely be removed in the future, that won't be a problem for long.
2021-03-19 11:21:24 -04:00
97b83b6a67 Geometry Nodes: Implicit interpolations to and from the edge domain
This patch adds the remaining 6 interpolations for mesh domains.
The new interpolations are:
 - Corner / point / polygon to edge
 - Edge to corner / point / polygon

After this it is possible to adapt an attribute to and from every
mesh domain. This is simple to test with the "Attribute Convert" node.

Though, as a note for the future, there are still some improvements
possible to the interpolations, like lazily calculating values for the
interpolations where it's possible, and slightly improving the
algorithms used for some interpolations, like using corner angles
for polygon to point.

Differential Revision: https://developer.blender.org/D10765
2021-03-19 08:59:56 -04:00
a7f4270748 Fix Cycles NaN assert in random walk SSS due to very small throughput
Now terminate if there are many bounces and the throughput gets so small
that we get precision issues.
2021-03-19 13:20:42 +01:00
d235f6a48e LibOverride: fix code trying to auto-resync linked overrides.
This is not only potentially extremely expensive, it is also fairly
futile, and code is not designed to handle it currently anyway (could
easily end up in inifinite loops and other crashes).
2021-03-19 12:24:53 +01:00
Angus Stanton
ae650b016f Fix T86208: copy node group button is inconsistent in geometry nodes
Differential Revision: https://developer.blender.org/D10740
2021-03-19 11:24:27 +01:00
de296e8429 Cleanup: add const. 2021-03-19 08:18:00 +01:00
ef944b5020 Cleanup: Replace std::vector with blender::Vector. 2021-03-19 08:11:11 +01:00
64a413b0c7 Fix T86710: Crash When Adding Node Group.
When adding a node group there can be no inputs in the input map that
was triggering an assert.
2021-03-19 08:04:30 +01:00
a7455ae5f8 Cleanup: remove unused function 2021-03-19 16:23:52 +11:00
74609bfd51 Cleanup: minor changes to pose-mode apply visual transform
- Remove use of evaluated poses, instead calculate transformations
  into an array which is applied afterwards.

- Only update ID's for poses that have been changed.
2021-03-19 15:33:43 +11:00
36deb8a48e BLI: Add location, rotation, scale constructor to float4x4
This is simply a convenience when using this type. More similar
constructors can be added in the future when they are useful.

Differential Revision: https://developer.blender.org/D10714
2021-03-18 17:29:39 -04:00
Patrick Busch
fc62d38ce1 Python API: Expose CurveProfile Reset View function
Allow python access to the `reset_view` functionality which before
was only available through the menu. This was suggested for
consistency after D10561.

Differential Revision: https://developer.blender.org/D10595
2021-03-18 17:25:36 -04:00
Pratik Borhade
7e3efac9a8 Fix T86701: Geometry nodes Cube and UV Sphere mesh size
The size in the transform matrices was extra, since it is also
passed as an argument to the BMesh operators.

Differential Revision: https://developer.blender.org/D10763
2021-03-18 17:00:47 -04:00
894e8b18e4 Geometry Nodes: Don't create empty components when realizing instances
Previously even if the input goemetry set had no point cloud or no mesh
instances, `geometry_set_realize_instances` would create empty data.
This isn't necessarily bad, but it can complicate things down the line if
there are a bunch of empty components getting passed around.
2021-03-18 16:32:49 -04:00
b1150fa1f5 Fix T86448 EEVEE: SSRefraction Depth regression
Caused by recent change for contact shadow raytracing. rB4e236326c137
2021-03-18 18:07:46 +01:00
51c7ff9222 GPencil: Rename Options panel to Settings
This change is to keep consistency with other panels with the same functionality.

Reviewed by @pablovazquez
2021-03-18 17:24:20 +01:00
1e1d96f0a8 Fix T86677: select grouped in node editor crashes without active node
This was reported for geometry nodes, but was true for all nodetrees
(e.g. after deleting the active node). Geometry node trees just made
this more obvious since they start without an active node to begin with.

Fix provided by @lone_noel, thx!

Maniphest Tasks: T86677

Differential Revision: https://developer.blender.org/D10762
2021-03-18 17:15:42 +01:00
cddfd11581 Fix T86548: Sculpt: Mask by Color tool not working
Caused by {rB2917f550caa9} which renamed the entry in the toolsystem,
but not the corresponding keymap.

Maniphest Tasks: T86548

Differential Revision: https://developer.blender.org/D10725
2021-03-18 17:10:50 +01:00
1919b104d3 LibOverride: Fix missing update after an override reset.
We need to brute-force reset IDs with `ID_RECALC_ALL` here...
2021-03-18 15:59:18 +01:00
59f92a218a LibOverride: Outliner: Rename Add... to Make....
Also more consistent with the name used for the 3DView operator.
2021-03-18 15:59:18 +01:00
07f9a73a8f Fix 3DView not updating on some NC_ID notifiers.
Outliner uses a lot `NC_ID | NA_EDITED` e.g., which was not caught by
the View3D editor for update.
2021-03-18 15:59:18 +01:00
06351c0504 LibOverride: Outliner: Tweak override creation from instancing empty.
Now behavior is similar to the one from 3DView: once override of the
collection is successfuly created, we remove the instancing empty from
the scene.
2021-03-18 15:59:18 +01:00
7ee365d8c7 Fix missing view3d updates after recent NC_SPACE notifier filters
Since {rB46aa70cb486d}, using `NC_SPACE | ND_SPACE_VIEW3D` as notifier is
restricted to space data as a reference. This was still used though for
RNA updates in other places (namely `rna_camera`, `rna_scene`,
`rna_animviz`), and passing NULL would automatically set the notifier
reference to the owner id. Above commit would happily filter these out,
leading to missing refreshes.

Now use more specific notifiers (in case of animviz a new
`ND_DRAW_ANIMVIZ` was added).

This was reported for Camera background images btw.
Fixes T86670.

Maniphest Tasks: T86670

Differential Revision: https://developer.blender.org/D10758
2021-03-18 15:23:23 +01:00
2dd040a349 UI: Dynamically increase data-block name button size if there's space
Data-block selectors (or other selectors using the
`UILayout.teamplate_search` or `UILayout.template_search_preview`)
in headers used a fixed size width for the name button. Often that meant
the text would be clipped to fit even though there was plenty of
whitespace surrounding the data-block selector.

Now the name button can increase in width with the contained string,
clamped to some arbitrary and quite big maximum (3 times the minimum
width).
We could further take the available space into account, to reduce the
need for scrolling in the header. But I don't think that is much of an
issue and the name clipping it would re-introduce would probably be more
annoying.
2021-03-18 15:09:31 +01:00
248d9809ca Fix T86594: Overrides: Possible collection "duplication".
Issue was actually in some Collection management code, a bit too eager
to add collection to the scene master one when it was not actually
needed.
2021-03-18 14:26:29 +01:00
f75d690ee4 LineArt: Add missing dna variable rename
Forgot to add this in: "Cleanup, LineArt: Rename LineartLine -> LineartEdge"
df28063795
2021-03-18 14:21:18 +01:00
6f7e632a6f Cleanup, LineArt: Sample -> Resample
Clear up what sample length does by renaming the option and variables.
2021-03-18 13:20:44 +01:00
3f0cd3fcc1 Cleanup: Remove unused variable in gpencil_add_lineart.c 2021-03-18 13:16:00 +01:00
1b05948e4d LineArt: Expose the allow_duplication property for instanced objects.
It was missing from the UI.
2021-03-18 13:13:08 +01:00
d39a1e3cab Fix T86692: Start Line Art GP objects on frame 0
If playback starts before the first GP frame, we will get "ghost"
strokes.
2021-03-18 12:50:55 +01:00
c114c78f57 LineArt: Do not calculate lines for objects not included
Only use non included objects for potential occlusion queries.
Don't calculate lines for them.

This fixes intersection lines appearing on objects not included by the
lineart modifier.
2021-03-18 12:42:41 +01:00
df28063795 Cleanup, LineArt: Rename LineartLine -> LineartEdge
Also cleanup various other "line" variable names
2021-03-18 12:41:44 +01:00
d7fb38ddd4 GPencil: Fix unreported datablock type changed using Dopesheet box select
When doing a box selection in the dopesheet in the header area, the data block type was changed to annotation because the pointer was not usable and produced an unexpected result.

Thanks to @pullup for finding a way to reproduce the bug.
2021-03-18 12:37:00 +01:00
8ab52daa3a BLO: Functions for temporarily loading a single datablock
This introduces two functions to the blenloader module, here shown as
calls for brevity:

* `temp_lib_ctx = BLO_library_temp_load_id(real_main, blend_file_path, idcode, idname, reports);`
* Now the data in `temp_lib_ctx->temp_id` can be used (but ought not to
  be not assigned to non-temp datablocks).
* `BLO_library_temp_free(temp_lib_ctx);`

The first loads a datablock from a blend file, and returns it as part of
a `struct TempLibraryContext`. This struct contains the temp-loaded ID,
as well as enough information to correctly free everything again.

Differential Revision: https://developer.blender.org/D10736
2021-03-18 11:09:15 +01:00
aeff59073b Fix T86219: Compositor backdrop not using Color Management View
Transforms in certain cases

This was caused by wrong flag checking in {rB278011e44d43}, which just
seems to be a copy-paste error.

For example, enabeling 'Auto-Offset' in the View menu would lead to CM
being ignored.

Maniphest Tasks: T86219

Differential Revision: https://developer.blender.org/D10751
2021-03-18 09:16:58 +01:00
decfd5c169 Cleanup: use doxy sections for pose_transform.c 2021-03-18 13:55:32 +11:00
30b5fd1a3c Cleanup: remove MJPEG reference from error message
Proxy coded has been changed to h264. Error code is more generic now.
2021-03-18 00:14:41 +01:00
bb6765f28f Cleanup: spelling 2021-03-18 09:36:44 +11:00
0c58ad8a34 Cleanup: remove unused common_restrict_check function
Since c10ad8e9ea hiding edit-mode objects
is supported.

Although this function had already been removed in
aeb8e81f27.
2021-03-18 09:06:56 +11:00
de6d6e171e Cleanup: Remove commented code
Mistake in earlier commit rBbe33d3eccdcdf252. Also use const and
set layouts disabled when the line art is baked.
2021-03-17 14:54:30 -04:00
a41d3c0ebe Geometry Nodes: Rename "Subdivide Smooth" back to "Subdivision Surface"
Following concerns raised in the commit that changed the name initially,
rB2e19509e60b39837, it makes more sense to keep the "Surface" name for
this node because it has a specific meaning that should not be confused
with other types of subdivision.
2021-03-17 14:40:38 -04:00
1cc427ce2b Geometry Nodes: Use consistent default for cylinder node
- Use 2m height instead of 1m
 - Default to N-Gon fill for the top and bottom
2021-03-17 14:17:52 -04:00
be33d3eccd UI: Tweak labels, descriptions, and panel layout for line art
Changes include:
 - Use `IFACE_` for UI labels set in the modifier panels
 - Use a sub-sub-panel for transparency
 - Fix grammar and spelling mistakes
 - Use more natural user-friendly wording
 - Make descriptions more specific and more useful
 - Don't capitalize "line art" in descriptions (tooltips)

These changes are aimed at making the UI strings more consistent with
the rest of the UI and being more helpful to someone trying to understand
how to use the modifier.

Differential Revision: https://developer.blender.org/D10750
2021-03-17 13:46:41 -04:00
0ff3f96a1b Nodes: make derived link data more obvious in NodeTreeRef
`NodeTreeRef` is a thin wrapper on top of `bNodeTree`. By default it
should not hide anything from the underlying `bNodeTree` (before this
it was hiding muted links).

For convenience some "derived" data is cached on sockets. For example
all the connected sockets when reroutes and muted links are ignored.

A nice side benefit of this refactor is that `NodeTreeRef` requires
less memory than before.
2021-03-17 16:43:54 +01:00
e9eb08fea1 BLI: support equality operator on Span and Vector
This is quite convenient sometimes and is available for `std::vector` as well.
2021-03-17 16:38:49 +01:00
bf620020f1 BLI: improve implicit conversions of spans
Some conversions that should work did not work before.
For example, `MutableSpan<int *> -> MutableSpan<const int *>`.
2021-03-17 15:27:31 +01:00
256da1c4b9 LineArt: Fix transparenct mask in cutting function. 2021-03-17 15:24:26 +01:00
0bae3002cf LineArt: Fix transparency flag error during cutting and chaining. 2021-03-17 15:23:48 +01:00
7f769567d0 LineArt: Remove "Render" in structure names. 2021-03-17 15:23:20 +01:00
0f1482279c LineArt: better explaination in lineart_line_cut() 2021-03-17 15:21:12 +01:00
4de7dc42c9 UI: Correct icon and description for "Object Line Art"
The icon should be the same as other object icons rather than "Cube",
and the description was just the collection description copy and pasted.
2021-03-17 08:51:59 -04:00
9cf25b9c44 Cleanup: Reduce variable scope 2021-03-17 13:01:30 +01:00
296984b40e Modify Dopesheet block between keyframes
This makes more visible where ends each keyframe. To use, as we did before, full block sometimes looks hard to view where a keyframe ends.

Reviewed By: pepeland, mendio, Severin

Differential Revision: https://developer.blender.org/D10588
2021-03-17 12:57:44 +01:00
Charlie Jolly
266cd7bb82 Nodes: Add support to mute node wires
This patch adds the ability to mute individual wires in the node editor.
This is invoked like the cut links operator but with a new shortcut.

Mute = Ctrl + Alt
Cut = Ctrl

Dragging over wires will toggle the mute state for that wire.
The muted wires are drawn in red with a bar across the center.
Red is used in the nodes context to indicate invalid links, muted links and internal links.

When a wire is muted it exposes the original node buttons which are normally hidden when a wire is connected.

Downstream and upstream links connected using reroute nodes are also muted.

Outside scope of patch:
- Add support for pynodes e.g. Animation Nodes
- Requires minor change to check for muted links using the `is_muted` link property or the `is_linked` socket property.

Maniphest Tasks: T52659

Differential Revision: https://developer.blender.org/D2807
2021-03-17 11:54:16 +00:00
20bf736ff8 Fix T86645: Executing "Operator Cheat Sheet" Crashes Blender
The "Operator Cheat Sheet" operator collects info about all operators, and as
part of that executes the callbacks to create dynamic enums. The callback to
enumerate the Outliner ID operations depends on Outliner context. If this isn't
available, it can just return a context-less version of the enum, that is, a
static enum with all available items. This was already done in case no context
is available at all.
2021-03-17 12:51:27 +01:00
Wannes Malfait
2a4bde04c5 Fix T86655: remove doubled transforms
Differential Revision: https://developer.blender.org/D10744
2021-03-17 12:23:17 +01:00
1185708911 Cleanup: clang format 2021-03-17 12:18:35 +01:00
3157c3680b Cleanup: remove unnecessary namespace specifiers 2021-03-17 11:52:02 +01:00
633f1cdec9 Cleanup: improve gathering supported domains by geometry type 2021-03-17 11:52:02 +01:00
e6bdd57191 Fix T86609: GPencil: Sculpt brush cursor disappears on undo.
Regression from rB2a8122fb65c5, somehow that piece of code was lost
during the refactor.
2021-03-17 11:38:31 +01:00
ac60e64745 BLI: provide a default hash for enums
This avoids some boilerplate code that was necessary when using enums
as keys in maps or sets.
2021-03-17 11:37:46 +01:00
e00a47ffd6 Geometry Nodes: store domain and data type in attribute hints
The information is not exposed in the attribute search yet.
2021-03-17 11:15:39 +01:00
e91dd645a9 Fix concern: lookup could fail.
Concern raised on {93e2491ee724}.
2021-03-17 09:18:39 +01:00
187f358f33 Cleanup: Use blender::MultiValueMap.
Fixed concern raise on {93e2491ee724}.
2021-03-17 09:14:38 +01:00
97defd9cd7 Cryptomatte: Show Name of Object/Material Under The Cursor.
This change shows the object or material name with the cursor when picking for a cryptomatte node.

Reviewed By: Julian Eisel

Differential Revision: https://developer.blender.org/D10705
2021-03-17 08:59:04 +01:00
f4639276ee Fix outliner multi-object edit-armature operations
Recursive restrict selection (hide/selectable flag) & renaming
edit-bones both used the active object, even when bones for another
non-active object were being operated on.

Bone renaming would rename a bone in the active object
(if that name exists).
2021-03-17 17:19:41 +11:00
d512fe441b Comments: document memory management for BPyPropStore 2021-03-17 15:27:37 +11:00
277e9b4355 PyAPI: use union to store pointer poll callback
Reduces `BPyPropStore` size by one pointer.
2021-03-17 15:15:16 +11:00
e8f6c65b44 UI: Rename Init to Initialize Face Sets in menu
Reviewed By: HooglyBoogly

Differential Revision: https://developer.blender.org/D10741
2021-03-17 02:43:46 +01:00
96abe8a3e8 Add versioning code removed in 91561629cd
rB91561629cd0b removed the versioning code added in rBb617b4441961
for the spreadsheet status bar. This commit simply adds it back.
2021-03-16 21:27:32 -04:00
de06cb8559 Bugfix: properly rename Null audio device to None 2021-03-16 23:45:49 +01:00
12c08ceee3 Audaspace: add support for CoreAudio on macOS
This adds CoreAudio as audio backend on macOS.
CoreAudio is the standard audio API on macOS.

Ref T86590
2021-03-16 23:21:45 +01:00
bc57985306 Audaspace: add support for WASAPI on Windows
This adds WASAPI as audio backend on Windows.
WASAPI is the modern standard audio API on
Windows introduced with Windows Vista.

Ref T86590
2021-03-16 23:21:45 +01:00
d33339ebf4 Audaspace: add support for PulseAudio on Linux
This adds PulseAudio as audio backend on Linux.
PulseAudio is the main audio engine used on most,
if not all, Linux distributions today.

Ref T86590
2021-03-16 23:21:45 +01:00
7b8fc307dc Audaspace: porting minor improvements from upstream
- NullDevice is now called None
- Automatic choice of best available device.
- Minor formatting, documentation and cmake fixes.
2021-03-16 23:21:45 +01:00
262a098846 Fix issues with automatic proxy building
After merging patches and resolving conflicts, typo prevented correct operation.
This uncovered crash on NULL dereference as well.
2021-03-16 23:18:21 +01:00
9a56a3865c Geometry Nodes: Add initial version of mesh primitives
This commit includes nodes to build the following primitives:
 - Cone
 - Cylinder
 - Circle
 - Cube
 - UV Sphere
 - Ico Sphere
 - Line
 - Plane/Grid

In general the inputs are the same as the corresponding operators
in the 3D view.

**Line Primitive**
The line primitive has two modes-- adding vertices between two end
points, or adding vertices each at an offset from the start point.
For the former mode, there is a choice between a vertex count
and a distance between each point.

**Plane Primitive**
This commit includes the "Plane" and "Grid" primitives as one node.
Generally primitives are named after the simpler form of the shape they
create (i.e. "Cone" can make some more complex shapes). Also, generally
you want to tweak the number of subdivisions anyway, so defaulting to
plane is not an inconvenience. And generally having fewer redundant
base primitives is better.

**Future Improvements**
A following patch proposes to improve the speed of the cylinder, cone,
and sphere primitives: D10730. Additional possible future improvements
would be adding subdivisions to the cube node and rings to the cone
and cylinder nodes.

Differential Revision: https://developer.blender.org/D10715
2021-03-16 17:35:36 -04:00
3e87d8a431 Grease Pencil: Add LineArt modifier
This adds the LineArt grease pencil modifier.

It takes objects or collections as input and generates various grease
pencil lines from these objects with the help of the active scene
camera. For example it can generate contour lines, intersection lines
and crease lines to name a few.

This is really useful as artists can then use 3D meshes to automatically
generate grease pencil lines for characters, enviroments or other
visualization purposes.

These lines can then be baked and edited as regular grease pencil lines.

Reviewed By: Sebastian Parborg, Antonio Vazquez, Matias Mendiola

Differential Revision: http://developer.blender.org/D8758
2021-03-16 19:59:09 +01:00
877238e2b7 make_deps: Update blender package mirror URI
Final location in SVN was slightly different
than we were planning on.
2021-03-16 12:42:09 -06:00
Charlie Jolly
e183f2b6a9 Geometry Nodes: Implicit conversion add int to color
Add implicit `int32 to Color4f` conversion. Matches `int32 to float3` conversion logic.

This may not be the most useful conversion but prevents an error in the Attribute Convert node.

Reviewed By: JacquesLucke

Differential Revision: https://developer.blender.org/D10686
2021-03-16 18:14:30 +00:00
Charlie Jolly
f8497caf59 Geometry Nodes: Implicit conversion change from distance to average
Use average instead of distance when converting from float3/float2 to float. This matches behaviour of shader nodes.

See: https://developer.blender.org/T86454

Reviewed By: JacquesLucke

Differential Revision: https://developer.blender.org/D10684
2021-03-16 18:04:41 +00:00
04e1feb830 VSE: Automatic proxy building
Build proxies automatically when added to sequencer timeline and when
switching preview size.

This behavior can be disabled in user preferences.

Reviewed By: sergey, fsiddi

Differential Revision: https://developer.blender.org/D10363
2021-03-16 18:56:44 +01:00
e4f3477833 FFmpeg: Improve proxy building performance
Use h264 codec for output. This codec produces smaller files, can be
multithreaded and decodes even faster than MJPEG.

Quality setting 0-100 corresponds to "Lowest Quality" to
"Perceptually Lossless" in Blender's h264 encoding presets.

All available cores are used for decoding.
Same goes for decoding but only for codecs that supports this
(h264, vp9 seems to support this option out of th box as well).
Other decoders can probably be optimized in similar way, but threaded
encoding provides significant boost already.

I have tested variety of codecs, and all were transcoded properly.

Reviewed By: sergey, fsiddi

Differential Revision: https://developer.blender.org/D10731
2021-03-16 18:50:32 +01:00
91561629cd VSE: Simplify proxy settings
- Remove Full Render size from VSE preview size. Use just 100% instead.
- Add Use Proxies checkbox to control whether proxies are used globally
- Move preview size to top so it is most prominent
- Set default to 100% preview size and use proxies

Reviewed By: sergey, fsiddi

Differential Revision: https://developer.blender.org/D10362
2021-03-16 18:50:32 +01:00
0449da5460 Outliner: Refactor: Move overrides tree items to new CPP code.
Fairly straight forwards.

Also fixes the bug from recent refactor that would not show overrides as
a tree, but as a flat list directly under IDs.
2021-03-16 18:35:53 +01:00
Matias Mendiola
15a4ed3aff Dopesheet Context Menu updates
Dopesheet context menu rearranging to include proper operators for Grease Pencil submode

Before:
{F9828095}

After:
{F9828096}

Reviewed By: antoniov, pablovazquez

Differential Revision: https://developer.blender.org/D10502
2021-03-16 17:26:44 +01:00
21236af80c Libraries: Fix deps build on macOS arm64
Minor adjustments that were missing when D10598 landed.
2021-03-16 17:08:48 +01:00
970e246ccc CMake/deps: Updated deps build requirements prompt for macOS arm64
Building deps on macOS arm64 has slightly different requirements.
Belongs to 4b3dcd8069
2021-03-16 17:08:48 +01:00
5ac47cded1 LibOverride: Resync: Fix most remaining 'overrides in master collection' issues.
Problem is, when a collection is excluded from the scene, none of its
objects are technically instantiated.

This should not happen when *creating* an override, but can be fairly
common during resync process.

For now, use a lesser precise check in resync case, only relying on
object usercount. This might lead to some objects being left without any
collection in some rare weird case, but this cannot really be avoided
currently.
2021-03-16 16:57:04 +01:00
1ba88d4d2f LibOverride: Resync: Fix too many objects being rooted in master collection.
No need to instantiate systematically the root object if it is already
instantiated in the scene...

Issue reported by the studio.
2021-03-16 16:57:04 +01:00
18371f2780 LibOverride: tweak log messages, fix crash in log code.
One of the log call could use freed memory.
2021-03-16 16:57:04 +01:00
b71b1ae384 Python GPU: Improve the Python GPU API documentation
This fixes some errors of continuity and consistency of formatting on
https://docs.blender.org/api/current/gpu.html

This also details the description of some parameters.

Differential Revision: https://developer.blender.org/D10531
2021-03-16 12:48:39 -03:00
6b6bcbe60c Fix T86612 EEVEE: Wrong AmbientOcclusion on refractive materials
This is because the refractive materials were using the deferred AO
computation instead of tracing their own.
2021-03-16 15:31:04 +01:00
4ce5dfe54c Cleanup: NULL -> nullptr. 2021-03-16 15:08:23 +01:00
93e2491ee7 Cleanup: replace std::map with blender::Map. 2021-03-16 15:03:30 +01:00
4ca8e09b24 Cleanup: Replace std::vector with blender::Vector. 2021-03-16 15:03:30 +01:00
5266e17ed5 Cleanup: Modernize iterators. 2021-03-16 15:03:30 +01:00
0efca18df7 Cleanup: Modernize iter. 2021-03-16 15:03:30 +01:00
b43d4c63cf Cleanup: Removed commented out code. 2021-03-16 15:03:30 +01:00
8ea3ab5b42 Cleanup: Remove unimplemented declarations. 2021-03-16 15:03:30 +01:00
d07a7697cf Fix T86124: Self-hosting external libraries packages
Allow downloading of source packages of Blender's dependencies, so that
it's easier to provide a "full source archive" that contains the blender
source + all dependencies archives. A `make` command for this will be
introduced soon.

This changes the deps builder slightly to be more flexible with the
origin of our source packages.

To support this a new CMake variable has been added called `PACKAGE_DIR`
where all sources archives will be stored.

default: a directory called `packages` in the build folder.

alternative-default: if a directory called `packages` exists in the
blender source folder that will be used. This is to support the "full
source archive" use case.

The download phase have been moved from the build phase to the configure
phase. Configure will download all sources validate the hashes while
downloading.

All `[depname].cmake` files have been changed to take a local
`file://[path_to_local_tarball]` path rather than a remote URI.

A second requirement was that there needed to be an option to grab the
sources from the blender SVN mirror rather than upstream. For this an
option has been added PACKAGE_USE_UPSTREAM_SOURCES (default ON). The
exact location in SVN still needs to be worked out, I tested with my
local webserver and codewise it checks out. The path that is in there
currently will not work (given there is no mirror there yet).

To build this mirror our local package caches can be used.

Reviewed By: lazydodo

Differential Revision: https://developer.blender.org/D10598
2021-03-16 14:10:30 +01:00
Pratik Borhade
4d3cdb32d3 Fix T86168: Add primitive Grid. Wrong number of subdivisions
Changes to increase subdivision by one along both axis (X and Y)

For example with x_segment = 3 and y_segment = 3.
There should be 16 vertices ((3 + 1) * (3 + 1)) for correct
number of subdivisions. Currently they are 3 * 3 = 9 vertices.

Ref D10699
2021-03-16 23:10:32 +11:00
6d011d0e27 Fix: Cryptomatte load corrupt manifests.
Seems like one of the example files on the cryptomatte github is
malformed and blender crashes when loading that file. This change will
try to load as much as possible from the manifest so it can still be
used.

This has also been reported to cryptomatte project.
2021-03-16 10:12:03 +01:00
cb3005c263 Fix: read cryptomatte manifests when images aren't loaded yet.
A check was preventing the actual image to load and was therefore not
parsed.
2021-03-16 10:12:03 +01:00
0a34fec56a Fix T86561: Edit-mode crash with multiple objects sharing a mesh
Use a for loop that always begins with the active object,
instead of moving the active object in the array,
which failed when it's data already being handled.

While the existing logic could have been fixed,
it's simpler to change the loop order.
2021-03-16 19:30:30 +11:00
d49e7b82da Compositor: Redesign Cryptomatte node for better usability
In the current implementation, cryptomatte passes are connected to the node
and elements are picked by using the eyedropper tool on a special pick channel.

This design has two disadvantages - both connecting all passes individually
and always having to switch to the picker channel are tedious.

With the new design, the user selects the RenderLayer or Image from which the
Cryptomatte layers are directly loaded (the type of pass is determined by an
enum). This allows the node to automatically detect all relevant passes.

Then, when using the eyedropper tool, the operator looks up the selected
coordinates from the picked Image, Node backdrop or Clip and reads the picked
object directly from the Renderlayer/Image, therefore allowing to pick in any
context (e.g. by clicking on the Combined pass in the Image Viewer). The
sampled color is looked up in the metadata and the actual name is stored
in the cryptomatte node. This also allows to remove a hash by just removing
the name from the matte id.

Technically there is some loss of flexibility because the Cryptomatte pass
inputs can no longer be connected to other nodes, but since any compositing
done on them is likely to break the Cryptomatte system anyways, this isn't
really a concern in practise.

In the future, this would also allow to automatically translate values to names
by looking up the value in the associated metadata of the input, or to get a
better visualization of overlapping areas in the Pick output since we could
blend colors now that the output doesn't have to contain the exact value.

Idea + Original patch: Lucas Stockner
Reviewed By: Brecht van Lommel

Differential Revision: https://developer.blender.org/D3959
2021-03-16 07:43:17 +01:00
269536d47e Cleanup: use doxy sections for 'bpy.props' module 2021-03-16 17:34:52 +11:00
95bb41a3e3 Cleanup: use _fn suffix in bpy.props 2021-03-16 17:22:34 +11:00
81178eca7c Revert removal of lambda usage for Python RNA callbacks
This reverts commits
- 476be3746e
- 8d50a3e19e
- 08dbc4f996 (partially).
2021-03-16 15:18:02 +11:00
e125305af4 Fix T86332: Error using lambda in annotations in Python 3.10
Callbacks used in `bpy.props` didn't hold a references to the functions
they used.

While this has been the case since early 2.5x it didn't cause any
problems as long as the class held a reference.

With Python 3.10 or when using `from __future__ import annotations`,
the annotations are no longer owned by the class once evaluated.

Resolve this by holding a reference in the module, which now supports
traverse & clear callbacks so the objects are visible to Python's
garbage collector.

Also refactor storage of Python data, moving from an array into a struct.
2021-03-16 15:17:45 +11:00
be51d671b5 Fix T86121: Cycles Attribute returning wrong results with OSL
Fix uninitialized variable in the OSL shader.
2021-03-15 20:47:07 +01:00
8f93386e62 Fix (apparently harmless) Cycles asan warnings 2021-03-15 20:46:57 +01:00
Mikhail
21bc1a99ba Cycles: optimize ensure_valid_reflection(), reduces render time by about 1%
This is an implementation that is about 1.5-2.1 times faster. It gives a result
that is on average 6° different from the old implementation. The difference is
because normals (Ng, N, N') are not selected to be coplanar, but instead
reflection R is lifted the least amount and the N' is computed as a bisector.

Differential Revision: https://developer.blender.org/D10084
2021-03-15 18:01:57 +01:00
Mikhail Matrosov
fbe0165aad Fix T56925: Cycles banding artifacts in dense volumes
Offset the starting point of segments by a random amount to avoid the bounding
box shape affecting the result and creating artifacts.

Differential Revision: https://developer.blender.org/D10576
2021-03-15 17:49:52 +01:00
cd3fade2aa Fix Cycles rendering crash on OpenBSD
Static initialization order was not guaranteed to be correct for node base
types. Now wrap all initialization in accessor functions to ensure the order
is correct.

Did not cause any known bug on Linux/macOS/Windows, but showed up on this
platform.
2021-03-15 16:47:07 +01:00
Charlie Jolly
3fdef12162 Geometry Nodes: Support drag & drop object to create Object Info, Collection Info and Sample Texture nodes
See: {T86296}

Reviewed By: JacquesLucke

Differential Revision: https://developer.blender.org/D10648
2021-03-15 15:36:22 +00:00
1b29e84c18 Fix Libmv tests after recent fix
Forgot to update regression test to the changed API.
2021-03-15 16:11:37 +01:00
e7f59e6f94 Spreadsheet: show number of filtered rows only when necessary 2021-03-15 16:11:18 +01:00
c82f65b096 Fix T86262: Tracking backwards fails after gap in track
The issue was caused by a prediction algorithm detecting tracking the
wrong way. Solved by passing tracking direction explicitly, so that
prediction will always happen correctly regardless of the state of the
Tracks context.
2021-03-15 15:55:09 +01:00
618c4b9daf Refactor Libmv C-API motion model conversion
Mode to an own utility function and guard missing enumerator values
with a LOG(FATAL).
2021-03-15 15:55:09 +01:00
1f7140e709 Tracking: Mention TODO about DNA to Libmv API conversion
Current code works, but is heavily relying on matched enum definition
in the Blender's DNA and Libmv's API, which is suboptimal and fragile.
2021-03-15 15:55:09 +01:00
d8e1750e34 Cleanup: Spelling in Libmv comments 2021-03-15 15:55:09 +01:00
4e236326c1 EEVEE: Contact Shadow: Fix self intersection issues
This was cause by the change of some epsilon values for reflections.

This commit changes the planar reflection tracing to have correct
handling of parallel rays and discard any self intersection with normal
screen raytrace.
2021-03-15 15:52:02 +01:00
098c595e51 Cleanup: EEVEE: Remove unused variable 2021-03-15 15:52:02 +01:00
cf5cada6b2 Nodes: fix crash after undo after recent multi-input-socket changes
The issue is that the `last_node_hovered_while_dragging_a_link` pointer is invalidated on undo.
The pointer does not have to be on the space runtime data, because it only needs to exist
as long as the operator is running.

Differential Revision: https://developer.blender.org/D10726
2021-03-15 15:41:41 +01:00
3618948df8 Geometry Nodes: expose builtin crease attribute
This exposes the `crease` attribute, that is used by the Subdivide Smooth node.
It is also the first attribute on the edge domain. Domain interpolations for the
edge domain have not been implemented yet.

Ref T86397.

Differential Revision: https://developer.blender.org/D10660
2021-03-15 15:38:57 +01:00
992abd4734 LibOverride: Add checks to address some degenerate blend file cases
Attempt to work around some full-corruption cases created at the studio.
Not clear how those were created, so not really fixing anything here,
just detecting and 'solving' as best as possible some high corruption of
local overrides.

This is good to have in general anyway, might help prevent further
corruption to happen too.
2021-03-15 15:21:40 +01:00
ab6e67767e Comments: notes on sculpt/image undo looping logic 2021-03-15 23:31:35 +11:00
14863b3d4d Fix T86542: Crash going to UV editing workspace with an instancer that
is hidden from the viewport

Check visibilty (as done in workbench_cache_populate) in
overlay_edit_uv_cache_populate as well.

Maniphest Tasks: T86542

Differential Revision: https://developer.blender.org/D10724
2021-03-15 12:46:21 +01:00
880c840c0b Fix macos compile error
`std::get` does not seem to be available. Using `std::get_if` might work instead.

(Found the error on the buildbot.)
2021-03-15 12:42:20 +01:00
5ad4713cd8 Spreadsheet: improve separation of drawing and data generation
This is a refactor and no functional changes are expected.

The goal is to make it simpler to add other data sources without having
to repeat the drawing code everywhere. Also, having the `CellValue` class
allows us to implement filtering and sorting in a more generic way.
2021-03-15 12:23:03 +01:00
4ed208bcd8 Spreadsheet: support showing data from original/unevaluated object
There are two caveats of the current implementation which still need
to be resolved in a separate step:
* In theory the data on the original object can be editable in the spreadsheet.
* If a complex object is in edit mode, and its original data is displayed,
  the drawing code can be slow, because the bmesh is converted to a mesh
  every time. The proper solution is to draw the data from the bmesh directly.
  This should become easier after an upcoming refactor.

Ref T86141.

Differential Revision: https://developer.blender.org/D10701
2021-03-15 10:16:11 +01:00
b617b44419 Spreadsheet: add status bar
This implements the status bar as footer region in the
spreadsheet editor.

It shows the total number of rows and columns as well
as how many rows are actually visible (based on the filter).

The implementation stores the stats in a runtime struct during
drawing and the status bar reads from that struct.

Ref T86142.

Differential Revision: https://developer.blender.org/D10693
2021-03-15 10:00:02 +01:00
2ca48b9678 Fix T86370: Select color for glow is inverted
The shader was filtering everything but the selected color.
The fix inverts the check to make sure that color is selected.

Reviewed By: fclem

Maniphest Tasks: T86370

Differential Revision: https://developer.blender.org/D10670
2021-03-15 09:51:52 +01:00
4ecd47de6b Cleanup: clang modernize-use-override errors. 2021-03-15 08:34:33 +01:00
2939251a05 Fix regression with modal operator file load check
As of 2cc5af9c55, checking the window
managers pointer for changes is no longer a valid way
to check a file has been loaded.
2021-03-15 16:37:20 +11:00
684971c2f2 WM: fallback to regular writing if auto-save can't access undo data
While this is very unlikely, always write the autosave file,
even if the `memfile` undo data is unexpectedly NULL.

Also use CLG for logging warnings.
2021-03-15 14:53:29 +11:00
244315afc9 Cleanup: refactor auto-save timer usage
- Split out auto-save file writing from timer code.
- Add wm_autosave_timer_begin so there are both begin & end functions.
- Replace WM_event_add_timer/WM_event_remove_timer with begin/end calls.
2021-03-15 14:48:17 +11:00
d611f2889e Cleanup: remove unused auto-save read function
Also make wm_autosave_location a static function.
2021-03-15 14:48:17 +11:00
6cd1520378 Cleanup: replace 'timer_ended' with 'timer_end'
The previous naming made it seem as if the timer had already ended
where as this function ends the timers.
2021-03-15 14:48:17 +11:00
88b24bc6bb Writefile: only include recovery info in auto-save & quit.blend
Previously all blend files included the path they were saved,
causing files distributed publicly to include users local paths.
This also included developers home directories for startup & userprefs
defaults & app-templates bundled with Blender.

Now recovery information is only written for auto-save & quit.blend
since this is the only time they're intended to be used.
2021-03-15 14:48:17 +11:00
d3b4ff6eaa Cleanup: rename G_FILE_RECOVER -> G_FILE_RECOVER_READ
No functional changes, make room for a write equivalent.
2021-03-15 14:48:17 +11:00
042f06ef3c Cleanup: update comments, remove ifdef'd code 2021-03-15 14:48:17 +11:00
c23da7a5c9 BLI: Add "is_zero" method to float2 and float3 types
This is not necessary, but a nice convenience to avoid using `is_zero_v3`.

Differential Revision: https://developer.blender.org/D10713
2021-03-14 22:36:35 -04:00
070010e203 Nodes: multi-input support for Attribute Remove node
This patch adds multi-input support to the Attribute Remove node.

Reviewed By: Hans Goudey

Differential Revision: https://developer.blender.org/D10698
2021-03-14 23:11:36 +01:00
a01fb22f28 Fix T86427 Exact solver does not apply target material.
I had done some experiments to see what Fast boolean did for material
mapping and thought it just used the same slot in the target as the
slot in the source. The truth is more complicated: if the target material
exists in any slot of the destination, we need to remap to whatever
slot has the matching material. I fixed Exact Boolean to do this.
Since the materials may be in the object, this means that BKE_mesh_boolean
had to get another argument, the remapping arrays.

I will note that the current behavior of Fast, and now Exact, is not ideal.
Ideally, if the source material does not exist in the target, a new material
slot should be created in the target and the source material copied there
(and incrementing the material's reference count). Maybe a future project,
but for now, I want the behavior of Exact to match that of Fast.
2021-03-14 13:20:03 -04:00
8936550269 EEVEE: Specular Occlusion: Avoid overdarkening on smooth surfaces
Accumulate error caused by the low amount of integration slices and
correct it for the low roughness surfaces.

This increases light leak but it is less distracting than dark fringe
everywhere.
2021-03-14 17:19:39 +01:00
448cb5d55b CMake/guardedalloc: add header file to TEST_SRC 2021-03-14 18:11:24 +05:30
85b209e02e Tests: add script_validate_keymap
This checks the generated key-map data matches the result of
re-exporting and re-importing.

This shows up various inconsistencies, including:

- Unused keymaps.
- Unknown/unused data in the keymap.
- Event arguments that don't make sense.
- Event values that don't match the event type
  (tweak direction on keyboard event for example).
2021-03-14 23:31:09 +11:00
b0fbd1ff6f Cleanup: unused argument warnings 2021-03-14 18:08:05 +11:00
8dd9bb1749 Cleanup: avoid risky list as default argument in keymap 2021-03-14 18:08:05 +11:00
06245d0d94 Cleanup: remove redundant keymap arguments
Also add missing space-type argument, while not required
this is used by convention elsewhere in the key-map.
2021-03-14 18:08:05 +11:00
2e95eaed55 Cleanup: remove invalid repeat argument 2021-03-14 18:08:05 +11:00
8301cbd64f Cleanup: remove unused "Gizmo" & "Header" keymaps 2021-03-14 18:08:05 +11:00
2919c4bf9d Cleanup: use explicit check for WM_KEYMAP_UPDATE_RECONFIGURE
A block of code ran when `wm_keymap_update_flag` was non-zero,
replace this with explicit flag check since it wasn't
immediately obvious which flag needed to be set.
2021-03-14 18:08:05 +11:00
d2f4fc8275 WM: support loading keymaps in background mode
While this still isn't done by default on startup,
activating a key-config will load it as expected.

Needed to perform key-map loading tests in background mode.
2021-03-14 18:00:15 +11:00
15d728531a Fix pivot pie menu missing in the clip editor
Regression in a4226a050b.
2021-03-14 18:00:14 +11:00
e8e4a79512 Fix T86390 Exact Boolean crash.
The code has to keep track of "zero volume" cells and I forgot
that there were cases where that needed be be invalidated.
2021-03-13 19:23:14 -05:00
1f8d27a191 Cleanup: EEVEE: Replace brightness() by max_v3()
It is more straightforward to understand and is define in common file.
2021-03-13 23:49:31 +01:00
8041b1dd1c Cleanup: EEVEE: Remove unused mipmapping on main color buffer 2021-03-13 23:49:31 +01:00
9f68f5c1e1 Nodes: Add distance float socket type
This is necessary to make float sockets display a value with the unit
system. `PROP_DISTANCE` will be used quite a lot by the mesh primitives
geometry nodes patch.

Differential Revision: https://developer.blender.org/D10711
2021-03-13 17:15:50 -05:00
dcfea4a1e5 Cleanup: EEVEE: Silence warning 2021-03-13 23:13:08 +01:00
e30315ba95 EEVEE: RenderPass: Fix Ambient Occlusion pass
The shader was not using the horizon texture and was trying to
trace the AO again.

Also the depth reconstruction was off because now using the maxzBuffer.
2021-03-13 23:11:53 +01:00
75fc6e3b2b Cleanup: EEVEE: Remove the horizon search layered shader
This shader is of no use now that we the fullres hizbuffer.
2021-03-13 22:51:23 +01:00
00baf875ef EEVEE: Planar reflections: Fix ambient occlusion broken in reflections
Use the maxzbuffer to get the correct depth information.
2021-03-13 22:51:22 +01:00
2c216413d5 Nodes: Move group input and output to a consistent menu location
Currently (in geometry nodes) you can delete the group input or group
output nodes with no way to get them back without copy and paste. This
adds them to the "Group" submenu of the add menu so at least there is
a way to add them back.

Additionally, these nodes are moved to the "Group" submenu for all node
editors. This makes sense since they are not like the other input or
output nodes, they really just relate to how groups are organized.

Differential Revision: https://developer.blender.org/D10241
2021-03-13 16:00:56 -05:00
03490618a2 EEVEE: ScreenSpaceReflections: Avoid outputing NaNs
This happens when the normal is too much deformed to give valid
reflection even after ensure_valid_reflection.

Cycles seems to not handle this case either so we just discard the
rays.
2021-03-13 20:59:20 +01:00
09e77d2c89 Fix T86476 EEVEE: SSS material with variable radius can produce NaNs
Simple divide by 0 error. The input radius was assumed to be safe
but is not when the user can scale it arbitrarly.

This also move the division out of the loop.
2021-03-13 20:59:20 +01:00
165a2da753 EEVEE: Fix wrong sss component being affected by alpha
This fixes NaNs / blown up values when using alpha-hashed transparency
or alpha clip with SSS.
2021-03-13 20:59:20 +01:00
267a9e14f5 EEVEE: ScreenSpaceReflections: Add back multi ray-hitpoint reuse
We now reuse 9 hitpoints from the neighboorhood using a blue noise
sample distribution as mentionned in the reference presentation.

Reusing more rays does however make some area a bit more blury.

The resulting noise is quite lower compared to previous implementation
which was only reusing 4 hits.
2021-03-13 20:59:20 +01:00
b79f209041 EEVEE: ScreenSpaceReflections: Increase depth threshold
This avoids going through geometry when ray have certain angle.
2021-03-13 20:59:20 +01:00
bbc5e26051 EEVEE: ScreenSpaceReflections: Jitter starting texel
This make sure the rays are generated randomly from a fullres
texel center.

This creates more noise but increase the convergence when doing
half res tracing.
2021-03-13 20:59:20 +01:00
ff07a4afb8 EEVEE: Fix split commit 2021-03-13 20:59:20 +01:00
83b7f7dfb7 Cleanup: EEVEE: Remove SSR shader variations 2021-03-13 20:59:20 +01:00
40d579b69f Cleanup: EEVEE: Split effect_ssr.glsl
This split is to make code easier to manage and rename the files to
`effect_reflection_*` to avoid confusion.

Also this cleans up a bit of the branching mess in the trace shader.
2021-03-13 20:59:20 +01:00
6a7f6f2867 Cleanup: EEVEE: Remove hammersley texture and split hammersley code 2021-03-13 20:59:20 +01:00
5fee9dae5d Cleanup: EEVEE: Make bsdf_sampling_lib.glsl more tidy 2021-03-13 20:59:20 +01:00
ba3a0dc9ba Geometry Nodes: Add "normal" attribute for face normals
This commit adds a `normal` attribute on the polygon domain. Since
normal data is derived data purely based off of the location of each
face's vertices, it is exposed as a read-only attribute. After
rB80f7f1070f17, this attribute can be interpolated to the other domains.

Since this attribute is a special case compared to the others, the
implementation subclasses `BuiltinAttributeProvider`. It's possible
there is a better way to abstract this. Something else might also
become apparent if we add similar read-only attributes.

See rB2966871a7a891bf36 for why this is preferred over the previous
implementation.

Differential Revision: https://developer.blender.org/D10677
2021-03-13 14:13:16 -05:00
2966871a7a Geometry Nodes: Revert current normal attribute implementation
After further thought, the implementation of the "normal" attribute
from D10541 is not the best approach to expose this data, mainly
because it blindly copied existing design rather than using the
best method in the context of the generalized attribute system.

In Blender, vertex normals are simply a cache of the average normals
from the surrounding / connected faces. Because we have automatic
interpolation between domains already, we don't need a special
`vertex_normal` attribute for this case, we can just let the
generalized interpolation do the hard work where necessary,
simplifying the set of built-in attributes to only include the
`normal` attribute from faces.

The fact that vertex normals are just a cache also raised another
issue, because the cache could be dirty, so mutex locks were
necessary to calculate normals. That isn't necessarily a problem,
but it's nice to avoid where possible.

Another downside of the current attribute naming is that after the
point distribute node there would be two normal attributes.

This commit reverts the `vertex_normal` attribute so that
it can be replaced by the implementation in D10677.

Differential Revision: https://developer.blender.org/D10676
2021-03-13 14:05:00 -05:00
88f845c881 GPencil: Remove word "Strokes" in menu
This remove redundant word.
2021-03-13 19:52:10 +01:00
Charlie Jolly
670453d1ec Geometry Nodes: Add Attribute Convert node
The Attribute Convert node provides functionality to change attributes
between different domains and data types. Before it was impossible to
write to a UV Map attribute with the attribute math nodes since they
did not output a 2D vector type. This makes it possible to
"convert into" a UV map attribute.

The data type conversion uses the implicit conversions provided by
`\nodes\intern\node_tree_multi_function.cc`.

The `Auto` domain mode chooses the domain based on the following rules:
1. If the result attribute already exists, use that domain.
2. If the result attribute doesn't exist, use the source attribute domain.
3. Otherwise use the default domain (points).

See {T85700}

Differential Revision: https://developer.blender.org/D10624
2021-03-13 11:49:56 -05:00
8ab6450abb Fix geometry nodes implicit conversion to booleans reversed
The result value should be true if the input values are not zero.
Note that there is ongoing conversation about these conversions
in D10685. This is simply a fix though.
2021-03-13 11:39:48 -05:00
258b15da74 Cleanup: add BKE_pbvh_vertex_iter_begin to clang-format
Reviewed By: JacquesLucke

Differential Revision: https://developer.blender.org/D10707
2021-03-12 22:29:37 +01:00
74052a9f02 Sculpt: Mask Init operator
This operator initializes mask values for the entire mesh. It supports
different modes for initializing those values, and more will be added in
the future.

The initial version supports generating a random mask per vertex, Face
Sets or loose parts. These masks are useful for introducing variations
in the model using the filters (both shapes and colors).

Reviewed By: JacquesLucke

Differential Revision: https://developer.blender.org/D10679
2021-03-12 21:37:12 +01:00
9d08c169d1 GPencil: Interpolate can use all keyframe types except breakdown
Before only it was only possible interpolate frames of `Keyframe` type. Now all types except `Breakdown` can be used. 

`Breakdown` cannot be used because it would be impossible interpolate two times because the extremes of the interpolation would change and the clean operator would not work.
2021-03-12 19:43:13 +01:00
5788f608d3 GPencil: UI menu cleanup
Remove duplicate words Stroke and Point already in menu header.

Reviewed by: @mendio,  @filedescriptor
2021-03-12 19:12:27 +01:00
476be3746e Fix T86332: setting Cycles dicing camera fails after recent changes
Somehow "from __future__ import annotations" and "lambda" are not working
together well here, work around it by not using a lambda function.
2021-03-12 17:49:56 +01:00
b01e9ad4f0 Fluid: Enable scale options for fluid particles
There is no reason to hide the 'Scale' and 'Scale Randomness' options
for fluid particles that are rendered as 'Object'.

It is possible that hiding these options was just an oversight and
not intentional.
2021-03-12 17:24:53 +01:00
abe1a061f8 Docs: add doc-string for TransDataContainer 2021-03-13 03:14:56 +11:00
651fe243e6 Cleanup: const warning 2021-03-13 03:14:56 +11:00
f707783d5f LibOverride Auto Resync: Add option to disable it in Experimental userpref.
Some older .blend files won't react nicely to auto-resync, they need to
get manually fixed with `resync enforce` first.
2021-03-12 16:45:45 +01:00
Bastien Montagne
ef5782e297 CLOG: add support for substring matching.
So that `--log "*undo*"` matches any log identifier containing `undo`.

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D10647
2021-03-12 16:01:46 +01:00
bcac17196a Fix heap buffer overflow appending/linking from a blend file
Add new function `blo_bhead_is_id_valid_type()` to correctly check the
blend file block type.

File block type codes have four bytes, and two of those are only in use
when these blocks contain ID datablocks (like `"OB\0\0"`). However,
there are other types defined in `BLO_blend_defs.h` that have four
bytes, like `TEST`, `ENDB`, etc.

The function `BKE_idtype_idcode_is_valid(short idcode)` was used to
check for ID datablocks while reading a blend file. This only takes a
2-byte parameter, and thus its result is invalid for the 4-byte codes.
For `TEST` blocks, it would actually consider it a `TE` block, which is
a valid identifier for a Texture. This caused the heap buffer overflow,
as the datablock is not a valid ID, and thus the bytes that were
expected to form an ID name actually encode something completely
different.

Reviewed By: mont29

Differential Revision: https://developer.blender.org/D10703
2021-03-12 15:58:58 +01:00
f0c3ec3dc8 Fix T82532: Sculpt fails to redo the first sculpt session stroke
Sculpt undo relied on having a mode-changing undo step to properly
apply changes.

However this isn't the case with startup files or when mixing
global undo steps with sculpt (see T82851, also fixed).

Undo stepping logic follows image_undosys_step_decode_undo.
2021-03-13 01:36:26 +11:00
c7354cc64b Fix another crash in LibOverride resync code.
Another case where newly overridden ID (stored in `newid` of its linked
reference) gets immediately deleted in old broken overrides.

Re T86501.
2021-03-12 15:27:01 +01:00
20ee6c0f16 Fix compiler warning when building Cycles without Embree 2021-03-12 15:17:08 +01:00
fd905c1059 Cleanup: fix clang-tidy errors when COM_debug is active. 2021-03-12 14:32:24 +01:00
7388f9df71 Cleanup: Compiler warnings with COM_TM_NOTHREAD active. 2021-03-12 13:36:49 +01:00
583df9a5f8 Cleanup: document FileSelectAssetLibraryUID::type
No functional changes.
2021-03-12 13:24:31 +01:00
74557ca4f7 LibOverride: Add a new operation to Outliner to enforce resync of hierarchies.
This is basically done by ignoring override operations from old override
affecting ID pointer properties, when the new (destination) one is not
NULL.

Fix T86501: New object added to overridden collection doesn't show up in linking file on Resync.

This is more of a work-around actually, since there is no real way to
fix the issue in a fully automated and consistent way, it is caused by
older blender files being saved with 'broken' overrides.

WARNING: This cannot ensure that some purposedly edited/overridden ID
pointer properties won't be lost in the process.
2021-03-12 12:31:25 +01:00
fe2ceef729 Fix first part of T86501: Crash during resync process.
Code would end up freeing some of the newly created overrides, which
were assigned to the matching linked ID's `newid` pointer, accessed
again further down the code.

Note that this is not a normal expected situation, and it won't give a
proper resync result anyway, but it might happen in some complicated
corner cases, and also quite often when dealing with older .blend files.
2021-03-12 09:46:11 +01:00
4781ab0969 IDRemap: Add option to also remap internal runtime ID pointers.
In some cases (advanced, low-level), we also want to remap pointers like
`ID.newid` or `ID.orig_id`.

Only known case currently is `id_delete`, to avoid leaving potential access to freed memory. See next commit and T86501.
2021-03-12 09:46:11 +01:00
fd4c01a75c LibQuery: Add an option to process internal runtime ID pointers.
In some cases (advanced, low-level code) we also want to process ID
pointers like `ID.newid` or `ID.orig_id`.
2021-03-12 09:46:11 +01:00
960337f17a Fix T86455: vertex color baking issue with sculpt vertex colors
Baking to Vertex Colors would always bake to sculpt vertex colors (if
such a layer is present) even if those are not enabled in the
experimental preferences. This would bake without an error but leave the
user without a result to look in the viewport.

Now check if sculpt vertex colors are enabled and only bake to them in
that case.

Maniphest Tasks: T86455

Differential Revision: https://developer.blender.org/D10692
2021-03-12 09:22:47 +01:00
a5c44265a3 Cleanup: remove workaround for MSVC PyTypeObject declarations
This is no longer needed for MSVC-2017.
2021-03-12 16:13:36 +11:00
2a5f22c1af Cleanup: set the window manager to the updated context on load
While this happened to be corrected by code that runs afterwards,
leaving this in an invalid state could cause problems in the future.
2021-03-12 16:13:36 +11:00
2e9fb211c6 Cleanup: make_source_archive.py minor changes & comments
- Add notes on portability.
- Use encoding argument for all file IO.
- Use integer math to calculate major/minor version, while float
  division should be fine prefer matching Blender.
2021-03-12 16:13:36 +11:00
7f4530dad2 Cleanup: incorrect doxy section title
Also correct typo.
2021-03-12 16:13:36 +11:00
8125731cae Cleanup: break out of loop early 2021-03-12 16:13:36 +11:00
d3fa576aa7 Cleanup: redundant flag check 2021-03-12 16:13:36 +11:00
406d9749d8 Cleanup: redundant outliner includes 2021-03-12 16:13:36 +11:00
8922d177c1 Alembic procedural: specific result type for cache lookups
This type, CacheLookupResult, holds the data for the current time, or an
explanation as to why no data is available (already loaded, or simply
nothing available). This is useful to document the behavior of the code
but also, in future changes, to respond appropriately for missing data.
2021-03-12 01:57:41 +01:00
d72fc36ec5 Alembic procedural: add support for instancing
Inside of the procedural, instances are AlembicObjects which point to
the AlembicObject that they instance.

In Alembic, an instance is an untyped Object pointing to the original
(instanced) one through its source path. During the archive traversal we
detect such instances and, only if the instanced object is asked to be
rendered, set the instance's AlembicObject to point to the original's
AlembicObject.

Cycles Object Nodes are created for each AlembicObject, but only for
non-instances are Geometries created, which are then shared between
Object Nodes. It is supposed, and expected, that all instances share the
same shaders, which will be set to be the ones found on the original
object.

As for caching, the data cache for an AlembicObject is only valid for
non-instances and should not be read to or from as it is implicitly
shared.
2021-03-12 01:30:12 +01:00
7017844c5e Alembic procedural: move cache building out of object update methods
This will help support instancing as cache building is now decoupled
from the logic to update the Nodes' sockets as data (and cache) will
need to be shared by different Geometries somehow, and also simplify
implementing different data caching methods by centralizing this
operation.
2021-03-12 00:15:17 +01:00
7a028d5b99 Alembic procedural: fix missing attribute update
We need to explicitely tag the Attribute and AttributeSet as modified if
we change or add/remove data. This is more of a bandaid until attributes
handling is refactored to be able to reuse routines from the Attribute
API.
2021-03-12 00:15:16 +01:00
62e2fdf40b Cleanup: unused variable 2021-03-12 00:15:16 +01:00
2ebf4fbbfb Alembic procedural: fix potential zero scale matrix generation
This can happen during user edits or with files missing the global scale
property.
2021-03-12 00:15:15 +01:00
3256f0d52c Added missing file to last commit:
Nodes: Add Attribute Remove Node D10697
2021-03-11 23:42:19 +01:00
60f7275f7f Nodes: Add Attribute Remove Node
This patch adds a node, that removes an attribute if possible,
otherwise it adds an error message.

Differential Revision: https://developer.blender.org/D10697
2021-03-11 23:06:16 +01:00
afa30f1a9d Nodes: Fix drag link from output to already linked Multi-Input Socket
This patch fixes a visual bug related to connecting an output socket to
a Multi-Input Socket, that already has a link to that same output.
In this case, the drag link got a new index and snapped to a new
position. This path makes the drag link snap to the same position as the
first link between the two sockets.

Differential Revision: https://developer.blender.org/D10689
2021-03-11 18:53:29 +01:00
8c6337e587 Fix missing UI updates, caused by own earlier commit
Caused by 46aa70cb48.

RNA would send property update notifiers with the owner ID as `reference` data.
Since above's commit we'd only send the notifiers to editors if the reference
data address matches the space's address. So editors wouldn't get the notifiers
at all.

The owner ID for space properties is always the screen AFAIK. So allow
notifiers with the screen as reference to be passed to editors as well, think
this is reasonable to do either way.

For example, steps to reproduce were:
* Open Asset Browser
* Mark some data-blocks of different types as assets (e.g. object & its
  material)
* Switch between the categories in the Asset Browser. The asset list wouldn't
  be updated.
2021-03-11 18:47:14 +01:00
1b1f8da5dd Cleanup: remove unnecessary const from function declaration
No functional changes.
2021-03-11 18:20:34 +01:00
670c1fdf64 GPencil: Remove limitation to use only one Lattice modifier
This limitation was necessary in older versions, but now can be removed.
2021-03-11 18:17:30 +01:00
7092d6a7a3 Fix warning from own previous commit 2021-03-11 17:57:05 +01:00
46aa70cb48 UI: Avoid unnecessary redraws of unrelated editors on space changes
When adding a notifier, `reference` data can be passed. The notifier system
uses this to filter out listeners, for example if data of a scene changes,
windows showing a different scene won't get the notifiers sent to their
listeners.

For the `NC_SPACE` notifiers, a number of places also passed the space as
`reference`, but that wasn't used at all. The notifier would still be sent to
all listeners in all windows (and the listeners didn't use it either). Causing
some unnecessary updates (e.g. see ed2c4825d3).
With this commit, passing a space will make sure the notifier is only sent to
that exact space. Some code seems to already have expected that to be the case.

However there were some cases that passed the space as `reference` without
reason, which would break with this commit (meaning they wouldn't redraw or
update correctly).
Corrected these so they don't pass the space anymore.
2021-03-11 17:43:45 +01:00
ed2c4825d3 Fix Asset Browser showing oudated list for changes done while browser is hidden
Steps to reproduce were:
* Open an Asset Browser
* "Mark Asset" on some data-block
* Change the Asset Browser into a different editor (not File Browser!)
* "Clear Asset" on the data-block again, or mark another asset
* Change back to the Asset Browser, it will show an outdated list

Now the file-browser reloads local file data after spaces were changed. Note
that the current notifier code doesn't limit the space-change notifiers to the
affected spaces, so changing any visible space will trigger this. That's an
issue to be fixed separately.
2021-03-11 17:43:33 +01:00
a1b01edf45 GPencil: Fix unreported Fill fails if the stroke was tagged
In some situations the strokes could be tagged before filling, so it's necessary to reset before.
2021-03-11 17:23:04 +01:00
9dfc81ccf1 Fix regression in 2cc5af9c55
The check for undo-depth increment/decrement assumed a newly loaded
window manager would have a different pointer.

This broke bl_animation_fcurves test indirectly,
the change to undo-depth caused the redo panel to attempt to popup
in background mode - which isn't supported.

Now the pointer is unchanged, the undo-depth is assumed to match
the value used when calling the operator.

The undo-depth is now properly maintained between file loads,
which is an improvement on the original behavior which reset it.
2021-03-12 03:21:39 +11:00
Siddhartha Jejurkar
350ad4bcb1 Fix T86199: error when adding custom fluid diffusion preset
Differential Revision: https://developer.blender.org/D10694
2021-03-11 16:51:01 +01:00
d518b0fda5 Fluid: Updated hidden symbol visibility comment
It turns out that on official arm64 devices (not DevKit) the linker
warnings still show up. So just leaving this as is.

Ref D9002
2021-03-11 16:15:45 +01:00
5b91a52944 Cleanup: spelling 2021-03-12 00:51:29 +11:00
2cc5af9c55 Fix T86431: Keep memory location of the window manager on file load
Keep the pointer location from the initial window-manager
between file load operations.

This is needed as the Python API may hold references to keymaps for e.g.
which are transferred to the newly loaded window manager,
without their `PointerRNA.owner_id` fields being updated.

Since there is only ever one window manager, keep the memory at the same location so the Python ID pointers stay valid.

Reviewed By: mont29

Ref D10690
2021-03-12 00:40:52 +11:00
2cdebf293d WM: keep the current state when a blend fails to load
Previously many operations would run on file load, even if the file
did not load. Pre/post load handlers were called, timers canceled,
all undo data freed, editors exited ... etc.

Now keep the blend file in it's current state.

This simplifies updating this area of code as there is one less
possible situation to account for.
2021-03-12 00:40:52 +11:00
5812bc7d89 Cleanup: split file read and setup into separate steps
Currently file loading performs almost all reloading logic
even in the case loading the file fails, causing the file to be in
a state that isn't well defined: undo is cleared, timers are canceled &
scripts are re-registered.
2021-03-12 00:40:52 +11:00
f7616c6eaf Cleanup: file loading/recover checks
- Don't set G.relbase_valid until the file is loaded.
- Remove unnecessary string pointer comparison.
- Remove unused filename being passed to 'setup_app_data'.
2021-03-12 00:40:25 +11:00
93f8c9b823 LibOverride: auto-run resync process on file reading.
Part of T83811 & D10649.
2021-03-11 14:26:19 +01:00
a023c1a34c LibOverride: Add second part of auto-resync code.
`BKE_lib_override_library_main_resync` uses
`LIB_TAG_LIB_OVERRIDE_NEED_RESYNC` tags set by RNA override apply code,
and perform detection for the remaining cases (those were new overrides
need to be created for data that was not present before in the library).

And then it actually resync all needed local overrides.

Part of T83811 & D10649.
2021-03-11 14:26:19 +01:00
534f4e90fd LibOverride: First stage of detection of 'need resync'.
We can fairly easily detect some resync-needed cases when applying the
overrides operations on a Pointer RNA property.

This should cover all cases where an existing override's ID pointer is
changed in its linked data.

We still have to add code to detect when a not-yet-overridden linked ID
needs to become overridden (because its relations to other data-blocks
changed in a way that requires it).

Part of T83811 & D10649.
2021-03-11 14:26:19 +01:00
96064c3bb7 LibOverride: Do not delete no-more-used overrides during resync if they are user-edited.
Ultimately those will be listed with a special icon in the upcomming
Outliner overrides view.

Part of T83811 & D10649.
2021-03-11 14:26:19 +01:00
0a6ed7f035 LibOverride: Add a utils to check if override has been user-edited.
Part of T83811 & D10649.
2021-03-11 14:26:19 +01:00
f4f8b6dde3 Cycles: Change device-only memory to actually only allocate on the device
This patch changes the `MEM_DEVICE_ONLY` type to only allocate on the device and fail if
that is not possible anymore because out-of-memory (since OptiX acceleration structures may
not be allocated in host memory). It also fixes high peak memory usage during OptiX
acceleration structure building.

Reviewed By: brecht

Maniphest Tasks: T85985

Differential Revision: https://developer.blender.org/D10535
2021-03-11 14:12:35 +01:00
ba996ddb3a Cleanup: Add comment explaining plan for new Outliner tree-element code design
Explains how we can get rid of implicit assumptions and `void *`
arguments/storage in the future.
2021-03-11 13:49:16 +01:00
0f60dbe4bf Cleanup: Pass anim-data directly to Outliner anim-data tree element constructor
Rather than letting the `TreeElementAnimData` constructor take an ID from which
we get the animation-data based on an assumption on how it's stored, let the
constructor take the animation-data directly. That way we further centralize
the assumptions on the data passed to the element creation to
`tree_element_create()`.
The following commit will add a comment explaining the plan to entirely get rid
of those assumptions in the future.
2021-03-11 13:49:16 +01:00
d4d03f736b Fix (unreported): crash on undo when using pinned id in spreadsheet
Now the behavior is the same as in the properties editor, as far as I can tell.
2021-03-11 13:28:28 +01:00
fade765bf3 Outliner: Add assert to make assumption for new code design explicit
There was an implicit assumption that tree element types using the new code
design set their name on creation. Use an assert to make this explicit. See
f59ff9e03a, which was an error because of this broken assumption.
2021-03-11 13:20:27 +01:00
f59ff9e03a Fix crash when showing NLA actions in the Outliner
Caused by 2e221de4ce in combination with 4292bb060d.
In the former I forgot to set the name for NLA actions in the new code design,
in the latter I made it an assumtion that tree element types using the new
design set the name.
The following commit will make this assumption explicit with an assert.
2021-03-11 13:18:17 +01:00
018fffbe77 Fix failing assert when loading file with untraceable custom asset library
When loading a file with an asset browser open, and it showed a custom asset
library that can't be found currently (e.g. because the file is from somebody
else), the `BLI_assert(0)` in `rna_FileAssetSelectParams_asset_library_get()`
would fail.

There was code to handle this case already, but unlike I thought it didn't run
right after file read. Now it does.
2021-03-11 13:06:31 +01:00
42c5303409 Cleanup: Typos in comments (window-manager files)
Typos from a509e79a4c. Looks like issues with an automated cleanup tool.
2021-03-11 13:06:31 +01:00
5f1f233dc9 Spreadsheet: expore more domains and point cloud data
Ref T86135.

Differential Revision: https://developer.blender.org/D10681
2021-03-11 12:23:01 +01:00
Rahul Chaudhary
74f3edc343 Fix T86458: Simple Subdivision node does not preserve vertex groups
Differential Revision: https://developer.blender.org/D10683
2021-03-11 11:56:40 +01:00
28e83bca9d Geometry Nodes: improve handling when the same socket is connected twice
The multi-input-socket cannot be connected to the same socket twice currently.
However, it is still possible to achieve this using an intermediate reroute node.

In this case the origin socket should be listed twice in the `linked_sockets_` list.
Higher level functions can still deduplicate the list of they want.
2021-03-11 11:35:02 +01:00
Aaron Carlisle
85623f6a55 UI: Add Copy Full Data Path to RMB menu
This commit adds an operator to the RMB-menu "Copy Full Data Path“,
to copy the full RNA path to the clipboard. It aims to complement
"Copy Data Path“, which only copies the part of the path that is needed
for drivers, but for writing addons, etc. it is useful to have an option that
gives the full data path.

Similar patch have been submitted before, see D763 and D2746

This time I did not split the operator (as D2746) and does not contain the UI reorganization (as D763)

Note, the fixes from D2746 were committed in rB09eac0159db8 so that patch can be closed.

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D10539
2021-03-10 22:10:49 -05:00
9ef24d5aaa Geometry Nodes: fix error adding a value node
Caused by own rBcf2933c38a34 which changed the poll on this node to be
"shading-only", but this one is actually supported.
2021-03-10 22:19:36 +01:00
4cd9a1164b EEVEE: ScreenSpaceReflections: Improve minimal hit threshold
This makes the hit delta threshold dependant on the ray angle.
If the ray is more aligned with the view, its intersection
threshold gets bigger to avoid going through geometry.

This improves reflections and fix T86448 refraction issue.
2021-03-10 17:57:09 +01:00
352385d109 Cleanup: EEVEE: Remove unused function and fix comment 2021-03-10 17:57:09 +01:00
5ab2252a66 Fix T86429 EEVEE: Ambient occlusion broken on some platform
This was cause by a division by 0 if the ray direction had no
depth difference. Adding a small epsilon fix the issue.
2021-03-10 17:57:09 +01:00
56bf4f3fb3 EEVEE: ScreenSpaceReflections: Add back support for planar reflections
We now have a new buffer to output reflection depth. This buffer is
only usefull for non planar SSR but we use it to tag the planar rays.

This also touch the raytrace algo for planars to avoid degenerate
lines on vert sharp reflections.
2021-03-10 17:57:09 +01:00
793335f3e2 Cleanup: EEVEE: Use correct prefix for view space vectors 2021-03-10 17:57:09 +01:00
d89fb77d89 EEVEE: GGX: Use distribution of visible normal for sampling
This changes the sampling routine to use the method described in
"A Simpler and Exact Sampling Routine for the GGXDistribution of Visible Normals"
by Eric Heitz.
http://jcgt.org/published/0007/04/01/slides.pdf

This avoids generating bad rays and thus improve noise level in screen-
space reflections / refraction.
2021-03-10 17:57:09 +01:00
9957096f35 EEVEE: ScreenSpaceReflections: Improve hit quality
This changes the hitBuffer to store `ReflectionDir * HitTime, invPdf`
just as the reference presentation.

This avoids issues when the hit refinement produce a coordinate that
does not land on the correct surface.

We now store the pdf in the same texture and store it inversed so we can
remove some ALU from the resolve shader.

This also rewrite the resolve shader to not be vectorized to improve
readability and scalability.
2021-03-10 17:57:09 +01:00
79bc4962d3 Fix T86416: geometry nodes crash choosing a group node link menu
Since rBb279fef85d1a, the nodes properties for geometry nodes using a
texture are displayed in the Properties Editor.

It was possible to create recursive nodetrees when choosing the 'root'
nodegroup in the node link menu though leading to a crash.

Now poll if a group node of a particular node could actually be added to
the current tree.

Also check if the tree types actually match.

Maniphest Tasks: T86416

Differential Revision: https://developer.blender.org/D10671
2021-03-10 17:03:38 +01:00
cf2933c38a Add 'foreach_nodeclass' for geometry nodetrees
This way we get a choice when we click on node links in the Properties
Editor.

This also changes some of the more permissive poll functions on some
nodes back to being "shading-only" (these were made permissive in
rBb78f2675d7e5 for simulation nodes, but have not found their way into
geometry nodes yet).

ref b279fef85d / T86416 / D10671

Maniphest Tasks: T86416

Differential Revision: https://developer.blender.org/D10673
2021-03-10 17:03:38 +01:00
eb20250d2a Fix wrong white point of Linear ACES in config reading and the bundled config
The Blender/Cycles XYZ color space has a D65 white point instead of E, and
this was not correctly accounted for both in the OpenColor config reading code
and the bundled config.

This meant that since the OpenColorIO v2 upgrade, the Linear ACES color space
was not working correctly, and other OpenColorIO configs defining
aces_interchange were not interpreted correctly.
2021-03-10 16:56:27 +01:00
1e7b2d0bc6 Geometry Nodes: Add color to boolean implicit conversion
This conversion works the same way as a combination of the existing
color to float3 to boolean conversions, so the boolean result will be
false if the color is black, otherwise true, and the alpha is ignored.
2021-03-10 10:51:44 -05:00
7f07eff588 Cryptomatte tests: Fix layer_from_manifest failure.
Error in rBc6a831cfbc9b24fa8b1ed4852178c139e6ed79a6
2021-03-10 20:13:20 +05:30
576c392241 Nodes: Sortable Multi Input Sockets
This Patch removes the auto sorting from Multi-Input Sockets and allows
the links to be sorted by drag and drop instead.
As a minor related change, it fixes the drawing of the mute line to
connect to the first input instead of the socket's center.
2021-03-10 14:57:57 +01:00
5991c5c928 Cleanup: unused warning building as a Python module 2021-03-10 23:13:03 +11:00
Pratik Borhade
493628e541 Fix T67190: Edge Loop Select doesn't support non-manifold edges
- New Walker added `bmw_NonManifoldedgeWalker_type`.
- This walks over edges connected with 3 or more faces connected.

Ref D10497 with edits.
2021-03-10 23:04:37 +11:00
4fece16d45 Geometry Nodes: transfer polygon attributes to points in Point Distribute node 2021-03-10 12:41:50 +01:00
368647bd25 Geometry Nodes: move geometry component type enum to C
This allows us to use it in rna for the spreadsheet editor.
2021-03-10 11:53:31 +01:00
Siddhartha Jejurkar
122fefcc85 DNA: add defaults for UnifiedPaintSettings
Newly created scenes had unified paint settings zeroed. see T80164

Ref D10658
2021-03-10 21:45:12 +11:00
3dab6f8b7b Spreadsheet: new spreadsheet editor
This implements the MVP for the new spreadsheet editor (T85879). The functionality
is still very limited, but it proved to be useful already. A more complete picture
of where we want to go with the new editor can be found in T86279.

Supported features:
* Show point attributes of evaluated meshes (no original data, no other domains,
  no other geometry types, yet). Since only meshes are supported right now, the
  output of the Point Distribute is not shown, because it is a point cloud.
* Only show data for selected vertices when the mesh is in edit mode.
  Different parts of Blender keep track of selection state and original-indices with
  varying degrees of success. Therefore, when the selected-only filter is used, the
  result might be a bit confusing when using some modifiers or nodes. This will
  be improved in the future.
* All data is readonly. Since only evaluated data is displayed currently, it has to
  be readonly. However, this is not an inherent limitation of the spreadsheet editor.
  In the future editable data will be displayed as well.

Some boilerplate code for the new editor has been committed before in
rB9cb5f0a2282a7a84f7f8636b43a32bdc04b51cd5.

It would be good to let the spreadsheet editor mature for a couple of weeks as part
of the geometry nodes project. Then other modules are invited to show their own data
in the new editor!

Differential Revision: https://developer.blender.org/D10566
2021-03-10 11:35:42 +01:00
f247a14468 Geometry Nodes: handle same socket being linked to input more than once better
Note, this does not allow users to connect the same socket more than once to
a multi-input-socket in the UI. However, the situation could still happen when
using node muting.
2021-03-10 11:12:38 +01:00
70e73974b5 Cleanup: spelling 2021-03-10 15:47:50 +11:00
548e2e2f25 Cleanup: remove annotations from startup scripts
The current convention is not to use annotations for UI/startup scripts.
2021-03-10 15:36:23 +11:00
3e67e2a36e Cleanup: compiler warning (ignored-qualifiers) 2021-03-10 15:35:58 +11:00
53b82efed6 Fix (unreported) geometry node attribute search not working in the
Properties Editor

Since rBb279fef85d1a, the nodes properties for geometry nodes using a
texture are displayed in the Properties Editor.

rB85421c4fab02 added an attribute search button, but this was missing
still (gave just the regular text button) if this was displayed in the
Properties Editor.

ref b279fef85d / T86416 / D10671 / D10673

Maniphest Tasks: T86416

Differential Revision: https://developer.blender.org/D10674
2021-03-10 00:01:28 +01:00
90520026e9 Fix: only follow first input of multi-input-socket when muted
Otherwise muting a Join Geometry node has no effect, when there
are multiple Join Geometry nodes in a row.
2021-03-09 21:22:30 +01:00
7d827d0e9e Fix T86422: Expand crashing with EEVEE enabled
Using EEVEE (as well as some other actions like saving the file or
tweaking mesh parameters) can cause a PBVH rebuild. The different sculpt
tools can store PBVH nodes or other related data in their caches, so
this data becomes invalid if the PBVH rebuilds during evaluation. This
ensures that the PBVH does not rebuild while the cache of Expand is
being used, like it already happens for brushes and filters.

Reviewed By: JacquesLucke

Maniphest Tasks: T86422

Differential Revision: https://developer.blender.org/D10675
2021-03-09 21:21:08 +01:00
dcd7dacc4f Graph Editor: FCurve Show Extrapolation Toggle
Adds toggle to graph editor (View->Show Extrapolation). When disabled,
then fcurves only draw over the keyframe range. For baked fcurves and
ghost fcurves, the range is all sampled points.

It is intended for frequent use so anybody could assign hotkey or add
to quick favorites that's why GE-View is the best place for it.

Show Extrapolation is the default.

Reviewed By: sybren, Stan1, looch

Differential Revision: http://developer.blender.org/D10442
2021-03-09 15:09:09 -05:00
cfd7b4d1cd BLI: New 'BLI_array_iter_spiral_square'
No functional changes.

This function replaces some of the logic in
`DRW_select_buffer_find_nearest_to_point` that traverses a buffer in a
spiral way to search for a closer pixel (not the closest).

Differential Revision: https://developer.blender.org/D10548
2021-03-09 16:03:56 -03:00
80f7f1070f Geometry Nodes: Add Attribute interpolation for polygon domains
This commit adds interpolation to and from attribute on the polygon
domain. Interpolation is done automatically when a node uses attributes
on two different domains. The following are the new interpolations and
corresponding simple test cases:
- **Point to Polygon**: Painting the shade smooth attribute in weight
  paint mode
- **Polygon to Point**: Moving points along a normal based on the
  material index
- **Polygon to Corner**: Scaling a UV map with the material index
  before sampling a texture

{F9881516}

This is also necessary for an improved implementation of the `normal`
attribute.

Differential Revision: https://developer.blender.org/D10393
2021-03-09 13:39:05 -05:00
996586860b Cleanup: Do not pass stack allocated string to MEM_callocN 2021-03-09 13:31:51 -05:00
3f7b585a08 Fix crash in boundary brush after refactor
A missing continue in this loop.

Reviewed By: JacquesLucke

Differential Revision: https://developer.blender.org/D10610
2021-03-09 18:56:19 +01:00
e5c1e13ef0 Sculpt: Init Face Sets by Face Sets boundaries
This adds an extra option to the Face Sets Init operator to initialize
individual Face Sets based on the current Face Sets boundaries.
In particular, this is useful for splitting the patterns created by
Expand into individual Face Sets for further editing.

Reviewed By: JacquesLucke

Differential Revision: https://developer.blender.org/D10608
2021-03-09 18:55:20 +01:00
b1ef55abdb Cleanup: Document ensure()-like behaviour of KeyMaps.new()
Document the fact that `bpy.types.KeyMaps.new()` will not create a new
keymap but instead return an existing one, if one with the given
name/space/region already exists.

No functional changes.
2021-03-09 17:42:23 +01:00
8351e2d4b9 Cleanup: add missing full stop to docstring of function
No functional changes.
2021-03-09 17:42:23 +01:00
Corbin Dunn
4069016de8 macOS/Ghost: Simplify pasteboard and screen count code
Reviewed By: #platform_macos, sebbas, ankitm
Differential Revision: https://developer.blender.org/D10616
2021-03-09 21:38:47 +05:30
Corbin Dunn
9d046019e2 macOS/Ghost: Remove unnecessary nil checks.
Reviewed By: #platform_macos, sebbas, ankitm
Differential Revision: https://developer.blender.org/D10616
2021-03-09 21:38:44 +05:30
Corbin Dunn
cd1e6df534 macOS/Ghost: Replace NSAutoreleasePool with @autoreleasepool
- Automatic and guaranteed cleanup.
- Improves readability and reduces chances of errors by removing
`[pool drain]` statements.

Reviewed By: #platform_macos, sebbas, ankitm
Differential Revision: https://developer.blender.org/D10616
2021-03-09 21:38:41 +05:30
04e816bd11 Fix T86432: missing check if attribute is available
This failed when the component did exist, but did not contain any data.
2021-03-09 17:00:17 +01:00
c6a831cfbc Cleanup: use raw strings. 2021-03-09 16:50:47 +01:00
077beb738c Cleanup: use nullptr in cpp. 2021-03-09 16:34:43 +01:00
0700441578 Geometry Nodes: Expose "shade smooth" as an attribute
This patch exposes the "Shade Smooth" value as a boolean attribute.
This setting is exposed as a check-box in the mesh data properties,
but the value is actually stored for every face, allowing some faces
to be shaded smooth with a simple per-face control.

One bonus, this allows at least a workaround to the lack of control
of whether meshes created by nodes are shaded smooth or not: just use
an attribute fill node.

Differential Revision: https://developer.blender.org/D10538
2021-03-09 09:27:44 -05:00
Jeroen Bakker
eaada56591 Cleanup: add resource manager for cryptomatte session.
Auto frees cryptomatte session when it the pointer is collected from the
stack.

Reviewed By: Jacques Lucke

Differential Revision: https://developer.blender.org/D10667
2021-03-09 15:19:12 +01:00
cdb0b3cedc Compositor: Silence -Wself-assign
Use member initializer list for constructor.
Use `this->` for member function.
Introduced in rBef53859d24a9720882e3ca6c5415faefec6fb82c

Reviewed By: jbakker
Differential Revision: https://developer.blender.org/D10653
2021-03-09 19:19:21 +05:30
be6b3923f5 Compositor: silence clang/clang-tidy override warnings
`-Winconsistent-missing-override` and `modernize-use-override`.

Reviewed By: jbakker
Differential Revision: https://developer.blender.org/D10654
2021-03-09 19:19:08 +05:30
6114d909d6 Fix T86417: Crash deleting Shader AOV from an empty list
Missing NULL check in {rB2bae11d5c08a}.

Candidate for corrective release I guess.

Maniphest Tasks: T86417

Differential Revision: https://developer.blender.org/D10666
2021-03-09 14:45:38 +01:00
68ff213cd4 Cleanup: Correct area writing function name
This function writes areas, not regions. The old name read as if it was
regions.
2021-03-09 14:18:09 +01:00
7f9b6b1dc9 Sculpt: 'Unifiy' Dyntopo Detail Size operators
Prior to rB99a7c917eab7, Shift + D was used to set detail size for both
constant and relative detail (using radial control). The commit added an
improved operator for doing this for constant detail (showing the
triangle grid representation), but left the user without a shortcut to
do this for relative detail.

Interestingly rB99a7c917eab7 only changed this for the Blender keymap,
the Industy Compatible keymap still has the "old" entry.

This patch changes both keymaps to have both entries.

For user experience, the real change here is to have both available on
one 'primary' shortcut (Shift+D), the improved
'dyntopo_detail_size_edit' operator will now act on all possible cases.
If it deals with constant detail, it acts as before, if it deals with
relative detail etc, it will fallback to the "old" way of doing it via
radial control instead. I assume this adresses what was stated in
rB99a7c917eab7: "Deciding if both detail sizes can be unified needs a
separate discussion"

Also, move dyntopo_detail_size_edit to sculpt_detail.c

Fixes T83828

Maniphest Tasks: T83828

Differential Revision: https://developer.blender.org/D9871
2021-03-09 13:55:37 +01:00
2283b6ef69 Fix the session UUID being set for temporary blend file data
Triggered by temporarily appending library linked data from Python.
2021-03-09 23:47:43 +11:00
07a9d39f57 Fix: unconnected multi socket input crashes
The crash would only happen when the output of the Join Geometry node is used.
2021-03-09 09:45:18 +01:00
dc3e9048ae Cleanup: fix warnings 2021-03-09 09:31:14 +01:00
745576b16e UI: Clean up sub-panel for new boolean modifier options
A few changes to make this consistent with other modifier panels:
 - Title case for UI labels
 - Use property split (and therefore decorators)
 - Declare sublayout variables after getting modifier info
2021-03-08 22:22:16 -05:00
d25ab68cf4 Cleanup: Complete earlier geometry component refactor
This was meant to be part of rB9ce950daabbf, but the change dropped from
the set at some point in the process of updating and committing.
Sorry for the noise.
2021-03-08 16:31:51 -05:00
8df968d69f "Show Texture in texture tab" button: full support for Sculpt / Paint
In {rBb279fef85d1a} the button that displays a texture in a Properties
Editor texture tab was added for geometry nodes.
Same commit will actually show them for Brush textures as well (but
disabled -- because the Texture users dont match).
This task is for finanlizing proper support for Brush textures as well.
There was originally a separate patch for this (see {D9813}) but most of
it was already implemented by above commit.

**what this solves**
from the default startup file:
- go to any sculpt or paint mode and add a texture to your brush
- observe the button to edit this texture in the Properties editor is
greyed out

{F9860470}

There are two possible solutions:
- [1] call the texture template for the brush `texture_slot` texture
(instead of the brush 'texture') from the python UI code, this is then
working in harmony how ButsTextureUser works for brushes
- [2] tweak the way `ButsTextureUser` works (dont rely on
`RNA_BrushTextureSlot` there)

This patch implements the first solution.
Since `brush.texture_slot` is `br->mtex` RNA wrapped and `brush.texture`
is `br->mtex.tex` RNA wrapped, this really comes down to doing the same
thing. I checked that creating a new texture and unlinking/deleting will
have the same results even though they take slightly different code
paths: assignment and NULLing the pointers are working on the same (see
above) and RNA update callbacks also do the same [even though in
different functions]:
- brush.texture will do rna_Brush_main_tex_update
- brush.texture_slot.texture will do rna_TextureSlotTexture_update /
rna_TextureSlot_update
(only difference here is an additional DEG relations update in the case
of texture_slot which should not do harm)

Differential Revision: https://developer.blender.org/D10626
2021-03-08 19:38:35 +01:00
2e19509e60 Geometry Nodes: Rename subdivision nodes
This makes the following changes to the name of the two
geometry nodes subvision nodes:
 - `Subdivision Surface` -> `Subdivide Smooth`
 - `Subdivision Surface Simple` -> `Subdivide`
Most of the benefit is that the names are shorter, but it also better
mirrors the naming of operations in edit mode, and phrases the names
more like actions. This was discussed with the geometry nodes team.
2021-03-08 13:37:49 -05:00
Mark Stead
a45af290f3 Fix T86357: EEVEE: Shadows: Casters have exponential performance degradation with many objects
When you have many distinct objects, in an Eevee render then the shadow caster gets exponentially slower as the number of (distinct) objects increase.

This is because of the way that frontbuffer->bbox (EEVEE_BoundBox array) and the associated frontbuffer->update bitmap are resized.
Currently the resizing is done by reserving space for SH_CASTER_ALLOC_CHUNK (32) objects at a time.
When the number of objects is large, then the MEM_reallocN() gets progressively slower because it must memcpy the entire bbox/bitmap data to the new memory chunk.
And there will be a lot of *memcpy* operations for a large scene.
(Obviously there are a significant number of memory allocations/deallocations too - though this would be linear performance.)

I've switched to doubling the frontbuffer->alloc_count (buffer capacity) instead of adding SH_CASTER_ALLOC_CHUNK (32).  As I understand this is the only way to eliminate exponential slowdown.  Just increasing the size of SH_CASTER_ALLOC_CHUNK would still result in exponential slowdown eventually.

In other changes, the "+ 1" in this expression is not necessary.
if (id + 1 >= frontbuffer->alloc_count)
The buffer is 0-based.  So when the buffer is initially allocated then id values from bbox[0] to bbox[31] are valid.  Hence when frontbuffer->count == frontbuffer->alloc_count, is when the resizing should be triggered.
As it stands the "+ 1" results in resizing the buffer, when there is still capacity for one more object in the buffer.

I've changed the initial buffer allocation to use MEM_mallocN() instead of MEM_callocN().  The difference is that malloc() doesn't memset buffer (with zeros) when allocated.  I've checked the code where new bbox records are created, and it does not rely on the buffer being initialised with zeros.
Anyway, isn't calloc() safer than using malloc()?  Well no, it's actually the opposite in this case.  Every time the buffer size is increased, it is done using realloc(), and this does not zero-out the uniniitialised portion of the buffer.  So the code would break if it was modified to assume that the buffer contains zeros.  Hence I believe initialising the buffer using calloc() could be misleading to a new developer.

Won't this result in increased memory usage?  Yes, if you have millions of objects in your scene, then you are potentially using up-to twice the memory for the shadow caster.  (However if you have millions of objects in your scene you're probably finding the Eevee render times a slow.)
Note that once the render gets going the frontbuffer bbox/bitmap will be shrunk to a multiple of SH_CASTER_ALLOC_CHUNK (32), therefore releasing the overallocation of memory.
As observed in Visual Studio - this appears to be prior to peak memory usage anyway.
Note this shrinking is executed in EEVEE_shadows_update() - during the first render sample pass.  If necessary you could consider shrinking the buffer immediately after the EEVEE_shadows_caster_register() has done it's work.  (Note however it appears you would need to add that function call is multiple places.)
Anyway as per the bug report I raised, I observed a 5% increase in peak-memory.  And I'm unclear whether this difference in memory is due to me running the debug build.  (It could be that there is no difference because of the shrinking.)

I couldn't figure out how the shadow caster backbuffer works.  I see that EEVEE_shadows_init() has an explicit command to swap the front/back buffers.  However this is done only when the buffers are first initialised and there is nothing in there yet.  In my testing, the backbuffer->count was always zero, EEVEE_shadows_update() never did anything with the backbuffer.

Finally this problem is most evident when using Geometry Nodes or a Particle System to instantiate many objects.  Objects created through say the array modifier do not cause any issues because it is considered one object by the shadow caster.

Reviewed By: #eevee_viewport, fclem

Differential Revision: https://developer.blender.org/D10631
2021-03-08 18:51:48 +01:00
84a4f2ae68 Geometry Nodes: Improve performance of point distribute node
This commit refactors the point distribute node to skip realizing
the instances created by the point instance node or the collection
and object info nodes. Realizing instances is not necessary here
because it copies all the mesh data and and interpolates all
attributes from the instances when this operation does not
need to modify the input geometry at all.

In the tree leaves test file this patch improves the performance of
the node by about 14%. That's not very much, the gain is likely larger
for more complicated input instances with more attributes (especially
attributes on different domains, where interpolation would be necessary
to join all of the instances). Another possible performance improvement
would be to parallelize the code in this node where possible.

The point distribution code unfortunately gets quite a bit more
complicated because it has to handle the complexity of having many
inputs instead of just one.

Note that this commit changes the randomness of the distribution
in some cases, as if the seed input had changed.

Differential Revision: https://developer.blender.org/D10596
2021-03-08 12:45:06 -05:00
fc0de69471 Cleanup: Split up new files for Outliner ID tree-elements
Splits up `tree_element_id.cc`/`tree_element_id.hh`.
If we move all ID types into this one file, it will become rather big. Smaller
files are probably easier to work with. We could still keep small classes like
`TreeElementIDLibrary` in the general file, don't mind really, but this creates
separate files for that too.
2021-03-08 18:38:23 +01:00
f0ad78e17c Cleanup: Rename recently added Outliner files to exclude "_base" suffix
These files can contain more than just the "base" tree element types. E.g. the
class for the view-layer base element can also contain the class for the
view-layer elements. Otherwise we'd end up with like >50 files for the
individual types, most of them very small.
So just give the files a general name and put the related classes in there.
2021-03-08 18:38:23 +01:00
4292bb060d Outliner: Port scene elements and some related types to new tree-element code design
Continuation of work in 2e221de4ce, 249e4df110 and 3a907e7425.

Adds new tree-element classes for the scene-ID, scene collections, scene
objects, and the view layers base.
There is some more temporary stuff in here, which can be removed once we're
further along with the porting. Noted that in comments.
2021-03-08 18:38:23 +01:00
8771f015f5 Python version of make_source_archive.sh
This is a Python version of the existing `make_source_archive.sh`
script. IMO it's easier to read, and it'll also be easier to extend with
the necessary functionality for D10598.

The number of lines of code is larger than `make_source_archive.sh`, but
it has considerably less invocations of `awk` ;-) And also the filtering
is integrated, instead of forking out to Python to prevent certain files
to be included in the tarball.

Reviewed By: dfelinto, campbellbarton

Differential Revision: https://developer.blender.org/D10629
2021-03-08 18:10:26 +01:00
9ce950daab Cleanup: Move geometry component implementations to separate files
Currently the implementations specific to each geometry type are in
the same file. This makes it difficult to tell which code is generic
for all component types and which is specific to a certain type.
The two files, `attribute_access.cc`, and `geometry_set.cc` are
also getting quite long.

This commit splits up the implementation for every geometry component,
and adds an internal header file for the common parts of the attribute
access code. This was discussed with Jacques Lucke.
2021-03-08 11:41:23 -05:00
bf799cb12c Fix T81741 EEVEE: Ambient Occlusion does not converge properly
This was due to the AO random sampling using the same "seed" as
the AA jitter. Decorelating the noise fixes the issue.
2021-03-08 17:25:38 +01:00
30cb4326fe EEVEE: Ambient Occlusion: Add sample parameter support for the AO node
The actual sample count is rounded up to a multiple of 4 because we
sample 4 horizons directions.

Changing this setting forces the shader to recompile (because using a
GPU_constant).
2021-03-08 17:25:38 +01:00
1540f1df07 EEVEE: RenderPass: Improve AO pass if screen space radius is small
This just bypass the occlusion computation if there is no occlusion
data. This avoids weird looking occlusion due to the screen space
geometric normal reconstruction.
2021-03-08 17:25:38 +01:00
0983e66e03 EEVEE: Occlusion: Use ScreenSpaceRay for iteration
The sampling is now optimum with every samples being at least one pixel
appart. Also use a squared repartition to improve the sampling near the
center.

This also removes the thickness heuristic since it seems to remove
a lot of details and bias the AO too much.
2021-03-08 17:25:38 +01:00
5db5966cdb EEVEE: Sampling: Split hemisphere sampling just like GGX
This is useful for debugging raycasting.
2021-03-08 17:25:16 +01:00
6842c549bb EEVEE: SSRayTrace: Cleanup/Refactor
This is a major rewrite that improves the screen space raytracing
a little bit.

This also decouple ray preparation from raytracing to be reuse in other
part of the code.

This changes a few things:
- Reflections have lower grazing angle failure
- Reflections have less self intersection issues
- Contact shadows are now fully opaque (faster)

Unrelated but some self intersection / incorrect bad rays are caused by
the ray reconstruction technique used by the SSR. This is not fixed by
this commit but I added a TODO.
2021-03-08 17:25:16 +01:00
ba75ea8012 EEVEE: Use Fullscreen maxZBuffer instead of halfres
This removes the need for per mipmap scalling factor and trilinear interpolation
issues. We pad the texture so that all mipmaps have pixels in the next mip.

This simplifies the downsampling shader too.

This also change the SSR radiance buffer as well in the same fashion.
2021-03-08 17:25:16 +01:00
6afe2d373a Fix ID preview not updating in Asset Browser
Fix ID preview not updating in Asset Browser, by actually sending an
explicit `NA_EDITED` along with the `NC_ASSET` notifier.
2021-03-08 17:20:23 +01:00
a6a8ca9212 Fix T86063: support 'Relative Path' setting opening (alembic) caches
This was reported as opening alembic caches ignoring the
'use_relative_paths' preference, but this operator just did not have
this setting. Fortunately, adding this is just a simple switch.

Maniphest Tasks: T86063

Differential Revision: https://developer.blender.org/D10568
2021-03-08 17:01:03 +01:00
1aa59464b6 Cleanup: Move LibOverride debug prints to CLOG. 2021-03-08 16:53:16 +01:00
9cb5f0a228 Spreadsheet: add boilerplate code for new editor type
This adds the initial boilerplate code that is required to introduce
the new spreadsheet editor. The editor is still hidden from the ui.

It can be made visible by undoing the change in `rna_screen.c`.

This patch does not contain any business logic for the spreadsheet editor.

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

Ref T86279.
2021-03-08 16:25:08 +01:00
d230c9b96c Alembic: avoid red overwrite warning when opening a file
Pass `FILE_OPENFILE` instead of `FILE_SAVE` when selecting a file for
reading.
2021-03-08 15:49:16 +01:00
5a67407d5a File Browser: scroll selected files into view
Add operator `FILE_OT_view_selected` to the file browser (and thus also
to the asset browser) that scrolls selected files into view.

This includes the active file, even though it is not selected. In
certain cases the active file can loose its selected state (clicking
next to it, or refreshing the asset browser), but then it's still shown
in the right-hand sidebar. Because of this, I found it important to take
it into account when scrolling.

This also includes a change to the keymaps:
- Blender default: {key NUMPAD_PERIOD} is removed from the "reload"
  operator, and assigned to the new "view selected files" operator. The
  reload operator was already doubly bound, and now {key R} is the only
  remaining hotkey for it.
- Industry compatible: {key F} is assigned to the new "view selected
  files" operator. This is consistent with the other "view selected"
  operators in other editors.

Reviewed By: Severin

Differential Revision: https://developer.blender.org/D10583
2021-03-08 15:21:34 +01:00
e20b31504a Fix T86347: Add Primitive Tool fails for 1x1x1 scale
The Tool stores desired dimensions as `scale` and thus had to half the
scale again in `make_prim_init()` because by default all primitives are
created at a size of 2 in blender.

This worked, but:
- [1] it logged something like size=2, scale=2,2,2 for a 2x2x2 cube
[which does not sound right, it should be size=2 scale=1,1,1]
- [2] it had to make an exception for the case scale is exactly 1x1x1
[this happens when the property is not set specifically, e.g. adding
primitives from the menu]
-- this exception led to double sized primitives being created when the
tool asked for exact dimensions of 1x1x1

Now - instead of compensating in `make_prim_init()` - do this earlier in
the tool itself, see `view3d_interactive_add_modal`, this fixes the bug
and now also correctly logs size=2 scale 0.5,0.5,0.5 for a 1x1x1 cube.

Maniphest Tasks: T86347

Differential Revision: https://developer.blender.org/D10632
2021-03-08 15:18:16 +01:00
91825ebfe2 UI: UVProject modifier: clarify aspect & scale are only for camera
projectors

Make this clear in property UI descriptions and deactivate aspect &
scale fields if no camera projectors are present.

ref T86268

Maniphest Tasks: T86268

Differential Revision: https://developer.blender.org/D10634
2021-03-08 15:09:17 +01:00
9e09214979 PyAPI: add bpy.types.BlendFile.temp_data for temporary library loading
This adds support for creating a `BlendFile` (internally called `Main`),
which is limited to a context.

Temporary data can now be created which can then use
`.libraries.load()` the same as with `bpy.data`.

To prevent errors caused by mixing the temporary ID's with data in
`bpy.data` they are tagged as temporary so they can't be assigned
to properties, however they can be passed as arguments to functions.

Reviewed By: mont29, sybren

Ref D10612
2021-03-09 01:01:31 +11:00
cfd11af981 readfile: add id_tag_extra argument
This allows adding ID tags when linking/loading data.

This is needed to implement loading non 'G.main' ID data-blocks,
see D10612.
2021-03-09 00:55:55 +11:00
09a8f5ebca Fix T86384: Click detection fails in some cases with modifiers
Regression in b5d154f400
2021-03-09 00:44:46 +11:00
Germano Cavalcante
b6c07d69e2 Fix T86106: bpy.types.SpaceView3D.draw_handler_remove(...) causes Blender to crash
The handle of a drawing callback can be removed within the drawing function itself.

This causes `var = (type)(((Link *)(var))->next` to read an invalid memory value in C.
2021-03-08 10:38:11 -03:00
171ba42439 Fix error in unused argument cleanup
Bad keyword argument rename from
9dc0c44aa1
2021-03-09 00:25:46 +11:00
3669a3e2e9 Fix Cycles CUDA build error with Visual Studio 2019 v16.9
Something in this update broke the floor() function in CUDA, instead use
floorf() like we do everywhere else in the kernel code. Thanks to Ray
Molenkamp for identifying the solution.
2021-03-08 14:06:16 +01:00
240e721dd3 Fix T86210: No preview icons for non-8bit images
It looks like we never generated correct icon previews for images with
float_rects (non-8bit-images). Images from the report were 16bit pngs.

In this case, `icon_preview_startjob` would return early (it only
checked if the ImBuf `rect` was NULL -- which is the case if it has a
`rect_float` instead). This is not neccessary since `icon_copy_rect` is
perfectly capable of taking float rects.

Now correct the check and only return early if both `rect` & `rect_float`
are NULL.

note: this will not refresh icon previews from existing files
automatically. For this, use File > Data Previews > Clear Data-Block
Previews.

Maniphest Tasks: T86210

Differential Revision: https://developer.blender.org/D10601
2021-03-08 13:51:56 +01:00
9ba1ff1c63 Fix T86373: crash picking colors in geometry nodesockets
Caused by {rB85421c4fab02}.

Above commit treated `SOCK_RGBA` and `SOCK_STRING` the same in
`std_node_socket_draw`.
That would turn a RGBA button into a text button (for attribute search),
leading to trouble.
Note these were just treated the same prior to above commit because both
were doing the layout split.

Now just give RGBA sockets their own case.

Maniphest Tasks: T86373

Differential Revision: https://developer.blender.org/D10646
2021-03-08 13:47:39 +01:00
1775ea74c1 Cleanup: Change extension .cpp to .cc 2021-03-08 13:41:52 +01:00
b9cd2f4531 Revert "Fix modernize-raw-string-literal complaints from clang-tidy."
This reverts commit 7a34bd7c28.

Broke windows build. Can apparently fix with /Zc:preprocessor flag
for windows but need a Windows dev to make that fix.
2021-03-08 06:45:45 -05:00
e9e53ff3a6 Cleanup: Removed duplicate slash in macOS SDK path
Cleanup although it's harmless.
2021-03-08 11:55:35 +01:00
Leon Leno
e12ad2bce0 Geometry Nodes: support Vector Rotate node
Differential Revision: https://developer.blender.org/D10410
2021-03-08 11:37:37 +01:00
2b9eea17cc Particles: change default name to "ParticleSystem"
Since {rB7a6b46aac56b}, particle systems were named "ParticleSettings"
by default, same as particle settings themselves. These are not the same
thing and their names should reflect that.

Issue came up in T86366.

Now name them "ParticleSystem" by default, name uniqueness is preserved
for both system and settings.

Maniphest Tasks: T86366

Differential Revision: https://developer.blender.org/D10641
2021-03-08 10:47:27 +01:00
74c50d0c77 Cleanup: Remove unused variable. 2021-03-08 08:52:43 +01:00
cbf033c055 Fix T86026: Crash Opening Cryptomatte File.
But this time the root cause. Writing undo files is done in a separate
thread. This patch moved the updating of the matte_id when the user
actually changes the matte.
2021-03-08 08:47:22 +01:00
89757f918c Revert "Fix T86026: Crash Opening Cryptomatte File."
This reverts commit 7f36498740.
2021-03-08 08:28:31 +01:00
a1bc7729f2 Cleanup: use ofs instead of offs as an abbreviation for offset
Used for local structs/variables,
since `ofs` is by far the most widely used abbreviation.
2021-03-08 14:54:23 +11:00
b4f5128b21 Cleanup: rename offs to offset 2021-03-08 14:44:57 +11:00
242a278b56 Cleanup: rename offs to offscreen 2021-03-08 14:40:57 +11:00
c950e08cbb Cleanup: add use prefix for boolean 2021-03-08 14:39:28 +11:00
1ba15f1f7f Speedup for usual non-manifold exact boolean case.
The commit rB6f63417b500d that made exact boolean work on meshes
with holes (like Suzanne) unfortunately dramatically slowed things
down on other non-manifold meshes that don't have holes and didn't
need the per-triangle insideness test.
This adds a hole_tolerant parameter, false by default, that the user
can enable to get good results on non-manifold meshes with holes.
Using false for this parameter speeds up the time from 90 seconds
to 10 seconds on an example with 1.2M triangles.
2021-03-07 18:13:19 -05:00
7a34bd7c28 Fix modernize-raw-string-literal complaints from clang-tidy. 2021-03-07 17:03:24 -05:00
239a7d93ae Cleanup: fix compiler warning 2021-03-07 18:05:25 +01:00
74979459cb Geometry Nodes: simplify allocating dynamically sized buffer on stack 2021-03-07 17:53:05 +01:00
9c8382e618 Cleanup: do not pass class member to class methods 2021-03-07 17:22:00 +01:00
00f218602d Alembic procedural: fix missing update when only the transforms change
The missing update has two sources:

The TimeSampling used for looking up transformations in the cache was
uninitialized. To fix this, simply use the TimeSampling from the last
transformation in the hierarchy (that is the object's parent), which
should also contain the time information for all of its parents.

The objects are not tagged for update when their trasformations change.
2021-03-07 17:16:16 +01:00
ac4d45dbf1 Alembic procedural: fix infinite update loop when modifying Object level properties 2021-03-07 17:16:16 +01:00
111a77e818 Cleanup: remove dead code 2021-03-07 17:03:20 +01:00
a9fc9ce0ae Cleanup: remove dead code 2021-03-07 16:08:59 +01:00
b30f89918e Fix T85632 Improve Exact boolean in cell fracture of Suzanne.
The Exact boolean used in the cell fracture addon incorrectly
kept some outside faces: due to some raycasts going into open
eye socket then out of the head, leading to one ray direction
(out of 8) saying the face was inside the head. The current
code allowed 1 of 8 rays only as "inside" to accommodate the
case of a plane used in boolean to bisect. But this cell fracture
case needs more confidence of being inside. So changed the
test for intersection to require at least 3 of 8 rays to be inside.

Maybe the number of rays to indicate insideness should be exposed
as an option, to allow user tuning according to the degree of
"non-volumeness" of the arguments, but will try at least for now
to magically guess the right value of the rays-inside threshold.

Note: all of this only for the case where the arguments are not
all PWN (approx: manifold). The all-PWN case doesn't use raycast.
2021-03-07 08:55:11 -05:00
e72dc1e6c6 Cleanup: compiler warnings 2021-03-07 14:46:48 +01:00
c14770370f Cleanup: fix implicit conversion warning 2021-03-07 14:27:08 +01:00
649916f098 BLI: make it harder to forget to destruct a value
Instead of returning a raw pointer, `LinearAllocator.construct(...)` now returns
a `destruct_ptr`, which is similar to `unique_ptr`, but does not deallocate
the memory and only calls the destructor instead.
2021-03-07 14:24:52 +01:00
456d3cc85e BLI: reduce wasted memory in linear allocator
The main change is that large allocations are done separately now.
Also, buffers that small allocations are packed into, have a maximum
size now. Using larger buffers does not really provider performance
benefits, but increases wasted memory.
2021-03-07 14:15:20 +01:00
84da76a96c Cleanup: use POINTER_OFFSET macro 2021-03-07 19:27:11 +11:00
8618c4159c Cleanup: use class instead of struct in forward declaration 2021-03-06 17:54:28 +01:00
9828882b8e Cleanup: clang tidy 2021-03-06 16:54:09 +01:00
d2869943d2 Nodes: refactor derived node tree
This is a complete rewrite of the derived node tree data structure.
It is a much thinner abstraction about `NodeTreeRef` than before.
This gives the user of the derived node tree more control and allows
for greater introspection capabilities (e.g. before muted nodes were
completely abstracted away; this was convenient, but came with
limitations).

Another nice benefit of the new structure is that it is much cheaper
to build, because it does not inline all nodes and sockets in nested
node groups.

Differential Revision: https://developer.blender.org/D10620
2021-03-06 16:51:06 +01:00
cfd766cebd Fix T86308 Crash in Exact Boolean when have custom normal layer.
Custom Normal layers can't be interpolated, so needed a check
for non-interpolatable layers before trying to interpolate.
2021-03-06 09:05:55 -05:00
11efc9087b Cleanup: remove workaround for Python 3.7x crashing with libedit
This removes workaround for T43491. It's no longer needed as
Python 3.9x supports libedit as an alternative to readline
on all platforms.
2021-03-06 19:31:49 +11:00
995bb0860a Cleanup: remove redundant draw callback 2021-03-06 19:26:18 +11:00
37793b90be Cleanup: unused imports 2021-03-06 19:26:18 +11:00
9dc0c44aa1 Cleanup: unused arguments 2021-03-06 19:26:18 +11:00
bd79691599 Cleanup: unused variables 2021-03-06 19:00:18 +11:00
753f1cf0ad Cleanup: redundant pose bone assignment 2021-03-06 18:33:54 +11:00
b22b037229 Cleanup: rename wm_get_cursor_position
Match naming of other wm_cursor_position_* functions.
2021-03-06 18:33:54 +11:00
3bc406274b Cleanup: comments 2021-03-06 18:33:54 +11:00
f117ea2624 Geometry Nodes: Expose vertex normals as an attribute
This attribute exposes mesh vertex normals as a `vertex_normal`
attribute for use with nodes. Since the normal vector stored in
vertices is only a cache of data computable from the surrounding faces,
the attribute is read-only. A proper error message for attempting to
write this attribute is part of T85749. A write-only normal attribute
will likely come later, most likely called `corner_normal`.

The normals are recomputed before reading if they are marked dirty.
This involves const write-access to the mesh, protected by the mutex
stored in `Mesh_Runtime`. This is essential for correct behavior after
nodes like "Edge Split" or nodes that adjust the position attribute.

Ref T84297, T85880, T86206

Differential Revision: https://developer.blender.org/D10541
2021-03-05 15:16:25 -06:00
becc36cce5 Geometry Nodes: Sort attribute search items when menu opens
Because the search didn't run when the menu first opens, the attributes
appeared in a different order than after you typed anything into the
search field. This commit instead runs the search when the menu
is first opened, but it only sorts items without filtering.
2021-03-05 14:45:09 -06:00
4addcf1efc Cleanup: Remove redundant special handling after previous commit
Not needed anymore since 3a907e7425.
2021-03-05 18:14:56 +01:00
3a907e7425 Outliner: Barebones to port IDs to new Outliner tree-element code design
Continuation of work in 2e221de4ce and 249e4df110 .
This prepares things so we can start porting the individual ID types to
the new code design. I already added some code for library IDs, because
they need some special handling during construction, which I didn't want
to break.

The `AbstractTreeElement::isExpandValid()` check can be removed once
types were ported and can be assumed to have a proper `expand()`
implemenation.

Also makes `TreeElementGPencilLayer` `final` which I forgot in
e0442a955b.
2021-03-05 18:07:35 +01:00
ae005393dc Fix incorrect assert in Outliner ID deletion
Mistake in aa3a4973a3. The expanded `ELEM()` check would include
`0 && te->idcode != 0`, which always evaluates to `false`/`0`. That
wouldn't cause the asset to fail, but the `te->idcode` part would never
be checked.

Fixed the error and cleaned up the check against "0" with a check
against `TSE_SOME_ID`, see b9e54566e3.
2021-03-05 17:46:49 +01:00
b9e54566e3 Cleanup: Add & use enum value for ID Outliner element type
Code to check if the Outliner tree-element type was the general ID one
would always check against "0" (explicity or even implicitly). For
somebody unfamiliar with the code this is very confusing. Instead the
value should be given a name, e.g. through an enum.

Adds `TSE_SOME_ID` as the "default" ID tree-element type. Other types
may still represent IDs, as I explained in a comment at the definition.

There may also still be cases where the type is checked against "0". I
noted in the comment that such cases should be cleaned up if found.
2021-03-05 17:46:33 +01:00
ed84161529 Cleanup: Rename func occurences to _fn
Use _fn as a suffix for callbacks.
2021-03-05 17:35:35 +01:00
f882bee431 Fix crash with pinned geometry node tree with no active object
The check for a null active object was after trying to retrieve the active
modifier from the object.
2021-03-05 10:13:42 -06:00
d5c727c6ea Fix windows compilation. 2021-03-05 16:08:11 +01:00
ffd5b0d91e Cleanup: Use blender::Vector. 2021-03-05 16:56:14 +01:00
0729376a13 Fix: compilation OpenCL kernels Compositor.
introduced during cleanup.
2021-03-05 16:56:14 +01:00
d4c673d4c6 Cleanup: use blender::Vector. 2021-03-05 16:56:14 +01:00
7c8ec99b9a Cleanup: use blender::Vector. 2021-03-05 16:56:14 +01:00
7bccbce512 Cleanup: use snake case. 2021-03-05 16:56:14 +01:00
921138cf5f Cleanup: rename private attribtue m_max_read_buffer_offset. 2021-03-05 16:56:14 +01:00
87842d6388 Cleanup: Use blender::Vector in ExecutionGroup. 2021-03-05 16:56:14 +01:00
fde150fee4 Cleanup: Use std::Vector for chunk execution status. 2021-03-05 16:56:14 +01:00
e1d9b095e4 Cleanup: Use enum class for eChunkExecutionState. 2021-03-05 16:56:14 +01:00
3d4a844a50 Cleanup: ExecutionSystem::find_output_execution_groups. 2021-03-05 16:56:14 +01:00
8b2fb7aeed Cleanup: Remove unused method. 2021-03-05 16:56:14 +01:00
6ebd34c802 Cleanup: Make WorkPackage a struct 2021-03-05 16:56:14 +01:00
ba5961b4cd Cleanup: use MIN2/MAX2 in compositor. 2021-03-05 16:56:14 +01:00
3d3a5bb892 Cleanup: Remove using statements. 2021-03-05 16:56:14 +01:00
bf030decd4 Animation: add function to apply a pose from an Action
Add `BKE_pose_apply_action(object, action, anim_eval_context)` function
and expose in RNA as `Pose.apply_action(action, evaluation_time)`.

This makes it possible to do the following:

- Have a rig in pose mode.
- Select a subset of the bones.
- Have some Action loaded that contains the pose you want to apply.
- Run `C.object.pose.apply_pose_from_action(D.actions['PoseName'])`
- The selected bones are now posed as determined by the Action.

Just like Blender's current pose library, having no bones selected acts
the same as having all bones selected.

Manifest Task: T86159

Reviewed By: Severin

Differential Revision: https://developer.blender.org/D10578
2021-03-05 16:35:08 +01:00
8d0fbcd6df Nodes: move vector rotate node to C++
This makes it easier to add an implementation that can
be used in Geometry Nodes.

There should be no functional changes.
2021-03-05 16:09:19 +01:00
fe35551df2 Asset Browser Space API: add activate_asset_by_id() function
Add an RNA function `activate_asset_by_id(asset_id: ID, deferred: bool)`
to the File Browser space type, which intended to be used to activate an
asset's entry as identified by its `ID *`. Calling it changes the active
asset, but only if the given ID can actually be found.

The activation can be deferred (by passing `deferred=True`) until the
next refresh operation has finished. This is necessary when an asset has
just been added, as it will be loaded by the filebrowser in a background
job.

Reviewed By: Severin

Differential Revision: https://developer.blender.org/D10549
2021-03-05 15:11:40 +01:00
0dd9a4a576 Cleanup: Libmv, clang-format
Is based on Google style which was used in the Libmv project before,
but is now consistently applied for the sources of the library itself
and to C-API. With some time C-API will likely be removed, and it
makes it easier to make it follow Libmv style, hence the diversion
from Blender's style.

There are quite some exceptions (clang-format off) in the code around
Eigen matrix initialization. It is rather annoying, and there could be
some neat way to make initialization readable without such exception.

Could be some places where loss of readability in matrix initialization
got lost as the change is quite big. If this has happened it is easier
to address readability once actually working on the code.

This change allowed to spot some missing header guards, so that's nice.

Doing it in bundled version, as the upstream library needs to have some
of the recent development ported over from bundle to upstream.

There should be no functional changes.
2021-03-05 15:05:08 +01:00
e0442a955b UI Code Quality: Port Outliner Grease Pencil layers to new design
Continuation of work in 2e221de4ce and 249e4df110. Now the tree-element
types have to be ported one by one. This is probably the most straight forward
type to port.
2021-03-05 14:45:46 +01:00
a592f7e6cb Cleanup: COM_convert_data_types parameters. 2021-03-05 13:46:25 +01:00
b12be5a872 Cleanup: Remove static struct without data. 2021-03-05 13:46:25 +01:00
f3fb1df192 Fix T86293: crash undoing after executing the python console in certain
scenarios

In general, I could not find a reason executing from the python console
should not do an Undo push. Running a script from the Text Editor does
this as well and this seems generally useful.

Without an Undo push, one can easily run into situations were IDs have
been added or removed and undo on would then cause trouble (e.g. first
selection then bpy.ops.object.duplicate() -- this crashed as reported in
T86293 -- duplicate does not get its own undo push because it is not the
last op in the list, wm->op_undo_depth is not zero). This has changed
with the Undo refactor, so in essence the root cause is the same as
T77557, Legacy Undo does not suffer from the crash (but misses
the generally useful undo push from the console still)

Now add Undo to CONSOLE_OT_execute bl_options ('UNDO_GROUPED' seems more
appropriate than plain 'UNDO' since pasting multiple lines of code will
call CONSOLE_OT_execute multiple times in a row).

Maniphest Tasks: T86293

Differential Revision: https://developer.blender.org/D10625
2021-03-05 12:50:55 +01:00
5668901ced Cleanup: remove redundant NULL window checks handling events 2021-03-05 21:30:16 +11:00
6bc01222c6 Cleanup: Sync header+implementaiton definition.
Gave warning on Windows platform. There are more of these cases.
2021-03-05 09:48:49 +01:00
99e1866712 Cleanup: Use boolean in WM_cursor_wait 2021-03-05 10:36:57 +01:00
b5d154f400 Cleanup: move check_drag & check_click out of wmEvent
These variables track the wmWindow.event_queue state,
however they were used in a way that wasn't correct.

- check_drag & check_click from wmWindow.eventstate
  were used to track the click/drag status of events handled in
  wmWindow.event_queue.
- Event's in the queue read from wmEvent.check_drag.
- Once a drag action was detected, wmWindow.eventstate.check_drag
  was disabled.

Disabling drag in the event state would not change the drag state
for values already in the event queue.

Simplify logic by moving these values into the window,
so there is one place these variables are tracked.
2021-03-05 17:10:11 +11:00
663b0bb04c UI: minor changes to preset sorting
- Only sort by the preset name (not it's directory).
- Remove redundant string conversion.
- Only call lower() once on the input.
- Don't assign the lambda to a variable for single use.
2021-03-05 17:10:11 +11:00
511ff8b6b4 UI: Add Presets for high framerate video
It is quite common to high framerate video with modern cameras. To make
it easier to edit this footage new framerate presets are added and the
soft limit increased.

Note there is a bug with preset ordering, Blender thinks "120" goes
before "24" this bug needs to be fixed before these changes can be
merged.

Differential Revision: https://developer.blender.org/D10553
2021-03-04 23:22:47 -05:00
c2a8676544 Presets: Improve sort order of presets
Pythons sort function does not sort naturally,
to solve this a custom sort key is used.

This issue is apparent when trying D10553
2021-03-04 23:22:47 -05:00
78bd155f5c Cleanup: disambiguate 'queue' struct members
The term queue isn't very descruptive on it's own, use:

- wmWindow.event_queue
- wmWindowManager.notifier_queue
2021-03-05 14:59:38 +11:00
c2e73a1225 UI: save-preview tip now states that it's used for blend thumbnails 2021-03-05 14:44:39 +11:00
23dfcc5ac7 Cleanup: rename event to event_type
Reserve `event` for wmEvent.
2021-03-05 14:44:28 +11:00
aa86710242 Cleanup: spelling 2021-03-05 14:44:28 +11:00
b9833860e5 Cleanup: maintain include order without disabling clang format 2021-03-05 14:08:00 +11:00
e0ba6a4411 Cleanup: rename evt to event
Following naming convention of most operators.
2021-03-05 14:04:22 +11:00
59889d9b4f Cleanup: rename variables in wm_event_add_ghostevent
Using both evt and event together was confusing.

Renamed:

- event_state          <- evt
- event_state_other    <- oevt
- event_other          <- oevent
- win_other            <- owin
2021-03-05 14:03:54 +11:00
97fabc3c1c Fix T86185: Win32 Multiple Monitor Window Position
Because of D10469 we can now not force child windows onto parent's monitor and allow them to go where they wish.

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

Reviewed by Ray Molenkamp
2021-03-04 17:54:46 -08:00
Jacob Møller
57812c7e4f Windows/CLog: Support color logging on Win 10
Windows 10 supports V100 on all consoles given
you enable the ENABLE_VIRTUAL_TERMINAL_PROCESSING
flag for the console.

This patch enables color logging only on windows
10 and only if the log is not being redirected
to a file.

Differential Revision: https://developer.blender.org/D10546
2021-03-04 18:20:52 -07:00
6a662ffda8 GPencil: Implement Autokey button for Draw/Edit and Sculpt mode
Now, if the Autokey is not enabled, a new frame is not created and it is used the last active one. If no active frame, a message is displayed and the operation is canceled.

This is a common request for 2D artists.

Also, grease pencil was not working as Blender does in other areas.

Reviewed By: pepeland

Differential Revision: https://developer.blender.org/D10557
2021-03-04 21:32:37 +01:00
1668f883fb Fix T59376: UV project modifier not working after modifiers that dont provide a UVMap
This was reported for remesh and skin modifiers.
These dont preserve UV layers (and probably cannot in a reasonable way),
so instead let the UV Project modifier create a new (equally named) UV
layer (as was suggested by @brecht in T59376).

Maniphest Tasks: T59376

Differential Revision: https://developer.blender.org/D10617
2021-03-04 20:20:05 +01:00
63b7ff9f4e Cleanup: Main foreach ID code: Remove MAX_LIBARRAY and improve comments.
The `MAX_LIBARRAY` define was an annoying doublon to the `INDEX_ID_MAX` enum value
now defined in `DNA_ID.h`, and it is no more useful.

And comments were somewhat outdated. Also added an explanation about
chosen order for the `INDEX_ID_<IDTYPE>` order.
2021-03-04 18:43:30 +01:00
f951aa063f UI: prefer shorter search items in fuzzy search
This is a simple heuristic that seems to improve the search results in many cases.

Differential Revision: https://developer.blender.org/D10618
2021-03-04 18:39:31 +01:00
7d685391a0 Nodes: improve NodeTreeRef
This adds a couple more utility methods to various node tree ref types.
Also `InternalLinkRef` has been added to get simpler access to internal links.
2021-03-04 18:15:22 +01:00
bb1f02510b BLI: support mutable lookup from multi value map 2021-03-04 17:38:01 +01:00
Corbin Dunn
d09b874244 macOS/Ghost: Opt out of AppKit’s automatic window tabbing
Since Blender is single-tabbed, this will prevent extraneous
tab-related options from appearing in "Window" menu in case AppKit's
internals change.

Reviewed By: #platform_macos, sebbas, ankitm
Differential Revision: https://developer.blender.org/D10606
2021-03-04 21:53:27 +05:30
3de5fbba3a Fix T86050: use material count from correct data block
See comment in code for more details.

Differential Revision: https://developer.blender.org/D10615
2021-03-04 15:27:33 +01:00
a988099ee4 Fix T86172: tag relations update when pasting nodes
Pasting nodes can create new id relations, because nodes can reference IDs.
Therefore the depsgraph has to be updated when nodes are pasted.
We could somehow check if the pasted nodes referenced IDs, but I'm not sure
if this complexity is worth it.
2021-03-04 13:33:03 +01:00
386e3dd842 PyAPI: use methods for bpy.data.libraries.load & write
Replace static methods with regular methods.
Now the 'Main' value is taken from the collection.

Needed to support multiple 'Main' instances in Python, see T86183.
2021-03-04 23:13:07 +11:00
d9e567d365 PyAPI: support methods for collection properties
Previously only static methods were supported.

Now C/API functions added to collections can receive a 'self' argument.
2021-03-04 23:09:11 +11:00
7fd6c7f371 Fix T86204: support multiple group inputs in node group
Note that this still does not work when in the node group directly referenced
by the modifier, only in sub-node-groups. This limitation will be removed
at some point.
2021-03-04 12:50:23 +01:00
bda95ac0f9 Fix T86209: Preference Defaults "Relative Paths" tooltip could be improved.
This UserPref setting is only used when no path is set yet.
2021-03-04 12:20:10 +01:00
06d33a6876 Fix Saving startup file changing paths of the current file
Saving the startup file now uses "Save Copy", so paths are preserved.
2021-03-04 20:56:17 +11:00
9fffb78343 Fix T86231: Saving startup file always remaps relative 2021-03-04 20:52:03 +11:00
ef7efc3751 Tests: don't write thumbnails when running tests
Also replace WM_OT_read_factory_settings with WM_OT_read_homefile
so the preferences don't have to be reloaded.
2021-03-04 17:43:12 +11:00
753a2a34ce Cleanup: include '--open-last' in "Misc Options"
This was using fall-back category "Other Options"
which should be kept empty.
2021-03-04 17:43:11 +11:00
12b529b3a6 Cleanup: redundant struct declarations 2021-03-04 17:17:19 +11:00
2df2f1c908 Cleanup: use non-zero comparisons for event modifiers
Use event modifier checks that follow most of Blender's code.
2021-03-04 17:10:56 +11:00
abaa6c3ace Cleanup: use BM_mesh_copy_init_customdata utility function 2021-03-04 17:06:50 +11:00
be627ab9e2 Cleanup: comments 2021-03-04 17:00:42 +11:00
39b86a989d Cleanup: use const arrays 2021-03-04 16:58:03 +11:00
d10700a3ac Cleanup: number literals 2021-03-04 16:55:50 +11:00
24f0807550 Cleanup: replace Py_CLEAR with Py_DECREF in bpy.app modules
In this case, there is no benefit to using Py_CLEAR
as the value will never be NULL and can't be used later on.
2021-03-04 15:46:07 +11:00
a40ccde405 Fix logic for calling PyObject_GC_UnTrack
All tracked objects need a matching un-track,
also remove redundant Py_XDECREF call.
2021-03-04 15:18:10 +11:00
0d28e2a334 PyAPI: correct garbage collection for StructRNA types
By default objects are no longer GC tracked, this removes some overhead
although it's not significant in my own testing.

- Only enable GC for StructRNA when 'WITH_PYTHON_SAFETY' is on.
- Only track StructRNA when their 'reference' is set.
- Add missing NULL check when 'WITH_PYTHON_SAFETY' is on
  and objects new objects be created.
2021-03-04 15:18:10 +11:00
67856d8c4a macOS/GTests: add_dependencies to fix build error
When building `install`, linking blender_test fails because
test libraries do not exist. This happened on lite + Xcode. Error in
{rBdcb2821292f962951e88f146cb304160f21f73da}.

Reviewed By: #platform_macos, brecht
Differential Revision: https://developer.blender.org/D10607
2021-03-04 08:04:17 +05:30
e4a55b46c4 UI: Remove extra blank space for decorators in FCurve modifiers
None of these properties can be animated, so it doesn't make sense
to leave space for decorators on the right side of the panels. In fact
that is what was intended, but they were not manually disabled
in all of the panels.
2021-03-03 16:32:55 -06:00
b450d2d148 Fix T86042 EEVEE: incorrect irradiance bake
The environment (world) irradiance wasn't correctly skipped.
2021-03-03 23:14:06 +01:00
dd43a37016 Geometry Nodes: Allow clearing an attribute text field
Because pressing enter will choose the current search item from the menu,
and there was no search item with an empty string, it was impossible to
clear the text of an attribute text field. This commit adds a simple "X"
icon in the top row when you delete the string.
2021-03-03 13:48:39 -06:00
f53221bff7 UI: Allow translation for node error messages
This commit exposes the strings used in the node error messages for
localization. It also changes the message tooltip creation to
automatically add the period at the end, to be more consistent with
the (arguably bad) design of other tooltips in Blender.

Calling `TIP_` directly in the node implementation files allows us to
continue using `std::string` concatenation instead of passing variadic
arguments. It's also more explicit about which part of the message is
translated and which isn't. The files already include the translation
header anyway.
2021-03-03 12:58:33 -06:00
Corbin Dunn
93cdf461f3 macOS/Ghost: Remove redundant nil check after initWithContentRect
AppKit’s NSWindow.h has NS_ASSUME_NONNULL_BEGIN, and only methods/
properties explicitly marked nullable will ever return nil.

Reviewed By: #platform_macos, sebbas
Differential Revision: https://developer.blender.org/D10603
2021-03-03 21:26:09 +05:30
Corbin Dunn
87c949a3bd macOS/Ghost: Fix memory leak.
`new` allocates a new object that needs to be autoreleased.

Reviewed By: #platform_macos, sebbas, ankitm
Maniphest Tasks: T86222
Differential Revision: https://developer.blender.org/D10597
2021-03-03 21:25:20 +05:30
b9bb69a114 EEVEE: Avoid old files with too many volume shadow sample being too slow
This clamp the volumetric shadow samples to the actual old max to avoid
problematic slowdown after the bugfix rB3a29c19b2bff.
2021-03-03 15:20:35 +01:00
Mikhail
cd9a6a0f93 EEVEE: SSS: Fix light leaking bewteen object at different depths
The SSS shader in Eevee has the following drawbacks (elaborated in {T79933}):

1. Glowing
2. Ringing. On low SSS jittering it is rendered a bunch of sharp lines
3. Overall blurriness due to the nature of the effect
4. Shadows near occlusions as in T65849
5. Too much SSS near the edge and on highly-tilted surfaces

{F9438636}
{F9427302}

In the original shader code there was a depth correction factor, as far as I can understand for fixing light bleeding from one object to another. But it was scaled incorrectly. I modified its scale to depend on SSS scale*radius and made it independent from the scene scale. The scale parameter (`-4`) is chosen so that it makes tilted surfaces to have visually the same SSS radius as straight surfaces (surfaces with normal pointed directly to the camera).

This depth correction factor alone fixes all the problems except for ringing (pt. 2). Because of float-point precision errors and irradiance interpolation some samples near the border of an object might leak light, causing sparkly or dashed (because of aliasing) patterns around the highlights. Switching from `texture()` to `texelFetch()` fixes this problem and makes textures on renders visually sharper.

An alternative solution would be to detect object borders and somehow prevent samples from crossing it. This can be done by:
1. Adding an `object_id` texture. I think it requires much more code changing and makes the shader more complicated. Again, `object_id` is not interpolatable.
2. Watch gradient of depth and discard samples if the gradient is too big. This solution depends on scene scale and requires more texture lookups. Since SSS is usually a minor effect, it probably doesn't require that level of accuracy.

I haven't notice it in practice, but I assume it can make visible SSS radius slightly off (up to 0.5 px in screen space, which is negligible). It is completely mitigated with render sampling.

Reviewed By: Clément Foucault
Differential Revision: https://developer.blender.org/D9740
2021-03-03 14:57:25 +01:00
f746b568f3 EEVEE: SSR: Check reflection ray against geometric normal
This improve self intersection prevention. Also reduce the bias
that was making a lot of rays not being shoot at grazing angles.
2021-03-03 14:57:25 +01:00
1c22b551d0 EEVEE: Add ensure_valid_reflection to glossy closures
This is ported from Cycles and fixes issues with bump/normal mapping
giving weird reflections/lighting.

Fixes T81070 Specular light should be limited to normal pointing toward the camera
Fixes T78501 Normal mapping making specular artifact
2021-03-03 14:57:25 +01:00
87da26404f Fix compiler issues introduced in recent commit.
{73af762e9cd595ea708647c02c7e74752d844e80}
2021-03-03 13:42:28 +01:00
dcf7313e73 Cleanup: use zero_v3 to clear colors. 2021-03-03 12:37:52 +01:00
73af762e9c Cleanup: Make node_composite_cryptomatte CPP.
Core API of cryptomatte is also CPP.
2021-03-03 12:37:52 +01:00
3f716bb626 Cleanup: clang tidy
Warnings:
* readability-inconsistent-declaration-parameter-name
* readability-redundant-smartptr-get
2021-03-03 12:23:02 +01:00
7d2f27244c Cleanup: clang tidy
Can use const parameter.
2021-03-03 12:17:48 +01:00
e9c50913f8 Cleanup: clang tidy
Warning: else-after-return/break
2021-03-03 12:17:16 +01:00
b9ee877752 Cleanup: make format 2021-03-03 12:14:06 +01:00
a915e47ca1 Fix (unreported) Outliner missing updates copying IDs via python
Steps to reproduce:
- switch to Scripting workspace
- execute bpy.data.meshes['Cube'].copy()
- Outliner will not show the new mesh immediately

Now just send appropriate notifier.

Differential Revision: https://developer.blender.org/D10584
2021-03-03 08:53:13 +01:00
44ab908c86 Nodes: store references to bNodeLinks in NodeTreeRef
Sometimes it is useful to have this information available to be able
to read information from links.
2021-03-03 07:59:07 +01:00
4dd1068a57 Fix crash when dragging nodes
The `bNodeLinkDrag` struct was NULL when dragging a node instead of
a link. It is allocated with `calloc` anyway, so this field doesn't
need to be explitely cleared.
2021-03-02 22:53:25 -06:00
7fddf383b1 Cleanup: minor changes to Python RNA pointer assignment
Don't assign the BPy_StructRNA a value which can be 'None',
instead, set it to NULL.
2021-03-03 15:06:59 +11:00
023788ef9a Cleanup: Use span and float matrix type in direct boolean code
This commit includes a few simple improvements to the direct mesh
boolean code added recently.
 - Passing the transforms and meshes to `direct_mesh_boolean` as spans
   makes the function easier to call from C++.
 - The definition of `TransMat`, was unecessary when we have the
   `float4x4` type already used elsewhere in C++ code.

Differential Revision: https://developer.blender.org/D10592
2021-03-02 20:58:05 -06:00
a4f81c6838 Fix T85966: Wrong link picked when dragging multi-input socket
The socket drag operator stored the index of the last picked socket
into RNA in case the mouse cursor leaves the link while dragging.

This id was not unique which is why sometimes a link from an other node
with the same id is picked.

This patch changes the way the last picked link is stored and stores a
pointer to the link directly into bNodeLinkDrag struct instead.

Differential Revision: https://developer.blender.org/D10590
2021-03-02 23:13:59 +01:00
6aec6568a0 Cleanup: spelling, minor corrections
Also use doxygen comments for sculpt functions.
2021-03-03 06:20:27 +11:00
Patrick Busch
3eb8307160 Python API: Expose CurveMapping Reset View function
The Python API for the curve mapping widget offers the `update`
function, but no way to reset the view to the clipping rectangle.

This commit adds a blenkernel function for this operation,
and exposes it to the CurvMapping RNA API. This allows addons
to display a more user-friendly view of the data in this widget.

Differential Revision: https://developer.blender.org/D10561
2021-03-02 13:13:36 -06:00
85421c4fab Geometry Nodes: Attribute search drop-down
This commit adds a search for existing attributes when you click
on an attribute field. This is useful because otherwise you have
to remember which attributes should be available at each node in
the tree.

The fundamental complication is that this information is not
accessible statically. So the search data is only a cache from
the previous node tree evaluation. The information is added
with `BKE_nodetree_attribute_hint_add`, currently for every
input geometry socket for a single node.

This is only an initial implementation, and later versions will
expose the data type and domain of the attributes.

Differential Revision: https://developer.blender.org/D10519
2021-03-02 13:01:33 -06:00
a344f20346 UI: Rename search button variable
I landed D10527 in rB1a8aee0a7cec accidentally, and the version there was
missing a name change discussed in review. This commit just renames the
boolean variable controlling the special behavior for attribute search.

Original message meant for this change:
For geometry nodes we will use search buttons to display a list of
attributes available the last time the node tree was executed (D10519).
Because this list is just a hint, we need to be able to enter any string,
not just strings from the search items.

This patch adds a boolean option to string buttons to enable this.
The change is quite simple, changes to behavior are only required in
two places. The type-specific button struct changes help a lot here.

Differential Revision: https://developer.blender.org/D10527
2021-03-02 12:43:27 -06:00
81c770944c CMake/deps: Append platform CFLAGS and LDFLAGS to Python build to ensure compatibility with minimum macOS version
Similarly to other dependencies, the Python build should make use of the default CMake arguments. On macOS, for example, these arguments are required to set the deployment target correctly.

See also: https://devtalk.blender.org/t/compiling-latest-branch-on-macos-fails-undefined-symbol/17649

Reviewed By: brecht, sybren

Differential Revision: https://developer.blender.org/D10498
2021-03-02 19:08:26 +01:00
William Reynish
6471cf6bc8 UI: Clean up labels and descriptions: "Draw" to "Display"
In Blender, we used to use the term 'draw' to refer to information
displayed to the user. For version 2.80, it was decided to change these
instances to 'display' instead. This was to avoid the ambiguity between
end-user drawing tools and display options.

From the Oxford English Dictionary:
 - Draw: produce (a picture or diagram) by making lines and marks on
   paper with a pencil, pen, etc.
 - Display: show (data or an image) on a computer, television, or
   other screen.

Therefore, we should use draw when referring to drawing tools for
making marks, but use display when referring to information
shown/displayed to the user. From a user POV, the computer displays
certain information, whereas the user draws a mark.

Apparently this change was not implemented consistently, so this patch
changes all remaining relevant instances of "draw".

Differential Revision: https://developer.blender.org/D10551
2021-03-02 11:58:25 -06:00
1a8aee0a7c UI: Expose an "is first search" boolean to search button callbacks
Currently when you open an RNA collection search button, like a
vertex group selector, the search filter isn't applied until you
start typing, in order to display every option at the start.
Otherwise they wouldn't be visible, since the search filter would
run for the current text.

Currently this check happens in one place, but it relies on the
`changed` value of `uiBut`. This is fine in the interface directory,
but anywhere else it would require exposing `uiBut.changed`, which
is probably too low-level to expose.

The solution is adding an `is_first` argument to the search callbacks,
which is nice for a few reasons:
  - They work at a higher level of abstraction, meaning they don't
    have to worry about how exactly to tell if this is the first
    search.
  - It makes it easier to do special behavior when the search menu
    is first opened.
  - Then, obviously, it makes that state accessible without including
    `interface_intern.h`.

Needed for attribute search: T85658

Differential Revision: https://developer.blender.org/D10528
2021-03-02 11:42:05 -06:00
5a3b7c5329 Fix Node UI Storage Threading Issues
Since the same node tree can be used in modifiers on different objects,
there can be multiple threads writing to the maps in the node tree UI
storage at the same time. The additions for attribute name hints and
error messages made it so this would often cause a crash or at least
an ASAN report. This patch adds locks to prevent multiple threads
from using the maps concurrently.

In a brief test I actually didn't observe a crash without the global
`bNodeTree` UI storage mutex, but I think it's necessary for the change
to be correct, and I did notice some unfreed memory without it anyway.
Ideally it would be in a node tree runtime struct though.

Differential Revision: https://developer.blender.org/D10577
2021-03-02 11:08:36 -06:00
3a29c19b2b EEVEE: Fix incorrect volumetric light shadowing
The shadowing was computed on the light distance squared,
leaking to much light since it was integrating the extinction behind
the ligth itself.

Also bump the maximum shadow max step to the actual UI values. Otherwise
we get shadowing under evaluated because `dd` is too small.
2021-03-02 18:00:02 +01:00
3d7a00b8aa Fix (unreported) light cache bake crash
missing NULL check if there is no cache there to begin with.

Differential Revision: https://developer.blender.org/D10581
2021-03-02 17:54:45 +01:00
9c604ab0ca Fix Fuild error with lite build
With audaspace disabled, function SEQ_add_sound_strip was declared as prototype.
2021-03-02 17:47:21 +01:00
82e7032477 Sculpt: Expand Operator
Expand is a new operator for Sculpt Mode which is intended to be the main
tool for masking, Face Set editing, interacting with the filters and pattern
creation.

The fundamentals of the tool are similar to the previous sculpt.mask_expand
operator. It shares the same default shortcuts and functionality, making
the previous operator obsolete.

The shortcuts to execute the operator are:
- Shift + A: Expand mask
- Shift + Alt + A: Expand mask by normals
- Shift + W: Expand Face Set
- Shift + Alt + W: Resize current Face Set

The main changes compared to the previous sculpt.mask_expand operator are:
- Modal keymap, all operator options can be changed in real time while the
operator is running.
- Supports creating Mask, Face Sets and Sculpt Vertex Colors.
- Much better code, new features can be easily integrated.

Limitations:
- All Mask operations are supported for Sculpt Vertex colors, but not exposed
by default as their support is still experimental.
- Dyntopo does not support any Face Set or Sculpt Vertex Colors. functionality
 (they are not implemented in general for Dyntopo).
- Multires does not support any feature related to geodesic distances.
- Multires does not support vertex colors.
- Multires does not support recursions.
- In Multires, Face Sets snaping does not initialize all current enabled Face
Sets when toggling snapping.
- In Multires, Face Sets are created at base mesh level (works by this by
 design, like any other tool).
- Unlike the previous mask_expand operator, this one does not blur the mask
by default after finishing Expand as that does not fit the new design.
The mask can still be blurred by using the mask filter manually.

Reviewed By: JacquesLucke

Differential Revision: https://developer.blender.org/D10455
2021-03-02 16:53:56 +01:00
7f36498740 Fix T86026: Crash Opening Cryptomatte File.
Not sure this fixes the root cause. It seems that memory corruption
happens in dynstr. This patch replaces dynstr with a streamstring.
2021-03-02 16:21:31 +01:00
b3886c1f2a Fix crash on NULL dereference
Caused by e1f3996d74, `seq_update_meta_disp_range()` did not check if
sequencer data exists.
2021-03-02 15:21:09 +01:00
ca2044f72b Fix T86122: Performance Debug View Viewport Not Working
The performance debug menu isn't used that often anymore as render doc
also show the timings. This patch will make sure that enabling the
performance debug view (21) does not crash blender.
2021-03-02 14:27:52 +01:00
fece538e3d Cleanup: remove unused arguments 2021-03-02 14:21:30 +01:00
8d6a79ffc2 Fix error in rBb9e1cc931ee9
Bad copy paste...
2021-03-02 14:11:16 +01:00
b9e1cc931e Fix T86138 EEVEE: Bake Indirect Lighting crash in 2.93 with older files
This was caused by a missing version check.
2021-03-02 13:56:24 +01:00
f094b4fa08 Fix T86172: check if attribute is actually accessible
The crash happened when the density in the Point Distribute node was
above zero but so small, that no point was generated. In this case, there
was a point cloud component, but the point cloud was empty, making some
attributes unavailable.

One could also make more attributes available in this case, but that can
be done separately if necessary.
2021-03-02 13:29:35 +01:00
1e7d8a4ad5 EEVEE: Depth of field: Do not shrink highlights when using overblur
This fixes the issue of bokeh size being smaller when using overblur.

The additional overblur needs to be centered on the outer radius.
2021-03-02 13:08:57 +01:00
e1f3996d74 VSE: Refactor meta operators
Move low level logic to module code and versioning logic to versioning code.

Metas strip position was handled in diffrent way compared to other strips.
This was introduced in c8b0d25794 as bugfix for T28158.
I disagree with such design. Meta strips should be handled in same way as
any other strips.

I have tested this change and haven't found any problems.
No problems after checking T28158 as well.
There should be no functional changes on user level.

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D9972
2021-03-02 12:54:45 +01:00
b3005bf688 Fix T85981, part II: bone's custom shape disappear on undo in some cases.
Nicely hidden bug in pose read library code, it was using the library
from the wrong ID as reference to relink the custom shape object pointer
(pose is data from Object, not Armature).
2021-03-02 12:41:03 +01:00
3059c0b386 Fix T85970: Incorrect scaling of meta strips
This is same issue as fixed by d857892553, but I forgot to check meta
strips. Meta strip output is always in render size.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D10560
2021-03-02 12:23:04 +01:00
88604b79b7 FFmpeg: Improve scrubbing performance
Applying negative offset to seek position before scanning doesnn't have
any effect. This change results in 1.5x faster seeking (random frame,
average value) in sample file with 30 frame GOP length.

If I am not mistaken, B frames can have pts that can be less than
pts of I frame that must be decoded. Even in this case though, B frame
packet will be stored after that I frame.

In addition, preseek value is de facto hardcoded so seeking would fail
if it could. This can be hard to spot though.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D10529
2021-03-02 12:23:04 +01:00
bbb1936411 VSE: Refactor VSE strip loading code
Isolate RNA and operator logic from functions that create strips.
 - Operator specific code was removed from `SeqLoadInfo` structure and
   `SEQ_add_*` functions.
 - Strip loading code was removed from RNA and operator functions.
 - `SEQ_add_*` API was unified to work on `SeqLoadData` struct.
   Only exception is image strip, which require files to be loaded
   separately to strip creation itself. This is not ideal, but I think
   it's acceptable.
 - Some functions and variables were refactored so the code reads
   better.

There are minor functional changes (coincidental bugfixes):
 - Operator errors are reported per-strip. Previously they were not
   reported at all?
 - `new_sound()` RNA API function now create sound with length of 1
   if source file does not exist. Previously it created strip with
   length of 0.
 - Replace selection operator property wasn't working correctly.
   Fixed in this patch.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9760
2021-03-02 12:23:04 +01:00
b279fef85d Geometry Nodes: show "Show Texture in texture tab" button
This enables the quick access button [to show the relevant Texture in
the Properties Editor] for textures used in geometry nodes.

This goes in line to what we do for other textures:
- modifier textures have this button
- particle textures have this button
- brush textures will soon have it, too (see D9813)

When outside of the Properties Editor, the button will always show (if a
texture is actually assigned), but will be inactive if no suiting
Properties Editor to show the texture in can be found.

Note this also changes the behavior to not show the button if _no_
texture is assigned (as in: we are still showing the "New" button).
Previously it was always there (e.g. for modifier textures), even if it
would take us to an empty texture tab. (Sure, we could add a texture
there then, but imho it makes more sense to just start showing it once a
texture is already there)

For this to work with geometry nodes, the following chages were done:
- implement foreachTexLink for geonode modifiers
- new buttons_texture_user_node_property_add() that stores prop as well
as node
- also use NODE_ACTIVE_TEXTURE flag in geometry nodetrees

notes:
- this still uses the first suiting (as in: pinning does not interfere)
Properties Editor it finds, this should (maybe?) find the _closest_
Property Editor instead (see related feedback in D9813).
- this will already show the button for brush textures as well
(disabled), but there is another mandatory change in an upcomming commit
to make it work there as well (see D9813)

ref. T85278

Maniphest Tasks: T85278

Differential Revision: https://developer.blender.org/D10293
2021-03-02 12:08:44 +01:00
00f27a8568 Cleanup: RNA: Remove useless setter of PoseBone's custom shape.
If the property is properly tagged, RNA knows how to deal with ID
usercount by itself, no need of a custom setter callback for that.
2021-03-02 11:54:25 +01:00
Jeroen Bakker
2d4b638a67 Cryptomatte: Read metadata from multilayer OpenEXR.
Currently the compositor reads cryptomatte meta-data from the render
result. When loading a multilayer open exr file the meta-data was ignored.
This patch will also load the cryptomatte meta-data from multilayer open
exr files.

This enabled workflows where the rendering and compositing are done in
separate scenes or for future changes where the cryptomatte node will
use the meta-data for name matching and color picking.

Reviewed By: Sergey Sharybin

Differential Revision: https://developer.blender.org/D10384
2021-03-02 11:20:01 +01:00
8dec6452f2 Cryptomatte: Session from Existing Render Result.
Utility to construct a cryptomatte session from a render result or
openexr file. This will allow D3959 to be more aware of the context
it is working on and would also support external render engines in
the cryptomatte color picker.
2021-03-02 10:14:10 +01:00
c4ef90f5a0 Fix click-drag regression in fix for T86116
1638af109e &
bfc70a6a95
caused a regression with click-drag (not tweak which has it's own logic).

Restore some changes from these commits with added comments.

Minor changes from previous functionality from
39919e3532.

- `prevval` & `prevtype` are now set for all kinds of new events
  in the queue previously this was not done for some kinds of events
  (mouse wheel, ndof - for example).

- Set `prevval` & `prevtype` for other windows for mouse buttons.
2021-03-02 18:40:15 +11:00
ae96db0cf5 WM: log errors when wmWindow.eventstate values are invalid
Ensure they're working as documented (only for debug builds).
2021-03-02 17:02:57 +11:00
f8415261a6 WM: window.event_simulate now sets previous values properly
Match wm_event_add_ghostevent behavior for setting previous values.
2021-03-02 17:02:55 +11:00
bf1ee49e20 WM: use wmEvent.is_repeat instead of previous event checks
This check was added before is_repeat was supported, use this variable
instead since it's more a more reliable way of detecting held keys.

Also remove outdated comment.
2021-03-02 17:02:54 +11:00
92dac21e6b Docs: notes on wmEvent previous state struct member use 2021-03-02 17:02:54 +11:00
7093e8b40a Cleanup: remove Python 2.x support from complete_calltip 2021-03-02 17:02:52 +11:00
8f2c3c63e9 Fix build error after last commit 2021-03-01 15:45:06 -06:00
3084f6a8e0 Cleanup: Rename node UI storage function
"ensure" makes more sense in this case because the function actually
adds an item to the map if one doesn't exist yet.
2021-03-01 15:43:40 -06:00
Germano Cavalcante
6c6b1c015c GPU Python: Implement gpu.texture.from_image
It can be useful to replace `image.bindcode` and `image.gl_load`.

Used for example in https://docs.blender.org/api/current/gpu.html#d-image

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D10458
2021-03-01 17:38:57 -03:00
f39143bc2e CMake: reduce Neon related output on Intel platforms
* Only try to find sse2neon if Neon detected
* Only run Neon support test once
2021-03-01 19:43:54 +01:00
77bc5510a9 Cleanup: rename some animation-related functions
Rename:
- `BKE_animsys_store_rna_setting` → `BKE_animsys_rna_path_resolve`
- `BKE_animsys_read_rna_setting` → `BKE_animsys_read_from_rna_path`
- `BKE_animsys_write_rna_setting` → `BKE_animsys_write_to_rna_path`

The concept of "RNA setting" is unclear; the new names reflect better
what the functions actually do.

No functional changes.
2021-03-01 18:44:26 +01:00
4cc04beb77 Fix T85981: Undo on linked rig with overrides loses custom shapes.
While generally speaking bone shapes objects should not be overridden,
it can happens in some cases, and should be properly supported then.
2021-03-01 18:25:35 +01:00
03ab698921 Cleanup: refactor BKE_animsys_store_rna_setting()
Lower the cognitive complexity of `BKE_animsys_store_rna_setting()` by
flipping conditions and using early returns.

No functional changes.
2021-03-01 18:18:20 +01:00
fdbc54ca74 Cleanup: remove superfluous animsys_evaluate_action_ex() call
Remove `animsys_evaluate_action()` and rename
`animsys_evaluate_action_ex()` to it. The only function of the former
was to call the latter, with the exact same parameters.

No functional changes.
2021-03-01 17:37:46 +01:00
aeb7bc5beb GLog: Lower default logging severity to INFO
Before this change messages of ERROR and above were printed.
This change makes it so LOG(INFO), LOG(WARNING), LOG(ERROR)
and LOG(FATAL) will be printed to the console by default
(without --debug-libmv and --debug-cycles).

On a user level nothing is changed because neither INFO nor
WARNING severity are used in our codebase. For developers this
change allows to use LOG(INFO) to print relevant for debugging
information. Bering able to see WARNING messages is also nice,
since those are not related to debugging, but are about some
detected "bad" state.

After this change the LOG(INFO) is really treated as a printf.
Why not to use printf to begin with? Because it is often more
annoying to print non-scalar types. Why not to use cout? Just
a convenience, so that all type of logging is handled in the
same way. When one is familiar with Glog used in the area, it
is easy to use same utilities during development. Also, it is
easy to change LOG(INFO) to VLOG(2) when development is done
and one wants to keep the log print but make it only appear
when using special verbosity flags.

The initial reason why default severity was set to maximum
possible value is because of misuse of VLOG with verbosity
level 0, which is the same as LOG(INFO). This is also why
back in the days --debug-libmv was introduced.

Now there is some redundancy between --debug-libmv, --debug-cyles
and --verbose, but changes in their meaning will cause user
level side effects.

Differential Revision: https://developer.blender.org/D10513
2021-03-01 16:56:34 +01:00
ea95ea644a Libmv: Avoid use of LOG(INFO) in solver
Usage of LOG(INFO) actually went against own guidelines in the
logging.h: the INFO is for messages which are to be printed
regardless of debug/verbosity settings.
2021-03-01 16:54:14 +01:00
61b3870981 Cryptomatte: Flexible Definition of CryptomatteLayers.
Cryptomatte layers in Blender are predefined. Other render engines
might have other naming schemes. This patch will allow creation of
cryptomatte layers with other names. This will be used by D3959 to
load cryptomatte openexr files from other render engines.

EEVEE and Cycles still use our fix naming scheme so no changes are
detectable by users.
2021-03-01 16:37:42 +01:00
1d9092f632 Fix Crash: Access Unallocated Memory. 2021-03-01 16:37:42 +01:00
6b20ccb753 Cleanup: Missing const keyword. 2021-03-01 16:37:42 +01:00
82dccff809 Cleanup: Mention Correct Types In Comments 2021-03-01 16:37:42 +01:00
5da418d4e6 Fix Cycles build error without Embree on Windows
Don't use ssize_t, it's not available in MSVC.
2021-03-01 16:33:31 +01:00
f4a9883294 UI: Correct output attribute name in proximity node
I made an incorrect comment in patch review that "Location"
should be used instead of position. "Position" is more appropriate
here since it refers to generic data rather than an object origin.
"Position" is also the name we chose for the attribute for this reason.
2021-03-01 09:32:48 -06:00
b35a3933ee Build-system: Use C-linkage for internal interface header
That way the header can be included in C++ files.
2021-03-01 16:30:51 +01:00
Christoph Lendenfeld
fdb2c24c09 Cleanup: move some drawing code into ed_draw.c
Move some drawing code from `area.c` and `ed_util.c`  into `ed_draw.c`.
This is to support the new generic slider that wil be used in T81785.

No functional changes.

Reviewed By: #animation_rigging, #user_interface, Severin, sybren

Maniphest Tasks: T81785

Differential Revision: https://developer.blender.org/D9313
2021-03-01 16:23:15 +01:00
3649b5b6df Add --open-last CLI argument that opens the most recent file
Add a CLI argument `--open-last` that opens the most recent file,
effectively doing the same as {key Ctrl Shift O}, {key Enter} after
starting Blender.

When there are no known recent files, print a warning and do nothing,
showing the startup file instead.

Note that this does not try to be smart about restoring the last Blender
session. It just opens the file from disk, as if the user had typed
`blender $(head -n1 ~/.config/blender/2.93/config/recent-files.txt)`.

There is also no smartness when that file cannot be opened; it behaves
exactly the same as typing the most recent filename on the CLI.

Reviewed by: mont29, campbellbarton

Differential Revision: https://developer.blender.org/D10563
2021-03-01 14:37:33 +01:00
e06f5f64ae Cleanup: Use LISTBASE_FOREACH and LISTBASE_FOREACH_MUTABLE macro 2021-03-01 09:35:27 -03:00
4b3dcd8069 CMake/deps: Added new macOS arm64 build dependency to instructions
macOS arm64 has extra requirements.
2021-03-01 13:08:01 +01:00
e81034f75d Harden checks in datatoc_icon binary
The goal of the change is to perform check for attempts of icons
being overwritten on canvas. The check is based on checking original
coordinate of icons against all read icons. If there are two icon
files which have same original an error will be reported. The report
includes both file names to make it easier to troubleshoot.

This change will allow to early-on catch issues which we currently
have with the release environment: official Linux builds might have
different icon from Blender compiled locally. This is because the
order in which directory listing is traversed is not defined, so
it's like a race condition between two files to win the place in
the final canvas.

There is still possible improvement in the code to move more fields
into the context structure. This is beyond of goal of this change.

Note that before committing this change icons must be brought back
to their consistent state. Otherwise the build will fail.

Differential Revision: https://developer.blender.org/D9715
2021-03-01 12:00:32 +01:00
9def00a8ca Work around T86015: Crash undoing in certain scenario (disabling Global Undo).
Simply disable advanced 're-use current blend data` process when loading
a memfile step and Global Undo is disabled, since there is no way to
ensure we have a proper 'differential' state in the stack then.

NOTE: this is a quick work-around to fix the crash, not a satisfying
solution by far (pretty sure there can still be crashes if you then
re-enable Global Undo afterwards e.g.).
2021-03-01 11:27:24 +01:00
ca63729a5b Fix T86087: Assert when changing compositor node value or invoking tooltip.
Regression from rBde25b79ff5c4, this flag is inconsistent currently for
embedded IDs, needs to be sorted out, see T86119.
2021-03-01 10:59:07 +01:00
71ed6f32d2 Fix T84658: Anisotropic BSDF - most modes not using Screen Space
Reflection

Anisotropic is not really supported in Eevee, but since code looks like
it is just intended to make it behave like glossy, it should function
like it too.

Seems like the internal calling from `node_bsdf_glossy` from
`node_bsdf_anisotropic` has swapped arguments.
Also: ssr_id is available for SH_NODE_BSDF_ANISOTROPIC as well (see
`ntree_tag_bsdf_cb`), so why not use it?

Maniphest Tasks: T84658

Differential Revision: https://developer.blender.org/D10547
2021-03-01 09:04:07 +01:00
bfc70a6a95 Fix T86116: Failure to detect click events with modifier held
Click detection logic relied on the event queue not accumulating events
as newly added events at the end of the queue adjusted
`wm->eventstate->prev{val/type}` which was then compared with events
at the front of the queue.

This made Ctrl-Click fail to detect the click as releasing Ctrl
set the previous value before the previous event was handled.

In practice this only happened in heavy scenes,
updating 10 fps or lower. It also made automated tests fail that
accumulate events before handling them.
2021-03-01 17:12:46 +11:00
d8b35219d1 WM: set previous values for events in the event queue
This makes event's prevval and prevtype usable for events in the queue.

Previously they were unused, except as a hack for modal keymap handling.

This is needed to fix T86116, where the `wm->eventstate->prev{val/type}`
are set to values from events that have not been processed.
2021-03-01 16:54:59 +11:00
8da58dc85b WM: prevent model keymap handling overwriting previous event values
`wmEvent.prevtype` & `wmEvent.prevval` were overwritten
when used in modal keymaps.

Now they are restored to their original values.
2021-03-01 16:54:59 +11:00
6de41bed2f Cleanup: move logic to copy the previous event state to a function 2021-03-01 16:54:52 +11:00
72d1545ec2 Cleanup: minor change to click detection checks
Change order of checks for more convenient click-detection debugging.
2021-03-01 12:21:57 +11:00
1638af109e WM: don't set event prevval/prevtype on cursor motion
Currently the intended behavior regarding prevval/prevtype isn't
handled consistently. However, including cursor motion causes events
in `wm->queue` and `wm->eventstate` to behave differently,
where `wm->eventstate` ignores motion (necessary for click detection).

This makes checks from `wm->eventstate` to events in the queue fail.

This reverts 39919e3532,
using the `event.type` instead of it's previous type.
This works as it includes mouse button release events.
2021-03-01 12:00:29 +11:00
fc08fe82ae Cleanup: spelling 2021-03-01 11:00:22 +11:00
fbba239e3a Fix T86082 Bevel messed up UVs on some multisegment bevels.
When polygons around a bevel are rebuilt, sometimes UVs are merged
around a new vertex in the case of the face opposite a single edge
being beveled on a 3-edge vertex. This should not have been done
if any of the edges at that vertex were a seam.
2021-02-28 11:33:25 -05:00
f3d60c68ef Fix T85948 Exact boolean crash with some nonplanar ngons.
Triangulating ngons could fail with the method that was being
used: projecting along the dominant normal axis and then using CDT.
It could fail if the ngon has self crossings or might be so after
the described projection.
Switched to using projection along the normal itself, and also to
using polyfill which produces some kind of triangulation no matter
what in such circumstances. This will also likely be faster if
there are a lot of ngons in the meshes, since the exact arithmetic
CDT was being used before, and now float arithmetic is used.
2021-02-27 18:51:48 -05:00
92743cc895 Fix T85886: Rotate Tool and Adjust Last Operation - angles inverted
The constraint was not set when redoing.

This commit also removes `postInputRotation`. I really couldn't see a use for it.
2021-02-27 17:22:47 -03:00
aad2f1510a Fix T86028: Crash when loading file with missing libraries.
Regression from rB53d13b6f5387c68.
2021-02-27 13:12:07 +01:00
28f0a4b27e Fix (unreported) broken OCIO from install_deps.
Looks like they removed static libs by default in OCIO 2.0, for some
historical reasons `install_deps` was enforcing using only static libs
for this one, now removed it so that Blender buil can use usual so's.
2021-02-27 13:12:07 +01:00
4b16cb1e9a Fix T85987: Selection when GP is parented
When a GP object was parented to e.g. a bone, box selection as well as
point selection were broken in that the selection from the user would
not correlate with what was actually being selected.

The issue was that box and point selection did not use the active
evaluated stroke data. The fix uses the correct data.

Reviewed By: antoniov

Maniphest Tasks: T85987

Differential Revision: https://developer.blender.org/D10555
2021-02-27 13:08:46 +01:00
e3c11b36da Fix error converting simulated events press/release to clicks
Move logic that sets previous event state into WM_event_add_simulate.
2021-02-27 22:05:01 +11:00
9cfb320208 RNA: add Region.data member to access RegionView3D
Without this, the RegionView3D could only be accessed from
`context.region_data`, not the region.
2021-02-27 16:30:07 +11:00
Victor-Louis De Gusseme
f7933d0744 Geometry Nodes: Add "Location" output to Attribute Proximity node
This patch adds an output field to the Attribute Proximity node and
renames the existing string socket from "Result" to "Distance".
  - The "Distance" output contains distance to the closest position
    on the Target geometry.
  - The new "Location" output contains the coordinates of the closest
    position on the Target geometry.

A basic use case for this data is a simple shrinkwrap operation.

Differential Revision: https://developer.blender.org/D10415
2021-02-26 15:23:09 -06:00
e00a87163c CMake/deps: Adjust OSL shader directory
The location of the shaders changed with OSL 1.11.10. This commit is therefore in addition to D10212.

@sybren With the latest SVN libraries, I am fairly certain there is a "OSL not found" in the CMake output. Can you check on Linux?

@LazyDodo Since you haven't pushed the new OSL libs yet, this should not be a problem on Windows. So this will only be needed whenever those land.

Reviewed By: LazyDodo

Differential Revision: https://developer.blender.org/D10552
2021-02-26 21:35:54 +01:00
5c6cd5f8cd Cleanup: unused class member 2021-02-26 20:57:24 +01:00
c0d8a14ae3 Fix crash with dyntopo on tools that use cached vertex info
Tools can cache data related to the mesh topology for later use. This
data is indexed by vertex index, so it will be invalid after dyntopo
changes the topology during the stroke.

Reviewed By: JacquesLucke

Differential Revision: https://developer.blender.org/D10550
2021-02-26 19:27:56 +01:00
fb7751f3e6 CMake/deps: Fix LLVM and OSL builds
This commit is addition to D10212. Apple arm64 support was left out in that patch.
2021-02-26 17:38:14 +01:00
cd388ef2f1 Fix (unreported) missing 3DView update after some Outliner Override operations. 2021-02-26 17:15:03 +01:00
b2eb674731 Cleanup: Use find_first_not_of. 2021-02-26 16:32:53 +01:00
6ccfb9e0ea Fix: Compile issue Windows. 2021-02-26 15:36:04 +01:00
87ace46827 Cryptomatte: Manifest Parsing.
This patch adds manifest parsing to Cryptomatte. Normally when loading
cryptomatte layer from an OpenEXR file the manifest contains data to
convert a hash to its original name of the object/material. In the
future we want to use this to support lookup of cryptomatte
hashes and show it to the user.

Currently this logic isn't available to users (for now), but is required
by D3959 where a new cryptomatte workflow is implemented.
2021-02-26 14:13:15 +01:00
c489bb7c01 GPencil: Cancel Fill if the filled area is not closed
Fill only if it never comes in contact with an edge. It is better not to fill than to fill the entire area, as this is confusing for the artist.

Differential Revision: https://developer.blender.org/D10536
2021-02-26 13:25:06 +01:00
17534e28ff Assets: Preview rendering for Action datablocks
Render previews for Action datablocks by rendering the scene camera with
the Workbench (solid) engine. The //look// can be configured by setting
the scene's render engine to Workbench and editing the scene's shading
properties.

It is assumed that the pose has already been applied and that the scene
camera is capturing the pose. In other words, the render function just
renders from the scene camera without evaluating/applying the Action
stored in `preview->id`. The ID is only used to determine its type and
to store the resulting preview.

Not all code paths that lead to the `action_preview_render()` function
actually provide a depsgraph. The "Refresh Asset Preview" button
(`ED_OT_lib_id_generate_preview`) does, but `WM_OT_previews_ensure` does
not.

Reviewed By: Severin

Differential Revision: https://developer.blender.org/D10543
2021-02-26 12:44:08 +01:00
e1a541c689 CMake/Deps: Python 3.9.2
Straight up minor version bump, no anomalies to report

Reviewed By: sebbas, sybren

Differential Revision: https://developer.blender.org/D10523
2021-02-26 12:25:45 +01:00
53d13b6f53 UX: Readfile: Libraries error messages: avoid wall of warnings.
When a lot of libraries or linked IDs were missing/not found when
loading a .blend file, Blender used to show one warning report for each
missing item, potentially covering the user's screen with a giant
unuable popup.

Now it will instead generate a single warning with amount of missing lib
files and linked IDs. Each missing item is still reported individually,
but only as `INFO`, so it will still show up in the console or Info editor.
2021-02-26 11:59:14 +01:00
72ceab8ab2 Cleanup: use early exit 2021-02-26 16:59:26 +11:00
7cb55a79d8 Cleanup: use boolean arguments 2021-02-26 16:55:58 +11:00
9059ee81ef Fix particle-edit crash on undo/redo
Undo/redo was crashing & asserting.

There ware two bugs:

- Entering particle system edit-mode requires an evaluated depsgraph.

- The active object could get out of sync when undo/redo
  moves between different modes.

The new test 'view3d_mesh_particle_edit_mode_simple'
in `tests/ui_simulate/test_undo.py` exposes both issues.
2021-02-26 16:32:49 +11:00
b7939a059f Undo: use low level API calls to enable font edit-mode
While I couldn't redo a bug in this case, it's possible for the
active object to become out of sync in rare cases,
so best use these functions.
2021-02-26 16:31:11 +11:00
0c9607312f Undo: don't log an error when the undo limit has been exceeded 2021-02-26 16:31:11 +11:00
c402cfa308 Cleanup: move comment into function doc-string 2021-02-26 16:31:11 +11:00
c67b03b810 Cleanup: Clang Format 2021-02-25 20:31:55 -05:00
81e795e7f0 Fix T84953: Incorrect tooltip for dragging collections
"Shift to parent" does not make any sense for collections since they
don't have parenting like objects. This commit just adds a simple check
for whether the first drag ID is an object before displaying
that part of the message.

Differential Revision: https://developer.blender.org/D10203
2021-02-25 19:23:19 -06:00
b1b9671c93 Cleanup: commented/out of date rpdb2 import 2021-02-25 18:27:57 -05:00
fbb0017c90 PyAPI Docs: Update Sphinx to 3.5.1 2021-02-25 17:51:48 -05:00
57c41a9c63 Icons: Add icon for the upcoming spreadsheet editor
The editor is being worked on by the geometry nodes team.
Icon created by Andrzej Ambroz (jendrzych).

Addresses https://developer.blender.org/T85925.
2021-02-25 18:09:00 +01:00
16504ed4a2 Icons: Update blender_icons.svg to have a document background
When opening the SVG you wouldn't even see the icons, since they are all white
now. You'd always have to set up a document background color and make sure to
undo that again before saving the file, so it's not written into it.
Just make everyone's life easier by saving the file with a proper background
(gray with checkerboard).
2021-02-25 18:09:00 +01:00
1981f04b0f Icons: Resaved blender_icons.svg in new Inkscape version
Inkscape often does a number of unrelated changes when saving an SVG, not sure
if these are just formatting changes in the source SVG text or if there's more
to it. Either way this makes adding new icons hard since you want to avoid
these unrelated changes. Saving the file in a new Inkscape version every once
in a while should mitigate the problem a bit.
Regenerating the icons (e.g. through `make icons`) shows no difference in the
output.

Note that I also ran "Clean Up Document" in Inkscape, but that doesn't seem to
have changed anything/much.
2021-02-25 18:09:00 +01:00
2718ea80d2 Improve Purge operator.
The Purge operator to remove unused IDs can now also remove 'indirectly
unused' data-blocks (those only used by unused ones, recursively).

It can also now only operate on linked, or on local data.

All those options are exposed in the `File -> Cleanup` main menu.

The behavior of the `Purge` button in the Outliner remains unchanged,
needs some UI/UX design task for that.
2021-02-25 17:48:54 +01:00
ec4d412c9c Py API: update bpy.data.orphans_purge to support new options.
This API function can now purge recursively in a single call, and choose
to ignore (not purge) local or linked IDs.

Default behavior (with not argument) remains unchanged, so no API
breackage here.
2021-02-25 17:48:54 +01:00
1df6cd67a1 Fix (unreported) bad usercount handling in batch ID deletion.
This was rather obscure and non-critical issue, but in some cases ID
usercount of some deleted IDs from batch-deletion code would not be
properly nullified, which would then assert later in actual deletion
code.
2021-02-25 17:48:54 +01:00
b958a59c79 BKE_lib_query: Add a function to detect and tag all unused IDs.
With the option to detect orphaned data recursively (i.e. if ID `a` is the
only user of ID `b`, and ID `a` is unused, ID `b` will also get tagged
as unused).

To be used by the Purge operation.
2021-02-25 17:48:54 +01:00
6daff9a08e UI: Fix icon width and padding in search menus
Previously the padding size and the width saved for the icon were
constant regardless of the zoom level. This resulted in overlapping
icons and text, and ugly padding with more extreme zoom levels.
We can retrieve the size of the row from the `rect` argument.
2021-02-25 10:28:39 -06:00
f908ff1ccd BLI: simplify adding an arbitrary value to a resource container
With this is becomes easily possible to store a lambda in a resource
collector so that it will be freed when the resource collector is freed.
2021-02-25 17:17:45 +01:00
35df354e4a Cleanup: quiet warning
"loop variable 'item' is always a copy because the range of type ..."
2021-02-25 16:56:01 +01:00
400f2e4be6 Fix T85959 EEVEE: DOF with "Jitter Camera" broken
Was caused by recent changes in window_translate_m4 by rBbb2af40ec7dd.
2021-02-25 15:27:10 +01:00
626a8e0f10 Fix T85979: Attribute missing warning with empty geometry
An error doesn't make sense in these situations because we don't expect
to find attributes on empty geometry, and an empty geometry set is a
valid situation.

Note that we can't use `component.is_empty` here, because often the
component is visually "empty" but still has a point cloud with no
points or a mesh with no vertices.
2021-02-25 08:20:02 -06:00
bcd369c3c1 Fix macOS SSE support not detected correctly after recent changes
Due to moving the code the test binary was incorrectly compiled with OpenMP
flags. Move setting of the OpenMP flags to the appropriate place.
2021-02-25 15:09:10 +01:00
ae581f9445 Fix T85976: Outliner crash deleting collection with multiple windows 2021-02-26 00:17:43 +11:00
cccdd6626d PyAPI Docs: Add 'gpu.state' module
Also exclude `gpu.shader` from quick tests.
2021-02-25 09:16:48 -03:00
59c1029e20 install_deps: bump USD version to 21.02.
Should have been part of D10367/rBa923a34de19c, but for some reasons it
did not make it into final commit...

Re T85365.
2021-02-25 11:56:14 +01:00
adf1525171 install_deps: bump python version to 3.9.2.
Also bump exlusive maximal version to 3.11, since 3.10 is now supported.

Re T85365.
2021-02-25 11:50:38 +01:00
de25b79ff5 Refactor: IDTypeInfo: Add owner_get to get owner of embedded IDs.
This concerns currently only collections (`master_collection` of scenes)
and root node trees. It removes the matching type-specific helpers
(`BKE_collection_master_scene_search` and `BKE_node_tree_find_owner_ID`).

No functional change expected here.

NOTE: Current implementation of `owner_get` is far from optimal, we
could probably do it better, see {T69169}.

NOTE: While it could also have it, shapekeys IDTypeInfo was left out of
this change for now. Mainly because it sould not be used currently, and
we ultimately want to demote shape keys from ID status anyway.
2021-02-25 11:39:10 +01:00
b5d39f9b46 Merge remote-tracking branch 'origin/blender-v2.92-release' 2021-02-25 10:17:02 +01:00
0e1c6a29cb Cleanup: spelling 2021-02-25 16:34:50 +11:00
94dc6ceaa7 Cleanup: remove assert left in by accident, outdated comment 2021-02-25 16:33:55 +11:00
b073e59d4e Fix T85975: Edit-mode undo/redo removes overlays
Setting the active object when decoding undo steps missed
a call to ED_object_base_active_refresh.
2021-02-25 16:13:53 +11:00
e301f3422d Fix T85974: Edit-mode undo/redo causes assertion
Assert the poll function succeeds after setting the active object.
2021-02-25 16:13:53 +11:00
2b60d7d09c Fix entering edit-mode when object mode and edit-data don't match
In rare cases, it's possible for an object to have edit-mode data
without it's Object.mode set to edit-mode.

This could happen with undo, part of fix for: T85974.
2021-02-25 16:13:47 +11:00
3ed6d9f966 Cleanup: use low level edit-object access functions for undo
Use OBEDIT_FROM_VIEW_LAYER macro for curve & fonts (matching edit-mesh).

While the difference isn't significant at the moment,
there are no reason these should be different between undo systems.
2021-02-25 12:20:23 +11:00
72370b92be Fix T85926: Cycles missing viewport updates when making materials single user
This issue seems to be caused by the reallocation flag not being set on
the device shader data array so it was never updated on the GPU although
the host memory was modified.
2021-02-25 02:18:02 +01:00
c47990f41c PyAPI: expose imbuf.types.ImBuf, include in API docs
Without this, the ImBuf type wasn't part of documentation.
2021-02-25 12:04:23 +11:00
17260c9b9a Fix T85963: Combine and separate XYZ nodes don't work on instances
They were missing the `geometry_set_realize_instances` function used to
make any input instances real for writing.
2021-02-24 16:11:21 -06:00
01e13e2c95 Cleanup: Remove unused node editor button event defines
These defines seem to be left over from the initial implementation
of the node editor. In a few places the values were used in button
creation, but the callbacks never checked the value anyway.
Node uiBlocks also had a callback what would never do anything
since the value it checked for was never used.
2021-02-24 14:53:37 -06:00
Yevgeny Makarov
a50f6bc40b UI: Clean up "Dupli" to "Instance"
Following the naming conventions defined in T56648, where in this
instance there were still a few remaining uses of the old term.

Differential Revision: https://developer.blender.org/D9817
2021-02-24 13:49:14 -06:00
Yevgeny Makarov
962b87f06a UI: Clean up use of the term "Metaballs"
Clear the weird term "Metaelement".
These are the metaballs (elements) inside one metaball objects.
  - "Meta Ball" to "Metaball"
  - "Metaelement", "Meta element" to "Metaball element"

Differential Revision: https://developer.blender.org/D9910
2021-02-24 13:44:24 -06:00
Yevgeny Makarov
4f247dba5e UI: Cleanup and fix labels and descriptions in various places
Changes include using proper and consistent grammar, simplifying
phrasing, using correct terminology, and not including python API
identifiers in tooltips.

Differential Revision: https://developer.blender.org/D9924
2021-02-24 13:25:44 -06:00
9a1b29e16c CMake: Removed temporarily disabled clang block
Was disabled in rBc778fd981e63. Libraries have been updated in rBL62576.
2021-02-24 20:23:42 +01:00
7a8a8241b9 Revert "t"
This reverts commit d3a96e5022.
2021-02-24 16:23:18 -03:00
201ab7c540 Fix T85823: bpy.ops.transform... ignoring 'center_override' for Bezier control points
`transform_around_single_fallback_ex` ignored that the center could be overwritten.
2021-02-24 16:20:03 -03:00
d3a96e5022 t 2021-02-24 16:20:02 -03:00
Yevgeny Makarov
8cc4366a98 UI: Remove colons from some labels
The colons are not necessary in these situations because it's clear
that the label applies to the next group of buttons anyway, and they
add unecessary visual complexity. Committing as part of D9924.
2021-02-24 13:15:48 -06:00
bc0e121bce UI: Reorder mesh merge operator types for consistent shortcuts
In vertex selection mode, the "At First" and "At Last" options are
contextually added to the beginning of the list of merge operations.
This means the automatic shortcuts in the merge menu are different,
making learning the shortcuts much more difficult than necessary.

This patch reorders the items so that "At First" and "At Last" are
added after the first three options so the shortcuts are always
consistent.

Fixes T84335

Differential Revision: https://developer.blender.org/D10008
2021-02-24 13:08:26 -06:00
66874824e6 GPencil: Fix missing change material menu using U key
The menu was not activated when vertex mode was enabled.
2021-02-24 20:04:10 +01:00
Fabian Schempp
b54b56fcbe UI: Make node virtual sockets more visible
This commit tweaks how virtual sockets (unconnected node group input
and output sockets) are drawn to make them more recognizable. The
outline is changed to a gray color, and they get a dark inner color.

Differential Revision: https://developer.blender.org/D10080
2021-02-24 13:01:24 -06:00
89196765ba Cleanup: Clang tidy else after return 2021-02-24 12:57:49 -06:00
Kdaf
e8a99dda25 Fix T84796: Particle tool properties displayed for select tool
When using particle mode, the particle tool settings were always
displayed, even if select/cursor is the active tool. This patch
hides the properties of the particle tools for non-brush tools,
using the same check as in other modes.

Differential Revision: https://developer.blender.org/D10266
2021-02-24 12:27:25 -06:00
5dd176cde8 PyAPI: Ensure GIL state only when a callback exists
There are fewer python callbacks than `ARegionType`s.

This also broke GTests's `bf_blenderloader_tests`.
2021-02-24 13:57:06 -03:00
02948a2cab Blender 2.92.0 release tagging 2021-02-24 17:25:10 +01:00
069d96fce5 Docs: 2.92 release description for Linux appdata 2021-02-24 17:24:11 +01:00
b0b33b77fa Workbench: Fix typo in rB32ca8e58a374
This was creating incorrectly occluded overlays.
2021-02-24 17:10:18 +01:00
b22204fa37 Cleanup: Simplify vector direction comparison
Multiply the two number together. If the sign of the result is positive, then the sign was the same. If the sign of the result is negative, then the signs were different.
2021-02-24 16:44:34 +01:00
c778fd981e CMake: Temporarily removing find clang block
New libs have not landed in the SVN repository. Once they are up, this commit will be reverted.
2021-02-24 16:13:06 +01:00
c0b2c75c44 Geometry Nodes: store available attribute names in node ui storage
This information will be used by the attribute search in string sockets.

Ref T85657.

Differential Revision: https://developer.blender.org/D10462
2021-02-24 16:00:33 +01:00
7972785d7b PyAPI: Fix memory leak of parameters used for python 'draw_callbacks'
When closing the blender, while the callbacks are removed, the
reference count of the object used as `customdata` is not decremented.

This commit adds two functions that correctly release the
python `draw_callbacks` before releasing all `draw_callbacks`.

Differential Revision: https://developer.blender.org/D10478
2021-02-24 11:57:29 -03:00
6b6469a2e5 Cleanup: Fix comment 2021-02-24 15:47:11 +01:00
7bbf27891c GPencil: Improve Interpolate AutoFlip algorithm II
Improved the calculation of the distances and changed the variable names to make it more readable.

Still, there are some corner cases that could be not handled properly, but we keep as is to test more real drawings to analyze if the small number of corner cases needs to be fixed or not.
2021-02-24 15:34:24 +01:00
9243d286f4 Cleanup: CryptomatteLayer
Missing code flow.
2021-02-24 15:30:29 +01:00
bb3e54d8be Cleanup: Cryptomatte Use StringRef(Null). 2021-02-24 15:29:23 +01:00
79f34447d6 Cleanup: CryptomatteLayer structure.
Current implementation was to restricting for future enhancements where
the CryptomatterLayer could be read from existing metadata.
2021-02-24 15:18:31 +01:00
4fb0c83c1c Cmake/deps: Update OSL to 1.11.10.0
This bumps OSL to 1.11.10.0. OSL Has a new build time
dependency: Clang, and more importantly it expects
clang and llvm to share a library folder, which it
previously for us did not.

This patch changes:

-OSL Update to 1.11.10.0

-refactor the llvm/clang/clang-tools-extra builds into the llvm
 build using the llvm-project tarball for building that has all
 of the subprojects in it.

-update ispc/openmp builds since clang no longer its own dependency
 and they have to depend on the llvm build now.

-Update the windows builder to use the 64 bit host tools since it
 ran out of ram linking clang

-Since OSL now needs clang to link successfully a findclang.cmake
 has been provided for linux/OSX

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

Reviewed By: brecht, sebbas, sybren
2021-02-24 07:13:37 -07:00
5be72125bf Cleanup: Move some utilities to 'gpu_py.h' 2021-02-24 10:58:15 -03:00
8f6fd07b54 Fix T85947: Missing check of master collection for objects being instanced.
`object_in_any_collection` used during linking/appending to check
whether an object is already instanced by at least one collection, was
not taking into account embedded master collections from scenes.
2021-02-24 14:14:46 +01:00
0c0553ace7 Fix T85915: Cannot save new theme preset
Since making bpy.types a real module `dir(bpy.types)` now includes
__dir__ and __getattr__ methods which need to be ignored.
2021-02-24 23:39:38 +11:00
5c098ef58c Fix crash updating themes in background mode 2021-02-24 23:39:38 +11:00
812a362bd8 Docs: 2.91 release description for Linux appdata 2021-02-24 12:53:00 +01:00
12b805148f Cleanup: quiet asan overflow warning 2021-02-24 12:10:45 +01:00
32ca8e58a3 Workbench: Fix samples taken outside of pixel footprint
With the previous implementation, we could have pixels with offset larger
than 1 pixel.

Also fix a bug when the closest_index is not last. The sample positions
were incorrect in this case.
2021-02-24 11:37:03 +01:00
bb2af40ec7 Fix T85726 Workbench: Orthographic view is blurry
This was caused by the window_translate_m4 not offsetting the winmat in the
right direction for perspective view. Thus leading to incorrect weights.
The workbench sample weight computation was also inverted.

This fix will change the sampling pattern for EEVEE too (it will just
mirror it in perspective view).
2021-02-24 11:37:03 +01:00
1a427973b4 Fix incorrect icon .dat files after recent commit
Using `make icons` for 420f538fad changed some icons that it shouldn't have
touched on my system. Not sure what caused this, maybe a bug in the slightly
outdated Inkscape version there (1.0.1). Here on macOS the version is only
reported as 1.0 so I'm not sure what the situation is. Either way, this fixes
the icons.
2021-02-24 11:29:01 +01:00
daf7f42364 Fix line width broken for consecutive line draw calls
D9054 did multiple consecutive `immBegin()`/`immEnd()` draw calls to draw
multiple lines at varying thickness. This would only work for the first line,
then they'd all get a 1px thickness (at least on macOS).

Issue was that `wide_line_workaround_end()` called `immBindShader()` directly
to restore the old shader (which the workaround overrides). However this
doesn't set `imm->builtin_shader_bound` which has to be done for the workaround
to work on the next `immBegin()` call. Instead `immBindBuiltinProgram()` can be
called.

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

Reviewed by: Clément Foucault
2021-02-24 11:16:51 +01:00
0fe25a6232 Fix T85939: Eevee Specular BSDF shader compile error
Introduced by 7f7e683099.
2021-02-24 10:45:25 +01:00
8d50a3e19e Fix T85930: Custom Property Error: Wrong Subtype
Regression in 08dbc4f996

Unfortunately lambda functions don't work with postponed annotations.
2021-02-24 16:16:53 +11:00
d4c0c40015 Cleanup: spelling 2021-02-24 15:53:03 +11:00
5c2e10d5ed Docs: clarify radial/cycle use for BMesh loops
Also add minor corrections clarifications elsewhere.
2021-02-24 15:39:43 +11:00
b2c7ea6d82 Geometry Nodes: Move node UI storage function to BKE
This function will be used in another file with attribute search,
so it makes sense to share from the UI storage header.
2021-02-23 17:15:03 -06:00
dde7d4417a GPencil: Fix typo error in previous commit 2021-02-23 23:09:33 +01:00
4d9d87d2bf GPencil: Improve Flip algorithm for Interpolate
If the lines cross, but the angle is very sharp, check the distance between the extremes.
2021-02-23 23:06:06 +01:00
b67b1d59c3 Merge branch 'blender-v2.92-release' 2021-02-23 13:59:24 -08:00
eb554051e7 Revert Automatic Tablet API dynamic fallback.
Removes fallback to Windows Ink when Wintab reports no devices present.
Returns to old behavior of using only Wintab if Wintab.dll exists.
2021-02-23 13:29:59 -08:00
ee4f306509 Fix T85844: high pressure at start of line.
m_tabletInRange is no longer set for Wintab after 2e81f2c01a
reverted Wintab changes. This reverts most button processing to
behavior present in 2.91.2.

Left in place is a bugfix for Windows Ink: button events while a
Windows Ink pen is in range should still be processed. Events processed
by Windows Ink and not passed to DefWindowProc do not create WM_*BUTTON
events, but button events from e.g. tablet pad express keys do create
WM_*BUTTON events and should be handled.
2021-02-23 13:29:59 -08:00
f227a69a87 Revert high fequency mouse input for Windows.
Windows mouse history function GetMouesMovePointsEx has well documented
bugs where it receives and returns 32 bit screen coordinates, but
internally truncates to unsigned 16 bits. For mouse (relative position)
input this is not a problem as motion events and the resulting screen
coordinates reliably fit within 16 bit precision.

For tablets (absolute position) the 16 bit truncation results in
corrupt history when tablet drivers use mouse_event or SendInput from
the Windows API to move the mouse cursor. Both of these functions take
absolute mouse position as singed 32 bit value on the range of 0-65535
(or 0x0-0xFFFF) inclusive. Values larger than 0x7FFF (the largest
signed 16 bit value) are reliably corrupt when retrieved from
GetMouesMovePointsEx history. This is true regardless of whether mouse
history is retrieved using display resolution (GMMP_USE_DISPLAY_POINTS)
or high resolution points (GMMP_USE_HIGH_RESOLUTION_POINTS), the latter
of which should return points in range 0-65535.

Reviewed By: brecht

Maniphest Tasks: T85874

Differential Revision: https://developer.blender.org/D10507
2021-02-23 13:29:51 -08:00
8d02fdc7e0 WM_MOUSEMOVE cleanup. 2021-02-23 11:47:53 -08:00
6844b768f3 Revert Automatic Tablet API dynamic fallback.
Removes fallback to Windows Ink when Wintab reports no devices present.
Returns to old behavior of using only Wintab if Wintab.dll exists.
2021-02-23 11:27:40 -08:00
37afeb7eaa Fix T85844: high pressure at start of line.
m_tabletInRange is no longer set for Wintab after 2e81f2c01a
reverted Wintab changes. This reverts most button processing to
behavior present in 2.91.2.

Left in place is a bugfix for Windows Ink: button events while a
Windows Ink pen is in range should still be processed. Events processed
by Windows Ink and not passed to DefWindowProc do not create WM_*BUTTON
events, but button events from e.g. tablet pad express keys do create
WM_*BUTTON events and should be handled.
2021-02-23 11:27:40 -08:00
cd9dbe317d Revert high fequency mouse input for Windows.
Windows mouse history function GetMouesMovePointsEx has well documented
bugs where it receives and returns 32 bit screen coordinates, but
internally truncates to unsigned 16 bits. For mouse (relative position)
input this is not a problem as motion events and the resulting screen
coordinates reliably fit within 16 bit precision.

For tablets (absolute position) the 16 bit truncation results in
corrupt history when tablet drivers use mouse_event or SendInput from
the Windows API to move the mouse cursor. Both of these functions take
absolute mouse position as singed 32 bit value on the range of 0-65535
(or 0x0-0xFFFF) inclusive. Values larger than 0x7FFF (the largest
signed 16 bit value) are reliably corrupt when retrieved from
GetMouesMovePointsEx history. This is true regardless of whether mouse
history is retrieved using display resolution (GMMP_USE_DISPLAY_POINTS)
or high resolution points (GMMP_USE_HIGH_RESOLUTION_POINTS), the latter
of which should return points in range 0-65535.

Reviewed By: brecht

Maniphest Tasks: T85874

Differential Revision: https://developer.blender.org/D10507
2021-02-23 11:25:27 -08:00
b123aadeee Fix T85895: Viewing value passes in Image Editor displays the value as alpha
There was a similar report prior to the introduction of the Image
Engine, see T74586.
This was fixed by rB6a5bd812b569 at that time, but got lost in the
refactor it seems.

Above commit introduced the `ED_space_image_get_display_channel_mask`
function that will determine
the valid bitflags for the display channel of a given ImBuf.

But since the refactor, this is not called anymore (`draw_image_main` is
not called anymore)
Now it seems we can safely reuse that said function
`ED_space_image_get_display_channel_mask` also for the Image Engine.

Maniphest Tasks: T85895

Differential Revision: https://developer.blender.org/D10510
2021-02-23 18:32:09 +01:00
64c35769f9 Cleanup: Remove unecessary double negative 2021-02-23 11:25:13 -06:00
c62e60f01f Annotations: Add layer Opacity paramater
This option was removed in the refactor of grease pencil and never was set again.
2021-02-23 16:14:56 +01:00
18be02b859 Geometry Nodes: improve accessing attribute meta data
This allows accessing attribute meta data like domain and data type
without having to create a `ReadAttribute`. I kept the `attribute_names`
method for now to keep the patch more self contained.

Differential Revision: https://developer.blender.org/D10511
2021-02-23 15:15:29 +01:00
Yevgeny Makarov
420f538fad Fix T84707: Wrong icon for Movie Clip Editor
Sync the list of icons in CMakeLists.txt with UI_icons.h.
Restore, in the source file, the FUND icon that was accidentally
deleted.
Delete four old/unused icons.

See also D9715.
2021-02-23 12:07:25 +01:00
aa4882506c BLI: new FunctionRef type
Using `FunctionRef` is better than using `std::function`, templates and c function
pointers in some cases. The trade offs are explained in more detail in code documentation.

The following are some of the main benefits of using `FunctionRef`:
* It is convenient to use with all kinds of callables.
* It is cheaper to construct, copy and (possibly) call compared to `std::function`.
* Functions taking a `FunctionRef` as parameter don't need to be declared
  in header files (as is necessary when using templates usually).

Differential Revision:  https://developer.blender.org/D10476
2021-02-23 11:52:06 +01:00
b2e1b13abd Cycles: Add option to change input passes for viewport denoising
There are cases where the default input passes of color+albedo do not yield useful results
and while this was possible to change that for final frame rendering (in the layer settings),
viewport denoising always used a fixed color+albedo. This adds an option to change the
input passes for viewport denoising too, so that one can use it in scenes that otherwise
wouldn't work well with it.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D10404
2021-02-23 11:45:02 +01:00
bfb2e87a9e Cleanup: Use shorter enum names
With the full node name at the beginning, these names can get quite long.
Slightly different words shorten them just a bit.
2021-02-22 23:33:04 -06:00
82605093e9 Alembic procedural: avoid storing constant hair topology for each frame
Only store the curve keys and radiuses for each frame if the topology does not change through time, this helps saving quit a bit of memory.
2021-02-23 06:06:54 +01:00
87ef037459 Alembic procedural: cleanup, demultiply Object and Geometry Node
creation
2021-02-23 06:06:50 +01:00
3d5e290ee0 Alembic procedural: use an enumeration to discriminate IObjects
Using the various IObject::matches() to do so was expensive and would
show up in profiles as requires creating std::strings for each call.
2021-02-23 05:31:34 +01:00
d9abcee47e Alembic procedural: fix crash when accessing data out of frame bounds 2021-02-23 05:16:49 +01:00
9fe53bd4a1 Build Environment/macOS/Python: link against zlib statically
rBc70eb30240f8b5d5a8f2ac509f0eb585936142b5 added patch to use static
zlib on Linux. But also added flags to use the zlib in LIBDIR for
Python on macOS. That causes some shared libraries (binascii for one)
to link against libz.1.dylib which will not be there on users' systems.
Reuse the said patch for macOS also to avoid rpath issues.

Fix T85648.
Reviewed By: #platform_macos, brecht
Differential Revision: https://developer.blender.org/D10479
2021-02-23 08:34:33 +05:30
d447bd3e4a Fix T85638: Child Window Positioning on Multiple Monitors
Constraint of new window position can be incorrect when using multiple monitors.

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

Reviewed by Brecht Van Lommel
2021-02-22 13:47:21 -08:00
beb1f1b805 Win32: Do not (yet) set window styles for Dialog
Remove the setting of Dialog window styles until we confirm expected behavior between platforms.

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

Own Code
2021-02-22 12:46:45 -08:00
9c395d6275 UI: Remove Blend Thumb Passepartout
Removal of 'camera frame' around blend file thumbnail images.

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

Reviewed by Brecht Van Lommel
2021-02-22 11:52:19 -08:00
be9842f65b UI: Simplify Window Creation
Refactoring: WM_window_open() that can open different types of windows. 'New Window' with simplified layout.

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

Reviewed by Brecht Van Lommel
2021-02-22 11:38:21 -08:00
3d2d8a1aab Fix: Geometry nodes not depending on instanced collections properly
Geometry nodes were not adding referenced instanced collections as
dependencies to depsgraph.

This would lead to meshes and data not being ready on evaluation in
certain cases.
2021-02-22 20:28:47 +01:00
441c660270 Cleanup: Use bool instead of char 2021-02-22 13:18:49 -06:00
449ccf07e0 CMake/Windows: Update for new XR_OPENXR version
This updates platform/platform_win32.cmake to support
both the old and new library names for OpenXR.

The new version links against one additional system
library and the debug library filename changed ever
so slightly.

This is a temporary workaround and can be removed
once the new lib versions have landed.
2021-02-22 11:08:52 -07:00
cd8f2dfecc CMake/Windows: Detect Boost version
Rather than hardcoding the lib names, read
boosts version.hpp and extract the version
from there.

This will make it easier to land lib changes
in the near future.
2021-02-22 11:03:44 -07:00
5f8b6a9c0e Fix T85753: Default UVs for Icosphere are flipped horizontally
These were flipped since their introduction in rBa070a5befa11.

Maniphest Tasks: T85753

Differential Revision: https://developer.blender.org/D10465
2021-02-22 18:47:47 +01:00
Pascal Schön
277b4f4b93 Fix Principled BSDF specular color for black base color
Specular color is set to black instead of white inside the Principled BSDF
when the base color is set to fully black. This is contradictory to the sample
code of the Disney BRDF in BRDF Explorer. This patch aligns both
implementations.

Differential Revision: https://developer.blender.org/D10448
2021-02-22 18:33:05 +01:00
32073993a8 i18n messages extraction script: fix handling of C unicode-escapes.
rB1f5647c07d15 introduced for the first time a unicode escape in strings
to be translated, directly extracted from C-code itself.

This revealed that this case was not properly handled by current code,
for now we work around using `raw_unicode_escape` encoding/decoding of
python.
2021-02-22 18:32:49 +01:00
46bdf6d59f Fix T85768: Win32 Full-Screen Owned Windows
Improvements to how window states are determined and changed.

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

Reviewed by Brecht Van Lommel
2021-02-22 09:32:15 -08:00
d45a89ee44 Fix T85609 EEVEE: Viewport "vibrates" when mouse input is active
Taa offset was applied on first sample. This wasn't happening before
DOF refactor.

Also fixes T85618 Wireframe Displays Strangely in Eevee (Rendered,
material Preview)
2021-02-22 17:34:09 +01:00
cd1a083984 Fix T85720 EEVEE: Contact shadows do not appear when enabling SSR
Contact shadows needed correct `gl_FragCoord.z` but this is not
correctly set for fullscreen passes. Need to pass depth using a global
variable until we get rid of `cl_eval.tracing_depth`.
2021-02-22 17:34:09 +01:00
1ec626f4bd Fix T85549: GPencil draw tool offset when UI scale is not 1
There was a mistake in the variables saved and when resolution of the UI was not 1.0, the viewport was offset.
2021-02-22 17:18:32 +01:00
80793fc740 Cleanup: Use more clear field name
Disambiguate which time the frames are measured in.
2021-02-22 16:30:04 +01:00
dec73ed409 Cleanup: Tracking, reduce indentation level 2021-02-22 16:30:04 +01:00
da5eed7ee6 Cleanup: Spelling in comment 2021-02-22 16:30:04 +01:00
af89c9f9a6 Cleanup: Decrease variable scope 2021-02-22 09:28:17 -06:00
9ef2679ca9 Cleanup: Clang tidy inconsistent parameter name
Use the most recent names for the conflicting parameters.
2021-02-22 09:28:00 -06:00
fcac3d04f5 Fix T85850: GPencil Interpolate tool panel wrongly aligned
The layout was wrong.
2021-02-22 16:12:40 +01:00
046fe55e63 Fix T85869: GPencill Fill tool panel was not aligned as expected
The direction of the brush was displayed vertically.
2021-02-22 16:05:12 +01:00
6cd8c33d00 Fix compilation error in bypass bmesh commit when GMP not defined. 2021-02-22 09:54:18 -05:00
dd2e0150ae Various UI messages fixes and tweaks. 2021-02-22 15:48:54 +01:00
Evan Wilson
bc851700a6 Fix T85820: False Color not available in color management
Differential Revision: https://developer.blender.org/D10489
2021-02-22 14:52:04 +01:00
Pablo Dobarro
1a5027449a Fix proportional connected not working with loose edges due to hidden geometry
This was introduced in the new geodesic distances algorithm for proportional
editing. When all faces of an edge are hidden, that edge should be considered
as loose geometry.

Initial patch by Pablo with modifications by Brecht.

Differential Revision: https://developer.blender.org/D10488
2021-02-22 13:31:07 +01:00
4577ccc603 Merge branch 'blender-v2.92-release' 2021-02-22 13:28:52 +01:00
e497c1b93c Fix T85865: Crash when selecting Image texture node
Typo in rB7470c10601d0.

Maniphest Tasks: T85865

Differential Revision: https://developer.blender.org/D10496
2021-02-22 13:21:39 +01:00
c44c611c6d PyAPI: expose unstable type bpy.props._PropertyDeferred
Even though this might change, rigify, animation-nodes & translation
extraction depend on being able to extract this information.
2021-02-22 23:00:11 +11:00
Germano Cavalcante
086d70e910 GPU Python: Use 'PyC_ParseStringEnum' to parse items
Currently the GPU module for python has different ways to handle enums.
- Organizing items in `PyC_StringEnumItems` arrays and parsing them with `PyC_ParseStringEnum`.
- Using dedicated functions for each type of enum (`bpygpu_ParsePrimType`, `pygpu_ParseVertCompType` and `pygpu_ParseVertFetchMode`).

Although apparently more efficient (especially `pygpu_ParseVertCompType`
which transforms strings into integers for simple comparison), these
dedicated functions duplicate functionality, increase the complexity of
the code and consequently make it less readable.

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D10456
2021-02-22 08:35:52 -03:00
78c3caf3c1 Fix crash auto-completing bpy.types in the Python console
Reference counting error in dc61a63e3f
2021-02-22 22:30:13 +11:00
623ddc4aa6 Fix i18n messages extraction tool after update to support py 3.10.
The new defferred approach broke existing way to access items from
struct definition...

See T85872.
2021-02-22 12:20:25 +01:00
06212759bc Fix missing NULL check on macOS when system-python isn't found
Regression from cafd6b519c.

D10494 by @ysano with edits.
2021-02-22 21:20:48 +11:00
b4147aeeab Cleanup: unused variable 2021-02-22 10:29:34 +01:00
29a28a87e4 Added a cast needed to shut up an error in last commit. 2021-02-21 22:11:59 -05:00
af940c68cb Fix Cycles world volume scattering missing light in some cases
With very large distances there were precision / overflow errors, normalize
the average albedo to avoid that. This was causing test failures on macOS
Arm, but also other architectures had slightly wrong results.

Ref T78710
2021-02-22 00:22:20 +01:00
a3f091d7ce Change Exact Boolean modifier to skip round trip through BMesh.
The Exact modifier code had been written to avoid using BMesh but
in the initial release the modifier still converted all Meshes to
BMeshes, and then after running the boolean code on the BMeshes,
converted the result back to a Mesh.
This change skips that. Most of the work here is in getting the
Custom Data layers right. The approach taken is to merge default
layers from all operand meshes into the final result, and then
use the original verts, edges, polys, and loops to copy or interpolate
the appropriate custom data layers from all operands into the result.
2021-02-21 17:57:03 -05:00
7883eb04ed CMake/Deps: OpenEXR 2.5.5 2021-02-21 09:34:22 -07:00
e6b7905fe6 Fix memory leak when loading previous preferences from splash screen
When opening a Blender version for which there are no preferences, the splash
shows a button like "Load 2.92 Settings". Using this could cause a memory leak
of the storage for recently opened files.
2021-02-21 17:32:33 +01:00
Yevgeny Makarov
0c62906a41 UI: Correct the text alignment in the quick setup (splash screen) dialog
The "quick setup" dialog is actually a 'menu', and the "splash screen" block
contains the UI_BLOCK_LOOP flag which causes the buttons' text to align
to the left, however, usually regular buttons have centered text.

As a workaround, add the UI_BLOCK_QUICK_SETUP flag which prevents
the text from being left-aligned.

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

Reviewed by: Julian Eisel
2021-02-21 17:32:33 +01:00
08dbc4f996 PyAPI: use postponed annotations to support Python 3.10
Support Python 3.10a5 or 3.9x with support explicitly enabled.

- Enable Python's postponed annotations for Blender's RNA classes
  types registered on startup.

- Using postponed annotations has implications for how they are defined,
  since they must evaluate in the modules name-space instead of the
  classes name-space. See changes to annotations in `release/scripts`.

- Use `from __future__ import annotations` at the top of the module
  to ensure the script will run with Python 3.10.

- Old logic is kept since it could be used if PEP-649 is supported.

Resolves T83626

Ref D10474
2021-02-21 22:37:53 +11:00
de67e3c0c0 PyAPI: expose bpy_prop_deferred function & keywords
While not needed for Blender, Animation Nodes uses this information,
expose this information for scripts to access that need it.
2021-02-21 21:15:13 +11:00
c6ddb68b7a Cleanup: remove unused layers property from template
Also remove unused imports.
2021-02-21 20:55:31 +11:00
af37c3e8f1 Cleanup: remove duplicate settings from operator_mesh_add template
Also move align items into the enum call as there is no need to have
this accessible from the class.
2021-02-21 19:48:11 +11:00
4dd782a1a3 Fix T85714 Crash when Viewport Rending an image using EEVEE.
Was caused by non initialized render_timesteps.
2021-02-21 01:52:57 +01:00
48167644b7 Fix T85603 EEVEE: Baking Indirect lighting crashes Blender
Was caused by non initialized render_timesteps.
2021-02-21 01:33:56 +01:00
ba43b4c04d Cleanup: EEVEE: Rename variable named sample because ...
.. it's a reserved keyword on GL > 4.0.
2021-02-21 01:33:56 +01:00
2ce4a403d9 Cleanup: EEVEE: Rename aperture to cone angle when it make sense
Aperture for a cone is 2 times the cone angle.
2021-02-21 01:33:56 +01:00
33b4a03ca9 Cleanup: EEVEE: Use P and vP instead of worldPosition and viewPosition
... for local variables.
2021-02-21 01:33:56 +01:00
d0959924ad Cleanup: EEVEE: Use P for world position instead of W
This removes the last places where this was not the case.

We follow cycles convention of P being for Postion.
2021-02-21 01:33:56 +01:00
1d51cb6be2 Cleanup: EEVEE: change cameraVec macro to cameraVec(P)
This makes is clearer and avoid having to setup worldPosition if
shader is not a material shader.
2021-02-21 01:33:56 +01:00
dee94afd03 EEVEE: Ambient Occlusion Node: Support inverted and distance parameters
This adds an approximation of inverted AO by reversing the max horizon
search (becoming a min horizon). The horizons are correctly clamped in
the reverse direction to the shading and geometric normals.

The arc integration is untouched as it seems to be symetrical.

The limitation of this technique is that since it is still screen-space
AO you don't get other hidden surfaces occlusion. This is more
problematic in the case of inverted AO than for normal AO but it's
better than no support AO.

Support of distance parameter was easy thanks to recent AO refactor.
2021-02-21 01:33:56 +01:00
764082676b GPU: Add define to ouput more context lines for GLSL errors
This is work in progress, but it is very useful even as it is.
2021-02-21 01:33:56 +01:00
6fa984a1af GPU: Add RGB10_A2 format support
Nice format to output high definition normals or normalized colors.
2021-02-21 01:33:56 +01:00
1a9fe57a9f EEVEE: Planar Reflections: Fix regression
Fix regression with roughness not masking reflections when not using
Screen Space raytracing.

The trick was to only evaluate one planar per pixel, the one with
the most influence. This should not be too limiting since this is what
we do for SSR.

Also change evaluation order do not apply occlusion on planars probes.
2021-02-21 01:33:56 +01:00
274d7b87fd Cleanup: EEVEE: Remove SSR variant with AO
AO is always on in this case.
2021-02-21 01:33:56 +01:00
64d96f68d6 EEVEE: Ambient Occlusion: Refactor
- Fix noise/banding artifact on distant geometry.
- Fix overshadowing on un-occluded surfaces at grazing angle producing "fresnel"
  like shadowing. Some of it still appears but this is caused to the low number
  of horizons per pixel.
- Improve performance by using a fixed number of samples and fixing the
  sampling area size. A better sampling pattern is planned to recover
  the lost precision on large AO radius.
- Improved normal reconstruction for the AO pass.
- Improve Bent Normal reconstruction resulting in less faceted look on
  smoothed geometry.
- Add Thickness heuristic to avoid overshadowing of thin objects.
  Factor is currently hardcoded.
- Add bent normal support to Glossy reflections.
- Change Glossy occlusion to give less light leaks from lightprobes.
  It can overshadow on smooth surface but this should be mitigated by
  using SSR.
- Use Bent Normal for rough Glossy surfaces.
- Occlusion is now correctly evaluated for each BSDF. However this does make
  everything slower. This is mitigated by the fact the search is a lot faster
  than before.
2021-02-21 01:33:56 +01:00
6c2e1f3398 BLI: cleanup StringRef and Span and improve parameter validation
Previously, methods like `Span.drop_front` would crash when more
elements would be dropped than are available. While this is most
efficient, it is not very practical in some use cases. Also other languages
silently clamp the index, so one can easily write wrong code accidentally.

Now, `Span.drop_front` and similar methods will only crash when n
is negative. Too large values will be clamped down to their maximum
possible value. While this is slightly less efficient, I did not have a case
where this actually mattered yet. If it does matter in the future, we can
add a separate `*_unchecked` method.

This should not change the behavior of existing code.
2021-02-20 22:05:50 +01:00
d8b4246b9f GPencil: Remove old Interpolate menu option
This option was before move this action as a tool.
2021-02-20 19:29:24 +01:00
Yevgeny Makarov
cab26abbdb UI: Correct the text alignment of the RGB/HSV/Hex toggle in the color picker
Expanded enum items like this usually have centered text, but there are
limitations in the popup code that break this here. Add a workaround for this
limitation.

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

Reviewed by: Julian Eisel
2021-02-20 18:54:40 +01:00
f2c0bbed1c Python: Add to_curve method to the object API
This patch adds a to_curve method to the Object ID. This method is
analogous to the to_mesh method. The method can operate on curve and
text objects. For text objects, the text is converted into a 3D Curve ID
and that curve is returned. For curve objects, if apply_modifiers is
true, the spline deform modifiers will be applied and a Curve ID with
the result will be returned, otherwise a copy of the curve will be
returned.

The goal of this addition is to allow the developer to access the splines
of text objects and to get the result of modifier applications which was
otherwise not possible.

Reviewed By: Brecht

Differential Revision: https://developer.blender.org/D10354
2021-02-20 18:05:13 +02:00
5dced2a063 Geometry Nodes: expose float2 attribute in rna
This also fixes the issue reported in T85651.

Differential Revision: https://developer.blender.org/D10477
2021-02-20 11:33:43 +01:00
173b6b792c Cleanup: Split grease pencil selection index functions
This makes the code more readable.
2021-02-20 10:16:59 +01:00
37e6a1995a PyAPI: use a new type for storing the deferred result of bpy.props
This is needed to support Python 3.10's Postponed annotation evaluation.

It also simplifies type checking.
2021-02-20 16:19:33 +11:00
4cd808f912 Cleanup: spelling 2021-02-20 15:38:14 +11:00
7bb2b910c0 Cleanup: doxygen sections 2021-02-20 15:35:00 +11:00
83f285f56f Cleanup: reference near duplicate enum definitions 2021-02-20 15:34:55 +11:00
6e64d97ede Cleanup: remove duplicate enum 2021-02-20 15:34:55 +11:00
2d5b89be89 Cleanup: Disentangle outliner active status "get" and "set"
Previously the same functions were used to both set and get the active
state for outliner tree elements. This has quite a few problems.
 - It's hard to tell when data is changed or simply read
 - It prevents using `const`
 - The code is full of if statements, making it longer and less readable.

This commit replaces the `tree_element_type_active` and
`tree_element_active` functions with `_get` and `_set` variants. One
has const arguments and returns the active state, the other deals only
with setting the state. While this refactor results in slightly more
lines of code, the result is much better in my opinion.

This commit also removes unused variables from arguments of the affected
functions.

Differential Revision: https://developer.blender.org/D10232
2021-02-19 16:29:11 -06:00
Edgar Roman Cervantes
a961a2189c Geometry Nodes: Add string input node
This commit adds a simple string input node, intended for use in the
attribute workflow to make using the same attribute name in multiple
places easier. The node is function node similar to the existing vector
input node.

Ref T84971

Differential Revision: https://developer.blender.org/D10316
2021-02-19 16:03:14 -06:00
ee1c674775 UI: Use property split in geometry node properties
This makes the nodes look more consistent with the rest of the UI
by using the same split with right aligned labels as the property editor
and elsewhere. Additionally, for consistency, the "Type" part of some
dropdowns is removed. It already wasn't displayed everywhere, and
it gets redundant quite quickly.
2021-02-19 14:39:27 -06:00
b8bf662cce Cleanup: Comment formatting, spelling 2021-02-19 14:05:54 -06:00
34580748dc Fix T83027: Incorrect outliner collection state after operator
The "Hide Collection" operators assigned to the number keys in edit mode
trigger a redraw of the outliner, but as an optimization, they do *not*
trigger a rebuild of the tree.

This optimization is valid because unlike the collection exclude toggle,
the heirarchy is not affected by collection visibility. However, it means
that currently you must trigger a rebuild to get the correct "grayed out"
status after using the operator.

Rather than trigger a rebuild in this case to solve the bug, this patch
moves the decision for whether to gray out the text of a tree element
to the draw step rather than the build step. This means that any change
to the corresponding properties doesn't require a full tree rebuild.

Note that changing the "hide_viewport" property from the outliner still
causes a tree rebuild. I think that's because of the checks in
`outliner_collection_set_flag_recursive_fn`.
That could be optimized in the future.

Differential Revision: https://developer.blender.org/D10240
2021-02-19 13:56:49 -06:00
55700ac390 Cleanup: Fix clang tidy warning
0 cannot be used to initialize the whole settings struct.
2021-02-19 13:50:38 -06:00
Eitan
4891d4b3d1 Geometry Nodes: Add simple subdivision surface node
Add the Simple subdivision option to Geometry nodes, as a new node
instead of part of the existing subdivision node because of future
backend changes to the Simple option. (See T85584)

https://developer.blender.org/D10409
2021-02-19 13:20:04 -06:00
720d76a978 Merge branch 'blender-v2.92-release' 2021-02-19 19:05:38 +01:00
b1142858d4 Revert "Fix T80313: Fix clipped text in splash screen on hiDPI monitors"
This reverts commit 7ee518cf70.

Causes T84869. The initial issue is less bad than this. We are looking into
alternative fixes for 2.93 (see D9854 and D9853).
2021-02-19 19:02:57 +01:00
a23c7fd570 Geometry Nodes: forbid creating attribute with empty name
Empty attribute names are just a recipe for problems.
2021-02-19 18:10:03 +01:00
a346a7dd10 GPencil: Don't show only lines in draw mode
As now is possible to use multiframe in Draw mode, the option to display only lines must be disabled.
2021-02-19 18:00:34 +01:00
116cda65a2 UI: fuzzy search in collection search
This adds fuzzy search functionality to various input fields in Blender
where one can choose a value from many existing values (e.g. the
Vertex Group property in the Displace modifier).

Differential Revision: https://developer.blender.org/D10446
2021-02-19 17:56:24 +01:00
6bba830589 GPencil: Interpolate Tools refactor
Following with the changes included to interpolate strokes of different number of points, a full review has been done in the interpolation tools.

* Interpolate now is a tool and not an operator. It was not logic to have this tool as a button.
* Interpolate tool parameters have been moved to topbar.
* Interpolate popover has been removed from topbar and interpolate `Sequence` operator has been moved to grease pencil menu.
* Interpolate Sequence now include a Redo panel.
* Interpolate tool now allows to select the strokes by pairs. This allows to interpolate any stroke with any stroke and not as before that it was only possible by drawing order. If no stroke is selected, the interpolation is done as before.
* Now is possible interpolate again if a previous keyframe exist. Before, it was impossible to interpolate two times in same frame and this made impossible to do the interpolation by groups of frames.
* New automatic option to `Flip strokes` if the stroke and end are not in the right position. Also the flip can be set manually for corner cases.
* Cleanup of menus related to interpolate.
* Fixed some bugs and removed parameters from scene because now all are tool or operator contained.
* Some code cleanup and function renames.

This commit also includes the some codebase to future implementation of the concept `Vertex Active` that now does not exist in grease pencil.
2021-02-19 17:41:28 +01:00
2441886c58 UI: Use title case for label 2021-02-19 10:17:08 -06:00
1f5647c07d UI: FModifier layout updates, drag and drop
This patch implements the list panel system D7490 for FCurve modifiers.

The UI layouts are updated to make use of subpanels and to be consistent
with the rest of the interface, and easier to understand.

See the differential revision for screenshots.

This commit also significantly cleans up the FModifier UI code, and
improves, mainly by replacing the old button creation code is with
the newer interface API using RNA. In turn there is a bit of complexity
added because each FModifier has a separate panel.

Although reordering of FModifiers was not implemented before, we get
drag and drop basically for free here, so it is also included.
As noted in some older to do tasks, FModifiers aren't evaluated
in perfect order, which may be a point of improvement for the future.

Differential Revision: https://developer.blender.org/D7997
2021-02-19 10:11:35 -06:00
0d94695cc4 Fix T85745: Render grease pencil with time offset modifier fails
The problem was introduced fixing task T85035. 

As the frame was set again when render, if there was a time modifier, the frame was not remaped to the right frame number.
2021-02-19 16:18:36 +01:00
2b8c2438e4 Cleanup: Use braces after if statement 2021-02-19 08:07:18 -06:00
b6f9f83daf CMake/Deps: Mesa, harvest lib files from new location
The upgraded Mesa (see D10282) stores library files in `mesa/lib64`.
2021-02-19 14:33:45 +01:00
c97ea30e95 Merge branch 'blender-v2.92-release' 2021-02-19 13:49:56 +01:00
Peter Fog
94cd52a162 VSE: Fix duplicate menu entries
Commit rBf448ff2afe7a accidentally added menu entries that were removed.
`use_zoom_to_fit` is duplicated in menu, others were moved to overlays menu.

Remove these entries.

Reviewed By: ISS, campbellbarton

Differential Revision: https://developer.blender.org/D10453
2021-02-19 13:46:44 +01:00
3ae7a0f059 Cleanup: typo 2021-02-19 12:31:38 +01:00
e2caca1796 Nodes: only show warning icon if there are warnings 2021-02-19 12:31:38 +01:00
14f1d8962f Geometry Nodes: add method to get all geometry components in a set
Previously, functions would have to ask for every geometry type explicitely.

Using a vector is return type is fine. In practice this will probably never
allocate because of the small buffer optimization in vector.
2021-02-19 12:31:38 +01:00
ed070dd51d Docs: corrections to vertex group & face-map docstrings
Address issue raised by T77920
2021-02-19 22:12:41 +11:00
dc61a63e3f PyAPI: include all members in dir(bpy.types)
C/Python defined types were accessible but not exposed in dir(bpy.types)
2021-02-19 22:12:41 +11:00
eafcbbb4f7 PyAPI: use real module for bpy.types
This is needed to support `typing.get_type_hints`,
which expects each classes module to have a module '__dict__'.
2021-02-19 22:12:41 +11:00
80e5697b0b Cleanup: fix asan warnings 2021-02-19 12:05:59 +01:00
55c1021be4 Cleanup: extract function to get node ui storage
This function will be used by multiple functions.
2021-02-19 12:03:27 +01:00
Wannes Malfait
359d0029fe Fix T85763: Align Rotation to Vector node fails for collinear vectors
If the axes are aligned in auto pivot mode then the rotation axis would be (0,0,0).
We now fall back to the x axis in this case. If that fails, we fall back to the y axis.

Differential Revision: https://developer.blender.org/D10466
2021-02-19 11:37:35 +01:00
47fc1e11db Nodes: ensure ui storage implicitely
This makes it easier to use the api.
2021-02-19 11:27:40 +01:00
51c2ee4346 Geometry Nodes: use corner domain for densities in Point Distribute node
Previously, the density was set per point. That implies that when a
point has a non-zero weight, points might be distributed in all
connected polygons. By specifying the density per corner, this
limitation is removed. Note, per-point density maps (such as vertex
groups) can still be used. They will be adapted to the corner domain
without loss of information.

Differential Revision: https://developer.blender.org/D10461
2021-02-19 10:32:39 +01:00
cb3e092d45 Merge branch 'blender-v2.92-release' 2021-02-19 02:00:56 -05:00
241273d362 API Docs: Fix generation failing with unused context members
Instead of raising an expection a warnign is generated instead. This 
fixes the issue where `['hair', 'pointcloud']` are disabled for release 
builds. In the future a better solution would be to generate the context 
map dynamically but this would require refactoring of the API: D9988
2021-02-19 01:58:16 -05:00
7266d8e32a PyAPI Docs: Fix deprecation warning with new theme version 2021-02-18 23:55:23 -05:00
62c1b33f5e PyAPI Docs: Clarifiy vertex group index list paramater
See T77920
2021-02-18 23:13:30 -05:00
f75f447ce8 Merge branch 'blender-v2.92-release' 2021-02-18 22:54:22 -05:00
e6acc4db72 Instead of raising an expection a warnign is generated instead.
This fixes the issue where `['hair', 'pointcloud']` are disabled for 
release builds.
In the future a better solution would be to generate the context map 
dynamically but this would require refactoring of the API: D9988

Fixes T80364

Differential revision: https://developer.blender.org/D10468
2021-02-18 22:51:24 -05:00
eecb90d8d2 PyAPI: bpy.utils.execfile temporarily overrides the __main__ module
This is needed to support Python 3.10's `typing.get_type_hints`,
to access the name-space used when creating the class.

Also added a docstring for execfile.
2021-02-19 11:23:30 +11:00
4604350eef UI: Expand enum in collection info node 2021-02-18 17:56:47 -06:00
a7c1aa245f Cleanup: Remove type from global namespace in C++ header 2021-02-18 17:53:08 -06:00
27fd066baf Cleanup: Clang tidy inconsistent parameter name 2021-02-18 13:59:08 -06:00
73f4dfa3c5 Cleanup: Clang tidy else after return 2021-02-18 13:58:27 -06:00
Matt Hill
d519b33b32 Fix T85410: Quick liquid domain alignment
When `Preferences → Editing → New Objects → Align To` is set to `3D
Cursor`, the fluid domain added by `Object → Quick Effects → Quick
Liquid` is aligned to the 3D cursor.  This shouldn't be the case, since
these aren't new objects created directly by the user.

Differential Revision: https://developer.blender.org/D10467
2021-02-18 13:51:39 -06:00
782bed1984 Merge branch 'blender-v2.92-release' 2021-02-18 19:05:09 +01:00
c297bef9af Fix T85762: Crash when opening 2.83 VSE file
Crash happened in versioning code on NULL dereference in function
seq_convert_transform_crop() for Strip crop and transform
fields.

Strips created after rB1fd7b380f4cf were assumed to have crop and
transform always initialized, but this wasn't the case. This has been
fixed in 2.90, but not in versioning code.

Initialize these fields if they are not initialized already.

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D10463
2021-02-18 18:59:42 +01:00
f3bf87e588 GPencil: Small frame evaluation speed up improvement
Avoid look for frame if the actual frame is already available.
2021-02-18 18:30:07 +01:00
62b8c2a66a GPencil: Add missing edit lines in Multiframe mode
When edit using Onion skin, the edit line was missing.
2021-02-18 17:21:21 +01:00
81ac0bf759 Fix failing "Edit Source" (asserts) while number slider was visible
E.g. steps to reproduce:
* Enter Vertex Paint mode
* In the tool settings, right-click > "Edit Source"

When creating a number slider via `layout.prop(..., slider=True)`, the UI code
would reallocate the number button to be a number-slider button. That's because
we now actually have different button data-structures for these (see
e6f0b60c2e). The edit source code stored data based on the button pointers,
which didn't get updated after changing the type. The fix just adds this
updating.
2021-02-18 17:17:48 +01:00
afa5da9ce0 Cleanup: remove check for non-annotation properties in classes
This was added to assist upgrading scripts to Blender 2.8x,
now 2.9x is released there is no need to keep this block.
2021-02-19 02:19:53 +11:00
9df9269173 Cleanup: sort structs, file-lists 2021-02-19 02:19:53 +11:00
7e11595364 Cleanup: clang-format 2021-02-19 02:19:53 +11:00
aa2da44b82 Cleanup: use doxy sections 2021-02-19 02:19:53 +11:00
e79916eb47 Cleanup: order shape_len after shape argument
This matches nearly all other argument ordering in Blender,
including Python mathutils API.
2021-02-19 02:19:53 +11:00
10a54bbd06 Cleanup: spelling, correct doc-string arguments 2021-02-19 02:19:53 +11:00
bcb9e8e1a7 Fix T85769: Grease Pencil Fill option when drawing no longer works
The fill unclamped thickness value was not properly initialized for using with the new antialiasing.

The error was introduced in commit 09f7c93858
2021-02-18 16:16:02 +01:00
74383a332b Cleanup: Fix unused variable warning
exception was not used and can be safely removed
2021-02-18 08:09:08 -07:00
f521aa445d Merge branch 'blender-v2.92-release' 2021-02-18 15:36:32 +01:00
f1f8074b8d GPencil: Fix unreported broken use only lines in multiframe
This option was broken since the draw engine refactor and it was impossible to display only edit lines for multiframe mode.
2021-02-18 15:34:52 +01:00
0fe5be3525 Cleanup: return const reference instead of copy
There isn't really a reason for why this has to return a copy of
the data instead of a reference.
2021-02-18 12:40:27 +01:00
e1fe1fcc79 Cleanup: rename AttributeInfo to AttributeKind
"Kind" is a bit less generic than "Info" for me. Especially, it implies
that the struct does not contain the name of a specific attribute
(for me anyway).
2021-02-18 12:32:40 +01:00
b166429fc9 Merge branch 'blender-v2.92-release' 2021-02-18 11:11:00 +01:00
75580fa6a6 Fix flashing eevee render passes in viewport
Caused by rB85fe12071ad7.

When looking at a render pass in viewport and move the camera, there's a
"flash" effect in this AOVs test file:

{F9753476}

{F9753473}

The cause seems to be that taa_current_sample when rendering
(DRW_state_is_image_render()) is ok because it has been incremented in
EEVEE_temporal_sampling_draw but taa_current_sample is wrong when we are
not rendering.

D10375 by Ulysse Martin (youle) with clang format changes.

Reviewed By: jbakker, lichtwerk, also blessing from fclem

Differential Revision: https://developer.blender.org/D10375
2021-02-18 11:05:39 +01:00
72e2b5060d Geometry Nodes: support adapting point to corner domain
This allows accessing per-point attributes on the corner domain,
which can be useful e.g. when adding per-point displacement
to per-corner uv coordinates.

Also it is required to make an upcoming patch work well, that
makes the Point Distribute node use density weights per corner
instead of per point, giving the user more precise control over
the distribution.
2021-02-18 11:03:38 +01:00
e3f0b6d5cb Geometry Nodes: support accessing vertex colors
This makes vertex colors available in geometry nodes similar to
how uvs are available. They can be used using the attribute system.
Vertex colors are stored per corner (as are uvs, but not like vertex weights).

Ref T84297.

Differential Revision: https://developer.blender.org/D10454
2021-02-18 10:24:02 +01:00
999abee874 Geometry Nodes: convert point cloud to mesh vertices for modifiers
Previously, when a Geometry Nodes modifier outputs a point cloud
(e.g. generated using the Point Distribute node), other modifiers
could not use that data. Now, the point cloud data is converted to
mesh vertices for such modifiers.

Ref T85281.

Differential Revision: https://developer.blender.org/D10451
2021-02-18 10:13:56 +01:00
1bcc8f8410 Cleanup: Python: naming mismatch in bvh.ray_cast. 2021-02-18 09:09:31 +01:00
450ea1b755 Cleanup: Decrease variable scope 2021-02-17 16:59:50 -06:00
5fef212e31 Cleanup: Use const argument, decrease variable scope 2021-02-17 16:42:20 -06:00
fd75f7c135 Cleanup: Use Vector instead of of raw array 2021-02-17 16:19:50 -06:00
78116a1edc macOS: support building with command line tools without full Xcode
Latest Xcode takes up 15GB, command line tools are only 1.2GB.
2021-02-17 21:05:09 +01:00
eeeb85baf8 Cleanup: Comment formatting in node_draw.cc 2021-02-17 13:34:49 -06:00
af824b09c7 MSVC: Suppress C4251 in OpenVDB/Mantaflow
All headers in the svn libraries should be
building with /W0 however MSVC 16.8/16.9
has broken this functionality making OpenVDB
emit lots of warnings.

The breakage was reported [1] in august to MS
but they still have not gotten around to
addressing the issue.

This change explicitly suppresses C4251 in the
module that emitted these warnings. As the warning
is useful in other parts of blender a localized
approach is taken rather than a global suppression.

[1] https://developercommunity.visualstudio.com/content/problem/1167590/bug.html
2021-02-17 12:23:01 -07:00
f29a1d87e8 Fix: Attribute randomize node broken for integer attributes
The integer mode still needs a random value in a 0 to 1 range, just like
floats. So slightly refactor to let the integer randomization use the
float implementation and then round to an int afterwards.
2021-02-17 12:21:31 -06:00
c8b064f032 Merge remote-tracking branch 'origin/blender-v2.92-release'
Making sure the rc tag doesn't get carried over to master.
2021-02-17 19:08:29 +01:00
3bb58e2a7c Blender 2.92 bcon4 - change release cycle to release candidate
This is still a rolling release candidate with new builds every day
as a preparation to the final release.
2021-02-17 18:55:20 +01:00
8095aad47e Cycles: Fix build error on windows
Function __bsf was in util/util_simd.h twice

problem located by @EAW on chat.
2021-02-17 10:21:00 -07:00
4d28a1d75f Fix OpenColorIO 2.0 GPU shader error in uniform assignment
And fix a (harmless) compiler warning.
2021-02-17 18:03:52 +01:00
a7750f95b9 GPU Python: Rename 'uniform_buffer' to 'uniform_block'
From the the opengl wiki:
> Buffer objects are associated with a program's uniform block similarly to the way that texture objects are associated with sampler uniforms.
2021-02-17 13:23:35 -03:00
0da10b279a Cleanup: Use static struct for work scheduler. 2021-02-17 16:49:27 +01:00
3a4b7e2bc6 Cleanup: Use struct for WorkScheduler. 2021-02-17 16:49:27 +01:00
b452438d0a Cleanup: Use snake case for method names. 2021-02-17 16:49:27 +01:00
cc45dfa07f Cleanup: Remove definition in header without implementation. 2021-02-17 16:49:27 +01:00
89c79c3ed8 Cleanup: Abbreviate enums with 'UNSIGNED_' in the name 2021-02-17 12:38:21 -03:00
4430e8a008 Python: gpu module: add new submodules and types
This commit extends the gpu python API with:
```
gpu.types.Buffer         #"__init__", "to_list"
gpu.types.GPUTexture     #"__init__", "clear", "read", "format"
gpu.types.GPUFrameBuffer #"__init__", "bind", "clear", "is_bound", "viewport", ("__enter__",  "__exit__" with "GPUFrameBufferStackContext")
gpu.types.GPUUniformBuf  #"__init__", "update"
gpu.state                #"blend_set",  "blend_get",  "depth_test_set",  "depth_test_get",  "depth_mask_set",  "depth_mask_get",  "viewport_set",  "viewport_get",  "line_width_set",  "line_width_get",  "point_size_set",  "color_mask_set",  "face_culling_set", "front_facing_set",  "program_point_size_set"
```

Add these methods to existing objects:
```
gpu.types.GPUShader  #"uniform_sample", "uniform_buffer"
```

Maniphest Tasks: T80481

Differential Revision: https://developer.blender.org/D8826
2021-02-17 12:27:19 -03:00
ec8c09f2aa Cleanup: fix compiler warnings 2021-02-17 16:26:24 +01:00
351d8bfc41 Fix T85694: Cycles incorrect grayscale conversion with some OpenColorIO configs 2021-02-17 16:26:24 +01:00
0e9497e886 Cycles: add support for Arm Neon instructions using sse2neon
Based on patch contributed by Apple and Stefan Werner.

Ref D8237, T78710
2021-02-17 16:26:24 +01:00
68dd7617d7 Cycles: add utility functions for zero float2/float3/float4/transform
Ref D8237, T78710
2021-02-17 16:26:24 +01:00
8119f0aad2 Cycles: refactor intrinsic functions implementation
* Add processor independent fallbacks
* Use uint32_t and uint64_t types
* Remove unused functions
* Better comments and less indentation

Ref D8237, T78710
2021-02-17 16:26:24 +01:00
db28411fd9 BLI: use sse2neon to emulate SSE instructions with Arm Neon
* WITH_CPU_SSE was renamed to WITH_CPU_SIMD, and now covers both SSE and Neon.
* For macOS sse2neon.h is included as part of the precompiled libraries.
* For Linux it is enabled if the sse2neon.h header file is detected. However
  this library does not have official releases and is not shipped with any Linux
  distribution, so manual installation and configuration is required to get this
  working.

Ref D8237, T78710
2021-02-17 16:26:24 +01:00
859118d8f6 BLI: add BLI_simd.h header to wrap SSE includes
In preparation of adding Neon support.

Ref D8237, T78710
2021-02-17 16:26:24 +01:00
ac680c569e Merge branch 'blender-v2.92-release' 2021-02-17 08:13:42 -07:00
e3dad81164 Cleanup: Missing word in rna description
One of the sentences changed recently in rBc63df3b33f01 was missing
a word. No functional changes.
2021-02-17 08:12:51 -07:00
56f4397a3b Merge branch 'blender-v2.92-release' 2021-02-17 16:05:33 +01:00
6247b8cc77 Fix T85722: missing updates adding modifiers via python
Was reported for Geometry Nodes Editor "New" button, but was true for
any modifier added via modifiers.new().

Now just add appropriate nofifier.

Maniphest Tasks: T85722

Differential Revision: https://developer.blender.org/D10450
2021-02-17 15:57:29 +01:00
5b6a3a57fb Merge branch 'blender-v2.92-release' 2021-02-17 15:56:24 +01:00
0cbbb9edd7 Cleanup: Split COM_compositor into multiple functions. 2021-02-17 15:41:03 +01:00
53bf04f284 Geometry Nodes: Expose material index attribute
The `material_index` attribute can adjust which material in the list
will be applied to each face of the mesh. There are two new things
about this attribute that haven't been exposed by the attribute API yet.
Each comes with limitations:
 1. Integer data type: Most attribute nodes are currently written to use
    float data types. This means that they can't write to this attribute
    because they can't change the type of a built-in attribute.
 2. Polygon domain: This is our first attribute using the polygon domain,
    meaning until some of the interpolations are implemented, some
    operations may not work as expected.

Currently the two nodes that work with this attribute are Attribute Fill
and Attribute Randomize.

Differential Revision: https://developer.blender.org/D10444
2021-02-17 08:30:15 -06:00
37de612104 Cleanup: make local vars const. 2021-02-17 15:25:24 +01:00
4329a01d37 Cleanup: Bundle static globals in struct 2021-02-17 15:25:24 +01:00
52b2cb6ea3 Cleanup: Comment style 2021-02-17 15:25:24 +01:00
6afc04f2a0 Cleanup: Allocate Execution System on stack. 2021-02-17 15:25:24 +01:00
ef53859d24 Cleanup: Make ChunkOrderHotspot a struct 2021-02-17 15:25:24 +01:00
8bca03056c Cleanup: Make ChunkOrder a struct. 2021-02-17 15:25:24 +01:00
2217719feb Fix T85440: crash with displacement shaders and updating geometry in viewport
When primitive offsets change we need to rebuild or refit BVHs, however this
was also tagging other data as modified too late in the geometry update process.
Now ensure only the BVHs are updated.

Ref D10441
2021-02-17 15:22:37 +01:00
b7e1660d40 Cleanup: Use 'pygpu_' prefix in the cpython GPU module
`py_` prefix can be confused with the Python's own API's.
2021-02-17 10:38:59 -03:00
1ea6394fc8 Cleanup: Fix typo error 2021-02-17 13:40:39 +01:00
Jamell Moore
09f7c93858 Fix T80862: Small stroke opacity modulation is best done in the fragment shader
To avoid anti-aliasing artifacts on GPencil strokes that have a size smaller than 1 the thickness
is clamped and the opacity reduced. This was done in vertex shader but this had the side effect
of causing strokes that go from large to small to fade across their lengths.

**Solution**

The opacity modulation has now been moved to the fragment shader as advised by Clément Foucault.

The strokeThickness that was passed to the shader was clamped to prevent it from being too small so an additional
unclamped thickness has been passed to the fragment to calculate the opacity modulation. Alternatively I could have chosen
strokeThickness and clampedThickness but I decided against renaming the variables in the current code.


Reviewed By: fclem

Differential Revision: https://developer.blender.org/D10438
2021-02-17 13:40:38 +01:00
55a69d5707 Geometry Nodes: realize instances before deform modifier
This is a follow up commit for rB96da8e9ca302b8d879744.

Ref T85281.
2021-02-17 13:17:50 +01:00
96da8e9ca3 Geometry Nodes: realize instances before passing geometry to constructive mesh modifier
Previously, when the output of a Geometry Nodes modifier would
contain instances, those could not be accessed by other existing
modifiers (e.g. the Array modifier). That is because those modifiers
don't know about instances.

Upcoming commits will improve an this in two ways:
* Also realize instances before deform modifiers.
* Convert a point cloud in the geometry to mesh vertices so that
  they can be accessed as well.

Note, making instances real can result in loosing some information
that we do not support in Geometry Nodes yet. That includes some
special builtin attributes like bevel weights.

Ref T85281.

Differential Revision: https://developer.blender.org/D10432
2021-02-17 12:28:00 +01:00
3a6d6299d7 Cycles: support accessing custom mesh attributes
This makes custom mesh attributes available in Cycles. Typically,
these attributes are generated by Geometry Nodes, but they can also
be created with a Python script.

* The `subdivision` code path is not yet supported.
* This does not make vertex weights and some other builtin attributes
  available in Cycles, even though they are accesible in Geometry Nodes.
  All attributes generated in Geometry Nodes should be accessible though.
* In some cases memory consumption could be removed by not storing all
  attributes in floats. E.g. booleans and integer attributes for which
  all values are within a certain range, could be stored in less than
  4 bytes per element.

Differential Revision: https://developer.blender.org/D10210
2021-02-17 12:13:30 +01:00
9419452f85 Cycles: detect when attributes have changed
This patch has originally been written by Kévin Dietrich, thanks!
It is part of D10210.

As Brecht noted in D10210, this might not handle all cases yet.
I better solution should come soonish.
2021-02-17 12:06:10 +01:00
17dddc9417 Fix: NLA Blend Domain Enable All Typo
Introduced by my recent commit: rBc48360c2559a

Accidentally used 4 instead of `necs->length`.
2021-02-17 01:07:08 -05:00
2da0f3e523 Geometry Nodes: Support integer type in the Attribute Fill Node
This will be used by the material index attribute when it is added.
2021-02-17 00:01:33 -06:00
47a269745e Fix T85716: "Applied Modifier:" report hides more important message
Since "Applied Modifier" was always added last, it obscured more important
messages when using the shortcut to delete modifiers. The purpose of the
report when using the shortcut was to make it clear that something
happened. Since another report does that anyway, only display the
"Applied Modifier" report if the report list length hasn't changed.
2021-02-16 23:39:58 -06:00
Wayde Moss
c48360c255 Fix: NLA Blends Non-Animated Upper Channel Values
Issue introduced by my commit: rB40b7929cc040

**User-level Problem**:
The issue resulted in a full-replace upper strip with only a Z location
channel full-replacing the XY location channels of the lower stack.
replaced to default. The expected behavior is that only the Z location
channel is affected.

**Technical-level Problem**:
Before the problematic commit, fcurves were blended as they were read.
So only existing animated channels would blend. My recent commit
changed the process to read all fcurve values into an isolated
upper_snapshot then blend with the lower stack. There is no data stored
to know whether the upper snapshot channel values were sampled from
fcurves or were default values. Only those sampled from fcurves should
be blended.

**Solution**:
Added a `blend_domain` bitmask member to NlaEvalChannelSnapshot.
The blending function only blends values within the `blend_domain`.
Sampled fcurve values are now marked as within the `blend_domain`.
We also now always copy the lower snapshot to the result snapshot which
only matters when they aren't the same. Currently, it's always the same
so the change is more for future unseen cases.

Reviewed By: sybren, #animation_rigging

Differential Revision: https://developer.blender.org/D10339
2021-02-17 00:21:07 -05:00
585db47d99 Cleanup: Return bool instead of int 2021-02-16 23:02:33 -06:00
bfc7994d93 Cleanup: use edituv prefix for stretch area/angle data 2021-02-17 15:36:18 +11:00
2853ad775e Merge branch 'blender-v2.92-release' 2021-02-17 15:19:21 +11:00
6ce06957c9 Fix T85680: Crash displaying UV stretch/area with modifiers
This uses the same logic as drawing UV's,
where non-bmesh defaults to mesh.
2021-02-17 15:12:39 +11:00
20a6255d49 Cleanup: spelling 2021-02-17 15:04:29 +11:00
62592af843 Cleanup: pass scene as const 2021-02-17 14:50:08 +11:00
99b4c856ef Cleanup: remove commented function 2021-02-17 14:50:08 +11:00
ab484ff22f Fix T85664: 3D Viewport issues with curve poly splines
Caused by cleanup in rBcdb3cbd64401, where an index
was used to index `float *` instead of `float[3]`.
2021-02-16 21:40:16 -06:00
5c523c6578 Merge branch 'blender-v2.92-release' 2021-02-16 18:10:42 -08:00
ab21009842 Fix T84701: Popup closes on release while dragging parameter.
Windows Ghost cursor movement was previously changed to use SendInput
because SetCursorPos sporadically allows the cursor to escape the
window. This is now reverted because SendInput causes mouse history via
GetMouseMovePointsEx to contain invalid movement history, likely due to
interaction with mouse acceleration. This resulted in popups closing
when the cursor appeared to leave their range.
2021-02-16 17:45:57 -08:00
461d4fc1aa Geometry Nodes: Node error messages
This patch adds icons to the right side of nodes when they encounter a
a problem. When hovered, a tooltip displays describing the encountered
while evaluating the node.

Some examples are: attribute doesn't exist, mesh has no faces,
incorrect attribute type, etc. Exposing more messages to the system
will be an ongoing process. Multiple warnings per node are supported.

The system is implemented somewhat generically so that the basic
structure can also be used to store more information from evaluation
for the interface, like a list of available attributes.

Currently the messages are just button tooltips. They could be styled
differently in the future. Another limitation is that every instance of
a node group in a parent node tree will have the same error messages,
the "evaluation context" used to decide when to display the tooltips
must be extended to support node tree paths.

Differential Revision: https://developer.blender.org/D10290
2021-02-16 17:15:08 -06:00
c9c4802c1c Fix T85671: color management crash with Medium Contrast look 2021-02-16 23:29:06 +01:00
ba79b8013f Cleanup: Use consistent order placement for include 2021-02-16 16:17:03 -06:00
eb2e260540 Cleanup: Used derived node in geometry exec params
Since the derived node tree is already build for the evaluation system,
it's simpler to pass a derived node to the params struct. This will also
allow context lookups in nested node groups for node error messages,
since the derived node has that information readily accessible.
2021-02-16 13:06:18 -06:00
c075b8bff2 Cleanup: Remove use of designated initializers in C++ 2021-02-16 12:02:45 -06:00
520d965c77 Cleanup: Compile node_draw.c with C++
This will allow using C++ data structures to draw  node error messages.
This required removing a forward declared enum for grease pencil undo.
Compiles with clang tidy.
2021-02-16 10:55:10 -06:00
8971018eb6 UI: Add support for bl_description for panels
This commit adds support for `bl_description` and python docstrings for panels.
This is useful for pop-over panel types so they can have a label and description.

This commit also includes an example use case.

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D10429
2021-02-16 09:51:37 -05:00
e81fca1ed3 Assets: Remove appended asset when dropping operation fails
When dropping an asset somewhere, it is appended and then a drop operation is
called to actually add it to the scene based on current context. If this drop
operation fails, the appended data-block is now still in the .blend. The user
may not notice and not expect this.
Instead idea is to rollback any changes done by dropping code if the operation
fails, namely removing the appended data-block again.

Adds a new `cancel()` callback which is called if the drop operator returns
`OPERATOR_CANCELLED` to drop-boxes and a generic function to deal with assets
on drop failure.

Also removes the `free_id_on_error` property of the `NODE_OT_add_group`
operator, which was used as ad-hoc solution to get this same behavior.
2021-02-16 15:34:32 +01:00
500bc99da5 Fix T85697: implement interpolation for float custom data type
This just hasn't been implemented before.
2021-02-16 14:25:55 +01:00
82ade44299 LibOverride: Add support for rotation mode of PoseBones.
Request from the studio.
2021-02-16 14:23:22 +01:00
2442c85dc3 Merge branch 'blender-v2.92-release' 2021-02-16 13:58:03 +01:00
Pratik Borhade
c13754e647 Fixes T84928 : Lattice vertices at unexpected positions when changing lattice resolution from 1 to 3 or more.
Fix for T84928 .
Considering the changes , issue is resolved ( Ignoring readability issues) .

**Changes **:

  - `Change in value assignment of fu/v/w :`  Observing previous code , I noticed ,value assigned to them is equivalent to -0.5 ( i.e. co-ordinate of left most vertex of lattice size =1 where  centre of lattice is origin ) .

  - `Change in value assignment of du/v/w :`    Margin ( distance ) between each division of surface along any axis is equivalent to **( (length of surface along axis ) / (no of division line - 1) )** . that's why is changed it to (default_size/unew -1) .

  - ` New variable declared "default_size"  :`  As far as I gone through the code , I noticed values  1 < du ,fu < 1  , which indicates these values were calculated with respect to default lattice of size 1 .

  - `removed pntsu/v/w != 1 check :`  Following changes inside the if block worked properly for pntsu/v/w = 1 .

Reviewed By: lichtwerk, campbellbarton

Differential Revision: https://developer.blender.org/D10353
2021-02-16 13:47:12 +01:00
1ec30d4b15 Fix T85697: subdivision surface node output does not contain vertex group names
The vertex weights were actually interpolated correctly. The issue was that
vertex group names were removed from the output geometry set. We have
to keep track of these names separately from the mesh, for legacy reasons.
Vertex group names are not stored on meshes but objects instead.
2021-02-16 13:35:06 +01:00
5688f791f5 Geometry Nodes: move realize-instances code to blenkernel
I need to access this functionality from modifier code. Therefore it should
not be in the nodes module.
2021-02-16 12:30:42 +01:00
21de1f9148 Geometry Nodes: move geometry set instance handling to separate file
In an upcoming commit I'll also move the make-instances-real functionality
to this file. This code is not essential to working with geometry sets in general,
so it makes sense to move it to a separate header.
2021-02-16 12:07:10 +01:00
39f60e6909 Geometry Nodes: move some attribute utilities to blenkernel
I need to access these utilities from modifier code as well.
Therefore, they should not live in the nodes module.
2021-02-16 11:55:12 +01:00
c03650073e Cleanup: spelling 2021-02-16 21:15:45 +11:00
a059f07274 Fix add-on & app-template installation logic for overwriting modules
The logic to remove one Python module before installing another
only worked in simple cases where a file replaced a file.

- Installing a single file add-on over a Python package with the same
  name caused an error as the directory isn't empty.

- Removing existing module directories from the zip-file did nothing
  as the directories from the zip-file that end with a slash were
  compared with directories from `os.listdir` that don't.

- `module_filesystem_remove` assumed ZipFile.namelist() was a list of
  files in the root of the zip-file when it's a list of all files.

  While I couldn't find any bugs caused by this, it performed checks
  that don't make sense, comparing files at different depths of the
  file-system.
2021-02-16 20:52:09 +11:00
36814ddc94 Workbench: Improve AntiAliasing sampling
This improves stability and convergence speed of Workbench Temporal AntiAliasing.

This adds a filtering kernel (blackmann-haris, same as EEVEE/Cycles) to the
temporal antialiasing sampling. We also gather neighbor pixels since they might
end up in the pixel footprint.

We use a 1px radius for the filter window which is a bit less than the 1.5 default
of cycles and EEVEE since it does blur quite a bit more than what we have now.

Another improvement is that the filtering is now in log space which improves
AntiAliasing around highlights.

Theses improvement may not be very useful for every day case but it was an
experiment to try to make TAA usable for GPencil.

Test file used :
{F9798807}

|filtered+logspace|filtered|original|
|{F9798847}|{F9798848}|{F9798849}|

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D10414
2021-02-16 09:05:44 +01:00
dd79a715c9 Merge branch 'blender-v2.92-release'
# Conflicts:
#	intern/ghost/intern/GHOST_SystemWin32.cpp
#	intern/ghost/intern/GHOST_WindowWin32.cpp
#	intern/ghost/intern/GHOST_WindowWin32.h
2021-02-15 23:27:21 -08:00
2e81f2c01a Revert Wintab High Frequency Input.
This revert removes handling of cursor move and button press events
during Wintab's WT_PACKET event, instead storing pressure and tilt
information to be combined with Window's WM_MOUSEMOVE events.

This also reverts dynamic enabling and disabling of Wintab, dependent
on the chosen Tablet API. If the Tablet API is not explictly Windows
Ink during startup, Wintab is loaded and enabled.

Left in place is a fallback to Windows Ink when the Tablet API is set
to Automatic and no Wintab devices are present. This allows devices
with Wintab installed but not active to fallback to Windows Ink.

Using position provided by Wintab was found to have too many
regressions to include in Blender 2.93. The primary source of
regressions was tablets which mapped coordinates incorrectly on multi-
monitor and scaled displays. This resulted in an offset between what
the driver controlled Win32 cursor position and the Wintab reported
position. A special case of this included tablets set to mouse mode,
where Wintab reported absolute position while the system cursor moved
as a relative mouse with mouse acceleration.
2021-02-15 23:06:00 -08:00
63fb53ad95 Docs: add a docstring for UserDef.pythondir 2021-02-16 16:28:48 +11:00
7bb5e4a3c1 Fix reloading preferences ignoring 'script_directory'
Reloading preferences didn't update Python's `sys.path` to account
for the modified `script_directory`.

This meant the operator to load settings from a previous version
required a restart to initialize Python when this directory was set.
2021-02-16 16:00:03 +11:00
f34d5d99dc Cleanup: remove local copy of shutil.copytree from Python 3.8 2021-02-16 15:58:34 +11:00
4a784f32fe Calm Win32 Window Creation Warning
Removing warning that 'GHOST_TUns32' to 'LONG' requires a narrowing conversion.

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

Own Code
2021-02-15 17:44:49 -08:00
23de16414a UI: Clarify descriptions in properties popover
Updates the descriptions and labels for outliner sync in the properties
editor popover to be more clear.

Differential Revision: https://developer.blender.org/D10010
2021-02-15 18:25:06 -07:00
c63df3b33f UI: Clarify descriptions in properties popover
Updates the descriptions and labels for outliner sync in the properties
editor popover to be more clear.

Differential Revision: https://developer.blender.org/D10010
2021-02-15 18:07:40 -07:00
c53022768b Fix T85587: Crash on selecting multiple frames
Blender would crash when selecting multiple keyframes while multiframe edit was
active. This was due to the active frame being NULL in some instances.

The fix checks if the active frame is not NULL.

Reviewed By: antoniov

Maniphest Tasks: T85587

Differential Revision: https://developer.blender.org/D10421
2021-02-15 20:30:13 +01:00
ae370e292a macOS: add Embree, OpenImageDenoise and sse2neon libraries for ARM
This required using a fork of Embree, newer LLVM version, unreleased ISPC
version and sse2neon directly from Git. Hopefully over time all the required
changes end up in official releases. For now we deviate from other platforms.

Based on contributions by Apple and Stefan Werner.

Ref D9527, D8237, T78710
2021-02-15 20:22:34 +01:00
4ce57f6eb8 macOS: fix Cycles not detecting 64 bit and failing to build with Embree
Contributed by Apple

Ref D9527, T78710
2021-02-15 20:22:34 +01:00
7baf796886 macOS Deps: NumPy: Remove buggy Accelerate framework
Building NumPy from source with default options of builder
causes it to link against Accelerate framework which is buggy and
raises a warning mentioned in [2].
"RankWarning: Polyfit may be poorly conditioned"
Accelerate is deprecated with NumPy 1.20+.[1]

So either we build OpenBLAS in dependencies also and set appropriate
env variables suggested in [1] while building NumPy for it to find
OpenBLAS. Or download NumPy wheel from pip and never allow pip to
build NumPy from source while installing.

After this change, pip wheels are used for NumPy for macOS with x86_64.

[1] https://numpy.org/doc/stable/user/building.html#lapack
[2] https://github.com/numpy/numpy/issues/15947
Reviewed By: #platform_macos, sebbas
Differential Revision: https://developer.blender.org/D10368
2021-02-16 00:47:50 +05:30
35145db056 Merge branch 'blender-v2.92-release' 2021-02-15 20:11:42 +01:00
3e55d7d605 Fix T85499: Crash on switching to edit mode with uv editor open
A fix for T83187 (rBf83aa830) assumed in the overlay code of the uv editor that the object was a mesh
when it did not have to be - causing a crash.

The fix makes sure that the object is a mesh.

Reviewed By: jbakker, campbellbarton

Maniphest Tasks: T85499, T85495

Differential Revision: https://developer.blender.org/D10369
2021-02-15 20:10:46 +01:00
604e61d81d UI/Nodes: Adding node groups via drag & drop (e.g. from Asset Browser)
Adds `NODE_OT_add_group` operator to add a node group from a given name, and
uses that to register a node editor drop-box.
When dropping a node-group asset, the ID will be appended. This is what we do
for other ID assets too.

Should the node group insertion fail (e.g. the group is not compatible with the
current tree, as checked by the poll), the appended data-block is removed.

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

Reviewed by: Jacques Lucke
2021-02-15 19:39:46 +01:00
45852532d5 Merge branch 'blender-v2.92-release' 2021-02-15 19:33:16 +01:00
9cccbbebaa Fix T84624: node group data-block has phantom user
This is because the node editor added a "real user" to the node group
that it displays. It was mainly added as a hack to solve issues with custom
tree types (T36024). Since we can store id references in custom properties
now, this "real user" is not really necessary anymore.

Given that we are close to a release, I'll only disable line for geometry nodes,
for which the bug has been reported.

Discussed this solution with Hans Goudey.
2021-02-15 19:29:09 +01:00
cab8a76abf Fix: wrong clang tidy cleanup
This reverts a part of rBd3960164163c910d5031a8f076c41b39e0a5503d.
It is not a `std::shared_ptr` but a `boost::shared_ptr`.
This could probably be fixed differently, but `NOLINT` is fine now.
2021-02-15 19:03:32 +01:00
e2ab535e6f install_deps: Bump OpenEXR to 2.5.5 version. 2021-02-15 17:44:03 +01:00
0df76ecbf3 Cleanup: Remove code duplication (merge error) 2021-02-15 15:44:52 +01:00
d396016416 Cleanup: clang tidy 2021-02-15 15:30:17 +01:00
b55e7e4895 Cleanup: Spelling in function name 2021-02-15 14:25:21 +01:00
Peter Fog
d8754de7c3 FFmpeg: Improve multi-threading settings for VSE proxies
Following code from D8627 this patch corrects multi threaded processing
of proxies, where a 60 sec proxy generation drops to 35 sec.

Differential Revision: https://developer.blender.org/D8659
2021-02-15 12:29:14 +01:00
5b2bfb2fed FFmpeg: Improve multi-threading settings
Allow use all system threads for frame encoding/decoding. This is very
straightforward: the value of zero basically disables threading.

Change threading policy to slice when decoding frames. The reason for
this is because decoding happens frame-by-frame, so inter-frame threading
policy will not bring any speedup.

The change for threading policy to slice is less obvious and is based on
benchmark of the demo files from T78986. This gives best performance so
far.

Rendering the following file went down from 190sec down to 160sec.

  https://storage.googleapis.com/institute-storage/vse_simplified_example.zip

This change makes both reading and writing faster. The animation render
is just easiest to get actual time metrics.

Differential Revision: https://developer.blender.org/D8627
2021-02-15 12:29:14 +01:00
a923a34de1 CMake/Deps: upgrade USD 20.05 → 21.02
USD version 21.02 includes two of the changes Blender used to patch in,
which have now been removed from `usd.diff`. Unfortunately 21.02
introduces another issue where LZ4 symbols are accidentally exported,
causing linker errors. Fortunately these symbols are only used for
resting, so I added a patch hunk that simply removes their `extern "C"`
declaration.

The LZ4 linker issue has been reported upstream at
https://github.com/PixarAnimationStudios/USD/issues/1447.

Reviewed By: sebbas, mont29

Differential Revision: https://developer.blender.org/D10367
2021-02-15 12:17:08 +01:00
ebdf68a0bb CMake/Deps: OpenImageDenoise 1.2.3 → 1.3.0 2021-02-15 12:17:08 +01:00
Ray molenkamp
da0c5e7224 CMake/Deps: XR_OpenXR v1.0.14
Straight up version bump

Things of note:

They started using API calls only available in windows 8, however given
the Python 3.9 update will forcibly bump us to 8.1+ anyhow this is not
an issue.

Will require some minor tweaks to platform_win32.cmake after adding the
libs to svn which are not included in this diff so this diff can land
without having to have the libs in place yet.

Reviewed By: sebbas, sybren

Differential Revision: https://developer.blender.org/D10349
2021-02-15 12:17:08 +01:00
Ray molenkamp
0a3b076961 CMake/Deps: OpenVDB 8.0.1
Straight forward version bump, some of the variables to detect a static
OpenEXR changed and the folder structure seemingly changed a little
requiring updates to the diff

Reviewed By: sebbas, sybren

Differential Revision: https://developer.blender.org/D10340
2021-02-15 12:17:08 +01:00
649f99b6bc CMake/Deps: Alembic 1.7.16
Version bump + no longer using Boost.

Building Alembic with Boost gave compiler errors, and having one less
inter-dependency is good as well.

Reviewed By: sebbas, sybren

Differential Revision: https://developer.blender.org/D10329
2021-02-15 12:17:08 +01:00
Ray molenkamp
227fa68696 CMake/Deps: TBB 2020U2
Straight forward version bump.

2020U2 is significantly louder in the deprecated header usage warning
department, we should probably see if we need to act on this: P1949

Differential Revision: https://developer.blender.org/D10359
2021-02-15 12:17:08 +01:00
Ray molenkamp
3ba20aa866 CMake/Deps: Boost 1.73
Just a simple version bump.

Maniphest Tasks: T85365

Differential Revision: https://developer.blender.org/D10314
2021-02-15 12:17:08 +01:00
d6b2c18481 Attributes: return refined Attribute from attributes.new method
Previously `mesh.attributes.new(...)` would return a generic attribute that
one could not do much with. Now it returns refined attributes like `FloatAttribute`.
2021-02-15 12:06:40 +01:00
c233f081d6 Merge branch 'blender-v2.92-release' 2021-02-15 11:22:12 +01:00
0ed0b1164a Cleanup: Use enum class for CryptomatteLayerState. 2021-02-15 11:09:17 +01:00
853c4e74ee Cleanup: Grammar in comments 2021-02-15 11:07:11 +01:00
ef02e1be5d Fix: incorrect versioning for Attribute Randomize node 2021-02-15 10:36:35 +01:00
32060ca1f1 Cleanup: unused variable 2021-02-15 10:31:41 +01:00
7c864388fc Fix T71960: Malformed .bmp files lead to crash
Add a boundary check, avoiding access past actual data.

Ideally would need to report error to the user somehow,
but it doesn't seem to be easy to do.

This is a minimal safe patch. The proper complete fix is
being worked on by Jesse.

Differential Revision: https://developer.blender.org/D10357
2021-02-15 10:30:43 +01:00
7a608f88a7 Fix T85633: Misspelling of "neighborhood" in description 2021-02-14 15:31:01 -06:00
80a8df72be Merge branch 'blender-v2.92-release' 2021-02-14 20:52:23 +01:00
2d3b29de4f Fix T85488: Display units inset operator
The inset operator would display the inset thickness and depth as
Blender units during transform. This meant that when the scene units
were set to something different than meters, the display value would
give different results than entering the same number using the value
input. (Similar to D10325)

The fix makes sure that the numbers are always displayed in the correct
scene units.

Reviewed By: campbellbarton

Maniphest Tasks: T85488

Differential Revision: https://developer.blender.org/D10366
2021-02-14 20:51:10 +01:00
Lukas Stockner
2f6d62bf88 Cycles: Implement Dwivedi guiding for path-traced subsurface scattering
Cycles has supported path-traced subsurface scattering for a while, but while it's
more accurate than other approaches, the increase in noise makes it an expensive option.

To improve this, this patch implements Dwivedi guiding, a technique that is based on
zero-variance random walk theory from particle physics and helps to produce shorter
random walks with more consistent throughput.

The idea behind this is that in non-white materials, each scattering event inside the
medium reduces the path throughput. Therefore, the darker the material is, the lower the
contribution of paths that travel far from the origin is.
In order to reduce variance, Dwivedi guiding uses modified direction and distance sampling
functions that favor paths which go back towards the medium interface.
By carefully selecting these sampling distributions, variance can be greatly reduced, and
as a neat side effect shorter paths are produced, which speeds up the process.

One limitation of just blindly applying this is that the guiding is derived from the
assumption of a medium that covers an infinite half-space. Therefore, at corners or thin
geometry where this does not hold, the algorithm might lead to fireflies.
To avoid this, the implementation here uses MIS to combine the classic and guided sampling.
Since each of those works on one of the three color channels, the final estimator combines
six sampling techniques. This results in some unintuitive math, but I tried to structure
it in a way that makes some sense.

Another improvement is that in areas where the other side of the mesh is close (e.g. ears),
the algorithm has a chance to switch to guiding towards the other side. This chance is based
on how deep the random walk is inside the object, and once again MIS is applied to the
decision, giving a total of nine techniques.

Combining all this, the noise of path-traced subsurface scattering is reduced significantly.
In my testing with the Rain character model and a simple lighting setup, the path-traced
SSS is now actually less noisy than the Christensen-Burley approximation at same render time
while of course still being significantly more realistic.

Differential Revision: https://developer.blender.org/D9932
2021-02-14 17:07:19 +01:00
67c8d97db3 Cleanup: spelling 2021-02-14 20:58:04 +11:00
07c6a57507 cmake/deps: Update mesa to 20.3.4
This resolves build error with Py3.9x, use meson build system
since autoconf/automake are no longer supported.

This adds ninja & meson as dependencies for Linux.

Reviewed By: brecht, sybren

Ref D10282
2021-02-14 19:56:55 +11:00
0bc281a6dd Cleanup: Simplify geometry nodes attribute API usage
Getting an "ouput" attribute is equivalent to creating an attribute and
then getting a write attribute. Replace the latter with the former for
consistency with other code, and to decrease the used surface area
of the attribute API to hopefully facilitate future cleanup.
2021-02-13 21:27:39 -06:00
237175e747 Cleanup: use doxy sections 2021-02-14 12:18:42 +11:00
2ff2900f7f Cleanup: use return argument prefix 2021-02-14 11:44:47 +11:00
fa093ef2ff Cleanup: correct/update comments 2021-02-14 11:44:37 +11:00
c2b73dfe91 Cleanup: unused function 2021-02-14 11:27:33 +11:00
90c2307826 Cleanup: remove commented logic for Alt-Pad0 to use previous camera
While this could be useful, it's been removed since 2.4x, keeping this
here doesn't help add it back since it would need to be re-implemented.
2021-02-14 11:20:29 +11:00
3c1e70dedf Cleanup: spelling 2021-02-14 11:19:06 +11:00
luzpaz
f362dad19b Cleanup: Source Code Typos
Corrects approximately 36 spelling errors in source variable names.

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

Reviewed by Hans Goudey
2021-02-13 15:23:49 -08:00
9e81e1c33f EEVEE: Fix glass with sharp distribution not ignoring roughness 2021-02-13 19:08:16 +01:00
aaf1650b09 EEVEE: Change cubemap roughness fit
This changes the roughness mapping to better utilize the mip chain resolution.
This improves glossy reflections with small roughness.

Lightcache version bumped because old data does not have the same roughness
mapping and cannot be used.
2021-02-13 18:55:52 +01:00
e7f61685ed EEVEE: Update Offline LUT
This follows a change in the LUT generation code.
2021-02-13 18:53:51 +01:00
83ac8628c4 EEVEE: Update LUT GGX generation shader
This modifies the principled BSDF and the Glass BSDF which now
have better fit to multiscatter GGX.

Code to generate the LUT have been updated and can run at runtime.

The refraction LUT has been changed to have the critical angle always
centered around one pixel so that interpolation can be mitigated.

Offline LUT data will be updated in another commit

This simplify the BTDF retreival removing the manual clean cut at
low roughness. This maximize the precision of the LUT by scalling
the sides by the critical angle.
I also touched the ior > 1.0 approximation to be smoother.

Also incluse some cleanup of bsdf_sampling.glsl
2021-02-13 18:52:19 +01:00
06492fd619 EEVEE: Fix incorrect fresnel function.
The optimized version was not correct. Also it is not showing any benefit
over the non optimized version.
2021-02-13 18:49:42 +01:00
7f7e683099 EEVEE: Refactor closure_lit_lib.glsl
This refactor was needed for some reasons:
- closure_lit_lib.glsl was unreadable and could not be easily extended to use new features.
- It was generating ~5K LOC for any shader. Slowing down compilation.
- Some calculations were incorrect and BSDF/Closure code had lots of workaround/hacks.

What this refactor does:
- Add some macros to define the light object loops / eval.
- Clear separation between each closures which now have separate files. Each closure implements the eval functions.
- Make principled BSDF a bit more correct in some cases (specular coloring, mix between glass and opaque).
- The BSDF term are applied outside of the eval function and on the whole lighting (was separated for lights before).
- Make light iteration last to avoid carrying more data than needed.
- Makes sure that all inputs are within correct ranges before evaluating the closures (use `safe_normalize` on normals).
- Making each BSDF isolated means that we might carry duplicated data (normals for instance) but this should be optimized by compilers.
- Makes Translucent BSDF its own closure type to avoid having to disable raytraced shadows using hacks.
- Separate transmission roughness is now working on Principled BSDF.
- Makes principled shader variations using constants. Removing a lot of duplicated code. This needed `const` keyword detection in `gpu_material_library.c`.
- SSR/SSS masking and data loading is a bit more consistent and defined outside of closure eval. The loading functions will act as accumulator if the lighting is not to be separated.
- SSR pass now do a full deferred lighting evaluation, including lights, in order to avoid interference with the closure eval code. However, it seems that the cost of having a global SSR toggle uniform is making the surface shader more expensive (which is already the case, by the way).
- Principle fully black specular tint now returns black instead of white.
- This fixed some artifact issue on my AMD computer on normal surfaces (which might have been some uninitialized variables).
- This touched the Ambient Occlusion because it needs to be evaluated for each closure. But to avoid the cost of this, we use another approach to just pass the result of the occlusion on interpolated normals and modify it using the bent normal for each Closure. This tends to reduce shadowing. I'm still looking into improving this but this is out of the scope of this patch.
- Performance might be a bit worse with this patch since it is more oriented towards code modularity. But not by a lot.

Render tests needs to be updated after this.

Reviewed By: jbakker
Differential Revision: https://developer.blender.org/D10390

# Conflicts:
#	source/blender/draw/engines/eevee/eevee_shaders.c
#	source/blender/draw/engines/eevee/shaders/common_utiltex_lib.glsl
#	source/blender/draw/intern/shaders/common_math_lib.glsl
2021-02-13 18:43:09 +01:00
40aadd8940 Build: fix macOS minimum version link warning with pystring
Patch OpenColorIO again to pass along build flags, and remove outdated
patches which were no longer being used.
2021-02-13 15:37:48 +01:00
ec882b8033 Fix geometry nodes build error with TBB enabled and OpenVDB disabled
Don't rely on TBB includes coming along with OpenVDB.
2021-02-13 15:35:33 +01:00
dae445d94a Fix T85573: Building with Python 3.10a5 fails
Replace deprecated _PyUnicode_AsString{AndSize} usage.

T83626 still needs to be resolved before 3.10 is usable.
2021-02-13 23:09:55 +11:00
32660201ac Fixes T84651: Weight paint gradient doesn't auto-normalize weights
Auto-normalize when the option is enabled.

Ref D10239 by @PratikPB2123 with minor edits.
2021-02-13 21:17:35 +11:00
376eedae16 Merge branch 'blender-v2.92-release' 2021-02-13 08:39:39 +01:00
a9092768c0 GPencil: Try again to fix compiler warnings
The windows compiler is not as sensible to this warnings as Linux.
2021-02-13 08:38:38 +01:00
fea335fe8b Cleanup: spelling 2021-02-13 17:44:51 +11:00
474947c465 Cleanup: clang-format 2021-02-13 17:40:10 +11:00
69e9e45744 Cleanup: macro hygiene, use parenthesis around operators 2021-02-13 17:40:10 +11:00
2da649cc50 Cleanup: use doxy sections 2021-02-13 17:40:03 +11:00
0b80201c94 Merge branch 'blender-v2.92-release' 2021-02-13 16:29:37 +11:00
e72ad982ea Merge branch 'blender-v2.92-release' 2021-02-13 16:29:34 +11:00
17a37ed938 Fix brace placement from recent fix for T85581
ccea44e76b missed this expression.
2021-02-13 16:27:04 +11:00
17daf917ee Cleanup: Remove unused outliner enum values
Removes values from various Outliner context menu enums that were unused.
Many of these had been commented out for years. Also deletes some
unused code related to the removed enums. No functional changes.
2021-02-12 18:31:49 -07:00
327e8fb913 RNA Manual Reference: Update mappings 2021-02-12 19:33:32 -05:00
Stephan Seitz
1065b413ed Cleanup: Fix clang compile warning
Use a reference instead of copying the string.

Differential Revision: https://developer.blender.org/D10411
2021-02-12 16:08:01 -06:00
cdb3cbd644 Cleanup: Simplify three functions in displist.c
A few related improvements to the three functions:
 - Reduce variable scope
 - Use for loops instead of while loops
 - Use const, bool instead of int
 - Generally make logic easier to read
2021-02-12 16:06:17 -06:00
85f6674241 Tests: Add additional object to convert curve to mesh file 2021-02-12 16:02:04 -06:00
000a340afa EEVEE: Depth of field: New implementation
This is a complete refactor over the old system. The goal was to increase quality
first and then have something more flexible and optimised.

|{F9603145} | {F9603142}|{F9603147}|

This fixes issues we had with the old system which were:
- Too much overdraw (low performance).
- Not enough precision in render targets (hugly color banding/drifting).
- Poor resolution near in-focus regions.
- Wrong support of orthographic views.
- Missing alpha support in viewport.
- Missing bokeh shape inversion on foreground field.
- Issues on some GPUs. (see T72489) (But I'm sure this one will have other issues as well heh...)
- Fix T81092

I chose Unreal's Diaphragm DOF as a reference / goal implementation.
It is well described in the presentation "A Life of a Bokeh" by Guillaume Abadie.
You can check about it here https://epicgames.ent.box.com/s/s86j70iamxvsuu6j35pilypficznec04

Along side the main implementation we provide a way to increase the quality by jittering the
camera position for each sample (the ones specified under the Sampling tab).

The jittering is dividing the actual post processing dof radius so that it fills the undersampling.
The user can still add more overblur to have a noiseless image, but reducing bokeh shape sharpness.

Effect of overblur (left without, right with):
| {F9603122} | {F9603123}|

The actual implementation differs a bit:
- Foreground gather implementation uses the same "ring binning" accumulator as background
  but uses a custom occlusion method. This gives the problem of inflating the foreground elements
  when they are over background or in-focus regions.
  This is was a hard decision but this was preferable to the other method that was giving poor
  opacity masks for foreground and had other more noticeable issues. Do note it is possible
  to improve this part in the future if a better alternative is found.
- Use occlusion texture for foreground. Presentation says it wasn't really needed for them.
- The TAA stabilisation pass is replace by a simple neighborhood clamping at the reduce copy
  stage for simplicity.
- We don't do a brute-force in-focus separate gather pass. Instead we just do the brute force
  pass during resolve. Using the separate pass could be a future optimization if needed but
  might give less precise results.
- We don't use compute shaders at all so shader branching might not be optimal. But performance
  is still way better than our previous implementation.
- We mainly rely on density change to fix all undersampling issues even for foreground (which
  is something the reference implementation is not doing strangely).

Remaining issues (not considered blocking for me):
- Slight defocus stability: Due to slight defocus bruteforce gather using the bare scene color,
  highlights are dilated and make convergence quite slow or imposible when using jittered DOF
  (or gives )
- ~~Slight defocus inflating: There seems to be a 1px inflation discontinuity of the slight focus
  convolution compared to the half resolution. This is not really noticeable if using jittered
  camera.~~ Fixed
- Foreground occlusion approximation is a bit glitchy and gives incorrect result if the
  a defocus foreground element overlaps a farther foreground element. Note that this is easily
  mitigated using the jittered camera position.
|{F9603114}|{F9603115}|{F9603116}|
- Foreground is inflating,  not revealing background. However this avoids some other bugs too
  as discussed previously. Also mitigated with jittered camera position.
|{F9603130}|{F9603129}|
- Sensor vertical fit is still broken (does not match cycles).
- Scattred bokeh shapes can be a bit strange at polygon vertices. This is due to the distance field
  stored in the Bokeh LUT which is not rounded at the edges. This is barely noticeable if the
  shape does not rotate.
- ~~Sampling pattern of the jittered camera position is suboptimal. Could try something like hammersley
  or poisson disc distribution.~~Used hexaweb sampling pattern which is not random but has better
stability and overall coverage.
- Very large bokeh (> 300 px) can exhibit undersampling artifact in gather pass and quite a bit of
  bleeding. But at this size it is preferable to use jittered camera position.

Codewise the changes are pretty much self contained and each pass are well documented.
However the whole pipeline is quite complex to understand from bird's-eye view.

Notes:
- There is the possibility of using arbitrary bokeh texture with this implementation.
  However implementation is a bit involved.
- Gathering max sample count is hardcoded to avoid to deal with shader variations. The actual
  max sample count is already quite high but samples are not evenly distributed due to the
  ring binning method.
- While this implementation does not need 32bit/channel textures to render correctly it does use
  many other textures so actual VRAM usage is higher than previous method for viewport but less
  for render. Textures are reused to avoid many allocations.
- Bokeh LUT computation is fast and done for each redraw because it can be animated. Also the
  texture can be shared with other viewport with different camera settings.
2021-02-12 22:35:52 +01:00
dd2ff266ac Cleanup: Decrease scope of RNA enum definitions
Since these enums are only used in a single function, they can be
defined where they are used. Similar to rB2f60e5d1b56dfb8c9104.
2021-02-12 13:40:08 -06:00
d4fd06d6ce Geometry Nodes: Add operation setting to attribute randomize node
This commit adds a drop-down to the attribute randomize node to support
a few operations on the values of existing attributes: "Replace/Create"
(the existing behavior), "Add", "Subtract", and "Multiply".
At this point, the operations are limited by what is simple to implement.
More could be added in the future, but there isn't a strong use case
for more complex operations anyway, and a second math node can be used.

Differential Revision: https://developer.blender.org/D10269
2021-02-12 13:25:45 -06:00
d7c2c889a6 Geometry Nodes: Allow attribute nodes to use different domains
Currently every attribute node assumes that the attribute exists on the
"points" domain, so it generally isn't possible to work with attributes
on other domains like edges, polygons, and corners.

This commit adds a heuristic to each attribute node to determine the
correct domain for the result attribute. In general, it works like this:
 - If the output attribute already exists, use that domain.
 - Otherwise, use the highest priority domain of the input attributes.
 - If none of the inputs are attributes, use the default domain (points).

For the implementation I abstracted the check a bit, but in each
node has a slightly different situation, so we end up with slightly
different `get_result_domain` functions in each node. I think this makes
sense, it keeps the code flexible and more easily understandable.

Note that we might eventually want to expose a domain drop-down to some
of the nodes. But that will be a separate discussion; this commit focuses
on making a more useful choice automatically.

Differential Revision: https://developer.blender.org/D10389
2021-02-12 12:46:17 -06:00
ba03f7f0b1 Fix T85562: Remove Win32 RIM_INPUTSINK
Removal of Win32 code that allows background windows to receive raw input.

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

Reviewed by Brecht Van Lommel
2021-02-12 10:40:20 -08:00
97072e0135 Py Doc: Fix rst syntax errors 2021-02-12 13:14:43 -05:00
95cba37190 Py Doc: Delete old deployment scripts
Now, the API docs are deployed via the new devops pipeline developed by 
James.
2021-02-12 13:14:43 -05:00
432b758ae3 Py Doc: Update Sphinx and theme versions 2021-02-12 13:14:43 -05:00
1b4961b318 OpenColorIO: upgrade to version 2.0.0
Ref T84819

Build System
============

This is an API breaking new version, and the updated code only builds with
OpenColorIO 2.0 and later. Adding backwards compatibility was too complicated.

* Tinyxml was replaced with Expat, adding a new dependency.
* Yaml-cpp is now built as a dependency on Unix, as was already done on Windows.
* Removed currently unused LCMS code.
* Pystring remains built as part of OCIO itself, since it has no good build system.
* Linux and macOS check for the OpenColorIO verison, and disable it if too old.

Ref D10270

Processors and Transforms
=========================

CPU processors now need to be created to do CPU processing. These are cached
internally, but the cache lookup is not fast enough to execute per pixel or
texture sample, so for performance these are now also exposed in the C API.

The C API for transforms will no longer be needed afer all changes, so remove
it to simplify the API and fallback implementation.

Ref D10271

Display Transforms
==================

Needs a bit more manual work constructing the transform. LegacyViewingPipeline
could also have been used, but isn't really any simpler and since it's legacy
we better not rely on it.

We moved more logic into the opencolorio module, to simplify the API. There is
no need to wrap a dozen functions just to be able to do this in C rather than C++.
It's also tightly coupled to the GPU shader logic, and so should be in the same
module.

Ref D10271

GPU Display Shader
==================

To avoid baking exposure and gamma into the GLSL shader and requiring slow
recompiles when tweaking, we manually apply them in the shader. This leads
to some logic duplicaton between the CPU and GPU display processor, but it
seems unavoidable.

Caching was also changed. Previously this was done both on the imbuf and
opencolorio module levels. Now it's all done in the opencolorio module by
simply matching color space names. We no longer use cacheIDs from OpenColorIO
since computing them is expensive, and they are unlikely to match now that
more is baked into the shader code.

Shaders can now use multiple 2D textures, 3D textures and uniforms, rather
than a single 3D texture. So allocating and binding those adds some code.

Color space conversions for blending with overlays is now hardcoded in the
shader. This was using harcoded numbers anyway, if this every becomes a
general OpenColorIO transform it can be changed, but for now there is no
point to add code complexity.

Ref D10273

CIE XYZ
=======

We need standard CIE XYZ values for rendering effects like blackbody emission.
The relation to the scene linear role is based on OpenColorIO configuration.

In OpenColorIO 2.0 configs roles can no longer have the same name as color
spaces, which means our XYZ role and colorspace in the configuration give an
error.

Instead use the new standard aces_interchange role, which relates scene linear
to a known scene referred color space. Compatibility with the old XYZ role is
preserved, if the configuration file has no conflicting names.

Also includes a non-functional change to the configuraton file to use an
XYZ-to-ACES matrix instead of REC709-to-ACES, makes debugging a little easier
since the matrix is the same one we have in the code now and that is also
found easily in the ACES specs.

Ref D10274
2021-02-12 19:06:35 +01:00
6b40ee608c OpenColorIO: remove default display workaround
A fix for this is in 2.0 (and recent 1.1.x versions), no need for this anymore.

Differential Revision: https://developer.blender.org/D10275
2021-02-12 19:06:35 +01:00
5393054a5d Geometry Nodes: Add dependency relation for collection objects
Currently moving or changing an object references in a node modifier's
node group does not trigger re-evaluation. Because there is no collection
relation in the dependency graph, we must add the relation to all objects
in the collection individually.
2021-02-12 12:03:38 -06:00
a4baedea91 Geometry Nodes: Make instances real on-demand
This commit makes the geometry output of the collection info usable.
The output is the geometry of a collection instance, but this commit
adds a utility to convert the instances to real geometry, used in the
background whenever it is needed, like copy on write.

The recursive nature of the "realize instances" code is essential,
because collection instances in the `InstancesComponent`, might have no
geometry sets of their own containing even more collection instances,
which might then contain object instances, etc.

Another consideration is that currently, every single instance contains
a reference to its data. This is inefficient since most of the time
there are many locations and only a few sets of unique data. So this
commit adds a `GeometryInstanceGroup` to support this future optimization.
The API for instances returns a vector of `GeometryInstanceGroup`.
This may be less efficient when there are many instances, but it makes
more complicated operations like point distribution that need to iterate
over input geometry multiple times much simpler.

Any code that needs to change data, like most of the attribute nodes,
can simply call `geometry_set_realize_instances(geometry_set)`,
which will move any geometry in the `InstancesComponent` to new "real"
geometry components.

Many nodes can support read-only access to instances in order to avoid
making them real, this will be addressed where needed in the near future.

Instances from the existing "dupli" system are not supported yet.

Differential Revision: https://developer.blender.org/D10327
2021-02-12 11:58:15 -06:00
ff3df2ea56 Merge branch 'blender-v2.92-release' 2021-02-12 17:50:44 +01:00
98db4cc639 Fix T84899: instance ids are not unique in common cases
Ids stored in the `id` attribute cannot be assumed to be unique. While they
might be unique in some cases, this is not something that can be guaranteed
in general. For some use cases (e.g. generating "stable randomness" on points)
uniqueness is not important. To support features like motion blur, unique ids
are important though.

This patch implements a simple algorithm that turns non-unique ids into
unique ones. It might fail to do so under very unlikely circumstances, in
which it returns non-unique ids instead of possibly going into an endless
loop.

Here are some requirements I set for the algorithm:
* Ids that are unique already, must not be changed.
* The same input should generate the same output.
* Handle cases when all ids are different and when all ids are the same
  equally well (in expected linear time).
* Small changes in the input id array should ideally only have a small
  impact on the output id array.

The reported bug happened because cycles found multiple objects with
the same id and thought that it was a single object that moved on every
check.

Differential Revision: https://developer.blender.org/D10402
2021-02-12 17:44:27 +01:00
c04bcc87fe Merge branch 'blender-v2.92-release' 2021-02-12 16:54:50 +01:00
ccea44e76b GPencil: Fix compiler warnings after previous commit
These warnings were not detected by Windows compiler as the Linux compiler does.
2021-02-12 16:54:22 +01:00
5b073a9590 Merge branch 'blender-v2.92-release' 2021-02-12 15:24:20 +01:00
72989f9d0b Fix T85581: GPencil draw on surface does not work
The problem was the stroke was reproject flat to view if the axis was View. Now, if the operation is using depth, the stroke is not reprojected.

Related to T85082
2021-02-12 15:23:47 +01:00
dad32cbd17 Merge branch 'blender-v2.92-release' 2021-02-12 15:22:21 +01:00
9febda912b Baking: support vertex color baking of normal material, UV discontinuities
Baking vertex colors per-corner leads to unwanted discontinuities when there is
sampling noise, for example in ambient occlusion or with a bevel shader node for
normals. For this reason the code used to always average results per-vertex.

However when using split normals, multiple materials or UV islands, we do want to
preserve discontinuities. So now bake per corner, but make sure the sampling seed
is shared for vertices.

Fix T85550: vertex color baking crash with split normals, Ref D10399
Fix T84663: vertex color baking blending at UV seams
2021-02-12 15:01:29 +01:00
7db00556fa CMake/Deps: fix build of nasm when asciidoc and xmlto are unavailable
Create zero-byte manual page files `nasm.1` and `ndisasm.1` such that
nasm's `make install` step succeeds.

Installing nasm requires that its manual pages are built. This requires
local packages `asciidoc` and `xmlto` to be installed.

Not only does `asciidoc` pull in 110 MB of packages (itself +
dependencies), there is also no need for these manual pages. Nasm is
just used for building other dependencies, and not even part of our
precompiled libraries in SVN.

Reviewed By: sebbas

Differential Revision: https://developer.blender.org/D10396
2021-02-12 14:54:08 +01:00
780cabb7a8 Fix T85558: crash changing the resolution mode of the "volume to mesh" node
The nodes update function geo_node_volume_to_mesh_update would not run
if it is not the very first node in the tree.
If the update function is not run, there are sockets not cleared from
the SOCK_UNAVAIL flag (but this needs to be done -- these get available
depending on the chosen mode).

Havent tracked down why this was actually updating when it was the first
node in the tree, but now make sure we always get an update by specifing
an appropriate RNA update callback for the property.

Maniphest Tasks: T85558

Differential Revision: https://developer.blender.org/D10403
2021-02-12 13:59:53 +01:00
fd8ac0b0f4 Merge branch 'blender-v2.92-release' 2021-02-12 12:34:41 +01:00
9fa6e06287 Geometry Nodes: remove incorrect assert
It is perfectly valid that an attribute does not exist and cannot be created.
For example, this can happen when a mesh does not contain any vertices.
2021-02-12 12:33:04 +01:00
ed667e344d Merge branch 'blender-v2.92-release' 2021-02-12 11:55:42 +01:00
26481eabe1 Cycles: Use Blender Settings For AOV
This patch will share the AOV settings between Cycles and Eevee.
It enable using the AOV name conflict detection of Blender. This
means that unlike how Cycles used to work it isn't possible to add an
AOV with a similar name. Conflicts with internal render pass names will
be indicated with an Warning icon.

Reviewed By: Brecht van Lommel

Differential Revision: https://developer.blender.org/D9774
2021-02-12 11:35:05 +01:00
9a7dc41dd9 Fix T85545: changing position attribute does not tag normals dirty
This makes it so that normals are tagged dirty whenever the position
attribute is requested for writing. This seems like a good default. If the
calling code is aware of normals, it could untag normals when they are
not changed by the operation.

Differential Revision: https://developer.blender.org/D10397
2021-02-12 11:31:15 +01:00
837b5743ce Fix T79999: Double color management applied during viewport animation render
In 2.81 there was a change to increase the performance of viewport
animation rendering. This change would perform the color management on the
GPU if the only 8bit was needed. This saved CPU cycles and data
transfer.

The issue is that in the image editor or when saving the image the CM
will be reapplied. Although the speed is desired, exporting the actual
colors has more priority.

In the ticket there is an analysis that shows that shows that this fix
is the correct short term step to take. It would be better that the
render result is aware of the color space of its buffers so the applying
color management could be skipped when saving to disk or drawing in the
image editor.

The issue with this change is the performance penalty it has.

Reviewed By: Brecht van Lommel

Maniphest Tasks: T79999

Differential Revision: https://developer.blender.org/D10371
2021-02-12 08:23:03 +01:00
33145dd187 Fix T79999: Double color management applied during viewport animation render
In 2.81 there was a change to increase the performance of viewport
animation rendering. This change would perform the color management on the
GPU if the only 8bit was needed. This saved CPU cycles and data
transfer.

The issue is that in the image editor or when saving the image the CM
will be reapplied. Although the speed is desired, exporting the actual
colors has more priority.

In the ticket there is an analysis that shows that shows that this fix
is the correct short term step to take. It would be better that the
render result is aware of the color space of its buffers so the applying
color management could be skipped when saving to disk or drawing in the
image editor.

The issue with this change is the performance penalty it has.

Reviewed By: Brecht van Lommel

Maniphest Tasks: T79999

Differential Revision: https://developer.blender.org/D10371
2021-02-12 07:53:50 +01:00
c10ad8e9ea UI: expose the 3D views active object, even when hidden
The previous behavior meant that changing an objects visibility
effectively changed the current mode - which missed necessary
updates for the tool-system (for example).

There was already a check for edit-mode, now expected to all modes.

This makes the test-case described in T83013 work as expected.
2021-02-12 17:09:34 +11:00
Juanfran Matheu
631cc5d56e WM: Add 'Confirm On Release' option for WM_OT_radial_control
Adds a new property called "Confirm On Release" that does what it says,
confirm the action without having to do left-click or to press any other
extra-key which concludes in a more dynamic and efficient way of changing
brush size or strength for example, especially for tablet users.

Reviewed By: campbellbarton

Ref D10233
2021-02-12 16:45:29 +11:00
5a15039530 Cleanup: use the assignment operator with list-comprehension 2021-02-12 16:35:16 +11:00
9d3d2fa031 Cleanup: don't subclass 'Panel' for mix-in classes
This reports warnings with `--debug-python` since all panel
sub-classes are expected to be registered.
2021-02-12 16:35:16 +11:00
fae3057084 Cleanup: remove unused panel SEQUENCER_PT_sound
These have since been moved to SEQUENCER_PT_source.
2021-02-12 16:35:16 +11:00
6a12c50703 Docs: add notes to 'make deps' & the sqlite build configuration
- Move non-blender build targets into their own section.
- Expand 'make help' text, noting a local 'make deps' overrides.
- Note where the spell checkers word-list is maintained.
- Note on why sqlite is built without 'tcl'.
2021-02-12 16:33:59 +11:00
3fea77ceed CMake: update MSVC PDB path reference
Replace literal number with a variable.
2021-02-12 08:15:09 +11:00
cafd6b519c PyAPI: Use PyPreConfig & PyConfig for Python initialization
Use Python 3.8's API for setting the initial configuration.

This replaces a mix of our logic and direct calls to the Python API
and has no user visible changes.

Using the Python API makes the logic easier to follow and provides
utilities such as `PyConfig_SetBytesArgv`
that wasn't available in previous releases.

Note that this uses Python's utf8/wchar_t conversions,
which used to cause problems (see T31506).

Since `Py_UTF8Mode` was set, the systems locale isn't used for decoding,
allowing us to use Python's utility functions that call
`Py_DecodeLocale` internally.

Ref D10382
2021-02-12 08:10:12 +11:00
aa43e2ec29 PyAPI: use PyModule_AddType utility function 2021-02-12 08:08:16 +11:00
d21f445469 PyAPI: remove Python 3.7x compatibility code
This removes Python version checks needed to build with 3.8+ and 3.7x.

Ref D10381
2021-02-12 08:08:15 +11:00
7952ed872a CMake: update python to 3.9.1
Default to Python version 3.9.

Reviewed By: LazyDodo, sybren, sebbas

Ref D10380
2021-02-12 07:50:01 +11:00
35ddcb4041 Cleanup: clang-format, spelling 2021-02-12 07:49:40 +11:00
Habib Gahbiche
b6d7aa9e13 Mesh automated testing: compare selection
MeshTest now compares selection between evaluated mesh and expected mesh. This way, we can test more operators
such as `faces_select_linked_flat`

Note: selection comparison intentionally does not happen in BKE_mesh_cmp() on C side but rather on Python side, because
selection is independent of mesh generation.

Reviewed By: calra, mont29

Differential Revision: https://developer.blender.org/D10279
2021-02-12 01:33:56 +05:30
847da6176e Fix finding system Haru library on Debian.
Paths and names of system packages-installed libhpdf on Debian (and
probably its derived distributions?) are slightly different than what
was given to CMake finding script.
2021-02-11 20:28:10 +01:00
ed817d62bd Cleanup: Python GPU: Use consistent prefixes for local API
It was not following the own documentation at the top code that mentions
that for local API the prefix is "bpygpu_".
2021-02-11 16:13:02 -03:00
Habib Gahbiche
a608313860 Mesh automated testing: improve progress printing
Print number of total tests with each test to show how many tests have been executed and how many are left.
Example: `Running test 27/36: PlaneFaceSplitByEdges...`

Reviewed By: calra, mont29

Differential Revision: https://developer.blender.org/D10278
2021-02-11 23:07:03 +05:30
Habib Gahbiche
916e3b6e3d Cleanup: delete comments with test index
Tests are not identified with indexes, so no need to maintain comments with indexes anymore

Reviewed By: calra, mont29

Differential Revision: https://developer.blender.org/D10277
2021-02-11 22:56:54 +05:30
6a5d17bfb2 Cleanup: Remove unused variable 2021-02-11 10:27:25 -06:00
05bbe3f8ef Merge branch 'blender-v2.92-release' 2021-02-11 10:23:33 -06:00
314525b8cf Fix T85555: Geometry Nodes: Attribute Vector Math Wrap is broken
This was just a copy and paste error / typo. The proper DNA variable
wasn't used. Thanks @charlie for finding the issue.
2021-02-11 10:22:57 -06:00
4f8bc3e35c GPencil: Move Autofit parameter from topbar to advanced panel
As this is used only in corner cases, it is better keep in advanced panel.

Also renamed to "Limit to Viewport"
2021-02-11 15:59:53 +01:00
18ac37a39b Merge branch 'blender-v2.92-release' 2021-02-12 00:42:36 +11:00
196dfc01a3 Fix T84114: Existence of vertex groups slows down mesh editing
Having a vertex group in a mesh slowed down unrelated operations
such as selection.

De-duplicating custom-data arrays for layers that contain pointers
can become slow without any benefit as the content never matches.

Use full copies when storing custom-data for edit-mesh undo.
2021-02-12 00:40:58 +11:00
dabf96f732 Attributes: support bool attribute in rna
Differential Revision: https://developer.blender.org/D10387
2021-02-11 13:44:58 +01:00
6ca992b017 Merge branch 'blender-v2.92-release' 2021-02-11 12:34:51 +01:00
b20872d36e Fix T85543: Object Types Visibility missing shading notifier
Caused by rB0f95f51361d7.

Similar to T85515, T84717 and their related fixes.
In this case, add missing shading notifier as in rB9274bd457a25.

Maniphest Tasks: T85543

Differential Revision: https://developer.blender.org/D10395
2021-02-11 12:30:41 +01:00
349c17cf54 Fix T85462: crash in render mode while removing instances
This crash is caused by accessing object data in the kernel at an out of bound index from a deleted instance.

Cycles represents instances as Object nodes sharing the same Geometry node, so we need to tag the GeometryManager for an update if some objects are added or removed as no geometry might have been added or removed in order to properly update the BVH and its associated data arrays.

Regression caused by rBbbe6d4492823.
2021-02-11 12:03:26 +01:00
69e191604b Fix T85541: crash when replacing an existing node link
It's not necessary to check if the link has to be removed,
if it was removed already.

This regression was caused by rB8f707a72e81833bb835324ddc635b29dfbe87a9f.
2021-02-11 11:50:12 +01:00
Fabian Schempp
8f707a72e8 UI: Multi-input node socket spacing and interaction
This commit makes links connected to multi-input sockets spread verticaly
along the socket. Sockets grow if more links are connected and the node
layout updates accordingly. Links are sorted by their incoming angle
to avoid crossing links. Also, link picking is updated to work with
spread links and bezier links.

Currently the multi-input sockets are used in the join geometry node.

The mutli-input sockets look like a vertical rounded rectangle.
Currently they do not support the other custom socket shapes.

Reviewed By Hans Goudey, with cleanup and additional edits

Differential Revision: https://developer.blender.org/D10181
2021-02-11 01:16:17 -06:00
Fabian Schempp
9a9e19fdcc Geometry Nodes: Use multi-input socket in join geometry node
This updates the join node to use the new multi-input socket from D10067.
The change just requires slightly changing the arguments of the exec
function, and changing the socket input list.

Note that this commit does not contain the UI changes, it only allows for
more input links, and combines the two sockets into one. The UI changes
will come next.

Reviewed By: Hans Goudey

Differential Revision: https://developer.blender.org/D10069
2021-02-11 00:23:15 -06:00
faad487b58 Cleanup: remove version check for unsupported cmake version 2021-02-11 15:57:24 +11:00
b0e483c373 Fix ASAN report when creating attribute math node
The DNA struct name for the node storage was incorrect.
2021-02-10 22:54:45 -06:00
ed1945c801 Merge branch 'blender-v2.92-release' 2021-02-11 12:40:07 +11:00
52cfc620c8 Fix T83013: Annotation with hidden object in sculpt mode crashes
This just avoids the crash, the annotation tool still doesn't work.

Larger changes will be needed to resolve this, see T85532.
2021-02-11 12:34:41 +11:00
175325ebdb Merge branch 'blender-v2.92-release' 2021-02-11 08:40:19 +11:00
16c621e529 Merge branch 'blender-v2.92-release' 2021-02-11 08:40:16 +11:00
1a52b5f7d3 Merge branch 'blender-v2.92-release' 2021-02-11 08:40:12 +11:00
15785b35f3 Merge branch 'blender-v2.92-release' 2021-02-11 08:40:09 +11:00
f1ee345f99 Cleanup: incompatible-pointer-types warning 2021-02-11 08:38:52 +11:00
2d252b6d26 Fix T85508: UV select overlap fails on identical faces
The triangle overlap test failed for exactly overlapping triangles.

When none of the segments intersect, testing a if a single corner
is inside the other triangle fails when the triangles share UV
coordinates.

Resolve by comparing the triangle centers.
2021-02-11 08:35:16 +11:00
4719836eca BLI_math: add mid_v2_v2v2v2 2021-02-11 08:27:28 +11:00
9274bd457a Fix T85515: missing viewport update when toggling Hidden Wire
This is in the overlay popover but also affects shading.
2021-02-10 19:49:10 +01:00
Brecht Van Lommel
677e63d518 TBB: fix deprecation warnings with newer TBB versions
* USD and OpenVDB headers use deprecated TBB headers, suppress all deprecation
  warnings there since we have no control over them.
* For our own TBB includes, use the individual headers rather than the tbb.h that
  includes everything to avoid warnings, rather than suppressing all.

This is in anticipation of the TBB 2020 upgrade in D10359. Ref D10361.
2021-02-10 19:32:24 +01:00
69c7ffff8b Transform: refactor createTransData splitting into more specific functions
Currently, `createTransData` is doing much more than the name implies.

This commit makes it clearer through smaller and more specific functions
what the real purpose of that function.
2021-02-10 15:29:05 -03:00
62f0d51681 Fix T85494: Click and drag of the 3d cursor turns off proportional editing
Missed `CTX_NO_PET`.

This commit also reorganizes the code to make it clearer when using flags.
2021-02-10 15:23:28 -03:00
f75a711178 CMake/Deps: Fix building cython on windows
For the debug version of cython pip was trying to link
against the release version of python for some strange
reason. Passing some flags to explicitly target the
debug version fixes the issue.

Given other platforms do not have different builds for
debug/release this is not an issue there.
2021-02-10 11:20:49 -07:00
4818ed1c76 Cleanup: Unindent if statements in sculpt tools code
This removes indentations from if statements by converting them to early
returns and continue.
Most of the code of brushes and tools has loops with a full indented
body inside of an if, which was also copied into some of the new tools.

Reviewed By: JacquesLucke

Differential Revision: https://developer.blender.org/D10333
2021-02-10 18:06:56 +01:00
54cbfeedd7 Cleanup/fix warnings.
Own dummy mistakes in rBf269fbd64a5a0cb7.
2021-02-10 17:48:49 +01:00
e03cfc2374 Fix T85420: moving color ramp handles via position input does not work
This just needed some special case handling for the new attribute color ramp node...
2021-02-10 17:29:52 +01:00
f269fbd64a LibOverride: Refactor: Switch more code to using Main.relations.
This potentially could fix some missed cases in dependency tagging (when
dealing with overrides hierarchies), since relying on tag in ID itself
is not a good idea to check whether an ID has been propcessed or not
(exterior code may have forced that tag on some IDs e.g., which would
prevent them from ever being processed properly).
2021-02-10 17:10:43 +01:00
b5536c97b7 Merge branch 'blender-v2.92-release' 2021-02-10 16:53:40 +01:00
40a1861265 Fix T85514: exact match is not showing up in search menu
The `get_shortest_word_index_that_startswith` function was not doing
what it was supposed to do. This resulted in wrong matches.
2021-02-10 16:52:09 +01:00
806b22d130 Cleanup: typo
Committing this to the release branch, to avoid merge conflicts with an
upcoming fix.
2021-02-10 16:52:09 +01:00
bdb83cc32c Fix T85471: Wrong orientation in transforming objects in weight paint mode
The local orientation chosen was that of the active object, but as
confirmed in other parts of the code, the orientation of the selected
Bone has priority.
2021-02-10 12:32:46 -03:00
d9eeb7840f Merge branch 'blender-v2.92-release' 2021-02-10 13:30:07 +01:00
97cc130f47 Fix T85395: Texture paint external edit wrong projection on reapply
Caused by rB5b34d11b55e0.

Above commit restored the view matrices in ED_view3d_draw_offscreen
_before_ they can be stored in the ImBuff (see ED_view3d_draw_offscreen
/ texture_paint_image_from_view_exec).

Now make restoring the view matrices optional and dont do this in case
of reprojection, so the used matrices can still be saved in the ImBuff
later.

Reviewed By: campbellbarton

Maniphest Tasks: T85395

Differential Revision: https://developer.blender.org/D10331
2021-02-10 13:25:31 +01:00
4c883fd04e Merge branch 'blender-v2.92-release' 2021-02-10 12:49:54 +01:00
d76890bfb0 Fix T85492: fix check if object has visible instances
Without this, `OB_VISIBLE_INSTANCES` would be added to `visibility` incorrectly,
leading to unexpected visibility changes down the line.
2021-02-10 12:48:17 +01:00
db9d40b9d3 CMake: set compiler-ccache & build-type-init variables as advanced
These settings aren't useful for basic configuration.
2021-02-10 17:44:14 +11:00
328a8c68b7 Fix Geometry Nodes: Broken built-in attribute exists check
Fixes an issue in a node setup with the point separate node, where muting
a node that does nothing breaks the operation, resulting in the point
separate not copying the position attrbute to either result.

The fix is straightfoward, it looks just like a typo.

Differential Revision: https://developer.blender.org/D10379
2021-02-09 22:55:59 -06:00
d72595a594 Cleanup: Remove unecessary padding from small DNA structs
After {rBa0867f05a48e2017a}, it is no longer necessary to pad
structs with 1 and 2 byte sizes. Most of these are geometry node
structs, where we've been avoiding using `node.custom1`.

I only found two others, the freestyle flags in custom data DNA.

Differential Revision: https://developer.blender.org/D10335
2021-02-09 20:26:58 -06:00
53ae2c2a40 Merge branch 'blender-v2.92-release' 2021-02-10 01:18:37 +01:00
f617782fc1 Fix Sculpt Gestures using normal orientation with translated objects
This fixes two issues that were preveting normal orientation for working:

- The translation of component of the object matrix should not be
considered when converting a normal to world space.
- Whe using cursor for depth, the depth for the shape should be taken
directly from the cursor (which is already unprojected and updated)
instead of from the brush, which may have not been updated.

Reviewed By: dbystedt, JacquesLucke

Differential Revision: https://developer.blender.org/D10231
2021-02-10 01:16:53 +01:00
1c4ae8a11c UI: Removal of GHOST_CreateDialogWindow
Simplification of window creation code to allow greater flexibility.

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

Reviewed by Brecht Van Lommel
2021-02-09 16:14:31 -08:00
2a670a34be Fix T83047: Texture paint symmetry options not in topbar
The texture paint mode was accidentally removed from the list

Reviewed By: JacquesLucke

Maniphest Tasks: T83047

Differential Revision: https://developer.blender.org/D10216
2021-02-10 01:10:58 +01:00
8fcf3e96fe Fix T85079: Thumb brush unstable when producing larger displacements
The thumb brush was updating the area normal per brush sample, which was
making unstable sampled normals for setting the displacement direction
when the vertices are moved too much from their original positions.
Now it always uses the original normal except when using anchored
strokes. In those cases, the normal always needs to be updated.

Reviewed By: JacquesLucke

Maniphest Tasks: T85079

Differential Revision: https://developer.blender.org/D10214
2021-02-10 01:09:25 +01:00
5bddfde217 cmake/deps: update Python to 3.9.1
The following packages also have received updates:

- IDNA 2.10
- CHARDET 4.0.0
- URLLIB3 1.26.3
- CERTIFI 2020.12.5
- REQUESTS 2.25.1
- NUMPY 1.19.5

numpy has gained a hard dependency on cython:

- CYTHON 0.29.21

Notes:

- This only updates the build environment files,
  once these are built, Blender can default to Python 3.9.
- The 'm' suffix for Python binaries/libs has been removed.
- The macOS patch in Python 3.7 is has been removed.

Reviewed By: sybren, campbellbarton, sebbas

Ref D10257
2021-02-10 09:38:48 +11:00
bdb42c2c2d Cleanup: remove redundant headers in source/blender/editors/
Remove redundant headers using
`./source/tools/utils_maintenance/code_clean.py`

Reviewed By: jmonteath

Ref D10364
2021-02-10 09:38:24 +11:00
7b84a5a370 Cleanup: spelling 2021-02-10 09:38:24 +11:00
201865b6f7 Cleanup: update old comments 2021-02-10 09:38:19 +11:00
de0801c3d6 Cleanup: clang-format 2021-02-10 09:29:48 +11:00
048dd8454c Cleanup: warning (useless type qualifier) 2021-02-10 09:29:48 +11:00
Victor-Louis De Gusseme
722790e8d2 Fix T85493: Attribute glitches while using Attribute Proximity node
The span fill was in multithreaded code, so calculated values were
sometimes reset. The fix is to move FLT_MAX fill outside of parallel_for.

Differential Revision: https://developer.blender.org/D10378
2021-02-09 16:24:49 -06:00
a86605fffd LibOverride: Refactor: Switch more code to using Main.relations.
This potentially could fix some missed cases in dependency tagging (when
dealing with overrides hierarchies), since relying on tag in ID itself
is not a good idea to check whether an ID has been propcessed or not
(exterior code may have forced that tag on some IDs e.g., which would
prevent them from ever being processed properly).
2021-02-09 21:53:47 +01:00
87c75767b3 Fixed (unreported) memleak in recent BMain relations new code.
Forgot to free the GHash iterator.
2021-02-09 21:38:57 +01:00
510db9512f Outliner: Enable render visibility column by default
The render visibility column in the outliner should be enabled by
default. This change makes it more obvious which objects will be
rendered which can be misleading when only viewport visibility toggles
are shown by default. This commit enables the render visibility column
in all existing and new Outliner editors.

Differential Revision: https://developer.blender.org/D10365
2021-02-09 12:03:53 -07:00
bace031b65 Fix (unreported) assert in liboverride reset code.
Invalid override properties ( i.e. invalid RNA paths) are not strictly
speaking errors, many things can lead to that situation. Just ignore and
skip those cases.
2021-02-09 18:53:52 +01:00
ebdaa52fa7 LibOverride: Refactor a bit override hierarchy utils.
Use LibOverrideGroupTagData helper struct a bit more widely.
2021-02-09 18:53:04 +01:00
Wannes Malfait
a2ba37e5b6 Geometry Nodes: Add Combine and Separate XYZ nodes for attributes
These are similar to the regular "Combine XYZ" and "Separate XYZ" nodes,
but they work on attributes. They will make it easier to switch between
vector attributes and float attributes.

Differential Revision: https://developer.blender.org/D10308
2021-02-09 11:12:24 -06:00
34155dd29b install_deps: Update OpenXR repository info
The repository information for cloning the OpenXR repository, rather than just
downloading the source archive, was outdated.
* Use the OpenXR-SDK repository link, not the OpenXR-SDK-Source one. Only the
  former is needed, it contains pregenerated files with minimum dependencies.
  The latter contains additional tools and the un-generated source files.
* Update the commit hash to the version we currently use, 1.0.14 (was 1.0.6).

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

Reviewed by: Bastien Montagne
2021-02-09 17:10:26 +01:00
4e92be6d72 LibOverride: Verious minor cleanups and fixes to code tagging IDs in an override hierarchy. 2021-02-09 16:52:53 +01:00
9e1065ead2 LibOverride: cleanup: code consistency.
Properly fully extract
`lib_override_hierarchy_dependencies_recursive_tag` from
`lib_override_linked_group_tag`.

Was supposed to be that way already (see comment of
`lib_override_linked_group_tag`), for some reasons this case was missed.
2021-02-09 16:52:53 +01:00
b926c9f345 Transform: Expose the hardcoded Precision Key
As shown on the T85383, attempts are made to edit the precision mode key.

But that key was hardcoded.

That key now appears among the custom modal keymap items.
2021-02-09 12:29:00 -03:00
e44b2ada3e GPencil: Basic block drawing in Dopesheet
Add a bar between keyframes to indicate that keyframe is still used. This is part of a change to make the rec button be used by gpencil.

Example:

Before:
{F9592704}

After:
{F9592702}

Reviewed By: #user_interface, #grease_pencil, pepeland, Severin

Maniphest Tasks: T85463

Differential Revision: https://developer.blender.org/D10179
2021-02-09 16:08:45 +01:00
1352d81b17 GPencil: Fill tool refactor and Multiframe in Draw mode
This commit is a refactor of the fill tool to solve several problems we had since the first version of the tool.

Changes:

* The filling speed has been improved for each step of the process with the optimization of each algorithm/function.
* New `AutoFit` option to fill areas outside of the viewport. When enable, the total size of the frame is calculated to fit the filling area.
* New support multiframe filling. Now it is possible to fill multiple similar frames in one go.
* New `Stroke Extension` option to create temporary closing strokes. These strokes can be displayed and adjusted dynamically using wheel mouse or PageUp/Down keys.
* Parameter `Resolution` now is named `Precision` and has been moved to topbar.
* `Resolution` now has decimals and can be lower than 1 to allow quick filling in storyboarding workflows. Maximum value has been set as 5.
* Parameter `Simplify` has been moved to Advanced panel.
* Improved fill outline detection. In some cases, the outline penetrated the area to be filled with unexpected results.
* Fixes some corner case bugs with infinite loops.

As a result of this refactor, also these new functionalities has been added.

* New support for multiframe in `Draw` mode. Any drawing in active frame is duplicated to all selected frame.
* New multiframe display mode. Keyframes before or after of the active frame are displayed using onion colors. This can be disable using Onion overlay options.
2021-02-09 16:00:36 +01:00
5213b18eb2 Cycles: fix wrong flags used to tag device data as dirty
Also fixes missing modified tag for float2 and float3 attributes arrays.
2021-02-09 14:50:00 +01:00
5321e844d3 CMake/Linux: Add libharu to platform_linux.cmake
Since GPencil changes depending on libharu may be committed to master
before SVN libraries for all platforms are in place, avoid build issues.
Extension of D9928.

Reviewed By: sybren

Differential Revision: https://developer.blender.org/D10280
2021-02-09 14:36:29 +01:00
a7b931e87f Cleanup: comments, replace German expression with English 2021-02-09 22:31:28 +11:00
62195fb5b3 Cleanup: comments, replace 'undoes' with 'undo-steps' 2021-02-09 22:31:28 +11:00
ee585b9c21 Fix: use class instead of struct in forward declaration 2021-02-09 11:47:49 +01:00
17672efa0e Geometry Nodes: initial attribute interpolation between domains
This patch adds support for accessing corner attributes on the point domain.
The immediate benefit of this is that now (interpolated) uv coordinates are
available on points without having to use the Point Distribute node.

This is also very useful for parts of T84297, because once we have vertex
colors, those will also be available on points, even though they are stored
per corner.

Differential Revision: https://developer.blender.org/D10305
2021-02-09 11:45:04 +01:00
4601e3a591 Geometry Nodes: refactor internal attribute access architecture
Goals:
* Clarify the distinction between builtin and other attributes at the code level.
* Reduce number of places that need to be modified to add more builtin attributes.
* Reduce number of virtual methods that need to be implemented by e.g. `MeshComponent`.

To achieve these goals, this patch implements the concept of "attribute providers".
An attribute provider knows how to give access to attributes on a geometry component.
Each geometry component can have multiple attribute providers, whereby each provider
manages an different set of attributes.

The separation of builtin and other attributes is now done at the attribute provider level.
There are two types of attribute providers. One for builtin attributes and one for all others.

This refactor also helps with T84297.

Differential Revision: https://developer.blender.org/D10341
2021-02-09 11:24:28 +01:00
494913f17a Merge branch 'blender-v2.92-release' 2021-02-09 08:13:33 +01:00
549d9f8727 Fix T81206: Do not limit gl texture size in image editor
This patch will show textures in the image editor with the maximum
available resolution determined by the GPU Hardware/Driver.
Currently the size is limited by the user preference texture size limit.

An image user can set the `IMA_SHOW_MAX_RESOLUTION` flag to request
gpu textures in the max supported resolution. When this flag isn't
set the gpu texture is limited by the user preference setting.

When the gl resolution limit is disabled the GPU texture is always
created for the max supported resolution.

Reviewed By: Clément Foucault

Maniphest Tasks: T81206

Differential Revision: https://developer.blender.org/D9160
2021-02-09 08:12:29 +01:00
10f44a4135 Fix versioning code of previous commit 2021-02-09 08:11:56 +01:00
eab9165c25 Cleanup: spelling 2021-02-09 10:42:00 +11:00
3b1c7a6d6f Cleanup: move eIconSizes, ID_Type enums into own file
This avoids adding DNA_ID.h into other headers, recently changed in
cfa48c84d0

Note that other enums could be moved too, this is a smaller change
to avoid indirectly including DNA_ID.h in many places.
2021-02-09 09:58:06 +11:00
cfa48c84d0 Cleanup: Register node property layout callbacks in files
This commit moves the property layout callbacks for node types to their
implementation files from `drawnode.c`. This was proposed a while ago in
T75724.

**Benefits**
 - Fewer files need to be changed when adding a new node.
 - Makes it possible to reuse functions from the node's implementation
   in the layout code.
 - Except for RNA, all of the node "inputs" are in the same place.
 - Code gets shorter overall, avoids the large switch statements.

**Downsides**
 - Requires including two UI headers.
 - Requires adding an editors dependency to the nodes folder.

This commit only changes function nodes and geometry nodes, more can be
moved later.

Differential Revision: https://developer.blender.org/D10352
2021-02-08 15:09:49 -06:00
13299a7367 Docs: Remove CLI arguments removed in recent commit
This commit follows up on rBbc94036a76b63254181788ce5814fb946f52a287
and removes the arguments from the CLI args docs.
2021-02-08 15:27:49 -05:00
694bc4d040 Fix for T84038: Improved Report Warnings
Improved contrast for Status Bar report warning messages.

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

Reviewed by Hans Goudey
2021-02-08 08:19:23 -08:00
21a2b975b8 Cleanup: Remove using-directive from freestyle headers
The header files in freestyle utilize the using-directive at the global
file scope. This is a bad practice as it pollutes the global name space
causing possible ambiguous reference compilation errors. In particular,
the DNA files that are included by freestyle will cause those ambiguous
reference errors when the developers adds a DNA member with a type name
that also exist in the Freestyle name space, such as Curve and possibly
others.

This patch does the minimal work needed to resolve that by moving the
using-directives from the headers into the corresponding translation
units.

Reviewed By: Brecht

Differential Revision: https://developer.blender.org/D10351
2021-02-08 17:29:42 +02:00
048135e2c8 Fix T85448: File Browser sidebar collapses when selecting a file
The logic to ensure a valid region state was too aggressive in setting the
region hiding. It would just always update it based on the operator's
`hide_props_region` option, not only when file browser was newly opened.
It's more selective now.
2021-02-08 16:14:10 +01:00
302625eb37 Fix (studio-reported) crash in readfile code.
Essentially, `lib_link_all` would perform some post-processing over data
in given `bmain` that **may** fail when not all data from all libraries
has been properly loaded yet.

This happens when `lib_link_all` is called from `read_libraries`, where
the bmains are split by libraries.

Now those post-processing is put into its own utils function, which
asserts that it is only called on a merged bmain.

Bonus point, this will avoid re-runing those not-so-cheap operations
more than once on the same data.

Reproducible in r1442 of Sprite repository when opening
`pro/animation_test/rex/performance/rex_crowdcamping/rex_crowdcamping.lighting.blend`

NOTE: Not so sure why we have to call `lib_link_all` several times (once
for each library, and then once on the whole merged bmain, including
local IDs then). So that it can get called for libs while we still have
that specific .blend file handle around?
In any case, the overhead here is minimal since we do ensure a data-block is
never lib-linked more than once, so this is not a serious concern right now.

Differential Revision: https://developer.blender.org/D10307
2021-02-08 15:59:08 +01:00
df0bce3f7d Fix T81206: Do not limit gl texture size in image editor
This patch will show textures in the image editor with the maximum
available resolution determined by the GPU Hardware/Driver.
Currently the size is limited by the user preference texture size limit.

An image user can set the `IMA_SHOW_MAX_RESOLUTION` flag to request
gpu textures in the max supported resolution. When this flag isn't
set the gpu texture is limited by the user preference setting.

When the gl resolution limit is disabled the GPU texture is always
created for the max supported resolution.

Reviewed By: Clément Foucault

Maniphest Tasks: T81206

Differential Revision: https://developer.blender.org/D9160
2021-02-08 15:44:54 +01:00
f5c781af56 install_deps: Updated OpenImageDenoise to 1.3.0 2021-02-08 14:44:54 +01:00
db1e50262b Fix compilation error after recent refactor
Thanks Germano for review!
2021-02-08 14:36:48 +01:00
e35182fc05 install_deps: Updare OpenVDB to 8.0.1. 2021-02-08 14:35:05 +01:00
711b65407f Transform: Refactor texture space 'transform_convert' data
The changes are:
- Split conversion of the texture space data to its own file.
- Skip adding keyframes with AutoKeyframes.
- Skip recalculation of the trasform dependencies between objects.
- Skip `special_aftertrans_update_...`.

No real user functional changes
2021-02-08 10:01:07 -03:00
0bc07ea090 Cleanup: Unify, move and rename transform flags
Flags unified:
T_CURSOR -> CTX_CURSOR
T_TEXTURE -> CTX_TEXTURE

Flags moved:
T_CAMERA -> CTX_CAMERA
T_POSE -> CTX_POSE_BONE
T_OBJECT -> CTX_OBJECT
T_TEXTURE -> CTX_TEXTURE_SPACE

Flag renamed:
CTX_EDGE -> CTX_EDGE_DATA
2021-02-08 09:54:54 -03:00
be60b3b239 Transform: Grid snap target refactor
The code takes many turns to get a suitable "target" for the snap to grid.

Perhaps there were other reasons awaited for `transformCenter_from_type`
and `TransCenterData center_cache[5]`.

But since nothing is defined, it is better to simplify the code.

No user functional changes
2021-02-08 09:54:54 -03:00
bc56c12770 Cleanup: Rearrange and name the enums and flags used in the transform code
Simple change that shows all the enums used in the transform code and helps
to better understand the role of the members of the struct TransInfo.

It also allows the IDE to show the name of the value represented by the
member instead of a number that needs to be consulted.

Differential Revision: https://developer.blender.org/D10312
2021-02-08 09:54:54 -03:00
dfa3e0d9b5 Merge branch 'blender-v2.92-release' 2021-02-08 13:36:51 +01:00
Sam Miller
bb0b250cbd Fix T85368: map range node clamps incorrectly in geometry nodes
When clamp is enabled, it should clamp between the output min and max
and not between 0 and 1.

Differential Revision: https://developer.blender.org/D10324
2021-02-08 13:33:23 +01:00
2ca3a1d2ae install_deps: Update TBB to 2020_U2 2021-02-08 12:45:59 +01:00
15d1a43445 install_deps: Update OpenXR to 1.0.14. 2021-02-08 12:26:27 +01:00
ecfd5360a1 Merge branch 'blender-v2.92-release' 2021-02-08 11:36:11 +01:00
4402f43b71 Fix T85426: Speed effect stretch to input not working
`seq_effect_speed_get_strip_content_length()` checked only for number
of inputs of target strip, even if it's not an effect.

Only effects are treated in different way, so check for type as well.
Broken by 93c10797dc

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D10356
2021-02-08 11:30:26 +01:00
Sebastian Koenig
c33a3cfd9a Mask: Use control point position when handle is selected
This is something what comes after an experiment, which makes behavior
more desirable. Basically, for Lock-to-Selection functionality always
use control point position if any of control point itself or handles
are selected.

Initial patch from Sebastian, modification from Sergey.

Differential Revision: https://developer.blender.org/D10265
2021-02-08 11:14:34 +01:00
62ef35db6d Fix strict uninitialized warning for C++
Allows to compile Blender without uninitialized warning in Bullet code.
2021-02-08 11:10:21 +01:00
9d6059504c Cleanup: Remove unused tree element types
These weren't used since ages. Comment out the DNA define (value shouldn't be
reused to avoid compatibility breakage) and remove icon code for the types.
2021-02-08 10:32:18 +01:00
fd05e31d3f Cleanup: Use enum for Outliner tree-store element types
We generally prefer using enums over precompiler defines. This adds an actual
type for the values, which the compiler can use to throw warnings, give better
messages, etc.
2021-02-08 10:32:18 +01:00
8acd58a1a9 Cleanup: Remove dead code for keymap Outliner display mode
This wasn't used for a long time and there are no plans to bring this back.
2021-02-08 10:32:18 +01:00
04be1e9980 Code quality: Refactor asset operators using C++
* Attempt to improve readability by using focused, coherent helper classes.
* Replace ListBase with blender::Vector, which is more efficient and has a
  better API.
* Split user reporting from error checking.
* Use namespace (as we usually do for C++ code).
* Remove unused headers
2021-02-08 10:32:18 +01:00
eb7d9e2a1b Cleanup: Alphabetize function order 2021-02-07 17:21:21 -06:00
0376b2f566 Forgot to free a bvhtree with previous commit. 2021-02-07 17:41:03 -05:00
6f63417b50 Fix T84493 et al: New Boolean on Suzanne.
While Boolean is not guaranteed to work if the operands are not
volume-enclosing (technically: PWN - piecewise constant winding number),
it needs to do something in those cases. This change makes
more cases meet user expectations in T84493, T64544, T83403,
T82642 (though very slow on that one).
The original new boolean code used "generalized winding number"
for this fallback; replaced this with code that uses raycasting.
Raycasting would have been faster, but for unfortunately also
switchd to per-triangle tests rather than per-patch tests since
it is possible (e.g., with Suzanne) to have patches that are
both inside and outside the other shape. That can make it much
slower in some cases, sadly.
2021-02-07 11:25:07 -05:00
71e63153eb GPencil: Fix wrong python API for Point weights
The old property never worked as expected because it was impossible expose the data as props.

Now, there are two methods to handle this: weight_get and weight_set

Example use:
```import bpy
ob = bpy.context.active_object
gpd = ob.data
gps = gpd.layers[0].frames[0].strokes[0]
i = 0
print("Weights\n================================")
for pt in gps.points:
    gps.points.weight_set(vertex_group_index=0, point_index=i, weight=0.5)
    i +=1

i = 0
for pt in gps.points:
    weight = gps.points.weight_get(vertex_group_index=0, point_index=i)
    print(weight)
    i +=1
```

Reviewed By: brecht

Maniphest Tasks: T84967

Differential Revision: https://developer.blender.org/D10177
b3f989
2021-02-07 13:02:11 +01:00
699b2d9855 Code quality: Port recently added utility file to C++
It seems generally preferred to have new files be created with C++.
The only reason I didn't do that when I initially created the files is that I
was unsure about some C-API aspect.

Also use nullptr instead of NULL.
2021-02-06 19:27:55 +01:00
ef29ebb31b Code quality: Port recently added asset files to C++
It seems generally preferred to have new files be created with C++.
The only reason I didn't do that when I initially created the files is that I
was unsure about some C-API aspect.

Also includes some minor C++ related cleanup (nullptr instead of NULL, remove
redundant `struct` keyword).
2021-02-06 19:27:55 +01:00
4cca64f4ad Merge branch 'blender-v2.92-release' 2021-02-06 09:09:17 +01:00
eccc57aa5c Fix T85378: Shrink/Fatten display number units
Currently the displayed distance when using the shrink/fatten transform
operator does not respect the scene units (they would always be in
blender units).

This changes makes sure the number is displayed in the correct unit.

Reviewed By: mano-wii

Maniphest Tasks: T85378

Differential Revision: https://developer.blender.org/D10325
2021-02-06 09:07:50 +01:00
luzpaz
a4a9d14ba7 UI: Fix Typos in Comments and Docs
Approximately 91 spelling corrections, almost all in comments.

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

Reviewed by Harley Acheson
2021-02-05 19:08:14 -08:00
3560f5c1e6 Cleanup: compare with zero for flag checks
This is done almost everywhere already,
use this more straightforward convention.
2021-02-06 13:33:18 +11:00
f10825d573 Cleanup: malformed web addresses in comments 2021-02-06 13:29:19 +11:00
abfb9dbf59 Fix: Disabled NLA Interferes with Action Eval
Introduced by my commit: rB09709a7e64ff

This bug effectively enabled the NLA when it should be disabled, when
all tracks muted or no strips exist. Specifically, the NLA Action Track
settings would be used (extrapolation, blendmode, influence).
2021-02-05 17:47:56 -05:00
Wayde Moss
10e23fd104 NLA: Refactor Transition, Use Snapshot Blend Func
The function `nlastrip_evaluate_transition()` has been slightly
modified to use `nlasnapshot_blend()` instead of it's own special
blending function `nlaeval_snapshot_mix_and_free()`.

No user functional changes

Reviewed By: sybren, #animation_rigging

Differential Revision: https://developer.blender.org/D10221
2021-02-05 16:52:43 -05:00
5bc9ddd98b Fix T85380: NLA Evaluation Missing Null Check
Introduced by commit: rB40b7929cc040
2021-02-05 14:19:38 -05:00
7d874b0343 Image: Flip image operator
This implements an operator to flip the contents of an image buffer. It
supports flipping the image horizontally and vertically.

Reviewed By: JacquesLucke

Differential Revision: https://developer.blender.org/D10310
2021-02-05 19:15:43 +01:00
faf45091b4 GPencil: New python API to force stroke triangulation data update
In some python scripts, the coordinates of the points are manipulated, but there are no way to force the recalculation and need hack to force the refresh.

The new api allows to call to the refresh function directly.

example: `gp_stroke.points.update()`
2021-02-05 19:15:12 +01:00
5dc87a3ca5 Massive install_deps update.
Unfortunately one issue raising another one, this ended up being a
fairly big update, with:

*Fixes:
** Dependencies between libraries are better handled (would fail
   previously in some cases when the lib was also available as package).
** Dependency of Boost over Python is now taken into account.
** Fix CMake flags to use local own built boost.
** Fix building numpy.

*Changes:
** We now use pip for all python modules (including numpy).
** Added all missing python modules (requests etc.).

*Updates:
**USD: 20.08, Due to build failing with 20.05 (missing include).
2021-02-05 19:02:11 +01:00
07521b1627 Depsgraph: Remove no-op evaluation function
Make the SHADING_PARAMETERS operation on node tree a real no-op.
The function used as a callback was only doing a debug print.

The issue with this function was that an original ID was passed
as an argument. This is a violation of design, and if anything it
should be left up to the implementation to check whether depsgraph
is active.

There are no functional changes for users in the interface. The
only difference is that the debug print will no longer happen.
2021-02-05 17:13:59 +01:00
b4dca4ea2c Cleanup: Use raw string literal
Resolves modernize-raw-string-literal Clang-Tidy warning

The way warning works is it suggests to use raw literal when
overhead of having escape characters is higher than the overhead
of having raw literal syntax (talking about code size overhead).
This means that the warning will not trigger for "foo\"bar".

Differential Revision: https://developer.blender.org/D10322
2021-02-05 16:43:23 +01:00
5ec4ba8080 Cleanup: Use lambda instead of function bind
More detailed explanation why it is a preferred way of coding
nowadays can be found at

https://clang.llvm.org/extra/clang-tidy/checks/modernize-avoid-bind.html

Resolves modernize-avoid-bind Clang-Tidy warning.

Differential Revision: https://developer.blender.org/D10320
2021-02-05 16:43:23 +01:00
a0867f05a4 DNA: support structs with a size of 1 or 2 bytes.
Before the smallest possible dna struct size was 4 bytes.

Differential Revision: https://developer.blender.org/D10287
2021-02-05 16:24:46 +01:00
e8a5744cda Merge branch 'blender-v2.92-release' 2021-02-05 16:24:03 +01:00
a563775649 Fluid: Updated Mantaflow source files
This updates fixes the following issues (critical for 2.92):

- Issue that prevented dense 'int' grids from being exported (incorrect clip value)
- Issue with particles outside out of domain bounds (position between -1 and 0) not being deleted
2021-02-05 16:23:02 +01:00
66923031e6 Cleanup: Minimize seq->tmp usage
Using this persistent field in `select_more_less_seq__internal` was
inapropriate in this case.

Split select more/less and linked code, because it was mixed in
`select_more_less_seq__internal()`
These operators work in completely different way.
`select_linked_internal()` doesn't use seq->tmp at all.

`seq->tmp` was used to mask strips selected by operator while iterating.
Use GSet to store temporary data instead of `seq->tmp`.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D10326
2021-02-05 16:21:58 +01:00
16abe9343a Geometry Nodes: add Volume to Mesh node
This node takes a volume and generates a mesh on it's "surface".
The surface is defined by a threshold value.

Currently, the node only works on volumes generated by the
Points to Volume node. This limitation will be resolved soonish.

Ref T84605.

Differential Revision: https://developer.blender.org/D10243
2021-02-05 16:20:14 +01:00
46e0efb462 Geometry Nodes: support fixed pivot axis in Align Rotation to Vector node
When the pivot axis is not set to auto, the node will try to align the rotation
to vector as best as possible, given the selected rotation axis.

Ref T85211.

Differential Revision: https://developer.blender.org/D10292
2021-02-05 16:10:54 +01:00
56903024dc Cleanup: Use transparent functor
Resolves modernize-use-transparent-functors Clang-Tidy warning.

Differential Revision: https://developer.blender.org/D10323
2021-02-05 15:39:50 +01:00
Victor-Louis De Gusseme
4d39a0f8eb Geometry Nodes: Add Attribute Proximity Node
This node calculates a distance from each point to the closest position
on a target geometry, similar to the vertex weight proximity modifier.
Mapping the output distance to a different range can be done with an
attribute math node after this node.

A drop-down changes whether to calculate distances from points,
edges, or faces. In points mode, the node also calculates distances
from point cloud points.

Design task and use cases: T84842

Differential Revision: https://developer.blender.org/D10154
2021-02-05 08:28:31 -06:00
7054d03701 Cleanup: Clang-tidy modernize-use-default-member-init
Using assignment syntax as we don't use `{}` initialization yet.

Reviewed By: sergey
Differential Revision: https://developer.blender.org/D9501
2021-02-05 19:09:36 +05:30
be636f72dc Cleanup: Remove LibAV support
Ubuntu and Debian dropped libav in 2015 in favor of ffmpeg.
Development stopped of libav in 2018, so it should be save to remove.
2021-02-05 14:30:35 +01:00
6b4cd92e4d Merge branch 'blender-v2.92-release' 2021-02-05 13:07:14 +01:00
4212ea7b7d Fix T85260: Viewport render does not draw background
Regression introduced by {rBed809866b172} where overlays weren't drawn
when overlays are turned off. The background in wireframe, solid
(always) and material preview and render preview (when not using scene
world) are also part of the overlays.
2021-02-05 13:05:58 +01:00
8c0b0b7c96 Merge branch 'blender-v2.92-release' 2021-02-05 12:46:42 +01:00
0a546beb1f Fix T85396: Display Texture Paint UV only working in editmode
Caused by rBf83aa830cd00.

Since above commit, only meshes in editmode were considered for drawing
(because
BKE_view_layer_array_from_objects_in_edit_mode_unique_data_with_uvs was
used), but the option needs to work for texture paint mode as well, so
use BKE_view_layer_array_from_objects_in_mode_unique_data instead on
pass the draw_ctx->object_mode.

note: there is no good filter_fn to check if we have UVs if mesh is not
in editmode, this shouldnt cause much of a performance hit though.

Maniphest Tasks: T85396

Differential Revision: https://developer.blender.org/D10319
2021-02-05 12:43:00 +01:00
606805d1b7 Cleanup: use 'r_' prefix for return arguments, order last 2021-02-05 22:34:03 +11:00
f8cbd333d6 Cleanup: outdated/unhelpful comments 2021-02-05 22:33:27 +11:00
f21b4e69b0 Fix T82973: Strips overlap after transforming
When transforming multiple strips to limits of sequencer timeline they get
squashed into one channel.

Store selection minimum and maximum channel in TransSeq and limit
transformation so no strip can be transformed beyond timeline boundary.

Reviewed By: Sergey, mano-wii

Differential Revision: https://developer.blender.org/D10013
2021-02-05 10:40:35 +01:00
fa96aa5811 Fix missing preview images for actions when browsing in external files
When reading the preview images of external .blend files, action data-blocks
were not handled.
Preview support for actions was added in 2397ccc583.
2021-02-05 11:28:34 +01:00
db40d5ed97 Cleanup: Modernize type definition in Alembic
Use newer `using` semantic for type definition.
Solves modernize-use-using Clang-Tidy warning.
2021-02-05 11:04:28 +01:00
b6921506c9 Fix integer types in ImBuf leading to warnings
Replace `long long` with an explicit `int64_t`. This is also what is
used in the FFmpeg headers.

Fixes clang diagnostics warning about wrong format used in the log.

Should be no functional changes.
2021-02-05 10:58:44 +01:00
600625794d install_deps: Add libharu.
Old lib available as packages everywhere, easy. ;)
2021-02-05 09:41:35 +01:00
38420f19b6 Cleanup: rename USER_ZOOM_{CONT->CONTINUE} improve comments
USER_ZOOM_CONT only had comments saying this was 'oldstyle',
remove these comments, add brief explanations of the zoom style
in the enum.
2021-02-05 17:04:14 +11:00
f2bf5acd58 Keymap: use Shift-Tab to cycle backwards over edit-buttons
All modifiers were being checked, a hang-over from 2.4x
where this checked the modifier flag was non-zero.
2021-02-05 16:44:42 +11:00
d975e19583 Cleanup: correct spelling in code 2021-02-05 16:30:49 +11:00
17e1e2bfd8 Cleanup: correct spelling in comments 2021-02-05 16:23:34 +11:00
b62b923f54 Cleanup: replace inline loops with RNA_enum_from_identifier 2021-02-05 09:45:17 +11:00
7e850ffa73 Cleanup: cmake indentation, white-space 2021-02-05 09:45:16 +11:00
94cf74afbb Cleanup/refactor: Undosys: Get rid of the magic values for undo direction.
Move `eUndoStepDir` to `BKE_undo_system.h` and use its values
everywhere.

Note that this also introduce the `STEP_INVALID` value in that enum.

Finally, kept the matching struct members in some lower-level readfile
code as an `int` to avoid having to include `BKE_undo_system.h` in a lot
of unrelated files.
2021-02-04 22:03:39 +01:00
7d5640ee10 LibOverride: Improve/Fix issues in override resync process.
When we have a local override, its linked reference may not be detected
as needing to be overridden anymore.

In that case, if there is no actual override defined by the user, assume
that we can get rid of this local override as part of the resync
process, and use the linked data directly instead.
2021-02-04 19:23:10 +01:00
0f893656f4 Fix T85356: Dope Sheet not showing keyframes of Geometry Nodes graph
The animation filter wasn't following ID pointers to Node Trees yet.
2021-02-04 18:56:41 +01:00
2397ccc583 Animation: Add PreviewImage to bAction struct
Make it possible to attach a preview image to an Action.

In the #asset_browser_pose_libraries project, poses will be stored as
individual Action datablocks. Having a thumbnail for each pose is of
course essential.

Reviewed By: mont29

Differential Revision: https://developer.blender.org/D10306
2021-02-04 18:56:41 +01:00
e027d93ab0 Merge branch 'blender-v2.92-release' 2021-02-04 10:40:35 -07:00
7fb540b4cf Fix T85357: Setting collection color restricted to View Layer mode
Allow setting collection color in Scenes and Blender File outliner
display modes in addition to View Layer mode.
2021-02-04 10:38:44 -07:00
e7af04db07 Geometry Nodes: new Is Viewport node
This node outputs true when geometry nodes is currently evaluated
for the viewport and false for final renders.

Ref T85277.

Differential Revision: https://developer.blender.org/D10302
2021-02-04 16:36:34 +01:00
95703d19e0 Liboverride: clean-up/sanitize tagging of root overrides.
now do this in utils that also handle the hierarchy tagging, doing it in
caller code is prone to errors.

Issue reported by @sebbas, thanks.
2021-02-04 16:15:16 +01:00
07f7483296 LibOverride: Added log statements in liboverride operator functions
As discussed in D10301.

Reviewed By: mont29

Differential Revision: https://developer.blender.org/D10303
2021-02-04 15:11:42 +01:00
bd973dbc44 LibOverride: Only show relevant operators in outliner menu
No need to show certain operators when they have no functionality.

For example, when adding a library override from the outliner menu, there should only be an option to add one (i.e. reset, delete, resync operators not relevant for objects without library override).

Reviewed By: mont29

Differential Revision: https://developer.blender.org/D10301
2021-02-04 15:09:12 +01:00
4ef8033116 Merge branch 'blender-v2.92-release' 2021-02-04 10:50:43 -03:00
760a16b88b Fix for 3D view transform: flipped rotation direction for numeric input
The rotation direction was flipped recently.

This meant that rotation on a single axis gave negative results compared
with previous Blender releases.

This partially reverts a9b53daf23.

Differential Revision: https://developer.blender.org/D10299
2021-02-04 10:43:57 -03:00
Johannes Jakob
bec08621d6 Fix T85363: Cmd + Tab shortcut overridden on macOS
Adds an exception so that the key-binding `control + Tab` does not get
duplicated as `command + Tab` on macOS because this is a global system
shortcut for the app switcher.

The key-binding `command + Tab` was shown for the operators “Toggle
Graph Editor“ and “Toggle Dope Sheet” in Dope Sheet and Graph Editor,
but only `control + Tab` actually worked.

Differential Revision: https://developer.blender.org/D10304
2021-02-04 14:27:44 +01:00
3be5859b21 Cleanup: pass keymap items as const where possible 2021-02-04 22:21:10 +11:00
dff51d418a Fix: window manager can reference scenes and workspaces
This also fixes T83592 for me.

Differential Revision: https://developer.blender.org/D10046
2021-02-04 11:31:01 +01:00
4895d1f9ce Cleanup: replace '_imp' function suffix with '_impl'
Use the more common abbreviation for `implementation`.
2021-02-04 13:10:29 +11:00
54cb9e1d79 PyAPI: correct docstring 2021-02-04 13:10:29 +11:00
492e64c7bc UI: Win32 Child Windows On Top
Win32 child windows on top of parents. Short-term solution of forcing is_dialog when owned.

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

Reviewed by Brecht Van Lommel
2021-02-03 17:51:19 -08:00
261fa052ac UI: Win32 Window Creation Refactor
Simplification of Win32 GHOST_WindowWin32 with improved support for owned windows.

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

Reviewed by Brecht Van Lommel
2021-02-03 17:44:24 -08:00
Ankur Deria
1ad1ecf1c9 Fix T79822: Custom preset casing not preserved
When adding a new preset the name would be converted to lower case and
then displayed in the interface in title case. This was confusing
because the name didn't reflect what was typed, and there are many cases
when the name shouldn't be forced into title case (like 8K UHDTV for
example).

This commit leaves the custom preset names in the original casing, and
removes the conversion of filenames to title case for preset lists.

Differential Revision: https://developer.blender.org/D10224
2021-02-03 17:48:39 -07:00
01d49d1542 Presets: Cleanup preset naming
Before committing D10224, bundled preset names that are lowercase need
updating to title case for display in the UI. This changes several of
the preset file names to title case, and fixes a couple of other naming
issues in the preset names. A few strings in the code are also changed
to reflect the new filename of the Blender keymap.
2021-02-03 17:34:27 -07:00
d30320b4f5 Merge branch 'blender-v2.92-release' 2021-02-04 11:22:11 +11:00
3f90c11621 Fix T85318: Driver variable don't resolve collection indices
The driver variable `splines[0]` (on a curve)
behaved as if the path was `splines`.

Resolve pointers was well as properties as it's supported by the caller.

Error in original commit that added property support
82b0a9e369.
2021-02-04 11:19:09 +11:00
d85c5accec Cleanup: unused function warning 2021-02-04 10:01:19 +11:00
0352546cdd NLA: Fix nlasnapshot_blend() Misplaced Null Check
From original commit: rB40b7929cc040
2021-02-03 17:35:21 -05:00
Wayde Moss
40b7929cc0 NLA: Extract nlasnapshot_blend()
Refactor
//nlastrip_evaluate_actionclip()// and //nlaeval_blend_value()// into
//nlasnapshot_blend()//, //nlastrip_evaluate_actionclip()//,
//nlasnapshot_from_action()//.

**Motivations**:
* {T83615} Requires reading all pose bone fcurves before being able to
apply pre-blend transforms. The function //nlasnapshot_from_action()//
achieves this. This effectively removed the need to specially handle
Quaternion blend queuing so that code has been removed.

* {D8296} Adds support for keyframe remapping through an upper stack of
strips. Instead of introducing a variant of the form:
//nlastrip_evaluate_actionclip_inverted_get_lower()//,
//nlastrip_evaluate_actionclip()// will later be extended to take an
`evaluation_mode` as input to avoid duplicating the recursion functions
related to //nlastrip_evaluate()//.

* //nlasnapshot_blend()// will eventually have variants of
//nlasnapshot_blend_get_inverted_lower_snapshot()// and
//nlasnapshot_blend_get_inverted_upper_snapshot()// which are all
independent of NlaStrips and NlaTracks, further simplifying the
blending implementation. Ideally, //nlastrip_evaluate()// would get
renamed to //nlasnapshot_blend_strip()// but that'll be a later patch
to avoid unnecessary patches slowing the review of more important
patches.

No User-side Functional changes

Reviewed By: sybren, #animation_rigging

Differential Revision: https://developer.blender.org/D10220
2021-02-03 16:45:53 -05:00
Wayde Moss
264af1519e NLA: Fix Strip Truncate When Next to Transition
**Problem**:
Translating a strip will truncate it when next to a transition.

**Solution**:
The code only accounted for the prev/next strip for whether it exceeds.
When it was a transition, the exceed logic fails. Now, we use the
nearest non-transition strip instead.

Reviewed By: sybren, #animation_rigging

Differential Revision: https://developer.blender.org/D10083
2021-02-03 16:19:07 -05:00
70371299ae Merge branch 'blender-v2.92-release' 2021-02-03 21:06:56 +01:00
ebd2aa789e Fix T85230: Face Set Boundary automasking not working with dyntopo
Dyntopo does not have Face Sets implemented yet, so the entire mesh is
considered a single Face Set. In that case, the check unique face set
function should always return true.

Reviewed By: JacquesLucke

Maniphest Tasks: T85230

Differential Revision: https://developer.blender.org/D10259
2021-02-03 21:05:48 +01:00
0f238c5bcb Fix T85136: Sculpt geometry extract not using updated mesh
This ensured that the sculpt mode deformation is flushed to the mesh
datablock after leaving sculpt mode, so it can be duplicated and
extracted correctly.

Reviewed By: JacquesLucke

Maniphest Tasks: T85136

Differential Revision: https://developer.blender.org/D10254
2021-02-03 21:00:28 +01:00
1081eee4c5 Fix T84370: Project tool not working with shape keys
A missing flush of the deformed PBVH coordinates to the shape key.

Reviewed By: JacquesLucke

Maniphest Tasks: T84370

Differential Revision: https://developer.blender.org/D10174
2021-02-03 20:58:42 +01:00
Pablo Dobarro
7bde2844ae Fix memory leak in boundary brush preview data
The edge preview data of the boundary needs to be freed with the
boundary data created for the brush. Also, all data for the
ScultpSession preview that is used to render the cursor needs to be
freed with the ##SculptSession##.

Found by Jacques Lucke

Reviewed By: JacquesLucke

Differential Revision: https://developer.blender.org/D10173
2021-02-03 20:55:17 +01:00
fec6a4e24a Cleanup: don't end description with dot 2021-02-03 20:04:28 +01:00
55c88e5582 Alembic procedural: fix crash when cancelling a render during
synchronization
2021-02-03 19:15:49 +01:00
9734a78bc8 macOS: Fix build error due to std::optional<T>::value
Added in rBc5514d3a2a03242ddc43f83be4bb72df7f85469f
2021-02-03 23:30:10 +05:30
9d902d1b30 Merge branch 'blender-v2.92-release'
# Conflicts:
#	source/blender/editors/transform/transform_constraints.c
2021-02-03 14:57:06 -03:00
5eb5a7f4b7 Fix unreported: Rotation Gizmo "C" influenced by custom orientation
The white rotation Gizmo should always use the View orientation.

Before, if you set an orientation for the gizmo other than the default,
that gizmo would behave like the contraint Z Gizmo.
2021-02-03 14:54:58 -03:00
dcb2821292 macOS/GTest: Fix duplicate symbol errors with some generators
Don't force load _and_ link against a library in case
linker fails to deduplicate them.
https://devtalk.blender.org/t/macos-duplicate-symbol-errors/17343

Reviewed By: #platform_macos, brecht
Differential Revision: https://developer.blender.org/D10294
2021-02-03 23:20:27 +05:30
bbd74e9fd4 Fix T85340: Gizmo rotation inverted (in some perspective angles)
This is an old bug (strange not to have been reported before).

To define the direction of rotation, the View Vector is used.

However, only the projection matrix was being considered, but in
perspective mode, the position of the pivot also matters.
2021-02-03 14:48:17 -03:00
9042532085 Cleanup: Move and rename 'getViewVector' utility
This function is only being used by the constraint code.
2021-02-03 14:48:17 -03:00
8c7b78672e Fix 'getViewVector' returning inverted vector
Despite the wrong value, this change is harmless since the direction of
the vector is not really required.
2021-02-03 14:48:17 -03:00
46e66cecb3 install_deps: Update OSL to 1.11.10.
Good news is, this version support LLVM 11.

But it was a serious pain to get working, even ended having to add an
ugly hack to manually specify the OIIO include dir...

Ref: T83631.
2021-02-03 18:07:48 +01:00
Fabian Schempp
c5514d3a2a Geometry Nodes: Multi-Input Sockets
Normally sockets only have one input link. This commit adds the back-end
changes needed to use multiple input links per socket.

Multi-input sockets can be defined with a new flag in `bNodeSocketType`.
The changes necessary to make the sockets work in the geometry nodes
evaluator are generalizing input socket values as a vector of values,
and supporting this in the derived node tree structure.

This patch should contain no functional changes. Two upcoming patches
will use this system for the "Join Geometry" node and expose link picking
and updated display in the UI: D10069 and D10181.

Reviewed By: Jacques Lucke, Hans Goudey

Differential Revision: https://developer.blender.org/D10067
2021-02-03 11:03:00 -06:00
894cc9c915 Geometry Nodes: Add Collection Info Node
Implements a node to get collection objects.
These objects are then passed along as instances in the node tree.

Follow up tasks:
Multiple nodes does not support instancing yet: T85159
Changing collection offset does not trigger a refresh: T85274

Reviewed By: Jacques, Dalai, Hans

Differential Revision: http://developer.blender.org/D10151
2021-02-03 17:54:33 +01:00
Johannes Jakob
54a4eb5e17 UI: use system generated document icon on macOS
Adds Document Type Identifier configuration to use a system generated
document icon for Blender files on macOS. The system composites the
app’s icon and the extension name onto the document sheet icon
(new style on macOS 11 Big Sur and old style on macOS 10.15 Catalina
and earlier). This is in line with Apple’s Human Interface Guidelines.

Removes the previously used file icon because it is no longer needed.

Differential Revision: https://developer.blender.org/D10267
2021-02-03 17:14:46 +01:00
Yevgeny Makarov
e54f88f092 macOS: trackpad scroll direction reversed in list views
The 'ui_pan_to_scroll' uses 'WM_event_absolute_delta_y'. For scrolling the List View
we need to invert the direction to respect "natural scroll direction" system preferences.

Differential Revision: https://developer.blender.org/D10291
2021-02-03 17:13:27 +01:00
e49b702527 GL: Improve framebuffer error message by adding framebuffer name
Framebuffer error can be hard to track. This makes it much easier to
find the wrong framebuffer configuration.
2021-02-03 17:11:17 +01:00
f4f4495586 install_deps: OIIO: tweak to max version, and cleanup compile code.
OSL 1.10.10 does not build with OIIO 2.2.10.
2021-02-03 16:04:18 +01:00
8e98983945 install_deps: Upgrade Alembic to 1.17.16.
See T83246.
2021-02-03 16:04:18 +01:00
1a1aa5392d install_deps: Update Boost to 1.73.
See T83246.
2021-02-03 16:04:18 +01:00
3200a135be install_deps: update Python to 3.9.1, numpy to 1.19.5.
See T83246.
2021-02-03 16:04:18 +01:00
2b18c41c4d Merge branch 'blender-v2.92-release' 2021-02-03 15:53:55 +01:00
85fe12071a Fix T85261: Eevee passes have slight inaccurate colors
In everything in `EEVEE_renderpasses_postprocess` (or the corresponding
renderpass_postprocess_frag.glsl) colors get divided by a
'currentSample'.

This 'currentSample' is always incremented in
`EEVEE_temporal_sampling_draw` (and also one more time before we reach
`EEVEE_renderpasses_postprocess`.
This results in a "off-by-one", slightly inacurate colors and slight
inaccurate transparency (in certain passes like AOVs).

Now decrement the currentSample `EEVEE_renderpasses_postprocess` again
by one to compensate.

Maniphest Tasks: T85261

Differential Revision: https://developer.blender.org/D10286
2021-02-03 15:50:17 +01:00
3a446f2d9f Merge branch 'blender-v2.92-release' 2021-02-03 15:30:15 +01:00
487fe5abfc Cryptomatte: Incorrect Coverage with Volumetrics
Related to {D10286}. When volumetrics are used in the scene the coverage
is incorrect. The reason is that the current sample is 1 over the num
samples that are calculated.
2021-02-03 15:30:03 +01:00
10e3b2dc8e Cryptomatte: Incorrect Coverage with Volumetrics
Related to {D10286}. When volumetrics are used in the scene the coverage
is incorrect. The reason is that the current sample is 1 over the num
samples that are calculated.
2021-02-03 15:27:52 +01:00
e1f38b2169 Fix incorrect mesh selection duplication in internal utility function
`BKE_mesh_new_nomain_from_template_ex()` would duplicate the mesh selection
storage of the destination mesh to the destination mesh. Since that mesh was
default initialized at this point, the selection was `NULL`, so the duplication
call is essentially a no-op.

Mistake in 7efc75c709.

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

Reviewed by: Sybren Stüvel
2021-02-03 15:09:06 +01:00
e69217b283 UI: Improve tooltip for continuous grab
Attempt to explain the feature better follow a better writing style.
2021-02-03 15:07:37 +01:00
c9d6737e3e BKE UndoSys refactor: deduplicate and simplify code, sanitize naming.
Now we only use 'undo' or 'redo' in function names when the direction is
clear (and we assert about it). Otherwise, use 'load' instead.

When passing an undo step to BKE functions, consider calling code has
done its work and is actually passing the target step (i.e. the final
step intended to be loaded), instead of assuming we have to load the
step before/after it.

Also deduplicate and simplify a lot of core undo code in BKE, now
`BKE_undosys_step_load_data_ex` is the only place where all the complex
logic of undo/redo loop (to handle several steps in a row) is placed. We also
only use a single loop there, instead of the two existing ones in
previous code.

Note that here we consider that when we are loading the current active
step, we are undoing. This makes sense in that doing so //may// undo
some changes (ideally it should never do so), but should never, ever
redo anything.

`BKE_undosys_step_load_from_index` also gets heavily simplified, it's
not basically a shallow wrapper around
`BKE_undosys_step_load_from_index`.

And some general update of variable names, commenting, etc.

Part of T83806.

Differential Revision: https://developer.blender.org/D10227
2021-02-03 11:11:12 +01:00
4884153823 BPY: allow bpy.data.libraries.load() to filter out non-asset data-blocks.
Differential Revision: https://developer.blender.org/D10237
2021-02-03 09:53:56 +01:00
2ce1400297 Merge branch 'blender-v2.92-release' 2021-02-03 00:17:52 +01:00
0fc456f091 Fix T85314 GPU: Drawlist submit data overflows.
This was caused by an incorrect bound check. Since we now use different
data type for indexed and non-indexed drawcalls, we need to check if the
next drawcall is going to overflow the buffer.
2021-02-03 00:15:52 +01:00
78ff852680 Force Fields: implement early filtering by the Affect flags.
Most fields have Affect Location and Rotation options that switch
off their effect, but they are only checked as the last step after
the force is already computed. It is more efficient to check it
when building the list of field objects, just like zero weight.
It is also possible to check the strength-related fields for 0.

As an aside, this adds Location to Texture fields (they don't
handle rotation) and both Location & Rotation checkboxes to
Fluid Flow. Boid and Curve Guide remain without options for
now as they are completely different from others.

Differential Revision: https://developer.blender.org/D10087
2021-02-02 23:03:16 +03:00
64a963486f Merge branch 'blender-v2.92-release' 2021-02-02 20:42:54 +01:00
Robert Guetzkow
4a80c0e275 Fix T85225: Variable scope in ridged multi-fractal noise
This patch fixes a bug introduced in
rB74188e65028d268af887ab2140e4253087410c1e.
The commit incorrectly moved the declaration and intialization of the
variable `pwr` inside the loop. Since the value was originally modified
in each iteration based on it's previous value and `pwHL` through
`pwr *= pwHL`, this change in scope was wrong. It resetted the value in
each iteration. This patch moves the declaration of `pwr` outside the
loop again.

Reviewed By: JacquesLucke

Differential Revision: https://developer.blender.org/D10258
2021-02-02 20:37:28 +01:00
f2781e1c7c Fix for T82459 - Input Language Independent of Display Language
Allow OS input language to initiate IME, regardless of Blender output language.

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

Reviewed by Julian Eisel
2021-02-02 10:58:02 -08:00
b3f9895ab0 Fix build error on windows after recent commit
rB198ff4703f84d0c3267 neglected to remove designated initializers,
which are not supported in the C++ 17 standard.
2021-02-02 11:26:17 -06:00
1a5b988509 Merge branch 'blender-v2.92-release' 2021-02-02 17:51:18 +01:00
8c36f6becf Fix T84649: Quick liquid causing crash on scale operation
This commit makes use of the updated fluid sources files (previous commit rB9ad828dbad94d279521875db47a3472a38cc9b29)
2021-02-02 17:50:08 +01:00
9ad828dbad Fluid: Updated Mantaflow source files
Includes improvements for the file IO. Namely, more meta data will be written from now on.

This change is required to prevent IO issues (e.g. T84649) that arised through the use of sparse grids caching (introduced in 2.92).
2021-02-02 17:46:48 +01:00
4ff5051ffc BKE BMain relations: add utils to (re)set tags of the entries. 2021-02-02 17:26:59 +01:00
2262e18269 Cleanup: LibOverride: group logically utils static functions. 2021-02-02 17:26:59 +01:00
198ff4703f Blenkernel: Move node.c to C++
Required changes to compile `node.cc` with clang tidy:
* Use c++ includes like (e.g. climits instead limits.h).
* Insert type casts when casting from `void *`.
* Replace `NULL` with `nullptr`.
* Replace typedef statements.

This change is in order to use the `blender::Map` data structure
for node error messages.
2021-02-02 09:51:38 -06:00
d0aa7d5562 Merge branch 'blender-v2.92-release' 2021-02-02 16:47:21 +01:00
f8359b5f52 Fix freestyle render pass not being created when there are no strokes
It could lead to missing images when outputing the pass to an image
sequence.
2021-02-02 16:45:23 +01:00
326102f498 Merge branch 'blender-v2.92-release' 2021-02-02 08:26:21 -07:00
56bccd2395 Fix T83450: Missing 4th studio light in preview icon
Due to an off-by-one error the generated studio light icons did not show
the influence of the 4th light. This fix changes the loop to iterate
over all of the lights when computing the lighting.

Differential Revision: https://developer.blender.org/D10283
2021-02-02 08:23:13 -07:00
b7865f77c3 Merge branch 'blender-v2.92-release' 2021-02-02 09:21:14 -06:00
a1c7cab06c Fix T85155: Vertex groups from object don't transfer to next nodes modifier
Because the the vertex group name-to-index map is stored in the object
rather than object data, the object info node has to replace the
map when it replaces the mesh component on the geometry set with mesh
data from another object.

This normally works fine as a way to use the vertex groups from the
input mesh, but when passing this mesh to the next modifier, the entire
mesh component was replaced, removing the vertex group name map.

This commit adds a function to replace only the mesh data in mesh
component, uses it in the modifier code, and updates the relevant
comments.

Note that the fact that vertex group names are stored in object data
is a legacy design decision that should be reevaluated at some point.

Differential Revision: https://developer.blender.org/D10256
2021-02-02 09:20:54 -06:00
ed00f7c65e Merge branch 'blender-v2.92-release' 2021-02-02 15:34:39 +01:00
9e0c876aad Fix T85301: Eevee does not respect collection instance offset for hair
This resulted in hair drawing with an offset if an instance_offset was
set.

note: Usually the instance_offset gets combined with the objects obmat
in 'make_duplis_collection' / 'make_dupli', see
> /* Combine collection offset and `obmat`. */
Using the resulting DupliObject->mat instead does include the
instance_offset, but this results in double-transforms (something that I
have not investigated further), so now reconstruct the correct matrix
from scratch.

Maniphest Tasks: T85301

Differential Revision: https://developer.blender.org/D10285
2021-02-02 15:32:35 +01:00
Miguel Pozo
1428544528 Python API: option for render engines to delegate Freestyle render to Eevee
Eevee is now used for Freestyle rendering by default, since other engines are
unlikely to have support for this. Workbench and Cycles do their own rendering.

RenderEngine add-ons can do their own Freestyle rendering by setting
bl_use_custom_freestyle = True.

Differential Revision: https://developer.blender.org/D8335
2021-02-02 14:19:04 +01:00
e3c8363ce0 Fix T83064: Missing tooltips, caused by string property search button
When a searchbox-button for string properties (e.g. to reference a vertex
group) was created, and a value was set, the tooltip timer would constantly get
cancelled.
That was because the code to validate the current value
(`ui_but_search_refresh()` - early exists for non-string properties) would call
a helper function to update the search results (`ui_searchbox_update_fn()`),
which always reset tooltips. Resetting them in the helper makes sense, for as
long as the searchbox is open. But while it's not, and we just validate the
current value, it shouldn't do this.

This was also noticable in the output settings of dynamic paint, and probably a
number of other cases (especially with script UIs which tend to use string
properties more often).

Likely caused by de53c039ad.
2021-02-02 13:54:18 +01:00
f3a2434bb6 Cleanup: Use bool instead of int 2021-02-02 13:54:18 +01:00
fed191fd89 Cleanup: take grid reference instead of shared pointer as parameter
This makes the function usable in more contexts.
2021-02-02 13:17:51 +01:00
Brecht Van Lommel
886486615b macOS: use precompiled libraries for arm64 build
Standard wiki build instructions for building Blender on macOS can now be used
on Macs with ARM processors.

This contains all libraries except for Embree and OpenImageDenoise, so Cycles
performance does not yet have full performance and features in this build. An
x86-64 build is likely to still render faster than arm64 until Embree is added.

Uses the new lib/darwin_arm64 folder. For simplicity and to keep download size
under control, both for end users and builders, we are not planning to ship
universal binaries. So this is a separate folder from lib/darwin.

Ref T78710

Differential Revision: https://developer.blender.org/D10276
2021-02-02 12:08:23 +01:00
62419975b7 macOS: fix warning about unkown GPU with Apple M1 chip 2021-02-02 12:08:23 +01:00
d19aaad0bc Fix regression: Crash garbage collecting VBOs on never evaluated scenes
Committing fix again, since it is somehow got lost when merging release
branch into master.
2021-02-02 11:10:56 +01:00
356c62fe32 Merge branch 'blender-v2.92-release' 2021-02-02 19:36:18 +11:00
1d77302fd9 creator: add missing '--debug-*' arguments under debugging options
Only print "Other Options" when the heading has content to show.
2021-02-02 19:34:47 +11:00
bde797c172 Merge branch 'blender-v2.92-release' 2021-02-02 09:33:05 +01:00
d917d7cf94 Fix T85194: Smart UV does not respect "Correct Aspect" correctly
This lead to wrong, stretched UVs regardless of the ON/OFF state of
"Correct Aspect" option (some code in the operator respected this
setting properly, whereas it was hardcoded in another part).

Before rB9296ba867462, `uvedit_pack_islands_multi` was always called
with `correct_aspect` = false for the UnwrapOptions.
After rB9296ba867462, `ED_uvedit_pack_islands_multi` was always called
with `correct_aspect` = true for the UVPackIsland_Params.

Both seem wrong [in that they do not take the operator setting into
account]. Now respect that setting [same as the following
`uv_map_clip_correct_multi` does as well btw.]

Now results match 2.90 [where this was still python] perfectly.

Maniphest Tasks: T85194

Differential Revision: https://developer.blender.org/D10246
2021-02-02 09:30:58 +01:00
1422c28ef1 Merge branch 'blender-v2.92-release' 2021-02-02 19:18:20 +11:00
3ae74bcd29 cmake/deps: remove 'tcl' language support from sqlite
Build sqlite without `tcl` support, as it's causes an error on
installation when `tcl` is installed into the systems `/usr/lib/` and
install isn't running as root.

This could be resolves by adding `tcl` as a dependency
however it's not needed for Python's sqlite integration.

Linux distributions (Debian & Arch at least) split this off
into a separate package (which Python doesn't depend on),
so there is no need for Blender to include sqlite's `tcl`
integration either.

Reviewed By: brecht, LazyDodo

Ref D10281
2021-02-02 19:12:45 +11:00
33b8063b1f CMake: Remove duplicated code for Haru-TIFF dependency. 2021-02-02 02:15:40 +05:30
038d72752d CMake/Windows: Fix build issue in lite+haru
Haru depends on some symbols defined in libtiff
which will cause linker errors if not enabled.
Disable haru if WITH_IMAGE_TIFF is off.
2021-02-01 11:35:23 -07:00
59054d906f CMake/Windows/macOS: Add Libharu
Decision: https://lists.blender.org/pipermail/bf-committers/2020-December/050836.html
Adds CMake dependency builder support. Tested on
macOS and Windows (Thanks @LazyDodo).

Reviewed By: #platform_macos, LazyDodo, sebbas
Maniphest Task: T84836
Differential Revision: https://developer.blender.org/D9928
2021-02-01 21:58:57 +05:30
84dddf641e Merge branch 'blender-v2.92-release' 2021-02-01 16:40:43 +01:00
d5d8655ca1 Fix T81843 Bones invisible using Weight Paint + Wireframe shading + Bone X-Ray
This was caused by the paint overlay drawing after the infront pass.

Moving the paint overlay before it fixes the issue. We might even do
that for more mode overlays.
2021-02-01 16:40:23 +01:00
bc41aaaaaa Overlay: Fix Z axis planes rendered even if not needed
This remove some drawn completely transparent pixels.
2021-02-01 16:40:23 +01:00
5ec9e3a26e Merge branch 'blender-v2.92-release' 2021-02-01 16:27:42 +01:00
006e70dbd7 Fix T85203: GPencil: Drawing on locked axis plane
Drawing on e.g. the X-Z plane was broken due to an earlier
commit (rBef28da262342). This was causing the projection when drawing
on an axis plane to fail.

The fix checks that the user is in view plane projection mode.

Reviewed By: antoniov

Maniphest Tasks: T85203

Differential Revision: https://developer.blender.org/D10252
2021-02-01 16:26:31 +01:00
82e2d70024 Merge branch 'blender-v2.92-release' 2021-02-01 15:20:01 +01:00
a69983f30e Fix T85229: Transform operator saving a different orientation than the chosen one
Some orientations are not possible to be calculated for certain scenes.

In these cases, others are chosen and informed by the operator.

However, the user may prefer that the chosen one be displayed (even if it
is not actually used).

This corresponds to older versions of Blender.
2021-02-01 11:16:58 -03:00
c02f2d7371 Fix T81177 EEVEE: Missing shadow if last material has no shadow
This was caused by the boolean not being a union of all the material
slots.
2021-02-01 14:54:08 +01:00
9e9ebaba8d Fix crash when creating lib overrides.
Own mistake in recent commit rB2a81d948ad00c50.
2021-02-01 14:09:49 +01:00
88d9eb14d1 Merge branch 'blender-v2.92-release' 2021-02-01 14:01:33 +01:00
d1ee8a0502 DRW: Fix render wrong orthographic depth conversion
Fix for both workbench and Gpencil.

Fixes T78574 GPencil: Z pass combine not work
2021-02-01 14:00:08 +01:00
f04ddd398f Merge branch 'blender-v2.92-release' 2021-02-01 13:41:21 +01:00
03c1c5f3a4 GPU: Fix performance regression on AMD GPU
This was caused by a missing check left over during the GL isolation.

Fix T84277 Solid and Wireframe viewport performance hit on AMD Radeon GPUs
2021-02-01 13:41:07 +01:00
5c72a4d452 Fix T84780: Corrupt screen layout when loading file with area full-screen
This could happen with files saved before ef4aa42ea4, so before global areas
were written to .blend files.
We would just always add the top- and status-bar, even though the screen wasn't
supposed to have them. I'm not entirely sure what caused the further issues
observed there, most code should probably handle the case fine still. But
apparently something didn't.

Steps to reproduce were:
* Open Blender from before ef4aa42ea4 (e.g 2.91 release)
* In 3D View, View > Area > Toggle Fullscreen Area
* Save the file
* Open the saved file (can be in newer version too)
The fullscreen is corrupt now, especially noticable after duplicating the
workspace.
2021-02-01 12:48:05 +01:00
fa2ffb1a2f Merge branch 'blender-v2.92-release' 2021-02-01 12:01:23 +01:00
5e117b1226 Usual UI messages fix... 2021-02-01 12:00:32 +01:00
f4cb93b55d Merge branch 'blender-v2.92-release' 2021-02-01 11:03:13 +01:00
d857892553 VSE: Fix proxy images have incorrect size
This bug happens when media size doesn't match scene size and proxies
are enabled. This is because some strips are rendered in preview size
already -  effects, mask or strips using proxies.
If strip input is prescaled it needs to be known when transforming
images, which does also scaling to preview size as one operation.

whether image needs prescaling is defined in function
`seq_need_scale_to_render_size()`

Problem was introduced in 5713626422. Previously all images were
scaled to fit into preview, and this was considered as baseline for
further image transformation.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D10183
2021-02-01 11:02:25 +01:00
e94c38e005 Merge branch 'blender-v2.92-release' 2021-02-01 11:01:29 +01:00
54ac63f06b Fix T85252: Gpencil interpolate sequence crash in new scenes
The value of the step was not initializated for new scenes.
2021-02-01 11:00:50 +01:00
1e55d28a4e Fix T85035: Gpencil render in background render wrong frame
Due a thread priority, the calculation of the current frame is not done before the frames are available. This produces wrong render frames.

The solution is verify the current frame before doing the real render. This adds only a few milliseconds, but it assures the frame is correct.

As the problem is only when render in background, the recalculation of the frame is only necessary when do real render and not a viewport render, so there is no impact in the animation FPS.
2021-02-01 10:27:03 +01:00
9c244820d1 Merge branch 'blender-v2.92-release' 2021-02-01 10:00:45 +01:00
30ac21bf33 Fix regression: Crash garbage collecting VBOs on never evaluated scenes
Introduced in rB087777f2b9b8.

Fixes issues with scene from T82808.
2021-02-01 09:59:09 +01:00
b10fac0432 Docs: Remove wrong debug flag info
Removed the `--debug-gpu-shaders` argument in bc94036a76 but forgot to amend
these changes.
2021-01-31 15:53:09 +01:00
d4aa5b2166 Merge branch 'blender-v2.92-release'
# Conflicts:
#	source/blender/editors/transform/transform_constraints.c
2021-01-31 10:36:01 -03:00
a9b53daf23 Fix T83092: Direction of rotation with View orientation changed in 2.91
This solution replaces {rBf9e994d0f463}.

That commit created an inverted orientation matrix but the 'Align to
Transform Orientation' operator doesn't work well with inverted matrices.

This new solution makes the rotate operator use the negative vector of the
axis.
2021-01-31 10:31:15 -03:00
c828a505c2 Revert "Fix T83092: Direction of rotation with View orientation changed in 2.91"
This reverts commit f9e994d0f4.
And fixes T85227.

That commit created an inverted orientation matrix but the 'Align to
Transform Orientation' operator doesn't work well with inverted matrices.
2021-01-31 10:30:02 -03:00
419c67c851 Fix error in recent commit
Unused argument in rB216ebe0b7392d6
2021-01-31 10:26:54 -03:00
a80c0ee167 Revert "Cleanup: remove unused argument"
This reverts commit 780857f8e8.

The `axismtx` argument was supposed to be used.
2021-01-31 10:26:36 -03:00
194f6c7880 Merge branch 'blender-v2.92-release' 2021-01-31 19:45:15 +11:00
fecce5dc09 Fix T85236: "Zoom to Mouse Position" inverts "Dolly View" direction 2021-01-31 19:44:01 +11:00
088fbc0286 Cleanup: remove unused BMesh.currentop struct member 2021-01-31 18:20:12 +11:00
e6a5e548d5 Cleanup: correct and update comments for bmesh walkers
- Correct variable names which were missed when refactoring.
- Use full sentences.
2021-01-31 17:42:42 +11:00
6b8f28a6b5 Cleanup: use doxygen for transform_constraints 2021-01-31 17:23:46 +11:00
1939911c54 Merge branch 'blender-v2.92-release' 2021-01-31 17:16:16 +11:00
780857f8e8 Cleanup: remove unused argument 2021-01-31 17:15:58 +11:00
cdf01f7750 Cleanup: use switch for Add Object Tool event handling 2021-01-31 17:05:12 +11:00
2e84edea97 Add Object Tool: make automatic axis selection an option
While useful in some cases, this meant it wasn't possible to use the
"Floor" for object placement without looking top-down or bottom up.
2021-01-31 17:05:12 +11:00
ae3fee3f47 Merge branch 'blender-v2.92-release' 2021-01-30 21:54:10 -07:00
7a64e93761 Fix T79797: Compositor backdrop gizmo not updating after zoom
The gizmo for the compositor backdrop image did not redraw when zooming
in and out with the backimage_zoom operator. This adds the missing
notifier.
2021-01-30 21:49:56 -07:00
016bd284fb Fix T84465 Bevel Percent and Absolute when limit type is Weight.
The previous fix to the width modes Percent and Absolute did
not take into account that with limit mode Weight, the amount
needs to be scaled by the bevel weight of the beveled edge in
question. (Sometimes there are two beveled edges in question,
in which case an average is used.)
2021-01-30 15:58:08 -05:00
40061911d2 Fix T84465 Bevel Percent and Absolute when limit type is Weight.
The previous fix to the width modes Percent and Absolute did
not take into account that with limit mode Weight, the amount
needs to be scaled by the bevel weight of the beveled edge in
question. (Sometimes there are two beveled edges in question,
in which case an average is used.)
2021-01-30 15:50:58 -05:00
38bb263422 Fix T81193 EEVEE: Crash when motion blur is aborted at cache finish
This was caused by a use after free. The issue was that the motion steps
were successfully gathered but failling the last vertex count check,
discarding the copied VBOs but not removing the reference of the first
VBO which was passing the test.
2021-01-30 16:56:38 +01:00
216ebe0b73 Fix T83092: Direction of rotation with View orientation changed in 2.91
This solution replaces {rBf9e994d0f463}.

That commit created an inverted orientation matrix but the 'Align to
Transform Orientation' operator doesn't work well with inverted matrices.

This new solution makes the rotate operator use the negative vector of the
axis.
2021-01-30 12:55:07 -03:00
acc662ea5a Revert "Fix T83092: Direction of rotation with View orientation changed in 2.91"
This reverts commit f9e994d0f4.
And fixes T85227.

That commit created an inverted orientation matrix but the 'Align to
Transform Orientation' operator doesn't work well with inverted matrices.
2021-01-30 12:51:03 -03:00
3a954af862 EEVEE: Fix crash when using animated visibility with motion blur steps
This was caused by the same VBO being remapped twice by
`EEVEE_motion_blur_cache_finish`. Leading to memory corruption.
2021-01-30 16:35:52 +01:00
036b65d778 Fix T85149: Wrong reroute position when adding with quick gesture
In the operation of adding reroute node to the intersection with the
gesture segment, each rerount was added to the middle of two points that
are part of the segment.

Now add the reroute point to the intersection position.

Maniphest Tasks: T85149

Differential Revision: https://developer.blender.org/D10247
2021-01-30 10:46:05 -03:00
d0f59d3842 Fix T85144: Cycles crashes when editing render properties in viewport
rendering

Issue was caused by the sample pattern LUT always being freed and not
rebuilt when properties driving its dimensions were modified.
2021-01-29 17:35:28 +01:00
171f2e4949 Merge branch 'blender-v2.92-release' 2021-01-29 17:09:58 +01:00
Michael Möller
5d215d5225 EEVEE: Fix GPUNodeLink memory leak for displacement nodes using SHD_SPACE_WORLD
When the displacement space is set to SHD_SPACE_WORLD, the GLSL method
"node_displacement_world" is used instead of the "node_displacement_object" method. The two GLSL methods:
```
void node_displacement_object(
    float height, float midlevel, float scale, vec3 N, mat4 obmat, out vec3 result)
{
  N = (vec4(N, 0.0) * obmat).xyz;
  result = (height - midlevel) * scale * normalize(N);
  result = (obmat * vec4(result, 0.0)).xyz;
}

void node_displacement_world(float height, float midlevel, float scale, vec3 N, out vec3 result)
{
  result = (height - midlevel) * scale * normalize(N);
}
```
In contrast to the "node_displacement_object" method, the "node_displacement_world"
does not require an "obmat" parameter. Attempting to still pass "GPU_builtin(GPU_OBJECT_MATRIX)"
as additional parameter will result in a memory leak. The "GPUNodeLink" allocated in
the "GPU_builtin" method will never get released.

Fixes T83941 Memory leak when using the Displacement shader node in Eevee with the displacement
space set to "World Space"
2021-01-29 17:08:46 +01:00
c7d75a6616 Merge branch 'blender-v2.92-release' 2021-01-29 16:06:11 +01:00
b3fc885544 Depsgraph: Remove redundant copy-on-write operations
This change removes copy-on-write operations from ID nodes which do not
need copy-on-write.

Should be no functional changes, as before the copy-on-write operation
would do nothing for those nodes anyway.
2021-01-29 15:52:53 +01:00
876fd40643 Fix T83411: Crash when using a workspace/layout data path in a driver
Building IDs which are not covered by copy-on-write process was not
implemented, which was causing parameters block not present, and, hence
causing crashes in areas which expected parameters to present.

First part of this change is related on making it so Copy-on-Write is
optional for ID nodes in the dependency graph.

Second part is related on using a generic builder for all ID types
which were not covered by Copy-on-Write before.

The final part is related on making it so build_id() is properly
handling ParticleSettings and Grease Pencil Data. Before they were not
covered there at all, and they need special handling because they do
have own build functions.

Not sure it worth trying to split those parts, as they are related to
each other and are not really possible to be tested standalone. Open
for a second opinion though.

Possible nut-tightening is to re-organize build_id() function so
that every branch does return and have an assert at the end, so that
missing ID type in the switch statement is easier to spot even when
using compilers which do not report missing switch cases.

As for question "why not use default" the answer is: to make it more
explicit and clear what is a decision when adding new ID types. We do
not want to quietly fall-back to a non-copy-on-write case for a newly
added ID types.

Differential Revision: https://developer.blender.org/D10075
2021-01-29 15:52:53 +01:00
0e37d3efc0 Fix T84717: missing 3D viewport updates when changing shading settings
Previously this relied on the dependency graph to detect changes in the screen
datablock, which would then notify the renderers. This was rather indirect an
not even really by design. Instead use notifiers to tag specific 3D viewports
to be updated.

Includes changes to BKE_scene_get_depsgraph to accept a const Scene pointer.

Testing if this works correctly requires adding back commits 81d444c and 088904d,
since those have been temporarily reverted.

Differential Revision: https://developer.blender.org/D10235
2021-01-29 15:52:53 +01:00
087777f2b9 Cleanup: accept const pointer for BKE_scene_get_depsgraph 2021-01-29 15:52:53 +01:00
cacc1d723c Fix T81169: Grease Pencil Z-depth drawing issue on OSX + AMD Graphic Cards
The grease pencil merge depth shader is designed to only work correctly
in octographic mode. The uv coordinates used `noperspective` attribute.
Somehow this doesn't lead to render artifacts on most platforms and was
only detected on OSX + AMD cards.

This fix would calculate the uv coordinate inside the fragment shader
and isn't passed along from the vertex shader.

Thanks to Sebastián Barschkis for providing the hardware and time and
Clément Foucault for helping out with the final fix.
2021-01-29 15:19:01 +01:00
bc94036a76 GPU: Remove unused GPU debugging command line options
Removes two unused --debug-gpu command line flags (unused as in, does nothing):
* `--debug-gpumem`: Unused since c08d847488, the info is now available in
  the status-bar if enabled in the Preferences. Initially added in
  fec317de8d.
* `--debug-gpu-shaders`: Unused since 216d78687d, double checked with
  Clément, he says it's not that useful nowadays. Initially added in
  fec317de8d.

Addresses T83954 and T83953.

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

Reviewed by: Clément Foucault
2021-01-29 14:17:49 +01:00
75e8e01124 Fix wrong command line argument description for --debug--gpu-force-workarounds
Was using the same description as `--debug-gpumem`.

`--debug-gpu-shaders` actually has the same issue, but will be removed in the
next commit.
2021-01-29 14:13:30 +01:00
b2e00e8f8e Merge branch 'blender-v2.92-release' 2021-01-29 13:35:21 +01:00
9f89166b52 Fix T85148: OptiX viewport denoising regression
Commit 6e74a8b69f changed the denoiser input passes default to
include the normal pass. This does not always produce optimal images though, hence why the
default was previously set to only include the color and albedo passes. This restores that behavior, so
that viewport denoising with OptiX produces the same results as before.
2021-01-29 13:35:00 +01:00
b8feac9c81 Merge branch 'blender-v2.92-release' 2021-01-29 13:16:41 +01:00
Robert Guetzkow
821df20797 Fix T84588: Set parameter as required for uv_on_emitter
This commit fixes T84588's second issue. The `particle` parameter was
declared optional in the Python API of `bpy.types.ParticleSystem.uv_on_emitter`
due to a typo in the RNA definition. This commit marks it as required.

Reviewed By: JacquesLucke

Differential Revision: https://developer.blender.org/D10127
2021-01-29 13:10:54 +01:00
02bb3595d0 Merge branch 'blender-v2.92-release' 2021-01-29 12:58:39 +01:00
1b32679284 Fix T85169: UV scale gizmo swaps X/Y
Introduced with swapped axis in rB0d67eb277f9b.
Similar was fixed for the translate gizmo in rB567212c3434a.
Now do the same for scaling as well.

Maniphest Tasks: T85169

Differential Revision: https://developer.blender.org/D10245
2021-01-29 12:56:08 +01:00
bc794109db Merge branch 'blender-v2.92-release' 2021-01-29 22:31:24 +11:00
cf91fb347d Fix T85178: edit-mesh show_edges overlay option toggles face-dots
When this behavior was added it made sense,
since then show_edges has changed to make edge-display more subtle
(see 1a4b60c30d) instead of removing
edge-selection display entirely.
2021-01-29 22:30:02 +11:00
954af8c182 Geometry Nodes: missing null check for volume objects
The problem was found by Dalai in T84606.
2021-01-29 11:44:30 +01:00
b62e98d4e2 Merge branch 'blender-v2.92-release' 2021-01-29 11:38:33 +01:00
6f88053d85 Fix T84661: read jpg pixel density
For jpeg, an image.resolution was always based on the default 72dpi, now
read the pixel density from the jpeg_decompress_struct, convert
according to unit and store in IMBuf's ppm.

Not 100% sure of all implications tbh., files I have checked seem to work
as expected now in the context of the report.

Maniphest Tasks: T84661

Differential Revision: https://developer.blender.org/D10166
2021-01-29 11:07:58 +01:00
45d952e045 Merge branch 'blender-v2.92-release' 2021-01-29 10:21:17 +01:00
3fb5e83867 Fix T85139: Force field texture missing depsgraph relation
If a force field was of type "Texture", any changes of that texture (e.g.
its type - as reported in T85139 - or also its properties) were not
properly updating rigid bodies and particle systems.

Now ensure that texture is actually in the depsgraph and set up relation
accordingly.

Also fixes T75198.

Maniphest Tasks: T85139

Differential Revision: https://developer.blender.org/D10234
2021-01-29 10:18:53 +01:00
27e2c5ab78 Tests, docs: Use sanitizer options from environment too.
Don't overwrite environment variables that may
contain options like suppression files, symboliser etc.
It's similar to rBa181b156399a13fa429159112e30c8005d5e8a59
and rBA589d13408a60cbec34a8bc3cc798c586043743ae .
For Blender Add-ons repo, see the equivalent in D9816.

Reviewed By: Blendify
Differential Revision: https://developer.blender.org/D9815
2021-01-29 14:13:26 +05:30
16fab8ebc4 Cleanup: git-blame-ignore-revs: Update policy & commits
Discussion:
https://lists.blender.org/pipermail/bf-committers/2020-December/thread.html#50844

*Remove clang-tidy commits altogether as they have a history of
introducing bugs/ build issues.
*Remove renames.

Reviewed By: brecht
Differential Revision: https://developer.blender.org/D9986
2021-01-29 13:20:32 +05:30
ca4ac742f4 UI: clarify edit-mesh face center behavior
- Grey out in wire/xray display.
- Expand the description for when this is used.

While this is working, the intended behavior wasn't clear,
address T85177.
2021-01-29 16:41:15 +11:00
93706de594 Docs: notes on the 2.7x keymap
Note the key-map items that don't match the original 2.7x key-map,
since some of these are quite obscure.
2021-01-29 16:00:23 +11:00
cba5d38256 Merge branch 'blender-v2.92-release' 2021-01-29 11:44:13 +11:00
3e5091bb21 Merge branch 'blender-v2.92-release' 2021-01-29 11:44:08 +11:00
b2ce1b0758 Cleanup: rename variables for gizmo templates
The abbreviation was from 'manipulator',
which was changed to gizmo during development.

Also correct operator description.
2021-01-29 11:43:19 +11:00
82b06f3112 PyAPI: Add error when registering a 3D gizmo into a 2D gizmo group
Address issue raised in T85145.
2021-01-29 11:43:14 +11:00
f560dc6892 Cleanup: rename variables for gizmo templates
The abbreviation was from 'manipulator',
which was changed to gizmo during development.

Also correct operator description.
2021-01-29 11:33:54 +11:00
b0ab4b815a PyAPI: Add error when registering a 3D gizmo into a 2D gizmo group
Address issue raised in T85145.
2021-01-29 11:12:57 +11:00
213f8294b5 Fix T84906: Loop select can fail when starting from an ngon
When stepping over an ngon's edges, check the number of edges & faces,
to ensure the topology connected to the ngon would be walked along.
2021-01-29 10:06:56 +11:00
1e355b0992 Docs: add diagrams describing the purpose of BMwEdgeLoopWalker.f_hub
Without this the purpose of this feature isn't clear.

While 01b3e9cc9f linked to an image,
add inline ascii diagrams with detailed explanations.
2021-01-29 10:06:52 +11:00
92b0803f35 Merge branch 'blender-v2.92-release' 2021-01-28 16:25:59 -06:00
71cb6923f5 Fix T83988: Active modifier outline uses search theme color
The outline for the active modifier was abusing the property search
match theme color, as noted in a comment. This commit adds a new
theme color in RNA specifically for the active modifier outline.
2021-01-28 16:16:24 -06:00
323b7ad9cd Merge remote-tracking branch 'origin/blender-v2.92-release' 2021-01-28 22:59:18 +01:00
2f60e5d1b5 Cleanup: Move geonodes object info RNA enum
This enum is only used by the node. So it does not need to be declared outside
the scope of its function.

Originally I thought this may be relevant to the collection info node as well,
but the patch for it is defining its own enums.
2021-01-28 22:44:20 +01:00
7a62574338 Cleanup: Reduce variable scope
Also some minimal white space changes
2021-01-28 13:52:39 -06:00
fcb7b0adcc Fix T85157: join node not working when the second mesh is empty
The issue was that the `offset` in `dst_span[offset]` was out of bounds
when the domain size is 0. The fix is to simply skip copying attributes
in that case.
2021-01-28 17:03:34 +01:00
133966423a Revert "Depsgraph: Remove redundant copy-on-write operations"
This reverts commit 76fd41e9db. This should have
been reverted along with 0f95f51361, since this
change by itself is causing crashes when the depsgraph accesses a non-existent
copy-on-write component.

Ref T84717
2021-01-28 13:16:49 +01:00
a51ff5208b Fix alpha transparency slider range being influenced by RGB values
For buttons that edit array properties, the soft min/max and slider ranges are
based on the range of all values in the array. However for alpha this does not
make much sense, the only reasonable range is 0..1 even when there are RGB
values larger than 1. So treat alpha as an individual property.
2021-01-28 13:16:49 +01:00
3c7d5ec829 Surface Deform: fix binding vertex artifacts causing spikes.
There are two issues here. First, like in T81988 there are cases
where the modifier would deform some vertices immediately after
bind. This is caused by wrong assumptions in the code about the
possible relative angles between various vectors, which can cause
negative weights that don't blend correctly to appear.

Specifically, it seems originally the code assumes that the
centroid-point vector in the polygon plane lies somewhere
between the mid-edge vectors. This is however not necessarily
the case for distant vertices, because the polygon is not
guaranteed to be truly planar, so normal projection may be
a bit off. The code has to use signed angles and checks to
support all possible angular arrangements.

The second issue is very thin and long triangles, which tend
to be very spatially unstable in their thin dimension, resulting
in excess deformation. The code was weighting distance using
the distances between the centroid and the mid-edge points, which
in this case end up as nearly opposite vectors of sizable length
and don't correctly represent how thin the triangle actually is.
It is thus better to use centroid-to-line distances, and an
additional even stricter value for the midpoint that will use
only 3 vertices at evaluation time.

Differential Revision: https://developer.blender.org/D10065
2021-01-28 14:42:53 +03:00
a6b31af37e Merge branch 'blender-v2.92-release' 2021-01-28 12:36:13 +01:00
Yevgeny Makarov
3726aa68c3 Fix T83935: Superimposed icon's hotspot is misaligned
Now the icon's rect are drawn wider than it should be, and with
overlapping, probably in order to compensate for the icon's offsets
inside the rect. The solution is to draw icon's rect of the correct
size and center the icon itself.

And make the hotspot exactly match the icon's rect. The last/right
button's hotspot also covers the extra padding on the right.

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

Reviewed by: Julian Eisel
2021-01-28 12:36:00 +01:00
Yevgeny Makarov
6f054f5ac7 Fix T83935: Superimposed icon's hotspot is misaligned
Now the icon's rect are drawn wider than it should be, and with
overlapping, probably in order to compensate for the icon's offsets
inside the rect. The solution is to draw icon's rect of the correct
size and center the icon itself.

And make the hotspot exactly match the icon's rect. The last/right
button's hotspot also covers the extra padding on the right.

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

Reviewed by: Julian Eisel
2021-01-28 12:33:46 +01:00
c0d2b10c59 Fix T69001: Custom icons won't load while using workbench engine
Preview icons (e.g. material preview or other data-block previews) use the same
background-job code as deferred loading of custom icons/previews. There was a
check to skip preview generation if the render engine does not support preview
rendering mode, which workbench doesn't. However this check should only be used
when actually rendering a preview, not when doing deferred loading.
2021-01-28 12:23:15 +01:00
0bd2f18a85 Merge branch 'blender-v2.92-release' 2021-01-28 22:11:20 +11:00
07e66f58cc Fix T85121: Sequencer key conflict with Lock & Select Linked
"Lock Strips" (Shift-L), conflicted with "Select Pick Linked".

Use Ctrl-H, Ctrl-Alt-H for lock & unlock since selected linked
uses bindings which are used in other parts of Blender.
2021-01-28 22:06:05 +11:00
a64a8d2b79 Cleanup: spelling
Also remove replace 'playblast' with terminology used in Blender's UI.
2021-01-28 22:02:11 +11:00
dfcfc8ee95 Merge branch 'blender-v2.92-release' 2021-01-28 21:56:10 +11:00
8948f73784 Fix T81334: Python view-port drawing depth-test regression
Since 216d78687d the depth function
(glDepthFunc) was left in an undefined state for drawing callbacks that
use the `bgl` module.

This meant enabling depth-test from Python's bgl module also needed
to set the depth function (which previously wasn't necessary).

Set the depth function as part of GPU_bgl_start
2021-01-28 21:53:56 +11:00
bf721fb679 Fix panning with Lock-to-Selection and no selection in Clip Editor
Rather self-explanatory. Never worked since the initial implementation.
It is possible to preserve lock-to-selection option with no selection
nowadays (since the fix for T84850). So now the Lock-to-Selection option
is fully under user control. Surely, the panning and zooming is also
properly supported now in the described scenario.

Differential Revision: https://developer.blender.org/D10226
2021-01-28 11:34:53 +01:00
3b66f40d40 Fix T85124: Undo assert changing property in redo panel.
Logical mistake in recent refactor (rB2a8122fb65c5).
2021-01-28 11:33:37 +01:00
573bda1fae Fix unused result from mmap() call
The unused result was reported by Clang-Tidy 11.

It does make sense to check for the failed mmap() calls rather than
quietly suppress errors.

In this change failures are reported, but application execution is
not aborted. This is a bit disputable, but it feels to be a safer
thing to do now.

It is unclear how to test the code though, as we don't have any
tools in-place to simulate read errors.

Differential Revision: https://developer.blender.org/D10223
2021-01-28 11:05:38 +01:00
92567c072a Cleanup: Fix clang format
Due a problem in the mergetool, the clang format was totally wrong in the previous commit.
2021-01-28 11:02:49 +01:00
8214a63493 Merge branch 'blender-v2.92-release' 2021-01-28 10:54:20 +01:00
Habib Gahbiche
51c8d53a7d Fix T84512: Crash if size input of Blur node is too large
Gaussian filter with a too large kernel doesn't make much sense.
This commit caps the Gaussian function radius to MAX_GAUSSTAB_RADIUS.

Reviewed By: sergey

Maniphest Tasks: T84512

Differential Revision: https://developer.blender.org/D10122
2021-01-28 10:43:46 +01:00
7000eb00f8 Merge branch 'blender-v2.92-release' 2021-01-28 10:37:19 +01:00
b379f626ce Fix T85035: Gpencil render in background render wrong frame
Due a thread priority, the calculation of the current frame is not done before the frames are available. This produces wrong render frames.

The solution is verify the current frame before doing the real render. This adds only a few milliseconds, but it assures the frame is correct.

As the problem is only when render in background, the recalculation of the frame is only necessary when do real render and not a viewport render, so there is no impact in the animation FPS.
2021-01-28 10:36:05 +01:00
9fdb32bf51 Merge branch 'blender-v2.92-release' 2021-01-28 10:34:33 +01:00
61d1fd7e2f Fix T85142: BMW scene quits Blender
Technically, the crash was caused by revert which happened in
rBcd24712c2c5: it reverted some code which is essential for
rB76fd41e9db1.

Bring back the essential code for the removal of un-needed
Copy-on-Write operations, so that the crash doesn't happen.

What was causing the crash is the ID tag assuming Copy-on-Write
operation always exists.
2021-01-28 10:34:18 +01:00
39cfc95c2c Merge branch 'blender-v2.92-release' 2021-01-28 18:54:45 +11:00
78f7377c88 Fix T85107: Active tool doesn't update when mouse is already over it 2021-01-28 18:53:03 +11:00
fcda0c7eb9 Merge branch 'blender-v2.92-release' 2021-01-28 18:27:53 +11:00
9509e18564 Fix T82785: Setting Image.alpha_mode clears generated image data 2021-01-28 18:27:25 +11:00
c1c77b7b9a Merge branch 'blender-v2.92-release' 2021-01-28 16:23:01 +11:00
10e093b30d Fix T83539: 'activate_init' fails with buttons that have popups
Activating buttons was running too early, before the popup was
positioned on the screen,
causing data-selectors to be positioned incorrectly.

As the early button activation isn't needed, remove this call.

Ensure this doesn't happen again with an assert.
2021-01-28 16:12:43 +11:00
862aa2a66b Merge branch 'blender-v2.92-release' 2021-01-28 14:59:27 +11:00
e6a5e33c09 Merge branch 'blender-v2.92-release' 2021-01-28 14:59:24 +11:00
057859620d Merge branch 'blender-v2.92-release' 2021-01-28 14:59:20 +11:00
93412cb4e7 Fix jpeg200 4k cinema preset
Used the wrong define, also remove local defines.
2021-01-28 14:50:46 +11:00
87d3f4aff3 Fix T82675: Crash on exit when Blender is built as a Python module 2021-01-28 14:38:08 +11:00
198980693b Fix T84931: Keys that open menus can also activate menu items
Disable key-accelerators for key-repeat events.

When a key was held it could open the menu and activate the menu
item associated with that key.

With the RMB select option: edit-meshes & edge-selection caused
holding W to open & activate "Edge Bevel Weight".
2021-01-28 10:50:47 +11:00
df135b74fc PyAPI: use PYTHONUTF8/Py_UTF8Mode on all platforms
System encoding issues have been a paint-point for us with Python 3,
since Blender always uses UTF-8 which might not be the case for the OS.

While the Py_SetStandardStreamEncoding was already set to utf-8,
the file-system could still have an incompatible encoding.

See PEP-540 for details.
2021-01-28 09:47:05 +11:00
e285765a6b Fix incorrect RNA enum default
Also another copy and paste error in the attribute compare node.
2021-01-27 12:48:10 -06:00
c604fd56a7 Merge branch 'blender-v2.92-release' 2021-01-27 18:44:59 +01:00
37e60289c2 Fix T85110: moving markers num input confuses time vs frames
Looks like a typo in rB66b84ad1592d.

Maniphest Tasks: T85110

Differential Revision: https://developer.blender.org/D10225
2021-01-27 18:40:07 +01:00
4c4ccdfa36 RNA: Add warning to float percentage property definition
As a followup to rBc71a8e837616159735, add a debug-only check for
incorrect range, when the percentage and factor functions were likely
confused.
2021-01-27 11:22:55 -06:00
c71a8e8376 UI: Fix incorrect RNA percentage property definitions
In two cases the percentage property was actually used incorrectly, as
pointed out in T82070. The range was [0, 1], but the properties were still
displayed as percentages.

There is a preference to control whether to display factors or
percentages, so it usually doesn't make sense to manually define
properties as percentages.

Resolves T82070

Differential Revision: https://developer.blender.org/D9344
2021-01-27 11:19:54 -06:00
0e39c526d8 Fix RNA debug build error after recent Sky texture altitude change
Reduce step size within the allowed range.
2021-01-27 17:54:38 +01:00
ded4940901 Fix possible dereference of nullptr mask 2021-01-27 16:54:29 +01:00
Marco
0af512abdf Sky Texture: change Nishita Altitude to use unit system
Differential Revision: https://developer.blender.org/D9968
2021-01-27 16:48:50 +01:00
97e646b54a Documented color management issue.
When using the viewport render animation and saving to an 8 bit
image/movie file, the color management is applied twice. Once on the GPU
and once when saving to disk. Removing this option currently leads to
incorrect Scene strip rendering so needs more research.
2021-01-27 16:07:17 +01:00
a4d07bafc6 Cleanup: Moved update ratio stretching overlay to cache_finish 2021-01-27 16:07:17 +01:00
f83aa830cd Fix T83187: Unselected UVs shows selected on linked meshes.
When uv editing objects that share the same mesh only the selection
state can get confused. The cause is that the UV editor uses a
particular order of objects and store its state in the first object of a
mesh it hasn't handled. During drawing this state is updated into the
GPU buffers. In the case of linked meshes it can happen that the GPU
buffers are updated based on the object that does not have the correct
selection state making th selection VBOs incorrect.

This patch adds a work around that uses the order that the UV editor is
also using so the GPU buffers are built with the right data.
2021-01-27 16:07:17 +01:00
9b80291412 Merge branch 'blender-v2.92-release' 2021-01-27 15:29:39 +01:00
James Horsley
4fbeb3e6be Fix T85089: Crash when rendering scene that does not fit into GPU memory with CUDA/OptiX
The "cuda_mem_map_mutex" was potentially being locked recursively during the call to
"CUDADevice::move_textures_to_host", which crashed. This moves around the locking and
unlocking of "cuda_mem_map_mutex", so that it doesn't call a function that locks it while
still holding the lock.

Reviewed By: pmoursnv

Maniphest Tasks: T85089, T84734

Differential Revision: https://developer.blender.org/D10219
2021-01-27 15:27:57 +01:00
6f7e2bf170 Fix T84329: Crash when loading the blender with deprecated graphics driver
Add the driver `4.5.13467` related to `Radeon R5 Graphics` to the
workaround list.
2021-01-27 10:52:40 -03:00
8e52d76bcd Merge branch 'blender-v2.92-release' 2021-01-27 14:25:28 +01:00
cd24712c2c Fix T84717: Missing viewport update after shading changes
Revert "Fix T83411: Crash when using a workspace/layout data path in a driver"

The fix for the crash exposed design violation in the viewport shading updates,
which is for some reason relying on dependency graph tag of interface data.

The viewport module did not respond to the issue in 2 weeks, and the architect
considered missing update for multiple users a more serious issue than a crash
in a very specific case.

This reverts commit 0f95f51361.
2021-01-27 14:20:31 +01:00
c92b5622ad CMake: Detect Clang-Tidy 11 and 12 2021-01-27 13:01:01 +01:00
3f8816eb6a Merge branch 'blender-v2.92-release' 2021-01-27 20:26:22 +11:00
75c426a60a Merge branch 'blender-v2.92-release' 2021-01-27 20:26:19 +11:00
ea01c8c5f6 Fix T84402: Off-screen rendering works only once from Python
Off-screen drawing doesn't work once the 'bgl' workaround is enabled.
Disable this for off-screen drawing.
2021-01-27 20:23:00 +11:00
4b7b4efd5b Fix T81834: Images not properly duplicated in node_shader_utils
Oversight in fb10eaf6e8
2021-01-27 18:16:02 +11:00
fc669a4c3e Cleanup: spelling 2021-01-27 15:28:24 +11:00
6e03a66e78 Merge branch 'blender-v2.92-release' 2021-01-27 15:18:56 +11:00
abb2215061 Merge branch 'blender-v2.92-release' 2021-01-27 15:18:52 +11:00
fb10eaf6e8 UI: add ellipsis to batch rename menu item 2021-01-27 15:17:01 +11:00
7d24aa8aa8 RNA Manual Reference: Update Mappings 2021-01-26 17:19:03 -05:00
e41a8bfabe Merge remote-tracking branch 'origin/blender-v2.92-release' 2021-01-26 14:57:17 -07:00
5496d8cd36 Windows: Fix wchar_t truncation
BLI_strncpy_wchar_from_utf8 made the assumption that
wchar_t is UTF-32 bit regardless of environment, while
this holds true on both mac and linux, on windows
wchar_t is actually actually UTF-16.

This resulted in the upper 16 bits being dropped from
from some string conversions and prevented blender
from starting when installed in a path with unicode
code-points over 0xffff.

There was also a fair bit of code duplication between
BLI_strncpy_wchar_from_utf8 and BLI_str_utf8_as_unicode_and_size

this change essentially removes all logic from
BLI_strncpy_wchar_from_utf8 and calls the right function
for the right environment.

Reviewed By: brecht , Robert Guetzkow

Differential Revision: https://developer.blender.org/D9822
2021-01-26 14:56:39 -07:00
d096d9c4d6 UI: Tooltip for data-block selector menus, showing full name and library info
Long data-block names are clipped to fit into data-block selector menus. For
linked data-blocks, there's also a hint indicating the source library, which
takes further space and may get clipped too.

So this commit adds a tooltip to the menu items, which displays the full,
unclipped data-block name and the unclipped library name. Plus, the library
path is shown too, which is also useful info.

Adds helper functions for search menu item tooltips, so these are easier to add
to other search menus in future.

Part of T84188.
2021-01-26 22:17:17 +01:00
656f6ae643 Cleanup: Use const parameters for active button lookups/tests
Needed for const-correctness in the following commit.
2021-01-26 22:17:17 +01:00
733bcbed46 Cleanup: Comment formatting, grammar 2021-01-26 15:09:02 -06:00
1f81195fb9 Cleanup: Use LISTBASE_FOREACH macro 2021-01-26 14:59:03 -06:00
c32c6a5f85 UI: Current Frame Marker Cleanup
Draw current frame marker in a single pass.

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

Reviewed by Hans Goudey
2021-01-26 11:15:42 -08:00
1c4b0c47dd Geometry Nodes: Support all operations in the "Attribute Math" node
This adds the ability to use all the math operations in the regular
utility "Math" node. The code is quite similar to the attribute vector
math node, with the simplification that the result is always a float.

Differential Revision: https://developer.blender.org/D10199
2021-01-26 12:57:31 -06:00
de3f369b30 UI: Use Ellipsis for Short Truncated Text
Allow use of ellipsis to indicate truncated text down to a single character.

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

Reviewed by Hans Goudey
2021-01-26 10:17:37 -08:00
cdb8209b35 Merge branch 'blender-v2.92-release' 2021-01-26 12:13:42 -06:00
d9a63d40e2 Fix build error
An extra `p->` was added for some reason in a recent commit.
Additionally, there's no reason for the flag to be kept as a pointer,
so just dereference it at the start of both functions.
2021-01-26 12:13:28 -06:00
3d7d0f1f2e Merge branch 'blender-v2.92-release' 2021-01-26 11:56:08 -06:00
a6016bf5af UI: Fix ugly alignment of timeline popover buttons
Apparently things have changed since {rB98d205508977a6f72bf55},
and putting the buttons in two separate rows is no longer enough
to keep the right-most popover button in the timeline header from
aligning with the menu buttons. This just adds a separator large
enough to avoid the alignment.
2021-01-26 11:55:36 -06:00
60d85a3e60 Merge branch 'blender-v2.92-release' 2021-01-26 18:38:07 +01:00
23e108c5b6 Fix T85082: Perspective distortion while drawing
When the drawing plane was set to view and the user would pan their
camera sideways, the drawing would be more and more distorted and
projected further back.

The fix projects the strokes to view when the user is looking through
the camera or has the drawing plane set to view.

Reviewed By: antoniov

Maniphest Tasks: T85082

Differential Revision: https://developer.blender.org/D10213
2021-01-26 18:37:08 +01:00
ef28da2623 Fix T85082: Perspective distortion while drawing
When the drawing plane was set to view and the user would pan their
camera sideways, the drawing would be more and more distorted and
projected further back.

The fix projects the strokes to view when the user is looking through
the camera or has the drawing plane set to view.

Reviewed By: antoniov

Maniphest Tasks: T85082

Differential Revision: https://developer.blender.org/D10213
2021-01-26 18:32:49 +01:00
6157c45445 Fix T85049: Geometry Nodes: How to handle instances with shear? (part2)
Update to changes in master.

Reviewed By: JacquesLucke

Differential Revision: http://developer.blender.org/D10211
2021-01-26 18:25:16 +01:00
82523840cd Merge branch 'blender-v2.92-release' 2021-01-26 18:23:13 +01:00
abd6b1d7b2 Fix T85049: Geometry Nodes: How to handle instances with shear?
Use transform matrices instead of loc, rot, scale variables to store instance transforms.

Reviewed By: JacquesLucke

Differential Revision: http://developer.blender.org/D10211
2021-01-26 18:21:12 +01:00
ae5c15bb43 Merge branch 'blender-v2.92-release' 2021-01-26 17:51:51 +01:00
6d40d72189 Fix T84847: Crash after splitting effect strip
`seq->tmp` was left in invalid state after
`SEQ_sequence_base_dupli_recursive()` which is run by
`scene_copy_data()`

Ensure all strips have `seq->tmp` set to `NULL` before splitting strips.
2021-01-26 17:50:44 +01:00
c967208460 Fix T79922: Cache of meta strip not invalidated
Meta strip cache is not invalidated if strip inside of meta strip is
invalidated.

Find all metastrips that contain invalidated strip and invalidate them
recursively.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D10192
2021-01-26 17:50:44 +01:00
41979fc03b Fix T84160: Wrong DOF when camera is overriden
Workbench engine used active camera to setup DOF effect even when
camera was overridden.

Store camera override in `WORKBENCH_PrivateData` and use it in
`workbench_dof_engine_init()`

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D9952
2021-01-26 17:50:44 +01:00
981380cf6d VSE: Fix memory leak when building proxies
With no valid strips selected, file_list is not freed.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D10191
2021-01-26 17:50:44 +01:00
20504e555e Fix T84979: No sound after changing strip datablock
Tag relations to update to load new sound.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D10182
2021-01-26 17:50:44 +01:00
f22e85d721 Fix T84935: improve previous fix for boolean custom data layers
This improves the fix introduced in rBdc8b31af578bfcf9f77dbce6d7b7da1006a3c8c1.
While it did not result in other bugs afaik, I thought it would be
good to make the fix more specific, in case some other code did
expect `layer->data` to be null. This updated fix checks for the
very specific case the fix was intended for.
2021-01-26 17:49:58 +01:00
ff7a557c67 Geometry Nodes: new Points to Volume node
This implements a new geometry node based on T84606.
It is the first node that generates a `VolumeComponent`.

Differential Revision: https://developer.blender.org/D10169
2021-01-26 17:37:58 +01:00
89484e9754 Geometry Nodes: Use highest complexity attribute in join node
This just implements a todo with a utility function that didn't exist
at the time. For example, if one geometry has a "scale" attribute with
a float type and another has a "scale" attribute with a vector type,
the vector type will be used for the resulting geometry.

Differential Revision: https://developer.blender.org/D10206
2021-01-26 10:10:07 -06:00
66f8835f9c Fix T84850: "Lock to Selection" causes unwanted jumps
Adding new tracks, mask points, mask primitives, changing selection was
causing an unwanted jumps in the view.

This change makes it so those operations are preserving view offset.

Differential Revision: https://developer.blender.org/D10146
2021-01-26 16:23:09 +01:00
3d3b6d94e6 Subdiv: Use better default UV interpolation
The default one is now UVs are smoothed, boundaries are kept sharp.

After some time of experimentation seems this is better default from
interoperability point of view.

This fixes distortion reported in T83470.

Differential Revision: https://developer.blender.org/D10111
2021-01-26 16:23:09 +01:00
66151b5de3 Subsurf: Expose all UV interpolation options
Useful for interoperability, and allows to change default mode
without breaking compatibility.
2021-01-26 16:23:09 +01:00
c1d0b234fb Subdiv: Fix typo in RNA enum value name
Was duplicated from SUBSURF_UV_SMOOTH_PRESERVE_BOUNDARIES value.
2021-01-26 16:23:09 +01:00
8d51c06611 Cleanup: Reduce variable scope 2021-01-26 09:21:42 -06:00
20d0bb43af GPencil: Swap positions of Pie menu options for Vertex Paint and Weight Paint
This keep the same logic used with meshes because now the Weight Paint and Vertex Paint are not in the same position for grease pencil.
2021-01-26 16:11:06 +01:00
31f568c336 Fix: incomplete integration of PugiXML and Potrace build options
Add them to the standard build configurations, disable properly when library
not found and print as part of configuration overview.
2021-01-26 15:55:27 +01:00
dde3ecc1a8 Cleanup: compiler warnings
If one method is marked as override, clang warns if others are not.
2021-01-26 15:52:05 +01:00
c51a5b204c Fix T85048: Cycles sculpt vertex color issues after recent changes
Attribute fields were not fully copied.

Ref D10208
2021-01-26 15:32:05 +01:00
26b5760d6d Fix T85038: No curve is "active" after selecting all curves
Check for selection status beforec learing the "active" flag from an
FCurve. This allows the "Select All Curves" operator to retain what is
seen as the active curve.
2021-01-26 15:13:42 +01:00
Charles Flèche
76ab0381d1 Fix Cycles standalone compilation following API changes
The changes to the socket API were not applied to the standalone app.

Also modify Camera.compute_auto_viewplane() to use Camera.full_width and Camera.full_height as it is not possible to publicly access Camera.width and Camera.height anymore, so the aspect ratio could be computed with stale data.

Differential Revision: https://developer.blender.org/D9961
2021-01-26 14:39:32 +01:00
Charles Flèche
532d3a103a Cycles standalone: fix missing dependencies in CMake files
Also set default CYCLES_INSTALL_PATH to CMAKE_INSTALL_PREFIX.

By default with a `make cycles` this will build to ${CMAKE_BINARY_DIR}/bin

Differential Revision: https://developer.blender.org/D9961
2021-01-26 14:39:32 +01:00
84671d796d Merge remote-tracking branch 'origin/blender-v2.92-release' 2021-01-26 14:38:40 +01:00
b665781808 Asset Browser: fix context properties reported to Python
Change `"active_id"` to `"id"` so that tab completion in the asset browser
context returns the correct properties.

055ef5df61 renamed the `active_id` property
to `id`, but `dir(thecontext)` still returned `"active_id"`.
2021-01-26 14:27:33 +01:00
ed809866b1 Viewport Rendering: Don't clamp when overlays are disabled.
During viewport rendering the color values were clamped in order to
apply the overlay on top of it. This clamping would show the scene
colors washed out.

This patch adds a work around to skip the clamping when the overlays are
turned off.

Parial fix for {T77909}
2021-01-26 14:25:18 +01:00
e6aece32a0 GPU: Enable HQ normals workaround for any AMD Drivers on Polaris. 2021-01-26 12:48:50 +01:00
74633c0456 Merge branch 'blender-v2.92-release' 2021-01-26 12:41:47 +01:00
Robert Guetzkow
c399651637 Fix T84708: Versioning for Set Alpha node
The versioning code introduced in rB38df935c0985 skips the composite node
tree that is used by the scene thus not correctly versioning Set Alpha
nodes outside of node groups. This fix iterates through all node trees to
version all Set Alpha nodes.

Reviewed By: JacquesLucke

Differential Revision: https://developer.blender.org/D10110
2021-01-26 12:38:43 +01:00
c3a4c6c209 GPU: Enable HQ normals workaround for AMD 21.1.1 driver.
AMD 21.1.1 still has the same issues as reported in T82856.
2021-01-26 12:30:54 +01:00
4935ed6ce6 Fix T84907: incorrect dirty mask after geometry join node
Hans noticed that these dirty flags are only used for normals currently
and that the edge flag is not used at all. This patch still applies the
"entire" fix with all four flags.

Differential Revision: https://developer.blender.org/D10193
2021-01-26 12:09:44 +01:00
dc8b31af57 Fix T84935: boolean custom data layers not saved correctly
The issue was that boolean custom data layers were not written to files,
because the dna struct name `bool` does not exist. Adding a struct that
just contains a `bool/uint8_t` does not seem to be possible, it looks like
the minimum dna struct size is 4 bytes.

The proposed solution has two parts:

1. Write the custom data layer using `BLO_write_raw` instead of
   `BLO_write_struct_array_by_name`.
2. When loading a file, reinitialize any custom data layer that was
   not saved correctly (this is just a fix for existing files).

Differential Revision: https://developer.blender.org/D10194
2021-01-26 12:05:40 +01:00
f066cee92f Merge branch 'blender-v2.92-release' 2021-01-26 22:04:21 +11:00
548d8a397c Fix T85011: "Allow Execution" reloads the wrong file when recovering
Support custom revert actions, necessary for recover operations
to be able to reload the file with scripts enabled.
2021-01-26 21:56:49 +11:00
2a8122fb65 ed_undo refactor: split/remove ed_undo_step_impl.
This function was doing too many things, with behaviors fairly different
depending on its input parameters. This was making the code fragile and
hard to follow.

Split it in three:
* `ed_undo_step_pre` does the common actions before we actually undo
  data.
* `ed_undo_step_post` does the common actions after we have undone/redone
  data.

Then, `ed_undo_step_direction`, `ed_undo_step_by_name` and
`ed_undo_step_by_index` do their actual specific actions, with their own
logic.

Note: Since the actual behavior of those three funtions is fairly
different (the first only undo/redo one effective step, the second is only
supposed to **undo** //before// given named step, and the third actually
undo/redo until given indexed step become active), we could also find
better names for those. right now, it sounds like they are doing the
same thing, with just different ways to specify the target step.

Note: This is part of on-going refactor work on undo system, see T83806.

Differential Revision: https://developer.blender.org/D10112
2021-01-26 09:44:46 +01:00
0d9f79b163 Cleanup: Reduce variable scope, use LISTBASE_FOREACH macro 2021-01-25 23:47:56 -06:00
f21de01b84 Merge branch 'blender-v2.92-release' 2021-01-26 15:38:08 +11:00
7909f70f64 WM: add "use_scripts" to recover auto-save/session operators
Support recovering blend files with scripts enabled,
needed to fix T85011, can be useful in general too.

Adding this also resolves an assert in BKE_autoexec_match,
since it ran even when scripts were enabled.
2021-01-26 15:34:38 +11:00
e9e054b987 Geometry Nodes: Add float2 to attribute complexity map 2021-01-25 22:20:41 -06:00
71a8e32dc0 Merge branch 'blender-v2.92-release' 2021-01-26 15:18:10 +11:00
d55d95b04d WM: return success from WM_recover_last_session, minor cleanup
- Return success from WM_recover_last_session
- Avoid setting global variables is already called in WM_file_read.
  While it didn't cause any problems, these assignments ran even when
  recovering the session failed to load the file.
- Return OPERATOR_CANCELLED when the operator fails.

Returning success is needed to fix T85011.
2021-01-26 15:16:12 +11:00
Juanfran Matheu
7d2f746369 TEXTURE PAINT: Tools with wrong cursor
Texture paint tools were using DEFAULT cursor instead of PAINT_CROSS cursor as vertex paint, weight paint and sculpt modes.

Before
{F9591366}

After
{F9591370}

Reviewed By: Blendify

Differential Revision: https://developer.blender.org/D10172
2021-01-25 22:37:14 -05:00
Zev Eisenberg
6499a2ec5c Fix typos in driver_functions.py
I'm learning how driver functions work, and I found a couple of typos in the driver_functions.py template file. Here's a quick patch to fix them up.

Reviewed By: Blendify

Differential Revision: https://developer.blender.org/D10149
2021-01-25 22:37:14 -05:00
d7a2e0b83c Cleanup: Use const arguments 2021-01-25 21:11:57 -06:00
Juanfran Matheu
be262cf561 TEXTURE PAINT: Tools with wrong cursor
Texture paint tools were using DEFAULT cursor instead of PAINT_CROSS cursor as vertex paint, weight paint and sculpt modes.

Before
{F9591366}

After
{F9591370}

Reviewed By: Blendify

Differential Revision: https://developer.blender.org/D10172
2021-01-25 22:01:12 -05:00
Zev Eisenberg
0734b235d2 Fix typos in driver_functions.py
I'm learning how driver functions work, and I found a couple of typos in the driver_functions.py template file. Here's a quick patch to fix them up.

Reviewed By: Blendify

Differential Revision: https://developer.blender.org/D10149
2021-01-25 21:59:25 -05:00
ae1e68f514 Cleanup: Declare variables where initialized 2021-01-25 17:22:52 -06:00
70e064f111 Cleanup: Correct comments in ID type enum 2021-01-25 16:28:00 -06:00
c4f3475612 Cleanup: update comment from 77f73a9284 2021-01-26 09:23:44 +11:00
6249995c5e Fix T85054: undo/redo app handlers broken
Regression in recent commit c13383da41
which swapped undo/redo when calling the handlers.

Ref D10200
2021-01-26 09:18:26 +11:00
eaa726542e Merge branch 'blender-v2.92-release' 2021-01-25 23:12:02 +01:00
77f73a9284 Fix library name clipping most of the data-block name in data-block menus
Issue is visible here https://developer.blender.org/F8626313.

If there is enough space for both the item name and the library hint, display
both. Otherwise, clip either the item name, the library hint, or both so that
not more than 60% and 40% of the available width are used repectively.
There are further improvements we could do, as noted in T84188, this just fixes
the regression for the release.

Part of T84188. There were multiple reports about this, see merged in and
mentioned reports in T84188 and T78012.
2021-01-25 23:10:16 +01:00
a35c0fe6ce Merge branch 'blender-v2.92-release' 2021-01-26 08:16:22 +11:00
14f61c619b Fix wm.context_* operators reusing values when it's not expected
wm.context_* operators typically have their options set by menus
or key bindings.

Re-using options in this case can cause problems where two
actions that change unrelated properties will re-use a setting
from the previous execution.

For example changing the lights Power impacted
changing it's Radius afterwards.
2021-01-26 08:13:58 +11:00
4fc54ddae1 Cleanup: spelling 2021-01-26 07:50:40 +11:00
1559aa3da0 Merge branch 'blender-v2.92-release' 2021-01-25 21:11:48 +01:00
Greg Neumiller
c134d7437d Fix T84031 initialize connectivity info of the base mesh before using Displacement Smear brush.
Reviewed By: pablodp606

Maniphest Tasks: T84031

Differential Revision: https://developer.blender.org/D9956
2021-01-25 21:09:58 +01:00
93e3aed041 Merge branch 'blender-v2.92-release' 2021-01-25 11:48:53 -06:00
aa030d3459 Fix: Unable to animate nodes modifier exposed properties
The RNA path used for animating the settings passed to the node tree
is incorrect. Currently it's just `settings.property_name`, but it's
the path from the ID, not the modifier, so it should be
`modifiers[modifier_name].settings.property_name`.

However, the "Settings" struct is separated in RNA and DNA, which means
that the callback to get the RNA path does not know about the modifier's
name in order to fill the above path, so some reference to the modifier
in the "Settings" struct would be necessary, which would create a
convoluted layout in the `ModifierData` struct.

Instead, this commit simply removes the "Settings" struct from RNA,
which isn't as elegant from the point of view of the Python API,
but otherwise it's a nice simplification. Note that we don't remove the
"Settings" struct from DNA, because it would break reading old files.

Differential Revision: https://developer.blender.org/D10175
2021-01-25 11:46:55 -06:00
51c433f1a5 Windows: Remove zero terminator from stack trace
Important lesson to be learned here, leaving comments
is great and in the moment, they usually make sense.

Many months later they may not quite make as much sense
any more and time will have to be spend to figure out
what was meant, all of this would have been averted with a
better comment.

The zero terminator in this case, I can find no evidence
of it being used or relied on at any point. It does however
break GTests's `EXPECT_EXIT` macro that stops looking in
the output as soon as it sees the zts and doesn't end up
looking at the actual assert text being thrown. Which in
turn makes the`fcurve_active_keyframe`test fail when run
in debug mode on windows.
2021-01-25 08:50:37 -07:00
8a77019474 Cycles: modernize usage of rna iterators
Using rna iterators in range-based for loops is possible since {rBc4286ddb095d32714c9d5f10751a14f5871b3844}.

This patch only updates the places that are easy to update
without more changes in surrounding code.

Differential Revision: https://developer.blender.org/D10195
2021-01-25 16:25:27 +01:00
04f91bce53 Fix build error after Cycles Amembic procedural commit 2021-01-25 16:15:35 +01:00
b64f0fab06 Cycles: internal support for Alembic procedurals
The implementation is currently optimized to load animation sequences once
and then quickly scrubbing through them. Later on an option should be added
to optimize for memory usage and only load the current frame into memory.

Currently mesh and curve objects are supported, including support for UV and
vertex color attributes. Missing still is support for arbitrary attributes and
motion blur, as well as better handling of changing topology. Shader assignments
are made using FaceSets found in the Alembic archive.

The animation (and constant) data of the objects inside the Alembic archive is
loaded at once at the beginning of the render and kept inside a cache. At each
frame change we simply update the right socket of the corresponding Cycles node
if the data is animated. This allows for fast playback in the viewport
(depending on the scene size and compute power).

Note this is not yet exposed in the Blender UI, it's a feature that is still under
development and not ready for general use.

Ref T79174, D3089
2021-01-25 15:51:42 +01:00
2e67191c86 Cycles: internal support for the concept of procedurals
Procedurals are nodes in the scene that can generate an arbitrary number of
other nodes at render time. This will be used to implement an Alembic procedural
that can load an Alembic file into Cycles nodes. In the future we also expect to
have a USD procedural.

Direct loading of such files at render time is a standard feature in other
production renderers. Reasons to support this are memory usage and performance,
delayed loading of heavy scene data until rendering, Cycles standalone rendering
using standard file formats beyond our XML files, and shared functionality for
Cycles integration in multiple 3D apps.

Ref T79174, D3089
2021-01-25 15:51:38 +01:00
3656fc3aee Cleanup: move code to find geometry shaders into own function
Ref D3089
2021-01-25 15:48:39 +01:00
2a81d948ad LibOverride: refactor of relationships handling in library overrides.
First step towards a better handling of relationships between IDs in
override context, especially when a resync is needed.

First, introduce a new flag to override operations,
`IDOVERRIDE_LIBRARY_FLAG_IDPOINTER_MATCH_REFERENCE`, for ID pointers.
It keeps track of whether an RNA ID pointer has been kept to its
'natural overriden ID' (in override hierarchy context), or has actually
been re-assigned to some other data-block.

Second, refactor how we deal with relationships between IDs in override
hierarchy code, especially in resync case. This will fixe several cases
listed in T83811, especially the case where an ID pointer to an existing
override needs to be updated to a new one due to a matching change in
linked data.
2021-01-25 14:48:51 +01:00
5c490bcbc8 Fix T85027: Crash dragging a collection over empty Outliner
Filtering may make the Outliner tree empty. The function to find the drop
element should just return null then and let the caller decide how to deal with
it.
2021-01-25 14:37:24 +01:00
ef6d652428 Fix T83344: Cycles baking with progressive refine fails on GPU 2021-01-25 14:27:01 +01:00
f226687bb9 Cleanup: Knife Tool: Remove redundant 'view3d_operator_needs_opengl' calls
This function sets the `RegionView3D` matrices to the GPU.
But the OpenGL library is not actually being used by the operator.
2021-01-25 10:07:50 -03:00
4792d988fb Fix T84964: Crash when running Knife Project in the background
Although the Knife Project operator converts 3D coordinates to screen
space, it doesn't really need opengl.

Differential Revision: https://developer.blender.org/D10178
2021-01-25 10:07:50 -03:00
e9a47223cb Merge branch 'blender-v2.92-release' 2021-01-25 23:48:00 +11:00
4bc7996e2e Merge branch 'blender-v2.92-release' 2021-01-25 23:47:56 +11:00
72a207de35 Merge branch 'blender-v2.92-release' 2021-01-25 23:47:52 +11:00
William Reynish
601b690a24 Fix T84911: Add Primitive and IC keymap - 3d navigation conflict
Ref D10176
2021-01-25 23:46:57 +11:00
William Reynish
da2955fdf6 UI: improve categorization in Grease Pencil Layers sub-panels
The "Layers" panel for Grease Pencil objects uses sub-panels to organize
their properties in categories. Currently, this isn't so clear.
This patch cleans up these sub-panels with clearer categorization.

Reviewed By: #grease_pencil, antoniov, Blendify, HooglyBoogly

Ref D10184
2021-01-25 23:41:00 +11:00
7a005fb7d1 Fix T84324: Crash when combining two scenes in compositor.
In the CompositorOperation::deinitExecution the viewer could be freed at
the same time it was drawn in the image editor or node editor. There is
a guard for that but wasn't added during the migration of the two
editors to the draw manager.
2021-01-25 12:44:18 +01:00
dd2b616320 Buildbot: Fixed crash when building RC builds
Building RC builds would parse `BLENDER_VERSION_CYCLE_NUMBER` that
doesn't exist anymore. It was removed by {D7748}.

This change removes it from `buildbot_utils.py`.
2021-01-25 11:53:35 +01:00
06fdbe6664 Merge branch 'blender-v2.92-release' 2021-01-25 11:36:31 +01:00
fba35a02c6 Fix padding issue in DNA
Was introduced in the previous change in the image.
2021-01-25 11:35:29 +01:00
William Reynish
5f2c5e5bb8 UI: object context menu tweaks for consistency
Currently, the object context menu includes some inconsistencies
between object types. This is a small patch that fixes these.

- Adds the same ability to Join and Set Origin
  to all supported object types.
- Adds Set Active Camera for cameras.
- Adds Adjust Stroke Width for GP Objects.
- Adds Trace Image to Grease Pencil for Image Empties.

Reviewed By: #grease_pencil

Ref D10144
2021-01-25 21:28:39 +11:00
ebaa3fcedd Fix T84398: Multiview images show only one view.
The `image_get_gpu_texture` didn't use the iuser->view_index but
recalculated the requested view again. This lead to inconsistent
behavior when switching between multi view textures or stereo textures.

This has been fixed by ensuring that the `iuser->view_index` is always
used.

An Image has only place to store 2 view textures. This is done for
right/left eye compositing. A multi view texture can have more views.
This would lead to reading and writing to unallocated space.

When a multiview texture is requested that is larger than 1. It will
always be cached as being the first eye. The `gpu_view` of the Image is
also used as a cache key to check this.
2021-01-25 11:27:55 +01:00
7cb65a1e67 Fix T84990: Proportional Editing falloff drawing for masks in MCE is broken
This got broken in 4b1112c8c9. A fix which will be consistent with image
editor is not obviously clear, so for the time being revert the change and
go back to state which was working for a long time.
2021-01-25 11:10:42 +01:00
be8b60aa20 Merge branch 'blender-v2.92-release' 2021-01-25 11:07:08 +01:00
02404ded80 Fix UI message typo in own previous commit.
//sigh//
2021-01-25 11:06:21 +01:00
a0b85800ec Merge branch 'blender-v2.92-release' 2021-01-25 10:56:55 +01:00
3df2bea88b Fix UI messages.
Avoid sticking words together when it's not absolutely necessary.
2021-01-25 10:56:36 +01:00
4d94e2afc8 Merge branch 'blender-v2.92-release' 2021-01-25 20:37:50 +11:00
2188047d9d Merge branch 'blender-v2.92-release' 2021-01-25 20:37:46 +11:00
52022cba78 UI: increase the context menu's light power
This roughly matches the behavior when
editing this value via the buttons.

Part of D10144
2021-01-25 20:35:56 +11:00
William Reynish
5f55022276 UI: tweak object context menu labels
A number of naming changes for consistency and clarity

- Use 'Adjust...' for all entries that adjust properties
  rather than being normal operators.
- Follow naming conventions (ie Draw -> Display etc).
- Less naming ambiguity and more correctness and consistency.

Part of D10144
2021-01-25 20:12:39 +11:00
292685ea39 Fix T84878: Eevee cryptomatte broken with stereoscopy
During multiview rendering the `cryptomatte_accum_buffer` is not cleared
between the views and leaves artifacts on the next view to be rendered.
This change clears the accum buffer when it already exists and will be
reused for the next view.
2021-01-25 09:40:03 +01:00
0cb264a282 Cleanup: pass 'rctf' rectangle to 2D box drawing functions
Passing 4x arguments for the rectangle,
mixed in with round-box radius & color wasn't very readable.

Instead, pass a `rctf` as the first argument to UI box drawing functions.
2021-01-25 18:34:29 +11:00
17ac860cef Cleanup: remove redundant len() calls 2021-01-25 18:09:15 +11:00
32fd000b4b UI: Round-box drawing cleanup
The new GPU_SHADER_2D_WIDGET_BASE shader allows us to draw
many complex shapes with anti-aliasing.
One thing it can do is draw an opaque rounded rectangle with colors
that differ between its interior and outline.

In order to do the above in a single pass I recently added an "_ex"
version of UI_draw_roundbox that exposes most of that shaders features.

This simplifies interface_draw.c by removing redundancy in the calling
of this shader by using this new uber "_ex" version.

Ref D10189
2021-01-25 18:06:39 +11:00
1ac3c861fd Cleanup: remove unused UI_draw_roundbox_shade_y function
Marked unused 2017 f69678482c)

Remove since this remains unused,
split from D10189 to allow reverting if we ever need it back.
2021-01-25 17:57:59 +11:00
William Reynish
5a1cef2e76 UI: move 'Trace Image to Grease Pencil' to 'Convert' sub-menu
This operator is very specific, and may not warrant being placed in
such a prominent place. Move it together with other convert operators.

Ref D10188
2021-01-25 17:49:02 +11:00
bf329d37da Merge branch 'blender-v2.92-release' 2021-01-25 17:43:00 +11:00
7a0281914e Fix T85010: Cycles viewport not showing certain material changes when using GPU compute
Modifications to triangle shader association were not considered when checking for updates and the associated device data array was not tagged as modified so it was not resent to the device(s).
2021-01-25 07:40:49 +01:00
7f9ed0178a Cleanup: compiler warning, clang-format, spelling 2021-01-25 17:40:40 +11:00
b90ccaa067 Merge branch 'blender-v2.92-release' 2021-01-25 06:01:14 +01:00
Olivier Jolly
5501a5de32 Fix T84705: Snapping strip handle offset animation
Only offset animation if whole strip is snapped.

Bug introduced in e36c05b3d1.

Reviewed By: ISS

Differential Revision: https://developer.blender.org/D10116
2021-01-25 05:51:36 +01:00
Peter Fog
d6bbcc4f66 VSE: Inherit blend mode with single input effects
It is very likely, that after applying effect like transform or speed on
strip with certain blending, user would want to change effect blending
to match original strip.

Feature suggested on RCS:
https://blender.community/c/rightclickselect/HVgbbc/

Reviewed By: ISS

Differential Revision: https://developer.blender.org/D10156
2021-01-25 05:42:10 +01:00
6d21703e89 Merge branch 'blender-v2.92-release' 2021-01-25 05:09:13 +01:00
e16c786022 Fix T83267: Crash prefetching scene strip in meta strip
Scene strips can't be prefetched and seq_prefetch_do_skip_frame()
should check if scene strip is in timeline. But it did not recurse into
meta strips, which resulted in crash.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9999
2021-01-25 05:03:15 +01:00
93c10797dc Fix T82698: Speed effect not working on generator strips
Generator strips with zero inputs have their length set to 1 pernamently.

In some cases it is useful to use speed effect on these strips because they
can be animated. This can be done by using their length as is on timeline as
content length.

This is very simplified and temporary solution, as cutting these strips won't
give expected results. Lot of code relies on length of these strips being fixed
to 1, resolving this properly should be done by T59540.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D10026
2021-01-25 04:55:10 +01:00
744fa41e7e Fix T83266: Proxy building with meta strips fails
Building proxy with meta strip selected resulted in attempt to render
meta strip itself and save result as image as is done when building
image proxies.

Remove meta strip from list of supported strips.

Multicam, Meta and scene strip are cleared from poll function in UI as well.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D10001
2021-01-25 04:42:46 +01:00
77b51d4e58 VSE: Remove skip_disk_cache argument
This argument was used to prevent infinite loop in lookups between disk
and RAM cache.

Code was refactored, so this can be handled internally in cache.

Reviewed By: sybren, sergey

Differential Revision: https://developer.blender.org/D9955
2021-01-25 04:28:13 +01:00
6623d572aa Cleanup: minor changes and comments to screen_bounds_get access 2021-01-25 13:49:32 +11:00
9708aa6341 Fix view-axis gizmo tool-tip placement
Bounding box calculation ignored the gizmo size preference.
2021-01-25 13:44:42 +11:00
c5e409b013 Merge branch 'blender-v2.92-release' 2021-01-25 13:38:02 +11:00
850115531d Merge branch 'blender-v2.92-release' 2021-01-25 13:37:54 +11:00
652dd4e27f Fix ruler end-caps not following interface scale 2021-01-25 13:34:15 +11:00
d1c6704413 UV: tweak island select behavior
Selecting inside an island no longer de-selects
when it's too far from an edge.

When edge select fails fall back to inside-face test.

This follows 908b383b7d
which made this change for face-select.

Apply to island selection since it doesn't make sense
for island select to behave differently.
2021-01-25 13:30:02 +11:00
cf6d17a6aa UI: Gizmo Tooltip Positioning
Position Gizmo tooltips below their bounds so they do not obscure the content.

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

Reviewed by Julian Eisel
2021-01-24 15:16:05 -08:00
2fec46c3e6 Asset Browser: Support dragging in object-data assets (meshes, curves, etc.)
The Asset Browser already displayed object-data assets, but you couldn't
actually drag & drop them. This is now supported.

The object-data drop poll needed access to the data-block. But with a small
tweak it doesn't need that and can just check the ID type (which is known for
asset dragging too).

Part of T82661.
2021-01-24 22:33:17 +01:00
c8d6e2dfa0 UI: Avoid showing drop hint on drag & drop if dropping won't succeed
If the poll check of the operator fails, the operator won't run. We can check
that in advance to hide the drop hint if dropping will fail anyway.
This improves feedback during dragging.
2021-01-24 21:29:14 +01:00
e90a2a3f01 Asset Browser: Avoid appending asset data-block when drop operator will fail
For assets, the copy callback of the drop-box would append the asset
data-block. Check if the operator's poll succeeds before calling the copy
callback.
Otherwise the data-block is "secretly" appended, which the user doesn't expect
and won't notice without checking the file data in the Outliner.

For masks I had to extend the poll function, it didn't check context
sufficiently.
2021-01-24 21:29:14 +01:00
f04206cbc7 Cleanup: Add/use helper to check if dragging a certain ID type or asset ID type
This check is a common pattern, avoid duplication by using a helper function.
2021-01-24 21:29:14 +01:00
e747c07156 GPencil: New option to trace current frame
Instead to trace the image of the sequence starting in first frame, now it uses the current frame by default.
2021-01-24 17:22:44 +01:00
b449da3a7d Asset Browser: Support dragging mask assets into compositors
The normal drag & drop support was already there, just needed minor tweaks to
respect asset importing. The dragged in mask will create a mask node for
compositor node editors.

Part of T82661.
2021-01-24 17:16:20 +01:00
db15df0baa Asset Browser: Support dragging image assets into node editors
The normal drag & drop support was already there, just needed minor tweaks to
respect asset importing. The dragged in image will create a image/texture node
for the internally known node-tree types (shader, texture and compositing
nodes).

Part of T82661.
2021-01-24 16:53:34 +01:00
aa065a2951 Merge branch 'blender-v2.92-release' 2021-01-24 18:43:58 +11:00
d3506c86da Fix UV editor vertex/face drawing ignoring UI scale 2021-01-24 18:38:05 +11:00
9ad181a5d0 Cleanup: email address formatting
Match git style email addresses, ignored by the spell checker.
2021-01-24 16:08:17 +11:00
9c088b1b97 Cleanup: spelling 2021-01-24 16:06:58 +11:00
2b0d08961a Cleanup: remove toolbar popup release hack
This isn't needed since key-map items can ignore repeat events.
2021-01-24 15:51:05 +11:00
de9977260c Merge branch 'blender-v2.92-release' 2021-01-24 15:25:57 +11:00
e9cd3d50a7 Fix T84988: Armature symmetries crashes with action constraint
Action constraint without an action pointer set was crashing.
2021-01-24 15:24:04 +11:00
9f3c5a061d Fix outliner and animation editors exiting multi-object edit-mode
When multiple objects were in edit-mode,
only the active object would exit edit-mode.
2021-01-24 15:24:04 +11:00
e77c65f73c Cleanup: group navigation gizmo size with generic gizmo size
Also use `char` for these gizmo size & flag.
2021-01-24 13:45:17 +11:00
bd4ed5ca9a Fix "use after scope" reported by ASAN
The float array is declared inside a smaller scope, pointed to, and then
used later. This simply moves the declaration outside of the if statement.
Also remove two redundant lines.
2021-01-23 18:38:51 -06:00
ded9484925 UI: Viewport Navigate Gizmo Refactor
Simplification and changes to the Navigation gizmo. Better indication of negative axes, consistent use of color and size to indicate orientation, ability to be resized.

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

Reviewed by Campbell Barton
2021-01-23 13:10:07 -08:00
aaa1d58054 Merge branch 'blender-v2.92-release' 2021-01-22 19:30:23 +01:00
90bcd5e724 Cleanup: remove unused render camera code 2021-01-22 19:30:17 +01:00
a1f44e43a2 Fix T84745: more build errors with TBB 2021
* tbb::blocked_range moved to a different namespace and since the fix is
  non-trivial, remove some unused code that used this.
* Task group priorities are no longer supported. It's unclear if they are
  useful at all right now and even set correctly, for now all tasks are equal
  priority with TBB 2021.
2021-01-22 19:24:13 +01:00
5d6e5a9076 Fix vertex color baking using wrong color space
Now light baking should match the render.
2021-01-22 19:24:13 +01:00
e91b59b589 Merge branch 'blender-v2.92-release' 2021-01-22 11:28:59 -06:00
e845467d93 Fix: Mouse presses in some areas do not set active modifier
There are a couple of operations that are meant to set the active
modifier that currently don't. The first is a mouse press on the drag
icon on the right of the header, and the second is mouse presses on
modifier sub-panels headers.

This was an oversight in the implementation, especially the second,
because the blank space on the right of a sub-panel header often looks
just like the blank space elsewhere on the modifier's panel that
*does* set the active modifier.

Note that this purposefully doesn't include collapsing and expanding
the modifier as operations that set the active, since regardless of
whether that makes sense, it wasn't in the agreed upon design, which
would ideally not need changing for 2.92.

Differential Revision: https://developer.blender.org/D10155
2021-01-22 11:08:58 -06:00
735093dee8 Fix crashes from recent refactor rB131a758b6f88.
Much better to add a relation entry for all IDs, even if they are not
connected to any other ID.
2021-01-22 17:37:09 +01:00
3469e06c1a Fix memory leak when opening file browser
The name string of each file was duplicated but not freed. The new flag to
ensure the file-list frees the name wasn't set. Mistake in ca475479eb.
2021-01-22 16:58:23 +01:00
bbe6d44928 Cycles: optimize device updates
This optimizes device updates (during user edits or frame changes in
the viewport) by avoiding unnecessary computations. To achieve this,
we use a combination of the sockets' update flags as well as some new
flags passed to the various managers when tagging for an update to tell
exactly what the tagging is for (e.g. shader was modified, object was
removed, etc.).

Besides avoiding recomputations, we also avoid resending to the devices
unmodified data arrays, thus reducing bandwidth usage. For OptiX and
Embree, BVH packing was also multithreaded.

The performance improvements may vary depending on the used device (CPU
or GPU), and the content of the scene. Simple scenes (e.g. with no adaptive
subdivision or volumes) rendered using OptiX will benefit from this work
the most.

On average, for a variety of animated scenes, this gives a 3x speedup.

Reviewed By: #cycles, brecht

Maniphest Tasks: T79174

Differential Revision: https://developer.blender.org/D9555
2021-01-22 16:08:25 +01:00
131a758b6f Refactor BMain relations temp data.
`bmain.relations` is used to store temp data of relations between IDs,
to speed-up some complex processes heavily relying on such information.

Previous implementation was failry unclear/confusing, and required a
not-so-nice hack to 'tag' some ID as processed.

New code changes as such:
* Using `from`/`to` naming (instead of `user`/`used`).
* More clear separation between `to` `id_pointer` and `from` one,
  using an union instead of hacking around difference between `ID *` and
  `ID **` pointers.
* Adds storage of `session_uuid` informations (mainly useful as
  debug/ensuring proper consistency of data currently).
* Adds a structure per ID in the mapping. This enables possibility of
  storing tags (and potentially more  data in the future) per-ID,
  without polluting the IDs themselves with very short-life info.

Differential Revision: https://developer.blender.org/D10164
2021-01-22 16:05:17 +01:00
be7106a974 LibOverride: Add an 'post apply' callback to IDTypeInfo.
Currently this is needed to properly tag PointCache's for info update
(fixes an issue reported in T82503).

Suspect we may need this in more cases in the future though, RNA
assign/update processes are not always 100% enough to deal with
complicated corner cases.
2021-01-22 15:31:15 +01:00
7e32bb8492 Merge branch 'blender-v2.92-release' 2021-01-22 14:32:01 +01:00
226eb5e366 Cycles: Fix usage of double floating precision in CNanoVDB
Double floating point precision is an extension of OpenCL, which might
not be implemented by certain drivers, such as Intel Xe graphics.

Cycles does not use double floating point precision, and there is no
need on keeping doubles unless there is an explicit decision to use
them.

This is a simple fix from Cycles side to replace double floating point
type with a type of same size and alignment rules. Inspired by Brecht
and Patrick.

Tested on NVidia Titan V, Radeon RX Vega M, and TGL laptop.

Differential Revision: https://developer.blender.org/D10143
2021-01-22 14:31:06 +01:00
18e063b69d Functions: use better conversion from float2 to float3
Previously float2 was converted to float3 by implicitly converting to a
float pointer first, which was then passed to the float3 constructor.
This leads to uninitialized memory in the z component of the new float3.

Ideally this should be solved in float2/float3 itself, but my first fix for
that resulted in a compile error: rB6ac0a3d83c8e5a39bd5356aa0d68e3166bd91e82

This is an alternative fix that can be used for now. Will have to look
into the conversion in more detail again.
2021-01-22 13:46:13 +01:00
7a07ca1f8c Merge branch 'blender-v2.92-release' 2021-01-22 13:41:35 +01:00
644976548d Revert "BLI: add conversion from float2 to float3"
This reverts commit 6ac0a3d83c.
2021-01-22 13:40:45 +01:00
9fbf3075ad Merge branch 'blender-v2.92-release' 2021-01-22 12:26:23 +01:00
2ba2d2bd9d Fix T76936: Mesh shape amended upon undoing in sculpt mode
Was happening when there are deform modifiers prior to the multires.

There are detail in the comment around sculpt_undo_refine_subdiv(),
but briefly: the subdiv was refined with wrong base mesh coordinates.

Differential Revision: https://developer.blender.org/D10158
2021-01-22 12:26:02 +01:00
7f96e6ed7e Merge branch 'blender-v2.92-release' 2021-01-22 12:17:44 +01:00
6ac0a3d83c BLI: add conversion from float2 to float3
Previously float2 was converted to float3 by implicitly converting to a
float pointer first, which was then passed to the float3 constructor.
This leads to uninitialized memory in the z component of the new float3.
2021-01-22 12:16:53 +01:00
ae4a430755 Merge branch 'blender-v2.92-release' 2021-01-22 11:54:43 +01:00
526373b897 Cleanup - Point Instance: Use own DNA struct
We will need to expand this node soon to add weight/count for different
elements inside the collection. For that it is better to have the node
to use its own DNA.
2021-01-22 11:47:47 +01:00
cd8893d446 Fix (unreported) LibOverride: hair cache settings not working.
Thanks to that same point cache being exposed in **four** different RNA
paths (twice in particle system, and twice in its embedded cloth
simulation settings).

Only way is to also make particle system overridable.
2021-01-22 11:39:56 +01:00
d179e1c6e4 Merge branch 'blender-v2.92-release' 2021-01-22 11:26:15 +01:00
0373d1b09f GPencil: Fix unreported Vertex Paint masking error
The masking was not working as expected and allowed to paint non selected strokes.
2021-01-22 11:25:32 +01:00
8eaea99d98 Merge branch 'blender-v2.92-release' 2021-01-22 20:00:14 +11:00
Stefan Werner
927d099ec0 Particles: Fixed thread work size calculation.
Dividing the workload by number of tasks in float is imprecise and
lead in some cases to particles not being calculated at all
(example: 20000 particles, 144 tasks).

Switching this calculation to integer makes sure we don't lose count.

Differential Revision: https://developer.blender.org/D10157
2021-01-22 09:30:35 +01:00
Stefan Werner
cdf564277c Particles: Fixed thread work size calculation.
Dividing the workload by number of tasks in float is imprecise and
lead in some cases to particles not being calculated at all
(example: 20000 particles, 144 tasks).

Switching this calculation to integer makes sure we don't lose count.

Differential Revision: https://developer.blender.org/D10157
2021-01-22 09:22:13 +01:00
3a9d43cf31 Fix outliner and animation editors exiting multi-object edit-mode
When multiple objects were in edit-mode,
only the active object would exit edit-mode.
2021-01-22 18:43:00 +11:00
2469ddc1a9 Cleanup: correct last spelling cleanup 2021-01-22 17:12:11 +11:00
c0bbb93b88 Cleanup: spelling, remove outdated/invalid comments 2021-01-22 16:54:35 +11:00
421c5127f4 Merge branch 'blender-v2.92-release' 2021-01-22 16:43:48 +11:00
295b21f56a Merge branch 'blender-v2.92-release' 2021-01-22 16:43:44 +11:00
ee5a4f41eb Fix the NLA setting the active object without exiting edit-mode
This is done by convention in the outliner and dope-sheet.

Missing edit-mode exit causes glitches with mixed object/edit-mode undo.
2021-01-22 16:08:12 +11:00
141f17eaf4 Fix dope-sheet exiting edit-mode when activating an object
Regression from d8992192e5
The original code relied on having a separate edit-object pointer
than the active object.
2021-01-22 16:00:31 +11:00
8d958fe685 Merge branch 'blender-v2.92-release' 2021-01-22 15:45:48 +11:00
1a30687c24 Fix undo crash on active object change without exiting edit-mode
While the previous fix for T84920 is correct, the crash could still be
triggered by changing the active object while in edit-mode.

Ensure stale data isn't used by tagging for depsgraph update when
edit-mode data is freed on undo.

While exiting edit-mode normally does this, it's possible to set the
active object to a non edit-mode mesh, skipping the mode-switch
operator and it's depsgraph tagging.
2021-01-22 15:43:25 +11:00
4f3fba2aa7 Merge branch 'blender-v2.92-release' 2021-01-22 12:42:20 +11:00
665eca85ba Merge branch 'blender-v2.92-release' 2021-01-22 12:42:15 +11:00
7b528b2a3a Fix T84920: Crash undoing object activation in the outliner
Regression from d8992192e5
The original code relied on having a separate edit-object pointer
than the active object.

Use a utility function to avoid code duplication as there are
other areas that have similar functionality.
2021-01-22 12:38:55 +11:00
99e5d5ba21 Fix marker camera switch + undo crashes in edit-mode
Selecting markers and cameras could crash when in edit-mode.

Only support this in object mode as mode-switching as part of
activating cameras doesn't seem like a priority.

This has the same root cause as T84920.
2021-01-22 12:38:55 +11:00
e391ad7bbc Merge branch 'blender-v2.92-release' 2021-01-21 23:24:19 +01:00
b9e07c1e0b Fix T84896: Boundary brush not affected by automasking
This uses the values form the stroke automasking cache to control the
falloff of all deformers in the boundary brush. Usually this is already
considered in the general brush falloff function for the rest of the
brushes, but this is one of the exceptions where the brush implements
its custom falloff.

Reviewed By: JacquesLucke

Maniphest Tasks: T84896

Differential Revision: https://developer.blender.org/D10161
2021-01-21 23:23:08 +01:00
96fa78f5b0 Fix editors showing old data-block name after renaming in Outliner
E.g. the graph editor channels list would still show the old name of a material
that was renamed in the Outliner. Same for the Asset Browser when showing
data-blocks in the "Current File" repository.

The Outliner didn't send the notifier for some data-block types that editors
listen to for data-block name changes.
2021-01-21 22:56:38 +01:00
ca475479eb Fix Asset Browser showing old name after renaming data-block
The "Current File" asset library didn't get refreshed after the data-block name
changed. But rather than entirely refreshing the file list, or doing possibly
problematic partial refreshes, reference the data-block name directly, so a
simple redraw gets the new name displayed.

Addresses T83751
2021-01-21 22:23:43 +01:00
41982af6a0 Merge branch 'blender-v2.92-release' 2021-01-21 21:59:56 +01:00
f24992d2ec GPencil: Deactivate interpolation of gpencil curves
To avoid unexpected behavior and desync issues with
stroke and curve data, the interpolation operators are deactivated
in curve edit mode.
2021-01-21 21:58:39 +01:00
b4b02eb4ff UI: Transform Arrow Cursor Refactor
Mouse cursors used during transforms made to work better with changes of user scale and line width.

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

Reviewed by Campbell Barton
2021-01-21 08:19:26 -08:00
ceb500df03 Geometry Nodes: fix losing data when attribute has incorrect type
Differential Revision: https://developer.blender.org/D10165
2021-01-21 17:02:07 +01:00
425e706921 Geometry Nodes: new Attribute Sample Texture node
This node allows sampling a texture for every vertex based on some
mapping attribute. Typical attribute names are the name of a uv map
(e.g. "UVMap") and "position". However, every attribute that can be
converted to a vector implicitly is supported.

It should be noted that as of right now, uv map attributes can only be
accessed after a Point Distribute node.

Ref T82584.

Differential Revision: https://developer.blender.org/D10121
2021-01-21 16:49:06 +01:00
a92ebab5da Windows: Add "--debug-cycles" argument to "blender_debug_gpu.bat" batch file
This extends the "blender_debug_gpu.bat" batch file to also be useful for triaging Cycles
problems. OptiX initialization errors or problem while iterating CUDA devices are only
logged when the `--debug-cycles` flag is specified, so adding that here.

Reviewed By: brecht, LazyDodo

Differential Revision: https://developer.blender.org/D10167
2021-01-21 16:47:16 +01:00
b32e8e5ba7 Gpencil: Fix missing change in previous commit
This was related to the changes for Layer and Frame duplication.
2021-01-21 16:04:12 +01:00
cfd54ad7d7 GPencil: New option to Duplicate Layers with Empty Keyframes
This option allows to duplicate the layer and keyframes but without copying the strokes. This is very handy for the cleanup and paint process.
2021-01-21 16:00:12 +01:00
9c4c3fbabc GPencil: Make Layer and Frame duplicate functions more flexible
Now it's possible to copy only part of the data. This will be used in future operators.
2021-01-21 15:57:10 +01:00
3fd92b5c22 Fix T83344: Cycles baking + progressive refine fails 2021-01-21 15:12:17 +01:00
f817a11dc6 Cleanup: variable rename.
Avoid using two or three chars names when it's not absolutely obvious
what they mean.
2021-01-21 14:59:25 +01:00
1135790ad5 Asset Browser: Enable by default in alpha builds
The Asset Browser is still considered an experimental feature right now. But it
can be enabled by default for alpha builds, to get further testing and
feedback. It will hopefully be a non-experimental feature by the end of bcon1.
This is done in agreement with Dalai.
2021-01-21 14:40:13 +01:00
84702bd3d8 Fix T84242: freestyle animated camera shift lags behind in animation render 2021-01-21 14:21:49 +01:00
f4d07196bd Merge branch 'blender-v2.92-release' 2021-01-21 13:20:58 +01:00
aff7d59986 Fix T84908: Cycles GPU + CPU and denoising failure after recent fix 2021-01-21 13:20:05 +01:00
324d6d2192 Tracking: Cleanup, yet another spelling in the same line
Spotted by Jacques, thanks!
2021-01-21 12:53:14 +01:00
649c87814d Merge branch 'blender-v2.92-release' 2021-01-21 12:42:21 +01:00
9237b2019c Fix T84867: Transform node applies transforms in the wrong order 2021-01-21 12:39:30 +01:00
35f379ba26 Tracking: Actual spelling cleanup in the comment
The previous spelling cleanup did not catch this, so didn't the
review of the coming proportional editing code change.
2021-01-21 12:34:37 +01:00
793547e7d1 Geometry Nodes: initial support for volumes
For the most part, this just adds boilerplate code for volume support in geometry nodes:
* Add `VolumeComponent` next to `MeshComponent`, etc.
* Support `VolumeComponent` in depsgraph object iterator.

Furthermore, I added initial volume support in a few nodes:
* The Object Info node outputs an object instance when the input is a volume object
  (that will be the same for mesh objects soonish, to avoid copies).
* Support transforming a `VolumeComponent` in the Transform node.
* Support the `VolumeComponent` in Join Geometry nodes, but only when just one of the
  inputs has a volume component for now.

Right now, there is no way to create a `VolumeComponent`, because the Object Info node
outputs an object instance. The `VolumeComponent` will be necessary for upcoming nodes,
which will generate volumes on the fly.

Viewport selection does not work correctly with `VolumeComponent`s currently. I don't
know why that is. That can be figured out a bit later, once we can actually create
new volumes in geometry nodes.

Ref T84604.

Differential Revision: https://developer.blender.org/D10147
2021-01-21 10:32:42 +01:00
985bc08688 Merge branch 'blender-v2.92-release' 2021-01-21 16:37:52 +11:00
eb45e7be47 UI: particle tool properties layout tweaks
Adopt some of the newer layout abilities to
clean up the Particle Tool Properties a bit.

- Use in-line check-boxes next to values.
- Use text heading for Preserve toggles and mirror/topology mirror.

Reads clearer. Uses less space. Is more consistent.

Reviewed By: #user_interface, pablovazquez, Blendify, campbellbarton

Ref D10130
2021-01-21 16:08:43 +11:00
William Reynish
cd4e27a4a1 Industry Compat Keymap: Fix box/lasso selection for GP edit mode
There was a bug which which prevented box and lasso select to work
correctly in GP Edit Mode. It would select a nearby vertex before the
box selection.

This patch fixes it so it works with a click event,
like the default keymap, which fixes box and lasso selection.

Ref D10119
2021-01-21 15:11:33 +11:00
011a79215d Merge branch 'blender-v2.92-release' 2021-01-21 15:00:58 +11:00
d7cfee0b68 Fix use of uninitialized variable in image sequence detection
Uninitialized stack memory was being re-used in a loop.

Error in original commit from 04f81c8225

This happened to work as the same memory location was re-used
between iterations and not overwritten.
2021-01-21 14:59:40 +11:00
b243fab16b Merge branch 'blender-v2.92-release' 2021-01-21 14:05:59 +11:00
eaf5ee8981 Cleanup: NULL used for boolean 2021-01-21 14:05:16 +11:00
41a945d746 Docs: add note on convention for setting line-width 2021-01-21 11:12:11 +11:00
7b45850eac Cleanup: spelling 2021-01-21 10:59:50 +11:00
b303769d2e Merge branch 'blender-v2.92-release' 2021-01-20 20:01:40 +01:00
c60c30205d Fix T82966, T78152: Cycles GPU render hair ribbon artifacts and differences
Now it should match CPU rendering much more closely.
2021-01-20 19:59:43 +01:00
c07c110467 Merge branch 'blender-v2.92-release' 2021-01-20 18:18:38 +01:00
b33d839162 Fix T84867: Transform node does not rotate/scale instances
The manipulation of rot/scale was simply not implemented.
2021-01-20 18:17:25 +01:00
a823e825c8 Fix T84569: crash when trying to bake an object with no faces
Differential Revision: https://developer.blender.org/D10125
2021-01-20 18:07:51 +01:00
0d599ce95a GPencil: Fix unreported NaN value for UV Rotation in Primitives
Using primitive drawings, the point UV rotation was not initialized.
2021-01-20 16:53:42 +01:00
e12eb89f22 Fix T81429: move tool's axis constraints not drawn completely when using local orientation
In fact, the drawing was that of the local contraint axis (which is
summarized so as not to fill the screen with too much information).

Use the local contraint axis only when more than one object is selected.
2021-01-20 12:35:38 -03:00
736b0d6894 Revert "Transform: Use orientation of active object with Auto Constraint"
This reverts commit 54f248fa87.

And fixes T84259.

Apparently the ideal behavior was the previous one.
2021-01-20 12:28:00 -03:00
1f691050e5 Fix T84539: cryptomatte metadata lost when using save buffers option 2021-01-20 14:59:23 +01:00
10d2cbfa36 Fix T84872: OptiX GPU + CPU rendering uses branched path samples
Branched path tracing is not supported for OptiX, and it would still use the
number of AA samples from there when branched path was enabled by the user
earlier but auto disabled and hidden in the UI when using OptiX.

Ref D10159
2021-01-20 14:59:23 +01:00
1451f7d093 Fix T84813: enabling Cycles OpenImageDenoise during GPU viewport render fails 2021-01-20 14:59:23 +01:00
fc5f9a8ac9 Merge branch 'blender-v2.92-release' 2021-01-20 14:40:46 +01:00
4a09907eab Fix T84049: Crash when using Cycles Progressive Refine with OptiX+CPU
Tile stealing may steal a CPU tile buffer and move it to the GPU, but next time around that
tile may be re-used on the CPU again (in progressive refinement mode). The buffer would
still be on the GPU then though, so is inaccessible to the CPU. As a result Blender crashed
when the CPU tried to write results to that tile buffer.
This fixes that by ensuring a stolen tile buffer is moved back to the device it is used on before
rendering.
2021-01-20 14:40:27 +01:00
6a8f4bfc60 Tracking: Fix missing average of track offset 2021-01-20 14:07:48 +01:00
b01c865687 Merge branch 'blender-v2.92-release' 2021-01-20 13:48:44 +01:00
87db3423c9 Fix Lock to Selection does not work in mask mode
A regression since 2.80: need to use evaluated mask to calculate
its bounds. Non-evaluated mask does not contain state for the
current frame, so iterating over control points of the original
mask gives points state from the time they were edited last (aka,
not affected by the animation).
2021-01-20 13:46:39 +01:00
Yevgeny Makarov
a73dfac519 Fix T73575: Zooming out a lot faster than zooming in
- Zooming out a lot faster than zooming in,
  it had the wrong aspect ratio, make all the preparations
  with the factors instead of deltas.
- Improved following the `zoom_invert`
  (should not apply to `MOUSEZOOM`) and "trackpad natural scroll"
  preferences.
- `zoomfac` adjustment, same as in `view_zoomdrag_modal`.

Ref D8686
2021-01-20 22:56:35 +11:00
Yevgeny Makarov
9425628c84 Fix T65837: Zoom Axis is not working in the Node Editor
It was already fixed for the mouse in
bcda8cc89b, T65837
now the same logic is applied for the track-pad.

Ref D8685
2021-01-20 22:56:35 +11:00
f2988543c2 Merge branch 'blender-v2.92-release' 2021-01-20 22:10:15 +11:00
8e5b6320a6 Add Object Tool: minor improvements to tool-tips 2021-01-20 21:47:52 +11:00
William Reynish
685419d6be UI: Object "Make Links" sub-menu overhaul
- Rename to "Link/Transfer Data".
- Move Mesh Data Transfer operators here from the Relations sub-menu.
- Clarify which operations links to, copies or transfers/projects
  data using Link, Copy and Transfer leading text.
- Re-order contents to fit each category and add separators.
- Add enum tool-tips.

Reviewed By: Blendify, campbellbarton pablovazquez, mont29

Ref D10090
2021-01-20 20:51:44 +11:00
91bf24dd00 Cleanup: clang-format 2021-01-20 20:43:58 +11:00
f0ab9034d9 Merge branch 'blender-v2.92-release' 2021-01-20 20:42:54 +11:00
aee7d8f411 Cleanup: clang-format 2021-01-20 20:42:15 +11:00
e69034e6d9 Merge branch 'blender-v2.92-release' 2021-01-20 10:16:30 +01:00
c082b21625 Fix typo in UI message.
Noted by Satoshi Yamasaki (@yamyam) in rBTS5522.
2021-01-20 10:15:59 +01:00
160d8c1ea6 Merge branch 'blender-v2.92-release' 2021-01-20 18:56:29 +11:00
fad8a753a9 Add Object Tool: adjust cursor alpha when near view aligned
The cursor-plane was too dense/bright when approaching view alignment.
2021-01-20 18:55:44 +11:00
2c31a84bd1 Merge branch 'blender-v2.92-release' 2021-01-20 17:08:56 +11:00
1db904d954 Merge branch 'blender-v2.92-release' 2021-01-20 17:08:53 +11:00
74c6c504b2 Merge branch 'blender-v2.92-release' 2021-01-20 17:08:49 +11:00
908b383b7d UV: tweak face select behavior
When the mouse cursor is inside the UV face,
extend the selection threshold.

This means when zoomed in, a face can always be selected when the cursor
is inside it.
In the case of multiple overlapping faces - the face with the closest
center is used.

----

Prior to 246efd7286, the UV selection
threshold was scaled by the zoom level, so selecting a face when zoomed
in close would often often select faces even when the on-screen center
was outside the intended threshold.

Having a zoom-independent threshold may require more precision than
users are used to.

This change addresses this.
2021-01-20 17:07:20 +11:00
9f337bef80 Cleanup: move UvNearestHit.ob assignment in find nearest functions
Splitting assignments between functions complicates refactoring.

Also rename 'hit_final' to 'hit', since there are no longer a local
'hit' variable defined in these functions.
2021-01-20 17:00:39 +11:00
8bd5d58860 BMesh: add function to check if a point is inside a faces UV's 2021-01-20 16:56:59 +11:00
255c850e0b Cleanup: spelling 2021-01-20 16:15:53 +11:00
b2a6e2abdb Cleanup: remove extra in trailing asterisk
Comment blocks not conforming to convention.
2021-01-20 16:14:00 +11:00
69d30c1543 Merge branch 'blender-v2.92-release' 2021-01-20 16:11:22 +11:00
41d1729148 Merge branch 'blender-v2.92-release' 2021-01-20 16:11:19 +11:00
6f47549fe5 Merge branch 'blender-v2.92-release' 2021-01-20 16:11:15 +11:00
c7f6309437 Merge branch 'blender-v2.92-release' 2021-01-20 16:11:12 +11:00
b2037464e4 CMake: add missing headers
Resolves 'cmake_consistency_check' reports.
2021-01-20 16:08:52 +11:00
be970c03c2 Cleanup: spelling & cleanup for cmake_consistency_check
Much more could be done here, some obvious corrections.
2021-01-20 16:04:03 +11:00
d3fe320b83 CMake: update checking utility to ignore nanovdb files 2021-01-20 16:03:57 +11:00
0706a756f9 Cleanup: remove unused file SEQ_util.h
Committed by accident when SEQ_utils.h was also created.
2021-01-20 16:01:40 +11:00
6290091bac Cleanup: Store runtime space node variables in a separate struct
This commit moves runtime-only variables from the `SpaceNode`
DNA struct to a private struct in `node_intern.h`. Before, it was hard
to tell which data needed to be saved in files, this should make it
more clear.

Node that the `edittree` field is basically a runtime variable, since
it's set from the `treepath` list on read, but moving it would require
some more invasive changes that I don't think are worth it right now.
Also, not all of the moved variables were explicitly cleared on read--
`aspect` is set at the start of a redraw, `cursor` is set in a region
callback, and `recalc` was used as an update flag.

Differential Revision: https://developer.blender.org/D10141
2021-01-19 16:43:08 -06:00
da6dea5701 Cleanup: Use const arguments, explicit type 2021-01-19 16:09:34 -06:00
694032c9d1 Merge branch 'blender-v2.92-release' 2021-01-19 19:02:57 +01:00
c2e6969c56 Refactor modifier copying code.
Things like pointers to particle systems, or softbody data being stored
outside of its modifier, make it impossible for internal modifier copy
data code to be self-contained currently. It requires extra processing.

In existing code this was handled in several different places, in
several ways, and alltogether fairly inconsistently. Some cases were
even not properly handled, causing e.g. crashes as in T82945.

This commit addresses those issues by:
 * Adding comments about the hackish/unsafe parts `psys` implies when
   copying some modifier data (since we need to ensure particle system
   copying and remapping of those pointers separately).
 * Adding as-best-as-possible handling of those cases to
   `BKE_object_copy_modifier` (note that it remains fragile, but is
   expected to behave 'good enough' in any practical usecase).
 * Remove special handling for specific editor code
   (`copy_or_reuse_particle_system`). This should never have been
   accepted in ED code area, and is now handled by
   `BKE_object_copy_modifier`.
 * Factorize copying of the whole modifier stack into new
   `BKE_object_modifier_stack_copy`, now used by both `object_copy_data`
   and `BKE_object_link_modifiers`.

Note that this implies that `BKE_object_copy_modifier` and
`BKE_object_copy_gpencil_modifier` are now to be used exclusively to
copy single modifiers. Full modifier stack copy should always use
`BKE_object_modifier_stack_copy` instead.

Fix T82945: Crash when dragging modifiers in Outliner.

Maniphest Tasks: T82945

Differential Revision: https://developer.blender.org/D10148
2021-01-19 18:58:35 +01:00
bc95c249a7 Refactor modifier copying code.
Things like pointers to particle systems, or softbody data being stored
outside of its modifier, make it impossible for internal modifier copy
data code to be self-contained currently. It requires extra processing.

In existing code this was handled in several different places, in
several ways, and alltogether fairly inconsistently. Some cases were
even not properly handled, causing e.g. crashes as in T82945.

This commit addresses those issues by:
 * Adding comments about the hackish/unsafe parts `psys` implies when
   copying some modifier data (since we need to ensure particle system
   copying and remapping of those pointers separately).
 * Adding as-best-as-possible handling of those cases to
   `BKE_object_copy_modifier` (note that it remains fragile, but is
   expected to behave 'good enough' in any practical usecase).
 * Remove special handling for specific editor code
   (`copy_or_reuse_particle_system`). This should never have been
   accepted in ED code area, and is now handled by
   `BKE_object_copy_modifier`.
 * Factorize copying of the whole modifier stack into new
   `BKE_object_modifier_stack_copy`, now used by both `object_copy_data`
   and `BKE_object_link_modifiers`.

Note that this implies that `BKE_object_copy_modifier` and
`BKE_object_copy_gpencil_modifier` are now to be used exclusively to
copy single modifiers. Full modifier stack copy should always use
`BKE_object_modifier_stack_copy` instead.

Fix T82945: Crash when dragging modifiers in Outliner.

Maniphest Tasks: T82945

Differential Revision: https://developer.blender.org/D10148
2021-01-19 18:50:32 +01:00
bcdba7c34d UI: Deselect other objects when dragging into 3D View
When dragging an object into the 3D View, e.g. from the Outliner or the Asset
Browser, other objects wouldn't get deselected. That differs from what other
drop operations do, which create a new object. They deselect other objects in a
lower-level function, which happens to not be called for just dropping objects.
So I guess this is an oversight.
Old behavior was also a bit annoying because users seem to expect this to
deselect.
2021-01-19 18:47:20 +01:00
02a63115d2 Merge branch 'blender-v2.92-release' 2021-01-19 18:40:40 +01:00
c371d699ca Fix T84784: Time Remapping not displaying in the timeline
Caused by rBbbb2e0614fc3.

Oversight to not take the remapped framelength into account.

Maniphest Tasks: T84784

Differential Revision: https://developer.blender.org/D10134
2021-01-19 18:31:21 +01:00
7d114e5d87 Merge branch 'blender-v2.92-release' 2021-01-19 18:28:45 +01:00
36f0a1ead7 Fix T84823: crash rendering with unconnected input socket in File Output node
Caused by rB957e292c5864.

Now just skip unconnected sockets.

Maniphest Tasks: T84823

Differential Revision: https://developer.blender.org/D10137
2021-01-19 18:23:53 +01:00
b39ee69789 Merge remote-tracking branch 'origin/blender-v2.92-release' 2021-01-19 18:23:08 +01:00
d311a76931 Fix merge from 2.92 (subversion bump 292.14) 2021-01-19 18:20:12 +01:00
c3207d88c2 Object Info: Fix tooltip for the transform space option
This was agreed outside the patch discussion. And it did not make into
the submitted code on 8b777ee6d6.
2021-01-19 18:13:50 +01:00
40e089716b Merge branch 'blender-v2.92-release' 2021-01-19 18:12:34 +01:00
05179a0ba4 Volumes: fix calling BKE_volume_load from multiple threads
`BKE_volume_is_loaded` uses `grids.filepath` to determine if the
grids are already loaded. The issue was that `grids.filepath` was
set before the grids were loaded, resulting in incorrect early
returns for other threads.

Differential Revision: https://developer.blender.org/D10150
2021-01-19 18:01:22 +01:00
8b777ee6d6 Geometry Nodes - Object Info: option to apply obj transform to the geometry
By design the modified object transformations should still work and
affect the geometry nodes results. The current behaviour, however, would
make the geometry from the object info to not be affected by the
modified object transformations. This patch changes that by default.

In a similar fashion the Location, Rotation and Scale sockets outputs
should be aware of whether the output should be in the global space or in the
space of the nodetree.

To solve this, the patch introduces a new transformation space "enum"
where users can pick "Original" or "Relative" space.

Original
--------
Output the geometry relative to the input object transform, and the
location, rotation and scale relative to the world origin.

Relative
--------
Bring the input object geometry, location, rotation and scale into the
modified object maintaining the relative position between the two objects in
the scene.

Relative space violates a bit the design of the nodetree. The geometry in this
case is transformed so that moving the modified object doesn't interfere with
the geometry. This is particularly useful for the boolean node for instance.

"Original" is the default space, but old files are set to "Relative" for
backwards compatibility.

Differential Revision: https://developer.blender.org/D10124
2021-01-19 17:30:44 +01:00
9a32c7130b Geometry Nodes: pass depsgraph to nodes during execution
The depsgraph will have to be accessed in an upcoming patch.
2021-01-19 16:58:05 +01:00
d60b128274 Merge branch 'blender-v2.92-release' 2021-01-19 12:32:07 +01:00
a9203e25a2 Fix T84642: Reassign effect-strip ignores animdata
When reassigning an effect strip to another sequence, any animation data
in the effect strip will not be offset like expected.

The fix calls `SEQ_offset_animdata` to offset the animation data after
the seqence has been moved.

Reviewed By: ISS

Maniphest Tasks: T84642

Differential Revision: https://developer.blender.org/D10096
2021-01-19 12:31:02 +01:00
089cd25982 Merge branch 'blender-v2.92-release' 2021-01-19 20:43:49 +11:00
a86bb2594f Fix T84698: error adding movie clip tracks
The movie clip's `region->v2d` was being resized by the view2d code,
causing mouse cursor to movie-clip coordinate mapping to fail.

This commit removes `UI_view2d_region_reinit`,
matching the behavior for the image editor's 2D view.

Reviewed By: sergey

Ref D10106
2021-01-19 20:39:31 +11:00
df2ed1550d Fix T74755: Cap of curve doesn't have smooth shading
Copy the smooth setting when filling in curve caps.

For drawing this doesn't change behavior as a single normal is used
for all faces.

The difference may be noticed when converting to a mesh or with
modifiers applied.
2021-01-19 17:24:25 +11:00
1cc54107a9 Merge branch 'blender-v2.92-release' 2021-01-19 17:14:47 +11:00
d26588268d Merge branch 'blender-v2.92-release' 2021-01-19 17:14:43 +11:00
418cd7c4ba Fix T84041: Bevel caps have invalid normals
Bevel caps always had incorrect normals, causing display glitches
in some cases.

It seems this never worked properly (at least 2.79 also had this bug).

Use the projection vector as the normal.
2021-01-19 17:12:01 +11:00
e25f7e33ff Fix T84568: UV loop selection marks edges sharp
Regression in 6a10e69d27
(added when testing).
2021-01-19 15:32:00 +11:00
94e9d3ca3e Merge branch 'blender-v2.92-release' 2021-01-19 13:36:53 +11:00
d31dd1da80 Fix T84824: Incorrect height using interactive add tool
When using the interactive add tool for primitives with a fixed
height and base aspect ratio, the height of the created primitive
would be incorrect (two times too small or two times too big).

When the base origin was centered, the `fixed_aspect_dimension`
was not changed even though the base length was doubled.
Additionally, when the height origin was centered but the height
aspect ratio was fixed, the height was doubled leading to an
incorrect size.

The fix doubles `fixed_aspect_dimension` when the base origin is
centered and correctly calculates the height of the primitive when
the aspect ratio is set to fixed.

Ref D10140
2021-01-19 13:20:02 +11:00
2fa7e81d9c Cleanup: use 'const' argument for parameter argument 2021-01-19 12:59:00 +11:00
d144337098 Merge branch 'blender-v2.92-release' 2021-01-19 12:45:11 +11:00
58e554a55c Fix T66681: Blender 2.7x keymap inconsistencies
Match Blender 2.7x keymap more closely.

- Image Editor: F3 for save image as.
- Node Editor: Ctrl-LMB to cut links.
- Cycle the falloff types instead of showing a pie-menu.
- Use regular menu instead of pie menu for snapping.
2021-01-19 12:20:48 +11:00
09c7c63890 UI Code Quality: Use "params" struct for area and region callbacks
These functions with many arguments can be unwieldy. Aside from the obvious issues
with rewriting the list of arguments and the opportunities for error and frustration
that presents, the long list of arguments make these systems hard to change. So when
an argument should be added, someone might skip that and add some hack instead.

So, as proposed in T73586#1037210, this patch instead uses a "params" struct for
each of these callbacks.

- Use param argument for `ARegionType.listener`
    - Remove unused window field in region listener
- Use param argument for `SpaceType.listener`
- Use params struct for `ARegionType.message_subscribe`

Differential Revision: https://developer.blender.org/D9750
2021-01-18 17:28:47 -06:00
4b4aec2884 Cleanup: Clang tidy else after return 2021-01-18 14:21:24 -06:00
bfa083f873 Cleanup: Clang tidy else after return 2021-01-18 12:48:51 -06:00
40d6ee5304 Merge branch 'blender-v2.92-release' 2021-01-18 20:08:41 +03:00
b5c3f26cba Armature: fix B-Bone deformation blending artifacts with Preserve Volume.
The double quaternion blending method in addition to the deformation
matrix of each bone requires their rest matrices. For ordinary bones
this literally should use the bone rest matrix without any ambiguity.

However, it was also using the bone rest matrix for all of its
B-Bone segments, which is incorrect and causes strange deformation
in some cases involving extreme non-uniform scale, especially
at boundaries between different B-Bones. There is also a similar
known issue that happens with scale at bending joints, and this
fix reduces the distortion when both bones are B-Bones.

This changes both the Armature modifier and the Armature constraint
to use the actual segment rest matrices. Unlike bones, these can have
scale even in rest pose, so normalization is required.

Differential Revision: https://developer.blender.org/D10003
2021-01-18 20:08:16 +03:00
f17b26bbed Tracking: Implement tracks average operator
Average selected tracks into the new one. This can be used to improve
stability of tracking on blurry or non-very-sharp feature shapes.

Averaging happens for all position, pattern corners and search area.
Disabled markers do not take effect on averaging. Keyframed flag is
copied from source.

Gaps in the source tracks will be linearly interpolated, to reduce
result track jump. Note that this only applies to gaps "inbetween".
This means that if an input track doesn't have markers in the
beginning/end of it, there is nothing to interpolate with and the
result track will jump.

Available from the Track panel, under the Merge category.

Differential Revision: https://developer.blender.org/D6323
2021-01-18 16:38:40 +01:00
0ac8fec3be Tracking: Add interpolated accessor for markers
Allows to get marker position interpolated through out a gap.

Currently unused, but is covered with test. Aimed to be used for
track average operator.
2021-01-18 16:38:40 +01:00
0ca0d3366d Tracking: Re-write marker request function
There are two main things.

First, remove the marker index caching. Thins makes it possible to
safely use function from a threaded environment.

Second, replace linear search with binary search, which speeds up
random lookup.

There is no measurable difference in the stabilization which had a
comment about caching nature of track lookup. The random lookup
complexity changed from O(N) to O(log N). In practice this also
unlikely to be measurable, but thread-safety worth it.
2021-01-18 16:38:40 +01:00
f508292277 Fix T84719: Doversion for curve edit settings
Make sure default values for curve edit mode are filled for older files.

Reviewed By: antoniov

Maniphest Tasks: T84719

Differential Revision: https://developer.blender.org/D10136
2021-01-18 16:29:09 +01:00
5e0ef4ef85 Fix T84719: Doversion for curve edit settings
Make sure default values for curve edit mode are filled for older files.

Reviewed By: antoniov

Maniphest Tasks: T84719

Differential Revision: https://developer.blender.org/D10136
2021-01-18 16:23:13 +01:00
0145c8d484 Merge branch 'blender-v2.92-release' 2021-01-18 15:47:33 +01:00
0d8948387e Cycles: Fix missing OpenCL extensions in certain cases
If extensions string is longer than 1024 then the old code would have
reported empty string instead of extensions.

Now the code does dynamic string allocation to store result of request,
similar to what is done in `OpenCLInfo::get_hardware_id`.

The code looks a bit ugly, but it didn't really change much with this
patch. In other words, the code can become more modern and clear, but
it is considered to be outside of the scope of this change.

Differential Revision: https://developer.blender.org/D10135
2021-01-18 15:47:00 +01:00
ce0f212498 Merge branch 'blender-v2.92-release' 2021-01-18 15:30:48 +01:00
4fde594fda Fix T84650: CPU render + OptiX denoiser leaves empty tiles unprocessed
The OptiX denoiser is part of the OptiX device, so to the tile manager looks like a GPU device. As a
result the tile stealing implementation erroneously stole CPU tiles and moved them to that OptiX
device, even though in this configuration the OptiX device was only set up for denoising and not
rendering. Launching the render kernel therefore caused a crash because of a missing AS etc.
This fixes that by ensuring tiles can only be stolen by devices that support render tiles.
2021-01-18 15:30:25 +01:00
023ebb890b Merge branch 'blender-v2.92-release' 2021-01-18 15:02:24 +01:00
1c2b203795 Fix T84600: prevent bone groups operators on proxies and library
overrides

Editing bone groups is not supported on proxies/overrides [changes a re
lost on file reload], need to do proper polling (and also prevent this
from rna) for:

- adding bone groups
- removing bone groups
- renaming bone groups
- setting bone groups colors

Previously, this was hinted at by setting the layout inactive, with
preoper polls, this is now not needed anymore.

note: Selection of bone groups actually makes sense here and is
supported, so this is not prevented in this patch, but UI wise this is
not nice in the override case, because one cannot set an active_index
(aka select) in the UI list.

Maniphest Tasks: T84600

Differential Revision: https://developer.blender.org/D10131
2021-01-18 15:00:37 +01:00
a1fb3dc7ae Fix T84808: Individual projection works even when snap options don't affect the transform mode
Individual projection is a different branch of snap and always projects
the transformed elements on the surface of objects.

Perhaps this option should be limited to the Move mode due to similarity.

But in order not to change the current behavior too much, this commit only
disables this option in modes not affected by snap.
2021-01-18 10:57:45 -03:00
3584f1d224 Merge branch 'blender-v2.92-release' 2021-01-18 14:07:11 +01:00
b4530deec4 Fix T84586: missing Outliner redraws for certain NLA operators
Outliner display under 'Animation' > 'NLA Tracks' was not updating in
the following cases:
- adding strips
- removing strips
- duplicating strips (possibly to different track)
- swapping strips
- reordering tracks
- changing strip order by translating
- translating strips between tracks
- renaming tracks

In the case of deleting strips/tracks, this was also resulting in a use-
after-free error in Outliner drawing code (this was reported specifically
in T84586).

Most of these operators already sent a ND_NLA|NA_EDITED notifier, but the
Outliner is not listening to these. Listening to NA_EDITED is also not
what we want since this also happens a lot in cases irrelevant to the
Outliner. Now be a bit more specific and send ND_NLA|NA_ADDED / ND_NLA|
NA_REMOVED or a new ND_NLA_ORDER (to distinguish from NA_EDITED
'only' - where a redraw is not neccessary) and listen to these from the
Outliner.

(note: places that were listening to ND_NLA|NA_EDITED before are also
listening to NA_ADDED or NA_REMOVED, so changing NA_EDITED should not be
a problem here)

(note 2: for cases like swapping tracks/strips order, NA_ADDED or
NA_REMOVED does not make sense, neither can we use NA_EDITED [since we
dont want to listen to this], so in this case an additional ND_NLA_ORDER
is now sent)

(note 3: in nla transform code, this is now always sent on confirm. There
are cases were the notifier would not be needed, but checking exactly all
cases were it actually would be needed seems overkill [history of D10073
has example code to check if strips moved between tracks])

Maniphest Tasks: T84586

Differential Revision: https://developer.blender.org/D10073
2021-01-18 13:58:31 +01:00
e061bbadec Merge branch 'blender-v2.92-release' 2021-01-18 13:55:11 +01:00
dfdf79fb03 Fix T84250: Eevee world/material parameter animation not updating the viewport
The WORLD_UPDATE operation (needed to free the gpu material) was already
defined in DepsgraphNodeBuilder::build_world, but corresponding relation
was only set up for changes in the nodetree, not for changes in the
world/material itself in DepsgraphRelationBuilder::build_world.
Direct changes to these surface properties in the UI were updating
properly through RNA property update callbacks, but these are not called
from the animation system.

So now add these relations in the depsgraph.

Not 100% sure this is the right place for this (since e.g. eevee engine
seems to handle e.g. animated light paramters just fine through
EEVEE_cache_populate / eevee_light_setup, but properly freeing gpu
materials wont happen for worlds in e.g eevee_id_world_update and also
not for materials)

Maniphest Tasks: T84250

Differential Revision: https://developer.blender.org/D9959
2021-01-18 13:51:28 +01:00
95af2e39f6 Merge branch 'blender-v2.92-release' 2021-01-18 12:18:31 +01:00
9f2271d354 Fix T84739: Crash with curve brush in sculpt mode.
No idea why we did not pass context to `ED_paintcurve_undo_push_end`, it
is easily availbale everywhere...
2021-01-18 12:15:46 +01:00
6251eb8bda Merge remote-tracking branch 'origin/blender-v2.92-release' 2021-01-18 12:02:55 +01:00
Karthik Rangasai Sivaraman
c85317e669 Fix T83657: Pose Mode: Clearing transform doesn't respect Mirror X
Extend the pose bone "clear loc/rot/scale" functions so that they
respect the "Mirror X" option.

Reviewed By: sybren

Maniphest Tasks: T83657

Differential Revision: https://developer.blender.org/D9938
2021-01-18 11:59:45 +01:00
Karthik Rangasai Sivaraman
f7a5695676 Fix T83657: Pose Mode: Clearing transform doesn't respect Mirror X
Extend the pose bone "clear loc/rot/scale" functions so that they
respect the "Mirror X" option.

Reviewed By: sybren

Maniphest Tasks: T83657

Differential Revision: https://developer.blender.org/D9938
2021-01-18 11:59:14 +01:00
4ef0654449 GPencil: Fix Autojoin error using layer transform
The target stroke bounding box was not checked properly and when using layer transform the error was noticeable, but really the error was before the layer transform commit.
2021-01-17 12:35:27 +01:00
502eadb2f7 Merge branch 'blender-v2.92-release' 2021-01-17 21:40:11 +11:00
ced673c833 Merge branch 'blender-v2.92-release' 2021-01-17 21:40:07 +11:00
9fb755fe4c Merge branch 'blender-v2.92-release' 2021-01-17 21:40:03 +11:00
2ee2f87f29 Add Object Tool: move extra settings popover last
This is intended to be used when settings don't fit in the top bar,
so it makes sense to keep them last.
2021-01-17 21:36:49 +11:00
06da6e2eaf Add Object Tool: scale the cursor plane based on the depth
Draw the cursor plane smaller then further away from the view.

This makes the plane being drawn onto easier to perceive.
2021-01-17 21:21:18 +11:00
5f9358a373 Add Object Tool: split aspect & origin options for base/height
In practice it's common these settings shouldn't be linked for drawing
the initial (base) plane, compared with the height.
2021-01-17 21:16:22 +11:00
14bb9f09ab Merge branch 'blender-v2.92-release' 2021-01-17 18:30:14 +11:00
54c28e5bfb Merge branch 'blender-v2.92-release' 2021-01-17 18:30:10 +11:00
ca476a638c RNA: report an error when the name property is set twice
This helps avoid copy-paste errors which have happened a few times,
no functional changes.
2021-01-17 18:24:34 +11:00
66a87fc9f4 Fix workspace tool name property
The fallback tool was used as the tool name.

Regression in a8ce9a143a
2021-01-17 18:24:34 +11:00
1e8ed36a90 Merge branch 'blender-v2.92-release' 2021-01-16 13:11:33 -06:00
Wannes Malfait
6fb7d0f559 Fix T84713: Geometry nodes reroute sockets have incorrect type
This implements the node tree update function, which is needed so that the
reroutes get updated to the correct type. It is based on the same code in
the shader and compositor node trees.

Differential Revision: https://developer.blender.org/D10123
2021-01-16 13:09:19 -06:00
4e8c78245d GPencil: Hide layer if the scale is zero
When scale a layer to zero must be hidden.
2021-01-16 19:36:00 +01:00
24cdffde55 GPencil: Cleanup - Rename ED_gpencil_stroke_color_use to ED_gpencil_stroke_material_editable 2021-01-16 16:44:49 +01:00
f5ec29023d GPencil: Fix initial value for fill factor after last changes
The value has changed due a previous commit and the minimum value cannot be 0.
2021-01-16 16:36:49 +01:00
e02d84eb3b GPencil: Add new parameteres to transform layers
When using grease pencil for drawing Storyboards, it's very common to require a transform of the layers. This transform can be done using the offset modifier, but in some cases, the scene requires a lot of modifiers and makes the file hard to work.

This new feature adds a transforms Location, Rotation and Scale at Layer level, and allows to transform the layer without using a modifier, keeping the scene more clean.

{F9480695}

This feature was suggested by @pepeland after receiving feedback from several artists.

Also, done some code cleanup and rename some functions to get a better naming.

Maniphest Tasks: T83660

Differential Revision: https://developer.blender.org/D9761
2021-01-16 15:46:45 +01:00
0a44c4b594 Merge branch 'blender-v2.92-release' 2021-01-16 15:26:43 +01:00
1e193a0b56 Fix T84757: feedback loop with when modifying vertex group with nodes
The issue was that the mesh shared its vertex weights with the
original mesh (to reduce memory consumption). The solution is
to make a local copy of the vertex weights in this case.
2021-01-16 15:24:22 +01:00
79dd9fedb2 Fix T84758: Revert "LibOverride: Also consider regular embedded IDs as virtual overrides."
This made Blender considers all materials to be overridden.

This reverts commit 2aa7bc06e7.
2021-01-16 10:28:47 +01:00
3cc1bcce4f Merge branch 'blender-v2.92-release' 2021-01-16 11:39:37 +11:00
7573631d69 Merge branch 'blender-v2.92-release' 2021-01-16 11:39:34 +11:00
d4ffccbeae Merge branch 'blender-v2.92-release' 2021-01-16 11:39:31 +11:00
3adb9530bb Merge branch 'blender-v2.92-release' 2021-01-16 11:39:29 +11:00
3856c58f5d Merge branch 'blender-v2.92-release' 2021-01-16 11:39:27 +11:00
6403c8c025 Merge branch 'blender-v2.92-release' 2021-01-16 11:39:23 +11:00
39b752316d Merge branch 'blender-v2.92-release' 2021-01-16 11:39:21 +11:00
66161ba3a1 Merge branch 'blender-v2.92-release' 2021-01-16 11:39:12 +11:00
f7829961c6 Add Object Tool: include shortcuts in the tool-tip 2021-01-16 11:37:52 +11:00
ecffd231a0 Add Object Tool: add initial "Fixed Aspect" option
This makes it more convent to add many objects with a fixed aspect ratio.
2021-01-16 11:37:52 +11:00
fef7b792e7 Add Object Tool: make UI more compact
Move some of the more obscure options into a popover,
so they don't take up so much room in the top-bar.
2021-01-16 11:37:52 +11:00
cdfa3feb91 Add Object Tool: support incremental snapping
This adds a "Snap to" option that allows using all the scenes snap
settings which includes incremental & absolute grid snapping options.

This is optional because always following scene snapping would not
snap to geometry by default (which seems to be the most useful default).
2021-01-16 11:36:55 +11:00
c4bbe44e47 Add Object Tool: workaround non-orthogonal orientation matrices 2021-01-16 11:32:00 +11:00
2f0d919f89 Add Object Tool: quiet warning setting size
The size property was only used for the cube
2021-01-16 11:32:00 +11:00
8fd3ffcb31 Add Object Tool: rename keymap, expose in keymap editor
Make the name follow the convention of other View3D keymaps.
2021-01-16 11:31:35 +11:00
27c142aa29 Add Object Tool: remove from experimental
Based on feedback from @dbystedt, include this in 2.92
with some updates (coming next).
2021-01-16 11:28:02 +11:00
a8436334bd Merge branch 'blender-v2.92-release' 2021-01-15 12:23:13 -08:00
957de39191 Fix T84645 cursor moves when clicking selector.
The absolute position desktop mapping has been corrected. The correct
mapping is 0-65535 inclusive. Additionally, division by the virtual
desktop width and height needed to be subtracted by 1 as width and
height are one more than the final pixel index.
2021-01-15 12:18:13 -08:00
Aaron Carlisle
f71a7d3914 Cleanup: Remove Unused tracking properties
These properties are unused and serve no purpose.

Reviewed By: sergey, #motion_tracking

Differential Revision: https://developer.blender.org/D9803
2021-01-15 14:58:24 -05:00
fa817b8c96 Merge remote-tracking branch 'origin/blender-v2.92-release' 2021-01-15 12:36:35 -07:00
de60dc84e2 Fix: Build error with MSVC 2017
BKE_cryptomatte_extract_layer_name was using std::isdigit
without including <cctype> somehow only MSVC 2017 had a
problem with that.
2021-01-15 12:36:03 -07:00
bf7fdd0f67 Cleanup: LibOverride: Update comment. 2021-01-15 19:36:38 +01:00
2aa7bc06e7 LibOverride: Also consider regular embedded IDs as virtual overrides.
Those (aka root node trees and master collections) share same 'traits'
as the shapekeys: RNA cannot assign them, so we need to handle them as
sub-data of their owner IDs.

Not sure how much this will help in improving support of overrides for
scenes and nodetrees, but this is a mandatory step towards that goal for
sure.
2021-01-15 19:27:49 +01:00
ce317c9faa LibOverride: fix/update/re-enable ID-related debug checks in diffing code.
We should now have the tools to ensure consistency of ID pointers
diffing in `rna_property_override_diff_propptr`.

As a reminder, for most ID pointers we just check the actual pointer value,
but this is not possible for embedded IDs like root node trees or master
collections, and for fake embedded ones like shapekeys, so those should be
handled as mere sub-data of their owner IDs in override context.
2021-01-15 19:18:26 +01:00
f1a577b38a Merge branch 'blender-v2.92-release' 2021-01-15 19:00:46 +01:00
dc69ef6f3b Fix T84373: Overrides : shapes keys driven by armature don't work on second instance.
Code generating override operations would not deal properly with Pointer
RNA properties, trying by default to use and check pointers' names
properties like it does with items of a collection.

However, using name property in pointer RNA property case makes no
sense, so specialize the `no_prop_name` flag for each case (pointer or
collection).

here, since second override would generate local data-blocks with
different names than the linked data ones, name matching would fail and
breck handling of override diffing in shapekeys.

Note that shape keys are the only one concerned by that problem, since
other embedded IDs (root node trees and master collections) are fully
real ones, so they always get the same names.
2021-01-15 19:00:38 +01:00
5cf04fe2ba Fix (unreported) copying liboverride of mesh breaks overrides of shape keys.
Our beloved shapekeys are 'virtual' overrides, they need special
snowflake treatment here as well.

They do not have any override data, from override perspective they are
considered as mere sub-data from their owning ID (mesh, lattice, etc.).
Therefore, we should not copy override data from them, but instead
properly flag those new IDs as `LIB_EMBEDDED_DATA_LIB_OVERRIDE`.

Found while investigating T84373.
2021-01-15 19:00:38 +01:00
319056679b Fix T84373: Overrides : shapes keys driven by armature don't work on second instance.
Code generating override operations would not deal properly with Pointer
RNA properties, trying by default to use and check pointers' names
properties like it does with items of a collection.

However, using name property in pointer RNA property case makes no
sense, so specialize the `no_prop_name` flag for each case (pointer or
collection).

here, since second override would generate local data-blocks with
different names than the linked data ones, name matching would fail and
breck handling of override diffing in shapekeys.

Note that shape keys are the only one concerned by that problem, since
other embedded IDs (root node trees and master collections) are fully
real ones, so they always get the same names.
2021-01-15 18:51:04 +01:00
69a7015e12 Fix (unreported) copying liboverride of mesh breaks overrides of shape keys.
Our beloved shapekeys are 'virtual' overrides, they need special
snowflake treatment here as well.

They do not have any override data, from override perspective they are
considered as mere sub-data from their owning ID (mesh, lattice, etc.).
Therefore, we should not copy override data from them, but instead
properly flag those new IDs as `LIB_EMBEDDED_DATA_LIB_OVERRIDE`.

Found while investigating T84373.
2021-01-15 18:50:50 +01:00
3459f75f5b Merge branch 'blender-v2.92-release' 2021-01-15 11:04:53 -06:00
0b0e45252b Geometry Nodes: Use a default value in the point scale node
This commit adds the ability to provide a default value to
`attribute_try_get_for_output` and uses it for the `Point Scale` node,
which is important because the node uses multiplication.

The idea is to keep "name-specific" functionality in nodes rather than in
the attribute API, otherwise the complexity will be hard to keep track of.
So this fix doesn't apply to the Attribute Vector Math node, but hopfully
that is okay since that's now a lower level node for this purpose anyway.

Differential Revision: https://developer.blender.org/D10115
2021-01-15 11:04:32 -06:00
237e27e161 Cleanup: Add const in various places in node code
Also includes some various other minor cleanups, like using bool
instead of int in a couple places.
2021-01-15 10:48:22 -06:00
20a54347ee Tracking: Fix transform cancel for plane tracks
Use exact marker accessor. Harmless due to the current way the
transform system is used by tracking. But for the future development
proper accessor needs to be used.
2021-01-15 17:42:13 +01:00
3732508c64 Fix T84745: build error with TBB 2021
task_group::is_canceling() was removed.
2021-01-15 17:29:36 +01:00
c4286ddb09 RNA: support range-based for loops in C++ api
Cycles has a lot of code like this:
```lang=c++
BL::Object::modifiers_iterator b_mod;
for (b_ob->modifiers.begin(b_mod); b_mod != b_ob->modifiers.end(); ++b_mod) {
```

Range-based for loops allow us to simplify this to:
```lang=c++
for (BL::Modifier &b_mod : b_ob->modifiers) {
```

In order to support this, a collection (such as `b_ob->modifiers`) must have
a `begin()` and `end()` method, that take no parameters and return an iterator.
The `end` method already exists, but the `begin` method takes the iterator as
argument currently.

This patch adds a new `begin` method that returns the iterator. The old `begin`
method is still available to avoid breaking existing code.

My assumption is that the old `begin` method took the iterator as parameter so
that the iterator is not copied or moved, i.e. its memory address is stable and
the destructor is only called once. I'm not sure if both of these requirements
are really necessary to ensure that the iterators work correctly. To be on the
safe side, I deleted the copy/move constructors/assignment operators.

Since C++17 there is "guaranteed copy elision" which basically allows us to
return a non-copyable and non-movable type from a function. To make that work,
I had to add a new constructor to `CollectionIterator` that calls `begin` on itself.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D10120
2021-01-15 16:35:22 +01:00
Piotr Barejko
340529a845 Fix Cycles build error with OSL 1.12
Differential Revision: https://developer.blender.org/D10118
2021-01-15 15:41:17 +01:00
df96a9c6ea Merge branch 'blender-v2.92-release' 2021-01-15 11:28:15 -03:00
c63442d2f2 Fix T84673: Skin resize operator always using object origin as pivot
The TransData converted to work in Skin Resize had no defined center.

Caused by rB54ee4109143b
2021-01-15 11:24:45 -03:00
cab6d5e94a Merge branch 'blender-v2.92-release' 2021-01-15 08:19:19 -06:00
6c840a2cb9 Fix "Make Instances Real" to work with nodes modifier instances
This commit changes the check at the beginning of the
"Make Instances Real" operator to account for the instances
created by nodes modifiers in the modifier stack.

Differential Revision: https://developer.blender.org/D10059
2021-01-15 08:18:52 -06:00
a51584dc70 Geometry Nodes: transfer corner and point attributes in Point Distribute node
If the mesh has any corner or point attributes (e.g. vertex weights or
uv maps), those attributes will now be available on the generated points
as well.

Other domains can be supported as well. I just did not implement those yet,
because we don't have a use case for them.

Differential Revision: https://developer.blender.org/D10114
2021-01-15 12:00:38 +01:00
04572f0899 Cleanup: spelling 2021-01-15 12:23:50 +11:00
dc59955481 Cleanup: use 'pragma once' 2021-01-15 12:17:11 +11:00
f03752b92f Nla: Rename NlaEvalChannel->valid to domain
For term consistency with usage.

The clarity is more for consistency with the nla domain() processing
function names and the core struct member name it stores the results
in, "valid". The name "domain", which implies a function can operate
on it, seems more natural than "valid", which implies something is
wrong if false.

No functional changes.

Reviewed by: sybren

Differential Revision: http://developer.blender.org/D9692
2021-01-14 19:27:46 -05:00
10ce2a1016 NLA: Redundant NlaEvalChannel Valid Mask Write
The field will already be properly written to in (anim_sys.c)
nla_eval_domain_action(). It's easier to understand the property's
usage after removing the redundancy.

No functional changes.

Reviewed by: ChrisLend, sybren

Differential Revision: http://developer.blender.org/D9689
2021-01-14 19:04:40 -05:00
32e4ded24b Nla Refactor: is_fcurve_evaluatable()
No functional changes.

Future patches {D8867} {D8296} make use of it.

Reviewed by: sybren, ChrisLend

Differential Revision: http://developer.blender.org/D9691
2021-01-14 18:47:12 -05:00
09709a7e64 Nla Refactor: Split animsys_evaluate_nla()
No intended functional changes.

Refactors animsys_evaluate_nla() into 2 versions:
animsys_evaluate_nla_for_keyframing(), animsys_evaluate_nla_for_flush()
to make it clear what data is being calculated and why.

Dummy strip creation has been refactored to two separate functions,
animsys_create_tweak_strip() and animsys_create_action_track_strip().
Both are evaluated differently from other strips and eachother. There's
no need to interweave them. A future patch D8296, generally requires
both strips.

___

XXX anim_sys.c) nlatrack_find_tweaked() is a temporary work around.
If anyone has any insight into this problem, help is appreciated.

Reviewed by: sybren

Differential Revision: http://developer.blender.org/D9696
2021-01-14 18:25:01 -05:00
b75552ebbb UI: Draw socket type colors on the left in group sockets list
Previously the colors were on the right for outputs, but this is now
unecessary because of the organization in separate panels after
rBb1d1a58c77fb1658.
2021-01-14 16:49:20 -06:00
40d391fa60 Fix T81533: NLA Properly Draw FModifiers
When NLA strips weren't time-aligned with the underlying action, then
fcurve modifiers would not be drawn anchored to the strip. Fmodifiers
were evaluating properly, they just weren't drawn with the proper
offset and scale.

To fix it in this specific case, I've chosen to undo the keyframe
remapping then remap the draw-evaluation-time from scene time to
fcurve time. Afterward, I redo the keyframe remapping so the controls
are properly drawn.

The Envelope fmodifier has special drawing code which was fixed too. In
this case, no mapping at all was happening. The solution was similar,
to remap the envelope control points from fcurve time to scene time.
2021-01-14 16:50:14 -05:00
Cody Winchester
7a4bdc3a4f Gpencil Noise - Add noise offset parameter
This patch adds a noise offset option to the grease pencil noise modifier.
It allows the user to animate the noise along the length of the stroke to create movement that is currently not possible.

It works by adding an offset to the noise table and adding the remaining floating point value to the noise table sampling.

Reviewed By: #grease_pencil

Differential Revision: https://developer.blender.org/D10021
2021-01-14 22:25:36 +01:00
Lukas Stockner
0f2ae614a1 Use mmap() IO for reading uncompressed .blends
Instead of submitting tons of tiny IO syscalls, we can speed things up
significantly by `mmap`ing the .blend file into virtual memory and directly
accessing it.

In my local testing, this speeds up loading the Dweebs file with all its
linked files from 19sec to 10sec (on Linux).

As far as I can see, this should be supported on Linux, OSX and BSD.
For Windows, a second code path uses `CreateFileMapping` and
`MapViewOfFile` to achieve the same result.

Reviewed By: mont29, brecht

Differential Revision: https://developer.blender.org/D8246
2021-01-14 22:03:29 +01:00
30dd31a7b3 Fix T81533: NLA Properly Draw FModifiers
When NLA strips weren't time-aligned with the underlying action, then
fcurve modifiers would not be drawn anchored to the strip. Fmodifiers
were evaluating properly, they just weren't drawn with the proper
offset and scale.

To fix it in this specific case, I've chosen to undo the keyframe
remapping then remap the draw-evaluation-time from scene time to
fcurve time. Afterward, I redo the keyframe remapping so the controls
are properly drawn.

The Envelope fmodifier has special drawing code which was fixed too. In
this case, no mapping at all was happening. The solution was similar,
to remap the envelope control points from fcurve time to scene time.
2021-01-14 15:13:26 -05:00
33a558bf21 Geometry Nodes: support accessing UV layers with attribute system
Note that uv layers still can't be accessed with nodes, because those
only access attributes on the point domain currently, while uv data
is stored per corner. Implicit domain conversion hasn't been
implemented yet.
2021-01-14 18:11:44 +01:00
5c1b740f1e Geometry Nodes: add implicit conversions for float2 and others
Some of these conversions are arbitrary to some degree.
However, the user experience is better when at least something
happens when converting between types, instead of just getting
zeros. I left out a few conversions that I wasn't sure about yet.

I also added conversions for float2.
2021-01-14 18:02:59 +01:00
0815e2fdb1 Fix automated tests when building with GCC and march=native
When building with more aggressive optimization flags, GCC will add FMA
(Fused Multiply Add) instructions that will slightly alter the floating
point operation results.

This causes some automated tests to fail in blender.

In clang and the intel compiler ffp-contract is set to off per default
it seems from my research.  (They do not have the exact same setting,
but the default seems to match the off behavior)

Reviewed By: Brecht

Differential Revision: http://developer.blender.org/D9047
2021-01-14 17:37:39 +01:00
406d747695 Fix automated tests when building with GCC and march=native
When building with more aggressive optimization flags, GCC will add FMA
(Fused Multiply Add) instructions that will slightly alter the floating
point operation results.

This causes some automated tests to fail in blender.

In clang and the intel compiler ffp-contract is set to off per default
it seems from my research.  (They do not have the exact same setting,
but the default seems to match the off behavior)

Reviewed By: Brecht

Differential Revision: http://developer.blender.org/D9047
2021-01-14 17:32:21 +01:00
9131c697dd Merge branch 'blender-v2.92-release' 2021-01-14 15:55:51 +01:00
e5ee7e9a2d Geometry Nodes: don't delete existing attribute before new attribute is computed
This fixes the behavior of some nodes when the same attribute
name is used for input and output. If both attributes have a
different type, they can't exist at the same time. Therefore,
the input attribute has to be removed in order to create the
output attribute.

Previously, the input attribute was remove before it was used
in any computations. Now, the output is written to a temporary
buffer and only later saved in the geometry component. This
allows both attributes to coexist within the node.

The temporary attribute is only create when necessary. The
normal case without name collisions still works the same
as before.

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

Ref T83793.
2021-01-14 15:52:08 +01:00
8795514384 Merge branch 'blender-v2.92-release' 2021-01-14 15:19:24 +01:00
8ed7ed0255 Geometry Nodes: extract function for adding attributes in distribute node
This shouldn't have any functional changes.
2021-01-14 15:16:20 +01:00
53bd58993e Fix T84167: Saving half-float EXR might result in NaN pixels
Clamp value to the -HALF_MAX .. HALF_MAX.

The non-clamped values were causing NaN and inf values saved to
the file, which was the root cause of glare node giving unexpected
result.

The nan/inf on overflow is something mentioned in the half data
type in OpenEXR header.

Differential Revision: https://developer.blender.org/D10105
2021-01-14 14:54:08 +01:00
3cc7e2ad9d Fix various issues with regions in Asset Browser
Fixes a number of glitches, e.g. the sidebar disappearing when selecting an
asset or wrong AZones (the little chevrons to indicate a hidden region).

There were a couple of issues:
* Execution region was created, but not used.
* If an execution region already existed when refreshing the area, it was
  tagged as hidden, not removed.
* The sidebar was always set to be hidden on refreshes.
* When toggling from Asset Browser to File Browser as regular editor (i.e. not
  opened temporary via Ctrl+O or such), the sidebar region wasn't removed.

Adresses T83644.
2021-01-14 13:45:22 +01:00
Sebastian Parborg
74f6b81c12 Tests: skip OSL render tests in build without OSL
Differential Revision: https://developer.blender.org/D9990
2021-01-14 13:14:43 +01:00
4e90266fd8 Tests: enable bake and shader raytracing tests for OptiX
These are now supported and so can be tested.

Also refactor the code a bit to move Cycles specific blacklist out of generic
render test code.
2021-01-14 13:14:43 +01:00
6704372f04 GPencil: Allow small resolution for Fill tool
Now the resolution can be reduced to get less details. This is very useful for doing storyboards to get a quick fill of any character.

Following UI review, the name "Resolution" has been changed to "Precision" because is more clear.

Differential Revision: https://developer.blender.org/D10076
2021-01-14 12:57:17 +01:00
10423d462a Geometry Nodes: output color from Attribute Color Ramp node
The other output types did not work currently anyway.
There is not a significant benefit in somehow deducing the output
attribute type from the existing attribute types.
2021-01-14 12:44:37 +01:00
6f28c199b3 Cleanup: ed_undo: naming of parameters, const, etc.
No behavrioral change expected here.
2021-01-14 12:02:51 +01:00
a0029a678f Cleanup/refactor: Remove logically broken code from GPencil undo.
`ED_undo_gpencil_step` only support valid undo step direction, passing
step name here is useless and only add confusion to what works or not.

Undo by step name or step index is fully not supported by GPencil undo
mode currently.

Note that since GPencil undo mode does not seem to ever be used anyway,
this is not an urgent issue in practice, but this needs to be cleaned up
at some point. See also T84703.
2021-01-14 12:02:51 +01:00
8cdd701b45 Merge remote-tracking branch 'origin/blender-v2.92-release' 2021-01-14 11:42:22 +01:00
442b6e5e09 MeshCache: add error handling to fread() calls
Handle return value of `fread()`, by showing an error message when the
file cannot be read from and stopping further processing. Not only is
error handing a good idea, it also prevents GCC from warning that the
return value of `fread()` should not be ignored.

This is similar to {D9916}.

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D10079
2021-01-14 11:38:14 +01:00
9e038a2c6b Tracking: Make transform cancel use explicit frame number
Before transform cancel will request marker at a current frame number
and restore transform flags to it. This worked fine if there was only
one marker from track in the transform data. This did not work correct
when multiple markers from track were added to transform data.

This allows to implement proportional editing in the clip editor.
2021-01-14 11:37:36 +01:00
4b1112c8c9 Tracking: Fix wrong projection for post-draw pass
Allows to draw proportional editing circle at a proper location.
2021-01-14 11:37:36 +01:00
5cf87b4a8e Tracking: Re-duplicate logic used to count and initialize data
Allows to easily implement more comprehensive checks about which
markers get added to the transformation context.

No user measurable changes are expected, purely house-keeping to
ease an upcoming development.
2021-01-14 11:37:36 +01:00
ab536824a6 Tracking: Simplify transform code
Reduce amount of duplicated pointer offset logic: advance transform
data pointers deep in the loop rather than have offset duplicated in
the outer loop.

Array size calculation still has duplicated, but that is another story.
2021-01-14 11:37:36 +01:00
4b0871af87 Bmesh: Deprecate deform parameter of from_object()
The deform parameter of the Bmesh from_object method is deprecated,
always assumed to be True, and will be removed in version 3.0.

That is because the cases where it is False don't work correctly and are
subject to memory leaks. One of the symptoms of the incorrect behavior
is the application of constructive modifiers twice if the input object
is an evaluated one, as demonstrated in D10053.

Reviewed By: Brecht

Differential Revision: https://developer.blender.org/D10086
2021-01-14 12:20:46 +02:00
Cody Winchester
3191b76eb5 GPencil: Noise Modifier - Move noise seed value outside of randomize subpanel
Currently the grease pencil noise modifier seed value is under the randomize subpanel.

Moved the seed value outside of this panel because it doesn't only change the noise when using the randomize option. Moving the seed value prevents it from being hidden/greyed out so the user can manually keyframe it to control the noise animation.

Reviewed By: #grease_pencil, antoniov

Differential Revision: https://developer.blender.org/D10020
2021-01-14 11:10:33 +01:00
024ac9c089 Fix T84549: Keymap presets written without repeat enabled
Key map items using TEXTINPUT didn't include the repeat setting.
2021-01-14 20:52:36 +11:00
e7c36ce43c GPencil: Disable Multiframe edition when play animation
When the multiframe is enabled, playing animation must be disabled or the animation is not visible,

{F9527854}

Reviewed By: fclem

Differential Revision: https://developer.blender.org/D9930
2021-01-14 10:44:45 +01:00
3e4dd7b000 Merge branch 'blender-v2.92-release' 2021-01-14 15:55:34 +11:00
a4226a050b Fix T64518: Blender 2.7 keymap inconsistencies
- Add missing Shift-Space for toggle maximize area.
- Add missing Alt-F10 for toggle fullscreen area.
- Match 2.7x keymap for setting the pivot center.
2021-01-14 15:53:06 +11:00
646f1cc89a Merge branch 'blender-v2.92-release' 2021-01-14 11:50:55 +11:00
f64746177f Fix add-object tool snap placement when activated from tweak event
When activating add-object from from a tweak event (default keymap),
the snap gizmo could snap to a new location while dragging.

Workaround this by re-calculating the snap position where the tweak
event starts.

Reported T57210#1077747
2021-01-14 11:50:08 +11:00
0876829e7a Merge branch 'blender-v2.92-release' 2021-01-14 10:58:19 +11:00
5804bf25bd Fix uninitialized stack memory use accessing the snap normal
Using the add-object tool, snapping to object types such as
curve, armature ... etc, copied uninitialized stack memory.
2021-01-14 10:55:49 +11:00
c13383da41 Cleanup: use enum for undo step direction
The step direction was confusingly 1 for undo, -1 for redo.
This convention is from 2004 (562d6958cb).

Use enum for ed_undo.c for better readability.
2021-01-14 09:53:38 +11:00
01b9dfeab4 Fix T84684: Undo operators not working
Mistake in 2771dfd563. The commit left the new editors operator registration
in `ed_util_ops.c`, but removed the function call to it.
In other words, the ED-utils operators were not registered.
2021-01-13 23:41:14 +01:00
73169628a1 Fix T84684: Undo operators not working
Mistake in 2771dfd563. The commit left the new editors operator registration
in `ed_util_ops.c`, but removed the function call to it.
In other words, the ED-utils operators were not registered.
2021-01-13 23:39:04 +01:00
b6aa8daf49 Fix T84645 cursor moves when clicking selector.
The absolute position desktop mapping has been corrected. The correct
mapping is 0-65535 inclusive. Additionally, division by the virtual
desktop width and height needed to be subtracted by 1 as width and
height are one more than the final pixel index.
2021-01-13 14:07:49 -08:00
c4c2c4bdb8 Merge branch 'blender-v2.92-release' 2021-01-13 14:33:53 -06:00
cf9709fd1e Fix T84686: Node vector socket default values not animate-able
{rB1d3b92bdeabc} disabled animating other properties of the socket default
values, like the "min" and "max" properties, as well as the "default_value"
of the "default_value". That naming confusion lead to the commit
inadvertently removing animation for the vector socket in RNA.

I checked that the other socket types don't have the same issue.
2021-01-13 14:33:28 -06:00
21b9231d7f Transform: geodesic distances for proportional edit connected mode
Use approximate geodesic distance computatiom that crosses through triangles
rather than only along edges. Using only edges would give artifacts already
on a simple grid.

Fixes T78752, T35590, T43393, T53602

Differential Revision: https://developer.blender.org/D10068
2021-01-13 18:24:33 +01:00
00b2c7c5cc Merge branch 'blender-v2.92-release' 2021-01-13 11:21:09 -06:00
9dab489d51 Bump file subversion after recent node versioning commit 2021-01-13 11:16:11 -06:00
08ee5573a9 Fix Python warnings in node editor after revert of datablock changes
Revert was done in 2771dfd, ref T84669
2021-01-13 18:06:39 +01:00
09fe0e8aa9 Nodes: use green color again for shader sockets and shader category
The green is still distinct from the more turquoise use for geometry, and
they are never used in the same node graph. The use of red makes sense, but
would need changes to other sockets and categories to set it apart well.

Ref T82689
2021-01-13 18:00:14 +01:00
d08ec3120f Revert "2.92 splashscreen"
This reverts commit 5d826866a3.
2021-01-13 17:49:28 +01:00
84c08748d8 Revert "Blender 2.92 beta - bcon3"
This reverts commit cfc9b95abd.
2021-01-13 17:49:24 +01:00
a60e270efb Merge branch 'blender-v2.92-release' 2021-01-13 17:49:08 +01:00
8ad305382e Blender 2.93 bcon1 - alpha
Bump the version number for the new release cycle.
2021-01-13 17:33:27 +01:00
5d826866a3 2.92 splashscreen
Credit: Joanna Kobierska - artstation.com/joanna_kobierska
2021-01-13 17:33:22 +01:00
cfc9b95abd Blender 2.92 beta - bcon3
Bump the release cycle to beta. This also hides away the experimental features
from the user interface.
2021-01-13 17:33:22 +01:00
1f4c1c5fc7 Geometry Nodes: Add "Point Translate" and "Point Scale" nodes
The translate node moves every point in the geometry, and the scale
node multiplies the "scale" attribute of the input geometry by its input.
While these operations are already possible with the "Attribute" nodes,
these new nodes fit nicely with the nodes specifically for changing the
"rotation" attribute that already exist, and they provide a simpler way
to do the same thing.

Differential Revision: https://developer.blender.org/D10100
2021-01-13 10:32:06 -06:00
bae4d00e2a UI: Use gray color for float sockets in nodes
The shade is too close to RGBA sockets.

Related to T82689
2021-01-13 17:17:54 +01:00
7d749720ad UI: Use capital letters for X Y and Z axes
Also add another comma and use plural "axes".
2021-01-13 10:13:00 -06:00
8df0268e2b Geometry Nodes: Rename "Rotate Points" to "Point Rotate"
This is consistent with the other node names, giving (almost) all of the
nodes in the "Point" category the same prefix.
2021-01-13 10:10:25 -06:00
80578a9d54 Geometry Nodes: Rename boolean input sockets
"Geometry A" becomes "Geometry 1", just to be more consistent
with other nodes.
2021-01-13 10:00:20 -06:00
2771dfd563 UI: Revert design changes to data-block selector for the 2.92 release
Partially reverts 2250b5cefe.

Removing the user count and fake user count icons was controversial (which was
expected) and there are a few further changes needed, that won't make it in
time for the release, see D9946.
While there is a design to bring back the user count and fake user indicators,
a new design idea was proposed that the UI team wants to follow. This came too
late for the 2.92 release, the new design is targeted at the 2.93 release now.
Meanwhile, UI team decision was to simply revert the design changes.

The new design is being worked on in https://developer.blender.org/T84669.

Note that this commit does not revert some internal changes done in
2250b5cefe. Namely the introduction of `ed_util_ops.c` and data-block
operators in there. These will still be needed in the new design.
2021-01-13 15:31:02 +01:00
ad4202a14f Cleanup: Remove unecessary namespace prefixes 2021-01-13 08:29:03 -06:00
89f490932f Geometry Nodes: Enable exposing object and collection sockets
This patch allows connecting wires for object and collection socket
types to the "Group Input" node, which exposes them to be adjusted
in the modifier.

Thanks to @angavrilov's recent work in rB8964c02348f6, it is now
possible to edit pointer IDProperties in the interface when they are
drawn with `uiItemPointerR`.

This patch is composed of a few changes:
  - Add code to create pointer properties in the modifier settings for
    object and collection sockets, and also to draw them in the UI.
  - Also search through the modifier's `IDProperty` settings to find IDs
    used by the modifier.
  - Change the setting's UI layout to support the change.

Differential Revision: https://developer.blender.org/D10056
2021-01-13 08:13:57 -06:00
Eric Bickle
55c56f1ffb Fix T79356: Improved icons for MSIX builds
Fixed an issue that was causing the app icon to render with a
'plated' background color in the taskbar and other areas of Windows.

Updated all app icons in Microsoft Store package to match Microsoft's
design recommendations.

Added multiple scales for app icons for high resolution displays.

Added high contrast app icons.

Reviewed By: pablovazquez, jmonteath

Maniphest Tasks: T79356

Differential Revision: https://developer.blender.org/D9681
2021-01-13 14:42:05 +01:00
5f411f7f38 Revert "Fix T79356: Improved icons for MSIX builds"
This reverts commit 78011d712d.
2021-01-13 14:31:52 +01:00
Eric Bickle
78011d712d Fix T79356: Improved icons for MSIX builds
Fixed an issue that was causing the app icon to render with a
'plated' background color in the taskbar and other areas of Windows.

Updated all app icons in Microsoft Store package to match Microsoft's
design recommendations.

Added multiple scales for app icons for high resolution displays.

Added high contrast app icons.

Reviewed By: pablovazquez, jmonteath

Maniphest Tasks: T79356

Differential Revision: https://developer.blender.org/D9681
2021-01-13 13:32:00 +01:00
d985751324 Geometry Nodes: improve Point Distribute node
This greatly simplifies the Point Distribute node. For a poisson disk
distribution, it now uses a simpler dart throwing variant. This results
in a slightly lower quality poisson disk distribution, but it still
fulfills our requirements: have a max density, minimum distance input
and stability while painting the density attribute.

This new implementation has a number of benefits over the old one:
* Much less and more readable code.
* Easier to extend with other distribution algorithms.
* Easier to transfer more attributes to the generated points later on.
* More predictable output when changing the max density and min distance.
* Works in 3d, so no projection on the xy plane is necessary.

This is related to T84640.

Differential Revision: https://developer.blender.org/D10104
2021-01-13 12:44:17 +01:00
ed1042ee06 Geometry Nodes: cleanup attribute usage
Now that typed attribute wrappers don't need to own the
attribute anymore, many `std::move` calls can be removed.
2021-01-13 12:27:38 +01:00
76fd41e9db Depsgraph: Remove redundant copy-on-write operations
This change removes copy-on-write operations from ID nodes which do not
need copy-on-write.

Should be no functional changes, as before the copy-on-write operation
would do nothing for those nodes anyway.
2021-01-13 12:13:35 +01:00
0f95f51361 Fix T83411: Crash when using a workspace/layout data path in a driver
Building IDs which are not covered by copy-on-write process was not
implemented, which was causing parameters block not present, and, hence
causing crashes in areas which expected parameters to present.

First part of this change is related on making it so Copy-on-Write is
optional for ID nodes in the dependency graph.

Second part is related on using a generic builder for all ID types
which were not covered by Copy-on-Write before.

The final part is related on making it so build_id() is properly
handling ParticleSettings and Grease Pencil Data. Before they were not
covered there at all, and they need special handling because they do
have own build functions.

Not sure it worth trying to split those parts, as they are related to
each other and are not really possible to be tested standalone. Open
for a second opinion though.

Possible nut-tightening is to re-organize build_id() function so
that every branch does return and have an assert at the end, so that
missing ID type in the switch statement is easier to spot even when
using compilers which do not report missing switch cases.

As for question "why not use default" the answer is: to make it more
explicit and clear what is a decision when adding new ID types. We do
not want to quietly fall-back to a non-copy-on-write case for a newly
added ID types.

Differential Revision: https://developer.blender.org/D10075
2021-01-13 12:13:34 +01:00
2cd091e9c7 Fix Cycles not taking into account CYCLES_SHADER_PATH for finding stdcycles.h
Contributed by howetuft.

Differential Revision: https://developer.blender.org/D9973
2021-01-13 12:12:36 +01:00
Jesse Y
dc170a6d67 Fix: popout windows are sized incorrectly on high DPI screens
There should be a conversion to native pixel size as expected by GHOST at the
window manager level, the dimensions at screen level do not need a conversion.

Differential Revision: https://developer.blender.org/D9976
2021-01-13 12:12:36 +01:00
8964c02348 RNA: allow editing pointer IDProperty values from the UI.
Currently it is not possible to edit bare IDProperty pointer
values which are not explicitly defined through python via
UI fields. This is likely mostly because, unlike numeric values,
pointers aren't marked PROP_EDITABLE by default. However there
are also some bugs in the RNA code that need fixing.

The Geometry Nodes modifier uses bare properties to store
input settings for the node group it wraps, so supporting
Object and Collection sockets requires editable pointers.

This patch marks bare IDProperties editable, and ensures
that changing ID pointers rebuilds the dependency graph.
A type check is needed because an IDPROPERTY PointerPropertyRNA
can actually wrap a group value rather than an ID pointer.

Making pointers editable is not likely to accidentally
affect UI fields that were not intended to be editable,
because a simple `layout.prop` cannot determine which
datablocks to display in the menu and remains read-only.

The PROP_NEVER_UNLINK flag is also removed: it seems it
was added because the edit field that couldn't produce
a menu to set the pointer used to still display the unlink
button, but that seems not to be the case anymore.

Actual support for Object & Collection inputs in the modifier
is added in D10056, which can be used to test this code.

Differential Revision: https://developer.blender.org/D10098
2021-01-13 14:09:31 +03:00
8185d07ace RNA: fix a crash when setting bare IDProperty pointers.
The rna_idproperty_check call should be done before accessing
the prop pointer so that it can detect IDProperty values and
replace them with the actual PointerPropertyRNA object.

Ref D10098
2021-01-13 14:09:31 +03:00
38df935c09 Fix T84646: Compositor: In Blender 292 "Set Alpha" node is undefined
Incorrect version code introduced by 9dbea1db66 would not check inside
node groups.
2021-01-13 12:07:26 +01:00
aed5b88ec1 Asset System: Disable Asset Browser as experimental feature
The Asset Browser will be disabled and not available for the 2.92 release. In
alpha/beta builds, there will be an "Asset Browser" option under Preferences >
Experimental, if the developer extras are enabled.
Note that this also disables related UI elements (e.g. "Mark Asset" buttons,
Preferences settings for asset libraries, etc.).

The code is still in master of course, development and testing will continue
there. But there simply needs to be too much polishing and fixing before the
2.92 release, plus there are some design decisions to be reevaluated.

Check the milestone 1 project to follow ongoing work:
https://developer.blender.org/project/view/124/
2021-01-13 11:10:17 +01:00
Robert Guetzkow
27b78c9c94 Compositor: "Save as Render" for the file output node
This commit adds the "Save as Render" feature to the file output node,
that allows to disable the application of the configured view transform
and other color management settings on the image. If disable it uses
the standard view transform instead. This feature was originally
suggested in T83842 and is part of the color management improvements
task in T68926. With this feature it is possible to toggle the
application of the color management settings for each input socket
of the File Output node individually.

Reviewed By: brecht

Maniphest Tasks: T68926, T83842

Differential Revision: https://developer.blender.org/D9921
2021-01-13 11:04:02 +01:00
614bd239f8 Geometry Nodes: support optional ownership for typed attributes
This will simplify some code in an upcoming commit and will be
useful for T83793.
2021-01-13 10:48:39 +01:00
7b68d0679e Cleanup: rename enum for event value items
This contains all value items (with overlapping values),
name this to make it clear it contains all items.
2021-01-13 19:58:57 +11:00
7af8271c34 Fix WM_event_print error printing tweak events value 2021-01-13 19:56:49 +11:00
ba44919601 Fix Event.value RNA access with tweak event types
Accessing event.value would return unrelated values such as
PRESS, RELEASE, CLICK... etc. instead of NORTH, SOUTH... etc.
2021-01-13 19:56:40 +11:00
0b711e6758 Fluid: Updated Mantaflow source files
Includes minor fixes / cleanups from the viscosity plugin.
2021-01-13 09:49:38 +01:00
3f7c294a95 Mix modifiers test after commit to bevel modifier defaults
{rB6b5e4ad5899d} neglected to update the modifier tests to reflect
the fact that the default limit method is no longer "NONE".
2021-01-12 23:54:46 -06:00
97a6b3ceee Cleanup: use single quotes for enum literals 2021-01-13 16:41:12 +11:00
37c5552742 Fix memory leak with image drag and drop
Dragging an image from the file selector into the sequencer
was leaking memory.

Regression in b5d778a7d4.
2021-01-13 16:23:14 +11:00
Philipp Oeser
5d99199880 Fix T83084: Smart UV Project inverts the resulting UVs
Caused by 850234c1b1,

Flip the normal to avoid flipped projection.
2021-01-13 13:37:14 +11:00
92826a921c Cleanup: spelling 2021-01-13 13:21:29 +11:00
bc58425862 Cleanup: clang-format, trailing space 2021-01-13 13:15:22 +11:00
b9e02eace6 UI: Clarify the property name of "F-Curve Visibility"
"F-Curve Visibility" is a bad UI label for a property that only affects
the display of unselected F-Curves. This commit clarifies the property
name by making it more specific with the word "Unselected", and by using
the word "Opacity". "F-Curve" is redundant in the UI label anyway because
it is included in the panel title.

Resolves T82587

Differential Revision: https://developer.blender.org/D10027
2021-01-12 19:14:57 -06:00
6b5e4ad589 Bevel Modifier: Use angle limit method by default
This right click select post outlines the reasons to make "Angle" the
default limit method: https://blender.community/c/rightclickselect/BVfbbc/
In short: Beveling every single edge rather than just sharp edges is
rarely the desired behavior, and the placement of the property in the UI
makes it easy to see the property's importance and toggle it.

Differential Revision: https://developer.blender.org/D8961
2021-01-12 18:55:27 -06:00
719bea0d6d Geometry Nodes: Output the most complex attribute data type
In order to avoid losing information, it sometimes makes sense for the
output attribute type to depend on the types of the input attributes.

Such a function already exists, `attribute_data_type_highest_complexity`,
it just needs to be used in a few more places. The change for the attribute
compare node is just so the code there uses the same code style as in the
attribute mix node.

Addresses part of T83793
Differential Revision: https://developer.blender.org/D10099
2021-01-12 14:03:35 -06:00
Aaron Carlisle
6c15b70279 UI: Update Clip Tracking menus
- Add operators that previously could only be found in panels
- Re order menus to match other menus
- Organize Code

|Before|After|
|{F9493583}|{F9493584}|
|{F9493585}|{F9493586}|
|{F9493588}|{F9493590}|
|{F9493591}|{F9493592}|

Reviewed By: sergey, sebastian_k, #motion_tracking

Differential Revision: https://developer.blender.org/D9781
2021-01-12 14:45:20 -05:00
bf5d45fd99 Cleanup: Fix incorrect function name
The function used "domain" incorrectly where it meant "data type".
2021-01-12 11:47:51 -06:00
abbc43e4e4 Fix T84397: Creating and removing many objects very quickly causes a crash
The root of the issue was caused by the dependency graph using ID pointer
to map evaluated state from old depsgraph to new one upon relations update.
This was failing when IDs were re-allocated rapidly: was possible that
Object ID's evaluated state assigned to Mesh and vice versa.

Now depsgraph uses Session UUID to identify which IDs to restore evaluated
state to. The session UUID is stored in the IDNode, so that id_orig is not
dereferenced on depsgraph update since the ID might be freed.

The root of the issue is identified by Campbell, original patch was done
by Bastien, thanks! Also thanks to Oliver and Ray and everyone else for
testing!
2021-01-12 17:16:48 +01:00
957e292c58 Fix T64953: Add cryptomatte meta data to file output node.
This change will try to add meta data when using a multilayered open
exr file output node in the compositor. It adds the current scene meta
data and converts existing cryptomatte keys so it follows the
naming that is configured in the file output node.

This change supports the basic use-case where the compositor is
used to output cryptomatte layers with a different naming scheme to
support external compositors. In this case the Multilayered OpenEXR
files are used and the meta data is read from the render result.

Meta data is found when render layer node is connected with the
file output node without any other nodes in between. Redirects and empty
node groups are allowed.

The patch has been verified to work with external compositors.
See https://devtalk.blender.org/t/making-sense-of-cryptomatte-usage-in-third-party-programs/16576/17

See patch for example files.

Reviewed By: Sergey Sharybin

Differential Revision: https://developer.blender.org/D10016
2021-01-12 16:24:26 +01:00
c3b68fa7b1 Fix T81965: Library-Override Not able to edit Keyframe properties
Fix keyframe properties not being editable when animating a
library-overridden datablock.

The problem was that RNA pointers were created based on the datablock
affected by the animation (for example an Object), instead of the
datablock that contains the FCurve itself (the Action). The latter can
be local to the current blend file and should thus be editable, even
when the former is not.

Reviewed By: mont29

Maniphest Tasks: T81965

Differential Revision: https://developer.blender.org/D10091
2021-01-12 15:43:42 +01:00
c96d596f43 GPU: Remove Limited Support AMD Polaris
Removing the limited support message as the known opengl issues of the
recent drivers with polaris cards have been tackled.
2021-01-12 13:54:50 +01:00
b2ad52a763 Tests: skip unit test if built without ocean sim modifier
Disable the Ocean Sim test when building with `WITH_MOD_OCEANSIM=OFF`.
2021-01-12 13:50:29 +01:00
e0a4b392f3 Cleanup: use exact check for fread, move out of the loop
Without this, additional items could be added in the future
which wouldn't be included in the check.

Move the check out of the loop since this is such an unlikely
situation that checking every iteration isn't needed.

Also remove redundant casts.
2021-01-12 23:31:34 +11:00
28b17ef0e6 Cleanup: replace 'long long' with int64_t in imbuf indexer 2021-01-12 23:31:34 +11:00
3b77bd48f9 Geometry Nodes: new Align Rotation to Vector node
This adds a new Align Rotation to Vector node based on the mockup
in T83669.

Reviewers: HooglyBoogly, simonthommes

Differential Revision: https://developer.blender.org/D10081
2021-01-12 12:55:14 +01:00
3a254b93fd Geometry Nodes: support reading from spans of WriteAttribute
Previously, the span returned by `WriteAttribute`s might not contain the
current value of the attribute for performance reasons. To avoid some
bugs, the span now always contains the old values (they might have to
be copied over from the internal storage, dependending on how the
attribute is stored).
The old behavior is still available with the `get_span_for_write_only`
method. The span that it returns might not contain the current
attribute values. Therefore, it should only be used when you want
to overwrite an attribute without looking at the old values.
2021-01-12 12:50:29 +01:00
58dae919e5 Weight Paint: avoid creating very small values with locked weights.
When painting using Auto-Normalize or Lock Relative with some
groups locked, the locked weights may not add up precisely to
1 because of precision limitations, which results in creating
nonzero weights close to FLT_EPSILON. With Lock Relative display
mode this is very obvious and annoying (random red points amid
black or blue), so add an epsilon check to consider less than
1e-6 unlocked weight to be the same as 0.

In addition, in cases when no weight can be painted due to locks,
don't create vertex group entries at all if they don't exist yet.
Also, don't run Auto Normalize when not painting a deform group.

Differential Revision: https://developer.blender.org/D10000
2021-01-12 14:32:05 +03:00
Robert Guetzkow
f5c0ef52cf Fix T84588: Cache access in rna_Particle_uv_on_emitter
The function `rna_Particle_uv_on_emitter` did not handle the case where
`particle->num_dmcache` was `DMCACHE_ISCHILD`. This resulted in an
incorrect offset for the `mtface` pointer. The commit checks for the
case and sets the offset accordingly, similar to existing code in
e.g. `particle_calculate_parent_uvs`.

Reviewed By: JacquesLucke

Differential Revision: https://developer.blender.org/D10072
2021-01-12 12:14:34 +01:00
c56da67716 Fix: Bmesh from_object applies modifiers twice
The Bmesh from_object method applies modifiers twice when the input
deform is enabled and the input depsgraph is a render one.

The evaluated object already have modifiers applied, and
mesh_create_eval_final() applies modifiers again. To fix this, the
BKE_mesh_new_from_object() function is used instead.

Reviewed By: Brecht

Differential Revision: https://developer.blender.org/D10053
2021-01-12 13:07:12 +02:00
26fd55fad1 UndoSys: Refactor step 1: cleanup and simplify logic in main undo/redo handlers.
* Simplify and clarify logic in `BKE_undosys_step_undo/redo_with_data_ex`,
  by adding early return on invalid situations, renaming some variables,
  and adding comments.
* Add more sanity checks in those functions.

No behavioral change are expected here, besides in potential edge-case,
invalid situations.

This is a preliminary change, before some deeper modifications of
`BKE_undosys` undo/redo API.

Differential Revision: https://developer.blender.org/D10033
2021-01-12 11:58:14 +01:00
1dc9650d20 Cycles: upgrade to OptiX SDK version 7.1 on buildbot
This means that NVIDIA driver version 450 or newer is now required for Cycles
OptiX rendering. This upgrade is required to take advantage of new features and
improvements.

Ref T81431
2021-01-12 11:51:42 +01:00
89ae4a7a2a Fix NLA liboverride issues re tracks handling.
From original rBc0bd240ad0a1 commit, issues reported with suggested
fixes by Wayde Moss (@GuiltyGhost), thx.
2021-01-12 11:32:17 +01:00
Oliver Weissbarth
401279253e Fix T84515: Status bar is reporting the average solve error of the wrong tracking object
Reviewed By: sergey

Maniphest Tasks: T84515

Differential Revision: https://developer.blender.org/D10047
2021-01-12 11:02:12 +01:00
Janusch Patas
2a23addf52 Fix T83122: NURBS Extruding multiple points only moves existing points
The Surface -> Nurbs Curve behaves now like the Curve -> Nurbs Curve,
if you initially select less than all points. So, multiple points can
be selected and extruded which just moves the selected points similar
to Curve -> Nurbs Curve object.

Differential Revision: https://developer.blender.org/D9934
2021-01-12 10:56:51 +01:00
ff51afb194 Fix T84593: Operators on material (linked to local object but with
linked obdata) fail

Caused by rB1a650fdcb286.

Above commit made polling more restricitive in that it did not allow for
actions on material slots (linked to object, not object data) on objects
with liked object data. This should be allowed though.

Maniphest Tasks: T84593

https://developer.blender.org/D10078
2021-01-12 10:03:48 +01:00
55059af01d Fix T84455: Circle select tool cursor draws in overlapping regions 2021-01-12 14:19:32 +11:00
Rahul Chaudhary
acbda123ad UI: Icon for Multires Displacement Smear Tool
This commit adds the icon for the new tool.
2021-01-11 15:30:26 -06:00
b9b59aa6de UI: Update geometry icon files
None of these changes should be visible, but the files were somehow
out of sync with the blend file, so they need to be updated to reflect
those changes.
2021-01-11 15:29:20 -06:00
Lukas Stockner
688e5c6d38 Fix T82351: Cycles: Tile stealing glitches with adaptive sampling
In my testing this works, but it requires me to remove the min(start_sample...) part in the
adaptive sampling kernel, and I assume there's a reason why it was there?

Reviewed By: brecht

Maniphest Tasks: T82351

Differential Revision: https://developer.blender.org/D9445
2021-01-11 21:04:49 +01:00
b70f4a265a Fix T84496: Cycles: Tile stealing does not work with NLM
Reviewed By: brecht

Maniphest Tasks: T84496

Differential Revision: https://developer.blender.org/D10066
2021-01-11 21:04:49 +01:00
Nicholas Rishel
d5c59913de Fix T81211 Add high frequency mouse input for Windows.
Also send mouse move event instead of moving cursor via SetCursorPos.
SetCursorPos did not reliably move the mouse when it is leaving the
window quickly.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D9981
2021-01-11 11:40:21 -08:00
ecdbd83a8d Geometry Nodes: Attribute Vector Math Node
This patch implements the same operations and interface as the regular
vector math node, but it runs for every element of the attribute. This
should expand what's possible with geometry nodes quite a bit.

Differential Revision: https://developer.blender.org/D9914
2021-01-11 12:06:52 -06:00
5bd822dc46 Geometry Nodes Point Distribution: Align points to face normals
This patch makes the point distribute node write to the "rotation"
attribute with the normal of each face at each distributed point.
The "normal" attribute is also created with the triangle normal
at each point.

The conversion from the triangle normal to an Euler rotation is somewhat
arbitrary, since we only have one direction vector. For a more flexible
rotation for each point, the "Align Rotation to Vector" node can be used
in the future.

Differential Revision: https://developer.blender.org/D9965
2021-01-11 11:42:16 -06:00
2a8b987e9e Fix T83422: Dimensions incorrect after undoing if it has modified geometry.
Root of the issue is that `BKE_object_eval_boundbox` (that ports back
evaluated bbox to orig object during active depsgraph evaluation) is
only called when object's geometry actually is evaluated.

However, with new undo, often Object itself can be changed by undo,
without requiring its geometry to be re-evaluated, which was leading to
the evaluated bbox not being copied back into orig object anymore.

Fixing that by moving bbox copying-to-orig code into
`BKE_object_sync_to_original` instead, which is always executed when
object is evaluated (as hinted by the comment above
`BKE_object_eval_boundbox` actually).

Also allows to cleanup code for armature eval, apparently.

Maniphest Tasks: T83422

Differential Revision: https://developer.blender.org/D9789
2021-01-11 17:59:21 +01:00
e44e0e4e78 Cloth: add a vertex group setting to exclude from object collision.
This can be useful as a workaround on the boundary with the pinned
vertices in some situations among other things, and completely copies
the existing design of the self collision vertex group setting.

Differential Revision: https://developer.blender.org/D10043
2021-01-11 19:34:33 +03:00
ac290bfbe4 Collision: allow disabling collision without removing the modifier.
The `object.collision.use` flag was treated as a redundant marker
of the existence of the modifier, going as far as adding/removing
it when the value was changed, which is not actually very useful.
Removing the modifier loses its position in the stack, and requires
a dependency graph rebuild. It feels it may be a legacy flag?

What would be useful however is the ability to toggle collisions
dynamically without removing the modifier. This patch adjusts the
code to keep the modifier when the flag is disabled, and add it
if it doesn't exist when the flag is enabled. The modifier now
checks the flag at the start and quickly exits after cleaning
up stale data. The redesigned setting is exposed in the UI.

Collisions can't be disabled by simply using the modifier enable
flags because the modifier merely saves a snapshot of the mesh at
a certain point of the modifier stack for other objects to use,
and thus has to be able to clear the stale data.

Differential Revision: https://developer.blender.org/D10064
2021-01-11 19:34:32 +03:00
b271475a9e ImBuf: Add error handling to IMB_indexer_open
Handle return value of `fread()` by printing an error and closing the
file when it cannot be read from. Not only is error handing a good idea,
it also prevents GCC from warning that the return value of `fread()`
should not be ignored:

```
.../blender/source/blender/imbuf/intern/indexer.c: In function ‘IMB_indexer_open’:
.../blender/source/blender/imbuf/intern/indexer.c:201:5: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
  201 |     fread(&idx->entries[i].frameno, sizeof(int), 1, fp);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.../blender/source/blender/imbuf/intern/indexer.c:202:5: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
  202 |     fread(&idx->entries[i].seek_pos, sizeof(unsigned long long), 1, fp);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.../blender/source/blender/imbuf/intern/indexer.c:203:5: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
  203 |     fread(&idx->entries[i].seek_pos_dts, sizeof(unsigned long long), 1, fp);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.../blender/source/blender/imbuf/intern/indexer.c:204:5: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
  204 |     fread(&idx->entries[i].pts, sizeof(unsigned long long), 1, fp);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```

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

Reviewed by: campbellbarton
2021-01-11 17:29:21 +01:00
bf90fcda47 ID Creation: generate session_uuid in more cases.
Previous code would not generate a session uuid for embedded IDs (like
root node trees or master collections). While this is not a problem
currently since those are not directly stored in Main data-base, this is
conceptually wrong, since those IDs still pertain the Main data.

Further more, this is blocking using `session_uuid` more in depsgraph in
place from ID pointer itself, as identifier (related to T84397).
2021-01-11 16:44:19 +01:00
1a26d15763 Fix Embedded IDs creation bypassing ID management completely.
No ID (even remotely) related to Main database should ever be created
directly through MEM_mallocN. Using `BKE_libblock_alloc` is the bare
minimum.

Note that there is no behavior change expected here.
2021-01-11 16:44:19 +01:00
2f9073adb1 Fix missing IDType init in ViewLayer tests.
Kinda miracle this did not cause problems so far, but was breaking tests
with some upcoming changes.
2021-01-11 16:44:19 +01:00
9e1ec5033d Fix T84516: ID properties have incorrect names in Python dir() list
Caused by not going through the proper accessor function to access the
property identifier.
2021-01-11 16:10:29 +01:00
98268e5c68 Cleanup: remove trailing whitespace 2021-01-11 15:49:42 +01:00
beb5863ed4 Geometry Nodes: transform Object Info outputs to local space
Ref T83670.

Differential Revision: https://developer.blender.org/D10071
2021-01-11 15:00:29 +01:00
c083398921 BLI: fix math operation
That fixes a stupid mistake of mine that was copied a couple of times.
2021-01-11 14:59:05 +01:00
7b6e55b933 Cleanup: remove redundant UV edge selection calls
Selecting vertices and faces first checked edge selection,
this was called to set vert1 & vert2 variables which have since been
removed.

These calls should have been removed in
51f04bf7b8.
2021-01-12 00:53:33 +11:00
2a297366f0 Fix T84565: UV face select fails when zoomed in
Exposed by recent commit 246efd7286

Although this was an existing logical error causing
`uv_find_nearest_face` to only work properly when the hit distance was
initialized to FLT_MAX, which wasn't the case in multi-object edit mode.
2021-01-12 00:31:54 +11:00
fe53b6a7fb Fluid: Adjusted viscosity strength step size in UI
Step size was too small.
2021-01-11 12:55:33 +01:00
Pi Lanningham
f0ae0f490e Fix T84327: outliner_id_copy_tag was only copying from expanded nodes.
If a node was closed in the hierarchy, we would only copy that node,
even if child nodes were selected.

Reviewed By: brecht, mont29

Maniphest Tasks: T84327

Differential Revision: https://developer.blender.org/D9995
2021-01-11 12:02:06 +01:00
6e7716f32e Cleanup: Added const to RenderLayersProg methods 2021-01-11 11:46:32 +01:00
445ebcaa30 VSE: store raw images in cache
Previously raw images were not cached if image wasn't preprocessed.
This caused issue, that image had to be read from disk on every redraw.

Effect strips must be excluded, because this would cause problem with
invalidation. Effect strips can use preprocessing however. This is
mainly to allow usimg modifiers on them.

This change should follow rBf448ff2afe7a77, but I have wrongly assumed,
that it has been implemented already.

ref T80278
2021-01-11 11:38:33 +01:00
54f8a5dd73 Tests: run suites instead of individual test cases
Group all tests of a test suite into a single test command invocation.
This reduces the number of invocations by `ctest` by an order of
magnitude.

Since rB56aa5b0d8c6b663, `bin/tests/blender_test` was run for every
individual test. Having over a 1000 tests made testing slower than
necessary. Individual tests can still be run if desired by invocation of
`bin/tests/blender_test --gtest_filter=suitename.testname`.

NOTE: For this commit to have an immediate effect, it may be necessary
to remove the `tests` and `Testing` directories and some CMake files
from your build directory and rebuild. Run `ctest -N` to see the list of
tests; there should be less than 200.

Reviewed By: sergey, LazyDodo, sebbas

Maniphest Tasks: T83222

Differential Revision: https://developer.blender.org/D9649
2021-01-11 11:29:30 +01:00
63cea2b793 Fix versioning code outside of version check
Bug introduced in f448ff2afe probably due to mistake when resolving
conflicts and not checking functionality.
2021-01-11 10:55:27 +01:00
d095411002 Fix T83544: Cycles crash when rendering with Save Buffers enabled
The issue is that the "Noisy Image" pass is added even though it should not.

`use_denoising` has to be enabled on the scene and on the view layer
to actually enable it.

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

Reviewers: lukasstockner97, brecht
2021-01-11 10:21:38 +01:00
4c44a5309c Fix T84459: Face normals not displaying (AMD GPU)
This is part two of the fix for T84459.
Issue appears to be caused by AMD graphics driver later than 20.11.1 and
affects older GPUs (Polaris/FIJI cards). Drawing normals in edit mode
uses the same OpenGL data type for storing normals that is known to be
faulty.

This change fixes the face dot normals by using GPU_COMP_I16.
2021-01-11 09:52:16 +01:00
618f7df7fc Cleanup: Incorrect comment 2021-01-11 09:52:16 +01:00
9fb32b2b29 Fix T84459: Wireframe not displaying with AMD GPU
Issue appears to be caused by AMD graphics driver later than 20.11.1 and
affects older GPUs (Polaris/FIJI cards). Wireframe drawing uses the same
OpenGL data type for storing normals what is known to be faulty.

This patch enabled storing the normals using GPU_COMP_I16. It also
solves the normals drawing in edit mode for vertex and loop normals.
2021-01-11 09:52:16 +01:00
64929398fb Cleanup: skip accessing sequence strip name/source when hidden 2021-01-11 17:58:08 +11:00
a83c67c183 Fix incorrect use of BLI_snprintf in sequencer text concatenation
The start of the text was stepped over without subtracting it's length
(introduced in fad80a95fd).

Replace this logic with BLI_string_join_array to simplify construction.
2021-01-11 17:51:42 +11:00
b01e62e399 Fix missing directory separator in image/movie strip identifier 2021-01-11 17:17:10 +11:00
16aefea9fa Cleanup: use switch statement for sequence types
Also remove duplicate NULL pointer check and replace
BLI_snprintf with BLI_strncpy.
2021-01-11 17:13:27 +11:00
50104b11a1 Fix T84582: WalkNavigation.mouse_speed ignored with tablet
Scale the speed up 4x instead of clamping the value to a minimum of 4.
2021-01-11 16:33:15 +11:00
ab5986cf3a Fix T84501: Wintab button lag.
Multiple Wintab tablets do not send relative button state when
configured to do so. This causes button events to be delayed until
processed as Win32 button events.

This commit fixes the issue by configuring Wintab to use absolute
button state and tracking changes manually.
2021-01-10 21:18:46 -08:00
af88d23ffa Revert "Fix typo; Documentation; Expose layer for framebuffer attachament; Add framebuffer viewport setter; Remove framebuffer restore; Expose framebuffer push/pop stack API; Remove blend modes; Remove depth_range_set; Implement GPU_face_culling, GPU_front_facing, GPU_point_size, GPU_line_width, GPU_viewport, GPU_color_mask and GPU_depth_mask"
This reverts commit 9db3d1951d.

This was an accidental commit of the patch D8826
2021-01-10 21:07:04 -03:00
d4330ae70b Transform: In the Header, show translation value in local space only with constraint
This partially reverts commit ad15e764dd.
The local value is only useful with constraint.
2021-01-10 20:58:45 -03:00
ad15e764dd Transform: In the Header, show the translation value in local space
Showing value in the global space was an unintentional change.
2021-01-10 20:30:25 -03:00
08e44b5e3e Fix Increment Snapping Without Constraints in Non-Axis-Aligned Views
The incremental snap was always operating in the local space, which in most
cases is the VIEW type orientation.

Use only local space when the operation is affected by constraint.

Differential Revision: https://developer.blender.org/D10052
2021-01-10 20:24:46 -03:00
9db3d1951d Fix typo; Documentation; Expose layer for framebuffer attachament; Add framebuffer viewport setter; Remove framebuffer restore; Expose framebuffer push/pop stack API; Remove blend modes; Remove depth_range_set; Implement GPU_face_culling, GPU_front_facing, GPU_point_size, GPU_line_width, GPU_viewport, GPU_color_mask and GPU_depth_mask 2021-01-10 19:01:53 -03:00
1d3b92bdea UI: Improve node group input / output list interface
This commit replaces the two-column list for editing node group inputs
and outputs with a cleaner solution with two panels. The new layout
has several benefits:
 - It uses the vertical space in the node editor sidebar better.
 - It should be more familiar because of similarity with other UI lists.
 - It should look better with consistent alignment and icons.

Note that displaying the "Name" property outside of the list itself is
a bit inconsistent and could possibly be removed in the future.

Differential Revision: https://developer.blender.org/D9683
2021-01-10 13:24:37 -06:00
30310a4fc8 Fix T83777: Crash when enabling guides
Also adjusted adjusted guiding UI parameters so that guiding will not get invalidated when changing domain values.
2021-01-10 19:16:44 +01:00
5b90ed6c06 Fluid: Fix cache saving issue with OpenVDB IO
Fixes issue where files would not be written when 'resumable' option was checked.
2021-01-10 19:16:44 +01:00
Peter Fog
544e371908 Fix T84529: Crash with strip using deleted scene
If scene strip has no scene assigned, leave source string empty.
Same goes for all other strips, that use ID datablocks.

Reviewed By: ISS

Differential Revision: https://developer.blender.org/D10058
2021-01-10 17:37:07 +01:00
e45630a99f Fix sequencer disk cache not writing data
Error handling added in 512a23c3d6 caused that reading header of new
file failed, since it is empty.

Don't attempt to read header if file is empty. If header can not be read
anyway, try to delete the file. Add asserts, as this should never
happen.

Reviewed By: sybren

Differential Revision: https://developer.blender.org/D9954
2021-01-10 16:50:08 +01:00
9441413cb2 VSE: Remove fit method tool setting from header
This property was intended to affect fit method for added strips prior
to running operator. However UI team did not agree with current
implementation.

ref T84535

Reviewed By: HooglyBoogly

Differential Revision: https://developer.blender.org/D10055
2021-01-10 16:37:18 +01:00
6154aa1529 Cleanup: remove redundant decorator for eevee 'overscan_size'
All eevee scene properties are not animatable due to
`RNA_define_animate_sdna(false)` so there is no need for an animation
decorator here (would not show anyways).

Not sure if setting use_property_decorate to False and then manually
adding one again was a hack in rB7fc60bff14a6 to get the alignment
right, but seems to work good now without it.

Note: there also seems to be an inconsistency here generally:
- Eevee reserves room for an animation decorator in almost every panel
(except for "Sampling" and "Indirect Lighting") even though almost none
are animatable (except for stuff in "Hair" and "Film"). This looks nice
if multiple panels are expanded (except for mentioned "Sampling" and
"Indirect Lighting" -- maybe these should also reserve the room?)
- Cycles does not use animation decorators at all (even though pretty
much everything is animatable here -- maybe these should also use
animation decorators?)
- Then there is also the 'shared' "Grease Pencil", "Freestyle" and
"Colormanagement" -- these dont use animation decorators, but some stuff
is animatable...

Regarding the note: not sure what the guidelines here are, if this is
isolated to each panel then there is lots of stuff for eevee that could
set use_property_decorate to False, if multiple open panels are
considered (for nice visual consistency between them), then there is
romm for improvement elsewhere, too.

Maniphest Tasks: T81411

Differential Revision: https://developer.blender.org/D9164
2021-01-09 15:02:14 +01:00
fa82a15676 Cleanup: remove unused struct members
Non-projection painting in the viewport is no longer supported,
remove struct members used for this.
2021-01-09 19:07:31 +11:00
e718004edf Cleanup: use bool arguments & variables 2021-01-09 19:07:14 +11:00
246efd7286 Fix UV selection threshold which ignored image aspect and zoom level
Selecting UVs wasn't properly scaling based on the zoom or image aspect.

This now matches vertex selection in the 3D view.
2021-01-09 18:42:36 +11:00
645298be29 Fix build error after last commit 2021-01-08 23:10:58 -06:00
1bb530745f Cleanup: Use bool instead of int 2021-01-08 23:09:31 -06:00
9c07454816 Keymap: Enable repeat for "Make Edge/Face" operator
The "repeat" property was turned off by default in rBf5080c82dd91, but
it's important to have repeat turned on for this operator since it can be
used to fill large areas. This commit is similar to rBaa77689f77b4.

Fixes T84531
2021-01-08 17:19:04 -06:00
69a22a70ac Geometry Nodes: Don't start with empty group nodes selected
The nodes were selected in new node groups because they are by default,
but there's no particular reason for them to be selected, and it can
be distracting.
2021-01-08 16:29:10 -06:00
7fd19c20e0 Geometry Nodes: Gray out "New" button when curve object is active
Currently curve objects aren't supported by the node modifier, so the
new node group and modifier operator shouldn't be available.
2021-01-08 15:04:38 -06:00
3c1fcec652 Fix T84517: Two geometry node trees added with "New" button
Adding the modifier itself already adds a new node tree, which is
then displayed in the node editor because of the active object and
active modifier context. So there's no need to create the node tree
in the python code in this case.
2021-01-08 12:12:43 -06:00
bc788929aa Scenes: forbid deleting last local scene
Previously, it was only forbidden to delete the last scene. This can
lead to the situation where a .blend file only contains linked scenes.
This is problematic, because linked data might not always be available
or can be removed from a .blend file without having an additional check
for remaining scenes.

Now there always has to be at least one local scene.

Reviewers: mont29

Differential Revision: https://developer.blender.org/D10049
2021-01-08 16:39:42 +01:00
2d3f96cace Fix T84453: Crash bezier curves transfrom
The pointer allocated to the `TransData` was being incorrectly incremented,
causing misalignment and consequently `heap-buffer-overflow`.

Because of this, `TD_NOTCONNECTED` was being set in a strange way that did
not correspond to other types of `TransData`.

The solution is to not increment the `TransData` pointer and set
`TD_NOTCONNECTED` only for "unconnected" segments.

The code was also a bit deduplicated.
2021-01-08 11:22:58 -03:00
c549d736cf Icons: Update script to generate icons from SVGs for Inkscape 1.0
The command line syntax for Inkscape changed quite a bit for the 1.0 release,
see https://wiki.inkscape.org/wiki/index.php/Release_notes/1.0#Command_Line.
Think it's reasonable to expect Inkscape 1.0 or later be installed if you want
to generate the icons with the script. It's easy to get via the website, if the
distribution doesn't provide new enough packages. Only few people would use the
script anyway.

I also had to change the path for command line access on macOS which apparently
changed (https://stackoverflow.com/a/60068607). Although I didn't find a
mention of this change in the Inkscape release notes.
2021-01-08 15:07:54 +01:00
c66f00dc26 Fix Cycles rendering with OptiX after instance limit increase when building with old SDK
Commit d259e7dcfb increased the instance limit, but only provided
a fall back for the host code for older OptiX SDKs, not for kernel code. This caused a mismatch when
an old SDK was used (as is currently the case on buildbot) and subsequent rendering artifacts. This
fixes that by moving the bit that is checked to a common location that works with both old an new
SDK versions.
2021-01-08 13:38:26 +01:00
e3ae7d1f2f Fix T83942: improve error checking when trying to render high resolution volume
Reviewers: fclem

Differential Revision: https://developer.blender.org/D10032
2021-01-08 12:14:12 +01:00
c889ec916c Cleanup: clang format 2021-01-08 11:54:53 +01:00
c44a17ec4b Fix T84475: Outliner missing update when adding IDs to main via RNA
Was reported for meshes, but was true for any type.
Now add appropriate notifier to refresh the Outliner.

Maniphest Tasks: T84475

Differential Revision: https://developer.blender.org/D10030
2021-01-08 11:50:36 +01:00
1698678231 GPU: Mark AMD Polaris 20.11+ drivers with limited support.
The issue does not render wireframes correctly.
2021-01-08 11:44:31 +01:00
03f1d8acab Use the term "N-gon" instead of "Polygon" for triangulation method
This was reported for the Triangulate geometry node, but was also true
for the triangulate modifier and in exporters.

Note the modifier was introduced with "Ngon Method" in rBa7b44c82e5b9 but
was renamed to "Polygon Method" in rBf4762eb12ba5.

Since quads are also polygons (and quads have their own method), the
term "N-gon" is more appropriate here and is also described in the
glossary https://docs.blender.org/manual/en/2.92/glossary/
index.html#term-N-gon

Docs have been updated in rBM7539 (partially - the method would also
have to be renamed once this patch lands).

Note this also fixes the wrong enum used for the alembic exporter.

Fixes T83907

Maniphest Tasks: T83907

Differential Revision: https://developer.blender.org/D10022
2021-01-08 11:20:42 +01:00
4a0b8c9427 Cloth: completely exclude fully pinned triangles from collision.
Currently such triangles are effectively already excluded, because
the calculated forces are not applied to pinned vertices. However
these forces are still being computed, which is inefficient.

This adds an early check for triangles where all vertices are
pinned during BVH overlap detection, which significantly speeds
up certain use cases with big fully pinned areas that happen to
overlap a collider. In case of self collision both triangles must
be fully pinned to exclude safely, because the computation is
symmetric and handles two triangles at the same time.

Differential Revision: https://developer.blender.org/D10041
2021-01-08 12:24:50 +03:00
8877e294df Surface Deform: the Strength setting is not bind-specific.
It is used during evaluation so it shouldn't be greyed out in the UI.

Ref D10040
2021-01-08 12:24:50 +03:00
662b7c3edf Surface Deform: optimize memory allocation in the evaluation code.
Using malloc to allocate a temporary array for each vertex,
which most commonly contains just 4 elements, is not efficient.
Checking the mode with a switch is also better.

Differential Revision: https://developer.blender.org/D10040
2021-01-08 12:24:50 +03:00
ceaed47bf9 GPU: Enable HQ normal work around on Linux.
Linux does not report the driver version. It does report the OpenGL
version. This change will check the OpenGL version to enable the HQ
normal work around.
2021-01-08 10:23:20 +01:00
f448ff2afe VSE: Hide cache settings and adjust defaults
Adjust default cache settings for all files to store raw and final
images.

All settings are still available when developer extras option is
enabled in user preferences.

This is part of design task T80278

Differential Revision: https://developer.blender.org/D9745
2021-01-08 07:24:55 +01:00
09ea339a6c Cleanup: Use LISTBASE_FOREACH macro 2021-01-07 21:24:46 -06:00
15bb8f9f93 Fix file-handle leak when parsing xdg user directories 2021-01-08 13:19:11 +11:00
61f1faac3f Fix T83868: Disabled or inactive list items are not grayed out
The cause for this was quite simple-- a misplaced bitwise operation
before passing a value to the function that grayed out buttons based on
their state, caused by refactoring in rB933bf62a611f before committing.

What makes the situation a little more confusing is that the theme colors
are overridden for list buttons in UI lists, necessitating a second
call to `ui_widget_color_disabled()`. Ideally that wouldn't be necessary.
2021-01-07 16:28:26 -06:00
5530d6f86f PyAPI Docs: Terminal instructions for Windows incorrect
Fixes T84498
2021-01-07 15:58:47 -05:00
95c63babbb Cleanup: Declare variables where initialized 2021-01-07 12:30:18 -06:00
d259e7dcfb Cycles: Increase instance limit for OptiX acceleration structure building
For a while now OptiX had support for 28-bits of instance IDs, instead of the initial 24-bits (see also
value reported by OPTIX_DEVICE_PROPERTY_LIMIT_MAX_INSTANCE_ID). This change makes use of
that and also adds an error reported when the number of instances an OptiX acceleration structure is
created with goes beyond the limit, to make this clear instead of just rendering an image with artifacts.

Manifest Tasks: T81431
2021-01-07 19:23:13 +01:00
3db2bc82aa Surface Deform: optimize handling of the vertex group weight.
There is no need to first copy weights to a separate array,
or create the data layer if it doesn't exist. The threaded
code can retrieve the weight directly from the layer.

Differential Revision: https://developer.blender.org/D10015
2021-01-07 21:08:44 +03:00
Juanfran Matheu
64277e8f3a UI: Use Eyedropper Cursor with Sample Weight Tool
While using the Sample Weight tool in Weight Paint mode, user eyedropper mouse cursor.

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

Reviewed by Pablo Vazquez
2021-01-07 09:44:48 -08:00
Juanfran Matheu
e3d9241a05 UI: Show Weight Value with Sample Weight Tool
While using the Sample Weight tool in Weight Paint mode, show weight value in tool header.

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

Reviewed by Pablo Vazquez
2021-01-07 09:29:36 -08:00
3db975f30d Fix T84326: No ID for geometry nodes instances after scattering
Instances are created with an "index" parameter used for persistence over
time through animation. Currently the geometry nodes instancer passes
the index in the array for this value, but the arrays created by the
"Point Distribution" node aren't necessarily stable  in this way when
the input mesh is deformed. In D9832 we already mostly solved this
problem with an `id` attribute. The solution here is to create instances
with this attribute as well.

It's important to note that deforming the instanced points *after*
distribution will usually be a better solution for this problem. This
solution is likely still important though.

Differential Revision: https://developer.blender.org/D10024
2021-01-07 09:27:42 -06:00
4c0fc60105 UndoSystem: Early out from core undo/redo handlers when undo step is NULL.
Also added `undosys_stack_validate` debug check to redo case.
2021-01-07 15:58:23 +01:00
044dd42a05 Cleanup: Undo system: minor simplification in non-debug code. 2021-01-07 15:58:23 +01:00
987e9e2145 Fix T84469: Online manual raises an exception with key-map options
Report an error instead of raising a Python exception.

Currently these properties aren't written to the manual
so it's best to show an error.
2021-01-07 23:36:25 +11:00
c55b578c9e Fix T84142: crash when mirroring hair emitted from vertices
The hair mirroring code seems to expect that hair is emitted from faces.
The PE_mirror_x contains the following expression: mirrorfaces[pa->num * 2].
This only makes sense when pa->num is a face index.

The simplest short term solution is to disable the mirror operator when
the particles haven't been emitted from faces.

Diffferential Revision: https://developer.blender.org/D10002
2021-01-07 13:32:36 +01:00
c26f46cb95 Fix T83497: missing relations update when group node changes
Changing which node group a group node references needs a depsgraph
relations update in some cases.

Differential Revision: https://developer.blender.org/D10018
2021-01-07 13:31:17 +01:00
0d042c8cca RNA: document Python instancing for ID's and RNA types
Document some of the less obvious implications for
re-using Python instances.
2021-01-07 21:36:39 +11:00
4a771263fd Outliner: use the scene ID for ObjectBase PointerRNA
While this didn't cause any problems, `Base` structs are part of the
scene which is being set in other uses of this type.
2021-01-07 16:20:08 +11:00
Yevgeny Makarov
dd0df3c5d2 UI: Fix various issues with UI text
- Use the name "Point Cloud" instead of "Pointcloud"
 - Fix a typo in UV_OT_smart_project.
 - Use the name "Install Light" to for the installation
   operator for MatCaps, HDRIs, and Studio Lights.

Fixes T83585, T65291, and T54921

Differential Revision: https://developer.blender.org/D9867
2021-01-06 22:54:10 -06:00
2dfd117ab5 Fix memory leak duplicating a scene with "Copy Settings" 2021-01-07 15:04:26 +11:00
a9dea9cfaa PyAPI: don't raise & clear exceptions when setting context members
BPY_context_dict_clear_members_array used PyDict_DelItemString
which raised & cleared the exception when the key didn't exist.

Even though setting/clearing the exception is supported,
it's worth avoiding where possible as it adds some overhead as well as
overwriting the previous error which can free PyObject's which are
unrelated to the code being executed.

Possible fix for T82552, crashing on Windows when setting the exception.
2021-01-07 14:41:52 +11:00
f35a38fba7 Fix BKE_blender_atexit_unregister error removing from linked list
This is an old bug exposed by having multiple atexit calls since
c65c4149c9.
2021-01-07 13:31:57 +11:00
27426c05b1 PyAPI Docs: Link to user docs instead of describing in API doc 2021-01-06 19:52:13 -05:00
b138c8f5b3 PyAPI Docs: Update Indirect Data Access docs
Fixes T84432
2021-01-06 19:34:21 -05:00
a9c607e60e PyAPI Docs: Fix wrong modifier path usage
Fixes T84430
2021-01-06 18:54:56 -05:00
133bdac306 PyAPI Docs: Clarify quick start guide tips
Some of the text here was outdated with 2.8x.
See T84427
2021-01-06 18:45:34 -05:00
211e161d76 Fix T84416: Vertex color baking checks for UVMap
Since the introduction in rB2221389d6e8e, baking to vertex colors would
still check for the existence of a valid UVMap (as if baking to image
textures).

Now check for vertex colors instead if target is
R_BAKE_TARGET_VERTEX_COLORS.

Maniphest Tasks: T84416

Differential Revision: https://developer.blender.org/D10006
2021-01-06 22:26:20 +01:00
6ea01dc509 UI: Use the 3D cursor icon for the RNA struct
Since there is a specific icon to represent the 3D cursor it makes sense
to add it to the RNA struct. This struct's icon is only displayed in the
Data API section of the outliner.
2021-01-06 14:00:44 -06:00
3028de9527 UndoType: Refactor: replace use_context boolean by a bitflag.
We will soon need more options here, sinmpler and cleaner to use a
bitflag then.
2021-01-06 18:07:09 +01:00
5cdf279ef4 Fix T84420: Linking regular materials to gpencil
When using "Make Links"->"Materials" regular materials could be linked
onto grease pencil objects. This caused a number of issues.

The fix changes the `allow_make_links_data` function to make sure that
if one object is of type `OB_GPENCIL`, the other has to be aswell.

Reviewed By: antoniov

Maniphest Tasks: T84420

Differential Revision: https://developer.blender.org/D10014
2021-01-06 17:54:44 +01:00
6672cbeb23 Fix T84202: Sculpt lasso mask crash after remesh.
'Caused'/revealed by rBd29a720c45e5: Operators that fully re-create the
mesh would previously rely on `sculpt_update_object` called from update
code to get required sculpt-specific data layers re-added to the new
mesh.

Now instead put all code adding data to orig mesh for sculpt purpose
into a new util function (`BKE_sculpt_ensure_orig_mesh_data`), and call
that function when entering sculpt mode, and from voxel remesher code.

This is contonuing effort to more clearly separate orig data from evaluated
data handling/usage in sculpt code.

TODO: there are likely other code paths that would need to call that
new function?

Reviewers: @sergey, @pablodp606

Subscribers:
2021-01-06 16:25:39 +01:00
a584aef470 Undo: Further tweak/fixes the 'use context' flag of undo types.
Note that this is fairly fragile still, especially in cases like paint
cureve undo, which actually does not use context in most cases (and can
be called with a NULL context), but do need it in one case. This will
need a proper rework at some point.
2021-01-06 15:59:23 +01:00
691c021679 Fix T82952: Crash changing mesh data block and switching scenes
Regression in 33ac3582bb.
2021-01-07 01:35:05 +11:00
f0071dfa10 Fix T79779: Pick shortest UV face-path ignores sticky setting 2021-01-07 00:37:05 +11:00
0e4f8ed90e UndoType: Fix some incinsistencies re context usage flag.
`use_context_for_encode` was not properly set regarding actual `encode` code for a few types.
2021-01-06 14:11:25 +01:00
eb1ff4b3a4 Cleanup: CodeStyle format 2021-01-06 13:55:27 +01:00
1c72a2f47d Cleanup: CodeStyle Format 2021-01-06 13:54:12 +01:00
967cf303f3 Fix T83372: Point.select can be True when unselected 2021-01-06 23:27:03 +11:00
bc3e38ca3a Cleanup/refactor: UndoType: Clarify use_context variable.
Rename it to mark it is only for `encode` callbacks, fix `encode`
callback of text undo to early fail in case it gets a NULL context, add
an assert to `BKE_undosys_step_push_with_type` that context is not NULL
when undotype requires a valid one.

Note that in practice this should not change anything, currently it
seems that we always get a valid context in
`BKE_undosys_step_push_with_type`?
2021-01-06 12:28:06 +01:00
4e23f08807 Fix object moved to cursor when editing last operation after dropping object
Steps to reproduce were:
* Drag object icon from the Outliner into the 3D view (or an object asset from
  the Asset Browser)
* Open the "Adjust Last Operation" panel
* Edit options in there - the object would move to the mouse location

The same issue happens with collection instance and object data adding (e.g.
via drag & drop). This patch addresses them too.

The operator used the event state stored in the window. This shouldn't be
accessed from the operator execute callback generally which happened here.
Especially not if the operator supports editing properties.
2021-01-06 11:55:21 +01:00
290b6d7ef3 Fix T70316: Custom "Delete Keyframes" shortcut still requires
confirmation

Deleting keyframes in the dopesheet or graph editor always required
confirmation, even if used ouside of the "Delete" menus.

Now add a "confirm" option [same as for deleting objects], which can be
disabled for immediate keyframe deletion.

This will also change the default behavior and bring this in line with
how object deletion works so there is one shortcut for bringing up the
menu/confirmation and another shortcut to delete immediately without
requiring confirmation / another click:

- Blender Default keymap: "X" for menu, "Del" for immediate
- Industry Compatible: "Backspace" for menu, "Del" for immediate

Maniphest Tasks: T70316

Differential Revision: https://developer.blender.org/D9651
2021-01-06 11:35:06 +01:00
4b56c18290 Fix T84426: Limit dissolve ignores selection with custom normals
Regression in 9969c2dd16.

Add note that custom normal calculation functions write into to tags.
2021-01-06 19:04:53 +11:00
947dc92083 BMesh: assert when a mesh has two kinds of shake-key data
Assert with comment to avoid confusion caused by
mixing two kinds of shape-key data.

This problem was exposed when investigating T84364.
2021-01-06 18:11:46 +11:00
Yevgeny Makarov
5424b4821d Fix T83094: Alternate rows in the Sequencer are green (macOS)
The issue is that `UI_GetThemeColorBlendShade4fv()` creates a color
with alpha, but there is not any background underneath to blend in with.

The solution is just to draw an opaque background first, which also
halves the number of rects to draw. Note that the brighter rows get
very slightly darker after this change.

Differential Revision: https://developer.blender.org/D9947
2021-01-05 14:21:54 -06:00
2ed6055209 Fix T79146: Sculpt Mode lags until the entire mesh is visible
This was caused when the BKE_pbvh_draw_cb function was used with
update_only_visible set to false. In that case, all nodes with the flag
were updating, but the update flag was only cleared for visible nodes.
This was causing constant updates per redraw in no visible nodes until
they enter the view frustum and their flag was cleared.

In order to fix this and prevent it from happening again:
 - Updating the buffers, flushing the updates and clearing the flags are
now part of the same function. It does not make sense to do these in
separate places.

 - The BKE_pbvh_draw_cb function was refactored so the
pbvh_update_draw_buffers is only called once. It should now be easier to
understand what the function does when it is used to update only visible
nodes or all nodes.

Reviewed By: mont29

Maniphest Tasks: T79146

Differential Revision: https://developer.blender.org/D9935
2021-01-05 20:23:41 +01:00
c20e482714 Fix T78681: "Add Primitive" icons are cropped in tool header
The issue can be simply resolved by moving the primitives and plus
icons slightly. They still bump up against the top and bottom of the
header but it looks much better now.
2021-01-05 13:00:35 -06:00
4ade409a87 Cleanup: Reduce variable scope 2021-01-05 12:22:23 -06:00
3373d14b1b Fix T83925: Crash when rendering on the CPU with OptiX denoiser enabled
Rendering on the CPU uses the Embree BVH layout, whether the OptiX denoiser is enabled or not.
This means the "build_bvh" function gets a "BVHEmbree" object to fill and not a "BVHMulti" as it
was assuming before, which caused crashes due to memory geting overwritten incorrectly. This
fixes that by redirecting Embree BVH builds to the Embree device.

Manifest Tasks: T83925
2021-01-05 18:37:31 +01:00
491a9e9ec4 Cleanup: Undo code: poll function.
Remove obviously outdated comment, and explictely set `poll` to `NULL`
in the one case it is not actually defined (sculpt undo).
2021-01-05 18:21:09 +01:00
90a26f900c Cleanup: UndoType: use size_t for memory size of structs. 2021-01-05 18:21:09 +01:00
166c0db3f9 Fix T83915: Subdivision Surface modifier causes visual artifacts in Cycles rendered viewport - CPU and OptiX
Changing the geometry in the current scene caused the primitive offsets for all geometry to
change, but the values would not be updated in all bottom-level BVH structures. Rendering
artifacts and crashes where the result. This fixes that by ensuring all BVH structures are
updated when the primitive offsets change.
2021-01-05 17:59:38 +01:00
da9d471e1d Fix T84389: RGB Curves node shows "tone" option outside of compositor
Since the introduction in rB4de7c0c3105a, the option is only used in the
compositor, it has no effect elsewhere [texture nodes, shader nodes].

Now only show the option for the compositor.

Maniphest Tasks: T84389

Differential Revision: https://developer.blender.org/D10005
2021-01-05 17:04:56 +01:00
583006d0ef Cleanup: clang tidy 2021-01-05 17:04:02 +01:00
39f99fd05c Fix: tried to set error message on modifier that does not exist
Without this, the example file in T83730 crashes in a debug build
when deleting the hair edit bake in the particle settings.
2021-01-05 16:50:23 +01:00
9dbea1db66 Compositor: Alpha Mode
{D9211} introduced pre-multiplying the color for the keying node. This
pre-multiplication should also be done by other keying nodes and should be
the default operation for alpha node.

This patch will change the logic of keying nodes (Cryptomatte Node,
Channel Matte, Chroma Matte, Color Matte, Difference Matte, Distance
Matte, Luminance Matte) and breaks old files.

The Set alpha node has a mode parameter. This parameter changes
the logic to `Apply Mask` the alpha on the RGBA channels of the input color
or only replace the alpha channel (old behavior).

The replace mode is automatically set for older files. When adding
new files the the multiply mode is set.

Reviewed By: Sergey Sharybin

Differential Revision: https://developer.blender.org/D9630
2021-01-05 16:34:55 +01:00
357e519575 Fix T83282: division by zero when creating psys tasks 2021-01-05 16:17:37 +01:00
cffa39358f Cleanup: Compositor comment style 2021-01-05 15:50:58 +01:00
36ae6e66c1 Fix T84367: Fix crash when showing invalid/legacy constraints
Exposed by rBeaa44afe703e.

Definition for CONSTRAINT_TYPE_NULL is not totally clear (it is set for
constraints without data, see an old comment from Ton), but for these, a
TypeInfo cannot be fetched.

Avoid processing those constraints in UI code, just do nothing instead.

Maniphest Tasks: T84367

Differential Revision: https://developer.blender.org/D9987
2021-01-05 15:31:40 +01:00
Jeroen Bakker
1f41bdc6f3 Eevee Cryptomatte: Store hashes in render result meta data
Stores cryptomatte hashes as meta data to the render result. Compositors could
use this for lookup on names in stead of hashes.

Differential Revision: https://developer.blender.org/D9553
2021-01-05 15:03:05 +01:00
7cd6f667e3 Fix T84053: Mask overlay in image editor not working
The mask overlay wasn't part of the overlay engine. The reasoning nehind
this was that more editors used the mask overlay and most of them used
old drawing code. This patch adds the mask overlay drawing to the draw
overlay engine. This code path will only be used by the image editor
VSE, Compositor and Movie Clip editor will still use the previous
method.

During this patch some alternatives have been researched:
1. `ED_mask_draw_region`: this would lead to different code paths when
   drawing in the image editor, and some hacks to retrieve the correct
   framebuffer.
2. Add mask drawing to image engine: Would lead to incorrect color
   management when viewing the mask.
3. Add mask drawing to image engine and overlay engine: Would lead to
   duplicated code.
4. Add mask drawing to overlay engine and for combined overlay select
   the correct framebuffer.

Option 4 was chosen as the exception (switching framebuffers) can be
done without hacks. The code stays clean.
2021-01-05 13:53:33 +01:00
f41de6dc46 Fix T84404: Crash when using Skin Resize in mesh without Skin modifier
Caused by rB54ee4109143b

Before that commit `TD_SKIP` was marked for all vertices.

Now skip the whole operation as all vertices are skipped.
2021-01-05 09:46:07 -03:00
fab772860d Asset browser: workspace in the wrong category
Workspaces [FILTER_ID_WS] were in the `Environment` category
IDFilterBoolean, whereas they are in the `Miscellaneous` category in
`rna_def_fileselect_asset_params`.

Make this consistent ['Miscellaneous'] in both cases.

(note this was already done in rB2c317457cbf2 for the file browser case)

Spotted while looking into T83983.

Maniphest Tasks: T83983

Differential Revision: https://developer.blender.org/D9911
2021-01-05 13:30:51 +01:00
acfa7b102b Sculpt: use distance threshold for dyntopo symmetrize
This was only used for non-dyntopo symmetrize.
There is no reason to use a hard-coded value in this case.
2021-01-05 23:19:34 +11:00
1f6846fa4e Cleanup: remove UNUSED(..) from public function declarations
This doesn't serve any purpose and can become out of sync
with the function it's self without reporting warnings.
2021-01-05 23:09:50 +11:00
e4884d224c Cleanup: remove redundant RNA_types.h header from UI_interface.h 2021-01-05 23:04:51 +11:00
105d385e4b Fix T84364: Sculpt symmetrize fails with shape keys
Use the BMesh symmetrize operator instead of using the modifier code.

While we could support shape-keys with the existing code used by the
mirror modifier, we'd need to add code-paths for evaluated mesh & bmesh
conversion to handle shape-keys differently just for this one case,
since we want to avoid copying & processing shape-keys layers for
evaluated meshes in general.
2021-01-05 22:48:12 +11:00
7241104877 Enabled Physics Particle Instance test 2021-01-05 16:16:08 +05:30
c0a8dd943f Fix T84018: bulk selection (box, circle, lasso) - unwarranted selection
of islands in vertex mode if "UV Sync Selection" is on

Caused by rB72b422c1e101: UV: support select linked with sync-select in
vert/edge modes

If you had island selection mode enabled in the UV editor with UV Sync
Selection off, and switch UV Sync Selection on, then in vertex selection
mode all bulk selection ops (box, circle, lasso) will be selecting whole
islands.

Prior to culprit commit, for sync selection ON plus island selection ON,
BM_uv_vert_map_create would always return a NULL vmap (it was called
with `use_select` = True, no faces tagged selected). After said commit,
for sync selection ON plus island selection ON, BM_uv_vert_map_create
would return a valid vmap (it is now called with `use_select` = False,
no faces tagged selected - but if `use_select` is False, all UVs will be
added here).

If I am not mistaken, it is never wanted to actually select islands with
box/lasso/circle when sync selection is turned ON [after all you dont
have the UI for it showing], so solution is now to check for this
earlier and not even call uv_select_linked_multi in those cases. (Maybe
in the future this can be unified and we dont need separate selection
modes fo UV and 3D?)

Maniphest Tasks: T84018

Differential Revision: https://developer.blender.org/D9917
2021-01-05 10:26:23 +01:00
dc4014c676 Cleanup: Enum for mask overlay mode 2021-01-05 10:13:00 +01:00
7d152bedc5 Fix T84216: Drawing a paintcurve [vertexpaint / weightpaint] fails
Caused by rB35e3dc9192e7.

Above commit moved 'Weight Paint' & 'Vertex Paint' keymap also before
'Paint Curve' keymap.
This way, paintcurve.add_point_slide would be overriden by:
- paint.vertex_paint (inverted)
- paint.weight_sample

Now move 'Paint Curve' above again.

Reviewers: campbellbarton

Maniphest Tasks: T84216

Differential Revision: https://developer.blender.org/D9939
2021-01-05 10:02:03 +01:00
08f00f4f6e BMesh: Add shape-key support to edit-mesh symmetrize
Symmetrize now flips shape-keys too since using the un-flipped
locations creates an overlapping surface which isn't useful.
2021-01-05 18:03:56 +11:00
4150facd61 BMesh: add use_shapekey to BMesh transform operators
Currently unused, needed for symmetrize to support shape keys.
2021-01-05 15:51:50 +11:00
5370a7dd40 Cleanup: use scale's 'space' argument instead of two transform calls 2021-01-05 15:51:50 +11:00
d3c62b682d Fix bmesh.mirror operator
Checks for merging vertices assumed all the geometry was being mirrored.
2021-01-05 15:51:50 +11:00
a0db43cd7b Fix T84388: Invalid operator reference in the quick-start 2021-01-05 15:51:50 +11:00
6990b6ed3b Cleanup: typos (repeated words) 2021-01-05 15:51:50 +11:00
f359102589 VSE: Fix incorrect condition for skipping prefetch frames
This error was overlooked in commit be69f23b68.
2021-01-05 04:04:06 +01:00
9b17e71c23 Cleanup: Use flag type explicitly
Using the `uiButtonGroupFlag` type explicitly can avoid the need
to look up which enum should be used as an argument.
2021-01-04 17:35:14 -06:00
5a6dfb7571 Fix T78017: Broken layout in "View Lock" panel with armature
The property split layout was broken when the bone dialog appeared,
because the name field was not set. Theoretically property split should
work in this case, but it makes sense to use the label anyway.
2021-01-04 17:32:22 -06:00
9316cb33d8 Cleanup: Remove unused variables in transform mesh skin code
Differential Revision: https://developer.blender.org/D9992
2021-01-04 17:11:59 -06:00
102eff0bd4 Fix T84382: Geometry Nodes: Vertex group attributes are removed
In the report, the geometry is copied because it has two users and the
final join node needs to write to it. The join node also happens to
remove attributes apparently, because it exposed a mistake in the "copy"
method of the `MeshComponent` class. The copy is supposed to be
a deep copy, but the vertex group name map was not duplicated.

Differential Revision: https://developer.blender.org/D9991
2021-01-04 17:07:10 -06:00
ec90dda318 UI: Fix typo in operator description 2021-01-04 15:42:15 -06:00
Pi Lanningham
5a498e6a7b Fix T84183: Dark area in the bevel custom profile widget
If there was a control point at an extreme position when drawing a curve
profile (in the bottom corner), the fill's trianglulation could fail, giving
a misleading view of the curve. This is because the extra points added to
create a closed shape were exactly on the border of the view.

This commit adds a small margin to those points, so the triangulation
doesn't fail because the line overlaps itself.

Another possible solution is to use a different algorithm to fill
the polygon, such as scanfill, which is used by curve objects.
This seemed simpler, and seems to work fairly robustly.

Differential Revision: https://developer.blender.org/D9989
2021-01-04 15:13:08 -06:00
54ee410914 Fix T84376: Skin Resize(Ctrl + A) does not work in Symmetry
Since the `TransData` converted from vertices is the same used for other
transform modes (Move, Rotate, Resize), the logic used for mirroring
focused only on the position of the vertices.

The solution here is to create a specific `TansData` for `CD_MVERT_SKIN`.
2021-01-04 17:37:08 -03:00
8c80299fc4 Make mesh modifier tests not fail with optimized OSD lib
When building opensubdiv with more aggressive optimization flags
(-march=native -02) the output meshes would differ a bit from what we
expected in the current automated modifier test file.

The differences in vertex position is within the 1e-6 range, which I
would call is acceptable for floats. In addition to this, all the
modifier test that tests the subdiv modifier in particular pass without
any modifications. I've updated two tests in the modifier test file and
script to make it pass (listed below).

Updated following test categories:

1. Decimate test

Here there was a subdiv modifier applied before the actual decimate
modifier. Because the decimate modifier creates a queue of potential
vertices it can remove, it is highly sensitive to even small changes as
it drastically changes in which order the vertices are decimated in.

As this test should only be testing the decimate modifier, I pre-applied
the subdiv modifier in the test file.

2. RandomCubeModifier
For these tests I removed the subdiv modifier as well. As with decimate,
a small change in vertex position here can lead to quite different
results.

Reviewed By: Sergey, Bastien

Differential Revision: http://developer.blender.org/D9004
2021-01-04 19:30:20 +01:00
5aab7f66a0 Fix T83876: blender crashes when baking particles + smoke sim
This was introduced in rBe5c0d4613a8943c712b57fb336997ecd78e6508e.

The issue is that the new fluid system does not use the pointcache
system for caching anymore, but still relies on pointcache for
other things. For example, it uses DEG_add_collision_relations
which internally creates relations with pointcache. Not sure if
there are other issues.

Ideally, this dependence should be resolved in one way or another
at some point, but that is out of scope for this fix.

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

Reviewers: brecht
2021-01-04 15:58:51 +01:00
09c1cb8a17 Fix T84260: NURBS edit mode lines not showing
When in edit mode, the edit lines for de-selected surfaces did not
show up.

The bug was caused by the is_gpencil bool which reused another flag.
Both grease pencil and nurbs surfaces use the edit_curve_handle shader.
A dedicated flag was added to make sure the is_gpencil bool is
set correctly.

Reviewed By: fclem

Maniphest Tasks: T84260

Differential Revision: https://developer.blender.org/D9985
2021-01-04 15:34:02 +01:00
c6e5b3f42d Fix T84095: Eevee vextex color isn't working with hair
Regression introduced by {c766d9b9dc56}. When converting the vertex
buffer to a texture buffer the fetch mode wasn't checked and the short
was bitwise interpreted as a float. This change checks the fetch_mode
and select the correct texture buffer.

This could also be added to other places when needed. At this time it is
only added here to support vertex colors when used with hair particles.
2021-01-04 15:05:37 +01:00
c716b9862a Fix: Update normals when switching scene quality
Recent commits also updated normals for metaballs, curves and volumetric
objects. This change tags will tag to generate geometry for these new
types.
2021-01-04 13:04:37 +01:00
cb2517016b GPU: Enable HQ normal work around for AMD Polaris
THe high quality normals work around is enabled for Polaris cards using
the official drivers. Since driver version 2.11.2 they fail to render
using low quality normals.

The detection of polaris cards is done by matching the opengl renderer.
The renderer strings have been extracted from various reports linked to
{T82856} but isn't complete as some reports are missing the exact
renderer as users don't always report via the help menu.
2021-01-04 12:19:51 +01:00
a3fcbb54f4 GPU: Add HQ normals workaround.
This change makes it possible for platforms to only support high quality
normal rendering. This is part of {T82856} where current AMD drivers
running on the polaris architecture does not support the low quality
setting due to a driver bug.

In a next commit the work around will be enabled.
2021-01-04 12:19:51 +01:00
02d1f1482a Fix mistake in rBef90a8e12caf in data transfer code.
Old mistake from 2.80 era when we got rid of DerivedMesh...

Not critical, but could be backported to 2.90LTS too.
2021-01-04 11:30:04 +01:00
5e38384034 Fix T84362: Crash when use Vertex Paint in subdivide strokes
Maniphest Tasks: T84362

Differential Revision: https://developer.blender.org/D9983
2021-01-04 11:29:47 +01:00
c7085be6c6 Fix T84345: Transforming the cursor fails with absolute grid-snap
Absolute grid snapping was using the pivot, which doesn't make sense
when transforming the cursor.
2021-01-04 21:15:00 +11:00
d11a87b88c DrawManager: High quality normals for non meshes
This adds high quality normals for non meshes. These include

* Volumetric Object Wireframe
* Metaballs
* Extracted Curves
* Curves in edit mode

This is in preparation to fix a regression in recent AMD
drivers where the `GL_INT_2_10_10_10_REV` data type isn't
working in Polaris cards.
2021-01-04 11:09:56 +01:00
17be2149a8 Fix T84106: attribute mix node worked incorrectly on float attributes 2021-01-04 10:43:56 +01:00
b8e536f381 Fix imbuf.new & resize allowing zero & negative dimensions 2021-01-04 20:05:32 +11:00
a6285339ba Cleanup: remove unused optional argument to imbuf.new
While this didn't cause any problems, it was incorrect.
2021-01-04 20:00:27 +11:00
Philipp Oeser
80e720ee4a Fix T84191: remove python API limits for Image.scale() dimensions
Since the introduction in 2c23bb8389,
these were set to 10000 each.

This seems like an arbitrary limit (BKE_image_scale / IMB_scaleImBuf
don't have limits and I couldn't spot similar size restrictions in
image relating functions), now match what we do for creating images
(rna_Main_images_new), use INT_MAX.

Ref D9950
2021-01-04 19:05:46 +11:00
14ee48d898 Fix crash reading files with unknown modifier ID's
Missing NULL check for the modifier type.
2021-01-04 17:40:05 +11:00
f43e8cceb3 Fix early exit check in BKE_appdir_app_template_has_userpref
Logical error in 84f21c170d
This check was a no-op, replace this with a check for an empty string.
2021-01-04 17:40:05 +11:00
f17184bfeb Fix clang_array_check checking utility
Use python3 which is now supported,
only use CLANG_BIND_DIR & CLANG_LIB_DIR when they are set.

Also add immediate mode GPU API function calls.
2021-01-04 17:40:05 +11:00
3254a63218 Cleanup: correct array size in argument 2021-01-04 17:40:05 +11:00
dcdc0f177a Cleanup: use const variables 2021-01-04 17:40:05 +11:00
cd29d76ab6 Cleanup: typo in c484b54453 2021-01-04 17:38:11 +11:00
2008c24123 Cleanup: add NULL check for filename argument which could be NULL
While it's never NULL at the moment, checks elsewhere in this function
support passing in a NULL filename, so keep this working as intended
in case RNAProcessItem.filename is NULL in the future.
2021-01-04 17:38:11 +11:00
82bbe257ee Cleanup: redundant call to WM_modalkeymap_find 2021-01-04 17:38:11 +11:00
a5081896bc Cleanup: redundant code, minor inconsistencies
- Remove ternary operators when both values are the same.
- Remove break after return.
- Remove redundant NULL checks for code which handles
  those cases immediately beforehand.
2021-01-04 17:38:11 +11:00
b5c2a75d26 Cleanup: use ARRAY_SIZE when when looping over the array indicies 2021-01-04 17:38:11 +11:00
22895d0f32 Cleanup: remove self-assignment
Use CLAMP_MAX to remove redundant comparison.
2021-01-04 17:38:11 +11:00
b34eded930 Cleanup: remove redundant code
Fix for T62504 missed removing return call.
2021-01-04 17:38:11 +11:00
9ff4012711 Cleanup: sort cmake file lists 2021-01-04 17:38:11 +11:00
fea1026bb8 Cleanup: use 'pragma once'
Add explanations for cases the header-guard defines are still used.
2021-01-04 17:38:11 +11:00
dfbda59a66 Cleanup: redundant struct declarations 2021-01-04 17:38:11 +11:00
f03c25bda8 Cleanup: sort structs 2021-01-04 17:38:11 +11:00
54f89e8704 Cleanup: docy comments beginning with '/**' don't end with '**/' 2021-01-04 17:38:11 +11:00
9b10b3930b Cleanup: clang-format 2021-01-04 17:38:11 +11:00
c61c7d9926 Cleanup: spelling (use 'gimbal' instead of 'gimble') 2021-01-04 17:38:07 +11:00
613c568df2 Cleanup: use doxy sections for render_preview.c 2021-01-04 17:37:44 +11:00
12409b2069 Cleanup: rename get_brush_icon, make it a static function
Group with other icon preview API functions.
2021-01-04 17:37:44 +11:00
01f38c10cb Cleanup: use const casts in DerivedMesh.cc 2021-01-04 17:37:44 +11:00
1e8f266591 API Docs: CSS: Fix long enum list
This commit makes some adjustments to a previous fix which broke with 
new versions of sphinx/theme.

Fixes T76453
2021-01-02 20:04:25 -05:00
c7e92e379d Update RNA to manual url mappings 2021-01-02 17:51:56 -05:00
Aaron Carlisle
e1b8af9ba7 Fix Unreported: Run time error in UI code
Steps to reproduce:

1. Add clip to clip editor
2. Open the tracking settings & tracking settings extra panels

To fix this the sub panel is only drawn if a track is active.
The main panel will exit early and display a "No active track" message.
This is consistent with other panels in the clip editor.

Reviewed By: HooglyBoogly

Differential Revision: https://developer.blender.org/D9727
2021-01-02 16:11:14 -05:00
0330b0552b Cleanup: Explicitly pass icon size to generation function, not just bool
* This way you don't have to look up the function declaration to know what the
  boolean value means.
* You can call the function in a loop over the available sizes and pass the
  index as size.
* Makes it easier to add a new size in future if needed.
2021-01-02 15:36:51 +01:00
057a8afb87 Fix T84024: Empty image opacity labeled transparency
This value really is the opacity, or the alpha, since a value of 1.0 means
that the image is fully visible, not invisible like "full transparency"
would suggest. Mistake in rBea4d28aea0343a.

Differential Revision: https://developer.blender.org/D9920
2021-01-01 12:07:42 -06:00
0da1fc2fc4 Fix T84029: Point Distribution node crash on mesh with no faces
This bug exposes some ugliness in the implementation in poisson disk
distribution implementation with likely incorrect resizing of vectors and
some other assumptions. However, a simple quick fix is to return early
when the input mesh has no faces. This makes sense anyway because
there is no surface to scatter on.
2020-12-31 17:01:29 -06:00
cda8979005 Fix mistake in recent rB8c135fa9a834 commit. 2020-12-31 15:12:06 +01:00
8c135fa9a8 LibOverride/RNA: refactor rna_property_override_property_real_id_owner.
Makes it more in line with more generic `RNA_find_real_ID_and_path`, and
avoids generating the rna path string if we do not need it.
2020-12-31 14:25:29 +01:00
85951f8fde Cleanup: Move functions from sequencer_edit.c
These are utility functions that are not used in this file.

No functional changes.
2020-12-31 05:22:19 +01:00
e5e57fe0a2 Cleanup: Remove unused functions from sequencer_edit.c
No functional changes.
2020-12-31 05:02:10 +01:00
8373f497bd Add regression tests for curve conversion to mesh
This adds a basic set of tests for curve sampling and bevel generation.
At the moment there are basic test cases for bevels, caps, and the
filling of 2D curves, but more tests can be added in the future.

Curves are actually converted to "DispLists" for displaying them in the
viewport, so it's much simpler to rely on the mesh conversion operator
instead of building a new test framework for another data structure.

Differential Revision: https://developer.blender.org/D9958
2020-12-30 13:12:29 -06:00
Yevgeny Makarov
2d86175bac Fix unreported: Sequencer grid lines are not drawn
By design, there should be lines between the alternating horizontal
stripes in the Sequencer. But currently they are all drawn in one place,
on top of each other. Mistake in rBfae895125efe.

Differential Revision: https://developer.blender.org/D9962
2020-12-30 12:56:24 -06:00
2be2165dd6 Cleanup: Use LISTBASE_FOREACH macro
Differential Revision: https://developer.blender.org/D9960
2020-12-30 17:03:06 +01:00
f910342c8d Outliner: Fix useless assert in new liboverride showing code.
It is perfectly 'valid' to find invalid RNA properties references in
override properties list. Data change, RNA changes, IDProperties change,
some linked ID may become unavailable, etc.

Note that those invaldi override properties are cleaned up when updating
the override info (so typically on undo step storage, and .blend file save).
2020-12-30 12:38:53 +01:00
761ef45a24 Cleanup: Fix typo in tests error message 2020-12-29 20:46:29 -06:00
c1740e9ad0 Fix T83991: Pasting sound strip not working correctly
New UUID was generated for original strip not new one.

Bug caused "invisible" sound strip playing that is impossible to
remove. Especially noticable when transforming pasted strips. In such
case, file reload was necessary.

Reviewed By: mont29

Differential Revision: https://developer.blender.org/D9912
2020-12-29 19:57:56 +01:00
48e0e0e2ac Fix T83439: Sculpt: Radial symmetry combined with mirroring results in texture offsets
Looks like this has been wrong since the introduction in rB5505697ac508
10 years ago.

To get the proper texture lookup in the mirrored area, first rotate, then
translate/flip [instead of the other way around].

Maniphest Tasks: T83439

Differential Revision: https://developer.blender.org/D9897
2020-12-29 18:38:16 +01:00
ae82410329 Fix T83749: Better handling of alpha in generic Nodes material wrapper for IO add-ons.
Try to detect if a given image may have valid alpha data or not (based
on number of channels and depth). This may be a bit doggy in theory, but
in practice it should cover most fields as expected. We can always
adjust the euristic here in other wrong cases appear.

This will affect all import add-ons using that node shader wrapper (at
least OBJ and FBX ones).
2020-12-29 16:38:40 +01:00
e22a36e80a Cleanup: Use proper RNA_pointer_is_null helper.
Followup to rB7f3601e70dd and rBad63d2f60e2.
2020-12-29 12:11:18 +01:00
5428ad40e8 Test: Add utility to do near comparison for float[2] 2020-12-29 10:38:38 +01:00
81c57c9471 Fix T84144 cursor wrap broken for Windows.
Modifies WM_BUTTON processing to reuse existing mousemove logic. Fixes
case where cursor wrap was not being handled on mouse release.

Bonus: flattened mouse move logic so all paths lead to a single return.
Removed case where wrap is not handled until subsequent mousemove as
button press may rely on updated mouse move position.
2020-12-28 13:34:58 -08:00
1db27af38f Fix T84200: Rotating a paintcurve [all paintmodes] doesn’t work correctly
The transform code did not provide a 2d context to be used in 3d space.

The solution is to set all matrices for the screen space in these cases.

This commit also removes the dial3d drawing in these cases.
It was not correct anyway.
2020-12-28 16:19:37 -03:00
Erik Abrahamsson
6fbeb6e2e0 Add operator to copy a modifier to all selected objects
These two operators (one for grease pencil, one for other objects)
copy a single modifier from the active object to all selected objects.
The operators are exposed in the dropdown menus in modifier headers.

Note that It's currently possible to drag and drop modifiers between
objects in the outliner, but that only works for dragging to one object
at a time. Modifiers can also be copied with the "Make Links" operator,
but that copies *all* modifiers rather than just one. The placement
and scope of these new operators allow for more useful poll messages
and error messages as well.

Every object type that supports modifiers is supported. Although hook
and collision modifiers aren't supported because of an unexplained
comment in `BKE_object_copy_modifier`, other than that, every modifier
type is supported, including particle systems, nodes modifiers, etc.

The new modifiers are set active, which required two small tweaks to
`object.c` and `particle.c`.

Reviewed By: Hans Goudey (with additional edits)

Differential Revision: https://developer.blender.org/D9537
2020-12-28 11:18:52 -06:00
7f3601e70d Cleanup/refactor rna_idp_path code.
Factorize common processes and checks, early `continue` in invalid
cases, etc.
2020-12-28 17:40:27 +01:00
ad63d2f60e Fix T84091: IDProperties/RNA: Crash due to colliding name between custom data and static RNA property.
We have to check that the RNAProperty found in `rna_idp_path` from the
currently checked IDProperty name is actually a real runtime RNA-defined
one, and not a static C-defined RNAProperty...
2020-12-28 17:40:27 +01:00
b1d8aeeab2 Snap: Decrease the distance of the incremental snap in ortho view
This matches more the older versions (as shown in the T77819).
2020-12-28 11:44:43 -03:00
26c34a2a3a Tweak comment regarding Sculpt mode undo issues in object update code.
Original comment from rB8a9dedf82954. See also T84084.
2020-12-28 14:16:14 +01:00
823f0da702 Cleanup: UI messages fixes. 2020-12-28 10:22:02 +01:00
e6bb2cdec7 Cleanup: Typo: overriden -> overridden. 2020-12-28 10:22:02 +01:00
e0b6c8f777 Fix possible fall-through in outliner region listener
Reported as a strict compiler warning, and the need of fall-through is
not needed from just reading the code.

If it is something what must happen, the reasoning is to be explained
in the comment, and ATTR_FALLTHROUGH is to be used.
2020-12-28 09:57:59 +01:00
e590d2d167 Cleanup: Declare variables where initialized 2020-12-27 21:46:57 -06:00
57fe65b17e Cleanup: Reduce indentation
Since the if statement is just a NULL check, returning early is simpler
and makes reading the rest of the funtion easier.
2020-12-27 21:26:53 -06:00
aa64fd69e7 UI: List library overrides in the Outliner
Having a centeral place to find a list of all library overrides should be
useful for managing production scenes where library overrides are used a lot.
This change adds the individually overridden properties of a data-block under
the data-block itself. Just how we show modifiers, constraints or pose channels
there. This way we can also expose library override operations/options better
in future.

There's also a filter option for the library overrides now, so they can be
hidden. It is only available in the View Layer display mode though, like the
other filter options.

One internal change this has to do is adding more informative return values to
undo pushes and the library override functions called by it. That way we can
send a notifier when library overrides change for the Outliner to know when to
rebuild the tree.

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

Reviewed by: Andy Goralczyk, Bastien Montagne, William Reynish
2020-12-27 22:45:41 +01:00
960a0b892c Fix T84101: Duplicate operator not available for some data-block selectors
In some operators that previously allowed duplicating the selected data-block,
the operator would not be available now. 2250b5cefe split the "new" operators
into "new" and "delete" to allow clearly differentiating between the two. But I
apparently didn't amend all affected data-block selectors to use the added
"duplicate" operators.
I went over all operators that were split now and made sure all affected
data-block selectors are updated.
2020-12-27 15:55:58 +01:00
e56fe47748 Fix crash when saving render from temporarily maximized render window
Steps to reproduce were:
* Start with factory defaults
* Set "Render in" to "Maximized Area"
* Render
* Open "Save as"
* Click Cancel

Mistake in  78d2ce19c4. Was using the wrong area pointer, which I think
didn't make a difference in most cases, but here it did.
2020-12-27 15:11:26 +01:00
7916c59304 UI: Grammar: "Clean Up" vs "Cleanup" in operator name
"Cleanup" is a noun while "Clean Up" is the verb.
2020-12-26 16:50:44 -06:00
8491e4ab86 Fix unreported: Cycles CLI device override doesn't set peer memory usage flag
Reviewed By: brecht

Differential Revision: https://developer.blender.org/D9929
2020-12-25 23:13:03 +01:00
Nicholas Rishel
565ea3df60 Simplification of Wintab event handling.
Previously Wintab packets were added to a local queue to be processed
during Win32 mouse events, in order to correlate Wintab to Win32
mouse buttons. Wintab packets before Win32 mouse down events were
expired on a timer.

This commit drives mouse events during Wintab events when a device is
in range. When a Wintab button is found it is dispatched if an
equivalent event can be popped from the Win32 event queue. If a Win32
mouse button event is not associated with a Wintab event, it falls
through to WM_BUTTON handling. All Wintab packets are handled as they
are received.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D9908
2020-12-24 16:41:19 -08:00
Yevgeny Makarov
af316d2761 UI: Cleanup spelling of compound words
Approximately 138 changes in the spelling of compound words
and proper names like "Light Probe", "Shrink/Fatten", "Face Map".
In many cases, hyphens were used where they aren't correct, like
"re-fit". Other common changes include:
 - "Datablock" -> "data-block"
 - "Floating point" -> "floating-point"
 - "Ngons" -> "n-gons"

These changes help give the language used in the interface
a consistent, more professional feel.

Differential Revision: https://developer.blender.org/D9923
2020-12-24 13:11:22 -06:00
Yevgeny Makarov
2917f550ca Cleanup: Fix capitalization in various UI strings
Approximately 195 changes of capitalization to conform to MLA title style.
UI labels and property names should use MLA title case, while descriptions
should be capitalized like regular prose, generally with only the start of
a sentence capitalized.

Differential Revision: https://developer.blender.org/D9922
2020-12-24 11:07:32 -06:00
fe440a92e9 Cleanup: compiler warning 2020-12-24 14:19:21 +01:00
29cd99e7fd Cycles: remove surface area computation for meshes with OSL
This is relatively expensive and as per the OSL spec, this value is not
expected to be meaningful for non-light shaders. This makes viewport updates
a little faster.

As a side effect also fixes T82723, viewport refresh issue with volume density.
2020-12-24 13:53:33 +01:00
c4f8aedbc2 Fix T84016: Cycles baking crash with OptiX after recent changes
This worked for CPU + GPU, but not GPU only.
2020-12-24 12:59:35 +01:00
2221389d6e Bake: vertex color baking support for Cycles
In the Bake > Output panel, there is now a choice between Image Textures and
Vertex Colors. The active vertex color layer is used for baking. This works
with both existing per-corner and sculpt per-vertex vertex colors.
2020-12-24 12:40:48 +01:00
0b4fae7a51 Cleanup: refactoring of bake code in preparation of vertex color baking
Split of internal/external image bake target code off into smaller functions and
refactor associated data structures for clarity. Designed so that a vertex color
bake target is easy to fit in.

Also avoid passing in a huge number of arguments into the main baking function,
pass a struct instead.
2020-12-24 12:00:58 +01:00
58c697a9ec Audaspace: port accuracy improvement from upstream. 2020-12-24 10:42:16 +01:00
83ad35cb9c Fix T83997: Duplicated audio does not sound the same
The issue was that sounds were always faded from 0 volume when they
started and depending on the currently used buffer size, the fading took
longer or shorter.

The solution stores whether the sound has ever been played back and
consequently does not fade when starting to play back.
2020-12-24 10:42:16 +01:00
c9efb54240 Cleanup: Clang format 2020-12-23 12:13:44 -06:00
d8dc4c5b32 Geometry Nodes: new Rotate Points node
This node updates the "rotation" attribute on points.
Multiple ways to specify the rotation are supported.

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

Ref T83668.
2020-12-23 16:37:47 +01:00
8a9dedf829 Workaround T84084: Assert/crash when undoing from Sculpt mode to Object one.
Disclaimer: This workaround avoids crashing with current state of the
code and is only committed as temporary band-aid until we can assess the
full issue and decide if/how it needs to be adressed.
2020-12-23 16:03:42 +01:00
d29a720c45 Fix T84002: Sculpt: Masking operations crash if multires is in play.
This fixes the main issue there (essentially a followup to
rB90e12e823ff0: Fix T81854: crash when undoing switch between sculpt and
edit mode).

We basically remove more (hopefully all the remaining!) modifications of
orig mesh from `sculpt_update_object`, as those done here will not be
immediately available in the evaluated data (that specific bug happened
because masking data was added to orig mesh there, but not flushed to
depsgraph evaluated one).

This also goes towards a better separation between handling of evaluated
data and orig one.

Note that modification of orig mesh data can still happen, e.g. values
in some cdlayers, but at least all pointers should now be valid in the
evaluated mesh.

There are still some issues, e.g. we now get an assert/crash in
`multires_reshape_assign_final_coords_from_ccg` when undoing out of the
Sculpt mode, presumably because subdiv_ccg data remains unchanged then
(and hence still has the `has_mask` flag set), while actual mesh data do
not have that cdlayer anymore...

This commit also cleans up/simplifies some code,
`ED_object_sculptmode_enter_ex` was (indirectly) calling
`BKE_sculpt_face_sets_ensure_from_base_mesh_visibility` twice e.g.
2020-12-23 16:03:42 +01:00
9d04fa39d1 Fix T84063: crash reading pointer properties in Attribute shader node
Path resolving can find e.g. a datablock rather than a float or integer,
treat that as a failure to find a valid property.
2020-12-23 15:50:31 +01:00
635694c0ff Fluid: Added new viscosity solver
Mainly updated the Mantaflow version. It includes the new viscosity solver plugin based on the method from 'Accurate Viscous Free Surfaces for Buckling, Coiling, and Rotating Liquids' (Batty & Bridson).

In the UI, this update adds a new 'Viscosity' section to the fluid modifier UI (liquid domains only). For now, there is a single 'strength' value to control the viscosity of liquids.
2020-12-23 15:48:38 +01:00
5cfda8e7f7 Fix crash closing File Browser window after closing temporary render window
This seems to be a longer standing issue. Steps to reproduce were:
* With factory settings, Ctrl+O then F12
* Close the render window using the window close button
* Close the File Browser window using the window close button

This could be OS specific though, at least on macOS this caused a crash.
2020-12-23 15:31:31 +01:00
21cb288029 Fix incorrect debugging text in extra operator icons for buttons 2020-12-23 14:43:40 +01:00
27fcaa6173 Cleanup: Move functions to new ED (editor) operators file & general cleanup
With the new `ed_util_ops.c` introduced in 2250b5cefe, existing code can be
cleaned up to use it.

* Move new ID preview operators to `ed_util_ops.c`
* Move ED operator registration to `ed_util_ops.c`
* Use doxygen sections in `ed_util_ops.c`
* Rename ID related ED operators to use `ED_OT_lib_id_` prefix.
* Remove unused `#include`s
2020-12-23 14:34:24 +01:00
78d2ce19c4 Fix T84013: Crash closing maximized File Browser opened from Preferences
After 1e799dd26e, the logic to recognize a temporary File Browser window
didn't work correctly anymore. It would recognize a maximized File Browser
inside a temporary window as a temporary File Browser window, and attempt to
close this (rather than returning to the previous layout).
The logic there was pretty weak, and still is I think. A more stable solution
would need bigger refactoring.

With this, it's also not possible to maximize or fullscreen an area within a
temporary window (Preferences, File Browser, render window) anymore. Think that
won't make a noticable difference, since you couldn't open multiple areas there
anyway, and the area seems to be maximized already.

Cleaned up the code a bit to not become more confusing with the changes.
2020-12-23 14:34:24 +01:00
9460051c1a Sculpt Undo: Fix broken memory size and potential use of uninitialized variables.
That code looked really like a joke tbh... Random reported memory usage
is not really that important, but the uninitialized items counts was
potentially fairly severe.
2020-12-23 11:17:58 +01:00
b4b888fd2a Cleanup: Reduce Variable scope clip_buttons 2020-12-22 20:13:05 -05:00
8d3d4c8840 Cleanup: Use true and false for booleans 2020-12-22 14:58:57 -06:00
4b46afae09 WM: minor optimization for when there is a large number of notifiers
Don't add the same stats refresh notifiers multiple times, it can be slow to
search the full list of notifiers for duplicates when there are many.

Fundamentally the time complexity in searching for duplicates is still bad.

Inspired by D9901 from Erik Abrahamsson
2020-12-22 19:26:06 +01:00
ac82904c49 UI: keep image open button always visible in image editor datablock selector
Does not need to be hidden in the menu.
2020-12-22 18:18:22 +01:00
00ff3dfb23 Cleanup: Reduce variable scope in object.c 2020-12-22 10:35:18 -06:00
b2edc716c1 Fix Cycles OptiX runtime compilation broken after shader raytracing
Need to pass the appropriate flags as we do for compilation as part of the
CMake build.
2020-12-22 15:08:59 +01:00
dad5aded0c Fix T84006: Cycles AOV not written with some mix shader node set ups 2020-12-22 14:25:50 +01:00
2601501fce RNA: make bpy.data.orphans_purge() return number of deleted datablocks
Sometimes multiple calls to `bpy.data.orphans_purge()` are needed to
delete all orphans, because a call can turn previously-used datablocks
into orphans. Returning the number of deleted datablocks makes it
possible to keep looping until nothing can be deleted any more.

This patch keeps track of deletions in `id_delete()` so that it can be
returned up the call stack.

Reviewed By: mont29

Differential Revision: https://developer.blender.org/D9918
2020-12-22 14:05:49 +01:00
512a23c3d6 VSE: handle IO errors when reading disk cache header and version
Respond to return values of `fscanf()` and `fread()` to detect and
handle I/O errors. Not only is error handling a good idea, this also
prevents warnings from GCC that `fread()` and `fscanf()` return values
are ignored.

Reviewed By: ISS

Differential Revision: https://developer.blender.org/D9915
2020-12-22 11:43:33 +01:00
0e85d701c6 Animation: Bake Action, improved discontinuity filter for bones
Perform the same filtering as e5528904f1
introduced for object rotations, for bone rotations.
2020-12-22 10:04:21 +01:00
9f34f2b20d VSE: Fix animation versioning for bezier F-curves
`seq_convert_transform_animation()` converted only keyframed value, but
when bezier interpolation is used, posotion of handles was unchanged.
This caused significant difference in animation.

I have checked only linear interpolation when testing versioning originally.
2020-12-22 05:50:34 +01:00
ffacce5be4 UI: Properties editor popover and outliner sync
This adds a popover to the properties editor. Currently the only setting
is for controlling outliner to properties syncing.

Because we cannot define a perfect heuristic to determine when
properties editors should change tabs based on outliner icon selection,
we need an option to enable or disable this behavior per properties
editor.

There are 3 options for controlling the syncing. Auto uses the heuristic
to only allow tab switching when a properties editor and outliner share
a border. On and off enable and disable syncing respectively.

Differential Revision: https://developer.blender.org/D9758
2020-12-21 14:31:32 -07:00
Wayde Moss
2d6e6d035b Nla Refactor: Better blend function parm naming
**Renames parms**:
| **old name** | **new name**
| old_value | lower_value
| target_value | blended_value
| value | strip_value
| inf | influence

**Reason**: {D8296} allows full nla stack evaluation with proper
keyframing support. These names should make it more intuitive how all
the data gets processed and inverted. Note, that I do use the term
"strip_value" instead of something like "fcurve_value" of the tweak
strip. Technically, "strip_value" is closer to what is solved for.
For example, if a noise fmodifier was active for the fcurve, then the
remapping would appear to be wrong. In the future, further solving can
be done afterward, outside of the nla system, to remove the effects of
fmodifiers.

**Renames functions**:
| nla_invert_blend_value | nla_blend_get_inverted_strip_value
| nla_invert_combine_value | nla_combine_get_inverted_strip_value

**Reason**: D8296 adds get_inverted_lower_value() variants,
so "invert" alone is too vague.

**Renames NlaKeyframingContext member**:
| nla_channels | lower_eval_data

**Reason**: D8296 evaluates the upper stack. This name makes it more
obvious what data is stored there.

No functional changes (relative to the dependency below)
Split from {D9247}
Depends on {D9694} since the code was so close to eachother.

Reviewed By: sybren

Differential Revision: https://developer.blender.org/D9695
2020-12-21 14:07:16 -05:00
1e2c028a3a Fix/workaround geometry nodes not working with deformation motion blur
Always assume geometry nodes produce potentially animated meshes or point
clouds. In general it is hard to check if geometry nodes are animated, and
for modifiers this was already weak.

The better solution will likely involving checking which geometry was
modified by the depsgraph on frame change, to replace the current mechanism
of manually checking for certain types of modifiers and animation.
2020-12-21 19:19:59 +01:00
36b6ea6cb1 Weight Paint: fix Multi-Paint weight display after rB5502517c3.
Weight Paint Multi-Paint definitely depends on the weight specific
flag, and vertex group locking also involves group name symmetry
via BKE_object_defgroup_mirror_selection. These two are also
features implemented by me so I feel confident.

The rest of object_vgroup.c possibly should be changed too, but
that requires more consideration than these obvious cases.
2020-12-21 20:50:05 +03:00
be71bd8fcc Cleanup: Reduce indentation 2020-12-21 09:43:54 -06:00
Matteo Falduto
985528c9b9 UI: make light spot shape panel consistent between Cycles and Eevee
Differential Revision: https://developer.blender.org/D9906
2020-12-21 14:15:21 +01:00
d2239b685c UI: Use better icon for identifying assets
Use the `ASSET_MANAGER` icon which is more appropriate than the current one
which was just an unused icon that seemed sorta fitting, but was only meant to
be temporary.
The `ASSET_MANAGER` icon is already used for the Asset Browser, so it's being
reused which we normally avoid. So we may still want to create a dedicated one,
maybe a variation of this one.
2020-12-21 13:33:48 +01:00
626a9aae6d Fix part of T84004: Some 2.92 alpha UI strings can't be translated.
Adding 'new' (?) `heading` parameter of some UILayout functions...
2020-12-21 11:50:38 +01:00
5fe24ce295 Fix T84010: Missing scale animation versioning code
Code was removed in 247b10e6a2 but it was incorrect in first place.
Conversion was done for `offset_x` and `offset_y` channel originally,
but it should be done for `scale_x` and `scale_y`
2020-12-21 11:36:39 +01:00
c34ba26856 Fix part of T84004: Some 2.92 alpha UI strings can't be translated.
Not sure why, but py files from `bl_operators` were never considered for
i18n string extraction... They do define some UI strings though.
2020-12-21 11:35:02 +01:00
c9c3bf9833 Some more UI messages fixes... 2020-12-21 10:52:15 +01:00
42e2dd2178 Fix some UI messages and update i18n spellcheck utils. 2020-12-21 10:49:33 +01:00
720b2c6655 install-deps: Install OIIO utils, re-enable package on RPMs.
OIIO utils are mandatory for a whole set of tests (Cycles, VSE), and
it's a small package, no reason to not install it.

Also re-enabling package handling of OIIO on RPM-based distro, not sure
why it was disabled but this has become a fairly stable and standard
library now, would not expect issues anymore.
2020-12-21 09:49:08 +01:00
Matt Hill
fdb7623e09 Unix/macOS: support building with Ccache
This adds an option (WITH_COMPILER_CCACHE) to build using Ccache if it's
found. Makefiles-based, Ninja-based and Xcode generators are supported.

Pass `-DWITH_COMPILER_CCACHE=ON` to cmake to enable Ccache.
Utility option in GNUmakefile is also added: for e.g.,
`make ninja ccache`.

Reviewed By: brecht, ankitm
Differential Revision: https://developer.blender.org/D9665
2020-12-21 10:47:35 +05:30
Garry R. Osgood
84cc00f3b6 Fix T83989: Attribute Math node ignores its operation setting
T83989 observes that the Attribute Math node always adds its
operands regardless of its operator setting. This was caused
by an oversight committed in rB23233fcf056e42, which overlooked
adjusting the exec function to use the new storage location.

Differential Revision: https://developer.blender.org/D9909
2020-12-20 18:46:24 -06:00
c229d9876b Cleanup: Correct comment 2020-12-20 18:42:35 -06:00
d283a093d6 fix T83880: Added check for valid context object to avoid null pointer exception when no object in scene 2020-12-20 18:48:40 +01:00
Yevgeny Makarov
478ba53270 UI: Fix text padding in some list widgets
Normally, pure text buttons have no padding at their edges so they
align with edges of buttons, see D9058. However, in several cases
there are labels aligned to the right side of a list widget row,
so they're missing padding against the right edge.

The fix is to use emboss = 'NONE' for such labels, which changes
the drawing style, adding padding on the right edge. (Normally so
labels aligned with the text from non-embossed buttons). This is
not necessarily intended, but it works properly.

For more information, see the revision.

Differential Revision: https://developer.blender.org/D9874
2020-12-20 11:27:02 -06:00
16527ebaba UI: Slightly improve alignment in selection tool icons
Parts of the tool icons for box, circle, lasso, and tweak select that were
meant to be flat or at a 45 degree angle were slightly misaligned, making
the edge look blurry.
2020-12-20 10:53:23 -06:00
Peter Fog
5a69f70751 VSE: Add options to select neighboring handles
Options added to `sequencer.select_handles()` operator.

Reviewed By: ISS

Differential Revision: https://developer.blender.org/D7707
2020-12-20 06:23:08 +01:00
Yevgeny Makarov
864c806863 UI: Reorder enums in render results image editor header
The convention is to put the label at the bottom of the enum, or in the
spot furthest away from the button. This commit reorders the items in
the "Slot", "Layer", and "Pass" menus to be consistent with this
convention. It also reorders the numbering so that higher numbers are
lower.

The original patch was by Adrian Newton (@TFS), with slight changes
and additions.

Differential Revision: https://developer.blender.org/D7142
2020-12-19 21:52:45 -06:00
38b77ef8b2 VSE: Remove cost calculation from cache
This value was meant to be used for keeping images that are slowest to
render in cache. Method of measurement was flawed, because it doesn't
take UI overhead into consideration.

Cache panel is to be removed because users should not have to tweak
settings like this. It is not useful for development either, therefore
it is removed completely.
2020-12-20 03:58:38 +01:00
c4ff91aab7 VSE: Fix incorrect cache memory usage calculation
If image is cached twice, it's size has been counted twice as well, but
only image reference count is increased, not memory usage.

Use `MEM_get_memory_in_use()` instead of size own tracking.
2020-12-20 03:51:56 +01:00
Aaron Carlisle
0144b70948 Movie Clip: Annotation UI Improvements
Previously, the Annotation panels were a bit buggy in the movie clip editor.
This commit fixes the issue of the panel in the sidebar would disappear
when selecting  "Tracks" if no tracks were added to the clip.
To solve this issue the user if given a label text saying "No annotation source"

This commit also removes some grease pencil operators from the toolbar
that do not work with the new annotation system.

This commit also moves the data source choice from the toolbar to the sidebar.
This is needed to migrate the current toolbar to the new tool system
(see T83612)

Some old invalid code was also removed.

Reviewed By: #grease_pencil, antoniov

Differential Revision: https://developer.blender.org/D9729
2020-12-19 14:49:38 -05:00
Aaron Carlisle
6538f1e600 Compositor: New Exposure Node
This new node increases the radiance of an image by a scalar value.
Previously, the only way to adjust the the exposure of an image was with
math node or using the scene's color management.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D9677
2020-12-19 14:41:14 -05:00
09be4a0917 Cleanup: Use typedef for UI emboss type enum
Previously both `char` and `int` were used to represent this enum.

Differential Revision: https://developer.blender.org/D9903
2020-12-19 10:07:20 -06:00
a5a302bd18 Cleanup: Split SEQ_sequencer.h file 2020-12-19 07:25:01 +01:00
046ca0749a Cleanup: Rename BKE_sequencer functions
API functions get SEQ_ prefix.
Intern functions get seq_ prefix

Functions also have appropriate category included in name.
2020-12-19 06:29:15 +01:00
6942dd9f49 Fix T83868: Button animation states no longer visible without emboss
This bug was caused by making it so that non-embossed modifier icon
buttons could become an operator button and retain their red highlight
for disabled modifiers. The icon button needs emboss turned off, but
in earlier versions of Blender, `UI_EMBOSS_NONE` would be overridden
by animation or red alert states.

Instead of abusing "NONE" to mean "none unless there is animation or
red alert", this commit adds a new emboss flag for that situation,
`UI_EMBOSS_NONE_OR_STATUS`, which uses no emboss unless there is an
animation state, or another status. There are only a few situations
where this is necessary, so the change isn't too big.

Differential Revision: https://developer.blender.org/D9902
2020-12-18 17:13:15 -06:00
002722bb80 Fix build error after previous commit
I tested building so many times while making this patch, but somehow
the previous commit was missing a padding variable, I have no idea how.
2020-12-18 17:08:49 -06:00
c106b07e23 Cleanup: Remove unused variables from the bNode struct
In some cases the variables were set but never used anywhere.

Differential Revision: https://developer.blender.org/D9889
2020-12-18 17:04:52 -06:00
6367bc716a Cleanup: Use true and false for booleans 2020-12-18 15:12:15 -06:00
e298339289 Cleanup: Declare variables where initialized
Also decrease scope of some variable declarations.
2020-12-18 12:39:50 -06:00
6be9747b96 Cleanup: Use bool instead of int 2020-12-18 12:12:32 -06:00
2250b5cefe UI: Redesigned data-block selectors
The previous design is rather old and has a couple of problems:

* Scalability: The current solution of adding little icon buttons next to the
  data-block name field doesn't scale well. It only works if there's a small
  number of operations. We need to be able to place more items there for better
  data-block management. Especially with the introduction of library overrides.
* Discoverability: It's not obvious what some of the icons do. They appear and
  disappear, but it's not obvious why some are available at times and others
  not.
* Unclear Status: Currently their library status (linked, indirectly linked,
  broken link, library override) isn't really clear.
* Unusual behavior: Some of the icon buttons allow Shift or Ctrl clicking to
  invoke alternative behaviors. This is not a usual pattern in Blender.

This patch does the following changes:

* Adds a menu to the right of the name button to access all kinds of operations
  (create, delete, unlink, user management, library overrides, etc).
* Make good use of the "disabled hint" for tooltips, to explain why buttons are
  disabled. The UI team wants to establish this as a good practise.
* Use superimposed icons for duplicate and unlink, rather than extra buttons
  (uses less space, looks less distracting and is a nice + consistent design
  language).
* Remove fake user and user count button, they are available from the menu now.
* Support tooltips for superimposed icons (committed mouse hover feedback to
  master already).
* Slightly increase size of the name button - it was already a bit small
  before, and the move from real buttons to superimposed icons reduces usable
  space for the name itself.
* More clearly differentiate between duplicate and creating a new data-block.
  The latter is only available in the menu.
* Display library status icon on the left (linked, missing library, overridden,
  asset)
* Disables "Make Single User" button - in review we weren't sure if there are
  good use-cases for it, so better to see if we can remove it.

Note that I do expect some aspects of this design to change still. I think some
changes are problematic, but others disagreed. I will open a feedback thread on
devtalk to see what others think.

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

Reviewed by: Bastien Montagne

Design discussed and agreed on with the UI team, also see T79959.
2020-12-18 18:28:04 +01:00
7bee1489c1 UI: Rename "Float Color" attribute data type to "Color"
Since "Float Color" is more commonly used than "Byte Color",
which is not exposed in the interface yet anyway, it makes sense to
drop the "Float" label on the color data type name.
2020-12-18 09:34:21 -06:00
3deb21055a Geometry Nodes: support randomly picking instances from collection
This uses the "id" attribute to randomly pick instances from a collection
for each point.

There is one issue. When the collection is updated (e.g. when an object is
added to it), the nodes modifier is not automatically updated. It seems
like we don't have the infrastructure to support this dependency yet.
The same issue exists in the Boolean modifier and with collision collections.
This should be solved separately soonish.

When "Whole Collection" is disabled, one direct child of the input collection
is instanced at each point. A direct child can be an object or a collection.

Currently, all objects are picked approximately equally often. In the future,
we will provide more control over which point gets which instance.

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

Ref T82372.
2020-12-18 16:02:23 +01:00
1be465cccb GPencil: Fix potential error in interpolate frame
As now it is using a duplicated frame, the untag must be done before copying the frames.
2020-12-18 15:57:19 +01:00
f3b50380f0 Fix T83916: Cannot drag link from socket if node is inside frame
Caused by rB7470c10601d0 where iterating nodetree nodes was changed from
backwards to forwards by mistake.

Maniphest Tasks: T83916

Differential Revision: https://developer.blender.org/D9890
2020-12-18 14:41:38 +01:00
Vincent Blankfield
95afc53604 Fix T83716: Dope Sheet, incorrect scaling of channel UI elements
Change the top coordinate of the animation channel list UI elements to
`rect->ymin` so they correctly span from `rect->ymin` to
`channel_height`.

Some buttons in the dope sheet channels didn't scale properly with the
`Keyframe Scale Factor` preferences setting. This was caused by using
the `ymid` value (`ymid = BLI_rctf_cent_y(rect) - 0.5f * ICON_WIDTH`) to
position the buttons that supposed to fill all vertical space in the
channel (with `channel_height` height). The `ymid` value is only
appropriate for the UI elements that with `ICON_WIDTH` height.

Maniphest Tasks: T83716

Reviewed by: sybren

Differential Revision: https://developer.blender.org/D9841
2020-12-18 14:13:52 +01:00
e5764013b0 Geometry Nodes: move Boolean node to mesh category
This node works on meshes specifically.
2020-12-18 13:33:24 +01:00
c5569ba140 Geometry Nodes: do not crash when there are undefined nodes
Undefined geometry nodes will just output a default value now.
2020-12-18 13:28:55 +01:00
79d6bd9a22 Functions: add generic pointer class for const pointers
This adds a GPointer class, which is mostly the same as GMutablePointer.
The main difference is that GPointer references const data, while GMutablePointer
references non-const data.
2020-12-18 13:28:55 +01:00
f43561eae6 Function Nodes: Input Vector
Ref: T82651

Normally people use "Combine XYZ" to input a vector, but it is more
interesting to have an explicit vector input.

So this is basically "Combine XYZ" without any input sockets, the values
are stored in the node itself.

Differential Revision: https://developer.blender.org/D9885
2020-12-18 13:03:27 +01:00
b342e089c3 Fix mistake in Bake Action discontinuity fix
Fix mistake in e5528904f1 where one change accidentally wasn't included
in the commit.
2020-12-18 13:02:28 +01:00
e5528904f1 Fix T83351: Baked object rotation has discontinuities
Fix Euler discontinuities in the Bake Action operator, by explicitly
using the previous Euler angles when converting from matrix to rotation.

This basically follows the same approach as used in e4ca1fc4ea, although
the Euler Discontinuity Filter also performs single-channel filtering which
the Bake Action operator doesn't.
2020-12-18 12:50:36 +01:00
fe5d2448c6 Fix T83494: Eevee clamp node incorrect when min > max.
In glsl the clamp function has undefined behavior when min > max. For
the clamp node this resulted in differences between cycles and eevee.
This patch adds the expected implementation for minmax.

The old clamp function is still used in cases where we know for certain
that the input values are correct (math node clamp option). GPU uses
optimized code and silicon in these cases.
2020-12-18 10:26:02 +01:00
ffb6648a97 Fix T83625: Shading attribute names cause compilation error.
Some GPU platforms don't support having more than one underscore in
sequence in an attribute name. This change will remove the underscore
as a possible character when encoding to save names.
2020-12-18 09:56:28 +01:00
4f9e21bdc9 Fix T82591: Performance regression when rendering at very high resolution
This patch introduces a partial update of GPUTexture. When rendering
a large image the GPUTexture could have been scaled. The old implementation
would rescale the image on CPU and create a new GPUTexture. This
resulted in flooding the PCI bus.

The new solution would only scale and upload the parts of the GPUTexture
that has been changed. It does this by keeping track of areas of 256x256
pixels. When something changes the tiles that cover that changes will be
rescaled and uploaded the next time the GPUTexture is requested.

Test situation: Default Cube, 4 samples, 19200x10800 tile size 512.

Blender 2.83.9: 4m27s.
Blender 2.91:   20+m (regression)
This patch:     1m01s.

There is still room for more optimizations:
* Reduce the time that an image is locked.
** Use task scheduling to update the tiles of an image.
** Generic optimization of the ImBuf scale method.

Maniphest Tasks: T82591

Differential Revision: https://developer.blender.org/D9591
2020-12-18 09:18:44 +01:00
095b693614 Outliner: Set active modifier on click
The outliner already expands the panel for the modifier you click on,
this just extends that idea to also set it active, which is consistent
with behavior of active and selected items elsewhere in Blender.
2020-12-17 23:35:05 -06:00
9dbc014af7 Cleanup: Various clang tidy warnings
There are more in the new mesh fairing code and in the poisson
distribution code, this commit doesn't fix those.
2020-12-17 22:53:47 -06:00
7d25139eaf Fix T82960: Inaccurate selection on collapsed outliner rows
After rB15083d9e1 the outliner tree is not rebuilt after expanding or
collapsing rows. Because the tree is no longer rebuilt the positions
and flags of the elements are not cleared when collapsing a row. This
caused hover highlights and selections on the collapsed child icons to
be incorrect in many cases.

For example, only the direct children of a collapsed element are drawn
inline. If any grandchild elements had been previously icon row flagged
they would continue to be evaluated as icon row elements despite being
hidden. In this case the x coordinates of the child and grandchild would
overlap causing selection to appear erratic.

Now the flags for inline row icons are explicitly cleared, which was
previously only done because the tree was rebuilt on collapsing rows.
2020-12-17 20:10:20 -07:00
7cbcfb7f49 Cleanup: Use LISTBASE_FOREACH macro in outliner code
No functional changes.
2020-12-17 19:59:49 -07:00
f880fe2d66 Fix T82288 Wintab walk navigation erratic.
Walk navigation relies on tablet data being set to detect if motion is
absolute. This patch sets tablet data in Ghost to dummy values when a
tablet pen is in range and not handled by Wintab processing.
2020-12-17 17:21:15 -08:00
Yevgeny Makarov
ef17fb2715 UI: Don't use abbreviations in label text
Expand abbreviations for words like "Bright" (instead of "Brightness"),
"Premul", "Lib", "Dir", etc.

Differential Revision: https://developer.blender.org/D9862
2020-12-17 19:06:21 -06:00
23233fcf05 Cleanup: Use abstraction for attribute math node input
Since creating the attribute node, a helper function has been added to
automatically get the input attribute or a constant value, depending on
the "input type" values for the node. This commit replaces the specific
implementation of that behavior with the new helper function.

The versioning is necessary since the node now has a "storage" struct.
2020-12-17 14:43:01 -06:00
b10d8e330e Cleanup: renaming and code deduplication for color space clarity in picker
Ref T68926
2020-12-17 20:08:58 +01:00
f193b1afb3 Color Management: use scene linear HSV for number buttons in color pickers
Previously these HSV values were in the color picking space, which meant the
relation to the scene linear RGB values was confusing.

The new situation:
* RGB number buttons: scene linear color space
* HSV number buttons: scene linear color space
* Picker widgets: color picking color space
* Hex: sRGB color space

Fixes T69562, T83853, Ref T68926
2020-12-17 20:08:58 +01:00
48ddb94a26 Geometry Nodes: Point separate and attribute compare nodes
This patch adds two related nodes, a node for separating points
and mesh vertices based on a boolean attribute input, and a node
for creating boolean attributes with comparisons.

See the differential for an example file and video.

Point Separate (T83059)
The output in both geometries is just point data, contained in the mesh
and point cloud components, depending which components had data in the
input geometry. Any points with the mask attribute set to true will be
moved from the first geometry output to the second. This means that
for meshes, all edge and face data will be removed. Any point domain
attributes are moved to the correct output geometry as well.

Attribute Compare (T83057)
The attribute compare does the "Equal" and "Not Equal" operations by
comparing vectors and colors based on their distance from each other.
For other operations, the comparison is between the lengths of the
vector inputs. In general, the highest complexity data type is used
for the operation, and a new function to determine that is added.

Differential Revision: https://developer.blender.org/D9876
2020-12-17 12:22:47 -06:00
Himanshi Kalra
e7b698327c Updated and extended Regression Testing frameworks (Gsoc 2020)
This revision contains the following changes-

  - Updated the existing testing framework for Modifiers for Regression
  Testing.
  - Tests for Physics modifiers and remaining Generate and Deform modifiers are added.
  - The existing `ModifierSpec` is updated with backward compatibility to support Physics Modifiers.
  - Now there is support for frame number and giving nested parameters for attributes.
  - Some Deform modifiers required Object Operators, e.g. "Bind" in Mesh Deform, so a new class was added to support that functionality.
  - A separate class for holding Particles System, they are tested by converting all the particles to mesh and joining it to the mesh they were added.
  - Updated the format to add tests for Bevel, Boolean and Operators as
  well.

Reviewed By: zazizizou, mont29, campbellbarton

Differential Revision: https://developer.blender.org/D8507
2020-12-17 20:58:20 +05:30
fed995ced5 Fix T83888: Ctrl F in Asset Browser crashes blender
In case of being in Asset browsing mode, the search field is located in
the header (RGN_TYPE_HEADER not RGN_TYPE_UI as for file browsing mode).
To be future proof, now iterate all regions and act if the
"filter_search" can be activated.

Maniphest Tasks: T83888

Differential Revision: https://developer.blender.org/D9882
2020-12-17 16:05:20 +01:00
3fc07d1e74 Fix T83886: Particle instance modifier broken
Caused by Caused by rB83980506957c.

Since above commit, the modifier was created with wrong initial values
[amount was 0.0 and offset was 1.0 -- instead of the other way around].

Since there is no way to fix existing files in a reasonable way I guess,
all we can do here is to make sure that from now on, the defaults are
correct.

Maniphest Tasks: T83886

Differential Revision: https://developer.blender.org/D9881
2020-12-17 16:00:18 +01:00
c9f8f7915f Geometry Nodes: Make random attribute node stable
Currently, the random attribute node doesn't work well for most
workflows because for any change in the input data it outputs
completely different results.

This patch adds an implicit seed attribute input to the node, referred
to by "id". The attribute is hashed for each element using the CPPType
system's hash method, meaning the attribute can have any data type.
Supporting any data type is also important so any attribute can be
copied into the "id" attribute and used as a seed.

The "id" attribute is an example of a "reserved name" attribute,
meaning attributes with this name can be used implicitly by nodes like
the random attribute node. Although it makes it a bit more difficult
to dig deeper, using the name implicitly rather than exposing it as an
input should make the system more accessible and predictable.

Differential Revision: https://developer.blender.org/D9832
2020-12-17 07:43:31 -06:00
a9edf2c869 Geometry-Nodes: Point Distribute - Sockets Renaming
The size of the nodes is not enough to give enough context to users what
the sockets are about.

Minimum Distance -> Distance Min
Maximum Density -> Distance Min

Note this does not handle doversion. That means users will have to
manually.
2020-12-17 14:31:41 +01:00
9258b70453 Explicitly link X11 libraries
Fix X11 library underlinking, which was breaking Debian and Ubuntu
packages.

From Ubuntu Hirsute changelog:

```
blender (2.83.5+dfsg-4ubuntu1) hirsute; urgency=medium

  * Try to also link ghost library with x11, needed because of missing
    XConvertSelection symbol link (used in ghost static library).
  * Don't use gold, but switch to bfd linker that seems to be working better
    on ppc64el.

 -- Gianfranco Costamagna <locutusofborg@debian.org>  Wed, 11 Nov 2020 14:17:29 +0100
```

Reviewed by: sybren

Differential Revision: https://developer.blender.org/D9617
2020-12-17 13:24:35 +01:00
cf2ebaf27c Fix T83875: Converting Proxy to override crashes blender.
Some weird proxies apparently can have a local collection instancing...
Not sure this is even really valid for proxies, but in any case we
cannot override that, just detect and properly cancel the operation
then.

Should be backported to 2.91.1 should we do it.
2020-12-17 12:05:30 +01:00
0eedba328d Geometry Nodes: add Attribute Color Ramp node
Differential Revision: https://developer.blender.org/D9861

Ref T82585.
2020-12-17 11:56:18 +01:00
2945c1e3e5 Fix asset data-block name button not showing up in custom repositories
The Python syntax was wrong, as noted by Campbell in 0ae15e68c7.
2020-12-17 11:39:45 +01:00
6203a3ee68 Fix T83878: Crash right-clicking in Asset Browser with no asset active
Data of the File Browser context callback needs to be validated and
return `CTX_RESULT_NO_DATA` if the context member is valid but not set
in the current context.
2020-12-17 11:24:08 +01:00
7e535499d5 Clean-up: Fix build warning with MSVC
Callback function was using int while update_render_passes_cb_t was
using eNodeSocketDatatype leading to a build warning about different
argument types with MSVC.
2020-12-16 21:03:42 -07:00
8df6589585 VSE: Fix crash when adding image strip
Crash happens when using relative path to image in operator properties
and checking image dimensions by loading image with `IMB_loadiffname()`

Ensure path is absolute.
2020-12-17 02:32:24 +01:00
d11b219d40 Fix T83869: Crash when creating Sequencer in new scene
Crash on null dereference in `SEQ_timeline_boundbox()`. This function was
generalized in rB9e4a4c2e996c to work on arbitrary `seqbase`.

Fixed by refactoring `SEQ_timeline_boundbox()` functions to return default
sane values if `seqbase` is `NULL`

Reviewed By: HooglyBoogly

Differential Revision: https://developer.blender.org/D9878
2020-12-17 02:19:34 +01:00
3a1d1aaa86 Synchronize Wintab and Win32 time.
Time is synchronized by the difference between the WT_PACKET receive
time and the last received PACKET's pkTime. This is used to prevent
Wintab packets from being prematurely expired.
2020-12-16 15:32:18 -08:00
9f588432e9 Fix T83861: Snapping panel from shortcut dissapears after click
This simple change sets the call_panel operator's "keep_open" property
to True for the viewport snapping panel called with `ctrl-shift-tab`.
There are quite a few settings in this panel, it often makes sense to
change more than one of them at a time, especially because multiple
snap elements can be active at the same time.
2020-12-16 14:40:30 -06:00
07c4615431 Fix T83856: Sculpt: anchored brushes with spherical falloff ignore topology automasking
Anchored brushes with spherical falloff start off with zero radius, thus
we have no pbvh nodes on the first brush step. This would prevent
initializing the automasking cache [which only happens on the first brush
step].

Maniphest Tasks: T83856

Differential Revision: https://developer.blender.org/D9873
2020-12-16 21:36:15 +01:00
247b10e6a2 Fix sequencer transform test failing
This was casued by incorrect versioning keyframe conversion in
recent commit 5713626422.
2020-12-16 21:28:01 +01:00
Gaia Clary
ad7682ffdb Allow vertex tools to operate on weight groups when armature is in object mode
Since a few versions (even before 2.79) we have an option that allows to restrict the vertex tools to operate only on deform groups. This was originally implemented for working with vertex groups for skeletal animation. In that case it is fortunate to have weight tools operate only on deforming vertext groups (vgroups assigned to bones)

In previous versions of Blender (up to 2.79) we have been able to use this option in Mesh Edit mode regardless of the armature mode. The current implementation (since 2.80 as far as i know) enables this option only when the associated armature is in pose mode. this has a bad consequence:

It is not at all intuitive that you have to put the armature into Pose mode before you can make use of the option in mesh edit mode.
Besides this it is not even necessary in the case when the user wants to restrict the tool only to all pose bones. In that case the armature can safely be kept in Object mode. However, when the tool shall apply only to selected pose bones, then it actually makes sense to have the armature in pose mode (as it is implemented right now)

I do not know why this feature has been restricted as described above. It must have got lost somewhere on the way to Blender 2.90

This patch fixes the issue as it allows to select the "restrict to pose bones" option when the armature is in any mode. I see no downsides of this change, actually this is a fix for a feature that once worked and apparently got forgotten in newer releases.

Reviewed By: sybren, campbellbarton

Differential Revision: https://developer.blender.org/D9658
2020-12-16 20:46:50 +01:00
5713626422 VSE: Improve motion-picture workflow
This commit resolves problem introduced in e1665c3d31 - it was
difficult to import media at their original resolution.
This is done by using original resolution as reference for scale.

All crop and strip transform values and their animation is converted
form old files.

To make both workflows easy to use, sequencer tool settings have been
created with preset for preffered scaling method. This setting is in
sequencer timeline header and add image or movie strip operator
properties.

Two new operators have been added:
`sequencer.strip_transform_fit` operator with 3 options: Scale To Fit,
Scale to Fill and Stretch To Fill.
Operator can fail if strip image or video is not loaded currently, this
case should be either sanitized or data loaded on demand.

`sequencer.strip_transform_clear` operator with 4 options:
Clear position, scale, rotation and all (previous 3 options combined).

Reviewed By: sergey, fsiddi

Differential Revision: https://developer.blender.org/D9582
2020-12-16 20:38:28 +01:00
9d15226383 Ghost/Linux: Avoid error print if special directory can't be determined
The function is supposed to fail gracefully if there is some error. That
includes not being able to find `xdg-user-dir`. So don't let the error
be printed to the console, it's misleading/annoying.
From what I can tell we'll detect that problem fine and return NULL
then.
2020-12-16 20:36:37 +01:00
a8da70f70a Geometry Nodes: Add boolean attribute in utility function
This follows up rBc484b54453e607, adding the boolean custom property
data type in one more place that was missed.
2020-12-16 12:50:45 -06:00
c484b54453 Geometry Nodes: Boolean attribute type
This adds a boolean attribute and custom data type, to be used in the
point separate node. It also adds it as supported data types in the
random attribute and attribute fill nodes.

There are more clever ways of storing a boolean attribute that make
more sense in certain situations-- sets, bitfields, and others, this
commit keeps it simple, saving those changes for when there is a proper
use case for them. In any case, we will still probably always want the
idea of a boolean attribute.

Differential Revision: https://developer.blender.org/D9818
2020-12-16 12:33:13 -06:00
c06c5d617a Cleanup: Replace mempcpy with memcpy
There is no need of using mempcpy here, memcpy is enough.

Note: This also fix building in Windows which was broken since a7628ec22a.
2020-12-16 18:02:55 +01:00
ebd8a703cc Fix T83851: Python: operator macros cause a crash
Caused by rB7447eb7e7430.

This is just a copy-paste error [previous LISTBASE_FOREACH substitution
of marco loop in that file has a different starting point which is not
appropriate here]

Maniphest Tasks: T83851

Differential Revision: https://developer.blender.org/D9872
2020-12-16 17:16:01 +01:00
a7628ec22a Geometry Nodes: Poisson disk point distribution node/method
This patch does two things:
* Introduce a Seed to the random distribution method
* Bring in a new distribution method for the point scattering node

Patch Review: https://developer.blender.org/D9787

Note: This commit doesn't not handle doversion. Which means that users
need to manually update their files that were using the Point Distribute
node and reconnect inputs to the "Maximum Density" socket.

Original patch by Sebastian Parborg, with changes to not rely on the cy
libraries and overall cleanup.

Patch review by Jacques Lucke, besides help with the new "heap" system
that was required for this algorithm.

Based on Cem Yuksel. 2015. Sample Elimination for Generating Poisson Disk
Sample. Sets. Computer Graphics Forum 34, 2 (May 2015), 25-32
http://www.cemyuksel.com/research/sampleelimination/
2020-12-16 17:13:46 +01:00
Pablo Dobarro
d23894d3ef Sculpt: Multires Displacement Smear
This tool implements smearing for multires displacement over the limit
surface, similar to how smearing for colors and topology slide works.
When used the displacement values of the vertices "slide" over the
topology, creating the effect of smearing the surface detail.

As the brush just modifies displacement values instead of coordinates,
the total displacement of the affected area doesn't change. This means
that this smearing effect can be used multiple times over the same area
without generating any artifacts in the topology.

When the brush is used with the pinch or expand smear modes,
displacement differences are pushed into the same area, creating hard
surface effects without pinching the topology.

As any other brush that relies on the limit surface (like displacement
erasers), this will work better after using apply base.

Reviewed By: sergey, JulienKaspar, dbystedt

Differential Revision: https://developer.blender.org/D9659
2020-12-16 17:08:19 +01:00
f3ab123e33 Cleanup: Remove unused crop field from RenderResult.
The `crop` field was used by Blender Internal to do an overscan per
tile and merge it back to the render result.
2020-12-16 16:54:24 +01:00
5c5550f7b8 Asset Browser: For assets without preview, show type icon in sidebar
Otherwise it would just show empty space where the icon is supposed to
be.
Unfortunately this icon is upscaled quite a bit and doesn't look too
great. Would be good to improve but not a high priority.
2020-12-16 16:38:56 +01:00
7ed69bd672 Fix T83843: Crash in Asset Browser sidebar with geometry asset selected
No icon should be created if the preview doesn't exist.
2020-12-16 16:38:56 +01:00
4463087223 BLI: remove implicit casts between some span types
Casting pointers from one type to another does change the
value of the pointer in some cases. Therefore, casting a span
that contains pointers of one type to a span that contains
pointers of another type, is not generally safe. In practice, this
issue mainly comes up when dealing with classes that have a
vtable.

There are some special cases that are still allowed. For example,
adding const to the pointer does not change the address.
Also, casting to a void pointer is fine.

In cases where implicit conversion is disabled, but one is sure
that the cast is valid, an explicit call of `span.cast<NewType>()`
can be used.
2020-12-16 16:00:17 +01:00
684c771263 Fix: Python warning in windows debug builds
When doing a debug build on windows, blender will
start with the following warning:

"Unable to find the python binary, the multiprocessing
module may not be functional!"

The root cause for this issue is: for a debug build
the python binary is called python_d.exe rather than
just python.exe

This change fixes BKE_appdir_program_python_search
to look for the _d suffix for debug builds on windows

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

Reviewed by: Campbell Barton
2020-12-16 07:27:47 -07:00
25543e6983 LibOverride: Better handling of missing linked data during resync.
We do not generate overrides for missing data-blocks (aka placeholder
ones) anymore, and properly delete the remaining old overrides of those
during the resync process.

This should prevent constant 'missing data-blocks' messages when opening
blend files with overrides whose libraries have beed edited.

Issue reported by @andy from Blender studio, thanks.
2020-12-16 15:12:56 +01:00
8d590e4b86 Fix T83801: UVEditor translation ignores "Pixel Coordinates" and aspect
ratio

Caused by rB4eda60c2d82d.

T83801 reported not moving in pixel space, but even without that toggle
above commit caused the translation to not take apsect ratio into
account properly [a translation of 1 on the x axis for example on an
image with non 1:1 aspect ration caused the UVs to not end up in the
same place on the next 'tile']

Above commit removed 'removeAspectRatio()' [the counterpart of
applyAspectRatio -- which does the pixel coord correction internally]
from 'applyTranslation()'.

This was also reported in T83352 [which was closed by rBf3b08af24c9f --
but that only solved the displax in header, not the actual
transformation]

Now bring back 'removeAspectRatio()'.

Maniphest Tasks: T83801

Differential Revision: https://developer.blender.org/D9869
2020-12-16 15:03:46 +01:00
8da62a9a86 Fix T83547: UV Editor stitching preview is gone.
Issue was related that the draw manager didn't invoked the draw handlers
for image editors.
2020-12-16 15:02:48 +01:00
245450b144 Fix exported keymaps loading in 2.91 and older
The generated keymaps used a keyword argument that doesn't exist
in older Blender versions.
2020-12-17 00:53:28 +11:00
Valdemar Lindberg
69c3f4a46d Fix 3D View is red when using stereo
Fix T83415: 3D View is red when using stereo

The red view was caused by SRGB not being enabled for an SRGB texture attached to the framebuffer.
Currently, when configuring a framebuffer, the first texture attachment needs to be an SRGB format in order for the framebuffer to be binded with SRGB enabled.
Thus, simply changing the SRGB texture attachment as the first texture attachment removes the red color in the view.

Reviewed By: #eevee_viewport, jbakker

Maniphest Tasks: T83415

Differential Revision: https://developer.blender.org/D9845
2020-12-16 14:21:51 +01:00
29f923b27c Fix T83557: Alpha blend + emissive colors renders white artifacts
Issue was that not all code paths were taken to determine if
the GPU Texture was premultiplied or not. In this case the result
was set to unpremultiplied what is incorrect.

This fixes broken test case image alpha blend from image_colorspace.
2020-12-16 13:57:28 +01:00
4c26dd430d Geometry Nodes: rename node to Attribute Randomize
Previously, the node was called Random Attribute. For consistency reasons,
we move the "Attribute" part of the name to the front.
2020-12-16 13:31:56 +01:00
985d673374 BLI: add new InplacePriorityQueue data structure
This data structure adds priority queue functionality to an existing array.
The underlying array is not changed. Instead, the priority queue maintains
indices into the original array.

Changing priorities of elements dynamically is supported, but the priority
queue has to  be informed of such changes.

This data structure is needed for D9787.
2020-12-16 12:19:17 +01:00
Eric Cosky
4f128269b2 Fix possible crash with custom (add-on defined) icons
This change is a simple null check on the ID provided to icon_set_image() which
appears to be a legitimate value for the ID when used by some addins
(discovered with PowerSave shortly after syncing to main).

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

Reviewed by: Julian Eisel
2020-12-16 12:13:49 +01:00
3fc9fc1cb4 UI: Indicate asset data-blocks with an icon in Outliners & search menus
It's useful to easily see which data-blocks are assets and which not. So just
like we usually show the library linking/override icons, we show the asset icon
there (these are mutually exclusive data-block states).

Uses the `'MAT_SPHERE_SKY` icon, which wasn't used before (except by an
add-on!) and is sorta fitting, but not quite. We should either change this one
or add an own asset icon. Meanwhile this isn't too bad :)

Also adds an internal macro to check if a data-block is an asset, consistent to
how we do it for libraries and library overrides.
2020-12-16 12:10:58 +01:00
58d818f8be Assets: Add operator & button to regenerate the automatic preview
This makes it possible to trigger a refresh of the data-block preview,
available next to the preview in the Asset Browser sidebar. The previews get
easily outdated and automatically refreshing it all the time is not an option
because it would be a consistently running, quite expensive process. So a
button to cause a refresh should be reasonable.

This button can also be used to switch back from a custom preview to a
generated one. Although that may not be clear, and we should probably think of
a way to explain that better.

Addresses T82719.
2020-12-16 12:10:58 +01:00
c7a500e3a0 Asset Browser UI: Changes to the sidebar layout
The current layout wasn't great at all, and it was planned to polish this. This
does a first round of improvements, some more tweaking may follow.
* Place name button at the top, with no panel and no leading label.
* Add "Preview" panel, people may not want to see the preview all the time,
  it's already visible in the file list.
* Move button to browse for a custom preview to the right of the preview, as
  icon-only. We have a similar layout in other places (UI-lists, matcaps).
* Don't make the details panel a sub-panel. Looked weird because the parent
  doesn't have a header.
* Add info icon to "No asset selected", looks a bit friendlier.
* Minor cleanups in the UI script.

Based on designs and feedback by William Reynish.
2020-12-16 12:10:58 +01:00
19fc30c15f Assets UI: Tweak position of the "Add Asset Library" icon-button in Preferences
It's weird to have a button that adds a new item at the bottom be placed at the
top. So rather move it below the list of custom asset library paths.
2020-12-16 12:10:58 +01:00
0ae15e68c7 Asset Browser: Allow renaming asset data-blocks from the sidebar directly
This is something we wanted to support doing. It's confusing if users see the
name but it's always grayed out. So be convenient and avoid the confusion.
2020-12-16 12:10:58 +01:00
055ef5df61 Cleanup: Rename Asset Browser context member from "active_id" to "id"
This is the same name we use elsewhere for the focused/active ID context
member, so this should follow it.
2020-12-16 12:10:58 +01:00
Nathan Letwory
975ca91939 Steam Release: Script creation of Steam build files
Script tool for automation of Steam build files for tasks like {T77348}

This script automates creation of the Steam files: download of the archives,
extraction of the archives, preparation of the build scripts (VDF files), actual
building of the Steam game files.

Requirements
============

* MacOS machine - Tested on Catalina 10.15.6. Extracting contents from the DMG
  archive did not work Windows nor on Linux using 7-zip. All DMG archives tested
  failed to be extracted. As such only MacOS is known to work.
* Steam SDK downloaded from SteamWorks - The `steamcmd` is used to generate the
  Steam game files. The path to the `steamcmd` is what is actually needed.
* SteamWorks credentials - Needed to log in using `steamcmd`.
* Login to SteamWorks with the `steamcmd` from the command-line at least once -
  Needded to ensure the user is properly logged in. On a new machine the user
  will have to go through two-factor authentication.
* App ID and Depot IDs - Needed to create the VDF files.
* Python 3.x - 3.7 was tested.
* Base URL - for downloading the archives.

Reviewed By: Jeroen Bakker

Differential Revision: https://developer.blender.org/D8429
2020-12-16 11:15:18 +01:00
9cbfcc4af5 Revert "Steam Release: Script creation of Steam build files"
This reverts commit 1a375d6ece.
2020-12-16 11:11:15 +01:00
Nathan Letwory
1a375d6ece Steam Release: Script creation of Steam build files
Script tool for automation of Steam build files for tasks like {T77348}

For in-depth information see the README.

Related Wiki page: https://wiki.blender.org/wiki/Process/Release_On_Steam

Reviewed By: jbakker

Maniphest Tasks: T77348

Differential Revision: https://developer.blender.org/D8429
2020-12-16 11:07:10 +01:00
d23a5b1d88 BLI: constexpr Span, IndexRange, StringRef(Null/Base)
Motivated by `std::string_view` being usable in
const (compile-time) context.
One functional change was needed for StringRef:
`std::char_traits<char>::length(str)` instead of `strlen`.

Reviewed By: JacquesLucke, LazyDodo
Differential Revision: https://developer.blender.org/D9788
2020-12-16 13:03:46 +05:30
e671c548e6 Cleanup: pep8 2020-12-16 18:02:40 +11:00
Vincent Blankfield
f34ca933a8 UI: include the category for add-ons search
This lead to some confusion, see T83747.

Now the category is included in the search when the category is "All".

Ref D9848
2020-12-16 16:35:26 +11:00
a869a61c88 Cleanup: sort struct blocks 2020-12-16 16:26:23 +11:00
b347c4e9ca Cleanup: remove redundant struct declarations 2020-12-16 16:25:56 +11:00
588f107f11 Cleanup: clang-format 2020-12-16 16:13:05 +11:00
87fdb71438 Cleanup: use static declarations 2020-12-16 16:12:50 +11:00
977bd7937a Fix warnings introduced in previous commit 2020-12-16 00:20:20 +01:00
Peter Fog
fad80a95fd VSE: Add Overlay popover panels
Add panels with overlay settings for strips and preview and overlay
enable/disable button.

Entries from the View menus moved to the overlay panels, which will
simplify cluttered View menus.

Additional options have been added:
 - Strip Name
 - Strip Source(ex. path)
 - Strip Duration

So users can now select what info they need to see on the strips. When
No text is displayed, waveforms are drawn in full height.

Reviewed By: ISS, HooglyBoogly, pablovazquez

Differential Revision: https://developer.blender.org/D9751
2020-12-15 23:50:18 +01:00
Peter Fog
f44dea0558 VSE: Reorder Tools in Sequencer/Preview
When in Sequencer/Preview mode, the Sampler was on top, which normally
is the place of Select, and Annotation seems to be after Sampler in the
bottom in the various editors.

Reviewed By: ISS

Differential Revision: https://developer.blender.org/D9821
2020-12-15 22:30:01 +01:00
Peter Fog
dd9d12bf45 VSE: Paste strips after playhead by default
Paste copied strips after playhead, because this is more intuitive.

Previous functionality is still available by enabling "Keep Offset"
property, or under shortcut Ctrl+Shift+V.

Reviewed By: ISS

Differential Revision: https://developer.blender.org/D9734
2020-12-15 22:30:01 +01:00
Falk David
151e847b87 GPencil: Improve interpolation of strokes with unequal lengths
Use the BKE_gpencil_stroke_uniform_subdivide function to subdivide strokes
before interpolation. When the target/source stroke is smaller than the other
stroke, it is subdivided until the lengths match. This improves the overall quality
of the interpolation of different sized strokes.

Before/After video:
{F9511779}

Reviewed By: #grease_pencil, antoniov, pepeland, mendio

Differential Revision: https://developer.blender.org/D9839
2020-12-15 22:29:21 +01:00
Cody Winchester
5535b0b887 GPencil Array - Add option for uniform random scaling
This patch adds the option to make the random scaling from the grease pencil array modifier uniform.
The current settings allow a separate value for each of the 3 scaling axis. The modifier also creates different seed values for each axis so there is no way to keep the random scaling uniform.
This patch creates 1 random seed value and applies it to each of the scaling axis.

Here is a demonstration of the previous behavior and the new optional behavior.
{F9485973}
{F9485981}

{F9485798}

Reviewed By: #grease_pencil, antoniov, pepeland

Differential Revision: https://developer.blender.org/D9764
2020-12-15 22:16:49 +01:00
9e4a4c2e99 VSE: Move remove gaps operator logic to module code
Logic was broken into finding gaps and ofsetting strips.
Functions were modified so they work on explicitly defined seqbase,
so they can be used as python API functions.

Functional changes:
 - Improve performance by calculating gap length and offseting strips
   at once. Previously strips were offset by one frame.
 - Calculate gap from start frame. Previously gap was considered only
   inbetween strips.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9730
2020-12-15 21:49:15 +01:00
7e8f6985d8 Fix crash selecting custom asset preview from maximized File Browser
If Preferences > Interface > Temporary Editors > File Browser is set to
"Maximized Area", "Load Custom Preview" in the Asset Browser would crash
after selecting the file.

1e799dd26e was important to get this issue fixed. This commit just
ensures the file-list is recreated correctly after closing the temporary
File Browser, so the custom preview operator can execute on valid
context.
2020-12-15 21:31:45 +01:00
1e799dd26e Fix various issues with temporary, maximized File Browsers
If Preferences > Interface > Temporary Editors > File Browser is set to
"Maximized Area", opening a File Browser from a File or Asset Browser as
regular editor would cause some issues. For example after closing the
temporary File Browser, the regular browser would take over the file
path and display settings from the temporary one. This is because they
used to share the same area data.

Some similar issues may have happend with temporary image editors.

Now, this commit finally separates the space data of temporary maximized
editors from the regular ones. So the editor data is entirely
independent now, as it should be.
2020-12-15 21:31:33 +01:00
c9b4d75336 Sculpt: Fair Face Sets operation for Face Set Edit
This implements a mesh fairing algorithm and implements the fair
operations for Face Set edit. This edit operations create a smooth as
possible geometry patch in the area of the selected Face Set.

The mesh fairing algorithm is designed by Brett Fedack for the addon
"Mesh Fairing": https://github.com/fedackb/mesh-fairing, with some
modifications:

- The main fairing function in BKE_mesh_fair.h does not triangulate
 the mesh. For the test I did in sculpt mode results are good enough
 without triangulating the topology. Depending on the use and the
 result quality needed for a particular tool, the mesh can be
 triangulate in the affected area before starting fairing.

- Cotangents loop weights are not implemented yet. The idea is to
also expose the vertex and loop weights in a different function in
 case a tool needs to set up custom weights.

This algorithm will also be used to solve the limitations of line
project and implement the Lasso Project and Polyline Project tools.
It can also be used in tools in other areas of Blender, like Edit Mode
or future retopology tools.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D9603
2020-12-15 20:32:58 +01:00
288f2efbd4 Fix T83504: Cancel trim operators when there is no geometry
The boolean solver crashes when there is no geometry in the mesh. Also,
using the trimming tools without a valid intersection in the PBVH will
make the orientation and position functionality of the trimming shape
not work, so this is the safer solution.

Reviewed By: mont29

Maniphest Tasks: T83504

Differential Revision: https://developer.blender.org/D9777
2020-12-15 20:23:17 +01:00
c9de65679b Fix T83201: Cloth brush performance regression
The if statement of the dynamic area mode branch should be an else if.
When using local mode, this was running both the local and global code.

I moved this code to sculpt_cloth and refactored it to use a switch case
to prevent this from happening again.

Reviewed By: mont29

Maniphest Tasks: T83201

Differential Revision: https://developer.blender.org/D9762
2020-12-15 20:22:26 +01:00
26e9c2147e Blenloader: Add utility function to write double array
It makes sense to support writing double arrays just like floats.
This is just split from a patch (D9697) to slim it down some.
2020-12-15 12:43:21 -06:00
d59e87acf0 Cleanup: Use nullptr instead of NULL in C++ code 2020-12-15 12:41:41 -06:00
8df167873a Cleanup: Clang tidy else after return 2020-12-15 12:39:27 -06:00
3834dc2f7b Fix Adjust Last Operation popup for operators relying on button context
This was reported for duplicating particle systems, then using F9 to
enable the 'Duplicate Settings' option (see T83317).
In this case, the operator gets the particle_system from (buttons)
context and if none can get found will duplicate all settings instead.

The reason why none gets found here is that buttons_context() doesnt
have a valid path when called from F9/SCREEN_OT_redo_last, path is
cleared when global undo does a file-read which clears the path (see
lib_link_workspace_layout_restore). It can be recomputed though to be
valid even from redo_last (at least when in the Properties Editor).

This was likely causing other operators (relying on buttons context)
from the Properties Editor to fail as well.

Fixes T83317

Maniphest Tasks: T83317

Differential Revision: https://developer.blender.org/D9825
2020-12-15 19:10:35 +01:00
ffe63b0440 Fix crash opening maximized File Browser from Asset Browser
If Preferences > Interface > Temporary Editors > File Browser is set to
"Maximized Area", opening a File Browser from an Asset Browser would
cause the new maximized editor to be an Asset Browser. Exiting it again
would crash.

This fixes the wrong behavior and the crash. There's still an issue with
exiting the editor again, it stays a File Browser then and doesn't go
back to being an Asset Browser. That's to be fixed separately.
2020-12-15 18:56:26 +01:00
b24712a9ca Fix (studio-reported) broken handling of relative font paths.
`blf_dir_search` BLF util would not properly handle relative fonts not
found in pre-defined 'system fonts' directoriesi stored in
`global_font_dir` global variable.

Now it rebases relative paths to current .blend file location as
expected.

Note: the fact that VSE is setting font ptaths relative by default is
probably not actually desired, but this is another issue really. See
`BKE_sequencer_text_font_load` code.
2020-12-15 18:22:22 +01:00
c6692014cf Fix redundant declaration warning
Function was declared twice (caused by merge conflicts) which GCC would
rightfully complain about.
2020-12-15 17:19:55 +01:00
990406e1ff Fix crash when deleting/renaming asset library while it's visible
Storing the asset library reference by name wasn't a good idea, I thought it
would work with a careful fallback, but it's easier to just use the index
instead. So change to using indices, make sure fallback methods work reliable
and make sure the file list is updated when asset libraries are removed.

I added a new notifier type for the latter, I prefer not using file notifiers
in asset-library/preferences code. We have more than enough values for
notifiers left.
2020-12-15 17:03:49 +01:00
7dc8db7cd1 Fix failing assert when generating material preview
The `!BKE_previewimg_is_finished()` in `icon_preview_startjob_all_sizes()`
would fail.

Caused by 990bd9acf243ae. We have to be more picky about tagging previews as
unfinished after file read. But we also have to consider files stored in old
versions and set the unfinished tag as needed.
2020-12-15 17:03:49 +01:00
9caeb9dfc7 Fix Asset Browser crash with undo in "Current File" library with sidebar
When the Asset Browser was showing the "Current File" repository and the
sidebar was open, undoing could crash, because the context API returned freed
data.

Don't let context return anything if a refresh is pending due to data changes
like undo/redo.
2020-12-15 17:03:49 +01:00
68e4a90240 Assets: Better path for the default asset library
In D9722 we agreed on using `[home-directory]/Documents/Blender/Assets` for
the default asset library. I just forgot to do the change before committing.

(The default repository is just a named path, it's *not* a default library with
bundled assets.)
2020-12-15 17:03:48 +01:00
303aceb917 Fix asset previews not showing in "Current File" repository after reading
Previews would be flagged as unfinished when reading. Instead clear the flag
and always consider them finished upon reading. If we wouldn't do this, the
File Browser would keep running the preview updating to wait for the preview to
finish. It could be smarter and also check if there's actually a preview job
running.
Instead, I think it will just display an unfilled buffer for now. Up until
today we wouldn't even know if a stored preview is finished or not, so it would
always assume they are finished. We do the same now, but have the option to
make it smarter.
2020-12-15 17:03:48 +01:00
2d6a69ae4e Asset System: New Asset Browser editor
This introduces the User Interface part of the Asset Browser, based on the
design in T54642.

Additions:
* New Asset Browser (internally a sub-editor of the File Browser).
* Navigation region showing asset categories.
* Main region showing the assets of the selected asset library with previews.
  The assets may be stored over multiple .blends in the directory that's
  "mounted" as asset library in the Preferences. They will all be shown in this
  list.
* Header with an asset library dropdown, allowing to choose the active asset
  library to show. Options are the "Current File" as asset library and all
  custom libraries.
* Display popover, filter popover and search box (partially dummies, see
  T82680).
* Sidebar showing the metadata of the currently active file (name, preview,
  description and tags), which can be edited for assets in the "Current File"
  asset library. (For others it will reset on reload.)
* The sidebar includes a button to load a custom preview image from a file.
* Make asset files draggable (with preview image).
* If a library with invalid path is selected, a message is drawn in the main
  region to help the user understand what's wrong.
* Operators to add and remove asset tags. Exposed in the sidebar.
* "Only Assets" option for Link/Append.
* Internal utilities for asset UI scripts.

For screenshots or demo videos, please see D9725. Or the 2.92 release notes.

Note that there are many things to be tweaked and polished in the Asset Browser
UI still. For example, the filter and display popovers are mostly dummies. See
T82680.

Part of the first Asset Browser milestone. Check the #asset_browser_milestone_1
project milestone on developer.blender.org.

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

Reviewed by: Brecht Van Lommel, Hans Goudey
2020-12-15 17:03:48 +01:00
70474e1a7c Asset System: Prepare File Browser backend for the Asset Browser
The Asset Browser will be a sub-editor of the File Browser. This prepares the
File Browser code for that.

**File-Lists**
* Support loading assets with metadata read from external files into the
  file-list.
* New main based file-list type, for the "Current File" asset library.
* Refresh file-list when switching between browse modes or asset libraries.
* Support empty file-lists (asset library with no assets).
* Store file previews as icons, so scripts can reference them via icon-id. See
  previous commit.

**Space Data**
* Introduce "browse mode" to differeniate between file and asset browsing.
* Add `FileAssetSelectParams` to `SpaceFile`, with `FileSelectParams` as base.
  Makes sure data is separated between asset and file browsing when switching
  between them. The active params can be obtained through
  `ED_fileselect_get_active_params()`.
* `FileAssetSelectParams` stores the currently visible asset library ID.
* Introduce file history abstraction so file and asset browsing can keep a
  separate history (previous and next directories).

**General**
* Option to only show asset data-blocks while file browsing (not exposed here).
* Add "active_file" context member, so scripts can get and display info about
  the active file.
* Add "active_id" context member, so `ED_OT_lib_id_load_custom_preview` can set
  a custom ID preview. (Only for "Current File" asset library)
* Expose some of `FileDirEntry` in RNA as (non-editable). That way scripts can
  obtain name, preview icon and asset-data.

Part of the first Asset Browser milestone. Check the #asset_browser_milestone_1
project milestone on developer.blender.org.

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

Reviewed by: Bastien Montagne
2020-12-15 17:03:48 +01:00
e413c80371 Asset System: Support custom asset library paths through Preferences
One of the core design aspects of the Asset Browser is that users can "mount"
custom asset libraries via the Preferences. Currently an asset library is just
a directory with one or more .blend files in it. We could easily support a
single .blend file as asset library as well (rather than a directory). It's
just disabled currently.

Note that in earlier designs, asset libraries were called repositories.

Idea is simple: In Preferences > File Paths, you can create custom libraries,
by setting a name and selecting a path. The name is ensured to be unique. If
the name or path are empty, the Asset Browser will not show it in the list of
available asset libraries.
The library path is not checked for validity, the Asset Browser will allow
selecting invalid libraries, but show a message instead of the file list, to
help the user understand what's going on.
Of course the actual Asset Browser UI is not part of this commit, it's in one
of the following ones.

{F9497950}

Part of the first Asset Browser milestone. Check the #asset_browser_milestone_1
project milestone on developer.blender.org.

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

Reviewed by: Brecht Van Lommel, Hans Goudey
2020-12-15 17:03:48 +01:00
b5d778a7d4 Asset System: Support dragging assets and appending on drop
For the Asset Browser, it needs to be possible to drag assets into various
editors, which may not come from the current .blend file. In other words, the
dragging needs to work with just the asset metadata, without direct access to
the data-block itself.

Idea is simple: When dragging an asset, store the source file-path and
data-block name and when dropping, append the data-block. It uses existing drop
operators, but the function to get the dropped data-block is replaced with one
that returns the local data-block, or, in case of an external asset, appends
the data-block first.

The drop operators need to be adjusted to use this new function that respects
assets. With this patch it only works for dragging assets into the 3D view.

Note that I expect this to be a short-lived change. A refactor like D4071 is
needed to make the drag & drop system more future proof for assets and other
use cases.

Part of the first Asset Browser milestone. Check the #asset_browser_milestone_1
project milestone on developer.blender.org.

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

Reviewed by: Bastien Montagne, Brecht Van Lommel
2020-12-15 17:03:48 +01:00
9363132c86 Asset System: Various changes to previews in preparation for Asset Browser
* Support defining (not necessarily rendering) icons in threads. Needed so the
  File Browser can expose file previews with an icon-id to scripts.
** For that, ported `icons.c` to C++, to be able to use scope based mutex locks
   (cleaner & safer code). Had to do some cleanups and minor refactoring for
   that.
* Added support for ImBuf icons, as a decent way for icons to hold the file
  preview buffers.
* Tag previews as "unfinished" while they render in a thread, for the File
  Browser to dynamically load previews as they get finished.
* Better handle cases where threaded preview generation is requested, but the
  ID type doesn't support it (fallback to single threaded). This is for general
  sanity of the code (as in, safety and cleanness)
* Enabled asset notifier for custom preview loading operator, was just disabled
  because `NC_ASSET` wasn't defined in master yet.

Part of the first Asset Browser milestone. Check the #asset_browser_milestone_1
project milestone on developer.blender.org.

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

Reviewed by: Bastien Montagne, Brecht Van Lommel
2020-12-15 17:03:45 +01:00
c25e031049 Asset System: "Mark Asset" & "Clear Asset" operators and UI integration
This makes it possible to turn data-blocks into assets and back into normal
data-blocks. A core design decision made for the asset system is that not every
data-block should be an asset, because not every data-block is made for reuse.
Users have to explicitly mark data-blocks as assets.

Exposes "Mark Asset" and "Clear Asset" in Outliner context menus (currently ID
Data submenu) and button context menus. We are still not too happy with the
names, they may change.

This uses the new context members to pass data-blocks to operators, added in
af008f5532 and 0c1d476923.

Part of the first Asset Browser milestone. Check the #asset_browser_milestone_1
project milestone on developer.blender.org.

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

Reviewed by: Brecht Van Lommel
2020-12-15 17:03:00 +01:00
b71eb3a105 Asset System: Data-block asset metadata storage, reading and API
Asset metadata is what turns a regular data-block into an asset. It is a small
data-structure, but a key part of the technical design of the asset system.

The design foresees that asset data-blocks store an `ID.asset_data` pointer of
type `AssetMetaData`. This data **must not** have dependencies on other
data-blocks or data-block data, it must be an independent unit. That way we can
read asset-metadata from .blends without reading anything else from the file.
The Asset Browser will use this metadata (together with the data-block name,
preview and file path) to represent assets in the file list.

Includes:
* New `ID.asset_data` for asset metadata.
* Asset tags, description and custom properties.
* BKE code to manage asset meta-data and asset tags.
* Code to read asset data from files, without reading IDs.
* RNA for asset metadata (including tags)

Part of the first Asset Browser milestone. Check the #asset_browser_milestone_1
project milestone on developer.blender.org.

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

Reviewed by: Bastien Montagne, Brecht Van Lommel
2020-12-15 17:03:00 +01:00
82645ff739 Move Point Cloud object back to Experimental Features
The geometry-nodes features no longer depend on the point cloud object.
Therefore the point cloud object, although important in the future, can
be postponed until we have render and edit mode fully working.

This reverts commits:
* ea74ed5a7a.
* dc614c68ef.
2020-12-15 13:07:55 +01:00
0d58eabee6 Geometry Nodes: support evaluating mesh object to geometry set
This implements the design proposed in T83357.

The goal is to allow the geometry nodes modifier on mesh objects to
output instances and potentially other geometry types. Both problems
are tackled by allowing mesh objects to evaluate to a geometry set,
instead of just a single mesh id data block. The geometry set can
contain a mesh but also other data like instances and a point cloud.

I can't say that I'm sure that this commit won't introduce bugs. Mainly
the temporary object creation during rendering seems a bit brittle.
BUT, we can be reasonably sure that this commit will not introduce
regressions (at least not ones, that are hard to fix). This is because
the code has been written in a way that minimizes changes for existing
functionality.

Given that we intend to hide the point cloud object for the next release,
we won't even have to worry about temporary object creation for now.

An important part of the technical design is to make sure that
`ObjectRuntime->data_eval` contains the same data before and after this
patch. This helps to make sure, that existing code paths are impacted as
little as possible.

Instead of fully replacing `data_eval`, there is `geometry_set_eval`,
which contains all the geometry components an object evaluated to
(including the data referenced by `data_eval`).

For now, not much code has to be aware of `geometry_set_eval`. Mainly
the depsgraph object iterator and the instances system have to know
about it.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D9851
2020-12-15 12:42:10 +01:00
d8db5cb600 Fix: upward compatibility of cryptomatte matte id.
The matte_id is stored in a different structure in 2.92. This patch will
write the old matte_id field so the files can be opened correctly in
older versions.
2020-12-15 12:17:31 +01:00
ef2151d73d Fix T83776: Crashes with add-on's icon preview in menus
Apparently the ID pointer can be NULL, which most code here assumes is
not the case. But it's very fragile & finicky, there is one code path
were it's allowed to be NULL.

Add necessary NULL-checks, an assert as sanity check and a comment to
note the possibility of NULL.
2020-12-15 12:05:12 +01:00
1b130f17c9 Cleanup: make format 2020-12-15 12:01:45 +01:00
35368e8bfc Fix: mattes of cryptomatte node lost after write
Fix an issue introduced by {f4df036bc497} where the read/write
code missed to store and read the mattes from its new location.
2020-12-15 11:15:01 +01:00
12792ee70c Fix T83788: Topology mirror crashes for vertices aren't mirrored
Caused by da8dc204bd
2020-12-15 18:10:04 +11:00
e035d7301c Fix crash sliding effect sequence strips
Off by one error in array access.
2020-12-15 16:14:59 +11:00
a05d98884a RNA: disallow negative fcurve data-path array index 2020-12-15 12:48:33 +11:00
612598acd7 Cleanup: doxy comments (use colon after parameter name)
Also remove colon after `\note`.
2020-12-15 12:34:25 +11:00
001f2c5d50 Cleanup: spelling 2020-12-15 12:34:25 +11:00
e995296acb Cleanup: unused variables 2020-12-15 12:34:25 +11:00
525364be31 Cleanup: reduce indirect DNA header inclusion
Remove DNA headers, using forward declarations where possible.

Also removed duplicate header, header including it's self
and unnecessary inclusion of libc system headers from BKE header.
2020-12-15 12:34:14 +11:00
15f2f69694 Cleanup: Reduce variable scope 2020-12-14 17:48:57 -06:00
1e38e32cf6 Cleanup: type check failure, discarded-qualifiers warnings
Caused by 7f6ffe9195
2020-12-15 10:27:36 +11:00
7470c10601 Cleanup: Use LISTBASE_FOREACH macro, reduce variable scope 2020-12-14 17:19:43 -06:00
Wayde Moss
6074636387 NLA: Action Strip Defaults Sync Length On
See T82309#1055564 {T63675} and their duplicates for how Default-off
can cause confusion.

This is just for convenience since it allows animators to keyframe
outside of the strip's bounds by default. This was likely off by
default before since Syncing Length would undesirably shift the whole
animation after leaving tweak mode (fixed by {D7602}) and the animator
wasn't able to keyframe outside the strip bounds anyways
(fixed by {D7533}). Now it's better if the flag was on by default.
While the animator is still roughly developing their animation NLA-wise
they won't have to worry about strip bound keying failures. When they
are more certain of the strip bounds, they can disable the flag to
prevent affecting the rest of the NLA system.

Reviewed By: sybren

Differential Revision: https://developer.blender.org/D9661
2020-12-14 17:32:14 -05:00
Wayde Moss
7f6ffe9195 Nla Refactor: Blend functions explicit Div0 check
It's an explicit check to prevent division by zero if caller hasn't
done the check. Future patch {D8867} will not use the nla remap
function and thus not do the check. This patch also replaces some
float (==) equality checks with IS_EQF().

Split from {D9247}

Reviewed By: sybren

Differential Revision: https://developer.blender.org/D9694
2020-12-14 17:11:41 -05:00
Wayde Moss
fa6bf8f5b6 Nla Refactor: nlaevalchan_validate_index_ex()
And removes redundant index local variable. Future patches {D8296} and
{D8867} make use of this function.

No functional changes.
Split from {D9247}

Reviewed By: sybren

Differential Revision: https://developer.blender.org/D9693
2020-12-14 17:06:59 -05:00
Wayde Moss
04ca93ef9b NLA: Fix context.selected_nla_strips PointerRNA
The strips were given the wrong owner ID.  This only caused issues for
python based UI as far as I know. Property changes would not properly
update the viewport.

Reviewed By: lichtwerk

Differential Revision: https://developer.blender.org/D9685
2020-12-14 17:00:04 -05:00
20bc1ab275 Fix incorrect RNA type warning
Using the RNA type for regular modifiers instead of grease pencil
modifiers caused a warning in context.c.
2020-12-14 15:12:18 -06:00
49ec3cef69 Geometry Nodes: Input data type utility function
This commit adds a simple utility function for getting the data type of an
attribute or its "constant" socket counterparts. No functional changes.

Differential Revision: https://developer.blender.org/D9819
2020-12-14 11:43:54 -06:00
010f44b855 Fix several issues with handling of numpy in CMake.
Issues were:
* Abusing of `WITH_PYTHON_INSTALL_NUMPY` by both Audaspace and
  Mantaflow.
    - `PYTHON_INSTALL` options only decide whether we copy python (and
      some extra modules) in our Blender installation. On linux it
      makes much more sense to use global python installation.
    - Now we have instead a proper `WITH_PYTHON_NUMPY`
* Bad assumptions regarding path of headers relative to path of python
  module.
    - In current Debian testing, modules are under `python3.9`
      directory, while headers are under `python3` directory.
    - Now we properly `find_path` for headers as well, modifying
      `find_python_package` to take an optional argument for headers.

Note that the required changes done to `extern` libraries are in
blender-specific files that do not exist upstream.

Differential Revision: https://developer.blender.org/D9773
2020-12-14 16:44:55 +01:00
f4df036bc4 Cryptomatte: Data structure in compositor node
This changes the way how the mattes are stored in the compositor node. This used to
be a single string what was decoded/encoded when needed. The new data structure
stores all entries in `CryptomatteEntry` and is converted to the old `matte_id`
property on the fly.

This is done for some future changes in the workflow where a more structured
approach leads to less confusing and easier to read code.
2020-12-14 16:14:38 +01:00
07ce9910f7 Geometry Nodes: enabled supports-mapping in nodes modifier
Sometimes the geometry nodes modifier does support mapping and
sometimes it does not. We have no infrastruture to determine this ahead
of time currently. In order to support common use cases, it makes sense
to add this flag to the modifier.

One such common use case is to use the mesh as surface that other
things are distributed on. Often, the distribution is controlled by vertex
groups. Therefore, it would be helpful if the modifier is evaluated
when the object is in vertex paint mode. This allows the user to see the
distributed objects while painting.

If the nodes modifier transforms the mesh in any way, vertex painting
might not work as expected anymore, because the `deformMatrices`
callback is not implemented. I'm not sure how this can be solved nicely, yet.
2020-12-14 15:44:28 +01:00
9ee7270e0a Geometry Nodes: require vertex groups data in nodes modifier
Without this, the modifier evaluation code might remove any
vertex groups from the mesh for performance reasons.
We can't say for sure whether the node group will need the vertex
groups, but it is quite likely.

Ref T83357.
2020-12-14 15:29:50 +01:00
6714b800d1 Cryptomatte: apply volume transmittance to Eevee.
This patch will add volumetric transmittance to the cryptomatte coverage
data of all samples when post processing the cryptomatte passes.

It was discussed with Cycles that this is desired, but tricky to
implement in Cycles.
2020-12-14 15:03:29 +01:00
e3068f38c8 Fix memory leak and possible other issues with custom previews
Mistake in 812ea91842. Fixed that same one before in the branch, I may have
brought it back when resolving merge conflicts.
2020-12-14 14:57:30 +01:00
Joan Bonet Orantos
68d5ad9983 Fix T75539: Cycles missing geometry update when switching displacement method
The shaders were not tagged for a needed geometry update when the displacement method was modified, neither were the Geometry and Object managers.

Reviewed By: kevindietrich

Maniphest Tasks: T75539

Differential Revision: https://developer.blender.org/D8896
2020-12-14 13:44:29 +01:00
4b0396695c UI/Assets: Support generating object preview images
Object previews are really helpful for visual data-block selection, like asset
browsing. Having them be generative should also be quite handy and should work
well enough in many, if not most cases.

What this does is simple:
* Place the object (actually a deep copy of it, for thread safety) in a virtual
  .blend into an empty scene/view-layer.
* Add a camera, point it towards the front of the object, assuming that means
  pointing towards its +Y axis.
* Use "Camera Fit Frame to Selected" logic to put the object into frame.
* Create a threaded off-screen render.

Of course, such an automatic preview will not work in all situations. E.g. it
currently does a bad job capturing a single plane. We could add options for
more advanced automatic previews, but probably custom previews is more
important, which I committed already (812ea91842).

Part of the first Asset Browser milestone. Check the #asset_browser_milestone_1
project milestone on developer.blender.org.

Reviewed as part of https://developer.blender.org/D9719.
Reviewed by: Bastien Montagne, Brecht Van Lommel
2020-12-14 13:17:57 +01:00
732d0b458b Blenkernel: move DerivedMesh.c to c++
Required changes to make it compile with clang tidy:
* Use c++ includes like (e.g. climits instead limits.h).
* Insert type casts when casting from void* to something else.
* Replace NULL with nullptr.
* Insert casts from int to enum.
* Replace designed initializers (not supported in C++ yet).
* Use blender::Vector instead of BLI_array_staticdeclare (does not compile with C++).
* Replace typedef statements.

Ref T83357.
2020-12-14 13:08:02 +01:00
551856ed32 Revert "Fix several issues with handling of numpy in CMake."
This reverts commit 5d570c875e.

Buildbots are still borken, need more time to investigate.
2020-12-14 12:29:34 +01:00
fdc9350a9f Revert "Fix own error in rB5d570c875eda in CMake script."
This reverts commit 6da609fcb3.

Buildbots are still broken, need more time to investigate.
2020-12-14 12:29:08 +01:00
6da609fcb3 Fix own error in rB5d570c875eda in CMake script.
My mistake, though CMake could handle default arguments but it needs to
be explicitly passed actually.
2020-12-14 12:23:21 +01:00
812ea91842 UI/Assets: Operator to load custom preview images for data-blocks
No automatic preview generation will ever be good enough to cover all cases
well. So custom preview images are a must for a preview driven data-block
selection - like for asset browsing.

The operator simply allows selecting an image file, which will then be read and
copied into the data-blocks preview (resized if necessary).

There's no UI for this currently and the operator won't be available in the
search menu yet. It will later once the Asset Browser UI is merged.

Reviewed as part of https://developer.blender.org/D9719.
Reviewed by: Bastien Montagne, Brecht Van Lommel
2020-12-14 12:16:59 +01:00
6f7ced77e3 Fix windows build. 2020-12-14 14:09:18 +03:00
Bastien Montagne
f5a019ed43 LibOverride: Do not store some heavy data from override IDs.
This commit removes geometry from meshes and shapekeys, and embedded
files, from liboverride IDs.

This data is never overrideable, there is no reason to store extra
useless copies of it in production files.

See T78944.

Note that we may add more data to be skipped on write for liboverrides
in the future, but this commit should address all the most important
cases already.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D9810
2020-12-14 11:37:01 +01:00
8e1b63d4bd GPencil: Add missing Pin icon for default eraser
This icon allows to set the default eraser when press Ctrl key and was removed by error in the brush refactor.
2020-12-14 11:31:01 +01:00
5d570c875e Fix several issues with handling of numpy in CMake.
Issues were:
* Abusing of `WITH_PYTHON_INSTALL_NUMPY` by both Audaspace and
  Mantaflow.
    - `PYTHON_INSTALL` options only decide whether we copy python (and
      some extra modules) in our Blender installation. On linux it
      makes much more sense to use global python installation.
    - Now we have instead a proper `WITH_PYTHON_NUMPY`
* Bad assumptions regarding path of headers relative to path of python
  module.
    - In current Debian testing, modules are under `python3.9`
      directory, while headers are under `python3` directory.
    - Now we properly `find_path` for headers as well, modifying
      `find_python_package` to take an optional argument for headers.

Note that the required changes done to `extern` libraries are in
blender-specific files that do not exist upstream.

Differential Revision: https://developer.blender.org/D9773
2020-12-14 11:00:28 +01:00
53ed96641c Cleanup: clang tidy 2020-12-14 10:48:11 +01:00
45bf470ee9 Fix T83712: arctangent math node does not work in Eevee
Caused by my refactoring of the math node.
Somehow this operation slipped through my double checking procedure.
2020-12-14 10:47:17 +01:00
067046c26a Cleanup: path_util.c comments 2020-12-14 20:44:26 +11:00
088df2bb03 Fix missing string escape for RNA path creation 2020-12-14 20:44:26 +11:00
b8ae90263a Fix version patching sequence strip alpha from 2.4x files
Regression in 4f5f868a52
2020-12-14 20:44:26 +11:00
7d4536cacc Fix enum-conversion, old-style-declaration warnings
Introduced in 8f3a401975
2020-12-14 20:44:26 +11:00
6327771bc9 Fix T83696: Add Additional menu to Effects panel
This adds the missing options for the effects as it is done in modifiers.

Reviewed By: HooglyBoogly

Maniphest Tasks: T83696

Differential Revision: https://developer.blender.org/D9838
2020-12-14 10:25:37 +01:00
8f3a401975 Eevee: Add Volume Transmittance to Color Render Passes.
In Cycles the volume transmittance is already composited into the color
passes. In Eevee the volume transmittance pass was separate and needed
to be composited in the compositor. This patch adds the volume
transmittance pass direct in the next render passes:

 * Diffuse Color
 * Specular Color
 * Emission
 * Environment

This patch includes the removal of the volume transmittance render pass.
It also renames the volume render passes to match Cycles. The setting
themselves aren't unified.

Maniphest Tasks: T81134
2020-12-14 09:27:58 +01:00
fddbcb5757 UI: Click modifier icon to set active modifier
This should be a final piece of the changes for the active modifier
interface. Before, it was necessary to click on the blank space of a
modifier panel to set it active (not the header), this commit allows
clicking on the icon also.

The spacing with the spacing with the expand button would ideally
be a bit larger, but the layout system doesn't offer much flexibility
here.
2020-12-13 23:49:14 -06:00
260fca5d08 Fix T83673: Custom node trees selectable in nodes modifier
Node tree types from addons were selectable in the modifier's drop-down.
Obviously they didn't do anything, but it shouldn't be possible anyway.
This was just caused by an unimplemented poll function.
2020-12-13 22:59:52 -06:00
Yevgeny Makarov
977ef04746 Cleanup: Fix capitalization in various places
Approximately 33 changes of capitalization to conform to MLA title style.

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

Reviewed by Julian Eisel
2020-12-13 13:12:56 -08:00
dd0520b93b Fix T83725 Inconsistent vertex group between exact and fast boolean.
This makes the exact boolean have zero weights for any vertex groups
on any newly created vertices, which is what the fast solver does.

The exact boolean solver was interpolating vertex data when interpolating
loop data in newly created faces. Not sure why I chose that. The Fast
boolean solver doesn't do that, so I stopped doing it too.
2020-12-13 16:04:05 -05:00
Yevgeny Makarov
a2693ba43e Cleanup: removing some uses of equal sign in descriptions
Using 'is/means/equal' words in place of equal sign in descriptions.

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

Reviewed by Hans Goudey
2020-12-13 12:59:36 -08:00
Yevgeny Makarov
afeaac8b18 Fix cursor position on HighDPI in stereo side-by-side mode
Could not select left quarter of the screen in stereo side-by-side mode on high dpi displays.

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

Reviewed by Julian Eisel
2020-12-13 12:48:50 -08:00
Yevgeny Makarov
2e5d9a73f7 UI: Improved Script Execution Warning
New dialog box layout with large alert icon for the Python script execution warning popup.

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

Reviewed by Hans Goudey
2020-12-13 12:39:28 -08:00
Yevgeny Makarov
bec583951d UI: Remove Unused 'U.wheellinescroll' Property
Remove 'U.wheellinescroll' preference, currently hidden and unused.

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

Reviewed by Brecht Van Lommel
2020-12-13 12:30:03 -08:00
9c0df8e275 Fix weird Swing+Twist decomposition with noncanonical quaternions.
It turns out that after the fix to T83196 (rB814b2787cadd) the matrix
to quaternion conversion can produce noncanonical results in large
areas of the rotation space, when previously this was limited to
way smaller areas. This in turn causes Swing+Twist math to produce
angles beyond 180 degrees, e.g. outputting a -120..240 range.

This fixes both issues, ensuring that conversion outputs a canonical
result, and decomposition canonifies its input.

This was reported in chat by @jpbouza.
2020-12-13 22:06:01 +03:00
c6075118d5 Cleanup: Reduce variable scope in view_2d_ops.c 2020-12-13 09:27:37 -06:00
4797c13e8f UI: Add more property editor operators to IC keymap
As a followup for rB2b3d85d7d6771, this commit adds the remove and
copy operators for grease pencil modifiers, effects, and constraints
where they apply.
2020-12-12 12:07:22 -06:00
57f900e4ef Fix T83705: GPencil - Duplicate strokes of destination layer when merge layer
If the destination layer hadn't keyframe, a new keyframe was added and later the merge layer strokes were added, but this could change the animation because the new frame replaced the old drawings of the target layer.

Now, before merge the layer, all keyframes are added in the target layer in order to keep the drawings.
2020-12-12 18:49:57 +01:00
3eb6649453 GPencil: Add uniform subdivide BKE to improve interpolation
This patch introduces a new BKE function that performs a uniform subdivide.

The goal of this function is to subdivide the stroke to reach a target number of points while maintaining its shape, color, and weights.
This is done by repeatedly subdividing the longest edge in the stroke. Every subdivision adds a new point at the exact middle point of an edge.

The function is intended to be used in the interpolation operators to give better results when interpolating between different sized strokes.

Reviewed By: antoniov

Differential Revision: https://developer.blender.org/D9835
2020-12-12 16:49:38 +01:00
ae94a390a7 Cleanup: clang tidy 2020-12-12 12:24:14 +01:00
0c1d476923 UI: Allow UI to pass focused data-block to operators via context
This is similar to c4a2067130130d, but applies to the general UI and is only
about single data-blocks. Here there was a similar problem: How can buttons
pass the data they represent to operators? We currently resort to ugly ad-hoc
solutions like `UI_context_active_but_get_tab_ID()`. So the operator would need
to know that it is executed on a tab button that represents a data-block.

A single button can now hand operators a data-block to operate on. The operator
can request it via the "id" context member (`CTX_data_pointer_get_type(C, "id",
&RNA_ID)` in C, `bpy.context.id` in .py).
In this commit, it is already set in the following places:
* Generic RNA button code sets it to the pointed to data-block, if the button
  represents a data-block RNA pointer property. (I.e for general data-block
  search buttons.)
* Data-block selectors (`templateID`) set it to the currently active data-block.
* The material slot UI-List sets it for each slot to the material it represents.
The button context menu code is modified so its operators use the context set
for the layout of its parent button (i.e. `layout.context_pointer_set()`).

No user visible changes. This new design isn't actually used yet. It will be
soon for asset operators.

Reviewed as part of https://developer.blender.org/D9717.
Reviewed by: Brecht Van Lommel
2020-12-11 23:08:29 +01:00
af008f5532 UI: Allow Outliners to pass selected data-blocks to operators via context
The way the Outliner integrates operations on selected tree elements is known
to be quite problematic amongst developers. The context menu is generated in an
unusual way and doesn't use the normal operator system. Instead, changes are
applied via a recursive callback system. Things are quite ad-hoc, and the
callbacks often implement logic that should not be in the Outliner, but in
entirely different modules. Often these modules already contain the logic, but
as proper operators.

This commit is a step into a hopefully better direction that should allow us to
put actual operators into Outliner context menus. It starts solving the problem
of: How can the Outliner pass selected data to operators. It implements it for
data-blocks only, but other data could do it in the same way.

Idea is to keep doing what operators were initially designed to do: Operate on
context.
Operators can now query a "selected_ids" context member
(`CTX_data_selected_ids()` in C, `bpy.context.selected_ids` in .py). If an
Outliner is active, it will generate a list of selected data-blocks as a
response, via its `SpaceType.context` callback.
Any other editor could do the same.

No user visible changes. This new design isn't actually used yet. It will be
soon for asset operators.

Reviewed as part of https://developer.blender.org/D9717.
Reviewed by: Brecht Van Lommel
2020-12-11 23:08:29 +01:00
ba83ad226d Fix error in recent commit
Introduced in rBcada56b1f72f537f9ab007cfafd430ac10c292fb
2020-12-11 17:54:27 -03:00
0dbbcaf1e6 Fix: Fix potential memory leak in BLI_getenv
Issue introduced in rB87b19b3aba0c and unlikely to occur
but no reason not to have correct code.
2020-12-11 12:09:18 -07:00
bbd7f94d8a Cleanup: Python GPU: change prefix 'bpygpu_' to 'py_' in static functions 2020-12-11 16:06:22 -03:00
cada56b1f7 Cleanup: GPU Python: Use 'PyC_ParseStringEnum' for string enum 2020-12-11 16:06:22 -03:00
87b19b3aba Fix: BLI_getenv returns ascii not UTF8 on windows
BLI_getenv has always incorrectly returned ascii rather
than UTF-8. This change corrects this behaviour.

This resolves issues when the `BLENDER_USER_CONFIG`
environment variable contains a path with Unicode characters
on windows as reported in T74510 (but unlikely the root
cause for the issue at hand there)

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

Reviewed by: brecht
2020-12-11 11:59:14 -07:00
92ab76c38f Cleanup: clang-format
Forgot to run Make Format on recent spelling changes
2020-12-11 10:48:30 -08:00
Valdemar Lindberg
93c67b0b8e Fix T83586: Cycles failing to load OpenEXR image with EXR RGBAZ channels
Don't refuse to load 5-channel images, instead drop any channels after the 4th
and hope that the first channels represent RGBA.

Differential Revision: https://developer.blender.org/D9820
2020-12-11 19:36:09 +01:00
97651f428b Fix T83050: Crash dragging shared collection to master collection
The flag syncing code expects to find collection flags in same view
layer before and after the move, it even has an assert for it. However,
there is one case where this doesn't happen, when dragging a collection
that exists in two scenes to the master collection.

This commit removes this assert, frees the temporary flag structs
separately, and updates some comments with this information.
There is more detail in the adjusted comment.

Differential Revision: https://developer.blender.org/D9785
2020-12-11 12:15:51 -06:00
b73ed882c0 Cleanup: clang tidy 2020-12-11 19:02:46 +01:00
cef5d0923b Readme file to extern libraries about the attribution document 2020-12-11 18:53:22 +01:00
561d9169fe Fix T83280: Crash when deleting hair collision collection.
Root of the issue was missing management of ID pointers in the cloth
modifier data stored in ParticleSystem for hair physics, in the
'foreach_id' particle system code.

Using modifier's 'foreach_id' code in psys one unfortunately requires
some ugly conversion gymnastics, but this is still better than having
dedicated code for that case.

Note that this is actually a fairly critical issue, fix should be
backported to 2.91.1 should we do it, and to 2.83 LTS as well I think.
2020-12-11 18:46:21 +01:00
85cb238820 Licenses: Attribution document
This document helps Blender users to known what is the library of each
individual 3rd party components that Blender depend on.

Generated using:
https://github.com/amzn/oss-attribution-builder

This is based on the libraries in extern and the svn libraries.

For the libraries in extern the README.blender was used as reference.
For the libraries in svn I used `cmake/versions.cmake`.

Note that the crediting is a bit of hit and miss. For some projects this
is very clear, while for others I had to do some digging. Either way I
gave my best shot.

The sources to (re-)generate this file is local at the moment. But it
should be moved to our infra-structure at some point.

Differential Revision: https://developer.blender.org/D9798
2020-12-11 18:44:11 +01:00
f5dc34ec9c Geometry Nodes: support instancing collections
The Point Instance node can instance entire collections now.
Before, only individual collections were supported.

Randomly selecting objects from the collection on a per point basis
is not support, yet.

Last part of D9739.

Ref T82372.
2020-12-11 18:00:37 +01:00
5ced167336 Geometry Nodes: support collection sockets
Part of D9739.
2020-12-11 17:47:58 +01:00
4885fbc07b Nodes: add Collection socket type
The implementation is pretty much the same as for Object sockets.
The socket color is the one that is used for collections in the outliner.

Part of D9739.
2020-12-11 17:38:32 +01:00
f762d37790 Cycles: enable OpenCL rendering on recent Intel GPUs
Based on testing by Intel, rendering on Iris GPUs and upcoming Xe GPUs
should work. This is enabled on Windows and Linux.

More testing is needed to verify correctness and performance in production
scenes, but our basic benchmark files seem to give correct results.
2020-12-11 17:37:54 +01:00
c6626a2f8a Cleanup: compiler warnings
If you mark one function as override in a class, all must be marked.
2020-12-11 17:37:31 +01:00
Yevgeny Makarov
f7069d71aa Trackpad: Fix wrong scroll deltas on Retina
Scale Mac trackpad scrolling changes by pixel size of output device.

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

Reviewed by Brecht Van Lommel
2020-12-11 08:28:56 -08:00
Yevgeny Makarov
badbf816b8 UI: Consistent Range Descriptions
Unifying range descriptions as a value 'to' a value.

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

Reviewed by Julian Eisel
2020-12-11 07:35:44 -08:00
273aca964e Refactor/extend BKE API to get special user directories
The previous `BKE_appdir_folder_default()` was confusing, it would return the
home directory on Linux and macOS, but the Documents directory on Windows.
Plus, for the Asset Browser, we want to use the Documents directory for the
default asset library on all platforms.
This attempts to clean up the API to avoid confusion, while adding the newly
needed functionality.

* `BKE_appdir_folder_default()` should behave as before, but the implementation
  changed:
** Removes apparently incorrect usage of `XDG_DOCUMENTS_DIR` on Unix systems -
   this seems to be a config file variable, not an environment variable. Always
   use `$HOME` instead, which this ended up using anyway.
** On Windows it doesn't attempt to use `%HOME%` anymore and gets the Documents
   directory directly.
* Add `BKE_appdir_folder_home()` to gives the top-level user directory on all
  platforms.
* Add `BKE_appdir_folder_documents()` to always get the user documents
  directory on all platforms.

There should be no user noticable behavior change.

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

Reviewed by: Brecht Van Lommel
2020-12-11 16:20:53 +01:00
6de85a0cc0 Ghost: Support queries for special user directories (desktop, documents, etc.)
When we had to get special user directories, we'd usually do it in varying,
rather ad-hoc ways. It would be done with a bunch of `#ifdef`s for the
different operating systems. Also, some of the used Win32 functions were legacy
ones and the API docs recommend using newer ones.
Further, seems `BKE_appdir_folder_default()` used `XDG_DOCUMENTS_DIR` wrong.
It's not supposed to be an environment variable but a value inside a config
file.

This adds the platform dependent logic to Ghost, so we can abstract it away
nicely using the `GHOST_ISystemPaths` interface. Getting the desktop directory
for example can now easily be done with:
`GHOST_getUserSpecialDir(GHOST_kUserSpecialDirDesktop).`

For now I added the logic for desktop, documents, downloads, videos, images and
music directories, even though we only use the Documents one. We can extend/
change this as needed, it's easy to do now.
On Windows and macOS, it uses pretty much the same way to access the
directories as elsewhere already. On Linux, it uses the `xdg-user-dir` command
that seems to be available by default on most Linux systems.

No functional changes. The new queries are not actually used yet.

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

Reviewed by: Brecht Van Lommel
2020-12-11 16:20:53 +01:00
c8a3d1a1fa GPencil: Add Link support to Effects using Ctrl+L
The effects were not supported in this operator, but it was supported in the Outliner.

Differential Revision: https://developer.blender.org/D9824
2020-12-11 15:53:22 +01:00
727d5013a7 Fix T82881: Paint mask 'deselect on nothing' missed viewport update
Was failing for weightpaint and vertexpaint.

Selection flags were actually changed, but the update in the viewport
wasnt immediate, leading to confusion when the update happened later
(e.g. when using the weight gradient tool as done in the report).

We need to tag ID_RECALC_SELECT and send ND_SELECT notifier here. This
could be done explicitly, but there is also existing functionality
available that does this.
Note: the way updates happen for paintfaces vs. paintverts looks a bit
inconsistent (so this could be part of a later cleanup commit)

Maniphest Tasks: T82881

Differential Revision: https://developer.blender.org/D9631
2020-12-11 15:32:31 +01:00
7c8e01341f UI: Correct help text in the Parent panel
Tracking Axis and Up Axis were still referring to duplis (DupliFrame) - changed it to be in line with Aaron's info about them in our manual
2020-12-11 14:11:17 +01:00
bfb6fce659 Cycles: Add CPU+GPU rendering support with OptiX
Adds support for building multiple BVH types in order to support using both CPU and OptiX
devices for rendering simultaneously. Primitive packing for Embree and OptiX is now
standalone, so it only needs to be run once and can be shared between the two. Additionally,
BVH building was made a device call, so that each device backend can decide how to
perform the building. The multi-device for instance creates a special multi-BVH that holds
references to several sub-BVHs, one for each sub-device.

Reviewed By: brecht, kevindietrich

Differential Revision: https://developer.blender.org/D9718
2020-12-11 13:24:29 +01:00
d72ec16e70 Geometry Nodes: add Attribute Mix node
This node can be used to mix two attributes in various ways.
The blend modes are the same as in the MixRGB shader node.

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

Ref T82374.
2020-12-11 12:00:48 +01:00
150a1d158a Cleanup: remove some forward declared enums
Forward declaring enums are not allowed in C++.

Differential Revision: https://developer.blender.org/D9811
2020-12-11 11:48:58 +01:00
f5c7246717 Fix wrong operator return values in Outliner code.
Mistakes in rBac8b641b77e0 and rBf254f66587f2.

Spotted while inverstigating T83592.
2020-12-11 11:05:28 +01:00
f7e5f96f56 GeometryNodes: Make properties exposed in modifier overridable. 2020-12-11 10:53:08 +01:00
b62a9ef66f Cleanup: Fix typo in comment. 2020-12-11 10:53:08 +01:00
Evan Wilson
6e4fccd9fa Correct the order of the last two arguments in eevee_cryptomatte_shading_group_create
When compiling on Windows, the following warnings occur:
```[3468/4560] Building C object source\blender\draw\CMakeFiles\bf_draw.dir\engines\eevee\eevee_cryptomatte.c.obj
C:\blender-git\blender\source\blender\draw\engines\eevee\eevee_cryptomatte.c(306): warning C4047: 'function': 'bool' differs in levels of indirection from 'void *'
C:\blender-git\blender\source\blender\draw\engines\eevee\eevee_cryptomatte.c(306): warning C4024: 'eevee_cryptomatte_shading_group_create': different types for formal and actual parameter 5```

As @Severin pointed out [here](https://developer.blender.org/rB76a0b322e4d3244e59a154c8255b84a4fbc33117#288960), this is due to the last two arguments being flipped.  This diff corrects the order.

Reviewed By: Severin, fclem

Differential Revision: https://developer.blender.org/D9809
2020-12-11 08:45:05 +01:00
219dba8506 Workaround T83651: Crash dragging multiple buttons in the clip editor
Avoid the crash, dragging multiple buttons still needs fixing.
2020-12-11 15:32:14 +11:00
392a8e2907 Cleanup: sort cmake file lists 2020-12-11 15:32:14 +11:00
8cc951d2ae Cleanup: trailing space 2020-12-11 15:32:14 +11:00
ff6d7e9072 Cleanup: spelling, expand on FCurve.rna_path docstring 2020-12-11 15:32:14 +11:00
Yevgeny Makarov
a4a42f3171 UI: Use 'and' Instead of '&' in Descriptions
Use 'and' instead of ampersand in descriptions and comments.

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

Reviewed by Aaron Carlisle
2020-12-10 18:22:16 -08:00
caed4849d0 Fix T83640: No immediate updates when changing the settings of a just-
duplicated particle system

When particle settings are duplicated along with the particle system,
this means a change in relations, was missing
'DEG_relations_tag_update'.

Maniphest Tasks: T83640

Differential Revision: https://developer.blender.org/D9823
2020-12-10 22:48:47 +01:00
a7fcca1062 UI: Use words instead of symbols for float comparison items
Though they are nice and concise, users should not be expected to know
the meaning of symbols like `!=`.
2020-12-10 11:07:26 -06:00
8bdd996cd0 Geometry Nodes: Add helper function to check if attribute exists 2020-12-10 10:50:37 -06:00
3d25312617 Nodes: fix incorrectly parameter name and type
The parameter type was incorrectly changed in rB6be56c13e96048cbc494ba5473a8deaf2cf5a6f8 by me.
This can be any id and does not have to be a node tree.
2020-12-10 16:15:28 +01:00
1d447dcd19 Fix T83630 Exact Boolean assert failure in Debug build.
I thought I had reasoned that the add_patch would only happen
when the patch was not already in a cell, but I missed reasoning
about merged cells. So switched to a set 'add' instead of 'add_new'.
2020-12-10 09:15:16 -05:00
348bd319d5 Geometry Nodes: Attribute Fill Node
This commit adds a node that fills every element of an attribute
with the same value. Currently it supports float, vector, and color
attributes. An immediate use case is for "billboard" scattering.

Currently people are using the same input to a Random Attribute node's
min and max input to fill every element of a vector with the same value,
which is an unintuitive way to accomplish the same thing.

Differential Revision: https://developer.blender.org/D9790
2020-12-10 07:58:45 -06:00
efb741b280 Geometry Nodes: rename modifyPointCloud to modifyGeometrySet
Since the initial merge of the geometry nodes project, the modifyPointCloud
function already was already modifying a geometry set. The function wasn't
renamed back then, because then the merge would have touched many
more files.

Ref T83357.
2020-12-10 14:35:15 +01:00
2b9eb5eee5 Fix T83361: UV Editor does not draw pinned selected UVs as pinned
Caused by rB4212b6528af.

outlineColor is computed by the vertex shader, so not a uniform.
So outlineColor was undefined.

note: it was still possible to run into the situation that a selected UV
is drawn ontop of a selected pinned UV [you had to disable sticky
selection for this], now also make sure selected-pinned are drawn
topmost, then selected, then unselected UVs.

Maniphest Tasks: T83361

Differential Revision: https://developer.blender.org/D9786
2020-12-10 13:20:15 +01:00
e795ba1529 Geometry Nodes: fix recursive instance transforms
Previously, the transformation of recursive instances did not work as
on would expect. Second-level instances would detach from first-level
instances when the object was moved.
2020-12-10 10:23:54 +01:00
22959dc866 Fix missing custom-property escaping for whole-character keying set
Custom properties with characters that needed escaping
had f-curves created with invalid paths.
2020-12-10 19:31:22 +11:00
83f5a0b972 Fix missing string escaping in RNA_path_append
This was escaping the '[' character, which isn't needed for quoted text.
2020-12-10 17:57:59 +11:00
e21f1136c2 Tests: fix 'ctest -j' running multiple tests at once
bl_blendfile_io & bl_blendfile_liblink shared a filename,
which could make these tests fail.
2020-12-10 17:18:38 +11:00
2fbf9cb551 Cleanup: remove unused function bc_find_bonename_in_path 2020-12-10 17:10:19 +11:00
d97845a693 BLI_string: return NULL from BLI_str_quoted_substrN on failure
This was returning an empty allocated string, however almost
all callers checked if the return value was NULL before freeing,
making for misunderstandings on the intended use of this function.

BCAnimationSampler::initialize_curves for example detected the
f-curves animation type to 'bone' based on a non-NULL return value
which never failed.

Also fixes two leaks where the the result of BLI_str_quoted_substrN
wasn't freed.
2020-12-10 16:56:09 +11:00
3ec7cf64bc Fix BLI_str_quoted_substrN use with escaped strings
BLI_str_quoted_substrN didn't unescape the resulting string,
yet all callers were using this with animation paths which are
created using BLI_str_escape().

- Fix BLI_str_quoted_substrN use with escaped strings by calling
  BLI_str_unescape().

  Note that it's possible we want an a version of this function that
  keeps escape characters. This could be added if it's required.

- Fix end quote detection using BLI_str_escape_find_quote
  checking for `\"` isn't reliable since an even number of back-slashes
  before a quote means it's not escaped.
2020-12-10 16:12:25 +11:00
2814cdbd86 BLI_string: extract quote utility into BLI_str_escape_find_quote
Duplicate logic for this exists in BLI_str_quoted_substrN,
which doesn't properly support escaping.
2020-12-10 15:06:16 +11:00
aef9243ebb Cleanup: remove unnecessary vars in RNA token reading 2020-12-10 14:55:28 +11:00
ed2556e22c Cleanup: declare variables when used (RNA) 2020-12-10 14:55:28 +11:00
c5aaa11c3b Cleanup: declare variables when used (bpy) 2020-12-10 14:55:28 +11:00
51cbd5d91d Cleanup: avoid '_ln' suffix
Use '_len' or '_line_number'.
2020-12-10 14:55:28 +11:00
564ef8279b Cleanup: use snake-case instead of camel-case 2020-12-10 14:55:28 +11:00
b5bc9d80a1 PyAPI: add bpy.utils.unescape_identifier
Utility to perform the reverse of `bpy.utils.escape_identifier`
2020-12-10 14:40:01 +11:00
2f86518ac0 RNA: use BLI_str_unescape utility for parsing escaped strings 2020-12-10 14:40:01 +11:00
82e1b65d91 BLI_string: support escaping additional control character
Add support for escaping \a, \b & \f for completeness,
currently it's not required.
2020-12-10 14:40:01 +11:00
15d801625c BLI_string: add BLI_str_unescape utility function
Performs the reverse of BLI_str_escape.
This allows logic to be removed from RNA path handling.
2020-12-10 14:40:01 +11:00
7fc1d76037 Fix BLI_str_escape with control characters, add unit tests 2020-12-10 14:40:01 +11:00
65f139117d Cleanup: rename BLI_strescape to BLI_str_escape
Prepare for `BLI_str_unescape` which doesn't read well
without the separator.
2020-12-10 14:40:01 +11:00
548e9624d0 Fix T82852: Cycles crashes when editing a mesh with adaptive subdivision
The issue is caused by stale data on the Mesh Node which is not cleared
during synchronizing since the socket API refactor so that we can detect
changes. However, synchronization only updates the sockets of the Mesh,
so other properties were left with outdated values.

This caused an underflow when computing attribute size for undisplaced
coordinates as it was using the current number of vertices minus the
previous count of subdivision vertices, which at this point should be 0.

Added a simple method to clear non socket data. Also modified
Mesh.add_undisplaced to always use an ATTR_PRIM_GEOMETRY as the data is
not subdivided yet and it avoids any further issues regarding computing
attribute sizes.
2020-12-10 02:31:25 +01:00
b379f93484 Cleanup: Use const for filter queries 2020-12-09 23:43:01 +01:00
d870a60dd9 Sculpt: Elastic deform type for Snake Hook
This adds deformation types to snake hook and the elastic deformation
type. This mode deforms the mesh using a kelvinlet instead of applying
the displacement directly inside the brush radius, which is great for
stylized shapes sketching.

Changes in rake rotation when using elastic are too strong when set
to 1, so I'll add a nicer way to support rake rotations with smoother
transitions in the future.

Reviewed By: sergey, JulienKaspar

Differential Revision: https://developer.blender.org/D9560
2020-12-09 22:25:16 +01:00
19560eef1a Cleanup: Remove unused c popup menu for text editor
This code hase been usused for 10 years and the right click menu is now 
in python.
2020-12-09 16:09:51 -05:00
3b57927651 Fix T82242: creating particle influence textures does not set up DEG
relation immediately

Texture and ParticleSettings have a DEG relation, but
`DEG_relations_tag_update` was not called when the texture changed.
This lead to no updates when e.g. texture size changes, relation only
went into full effect after save/reload or adding/removing keyframes.

Two places were additional relation tagging is needed:
- ParticleSettings `active_texture` changes
- ParticleSettingsTextureSlot (basically any TextureSlots') texture
changes

Maniphest Tasks: T82242

Differential Revision: https://developer.blender.org/D9393
2020-12-09 21:45:36 +01:00
ac7694aee0 UI: Update theme to match Shader nodes category color with socket color
The change to match socket color and category was already done, but it was missing
versioning code to update the theme on load.

Fixes T83500 (already closed as invalid, but this would solve the non-matching colors)

Reviewed by Hans Goudey (HooglyBoogly)
2020-12-09 21:09:37 +01:00
41bca5a3ee Fix T83581: "Only local" ambient occlusion option causes error on OptiX 2.92
The SVM AO node calls "scene_intersect_local" with a NULL pointer for the intersection
information, which caused a crash with OptiX since it was not checking for this case and
always dereferencing this pointer. This fixes that by checking whether any hit information
was requested first (like is done in the BVH2 intersection routines).
2020-12-09 17:06:28 +01:00
c93f826661 Cleanup: various clang tidy fixes 2020-12-09 16:29:11 +01:00
4a5f36638b Geometry Nodes: simplify supporting different input socket types for attributes
This is a non-functional change. The functionality introduced in this commit
is not used in master yet. It is used by nodes that are being developed in
other branches though.
2020-12-09 16:20:57 +01:00
25e151cc34 Fix T83575: GPencil: VFX Blur is not disabled when samples are zero
Before the number of samples was not checked, only the pixel size.
2020-12-09 15:41:07 +01:00
37bf71ad04 Fix T83588: Crash with Shrink/Fatten and Offset Even
`t->keymap` can be `NULL`.

Bug introduced in rBc822f66bb83
2020-12-09 10:30:23 -03:00
Germano Cavalcante
b9eb592133 Fix T83460: Regression in snap for measure tool
Now the gizmo is drawn only when the eventstate located in
`wm->winactive->eventstate` has not changed.

So it doesn't matter if it's "selected" or not.

This commit also removes the use of the private header "wm.h"

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D9539
2020-12-09 09:34:44 -03:00
5a8012b6a6 Degraded AMD 20.11.3 driver to limited support. 2020-12-09 12:37:20 +01:00
baf84ecbe4 Workaround for Access Violation startup crash on deprecated Radeon GPUs on Windows
This is a workaround for T80804.

There's a startup crash that happens on 2.91.0 on Windows, an `EXCEPTION_ACCESS_VIOLATION`
on `atio6axx.dll`. It is triggered by `glClear` on the `detect_mip_render_workaround`
function. The workaround moves the function after the device/driver workaround section and
sets the flag to the affected one to avoid running the check.

It is deprecated hardware that has not meet the minimum requirements since 2.79, but is
still usable and this extends its usability a bit before the cards are finally blacklisted.

Reviewed By: Jeroen Bakker

Differential Revision: https://developer.blender.org/D9667
2020-12-09 12:15:15 +01:00
1a959e9fa8 Raised AMD/Terascale2 from unsupported to supported.
There is a patch that fixes the crash on startup {D9667}.
2020-12-09 12:12:35 +01:00
55d14210cc Raised AMD CEDAR on Linux from unsupported to limited support
There is a workaround available by setting the environment variable `R600_DEBUG=nosb`.
2020-12-09 12:10:32 +01:00
3a23f18e02 Blender LTS: Download + Release notes CMS scripts
This patch contains 2 scripts that will help with LTS releases

create_download_urls.py

    This python script is used to generate the download urls which we can
    copy-paste directly into the CMS of www.blender.org.

    Usage: create_download_urls.py --version 2.83.7

    Arguments:
      --version VERSION  Version string in the form of {major}.{minor}.{build}
                         (eg 2.83.7)

    The resulting html will be printed to the console.

create_release_notes.py
=======================

    This python script is used to generate the release notes which we can
    copy-paste directly into the CMS of www.blender.org and stores.

    Usage: ./create_release_notes.py --task=T77348 --version=2.83.7

    Arguments:
      --version VERSION  Version string in the form of {major}.{minor}.{build}
                         (e.g. 2.83.7)
      --task TASK        Phabricator ticket that is contains the release notes
                         information (e.g. T77348)
      --format FORMAT    Format the result in `text`, `steam`, `wiki` or `html`

Requirements
============

* Python 3.8 or later
* Python phabricator client version 0.7.0
  https://pypi.org/project/phabricator/

For convenience the python modules can be installed using pip.

    pip3 install -r ./requirements.txt

Differential Revision: https://developer.blender.org/D9055
2020-12-09 09:14:53 +01:00
abddd7d5f9 Fix T83566: bpy.props.CollectionProperty gives incorrect error
Error in commit a7b3047cef.
2020-12-09 18:46:07 +11:00
ebe4bf6286 Fix another id-property name length check
Missed this in 6c9263d817
2020-12-09 17:33:11 +11:00
acc6373939 Fix custom-property UI allowing long names that raised errors
Rename `rna_property` to `rna_custom_property`
to differentiate it from a more general property.
2020-12-09 17:20:44 +11:00
6c9263d817 Fix off by one error in id-property name validation
The Python API accepted a name with 64 bytes, clipping it to 63.
2020-12-09 17:16:43 +11:00
3b5a81936d Fix custom property UI handling names with quotes and back-slashes
Custom property names wasn't escaping strings, causing exceptions
editing custom properties with characters that needed to be escaped.
2020-12-09 17:04:05 +11:00
9d8aefaa5c Fix RNA un-escaping multiple slashes and strings ending with a slash
Fix for T78823 resolved the issue reported but didn't
properly support multiple back-slashes.
2020-12-09 16:56:08 +11:00
ceba6b2c21 Fix T78823: Slash in custom property name does not work
This fixes inserting key-frames for any collection names
containing a back-slash too (bones, modifiers, sequence strips etc).
2020-12-09 16:04:21 +11:00
d1cedf53fa Revert "Fix T78823: Slash in custom property name does not work"
This reverts commit cbae82ba96.

This change introduced the following problems:

- We could no longer reliably duplicate or use an existing
  custom property names.
- We could no longer assume a bone or ID name
  can be used in a custom-property.
- Importers that support custom properties (such as FBX)
  could fail with an exception creating custom properties.
2020-12-09 15:29:28 +11:00
cdfe733e70 Cleanup: use doxy sections for graph_edit.c 2020-12-09 14:34:40 +11:00
9c5d67411a creator: remove reference to SDL_AUDIODRIVER from --help text
This was added when Linux's audio support
often needed to be manually configured.

Further 3rd party libraries have their own environment variables & docs
these need not be part of Blender's help message unless they're likely
to be needed to properly run Blender.
2020-12-09 14:15:24 +11:00
5cdfceaa1a Cleanup: use common 'MOD_WELD_MODE_' prefix 2020-12-09 14:10:30 +11:00
Henrik Dick
9b11a7776f Modifier: Add "Connected" mode to the weld modifier
Implement improvement from T73139 for merging along edges.
It is now called "Connected" mode, while the default is called "All".

With the recent performance improvement, the Connected Mode is in some
cases only double the speed than the usual merge all strategy but in
other cases it may be even faster. The bottleneck is somewhere further
down the line of merging geometry.

The motivation for this patch came from T80897, because the merging in
complex solidify is making it very slow.
Now merging can be removed from solidify without greater consequences,
as this is just a quicker and more advanced algorithm to do the same
thing that solidify currently does slowly.

Reviewed by: mano-wii, campbellbarton

Ref D8966
2020-12-09 12:29:48 +11:00
e17967f890 Fix T83559: File Browser uses wrong operation
When opening a temporary File Browser, we have to make sure the file selection
parameters are refreshed. When opening it in a new Window that would always be
the case, if the File Browser uses a maximized window (as set in the
Preferences), it might reuse space-data from a previous use. So we have to
force the refresh.
Also renamed the relevant function to be more clear about what it's doing.

Mistake in 95b3c4c966.
2020-12-08 21:23:55 +01:00
41fa1fea40 Removing ISC license
Blender actually uses the ICS license, not ISC.
2020-12-08 18:51:56 +01:00
46e66d154c Missing README.blender license files + New BSD cases
I also changed New BSD to BSD 3 Clause.

Differential Revision: https://developer.blender.org/D9791
2020-12-08 18:51:14 +01:00
e08de974c3 Fix T83114: incorrect normals after joining subdivided meshes
This just makes sure that the mesh coming out of the subdivision
surface node has correct normals. Ideally, we would lazily compute
derived data like normals in more cases, but that can be solved later.
Correctness is more important right now.

In order to solve this better, it would be nice if functions like
`BKE_mesh_ensure_normals` would take a `const Mesh *`.
The mesh could be considered to be logically const, because
normals are derived data that is only cached for the current
state of the mesh.
2020-12-08 18:07:50 +01:00
Léo Depoix
40dd70882c Fix T83337: boundary smooth input in subdivision surface node is inverted
Differential Revision: https://developer.blender.org/D9753
2020-12-08 17:49:12 +01:00
Jamell Moore
5b73083d4f Fix T81950: GPencil - Draw - Stoke Placement Stroke Feature Broken
Buffer strokes weren't being the excluded from depth only draw calls
so were being included in depth tests. They are now excluded by
bypassing the creation of the buffer strokes.

Reviewed By: fclem

Differential Revision: https://developer.blender.org/D9742
2020-12-08 16:48:22 +01:00
d7cf464b49 Cycles: Remove "OptiX support is experimental" notice
OptiX support is not in fact experimental anymore, so it is time for that notice to go.
All Cycles features that are currently supported on the GPU do work now when OptiX is selected.
2020-12-08 16:13:04 +01:00
612b83bbd1 Cycles: Enable baking panel in OptiX and redirect those requests to CUDA for now
This enables support for baking when OptiX is active, but uses CUDA for that behind the scenes, since
the way baking is currently implemented does not work well with OptiX.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D9784
2020-12-08 16:06:39 +01:00
9962e5936d Cleanup: Use enum for file selection type definitions
Makes it more clear that these belong together and allows using the enum type
rather than just `int`.
2020-12-08 15:43:15 +01:00
2678953f69 Cleanup: Correct an own earlier commit to use an existing utility function
Didn't know this function existed, better to use it then to avoid verbosity.
2020-12-08 15:00:31 +01:00
95b3c4c966 File Browser: Refactor access to the selection parameters struct
* Avoid direct access to `SpaceFile.params`, use a getter instead. This matters
  because once the asset-browser changes are in, there will be an alternative
  selection parameter object. The getter can return the correct one.
* Rename the function to ensure the parameters. The old name
  `ED_fileselect_get_params()` wasn't a mere getter, it would create the
  parameters if necessary. Now we have an actual getter, so better be clear.
* In some instances, I replaced the old "get" function with the new mere
  getter. So the ensure logic is called less often. However, in these cases we
  should be able to assume the selection parameters were created already as
  part of the editor creation routine.

The term "active" in the new function names may seem a bit odd in the current
context, but that is a preparation for the Asset Browser merge as well. Like
said, there will be two file selection parameter objects in the space.
2020-12-08 14:39:31 +01:00
2a4fe88c13 Cleanup: Use guarded allocator for data-block names returned from file reading
Direcly using the C library allocator functions is usually avoided in favor of
our guarded allocator. It's more useful when debugging.
2020-12-08 12:56:11 +01:00
296bc35638 Fix unexpected "/" path after normalizing empty directory path
Caused problems in the Asset Browser branch when passing an empty path. The
function shouldn't blindly add a slash but sanity-check the input parameters
first.
2020-12-08 12:42:02 +01:00
Bastien Montagne
c0bd240ad0 LibOverride: Add initial support for adding new NLA tracks.
Also makes NLA tracks and strips overridable.

User can either edit existing strips in existing NLA tracks (but not add or remove them), and/or add new NLA tracks after those comming from the linked data.

Most of the work was as usual checking operators and adding protections against illegal operations in override context.

Note that since we can only rely on indices to deal with local added tracks, we forbid any local track being before any linked/original track.

Maniphest Tasks: T72629

Differential Revision: https://developer.blender.org/D9611
2020-12-08 10:55:57 +01:00
78080337f8 PyDoc: expanded documentation for bpy_struct.is_property_set
This patch expands on the `is_property_set` doc-string,
detailing the purpose of the `ghost` argument added in
d3bcbe10c2.

Reviewed By: sybren

Ref D9780
2020-12-08 20:52:31 +11:00
28169cea3d PyDoc: avoid blank lines at the beginning of code-examples 2020-12-08 20:49:28 +11:00
276f6840ed CMake: fix linking with WITH_SDL_DYNLOAD
While this was only needed in 'source/blender/python',
add to ghost to avoid problems in the future.
2020-12-08 20:48:11 +11:00
f43c9499bf Cleanup: use static declarations 2020-12-08 20:44:45 +11:00
d9918e3e53 shaders_test: correct arguments to EEVEE_shaders_cryptomatte_sh_get 2020-12-08 20:44:14 +11:00
922b8abea5 Cleanup: LibOverride: Forgot to update comments in previous commit. 2020-12-08 09:48:20 +01:00
682ccd770c LibOverride: Refactor collection items 'local' helper functions.
It's easier to read and less 'weird' to check that an item is non-local
in a liboverride data-block, than the other way around. Thanks to
@sybren for noticing it.
2020-12-08 09:40:42 +01:00
5f1a155a5e Fix T83117: Curve bevel not handle aligned at end-points
Caused by fix for T80742, 4987b7d347.

Keep the fix that calculates the start/end direction
from adjacent points but only use it as a fallback.
2020-12-08 12:20:27 +11:00
Yevgeny Makarov
ab9952e55f Spelling: Bit Depth Compound Modifiers
Correct usage of compound modifiers like '32-bit'.

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

Reviewed by Julian Eisel
2020-12-07 14:51:06 -08:00
Yevgeny Makarov
41e236c527 UI: Correct Usage of 'Eevee' Name
Use accepted capitalization of Eevee, not 'EEVEE'.

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

Reviewed by Julian Eisel
2020-12-07 13:46:01 -08:00
William Reynish
e258dfa421 UI: Add Heading to Curve Deform Toggles
Adds a heading to the three Properties Curve Deform toggles.

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

Reviewed by Julian Eisel
2020-12-07 13:35:50 -08:00
William Reynish
2b3d85d7d6 IC keymap: Properties and Modifier Changes
Updating Industry Compatible keymap for Property filtering and new Modifier behavior.

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

Reviewed by Julian Eisel
2020-12-07 13:34:06 -08:00
William Reynish
6858065754 Userprefs: Tooltips Section Layout Tweaks
Small improvements to the layout of the Tooltips section in Preferences.

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

Reviewed by Pablo Vazquez
2020-12-07 13:29:53 -08:00
c822f66bb8 Fix T83307: Some modal keys of transform operators don't correspond to the expected effect
The transform modes `shrinkfatten` and `seq_slide` have a special way of
handling events.

They use modal events in a different way than expected.

Therefore, this commit adds special event handles for these modes and
removes the keymodal tips from the status bar.

These effects are already described in the header anyway.
2020-12-07 17:36:23 -03:00
29fb12da58 Fix T83510: Convert Gpencil to curve crash when stroke has zero points
If the stroke had zero points the pointer returned NULL.

Also replaced for loop by FOREACH macro.

This is a corner case of "empty" strokes without points.
2020-12-07 19:08:29 +01:00
3e005a3214 Cleanup: Use LISTBASE_FOREACH in node transform code
Also decrease variable scope.
2020-12-07 11:11:03 -06:00
a61febe739 Add comment to clarify the use of mesh::symmetry
Reviewed By: sybren

Differential Revision: https://developer.blender.org/D9776
2020-12-07 17:17:56 +01:00
4f25e168a2 Fix DPX image output having invalid float metadata
Casting 0xFFFFFFFF to float does not give NaN as is needed here. Found through
compiler warning which is now fixed.
2020-12-07 17:09:34 +01:00
b14b57fc05 Fix failing Eevee render tests after recent changes 2020-12-07 17:09:34 +01:00
Jim Eckerlein
3012446f02 glTF: update Draco library to new version
To support decoding and enhanced encoding of Draco compressed glTF files.

Differential Revision: https://developer.blender.org/D9642
2020-12-07 17:09:34 +01:00
fb82cfb539 Animation: Show Channel Group Colors is now off by default
Change the default for the Show Channel Group Colors preference to OFF.

This option in the user preferences was introduced in rBad85256e7108. It
moved a per-file-per-editor option to the user preferences. As this
option would be frequently turned off by animators, this would now have
to happen only once. This commit takes this one step further, and turns
it off by default, as it can cause major readability issues of the
animation channel list.
2020-12-07 16:58:39 +01:00
bab57550b6 LibOverride: Abstract a bit handling of local items of RNA collections.
RNA collections that support insertion of new items in liboverride
data-block need a special way to distiguish between locale and
orig-from-linked items (since some operations are allowed on the forer,
but no the latter).

In future we want a proper solution to abstract that at the
`BKE_lib_override` level, but for now we need to add some code for each
case.

Note that this commit also fixes a few potential issues with GPencil
modifiers, and constraints, regarding their handling of local overrides.
2020-12-07 16:55:51 +01:00
513578b182 Fix (unreported) LibOverride: GPencil local Modifiers not fully editable.
Missing case in `RNA_property_overridable_get`
2020-12-07 16:55:51 +01:00
c51a70537b Fix T81745: Auto Weights fails with Mirror mod + Vertex Groups X
Fix the Assign Automatic Weights operator in weight paint mode when the
Vertex Groups X option is enabled. This issue was probably introduced in
rB5502517c3c12 where `me->editflag & ME_EDIT_MIRROR_X` was replaced by
either `me->editflag & ME_EDIT_VERTEX_GROUPS_X_SYMMETRY` or
`me->symmetry & ME_SYMMETRY_X`. In this case, the former wasn't working,
so I replaced it with the latter.
2020-12-07 16:30:14 +01:00
2e221de4ce UI Code Quality: Start refactoring Outliner tree-element building (using C++)
Continuation of the work started with 249e4df110. After all display modes
were ported to this new design, this commit starts the (more complex) work on
the individual tree-element types. More concretely it ports animation
tree-elements (action data-blocks, drivers and NLA data).

The commit above explains motivations. In short, we need a better design that's
easier to reason about and better testable.

Changes done here are pretty straight forward and introduce similar class
hierarchy and building patterns as introduced for the display modes already.
I.e. an abstract base class, `AbstractTreeElement` with derived classes for the
concrete types, and a C-API with a switch to create the needed objects from a
type enum. The latter should be replacable with something nicer later on (RAII
based, and type-safer through meta-programming).
Each tree-element type has its own class, with an own header and source file
(okay some closely related types can share a header and source file, like the
NLA ones).

I added some further temporary bits for the transition to the new design, such
as the `TreeElement.type`. It should entirely replace `TreeElement` eventually,
just as `outliner_add_element()` should be quite small by then and easily
replacable by a `TreeBuilder` helper.
2020-12-07 14:51:15 +01:00
634b10acbb Fix missing type check for Outliner eyedropper query
Mistake in 35a5dee2ef.

Code would simply assume that the element under the cursor is an Object if it
was an ID (but not a collection).

This wouldn't cause any issues in current code, since the only other ID that
set the direct-data were collections, which are special in that they don't have
a `TreeStoreElem.type` of 0, which is already being checked for here. And if
there was no direct-data set, the object lookup in the View-Layer would
correctly fail too.
2020-12-07 14:35:54 +01:00
95734e32bf Cleanup: Avoid setting (unsafe) Outliner tree element data that won't be used
I carefully checked and am quite sure for `TSE_ANIMATION_DATA` and
`TSE_NLA_ACTION` the direct-data isn't used at all. This data is stored and
accessed in unsafe ways based on conventions anyway (`void *`). We should aim
for a safer design but it will be difficult to get there. Any removed
complexity will help.
2020-12-07 14:35:54 +01:00
0c0bc61918 Fix access to invalid data in Outliner tree building
Non-ID tree-elements would cast their data pointer to `ID *` and take the name
and ID-Code from there. The name would actually be overridden a few lines
later, so that didn't cause issues. But the ID-Code stored inside the tree
element kept an undefined value. In practice that probably didn't cause many
issues either, since it's just an undefined value that was very unlikely to
take a valid 16-bit ID-code value, meaning ID-Code checks would simply fail as
they should. Further there typically are other checks to see if the element
actually represents an ID.
However, in theory this may have caused a few random crashes or
data-corruptions.
2020-12-07 14:35:54 +01:00
cf9275dd4e Fix failing Cycles tests after Cryptomatte changes
For old files without Cycles cryptomatte settings, must provide the defaults.
2020-12-07 13:13:49 +01:00
d329a6a937 Fix bug in cleanup commit
Fix a copy-paste error in rB11c4066159e
2020-12-07 12:54:46 +01:00
11c4066159 Cleanup: partial Clang-Tidy modernize-loop-convert
Modernize loops by using the `for(type variable : container)` syntax.

Some loops were trivial to fix, whereas others required more attention
to avoid semantic changes. I couldn't address all old-style loops, so
this commit doesn't enable the `modernize-loop-convert` rule.

Although Clang-Tidy's auto-fixer prefers to use `auto` for the loop
variable declaration, I made as many declarations as possible explicit.
To me this increases local readability, as you don't need to fully
understand the container in order to understand the loop variable type.

No functional changes.
2020-12-07 12:41:17 +01:00
2072134faa UI: Fix mistakes in UI messages. 2020-12-07 10:57:27 +01:00
7d2745f8b3 Fix Cryptomatte panel not visible in EEVEE
Caused by {rB5baae026a86f}
2020-12-07 09:31:05 +01:00
9ac6ef7036 File Subversion Bump: 2.92.5 2020-12-07 08:07:18 +01:00
Jeroen Bakker
5baae026a8 Cycles: Use Blender Cryptomatte Settings.
Blender has now the place to store the Cryptomatte settings. This patch
migrates Cycles to use the new settings.

Reviewed By: Brecht van Lommel

Differential Revision: https://developer.blender.org/D9746
2020-12-07 08:01:49 +01:00
Greg Neumiller
3d0b65f89b Fix T83296: Unknown actions no longer perform an undo push
str_len_clip is initialized to 0, so when "Unknown Action"
occurs, set str_len_clip appropriately.
Regression in 0688309988

Ref D9759
2020-12-07 13:44:23 +11:00
Greg Neumiller
c2a01a6c11 Fix T83347: Smart UV project crashes with wire edges
Missing NULL check.
Regression in 9296ba8674

Ref D9757
2020-12-07 13:44:17 +11:00
fff0032a25 Cleanup: spelling 2020-12-07 13:25:53 +11:00
5c3fa5a424 Cleanup: correct enum type 2020-12-07 13:25:49 +11:00
ba740ad2ab GPencil: Enable Layer Onion Skin by default 2020-12-06 22:27:28 +01:00
6f22a536e6 Fluid: Updated Mantaflow source files
Includes outflow optimization - might have been the cause of instabilities.
2020-12-06 21:56:43 +01:00
Yevgeny Makarov
ee70eb96cf UI: Alert Dialog Helper Function
Shared helper function to create a split layout with an alert icon for popup dialogs.

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

Reviewed by Julian Eisel
2020-12-06 11:17:51 -08:00
Yevgeny Makarov
79eeabafb3 UI: 'About Blender' with Full Logo
New layout for the 'About' dialog featuring the full version of the Blender logo.

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

Reviewed by Hans Goudey
2020-12-06 10:29:26 -08:00
a90504303e Reorder fields in boolean's ITT_value to save memory. 2020-12-06 10:58:14 -05:00
538f41e949 Doxygen: Increase lookup cache
I could not measure any major speedup/memory usage but this resolves a 
message while running doxygen.
2020-12-05 20:17:32 -05:00
eb4eb07065 Doxygen: Disable HTMLHELP
This feature is intended to generate Microsoft Compiled HTML Help files 
which is not something we use/need.
This also fixes an error in generation because the executable cannot be 
found.
2020-12-05 20:17:32 -05:00
52a6c4f34d Fix crashes with invisible Outliners on fullscreen or window closing
I didn't actually confirm this is caused by invisible Outliners. But I'm pretty
sure the error happens with Outliners that aren't initialized (so were open in
an area before, but another editor is active there currently).
In that case, the runtime data may not be set yet and that is fine.

Fixes T83420.
2020-12-05 14:56:13 +01:00
237f9da4a0 Fix T83400: GPencil onion skin not visible when Edit Lines is enabled
The Edit Lines flag was not checking if Onion was enabled. In 2D template this is disabled by default, but default template has enabled it.
2020-12-05 13:55:10 +01:00
8982a315b7 Add more timing hooks for boolean. 2020-12-05 07:48:41 -05:00
887a602448 Cleanup: Finish porting outliner tree building to C++
No functional changes. This is a few minor cleanups to the remaining C
code for building the outliner tree after parts have been moved to C++.

Differential Revision: https://developer.blender.org/D9741
2020-12-04 17:58:46 -07:00
48acf15f98 Cleanup: Outliner Data API display mode
No functional changes. Moves the data API display building code to C++.

Differential Revision: https://developer.blender.org/D9741
2020-12-04 17:54:19 -07:00
aaa02984d3 Cleanup: Outliner scenes display mode
No functional changes. The scene display building code has been moved
to C++.

Differential Revision: https://developer.blender.org/D9741
2020-12-04 17:53:42 -07:00
1db40c29e5 Cleanup: Outliner orphan data display mode
No functional changes. Code is ported to C++ with additional cleanups to
the logic and variable names.

Differential Revision: https://developer.blender.org/D9741
2020-12-04 17:51:51 -07:00
1cc0a59be6 Cleanup: Outliner video sequencer display mode
No functional changes. Code is ported to C++. Variable names and logic
are also improved.

Differential Revision: https://developer.blender.org/D9741
2020-12-04 17:50:46 -07:00
ea37e4ea5a Fix incorrect variable name after last commit 2020-12-04 14:46:51 -06:00
67faa85fb0 Cleanup: Use LISTBASE_FOREACH macro in windowmanager intern
Also decrease the scope of variables related to the loops.
2020-12-04 13:50:53 -06:00
3daf28388b Cleanup: Move Outliner runtime hash into internal runtime struct, out of DNA
This way Outliner internal data stays internal, non-Outliner code will not be
able to access and mess with this. Further it allows us to use the real type
(rather than `void *`), change the type to a C++ container if needed and
slightly reduces the size for every Outliner stored in files.

Slightly changed how we set the `SO_TREESTORE_REBUILD` for this, but it should
effectively behave the same way as before.
2020-12-04 20:00:45 +01:00
f5eaf67e34 Atomics: Add 16 bit fetch + AND and fetch + OR signed integer operations
I could use a 16 bit atomic fetch + AND for D9719. The alternative would be to
turn a `short` into a `int` in DNA, which isn't a nice workaround.

Also adds tests for the new functions.
2020-12-04 18:28:46 +01:00
1d2c70d761 Fix API doc generation.
BMesh auto-extracting API info does not support comments inside BMesh
operators parameters definition.
2020-12-04 16:45:10 +01:00
719dfd4088 macOS deps: Support building clang tidy
This patch builds clang-extra-tools on macOS for the
clang-tidy binary. The script "run-clang-tidy.py" is
also harvested because using the `CMAKE_C[XX]_CLANG_TIDY`
option can miss out some files (like makesrna), and using the
script is faster as it does not compile the files.
Thanks to `@LazyDodo` for the base patch D8502.

Reviewed By: LazyDodo, sebbas, #platform_macos
Differential Revision: https://developer.blender.org/D9450
2020-12-04 21:13:15 +05:30
d07009498a Transform: Don't use Automatic Constraint Plane in 2D editors
Technically it shouldn't have any effect on these editors.

The key tips in the header can be misleading.

The effect it previously had was not intended.
2020-12-04 12:31:30 -03:00
b919511607 Cleanup: Deduplicate constraint event code 2020-12-04 12:31:30 -03:00
fe1f05de1b i18n utils CLI: add missing RTL process command. 2020-12-04 15:54:50 +01:00
ca4b809e63 i18n utils: Add first version of the CLI wrapper around i18n tools.
Plan is to use that in new 'buildbot' pipeline to automate generation of
i18n files for Blender.
2020-12-04 15:14:16 +01:00
b3306cf669 i18n utils: Add a helper to list and match po files with languages codes.
This code was previously done in the add-on, but we'll need it for the
CLI tool as well, so now it is a utils generator instead.
2020-12-04 15:14:16 +01:00
06ae2e3a60 i18n utils : Reduce dependency to Blender bpy API, step 2.
Remove some top imports of bpy, only import it in a few specific
functions that only make sense when used whithin Blender anyway.
2020-12-04 15:14:16 +01:00
7bd8b8cdac i18n utils: reduce dependency to Blender bpy API, step 1.
This involves re-implementing some of Blender-defined helpers in utils,
we keep debug code to ensure those are still matching on
behavior/results sides.

This will allow to get more i18n tools independent from blender
executable.
2020-12-04 15:14:16 +01:00
69dd7e42c8 i18n utils: Cleanup. 2020-12-04 15:14:16 +01:00
04d3b54000 Cleanup: Declare variables where initialized 2020-12-04 08:03:14 -06:00
4bb5314754 Cleanup: Use typedef for button string info type
Before, it wasn't clear what the int in `uiStringInfo` was supposed to
store. Using a typedef can make this someone more explicit.
2020-12-04 08:01:54 -06:00
6fda30cc54 Fix T83177: Industry Compatible keymap: MMB-dragging to transform engages axis-constraining on release
With rBc0677b662f4b, we try to track all modal events in order to detect the
one corresponding to the release.

But modifier keys can mask the modal event and thus confirm realease ends up
being skipped.

This resulted in the T83387.

With this commit we now read the actual key drop value in the modal event.

This fixes T83387
2020-12-04 10:49:58 -03:00
2de49d1ff7 Revert "Fix T83177: Industry Compatible keymap: MMB-dragging to transform engages axis-constraining on release"
This reverts commit c0677b662f.
2020-12-04 10:49:58 -03:00
c10546f5e9 Cycles: Add support for shader raytracing in OptiX
Support for the AO and bevel shader nodes requires calling "optixTrace" from within the shading
VM, which is only allowed from inlined functions to the raygen program or callables. This patch
therefore converts the shading VM to use direct callables to make it work. To prevent performance
regressions a separate kernel module is compiled and used for this purpose.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D9733
2020-12-04 13:04:11 +01:00
7f2d356a67 Cleanup: Clang-Tidy, modernize-use-using
Replace `typedef` with `using` in C++ code.

In the case of `typedef struct SomeName { ... } SomeName;` I removed the
`typedef` altogether, as this is unnecessary in C++. Such cases have been
rewritten to `struct SomeName { ... };`

No functional changes.
2020-12-04 12:46:43 +01:00
10a8286a26 Cleanup: Clang-tidy, actually enable the modernize-use-override rule
Forgot this in rB168909d9741.

No functional changes.
2020-12-04 12:31:49 +01:00
168909d974 Cleanup: Clang-Tidy, modernize-use-override
No functional changes.
2020-12-04 12:02:52 +01:00
1166110a9d Cleanup: clang-format
Rerun `make format`.

No functional changes.
2020-12-04 11:28:56 +01:00
958df2ed1b Cleanup: Clang-Tidy, modernize-deprecated-headers
No functional changes.
2020-12-04 11:28:09 +01:00
f0df46287a Cleanup: replace NULL with nullptr in C++ code
No functional changes.
2020-12-04 10:50:06 +01:00
6ed6741ee3 Point users to new location of "Show Group Colors" option
In ad85256e71 the "Show Group Colors" option was changed from a
per-editor option to a user preference. Since so many people wanted to
turn this option off, this makes sense. However, this move caused some
confusion because the option was just gone from the menu.

This commit adds a dummy menu item. It's disabled, and the tooltip
explains that the option can now be found in Preferences.

T83390 was created to track the removal of these hints.

Reviewed by: Severin

Differential Revision: https://developer.blender.org/D9735
2020-12-04 10:14:44 +01:00
Jeroen Bakker
76a0b322e4 EEVEE Cryptomatte
Cryptomatte is a standard to efficiently create mattes for compositing. The
renderer outputs the required render passes, which can then be used in the
compositor to create masks for specified objects. Unlike the Material and Object
Index passes, the objects to isolate are selected in compositing, and mattes
will be anti-aliased.

Cryptomatte was already available in Cycles this patch adds it to the EEVEE
render engine. Original specification can be found at
https://raw.githubusercontent.com/Psyop/Cryptomatte/master/specification/IDmattes_poster.pdf

**Accurate mode**

Following Cycles, there are two accuracy modes. The difference between the two
modes is the number of render samples they take into account to create the
render passes. When accurate mode is off the number of levels is used. When
accuracy mode is active, the number of render samples is used.

**Deviation from standard**

Cryptomatte specification is based on a path trace approach where samples and
coverage are calculated at the same time. In EEVEE a sample is an exact match on
top of a prepared depth buffer. Coverage is at that moment always 1. By sampling
multiple times the number of surface hits decides the actual surface coverage
for a matte per pixel.

**Implementation Overview**

When drawing to the cryptomatte GPU buffer the depth of the fragment is matched
to the active depth buffer. The hashes of each cryptomatte layer is written in
the GPU buffer. The exact layout depends on the active cryptomatte layers. The
GPU buffer is downloaded and integrated into an accumulation buffer (stored in
CPU RAM).

The accumulation buffer stores the hashes + weights for a number of levels,
layers per pixel. When a hash already exists the weight will be increased. When
the hash doesn't exists it will be added to the buffer.

After all the samples have been calculated the accumulation buffer is processed.
During this phase the total pixel weights of each layer is mapped to be in a
range between 0 and 1. The hashes are also sorted (highest weight first).

Blender Kernel now has a `BKE_cryptomatte` header that access to common
functions for cryptomatte. This will in the future be used by the API.

* Alpha blended materials aren't supported. Alpha blended materials support in
  render passes needs research how to implement it in a maintainable way for any
  render pass.

This is a list of tasks that needs to be done for the same release that this
patch lands on (Blender 2.92)

* T82571 Add render tests.
* T82572 Documentation.
* T82573 Store hashes + Object names in the render result header.
* T82574 Use threading to increase performance in accumulation and post
  processing.
* T82575 Merge the cycles and EEVEE settings as they are identical.
* T82576 Add RNA to extract the cryptomatte hashes to use in python scripts.

Reviewed By: Clément Foucault

Maniphest Tasks: T81058

Differential Revision: https://developer.blender.org/D9165
2020-12-04 08:46:34 +01:00
Jeroen Bakker
2bae11d5c0 EEVEE: Arbitrary Output Variables
This patch adds support for AOVs in EEVEE. AOV Outputs can be defined in the
render pass tab and used in shader materials. Both Object and World based
shaders are supported. The AOV can be previewed in the viewport using the
renderpass selector in the shading popover.

AOV names that conflict with other AOVs are automatically corrected. AOV
conflicts with render passes get a warning icon. The reason behind this is that
changing render engines/passes can change the conflict, but you might not notice
it. Changing this automatically would also make the materials incorrect, so best
to leave this to the user.

**Implementation**

The patch adds a copies the AOV structures of Cycles into Blender. The goal is
that the Cycles will use Blenders AOV defintions. In the Blender kernel
(`layer.c`) the logic of these structures are implemented.

The GLSL shader of any GPUMaterial can hold multiple outputs (the main output
and the AOV outputs) based on the renderPassUBO the right output is selected.
This selection uses an hash that encodes the AOV structure. The full AOV needed
to be encoded when actually drawing the material pass as the AOV type changes
the behavior of the AOV. This isn't known yet when the GLSL is compiled.

**Future Developments**

* The AOV definitions in the render layer panel isn't shared with Cycles.
  Cycles should be migrated to use the same viewlayer aovs. During a previous
  attempt this failed as the AOV validation in cycles and in Blender have
  implementation differences what made it crash when an aov name was invalid.
  This could be fixed by extending the external render engine API.
* Add support to Cycles to render AOVs in the 3d viewport.
* Use a drop down list for selecting AOVs in the AOV Output node.
* Give user feedback when multiple AOV output nodes with the same AOV name
  exists in the same shader.
* Fix viewing single channel images in the image editor [T83314]
* Reduce viewport render time by only render needed draw passes. [T83316]

Reviewed By: Brecht van Lommel, Clément Foucault

Differential Revision: https://developer.blender.org/D7010
2020-12-04 08:14:07 +01:00
2bd0263fbf Fix T83346: Scrolling doesn't work with mouse over panel header
Just a misplaced assignment to the return value from the panel handler
in rB600fb28b6295.
2020-12-03 23:37:16 -06:00
Yevgeny Makarov
a88e6261db UI: Remove Decorators from Keymap Preferences
Improvements to the layout of the Keymaps section of Preferences by removing unneeded Decorator columns.

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

Reviewed by Hans Goudey
2020-12-03 17:23:13 -08:00
cc6ec71b19 Sculpt: Wet paint area radius
This adds a new property to the sculpt vertex color paint brush to limit
the area of the brush that is going to be used to sample the wet paint
color. This is exactly the same concept as normal radius and area radius
that exist for sculpting brushes for sampling the surface depth and
orientation.

When working near color hard edges, this allows to prevent the color
from the other side of the edge to blend into the wet paint.

With 1.0 (the previous default) wet paint radius, as soon as the brush touches
one vertex of the other color, the wet paint mix color changes, making it
impossible to maintain the border between the two colors.

Reviewed By: sergey, dbystedt, JulienKaspar

Differential Revision: https://developer.blender.org/D9587
2020-12-03 22:55:35 +01:00
9234a6a619 Fix T82872: Add design task link for tilt support
Reviewed By: sergey, Blendify

Maniphest Tasks: T82872

Differential Revision: https://developer.blender.org/D9615
2020-12-03 22:50:02 +01:00
1bc75dfa4a Sculpt: Allow inverting the Erase Displacement mesh filter
When inverting erase displacement the filter can increase the
displacement over the limit surface. After using apply base, this can be
used as an alternative intensify details as it usually gives better
results.

This is the same concept as smoothing inverting to intensify details.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9679
2020-12-03 22:48:12 +01:00
92e44ce67c UI: Add sculpt stats to statusbar
This was missing from D9623. Now the same sculpt scene stats are also
displayed in the status bar.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9700
2020-12-03 22:46:32 +01:00
82e401031f UI: Fix Node Groups color in Geometry Nodes
Node Groups didn't have a category assigned so they looked like inputs (red)
instead of the Node Group theme color (green by default).
2020-12-03 20:21:09 +01:00
f3b08af24c Fix T83352: Move with constraint showing an incorrect value in the header
The displayed value was always that of the x axis.
2020-12-03 15:29:32 -03:00
f637b47064 MSVC: Enable clang-tidy analyser
This enables the use of clang-tidy in the VS IDE.

To use it:

1 - Enable WITH_CLANG_TIDY in your cmake configuration
2 - From the Analyse pull down menu select Run Code Analysis on...

The analyser is currently not enabled by default on build
given it is quite slow and there are quite a few problems
it reports that we still need to deal with.
2020-12-03 11:00:58 -07:00
769818f7f4 GPencil: Reduce UI range for Simplify Adaptive factor
The old range was too big, so now the soft limit is between 0 and 5
2020-12-03 17:42:12 +01:00
c821aa8ca7 GPencil: Fix unreported refresh of stroke after using Arrange operator
When change the order of the stroke using the arrange operator, the arrange was done, but the viewport did not display the result until you refresh the viewport.
2020-12-03 17:18:01 +01:00
986955a2d5 GPencil: Add Vertex Paint operators to Paint menu
These operators existed since 2.83, but the menu was hidden by error.

Also the operators have been cleanup and make multiframe compatible.

Reviewed By: mendio

Differential Revision: https://developer.blender.org/D9671
2020-12-03 16:49:40 +01:00
570a16da18 Fix: remove show_group_colors from graph editor menu
The `show_group_colors` option was moved to the user preferences in
ad85256e71, but accidentally remained in the graph editor menu.
2020-12-03 16:32:58 +01:00
107231eb95 Geometry Nodes: improve support for Color attributes
* Add typed attribute accessors for color attributes.
* Support implicit conversions between colors and floats.
2020-12-03 16:25:48 +01:00
2c181521ec Geometry Nodes: add custom data type getter for attribute accessor
This is just an utility method, that avoids that the caller has to do
the conversion every time it is necessary.
2020-12-03 16:20:09 +01:00
675d84826e Fix T83315: Crash showing animation channel context menu after baking sound
Fix a crash when right-clicking in the Graph Editor animation channel
list. The code for getting selected keyframes was not checking for baked
curves.
2020-12-03 15:28:14 +01:00
a3c4091215 Fix Cycles device kernels containing debug assertation code
NanoVDB includes "assert.h" and makes use of "assert" in several places and since the compile
pipeline for CUDA/OptiX kernels does not define "NDEBUG" for release builds, those debug
checks were always added. This is not intended, so this patch disables "assert" for CUDA/OptiX
by defining "NDEBUG" before including NanoVDB headers.
This also fixes a warning about unknown pragmas in NanoVDB thrown by the CUDA compiler.
2020-12-03 15:20:50 +01:00
5d13082622 Tracking: Improve multithreading of tracking many markers
This change solves a bottleneck which was caused by attempt to cache
postprocessed search areas used for tracking. It was a single cache
used by all threads, which required to have some synchronization
mechanism. This synchronization turned out to be making all threads
to idle while one thread is accessing the cache. The access was not
cheap, so the multi-threading did not provide expected speedup.

Current solution is to remove the cache of search areas. This avoids
any threading synchronization overhead because there is no need for
it anymore. The downside is that for certain configurations tracking
became slower when comparing to master branch. There is no expected
slowdown compared to 2.91 release.

The slowdown is mainly experienced when using big search area and
keyframe matching strategy. Other cases should still be within a
ballpark of performance of single-threaded code prior to this change.
The reason why is it so is because while this change makes it so the
image accessors needs to process images multiple times the complexity
of this process is almost the same as all the overhead for the cache
lookup and maintenance.

Here are Some numbers gained on different configurations.

CPU: Intel Xeom CPU E5-2699 v4
OS: Linux
Footage: Old_Factory MVI_4005.mov from the first part of Track Match
Blend training which can be found on the Blender Cloud.

Tracking 443 markers across 250 frames. The unit is seconds.
File: F9433209

  2.91: 401.520874
before: 358.650055
 after:  14.966302

Tracking single marker across 250 frames. The unit is seconds.
File: F9433211

                         2.91      before     after
        Big keyframe   1.307203   1.005324   1.227300
  Big previous frame   1.144055   0.881139   0.944044
      Small keyframe   0.434015   0.197760   0.224982
Small previous frame   0.463207   0.218058   0.234172
         All at once   2.338268   1.481220   1.518060
2020-12-03 14:51:11 +01:00
Henrik Dick
a6c4e39876 Add Custom Object Space to Constraints
Add Custom Space to the list of space conversions for constraints.

Constraints can use World Space, Local Space, Pose Space, Local with
Parent, and now also Custom Space with a custom object to define the
evaluation space.

The Custom Space option uses the Local Space of an other
object/bone/vertex group. If selected on owner or target it will show a
box for object selection. If an armature is selected, then it will also
show a box for bone selection. If a mesh object is selected it will show
the option for using the local space of a vertex group.

Reviewed By: #animation_rigging, sybren, Severin, angavrilov

Differential Revision: https://developer.blender.org/D7437
2020-12-03 11:20:21 +01:00
899dcc5f60 Fix linker errors when building without Cycles
Fix linker errors by explicitly linking PugiXML when OpenImageIO is
used.

PugiXML has been separated from OpenImageIO (D8628). This means that any
time OpenImageIO libraries are linked, the PugiXML libraries have to be
linked as well. This was set up correctly for Cycles, but not for imbuf.
Because of this, building without Cycles but with OIIO would produce
linker errors.
2020-12-03 11:07:06 +01:00
acaee97c2f Fix accendental copy/paste errors after last commit 2020-12-02 22:26:14 -05:00
fc05e2c0e0 Bmesh: Improve documentation of op parameters
These comments are used to generate Py API docs.
Most of the comments are just copies of the mesh operator counterparts.

More improvements can be made here in the future.

Thanks to Jon Denning on twitter:

https://twitter.com/gfxcoder/status/1334178566993555459
2020-12-02 22:01:00 -05:00
dc4feed59d Cleanup: view-port --> 2D/3D Viewport 2020-12-02 18:16:23 -05:00
cba5137f32 Fix crash in outliner on cursor hover
The previous commit surfaced a bug introduced in rBab4654cdfe8f in which
a boolean wasn't initialized to false.
2020-12-02 09:25:45 -07:00
3fc178b19e Outliner: Highlight icons on cursor hover
The icons for collapsed children already draw highlighted when hovered.
Because the item icons are now select targets (for outliner to properties
editor tab switching) this adds highlights on hover for all outliner
element icons.
2020-12-02 08:58:32 -07:00
3d0c5455ed Cleanup: Store "is_active" instead of pointer property in panel type
This is consistent with the way other panel type fields are stored.
2020-12-02 16:44:40 +01:00
9281a1f4eb UI: Add new node colors for geometry nodes
During the development of the new nodes in the `geometry-nodes` branch
the color of the new nodes wasn't considered, so all of the nodes ended
up red, the color for "input" nodes. This patch introduces two new
colors, one for "Geometry" and one for "Attributes". There are only two
attribute nodes currently, but the next sprint will add two more,
attribute mix, and sample from texture. The attribute nodes are
conceptually different enough from the nodes that modify the geometry
that they deserve their own color.

Differential Revision: https://developer.blender.org/D9682
2020-12-02 16:34:06 +01:00
8522b1b6fb Geometry Nodes: automatically reconnect when swapping inputs
This makes it easier to swap the inputs to the Join Geometry node.
The behavior is the same as in the Math node.
2020-12-02 16:34:06 +01:00
074de755e9 Geometry Nodes: correct modifier name when creating from node editor
The name should be the same as when the modifier is created in the
modifier tab of the properties editor.
2020-12-02 16:34:06 +01:00
58cc8938e1 Fix T83309: Hide metadata when overlays are off.
Inconsistency between overlay popover and implementation. Now the
metadata will not be visible when the overlays are turned off.
2020-12-02 16:19:15 +01:00
60760bd470 Geometry Nodes: unify icons -> use ICON_NODETREE for everything
Until there is a icon made specially for this, the nodetree icon is up
for grabs. Using it in the nodegroup + modifier + editor helps the users
to make a connection on where to edit those modifiers.
2020-12-02 15:38:47 +01:00
ea74ed5a7a Cleanup: remove all of "#ifdef WITH_POINT_CLOUD"
Since Point Cloud was removed from experimental this is no longer needed.
2020-12-02 15:38:47 +01:00
3d3a20d6d1 Cleanup: remove most of "#ifdef WITH_GEOMETRY_NODES"
The ones around the simulation datablock are still there, since they are not
needed for the features planned for master yet.
2020-12-02 15:38:47 +01:00
dc614c68ef Preferences: remove Point Cloud object from experimental
The point cloud object is the only one that will support instancing at
first. So we can expose it as a regular object.

It is limited since it has no edit mode. But this is not different than
the volume object.
2020-12-02 15:38:47 +01:00
56931f63c6 Preferences: remove Geometry Nodes from experimental 2020-12-02 15:38:47 +01:00
b1d1a58c77 Geometry Nodes: improve operators for node editor header
This allows users to create new modifiers directly from the
Geometry Nodes Editor.
2020-12-02 15:38:47 +01:00
600fb28b62 Geometry Nodes: active modifier + geometry nodes editor
This commit adds functions to set and get the object's active
modifier, which is stored as a flag in the ModifierData struct,
similar to constraints. This will be used to set the context in
the node editor. There are no visible changes in this commit.

Similar to how the node editor context works for materials, this commit
makes the node group displayed in the node editor depend on the active
object and its active modifier. To keep the node group from changing,
just pin the node group in the header.

* Shortcuts performed while there is an active modifier will affect
  only that modifier (the exception is the A to expand the modifiers).
* Clicking anywhere on the empty space in a modifier's panel will make it active.

These changes require some refactoring of object modifier code. First
is splitting up the modifier property invoke callback, which now needs
to be able to get the active modifier separately from the hovered
modifier for the different operators.

Second is a change to removing modifiers, where there is now a separate
function to remove a modifier from an object's list, in order to handle
changing the active.

Finally, the panel handler needs a small tweak so that this "click in panel"
event can be handled afterwards.
2020-12-02 15:38:47 +01:00
fc4a853846 Geometry Nodes: support muted nodes
The handling of muted nodes is handled at the derived node tree
level now. This is also where expanding node groups is handled.
Muted nodes are relinked and removed from the derived tree
during construction. The geometry node evaluation code does
not have to know about muted nodes this way.
2020-12-02 15:38:47 +01:00
ae0aa4b94c Geometry Nodes: support geometry components in depsgraph object iterator
Objects can evaluate to a geometry set instead of a single ID (only point cloud
objects for now). In the depsgraph object iterator, the evaluated geometry
components are expanded into temporary objects.

It's important to note that instanced objects can also contain geometry
components. Therefore, they have to be split up into multiple objects
as well in some cases.

At a high level the iterator works like so:

```
for object in depsgraph:
    for component in object:
        yield object_from_component(component)
    for dupli in make_duplis_list(object):
        for component in dupli:
            yield object_from_component(component)
```

DEG_iterator_objects_next has been cleaned up, to make this structure
a bit more apparent.

This should not change anything for objects that are not point clouds.
2020-12-02 15:38:47 +01:00
6be56c13e9 Geometry Nodes: initial scattering and geometry nodes
This is the initial merge from the geometry-nodes branch.
Nodes:
* Attribute Math
* Boolean
* Edge Split
* Float Compare
* Object Info
* Point Distribute
* Point Instance
* Random Attribute
* Random Float
* Subdivision Surface
* Transform
* Triangulate

It includes the initial evaluation of geometry node groups in the Geometry Nodes modifier.

Notes on the Generic attribute access API

The API adds an indirection for attribute access. That has the following benefits:
* Most code does not have to care about how an attribute is stored internally.
  This is mainly necessary, because we have to deal with "legacy" attributes
  such as vertex weights and attributes that are embedded into other structs
  such as vertex positions.
* When reading from an attribute, we generally don't care what domain the
  attribute is stored on. So we want to abstract away the interpolation that
  that adapts attributes from one domain to another domain (this is not
  actually implemented yet).

Other possible improvements for later iterations include:
* Actually implement interpolation between domains.
* Don't use inheritance for the different attribute types. A single class for read
  access and one for write access might be enough, because we know all the ways
  in which attributes are stored internally. We don't want more different internal
  structures in the future. On the contrary, ideally we can consolidate the different
  storage formats in the future to reduce the need for this indirection.
* Remove the need for heap allocations when creating attribute accessors.

It includes commits from:
* Dalai Felinto
* Hans Goudey
* Jacques Lucke
* Léo Depoix
2020-12-02 15:38:47 +01:00
ddbe3274ef BLI: add missing const 2020-12-02 15:38:47 +01:00
d65628466a Functions: add float2 cpp type
This also adds a hash function for `float2`, because `CPPType`
expects that currently.
2020-12-02 15:38:47 +01:00
8268b9827a Theme: update shader node color to match socket color
Reviewed by Brecht

Ref T82689.
2020-12-02 15:38:47 +01:00
96e131f246 UI: update node socket colors
Note: This also changes the Shader socket color, to match "Shading" in the Outliner.

Theme update for shader nodes will be committed separately.

Ref T82689.
2020-12-02 15:38:47 +01:00
69f57550bc Nodes: add geometry socket type
We still have to pick a color for this socket.

Ref T81848.
2020-12-02 15:38:47 +01:00
1d6284a6d5 Functions: add generic pointer class
This class represents a pointer whose type is only known at runtime.
2020-12-02 15:38:47 +01:00
c7f518fe35 Functions: add move operations to CPPType
Those are sometimes needed when dealing with c++ types in a generic way.
2020-12-02 15:38:47 +01:00
85f9d319a4 Fix T83293: crash when selecting bone
This partially reverts rBe922dd7d8a307c54d49bc01649a12610b022192b.
The issues fixed by that commit is still fixed.

Reviewers: fclem
2020-12-02 15:33:51 +01:00
13c3ad7e76 GPU: Show Limited support message for polaris + 20.11.2 drivers.
See T82856 for details.
2020-12-02 15:30:00 +01:00
f8d1378b84 Deps: Additional changes for PugiXML on macOS
This commit expands the Windows-specific code in rBdca9aa0053f7 and Linux-specific code in rB33b7d53df08a.

It also fixes a capitalization issue in FindPugiXML.cmake
2020-12-02 15:18:05 +01:00
d40f5d41af GPU: Blacklist unsupported GPUs that crash during startup.
Since Blender 2.91 the TeraScale 2 based cards crash during startup.
This patch will show the user a screen that the platform they are using
isn't supported.

The GPUs have been carefully handpicked from dozens of reports. T83124,
T83127, T83103, T83091, T83045, T83065, T82750, T82889, T82925, T82640,
T82429, T82436, T82446.
2020-12-02 15:17:13 +01:00
c576d65c2f Fix T83161: Crash when moving ruler endpoints and opening or closing the toolshelf
`invert_snap` could be called before `snap_gizmo->keymap` was found.

Use the lazy initialization in `invert_snap` then.
2020-12-02 10:27:41 -03:00
Henrik Dick
ec39d8de4a Transform: Correct Mirror for Object Mode along arbitrary axis
This fixes T68521, T82334.

The object are not properly mirrored in object mode.

For mirroring an object that has an arbitrary rotation along the X axis
this is the procedure:
1. mirror x location.
2. negate x scale of the
3. negate y and z component of the rotation (independent of which rotation mode is used).

This knowledge applies now for all angles and axes to finally make the
mirror operation work in object mode.

The new mirror function has the downside that it can not (in this form)
be used with proportional editing.

This is no problem since the old behavior can still be replicated by
scaling with -1 along any axis.

The solution to get perfect mirrors can not work for scaling in general,
because in that case there could be scew created.

Reviewed By: mano-wii

Differential Revision: https://developer.blender.org/D9625
2020-12-02 09:22:37 -03:00
da8dc204bd Fix T83119: Crash with topology mirror affecting a hidden vertex
Caused by rBba97da21acf2.

For non-topology mirror hidden verts were never respected/included in
EDBM_verts_mirror_cache_begin (they were excluded from the kdtree).

Prior to said commit, hidden mirrored verts that were still in the map
would have been excluded in a separate loop over vertices in
'editmesh_mirror_data_calc()' by checking BM_ELEM_HIDDEN. Due to the new
nature of this function this check was now moved to
EDBM_verts_mirror_cache_begin.

Maniphest Tasks: T83119

Differential Revision: https://developer.blender.org/D9673
2020-12-02 12:35:51 +01:00
Christian Friedrich
e4204a3979 Add Custom Falloff Curve to the Vertex Weight Proximity Modifier.
The Vertex Weight Edit Modifier already got the Custom Curve, there was no
real reason for the proximity not to have it as well.

With some fixes by Bastien Montagne (@mont29).

Reviewed By: mont29

Differential Revision: https://developer.blender.org/D9594
2020-12-02 11:20:03 +01:00
84451f89f5 Fix T83300: constant scene refreshing in Cycles with empty volumes
This infinite loop is caused by a conflict between the volume mesh
creation which unintentionally clears the shaders before early exiting
when no grid is found, and the Blender exporter which adds back the
shaders causing us to reupdate as the shaders changed.

To fix this simply preserve the shaders on the Volume node.
2020-12-02 11:18:45 +01:00
67353ae630 Fix build error on builds without audaspace
This was caused by incorrect argument type in dummy function
`rna_Sequences_new_sound()`

Caused by 13ca11ac52
2020-12-02 10:13:45 +01:00
2afc508eb4 Fix T83090: Multiple warnings accessing brush enum data.
We already have generic enums for empty and default 'none' value.
2020-12-02 09:29:37 +01:00
da22ec1254 Cleanup: Fix CMake syntax error in the last commit. 2020-12-02 13:55:52 +05:30
6535135ef7 CMake/macOS: consider MinSizeRel too for ASan. 2020-12-02 13:23:25 +05:30
a715839a55 Cleanup: add commits to .git-blame-ignore-revs. 2020-12-02 13:20:43 +05:30
13ca11ac52 VSE: Unify sequences collections API
Use RNA_api_sequences() for SequenceEditor and MetaSequence
sequences member.

Defines pair of dispatch functions rna_Sequences_editing_* and
rna_Sequences_meta_* that pass pointer to seqbase to
rna_Sequences_* function.

Downside of this implementation is, that it defines 2 seemingly
different RNA collections - SequencesMeta and SequencesTopLevel

Reviewed By: mont29

Differential Revision: https://developer.blender.org/D9601
2020-12-02 05:51:22 +01:00
1176591574 Codesign: Allo non-zero exit code for signtool on Windows 2020-12-01 17:16:48 +01:00
33b7d53df0 Deps: Add PugiXML as an official dependency
PugiXML was historically shipped hidden embedded into OIIO, the Grease
Pencil team had a requirement for an XML library recently so pugi seems
like a natural choice since it's not really a 'new' library, we just
turn an implicit dependency into an explicit one.

This commit expands the Windows-specific code in rBdca9aa0053f7 to
include Linux. macOS support will be handled in a later commit.

NOTE: run `cmake -U'*PUGIXML*' .` in the build directory to ensure CMake
finds PugiXML in the new location.

For details see D8628
2020-12-01 16:25:51 +01:00
29401d38d1 Tracking: Refactor autotrack tracking implementation
The idea is to avoid any synchronization needed in the worker threads
and make them to operate on a local data. From implementation detail
this is achieved by keeping track of "wavefront" of markers which are
to be tracked and the tracking result. Insertion of results to the
AutoTrack context happens from main thread, which avoids need in the
lock when accessing AutoTrack.

This change makes tracking of many (300+) about 10% faster on the
Xeon) CPU E5-2699 v4. More speedup will be gained by minimizing
threading overhead in the frame cache.

Another important aspect of this change is that it fixes non-thread
safe access which was often causing crashes. Quite surprising the
crash was never reported.
2020-12-01 15:24:34 +01:00
4c92fb6715 Libmv: Tweak default logging verbosity level
Log to verbosity level 1 rather than INFO severity.

Avoids a lot of overhead coming from construction of the INFO stream
and improves performance and threadability of code which uses logging.

This makes tracking of 250 frames of a track of default settings to
drop down from 0.6sec to 0.4sec.
2020-12-01 14:55:22 +01:00
c21265b29e Libmv: Cleanup, remove unused logging macros
Unused and was not entirely happy with such short abbreviations.
2020-12-01 14:46:35 +01:00
01b94c5d8a Cleanup: De-duplicate object mullptr checks
Makes it more clear whether object is allowed or not allowed to be NULL.
Also, avoids possible access to the different object mode enumerator.

Should be no functional changes.
2020-12-01 10:45:02 +01:00
edf1095176 Fix T83275: Crash with scene statics and empty scene
ob can be NULL, so it needs to be checked before accessing ob->mode

Differential Revision: https://developer.blender.org/D9680
2020-12-01 10:27:51 +01:00
645c2bd4d0 Fix sculpt transform incorrently flipping displacement in Y and Z axis
These functions were only checking the X axis for flipping the
displacement for a symmetry area depending on the initial position of
the pivot.
This affects transform and any other tools that transform vertices and
applies symmetry based on areas (the pose brush, for example).

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9654
2020-11-30 23:40:06 +01:00
ea064133e5 UI: Add Sculpt Session info to stats
This adds the vertex and face count info to the scene stats in sculpt
mode. These stats count the active vertices and faces in the
sculptsession for the active object. This has the following advantages:
- It is possible to know how many vertices the sculptsession has active
comparted to the vertex count of the entire scene from sculpt mode
- When sculpting with constructive modifiers, these stats will report the
number of vertices that you can actually sculpt with, instead of the
vertex count of the modified mesh and the entire scene.

Reviewed By: sergey, dbystedt

Differential Revision: https://developer.blender.org/D9623
2020-11-30 23:35:39 +01:00
6b12dad190 Cleanup: Use LISTBASE_FOREACH for node tree sockets RNA code 2020-11-30 16:39:07 -05:00
007a0e43a0 Cleanup: Reduce variable scope in node drawing code
Also use LISTBASE_FOREACH in a few places and generally clean up
the code for the two sidebar panels "Sockets" and "Interface".
2020-11-30 13:56:46 -05:00
5a35e56bcb Cleanup: Remove unecessary code.
We already `memset` the whole mesh runtime to zero, no need to set some
of its pointer explicitly to NULL afterward.
2020-11-30 19:47:42 +01:00
814b2787ca Fix T83196: bad matrix to quaternion precision near 180 degrees rotation.
Adjust the threshold for switching from the base case to trace > 0,
based on very similar example code from www.euclideanspace.com to
avoid float precision issues when trace is close to -1.

Also, remove conversions to and from double, because using double
here doesn't really have benefit, especially with the new threshold.

Finally, add quaternion-matrix-quaternion round trip tests with
full coverage for all 4 branches.

Differential Revision: https://developer.blender.org/D9675
2020-11-30 21:46:45 +03:00
6022103264 Cleanup: Clang tidy void argument 2020-11-30 13:44:58 -05:00
c0677b662f Fix T83177: Industry Compatible keymap: MMB-dragging to transform engages axis-constraining on release
Release confirm did not consider modal keymap events.
2020-11-30 14:50:35 -03:00
3bdc42f97a Fix T82996: Library Overrides: Duplicate of overridden collection on Resync
Properly use given reference pointer in
`lib_override_library_create_post_process` when it is a Collection one
too.
2020-11-30 17:19:27 +01:00
a7cf6ad547 Fix (unreported) broken logic in BKE_collection_add_from_collection.
That function was adding given new collection to all ancestors of the
reference one, instead of only to its immediate parents.
2020-11-30 17:19:27 +01:00
c760ab0dda Cleanup: Graph Editor, refactor selection operators
Extract initialisation code of box selection into separate functions.

No functional changes.

Reviewed By: zeddb, sybren

Differential Revision: https://developer.blender.org/D9196
2020-11-30 17:14:55 +01:00
8c74c35ecb Fix T81628: Moving Python-made channels freezes Blender
Fix various problems in the Action Group rearranging code. All fixes are
necessary to resolve the bug.

- Before groups are rearranged, the channels are moved into their
  respective groups (so no longer referenced by `action->channels`). A
  temporary group is made for ungrouped channels. The code made
  assumptions about the channels being in the same order as the groups;
  that assumption has been removed.
- Looping over channels in an Action Group should stop when reaching the
  last channel, and not until `NULL`.
- After all the reshuffling is done, the `action->channels` linked list
  wasn't terminated properly. Now `first.prev` and `last.next` are set
  to `NULL` to avoid infinite loops.
2020-11-30 16:30:44 +01:00
ed9b70393c Cleanup: Animation, clean up action group rearranging code
Some minor cleanups to make an upcoming bugfix easier.

No functional changes.
2020-11-30 16:30:44 +01:00
0f30edc20c Tracking: Make image accessor own what it needs
Previously image accessor was sharing array pointer for tracks access.
Now it is possible to pass a temporary array valid only during the
initialization process.

Should be no functional changes.
2020-11-30 16:24:11 +01:00
13ce25d24c Tracking: Clarify tracks and options storage once again
This is something not-so-trivial to see from just reading code, which
shown an important of proper comments and clear naming.

Main source of confusion was that it is not immediately clear that
AutoTrack context is to see all tracks, but tracking to only operate on
selected ones.
2020-11-30 16:24:11 +01:00
83c872085d Windows/Ninja: allow parameters for rebuild.cmd
The windows build leaves a convenience helper script
in the build folder called, rebuild.cmd. This change
passes any parameters you give rebuild.cmd to ninja
so you can easily pass it additional parameters without
having to edit the batch file manually.
2020-11-30 08:22:50 -07:00
9081b80d15 GPencil: New operator to reset Vertex Colors
This operators reset the vertex color information of the strokes.

If nothing is selected, all strokes are reset. If any is selected, only selected strokes are reset.

Also added a new menu Paint in Vertex Color mode.

Differential Revision: https://developer.blender.org/D9647
2020-11-30 15:52:44 +01:00
f280300b6a Tracking: Cleanup, remove unused argument from image accessor 2020-11-30 15:50:21 +01:00
ba3bf822a1 Tracking: Cleanup, remove unused field
Was re-introduced after previous round of cleanups when was merging
refactor and master branches.
2020-11-30 15:44:42 +01:00
ecfacb7706 Tracking: Cleanup, use explicit frame match option
No functional changes, just allows to potentially extend the options
in the future, and also makes code more explicit.
2020-11-30 15:03:31 +01:00
c949062c6e Tracking: Cleanup pattern match DNA definition
Wrong comment was used for enumerator.

Also made it a real typed enumerator to ease use in the implementation
code.

Should be no functional changes.
2020-11-30 14:58:12 +01:00
f61ad0e101 Fix T83203 BGL: shader.program wrongly always returns 0
This was a leftover from the 2.91 GPU module refactor.

This is an exception that should be removed when we remove BGL.
2020-11-30 14:55:46 +01:00
6fba2726c7 Tracking: Cleanup, finish pass of comments in the context
Some fields are still not really documented, but they are subject of
refactor/fix which will happen shortly.
2020-11-30 14:48:48 +01:00
2f08906c47 Tracking: Cleanup, replace clip user with frame number
Makes it more clear from intent and usage point of view.
The user was not used for anything else than frame number.
2020-11-30 14:44:51 +01:00
9d3b6f75a1 Tracking: Cleanup, more clear variable naming
A no-functional-followup of the previous commit.
2020-11-30 14:40:00 +01:00
d61a6a8cc3 Tracking: Fix missing frame remap for plane tracks
Tracking track which is used for plane track and movie clip having
a scene frame offset would have trigger re-calculation from a wrong
frame.
2020-11-30 14:36:03 +01:00
88289d8f84 Tracking: Cleanup, clear variable names and indentation
Should be no functional changes.
2020-11-30 14:25:42 +01:00
8dac88b54a Tracking: Cleanup, unused field in autotrack context
Was only assigned to truth, always. Never read back.
2020-11-30 14:13:34 +01:00
Yevgeny Makarov
9306e01b10 Fix T82870: on macOS, continuous grab jumps when crossing editor border
The event queue can contain events from before pointer warping, ignore those
now. This is an old issue, but became more common now that we disabled event
coalescing and started using the event mouse location rather than the current
mouse location.

Thanks to Yevgeny Makarov and Nicholas Rishel for helping solve this.

Ref D9662
2020-11-30 13:41:38 +01:00
2a430a670c Tests: blacklist failing tests for Cycles CUDA and OptiX devices
Blacklist a bunch of tests on the GPU, which are known to currently have
differences with CPU. These can be enabled as they are fixed or the test
is modified to give compatible results when there are known limitations.

OSL tests were also moved to their own directory since those are not
supported on the GPU.

Ref T82193
2020-11-30 13:40:33 +01:00
dd391d38f6 Tests: add CMake option to run Cycles regression tests on GPU devices
CYCLES_TEST_DEVICES is a list of devices (CPU, CUDA, OPTIX, OPENCL). It is set
to CPU only by default.

Test output is now writen to build/tests/cycles/<device>, and the HTML report
has separate report pages for the different devices, with option to compare
between CPU and GPU renders.

Various GPU tests are still failing due to CPU/GPU differences, these are to be
fixed or blacklisted still.

Ref T82193
2020-11-30 13:40:33 +01:00
c986e46be7 Cleanup: avoid harmless but unnecessary float division by zero 2020-11-30 13:40:33 +01:00
057c15b549 Libmv: Add threading primitives
Allows to use mutex, scoped_lock, and conditional_variable from within
the libmv namespace.

Implementation is coming from C++11. Other configurations are easy to
implement, but currently C++11 is the way to go.
2020-11-30 12:12:39 +01:00
0f0c982ff4 Libmv: Add build configuration header
Allows to easily access build platform information, such as bitness,
compiler, supported C++ version and so on.
2020-11-30 12:12:39 +01:00
d3dd61aab3 Libmv: add missing files to bundler
Bundler wouldn't be able to pull changes form upstream until all the
changes are upstreamed, but is better to have information consistent.
2020-11-30 12:12:39 +01:00
Monique Dewanchand
c751d40e07 Cleanup hardcoded render percentage to factor conversion
During revision of {D8952} one of the comments was to make a function that converts the render percentage to a factor. This to avoid code duplication. However the duplicated code was already all over the compositor code. So in order to avoid this code duplication for {D8952} I propose to first cleanup the duplicated code and build patch {D8952} based on this clean up.

The method that converts the render percentage to a factor is put in the CompositorContext. Why? The CompositorContext keeps DNA information like the renderdata. DNA, and thus the CompositorContext, keeps the size of the render resolution in percentage (user oriented). The compositor needs the size of the render resolution as a factor. So the CompositorContext seems like the obvious place to have this conversion method.

Why not in de NodeBase? The method could've been added to the nodebase, but I wanted to keep the nodebase as clean as possible and not put simple "conversion" methods into this base class. Also I didn't really like the call flow: you'd always have to get the renderdata size from the context and then convert.
Putting it in the CompositorContext avoids this extra invoke of a call.

Why not in the Converter? See nodebase. And the Converter seems more like a class for "structural" and complex node tree conversions. Not the simple conversions.

Reviewed By: Sergey Sharybin

Differential Revision: https://developer.blender.org/D9566
2020-11-30 08:00:40 +01:00
f38cd7e188 RNA Manual Reference: Update 2020-11-29 22:01:23 -05:00
dc40bea003 Cleanup: Use LISTBASE_FOREACH macro in screen.c
This commit replaces while loops and for loops with the equivalent
macro. This results in much more readable code in some places,
and it's now more apparent when the situation is more complicated
than just iterating through a linked list.
2020-11-29 20:30:11 -05:00
748f468fdc Cleanup: Use "region" for ARegion variable names
As proposed in T74432 and already implemented in several commits,
"region" is the preferred name for `ARegion` variables, rather than
any variant of "ar". This commit changes a few "ar" variables that have
popped up over time and also adjusted names of variants like "arnew".
2020-11-29 18:10:47 -05:00
dca9aa0053 Deps: PugiXML 1.10
This separates out PugiXML that was previously
bundled by OIIO.

As this linux/mac libs are not available
this commit only contains the builder and windows
changes, and the option to enable pugixml is
guarded by a platform if, this can be removed
once all platforms have committed the svn libs.

For details see D8628
2020-11-29 14:01:33 -07:00
176324aa5c QuadriFlow: Fix std::allocator deprecation warnings
https://en.cppreference.com/w/cpp/memory/allocator/construct
"(deprecated in C++17) (removed in C++20)"
Same for `destroy`.

Reviewed By: zeddb

Differential Revision: https://developer.blender.org/D9657
2020-11-30 00:46:27 +05:30
11f0169e88 Run clang-format to fix line length after D8915. 2020-11-29 17:26:33 +03:00
Rebecca Dengate
13c820d87b CMake/macOS: Use custom LIBDIR if set on CLI
Reviewed By: ankitm
Maniphest Tasks: T83174
Differential Revision: https://developer.blender.org/D9664
2020-11-29 13:34:33 +05:30
458d8a423a Speed up finding patch components in new boolean.
By checking if a cell has already been processed in the finding patch
component code, an enormous speedup happens. This only will be
noticeable if there are lots of patches, and some cells with a
large number of patches.
2020-11-28 14:27:10 -05:00
1169507308 Speedups for finding cells in new boolean.
In case where there are coplanar instersections where
each part has a lot of triangles, the finding-cells algorithm was
very inefficient. This uses a Set instead of a Vector to keep track
of a cell's patches, avoids going through all patch x patch combinations,
avoids going through all patches to renumber after a merge, and
merges smaller patch-sixe cells into larger ones.
All this reduces the time to find cells in the cited case by a factor of 10.
2020-11-28 13:26:52 -05:00
566e7e6145 Fix Auto Clamped limits when smoothing the transition of cyclic curves.
The value of l[count-1] should be ready by the time hmin/hmax is computed.
Otherwise the left limit for the transition key would be scaled wrong.
2020-11-28 15:54:18 +03:00
c99d767735 Fix some naming and comments in F-Curve smoothing code. 2020-11-28 15:54:18 +03:00
b3f20eed6e Fix T83023: incorrect shape of cyclic F-Curve with only two points.
The equation solver didn't handle the one unknown case correctly.
2020-11-28 15:54:17 +03:00
f8553de2cd GPencil: Fix unreported vertex size for Bezier handles
By error, the Bezier points were using the mesh vertex size, not the grease pencil vertex size.
2020-11-28 11:10:35 +01:00
fbdf1af355 Fix T82758: Convert Proxy to Override: Local constraints aren't saved.
Ensure consistent order of pose bones. Now it should always match the
one from bones in armature obdata (as exposed by e.g. RNA, i.e.
children-first).

Previously when some pose bones would need to be added or removed from a
pose due to changes in the bone armature, or if bones in armature were
re-ordered, the bones order in pose would not match anymore the one from
armature, and could even become different between e.g. a proxy and its
linked source.

This was not really nice, but not a big issue before either. But with
diffing process of override, consistent order of items between reference
linked collection and local override one is crucial.

Reviewed By: #animation_rigging, sybren

Maniphest Tasks: T82758

Differential Revision: https://developer.blender.org/D9646
2020-11-27 16:18:59 +01:00
e4e7dfc1d8 Fix transform snap mixed with incremental
The incremental was taking priority but the other elements are mandatory.
2020-11-27 10:51:33 -03:00
f9e994d0f4 Fix T83092: Direction of rotation with View orientation changed in 2.91
The change was intentional so that the orientation matrices match
(`rv3d->viewinv` becomes equal to the orientation matrix).

But, although in a projection matrix the Z axis is negative, this
should not be so from the user's point of view.

So the solution here is to negate the Z axis when the View orientation
is chosen.

This affects all modes, but is only evident for rotation.

---
Another change here is to use the final rotation value (`values_final`)
for the gizmo drawing since this value can be changed by the mode.
2020-11-27 10:41:33 -03:00
24e57eea43 Fix T82156: Object with constraints translates when parented
Avoid the evaluation of constraints when computing the parent-inverse
matrix.

Constraints are meant to be evaluated last; object transforms are
computed this order:

1. `parent->obmat` (the parent object's world matrix)
2. `ob->parentinv` (the object's parent-inverse matrix)
3. Object's loc/rot/scale
4. Object's constraint evaluation

When the constraints are used to compute the parent-inverse matrix,
their effect is moved from step 4 to step 2 in this list, potentially
rotating or scaling the object's local transform. This causes unwanted
movement as reported in T82156.

Reviewed By: looch

Differential Revision: https://developer.blender.org/D9413
2020-11-27 12:11:43 +01:00
e4b6afbe6b Cleanup: Animation, clean up FCurve Cycles modifier
Simplify conditions and declare variables `const` where possible.

No functional changes.
2020-11-27 10:15:20 +01:00
45dca05b1c Cleanup: Add r_ to return parameter
Prefix a return parameter with `r_` to follow the style guide. No
functional changes.
2020-11-26 20:37:54 -07:00
ab4654cdfe Cleanup: Move logic to outliner_find_item_at_x_in_row
Move the logic for determining if the item at a given x position is an
icon into the function. This is used for determining selection over an
icon, and will be used in a later commit for checking for hover over an
icon. No functional changes.
2020-11-26 20:37:21 -07:00
1709bc5164 Add performance timing to mesh_boolean.cc.
You can uncomment the PERFDEBUG define to get timings.
2020-11-26 18:29:11 -05:00
64b58888fb Sculpt: Refactor transform code to allow incremental updates
This adds support for incremental updates in the sculpt transform
code. Now tools can define if they need the displacement applied
for the original coordinates or incrementally.

This is needed for features like elastic transform or cloth deformation
target in the transform tool.

No functional changes.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9547
2020-11-27 00:18:41 +01:00
26eb8d6aa0 UI: Use decorators in volume modifiers
This is consistent with the UI for other modifier types.
2020-11-26 12:56:12 -05:00
226b028523 GPencil: Cleanup - Remove unused old shaders
These fill shaders were used with the old draw engine.
2020-11-26 17:44:43 +01:00
9add12ff05 Transform: Improve event detection for AutoConstrain
The event "value" is not really required since this operation works as a toogle.

This change cleans and simplifies the code.
2020-11-26 13:42:56 -03:00
dd0e2da00e Cleanup unintentional change in rB8a2270efc52a
Note that the whole thing need to be redone/properly fixed, but this is
a bit more complicated so for now fix in  rB8a2270efc52a is 'good
enough'.
2020-11-26 17:30:20 +01:00
841ae18605 Fix T83055: setting rna pointer properties can create bogus custom properties
This was reported in the form of the eyedropper of the 'Parent' property
creating a custom property 'parent' if self was picked.

Problem arises when certain checks for setting rna pointer properties
failed (for example: the PROP_ID_SELF_CHECK check) and then a different
code path was entered (which was only meant for IDProperties).

Problem was introduced in rBa7b3047cefcb.

To solve, now first enter the branch for rna-based pointer properties,
then perform the sanity-checks (and if these fail: dont enter the other
unrelated codepath but instead do nothing)

Maniphest Tasks: T83055

Differential Revision: https://developer.blender.org/D9652
2020-11-26 17:18:48 +01:00
4b248c1658 Fix T82729: Crash in rna_EffectorWeight_path when object has fluid and
dynamic paint modifiers

Looks like prior to the introduction of mantaflow, the former
SmokeModifierData always had a domain initialized (even if its type was
set to None). Since mataflow, the FluidModifierData type needs to be set
to MOD_FLUID_TYPE_DOMAIN (otherwise domain is invalid)

Maniphest Tasks: T82729

Differential Revision: https://developer.blender.org/D9644
2020-11-26 16:57:02 +01:00
87030d8be5 Fix T83046: Material change not updating in the link of an override.
Code was actually not applying any override operation over linked data.

Reasonn behind that was that if library file is saved with latest
override applied then this is not needed, since data saved for the
override in the lib file is already up to date.

But this is actually fully breaking in case someone update the lib file
of the lib file, without re-saving the libfile itself.

So now we alwaya apply overrides also on linked data.

Note that this will not fix the case where a resync is needed.
2020-11-26 16:43:31 +01:00
4705fafa7e UI: Fix incorrect offset for panel label when zooming in
The panel title text intersected any buttons in the header because
the label offset retrieved from the layout code was not scaled by
the block's zoom level. Error in rB0d93bd8d63980.
2020-11-26 10:29:03 -05:00
44f5d99cbf Fix T83020: Transform: AutoConstraint being confirmed without releasing the MMB
The transform modifiers are confirmed by releasing any button.

Thus, the operation can be falsely confirmed if the button that launched
the operation is released after the modifier has been activated.

Previously the events that confirmed the modifiers were hardcoded.

An option to fix this would be to add custom confirmation keyitens for
specific modifiers. But this can be a bit confusing and would make the
modal keymap even bigger.

So the solution here is to skip the button that launched the operation
when confirming the modifier.
2020-11-26 11:42:28 -03:00
Joseph Brandenburg
849debe36c Fix T80970: Copy Rotation constraint incorrect under shear
Orthogonalize the constraint target's matrix before decomposing it into
Euler angles. This removes sheer, and is actually a requirement for
correct decomposition.

It's conceivable that someone has used the incorrect behaviour in a rig.
As the shear caused unpredictable flipping of the constrained object,
this is unlikely.

Reviewed By: angavrilov, sybren

Differential Revision: https://developer.blender.org/D8915
2020-11-26 13:12:13 +01:00
781429a8b0 Cleanup: clearer marking of what was changed in GTestAddTests.cmake
Replace `Blender` with `BLENDER` so that it's more clearly a marker, and
not just the name.

No functional changes.
2020-11-26 13:05:46 +01:00
Stefan Werner
0062b34e94 macOS: Patch OpenImageIO's ustring for ARM.
OpenImageIO's ustring makes assumptions about the interals of
std::string which aren't true on macOS/ARM. A patch for OpenImageIO
addresses this for macOS/ARM builds only, at the expense of potentially
duplicated allocations of strings.
2020-11-26 12:22:56 +01:00
Stefan Werner
05f410dd84 macOS: Added new location for Homebrew.
The build script for macOS dependencies expects to find bison provided
by Homebrew under /usr/local. Since the default install location for
Homebrew changes on macOS/ARM, the script now looks at the host
architecture and switches to /opt/homebrew on Macs with Apple Silicon.
2020-11-26 11:30:53 +01:00
8a2270efc5 Fix T81265: Animation is not evaluated when collection is included into view layer.
Just tag objects in un-excluded viewlayer for animation update.
2020-11-26 11:08:51 +01:00
774d18804f Fix T82452: Outliner: Cyclic "Original ID" panel in Data API.
I cannot think of any case where we'd want to show this pointer in UI
anyway, so just tag it with `PROP_HIDDEN`.
2020-11-26 10:46:35 +01:00
e09d0c0d07 Fluid: Updated Mantaflow source files
This update introduces two improvements from the Mantaflow repository:

(1) Improved particle sampling:
- Liquid and secondary particles are sampled more predictably. With all parameters being equal, baked particles will be computed at the exact same position during every bake.
- Before, this was not guaranteed.

(2) Sparse grid caching:
- While saving grid data to disk, grids will from now on be saved in a sparse structure whenever possible (e.g. density, flame but not levelsets).
- With the sparse optimization grid cells with a value under the 'Empty Space' value (already present in domain settings) will not be cached.
- The main benefits of this optimization are: Smaller cache sizes and faster playback of simulation data in the viewport.
- This optimization works 'out-of-the-box'. There is no option in the UI to enable it.
- For now, only smoke simulation grids will take advantage of this optimization.
2020-11-25 23:18:12 +01:00
Erik Abrahamsson
f7223d5f72 UI: Allow theming the alternate row color in the sequencer
Previously, the alternate row color in the Video Sequence Editor was
just a shaded version of the editor's background color. This makes it
theme-able just like in the file browser and outliner, although the
default color is very slightly different.

Differential Revision: https://developer.blender.org/D9634
2020-11-25 16:37:33 -05:00
05c4efc9b1 Fix Edit Face Set operator not being cancelled when the cursor is not over the mesh
If the cursor is not over the mesh, the operator was still using the
last Face Set ID updated by the drawing cursor code when the cursor was
over the mesh.

This now cancels the operator instead of modifying a Face Set that will
look random to the user.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9545
2020-11-25 22:22:12 +01:00
8b9b3d98e0 Rename use paint symmetry to use mesh symmetry in quadriflow
The original name was chosen because symmetry was a property of
the Paint struct. Now symmetry is a property of meshes, which
also makes the name of the property easier to understand.

Reviewed By: sergey, dbystedt

Differential Revision: https://developer.blender.org/D9618
2020-11-25 22:21:02 +01:00
41a73909de Cleanup: Typo in print_default_info function name. 2020-11-25 20:45:47 +01:00
02a0f6b04a Fluid Particles: fix viscoelastic spring threading crash again after D7394.
Since D6133 fluid particle code uses thread local storage to collect
springs created during a time step before adding them to the actual
spring array.

Prior to the switch to TBB there was a single finalize callback which
was called on the main thread, so it could use psys_sph_flush_springs
and insert the new entries into the final buffer. However in D7394 it
was replaced with a reduce callback, which is supposed to be thread
safe and have no side effects. This means that the only thing it can
safely do is copy entries to the other temporary buffer.

In addition, careful checking reveals that the 'classical' solver
doesn't actually add springs, so reduce isn't needed there.

Differential Revision: https://developer.blender.org/D9632
2020-11-25 22:31:47 +03:00
8330e19cb2 RNA Armature: Improve the description of AxisRollFromMatrix
The roll value may not be as expected when a matrix is not orthogonal
or has a negative determinant.

This can lead to confusion as seen in T82930.

Therefore, make it clear that this is a limitation and that a value for
the roll is somewhat indeterminable in these cases.

This fixes T82930
2020-11-25 13:55:05 -03:00
f67f895770 GPencil: Disable vertex color when use holdout
If the material has the holdout enabled, the value of the vertex color must not be used.
2020-11-25 16:01:30 +01:00
436fd5663e Fix T82988: Div by zero with curve deform modifier
In `calc_curve_deform` a factor is calculated without checking if
the divisior is zero or close to zero. This patch adds the missing
checks and sets the factor to zero if the division shouldn't be
computed.

Reviewed By: mont29

Differential Revision: https://developer.blender.org/D9645
2020-11-25 15:18:18 +01:00
4a179e8e3e Atomics: Fix missing 64bit implementation for 32bit platforms
Blender uses 64bit atomics to manipulate SessionUUID, and these atomics
were not defined on any of 32bit platforms.

While official support is limited to 64bit platforms only, the code
should not make assumptions about bitness or endianess, in terms that
there should be codepaths and fallback (or provision of them) for 32bit
platforms.

This change makes 64bit atomic functions defined for all platforms.
The atomic_test was compiled and successfully tested on i686 and armv7l
platforms. The rest of compilation process of Blender will be very
tedious, so that was not done.

This change is essential, but not necessarily enough to make Blender
compilable on i686 (ability to compile Blender on 32bit platforms was
lost during the 2.91 development).

This is a functional part of original fix done by Brecht in D9577.
2020-11-25 12:43:43 +01:00
4323886123 Atomics: Cleanup, move defines closer to usage
There is a special defines block needed for ARM on Linux. Move it from
public header to an implementation file.

No functional changes.

This is a non-functional part of original fix done by Brecht in D9577.
2020-11-25 12:43:43 +01:00
1c86d32fa7 Nodes: deduplicate ping pong math operation
The formula did not change. The only side effect of this change should be
that the compositor node now does not divide by zero in some cases.
2020-11-25 12:24:44 +01:00
9e77fc533c Cleanup: remove useless cast. 2020-11-25 11:19:28 +01:00
b1533f8fa4 Tracking: Cleanup, de-duplicate implementation of marker lookup
The logic was duplicated.

Should be no functional changes. The modified function is expected
to give same exact results for all inputs.

On the "caching last-used track" topic. The code was using last_marker
to allow faster lookup of marker closest to the frame. With this
change it is still the case since the BKE_tracking_marker_get() does
cache last used marker.
2020-11-25 09:37:24 +01:00
e922dd7d8a Viewport: cannot select object by clicking on its instances
Selecting an object by clicking on its instances only worked,
when the object itself is visible. However, it is possible to hide
the object and still keep the instances visible.

The solution is to give every object the correct `select_id` in the
depsgraph object iterator right before rendering.

Reviewers: fclem, brecht

Differential Revision: https://developer.blender.org/D9640
2020-11-24 17:32:56 +01:00
256a9d983d Merge remote-tracking branch 'origin/blender-v2.91-release' 2020-11-24 16:05:58 +01:00
278011e44d Fix T80748: Render Emissive Colors in Compositor Backdrop
This change will use the image engine to draw the backdrop of the compositor. With this patch the alpha blending will be done in Linear Scene Reference space and shows pure emissive colors.

See differential for an example image.

**Technical changes**

As only the backdrop drawing is done using the draw manager there are some technical changes.
1. The overlay buffer is partly drawn outside the draw manager. When drawing the backdrop image the overlay buffer needs to be masked to simulate premultiplied alpha under.
2. The backdrop of the node editor is done in region pixel space. A `DRWView` is constructed with this space.
3. UDIM textures uses world position to generate the UV coordinates. This has been implemented more strict by the `IMAGE_DRAW_FLAG_USE_WORLD_POS`. When the flag isn't used the local coordinates are used to generate the UV coordinates what is image space.
4. The draw manager now checks the actual `eSpaceType` of the space data to use different code paths. In the future the movie clip editor will be added.

NOTE: The preview images in nodes are drawn in display space and cannot show pure emissive colors. As preview images are used on more locations it is best to fix this in a separate patch.

Reviewed By: Clément Foucault

Differential Revision: https://developer.blender.org/D9451
2020-11-24 13:22:17 +01:00
82cc21d5e4 Fix T77261: Multires creates spikes when subdividing ngons
The spikes were caused by non-initialized tangent matrix used during
smoothing process. The reason tangent matrix was not initialized was
because wrong usage of API: n-gons should pass corner of 0 to the
matrix construction function.

Corrected usage of the API and added assert() to help catching such
kind of non-initialized issues easier.
2020-11-24 12:40:42 +01:00
31bf8307af Graph Editor: fix keyframe not activating in certain cases
When clicking on an already-selected keyframe, mark it as active if the
click caused the previously-active keyframe to become deselected.

When clicking on a key in the graph editor, it is selected and all other
keys are deselected. If that key was already selected before the click,
it would not become the active keyframe. This is now fixed.

Reviewed by: Severin

Differential Revision: https://developer.blender.org/D9639
2020-11-24 12:27:43 +01:00
bb5c4de009 Fix T82962: Crash changing lattice resolution with Vertex Group
Regression introduced by {rB042143440d76}. The deform group lookup was
performed on the wrong object. Before the lookup was performed on
the lattice object. This patch changes this back.

Reviewed By: Bastien Montagne

Differential Revision: https://developer.blender.org/D9638
2020-11-24 11:46:38 +01:00
aca8eadb63 Animation: Remove debug prints
Remove accidentally-commited debug prints.

No functional changes.

Reviewed by: sergey

Differential Revision: https://developer.blender.org/D9637
2020-11-24 11:13:43 +01:00
e74f61b49a Fix Python API docs for the render API
The API doc for free_blender_memory() was used in
get_preview_pixel_size()

Issue introduced in 5494683651.
2020-11-24 10:42:28 +01:00
037ce662e5 Outliner: Switch properties tabs only on icon click
According to feedback the outliner to properties editor tab switching
was annoying when it always changed tabs on selection, especially for
selecting individual objects. This limits the tab switching behavior to
only when the icons in the outliner are selected.
2020-11-23 22:21:02 -07:00
Yevgeny Makarov
d86fcde39c UI: Batch Rename Layout Improvements
Improvements to the layout of the Batch Rename dialog.

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

Reviewed by Reviewed by Hans Goudey
2020-11-23 17:27:01 -08:00
Yevgeny Makarov
df31ecf0c3 UI: Add Trackpad Smooth Scrolling for Popovers
Adds smooth scrolling with the trackpad for popovers. Also fixes the position of the scroll arrows on high-DPI.

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

Reviewed by Brecht Van Lommel
2020-11-23 17:22:20 -08:00
Yevgeny Makarov
b6a50b5dcb UI: Block Safety Not Scaled Correctly
Layout block safety sizes were not scaled correctly with interface scale.

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

Reviewed by Brecht Van Lommel
2020-11-23 16:56:01 -08:00
246c11634f Speedups for new boolean. Better hash function for verts.
The existing hash function didn't work well with Set's method of
masking to the lower bits, because many verts have zeros in the
lower bits.
Also, replaced VectorSet with Set for Vert deduping.
2020-11-23 19:30:40 -05:00
Jeroen Bakker
b0a9081883 Fix T82884: Cycles Compilation Error OpenCL/NanoVDB
Recent changes introduced `acc` parameter into the texture read
functions. When nanovdb isn't enabled this leads to compilation errors
as the `acc` variable wasn't defined. OpenCL only compiles needed
features what made it more prominent.

Reviewed By: Patrick Mours

Differential Revision: https://developer.blender.org/D9629
2020-11-23 16:42:48 +01:00
Jeroen Bakker
8351760ed0 Cycles: Remove Compilation Warning
ROCm 3.9 already defined `NULL`. This patch will first check if it was
already defined to remove compilation warnings.

NOTE: This doesn't add official support for ROCm as it still fails to
render correctly (crashes with default cube).

Reviewed By: Brecht van Lommel

Differential Revision: https://developer.blender.org/D9610
2020-11-23 16:36:15 +01:00
Christoph Lendenfeld
1f09dcc121 Cleanup: Animation, split graph_edit.c into separate files
Split some of the code of `graph_edit.c` into:
* `graph_view.c`: preview range, view all, view selected etc.
* `graph_slider_ops.c`: the decimate modal operator code.

The latter file will be extended later with more slider-based operators.

Maniphest Tasks: T81785

Reviewed By: sybren

Differential Revision: https://developer.blender.org/D9312
2020-11-23 15:26:54 +01:00
152754a477 Tracking: Cleanup, typos and spelling in DNA comments 2020-11-23 15:25:55 +01:00
e4ca1fc4ea Animation: New Euler filter implementation
This new discontinuity filter performs actions on the entire Euler
rotation, rather than only on the individual X/Y/Z channels. This makes
it fix a wider range of discontinuities, for example those in T52744.

The filter now runs twice on the selected channels, in this order:
- New: Convert X+Y+Z rotation to matrix, then back to Euler angles.
- Old: Add/remove factors of 360° to minimize jumps.

The messaging is streamlined; it now reports how many channels were
filtered, and only warns (instead of errors) when there was an actual
problem with the selected channels (like selecting three or more
channels, but without X/Y/Z triplet).

A new kernel function `BKE_fcurve_keyframe_move_value_with_handles()` is
introduced, to make it possible to move a keyframe's value and move its
handles at the same time.

Manifest Task: T52744

Reviewed By: looch

Differential Revision: https://developer.blender.org/D9602
2020-11-23 12:48:04 +01:00
1318eaf166 Cleanup: CMake: use string(APPEND..), not set(..)
Left out in {rB7f28a99dd5a57216fb477d844ae1fec5510ad5d5}
2020-11-23 16:34:17 +05:30
36426b0a68 CMake/macOS: Replace -Xlinker with -Wl.
Causes link issues on Xcode's "New Build System" which was introduced
in Xcode 10 and is default on Xcode 12.
https://devtalk.blender.org/t/16273

Differential Revision: https://developer.blender.org/D9624
Reviewed by: brecht, #platform_macos
2020-11-23 16:34:17 +05:30
64513df8b6 Fix T82849: Assert When Unlinking "Edit Source" Text Data-block.
Simplify and sanitize handling of usercounts for Text IDs generated
trhough `BKE_text_load_ex`.
2020-11-23 11:56:40 +01:00
401612b8e1 Tracking: Cover markers access with basic tests
Just a beginning of tests coverage, related on the planned upcoming
development.
2020-11-23 09:23:19 +01:00
1e0ff6b723 Tracking: Cleanup, make units explicit in new track creation 2020-11-23 09:23:19 +01:00
6d314c940e Tracking: Cleanup, clarify comments in tracking settings
Make unit more explicit.

Ideally would be "embedded" into the field name itself, but this will be
more involved change.
2020-11-23 09:23:19 +01:00
2ee5bc33ea Tracking: Refactor, move track allocation to helper function
The caller is still responsible for allocating list of markers,
but the track allocation and initialization can now be reused.

Currently no functional changes, preparing for an upcoming
development.
2020-11-23 09:23:19 +01:00
7bab87c119 Fix T82918: File menu "Save Copy" shows "Save As" in File Browser
Use a dynamic name/description based on the set properties. This makes it more
clear what's going on and avoids confusion, as explained in the report.
2020-11-22 19:21:30 +01:00
4c01fbb564 Cleanup: Use const arguments in curve bevel
This makes it clear that only the final "r_data" is being changed.
Also rename a variable to be less vague.
2020-11-22 12:11:15 -05:00
b11d409ac4 Cleanup: Improve readability of curve displist building
Just a few minor improvements: declare variables where they are
initialized, decrease scope, expand some variable names, and use
LISTBASE_FOREACH.
2020-11-22 11:47:37 -05:00
1cc3a0e2cf Cleanup: Reduce indentation
Having up to nine levels of indentation make this function hard to
follow. Instead of indenting the rest of the loop for a simple special
case, just continue.
2020-11-22 11:25:10 -05:00
0f3ca3f4bc Fix unclear tooltip for the Affect Transform option of constraints. 2020-11-22 13:33:27 +03:00
d25e116889 Previous commit forgot to guard some things with #ifdef WITH_GMP. 2020-11-21 22:44:35 -05:00
df8cc5662b Improve speed of Constrained Delaunay Triangulation with exact arith.
By using floating point filters, the speed improves by a factor of 2 to 10.
This will help speed up some cases of the Exact Boolean modifier.
Changed the interface of mpq2::isect_seg_seg to not return mu, as it was
not needed and not calculating it saved 15% time.
2020-11-21 11:55:14 -05:00
38fe962d95 Merge branch 'blender-v2.91-release' 2020-11-21 14:18:12 +01:00
6c6a5a72c2 GPencil: Fix unreported assert when use select Box in single point strokes
The assert was when use segment selection mode.
2020-11-21 14:17:26 +01:00
0eb096f406 Cleanup: Declare variables where initialized
Reduce variable scope, and in a few cases, use bool instead of int.
2020-11-20 21:54:52 -05:00
c850ce93a4 Fix wireframe opacity creating artifacts on sculpt overlay edges
When lowering the wireframe opacity with sculpt overlays enabled, the
wireframe overlay was creating white artifacts along the edges.

Reviewed By: fclem

Differential Revision: https://developer.blender.org/D9607
2020-11-20 18:02:07 +01:00
cec22ba8db Cleanup: Use LISTBASE_FOREACH macro 2020-11-20 11:00:51 -05:00
05ef031f37 UI: Remove excess row spacing in outliner popover
Some checkboxes had nonessential spacing between rows which made the
popover taller than needed.
2020-11-20 08:55:27 -07:00
2afdb4ba87 Outliner: Object state filter invert toggle
This adds an invert toggle for the outliner object state filters.
There are some cases where we want a filter for invertable states (Selected,
Unselected) and having a single toggle to invert the filter reduces the
number of separate filter types needed. This removes the "Hidden" filter
which can now be replicated with an inverted "Visible" filter.

Differential Revision: https://developer.blender.org/D9598
2020-11-20 08:47:51 -07:00
96995b2343 Fix (unreported) bug in liboverride diffing code for collection item insertion.
In case we do not use names, code adding new insert operations in
collections was broken.

Not a proble in practice so far, since this case was not yet in use, but
will be soon with NLA overrides.
2020-11-20 11:41:15 +01:00
07db110add Fix T82493: PyDoc generation throws exception on exit
Since add-ons now unregister on exit
(as of fa566157a5)
clearing functions in `bpy.app.handlers` caused an error on exit.

Resolve by restoring handlers before exiting.
2020-11-20 18:59:59 +11:00
056c9de30d Merge branch 'blender-v2.91-release' 2020-11-20 08:57:58 +01:00
93850c74c1 Fix add-object cursor plane failing to update on zoom
Zoom with an orthographic view wasn't refreshing the preview plane.
2020-11-20 17:32:09 +11:00
1501c3adad Add Object Tool: support placing objects in orthographic axis views
When an projecting onto a plane that is orthogonal to the views Z axis,
project onto a view aligned axis then map it back to the original plane.
see: ED_view3d_win_to_3d_on_plane_with_fallback

Since the depth can't be properly visualized in 3D, display a 2D so
it's possible to to tell the depth from the cursor motion.
2020-11-20 17:15:18 +11:00
a8f4affb2e Add Object Tool: use the closest view-aligned axis as a fallback
When using surface orientation and nothing is under the mouse-cursor,
pick the axis that's closest to the view's Z axis.

Now by default default, drawing into empty spaces wont use a plane
orthogonal to the view.
2020-11-20 16:45:06 +11:00
a1120892b0 UI: Fix panel drag icon added to redo panel
Error in cleanup commit 0d93bd8d63. Currently floating panels
cannot be dragged, so the widget should not be displayed.
2020-11-19 20:43:10 -05:00
5b34d11b55 Fix add-object tools cursor distorted drawing on save
Generating the thumbnail left the view matrices set to values
that couldn't be used for cursor drawing.

Backup/restore the matrices for off-screen drawing.
2020-11-20 12:15:04 +11:00
f0b75cc19d Cleanup: use a struct to backup/restore values for offscreen drawing
Variables to temporarily override values was scattered,
making it harder to follow.
2020-11-20 12:15:04 +11:00
cf780e0f67 Cleanup: remove unused off-screen drawing struct 2020-11-20 12:14:50 +11:00
f166fa67b7 Cleanup: rename do_sky argument to draw_background
This was leftover from Blender internal, follow the naming
already used by the draw manager.
2020-11-20 12:14:50 +11:00
219c3aa653 Cleanup: remove unused perspective argument to off-screen drawing
Some callers were passing in dummy values, this can be accessed from
`RegionView3D.is_persp` can be used to check this.
2020-11-20 12:14:50 +11:00
25266caa45 Cleanup: spelling 2020-11-20 11:39:22 +11:00
5f1bb8da96 Cleanup: clang-format 2020-11-20 11:28:58 +11:00
Stefan Werner
fdd3032f8f Cycles: Fixed zero sized normals when certain attributes were missing.
The Normal Map node was falling back to (0, 0, 0) when it was missing
the required attributes to calculate a new normal.
(0, 0, 0) is not a valid normal and can lead to NaNs when it is
normalized later in the shader. Instead, we now return sd->N,
the unperturbed surface normal.
2020-11-19 23:15:09 +01:00
dca36a8ec9 Fix T82769: remove thread local data from PTCacheMem
The issue was that the same point cache was read by multiple
threads at the same time (the same object was evaluated for
render and for the viewport).
Both threads incremented PTCacheMem->cur which lead to the crash.

The fix is to remove the PTCacheMem->cur and store it on the
stack instead. This way every thread has its own cur.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D9606
2020-11-19 19:09:24 +01:00
72a199e148 Atomic: Cover with unit tests
Cover all atomic functions with unit tests.

The tests are quite simple, nothing special so far. The goal is to:

- Make sure implementation exists.
- Implementation behaves the same way on all platforms
  (We had issue when MSVC and GCC were behaving differently in the
  past).
- Proper bitness is used for implementation and non-fixed-size
  function implementation.

The tests can be extended further to make sure, for example, that
CAS operations do not cast arguments to a more narrow type for
comparison. Considering it a possible further improvement, as it is
better be done being focused on that specific task.

There is an annoying ifdef around 64bit implementation, which uses
same internal ifdef as the header does. This check is aimed to be
removed, so is easier to simply accept such duplication for now.

The tests seems somewhat duplicate for signed/unsigned variants and
things like this. The reason for that is to keep test code as simple
as possible: attempting to do something smart/tricky in the test code
often causes the test code to be a subject of being covered with its
own unit tests.

Differential Revision: https://developer.blender.org/D9590
2020-11-19 17:19:48 +01:00
0d027b4583 Fix RNA not giving error with invalid identifiers for collection properties 2020-11-19 16:29:29 +01:00
a44bb8603e Guarded allocator: Fix lock-free allocator tests
Previously the lock-free tests were actually testing guarded allocator
because the main entry point of tests was switching allocator to the
guarded one.

There seems to be no allocations happening between the initialization
sequence and the fixture's SetUp(), so easiest seems to be just to
switch to lockfree implementation in the fixture's SetUp().

The test are passing locally, so the "should work" has high chance
of actually being truth :)

Differential Revision: https://developer.blender.org/D9584
2020-11-19 16:17:48 +01:00
39ec64b13d Guarded allocator: Add safety around type change
While it might not cover all possible abuse of API, it does provide
basic checks against most obvious usage mistakes.
2020-11-19 16:17:48 +01:00
4a8cf9d182 Guarded allocator: Add explicit switch to the lockfree implementation
Previously the only way to use lockfree implementation was to start
executable and never switch to guarded allocator.

Surely, it is not possible to switch implementation once any allocation
did happen, but some tests are desired to test lock-free implementation
of the allocator. Those tests did not operate properly because the main
entry point of tests are forcing guarded allocator to help catching
bugs.

This change makes it possible for those tests to ensure they do operate
on lock-free implementation.

There is no functional changes here, preparing boilerplate for an
upcoming work on the allocator tests themselves.
2020-11-19 16:17:48 +01:00
42b2ae5f69 Fix lost node links when linked node group datablock is temporarily missing
Don't refresh the list of sockets, so that when the .blend file is restored the
links remain valid. Also display such nodes in red to indicate an error, same
as when the node type info is missing.
2020-11-19 15:55:05 +01:00
c5306dd0cd Merge branch 'blender-v2.91-release' 2020-11-20 01:41:17 +11:00
e01bf7a92e Fix T82540: Smart UV project ignores seams
The seam check was missed in 9296ba8674
which calculates islands from the BMesh.
2020-11-20 01:35:26 +11:00
ad4b7741db Build-system: Force C linkage for all DNA type headers
Some DNA headers already did this, most did not. Even though many of them would
be included in C++ files and thus compiled as C++. This would be confusing and
developers may think they have to add `extern "C"` too a whole lot of
(indirect) includes to be able to use a C header in C++.

However, this is a misconception.
`extern "C"` does not cause code to be compiled with C rather than C++! It only
causes the linker to not use C++ function name mangling. See
https://stackoverflow.com/a/1041880.
Because extern DNA headers don't have function declarations, using `extern "C"`
actually should not have any effect. On the other hand, adding it causes no
harm and avoids confusion. So let's just have it consistently in C header
files.

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

Reviewed by: Bastien Montagne, Sybren Stüvel
2020-11-19 13:41:50 +01:00
1395ba70bf Fix crash when adding strip using RNA API call
Don't allocate StripElem for movieclip, scene and mask strips. This
struct is not handled in seq_dupli function. This caused field to be
uninitialized in COW datablock.

StripElem is not allocated when adding strip with operator and it is
not needed for these strip types.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9600
2020-11-19 13:10:42 +01:00
abe95fbdff Cleanup: refactor sequencer_edit.c file
Move RNA enums and utility functions closer to operator definition.

No functional changes.
2020-11-19 13:04:17 +01:00
af7af488d4 Cleanup: Animation, fix uninitialised variable in Euler filter code
No functional changes.
2020-11-19 13:02:13 +01:00
226feb52ec Cleanup: Animation, refactor Euler filter
Split up the Euler filter function into two more functions. The Euler
filter operator works in two stages (find channels that define the X/Y/Z
Euler rotations, and perform filtering on those channels), and each
stage now has its own function. This makes it clearer which data are
used in which part of the code, and makes future improvements easier.

No functional changes.
2020-11-19 12:57:29 +01:00
b5e85321dc Docs: document bmesh.utils.vert_collapse_faces join_faces argument 2020-11-19 22:18:47 +11:00
fd88246d61 Fix error message prefix in Quaternion.to_euler()
Fix copy-paste error of error message prefix, so that the Quaternion
function no longer says it's a Matrix function error.
2020-11-19 11:26:54 +01:00
ae64898147 Cleanup: fix bad comment separator
Replace `* /` with `*/` to actually end the comment. As it was, the code
compiled but caused an "`/*` in comment" warning.

No functional changes.
2020-11-19 11:04:30 +01:00
71c6c95aec Merge remote-tracking branch 'origin/blender-v2.91-release' 2020-11-19 10:43:46 +01:00
256e77c987 Fix T82833: GreasePencil crash when changing to Vertex Color mode
This is actually a user interface issue, introduced on 0688309988.

but->tip is checked for NULL in other parts, and rightly so, since here
it crashes Blender.

On a side note I don't know how to reliably reproduce the original bug
whose fix introduced this issue. That got on the way of seeing whether
this is the correct fix, if it happens outside greasepencil operators.

Maybe it is an operator that is missing a tooltip? Impossible to tell
without more information from said commit. That said since this happened
during the end of bcon3 and we are not in bcon4 I'm going ahead with
this NULL check commit.

Patch reviewed by Philipp Oeser and Sergey Sharybin.
2020-11-19 10:33:08 +01:00
e5df87b1b9 Cleanup: split sequencer_edit.c file
Move proxy operator functions to own file.

No functional changes.
2020-11-19 09:54:40 +01:00
8ec6b34b8e VSE: Move split operator logic to module code
Code was rewritten to work on per-sequence basis returning reference to
created strip.

There should be no functional changes.

Selection logic is left as is for now. I could simplify it, but it
belongs to operator, not split logic.

Reviewed By: sergey

Differential Revision: developer.blender.org/D9592
2020-11-19 05:31:40 +01:00
9d6d5b9beb Fix T82445: Wintab packets being discarded.
Switched timer to use GetTickCount instead of QueryPerformanceCounter
as Wintab's pkTime seems to (but is not guaranteed to) use the former.
2020-11-18 14:29:51 -08:00
e9ddb21df3 Cleanup: Grammar: "Allow to" vs gerund missed in last commit 2020-11-18 16:31:26 -05:00
8f30a88e63 Cleanup: Grammar: "Allow to" vs gerund
In cases where "Allow" is followed by an infinitive, a noun needs
to directly follow it. But it makes more sense to follow it with a
gerund instead.
2020-11-18 16:14:48 -05:00
038828f49a Fix: Sub-panel backdrop sometimes draws when closed
My last cleanup commit for this function missed this case. It likely
happens because the panel's block size doesn't update properly somewhere.
Short of investigating that right now, it makes sense to return early
in this case anyway.
2020-11-18 15:54:41 -05:00
e9607f45d8 GPencil: Automerge last drawn stroke with previous strokes
This option joins any stroke with an end near  the actual stroke. Now it is not limited to the last stroke, any stroke in the same layer for the actual frame can be joined. The join can join two strokes drawing a third stroke.

If the end and the start of the result stroke are very small, the stroke is changed to be cyclic automatically.

There is a limit distance to join the stroke, if the distance is greater than this value, the strokes are not joined. Actually, a constant, threshold distance is used, but we could expose 
as a parameter in the UI in the future.

The tool can be used with freehand drawing or with primitives.

Note: Great part of the patch is just a refactor of the old code to make it accessible and to keep code organized.

Reviewed By: mendio

Maniphest Tasks: T82377

Differential Revision: https://developer.blender.org/D9440
2020-11-18 21:35:06 +01:00
c126e27cdc Cleanup: Move function to proper section 2020-11-18 15:16:17 -05:00
0d93bd8d63 UI Code Quality: Refactor panel drawing function
The existing panel drawing function was a bit convoluted with dependent
conditions in different scopes, redundant and unecessary computations,
and un-helpful naming.

This commit separates the function into two parts, the backdrop and the
widgets. It also improves naming and uses const where possible, and in
general cleans up the code.

There are some slight visual changes, mostly with the placement of the
drag icon, which moves a bit downward to be centered with the triangle
icon. The black rectangle displayed while dragging is also removed.
2020-11-18 15:14:11 -05:00
ad58999b0d Fix pin icon in Properties not right-aligned after zooming
The logic for separator-spacers (used here for right-alignment) didn't take
region scaling into account. Usually that's not an issue because they are
otherwise only used in headers which can't zoom.
2020-11-18 19:54:35 +01:00
d6d7965307 Fix pin icon in Properties not right-aligned after zooming
The logic for separator-spacers (used here for right-alignment) didn't take
region scaling into account. Usually that's not an issue because they are
otherwise only used in headers which can't zoom.
2020-11-18 19:49:20 +01:00
56ef6fdb9e Merge branch 'blender-v2.91-release' 2020-11-18 08:19:37 -07:00
9a8f5022b7 Fix: Outliner hierarchy line width variations
During some operators like rotate in grease pencil edit mode the
hierarchy lines in the outliner would draw twice as thick. Set the width
before drawing the lines in the outliner.

Differential Revision: https://developer.blender.org/D9589
2020-11-18 08:17:42 -07:00
898231fdbc Fix transform redo panel showing only the first custom orientation
The error was introduced in rBf470a02afaea, but the problem is in
`ED_transform_calc_orientation_from_type_ex`
2020-11-18 11:57:08 -03:00
20f8130d6f Fix T82777: Some transform modes using incorrect default orientation
Some modes were always using `"Global"` orientation as the default.
2020-11-18 11:57:08 -03:00
466cd2535b Fix exact boolean coplanar problem due to inexact transform.
This is an addendum to previous boolean fix, where the object
transformation was "cleaned". Now the operand one is too.
This fixes the issue shown in the video in T82301 when you move
a column around the XY plane with the top and bottom faces
supposedly coplanar with a cube. The transformation matrix when
you do that has a tiny offset in the z component.
2020-11-18 09:56:20 -05:00
957f14a689 Merge branch 'blender-v2.91-release' 2020-11-18 15:39:43 +01:00
4edaa796d3 Fluid: Revert changes from T82488
Scaling of forces needs more work. Before making changes to them it would be nice to have a setup, that works physically correct across multiple modifiers (cloth, rigid bodies, fluid).

This will be a to do for 2.92.
2020-11-18 15:38:00 +01:00
f132d74c7d Merge branch 'blender-v2.91-release' 2020-11-18 14:26:01 +01:00
549a1cac88 Fix T82810: UV Editor, Crash with switching between single image and UDIM tile
Active tile could be NULL when it was on the second tile before
switching back and forth between the Image/UDIM.

In the future we might also check that the active_tile_index is always
valid.
2020-11-18 13:12:19 +01:00
4b55abc335 Fix T82586: Sculpt normals not updating with EEVEE enabled
The root cause of this bug is that the function that updates the PBVH
normals is drw_sculpt_generate_calls. As now both the overlays and
mesh can be drawn without using pbvh drawing, the normals were not
updating. This patch forces a normals updates also in the no PBVH
drawing code path of the overlays. This was affecting both shading and
sculpt surface sampling in both flat and smooth shading modes.

Having the sculpt normals being updated by the drawing code is a wrong
design which also causes other issues like:

    Brushes that sample the surface and do multiple stroke steps between

redraws will sample invalid normals, creating artifacts during the
stroke clearly visible in some brushes.

    Brushes that do not need to sample the surface update the normals on

each redraw. This affects performance a lot as in some cases, updating the
normals takes more time than doing the brush deformation. If flat shading
is being used, this is only necessary to do once after the stroke ends.

Reviewed By: fclem
Differential Revision: https://developer.blender.org/D9535
2020-11-18 12:20:57 +01:00
d2cddb1fda Merge branch 'blender-v2.91-release' 2020-11-18 16:43:01 +11:00
dfa2b0e1c9 Fix T82800: Changing settings from a pie menu doesn't add undo steps
Pie menu had inconsistent behavior for dragging & releasing the key
compared to clicking on the button.

This was caused by the `onfree` argument being set to true,
preventing the button from running callbacks such as setting
up undo data & auto-keyframe

This argument should only be used when freeing the button,
set this to false as is done for regular menus.
2020-11-18 16:40:48 +11:00
8b8328fbfc Merge branch 'blender-v2.91-release' 2020-11-18 15:13:26 +11:00
0688309988 Fix undo UI text containing shortcuts & newlines
- Shortcuts were being shown in the undo history.
- Multi-line tool-tips now only use the first line.
2020-11-18 15:10:51 +11:00
80a701c4e6 Merge branch 'blender-v2.91-release' 2020-11-17 19:55:49 -07:00
a352baccc3 Fix grease pencil draw mode icon color in outliner
ICON_GREASEPENCIL was defined as an object data icon when it was used as
a mode icon. This caused it to draw green in the outliner.
2020-11-17 19:51:14 -07:00
a3833abe2c Fix wrong grease pencil datablock icon in file browser
The datablock shown in the file browser was the draw mode icon rather
than the datablock icon.
2020-11-17 19:49:28 -07:00
bbdfeb751e Cleanup: remove break after return statements 2020-11-18 13:36:30 +11:00
88512646c0 Cleanup: clarify precedence of operations 2020-11-18 13:36:26 +11:00
d13edeaed4 Cleanup: 'false' use as NULL pointer 2020-11-18 13:19:53 +11:00
eb2c26bd38 Fix use of operator flag as boolean
Error in cb9de95d61
2020-11-18 13:13:52 +11:00
2485ee997b Cleanup: use descriptive argument name for uv parametrizer 2020-11-18 12:59:39 +11:00
ec6e88d4b2 Cleanup: simplify array usage for Python box packing API 2020-11-18 12:50:44 +11:00
75a4872c90 Cleanup: declare original function storage variables static
Also minor comment formatting changes.
2020-11-18 12:44:08 +11:00
3e325c35f8 Merge branch 'blender-v2.91-release' 2020-11-17 23:10:13 +01:00
e580c18853 Fix T82542: Boundary brush crash with dyntopo
This brush needs to be disabled for dyntopo as it stores its custom data
and deforms from original coordiantes.

Reviewed By: sergey

Maniphest Tasks: T82542

Differential Revision: https://developer.blender.org/D9516
2020-11-17 23:01:33 +01:00
9b20bbc3bf LibOverride: PointCache: Add UI feedback about need to enable Disk Cache.
Note that I chose to modify the label of the main `Bake` button instead
of adding an extra label line, as that would disturb the UI in a
annoying way.
2020-11-17 21:33:28 +01:00
df2bf164c7 Cleanup: Use LISTBASE_FOREACH macro 2020-11-17 13:00:43 -05:00
da6c968a95 Cleanup: Clang tidy else after return 2020-11-17 12:58:26 -05:00
7d23dd4430 Cleanup: Clang tidy inconsistent parameter name 2020-11-17 12:57:35 -05:00
75dbbaeda6 Merge branch 'blender-v2.91-release' 2020-11-17 17:39:47 +01:00
22161b6451 Cleanup: Fix incorrect RNA property label/tooltip re active NLA track.
The joys of copy/paste again.
2020-11-17 17:39:08 +01:00
ea7aae88cf Cleanup: Remove unecessary NULL check
Panels for active uiBlocks always have a type, because the process that
makes them uses the types. Add an assert just to make it clear that the
assumption is purposeful.
2020-11-17 10:28:57 -05:00
d952d1792a Merge branch 'blender-v2.91-release' 2020-11-17 10:17:00 -05:00
Jeroen Bakker
d73130cc28 Fix T82770: Artifacts when painting on generated transparent image
Regression introduced by {b17cca6966}. When centralizing the gpu texture
premultiplication setting it was assumed that generated images
(`IMA_TYPE_UV_TEST`) were stored as premultiplied. That assumption was
totally wrong as the alpha association is determined by the existing of
the float/byte buffer.

NOTE: This change will render generated images with pure emissive
colors (show colors when alpha=0.0) what might add more reports. Any
reports could be merged in the next report {T82790}.

Reviewed By: Clément Foucault, Philipp Oeser

Differential Revision: https://developer.blender.org/D9585
2020-11-17 16:10:42 +01:00
cc0b8cb359 Fix T82341: Warning in terminal during property search
After recent changes to the context panel layout (rB187cc5e26d28b1a8),
there has been an error printed when running propery search:

> Error: separator_spacer() not supported in popups.

The layout code thinks it's drawing in a menu because region->visible
isn't properly set for the other tab searches. This patch sets that field
for the temporary searching region, but it also disables searching in the
context breadcrumbs panel, because at best this will just give results
for the names of the active object, etc. This isn't helpful since
those labels are mostly in every tab anyway.

Differential Revision: https://developer.blender.org/D9425
2020-11-17 10:08:39 -05:00
0724fabcf5 Fix T81227: Modifier menu and text switch places
Logic was incorrect, mistake in f3b8792b96.

Updated comment to make intent more clear.

Same as fd78f8699e, but needed conflict resolution as the panel-type
flags where renamed in master.
2020-11-17 15:58:05 +01:00
dede4aac5b Fix T77561 EEVEE: Refraction BSDF is using world probe during glossy bake
This fixes light leaking during baking indoor environment when using
refraction bsdfs.
2020-11-17 15:56:24 +01:00
fd78f8699e Fix T81227: Modifier menu and text switch places
Logic was incorrect, mistake in f3b8792b96.

Updated comment to make intent more clear.
2020-11-17 15:31:50 +01:00
c12664a37f Merge branch 'blender-v2.91-release' 2020-11-18 00:27:40 +11:00
9d716b929d Merge branch 'blender-v2.91-release' 2020-11-18 00:27:36 +11:00
90e516d1a5 Merge branch 'blender-v2.91-release' 2020-11-18 00:27:33 +11:00
71def9738e Merge branch 'blender-v2.91-release' 2020-11-18 00:27:29 +11:00
9296ba8674 Fix T82637: pack UV islands fails with some non-manifold meshes
Edges with 3 or more connected UV's caused UV pack to fail.

Instead of using functions from uvedit_parametrizer.c which are intended
specifically for ABF/LSCM unwrapping, use a simpler method for packing
which stores arrays of BMesh faces.
2020-11-18 00:25:30 +11:00
a993600323 BMesh: support for comparing loops when calculating face-groups
Add an optional callback to check source/destination loops for
BM_mesh_calc_face_groups.

This is needed so it can be used to calculate UV islands.
2020-11-18 00:02:54 +11:00
6694d7ac5f BMesh: add UV face transform and minmax utility functions 2020-11-17 23:57:16 +11:00
7785a9c9d2 BLI_rect: add a float version of the 'pad' function 2020-11-17 23:57:16 +11:00
03ad2958d3 Merge branch 'blender-v2.91-release' 2020-11-17 13:12:21 +01:00
1e1c39fc89 Fix T82064: Add Image Clone tool to overlay engine
The clone tool in the image editor can show a second texture on top
of the image. This wasn't ported and now results into alpha and depth
issues. This fix adds the clone tool drawing to the overlay engine.

Reviewed By: Clément Foucault

Differential Revision: https://developer.blender.org/D9352
2020-11-17 13:10:39 +01:00
Ankit Meel
88de58fd1a Clang-tidy, fix bugprone-exception-escape.
Remove redundant call to `ofstream::close()` from `~PSStrokeRenderer`
and `~TextStrokeRenderer`. ofstream will be destructed automatically.

- For `~Depsgraph`, `std::function`'s constructor can throw.
- Passing throwing statements in the lambda will not be detected by
  clang-tidy.
Fix these issues by using lambda as function argument.

Reviewed By: sergey, sybren
Differential Revision: https://developer.blender.org/D9497
2020-11-17 17:33:25 +05:30
417224a31b Merge branch 'blender-v2.91-release' 2020-11-17 13:02:30 +01:00
8b6ce77f16 VSE: Fix prefetch initialization sequence
In 8d1978a8e0 bmain entry is updated when prefetching is started,
but this must be done before seq_prefetch_update_context(). Otherwise
created cache keys will be incorrect.

This happens immediately after prefetch is started. When it's refreshed
problem goes away.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9581
2020-11-17 13:00:00 +01:00
cd9ce01657 RNA define: check and report invalid usages of ID pointers properties.
Some RNA structs, like operators or keymaps, are not allowed to have ID
pointer properties. now this check will ignore those, and report an
error message in the console.

Related to T82597.

Notes: While a bit more involved than rBf39fbb3e6046, this commit
remains fairly localized and non-intrusive.

It relies on some rather obscure and weird behaviors of our RNA code
though, a cleaner solution could be e.g. to add a tye to
`StructOrFunctionRNA`, so that we could properly 'rebuild' (re-cast) the
pointer to either `StructRNA` or `FunctionRNA` when needed in internal
code...
2020-11-17 12:56:26 +01:00
a25bc79633 Merge remote-tracking branch 'origin/blender-v2.91-release' 2020-11-17 11:11:34 +01:00
Wayde Moss
709ceddab2 Fix T82774: NLA Sync Length Typo Fix
When offsetting strips to the left, to make space when syncing strip
length, move the preceding NLA strips instead of the succeeding strips.

The bug seems to be from a copy/pasting typo.

Reviewed By: sybren

Differential Revision: https://developer.blender.org/D9583
2020-11-17 11:01:28 +01:00
02efc0111c Fix T82588: Box Select selects keyframes hidden by "Only Show Selected"
Select only editable keys on selected curves when "Only Show Selected
Curves" is enabled in the Graph Editor's View menu.

This prevents selecting invisible keys with box, circle, and lasso
select in the Graph Editor.

Reviewed By: looch

Differential Revision: https://developer.blender.org/D9580
2020-11-17 10:58:40 +01:00
fb033341f9 Merge branch 'blender-v2.91-release' 2020-11-17 09:37:41 +01:00
2e1498ff16 Fix T82042: Crash when rendering huge images
Crash is related to the definition of the GL_MAX_TEXTURE_SIZE. OpenGL does not clearly
defined `GL_MAX_TEXTURE_SIZE` exactly means. Both on AMD and NVIDIA we have issues with
huge textures that they don't get created even if they are smaller. (See {D9530} for
research).

This patch will try to create the texture in a smaller size when the texture creation
failed.

Final implementation by: Clément Foucault

We should create a solution that doesn't need downscaling. For this specific case ARB_sparse_texture might help to create cleaner code, but you still have to commit the whole image what introduces several draw calls. Other improvement is to optimize the scaling; current implementation isn't optimized for performance.

Reviewed By: Clément Foucault

Differential Revision: https://developer.blender.org/D9524
2020-11-17 09:33:47 +01:00
797dfa6a0a Merge branch 'blender-v2.91-release'
Conflicts:
	source/blender/editors/render/render_opengl.c
	source/blender/sequencer/intern/effects.c
2020-11-17 04:10:51 +01:00
75bd286813 Fix T82703: Image not scaled when rendering
This is was caused by incorrectly set preview_render_size in VSE
rendering context. Value was set to SEQ_PROXY_RENDER_SIZE_FULL, but
it should be SEQ_PROXY_RENDER_SIZE_SCENE as scene render size is
being used.

This is same fix as 0d7036b40e, but I did not checked openGL
render pipeline.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9562
2020-11-17 03:56:53 +01:00
55be1dde5c Fix incorrect text size with downscaled preview
Use either scene render size or fixed preview scale factor.

Previously scene render size was used as baseline value for text size
correction. This is incorrect.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9563
2020-11-17 03:55:52 +01:00
4095835db1 Cycles: Fix compilation error and warning without OPENVDB 2020-11-17 01:31:33 +01:00
82b8c15684 Fix T81827: MacOS lines that should be thick are green instead
The issue was the use of alpha values of 0 when there were no blending
enabled.

This patch just disables the smoothing of the wires in this case.
2020-11-17 01:31:32 +01:00
09045ff64d Merge branch 'blender-v2.91-release' 2020-11-16 14:19:11 -07:00
906ff7b8fe Fix wrong collection icon in outliner popover
This icon was missed in rB0633a89e1827
2020-11-16 14:13:23 -07:00
1d4f3e2a26 Outliner: Collection icon color tweaks
The icons originally chosen for the collection colors were selected
during development and had a few issues with contrast in the light
theme, and the gray color was not a good choice against the default gray
backgrounds.

The new colors are more readable in both default Blender themes. Gray
was replaced with pink.

Differential Revision: https://developer.blender.org/D9504
2020-11-16 13:54:05 -07:00
96200110eb Fix T76699: Support macOS inbetween mouse/tablet.
Coalescing on macOS overwrites a singular unprocessed mouse event. To
receive all mouse and tablet events coalescing is disabled.

Disabling coalescing for macOS disables coalescing for trackpad
gestures. Repeat trackpad events are unnecessary and found to
negatively impact performance thus are re-coalesced in Window Manager.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D9574
2020-11-16 12:46:16 -08:00
5d13cb5c2a Merge branch 'blender-v2.91-release' 2020-11-16 19:30:37 +01:00
457d537fe4 Fix T82673: Cycles crash with zero emission strength and linked emission color 2020-11-16 19:29:59 +01:00
07bd8eab97 Fix unreported wireframe opacity color blending broken
This was introduced by rBdb7d8281c5a2.

The color needs to be premultiplied as there is no blend mode and
the output color is replacing the framebuffer color & alpha.
2020-11-16 18:31:43 +01:00
13ec512f4b Fix T81983: volume tiles missing in Cycles renders
The OpenVDB data structure can store voxel data in leaf nodes or tiles
when all the nodes in a given region have a constant value. However,
Cycles is using the leaf nodes to generate the acceleration structure
for computing volume intersections which did not include constant tiles.

To fix this, we simply voxelize all the active tiles prior to generating
the volume bounding mesh. As we are using a MaskGrid, this will not
allocate actual voxel buffers for each leaf, so the memory usage will be
kept low.

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

Reviewed by: brecht, JacquesLucke
2020-11-16 17:55:39 +01:00
328aad8c98 UI: Remove X axis panel dragging
X axis panel dragging traces back to Blender versions before 2.5,
where panels could be aligned horizontally. But for many years now
panels have been vertically aligned. Considering this, keeping the
X axis dragging around is a bit odd. It makes interaction confusing,
or at least more complicated. It also looks bad, since any part of
the panel outside the region is cropped.

Differential Revision: https://developer.blender.org/D9549
2020-11-16 11:47:11 -05:00
c1d8df47f6 Revert "RNA define: check and report invalid usages of ID pointers properties."
This reverts commit f39fbb3e60.

Code is not valid, `DefRNA.laststruct` does not always point to the
proper struct when defined from Python, need to be done differently.
2020-11-16 17:13:12 +01:00
c48063d1f6 Merge branch 'blender-v2.91-release' 2020-11-16 11:00:23 -05:00
13bcb000fa Fix broken pointcache on disk in some cases.
Root of the issue is that point caches are added to the object's list
on-demand, which often ends up with them being added only during
depsgraph evaluation, i.e. on COW objects.

This could result in having 'orig' data caches with invalid/unset stack
index at some points (e.g. when reading a file and applying
liboverrides), leading to discarding valid existing disk cache files.
Fact that one of those index is signed, and the other not, does not
help...

While this is very weak, fixing broken PointCache code is out of the
scope of a bug fix, so this patch merely:
* Simplifies and factorizes the code generating the 'extension' part of
  caches filenames;
* Ensures `BKE_object_insert_ptcache` is called when needed so that we
  always have a valid stack index to generate that filename extension.

This is only a bandaid, but it is simple and should be safe enough for
now.

Related to T82503.
2020-11-16 14:39:31 +01:00
97d52daf96 Fix (unreported) potential buffer overflow in PointCache code. 2020-11-16 14:39:31 +01:00
f39fbb3e60 RNA define: check and report invalid usages of ID pointers properties.
Some RNA structs, like operators or keymaps, are not allowed to have ID
pointer properties. now this check will ignore those, and report an
error message in the console.

Related to T82597.
2020-11-16 14:39:31 +01:00
b78bebb2af Merge remote-tracking branch 'origin/blender-v2.91-release' 2020-11-16 14:15:01 +01:00
62c4d0419c Merge branch 'blender-v2.91-release' 2020-11-16 13:23:59 +01:00
8b88739848 Merge branch 'blender-v2.91-release' into master 2020-11-16 12:55:50 +01:00
cb9f6dfebd Merge remote-tracking branch 'origin/blender-v2.91-release' 2020-11-16 12:23:05 +01:00
af013ff76f Cleanup: clang-tidy 2020-11-16 21:54:28 +11:00
8fd27c152a Correct T82753 Fix from 979fe4f1be 2020-11-16 18:27:11 +11:00
979fe4f1be Fix T82753: Crash using add-object tool when gizmos are disabled 2020-11-16 18:24:02 +11:00
64ab084ca5 Grease Pencil: adjust behavior of target object detection
First detect the other selected object, then check it can be written to.

Otherwise the target object could be the first one found when
looping over objects which is random from the user perspective.

Move the type check to the operator, which also checks the data isn't
library data which was being ignored.
2020-11-16 16:48:44 +11:00
a3a6d6a670 Cleanup: spelling 2020-11-16 16:48:41 +11:00
4eac03d821 Cleanup: clang-format 2020-11-16 16:48:19 +11:00
01db805a82 Cleanup: split sequencer.c file
Move most functions into separate files.

File sequencer.c is reserved for alloc, free and duplicating functions.

There should be no functional changes.
2020-11-16 05:02:30 +01:00
52a189936b Merge branch 'blender-v2.91-release'
Bring in exact boolean fix.
2020-11-15 20:26:14 -05:00
194a57fd63 Outliner: Fix memory errors in runtime data
Fix a heap-use-after-free when duplicating outliner editors, and fully
free runtime data when freeing outliner editors.
2020-11-14 14:24:40 -07:00
6ac5e0b3e8 GPencil: Missing initialization in previous commit 2020-11-14 15:21:20 +01:00
c2f76f1550 GPencil: Cleanup clang format 2020-11-14 15:16:27 +01:00
b6041bfc6c GPencil: Fix unreported crash in some cases when duplicate a stroke
Some pointers were not initialized.
2020-11-14 15:16:02 +01:00
a3ce05d00e GPencil: Fix callback parameter list error
In the previous commit the bGPDframe parameter was removed, but this parameter is required to keep the same function signature.
2020-11-14 09:44:55 +01:00
83d0810a9f Merge branch 'blender-v2.91-release' 2020-11-13 20:52:06 -07:00
2abbcaa021 GPencil: Fix compiler warning, unused variable 2020-11-13 22:31:58 +01:00
0be88c7d15 GPencil: Merge GSoC curve edit mode
Differential Revision: https://developer.blender.org/D8660

This patch is the result of the GSoC 2020 "Editing Grease Pencil Strokes
Using Curves" project. It adds a submode to greasepencil edit mode that
allows for the transformation of greasepencil strokes using bezier
curves. More information about the project can be found
here: https://wiki.blender.org/wiki/User:Filedescriptor/GSoC_2020.
2020-11-13 21:43:00 +01:00
9d28353b52 Cleanup: Make panel type flag names more clear
The overlap with the `Panel` flags that start with "PNL" was quite
confusing because wasn't clear which enum a flag was from. The
new names are a bit longer, but the clarity is worth it.
2020-11-13 13:57:20 -05:00
4c193f731e Cleanup: Move PanelType flag from DNA to BKE header
Since this flag isn't saved in files and PanelType itself is defined in
BKE, the flag makes more sense there.
2020-11-13 13:15:41 -05:00
e9b955b99c GPencil: Remove ID from operators to fix T82597
Instead to use the ID of the object, now the parameter is an Enum with Selected object or New.

If use selected mode, the first grease pencil object selected is used. If none of the selected objects is a grease pencil object, a new object is created.

Small cleanup changes to the original patch.

Differential Revision: https://developer.blender.org/D9529
2020-11-13 15:21:15 +01:00
50ccf346f0 LibOverride: Adjust PointCache operators to properly handle overrides.
LibOverrides only support a small sub-set of PointCache features for now
(one cannot add new caches, baking in memory is not supported...).

Part of first step of T82503: support disk cache in liboverrides.
2020-11-13 14:21:27 +01:00
7e210e68ba LibOverride: Do not tag overrides for complete recalc.
This was done as some sort of safety, but should not actually be needed,
and including tags like `ID_RECALC_POINT_CACHE` e.g. makes usage of
point caches impossible with liboverrides (since it would systematically
invalidate all cache on file load).

In theory we should not have to tag anything here in fact, RNA accessors
are supposed to take care of it, but for now we keep the
`ID_RECALC_COPY_ON_WRITE` one.

Part of first step of T82503: support disk cache in liboverrides.
2020-11-13 14:21:27 +01:00
59910f7217 LibOverride: Make PointCache RNA properties overridable.
Note that due to convoluted layout of point caches in RNA (active one
also storing list of all available ones), we'll often have the
pointcache overrides rules twice. Should not be a huge problem,
practically speaking.

Part of first step of T82503: support disk cache in liboverrides.
2020-11-13 14:21:27 +01:00
75ea4b8a1f Ceres: Update to upstream version 2.0.0
We already were using one of earlier RC of the library, so there is no
expected big changes. Just making the update official, using official
version and stating it in the readme file.
2020-11-13 11:52:59 +01:00
7146e9696e CMake: Extend strict flags cancellation flags
Becomes rather annoying to duplicate them across C/C++ GCC/Clang sets,
almost as if the test should test both C and C++, and to do it for all
compilers.

Solves strict warning in the upstream of Ceres library.
2020-11-13 11:51:49 +01:00
a2e00236d0 Revert "Codesign: Versioning code to support older branches"
This reverts commit 9d172f007e.

Got a second thought and remembered why it was not done in the first place.
The issue here is that the server needs to communicate codesign result back
and that must happen within the new protocol. So if the client talks old
protocol it is possible to receieve data from it, but is not possible to
communicate result back to it.
2020-11-13 11:35:04 +01:00
a8f9a24939 Cleanup: use IMB_FTYPE_NONE instead of 0 for imbuf format comparison
Image format code checked the file type against an enum except for
zero which is used when the format can't be detected.

Also add doc-strings to some of the image file type callbacks.
2020-11-13 20:32:15 +11:00
4a3b26dd5e Fix building after 2e53b646f6f02ab112e0823b9577ff2e1920faaeq 2020-11-13 20:32:15 +11:00
2e53b646f6 GPencil: Remove "angle_split" from Multiply modifier. 2020-11-13 17:20:20 +08:00
5035057281 Object: show preview plane for add-object tool
The orientation & depth settings are used to show the preview plane
that is used when adding the object.
2020-11-13 20:15:03 +11:00
9d172f007e Codesign: Versioning code to support older branches
Turns out it is easier to have suboptimal versioning code on the server
side than to deal with branches where changes are to be merged into.
2020-11-13 09:49:02 +01:00
12f394ece7 refactor vec_roll_to_mat3_normalized() for clarity
the function vec_roll_to_mat3_normalized() has a bug as described in T82455. This Differential is only for refactoring the code such that it becomes more clear what the function does and how the bug can be fixed. This differential is supposed to not introduce any functional changes.

Reviewed By: sybren

Differential Revision: https://developer.blender.org/D9410
2020-11-13 09:46:18 +01:00
Ivan Perevala
4efd87d56b UI: Adaptive HDRI preview resolution
HDRI preview should have resolution dependent on dpi, viewport scale and HDRI gizmo size.
This patch uses a LOD to render a more round sphere.

Reviewed By: Jeroen Bakker

Differential Revision: https://developer.blender.org/D9382
2020-11-13 08:26:27 +01:00
YimingWu
b35b8c8849 Adding 3D_POLYLINE_UNIFORM_COLOR to PyGPU shader API
This would allow python script to access `lineWidth` uniform when drawing lines
without using `glLineWidth`.

Reviewed By: Jeroen Bakker

Differential Revision: https://developer.blender.org/D9518
2020-11-13 08:23:04 +01:00
Manuel Castilla
4dc5920525 Fix CalculateStandardDeviationOperation incorrect results for R G B channels
Standard deviation formula wasn't being applied correctly when selecting
R G B cases. Issue is there since Blender 2.64 as it was incorrectly
ported over from the previous compositor.

Reviewed By: Sergey Sharybin, Jeroen Bakker

Differential Revision: https://developer.blender.org/D9384
2020-11-13 08:20:15 +01:00
Jun Mizutani
db7d8281c5 Add An Opacity Slider to Overlay Wireframe
This patch adds an opacity slider to the wireframe overlay. The previous
wireframe in dense geometry scenes could be too dark and sometimes the
user just wants an impression of the geometry during modelling.

Reviewed By: Jeroen Bakker

Differential Revision: https://developer.blender.org/D7622
2020-11-13 08:14:56 +01:00
f00ebd4dba UI: make add object tool experimental
Some changes here are planned which need feedback from users before
declaring this ready for the next release.
2020-11-13 17:27:39 +11:00
ccf8df66fe BLI_math: add floor_power_of_10, ceil_power_of_10
Add utility functions to get the floor/ceiling of a float value
to the next power of 10.
2020-11-13 17:05:46 +11:00
40b2ce5ea7 Cleanup: Remove unecessary logic in panel code
Also use short for panel flag arguments to functions since it matches
the type in DNA, and remove a comment that isn't helpful.
2020-11-12 23:32:50 -05:00
f3ab698951 Cleanup: Simplify panel activate state function
This commit moves some of the logic around so that the logic in
panel_activate_state is clearly separated by the state being activated.
There are fewer nested and redundant checks, and it's easier to see
the progression of interaction with the panel handler.
2020-11-12 23:28:53 -05:00
4eb57d00bb Merge branch 'blender-v2.91-release' 2020-11-13 11:37:47 +11:00
454b7876ff Cleanup: remove unnecessary ImFileType.ftype callback
This callback made some sense before moving the file-type information
from a bit-flag to an enum: e142ae77ca

Since then, we can compare the type value directly.

Also replace loops over file types with IMB_file_type_from_{ibuf/ftype}.
2020-11-13 11:28:24 +11:00
ac299bb453 Cleanup: imbuf file format callback declaration
Use named members as this wasn't very readable given the number
of unnamed NULL members.
2020-11-13 10:39:48 +11:00
9a73417337 Fix T82349: file extension not added to unpacked images
Ensure the appropriate extension is set when unpacking generated images
that don't have a filepath set.

Ref D9500
2020-11-13 10:11:00 +11:00
cd49afc596 Fix T82596: Fly/walk navigation crash
Add a NULL check for the View3D's camera, because these
modes can be entered even without an active camera.
2020-11-12 17:06:57 -05:00
55e2930c18 Outliner: Sync with property editor physics tab
This commit makes the property editor switch to the physics tab instead
of the modifier tab when selecting physics modifiers. Since the modifier
isn't visible then, it's confusing to change the expansion, so this commit
also disables the modifier expansion for these modifiers.

Differential Revision: https://developer.blender.org/D9544
2020-11-12 16:59:30 -05:00
b6988de22a Merge branch 'blender-v2.91-release' 2020-11-12 20:30:14 +01:00
a6c1c0427c Cleanup: remove accidentally committed merge files 2020-11-12 19:52:04 +01:00
ddc6a45a54 Cleanup: compiler warning 2020-11-12 19:52:04 +01:00
c43283d10b fix: added missing float declarations 2020-11-12 19:27:12 +01:00
923b314a7a Test cases for vec_roll_to_mat3_normalized
The function vec_roll_to_mat3_normalized() basically has to handle 3 scenarios:

- When a bone is oriented along the negative Y axis
- When a bone is very close to the negative Y axis
- All other cases

The tests in the Differential make sure that all 3 situations are covered.

Reviewed By: sybren, mont29

Differential Revision: https://developer.blender.org/D9525
2020-11-12 18:16:35 +01:00
b9bd47c2e2 Merge branch 'blender-v2.91-release' into master 2020-11-12 16:24:18 +01:00
987732181f Merge branch 'blender-v2.91-release' 2020-11-12 14:04:02 +01:00
a8f1bea590 Fix NanoVDB not being enabled/disabled correctly in CMake profiles
This caused warnings when e.g. building the lite profile because NanoVDB was not disabled, but
OpenVDB was. This Fixes this by setting the "WITH_NANOVDB" flag too.
2020-11-12 12:49:12 +01:00
5db114ae0f Merge branch 'blender-v2.91-release' into master 2020-11-12 11:51:25 +01:00
0d04bcd566 Merge branch 'blender-v2.91-release' into master 2020-11-12 11:39:34 +01:00
d706aaa53d Merge branch 'blender-v2.91-release' into master 2020-11-12 11:26:24 +01:00
d7a2032846 Merge branch 'blender-v2.91-release' into master 2020-11-12 11:23:16 +01:00
bc090387ac Fix T82388: Sculpt mode: Unexpected undo behavior.
Issue exposed by rB4c7b1766a7f1.

Main idea is that non-memfile first undo step should check into previous
memfile and tag the ID it is editing as `future_changed`.

That way, when we go back and undo to the memfile, said IDs are properly
detected as changed and re-read from the memfile.

Otherwise, undo system sees them as unchanged, and just re-use the
current data instead.

Note that currently only Sculpt mode seems affected (probably because it
is storing the mode switch itself as a Sculpt undo step instead of a
memfile one), but similar action might be needed in some other cases
too.

Maniphest Tasks: T82388

Differential Revision: https://developer.blender.org/D9510
2020-11-12 10:47:50 +01:00
fb4113defb Codesign: Report codesign errors from server to worker
Pass codesign errors (if any) from codesign buildbot server to the
buildbot worker, so that the latter one can abort build process if
the error happens. This solves issues when non-properly-notarized
DMG package gets uploaded to the buildbot website.
2020-11-12 10:12:56 +01:00
88bb29dea6 Fix T82617: artifacts in Cycles viewport when changing subdivision attributes
The old attributes were not cleared when synchronizing the geometries, this could also lead to crashes in other cases.

Ref T82608.
2020-11-12 09:17:38 +01:00
08452d9956 Merge branch 'blender-v2.91-release' 2020-11-12 09:14:36 +01:00
cd2dfacfa5 Merge branch 'blender-v2.91-release' 2020-11-12 09:14:05 +01:00
89c8b074e7 Cleanup: split view3d_placement depth & orientation calculation
Split out functionality needed for preview plane drawing.
2020-11-12 16:16:49 +11:00
934c2c8ac5 Cleanup: clang-tidy, remove invalid comments 2020-11-12 15:18:08 +11:00
977b6ca305 Cleanup: Imperative tense in property description 2020-11-12 04:59:50 +01:00
f284a40385 ImBuf: pass the number of bytes read to 'is_a' callbacks
Previously the header was a fixed size and assumed to be zeroed.
Now read in bytes up to `HEADER_SIZE`, pass the number or bytes
read to the callback which must not read past those bytes.
2020-11-12 12:30:18 +11:00
fa81a42539 Cleanup: RNA ID enum utility function
- Avoid calling `GS(id->name)` on each iteration.
- Remove unused arguments.
- Pass `const ID *` to the filter callback.
2020-11-12 11:46:30 +11:00
e00bb5a4b7 Cleanup: spelling 2020-11-12 11:35:31 +11:00
9e1e9516a0 Cleanup: warnings 2020-11-12 11:23:21 +11:00
Aaron Carlisle
2ef2b3e0fd Cleanup: Remove SSE math optimization i386 macOS builds
We haven't supported 32bit mac builds for a while so this should be safe to remove.

Reviewed By: #platform_macos, brecht

Differential Revision: https://developer.blender.org/D9489
2020-11-11 17:08:48 -05:00
1043ec7991 Merge branch 'blender-v2.91-release' 2020-11-11 16:37:22 -05:00
88e6341ce8 UI: Tooltips: dont add period to labels
These are generally only one or two word phrases and are not sentences.
This change slightly improves readability.

Note, the check when display labels:

```
Tip Label (only for buttons not already showing the label).
```

Could be improved here because there are a lot of false positives.
2020-11-11 14:58:50 -05:00
40aa69e2eb Cleanup: Split header for Outliner tree building into C and C++ headers
See https://developer.blender.org/D9499.

It's odd to include a C++ header (".hh") in C code, we should avoid that. All
of the Outliner code should be moved to C++, I don't expect this C header to
stay for long.
2020-11-11 19:09:15 +01:00
c2b3a68f24 Cleanup: Rename Outliner "tree-view" types to "tree-display" & update comments
See https://developer.blender.org/D9499.

"View" leads to weird names like `TreeViewViewLayer` and after all they are
specific to what we call a "display mode", so "display" is more appropriate.

Also add, update and correct comments.
2020-11-11 19:09:11 +01:00
01318b3112 Cleanup: Follow C++ code style for new Outliner building code
See https://developer.blender.org/D9499.

* Use C++17 nested namespaces.
* Use `_` suffix rather than prefix for private member variables.

Also: Simplify code visually in `tree_view.cc` with `using namespace`.
2020-11-11 19:09:06 +01:00
43b4570dcf Cleanup: General cleanup of Outliner Blender File display mode building
See https://developer.blender.org/D9499.

* Turn functions into member functions (makes API for a type more obvious &
  local, allows implicitly sharing data through member variables, enables order
  independend definition of functions, allows more natural language for
  function names because of the obvious context).
* Prefer references over pointers for passing by reference (makes clear that
  NULL is not a valid value and that the current scope is not the owner).
* Reduce indentation levels, use `continue` in loops to ensure preconditions
  are met.
* Add asserts for sanity checks.
2020-11-11 19:09:01 +01:00
44d8fafd7f UI Code Quality: Convert Outliner Blender File mode to new tree buiding design
See https://developer.blender.org/D9499.

Also:
* Add `space_outliner/tree/common.cc` for functions shared between display
  modes.
* I had to add a cast to `ListBaseWrapper` to make it work with ID lists.
* Cleanup: Remove internal `Tree` alias for `ListBase`. That was more confusing
  than helpful.
2020-11-11 19:08:56 +01:00
ad0c387fdf Cleanup: Put Outliner C++ namespace into blender::ed namespace, add comments
See https://developer.blender.org/D9499.

Also remove unnecessary forward declaration.
2020-11-11 19:08:49 +01:00
5fb67573b5 Fix possible null-pointer dereference in new Outliner tree building code 2020-11-11 19:08:43 +01:00
dc9a52a303 Cleanup: Remove redundant parameter from new Outliner tree building code
See https://developer.blender.org/D9499.
2020-11-11 19:08:36 +01:00
cad2fd99e7 Cleanup: Comments and style improvements for new Outliner C++ code
See https://developer.blender.org/D9499.

* Add comments to explain the design ideas better.
* Follow code style guide for class layout.
* Avoid uninitialized value after construction (general good practice).
2020-11-11 19:08:29 +01:00
6b18e13c5b UI Code Quality: Use C++ data-structures for Outliner object hierarchy building
See https://developer.blender.org/D9499.

* Use `blender::Map` over `GHash`
* Use `blender::Vector` over allocated `ListBase *`

Benefits:
* Significantly reduces the amount of heap allocations in large trees (e.g.
  from O(n) to O(log(n)), where n is number of objects).
* Higher type safety (no `void *`, virtually no casts).
* More optimized (e.g. small buffer optimization).
* More practicable, const-correct APIs with well-defined exception behavior.

Code generally becomes more readable (less lines of code, less boilerplate,
more logic-focused APIs because of greater language flexibility).
2020-11-11 19:08:13 +01:00
c9cc03b688 UI Code Quality: General refactor of Outliner View Layer display mode creation
See https://developer.blender.org/D9499.

* Turn functions into member functions (makes API for a type more obvious &
  local, allows implicitly sharing data through member variables, enables order
  independend definition of functions, allows more natural language for
  function names because of the obvious context).
* Move important variables to classes rather than passing around all the time
  (shorter, more task-focused code, localizes important data names).
* Add helper class for adding object children sub-trees (smaller, more focused
  units are easier to reason about, have higher coherence, better testability,
  can manage own resources easily with RAII).
* Use C++ iterators over C-macros (arguably more readable, less macros is
  generally preferred)
* Add doxygen groups (visually emphasizes the coherence of code sections,
  provide place for higher level comments on sections).
* Prefer references over pointers for passing by reference (makes clear that
  NULL is not a valid value and that the current scope is not the owner).
2020-11-11 19:07:55 +01:00
249e4df110 UI Code Quality: Start refactoring Outliner tree building (using C++)
This introduces a new C++ abstraction "tree-display" (in this commit named
tree-view, renamed in a followup) to help constructing and managing the tree
for the different display types (View Layer, Scene, Blender file, etc.).

See https://developer.blender.org/D9499 for more context. Other developers
approved this rather significantly different design approach there.

----

Motivation

General problems with current design:
* The Outliner tree building code is messy and hard to follow.
* Hard-coded display mode checks are scattered over many places.
* Data is passed around in rather unsafe ways (e.g. lots of `void *`).
* There are no individually testable units.
* Data-structure use is inefficient.

The current Outliner code needs quite some untangling, the tree building seems
like a good place to start. This and the followup commits tackle that.

----

Design Idea

Idea is to have an abstract base class (`AbstractTreeDisplay`), and then
sub-classes with the implementation for each display type (e.g.
`TreeDisplayViewLayer`, `TreeDisplayDataAPI`, etc). The tree-display is kept
alive until tree-rebuild as runtime data of the space, so that further queries
based on the display type can be executed (e.g. "does the display support
selection syncing?", "does it support restriction toggle columns?", etc.).

New files are in a new `space_outliner/tree` sub-directory.

With the new design, display modes become proper units, making them more
maintainable, safer and testable. It should also be easier now to add new
display modes.
2020-11-11 18:51:57 +01:00
5b5ec0a2e9 Fix T82521: Bump OpenImageIO minimum version 1.8 > 2.2.1 for install_deps.sh
Since rB6fdcca8de64cd70f, we need at least OpenImageIO 2.1.12 to build
Blender.
2020-11-11 15:10:01 +01:00
e47ea9fbc7 GPencil: Fix unreported crash when style is NULL 2020-11-11 12:16:22 +01:00
7b6d76f387 Cleanup: correct argument order to callback
Currently the callback isn't used,
found when testing a new enum callback.
2020-11-11 20:40:42 +11:00
251b7d77b3 Merge branch 'blender-v2.91-release' into master 2020-11-11 10:27:44 +01:00
9b3dabacbc Cleanup: Use NDEBUG define, DEBUG one is not reliable. 2020-11-11 10:15:58 +01:00
15ffda3bcd Fix T82602: checking image header reads past buffer bounds
Use the size argument to ensure checking the header doesn't read
past the buffer bounds when reading corrupt/truncated headers
from image files.
2020-11-11 16:14:09 +11:00
2d60845786 Cleanup: pass header size to 'is_a' callbacks
No functional changes, prepare for fixing out-of-bounds access
when reading headers.
2020-11-11 16:14:06 +11:00
99f56b4c16 Cleanup: use 'filepath' instead of 'name' for ImBuf utilities 2020-11-11 16:14:06 +11:00
a5f8071bdf Cleanup: use bool for imbuf save callbacks 2020-11-11 16:14:05 +11:00
e9c19b2820 Cleanup: avoid boolean literals for functions that return int 2020-11-11 16:14:05 +11:00
11bf3b7035 Cleanup: use define for targa header size 2020-11-11 15:05:30 +11:00
75c18b989c Cleanup: remove redundant NULL checks in ImFileType.is_a callback
Most of these callbacks don't do a NULL check,
so there is no need to do this for bmp/png.

Also correct radiance_hdr comments.
2020-11-11 14:54:04 +11:00
36e5c9e026 Merge branch 'blender-v2.91-release' 2020-11-11 14:44:27 +11:00
eeeb2c1967 Merge branch 'blender-v2.91-release' 2020-11-10 17:34:29 -07:00
c4d8f6a4a8 Cleanup: clang-format 2020-11-11 09:11:43 +11:00
cd9acfed4f Cleanup: use preprocessor version check for PyTypeObject declaration
While `tp_print` was deprecated, Python 3.8+ uses this for
'tp_vectorcall_offset' which wasn't stated in the comment from
efd71aad4f.

Instead of suppressing clang-tidy, use preprocessor a check since
this properly represents the difference between Python versions.
2020-11-11 09:11:21 +11:00
86bdd2acc6 Windows: Fix build issue with VCPKG
For blender we disable VCPKG to prevent it from picking
up the wrong libraries from VCPKG rather than our lib folder
some of the cycles tests needed this to link correctly.

reported by @alef on chat
2020-11-10 13:23:55 -07:00
b980cd163a Cycles: fix compilation of OSL shaders following API change
The names of the parameters are based on those of those of the sockets, so they also need to be updated. This was forgotten about in the previous commit (rBa284e559b90e).

Ref T82561.
2020-11-10 18:59:30 +01:00
a63208823c Fix NanoVDB compile errors with recent NanoVDB versions
There were some changes to the NanoVDB API that broke the way Cycles was previously using it.
With these changes it compiles successfully again and also still compiles with the NanoVDB revision
that is currently part of the Blender dependencies. Ref T81454.
2020-11-10 18:28:14 +01:00
339f442a93 Fix (unreported) potential assert in viewlayer synchronization.
Some operations, like remapping and ID (Object) to another, can lead to
having the same object in more than one base.

While this is not a valid state, this is being taken care of by the
`BKE_layer_collection_sync` call, so the object-to-base GHash generation
itself should be resilient to such issue.

Note: another way to fix this would be to make remapping post-process
code check explicitely for such doublons, but I would rather avoid
adding even more 'specialized' code there, it already has to deal with
too many of those corner cases.
2020-11-10 17:16:28 +01:00
626a79204e MSVC: Fix build warning
If a define of NOMINMAX was made before BLI_task.hh was included,
the compiler would emit a

warning C4005: 'NOMINMAX': macro redefinition

warning, to work around this only define it if it is not already
defined, and only undefine it if we were the ones that made the
define earlier.
2020-11-10 08:48:18 -07:00
bd6bfba64d Cycles: Enable NanoVDB usage by default
As discussed during the Rendering Metting. Ref T81454.
2020-11-10 16:20:15 +01:00
Germano Cavalcante
23614c49e9 Fix T81951: Add Cube new tool surface snaping not working
For the `plane_depth` of type `PLACE_DEPTH_SURFACE` to take effect, a `snap_context` is needed.

But, even if a temporary `snap_context` was created for `plane_orient == PLACE_ORIENT_SURFACE`,
this context was not used for `plane_depth`.

So, use a temporary `snap_context` for `PLACE_DEPTH_SURFACE` (as it is done for `PLACE_ORIENT_SURFACE`).

Differential Revision: https://developer.blender.org/D9345
Differential Revision: https://developer.blender.org/D9435
2020-11-10 12:18:19 -03:00
2ecab4c8a6 LibOverride: Optimize deletion of overrides in liboverride delete. 2020-11-10 16:14:16 +01:00
de8d7003bc Cleanup/Update comments in liboverride code. 2020-11-10 16:14:16 +01:00
a284e559b9 Fix T82561: shader compilation crashes in OSL
The "type" sockets on shader nodes were renamed in rB31a620b9420cab to
avoid clashes with the `NodeType type` member from the Node base class,
but the OSL shader compilation was missing those changes.
2020-11-10 16:05:47 +01:00
feb71f1d71 Animation: Expand unit tests for BKE_fcurve_active_keyframe_index()
Expand unit test for `BKE_fcurve_active_keyframe_index()` to test edge
cases better.

This also introduces a new test macro `EXPECT_BLI_ASSERT()`, which can be
used to test that an assertion fails successfully.

No functional changes to actual Blender code.
2020-11-10 15:36:21 +01:00
75a2db5d97 Multires: Cleanup, clarify comment 2020-11-10 15:32:06 +01:00
11c19c24bd Cleanup/Update comments in liboverride code. 2020-11-10 15:30:36 +01:00
01c7a94cdd install_deps: fix a typo in argument handling of new nanovdb option.
Spotted by  Patrick Mours (@pmoursnv), thanks!
2020-11-10 14:11:13 +01:00
2a2bc09096 Merge remote-tracking branch 'origin/blender-v2.91-release' 2020-11-10 14:02:28 +01:00
23c71a5fab ImBuf: support detecting the file format from in-memory images
Add `IMB_ispic_type_from_memory` so we can detect the file format
of in-memory images.

This removes `is_a_filepath` callback and uses a magic check for
photo-shop files that's compatible with OIIO.

Even though OIIO doesn't support packed images, we can still use the
file magic for detecting the format.

This change allows D9500 (a fix for unpacking images),
to be implemented without a significant performance penalty,
although the actual performance cost would depend heavily on the
blend file.

Reviewed By: dfelinto, sergey

Ref D9517
2020-11-10 22:25:05 +11:00
d2ab9b568e Merge branch 'blender-v2.91-release' 2020-11-10 19:09:04 +11:00
291473bb3e Merge branch 'blender-v2.91-release' 2020-11-10 17:50:15 +11:00
3bb6902235 Merge branch 'blender-v2.91-release' 2020-11-10 16:30:10 +11:00
bff1707aae Cleanup: remove hard coded file format check in IMB_ispic_type
This is already being checked in the 'is_a' callback.
2020-11-10 11:58:56 +11:00
b5d310b569 Cleanup: clang-format 2020-11-10 09:42:03 +11:00
efd71aad4f Cleanup: clang-tidy suppress warnings for PyTypeObject.tp_print
Clang-tidy behavior changes from Python 3.7 to 3.8+ so it's simplest
to suppress the warning in this instance.
2020-11-10 09:40:20 +11:00
3a764c3e6d Cleanup: suppress clang-tidy warnings without FFMPEG/AVI/AUDASPACE 2020-11-10 09:40:20 +11:00
6faba2db08 Merge branch 'blender-v2.91-release' 2020-11-09 21:18:28 +01:00
716b7a60df install_deps: add support for NanoVDB.
re T81454.
2020-11-09 19:08:01 +01:00
cdb1da6bf6 Install_deps: update URLS for OpenVDB repo/sources. 2020-11-09 19:08:01 +01:00
cf751e3914 Merge branch 'blender-v2.91-release' 2020-11-09 18:50:56 +01:00
cde2bd1828 Merge branch 'blender-v2.91-release' 2020-11-09 17:37:21 +01:00
bd2dda90b6 Cleanup: Clang-tidy, inconsistent parameter name
readability-inconsistent-declaration-parameter-name
2020-11-09 21:31:13 +05:30
94b44a5228 Cleanup: Clang-tidy, modernize-use-nullptr. 2020-11-09 21:31:13 +05:30
880b0f981d Cleanup: more renaming in the render/ module for consistency 2020-11-09 16:19:49 +01:00
4f66cf3b8b Pointclouds: move blenkernel code to c++ 2020-11-09 15:47:16 +01:00
6507449e54 Cleanup: fix wrong merge, remove extra unique_ptr.
Mistakes added in 3cb4c51308 and
bec1765340

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9514
2020-11-09 19:32:16 +05:30
021c40167d Cycles: fix Node::tag_modified not setting modified flag's upper bits
Previous code was flipping the bits on a 32-bit number and doing a zero extension to cast to 64-bit, so mark the constant as long to begin with.

This would also erase previously set bits in this part the flag.
2020-11-09 14:52:48 +01:00
ed75a50119 Cycles: Fix function inline attributes
forceinline attribute is only applicable for function which are
marked inline. Interestingly, it can be used for class methods
without explicit inline statement. But for functions it is another
story.
2020-11-09 14:41:00 +01:00
1f4062cf6e Fluid: Fix strict compiler warning
Proper way to check for DEBUG_PRINT is to do `if defined` check rather
than `if`: this is because in non-debug builds the symbol is not defined.
2020-11-09 14:35:20 +01:00
Yevgeny Makarov
055ed335a1 macOS: follow system preference for natural trackpad scroll direction
And remove Blender preference, which was expected to be set to match the system
preference for correct behavior. Instead just handle this automatically.

Differential Revision: https://developer.blender.org/D9402
2020-11-09 13:51:08 +01:00
0c4d12986a Merge branch 'blender-v2.91-release' 2020-11-09 12:54:26 +01:00
5da05dd627 Fix T82210: Animation, Bake Action cleanup
Make post-bake cleanup of the Bake Action operator optional, and disable
by default.

Previously Bake Action would do two things:
- Bake the Action
- Clean up the FCurves

It is now possible (and even the default) to only perform the baking
operation.

Reviewed By: #animation_rigging, looch, sybren

Maniphest Tasks: T82210

Differential Revision: https://developer.blender.org/D9453
2020-11-09 12:41:51 +01:00
118e31a0a9 Cycles: Fix tricubic sampling with NanoVDB
Volumes using tricubic sampling were producing different results with NanoVDB compared
to dense textures. This fixes that by using the same tricubic sampling algorithm in both
cases. It also fixes some remaining offset issues and some minor things that broke OpenCL
kernel compilation on NVIDIA.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D9491
2020-11-09 12:37:47 +01:00
92083772e7 Libmv: Fix warning about unused parameter in Ceres
Ceres is an external library, so consider it a system header which
makes it so all strict flags are properly ignored for them.
2020-11-09 12:12:00 +01:00
f26e267770 CMake: Extend supported strict flags cancelation for Clang 2020-11-09 12:12:00 +01:00
525a042c5c Cleanup: fix some clang tidy issues 2020-11-09 12:05:07 +01:00
5837ffc143 Merge branch 'blender-v2.91-release' into master 2020-11-09 11:49:44 +01:00
ad85256e71 Animation: move group colors switch to user preferences
Move the "Show Group Colors" toggle from a per-editor option to a single
user preference in the Animation preferences. The Grease Pencil
animation channel side panel allows picking a channel color; this now
shows a message when channel colors are disabled.

The old "Show Group Colors" toggle had to be set per editor, and was on
by default. This meant that disabling group colors would require an
action for every file, for every editor. It is very hard to select a
color that works both as bone color in the 3D Viewport (needs to be
bright there) as well as the channel list (needs to be dark there), most
animators turn channel list colors off.

Differential Revision: https://developer.blender.org/D9391
2020-11-09 11:11:05 +01:00
25375c769a Cleanup: Sequencer, remove unused function
Remove `static int clear_scene_in_allseqs_fn(...)`. It was a utility
function for `BKE_sequencer_clear_scene_in_allseqs()`, which was removed
in c063813c30.

No functional changes.
2020-11-09 11:11:05 +01:00
c356a3654d Merge branch 'blender-v2.91-release' 2020-11-09 20:37:03 +11:00
3c04a06178 Merge branch 'blender-v2.91-release' 2020-11-09 20:36:34 +11:00
ba179e3dd5 Merge branch 'blender-v2.91-release' 2020-11-09 20:36:31 +11:00
af4c389f99 Cleanup: imbuf callback naming
Use `is_a` & `is_a_filepath` in callback names.
2020-11-09 17:03:28 +11:00
e118426e46 Fix T82520: error building freestyle with Python3.8
Caused by 16732def37,
This is a 'Py_ssize_t' in Python 3.8,
replace with zero as this works in both 3.7 and 3.8.
2020-11-09 16:08:29 +11:00
8c846cccd6 Cleanup: clang-format 2020-11-09 15:47:08 +11:00
39012146e1 Fix T81651, exact boolean modifier incorrect if operand hidden.
The code was trying to ignore hidden geometry when doing boolean,
which is correct when used as a tool, but not when a modifier.
Added a "keep_hidden" argument to bmesh_boolean to distinguish the
two cases.
Also fixed a bug when the tool is used with hidden geometry that
is attached to unhidden geometry that is deleted by the operation.
2020-11-08 10:12:53 -05:00
7be47dadea Cleanup: Clang-tidy, readability-else-after-return 2020-11-07 21:52:53 +05:30
4429b4b77e Cleanup: Clang-tidy, readability-non-const-parameter. 2020-11-07 21:52:53 +05:30
9cd9ea591f Cleanup: NULL to nullptr. 2020-11-07 21:52:53 +05:30
bec1765340 Merge new boolean fix from blender-v2.91-release. 2020-11-07 09:33:56 -05:00
40d4a4cb1a Cleanup: Clang-format. 2020-11-07 18:48:13 +05:30
6e6b5e147c Noise: fix uninitialized variable warning.
Mistake in 74188e6502
2020-11-07 18:48:13 +05:30
ae342ed451 Cleanup: Clang-tidy else-after-return 2020-11-07 18:48:13 +05:30
4525049aa0 Cleanup: Clang-tidy, modernize-concat-nested-namespaces 2020-11-07 18:48:13 +05:30
a452fcb9a5 View3D: take clipping into account for Frame All
Clamp the min/max used for Frame All/Selected
by the clipping region if it's set.

Resolve T81050
2020-11-07 21:20:57 +11:00
19a0df25e3 Cleanup: move plane array intersection into a function
Also add check to ensure a point isn't occluded by it's own plane,
which could happen if a small epsilon values are passed in.
2020-11-07 21:01:42 +11:00
d2c102060d Cleanup: Rename render texture files to texture_* 2020-11-06 14:20:44 -05:00
b3e71ee098 Cleanup: Remove unused variable 2020-11-06 12:50:03 -06:00
c2b7e83fae Cleanup: remove unused includes in readfile.c and writefile.c 2020-11-06 19:11:53 +01:00
2d26057751 Fix missing include warning
Caused by rB580ff2cb937daf43699908afe1190baea8d117aa
2020-11-06 12:48:13 -05:00
b0dcabdf65 Cleanup: fix naming and remove unnecessary code 2020-11-06 18:41:03 +01:00
992b8f6f5f Refactor: move Screen .blend data read to blenkernel
Ref T76372.
2020-11-06 18:37:52 +01:00
1762d5f43a Refactor: move Ipo .blend I/O to IDTypeInfo callbacks 2020-11-06 18:33:33 +01:00
638913a3c0 Refactor: move Object .blend I/O to IDTypeInfo callbacks 2020-11-06 18:25:51 +01:00
16732def37 Cleanup: Clang-Tidy modernize-use-nullptr
Replace `NULL` with `nullptr` in C++ code.

No functional changes.
2020-11-06 18:08:25 +01:00
88926375a0 Clang-Tidy: error out when executable not found
Stop with an error when the Clang-Tidy executable cannot be found.

Without this check, CMake will happily report "Found Clang-Tidy" but with
the fallback version (0, 0, 0), when `CLANG_TIDY_EXECUTABLE` points to a
non-existing executable.
2020-11-06 18:08:25 +01:00
2acf01ec62 Refactor: move Pose .blend I/O to blenkernel
Ref T76372.
2020-11-06 17:58:25 +01:00
Yevgeny Makarov
60ad4a761a UI: Improved macOS Application Icon Progress Bar
Nicer appearance for the progress bar that is drawn over the application icon during long processes on macOS.

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

Reviewed by Brecht Van Lommel
2020-11-06 08:55:05 -08:00
58e9b51f95 Refactor: move Constraint .blend I/O to blenkernel
Ref T76372.
2020-11-06 17:45:29 +01:00
37ef37711d Refactor: move MotionPath .blend I/O to blenkernel
Ref T76372.
2020-11-06 17:33:13 +01:00
a3a6443bfd Merge branch 'blender-v2.91-release' into master 2020-11-06 17:29:18 +01:00
57414e6d1d Refactor: move gpencil modifier .blend I/O to blenkernel
Ref T76372.
2020-11-06 17:22:20 +01:00
019407810b Refactor: move modifier .blend I/O to blenkernel
Ref T76372.
2020-11-06 17:13:16 +01:00
f6ad56b1bc Merge branch 'blender-v2.91-release' into master 2020-11-06 16:58:06 +01:00
3cb4c51308 Cleanup: Clang-Tidy, modernize-make-unique 2020-11-06 16:47:16 +01:00
ce70f2e1e0 Cleanup: Sort includes after recent render module cleanup 2020-11-06 10:45:18 -05:00
c063813c30 Cleanup: remove unused functions 2020-11-06 16:43:48 +01:00
af24532612 Refactor: move ShaderFx .blend I/O to blenkernel
Ref T76372.
2020-11-06 16:42:50 +01:00
580ff2cb93 Cleanup: Render Module: combine intern/ source & include 2020-11-06 10:37:40 -05:00
90ac9770a4 Cleanup: whitespace 2020-11-06 16:16:14 +01:00
e15076b22f Cleanup: Render Module: move header files to main directory
Move headers files from `render/extern/` to `render/`

Part of T73586
2020-11-06 10:10:41 -05:00
Paul Melis
235c309e5f Add background rectangle option to video sequencer Text strip
This adds a Box option to the Text strip's style properties, plus related Box Margin value:

{F9208309}

When enabled the text is placed on top of a solid-filled rectangle of a chosen color, as shown below:

{F9208324}

When the box option is disabled the text strip works the same as it does now. When the box option is enabled the meaning of the Shadow option changes to provide a drop-shadow on the rectangle (and not on the text itself). The latter made more sense to me.

The box margin is specified as a fraction of the image width. The offset of the drop-down box shadow is fixed to a specific fraction of the image width as well.

I tested this feature on a movie of a couple of minutes containing dozens of text strips (all with box background), edge cases like multi-line strings and text overlapping the image edges.

Reviewed By: ISS

Differential Revision: https://developer.blender.org/D9468
2020-11-06 16:05:50 +01:00
f6524aaa80 Refactor: move ParticleSystem .blend I/O to blenkernel
Ref T76372.
2020-11-06 15:58:39 +01:00
ba4da217ce Sequencer: Make naming consistent in header and implementation files 2020-11-06 15:46:56 +01:00
c74086376f VSE: Don't store proxy images in cache
Proxies are expected to be fast to read. Storing them in cache has
little to no effect on performance.

This change also allows to omit invalidation of cache when user switch
between proxies and original media.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9473
2020-11-06 15:38:44 +01:00
958ceaf5bf Refactor: move Scene .blend expand to IDTypeInfo callback 2020-11-06 15:37:56 +01:00
2f3181d0f2 Refactor: move Scene .blend lib reading to IDTypeInfo callback 2020-11-06 15:21:57 +01:00
1e7d29b012 Cleanup: rename time related variables
Variables renaned:
 - cfra -> timeline_frame
 - nr -> frame index
 - cfra_over -> overlap_frame

Function seq_give_stripelem_index was renamed to seq_give_frame_index.
2020-11-06 15:13:53 +01:00
e91d2ee777 Blenloader: access report list via api 2020-11-06 15:13:31 +01:00
0c26a44c76 Blenloader: expose BLO_reportf_wrap in api
This function is used by a couple of functions that are moved out of blenloader.
2020-11-06 15:07:10 +01:00
6ab0bd4798 Refactor: move Scene .blend data reading to IDTypeInfo callback 2020-11-06 14:57:36 +01:00
140d6cc4a2 Refactor: move Scene .blend writing to IDTypeInfo callback 2020-11-06 14:49:30 +01:00
a83fcf2b35 CMake: Fix wrong library used for dependency
Was causing compilation failure on fresh builds.
2020-11-06 14:47:46 +01:00
7dd76329e1 Refactor: move PointCache .blend I/O to blenkernel
Ref T76372.
2020-11-06 14:40:54 +01:00
6bca9d8c11 Cleanup: Fluid engine API return types
Use bool return type where possible instead of int (the return values from fluid object are already boolean instead of int).

Also removed several if guards in API functions. If one of the arguments is in fact invalid / nullptr (should not happen though), it better to catch them directly where they failed and not silently escape them.
2020-11-06 14:35:40 +01:00
af35ada2f3 Cleanup: Clang-Tidy, modernize-use-bool-literals 2020-11-06 14:32:51 +01:00
dfa027fe09 Refactor: move sequencer modifier .blend I/O to sequencer module
Ref T76372.
2020-11-06 14:28:33 +01:00
94ce248b30 Cleanup: Alembic, simplify expression
Change `1 + current_mat++` to `++current_mat`.

No functional changes.
2020-11-06 14:24:50 +01:00
047819e728 Cleanup: Alembic, simplify material assignment code
Refactor material assignment code such that:
- `build_mat_map()` just returns the built map (instead of relying on
  modifying a map passed as parameter),
- `LISTBASE_FOREACH` is used to loop over a `ListBase` (instead of a
  hand-crafted for-loop),
- just `return` when not enough material slots can be created (instead
  of setting a boolean to false, then doing some useless work, then
  checking the boolean),
- reorder some code for clarity, and
- rename `mat_map` to `matname_to_material` so that the semantics are
  clearer.

No functional changes.
2020-11-06 14:24:50 +01:00
c32a5ce17c Refactor: move Paint lib linking to blenkernel
Ref T76372.
2020-11-06 14:10:31 +01:00
62223e9851 Refactor: move color settings .blend I/O to blenkernel
Ref T76372.
2020-11-06 14:10:31 +01:00
8d5073345d Cleanup: Clang-Tidy, modernize-use-emplace 2020-11-06 14:06:52 +01:00
cee5a41518 Fix compilation error of bf_draw
Similar to previous commit, missing build dependency.
2020-11-06 13:53:47 +01:00
187adc64b4 Fix compilation error when building from scratch
Make sure the DNA offset files is ready at a time bf_windowmanager
need it.
2020-11-06 13:49:56 +01:00
a331d5c992 Cleanup: Clang-Tidy, modernize-redundant-void-arg 2020-11-06 13:40:46 +01:00
41db8f2fce Refactor: move LightCache .blend I/O to eevee_lightcache.c
Ref T76372.
2020-11-06 13:35:19 +01:00
da96389dcb Refactor: move remaining ViewLayer .blend I/O to blenkernel
Ref T76372.
2020-11-06 13:22:10 +01:00
3ee9e3a04f Cleanup: remove unnecessary function 2020-11-06 13:17:31 +01:00
9ad2965921 Refactor: move Paint .blend I/O to blenkernel
Ref T76372.
2020-11-06 13:16:17 +01:00
e810a16d75 Refactor: move wmWindowManager .blend I/O to IDTypeInfo callbacks 2020-11-06 13:04:56 +01:00
2de454c514 Merge branch 'blender-v2.91-release' into master 2020-11-06 12:57:27 +01:00
3310e6d63e Merge remote-tracking branch 'origin/blender-v2.91-release' 2020-11-06 12:29:45 +01:00
3b77c670f0 Clang Tidy: Expand modernize category
Gives an idea of which warnings are affecting Blender code base.
2020-11-06 12:16:02 +01:00
311031ecd0 Cleanup: Use nullptr everywhere in fluid code
Switched from NULL to nullptr.
2020-11-06 12:06:05 +01:00
37b155420b Merge branch 'blender-v2.91-release' into master 2020-11-06 12:00:50 +01:00
390a0d5624 Fix T82387: Crash loading file saved with recent master in old versions
This fix makes sure new files save `wmWindow.global_areas` under a different
name, so old Blender versions don't recognize and 0-initialize it.

Since enabling global area writing (ef4aa42ea4), loading a file in old
Blender versions would cause `wmWindow.global_areas` to be read, because there
was already reading code for it and `ScrAreaMap` was in SDNA.
However the `ScrArea.global` of the global areas would be NULL, because it was
*not* in SDNA (`ScrGlobalAreaData` was excluded).
Now, issue is that the code assumes that areas in the global area-map have a
valid ScrArea.global pointer.

Think this was a mistake in rB5f6c45498c92. We should have cleared all this data
on reading, until the global area writing was enabled.

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

Reviewed by: Brecht Van Lommel
2020-11-06 11:58:06 +01:00
190170d4cc Cleanup: Clang-Tidy, readability-redundant-member-init 2020-11-06 11:54:53 +01:00
dae004557a Merge branch 'blender-v2.91-release' into master 2020-11-06 10:45:39 +01:00
0573f86587 Cleanup: Clang-Tidy warnings 2020-11-06 09:54:02 +01:00
9c34391e0c Fix compilation error in GHOST
ELEM macro isn't available in GHOST library.
2020-11-06 08:23:13 +01:00
84bbdfb8af Cleanup: Fix the order of info_cfg_option. 2020-11-06 12:46:58 +05:30
ec9241cd59 Cleanup: add missing doxygen group 2020-11-06 01:46:50 -05:00
df4935b29b Cleanup: Fix wrong doxygen groups
Was missed in rB9b6088cb9da4df1a893361997fc1a22986bf6f2e
2020-11-06 01:46:50 -05:00
9762a0992b CMake: configue_file() to pass strings for build-info
Using configue_file(..) would have avoided the breakage from
1daa3c3f0a, caused by buildinfo not properly escaping quotes.

Rely on CMake to escaping strings instead using configure_file().
2020-11-06 17:26:29 +11:00
9a7da1242d Fix uninitialized value
Own mistake in rB74188e65028d268af887ab2140e4253087410c1e
2020-11-06 01:10:51 -05:00
d9e7a42640 Cleanup: use 'BKE_' prefix for initialization functions 2020-11-06 16:43:09 +11:00
3c097af51f Cleanup: use doxy sections for node_group.c 2020-11-06 16:25:09 +11:00
2f58535b78 Cleanup: use if/else check for property poll 2020-11-06 16:02:42 +11:00
f38ad4c66b Cleanup: replace STREQLEN with STRPREFIX for constant strings 2020-11-06 15:56:03 +11:00
2d803d3f6d Cleanup: use STR_ELEM macro 2020-11-06 15:42:03 +11:00
4f140ec7cc Cleanup: Use LISTBASE_FOREACH macro 2020-11-05 22:39:30 -06:00
06c030eaa4 Cleanup: Use descriptive variable names 2020-11-05 22:33:01 -06:00
a51455918c Cleanup: de-duplicate code for instancing objects when linking
Ref D8843
2020-11-06 15:00:07 +11:00
605425c006 Cleanup: doxygen comments 2020-11-06 14:35:38 +11:00
eed6bf22a4 Cleanup: doxygen comments in ghost
Use colon after parameters, use hash to reference symbols.
2020-11-06 14:25:44 +11:00
f11f7ce08e Cleanup: use ELEM macro (>2 args) 2020-11-06 12:54:19 +11:00
d89fedf266 Cleanup: clang-format
Missed this last commit.
2020-11-06 12:46:17 +11:00
aa3a4973a3 Cleanup: use ELEM macro 2020-11-06 12:32:54 +11:00
7cb20d841d Cleanup: follow our code style for float literals 2020-11-06 12:32:54 +11:00
4a78a2774b Cleanup: use bool argument in BLI_noise 2020-11-06 12:32:54 +11:00
29401f8ca2 Cleanup: BLI_noise
Use common prefix as this collided with existing API's (eg BLI_voronoi).

Also expand some non-obvious abbreviations:

- 'g'  -> 'generic'
- 'vl' -> 'variable_lacunarity'
- 'V'  -> 'v3'
2020-11-06 12:32:54 +11:00
155f42a12f Cleanup: remove unused BLI_turbulence1
A slightly modified version of BLI_turbulence1, unused for years.
2020-11-06 12:32:54 +11:00
548b351647 Cleanup: use snake case for BLI_args API 2020-11-06 12:32:54 +11:00
c8f2ad0ab9 Cleanup: remove unused BLI_argsArgv 2020-11-06 12:32:54 +11:00
2bd8f7e059 Cleanup: use string APPEND/PREPEND
Replace 'set' with 'string(APPEND/PREPEND ...)'.
This avoids duplicating the variable name.
2020-11-06 12:32:54 +11:00
7160682b0d Cleanup: transform.h comments, use doxy sections 2020-11-06 12:32:54 +11:00
262eeb3e95 Cleanup: sort structs, files 2020-11-06 12:32:54 +11:00
c19e4b706e Cleanup: clang-format 2020-11-06 12:32:54 +11:00
73ea68d0ca Cleanup: unused variable 2020-11-06 12:32:53 +11:00
Yevgeny Makarov
c99c02d3ba UI: Tweaks to the Warning Icon
Warning Sign Alert Icon given a more rounded border.

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

Reviewed by Pablo Vazquez
2020-11-05 16:11:59 -08:00
1682a47876 Merge branch 'blender-v2.91-release' 2020-11-05 23:42:11 +01:00
057f9caac6 Fix T82400: Dyntopo detail size edit operator visual glitch
Just a missing immUnbindProgram

Reviewed By: sergey

Maniphest Tasks: T82400

Differential Revision: https://developer.blender.org/D9459
2020-11-05 23:28:16 +01:00
e2b3681f09 Fix Dyntopo detail size preview orientation not matching the cursor
Used the sampled cursor normal when available instead of the raycast face normal.
This makes the preview match the previous orientation of the cursor.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9460
2020-11-05 23:26:18 +01:00
00374fbde2 Move "Camera Parent Lock" from preferences to Object Relations
"Camera Parent Lock" can be useful when rigging cameras, but it is not
intuitive, and has also generated a lot of confusion (bug reports).
This is because it breaks the fundamental parent <-> child relationship
conventions in Blender, and there is no indication that it's intended
without diving into the preferences.

This commit moves the setting to the object level, and exposes it in
the relations panel in the property editor. It is exposed for every
object type because any object type can be "View Locked" in the 3D view.
The property description is also updated to reflect this change and be
more specific without getting too long.

In the future this could become a more general feature of the transform
system, but for now it is limited to "Lock Camera to View".

Differential Revision: https://developer.blender.org/D9239
2020-11-05 16:08:00 -06:00
ad481bdd35 Fix T82423: Add modifier key back into keymap
Commit rBf5080c82dd915db6c7b9dd68a52aaaccf2600137
accidentally remove the Shift modifier key from
the `AUTOCONSTRAINPLANE` shortcut.

Differential Revision: https://developer.blender.org/D9480
2020-11-05 23:03:41 +01:00
1b9d9cb1ed Fix T82164: Knife tool draws huge vertices after using bgl.glPointSize
Since it is possible to have multiple draw callbacks, (some of which
use bgl and others gpu), check and force the reset of the drawing status
at the end of each callback.

Differential Revision: https://developer.blender.org/D9476
2020-11-05 18:34:47 -03:00
69e567cfe8 Merge branch 'blender-v2.91-release' 2020-11-05 21:35:27 +01:00
74188e6502 Cleanup: Reduce variable scope
Differential Revision: https://developer.blender.org/D9475
2020-11-05 14:11:32 -05:00
6a2a6fa514 Fix T82428: Cycles crashes when building volume meshes
The Volume Node did not have all of the sockets from its Mesh base class
which are now required due to the recent socket API change.
2020-11-05 18:46:26 +01:00
d9dd408b42 Merge branch 'blender-v2.91-release' into master 2020-11-05 18:00:48 +01:00
8819a4dce8 Spelling: Predefined, Look Up, No One
Fixes 18 misspellings of 'predefined', 'Look Up', 'Lookup', and 'No One'.

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

Reviewed by Hans Goudey
2020-11-05 07:52:58 -08:00
d837923a56 VSE: cache performance optimization
Map frame for cached raw images to strip input media frame range. This
means that static images or extended frame range of movies will only
generate one cache entry.

timeline_frame is stored in cache key as a reference - on what frame
was this entry created, so we don't have to reverse lookup frame range.

Since each media frame corresponds to one cache frame with same frame
index key, there is no need to invalidate raw cache when changing time
remapping properties like use_reverse_frames or strobe

No changes are needed for disk cache, since invalidating raw entry
assumes all data will be invalidated.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9462
2020-11-05 15:55:17 +01:00
8720c66009 Fluid: Potential fix for T74559: Adaptive Domain creates lines in smoke
This commit corrects the maximum resolution field in Fluid objects. The field should be set to the maximum possible resolution, i.e. it should not adjust with adaptive domains and stay constant all the time.

The reason for this is that this resolution value will be used to scale gravity. And this gravity should be constant for adaptive domains too.

It remains to be shown if this issue was the only reason for line-artifacts as seen in T74559.
2020-11-05 15:06:01 +01:00
cba6b4f4a1 Cleanup: add commits to .git-blame-ignore-revs.
Quick python script to print commit messages, and finding
duplicates: P1736
2020-11-05 19:24:07 +05:30
2a6a26bbd7 Rename extern rendering and proxy functions
Replace BKE_sequencer wirh SEQ_render or SEQ_proxy prefixes.
In cases where function is very generic, only SEQ prefix is used.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9439
2020-11-05 14:05:25 +01:00
0f43fe7fa6 Cleanup: split sequencer.c file
Move functions closely related to rendering images and proxies into
render.c and proxy.c files. render.h and proxy.h are created for
functions used internally.

There should be no functional changes.
2020-11-05 13:33:27 +01:00
7bc7b7da2d Merge branch 'blender-v2.91-release' 2020-11-05 18:27:47 +11:00
e0db650483 Merge branch 'blender-v2.91-release' 2020-11-05 16:13:16 +11:00
9ac0541563 Merge branch 'blender-v2.91-release' 2020-11-05 15:48:37 +11:00
a88b9a4e00 Merge branch 'blender-v2.91-release' 2020-11-05 15:48:24 +11:00
63f7e69829 UI: Fix Support for Anonymous Menu Separators
Re-enables support for menus to have items without identifier or name that can be used to separate sections.

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

Reviewed by Hans Goudey
2020-11-04 17:19:46 -08:00
c23ee2a293 Cleanup: Use const for function arguments 2020-11-04 18:53:17 -06:00
86bdc959a3 Fix T82417: Panels draw below others while animating after drag
This adds a new runtime flag for panels that is set during the entire
drag and animation operation. The flag is set recursively so that
sub-panels know to draw on top too.

Note that this also replaces most of the fixes in 1960b8a361 and
8e08d80e52 (D7462) with a more "built-in" solution.
2020-11-04 18:02:27 -06:00
6c3849ea08 Cleanup: Simplify panel collapse handler logic 2020-11-04 16:35:54 -06:00
4572428e86 Cleanup: Remove unused Panel.snap from DNA and handler code
This was a remnant of floating panels from the horizontal layout in
pre 2.5 horizontal panels.
2020-11-04 16:25:38 -06:00
bf36080501 Cleanup: Remove unused drag scaling code for panels
This is done more universally now, and this implementation of this is
no longer used.
2020-11-04 16:05:23 -06:00
f888f3aa1f Cleanup: Make panel function static
These functions were not used elsewhere, and the handling for the panel
tabs should be kept local to this file where possible. Also remove
another unused function and removed an unecessary "_ex" function.
2020-11-04 15:54:56 -06:00
76416f336a Cleanup: Move function to proper file
This lower level drawing function didn't make sense in the panel code,
especially when it is used in multiple other places.
2020-11-04 15:38:11 -06:00
7ee518cf70 Fix T80313: Fix clipped text in splash screen on hiDPI monitors
The current layout gave too little space for the full "Search" string inside
the button.
Fix this by making sure radio-buttons have their text center aligned by default
in pop-ups too, like they do anywhere else.

This does affect a few other cases, e.g. the "RGB"/"HSV"/"Hex" radio-toggles
for color pickers. But this should be fine, I don't think they were ever
intentionally using left-aligned text (while similar buttons outside of pop-ups
didn't).
2020-11-04 22:32:26 +01:00
f9fbe4efd6 Cleanup: Improve property search related comments panel code
The comments related to property search changes should be generally
more correct and more helpful.
2020-11-04 15:30:56 -06:00
4d7ad82347 Cleanup: Use LISTBASE_FOREACH 2020-11-04 14:14:16 -06:00
f45d79f180 UI: Replace uses of "loc/rot" with full words
Use "Rotation" in place of "Rot" for the rotation header text.
Cleanup various RNA titles and tooltips.

Differential Revision: https://developer.blender.org/D9457
2020-11-04 12:36:59 -07:00
eca8cd8449 Cleanup: Remove incorrect comment
This function for replacing a button pointer in button groups is
needed by the block update from old code, so it cannot be removed
like its layout equivalent.
2020-11-04 13:30:59 -06:00
10914987a2 Merge branch 'blender-v2.91-release' 2020-11-04 13:27:13 -06:00
eb21222e64 Transform: Disable snap to plane-face intersection
This feature was added in D5608.
But in practice this confuses more than it helps.
This fixes T82386.
2020-11-04 15:23:08 -03:00
331614e09b Fix T82384: Custom Properties for ShaderNodeTree do not save in blend files.
Not sure why those were excluded, there is no reason not to write ID
data itself for embedded IDs...
2020-11-04 18:16:07 +01:00
afe5345a3f Fix (unreported) memory leak when freeing Master collections.
Potential ID properties there (or any other ID data itself) would not be
freed.
2020-11-04 18:16:07 +01:00
7a8c8ec5e9 Merge branch 'blender-v2.91-release' 2020-11-04 18:13:57 +01:00
c937f9c4e7 Cycles: fix another race condition in Geometry synchronization
This was forgotten in the previous fix, we should not modify sockets
updated in a separated thread.
2020-11-04 16:35:00 +01:00
0802e9cf54 Use compiler check for -fmacro-prefix-map
Use a more reliable method to check the availability of the flag than
compiler versions. Some compilers have different behaviors for
C and C++.

Reviewed By: campbellbarton, ChrisLend

Differential Revision: https://developer.blender.org/D9446
2020-11-04 21:00:29 +05:30
abc5e7d596 Annotations: Set as visible when use the annotation tool
If the annotation draw operator is used, enable the annotations in the current area.

Before this change, some editors had the annotation flag set to OFF, but this could be solved with a versioning code, but this did not solve the root problem. The user can disable annotation visibility in the overlay or side panel, depending on the editor. If the user uses the annotation tool and this flag is OFF, the annotation is not visible, and this is not correct. With this patch, every time the user uses the tool, the annotation visibility flag is set to ON to ensure the annotation is visible.

This solves the problem of T82273, T79578 and T80294

Maniphest Tasks: T82273

Differential Revision: https://developer.blender.org/D9409
2020-11-04 16:13:39 +01:00
b63490bc4b Merge branch 'blender-v2.91-release' 2020-11-04 16:07:03 +01:00
cf9ea111bf macOS: remove deprecated touch event API call
Now that the minimum version is macOS 10.13, we can use the new API.

This reverts commit f97a64aa9b.
2020-11-04 16:01:03 +01:00
fd9124ed6b Fix Cycles volume render differences with NanoVDB when using linear sampling
The NanoVDB sampling implementation behaves different from dense texture sampling, so this
adds a small offset to the voxel indices to correct for that.
Also removes the need to modify the sampling coordinates by moving all the necessary
transformations into the image transform. See also T81454.
2020-11-04 15:09:06 +01:00
43ceb0f047 UI: avoid using "loc/rot", use full words instead. 2020-11-04 14:27:18 +01:00
5af9b9f45b Merge branch 'blender-v2.91-release' 2020-11-04 14:14:38 +01:00
17ccda4fe1 Cycles: fix multithreading issue introduced in previous commit
The issue is that the shaders are stolen from the original Geometry by
the temporary Geometry used to accumulate data, but the main thread
still needs them for syncing the attributes.

So make a copy of the shader array to preserve the data on the original
Geometry.
2020-11-04 14:03:35 +01:00
ed4855ecb4 Modifiers: Fix wrong object when setting error in modifier
This was introduced in rBe4facbbea54019abe257787a7e9e8594a6ce3609.
2020-11-04 13:43:00 +01:00
25a718aa90 Merge branch 'blender-v2.91-release' into master 2020-11-04 13:34:41 +01:00
f7320c3bf1 Fix T82292: Set encoding for keymap export to UTF-8
Keymaps have previously been exported with an encoding dependent
on the current system locale. This caused issues when the
keymap contained non-ASCII characters, for instance in a string
property for an operator.

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D9449
2020-11-04 13:20:10 +01:00
31a620b942 Cycles API: encapsulate Node socket members
This encapsulates Node socket members behind a set of specific methods;
as such it is no longer possible to directly access Node class members
from exporters and parts of Cycles.

The methods are defined via the NODE_SOCKET_API macros in `graph/
node.h`, and are for getting or setting a specific socket's value, as
well as querying or modifying the state of its update flag.

The setters will check whether the value has changed and tag the socket
as modified appropriately. This will let us know how a Node has changed
and what to update, which is the first concrete step toward a more
granular scene update system.

Since the setters will tag the Node sockets as modified when passed
different data, this patch also removes the various modified methods
on Nodes in favor of Node::is_modified which checks the sockets'
update flags status.

Reviewed By: brecht

Maniphest Tasks: T79174

Differential Revision: https://developer.blender.org/D8544
2020-11-04 13:03:33 +01:00
a4a848d01b Merge branch 'blender-v2.91-release' 2020-11-04 22:17:29 +11:00
febfe436b9 Merge branch 'blender-v2.91-release' 2020-11-04 21:59:14 +11:00
e6a940a9b6 Merge branch 'blender-v2.91-release' 2020-11-04 21:59:10 +11:00
819a9622e9 CMake: remove -fmacro-prefix-map from build-info
Quotes caused build-info to fail,
remove these flags since they're not necessary.
2020-11-04 18:41:40 +11:00
9af147b5d3 Cleanup: make format 2020-11-04 02:14:48 -05:00
029e1f066e Cleanup: Add BLI prefix to some BLI_noise functions 2020-11-04 02:07:21 -05:00
72f8a08880 CMake: use path_ensure_trailing_slash for fmacro-prefix-map
Use the native system slash so this can work on windows.
2020-11-04 16:00:37 +11:00
43a2494058 CMake: add path_ensure_trailing_slash utility macro 2020-11-04 15:59:55 +11:00
2f7ec507f4 Cleanup: spelling in curve.c 2020-11-04 15:59:51 +11:00
18729aff27 Merge branch 'blender-v2.91-release' 2020-11-04 15:47:06 +11:00
0511640815 Fix assert on mouseover of blocks not using the layout system
When there was an active button in the "old" block from the last redraw,
this code tried to replace its pointer in the new block's button groups.
But in cases like the outliner or file browser, there are no groups
because the block doesn't use the layout system at all. This commit
just tweaks the assert to check whether there are any button groups.
2020-11-03 22:03:08 -06:00
a31039e1ed Merge branch 'blender-v2.91-release' 2020-11-04 14:54:11 +11:00
11843e7c29 UI: set the message for disabled vertex weight operators 2020-11-04 11:36:55 +11:00
951758c01f Merge branch 'blender-v2.91-release' 2020-11-04 11:33:12 +11:00
4d358855b8 Cleanup: avoid back-slash line continuations 2020-11-04 11:31:43 +11:00
ffa7bfdda5 Cleanup: unused argument 2020-11-04 11:28:31 +11:00
Jesse Y
c861517ca6 UI: Swap order of "Fade Inactive Geometry" in overlays popover
This simply makes the panel a bit nicer given how things are layed out--
the items with larger visual weight are grouped at the top.

Differential Revision: https://developer.blender.org/D9366
2020-11-03 18:21:02 -06:00
564f3be20a Merge branch 'blender-v2.91-release' 2020-11-04 00:04:15 +01:00
dc3fb012e7 Fix T82297: Brush alpha not affecting smear tools strength
The strength of this brush needs to take alpha into account

Reviewed By: sergey

Maniphest Tasks: T82297

Differential Revision: https://developer.blender.org/D9419
2020-11-03 23:55:39 +01:00
4413f481be Merge branch 'blender-v2.91-release' 2020-11-03 16:31:17 -06:00
47876e9c5e Merge branch 'blender-v2.91-release' 2020-11-03 16:25:47 -06:00
e29206f86a Cleanup: Remove broken/deprecated setting of color-ramp button step size
Setting the button's step size like this wouldn't work anymore after
e6f0b60c2e, which is reported in T81794. Instead, the step size should be set
for the RNA property, as proposed in D9277. That will be committed separately
as bug fix.
2020-11-03 22:31:46 +01:00
db7cf3652c Fix for previous cleanup commit 2020-11-03 15:26:23 -06:00
cabec08253 Cleanup: Clang tidy 2020-11-03 15:12:50 -06:00
f109b63431 Merge branch 'blender-v2.91-release' into master 2020-11-04 01:58:10 +05:30
fe7093fae4 Cleanup: Remove dead code in bevel operator
The `poll_property` callback is only used when the `ui` callback isn't
defined.
2020-11-03 14:10:20 -06:00
76683af38c Cleanup: Declare variables where initialized 2020-11-03 13:57:20 -06:00
e3858f4716 Fluid: Updated APIC plugin
Updated version of APIC plugin in order to resolve ASAN issues.
2020-11-03 19:34:31 +01:00
57d1aea64f Cycles: add support for BVH refit in OptiX
This avoids recomputing the BVH for geometries that do not have changes in topology but whose vertices are modified (like a simple character animation), and gives up to 40% speedup for BVH building.

This is only available for viewport renders at the moment.

Reviewed By: pmoursnv, brecht

Differential Revision: https://developer.blender.org/D9353
2020-11-03 18:05:29 +01:00
216880bb47 GPencil: Reorganize Cleanup menu
Reviewed by @mendio
2020-11-03 17:22:03 +01:00
7567086276 GPencil: Add Recalculate Geometry operator to Cleanup menu
This operators was only accesible using the search menu.
2020-11-03 17:22:03 +01:00
ed4540b799 Fix paste f-curve modifiers default "Only Active" value
The tooltip implies that this option should be off per default instead
of on. Some talking with the animators at the studio and in the
animation module confirmed that this seems to be the most logical
default.
2020-11-03 17:21:14 +01:00
5deb2d42d9 Merge branch 'blender-v2.91-release' 2020-11-03 16:39:27 +01:00
6fdcca8de6 Materials: add custom object properties as uniform attributes.
This patch allows the user to type a property name into the
Attribute node, which will then output the value of the property
for each individual object, allowing to e.g. customize shaders
by object without duplicating the shader.

In order to make supporting this easier for Eevee, it is necessary
to explicitly choose whether the attribute is varying or uniform
via a dropdown option of the Attribute node. The dropdown also
allows choosing whether instancing should be taken into account.

The Cycles design treats all attributes as one common namespace,
so the Blender interface converts the enum to a name prefix that
can't be entered using keyboard.

In Eevee, the attributes are provided to the shader via a UBO indexed
with resource_id, similar to the existing Object Info data. Unlike it,
however, it is necessary to maintain a separate buffer for every
requested combination of attributes.

This is done using a hash table with the attribute set as the key,
as it is expected that technically different but similar materials
may use the same set of attributes. In addition, in order to minimize
wasted memory, a sparse UBO pool is implemented, so that chunks that
don't contain any data don't have to be allocated.

The back-end Cycles code is already refactored and committed by Brecht.

Differential Revision: https://developer.blender.org/D2057
2020-11-03 16:35:44 +03:00
91d320edc3 Cycles: immediately store the used_shader list in Blender interface.
Uniform attributes require immediate access to the shader list
in object update code, so setting the field can't be deferred
to a background task. This required adding a parameter to the
clear method of Geometry.

Ref D2057
2020-11-03 16:35:43 +03:00
9bc177d8de Materials: support true float4 attributes in the Attribute node.
Add a new Alpha socket to the Attribute node that outputs the
fourth component of the attribute. Currently the only such
attribute is vertex color, but there may be more in the future.
If the attribute has no alpha channel, the expected value is 1.

The Cycles code is already refactored and committed by Brecht.

Ref D2057
2020-11-03 16:35:43 +03:00
da93da45ee Docs: add comments to some surface deform internal structures 2020-11-04 00:04:48 +11:00
7ceb622fd3 Cleanup: doxy param syntax 2020-11-04 00:01:00 +11:00
f278d814fd Cleanup: spelling 2020-11-03 23:59:24 +11:00
b1efea986d Fix sequence tests writing HTML report to wrong directory
It was missing from tests/report.html that gathers all tests reports.
2020-11-03 13:31:31 +01:00
c21ba10e0b Merge branch 'blender-v2.91-release' 2020-11-03 13:22:22 +01:00
c32bee0099 Cleanup: Use recently added helper function to find File Browser UI data
`ED_fileselect_handler_area_find()` was added in a750acab78 and makes this
case more readable and avoids code duplication as well.
2020-11-03 12:27:20 +01:00
bc0a6b0400 Fix T71759: Sculpt/Vertex/Weight Paint Brush Size Gets Undone After Undoing a Stroke.
Add code preserving scene's toolsettings accross undo.

IDPointers are dealt with special care, we try to keep existing ones for
some (like brushes) when possible.

Note that this covers ToolSettings, Brushes and Palettes currently.

I'm not especially happy about how this new code mixes with existing
'foreach_id' one, in particular in scene. But cannot think of a better,
more generic way to do it currently.

Maniphest Tasks: T71759

Differential Revision: https://developer.blender.org/D9311
2020-11-03 12:09:00 +01:00
5610ccdc08 Add a callback to IDTypeInfo to allow preservation of some data accross memfile undos
This is essentially adding that new callback, and using it only for already
existing Scene's 3DCursor.

Note that the place where this is called has been moved again, after all
have been lib-linked, such that those callbacks may also work on ID pointers.

Maniphest Tasks: T71759

Differential Revision: https://developer.blender.org/D9237
2020-11-03 11:40:29 +01:00
da03eb854b Merge branch 'blender-v2.91-release' 2020-11-03 20:54:26 +11:00
e03575768f Merge branch 'blender-v2.91-release' 2020-11-03 20:54:22 +11:00
093dfdfc94 Merge branch 'blender-v2.91-release' 2020-11-02 22:59:00 -07:00
Jaggz H
fbf2908674 Outliner: Add "Selectable" object filter
This addition to the filters allows the user to enable the
outliner tree to restrict the listing to only Selectable objects.

Differential Revision: https://developer.blender.org/D7310
2020-11-02 22:09:47 -07:00
084db58fbd Cleanup: Use typedef for bevel angle kind enum
This makes debugging slightly easier, and makes the code slightly more
explicit about its intentions.
2020-11-02 23:05:15 -06:00
6290bc4a37 Merge branch 'blender-v2.91-release' 2020-11-02 22:35:15 -06:00
23f3c30b58 Fix T64138: Windows Ink continuous grab at window edge.
WM_POINTERLEAVE occurs when the pen goes out of range or when a
hovering pen leaves the window's boundary. When leaving the window
boundary the xy position is invalid for some Wacom devices.

This change removes creation of GHOST_EventCursor during
WM_POINTERLEAVE events. This prevents unexpected jumping behavior
during continuous grab.
2020-11-02 19:02:16 -08:00
3049704b15 Cleanup: Remove unused parameter in panel code
This is no longer used after rB54da72d3cd546ecb, but passing it to a
recursive call hid the warning.
2020-11-02 18:00:46 -06:00
c067b7460a Fix C operators can't set default display or sort type for File Browser
`WM_operator_properties_filesel()` allows C operators to set a display or sort
type for the File Browser to use. But the File Browser would always override
that because of an invalid `_is_set()` check. (The operators don't actually set
the value, they only set the property's default value.)

The only operator affected by this is "Recover Auto Save". It is supposed to
show a vertical list ordered chronologically. It used settings from the
previous File Browser usage before this patch.

Operators using the File Browser should generally use
`FILE_DEFAULTDISPLAY`/`FILE_SORT_DEFAULT` now, except if they have a reason not
to. See comments at their definition.

----

This makes it so operators that set a different display or sort type
don't change the sort or display type for the next File Browser operation.
So using "Recover Auto Save" entirely isolates display and sort type from other
operations.

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

Reviewed by: Bastien Montagne
2020-11-03 00:00:41 +01:00
a750acab78 Fix possible use-after-free when closing Blender with File Browser open
I think there wasn't actually any issue currently, but only by luck. We still
passed around and NULL-checked a pointer to freed memory (the file operator,
`SpaceFile.op`) which is easy to break and should be avoided.
Noticed while testing D8598.
2020-11-03 00:00:41 +01:00
9cfcc27319 Cleanup: Mark arguments as const 2020-11-02 16:25:59 -06:00
e1665c3d31 VSE: Media transform redesign
This patch changes behavior of strip transform and crop feature.

Purpose of this change is to allow display arbitrary portion of input
image, simplify user interface and workflow.
Offset and Crop values in old files are converted in versioning.
Offset animation is also converted. Crop animation and animation of
crop or offset enable properties is not taken into account

Changes in behavior and interface:
- If image is added to timeline it is scaled to fit inside preview area
while maintaining aspect ratio. Image is centered. This is considered
as a baseline for further transformation.
- Scale and rotation was added, so it is possible to transform image at
it's original resolution.
- Crop will not affect image transformation (does not move image).
- Values of Crop and Transform Position are in pixels, these values are
corrected if preview is fraction of project resolution.
- Transform and Mirror panel has been removed and new Transform panel
and Crop panel is moved to Adjust panel. Mirror is now part of new
Transform panel.

Technical changes:
- Preprocessing stage must work on duplicated image, because original is
cached. Previously Crop and Offset could run at once and required only
one duplication of image. This is not the case with new algorithms, so
duplication on demand is implemented. Transformation can read original
image and will output new image that is safe to modify. It should be
possible to add crop step to transform algorithm, so that Crop won't
require previous duplication though.
- Use Crop and Use Translation checkboxes were removed. Individual
values are compared to default values to check if image needs to be
processed. In case of transform this will be done also if resolution of
source.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8393
2020-11-02 22:15:52 +01:00
6b3eca661d Revert "VSE: Media transform redesign"
This reverts commit 0277579b28.

This commit caused build errors on Linux.
2020-11-02 20:59:21 +01:00
b9ec6c305c Revert "Cleanup: store results of function calls in const values."
This reverts commit 20c4aa13de.

Wrong buggy commit breaking tests, and not actually adding anything to
code quality.
2020-11-02 20:31:12 +01:00
0277579b28 VSE: Media transform redesign
This patch changes behavior of strip transform and crop feature.

Purpose of this change is to allow display arbitrary portion of input
image, simplify user interface and workflow.
Offset and Crop values in old files are converted in versioning.
Offset animation is also converted. Crop animation and animation of
crop or offset enable properties is not taken into account

Changes in behavior and interface:
- If image is added to timeline it is scaled to fit inside preview area
while maintaining aspect ratio. Image is centered. This is considered
as a baseline for further transformation.
- Scale and rotation was added, so it is possible to transform image at
it's original resolution.
- Crop will not affect image transformation (does not move image).
- Values of Crop and Transform Position are in pixels, these values are
corrected if preview is fraction of project resolution.
- Transform and Mirror panel has been removed and new Transform panel
and Crop panel is moved to Adjust panel. Mirror is now part of new
Transform panel.

Technical changes:
- Preprocessing stage must work on duplicated image, because original is
cached. Previously Crop and Offset could run at once and required only
one duplication of image. This is not the case with new algorithms, so
duplication on demand is implemented. Transformation can read original
image and will output new image that is safe to modify. It should be
possible to add crop step to transform algorithm, so that Crop won't
require previous duplication though.
- Use Crop and Use Translation checkboxes were removed. Individual
values are compared to default values to check if image needs to be
processed. In case of transform this will be done also if resolution of
source.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8393
2020-11-02 20:19:16 +01:00
5ed4e1e23a Fix T77819: Snap Incremental does not match grid in all cases
The behavior of the incremental snap did not take into account the
relative dimensions of the window, which resulted in a different behavior
if the area height was greater than the width.
2020-11-02 16:14:03 -03:00
ef4aa42ea4 UI: Enable writing global area data (top-bar, status-bar) to .blend's
There should not be much user visible here (other than T73668 being addressed).

I added the writing code already for the initial implementation of workspaces,
but we decided to keep it disabled until the top-bar design is more clear. It
was never planned to keep this disabled for so long.

Fixes T73668.
2020-11-02 18:35:13 +01:00
cf7343a355 Fix Cycles kernel compile error with NanoVDB because of type redefinition
Cycles defines some basic integer types since it cannot use the standard headers when
compiling with NVRTC. NanoVDB however only does this when the "__CUDACC_RTC__" define
is set and otherwise includes the standard "stdint.h" header which clashes with those typedefs.
So for compatibility do the same thing in the Cycles kernel headers. See also T81454.
2020-11-02 18:00:13 +01:00
1408052781 LibOverride: make some pose options overridable.
Request from the studio.
2020-11-02 17:29:04 +01:00
576bd98622 Grease Pencil UI code: use row for rows in the UI
Rename `col` to `row` when it's actually a row (and not a column).

No functional changes.
2020-11-02 17:18:55 +01:00
aee1e4fc6a UI: Simplify some tool icon geometry
Removing interior vertices can remove some complexity from the final
exports. Also improved the topology slightly in some cases.
2020-11-02 10:10:49 -06:00
20c4aa13de Cleanup: store results of function calls in const values. 2020-11-02 17:08:10 +01:00
db18ba07b5 Fix py-defined pointer properties wrong tag re ID ownership.
This fixes critical bug with liboverride when soe add-ons add some
RNA ID Pointer properties.

ID pointers should **never** have ownership of their ID when defined
from python.

(As a reminder, RNA properties owning their ID pointers are extremely
rare even from C code, only embedded IDs (root node trees, master
collections) and the shape keys snowflakes are concerned.)
2020-11-02 17:08:10 +01:00
4c460a2dbd Fix incorrect colors in grease pencil strength tool icon 2020-11-02 09:52:23 -06:00
7872bcafa0 Cleanup: Document output of BKE_object_where_is_calc and friends
Add a comment to the declaration of the `BKE_object_where_is_calc...()`
functions to explain where the result of the calculation is stored.

No functional changes.
2020-11-02 15:36:18 +01:00
7887e91d31 Cleanup: Sanitise return value of ED_object_parent_set()
Consistently return `false` from `ED_object_parent_set()` when parenting
is not possible. Before, when parent and child were the same object, the
function would return `true` even though the parent-child relation was
not made.

Just returning `false` in the `parent == child` case would break the
parenting operator, as `false` stops its loop over all selected objects.
This tight coupling caused T82312. The loop now has its own check for
this, so that it properly continues, and the implementation of
`ED_object_parent_set()` is decoupled from its surrounding code.

No functional changes.
2020-11-02 15:36:18 +01:00
417ba6aa1c GPencil: Cleanup comments typo error 2020-11-02 15:27:33 +01:00
b1213e8cf9 Add comment about size of generated previews of filebrowser thumnails. 2020-11-02 15:10:38 +01:00
dca65390f0 Another attempt at fixing T81963: Random rare crashes in override code.
Adding another pass of ensuring valid up-to-date pose data in RNA
function itself...
2020-11-02 11:58:01 +01:00
2b98a9269b LibOverride: Do not assert on missing operands in apply function.
This can happen after some changes in lib file and resync in user file
e.g..
2020-11-02 11:58:01 +01:00
f2c7b4a1c5 Re-enable WITH_COMPILER_SHORT_FILE_MACRO, fix build error.
The issue was in `buildinfo.c`:
  char build_c[xx]flags[] = BUILD_C[XX]FLAGS;

Non-escaped double-quotes were terminating the string early, and
causing the compile error. So use single-quotes.
2020-11-02 16:11:10 +05:30
19dec6c8a7 Turn off WITH_COMPILER_SHORT_FILE_MACRO temporarily.
It's causing build errors on compilers that I don't have. Turn it off
while I fix them.

Added in {rB1daa3c3f0a1cfd74bef527e0207f38154e591d46}.
2020-11-02 15:45:59 +05:30
b801369c8e Merge remote-tracking branch 'origin/blender-v2.91-release' 2020-11-02 11:06:22 +01:00
1daa3c3f0a Clang/GCC: use relative path in __FILE__ macro
This change removes the user-specific information from
macros like `__FILE__` and keeps it relative to top level
source or build (for generated files) directory.
It makes traces concise.

Added option `WITH_COMPILER_SHORT_FILE_MACRO` enabled by default.

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D9386
2020-11-02 15:12:10 +05:30
cc09c0d048 Revert "Parenting: fix return value when parenting object to itself"
This reverts commit ad35fa1993, it had
unintended side-effects (T82312).
2020-11-02 10:11:46 +01:00
d49c71e96e Cleanup: use logging for "Found bundled Python" message
This was added when Python was initially bundled so any problems
finding Python could be investigated.

Move this to use logging so we can show this information when needed.
2020-11-02 19:33:32 +11:00
27acf8ced8 Cleanup: remove unused FileList.prv_w/h 2020-11-02 17:09:08 +11:00
0d10621630 Fix incompatible pointer types warning with GCC 2020-11-02 16:49:12 +11:00
Richard Antalik
c887a50f62 Add sequencer transform tests
Tests files are based on test from D8393

Test files should be in `lib\tests\sequence_editing`
These are files, I will add few more tests including animation test.
{F9155273}

Using generic tool to compare rendered vs reference image as other render engines.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9394
2020-11-01 21:34:18 +01:00
Richard Antalik
ea1c5a6c15 Rename BKE_sequencer.h
Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9349
2020-11-01 21:10:36 +01:00
a1f46ac9dc Revert "PyAPI: remove bpy.app.binary_path_python"
This reverts commit 6527a14cd2.

Some 3rd party scripts made use of this so scripts can work with
2.90 to 2.92, although eventually this can still be removed.
2020-11-01 19:11:08 +11:00
4012c6e86f Merge branch 'blender-v2.91-release' 2020-11-01 18:22:19 +11:00
f4d6823fd6 Merge branch 'blender-v2.91-release' 2020-11-01 18:22:16 +11:00
f2fb26575c Merge branch 'blender-v2.91-release' 2020-11-01 18:22:12 +11:00
9de42337c8 Cleanup: Fix typo in comment 2020-10-31 22:54:13 -05:00
c271600101 Fix T82089 Boolean on empty mesh with collection fails.
For the fast solver, there was an optimization carried over
from the non-collection case for empty meshes which did not
work in the chained boolean code for collection operands.
Removed that optimization in the collection case.
2020-10-31 20:48:24 -04:00
c249eb7a8d Fix new boolean performance bug.
The code that decided to use a faster double version of plane
side testing forgot to take an absolute value, so half the time
the exact code was being used when it was unnecessary.
2020-10-31 17:21:18 -04:00
64faa59846 Cycles: Fix debug compilation after tile stealing commit 2020-10-31 14:04:30 +01:00
e7dc3c91ab GPencil: Change maximum limit of Join stroke
Also, clarify comments.
2020-10-31 09:37:10 +01:00
fe90bb86c0 Merge branch 'blender-v2.91-release' 2020-10-31 09:25:13 +01:00
517ff40b12 Cycles: Implement tile stealing to improve CPU+GPU rendering performance
While Cycles already supports using both CPU and GPU at the same time, there
currently is a large problem with it: Since the CPU grabs one tile per thread,
at the end of the render the GPU runs out of new work but the CPU still needs
quite some time to finish its current times.

Having smaller tiles helps somewhat, but especially OpenCL rendering tends to
lose performance with smaller tiles.

Therefore, this commit adds support for tile stealing: When a GPU device runs
out of new tiles, it can signal the CPU to release one of its tiles.
This way, at the end of the render, the GPU quickly finishes the remaining
tiles instead of having to wait for the CPU.

Thanks to AMD for sponsoring this work!

Differential Revision: https://developer.blender.org/D9324
2020-10-31 01:57:39 +01:00
523414dda2 Cleanup: clang-format 2020-10-31 01:57:39 +01:00
316a5914bc Previous check seems to have a race condition, resulting in Wintab not being enabled. 2020-10-30 16:29:04 -07:00
af7b0003cb Add explanation for dequing Wintab PACKETs during WT_PACKET event into a local queue to consume during WM_* mouse events. 2020-10-30 16:29:04 -07:00
50558416b9 Commented assumption was incorrect, using tickCountToMillis causes underflow when compared to current time. 2020-10-30 16:29:04 -07:00
792e145c22 Cleanup: rename functions for consistency with other process*Events functions. 2020-10-30 16:29:04 -07:00
2b01c5a148 Cleanup: Use C style comments, punctuation, and capitalization.
Added missing function documentation.
2020-10-30 16:29:04 -07:00
632b345d35 Update tooltip, Tablet API can now be changed at runtime. 2020-10-30 16:29:04 -07:00
cbc1c83154 Remove Wintab logging. 2020-10-30 16:29:04 -07:00
a9d6eb8f0b Add Wintab debug logging as a CMake option WITH_WINTAB_DEBUG.
Signed-off-by: Nicholas Rishel <rishel.nick@gmail.com>
2020-10-30 16:29:04 -07:00
d9b0ef2de4 Finish the comment's thought explaining pessimistic button ups events for
Wintab.
2020-10-30 16:29:04 -07:00
5badaa8390 Return of the Wintab refactor.
Previously Wintab was handled by saving the most recent tablet pressure and tilt information and deferred appending tablet infromation to Windows mouse events. This caused synchronization issues evident at the beginning and ending of strokes where pressure and tilt were either ahead or behind in time from mouse button up or down events. This also dicarded swaths of data which resulted in blockly grease pencil lines most apparent when a context switch resulted in several coalesced mouse events.

This patch changes the behavior of Wintab to instead rely entirely on Wintab information for pressure, tilt, position, and button input.

Wintab has several design decisions and conventions which complicate relying soley on it's input while retaining current workflows reliant on non-API behavior. For example, many device optionally allow the user to map barrel buttons to non-mouse actions. These mappings may or may not modify the intended behavior when touching the stylus down, such as scroll vs alt mappings. This behavior is not exposed in the Wintab API, but Wintab will continue updating button state sans this necessary context.

To work around the problem, this refactor synchronizations tablet input to Windows mouse down and up events, this captures events which should result in pen input while allowing events such as pen scrolling. Until a Windows mouse down event fires Wintab input is left unprocessed; when a Windows up event occurs Wintab is processed until a corresponding button up event is found.

Wintab allows for either button state or changes to be reported, but not both. An earlier refactor tried to use button changes to let state to be managed by Wintab. This was replaced when it was found that button change events were unreliable at corner cases such as switching windows. It was also found that with Wacom drivers Wintab peek functions would modify events in the queue causing errant and loss of button events.

For the latter stated reason this patch opts to read all Wintab events into a queue as they arrive, removing events as they become stale. This was chosen over using Wintab peek functions due to the afformentioned issue. As a bonus this seems to work better as it prevents the queue in Wintab from filling, thus neither a flood of events need to be handled when Wintab processing begins and a Wintab implementation need not be trusted to overwrite old events in it's queue.

Maniphest Tasks: T75566

Differential Revision: https://developer.blender.org/D7840
2020-10-30 16:29:04 -07:00
0ee4b0b965 Before a wintab button event is generated, generate a GHOST mouse move
event to the button down location as this should be a more accurate point
of contact than the last mouse move event.

Signed-off-by: Nicholas Rishel <rishel.nick@gmail.com>
2020-10-30 16:29:04 -07:00
7599571904 Adding explanitory comment to explain why tablet API check is necessary
for Pointer input even when Wintab should be preventing Pointer events.

Signed-off-by: Nicholas Rishel <rishel.nick@gmail.com>
2020-10-30 16:29:04 -07:00
a080accdb6 When there are not associated button events, assume there is no button
events until one is found. This prevents errant cursor moves that occur
before the Wintab button event is reported. We need to skip these events
because if no button event exists, we generate one assuming it will either
arrive later in the Wintab queue or that the button was from a non-Wintab
device. For the case that this was generated by a non-wintab device, such
as buttons mapped to mouse on the tablet pad, these cursor move events can
significantly move the cursor from the intended click position.

Signed-off-by: Nicholas Rishel <rishel.nick@gmail.com>
2020-10-30 16:29:03 -07:00
1f25235ec3 Clarify comment to be more specific so that in the future someone knows
the issue with Wintab button events are more significant than simply
setting what buttons should receive button up/down events during context
initialization.

Signed-off-by: Nicholas Rishel <rishel.nick@gmail.com>
2020-10-30 16:29:03 -07:00
efe3e4f023 Save Wintab packets to a local queue as WT_PACKET events arrive or when
handling mouse input. This Wintab to mouse synchronization issues, and
likely prevents queue exhaustion for some Wintab implmenetations.

Signed-off-by: Nicholas Rishel <rishel.nick@gmail.com>
2020-10-30 16:29:03 -07:00
d58387cdda Correcting the type for indexing Wintab buttons.
Signed-off-by: Nicholas Rishel <rishel.nick@gmail.com>
2020-10-30 16:29:03 -07:00
14cddad034 Change updateWintab interface to include whether window is visible so that
window intitialization can specify whether it will be visible regardless
of whether it is yet visible.

Signed-off-by: Nicholas Rishel <rishel.nick@gmail.com>
2020-10-30 16:29:03 -07:00
b98ea1b268 Revert "Mask all button down/up and switch back to using relative button input."
This reverts commit 045aaf6f78f1fbb6e2bbefd234b7bae04844d42b.
2020-10-30 16:29:03 -07:00
c4821079b7 Fix type for physicalButton in wintabMouseToGhost.
Signed-off-by: Nicholas Rishel <rishel.nick@gmail.com>
2020-10-30 16:29:03 -07:00
a6e31482e9 Fix return value of WTPacketsGet.
Signed-off-by: Nicholas Rishel <rishel.nick@gmail.com>
2020-10-30 16:29:03 -07:00
a5f3c0e563 Move assignments into initializer list for GHOST_EventButton
and GHOST_EventCursor.

Signed-off-by: Nicholas Rishel <rishel.nick@gmail.com>
2020-10-30 16:29:03 -07:00
1b535e8719 Mask all button down/up and switch back to using relative button input.
Signed-off-by: Nicholas Rishel <rishel.nick@gmail.com>
2020-10-30 16:29:03 -07:00
3281507f7b Document inline that PACKETDATA and PACKETMODE modify external headers to
discourage reducing their scope to the only place they're used internally.

Signed-off-by: Nicholas Rishel <rishel.nick@gmail.com>
2020-10-30 16:29:03 -07:00
538a2ac58f Allow double button up, otherwise there may be a trailing 0 pressure line.
Signed-off-by: Nicholas Rishel <rishel.nick@gmail.com>
2020-10-30 16:29:03 -07:00
7c84f25453 Fix T75566
Button events now include tabletdata, so move is unnecessary.

Generate mouse button events when the system has an event but Wintab did not find a correlated event.

Only filter mouse button events, not Win32 Pointer events.

Signed-off-by: Nicholas Rishel <rishel.nick@gmail.com>

Maniphest Tasks: T75566

Differential Revision: https://developer.blender.org/D7404
2020-10-30 16:29:03 -07:00
70ca48b67f Button events now include tabletdata, so move is unnecessary.
Signed-off-by: Nicholas Rishel <rishel.nick@gmail.com>
2020-10-30 16:29:03 -07:00
abbdfc8bf7 Revert "Revert "Windows: support high resolution tablet pen events for Wintab""
This reverts commit e90d8422d0.
2020-10-30 16:29:03 -07:00
c503c5f756 Fix T82244: Crash when trying to use the rotate operator on the timeline
Some tranform modes are not expected to be used in the `SPACE_ACTION`.
2020-10-30 20:13:05 -03:00
81090ded0d Fluid: Removed binary_python from fluid script
This hack is no longer required. It was fixed in rB52b38d9c3d84 and temporarily disabled in rBa877248ac203.
2020-10-30 18:36:21 +01:00
99a7c917ea Sculpt: Dyntopo detail size edit operator
This introduces a new operator to edit the detail size of constant
detail mode in dyntopo. The way this operator works and the
functionality it provides is similar to the "Voxel size edit" operator
for the voxel remesher.

It also includes a sample mode. When pressing Ctrl, the detail size
will be sampled from the surface under the cursor, updating the
preview in real time. This allows quick resolution changes without
using the operator multiple times.

The operator is set to Shift + D, replacing the old way to change
the constant detail size of dyntopo. Shift + R will remain available to
be enabled when the voxel remesher works with dyntopo. Deciding
if both detail sizes can be unified needs a separate discussion as the
new dyntopo can work with detail sizes in parts of the mesh that can
easily crash the remesher.

The structure of these operators is similar, but the data they control,
ranges, drawing and setup functions are completely different, making it
hard to merge them into one.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9355
2020-10-30 18:13:25 +01:00
39be996452 Sculpt: Add pie menu for global automasking options
Global automasking options are usually turned on/off for quick
adjustments both in brushes and filters, so it is convenient to have them
in a pie menu.

This uses the Alt + A shortcut.

Reviewed By: dbystedt, HooglyBoogly

Differential Revision: https://developer.blender.org/D9282
2020-10-30 18:09:54 +01:00
15cb67e0b0 Sculpt: Add normal orientation to lasso trim tool
This adds an option to orientate the trimming shape using the surface
normal instead of the view when lasso trim is used.

Reviewed By: dbystedt, sergey

Differential Revision: https://developer.blender.org/D9231
2020-10-30 18:09:03 +01:00
492a9e4023 Fix crash when using multiple Sculpt Vertex Color layers for rendering
This line was probable left there after a bad merge.

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D9367
2020-10-30 18:07:51 +01:00
0270223552 Merge branch 'blender-v2.91-release' 2020-10-30 17:37:23 +01:00
62e532785d Refactor: move WorkSpace .blend I/O to IDTypeInfo callbacks 2020-10-30 16:32:55 +01:00
a877248ac2 Fluid: Switch to binary_python
This change is required since rB52b38d9c3d84. Why a bpy reference is there in the first place is to be investigated.
2020-10-30 16:25:43 +01:00
12c92433d8 Refactor: move bScreen .blend I/O to IDTypeInfo callbacks
I could not easily move `direct_link_screen` yet, because it
has a return value. That has to be solved differently at some point.
2020-10-30 16:01:26 +01:00
e6f61a4a37 GPencil: New material parameter to rotate texture
Add a parameter to rotate the texture for Dots and Squares

Differential Revision: https://developer.blender.org/D9369
2020-10-30 15:45:00 +01:00
aacdc39958 Merge branch 'blender-v2.91-release' into master 2020-10-30 15:34:12 +01:00
fc9ec1b9d8 Refactor: move Area .blend I/O to blenkernel
There should be no functional changes.
Eventually, it would be good to handle the different space types
using callbacks.

Ref T76372.
2020-10-30 15:28:17 +01:00
a8c165f2a4 Merge branch 'blender-v2.91-release' 2020-10-30 15:16:04 +01:00
c0beeeb5de Fix buffer-overflow in lattice deform evaluation
Caused Victor.blend from the cloud to crash with ASan. Four floats are
fetched from the stack, but the buffer was only three wide.

Caused by 042143440d. Issue was probably harmless since the fourth
element wasn't actually touched.
2020-10-30 14:56:32 +01:00
bcb612e361 Refactor: move view3dshading .blend I/O to blenkernel
Ref T76372.
2020-10-30 14:44:03 +01:00
ada45463b3 Refactor: move ParticleSettings .blend I/O to IDTypeInfo callbacks 2020-10-30 13:43:34 +01:00
f6d9a36534 Merge remote-tracking branch 'origin/blender-v2.91-release' 2020-10-30 13:17:49 +01:00
4c7b1766a7 Fix undo steps not allowing re-using old BMain in non-global undo.
Non-memfile undo steps never properly initialized the flag allowing to
re-use old Main data during undo/redo. This lead to doing a complete
full re-reading of data when undoing/redoing mode switches e.g.

Note that current undo system is supposed to support any kind of mode
switch across those steps, however this needs to be properly deeply
tested, so only comitting this to master. It would be way too risky for
2.91 release.
2020-10-30 11:51:48 +01:00
30b17e30f8 Fluid: Cleanup for APIC debug build setup
Fixes build issue
2020-10-30 11:15:24 +01:00
57d77bd922 Cleanup: malformed doxygen sections 2020-10-30 21:10:09 +11:00
9333f660d0 Docs: note the purpose of UserDef_Runtime.is_dirty 2020-10-30 21:00:43 +11:00
08d40ecbd8 Merge branch 'blender-v2.91-release' 2020-10-30 20:56:55 +11:00
62b68745fd Merge branch 'blender-v2.91-release' 2020-10-30 20:56:52 +11:00
ebb8f8fffc Merge branch 'blender-v2.91-release' 2020-10-30 20:56:48 +11:00
841517ca81 Merge branch 'blender-v2.91-release' 2020-10-30 20:56:45 +11:00
ff73dc244c Merge remote-tracking branch 'origin/blender-v2.91-release' 2020-10-30 10:52:25 +01:00
8bdf191461 Fluid: Added APIC simulation method
Basic support for velocity updates with the APIC method.

This commit adds APIC to the already existing dropdown menu for the simulation method. The APIC plugin within Mantaflow has been updated to the latest version.
2020-10-30 09:52:05 +01:00
e3e5d595f6 Outliner: Remove "ID" from tooltip
The concept of IDs shouldn't be exposed to the user.
2020-10-29 21:50:47 -06:00
b018582cd3 Cleanup: parse '--thread' as part of ARG_PASS_ENVIRONMENT
While this isn't needed at the moment, it's possible
the animation player uses the scheduler in the future.
2020-10-30 13:30:16 +11:00
6ab8cbc68c Text: support "Text to 3D Object" for read-only data
Add poll function for read-only text data,
for operators that don't require the text to be editable.
2020-10-30 12:51:38 +11:00
6250a8725e Cleanup: Use an enum to set instanced panel expansion
This commit uses an enum to access expansion for specific panels for
each modifier, constraint, etc. Even though these values are quite simple,
 this can help make the code more explicit when the ui_expand_flag is
accessed directly. Also update comments about this bitfield to make
them consistent.
2020-10-29 19:34:29 -05:00
81a0fffb2d Fix T82205: Curve Hooks not working
Caused by my own cleanup commit rBa308607a5334. Just a simple copy-paste
error. Here the difference between `curve` and `editnurb` makes quite a bit
of difference.
2020-10-29 18:21:48 -05:00
d35cd32d56 Cleanup: Use doxygen sections
After the changes in D7997, this whole file will use doxygen sections.
2020-10-29 17:37:44 -05:00
e997eb8bf7 GPencil: Fix compiler warnings
These warnings were not vivible in MSVSC
2020-10-29 23:32:19 +01:00
21f201e25e GPencil: Improve join operator
Now the strokes join the points near, not always end with start.

Differential Revision: https://developer.blender.org/D9359
2020-10-29 20:15:00 +01:00
b85504337e Refactor: move Collection .blend I/O to IDTypeInfo callbacks
This one was a bit more tricky, because the file loading is
mixed with versioning code and because collections are
embedded into scenes.

All tests that passed before, still pass.
2020-10-29 19:34:15 +01:00
7bf0682aa9 GPencil: Add interpolate operators in Draw mode
Now the interpolate is available in draw mode (except the option of selected strokes).

Differential Revision: https://developer.blender.org/D9325
2020-10-29 19:22:42 +01:00
d9b22b8094 Merge branch 'blender-v2.91-release' 2020-10-29 17:41:46 +01:00
4bf565460d Merge branch 'blender-v2.91-release' 2020-10-29 17:27:21 +01:00
Yevgeny Makarov
dfc576426b Allow Trackpad Ctrl-Pan to Cycle Enum Values
Allow Trackpad Ctrl-Pan to cycle enum values. Also allows cycling in more button types.

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

Reviewed by Brecht Van Lommel
2020-10-29 09:03:49 -07:00
c26ad42ea4 Simplify and enable NanoVDB dependency installation
Changes NanoVDB to be a standalone dependency that is independent of the OpenVDB one.
It works by downloading the "feature/nanovdb" branch of OpenVDB, but using the NanoVDB
CMake in the "nanovdb" subdirectory. Since it is header-only, only the install target is used.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D9383
2020-10-29 17:02:12 +01:00
Yevgeny Makarov
c1b30e0ed1 Fix for T78211: Trackpad Zoom to Mouse Position Error
When using a trackpad Zoom to Mouse Position would always zoom to center of canvas.

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

Reviewed by Brecht Van Lommel
2020-10-29 08:27:48 -07:00
Yevgeny Makarov
962a0a6c66 Allow Building Without UI_PROP_DECORATE
Allow project to build without definition of optional UI_PROP_DECORATE.

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

Reviewed by Julian Eisel
2020-10-29 08:16:34 -07:00
f75b09e7e6 Cycles: abort rendering when --cycles-device not found
Rather than just printing a message and falling back to the CPU. For render
farms it's better to avoid a potentially slow render on the CPU if the intent
was to render on the GPU.

Ref T82193, D9086
2020-10-29 16:01:38 +01:00
09be2a8358 BLI: use forwarding reference in Map
The is necessary when Map.add_or_modify is called with callbacks that
return a reference.
2020-10-29 15:19:43 +01:00
569b7c2821 Cleanup: remove unused Blender Internal render stats code 2020-10-29 14:23:06 +01:00
f4e8c0c104 Anim UI: Playback Sync menu improvement
Relabel the Playback Synchronisation menu so that it's clear:
- what does happen (instead of describing what does //not// happen), and
- that the synchronisation options don't just affect audio.

The changes are:
- Change label from "Audio" to "Sync"
- Change the labels of the sync enum:
    - No Sync → Play Every Frame
    - Frame Dropping stays the same
    - AV-sync → Sync to Audio

The "Audio" label has moved one option down, as that option does
actually relate to audio.

Reviewed By: looch, Severin, HooglyBoogly, campbellbarton

Differential Revision: https://developer.blender.org/D9269
2020-10-29 12:31:53 +01:00
b866100c1f Cleanup: spelling 2020-10-29 21:38:40 +11:00
Yevgeny Makarov
d26b746e36 UI: use "Save As" when saving un-saved image/text files
Now the behaviors are consistent for blend, image and text files:

- If the file is not writable, will report it.
- If the file is new (without a path), save as will be used.
- If the file was deleted, will try to recreate it.

Ref D6755
2020-10-29 21:11:23 +11:00
Ivan Perevala
cf78053027 Libmv: Fix clang inconsistent-missing-override warnings.
Reviewed By: sergey, ankitm

Differential Revision: https://developer.blender.org/D9377
2020-10-29 10:19:50 +01:00
e652ea5ab3 Merge branch 'blender-v2.91-release' 2020-10-29 10:05:29 +01:00
440ed3ade8 Fix T82188: Sculpt Grab Silhouette and symmetry fails
Wasnt checking the symmetrized 'grab_delta_symmetry' so result could
flip around.

Maniphest Tasks: T82188

Differential Revision: https://developer.blender.org/D9373
2020-10-29 09:47:05 +01:00
110d6a5130 Merge branch 'blender-v2.91-release' 2020-10-29 09:45:28 +01:00
e78ded8b0f Merge branch 'blender-v2.91-release' 2020-10-29 13:15:49 +11:00
83f369a0b9 Merge branch 'blender-v2.91-release' 2020-10-29 11:29:13 +11:00
Yevgeny Makarov
cac8a7cddb Fix for T65714: Pinch Zooming Crash using Mac Trackpad
Ensure that Zoom does not crash on Mac Trackpad by checking for existence of Continuous Zoom timer.

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

Reviewed by Julian Eisel
2020-10-28 16:40:28 -07:00
Yevgeny Makarov
b0a9a04f62 UI: Improvements to Close File Dialog
Improved alignment of items on the File Close Dialog.

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

Reviewed by Hans Goudey
2020-10-28 16:22:37 -07:00
Yevgeny Makarov
6bf043ac94 UI: Improved alignment of labels and buttons
Improved alignment of labels with other buttons.

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

Reviewed by Julian Eisel
2020-10-28 16:01:51 -07:00
d32188b85b Mesh: Fix BKE_mesh_translate changes referenced layer
This is the same fix that is implemented in rB3791dbea1e79.
2020-10-28 20:15:50 +01:00
0e47e57eb7 Outliner: Properties editor sync on selection
When outliner datablocks are selected, switch to the corresponding tab
for that datablock in properties editors. Only properties editors
that share an edge with the outliner will change tabs.

Additionally, when modifiers, constraints, and shader effects are
selected from the outliner, the panel will be expanded in all properties
editors.

Part of T77408

Manifest Task: https://developer.blender.org/T63991

Differential Revision: https://developer.blender.org/D8638
2020-10-28 11:54:29 -06:00
Yevgeny Makarov
5af8fc8192 UI: Improved Checkbox Width Calculation
Improved calculation of checkbox width to include line width preference.

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

Reviewed by Hans Goudey
2020-10-28 10:21:18 -07:00
Yevgeny Makarov
f7e4b209e2 UI: Misc Label and Description Changes
Various changes to some labels and descriptions to be more accurate, clear, or less confusing.

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

Reviewed by Hans Goudey
2020-10-28 10:10:41 -07:00
9f8acce3ab Cleanup: name parameters instead of commenting them.
It generates warning C4138 in MSVC:
> '*/' found outside of comment

Old code added in {rBafd13710b897}
2020-10-28 21:48:33 +05:30
Yevgeny Makarov
683dc71c3c UI: Improve Text on 'Color Grid' Image
Change the sequence of characters shown on the 'Color Grid' generated image.

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

Reviewed by Hans Goudey
2020-10-28 09:03:42 -07:00
Yevgeny Makarov
1ebb7afe1d UI: Popover Position Change
Move popover down a very slight amount to fix clipping of its arrow tip.

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

Reviewed by Julian Eisel
2020-10-28 08:53:41 -07:00
8c04337231 Merge branch 'blender-v2.91-release' into master 2020-10-28 21:18:55 +05:30
a087196a45 GPencil: Change trace tooltip for Threshold 2020-10-28 16:07:33 +01:00
abdd0198c0 GPencil: Change Trace tooltips 2020-10-28 15:41:16 +01:00
a5d237ac85 GPencil: New support to trace sequence images
Now it's possible to trace a sequence of images and not just a single one

When the trace is for more than one image, a bacth job is started to process all frames.

Note: All trace data is generated by Potrace library.

Differential revision: https://developer.blender.org/D9316
2020-10-28 15:36:01 +01:00
73378c2ba2 BLI: improve Map.add_new
Now it is possible to use Map.add_new_as which supports different types
for the key and value.
2020-10-28 13:57:53 +01:00
322b6ac52b UI: Save Preferences Button Not Translating
Ref D9338
2020-10-28 23:04:50 +11:00
70040e7b0b Cycles: internal support for alpha output for attribute node
Not exposed in Blender yet.

Ref D2057
2020-10-28 12:43:42 +01:00
b7558e3c9c Cycles: internal support for per-instance and per-geometry attributes
The existing code for this was incomplete. Each instance can now have a set
of attributes stored separately from geometry attributes. Geometry attributes
take precedence over instance attributes.

Ref D2057
2020-10-28 12:43:42 +01:00
0767683496 Cycles: refactor to make attribute lookup slightly more efficient
Ref D2057
2020-10-28 12:43:42 +01:00
d58b55b55a Cycles: internal support for float4 geometry attributes
Previously only float3 and byte4 was supported.

Ref D2057
2020-10-28 12:43:42 +01:00
ee6b989f8e Cycles: refactor to split surface and volume attribute lookup more
This avoids OpenCL inlining heavy volume interpolation code once for every
data type, which could cause a performance regression when we add a float4
data type in the next commit.

Ref D2057
2020-10-28 12:43:42 +01:00
fb88d4eda8 Add a Un-Bake FCurves operator
We already had the ability to bake fcurves but no way to convert the
baked result back without using python. This patch adds and operator
that is available now next to the bake operator in the drop down menu,

Reviewed By: Sybren

Differential Revision: http://developer.blender.org/D6379
2020-10-28 11:45:24 +01:00
2f7c6149fc Merge branch 'blender-v2.91-release' into master 2020-10-28 11:08:42 +01:00
2468635174 Tracking: Move optical center to lens panel
Optical center is in fact a property of lens rather than a camera body.
2020-10-28 10:39:37 +01:00
0269f0c574 Tracking: Simplify configuration of intrinsics to refine
Previously, only predefined and limited set of intrinsics combinations
could have been refined. This was caused by a bundle adjustment library
used in the early days of the solver.

Now it is possible to fully customize which intrinsics are to be refined
during camera solving. Internally solver supports per-parameter settings
but in the interface they are grouped as following:

* Focal length
* Optical center
* Radial distortion coefficients (which includes k1, k2, k3, k4)
* Tangential distortion coefficients (which includes p1, p2)

Differential Revision: https://developer.blender.org/D9294
2020-10-28 10:21:07 +01:00
1b1f46a98c Libmv: Fix typo in packed intrinsics
Was using doing an implicit cast of floating point value to boolean.
Was not noticed before because the boolean value was never never used.
2020-10-28 10:13:08 +01:00
283c7fecf9 Tracking: Decouple refine settings
Historically the refine options had a hardcoded list of possibilities.
This was caused by an old bundle adjustment code which did not support
all possible combinations.

Now the bundle adjuster is based on Ceres solver, allowing to refine
anything in any combination.
2020-10-28 10:13:08 +01:00
02ecf29d05 Merge branch 'blender-v2.91-release' 2020-10-28 19:43:58 +11:00
6527a14cd2 PyAPI: remove bpy.app.binary_path_python
This is deprecated in 2.91,
remove for 2.92 in favor of 'sys.executable'.
2020-10-28 17:40:07 +11:00
fb3f0d3cf0 Merge branch 'blender-v2.91-release' 2020-10-28 17:33:17 +11:00
1be819ea66 Cleanup: update comments
Some references to argument levels were still in comments.
2020-10-28 16:00:26 +11:00
a0f2866a8e Cleanup: update old comment for why we can't use PySys_SetArgv 2020-10-28 14:04:44 +11:00
58fc155976 Cleanup: move WM_init & arg parsing out of if/else branch 2020-10-28 14:04:44 +11:00
6445caa9b5 BLI_args: disallow zero to be used as a pass value
Introduced recently in 09139e41ed.
While this worked in the cases it was used, '--threads' for example
was failing to parse the number when it's pass was set to 0.

Increase the enum values to start at 1 &
add asserts so this wont happen again.
2020-10-28 14:04:44 +11:00
c518cd73cd Cleanup: use enum for command line argument passes 2020-10-28 14:04:44 +11:00
6ac46c9708 BLI_args: refactor argument passes
Avoid passing the pass argument to BLI_argsAdd, instead set this
once for each group of passes.

This means we can add new passes without having to bump the arguments
to BLI_argsAdd.
2020-10-28 14:04:41 +11:00
5711b85147 Cleanup: Remove unused IDProperty function
This function from 2017 came with a comment: "TODO Nuke this once its
only user has been correctly converted to use generic IDmanagement"
Since it is unused after rB91462fbb31ba, now is time to remove it.

Differential Revision: https://developer.blender.org/D9368
2020-10-27 20:12:42 -05:00
9dac5456b9 Merge branch 'blender-v2.91-release' 2020-10-28 11:52:15 +11:00
Yevgeny Makarov
d28676d89a UI: Move the 'Resolve Conflict' button closer to the text data-block
Moves the Text Editor 'Resolve Conflict' button closer to data-block selector and with 'Question' icon.

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

Reviewed by Hans Goudey
2020-10-27 16:30:37 -07:00
024b65b5e5 Cleanup: Update comment
This comment has to be updated since it was moved
from the header file to the source file.
2020-10-27 17:14:40 -05:00
1504ed99e6 Fix use after free in interface handler
ASAN reported a use after free in after rB15d78ea85b602c. This commit
removed a reassignment of the `data` variable here that was actually
required because it may have been freed earlier in the function. This
sort of error would be avoided if the same variable wasn't reused for
different purposes.
2020-10-27 13:44:47 -05:00
c80594f57f GPencil: New parameter in Texture modifier to rotate Dot textures
This new parameter allows to rotate the texture of any Dot or Square stroke.

Differential Revision:  https://developer.blender.org/D9343
2020-10-27 17:59:48 +01:00
3a7a936525 Merge branch 'blender-v2.91-release' 2020-10-27 17:39:59 +01:00
471c0bcd44 git blame: add file to help ignore cleanup commits
wiki.blender.org/wiki/Tools/Git#Tips has been updated.

A follow up to
lists.blender.org/pipermail/bf-committers/2020-October/050698.html
will be sent after commit.

Reviewed By: brecht, campbellbarton

Differential Revision: https://developer.blender.org/D9234
2020-10-27 20:20:39 +05:30
90e12e823f Fix T81854: crash when undoing switch between sculpt and edit mode.
The logic of `BKE_sculpt_update_object_for_edit` was not correct. such
low-level functions should typically never preform depsgraph evaluation
themselves, they should be able to rely on getting a fully evaluated
depsgraph and just get needed data from there.

Supporting that required fixing other broken code higher in the
callstack, namely:
* `ED_object_sculptmode_enter_ex` was freeing evaluated data, for no
  valid reason it would seem.
* `sculpt_undosys_step_decode` was ensuring an evaluated depsgraph
  **before** calling `ED_object_mode_generic_exit`, which would
  invalidate a lot of evaluated data.

Note that it is fairly difficult to track down all code paths leading to
`BKE_sculpt_update_object_for_edit`, so there may be still cases where
this gets called with improperly evaluated depsgraph.

Reviewed By: sergey

Maniphest Tasks: T81854

Differential Revision: https://developer.blender.org/D9270
2020-10-27 15:27:07 +01:00
f6990c235a Merge branch 'blender-v2.91-release' 2020-10-27 15:13:39 +01:00
4b188bb08c Cleanup: use over-line for doxy comments
Follow our code style for doxygen sections.
2020-10-27 21:45:55 +11:00
30f626fe4c Revert "Cycles API: encapsulate Node socket members"
This reverts commit 527f8b32b3. It is causing
motion blur test failures and crashes in some renders, reverting until this is
fixed.
2020-10-27 11:40:42 +01:00
17381c7b90 Multires: Remove simple subdivision type
The simple subdivision as a type only causes issues like no-continuous
normals across edges, inability to reliably switch the type and things
like this.

The new subdivision operators supports wider variety of how to add
details to the model, which are more powerful than a single one-time
decision on the subdivision type.

The versioning code is adjusting topology converter to specify all
edges as infinitely sharp. The reason for this (instead of using
settings.is_simple) is because in a longer term the simple subdivision
will be removed from Subsurf modifier as well, and will be replaced
with more efficient bmesh-based modifier.

This is finished up version of D8436.

Differential Revision: https://developer.blender.org/D9350
2020-10-27 10:31:48 +01:00
09139e41ed Cleanup: simplify order of initialization with argument parsing
Sub-systems that use directories from BKE_appdir needed to be
initialized after parsing '--env-system-datafiles'.

This meant the animation player needed to call IMB_init it's self.

Avoid this complication by having a pass that can be used to setup
the environment before Blender's resources are accessed.

This reverts the workaround from 9ea345d1cf
2020-10-27 18:45:42 +11:00
Ivan Perevala
eebe274312 RNA: remove duplicate of Brush.tex_paint_map_mode
Use Brush.map_mode instead.

Ref D9290
2020-10-27 17:38:29 +11:00
4d15f4ac5b Cleanup: Use const for PointCloud variable 2020-10-26 23:12:22 -05:00
c686951233 Cleanup: improve comment about shape keys, correct spelling 2020-10-27 14:16:26 +11:00
6133159311 Merge branch 'blender-v2.91-release' 2020-10-27 14:13:39 +11:00
5e8c135540 Merge branch 'blender-v2.91-release' 2020-10-27 14:13:35 +11:00
Erik Abrahamsson
716af6a470 Modifier: apply modifier now works for lattice
Ref D9337
2020-10-27 13:27:08 +11:00
527f8b32b3 Cycles API: encapsulate Node socket members
This encapsulates Node socket members behind a set of specific methods;
as such it is no longer possible to directly access Node class members
from exporters and parts of Cycles.

The methods are defined via the NODE_SOCKET_API macros in `graph/
node.h`, and are for getting or setting a specific socket's value, as
well as querying or modifying the state of its update flag.

The setters will check whether the value has changed and tag the socket
as modified appropriately. This will let us know how a Node has changed
and what to update, which is the first concrete step toward a more
granular scene update system.

Since the setters will tag the Node sockets as modified when passed
different data, this patch also removes the various `modified` methods
on Nodes in favor of `Node::is_modified` which checks the sockets'
update flags status.

Reviewed By: brecht

Maniphest Tasks: T79174

Differential Revision: https://developer.blender.org/D8544
2020-10-26 23:11:14 +01:00
Pablo Dobarro
d6180dd2f7 Sculpt/Paint: Add Paint Studio Light preset
This studio light preset is designed for color painting tasks. As color
are multiplied on top of the current studio light/matcap, this should be
as white as possible and with very soft speculars to avoid color
distorsion while showing the volume of the mesh.

Reviewed By: jbakker, JulienKaspar

Differential Revision: https://developer.blender.org/D8209
2020-10-26 20:35:37 +01:00
45e8218f90 Merge branch 'blender-v2.91-release' into master 2020-10-26 18:35:34 +01:00
183c2fe031 Merge branch 'blender-v2.91-release' into master 2020-10-26 17:37:16 +01:00
501854e4ee Fix T81421: "Saving As..." a blend file with a Script node file path filled with 1023 symbols crashes Blender.
Usual lack of protection against buffer overflows when manipulating
strings.

Also add some basic tests for `BLI_path_rel`.
2020-10-26 17:22:34 +01:00
253ae3d3f0 Merge branch 'blender-v2.91-release' 2020-10-26 16:33:54 +01:00
841eaebfa4 Cycles: Add support for OptiX 7.2 SDK 2020-10-26 15:43:55 +01:00
9d24d1b20c Merge branch 'blender-v2.91-release' 2020-10-26 14:34:03 +01:00
786e160aff Merge remote-tracking branch 'origin/blender-v2.91-release' 2020-10-26 13:52:36 +01:00
4d5e0a8520 Merge branch 'blender-v2.91-release' 2020-10-26 13:07:00 +01:00
57fc44de6c Merge branch 'blender-v2.91-release' 2020-10-26 22:06:57 +11:00
a207fb7ea7 Merge branch 'blender-v2.91-release' into master
Conflicts:
	source/blender/blenkernel/intern/armature.c
2020-10-26 11:29:20 +01:00
19f74e4022 Merge branch 'blender-v2.91-release' 2020-10-26 21:10:33 +11:00
38ba8a441f Merge branch 'blender-v2.91-release' 2020-10-26 11:03:30 +01:00
336a675c64 Merge branch 'blender-v2.91-release' into master 2020-10-26 15:06:55 +05:30
2c024bd335 Merge branch 'blender-v2.91-release' into master 2020-10-26 09:52:37 +01:00
cd16a5cea8 Merge branch 'blender-v2.91-release' into master 2020-10-26 09:17:06 +01:00
e4facbbea5 Modifiers: include the object & modifier when logging errors
Without this, there was no way of finding out which object, modifier
combination caused the error, making the logs not very useful
for debugging.
2020-10-26 18:16:30 +11:00
aa77689f77 Keymap: enable repeat for text editing paste operations 2020-10-26 15:59:24 +11:00
4d3a386af2 Cleanup: spelling 2020-10-26 15:59:08 +11:00
6c7f30a6f6 UI: Use property split in vertex paint symmetry panels
Set property split in the higher level panel functions so that it carries
over to buttons added after. Also discard the redundant "Symmetry"
to make sure there is enough space for the checkbox label.
2020-10-25 23:23:38 -05:00
e9d21136ce UI: Fix Symmetry options in weight paint panels
The now redundant "X" checkbox is removed since it's also present in the
Symmetry panel above. The Topology Mirror is moved into the Symmetry
panel also.

This was needed because `Mesh.use_x_mirror` has recently been turned into
different functionality, and its old functionality now lives under
`Mesh.use_mirror_vertex_group_x`. Something went wrong in the UI in This
transition.

Differential Revision: https://developer.blender.org/D9287
2020-10-25 23:16:11 -05:00
3baf65975c Split BKE_sequencer.h intern/extern definitions
Intern definitions are moved to sequencer/intern/sequencer.h

BKE_sequencer.h was also cleaned up a bit to make sure that functions
and structs are in correct category.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9259
2020-10-26 00:47:06 +01:00
bf10a56eea Merge branch 'blender-v2.91-release' 2020-10-26 00:39:30 +01:00
e661df71e6 Merge branch 'blender-v2.91-release' 2020-10-25 23:07:25 +01:00
c53b6067fa Sculpt: Implement plane deformation falloff for Grab
The plane deformation falloff was introduced in the first version of the
cloth brush, but due to the lack of all the new features and fixes in the
solver it was causing a lot of artifacts for deformation brushes. In
order to avoid that, the cloth brush was always using radial falloff for
the grab brush.

Now the plane falloff is properly implemented using the deformation
constraints.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9320
2020-10-25 22:59:01 +01:00
0eee384a8d Sculpt: Option to limit the action of line gestures to the segment
This adds a tool property for sculpt line gesture tools (line and
project) to limits its effect to the segment of the gesture instead of
using the infinite line to bisect the mesh in two parts.

To achieve that, the line gesture now has two extra side planes that can
be enabled/disabled for getting the nodes from the PBVH and to test the
vertices.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9307
2020-10-25 22:55:48 +01:00
c15bd1c4e6 Sculpt: Face Set Edit delete Geometry operation
This adds an operation mode to the Face Set Edit tool which deletes the
geometry of a Face Set by clicking on it.
The operator also checks for the mesh having a single Face Set to avoid
deleting the entire object by accident.
This is also disabled for Multires to avoid modifying the limit surface
without control (it is not an important limitation as base meshes for
multires are usually final, but maybe it can be supported in the future).

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8938
2020-10-25 22:52:07 +01:00
1d9499bbbc UI Code Quality: Cleanup ui_but_update_from_old_block
This commit contains some improvements to this function to make this
function more purposeful and readable.
  - Split updating information of the old button to a new function.
  - Remove some 7 year old code disabled with `#if 0`.
  - Add comments explaining some of the less obvious aspects.

Differential Revision: https://developer.blender.org/D9117
2020-10-24 23:58:32 -05:00
76fd84f209 Cleanup: Use LISTBASE_FOREACH in curve code
This is a followup to rBa308607a533, using the macro in a few places
that were missed.
2020-10-24 23:32:11 -05:00
05129bc821 Fix T81999, Boolean Exact+Self Difference fails.
A cell with winding number > 1 for the second operand was incorrectly
included in the output.
2020-10-24 17:44:59 -04:00
2f9068449f Fix T81884, clamping with percent, addendum.
The previous fix forgot the case where there is an intermediate
edge and everything isn't in one plane.
2020-10-24 15:10:19 -04:00
Yevgeny Makarov
622b30225a UI: Capitalization Corrections
Approximately 141 changes of capitalization to conform to MLA title style.

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

Reviewed by Julian Eisel
2020-10-24 11:42:17 -07:00
ca83649b7d Fix T82019 Crash loading 2.78 splash demo.
The versioning code to default to old booleans for old files was
faulty because really old files had a 'solver' field (later removed,
but then added back for new booleans).
2020-10-24 14:07:05 -04:00
bc0a33a812 GPU: Debug: Trim shader stats from output log
We don't make use of it anyway.
2020-10-24 14:07:05 -04:00
0d1f65e516 GPU: Use CLOG to for debug output
This removes the escape color control caracters when the output
does not supports it (i.e: file output, windows cmd).
2020-10-24 14:07:05 -04:00
e856443c99 CLOG: Add getter to know if output supports coloring 2020-10-24 14:07:05 -04:00
b37c40a575 Fix Cycles unnecessary overhead cancelling finished task pool 2020-10-24 14:07:05 -04:00
594f47ecd2 Cleanup: Return early in some curve functions
This commit uses continue in loops and returning early to reduce
indentation in long functions, only where this results in a significant
improvement. Also includes a few LISTBASE_FOREACH macros.
2020-10-23 23:29:52 -05:00
f32ab724eb Fix for T80679: Incorrect Translation of File Manager System List
Changing language could sometimes leave File Browser System list showing incorrect text until restart.

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

Reviewed by Brecht Van Lommel
2020-10-23 19:07:14 -07:00
3c42892610 GPencil: Minor changes in parameter order
This is related to D9330
2020-10-23 19:44:38 +02:00
69a22afdb6 GPencil: Remove unneeded python for calling Bake Animation
The operator was using a secondary python operator to ask parameters before running, but this can be done in invoke.

Differential Revision: https://developer.blender.org/D9330
2020-10-23 19:39:55 +02:00
390b28e338 Merge branch 'blender-v2.91-release' 2020-10-23 18:37:22 +02:00
83ddd658a6 Fix T81890: Active keyframe changes on deselect of keyframe
Activate an FCurve only on selecting, and not on deselecting a keyframe
or a handle.

Reviewed By: HooglyBoogly, Severin, looch, #animation_rigging

Differential Revision: https://developer.blender.org/D9328
2020-10-23 17:47:54 +02:00
Olivier Maury
559e87ad08 Fix T81976: Cycles crash after recent geometry sync multithreading change
Avoid accessing mesh emitter and hair at the same time. This is not ideal for
performance, but once we have a dedicated hair object this will resolve itself.

Differential Revision: https://developer.blender.org/D9322
2020-10-23 17:45:11 +02:00
0d1b1c341f Fix: Animation, Draw active keyframe handles only when Bézier
Draw the handles for the active keyframe only when the interpolation type
is set to Bézier. This now matches the behaviour of handles of regular
(non-active) keyframes.
2020-10-23 16:46:19 +02:00
50c475e534 Multires: Cleanup, better function naming
Hopefully it makes it more clear, and also allows to introduce
initialization from pre-created Subdiv descriptor.
2020-10-23 16:30:13 +02:00
e4728d0a16 Fluid: Possible fix for T79799
This issue is specific to Windows and should be resolved with the extra checks (untested).
2020-10-23 13:34:02 +02:00
56a3566e64 Merge branch 'blender-v2.91-release' 2020-10-23 09:53:50 +02:00
06e6068902 Merge branch 'blender-v2.91-release' 2020-10-23 14:00:28 +11:00
3f12f02bea Merge branch 'blender-v2.91-release' 2020-10-22 22:32:09 -04:00
14a4961490 Fix unreported: unmatching shortcut between gp modes
GPencil: Change Interpolate shortcut to Ctrl+E

Before the shortcut was Ctrl+Alt+E, but it's more logic remove the Alt.

This was missed in rBee49ce482a797a5937829de497abd69bcd1edb48
2020-10-22 22:31:20 -04:00
c6281d5dc7 Cleanup: Use DNA deprecated guards around old flags
These flags shouldn't be used except in versioning code.
2020-10-22 18:37:52 -05:00
165b4f85ec Merge branch 'blender-v2.91-release' 2020-10-22 18:14:14 -05:00
ff8ecf105c Merge branch 'blender-v2.91-release' 2020-10-22 17:34:48 -04:00
a3f5154448 Cleanup: make format 2020-10-22 17:08:37 -04:00
9b46d3cc80 Merge branch 'blender-v2.91-release' 2020-10-22 16:52:28 -04:00
2261da2897 Fix Unreported: Missing box mask in sculpt
There was a weird bug in the API where a value of 0 gave a mask value of 
1. I am not sure why this is but the current code works as desirable.

This was missed in rB6faa765af8954948de3cec75a2261a5aa139b4e5
2020-10-22 16:51:07 -04:00
7863ded680 Merge branch 'blender-v2.91-release' 2020-10-22 15:47:03 -05:00
d453bbbd26 Merge branch 'blender-v2.91-release' 2020-10-22 20:02:09 +02:00
3953833b60 Fix T81967: Crash when using extrude on a text object
Caused by rBa308607a5334, which mistakenly removed these lines.
2020-10-22 12:20:34 -05:00
Pablo Dobarro
383c20a6ab Sculpt: Grab silhouette option
This adds a property to the grab that masks vertices based on its
original normal and grab delta. When used on thin meshes, it allows to
grab the silhouette from one side of the object without affecting the
shape of the other side.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9205
2020-10-22 19:17:07 +02:00
b5169cd230 Fix T81932: Dyntopo crashing with sculpt vertex colors brush tools
Paint and smear tools are only implemented for regular mesh PBVH,
meaning they are not supported by the dynamic topology and multires
sculpting.

These tools are to be ignored for an unsupported sculpt modes, regardless
of state of user preferences.

Reviewed By: sergey

Maniphest Tasks: T81932

Differential Revision: https://developer.blender.org/D9308
2020-10-22 18:22:15 +02:00
e79154de73 Fix build error Python module build and Embree on macOS
Setting the stack size only works for executables, for shared libraries
the host application controls it.
2020-10-22 18:03:18 +02:00
2985a745bb GPencil: Add new parameter to set caps in Cutter
The new parameter allows to define if after cutting the stroke the cap of the cut side will be set as flat. 

Before, the cap shape of the cut side always was equal to the original stroke, and in some situations, the rounded cap was visible.

Note: If the angle of the join is very extreme,  it's still possible to view some sections of the cut stroke.,
2020-10-22 17:44:17 +02:00
90eab4a25d Merge branch 'blender-v2.91-release' 2020-10-22 10:25:44 -05:00
a8837c6cb0 Merge branch 'blender-v2.91-release' 2020-10-22 17:05:47 +02:00
cd7354f9f5 Merge branch 'blender-v2.91-release' 2020-10-22 17:02:59 +02:00
f73dad211b Potential fix for T81963: Random crashes in liboverride code.
From the backtrace it looks like in some cases file save (which triggers
a general override updates) is done before other code has a chance to
re-generate pose data, leading to rna accessing freed memory.

I was never able to reproduce that here, so this is a tentative fix in
master, if it proves to be working for the studio it will be
cherry-picked into 2.91 release branch later.
2020-10-22 15:22:56 +02:00
992a88b38b Pose: Add a 'pose_ensure' new utils that only rebuilds if needed.
Avoids having to spread the check logic everywhere in the code.
2020-10-22 15:22:56 +02:00
658370e9e1 Merge branch 'blender-v2.91-release' 2020-10-22 15:12:30 +02:00
dea3b8d984 Multires: Remove legacy subdivision code
Is no longer used, fully replaced with more powerful algorithm.
2020-10-22 12:41:18 +02:00
107199426c Multires: Cleanup, unused code 2020-10-22 12:28:31 +02:00
d11e357824 Multires: Remove legacy compatibility code
It was rather a huge chunk of code, which started to become
more harder to maintain with the transition to OpenSubdiv based
implementation. Because of this transition, the compatibility was
also rather on a poor side.

Remove compatibility support for pre-2.50.9 multires.

Ref T77107

Reviewed By: brecht, mont29

Differential Revision: https://developer.blender.org/D9238
2020-10-22 12:15:57 +02:00
f68c3d557a Compositor: Ensure keying node result is pre-multiplied
Historically the result of the keying node was violating alpha
pre-multiplication rules in Blender: it was simply overriding
the alpha channel of input.

This change makes it so keying node mixes alpha into the input,
which solves the following issues:

- The result is properly pre-multiplied, no need in separate
  alpha-convert node anymore.

- Allows to more easily stack keying nodes.
  This usecase was never really investigated, but since previously
  alpha is always overwritten it was never possible to easily stack
  nodes. Now it is at something to be tried.

Unfortunately, this breaks compatibility with existing files, where
alpha-convert node is to be manually removed.

From implementation side this is done as a dedicated operation since
there was no ready-to-use operation. Maybe in the future it might
be replaced with some sort of vector math node.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D9211
2020-10-22 11:57:01 +02:00
6c178bf439 Merge branch 'blender-v2.91-release' 2020-10-22 18:48:00 +11:00
36653a92fa Cleanup: centralize BLF default functions in the header 2020-10-22 17:30:52 +11:00
cf5ae6718c Cleanup: split BLF default into own file
This avoids accidents using user-preferences in the main BLF API,
which could cause preferences to be used unintentionally
(such as stamping into renders or creating generated images).

As well as uses of BLF when preferences aren't loaded
such as animation playback.
2020-10-22 17:24:19 +11:00
fe963b5a41 Merge branch 'blender-v2.91-release' 2020-10-22 17:13:04 +11:00
d00b1f6313 Merge branch 'blender-v2.91-release' 2020-10-22 16:00:52 +11:00
0c36255c48 Merge branch 'blender-v2.91-release' 2020-10-22 16:00:48 +11:00
a308607a53 Cleanup: Use LISTBASE_FOREACH macro in curve code
These changes should result in more readable and undestandable code,
especially where while loops were use instead of for loops. They are
not comprehensive, and I skipped wherever the change was not obvious.
2020-10-21 23:52:29 -05:00
6ebb2e5e2b Merge branch 'blender-v2.91-release' 2020-10-22 15:28:27 +11:00
608243c79c Merge branch 'blender-v2.91-release' 2020-10-22 14:08:07 +11:00
f5080c82dd Keymap: disable 'repeat' by default for keymap items
In practice, there are only a limited number of operations we need to
use repeat such as navigation, stepping operations that cycle states
and text input.

Now we don't need to disable repeat explicitly when a modal operator
uses checks for a key being held as was needed for 17cb2a6da0.

Repeat is now included in exported keymaps.

Use versioning so existing exported keymaps are loaded properly.
2020-10-22 12:29:45 +11:00
358a584985 Keymap: add support for versioning keymaps
Write the Blender version into the keymap
so we can change defaults without breaking existing keymaps.

Based on patch by @erik85 with own additions.
2020-10-22 12:29:42 +11:00
b9c8eb3b0c PyAPI: expose the file version via bpy.app.version_file
This exposes the version saved to the file,
compatible with `bpy.data.version`.

This is needed to write out version information into key-maps.
2020-10-22 12:29:38 +11:00
e9ae8148ae Merge branch 'blender-v2.91-release' 2020-10-22 12:03:53 +11:00
899d6d4db9 Merge branch 'blender-v2.91-release' 2020-10-22 12:03:50 +11:00
37df2ebaa9 Merge branch 'blender-v2.91-release' 2020-10-22 12:03:46 +11:00
cee35b2ca5 Merge branch 'blender-v2.91-release' 2020-10-22 12:03:41 +11:00
d6a43abc3a Merge branch 'blender-v2.91-release' 2020-10-22 12:03:36 +11:00
b632c1e90d Merge branch 'blender-v2.91-release' 2020-10-22 12:03:33 +11:00
ca87f4c45d Merge branch 'blender-v2.91-release' 2020-10-22 12:03:29 +11:00
Robert Guetzkow
ef5d6e9c45 Fix T81925: incorrectly skipped string copy in test_env_path
Regression in 6f3a9031f7
2020-10-22 09:51:51 +11:00
8a22b76988 Merge branch 'blender-v2.91-release' into master 2020-10-21 22:57:15 +02:00
d7e3b3aed0 Merge branch 'blender-v2.91-release' 2020-10-21 21:21:32 +02:00
0b3cb54887 Merge branch 'blender-v2.91-release' 2020-10-21 21:05:53 +02:00
0da8eb7bd0 Merge branch 'blender-v2.91-release' 2020-10-21 20:43:01 +02:00
e296d58cf2 GPencil: Subdivide Cyclic section of strokes in modifier
When use subdivision modifier, the close section of the stroke must be subdivided too.
2020-10-21 19:24:12 +02:00
657e344351 GPencil: Bake mesh animation for selected keyframes only
This new option allows to bake the animation of the selected frames and not the full range of keyframes.
2020-10-21 19:15:26 +02:00
Jagannadhan Ravi
bb49aa0d69 Cycles: multithreaded export of geometry
This improves performance in scene synchronization when there are many
mesh, hair and volume objects. Sync time speedups in benchmarks:

barbershop   5.2x
bmw          1.3x
fishycat     1.5x
koro         1.0x
sponza       3.0x
victor       1.4x
wdas_cloud   0.9x

Implementation by Nicolas Lelong, and Jagannadhan Ravi (AMD).

Differential Revision: https://developer.blender.org/D9258
2020-10-21 18:54:12 +02:00
b5803c0a24 Revert "2.91 splashscreen"
In master Blender still uses the dev fund splashscreen
This reverts commit 1b577d0d6d.
2020-10-21 18:18:12 +02:00
ce76f2db94 Merge branch 'blender-v2.91-release' 2020-10-21 18:16:46 +02:00
b6e0661e9e Merge branch 'blender-v2.91-release' 2020-10-21 18:12:50 +02:00
f2d454c829 Bump version to 2.92 alpha 2020-10-21 18:09:44 +02:00
9216b8d6cb UI: Allow changing the active side of line gestures
Line gesture use always the right side of the line as active (the area
of the mesh that is going to be modified) by default.
This adds the ability to change the active side when the line gesture is
active by pressing the F key.
This allows more freedom to position the line after starting the
gestures, as it won't be required to cancel the operation or undo if the
line was used in the wrong direction.

Reviewed By: Severin

Differential Revision: https://developer.blender.org/D9301
2020-10-21 17:55:17 +02:00
5993 changed files with 413616 additions and 207429 deletions

View File

@@ -2,7 +2,7 @@
# Configuration of clang-format
# =============================
#
# Tested to work with versions: 6 to 8.
# Tested to work with versions: 8 to 11.
# This causes parameters on continuations to align to the opening brace.
#
@@ -161,6 +161,7 @@ PenaltyBreakString: 1000000
# "^\s+[A-Z][A-Z0-9_]+\s*\([^\n]*\)\n\s*\{"
ForEachMacros:
- BEGIN_ANIMFILTER_SUBCHANNELS
- BKE_pbvh_vertex_iter_begin
- BLI_FOREACH_SPARSE_RANGE
- BLI_SMALLSTACK_ITER_BEGIN
- BMO_ITER
@@ -254,7 +255,7 @@ ForEachMacros:
- SCULPT_VERTEX_DUPLICATES_AND_NEIGHBORS_ITER_BEGIN
- SCULPT_VERTEX_NEIGHBORS_ITER_BEGIN
- SEQ_ALL_BEGIN
- SEQ_CURRENT_BEGIN
- SEQ_ITERATOR_FOREACH
- SURFACE_QUAD_ITER_BEGIN
- foreach
- ED_screen_areas_iter
@@ -263,8 +264,6 @@ ForEachMacros:
- MAP_SLOT_PROBING_BEGIN
- VECTOR_SET_SLOT_PROBING_BEGIN
# Use once we bump the minimum version to version 8.
# # Without this string literals that in-line 'STRINGIFY' behave strangely (a bug?).
# StatementMacros:
# - PyObject_VAR_HEAD
# - STRINGIFY
StatementMacros:
- PyObject_HEAD
- PyObject_VAR_HEAD

View File

@@ -15,7 +15,6 @@ Checks: >
-readability-misleading-indentation,
-readability-redundant-member-init,
-readability-use-anyofallof,
-readability-function-cognitive-complexity,
@@ -30,7 +29,19 @@ Checks: >
-bugprone-sizeof-expression,
-bugprone-integer-division,
-bugprone-exception-escape,
-bugprone-redundant-branch-condition,
WarningsAsErrors: '*'
modernize-*,
-modernize-use-auto,
-modernize-use-trailing-return-type,
-modernize-avoid-c-arrays,
-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
CheckOptions:
- key: modernize-use-default-member-init.UseAssignment
value: 1

104
.git-blame-ignore-revs Normal file
View File

@@ -0,0 +1,104 @@
# git config blame.ignoreRevsFile .git-blame-ignore-revs
#
# After running the above, commits listed in this file will be
# ignored by git blame. The blame will be shifted to the person
# who edited the line(s) before the ignored commit.
#
# To disable this ignorance for a command, run as follows
# git blame --ignore-revs-file="" <other options>
#
# Changes that belong here:
# - Massive comment, doxy-sections, or spelling corrections.
# - Clang-format, PEP8 or other automated changes which are *strictly* "no functional change".
# - Several commits should be added to this list at once, because adding
# one extra commit (to edit this file) after every cleanup is noisy.
# - No clang-tidy changes.
#
# Note:
# - The comment above the SHA should be the first line of the commit.
# - It is fine to pack together similar commits if they have the same explanatory comment.
# - Use only 40 character git SHAs; not smaller ones, not prefixed with rB.
#
# https://git-scm.com/docs/git-blame/2.23.0
# white space commit. (2 spaces -> tab).
0a3694cd6ebec710da7110e9f168a72d47c71ee0
# Cycles: Cleanup, spacing after preprocessor
cb4b5e12abf1fc6cf9ffc0944e0a1bc406286c63
# ClangFormat: apply to source, most of intern
e12c08e8d170b7ca40f204a5b0423c23a9fbc2c1
# Code Style: use "#pragma once" in source directory
91694b9b58ab953f3b313be9389cc1303e472fc2
# Code Style: use "#pragma once" in some newer headers
8198dbb888856b8c11757586df02aca15f132f90
# Code Style: use "#pragma once" in intern/ghost
1b1129f82a9cf316b54fbc025f8cfcc1a74b8589
# Cleanup: mostly comments, use doxy syntax & typos
e0cb02587012b4b2f4b18363dc7d0a7da2c02093
# Cleanup: use C comments for descriptive text
2abfcebb0eb7989e3d1e7d03f37ecf5c088210af
# use lowercase for cmake builtin names and macros, remove contents in else() and endif() which is no longer needed.
afacd184982e58a9c830a3d5366e25983939a7ba
# Spelling: It's Versus Its
3a7fd309fce89213b0224b3c6807adb2d1fe7ca8
# Spelling: Then Versus Than
d1eefc421544e2ea632fb35cb6bcaade4c39ce6b
# Spelling: Miscellaneous
84ef3b80de4915a24a9fd2fd214d0fa44e59b854
# Spelling: Loose Versus Lose
c0a6bc19794c69843c38451c762e91bc10136e0f
# Spelling: Apart Versus A Part
3d26cd01b9ba6381eb165e11536345ae652dfb41
# Cleanup: use 2 space indentation for CMake
3076d95ba441cd32706a27d18922a30f8fd28b8a
# Cleanup: use over-line for doxy comments
4b188bb08cf5aaae3c68ab57bbcfa037eef1ac10
# Cleanup: General comment style clean up of graph_edit.c and fcurve.c
0105f146bb40bd609ccbda3d3f6aeb8e14ad3f9e
# Cleanup: pep8 (indentation, spacing, long lines)
41d2d6da0c96d351b47acb64d3e0decdba16cb16
# Cleanup: pep8, blank lines
bab9de2a52929fe2b45ecddb1eb09da3378e303b
# Cleanup: PEP8 for python changes
1e7e94588daa66483190f45a9de5e98228f80e05
# GPencil: Cleanup pep8
a09cc3ee1a99f2cd5040bbf30c8ab8c588bb2bb1
# Cleanup: trailing space, remove tabs, pep8
c42a6b77b52560d257279de2cb624b4ef2c0d24c
# Cleanup: use C style doxygen comments
8c1726918374e1d2d2123e17bae8db5aadde3433
# Cleanup: use doxy sections for imbuf
c207f7c22e1439e0b285fba5d2c072bdae23f981
# Cleanup: clang-format
c4d8f6a4a8ddc29ed27311ed7578b3c8c31399d2
b5d310b569e07a937798a2d38539cfd290149f1c
8c846cccd6bdfd3e90a695fabbf05f53e5466a57
4eac03d821fa17546f562485f7d073813a5e5943
1166110a9d66af9c5a47cee2be591f50fdc445e8
# Cleanup: clang-format.
40d4a4cb1a6b4c3c2a486e8f2868f547530e0811

3
.gitignore vendored
View File

@@ -46,3 +46,6 @@ Desktop.ini
# smoke simulation noise tile (generated)
waveletNoiseTile.bin
# testing environment
/Testing

View File

@@ -63,6 +63,9 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/build_files/cmake/platform")
# avoid having empty buildtype
if(NOT DEFINED CMAKE_BUILD_TYPE_INIT)
set(CMAKE_BUILD_TYPE_INIT "Release")
# Internal logic caches this variable, avoid showing it by default
# since it's easy to accidentally set instead of the build type.
mark_as_advanced(CMAKE_BUILD_TYPE_INIT)
endif()
# Omit superfluous "Up-to-date" messages.
@@ -107,6 +110,10 @@ if(POLICY CMP0074)
cmake_policy(SET CMP0074 NEW)
endif()
# Install CODE|SCRIPT allow the use of generator expressions.
if(POLICY CMP0087)
cmake_policy(SET CMP0087 NEW)
endif()
#-----------------------------------------------------------------------------
# Load some macros.
include(build_files/cmake/macros.cmake)
@@ -164,10 +171,6 @@ if(APPLE)
endif()
option(WITH_BUILDINFO "Include extra build details (only disable for development & faster builds)" ON)
if(${CMAKE_VERSION} VERSION_LESS 2.8.8)
# add_library OBJECT arg unsupported
set(WITH_BUILDINFO OFF)
endif()
set(BUILDINFO_OVERRIDE_DATE "" CACHE STRING "Use instead of the current date for reproducible builds (empty string disables this option)")
set(BUILDINFO_OVERRIDE_TIME "" CACHE STRING "Use instead of the current time for reproducible builds (empty string disables this option)")
set(CPACK_OVERRIDE_PACKAGENAME "" CACHE STRING "Use instead of the standard packagename (empty string disables this option)")
@@ -178,6 +181,7 @@ mark_as_advanced(BUILDINFO_OVERRIDE_TIME)
option(WITH_IK_ITASC "Enable ITASC IK solver (only disable for development & for incompatible C++ compilers)" ON)
option(WITH_IK_SOLVER "Enable Legacy IK solver (only disable for development)" ON)
option(WITH_FFTW3 "Enable FFTW3 support (Used for smoke, ocean sim, and audio effects)" ON)
option(WITH_PUGIXML "Enable PugiXML support (Used for OpenImageIO, Grease Pencil SVG export)" ON)
option(WITH_BULLET "Enable Bullet (Physics Engine)" ON)
option(WITH_SYSTEM_BULLET "Use the systems bullet library (currently unsupported due to missing features in upstream!)" )
mark_as_advanced(WITH_SYSTEM_BULLET)
@@ -203,7 +207,8 @@ option(WITH_OPENVDB "Enable features relying on OpenVDB" ON)
option(WITH_OPENVDB_BLOSC "Enable blosc compression for OpenVDB, only enable if OpenVDB was built with blosc support" ON)
option(WITH_OPENVDB_3_ABI_COMPATIBLE "Assume OpenVDB library has been compiled with version 3 ABI compatibility" OFF)
mark_as_advanced(WITH_OPENVDB_3_ABI_COMPATIBLE)
option(WITH_NANOVDB "Enable usage of NanoVDB data structure for accelerated rendering on the GPU" OFF)
option(WITH_NANOVDB "Enable usage of NanoVDB data structure for rendering on the GPU" ON)
option(WITH_HARU "Enable features relying on Libharu (Grease pencil PDF export)" ON)
# GHOST Windowing Library Options
option(WITH_GHOST_DEBUG "Enable debugging output for the GHOST library" OFF)
@@ -235,9 +240,7 @@ option(WITH_SYSTEM_AUDASPACE "Build with external audaspace library installed on
mark_as_advanced(WITH_AUDASPACE)
mark_as_advanced(WITH_SYSTEM_AUDASPACE)
if(NOT WITH_AUDASPACE)
set(WITH_SYSTEM_AUDASPACE OFF)
endif()
set_and_warn_dependency(WITH_AUDASPACE WITH_SYSTEM_AUDASPACE OFF)
option(WITH_OPENMP "Enable OpenMP (has to be supported by the compiler)" ON)
if(UNIX AND NOT APPLE)
@@ -299,15 +302,33 @@ option(WITH_OPENCOLLADA "Enable OpenCollada Support (http://www.opencollada.or
# Sound output
option(WITH_SDL "Enable SDL for sound and joystick support" ON)
option(WITH_OPENAL "Enable OpenAL Support (http://www.openal.org)" ON)
if(APPLE)
option(WITH_COREAUDIO "Enable CoreAudio for audio support on macOS" ON)
else()
set(WITH_COREAUDIO OFF)
endif()
if(NOT WIN32)
option(WITH_JACK "Enable JACK Support (http://www.jackaudio.org)" ON)
if(UNIX AND NOT APPLE)
option(WITH_JACK_DYNLOAD "Enable runtime dynamic JACK libraries loading" OFF)
endif()
else()
set(WITH_JACK OFF)
endif()
if(UNIX AND NOT APPLE)
option(WITH_SDL_DYNLOAD "Enable runtime dynamic SDL libraries loading" OFF)
endif()
if(UNIX AND NOT APPLE)
option(WITH_PULSEAUDIO "Enable PulseAudio for audio support on Linux" ON)
option(WITH_PULSEAUDIO_DYNLOAD "Enable runtime dynamic PulseAudio libraries loading" OFF)
else()
set(WITH_PULSEAUDIO OFF)
endif()
if(WIN32)
option(WITH_WASAPI "Enable Windows Audio Sessions API for audio support on Windows" ON)
else()
set(WITH_WASAPI OFF)
endif()
# Compression
option(WITH_LZO "Enable fast LZO compression (used for pointcache)" ON)
@@ -332,7 +353,7 @@ mark_as_advanced(WITH_SYSTEM_GLOG)
option(WITH_FREESTYLE "Enable Freestyle (advanced edges rendering)" ON)
# Misc
if(WIN32)
if(WIN32 OR APPLE)
option(WITH_INPUT_IME "Enable Input Method Editor (IME) for complex Asian character input" ON)
endif()
option(WITH_INPUT_NDOF "Enable NDOF input devices (SpaceNavigator and friends)" ON)
@@ -346,16 +367,21 @@ if(UNIX AND NOT APPLE)
endif()
option(WITH_PYTHON_INSTALL "Copy system python into the blender install folder" ON)
if((WITH_AUDASPACE AND NOT WITH_SYSTEM_AUDASPACE) OR WITH_MOD_FLUID)
option(WITH_PYTHON_NUMPY "Include NumPy in Blender (used by Audaspace and Mantaflow)" ON)
endif()
if(WIN32 OR APPLE)
# Windows and macOS have this bundled with Python libraries.
elseif(WITH_PYTHON_INSTALL OR (WITH_AUDASPACE AND NOT WITH_SYSTEM_AUDASPACE))
elseif(WITH_PYTHON_INSTALL OR WITH_PYTHON_NUMPY)
set(PYTHON_NUMPY_PATH "" CACHE PATH "Path to python site-packages or dist-packages containing 'numpy' module")
mark_as_advanced(PYTHON_NUMPY_PATH)
set(PYTHON_NUMPY_INCLUDE_DIRS ${PYTHON_NUMPY_PATH}/numpy/core/include CACHE PATH "Path to the include directory of the numpy module")
set(PYTHON_NUMPY_INCLUDE_DIRS "" CACHE PATH "Path to the include directory of the NumPy module")
mark_as_advanced(PYTHON_NUMPY_INCLUDE_DIRS)
endif()
if(WITH_PYTHON_INSTALL)
option(WITH_PYTHON_INSTALL_NUMPY "Copy system numpy into the blender install folder" ON)
option(WITH_PYTHON_INSTALL_NUMPY "Copy system NumPy into the blender install folder" ON)
if(UNIX AND NOT APPLE)
option(WITH_PYTHON_INSTALL_REQUESTS "Copy system requests into the blender install folder" ON)
@@ -364,8 +390,8 @@ if(WITH_PYTHON_INSTALL)
endif()
endif()
option(WITH_CPU_SSE "Enable SIMD instruction if they're detected on the host machine" ON)
mark_as_advanced(WITH_CPU_SSE)
option(WITH_CPU_SIMD "Enable SIMD instruction if they're detected on the host machine" ON)
mark_as_advanced(WITH_CPU_SIMD)
# Cycles
option(WITH_CYCLES "Enable Cycles Render Engine" ON)
@@ -377,17 +403,18 @@ option(WITH_CYCLES_CUDA_BINARIES "Build Cycles CUDA binaries" OFF)
option(WITH_CYCLES_CUBIN_COMPILER "Build cubins with nvrtc based compiler instead of nvcc" OFF)
option(WITH_CYCLES_CUDA_BUILD_SERIAL "Build cubins one after another (useful on machines with limited RAM)" OFF)
mark_as_advanced(WITH_CYCLES_CUDA_BUILD_SERIAL)
set(CYCLES_TEST_DEVICES CPU CACHE STRING "Run regression tests on the specified device types (CPU CUDA OPTIX OPENCL)" )
set(CYCLES_CUDA_BINARIES_ARCH sm_30 sm_35 sm_37 sm_50 sm_52 sm_60 sm_61 sm_70 sm_75 sm_86 compute_75 CACHE STRING "CUDA architectures to build binaries for")
mark_as_advanced(CYCLES_CUDA_BINARIES_ARCH)
unset(PLATFORM_DEFAULT)
option(WITH_CYCLES_LOGGING "Build Cycles with logging support" ON)
option(WITH_CYCLES_DEBUG "Build Cycles with extra debug capabilities" OFF)
option(WITH_CYCLES_LOGGING "Build Cycles with logging support" ON)
option(WITH_CYCLES_DEBUG_NAN "Build Cycles with additional asserts for detecting NaNs and invalid values" OFF)
option(WITH_CYCLES_NATIVE_ONLY "Build Cycles with native kernel only (which fits current CPU, use for development only)" OFF)
option(WITH_CYCLES_KERNEL_ASAN "Build Cycles kernels with address sanitizer when WITH_COMPILER_ASAN is on, even if it's very slow" OFF)
mark_as_advanced(WITH_CYCLES_KERNEL_ASAN)
mark_as_advanced(WITH_CYCLES_CUBIN_COMPILER)
mark_as_advanced(WITH_CYCLES_LOGGING)
mark_as_advanced(WITH_CYCLES_DEBUG)
mark_as_advanced(WITH_CYCLES_DEBUG_NAN)
mark_as_advanced(WITH_CYCLES_NATIVE_ONLY)
option(WITH_CYCLES_DEVICE_CUDA "Enable Cycles CUDA compute support" ON)
@@ -401,6 +428,10 @@ mark_as_advanced(WITH_CYCLES_NETWORK)
option(WITH_CUDA_DYNLOAD "Dynamically load CUDA libraries at runtime" ON)
mark_as_advanced(WITH_CUDA_DYNLOAD)
# Draw Manager
option(WITH_DRAW_DEBUG "Add extra debug capabilities to Draw Manager" OFF)
mark_as_advanced(WITH_DRAW_DEBUG)
# LLVM
option(WITH_LLVM "Use LLVM" OFF)
if(APPLE)
@@ -409,6 +440,7 @@ else()
option(LLVM_STATIC "Link with LLVM static libraries" OFF)
endif()
mark_as_advanced(LLVM_STATIC)
option(WITH_CLANG "Use Clang" OFF)
# disable for now, but plan to support on all platforms eventually
option(WITH_MEM_JEMALLOC "Enable malloc replacement (http://www.canonware.com/jemalloc)" ON)
@@ -425,8 +457,8 @@ mark_as_advanced(WITH_CXX_GUARDEDALLOC)
option(WITH_ASSERT_ABORT "Call abort() when raising an assertion through BLI_assert()" ON)
mark_as_advanced(WITH_ASSERT_ABORT)
if(UNIX AND NOT APPLE)
option(WITH_CLANG_TIDY "Use Clang Tidy to analyze the source code (only enable for development on Linux using Clang)" OFF)
if((UNIX AND NOT APPLE) OR (CMAKE_GENERATOR MATCHES "^Visual Studio.+"))
option(WITH_CLANG_TIDY "Use Clang Tidy to analyze the source code (only enable for development on Linux using Clang, or Windows using the Visual Studio IDE)" OFF)
mark_as_advanced(WITH_CLANG_TIDY)
endif()
@@ -496,10 +528,10 @@ if(CMAKE_COMPILER_IS_GNUCC)
mark_as_advanced(WITH_LINKER_LLD)
endif()
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
option(WITH_COMPILER_ASAN "Build and link against address sanitizer (only for Debug & RelWithDebInfo targets)." OFF)
mark_as_advanced(WITH_COMPILER_ASAN)
option(WITH_COMPILER_ASAN "Build and link against address sanitizer (only for Debug & RelWithDebInfo targets)." OFF)
mark_as_advanced(WITH_COMPILER_ASAN)
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
if(WITH_COMPILER_ASAN)
set(_asan_defaults "\
-fsanitize=address \
@@ -526,10 +558,10 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
# Silence the warning that object-size is not effective in -O0.
set(_asan_defaults "${_asan_defaults}")
else()
set(_asan_defaults "${_asan_defaults} -fsanitize=object-size")
string(APPEND _asan_defaults " -fsanitize=object-size")
endif()
else()
set(_asan_defaults "${_asan_defaults} -fsanitize=leak -fsanitize=object-size")
string(APPEND _asan_defaults " -fsanitize=leak -fsanitize=object-size")
endif()
set(COMPILER_ASAN_CFLAGS "${_asan_defaults}" CACHE STRING "C flags for address sanitizer")
@@ -570,17 +602,16 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
endif()
endif()
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
option(WITH_COMPILER_SHORT_FILE_MACRO "Make paths in macros like __FILE__ relative to top level source and build directories." ON)
mark_as_advanced(WITH_COMPILER_SHORT_FILE_MACRO)
endif()
if(WIN32)
# Use hardcoded paths or find_package to find externals
option(WITH_WINDOWS_FIND_MODULES "Use find_package to locate libraries" OFF)
mark_as_advanced(WITH_WINDOWS_FIND_MODULES)
option(WINDOWS_USE_VISUAL_STUDIO_PROJECT_FOLDERS "Organize the visual studio projects according to source folder structure." ON)
mark_as_advanced(WINDOWS_USE_VISUAL_STUDIO_PROJECT_FOLDERS)
option(WINDOWS_USE_VISUAL_STUDIO_SOURCE_FOLDERS "Organize the source files in filters matching the source folders." ON)
mark_as_advanced(WINDOWS_USE_VISUAL_STUDIO_SOURCE_FOLDERS)
option(WINDOWS_PYTHON_DEBUG "Include the files needed for debugging python scripts with visual studio 2017+." OFF)
mark_as_advanced(WINDOWS_PYTHON_DEBUG)
@@ -598,6 +629,24 @@ if(WIN32)
endif()
if(WIN32 OR XCODE)
option(IDE_GROUP_SOURCES_IN_FOLDERS "Organize the source files in filters matching the source folders." ON)
mark_as_advanced(IDE_GROUP_SOURCES_IN_FOLDERS)
option(IDE_GROUP_PROJECTS_IN_FOLDERS "Organize the projects according to source folder structure." ON)
mark_as_advanced(IDE_GROUP_PROJECTS_IN_FOLDERS)
if (IDE_GROUP_PROJECTS_IN_FOLDERS)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
endif()
endif()
if(UNIX)
# See WITH_WINDOWS_SCCACHE for Windows.
option(WITH_COMPILER_CCACHE "Use ccache to improve rebuild times (Works with Ninja, Makefiles and Xcode)" OFF)
mark_as_advanced(WITH_COMPILER_CCACHE)
endif()
# The following only works with the Ninja generator in CMake >= 3.0.
if("${CMAKE_GENERATOR}" MATCHES "Ninja")
option(WITH_NINJA_POOL_JOBS
@@ -652,16 +701,11 @@ if(NOT WITH_BLENDER AND NOT WITH_CYCLES_STANDALONE)
)
endif()
if(NOT WITH_AUDASPACE)
if(WITH_OPENAL)
message(WARNING "WITH_OPENAL requires WITH_AUDASPACE which is disabled")
set(WITH_OPENAL OFF)
endif()
if(WITH_JACK)
message(WARNING "WITH_JACK requires WITH_AUDASPACE which is disabled")
set(WITH_JACK OFF)
endif()
endif()
set_and_warn_dependency(WITH_AUDASPACE WITH_OPENAL OFF)
set_and_warn_dependency(WITH_AUDASPACE WITH_COREAUDIO OFF)
set_and_warn_dependency(WITH_AUDASPACE WITH_JACK OFF)
set_and_warn_dependency(WITH_AUDASPACE WITH_PULSEAUDIO OFF)
set_and_warn_dependency(WITH_AUDASPACE WITH_WASAPI OFF)
if(NOT WITH_SDL AND WITH_GHOST_SDL)
message(FATAL_ERROR "WITH_GHOST_SDL requires WITH_SDL")
@@ -672,10 +716,8 @@ if(WITH_PYTHON_MODULE AND WITH_PYTHON_INSTALL)
message(FATAL_ERROR "WITH_PYTHON_MODULE requires WITH_PYTHON_INSTALL to be OFF")
endif()
if(NOT WITH_PYTHON)
set(WITH_CYCLES OFF)
set(WITH_DRACO OFF)
endif()
set_and_warn_dependency(WITH_PYTHON WITH_CYCLES OFF)
set_and_warn_dependency(WITH_PYTHON WITH_DRACO 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")
@@ -692,6 +734,8 @@ 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)
set_and_warn_dependency(WITH_PUGIXML WITH_OPENIMAGEIO OFF)
if(WITH_BOOST AND NOT (WITH_CYCLES OR WITH_OPENIMAGEIO OR WITH_INTERNATIONAL OR
WITH_OPENVDB OR WITH_OPENCOLORIO OR WITH_USD OR WITH_ALEMBIC))
@@ -708,8 +752,12 @@ set_and_warn_dependency(WITH_TBB WITH_MOD_FLUID OFF)
# NanoVDB requires OpenVDB to convert the data structure
set_and_warn_dependency(WITH_OPENVDB WITH_NANOVDB OFF)
# OpenVDB uses 'half' type from OpenEXR & fails to link without OpenEXR enabled.
# OpenVDB and OpenColorIO uses 'half' type from OpenEXR
set_and_warn_dependency(WITH_IMAGE_OPENEXR WITH_OPENVDB OFF)
set_and_warn_dependency(WITH_IMAGE_OPENEXR WITH_OPENCOLORIO OFF)
# Haru needs `TIFFFaxBlackCodes` & `TIFFFaxWhiteCodes` symbols from TIFF.
set_and_warn_dependency(WITH_IMAGE_TIFF WITH_HARU OFF)
# auto enable openimageio for cycles
if(WITH_CYCLES)
@@ -718,6 +766,7 @@ if(WITH_CYCLES)
# auto enable llvm for cycles_osl
if(WITH_CYCLES_OSL)
set(WITH_LLVM ON CACHE BOOL "" FORCE)
set(WITH_CLANG ON CACHE BOOL "" FORCE)
endif()
else()
set(WITH_CYCLES_OSL OFF)
@@ -740,6 +789,7 @@ if(WITH_INSTALL_PORTABLE)
endif()
if(WITH_GHOST_SDL OR WITH_HEADLESS)
message(STATUS "Disabling Ghost Wayland, X11, Input IME, and OpenXR")
set(WITH_GHOST_WAYLAND OFF)
set(WITH_GHOST_X11 OFF)
set(WITH_X11_XINPUT OFF)
@@ -751,14 +801,6 @@ if(WITH_GHOST_SDL OR WITH_HEADLESS)
set(WITH_XR_OPENXR OFF)
endif()
if(WITH_CPU_SSE)
TEST_SSE_SUPPORT(COMPILER_SSE_FLAG COMPILER_SSE2_FLAG)
else()
message(STATUS "SSE and SSE2 optimizations are DISABLED!")
set(COMPILER_SSE_FLAG)
set(COMPILER_SSE2_FLAG)
endif()
if(WITH_BUILDINFO)
find_package(Git)
if(NOT GIT_FOUND)
@@ -778,7 +820,7 @@ endif()
if(NOT WITH_CUDA_DYNLOAD)
find_package(CUDA)
if(NOT CUDA_FOUND)
message("CUDA toolkit not found, using dynamic runtime loading of libraries instead")
message(STATUS "CUDA toolkit not found, using dynamic runtime loading of libraries (WITH_CUDA_DYNLOAD) instead")
set(WITH_CUDA_DYNLOAD ON)
endif()
endif()
@@ -807,8 +849,8 @@ if(WITH_PYTHON)
# Do this before main 'platform_*' checks,
# because UNIX will search for the old Python paths which may not exist.
# giving errors about missing paths before this case is met.
if(DEFINED PYTHON_VERSION AND "${PYTHON_VERSION}" VERSION_LESS "3.7")
message(FATAL_ERROR "At least Python 3.7 is required to build")
if(DEFINED PYTHON_VERSION AND "${PYTHON_VERSION}" VERSION_LESS "3.9")
message(FATAL_ERROR "At least Python 3.9 is required to build, but found Python ${PYTHON_VERSION}")
endif()
file(GLOB RESULT "${CMAKE_SOURCE_DIR}/release/scripts/addons")
@@ -858,11 +900,11 @@ if(NOT CMAKE_BUILD_TYPE MATCHES "Release")
# Since linker flags are not set, all compiler checks and `find_package`
# calls that rely on `try_compile` will fail.
# See CMP0066 also.
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${COMPILER_ASAN_CFLAGS}")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} ${COMPILER_ASAN_CFLAGS}")
string(APPEND CMAKE_C_FLAGS_DEBUG " ${COMPILER_ASAN_CFLAGS}")
string(APPEND CMAKE_C_FLAGS_RELWITHDEBINFO " ${COMPILER_ASAN_CFLAGS}")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${COMPILER_ASAN_CXXFLAGS}")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${COMPILER_ASAN_CXXFLAGS}")
string(APPEND CMAKE_CXX_FLAGS_DEBUG " ${COMPILER_ASAN_CXXFLAGS}")
string(APPEND CMAKE_CXX_FLAGS_RELWITHDEBINFO " ${COMPILER_ASAN_CXXFLAGS}")
endif()
if(MSVC)
set(COMPILER_ASAN_LINKER_FLAGS "/FUNCTIONPADMIN:6")
@@ -870,9 +912,11 @@ if(NOT CMAKE_BUILD_TYPE MATCHES "Release")
if(APPLE AND COMPILER_ASAN_LIBRARY)
string(REPLACE " " ";" _list_COMPILER_ASAN_CFLAGS ${COMPILER_ASAN_CFLAGS})
add_compile_options("$<$<NOT:$<CONFIG:Release>>:${_list_COMPILER_ASAN_CFLAGS}>")
add_link_options("$<$<NOT:$<CONFIG:Release>>:-fno-omit-frame-pointer;-fsanitize=address>")
set(_is_CONFIG_DEBUG "$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>")
add_compile_options("$<${_is_CONFIG_DEBUG}:${_list_COMPILER_ASAN_CFLAGS}>")
add_link_options("$<${_is_CONFIG_DEBUG}:-fno-omit-frame-pointer;-fsanitize=address>")
unset(_list_COMPILER_ASAN_CFLAGS)
unset(_is_CONFIG_DEBUG)
elseif(COMPILER_ASAN_LIBRARY)
set(PLATFORM_LINKLIBS "${PLATFORM_LINKLIBS};${COMPILER_ASAN_LIBRARY}")
set(PLATFORM_LINKFLAGS "${COMPILER_ASAN_LIBRARY} ${COMPILER_ASAN_LINKER_FLAGS}")
@@ -881,6 +925,18 @@ if(NOT CMAKE_BUILD_TYPE MATCHES "Release")
endif()
endif()
# Test SIMD support, before platform includes to determine if sse2neon is needed.
if(WITH_CPU_SIMD)
set(COMPILER_SSE_FLAG)
set(COMPILER_SSE2_FLAG)
# Test Neon first since macOS Arm can compile and run x86-64 SSE binaries.
TEST_NEON_SUPPORT()
if(NOT SUPPORT_NEON_BUILD)
TEST_SSE_SUPPORT(COMPILER_SSE_FLAG COMPILER_SSE2_FLAG)
endif()
endif()
# ----------------------------------------------------------------------------
# Main Platform Checks
#
@@ -936,22 +992,49 @@ if(WITH_INTERNATIONAL)
endif()
endif()
# See TEST_SSE_SUPPORT() for how this is defined.
# Do it globally, SSE2 is required for quite some time now.
# Doing it now allows to use SSE/SSE2 in inline headers.
if(SUPPORT_SSE_BUILD)
set(PLATFORM_CFLAGS " ${COMPILER_SSE_FLAG} ${PLATFORM_CFLAGS}")
add_definitions(-D__SSE__ -D__MMX__)
endif()
if(SUPPORT_SSE2_BUILD)
set(PLATFORM_CFLAGS " ${PLATFORM_CFLAGS} ${COMPILER_SSE2_FLAG}")
add_definitions(-D__SSE2__)
if(NOT SUPPORT_SSE_BUILD) # don't double up
add_definitions(-D__MMX__)
# Enable SIMD support if detected by TEST_SSE_SUPPORT() or TEST_NEON_SUPPORT().
#
# This is done globally, so that all modules can use it if available, and
# because these are used in headers used by many modules.
if(WITH_CPU_SIMD)
if(SUPPORT_NEON_BUILD)
# Neon
if(SSE2NEON_FOUND)
blender_include_dirs_sys("${SSE2NEON_INCLUDE_DIRS}")
add_definitions(-DWITH_SSE2NEON)
endif()
else()
# SSE
if(SUPPORT_SSE_BUILD)
string(PREPEND PLATFORM_CFLAGS "${COMPILER_SSE_FLAG} ")
add_definitions(-D__SSE__ -D__MMX__)
endif()
if(SUPPORT_SSE2_BUILD)
string(APPEND PLATFORM_CFLAGS " ${COMPILER_SSE2_FLAG}")
add_definitions(-D__SSE2__)
if(NOT SUPPORT_SSE_BUILD) # don't double up
add_definitions(-D__MMX__)
endif()
endif()
endif()
endif()
# Print instructions used
if(SUPPORT_NEON_BUILD)
if(SSE2NEON_FOUND)
message(STATUS "Neon SIMD instructions enabled")
else()
message(STATUS "Neon SIMD instructions detected but unused, requires sse2neon")
endif()
elseif(SUPPORT_SSE2_BUILD)
message(STATUS "SSE2 SIMD instructions enabled")
elseif(SUPPORT_SSE_BUILD)
message(STATUS "SSE SIMD instructions enabled")
else()
message(STATUS "No SIMD instructions detected")
endif()
else()
message(STATUS "SIMD instructions disabled")
endif()
# set the endian define
if(MSVC)
@@ -997,6 +1080,9 @@ if(WITH_OPENVDB)
list(APPEND OPENVDB_DEFINITIONS -DOPENVDB_3_ABI_COMPATIBLE)
endif()
# OpenVDB headers use deprecated TBB headers, silence warning.
list(APPEND OPENVDB_DEFINITIONS -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1)
list(APPEND OPENVDB_INCLUDE_DIRS
${BOOST_INCLUDE_DIR}
${TBB_INCLUDE_DIRS}
@@ -1157,8 +1243,10 @@ if(WITH_OPENMP)
if(OPENMP_FOUND)
if(NOT WITH_OPENMP_STATIC)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
string(APPEND CMAKE_C_FLAGS " ${OpenMP_C_FLAGS}")
string(APPEND CMAKE_CXX_FLAGS " ${OpenMP_CXX_FLAGS}")
string(APPEND CMAKE_EXE_LINKER_FLAGS " ${OpenMP_LINKER_FLAGS}")
string(APPEND CMAKE_MODULE_LINKER_FLAGS " ${OpenMP_LINKER_FLAGS}")
else()
# Typically avoid adding flags as defines but we can't
# pass OpenMP flags to the linker for static builds, meaning
@@ -1169,6 +1257,7 @@ if(WITH_OPENMP)
find_library_static(OpenMP_LIBRARIES gomp ${CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES})
endif()
else()
message(STATUS "OpenMP not found, disabling WITH_OPENMP")
set(WITH_OPENMP OFF)
endif()
@@ -1244,6 +1333,7 @@ list(APPEND GL_DEFINITIONS -DGLEW_NO_GLU)
if(WITH_BULLET AND WITH_SYSTEM_BULLET)
find_package(Bullet)
if(NOT BULLET_FOUND)
message(STATUS "Bullet not found, disabling WITH_BULLET")
set(WITH_BULLET OFF)
endif()
else()
@@ -1412,6 +1502,7 @@ if(CMAKE_COMPILER_IS_GNUCC)
# gcc 4.2 gives annoying warnings on every file with this
if(NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "4.3")
ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_UNINITIALIZED -Wuninitialized)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_UNINITIALIZED -Wuninitialized)
endif()
# versions before gcc4.6 give many BLI_math warnings
@@ -1449,6 +1540,7 @@ if(CMAKE_COMPILER_IS_GNUCC)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_UNDEF -Wundef)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_FORMAT_SIGN -Wformat-signedness)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_RESTRICT -Wrestrict)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_SUGGEST_OVERRIDE -Wno-suggest-override)
# gcc 4.2 gives annoying warnings on every file with this
if(NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "4.3")
@@ -1475,10 +1567,14 @@ if(CMAKE_COMPILER_IS_GNUCC)
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_INT_IN_BOOL_CONTEXT -Wno-int-in-bool-context)
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_FORMAT -Wno-format)
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_SWITCH -Wno-switch)
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_VARIABLE -Wno-unused-variable)
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_VARIABLE -Wno-uninitialized)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_REMOVE_STRICT_FLAGS CXX_WARN_NO_CLASS_MEMACCESS -Wno-class-memaccess)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_REMOVE_STRICT_FLAGS CXX_WARN_NO_COMMENT -Wno-comment)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_REMOVE_STRICT_FLAGS CXX_WARN_NO_UNUSED_TYPEDEFS -Wno-unused-local-typedefs)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_REMOVE_STRICT_FLAGS CXX_WARN_NO_UNUSED_VARIABLE -Wno-unused-variable)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_REMOVE_STRICT_FLAGS CXX_WARN_NO_UNUSED_VARIABLE -Wno-uninitialized)
if(CMAKE_COMPILER_IS_GNUCC AND (NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "7.0"))
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_IMPLICIT_FALLTHROUGH -Wno-implicit-fallthrough)
@@ -1508,6 +1604,8 @@ elseif(CMAKE_C_COMPILER_ID MATCHES "Clang")
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_OVERLOADED_VIRTUAL -Wno-overloaded-virtual) # we get a lot of these, if its a problem a dev needs to look into it.
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_SIGN_COMPARE -Wno-sign-compare)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_INVALID_OFFSETOF -Wno-invalid-offsetof)
# Apple Clang (tested on version 12) doesn't support this flag while LLVM Clang 11 does.
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_SUGGEST_OVERRIDE -Wno-suggest-override)
# gives too many unfixable warnings
# ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_UNUSED_MACROS -Wunused-macros)
@@ -1517,6 +1615,7 @@ elseif(CMAKE_C_COMPILER_ID MATCHES "Clang")
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)
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_MACROS -Wno-unused-macros)
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_MISLEADING_INDENTATION -Wno-misleading-indentation)
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_MISSING_VARIABLE_DECLARATIONS -Wno-missing-variable-declarations)
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_INCOMPAT_PTR_DISCARD_QUAL -Wno-incompatible-pointer-types-discards-qualifiers)
@@ -1527,15 +1626,18 @@ elseif(CMAKE_C_COMPILER_ID MATCHES "Clang")
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_UNDEF -Wno-undef)
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_MISSING_NORETURN -Wno-missing-noreturn)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_REMOVE_STRICT_FLAGS CXX_WARN_NO_UNUSED_PARAMETER -Wno-unused-parameter)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_REMOVE_STRICT_FLAGS CXX_WARN_NO_UNUSED_PRIVATE_FIELD -Wno-unused-private-field)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_REMOVE_STRICT_FLAGS CXX_WARN_NO_CXX11_NARROWING -Wno-c++11-narrowing)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_REMOVE_STRICT_FLAGS CXX_WARN_NO_NON_VIRTUAL_DTOR -Wno-non-virtual-dtor)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_REMOVE_STRICT_FLAGS CXX_WARN_NO_UNUSED_MACROS -Wno-unused-macros)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_REMOVE_STRICT_FLAGS CXX_WARN_NO_UNUSED_VARIABLE -Wno-unused-variable)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_REMOVE_STRICT_FLAGS CXX_WARN_NO_REORDER -Wno-reorder)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_REMOVE_STRICT_FLAGS CXX_WARN_NO_COMMENT -Wno-comment)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_REMOVE_STRICT_FLAGS CXX_WARN_NO_UNUSED_TYPEDEFS -Wno-unused-local-typedefs)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_REMOVE_STRICT_FLAGS CXX_WARN_NO_UNDEFINED_VAR_TEMPLATE -Wno-undefined-var-template)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_REMOVE_STRICT_FLAGS CXX_WARN_NO_INSTANTIATION_AFTER_SPECIALIZATION -Wno-instantiation-after-specialization)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_REMOVE_STRICT_FLAGS CXX_WARN_NO_MISLEADING_INDENTATION -Wno-misleading-indentation)
elseif(CMAKE_C_COMPILER_ID MATCHES "Intel")
@@ -1548,8 +1650,8 @@ elseif(CMAKE_C_COMPILER_ID MATCHES "Intel")
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_SIGN_COMPARE -Wno-sign-compare)
# disable numbered, false positives
set(C_WARNINGS "${C_WARNINGS} -wd188,186,144,913,556,858,597,177,1292,167,279,592,94,2722,3199")
set(CXX_WARNINGS "${CXX_WARNINGS} -wd188,186,144,913,556,858,597,177,1292,167,279,592,94,2722,3199")
string(APPEND C_WARNINGS " -wd188,186,144,913,556,858,597,177,1292,167,279,592,94,2722,3199")
string(APPEND CXX_WARNINGS " -wd188,186,144,913,556,858,597,177,1292,167,279,592,94,2722,3199")
elseif(CMAKE_C_COMPILER_ID MATCHES "MSVC")
# most msvc warnings are C & C++
set(_WARNINGS
@@ -1580,7 +1682,7 @@ elseif(CMAKE_C_COMPILER_ID MATCHES "MSVC")
if(MSVC_VERSION GREATER_EQUAL 1911)
# see https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/c5038?view=vs-2017
set(_WARNINGS "${_WARNINGS} /w35038") # order of initialization in c++ constructors
string(APPEND _WARNINGS " /w35038") # order of initialization in c++ constructors
endif()
string(REPLACE ";" " " _WARNINGS "${_WARNINGS}")
@@ -1604,38 +1706,31 @@ if(WITH_PYTHON)
if(WIN32 OR APPLE)
# Windows and macOS have this bundled with Python libraries.
elseif((WITH_PYTHON_INSTALL AND WITH_PYTHON_INSTALL_NUMPY) OR (WITH_AUDASPACE AND NOT WITH_SYSTEM_AUDASPACE))
elseif((WITH_PYTHON_INSTALL AND WITH_PYTHON_INSTALL_NUMPY) OR WITH_PYTHON_NUMPY)
if(("${PYTHON_NUMPY_PATH}" STREQUAL "") OR (${PYTHON_NUMPY_PATH} MATCHES NOTFOUND))
find_python_package(numpy)
unset(PYTHON_NUMPY_INCLUDE_DIRS CACHE)
set(PYTHON_NUMPY_INCLUDE_DIRS ${PYTHON_NUMPY_PATH}/numpy/core/include CACHE PATH "Path to the include directory of the numpy module")
mark_as_advanced(PYTHON_NUMPY_INCLUDE_DIRS)
find_python_package(numpy "core/include")
endif()
endif()
if(WIN32 OR APPLE)
# pass, we have this in lib/python/site-packages
elseif(WITH_PYTHON_INSTALL_REQUESTS)
find_python_package(requests)
find_python_package(requests "")
endif()
endif()
if(MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++17")
# Make MSVC properly report the value of the __cplusplus preprocessor macro
# Available MSVC 15.7 (1914) and up, without this it reports 199711L regardless
# of the C++ standard chosen above
if(MSVC_VERSION GREATER 1913)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zc:__cplusplus")
endif()
elseif(
CMAKE_COMPILER_IS_GNUCC OR
CMAKE_C_COMPILER_ID MATCHES "Clang" OR
CMAKE_C_COMPILER_ID MATCHES "Intel"
)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
else()
message(FATAL_ERROR "Unknown compiler ${CMAKE_C_COMPILER_ID}, can't enable C++17 build")
# Select C++17 as the standard for C++ projects.
set(CMAKE_CXX_STANDARD 17)
# If C++17 is not available, downgrading to an earlier standard is NOT OK.
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# Do not enable compiler specific language extentions.
set(CMAKE_CXX_EXTENSIONS OFF)
# Make MSVC properly report the value of the __cplusplus preprocessor macro
# Available MSVC 15.7 (1914) and up, without this it reports 199711L regardless
# of the C++ standard chosen above.
if(MSVC AND MSVC_VERSION GREATER 1913)
string(APPEND CMAKE_CXX_FLAGS " /Zc:__cplusplus")
endif()
# Visual Studio has all standards it supports available by default
@@ -1646,12 +1741,47 @@ if(
(CMAKE_C_COMPILER_ID MATCHES "Intel")
)
# Use C11 + GNU extensions, works with GCC, Clang, ICC
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu11")
string(APPEND CMAKE_C_FLAGS " -std=gnu11")
endif()
if(UNIX AND NOT APPLE)
if(NOT WITH_CXX11_ABI)
set(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -D_GLIBCXX_USE_CXX11_ABI=0")
string(APPEND PLATFORM_CFLAGS " -D_GLIBCXX_USE_CXX11_ABI=0")
endif()
endif()
if(WITH_COMPILER_SHORT_FILE_MACRO)
# Use '-fmacro-prefix-map' for Clang and GCC (MSVC doesn't support this).
ADD_CHECK_C_COMPILER_FLAG(C_PREFIX_MAP_FLAGS C_MACRO_PREFIX_MAP -fmacro-prefix-map=foo=bar)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_PREFIX_MAP_FLAGS CXX_MACRO_PREFIX_MAP -fmacro-prefix-map=foo=bar)
if(C_MACRO_PREFIX_MAP AND CXX_MACRO_PREFIX_MAP)
if(APPLE)
if(XCODE AND ${XCODE_VERSION} VERSION_LESS 12.0)
# Developers may have say LLVM Clang-10.0.1 toolchain (which supports the flag)
# with Xcode-11 (the Clang of which doesn't support the flag).
message(WARNING
"-fmacro-prefix-map flag is NOT supported by Clang shipped with Xcode-${XCODE_VERSION}."
" Some Xcode functionality in Product menu may not work. Disabling WITH_COMPILER_SHORT_FILE_MACRO."
)
set(WITH_COMPILER_SHORT_FILE_MACRO OFF)
endif()
endif()
if(WITH_COMPILER_SHORT_FILE_MACRO)
path_ensure_trailing_slash(_src_dir "${CMAKE_SOURCE_DIR}")
path_ensure_trailing_slash(_bin_dir "${CMAKE_BINARY_DIR}")
# Keep this variable so it can be stripped from build-info.
set(PLATFORM_CFLAGS_FMACRO_PREFIX_MAP
"-fmacro-prefix-map=\"${_src_dir}\"=\"\" -fmacro-prefix-map=\"${_bin_dir}\"=\"\"")
string(APPEND PLATFORM_CFLAGS " ${PLATFORM_CFLAGS_FMACRO_PREFIX_MAP}")
unset(_src_dir)
unset(_bin_dir)
endif()
else()
message(WARNING
"-fmacro-prefix-map flag is NOT supported by C/C++ compiler."
" Disabling WITH_COMPILER_SHORT_FILE_MACRO."
)
set(WITH_COMPILER_SHORT_FILE_MACRO OFF)
endif()
endif()
@@ -1704,8 +1834,20 @@ if(WITH_BLENDER)
# internal and external library information first, for test linking
add_subdirectory(source)
elseif(WITH_CYCLES_STANDALONE)
add_subdirectory(intern/glew-mx)
add_subdirectory(intern/guardedalloc)
add_subdirectory(intern/libc_compat)
add_subdirectory(intern/numaapi)
add_subdirectory(intern/sky)
add_subdirectory(intern/cycles)
add_subdirectory(extern/clew)
if(WITH_CYCLES_LOGGING)
if(NOT WITH_SYSTEM_GFLAGS)
add_subdirectory(extern/gflags)
endif()
add_subdirectory(extern/glog)
endif()
if(WITH_CUDA_DYNLOAD)
add_subdirectory(extern/cuew)
endif()
@@ -1714,6 +1856,10 @@ elseif(WITH_CYCLES_STANDALONE)
endif()
endif()
#-----------------------------------------------------------------------------
# Testing
add_subdirectory(tests)
#-----------------------------------------------------------------------------
# Blender Application
if(WITH_BLENDER)
@@ -1721,11 +1867,6 @@ if(WITH_BLENDER)
endif()
#-----------------------------------------------------------------------------
# Testing
add_subdirectory(tests)
#-----------------------------------------------------------------------------
# Define 'heavy' submodules (for Ninja builder when using pools).
setup_heavy_lib_pool()
@@ -1755,7 +1896,7 @@ if(FIRST_RUN)
set(_msg " - ${_setting}")
string(LENGTH "${_msg}" _len)
while("32" GREATER "${_len}")
set(_msg "${_msg} ")
string(APPEND _msg " ")
math(EXPR _len "${_len} + 1")
endwhile()
@@ -1773,24 +1914,29 @@ if(FIRST_RUN)
message(STATUS "C++ Compiler: \"${CMAKE_CXX_COMPILER_ID}\"")
info_cfg_text("Build Options:")
info_cfg_option(WITH_ALEMBIC)
info_cfg_option(WITH_BULLET)
info_cfg_option(WITH_IK_SOLVER)
info_cfg_option(WITH_IK_ITASC)
info_cfg_option(WITH_OPENCOLLADA)
info_cfg_option(WITH_FFTW3)
info_cfg_option(WITH_INTERNATIONAL)
info_cfg_option(WITH_INPUT_NDOF)
info_cfg_option(WITH_CLANG)
info_cfg_option(WITH_CYCLES)
info_cfg_option(WITH_FFTW3)
info_cfg_option(WITH_FREESTYLE)
info_cfg_option(WITH_GMP)
info_cfg_option(WITH_HARU)
info_cfg_option(WITH_IK_ITASC)
info_cfg_option(WITH_IK_SOLVER)
info_cfg_option(WITH_INPUT_NDOF)
info_cfg_option(WITH_INPUT_IME)
info_cfg_option(WITH_INTERNATIONAL)
info_cfg_option(WITH_OPENCOLLADA)
info_cfg_option(WITH_OPENCOLORIO)
info_cfg_option(WITH_XR_OPENXR)
info_cfg_option(WITH_OPENIMAGEDENOISE)
info_cfg_option(WITH_OPENVDB)
info_cfg_option(WITH_ALEMBIC)
info_cfg_option(WITH_POTRACE)
info_cfg_option(WITH_PUGIXML)
info_cfg_option(WITH_QUADRIFLOW)
info_cfg_option(WITH_USD)
info_cfg_option(WITH_TBB)
info_cfg_option(WITH_GMP)
info_cfg_option(WITH_USD)
info_cfg_option(WITH_XR_OPENXR)
info_cfg_text("Compiler Options:")
info_cfg_option(WITH_BUILDINFO)
@@ -1798,58 +1944,62 @@ if(FIRST_RUN)
info_cfg_text("System Options:")
info_cfg_option(WITH_INSTALL_PORTABLE)
info_cfg_option(WITH_MEM_JEMALLOC)
info_cfg_option(WITH_MEM_VALGRIND)
info_cfg_option(WITH_SYSTEM_GLEW)
info_cfg_option(WITH_X11_ALPHA)
info_cfg_option(WITH_X11_XF86VMODE)
info_cfg_option(WITH_X11_XFIXES)
info_cfg_option(WITH_X11_XINPUT)
info_cfg_option(WITH_MEM_JEMALLOC)
info_cfg_option(WITH_MEM_VALGRIND)
info_cfg_option(WITH_SYSTEM_GLEW)
info_cfg_text("Image Formats:")
info_cfg_option(WITH_OPENIMAGEIO)
info_cfg_option(WITH_IMAGE_CINEON)
info_cfg_option(WITH_IMAGE_DDS)
info_cfg_option(WITH_IMAGE_HDR)
info_cfg_option(WITH_IMAGE_OPENEXR)
info_cfg_option(WITH_IMAGE_OPENJPEG)
info_cfg_option(WITH_IMAGE_TIFF)
info_cfg_option(WITH_OPENIMAGEIO)
info_cfg_text("Audio:")
info_cfg_option(WITH_OPENAL)
info_cfg_option(WITH_SDL)
info_cfg_option(WITH_SDL_DYNLOAD)
info_cfg_option(WITH_JACK)
info_cfg_option(WITH_JACK_DYNLOAD)
info_cfg_option(WITH_CODEC_AVI)
info_cfg_option(WITH_CODEC_FFMPEG)
info_cfg_option(WITH_CODEC_SNDFILE)
info_cfg_option(WITH_COREAUDIO)
info_cfg_option(WITH_JACK)
info_cfg_option(WITH_JACK_DYNLOAD)
info_cfg_option(WITH_OPENAL)
info_cfg_option(WITH_PULSEAUDIO)
info_cfg_option(WITH_PULSEAUDIO_DYNLOAD)
info_cfg_option(WITH_SDL)
info_cfg_option(WITH_SDL_DYNLOAD)
info_cfg_option(WITH_WASAPI)
info_cfg_text("Compression:")
info_cfg_option(WITH_LZMA)
info_cfg_option(WITH_LZO)
info_cfg_text("Python:")
if(APPLE)
info_cfg_option(WITH_PYTHON_FRAMEWORK)
endif()
info_cfg_option(WITH_PYTHON_INSTALL)
info_cfg_option(WITH_PYTHON_INSTALL_NUMPY)
info_cfg_option(WITH_PYTHON_MODULE)
info_cfg_option(WITH_PYTHON_SAFETY)
if(APPLE)
info_cfg_option(WITH_PYTHON_FRAMEWORK)
endif()
info_cfg_text("Modifiers:")
info_cfg_option(WITH_MOD_REMESH)
info_cfg_option(WITH_MOD_FLUID)
info_cfg_option(WITH_MOD_OCEANSIM)
info_cfg_option(WITH_MOD_REMESH)
info_cfg_text("OpenGL:")
info_cfg_option(WITH_GLEW_ES)
info_cfg_option(WITH_GL_EGL)
info_cfg_option(WITH_GL_PROFILE_ES20)
if(WIN32)
info_cfg_option(WITH_GL_ANGLE)
endif()
info_cfg_option(WITH_GL_EGL)
info_cfg_option(WITH_GL_PROFILE_ES20)
info_cfg_option(WITH_GLEW_ES)
info_cfg_text("")

View File

@@ -26,25 +26,31 @@
define HELP_TEXT
Convenience Targets
Blender Convenience Targets
Provided for building Blender, (multiple at once can be used).
* debug: Build a debug binary.
* full: Enable all supported dependencies & options.
* lite: Disable non essential features for a smaller binary and faster build.
* release Complete build with all options enabled including CUDA and Optix, matching the releases on blender.org
* release: Complete build with all options enabled including CUDA and Optix, matching the releases on blender.org
* headless: Build without an interface (renderfarm or server automation).
* cycles: Build Cycles standalone only, without Blender.
* bpy: Build as a python module which can be loaded from python directly.
* deps: Build library dependencies (intended only for platform maintainers).
* developer: Enable faster builds, error checking and tests, recommended for developers.
* config: Run cmake configuration tool to set build options.
* ninja: Use ninja build tool for faster builds.
* ccache: Use ccache for faster rebuilds.
Note: passing the argument 'BUILD_DIR=path' when calling make will override the default build dir.
Note: passing the argument 'BUILD_CMAKE_ARGS=args' lets you add cmake arguments.
Other Convenience Targets
Provided for other building operations.
* config: Run cmake configuration tool to set build options.
* deps: Build library dependencies (intended only for platform maintainers).
The existance of locally build dependancies overrides the pre-built dependencies from subversion.
These must be manually removed from '../lib/' to go back to using the pre-compiled libraries.
Project Files
Generate project files for development environments.
@@ -57,7 +63,7 @@ Package Targets
* package_debian: Build a debian package.
* package_pacman: Build an arch linux pacman package.
* package_archive: Build an archive package.
* package_archive: Build an archive package.
Testing Targets
Not associated with building Blender.
@@ -84,12 +90,15 @@ Static Source Code Checking
* check_descriptions: Check for duplicate/invalid descriptions.
Spell Checkers
This runs the spell checker from the developer tools repositor.
* check_spelling_c: Check for spelling errors (C/C++ only),
* check_spelling_osl: Check for spelling errors (OSL only).
* check_spelling_py: Check for spelling errors (Python only).
Note that spell checkers can take a 'CHECK_SPELLING_CACHE' filepath argument,
Note: an additional word-list is maintained at: 'source/tools/check_source/check_spelling_c_config.py'
Note: that spell checkers can take a 'CHECK_SPELLING_CACHE' filepath argument,
so re-running does not need to re-check unchanged files.
Example:
@@ -119,10 +128,16 @@ Utilities
* source_archive:
Create a compressed archive of the source code.
* update:
updates git and all submodules
* source_archive_complete:
Create a compressed archive of the source code and all the libraries of dependencies.
* format
* update:
Updates git and all submodules and svn.
* update_code:
Updates git and all submodules but not svn.
* format:
Format source code using clang (uses PATHS if passed in). For example::
make format PATHS="source/blender/blenlib source/blender/blenkernel"
@@ -152,7 +167,7 @@ endef
# This makefile is not meant for Windows
ifeq ($(OS),Windows_NT)
$(error On Windows, use "cmd //c make.bat" instead of "make")
$(error On Windows, use "cmd //c make.bat" instead of "make")
endif
# System Vars
@@ -182,8 +197,13 @@ endif
ifndef DEPS_INSTALL_DIR
DEPS_INSTALL_DIR:=$(shell dirname "$(BLENDER_DIR)")/lib/$(OS_NCASE)
ifneq ($(OS_NCASE),darwin)
# Add processor type to directory name
# Add processor type to directory name, except for darwin x86_64
# which by convention does not have it.
ifeq ($(OS_NCASE),darwin)
ifneq ($(CPU),x86_64)
DEPS_INSTALL_DIR:=$(DEPS_INSTALL_DIR)_$(CPU)
endif
else
DEPS_INSTALL_DIR:=$(DEPS_INSTALL_DIR)_$(CPU)
endif
endif
@@ -197,7 +217,7 @@ endif
# in libraries, or python 2 for running make update to get it.
ifeq ($(OS_NCASE),darwin)
ifeq (, $(shell command -v $(PYTHON)))
PYTHON:=../lib/darwin/python/bin/python3.7m
PYTHON:=$(DEPS_INSTALL_DIR)/python/bin/python3.7m
ifeq (, $(shell command -v $(PYTHON)))
PYTHON:=python
endif
@@ -241,6 +261,10 @@ ifneq "$(findstring developer, $(MAKECMDGOALS))" ""
CMAKE_CONFIG_ARGS:=-C"$(BLENDER_DIR)/build_files/cmake/config/blender_developer.cmake" $(CMAKE_CONFIG_ARGS)
endif
ifneq "$(findstring ccache, $(MAKECMDGOALS))" ""
CMAKE_CONFIG_ARGS:=-DWITH_COMPILER_CCACHE=YES $(CMAKE_CONFIG_ARGS)
endif
# -----------------------------------------------------------------------------
# build tool
@@ -340,6 +364,7 @@ headless: all
bpy: all
developer: all
ninja: all
ccache: all
# -----------------------------------------------------------------------------
# Build dependencies
@@ -354,7 +379,7 @@ deps: .FORCE
@cmake -H"$(DEPS_SOURCE_DIR)" \
-B"$(DEPS_BUILD_DIR)" \
-DHARVEST_TARGET=$(DEPS_INSTALL_DIR)
-DHARVEST_TARGET=$(DEPS_INSTALL_DIR)
@echo
@echo Building dependencies ...
@@ -431,7 +456,8 @@ project_eclipse: .FORCE
check_cppcheck: .FORCE
$(CMAKE_CONFIG)
cd "$(BUILD_DIR)" ; \
$(PYTHON) "$(BLENDER_DIR)/build_files/cmake/cmake_static_check_cppcheck.py" 2> \
$(PYTHON) \
"$(BLENDER_DIR)/build_files/cmake/cmake_static_check_cppcheck.py" 2> \
"$(BLENDER_DIR)/check_cppcheck.txt"
@echo "written: check_cppcheck.txt"
@@ -455,6 +481,9 @@ check_smatch: .FORCE
cd "$(BUILD_DIR)" ; \
$(PYTHON) "$(BLENDER_DIR)/build_files/cmake/cmake_static_check_smatch.py"
check_mypy: .FORCE
$(PYTHON) "$(BLENDER_DIR)/source/tools/check_source/check_mypy.py"
check_spelling_py: .FORCE
cd "$(BUILD_DIR)" ; \
PYTHONIOENCODING=utf_8 $(PYTHON) \
@@ -487,14 +516,24 @@ check_descriptions: .FORCE
#
source_archive: .FORCE
./build_files/utils/make_source_archive.sh
python3 ./build_files/utils/make_source_archive.py
source_archive_complete: .FORCE
cmake \
-S "$(BLENDER_DIR)/build_files/build_environment" -B"$(BUILD_DIR)/source_archive" \
-DCMAKE_BUILD_TYPE_INIT:STRING=$(BUILD_TYPE) -DPACKAGE_USE_UPSTREAM_SOURCES=OFF
# This assumes CMake is still using a default `PACKAGE_DIR` variable:
python3 ./build_files/utils/make_source_archive.py --include-packages "$(BUILD_DIR)/source_archive/packages"
INKSCAPE_BIN?="inkscape"
icons: .FORCE
BLENDER_BIN=$(BLENDER_BIN) INKSCAPE_BIN=$(INKSCAPE_BIN) \
"$(BLENDER_DIR)/release/datafiles/blender_icons_update.py"
BLENDER_BIN=$(BLENDER_BIN) INKSCAPE_BIN=$(INKSCAPE_BIN) \
"$(BLENDER_DIR)/release/datafiles/prvicons_update.py"
"$(BLENDER_DIR)/release/datafiles/blender_icons_update.py"
INKSCAPE_BIN=$(INKSCAPE_BIN) \
"$(BLENDER_DIR)/release/datafiles/prvicons_update.py"
INKSCAPE_BIN=$(INKSCAPE_BIN) \
"$(BLENDER_DIR)/release/datafiles/alert_icons_update.py"
icons_geom: .FORCE
BLENDER_BIN=$(BLENDER_BIN) \
@@ -503,9 +542,12 @@ icons_geom: .FORCE
update: .FORCE
$(PYTHON) ./build_files/utils/make_update.py
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)
$(PYTHON) source/tools/utils_maintenance/clang_format_paths.py $(PATHS)
# -----------------------------------------------------------------------------
@@ -514,9 +556,10 @@ format: .FORCE
# Simple version of ./doc/python_api/sphinx_doc_gen.sh with no PDF generation.
doc_py: .FORCE
ASAN_OPTIONS=halt_on_error=0 \
$(BLENDER_BIN) --background -noaudio --factory-startup \
--python doc/python_api/sphinx_doc_gen.py
ASAN_OPTIONS=halt_on_error=0:${ASAN_OPTIONS} \
$(BLENDER_BIN) \
--background -noaudio --factory-startup \
--python doc/python_api/sphinx_doc_gen.py
sphinx-build -b html -j $(NPROCS) doc/python_api/sphinx-in doc/python_api/sphinx-out
@echo "docs written into: '$(BLENDER_DIR)/doc/python_api/sphinx-out/index.html'"
@@ -525,8 +568,9 @@ doc_doxy: .FORCE
@echo "docs written into: '$(BLENDER_DIR)/doc/doxygen/html/index.html'"
doc_dna: .FORCE
$(BLENDER_BIN) --background -noaudio --factory-startup \
--python doc/blender_file_format/BlendFileDnaExporter_25.py
$(BLENDER_BIN) \
--background -noaudio --factory-startup \
--python doc/blender_file_format/BlendFileDnaExporter_25.py
@echo "docs written into: '$(BLENDER_DIR)/doc/blender_file_format/dna.html'"
doc_man: .FORCE

View File

@@ -31,6 +31,7 @@
#
# MAC OS X USAGE:
# Install with homebrew: brew install autoconf automake bison cmake libtool pkg-config yasm
# Additional requirements for macOS arm64: brew install flex
# Run "make deps" from main Blender directory
#
# LINUX USAGE:
@@ -46,6 +47,7 @@ include(ExternalProject)
include(cmake/check_software.cmake)
include(cmake/options.cmake)
include(cmake/versions.cmake)
include(cmake/download.cmake)
if(ENABLE_MINGW64)
include(cmake/setup_mingw64.cmake)
@@ -54,6 +56,7 @@ else()
endif()
include(cmake/zlib.cmake)
include(cmake/zstd.cmake)
include(cmake/openal.cmake)
include(cmake/png.cmake)
include(cmake/jpeg.cmake)
@@ -70,9 +73,7 @@ include(cmake/cuew.cmake)
include(cmake/opensubdiv.cmake)
include(cmake/sdl.cmake)
include(cmake/opencollada.cmake)
include(cmake/opencolorio.cmake)
include(cmake/llvm.cmake)
include(cmake/clang.cmake)
if(APPLE)
include(cmake/openmp.cmake)
endif()
@@ -81,42 +82,48 @@ if(UNIX)
endif()
include(cmake/openimageio.cmake)
include(cmake/tiff.cmake)
include(cmake/flexbison.cmake)
if(WIN32)
include(cmake/flexbison.cmake)
elseif(UNIX AND NOT APPLE)
include(cmake/flex.cmake)
endif()
include(cmake/osl.cmake)
include(cmake/tbb.cmake)
include(cmake/openvdb.cmake)
include(cmake/nanovdb.cmake)
include(cmake/python.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)
else()
include(cmake/numpy.cmake)
endif()
include(cmake/python_site_packages.cmake)
include(cmake/package_python.cmake)
include(cmake/numpy.cmake)
include(cmake/usd.cmake)
include(cmake/potrace.cmake)
include(cmake/haru.cmake)
# Boost needs to be included after python.cmake due to the PYTHON_BINARY variable being needed.
include(cmake/boost.cmake)
if(UNIX)
# Rely on PugiXML compiled with OpenImageIO
else()
include(cmake/pugixml.cmake)
endif()
if((NOT APPLE) OR ("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "x86_64"))
include(cmake/ispc.cmake)
include(cmake/openimagedenoise.cmake)
include(cmake/embree.cmake)
endif()
include(cmake/pugixml.cmake)
include(cmake/ispc.cmake)
include(cmake/openimagedenoise.cmake)
include(cmake/embree.cmake)
if(NOT APPLE)
include(cmake/xr_openxr.cmake)
endif()
if(WITH_WEBP)
include(cmake/webp.cmake)
# OpenColorIO and dependencies.
include(cmake/expat.cmake)
include(cmake/yamlcpp.cmake)
include(cmake/opencolorio.cmake)
if(BLENDER_PLATFORM_ARM)
include(cmake/sse2neon.cmake)
endif()
if(WIN32)
# OCIO deps
include(cmake/tinyxml.cmake)
include(cmake/yamlcpp.cmake)
# LCMS is an OCIO dep, but only if you build the apps, leaving it here for convenience
# include(cmake/lcms.cmake)
if(WITH_WEBP)
include(cmake/webp.cmake)
endif()
if(NOT WIN32 OR ENABLE_MINGW64)
@@ -162,6 +169,7 @@ endif()
if(UNIX AND NOT APPLE)
include(cmake/libglu.cmake)
include(cmake/mesa.cmake)
include(cmake/wayland_protocols.cmake)
endif()
include(cmake/harvest.cmake)

View File

@@ -19,16 +19,6 @@
set(ALEMBIC_EXTRA_ARGS
-DBUILDSTATIC=ON
-DLINKSTATIC=ON
-DALEMBIC_LIB_USES_BOOST=ON
-DBoost_COMPILER:STRING=${BOOST_COMPILER_STRING}
-DBoost_USE_MULTITHREADED=ON
-DUSE_STATIC_BOOST=On
-DBoost_USE_STATIC_LIBS=ON
-DBoost_USE_STATIC_RUNTIME=OFF
-DBoost_DEBUG=ON
-DBOOST_ROOT=${LIBDIR}/boost
-DBoost_NO_SYSTEM_PATHS=ON
-DBoost_NO_BOOST_CMAKE=ON
-DILMBASE_ROOT=${LIBDIR}/openexr
-DALEMBIC_ILMBASE_INCLUDE_DIRECTORY=${LIBDIR}/openexr/include/OpenEXR
-DALEMBIC_ILMBASE_HALF_LIB=${LIBDIR}/openexr/lib/${LIBPREFIX}Half${OPENEXR_VERSION_POSTFIX}${LIBEXT}
@@ -54,9 +44,9 @@ set(ALEMBIC_EXTRA_ARGS
)
ExternalProject_Add(external_alembic
URL ${ALEMBIC_URI}
URL file://${PACKAGE_DIR}/${ALEMBIC_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${ALEMBIC_MD5}
URL_HASH ${ALEMBIC_HASH_TYPE}=${ALEMBIC_HASH}
PREFIX ${BUILD_DIR}/alembic
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/alembic -Wno-dev ${DEFAULT_CMAKE_FLAGS} ${ALEMBIC_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/alembic
@@ -81,7 +71,6 @@ endif()
add_dependencies(
external_alembic
external_boost
external_zlib
external_openexr
)

View File

@@ -29,16 +29,16 @@ set(BLOSC_EXTRA_ARGS
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
)
# Prevent blosc from including it's own local copy of zlib in the object file
# Prevent blosc from including its own local copy of zlib in the object file
# and cause linker errors with everybody else.
set(BLOSC_EXTRA_ARGS ${BLOSC_EXTRA_ARGS}
-DPREFER_EXTERNAL_ZLIB=ON
)
ExternalProject_Add(external_blosc
URL ${BLOSC_URI}
URL file://${PACKAGE_DIR}/${BLOSC_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${BLOSC_HASH}
URL_HASH ${BLOSC_HASH_TYPE}=${BLOSC_HASH}
PREFIX ${BUILD_DIR}/blosc
PATCH_COMMAND ${PATCH_CMD} --verbose -p 1 -N -d ${BUILD_DIR}/blosc/src/external_blosc < ${PATCH_DIR}/blosc.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/blosc ${DEFAULT_CMAKE_FLAGS} ${BLOSC_EXTRA_ARGS}

View File

@@ -18,18 +18,23 @@
set(BOOST_ADDRESS_MODEL 64)
if(BLENDER_PLATFORM_ARM)
set(BOOST_ARCHITECTURE arm)
else()
set(BOOST_ARCHITECTURE x86)
endif()
if(WIN32)
set(BOOST_TOOLSET toolset=msvc-14.1)
set(BOOST_COMPILER_STRING -vc141)
set(BOOST_CONFIGURE_COMMAND bootstrap.bat)
set(BOOST_BUILD_COMMAND bjam)
set(BOOST_BUILD_COMMAND b2)
set(BOOST_BUILD_OPTIONS runtime-link=shared )
set(BOOST_HARVEST_CMD ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/boost/lib/ ${HARVEST_TARGET}/boost/lib/ )
if(BUILD_MODE STREQUAL Release)
set(BOOST_HARVEST_CMD ${BOOST_HARVEST_CMD} && ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/boost/include/boost-${BOOST_VERSION_NODOTS_SHORT}/ ${HARVEST_TARGET}/boost/include/)
endif()
elseif(APPLE)
set(BOOST_CONFIGURE_COMMAND ./bootstrap.sh)
set(BOOST_BUILD_COMMAND ./b2)
@@ -86,14 +91,14 @@ set(BOOST_OPTIONS
string(TOLOWER ${BUILD_MODE} BOOST_BUILD_TYPE)
ExternalProject_Add(external_boost
URL ${BOOST_URI}
URL file://${PACKAGE_DIR}/${BOOST_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${BOOST_HASH}
URL_HASH ${BOOST_HASH_TYPE}=${BOOST_HASH}
PREFIX ${BUILD_DIR}/boost
UPDATE_COMMAND ""
PATCH_COMMAND ${BOOST_PATCH_COMMAND}
CONFIGURE_COMMAND ${BOOST_CONFIGURE_COMMAND}
BUILD_COMMAND ${BOOST_BUILD_COMMAND} ${BOOST_BUILD_OPTIONS} -j${MAKE_THREADS} architecture=x86 address-model=${BOOST_ADDRESS_MODEL} link=static threading=multi ${BOOST_OPTIONS} --prefix=${LIBDIR}/boost install
BUILD_COMMAND ${BOOST_BUILD_COMMAND} ${BOOST_BUILD_OPTIONS} -j${MAKE_THREADS} architecture=${BOOST_ARCHITECTURE} address-model=${BOOST_ADDRESS_MODEL} link=static threading=multi ${BOOST_OPTIONS} --prefix=${LIBDIR}/boost install
BUILD_IN_SOURCE 1
INSTALL_COMMAND "${BOOST_HARVEST_CMD}"
)

View File

@@ -30,9 +30,9 @@ else()
endif()
ExternalProject_Add(external_bzip2
URL ${BZIP2_URI}
URL file://${PACKAGE_DIR}/${BZIP2_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH SHA256=${BZIP2_HASH}
URL_HASH ${BZIP2_HASH_TYPE}=${BZIP2_HASH}
PREFIX ${BUILD_DIR}/bzip2
CONFIGURE_COMMAND echo .
BUILD_COMMAND ${BZIP2_CONFIGURE_ENV} && cd ${BUILD_DIR}/bzip2/src/external_bzip2/ && make CFLAGS=${BZIP2_CFLAGS} LDFLAGS=${BZIP2_LDFLAGS} -j${MAKE_THREADS}

View File

@@ -33,6 +33,16 @@ if(UNIX)
yasm
)
if(NOT APPLE)
set(_required_software
${_required_software}
# Needed for Mesa.
meson
ninja
)
endif()
foreach(_software ${_required_software})
find_program(_software_find NAMES ${_software})
if(NOT _software_find)
@@ -42,8 +52,14 @@ if(UNIX)
endforeach()
if(APPLE)
if(NOT EXISTS "/usr/local/opt/bison/bin/bison")
set(_software_missing "${_software_missing} bison")
# Homebrew has different default locations for ARM and Intel macOS.
if("${CMAKE_HOST_SYSTEM_PROCESSOR}" STREQUAL "arm64")
set(HOMEBREW_LOCATION "/opt/homebrew")
else()
set(HOMEBREW_LOCATION "/usr/local")
endif()
if(NOT EXISTS "${HOMEBREW_LOCATION}/opt/bison/bin/bison")
string(APPEND _software_missing " bison")
endif()
endif()
@@ -54,11 +70,14 @@ if(UNIX)
" ${_software_missing}\n"
"\n"
"On Debian and Ubuntu:\n"
" apt install autoconf automake libtool yasm tcl\n"
" apt install autoconf automake libtool yasm tcl ninja-build meson python3-mako\n"
"\n"
"On macOS (with homebrew):\n"
"On macOS Intel (with homebrew):\n"
" brew install autoconf automake bison libtool pkg-config yasm\n"
"\n"
"On macOS ARM (with homebrew):\n"
" brew install autoconf automake bison flex libtool pkg-config yasm\n"
"\n"
"Other platforms:\n"
" Install equivalent packages.\n")
message(FATAL_ERROR "Install missing software before continuing")

View File

@@ -1,74 +0,0 @@
# ***** 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.
#
# ***** END GPL LICENSE BLOCK *****
set(CLANG_EXTRA_ARGS
-DCLANG_PATH_TO_LLVM_SOURCE=${BUILD_DIR}/ll/src/ll
-DCLANG_PATH_TO_LLVM_BUILD=${LIBDIR}/llvm
-DLLVM_USE_CRT_RELEASE=MD
-DLLVM_USE_CRT_DEBUG=MDd
-DLLVM_CONFIG=${LIBDIR}/llvm/bin/llvm-config
)
if(WIN32)
set(CLANG_GENERATOR "Ninja")
else()
set(CLANG_GENERATOR "Unix Makefiles")
endif()
if(APPLE)
set(CLANG_EXTRA_ARGS ${CLANG_EXTRA_ARGS}
-DLIBXML2_LIBRARY=${LIBDIR}/xml2/lib/libxml2.a
)
endif()
ExternalProject_Add(external_clang
URL ${CLANG_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${CLANG_HASH}
PREFIX ${BUILD_DIR}/clang
CMAKE_GENERATOR ${CLANG_GENERATOR}
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/clang ${DEFAULT_CMAKE_FLAGS} ${CLANG_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/clang
)
if(MSVC)
if(BUILD_MODE STREQUAL Release)
set(CLANG_HARVEST_COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/clang/ ${HARVEST_TARGET}/llvm/)
else()
set(CLANG_HARVEST_COMMAND
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/clang/lib/ ${HARVEST_TARGET}/llvm/debug/lib/
)
endif()
ExternalProject_Add_Step(external_clang after_install
COMMAND ${CLANG_HARVEST_COMMAND}
DEPENDEES mkdir update patch download configure build install
)
endif()
add_dependencies(
external_clang
ll
)
# We currently do not build libxml2 on Windows.
if(NOT WIN32)
add_dependencies(
external_clang
external_xml2
)
endif()

View File

@@ -19,9 +19,9 @@
set(CLEW_EXTRA_ARGS)
ExternalProject_Add(external_clew
URL ${CLEW_URI}
URL file://${PACKAGE_DIR}/${CLEW_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${CLEW_HASH}
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

@@ -19,9 +19,9 @@
set(CUEW_EXTRA_ARGS)
ExternalProject_Add(external_cuew
URL ${CUEW_URI}
URL file://${PACKAGE_DIR}/${CUEW_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${CUEW_HASH}
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}

View File

@@ -0,0 +1,96 @@
function(download_source dep)
set(TARGET_FILE ${${dep}_FILE})
set(TARGET_HASH_TYPE ${${dep}_HASH_TYPE})
set(TARGET_HASH ${${dep}_HASH})
if(PACKAGE_USE_UPSTREAM_SOURCES)
set(TARGET_URI ${${dep}_URI})
else()
set(TARGET_URI https://svn.blender.org/svnroot/bf-blender/trunk/lib/packages/${TARGET_FILE})
endif()
set(TARGET_FILE ${PACKAGE_DIR}/${TARGET_FILE})
message("Checking source : ${dep} (${TARGET_FILE})")
if(NOT EXISTS ${TARGET_FILE})
message("Checking source : ${dep} - source not found downloading from ${TARGET_URI}")
file(DOWNLOAD ${TARGET_URI} ${TARGET_FILE}
TIMEOUT 1800 # seconds
EXPECTED_HASH ${TARGET_HASH_TYPE}=${TARGET_HASH}
TLS_VERIFY ON
SHOW_PROGRESS
)
endif()
endfunction(download_source)
download_source(ZLIB)
download_source(OPENAL)
download_source(PNG)
download_source(JPEG)
download_source(BOOST)
download_source(BLOSC)
download_source(PTHREADS)
download_source(OPENEXR)
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)
download_source(OPENCOLORIO)
download_source(LLVM)
download_source(OPENMP)
download_source(OPENIMAGEIO)
download_source(TIFF)
download_source(OSL)
download_source(PYTHON)
download_source(TBB)
download_source(OPENVDB)
download_source(NANOVDB)
download_source(NUMPY)
download_source(LAME)
download_source(OGG)
download_source(VORBIS)
download_source(THEORA)
download_source(FLAC)
download_source(VPX)
download_source(OPUS)
download_source(X264)
download_source(XVIDCORE)
download_source(OPENJPEG)
download_source(FFMPEG)
download_source(FFTW)
download_source(ICONV)
download_source(SNDFILE)
if(WITH_WEBP)
download_source(WEBP)
endif()
download_source(SPNAV)
download_source(JEMALLOC)
download_source(XML2)
download_source(TINYXML)
download_source(YAMLCPP)
download_source(EXPAT)
download_source(PUGIXML)
download_source(FLEXBISON)
download_source(BZIP2)
download_source(FFI)
download_source(LZMA)
download_source(SSL)
download_source(SQLITE)
download_source(EMBREE)
download_source(USD)
download_source(OIDN)
download_source(LIBGLU)
download_source(MESA)
download_source(NASM)
download_source(XR_OPENXR_SDK)
download_source(WL_PROTOCOLS)
download_source(ISPC)
download_source(GMP)
download_source(POTRACE)
download_source(HARU)
download_source(ZSTD)
download_source(FLEX)

View File

@@ -29,6 +29,7 @@ set(EMBREE_EXTRA_ARGS
-DEMBREE_MAX_ISA=AVX2
-DEMBREE_TASKING_SYSTEM=TBB
-DEMBREE_TBB_ROOT=${LIBDIR}/tbb
-DTBB_ROOT=${LIBDIR}/tbb
-DTBB_STATIC_LIB=${TBB_STATIC_LIBRARY}
)
@@ -42,19 +43,36 @@ 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 ${EMBREE_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${EMBREE_HASH}
PREFIX ${BUILD_DIR}/embree
PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/embree/src/external_embree < ${PATCH_DIR}/embree.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/embree ${DEFAULT_CMAKE_FLAGS} ${EMBREE_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/embree
)
if(BLENDER_PLATFORM_ARM)
ExternalProject_Add(external_embree
GIT_REPOSITORY ${EMBREE_ARM_GIT}
GIT_TAG "blender-arm"
DOWNLOAD_DIR ${DOWNLOAD_DIR}
PREFIX ${BUILD_DIR}/embree
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/embree ${DEFAULT_CMAKE_FLAGS} ${EMBREE_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/embree
)
else()
ExternalProject_Add(external_embree
URL file://${PACKAGE_DIR}/${EMBREE_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${EMBREE_HASH_TYPE}=${EMBREE_HASH}
PREFIX ${BUILD_DIR}/embree
PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/embree/src/external_embree < ${PATCH_DIR}/embree.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/embree ${DEFAULT_CMAKE_FLAGS} ${EMBREE_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/embree
)
endif()
add_dependencies(
external_embree

View File

@@ -0,0 +1,35 @@
# ***** 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.
#
# ***** END GPL LICENSE BLOCK *****
set(EXPAT_EXTRA_ARGS
-DEXPAT_BUILD_DOCS=OFF
-DEXPAT_BUILD_EXAMPLES=OFF
-DEXPAT_BUILD_TESTS=OFF
-DEXPAT_BUILD_TOOLS=OFF
-DEXPAT_SHARED_LIBS=OFF
)
ExternalProject_Add(external_expat
URL file://${PACKAGE_DIR}/${EXPAT_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${EXPAT_HASH_TYPE}=${EXPAT_HASH}
PREFIX ${BUILD_DIR}/expat
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/expat ${DEFAULT_CMAKE_FLAGS} ${EXPAT_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/expat
SOURCE_SUBDIR expat
)

View File

@@ -17,8 +17,8 @@
# ***** END GPL LICENSE BLOCK *****
ExternalProject_Add(external_ffi
URL ${FFI_URI}
URL_HASH SHA256=${FFI_HASH}
URL file://${PACKAGE_DIR}/${FFI_FILE}
URL_HASH ${FFI_HASH_TYPE}=${FFI_HASH}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
PREFIX ${BUILD_DIR}/ffi
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/ffi/src/external_ffi/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/ffi

View File

@@ -30,6 +30,7 @@ if(WIN32)
--enable-w32threads
--disable-pthreads
--enable-libopenjpeg
--disable-mediafoundation
)
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "4")
set(FFMPEG_EXTRA_FLAGS
@@ -60,9 +61,9 @@ elseif(UNIX)
endif()
ExternalProject_Add(external_ffmpeg
URL ${FFMPEG_URI}
URL file://${PACKAGE_DIR}/${FFMPEG_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${FFMPEG_HASH}
URL_HASH ${FFMPEG_HASH_TYPE}=${FFMPEG_HASH}
# OpenJpeg is compiled with pthread support on Linux, which is all fine and is what we
# want for maximum runtime performance, but due to static nature of that library we
# need to force ffmpeg to link against pthread, otherwise test program used by autoconf

View File

@@ -28,9 +28,9 @@ else()
endif()
ExternalProject_Add(external_fftw3
URL ${FFTW_URI}
URL file://${PACKAGE_DIR}/${FFTW_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${FFTW_HASH}
URL_HASH ${FFTW_HASH_TYPE}=${FFTW_HASH}
PREFIX ${BUILD_DIR}/fftw3
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/fftw3/src/external_fftw3/ && ${CONFIGURE_COMMAND} ${FFTW_EXTRA_ARGS} --prefix=${mingw_LIBDIR}/fftw3
PATCH_COMMAND ${FFTW3_PATCH_COMMAND}

View File

@@ -17,9 +17,9 @@
# ***** END GPL LICENSE BLOCK *****
ExternalProject_Add(external_flac
URL ${FLAC_URI}
URL file://${PACKAGE_DIR}/${FLAC_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH SHA256=${FLAC_HASH}
URL_HASH ${FLAC_HASH_TYPE}=${FLAC_HASH}
PREFIX ${BUILD_DIR}/flac
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/flac/src/external_flac/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/flac --disable-shared --enable-static
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/flac/src/external_flac/ && make -j${MAKE_THREADS}

View File

@@ -0,0 +1,28 @@
# ***** 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.
#
# ***** END GPL LICENSE BLOCK *****
ExternalProject_Add(external_flex
URL file://${PACKAGE_DIR}/${FLEX_FILE}
URL_HASH ${FLEX_HASH_TYPE}=${FLEX_HASH}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
PREFIX ${BUILD_DIR}/flex
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/flex/src/external_flex/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/flex
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/flex/src/external_flex/ && make -j${MAKE_THREADS}
INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/flex/src/external_flex/ && make install
INSTALL_DIR ${LIBDIR}/flex
)

View File

@@ -19,9 +19,9 @@
set(FLEXBISON_EXTRA_ARGS)
ExternalProject_Add(external_flexbison
URL ${FLEXBISON_URI}
URL file://${PACKAGE_DIR}/${FLEXBISON_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${FLEXBISON_HASH}
URL_HASH ${FLEXBISON_HASH_TYPE}=${FLEXBISON_HASH}
PREFIX ${BUILD_DIR}/flexbison
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/flexbison ${DEFAULT_CMAKE_FLAGS} ${FLEXBISON_EXTRA_ARGS}
CONFIGURE_COMMAND echo .

View File

@@ -24,9 +24,9 @@ if(WIN32)
)
ExternalProject_Add(external_freeglut
URL ${FREEGLUT_URI}
URL file://${PACKAGE_DIR}/${FREEGLUT_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${FREEGLUT_HASH}
URL_HASH ${FREEGLUT_HASH_TYPE}=${FREEGLUT_HASH}
PREFIX ${BUILD_DIR}/freeglut
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/freeglut ${DEFAULT_C_FLAGS} ${DEFAULT_CXX_FLAGS} ${FREEGLUT_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/freeglut

View File

@@ -28,9 +28,9 @@ set(FREETYPE_EXTRA_ARGS
-DCMAKE_DISABLE_FIND_PACKAGE_BrotliDec=TRUE)
ExternalProject_Add(external_freetype
URL ${FREETYPE_URI}
URL file://${PACKAGE_DIR}/${FREETYPE_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${FREETYPE_HASH}
URL_HASH ${FREETYPE_HASH_TYPE}=${FREETYPE_HASH}
PREFIX ${BUILD_DIR}/freetype
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/freetype ${DEFAULT_CMAKE_FLAGS} ${FREETYPE_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/freetype

View File

@@ -22,9 +22,9 @@ set(GLEW_EXTRA_ARGS
)
ExternalProject_Add(external_glew
URL ${GLEW_URI}
URL file://${PACKAGE_DIR}/${GLEW_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${GLEW_HASH}
URL_HASH ${GLEW_HASH_TYPE}=${GLEW_HASH}
PATCH_COMMAND COMMAND ${CMAKE_COMMAND} -E copy ${PATCH_DIR}/cmakelists_glew.txt ${BUILD_DIR}/glew/src/external_glew/CMakeLists.txt
PREFIX ${BUILD_DIR}/glew
CMAKE_ARGS -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_INSTALL_PREFIX=${LIBDIR}/glew ${DEFAULT_CMAKE_FLAGS} ${GLEW_EXTRA_ARGS}

View File

@@ -19,9 +19,9 @@
set(GLFW_EXTRA_ARGS)
ExternalProject_Add(external_glfw
URL ${GLFW_URI}
URL file://${PACKAGE_DIR}/${GLFW_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${GLFW_HASH}
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

@@ -25,19 +25,12 @@ else()
set(GMP_OPTIONS --enable-static --disable-shared )
endif()
if(APPLE)
if("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "arm64")
set(GMP_OPTIONS
${GMP_OPTIONS}
--disable-assembly
)
else()
set(GMP_OPTIONS
${GMP_OPTIONS}
--with-pic
)
endif()
elseif(UNIX)
if(APPLE AND NOT BLENDER_PLATFORM_ARM)
set(GMP_OPTIONS
${GMP_OPTIONS}
--with-pic
)
elseif(UNIX AND NOT APPLE)
set(GMP_OPTIONS
${GMP_OPTIONS}
--with-pic
@@ -45,10 +38,17 @@ elseif(UNIX)
)
endif()
if(BLENDER_PLATFORM_ARM)
set(GMP_OPTIONS
${GMP_OPTIONS}
--disable-assembly
)
endif()
ExternalProject_Add(external_gmp
URL ${GMP_URI}
URL file://${PACKAGE_DIR}/${GMP_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${GMP_HASH}
URL_HASH ${GMP_HASH_TYPE}=${GMP_HASH}
PREFIX ${BUILD_DIR}/gmp
CONFIGURE_COMMAND ${CONFIGURE_ENV_NO_PERL} && cd ${BUILD_DIR}/gmp/src/external_gmp/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/gmp ${GMP_OPTIONS} ${GMP_EXTRA_ARGS}
BUILD_COMMAND ${CONFIGURE_ENV_NO_PERL} && cd ${BUILD_DIR}/gmp/src/external_gmp/ && make -j${MAKE_THREADS}
@@ -84,9 +84,9 @@ if(WIN32)
# given the C++ ABI between MSVC and mingw is not compatible, we need to build the bindings
# with MSVC, while GMP can only be build with mingw.
ExternalProject_Add(external_gmpxx
URL ${GMP_URI}
URL file://${PACKAGE_DIR}/${GMP_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${GMP_HASH}
URL_HASH ${GMP_HASH_TYPE}=${GMP_HASH}
PREFIX ${BUILD_DIR}/gmpxx
PATCH_COMMAND COMMAND ${CMAKE_COMMAND} -E copy ${PATCH_DIR}/cmakelists_gmpxx.txt ${BUILD_DIR}/gmpxx/src/external_gmpxx/CMakeLists.txt &&
${CMAKE_COMMAND} -E copy ${PATCH_DIR}/config_gmpxx.h ${BUILD_DIR}/gmpxx/src/external_gmpxx/config.h

View File

@@ -0,0 +1,46 @@
# ***** 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.
#
# ***** END GPL LICENSE BLOCK *****
set(HARU_EXTRA_ARGS
-DLIBHPDF_SHARED=OFF
-DLIBHPDF_STATIC=ON
-DLIBHPDF_EXAMPLES=OFF
-DLIBHPDF_ENABLE_EXCEPTIONS=ON
)
ExternalProject_Add(external_haru
URL file://${PACKAGE_DIR}/${HARU_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${HARU_HASH_TYPE}=${HARU_HASH}
PREFIX ${BUILD_DIR}/haru
PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/haru/src/external_haru < ${PATCH_DIR}/haru.diff
CMAKE_ARGS
-DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_INSTALL_PREFIX=${LIBDIR}/haru
${DEFAULT_CMAKE_FLAGS} ${HARU_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/haru
)
if(WIN32)
if(BUILD_MODE STREQUAL Release)
ExternalProject_Add_Step(external_haru after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/haru/include ${HARVEST_TARGET}/haru/include
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/haru/lib/libhpdfs.lib ${HARVEST_TARGET}/haru/lib/libhpdfs.lib
DEPENDEES install
)
endif()
endif()

View File

@@ -97,15 +97,23 @@ harvest(jemalloc/lib jemalloc/lib "*.a")
harvest(jpg/include jpeg/include "*.h")
harvest(jpg/lib jpeg/lib "libjpeg.a")
harvest(lame/lib ffmpeg/lib "*.a")
harvest(clang/bin llvm/bin "clang-format")
harvest(clang/include llvm/include "*")
harvest(llvm/bin llvm/bin "clang-format")
if(BUILD_CLANG_TOOLS)
harvest(llvm/bin llvm/bin "clang-tidy")
harvest(llvm/share/clang llvm/share "run-clang-tidy.py")
endif()
harvest(llvm/include llvm/include "*")
harvest(llvm/bin llvm/bin "llvm-config")
harvest(llvm/lib llvm/lib "libLLVM*.a")
harvest(llvm/lib llvm/lib "libclang*.a")
harvest(llvm/lib/clang llvm/lib/clang "*.h")
if(APPLE)
harvest(openmp/lib openmp/lib "*")
harvest(openmp/include openmp/include "*.h")
endif()
if(BLENDER_PLATFORM_ARM)
harvest(sse2neon sse2neon "*.h")
endif()
harvest(ogg/lib ffmpeg/lib "*.a")
harvest(openal/include openal/include "*.h")
if(UNIX AND NOT APPLE)
@@ -119,6 +127,8 @@ if(UNIX AND NOT APPLE)
harvest(xml2/include xml2/include "*.h")
harvest(xml2/lib xml2/lib "*.a")
harvest(wayland-protocols/share/wayland-protocols wayland-protocols/share/wayland-protocols/ "*.xml")
else()
harvest(blosc/lib openvdb/lib "*.a")
harvest(xml2/lib opencollada/lib "*.a")
@@ -135,30 +145,28 @@ harvest(openimageio/bin openimageio/bin "maketx")
harvest(openimageio/bin openimageio/bin "oiiotool")
harvest(openimageio/include openimageio/include "*")
harvest(openimageio/lib openimageio/lib "*.a")
if((NOT APPLE) OR ("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "x86_64"))
harvest(openimagedenoise/include openimagedenoise/include "*")
harvest(openimagedenoise/lib openimagedenoise/lib "*.a")
harvest(embree/include embree/include "*.h")
harvest(embree/lib embree/lib "*.a")
endif()
harvest(openimagedenoise/include openimagedenoise/include "*")
harvest(openimagedenoise/lib openimagedenoise/lib "*.a")
harvest(embree/include embree/include "*.h")
harvest(embree/lib embree/lib "*.a")
harvest(openjpeg/include/openjpeg-2.3 openjpeg/include "*.h")
harvest(openjpeg/lib openjpeg/lib "*.a")
harvest(opensubdiv/include opensubdiv/include "*.h")
harvest(opensubdiv/lib opensubdiv/lib "*.a")
harvest(openvdb/include/openvdb openvdb/include/openvdb "*.h")
if(WITH_NANOVDB)
harvest(openvdb/nanovdb nanovdb/include/nanovdb "*.h")
endif()
harvest(openvdb/lib openvdb/lib "*.a")
harvest(nanovdb/nanovdb nanovdb/include/nanovdb "*.h")
harvest(xr_openxr_sdk/include/openxr xr_openxr_sdk/include/openxr "*.h")
harvest(xr_openxr_sdk/lib xr_openxr_sdk/lib "*.a")
harvest(osl/bin osl/bin "oslc")
harvest(osl/include osl/include "*.h")
harvest(osl/lib osl/lib "*.a")
harvest(osl/shaders osl/shaders "*.h")
harvest(osl/share/OSL/shaders osl/share/OSL/shaders "*.h")
harvest(png/include png/include "*.h")
harvest(png/lib png/lib "*.a")
harvest(python/bin python/bin "python${PYTHON_SHORT_VERSION}m")
harvest(pugixml/include pugixml/include "*.hpp")
harvest(pugixml/lib pugixml/lib "*.a")
harvest(python/bin python/bin "python${PYTHON_SHORT_VERSION}")
harvest(python/include python/include "*h")
harvest(python/lib python/lib "*")
harvest(sdl/include/SDL2 sdl/include "*.h")
@@ -183,10 +191,14 @@ harvest(usd/lib/usd usd/lib/usd "*")
harvest(usd/plugin usd/plugin "*")
harvest(potrace/include potrace/include "*.h")
harvest(potrace/lib potrace/lib "*.a")
harvest(haru/include haru/include "*.h")
harvest(haru/lib haru/lib "*.a")
harvest(zstd/include zstd/include "*.h")
harvest(zstd/lib zstd/lib "*.a")
if(UNIX AND NOT APPLE)
harvest(libglu/lib mesa/lib "*.so*")
harvest(mesa/lib mesa/lib "*.so*")
harvest(mesa/lib64 mesa/lib "*.so*")
endif()
endif()

View File

@@ -19,9 +19,9 @@
set(ICONV_EXTRA_ARGS)
ExternalProject_Add(external_iconv
URL ${ICONV_URI}
URL file://${PACKAGE_DIR}/${ICONV_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${ICONV_HASH}
URL_HASH ${ICONV_HASH_TYPE}=${ICONV_HASH}
PREFIX ${BUILD_DIR}/iconv
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/iconv/src/external_iconv/ && ${CONFIGURE_COMMAND} --enable-static --prefix=${mingw_LIBDIR}/iconv
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/iconv/src/external_iconv/ && make -j${MAKE_THREADS}

View File

@@ -21,41 +21,53 @@ if(WIN32)
-DFLEX_EXECUTABLE=${LIBDIR}/flexbison/win_flex.exe
-DBISON_EXECUTABLE=${LIBDIR}/flexbison/win_bison.exe
-DM4_EXECUTABLE=${DOWNLOAD_DIR}/mingw/mingw64/msys/1.0/bin/m4.exe
-DARM_ENABLED=Off
)
elseif(APPLE)
# Use bison installed via Homebrew.
# The one which comes which Xcode toolset is too old.
set(ISPC_EXTRA_ARGS_APPLE
-DBISON_EXECUTABLE=/usr/local/opt/bison/bin/bison
)
# Use bison and flex installed via Homebrew.
# The ones that come with Xcode toolset are too old.
if("${CMAKE_HOST_SYSTEM_PROCESSOR}" STREQUAL "arm64")
set(ISPC_EXTRA_ARGS_APPLE
-DBISON_EXECUTABLE=/opt/homebrew/opt/bison/bin/bison
-DFLEX_EXECUTABLE=/opt/homebrew/opt/flex/bin/flex
-DARM_ENABLED=On
)
else()
set(ISPC_EXTRA_ARGS_APPLE
-DBISON_EXECUTABLE=/usr/local/opt/bison/bin/bison
-DFLEX_EXECUTABLE=/usr/local/opt/flex/bin/flex
-DARM_ENABLED=Off
)
endif()
elseif(UNIX)
set(ISPC_EXTRA_ARGS_UNIX
-DCMAKE_C_COMPILER=${LIBDIR}/clang/bin/clang
-DCMAKE_CXX_COMPILER=${LIBDIR}/clang/bin/clang++
-DCMAKE_C_COMPILER=${LIBDIR}/llvm/bin/clang
-DCMAKE_CXX_COMPILER=${LIBDIR}/llvm/bin/clang++
-DARM_ENABLED=Off
-DFLEX_EXECUTABLE=${LIBDIR}/flex/bin/flex
)
endif()
set(ISPC_EXTRA_ARGS
-DARM_ENABLED=Off
-DISPC_NO_DUMPS=On
-DISPC_INCLUDE_EXAMPLES=Off
-DISPC_INCLUDE_TESTS=Off
-DLLVM_ROOT=${LIBDIR}/llvm/lib/cmake/llvm
-DLLVM_LIBRARY_DIR=${LIBDIR}/llvm/lib
-DCLANG_EXECUTABLE=${LIBDIR}/clang/bin/clang
-DCLANGPP_EXECUTABLE=${LIBDIR}/clang/bin/clang++
-DCLANG_EXECUTABLE=${LIBDIR}/llvm/bin/clang
-DCLANGPP_EXECUTABLE=${LIBDIR}/llvm/bin/clang++
-DISPC_INCLUDE_TESTS=Off
-DCLANG_LIBRARY_DIR=${LIBDIR}/clang/lib
-DCLANG_INCLUDE_DIRS=${LIBDIR}/clang/include
-DCLANG_LIBRARY_DIR=${LIBDIR}/llvm/lib
-DCLANG_INCLUDE_DIRS=${LIBDIR}/llvm/include
${ISPC_EXTRA_ARGS_WIN}
${ISPC_EXTRA_ARGS_APPLE}
${ISPC_EXTRA_ARGS_UNIX}
)
ExternalProject_Add(external_ispc
URL ${ISPC_URI}
URL file://${PACKAGE_DIR}/${ISPC_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${ISPC_HASH}
URL_HASH ${ISPC_HASH_TYPE}=${ISPC_HASH}
PREFIX ${BUILD_DIR}/ispc
PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/ispc/src/external_ispc < ${PATCH_DIR}/ispc.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/ispc -Wno-dev ${DEFAULT_CMAKE_FLAGS} ${ISPC_EXTRA_ARGS} ${BUILD_DIR}/ispc/src/external_ispc
@@ -65,7 +77,6 @@ ExternalProject_Add(external_ispc
add_dependencies(
external_ispc
ll
external_clang
)
if(WIN32)
@@ -73,4 +84,9 @@ if(WIN32)
external_ispc
external_flexbison
)
elseif(UNIX AND NOT APPLE)
add_dependencies(
external_ispc
external_flex
)
endif()

View File

@@ -17,9 +17,9 @@
# ***** END GPL LICENSE BLOCK *****
ExternalProject_Add(external_jemalloc
URL ${JEMALLOC_URI}
URL file://${PACKAGE_DIR}/${JEMALLOC_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${JEMALLOC_HASH}
URL_HASH ${JEMALLOC_HASH_TYPE}=${JEMALLOC_HASH}
PREFIX ${BUILD_DIR}/jemalloc
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/jemalloc/src/external_jemalloc/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/jemalloc --disable-shared --enable-static --with-pic
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/jemalloc/src/external_jemalloc/ && make -j${MAKE_THREADS}

View File

@@ -21,9 +21,9 @@ if(WIN32)
set(JPEG_EXTRA_ARGS -DNASM=${NASM_PATH} -DWITH_JPEG8=ON -DCMAKE_DEBUG_POSTFIX=d -DWITH_CRT_DLL=On)
ExternalProject_Add(external_jpeg
URL ${JPEG_URI}
URL file://${PACKAGE_DIR}/${JPEG_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${JPEG_HASH}
URL_HASH ${JPEG_HASH_TYPE}=${JPEG_HASH}
PREFIX ${BUILD_DIR}/jpg
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/jpg ${DEFAULT_CMAKE_FLAGS} ${JPEG_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/jpg
@@ -50,9 +50,9 @@ else(WIN32)
-DCMAKE_INSTALL_LIBDIR=${LIBDIR}/jpg/lib)
ExternalProject_Add(external_jpeg
URL ${JPEG_URI}
URL file://${PACKAGE_DIR}/${JPEG_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${JPEG_HASH}
URL_HASH ${JPEG_HASH_TYPE}=${JPEG_HASH}
PREFIX ${BUILD_DIR}/jpg
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/jpg ${DEFAULT_CMAKE_FLAGS} ${JPEG_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/jpg

View File

@@ -24,9 +24,9 @@ if(MSVC)
endif()
ExternalProject_Add(external_lame
URL ${LAME_URI}
URL file://${PACKAGE_DIR}/${LAME_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${LAME_HASH}
URL_HASH ${LAME_HASH_TYPE}=${LAME_HASH}
PREFIX ${BUILD_DIR}/lame
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/lame/src/external_lame/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/lame --disable-shared --enable-static ${LAME_EXTRA_ARGS}
--enable-export=full

View File

@@ -27,9 +27,9 @@ set(LIBGLU_EXTRA_FLAGS
)
ExternalProject_Add(external_libglu
URL ${LIBGLU_URI}
URL file://${PACKAGE_DIR}/${LIBGLU_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${LIBGLU_HASH}
URL_HASH ${LIBGLU_HASH_TYPE}=${LIBGLU_HASH}
PREFIX ${BUILD_DIR}/libglu
CONFIGURE_COMMAND ${CONFIGURE_ENV} &&
cd ${BUILD_DIR}/libglu/src/external_libglu/ &&

View File

@@ -16,12 +16,21 @@
#
# ***** END GPL LICENSE BLOCK *****
if(APPLE AND "${CMAKE_OSX_ARCHITECTURES}" STREQUAL "arm64")
set(LLVM_TARGETS AArch64)
if(BLENDER_PLATFORM_ARM)
set(LLVM_TARGETS AArch64$<SEMICOLON>ARM)
else()
set(LLVM_TARGETS X86)
endif()
if(APPLE)
set(LLVM_XML2_ARGS
-DLIBXML2_LIBRARY=${LIBDIR}/xml2/lib/libxml2.a
)
set(LLVM_BUILD_CLANG_TOOLS_EXTRA ^^clang-tools-extra)
set(BUILD_CLANG_TOOLS ON)
endif()
set(LLVM_EXTRA_ARGS
-DLLVM_USE_CRT_RELEASE=MD
-DLLVM_USE_CRT_DEBUG=MDd
@@ -31,6 +40,8 @@ set(LLVM_EXTRA_ARGS
-DLLVM_ENABLE_TERMINFO=OFF
-DLLVM_BUILD_LLVM_C_DYLIB=OFF
-DLLVM_ENABLE_UNWIND_TABLES=OFF
-DLLVM_ENABLE_PROJECTS=clang${LLVM_BUILD_CLANG_TOOLS_EXTRA}
${LLVM_XML2_ARGS}
)
if(WIN32)
@@ -41,11 +52,13 @@ endif()
# short project name due to long filename issues on windows
ExternalProject_Add(ll
URL ${LLVM_URI}
URL file://${PACKAGE_DIR}/${LLVM_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${LLVM_HASH}
URL_HASH ${LLVM_HASH_TYPE}=${LLVM_HASH}
CMAKE_GENERATOR ${LLVM_GENERATOR}
LIST_SEPARATOR ^^
PREFIX ${BUILD_DIR}/ll
SOURCE_SUBDIR llvm
PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/ll/src/ll < ${PATCH_DIR}/llvm.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/llvm ${DEFAULT_CMAKE_FLAGS} ${LLVM_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/llvm
@@ -53,7 +66,11 @@ ExternalProject_Add(ll
if(MSVC)
if(BUILD_MODE STREQUAL Release)
set(LLVM_HARVEST_COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/llvm/ ${HARVEST_TARGET}/llvm/ )
set(LLVM_HARVEST_COMMAND
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/llvm/lib ${HARVEST_TARGET}/llvm/lib &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/llvm/include ${HARVEST_TARGET}/llvm/include &&
${CMAKE_COMMAND} -E copy ${LIBDIR}/llvm/bin/clang-format.exe ${HARVEST_TARGET}/llvm/bin/clang-format.exe
)
else()
set(LLVM_HARVEST_COMMAND
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/llvm/lib/ ${HARVEST_TARGET}/llvm/debug/lib/ &&
@@ -65,3 +82,11 @@ if(MSVC)
DEPENDEES mkdir update patch download configure build install
)
endif()
# We currently do not build libxml2 on Windows.
if(APPLE)
add_dependencies(
ll
external_xml2
)
endif()

View File

@@ -19,9 +19,9 @@
set(LZMA_PATCH_CMD echo .)
ExternalProject_Add(external_lzma
URL ${LZMA_URI}
URL file://${PACKAGE_DIR}/${LZMA_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH SHA256=${LZMA_HASH}
URL_HASH ${LZMA_HASH_TYPE}=${LZMA_HASH}
PREFIX ${BUILD_DIR}/lzma
PATCH_COMMAND ${LZMA_PATCH_CMD}
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/lzma/src/external_lzma/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/lzma

View File

@@ -20,31 +20,48 @@ set(MESA_CFLAGS "-static-libgcc")
set(MESA_CXXFLAGS "-static-libgcc -static-libstdc++ -Bstatic -lstdc++ -Bdynamic -l:libstdc++.a")
set(MESA_LDFLAGS "-L${LIBDIR}/zlib/lib -pthread -static-libgcc -static-libstdc++ -Bstatic -lstdc++ -Bdynamic -l:libstdc++.a -l:libz_pic.a")
# The 'native-file', used for overrides with the meson build system.
# meson does not provide a way to do this using command line arguments.
#
# Note that we can't output to "${BUILD_DIR}/mesa/src/external_mesa" as
# it doesn't exist when CMake first executes.
file(WRITE ${BUILD_DIR}/mesa/tmp/native-file.ini "\
[binaries]
llvm-config = '${LIBDIR}/llvm/bin/llvm-config'"
)
set(MESA_EXTRA_FLAGS
CFLAGS=${MESA_CFLAGS}
CXXFLAGS=${MESA_CXXFLAGS}
LDFLAGS=${MESA_LDFLAGS}
--enable-glx=gallium-xlib
--with-gallium-drivers=swrast
--disable-dri
--disable-gbm
--disable-egl
--disable-gles1
--disable-gles2
--disable-llvm-shared-libs
--with-llvm-prefix=${LIBDIR}/llvm
-Dbuildtype=release
-Dc_args=${MESA_CFLAGS}
-Dcpp_args=${MESA_CXXFLAGS}
-Dc_link_args=${MESA_LDFLAGS}
-Dcpp_link_args=${MESA_LDFLAGS}
-Dglx=gallium-xlib
-Dgallium-drivers=swrast
-Ddri-drivers=
-Dvulkan-drivers=
-Dgbm=disabled
-Degl=disabled
-Dgles1=disabled
-Dgles2=disabled
-Dshared-llvm=disabled
# Without this, the build fails when: `wayland-scanner` is not found.
# At some point we will likely want to support Wayland.
# Disable for now since it's not officially supported.
-Dplatforms=x11
--native-file ${BUILD_DIR}/mesa/tmp/native-file.ini
)
ExternalProject_Add(external_mesa
URL ${MESA_URI}
URL file://${PACKAGE_DIR}/${MESA_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${MESA_HASH}
URL_HASH ${MESA_HASH_TYPE}=${MESA_HASH}
PREFIX ${BUILD_DIR}/mesa
CONFIGURE_COMMAND ${CONFIGURE_ENV} &&
cd ${BUILD_DIR}/mesa/src/external_mesa/ &&
${CONFIGURE_COMMAND_NO_TARGET} --prefix=${LIBDIR}/mesa ${MESA_EXTRA_FLAGS}
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/mesa/src/external_mesa/ && make -j${MAKE_THREADS}
INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/mesa/src/external_mesa/ && make install
meson ${BUILD_DIR}/mesa/src/external_mesa-build --prefix=${LIBDIR}/mesa ${MESA_EXTRA_FLAGS}
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/mesa/src/external_mesa-build && ninja -j${MAKE_THREADS}
INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/mesa/src/external_mesa-build && ninja install
INSTALL_DIR ${LIBDIR}/mesa
)

View File

@@ -0,0 +1,54 @@
# ***** 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.
#
# ***** END GPL LICENSE BLOCK *****
set(NANOVDB_EXTRA_ARGS
# NanoVDB is header-only, so only need the install target
-DNANOVDB_BUILD_UNITTESTS=OFF
-DNANOVDB_BUILD_EXAMPLES=OFF
-DNANOVDB_BUILD_BENCHMARK=OFF
-DNANOVDB_BUILD_DOCS=OFF
-DNANOVDB_BUILD_TOOLS=OFF
-DNANOVDB_CUDA_KEEP_PTX=OFF
# Do not need to include any of the dependencies because of this
-DNANOVDB_USE_OPENVDB=OFF
-DNANOVDB_USE_OPENGL=OFF
-DNANOVDB_USE_OPENCL=OFF
-DNANOVDB_USE_CUDA=OFF
-DNANOVDB_USE_TBB=OFF
-DNANOVDB_USE_BLOSC=OFF
-DNANOVDB_USE_ZLIB=OFF
-DNANOVDB_USE_OPTIX=OFF
-DNANOVDB_ALLOW_FETCHCONTENT=OFF
)
ExternalProject_Add(nanovdb
URL file://${PACKAGE_DIR}/${NANOVDB_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${NANOVDB_HASH_TYPE}=${NANOVDB_HASH}
PREFIX ${BUILD_DIR}/nanovdb
SOURCE_SUBDIR nanovdb
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/nanovdb ${DEFAULT_CMAKE_FLAGS} ${NANOVDB_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/nanovdb
)
if(WIN32)
ExternalProject_Add_Step(nanovdb after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/nanovdb/nanovdb ${HARVEST_TARGET}/nanovdb/include/nanovdb
DEPENDEES install
)
endif()

View File

@@ -17,13 +17,22 @@
# ***** END GPL LICENSE BLOCK *****
ExternalProject_Add(external_nasm
URL ${NASM_URI}
URL file://${PACKAGE_DIR}/${NASM_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH SHA256=${NASM_HASH}
URL_HASH ${NASM_HASH_TYPE}=${NASM_HASH}
PREFIX ${BUILD_DIR}/nasm
PATCH_COMMAND ${PATCH_CMD} --verbose -p 1 -N -d ${BUILD_DIR}/nasm/src/external_nasm < ${PATCH_DIR}/nasm.diff
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/nasm/src/external_nasm/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/nasm
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/nasm/src/external_nasm/ && make -j${MAKE_THREADS}
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/nasm/src/external_nasm/ && ./autogen.sh && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/nasm
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/nasm/src/external_nasm/ && make -j${MAKE_THREADS} && make manpages
INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/nasm/src/external_nasm/ && make install
INSTALL_DIR ${LIBDIR}/nasm
)
if(UNIX)
# `touch nasm.1 ndisasm.1` helps to create the manual pages files, even when
# local `asciidoc` and `xmlto` packages are not installed.
ExternalProject_Add_Step(external_nasm after_configure
COMMAND ${CMAKE_COMMAND} -E touch ${BUILD_DIR}/nasm/src/external_nasm/nasm.1 ${BUILD_DIR}/nasm/src/external_nasm/ndisasm.1
DEPENDEES configure
)
endif()

View File

@@ -32,9 +32,9 @@ endif()
set(NUMPY_POSTFIX)
ExternalProject_Add(external_numpy
URL ${NUMPY_URI}
URL file://${PACKAGE_DIR}/${NUMPY_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${NUMPY_HASH}
URL_HASH ${NUMPY_HASH_TYPE}=${NUMPY_HASH}
PREFIX ${BUILD_DIR}/numpy
PATCH_COMMAND ${NUMPY_PATCH}
CONFIGURE_COMMAND ""
@@ -47,4 +47,5 @@ ExternalProject_Add(external_numpy
add_dependencies(
external_numpy
external_python
external_python_site_packages
)

View File

@@ -17,9 +17,9 @@
# ***** END GPL LICENSE BLOCK *****
ExternalProject_Add(external_ogg
URL ${OGG_URI}
URL file://${PACKAGE_DIR}/${OGG_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH SHA256=${OGG_HASH}
URL_HASH ${OGG_HASH_TYPE}=${OGG_HASH}
PREFIX ${BUILD_DIR}/ogg
PATCH_COMMAND ${PATCH_CMD} --verbose -p 1 -N -d ${BUILD_DIR}/ogg/src/external_ogg < ${PATCH_DIR}/ogg.diff
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/ogg/src/external_ogg/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/ogg --disable-shared --enable-static

View File

@@ -46,9 +46,9 @@ if(BUILD_MODE STREQUAL Release)
endif()
ExternalProject_Add(external_openal
URL ${OPENAL_URI}
URL file://${PACKAGE_DIR}/${OPENAL_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${OPENAL_HASH}
URL_HASH ${OPENAL_HASH_TYPE}=${OPENAL_HASH}
PREFIX ${BUILD_DIR}/openal
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openal ${DEFAULT_CMAKE_FLAGS} ${OPENAL_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/openal

View File

@@ -23,9 +23,9 @@ if(UNIX)
endif()
ExternalProject_Add(external_opencollada
URL ${OPENCOLLADA_URI}
URL file://${PACKAGE_DIR}/${OPENCOLLADA_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${OPENCOLLADA_HASH}
URL_HASH ${OPENCOLLADA_HASH_TYPE}=${OPENCOLLADA_HASH}
PREFIX ${BUILD_DIR}/opencollada
PATCH_COMMAND ${PATCH_CMD} -p 1 -N -d ${BUILD_DIR}/opencollada/src/external_opencollada < ${PATCH_DIR}/opencollada.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/opencollada ${DEFAULT_CMAKE_FLAGS} ${OPENCOLLADA_EXTRA_ARGS}

View File

@@ -18,102 +18,84 @@
set(OPENCOLORIO_EXTRA_ARGS
-DOCIO_BUILD_APPS=OFF
-DOCIO_BUILD_PYGLUE=OFF
-DOCIO_BUILD_PYTHON=OFF
-DOCIO_BUILD_NUKE=OFF
-DOCIO_USE_BOOST_PTR=OFF
-DOCIO_BUILD_STATIC=ON
-DOCIO_BUILD_SHARED=OFF
-DOCIO_BUILD_TRUELIGHT=OFF
-DOCIO_BUILD_JAVA=OFF
-DBUILD_SHARED_LIBS=OFF
-DOCIO_BUILD_DOCS=OFF
-DOCIO_BUILD_PYGLUE=OFF
-DOCIO_BUILD_JNIGLUE=OFF
-DOCIO_STATIC_JNIGLUE=OFF
-DOCIO_BUILD_TESTS=OFF
-DOCIO_BUILD_GPU_TESTS=OFF
-DOCIO_USE_SSE=ON
# Manually build ext packages except for pystring, which does not have
# a CMake or autotools build system that we can easily use.
-DOCIO_INSTALL_EXT_PACKAGES=MISSING
-DHalf_ROOT=${LIBDIR}/openexr
-DHalf_STATIC_LIBRARY=ON
-Dexpat_ROOT=${LIBDIR}/expat
-Dyaml-cpp_ROOT=${LIBDIR}/yamlcpp
)
if(APPLE AND NOT("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "x86_64"))
if(BLENDER_PLATFORM_ARM)
set(OPENCOLORIO_EXTRA_ARGS
${OPENCOLORIO_EXTRA_ARGS}
-DOCIO_USE_SSE=OFF
${OPENCOLORIO_EXTRA_ARGS}
-DOCIO_USE_SSE=OFF
)
endif()
if(WIN32)
set(OCIO_PATCH opencolorio_win.diff)
set(OPENCOLORIO_EXTRA_ARGS
${OPENCOLORIO_EXTRA_ARGS}
-DOCIO_BUILD_TESTS=OFF
-DOCIO_USE_SSE=ON
-DOCIO_INLINES_HIDDEN=OFF
-DOCIO_PYGLUE_LINK=OFF
-DOCIO_PYGLUE_RESPECT_ABI=OFF
-DOCIO_PYGLUE_SONAME=OFF
-DOCIO_PYGLUE_LIB_PREFIX=OFF
-DUSE_EXTERNAL_TINYXML=ON
-DTINYXML_INCLUDE_DIR=${LIBDIR}/tinyxml/include
-DTINYXML_LIBRARY=${LIBDIR}/tinyxml/lib/tinyxml${libext}
-DUSE_EXTERNAL_YAML=ON
-DYAML_CPP_FOUND=ON
-DYAML_CPP_VERSION=${YAMLCPP_VERSION}
-DUSE_EXTERNAL_LCMS=ON
-DINC_1=${LIBDIR}/tinyxml/include
-DINC_2=${LIBDIR}/yamlcpp/include
# Lie because ocio cmake is demanding boost even though it is not needed.
-DYAML_CPP_VERSION=0.5.0
)
else()
set(OCIO_PATCH opencolorio.diff)
set(OPENCOLORIO_EXTRA_ARGS
${OPENCOLORIO_EXTRA_ARGS}
)
endif()
ExternalProject_Add(external_opencolorio
URL ${OPENCOLORIO_URI}
URL file://${PACKAGE_DIR}/${OPENCOLORIO_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${OPENCOLORIO_HASH}
URL_HASH ${OPENCOLORIO_HASH_TYPE}=${OPENCOLORIO_HASH}
PREFIX ${BUILD_DIR}/opencolorio
PATCH_COMMAND ${PATCH_CMD} -p 1 -N -d ${BUILD_DIR}/opencolorio/src/external_opencolorio < ${PATCH_DIR}/${OCIO_PATCH}
PATCH_COMMAND ${PATCH_CMD} -p 1 -N -d ${BUILD_DIR}/opencolorio/src/external_opencolorio < ${PATCH_DIR}/opencolorio.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/opencolorio ${DEFAULT_CMAKE_FLAGS} ${OPENCOLORIO_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/opencolorio
)
if(NOT WIN32)
add_custom_command(
OUTPUT ${LIBDIR}/opencolorio/lib/libtinyxml.a
COMMAND cp ${BUILD_DIR}/opencolorio/src/external_opencolorio-build/ext/dist/lib/libtinyxml.a ${LIBDIR}/opencolorio/lib/libtinyxml.a
COMMAND cp ${BUILD_DIR}/opencolorio/src/external_opencolorio-build/ext/dist/lib/libyaml-cpp.a ${LIBDIR}/opencolorio/lib/libyaml-cpp.a
)
add_custom_target(external_opencolorio_extra ALL DEPENDS external_opencolorio ${LIBDIR}/opencolorio/lib/libtinyxml.a)
endif()
add_dependencies(
external_opencolorio
external_boost
external_yamlcpp
external_expat
external_openexr
)
if(WIN32)
add_dependencies(
external_opencolorio
external_tinyxml
external_yamlcpp
)
if(BUILD_MODE STREQUAL Release)
ExternalProject_Add_Step(external_opencolorio after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/opencolorio/include ${HARVEST_TARGET}/opencolorio/include
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/opencolorio/lib/static ${HARVEST_TARGET}/opencolorio/lib
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/opencolorio/lib ${HARVEST_TARGET}/opencolorio/lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/yamlcpp/lib/libyaml-cppmd.lib ${HARVEST_TARGET}/opencolorio/lib/libyaml-cpp.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tinyxml/lib/tinyxml.lib ${HARVEST_TARGET}/opencolorio/lib/tinyxml.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/expat/lib/libexpatMD.lib ${HARVEST_TARGET}/opencolorio/lib/libexpatMD.lib
COMMAND ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/opencolorio/src/external_opencolorio-build/ext/dist/lib/pystring.lib ${HARVEST_TARGET}/opencolorio/lib/pystring.lib
DEPENDEES install
)
endif()
if(BUILD_MODE STREQUAL Debug)
ExternalProject_Add_Step(external_opencolorio after_install
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/opencolorio/lib/static/Opencolorio.lib ${HARVEST_TARGET}/opencolorio/lib/OpencolorIO_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/opencolorio/lib/Opencolorio.lib ${HARVEST_TARGET}/opencolorio/lib/OpencolorIO_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/yamlcpp/lib/libyaml-cppmdd.lib ${HARVEST_TARGET}/opencolorio/lib/libyaml-cpp_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tinyxml/lib/tinyxml.lib ${HARVEST_TARGET}/opencolorio/lib/tinyxml_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/expat/lib/libexpatdMD.lib ${HARVEST_TARGET}/opencolorio/lib/libexpatdMD.lib
COMMAND ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/opencolorio/src/external_opencolorio-build/ext/dist/lib/pystring.lib ${HARVEST_TARGET}/opencolorio/lib/pystring_d.lib
DEPENDEES install
)
endif()
else()
ExternalProject_Add_Step(external_opencolorio after_install
COMMAND cp ${LIBDIR}/yamlcpp/lib/libyaml-cpp.a ${LIBDIR}/opencolorio/lib/
COMMAND cp ${LIBDIR}/expat/lib/libexpat.a ${LIBDIR}/opencolorio/lib/
COMMAND cp ${BUILD_DIR}/opencolorio/src/external_opencolorio-build/ext/dist/lib/libpystring.a ${LIBDIR}/opencolorio/lib/
DEPENDEES install
)
endif()

View File

@@ -42,9 +42,9 @@ set(OPENEXR_EXTRA_ARGS
)
ExternalProject_Add(external_openexr
URL ${OPENEXR_URI}
URL file://${PACKAGE_DIR}/${OPENEXR_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${OPENEXR_HASH}
URL_HASH ${OPENEXR_HASH_TYPE}=${OPENEXR_HASH}
PREFIX ${BUILD_DIR}/openexr
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openexr ${DEFAULT_CMAKE_FLAGS} ${OPENEXR_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/openexr

View File

@@ -41,9 +41,9 @@ else()
endif()
ExternalProject_Add(external_openimagedenoise
URL ${OIDN_URI}
URL file://${PACKAGE_DIR}/${OIDN_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${OIDN_HASH}
URL_HASH ${OIDN_HASH_TYPE}=${OIDN_HASH}
PREFIX ${BUILD_DIR}/openimagedenoise
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openimagedenoise ${DEFAULT_CMAKE_FLAGS} ${OIDN_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/openimagedenoise

View File

@@ -68,7 +68,6 @@ set(OPENIMAGEIO_EXTRA_ARGS
-DBOOST_LIBRARYDIR=${LIBDIR}/boost/lib/
-DBoost_NO_SYSTEM_PATHS=ON
-DBoost_NO_BOOST_CMAKE=ON
-OIIO_BUILD_CPP11=ON
-DUSE_LIBSQUISH=OFF
-DUSE_QT5=OFF
-DUSE_NUKE=OFF
@@ -112,14 +111,17 @@ set(OPENIMAGEIO_EXTRA_ARGS
-DOPENEXR_IEX_LIBRARY=${LIBDIR}/openexr/lib/${LIBPREFIX}Iex${OPENEXR_VERSION_POSTFIX}${LIBEXT}
-DOPENEXR_ILMIMF_LIBRARY=${LIBDIR}/openexr/lib/${LIBPREFIX}IlmImf${OPENEXR_VERSION_POSTFIX}${LIBEXT}
-DSTOP_ON_WARNING=OFF
-DUSE_EXTERNAL_PUGIXML=ON
-DPUGIXML_LIBRARY=${LIBDIR}/pugixml/lib/${LIBPREFIX}pugixml${LIBEXT}
-DPUGIXML_INCLUDE_DIR=${LIBDIR}/pugixml/include/
${WEBP_FLAGS}
${OIIO_SIMD_FLAGS}
)
ExternalProject_Add(external_openimageio
URL ${OPENIMAGEIO_URI}
URL file://${PACKAGE_DIR}/${OPENIMAGEIO_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${OPENIMAGEIO_HASH}
URL_HASH ${OPENIMAGEIO_HASH_TYPE}=${OPENIMAGEIO_HASH}
PREFIX ${BUILD_DIR}/openimageio
PATCH_COMMAND ${PATCH_CMD} -p 1 -N -d ${BUILD_DIR}/openimageio/src/external_openimageio/ < ${PATCH_DIR}/openimageio.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openimageio ${DEFAULT_CMAKE_FLAGS} ${OPENIMAGEIO_EXTRA_ARGS}
@@ -134,6 +136,7 @@ add_dependencies(
external_jpeg
external_boost
external_tiff
external_pugixml
external_openjpeg${OPENJPEG_POSTFIX}
${WEBP_DEP}
)

View File

@@ -28,9 +28,9 @@ else()
endif()
ExternalProject_Add(external_openjpeg
URL ${OPENJPEG_URI}
URL file://${PACKAGE_DIR}/${OPENJPEG_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH SHA256=${OPENJPEG_HASH}
URL_HASH ${OPENJPEG_HASH_TYPE}=${OPENJPEG_HASH}
PREFIX ${BUILD_DIR}/openjpeg
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/openjpeg/src/external_openjpeg-build && ${CMAKE_COMMAND} ${OPENJPEG_EXTRA_ARGS} -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openjpeg -DBUILD_SHARED_LIBS=Off -DBUILD_THIRDPARTY=OFF ${BUILD_DIR}/openjpeg/src/external_openjpeg
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/openjpeg/src/external_openjpeg-build/ && make -j${MAKE_THREADS}
@@ -42,9 +42,9 @@ ExternalProject_Add(external_openjpeg
if(MSVC)
set(OPENJPEG_EXTRA_ARGS ${DEFAULT_CMAKE_FLAGS})
ExternalProject_Add(external_openjpeg_msvc
URL ${OPENJPEG_URI}
URL file://${PACKAGE_DIR}/${OPENJPEG_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH SHA256=${OPENJPEG_HASH}
URL_HASH ${OPENJPEG_HASH_TYPE}=${OPENJPEG_HASH}
PREFIX ${BUILD_DIR}/openjpeg_msvc
CMAKE_ARGS ${OPENJPEG_EXTRA_ARGS} -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openjpeg_msvc -DBUILD_SHARED_LIBS=Off -DBUILD_THIRDPARTY=OFF
INSTALL_DIR ${LIBDIR}/openjpeg_msvc

View File

@@ -16,19 +16,24 @@
#
# ***** END GPL LICENSE BLOCK *****
if(APPLE)
set(OPENMP_PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/openmp/src/external_openmp < ${PATCH_DIR}/openmp.diff)
else()
set(OPENMP_PATCH_COMMAND)
endif()
ExternalProject_Add(external_openmp
URL ${OPENMP_URI}
URL file://${PACKAGE_DIR}/${OPENMP_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${OPENMP_HASH}
URL_HASH ${OPENMP_HASH_TYPE}=${OPENMP_HASH}
PREFIX ${BUILD_DIR}/openmp
PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/openmp/src/external_openmp < ${PATCH_DIR}/openmp.diff
PATCH_COMMAND ${OPENMP_PATCH_COMMAND}
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openmp ${DEFAULT_CMAKE_FLAGS}
INSTALL_COMMAND cd ${BUILD_DIR}/openmp/src/external_openmp-build && install_name_tool -id @executable_path/../Resources/lib/libomp.dylib runtime/src/libomp.dylib && make install
INSTALL_COMMAND cd ${BUILD_DIR}/openmp/src/external_openmp-build && install_name_tool -id @rpath/libomp.dylib runtime/src/libomp.dylib && make install
INSTALL_DIR ${LIBDIR}/openmp
)
add_dependencies(
external_openmp
external_clang
ll
)

View File

@@ -65,9 +65,9 @@ else()
endif()
ExternalProject_Add(external_opensubdiv
URL ${OPENSUBDIV_URI}
URL file://${PACKAGE_DIR}/${OPENSUBDIV_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${OPENSUBDIV_HASH}
URL_HASH ${OPENSUBDIV_HASH_TYPE}=${OPENSUBDIV_HASH}
PREFIX ${BUILD_DIR}/opensubdiv
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/opensubdiv -Wno-dev ${DEFAULT_CMAKE_FLAGS} ${OPENSUBDIV_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/opensubdiv

View File

@@ -54,20 +54,8 @@ set(OPENVDB_EXTRA_ARGS
-DOPENVDB_CORE_STATIC=${OPENVDB_STATIC}
-DOPENVDB_BUILD_BINARIES=Off
-DCMAKE_DEBUG_POSTFIX=_d
# NanoVDB is header-only, so only need the install target
-DNANOVDB_BUILD_UNITTESTS=OFF
-DNANOVDB_BUILD_EXAMPLES=OFF
-DNANOVDB_BUILD_BENCHMARK=OFF
-DNANOVDB_BUILD_DOCS=OFF
-DNANOVDB_BUILD_TOOLS=OFF
-DNANOVDB_CUDA_KEEP_PTX=OFF
-DNANOVDB_USE_OPENGL=OFF
-DNANOVDB_USE_OPENGL=OFF
-DNANOVDB_USE_CUDA=OFF
-DNANOVDB_USE_TBB=OFF
-DNANOVDB_USE_OPTIX=OFF
-DNANOVDB_USE_OPENVDB=OFF
-DNANOVDB_ALLOW_FETCHCONTENT=OFF
-DILMBASE_USE_STATIC_LIBS=On
-DOPENEXR_USE_STATIC_LIBS=On
)
if(WIN32)
@@ -88,18 +76,12 @@ else()
)
endif()
if(WITH_NANOVDB)
set(OPENVDB_PATCH_FILE openvdb_nanovdb.diff)
else()
set(OPENVDB_PATCH_FILE openvdb.diff)
endif()
ExternalProject_Add(openvdb
URL ${OPENVDB_URI}
URL file://${PACKAGE_DIR}/${OPENVDB_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${OPENVDB_HASH}
URL_HASH ${OPENVDB_HASH_TYPE}=${OPENVDB_HASH}
PREFIX ${BUILD_DIR}/openvdb
PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/openvdb/src/openvdb < ${PATCH_DIR}/${OPENVDB_PATCH_FILE}
PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/openvdb/src/openvdb < ${PATCH_DIR}/openvdb.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openvdb ${DEFAULT_CMAKE_FLAGS} ${OPENVDB_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/openvdb
)
@@ -121,12 +103,6 @@ if(WIN32)
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/openvdb/bin/openvdb.dll ${HARVEST_TARGET}/openvdb/bin/openvdb.dll
DEPENDEES install
)
if(WITH_NANOVDB)
ExternalProject_Add_Step(openvdb nanovdb_install
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/openvdb/nanovdb ${HARVEST_TARGET}/nanovdb/include/nanovdb
DEPENDEES after_install
)
endif()
endif()
if(BUILD_MODE STREQUAL Debug)
ExternalProject_Add_Step(openvdb after_install

View File

@@ -21,8 +21,8 @@ if(WIN32)
endif()
option(WITH_WEBP "Enable building of oiio with webp support" OFF)
option(WITH_BOOST_PYTHON "Enable building of boost with python support" OFF)
option(WITH_NANOVDB "Enable building of OpenVDB with NanoVDB included" OFF)
set(MAKE_THREADS 1 CACHE STRING "Number of threads to run make with")
cmake_host_system_information(RESULT NUM_CORES QUERY NUMBER_OF_LOGICAL_CORES)
set(MAKE_THREADS ${NUM_CORES} CACHE STRING "Number of threads to run make with")
if(NOT BUILD_MODE)
set(BUILD_MODE "Release")
@@ -36,13 +36,19 @@ else(BUILD_MODE STREQUAL "Debug")
set(LIBDIR ${CMAKE_CURRENT_BINARY_DIR}/Release)
endif()
option(DOWNLOAD_DIR "Path for downloaded files" ${CMAKE_CURRENT_SOURCE_DIR}/downloads)
set(DOWNLOAD_DIR "${CMAKE_CURRENT_BINARY_DIR}/downloads" CACHE STRING "Path for downloaded files")
# This path must be hard-coded like this, so that the GNUmakefile knows where it is and can pass it to make_source_archive.py:
set(PACKAGE_DIR "${CMAKE_CURRENT_BINARY_DIR}/packages")
option(PACKAGE_USE_UPSTREAM_SOURCES "Use soures upstream to download the package sources, when OFF the blender mirror will be used" ON)
file(TO_CMAKE_PATH ${DOWNLOAD_DIR} DOWNLOAD_DIR)
file(TO_CMAKE_PATH ${PACKAGE_DIR} PACKAGE_DIR)
set(PATCH_DIR ${CMAKE_CURRENT_SOURCE_DIR}/patches)
set(BUILD_DIR ${CMAKE_CURRENT_BINARY_DIR}/build)
message("LIBDIR = ${LIBDIR}")
message("DOWNLOAD_DIR = ${DOWNLOAD_DIR}")
message("PACKAGE_DIR = ${PACKAGE_DIR}")
message("PATCH_DIR = ${PATCH_DIR}")
message("BUILD_DIR = ${BUILD_DIR}")
@@ -57,7 +63,7 @@ if(WIN32)
if(MSVC_VERSION GREATER 1909)
set(COMMON_MSVC_FLAGS "/Wv:18") #some deps with warnings as error aren't quite ready for dealing with the new 2017 warnings.
endif()
set(COMMON_MSVC_FLAGS "${COMMON_MSVC_FLAGS} /bigobj")
string(APPEND COMMON_MSVC_FLAGS " /bigobj")
if(WITH_OPTIMIZED_DEBUG)
set(BLENDER_CMAKE_C_FLAGS_DEBUG "/MDd ${COMMON_MSVC_FLAGS} /O2 /Ob2 /DNDEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
else()
@@ -131,6 +137,10 @@ else()
endif()
set(OSX_SYSROOT ${XCODE_DEV_PATH}/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk)
if("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "arm64")
set(BLENDER_PLATFORM_ARM ON)
endif()
set(PLATFORM_CFLAGS "-isysroot ${OSX_SYSROOT} -mmacosx-version-min=${OSX_DEPLOYMENT_TARGET} -arch ${CMAKE_OSX_ARCHITECTURES}")
set(PLATFORM_CXXFLAGS "-isysroot ${OSX_SYSROOT} -mmacosx-version-min=${OSX_DEPLOYMENT_TARGET} -std=c++11 -stdlib=libc++ -arch ${CMAKE_OSX_ARCHITECTURES}")
set(PLATFORM_LDFLAGS "-isysroot ${OSX_SYSROOT} -mmacosx-version-min=${OSX_DEPLOYMENT_TARGET} -arch ${CMAKE_OSX_ARCHITECTURES}")
@@ -145,6 +155,10 @@ else()
-DCMAKE_OSX_SYSROOT:PATH=${OSX_SYSROOT}
)
else()
if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "aarch64")
set(BLENDER_PLATFORM_ARM ON)
endif()
set(PLATFORM_CFLAGS "-fPIC")
set(PLATFORM_CXXFLAGS "-std=c++11 -fPIC")
set(PLATFORM_LDFLAGS)

View File

@@ -17,9 +17,9 @@
# ***** END GPL LICENSE BLOCK *****
ExternalProject_Add(external_opus
URL ${OPUS_URI}
URL file://${PACKAGE_DIR}/${OPUS_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH SHA256=${OPUS_HASH}
URL_HASH ${OPUS_HASH_TYPE}=${OPUS_HASH}
PREFIX ${BUILD_DIR}/opus
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/opus/src/external_opus/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/opus
--disable-shared

View File

@@ -19,22 +19,14 @@
if(WIN32)
set(OSL_CMAKE_CXX_STANDARD_LIBRARIES "kernel32${LIBEXT} user32${LIBEXT} gdi32${LIBEXT} winspool${LIBEXT} shell32${LIBEXT} ole32${LIBEXT} oleaut32${LIBEXT} uuid${LIBEXT} comdlg32${LIBEXT} advapi32${LIBEXT} psapi${LIBEXT}")
set(OSL_FLEX_BISON -DFLEX_EXECUTABLE=${LIBDIR}/flexbison/win_flex.exe -DBISON_EXECUTABLE=${LIBDIR}/flexbison/win_bison.exe)
set(OSL_OPENIMAGEIO_LIBRARY "${LIBDIR}/openimageio/lib/${LIBPREFIX}OpenImageIO${LIBEXT};${LIBDIR}/openimageio/lib/${LIBPREFIX}OpenImageIO_Util${LIBEXT};${LIBDIR}/png/lib/libpng16${LIBEXT};${LIBDIR}/jpg/lib/${LIBPREFIX}jpeg${LIBEXT};${LIBDIR}/tiff/lib/${LIBPREFIX}tiff${LIBEXT};${LIBDIR}/openexr/lib/${LIBPREFIX}IlmImf${OPENEXR_VERSION_POSTFIX}${LIBEXT}")
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "4")
set(OSL_SIMD_FLAGS -DOIIO_NOSIMD=1 -DOIIO_SIMD=0)
else()
set(OSL_SIMD_FLAGS -DOIIO_NOSIMD=1 -DOIIO_SIMD=sse2)
endif()
SET(OSL_PLATFORM_FLAGS -DLINKSTATIC=ON)
set(OSL_SIMD_FLAGS -DOIIO_NOSIMD=1 -DOIIO_SIMD=sse2)
else()
set(OSL_CMAKE_CXX_STANDARD_LIBRARIES)
set(OSL_FLEX_BISON)
set(OSL_OPENIMAGEIO_LIBRARY "${LIBDIR}/openimageio/lib/${LIBPREFIX}OpenImageIO${LIBEXT};${LIBDIR}/openimageio/lib/${LIBPREFIX}OpenImageIO_Util${LIBEXT};${LIBDIR}/png/lib/${LIBPREFIX}png16${LIBEXT};${LIBDIR}/jpg/lib/${LIBPREFIX}jpeg${LIBEXT};${LIBDIR}/tiff/lib/${LIBPREFIX}tiff${LIBEXT};${LIBDIR}/openexr/lib/${LIBPREFIX}IlmImf${OPENEXR_VERSION_POSTFIX}${LIBEXT}")
SET(OSL_PLATFORM_FLAGS)
endif()
set(OSL_ILMBASE_CUSTOM_LIBRARIES "${LIBDIR}/openexr/lib/Imath${OPENEXR_VERSION_POSTFIX}.lib^^${LIBDIR}/openexr/lib/Half{OPENEXR_VERSION_POSTFIX}.lib^^${LIBDIR}/openexr/lib/IlmThread${OPENEXR_VERSION_POSTFIX}.lib^^${LIBDIR}/openexr/lib/Iex${OPENEXR_VERSION_POSTFIX}.lib")
set(OSL_LLVM_LIBRARY "${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMAnalysis${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMAsmParser${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMAsmPrinter${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMBitReader${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMBitWriter${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMCodeGen${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMCore${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMDebugInfo${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMExecutionEngine${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMInstCombine${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMInstrumentation${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMInterpreter${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMJIT${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMLinker${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMMC${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMMCDisassembler${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMMCJIT${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMMCParser${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMObject${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMRuntimeDyld${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMScalarOpts${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMSelectionDAG${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMSupport${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMTableGen${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMTarget${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMTransformUtils${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMVectorize${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMX86AsmParser${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMX86AsmPrinter${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMX86CodeGen${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMX86Desc${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMX86Disassembler${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMX86Info${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMX86Utils${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMipa${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMipo${LIBEXT}")
set(OSL_EXTRA_ARGS
-DBoost_COMPILER:STRING=${BOOST_COMPILER_STRING}
@@ -45,13 +37,8 @@ set(OSL_EXTRA_ARGS
-DBOOST_LIBRARYDIR=${LIBDIR}/boost/lib/
-DBoost_NO_SYSTEM_PATHS=ON
-DBoost_NO_BOOST_CMAKE=ON
-DLLVM_DIRECTORY=${LIBDIR}/llvm
-DLLVM_INCLUDES=${LIBDIR}/llvm/include
-DLLVM_LIB_DIR=${LIBDIR}/llvm/lib
-DLLVM_VERSION=3.4
-DLLVM_LIBRARY=${OSL_LLVM_LIBRARY}
-DOPENEXR_HOME=${LIBDIR}/openexr/
-DILMBASE_HOME=${LIBDIR}/openexr/
-DOpenEXR_ROOT=${LIBDIR}/openexr/
-DIlmBase_ROOT=${LIBDIR}/openexr/
-DILMBASE_INCLUDE_DIR=${LIBDIR}/openexr/include/
-DOPENEXR_HALF_LIBRARY=${LIBDIR}/openexr/lib/${LIBPREFIX}Half${OPENEXR_VERSION_POSTFIX}${LIBEXT}
-DOPENEXR_IMATH_LIBRARY=${LIBDIR}/openexr/lib/${LIBPREFIX}Imath${OPENEXR_VERSION_POSTFIX}${LIBEXT}
@@ -59,46 +46,36 @@ set(OSL_EXTRA_ARGS
-DOPENEXR_IEX_LIBRARY=${LIBDIR}/openexr/lib/${LIBPREFIX}Iex${OPENEXR_VERSION_POSTFIX}${LIBEXT}
-DOPENEXR_INCLUDE_DIR=${LIBDIR}/openexr/include/
-DOPENEXR_ILMIMF_LIBRARY=${LIBDIR}/openexr/lib/${LIBPREFIX}IlmImf${OPENEXR_VERSION_POSTFIX}${LIBEXT}
-DOpenImageIO_ROOT=${LIBDIR}/openimageio/
-DOSL_BUILD_TESTS=OFF
-DOSL_BUILD_MATERIALX=OFF
-DPNG_ROOT=${LIBDIR}/png
-DZLIB_LIBRARY=${LIBDIR}/zlib/lib/${ZLIB_LIBRARY}
-DZLIB_INCLUDE_DIR=${LIBDIR}/zlib/include/
-DOPENIMAGEIOHOME=${LIBDIR}/openimageio/
-DOPENIMAGEIO_INCLUDE_DIR=${LIBDIR}/openimageio/include
-DOPENIMAGEIO_LIBRARY=${OSL_OPENIMAGEIO_LIBRARY}
${OSL_FLEX_BISON}
-DCMAKE_CXX_STANDARD_LIBRARIES=${OSL_CMAKE_CXX_STANDARD_LIBRARIES}
-DBUILDSTATIC=ON
${OSL_PLATFORM_FLAGS}
-DOSL_BUILD_PLUGINS=Off
-DBUILD_SHARED_LIBS=OFF
-DLINKSTATIC=ON
-DOSL_BUILD_PLUGINS=OFF
-DSTOP_ON_WARNING=OFF
-DUSE_LLVM_BITCODE=OFF
-DLLVM_ROOT=${LIBDIR}/llvm/
-DLLVM_DIRECTORY=${LIBDIR}/llvm/
-DUSE_PARTIO=OFF
-DUSE_QT=OFF
-DUSE_Qt5=OFF
-DINSTALL_DOCS=OFF
${OSL_SIMD_FLAGS}
-DPARTIO_LIBRARIES=
-Dpugixml_ROOT=${LIBDIR}/pugixml
-DUSE_PYTHON=OFF
-DCMAKE_CXX_STANDARD=14
)
if(WIN32)
set(OSL_EXTRA_ARGS
${OSL_EXTRA_ARGS}
-DPUGIXML_HOME=${LIBDIR}/pugixml
)
elseif(APPLE)
# Make symbol hiding consistent with OIIO which defaults to OFF,
# avoids linker warnings on macOS
set(OSL_EXTRA_ARGS
${OSL_EXTRA_ARGS}
-DHIDE_SYMBOLS=OFF
)
endif()
ExternalProject_Add(external_osl
URL ${OSL_URI}
URL file://${PACKAGE_DIR}/${OSL_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
LIST_SEPARATOR ^^
URL_HASH MD5=${OSL_HASH}
URL_HASH ${OSL_HASH_TYPE}=${OSL_HASH}
PREFIX ${BUILD_DIR}/osl
PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/osl/src/external_osl < ${PATCH_DIR}/osl.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/osl -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} ${DEFAULT_CMAKE_FLAGS} ${OSL_EXTRA_ARGS}
@@ -109,19 +86,20 @@ add_dependencies(
external_osl
external_boost
ll
external_clang
external_openexr
external_zlib
external_flexbison
external_openimageio
external_pugixml
)
if(UNIX)
# Rely on PugiXML compiled with OpenImageIO
else()
if(WIN32)
add_dependencies(
external_osl
external_pugixml
external_flexbison
)
elseif(UNIX AND NOT APPLE)
add_dependencies(
external_osl
external_flex
)
endif()

View File

@@ -22,14 +22,14 @@ set(PNG_EXTRA_ARGS
-DPNG_STATIC=ON
)
if(APPLE AND ("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "arm64"))
if(BLENDER_PLATFORM_ARM)
set(PNG_EXTRA_ARGS ${PNG_EXTRA_ARGS} -DPNG_HARDWARE_OPTIMIZATIONS=ON -DPNG_ARM_NEON=on -DCMAKE_SYSTEM_PROCESSOR="aarch64")
endif()
ExternalProject_Add(external_png
URL ${PNG_URI}
URL file://${PACKAGE_DIR}/${PNG_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH SHA256=${PNG_HASH}
URL_HASH ${PNG_HASH_TYPE}=${PNG_HASH}
PREFIX ${BUILD_DIR}/png
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/png ${DEFAULT_CMAKE_FLAGS} ${PNG_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/png

View File

@@ -21,9 +21,9 @@ set(POTRACE_EXTRA_ARGS
if((WIN32 AND BUILD_MODE STREQUAL Release) OR UNIX)
ExternalProject_Add(external_potrace
URL ${POTRACE_URI}
URL file://${PACKAGE_DIR}/${POTRACE_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${POTRACE_HASH}
URL_HASH ${POTRACE_HASH_TYPE}=${POTRACE_HASH}
PREFIX ${BUILD_DIR}/potrace
PATCH_COMMAND ${CMAKE_COMMAND} -E copy ${PATCH_DIR}/cmakelists_potrace.txt ${BUILD_DIR}/potrace/src/external_potrace/CMakeLists.txt
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/potrace ${DEFAULT_CMAKE_FLAGS} ${POTRACE_EXTRA_ARGS}

View File

@@ -27,9 +27,9 @@ if(WIN32)
set(PTHREADS_BUILD cd ${BUILD_DIR}/pthreads/src/external_pthreads/ && cd && nmake VC-static /e CPPFLAGS=${PTHREAD_CPPFLAGS})
ExternalProject_Add(external_pthreads
URL ${PTHREADS_URI}
URL file://${PACKAGE_DIR}/${PTHREADS_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${PTHREADS_HASH}
URL_HASH ${PTHREADS_HASH_TYPE}=${PTHREADS_HASH}
PREFIX ${BUILD_DIR}/pthreads
CONFIGURE_COMMAND echo .
PATCH_COMMAND COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/pthreads/src/external_pthreads < ${PATCH_DIR}/pthreads.diff

View File

@@ -20,9 +20,9 @@ set(PUGIXML_EXTRA_ARGS
)
ExternalProject_Add(external_pugixml
URL ${PUGIXML_URI}
URL file://${PACKAGE_DIR}/${PUGIXML_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${PUGIXML_HASH}
URL_HASH ${PUGIXML_HASH_TYPE}=${PUGIXML_HASH}
PREFIX ${BUILD_DIR}/pugixml
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/pugixml ${DEFAULT_CMAKE_FLAGS} ${PUGIXML_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/pugixml
@@ -30,13 +30,13 @@ ExternalProject_Add(external_pugixml
if(WIN32)
if(BUILD_MODE STREQUAL Release)
ExternalProject_Add_Step(external_pugixml after_install
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/pugixml/lib/pugixml.lib ${HARVEST_TARGET}/osl/lib/pugixml.lib
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/pugixml ${HARVEST_TARGET}/pugixml
DEPENDEES install
)
endif()
if(BUILD_MODE STREQUAL Debug)
ExternalProject_Add_Step(external_pugixml after_install
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/pugixml/lib/pugixml.lib ${HARVEST_TARGET}/osl/lib/pugixml_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/pugixml/lib/pugixml.lib ${HARVEST_TARGET}/pugixml/lib/pugixml_d.lib
DEPENDEES install
)
endif()

View File

@@ -37,13 +37,13 @@ if(WIN32)
cmake_to_dos_path(${DOWNLOADS_EXTERNALS_FOLDER} DOWNLOADS_EXTERNALS_FOLDER_DOS)
ExternalProject_Add(external_python
URL ${PYTHON_URI}
URL file://${PACKAGE_DIR}/${PYTHON_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${PYTHON_HASH}
URL_HASH ${PYTHON_HASH_TYPE}=${PYTHON_HASH}
PREFIX ${BUILD_DIR}/python
CONFIGURE_COMMAND ""
BUILD_COMMAND cd ${BUILD_DIR}/python/src/external_python/pcbuild/ && set IncludeTkinter=false && call build.bat -e -p x64 -c ${BUILD_MODE}
INSTALL_COMMAND ${PYTHON_BINARY_INTERNAL} ${PYTHON_SRC}/PC/layout/main.py -b ${PYTHON_SRC}/PCbuild/amd64 -s ${PYTHON_SRC} -t ${PYTHON_SRC}/tmp/ --include-underpth --include-stable --include-pip --include-dev --include-launchers --include-venv --include-symbols ${PYTHON_EXTRA_INSTLAL_FLAGS} --copy ${LIBDIR}/python
INSTALL_COMMAND ${PYTHON_BINARY_INTERNAL} ${PYTHON_SRC}/PC/layout/main.py -b ${PYTHON_SRC}/PCbuild/amd64 -s ${PYTHON_SRC} -t ${PYTHON_SRC}/tmp/ --include-stable --include-pip --include-dev --include-launchers --include-venv --include-symbols ${PYTHON_EXTRA_INSTLAL_FLAGS} --copy ${LIBDIR}/python
)
else()
@@ -74,16 +74,15 @@ else()
endif()
set(PYTHON_CONFIGURE_ENV ${CONFIGURE_ENV} && ${PYTHON_FUNC_CONFIGS})
set(PYTHON_BINARY ${BUILD_DIR}/python/src/external_python/python.exe)
set(PYTHON_PATCH ${PATCH_CMD} --verbose -p1 -d ${BUILD_DIR}/python/src/external_python < ${PATCH_DIR}/python_macos.diff)
else()
set(PYTHON_CONFIGURE_ENV ${CONFIGURE_ENV})
set(PYTHON_BINARY ${BUILD_DIR}/python/src/external_python/python)
set(PYTHON_PATCH ${PATCH_CMD} --verbose -p1 -d ${BUILD_DIR}/python/src/external_python < ${PATCH_DIR}/python_linux.diff)
endif()
endif()
# Link against zlib statically (Unix). Avoid rpath issues (macOS).
set(PYTHON_PATCH ${PATCH_CMD} --verbose -p1 -d ${BUILD_DIR}/python/src/external_python < ${PATCH_DIR}/python_unix.diff)
set(PYTHON_CONFIGURE_EXTRA_ARGS "--with-openssl=${LIBDIR}/ssl")
set(PYTHON_CFLAGS "-I${LIBDIR}/sqlite/include -I${LIBDIR}/bzip2/include -I${LIBDIR}/lzma/include -I${LIBDIR}/zlib/include")
set(PYTHON_LDFLAGS "-L${LIBDIR}/ffi/lib -L${LIBDIR}/sqlite/lib -L${LIBDIR}/bzip2/lib -L${LIBDIR}/lzma/lib -L${LIBDIR}/zlib/lib")
set(PYTHON_CFLAGS "-I${LIBDIR}/sqlite/include -I${LIBDIR}/bzip2/include -I${LIBDIR}/lzma/include -I${LIBDIR}/zlib/include ${PLATFORM_CFLAGS}")
set(PYTHON_LDFLAGS "-L${LIBDIR}/ffi/lib -L${LIBDIR}/sqlite/lib -L${LIBDIR}/bzip2/lib -L${LIBDIR}/lzma/lib -L${LIBDIR}/zlib/lib ${PLATFORM_LDFLAGS}")
set(PYTHON_CONFIGURE_EXTRA_ENV
export CFLAGS=${PYTHON_CFLAGS} &&
export CPPFLAGS=${PYTHON_CFLAGS} &&
@@ -91,9 +90,9 @@ else()
export PKG_CONFIG_PATH=${LIBDIR}/ffi/lib/pkgconfig)
ExternalProject_Add(external_python
URL ${PYTHON_URI}
URL file://${PACKAGE_DIR}/${PYTHON_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${PYTHON_HASH}
URL_HASH ${PYTHON_HASH_TYPE}=${PYTHON_HASH}
PREFIX ${BUILD_DIR}/python
PATCH_COMMAND ${PYTHON_PATCH}
CONFIGURE_COMMAND ${PYTHON_CONFIGURE_ENV} && ${PYTHON_CONFIGURE_EXTRA_ENV} && cd ${BUILD_DIR}/python/src/external_python/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/python ${PYTHON_CONFIGURE_EXTRA_ARGS}

View File

@@ -16,14 +16,27 @@
#
# ***** END GPL LICENSE BLOCK *****
if(WIN32 AND BUILD_MODE STREQUAL Debug)
set(SITE_PACKAGES_EXTRA --global-option build --global-option --debug)
endif()
ExternalProject_Add(external_python_site_packages
DOWNLOAD_COMMAND ""
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
PREFIX ${BUILD_DIR}/site_packages
INSTALL_COMMAND ${PYTHON_BINARY} -m pip install idna==${IDNA_VERSION} chardet==${CHARDET_VERSION} urllib3==${URLLIB3_VERSION} certifi==${CERTIFI_VERSION} requests==${REQUESTS_VERSION} --no-binary :all:
INSTALL_COMMAND ${PYTHON_BINARY} -m pip install ${SITE_PACKAGES_EXTRA} cython==${CYTHON_VERSION} idna==${IDNA_VERSION} chardet==${CHARDET_VERSION} urllib3==${URLLIB3_VERSION} certifi==${CERTIFI_VERSION} requests==${REQUESTS_VERSION} --no-binary :all:
)
if(USE_PIP_NUMPY)
# Use only wheel (and not build from source) to stop NumPy from linking against buggy
# Accelerate framework backend on macOS. Official wheels are built with OpenBLAS.
ExternalProject_Add_Step(external_python_site_packages after_install
COMMAND ${PYTHON_BINARY} -m pip install --no-cache-dir numpy==${NUMPY_VERSION} --only-binary :all:
DEPENDEES install
)
endif()
add_dependencies(
external_python_site_packages
external_python

View File

@@ -30,9 +30,9 @@ else()
endif()
ExternalProject_Add(external_sdl
URL ${SDL_URI}
URL file://${PACKAGE_DIR}/${SDL_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${SDL_HASH}
URL_HASH ${SDL_HASH_TYPE}=${SDL_HASH}
PREFIX ${BUILD_DIR}/sdl
PATCH_COMMAND ${PATCH_CMD} -p 0 -N -d ${BUILD_DIR}/sdl/src/external_sdl < ${PATCH_DIR}/sdl.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/sdl ${DEFAULT_CMAKE_FLAGS} ${SDL_EXTRA_ARGS}

View File

@@ -34,9 +34,9 @@ else()
endif()
ExternalProject_Add(external_sndfile
URL ${SNDFILE_URI}
URL file://${PACKAGE_DIR}/${SNDFILE_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${SNDFILE_HASH}
URL_HASH ${SNDFILE_HASH_TYPE}=${SNDFILE_HASH}
PREFIX ${BUILD_DIR}/sndfile
PATCH_COMMAND ${SNDFILE_PATCH_CMD}
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/sndfile/src/external_sndfile/ && ${SNDFILE_ENV} ${CONFIGURE_COMMAND} ${SNDFILE_OPTIONS} --prefix=${mingw_LIBDIR}/sndfile

View File

@@ -17,9 +17,9 @@
# ***** END GPL LICENSE BLOCK *****
ExternalProject_Add(external_spnav
URL ${SPNAV_URI}
URL file://${PACKAGE_DIR}/${SPNAV_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${SPNAV_HASH}
URL_HASH ${SPNAV_HASH_TYPE}=${SPNAV_HASH}
PREFIX ${BUILD_DIR}/spnav
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/spnav/src/external_spnav/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/spnav --disable-shared --enable-static --with-pic
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/spnav/src/external_spnav/ && make -j${MAKE_THREADS}

View File

@@ -42,14 +42,27 @@ if(UNIX)
-DSQLITE_MAX_VARIABLE_NUMBER=250000 \
-fPIC")
set(SQLITE_CONFIGURE_ENV ${SQLITE_CONFIGURE_ENV} && export LDFLAGS=${SQLITE_LDFLAGS} && export CFLAGS=${SQLITE_CFLAGS})
set(SQLITE_CONFIGURATION_ARGS ${SQLITE_CONFIGURATION_ARGS} --enable-threadsafe --enable-load-extension --enable-json1 --enable-fts4 --enable-fts5
--enable-shared=no)
set(SQLITE_CONFIGURATION_ARGS
${SQLITE_CONFIGURATION_ARGS}
--enable-threadsafe
--enable-load-extension
--enable-json1
--enable-fts4
--enable-fts5
# While building `tcl` is harmless, it causes problems when the install step
# tries to copy the files into the system path.
# Since this isn't required by Python or Blender this can be disabled.
# Note that Debian (for example), splits this off into a separate package,
# so it's safe to turn off.
--disable-tcl
--enable-shared=no
)
endif()
ExternalProject_Add(external_sqlite
URL ${SQLITE_URI}
URL file://${PACKAGE_DIR}/${SQLITE_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH SHA1=${SQLITE_HASH}
URL_HASH ${SQLITE_HASH_TYPE}=${SQLITE_HASH}
PREFIX ${BUILD_DIR}/sqlite
PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/sqlite/src/external_sqlite < ${PATCH_DIR}/sqlite.diff
CONFIGURE_COMMAND ${SQLITE_CONFIGURE_ENV} && cd ${BUILD_DIR}/sqlite/src/external_sqlite/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/sqlite ${SQLITE_CONFIGURATION_ARGS}

View File

@@ -16,16 +16,13 @@
#
# ***** END GPL LICENSE BLOCK *****
set(LCMS_EXTRA_ARGS
)
ExternalProject_Add(external_lcms
URL ${LCMS_URI}
ExternalProject_Add(external_sse2neon
GIT_REPOSITORY ${SSE2NEON_GIT}
GIT_TAG ${SSE2NEON_GIT_HASH}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${LCMS_HASH}
PREFIX ${BUILD_DIR}/lcms
# Patch taken from ocio.
PATCH_COMMAND ${CMAKE_COMMAND} -E copy ${PATCH_DIR}/cmakelists_lcms.txt ${BUILD_DIR}/lcms/src/external_lcms/CMakeLists.txt
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/lcms ${DEFAULT_CMAKE_FLAGS} ${LCMS_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/lcms
PREFIX ${BUILD_DIR}/sse2neon
CONFIGURE_COMMAND echo sse2neon - Nothing to configure
BUILD_COMMAND echo sse2neon - nothing to build
INSTALL_COMMAND mkdir -p ${LIBDIR}/sse2neon && cp ${BUILD_DIR}/sse2neon/src/external_sse2neon/sse2neon.h ${LIBDIR}/sse2neon
INSTALL_DIR ${LIBDIR}/sse2neon
)

View File

@@ -20,9 +20,11 @@ set(SSL_CONFIGURE_COMMAND ./Configure)
set(SSL_PATCH_CMD echo .)
if(APPLE)
set(SSL_OS_COMPILER "blender-darwin-${CMAKE_OSX_ARCHITECTURES}")
set(SSL_OS_COMPILER "blender-darwin-${CMAKE_OSX_ARCHITECTURES}")
else()
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
if(BLENDER_PLATFORM_ARM)
set(SSL_OS_COMPILER "blender-linux-aarch64")
elseif("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
set(SSL_EXTRA_ARGS enable-ec_nistp_64_gcc_128)
set(SSL_OS_COMPILER "blender-linux-x86_64")
else()
@@ -31,9 +33,9 @@ else()
endif()
ExternalProject_Add(external_ssl
URL ${SSL_URI}
URL file://${PACKAGE_DIR}/${SSL_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH SHA256=${SSL_HASH}
URL_HASH ${SSL_HASH_TYPE}=${SSL_HASH}
PREFIX ${BUILD_DIR}/ssl
PATCH_COMMAND ${SSL_PATCH_CMD}
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/ssl/src/external_ssl/ && ${SSL_CONFIGURE_COMMAND} --prefix=${LIBDIR}/ssl

View File

@@ -8,6 +8,11 @@ my %targets = (
inherit_from => [ "linux-x86_64" ],
cflags => add("-fPIC"),
},
"blender-linux-aarch64" => {
inherit_from => [ "linux-aarch64" ],
cxxflags => add("-fPIC"),
cflags => add("-fPIC"),
},
"blender-darwin-x86_64" => {
inherit_from => [ "darwin64-x86_64-cc" ],
cflags => add("-fPIC"),

View File

@@ -21,6 +21,8 @@ if(WIN32)
-DTBB_BUILD_TBBMALLOC=On
-DTBB_BUILD_TBBMALLOC_PROXY=On
-DTBB_BUILD_STATIC=Off
-DTBB_BUILD_TESTS=Off
-DCMAKE_DEBUG_POSTFIX=_debug
)
set(TBB_LIBRARY tbb)
set(TBB_STATIC_LIBRARY Off)
@@ -30,6 +32,7 @@ else()
-DTBB_BUILD_TBBMALLOC=On
-DTBB_BUILD_TBBMALLOC_PROXY=Off
-DTBB_BUILD_STATIC=On
-DTBB_BUILD_TESTS=Off
)
set(TBB_LIBRARY tbb_static)
set(TBB_STATIC_LIBRARY On)
@@ -37,12 +40,13 @@ endif()
# CMake script for TBB from https://github.com/wjakob/tbb/blob/master/CMakeLists.txt
ExternalProject_Add(external_tbb
URL ${TBB_URI}
URL file://${PACKAGE_DIR}/${TBB_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${TBB_HASH}
URL_HASH ${TBB_HASH_TYPE}=${TBB_HASH}
PREFIX ${BUILD_DIR}/tbb
PATCH_COMMAND COMMAND ${CMAKE_COMMAND} -E copy ${PATCH_DIR}/cmakelists_tbb.txt ${BUILD_DIR}/tbb/src/external_tbb/CMakeLists.txt &&
${CMAKE_COMMAND} -E copy ${BUILD_DIR}/tbb/src/external_tbb/build/vs2013/version_string.ver ${BUILD_DIR}/tbb/src/external_tbb/src/tbb/version_string.ver
${CMAKE_COMMAND} -E copy ${BUILD_DIR}/tbb/src/external_tbb/build/vs2013/version_string.ver ${BUILD_DIR}/tbb/src/external_tbb/build/version_string.ver.in &&
${PATCH_CMD} -p 1 -d ${BUILD_DIR}/tbb/src/external_tbb < ${PATCH_DIR}/tbb.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/tbb ${DEFAULT_CMAKE_FLAGS} ${TBB_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/tbb
)
@@ -52,17 +56,17 @@ if(WIN32)
ExternalProject_Add_Step(external_tbb after_install
# findtbb.cmake in some deps *NEEDS* to find tbb_debug.lib even if they are not going to use it
# to make that test pass, we place a copy with the right name in the lib folder.
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbb.lib ${HARVEST_TARGET}/tbb/lib/tbb_debug.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbbmalloc.lib ${HARVEST_TARGET}/tbb/lib/tbbmalloc_debug.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbb.dll ${HARVEST_TARGET}/tbb/lib/tbb_debug.dll
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbbmalloc.dll ${HARVEST_TARGET}/tbb/lib/tbbmalloc_debug.dll
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbb.lib ${LIBDIR}/tbb/lib/tbb_debug.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbbmalloc.lib ${LIBDIR}/tbb/lib/tbbmalloc_debug.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/bin/tbb.dll ${LIBDIR}/tbb/bin/tbb_debug.dll
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/bin/tbbmalloc.dll ${LIBDIR}/tbb/bin/tbbmalloc_debug.dll
# Normal collection of build artifacts
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbb.lib ${HARVEST_TARGET}/tbb/lib/tbb.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbb.dll ${HARVEST_TARGET}/tbb/lib/tbb.dll
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/bin/tbb.dll ${HARVEST_TARGET}/tbb/bin/tbb.dll
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbbmalloc.lib ${HARVEST_TARGET}/tbb/lib/tbbmalloc.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbbmalloc.dll ${HARVEST_TARGET}/tbb/lib/tbbmalloc.dll
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/bin/tbbmalloc.dll ${HARVEST_TARGET}/tbb/bin/tbbmalloc.dll
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbbmalloc_proxy.lib ${HARVEST_TARGET}/tbb/lib/tbbmalloc_proxy.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbbmalloc_proxy.dll ${HARVEST_TARGET}/tbb/lib/tbbmalloc_proxy.dll
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/bin/tbbmalloc_proxy.dll ${HARVEST_TARGET}/tbb/bin/tbbmalloc_proxy.dll
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/tbb/include/ ${HARVEST_TARGET}/tbb/include/
DEPENDEES install
)
@@ -73,11 +77,12 @@ if(WIN32)
# to make that test pass, we place a copy with the right name in the lib folder.
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbb_debug.lib ${LIBDIR}/tbb/lib/tbb.lib
# Normal collection of build artifacts
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbb_debug.lib ${HARVEST_TARGET}/tbb/lib/debug/tbb_debug.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbb_debug.dll ${HARVEST_TARGET}/tbb/lib/debug/tbb_debug.dll
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbbmalloc_proxy.lib ${HARVEST_TARGET}/tbb/lib/tbbmalloc_proxy_debug.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbbmalloc.dll ${HARVEST_TARGET}/tbb/lib/debug/tbbmalloc.dll
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbbmalloc_proxy.dll ${HARVEST_TARGET}/tbb/lib/debug/tbbmalloc_proxy.dll
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbb_debug.lib ${HARVEST_TARGET}/tbb/lib/tbb_debug.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/bin/tbb_debug.dll ${HARVEST_TARGET}/tbb/bin/tbb_debug.dll
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbbmalloc_debug.lib ${HARVEST_TARGET}/tbb/lib/tbbmalloc_debug.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbbmalloc_proxy_debug.lib ${HARVEST_TARGET}/tbb/lib/tbbmalloc_proxy_debug.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/bin/tbbmalloc_debug.dll ${HARVEST_TARGET}/tbb/bin/tbbmalloc_debug.dll
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/bin/tbbmalloc_proxy_debug.dll ${HARVEST_TARGET}/tbb/bin/tbbmalloc_proxy_debug.dll
DEPENDEES install
)
endif()

View File

@@ -23,9 +23,9 @@ else()
endif()
ExternalProject_Add(external_theora
URL ${THEORA_URI}
URL file://${PACKAGE_DIR}/${THEORA_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH SHA256=${THEORA_HASH}
URL_HASH ${THEORA_HASH_TYPE}=${THEORA_HASH}
PREFIX ${BUILD_DIR}/theora
PATCH_COMMAND ${PATCH_CMD} -p 0 -d ${BUILD_DIR}/theora/src/external_theora < ${PATCH_DIR}/theora.diff
CONFIGURE_COMMAND ${THEORA_CONFIGURE_ENV} && cd ${BUILD_DIR}/theora/src/external_theora/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/theora

View File

@@ -34,9 +34,9 @@ set(TIFF_EXTRA_ARGS
)
ExternalProject_Add(external_tiff
URL ${TIFF_URI}
URL file://${PACKAGE_DIR}/${TIFF_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${TIFF_HASH}
URL_HASH ${TIFF_HASH_TYPE}=${TIFF_HASH}
PREFIX ${BUILD_DIR}/tiff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/tiff ${DEFAULT_CMAKE_FLAGS} ${TIFF_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/tiff

View File

@@ -53,9 +53,9 @@ set(USD_EXTRA_ARGS
)
ExternalProject_Add(external_usd
URL ${USD_URI}
URL file://${PACKAGE_DIR}/${USD_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${USD_HASH}
URL_HASH ${USD_HASH_TYPE}=${USD_HASH}
PREFIX ${BUILD_DIR}/usd
PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/usd/src/external_usd < ${PATCH_DIR}/usd.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/usd -Wno-dev ${DEFAULT_CMAKE_FLAGS} ${USD_EXTRA_ARGS}

View File

@@ -19,37 +19,54 @@
set(ZLIB_VERSION 1.2.11)
set(ZLIB_URI https://zlib.net/zlib-${ZLIB_VERSION}.tar.gz)
set(ZLIB_HASH 1c9f62f0778697a09d36121ead88e08e)
set(ZLIB_HASH_TYPE MD5)
set(ZLIB_FILE zlib-${ZLIB_VERSION}.tar.gz)
set(OPENAL_VERSION 1.20.1)
set(OPENAL_URI http://openal-soft.org/openal-releases/openal-soft-${OPENAL_VERSION}.tar.bz2)
set(OPENAL_HASH 556695068ce8375b89986083d810fd35)
set(OPENAL_HASH_TYPE MD5)
set(OPENAL_FILE openal-soft-${OPENAL_VERSION}.tar.bz2)
set(PNG_VERSION 1.6.37)
set(PNG_URI http://prdownloads.sourceforge.net/libpng/libpng-${PNG_VERSION}.tar.xz)
set(PNG_HASH 505e70834d35383537b6491e7ae8641f1a4bed1876dbfe361201fc80868d88ca)
set(PNG_HASH_TYPE SHA256)
set(PNG_FILE libpng-${PNG_VERSION}.tar.xz)
set(JPEG_VERSION 2.0.4)
set(JPEG_URI https://github.com/libjpeg-turbo/libjpeg-turbo/archive/${JPEG_VERSION}.tar.gz)
set(JPEG_HASH 44c43e4a9fb352f47090804529317c88)
set(JPEG_HASH_TYPE MD5)
set(JPEG_FILE libjpeg-turbo-${JPEG_VERSION}.tar.gz)
set(BOOST_VERSION 1.70.0)
set(BOOST_VERSION_NODOTS 1_70_0)
set(BOOST_VERSION_NODOTS_SHORT 1_70)
set(BOOST_URI https://dl.bintray.com/boostorg/release/${BOOST_VERSION}/source/boost_${BOOST_VERSION_NODOTS}.tar.gz)
set(BOOST_HASH fea771fe8176828fabf9c09242ee8c26)
set(BOOST_VERSION 1.73.0)
set(BOOST_VERSION_NODOTS 1_73_0)
set(BOOST_VERSION_NODOTS_SHORT 1_73)
set(BOOST_URI https://boostorg.jfrog.io/artifactory/main/release/${BOOST_VERSION}/source/boost_${BOOST_VERSION_NODOTS}.tar.gz)
set(BOOST_HASH 4036cd27ef7548b8d29c30ea10956196)
set(BOOST_HASH_TYPE MD5)
set(BOOST_FILE boost_${BOOST_VERSION_NODOTS}.tar.gz)
# Using old version as recommended by OpenVDB build documentation.
set(BLOSC_VERSION 1.5.0)
set(BLOSC_URI https://github.com/Blosc/c-blosc/archive/v${BLOSC_VERSION}.tar.gz)
set(BLOSC_HASH 6e4a49c8c06f05aa543f3312cfce3d55)
set(BLOSC_HASH_TYPE MD5)
set(BLOSC_FILE blosc-${BLOSC_VERSION}.tar.gz)
set(PTHREADS_VERSION 3.0.0)
set(PTHREADS_URI http://sourceforge.mirrorservice.org/p/pt/pthreads4w/pthreads4w-code-v${PTHREADS_VERSION}.zip)
set(PTHREADS_URI http://prdownloads.sourceforge.net/pthreads4w/pthreads4w-code-v${PTHREADS_VERSION}.zip)
set(PTHREADS_HASH f3bf81bb395840b3446197bcf4ecd653)
set(PTHREADS_HASH_TYPE MD5)
set(PTHREADS_FILE pthreads4w-code-${PTHREADS_VERSION}.zip)
set(OPENEXR_VERSION 2.4.0)
set(OPENEXR_VERSION 2.5.5)
set(OPENEXR_URI https://github.com/AcademySoftwareFoundation/openexr/archive/v${OPENEXR_VERSION}.tar.gz)
set(OPENEXR_HASH 9e4d69cf2a12c6fb19b98af7c5e0eaee)
set(OPENEXR_HASH 85e8a979092c9055d10ed103062d31a0)
set(OPENEXR_HASH_TYPE MD5)
set(OPENEXR_FILE openexr-${OPENEXR_VERSION}.tar.gz)
if(WIN32)
# Openexr started appending _d on its own so now
# we need to tell the build the postfix is _s while
@@ -69,203 +86,294 @@ endif()
set(FREETYPE_VERSION 2.10.2)
set(FREETYPE_URI http://prdownloads.sourceforge.net/freetype/freetype-${FREETYPE_VERSION}.tar.gz)
set(FREETYPE_HASH b1cb620e4c875cd4d1bfa04945400945)
set(FREETYPE_HASH_TYPE MD5)
set(FREETYPE_FILE freetype-${FREETYPE_VERSION}.tar.gz)
set(GLEW_VERSION 1.13.0)
set(GLEW_URI http://prdownloads.sourceforge.net/glew/glew/${GLEW_VERSION}/glew-${GLEW_VERSION}.tgz)
set(GLEW_HASH 7cbada3166d2aadfc4169c4283701066)
set(GLEW_HASH_TYPE MD5)
set(GLEW_FILE glew-${GLEW_VERSION}.tgz)
set(FREEGLUT_VERSION 3.0.0)
set(FREEGLUT_URI http://pilotfiber.dl.sourceforge.net/project/freeglut/freeglut/${FREEGLUT_VERSION}/freeglut-${FREEGLUT_VERSION}.tar.gz)
set(FREEGLUT_URI http://prdownloads.sourceforge.net/freeglut/freeglut/${FREEGLUT_VERSION}/freeglut-${FREEGLUT_VERSION}.tar.gz)
set(FREEGLUT_HASH 90c3ca4dd9d51cf32276bc5344ec9754)
set(FREEGLUT_HASH_TYPE MD5)
set(FREEGLUT_FILE freeglut-${FREEGLUT_VERSION}.tar.gz)
set(ALEMBIC_VERSION 1.7.12)
set(ALEMBIC_VERSION 1.7.16)
set(ALEMBIC_URI https://github.com/alembic/alembic/archive/${ALEMBIC_VERSION}.tar.gz)
set(ALEMBIC_MD5 e2b3777f23c5c09481a008cc6f0f8a40)
set(ALEMBIC_HASH effcc86e42fe6605588e3de57bde6677)
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_3)
set(OPENSUBDIV_URI https://github.com/PixarAnimationStudios/OpenSubdiv/archive/${OPENSUBDIV_VERSION}.tar.gz)
set(OPENSUBDIV_HASH 7bbfa275d021fb829e521df749160edb)
set(OPENSUBDIV_HASH_TYPE MD5)
set(OPENSUBDIV_FILE opensubdiv-${OPENSUBDIV_VERSION}.tar.gz)
set(SDL_VERSION 2.0.12)
set(SDL_URI https://www.libsdl.org/release/SDL2-${SDL_VERSION}.tar.gz)
set(SDL_HASH 783b6f2df8ff02b19bb5ce492b99c8ff)
set(SDL_HASH_TYPE MD5)
set(SDL_FILE SDL2-${SDL_VERSION}.tar.gz)
set(OPENCOLLADA_VERSION v1.6.68)
set(OPENCOLLADA_URI https://github.com/KhronosGroup/OpenCOLLADA/archive/${OPENCOLLADA_VERSION}.tar.gz)
set(OPENCOLLADA_HASH ee7dae874019fea7be11613d07567493)
set(OPENCOLLADA_HASH_TYPE MD5)
set(OPENCOLLADA_FILE opencollada-${OPENCOLLADA_VERSION}.tar.gz)
set(OPENCOLORIO_VERSION 1.1.1)
set(OPENCOLORIO_VERSION 2.0.0)
set(OPENCOLORIO_URI https://github.com/AcademySoftwareFoundation/OpenColorIO/archive/v${OPENCOLORIO_VERSION}.tar.gz)
set(OPENCOLORIO_HASH 23d8b9ac81599305539a5a8674b94a3d)
set(OPENCOLORIO_HASH 1a2e3478b6cd9a1549f24e1b2205e3f0)
set(OPENCOLORIO_HASH_TYPE MD5)
set(OPENCOLORIO_FILE OpenColorIO-${OPENCOLORIO_VERSION}.tar.gz)
set(LLVM_VERSION 9.0.1)
set(LLVM_URI https://github.com/llvm/llvm-project/releases/download/llvmorg-${LLVM_VERSION}/llvm-${LLVM_VERSION}.src.tar.xz)
set(LLVM_HASH 31eb9ce73dd2a0f8dcab8319fb03f8fc)
set(LLVM_VERSION 12.0.0)
set(LLVM_URI https://github.com/llvm/llvm-project/releases/download/llvmorg-${LLVM_VERSION}/llvm-project-${LLVM_VERSION}.src.tar.xz)
set(LLVM_HASH 5a4fab4d7fc84aefffb118ac2c8a4fc0)
set(LLVM_HASH_TYPE MD5)
set(LLVM_FILE llvm-project-${LLVM_VERSION}.src.tar.xz)
set(CLANG_URI https://github.com/llvm/llvm-project/releases/download/llvmorg-${LLVM_VERSION}/clang-${LLVM_VERSION}.src.tar.xz)
set(CLANG_HASH 13468e4a44940efef1b75e8641752f90)
if(APPLE)
# Cloth physics test is crashing due to this bug:
# https://bugs.llvm.org/show_bug.cgi?id=50579
set(OPENMP_VERSION 9.0.1)
set(OPENMP_HASH 6eade16057edbdecb3c4eef9daa2bfcf)
else()
set(OPENMP_VERSION ${LLVM_VERSION})
set(OPENMP_HASH ac48ce3e4582ccb82f81ab59eb3fc9dc)
endif()
set(OPENMP_URI https://github.com/llvm/llvm-project/releases/download/llvmorg-${OPENMP_VERSION}/openmp-${OPENMP_VERSION}.src.tar.xz)
set(OPENMP_HASH_TYPE MD5)
set(OPENMP_FILE openmp-${OPENMP_VERSION}.src.tar.xz)
set(OPENMP_URI https://github.com/llvm/llvm-project/releases/download/llvmorg-${LLVM_VERSION}/openmp-${LLVM_VERSION}.src.tar.xz)
set(OPENMP_HASH 6eade16057edbdecb3c4eef9daa2bfcf)
set(OPENIMAGEIO_VERSION 2.1.15.0)
set(OPENIMAGEIO_VERSION 2.2.15.1)
set(OPENIMAGEIO_URI https://github.com/OpenImageIO/oiio/archive/Release-${OPENIMAGEIO_VERSION}.tar.gz)
set(OPENIMAGEIO_HASH f03aa5e3ac4795af04771ee4146e9832)
set(OPENIMAGEIO_HASH 3db5c5f0b3dc91597c75e5df09eb9072)
set(OPENIMAGEIO_HASH_TYPE MD5)
set(OPENIMAGEIO_FILE OpenImageIO-${OPENIMAGEIO_VERSION}.tar.gz)
set(TIFF_VERSION 4.1.0)
set(TIFF_URI http://download.osgeo.org/libtiff/tiff-${TIFF_VERSION}.tar.gz)
set(TIFF_HASH 2165e7aba557463acc0664e71a3ed424)
set(TIFF_HASH_TYPE MD5)
set(TIFF_FILE tiff-${TIFF_VERSION}.tar.gz)
set(OSL_VERSION 1.10.10)
set(OSL_VERSION 1.11.14.1)
set(OSL_URI https://github.com/imageworks/OpenShadingLanguage/archive/Release-${OSL_VERSION}.tar.gz)
set(OSL_HASH 00dec08a93c8084e53848b9ad047889f)
set(OSL_HASH 1abd7ce40481771a9fa937f19595d2f2)
set(OSL_HASH_TYPE MD5)
set(OSL_FILE OpenShadingLanguage-${OSL_VERSION}.tar.gz)
set(PYTHON_VERSION 3.7.7)
set(PYTHON_SHORT_VERSION 3.7)
set(PYTHON_SHORT_VERSION_NO_DOTS 37)
set(PYTHON_VERSION 3.9.2)
set(PYTHON_SHORT_VERSION 3.9)
set(PYTHON_SHORT_VERSION_NO_DOTS 39)
set(PYTHON_URI https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tar.xz)
set(PYTHON_HASH 172c650156f7bea68ce31b2fd01fa766)
set(PYTHON_HASH f0dc9000312abeb16de4eccce9a870ab)
set(PYTHON_HASH_TYPE MD5)
set(PYTHON_FILE Python-${PYTHON_VERSION}.tar.xz)
set(TBB_VERSION 2019_U9)
set(TBB_VERSION 2020_U2)
set(TBB_URI https://github.com/oneapi-src/oneTBB/archive/${TBB_VERSION}.tar.gz)
set(TBB_HASH 26263622e9187212ec240dcf01b66207)
set(TBB_HASH 1b711ae956524855088df3bbf5ec65dc)
set(TBB_HASH_TYPE MD5)
set(TBB_FILE oneTBB-${TBB_VERSION}.tar.gz)
if(WITH_NANOVDB)
set(OPENVDB_GIT_UID e62f7a0bf1e27397223c61ddeaaf57edf111b77f)
set(OPENVDB_URI https://github.com/AcademySoftwareFoundation/openvdb/archive/${OPENVDB_GIT_UID}.tar.gz)
set(OPENVDB_HASH 90919510bc6ccd630fedc56f748cb199)
else()
set(OPENVDB_VERSION 7.0.0)
set(OPENVDB_URI https://github.com/AcademySoftwareFoundation/openvdb/archive/v${OPENVDB_VERSION}.tar.gz)
set(OPENVDB_HASH fd6c4f168282f7e0e494d290cd531fa8)
endif()
set(OPENVDB_VERSION 8.0.1)
set(OPENVDB_URI https://github.com/AcademySoftwareFoundation/openvdb/archive/v${OPENVDB_VERSION}.tar.gz)
set(OPENVDB_HASH 01b490be16cc0e15c690f9a153c21461)
set(OPENVDB_HASH_TYPE MD5)
set(OPENVDB_FILE openvdb-${OPENVDB_VERSION}.tar.gz)
set(IDNA_VERSION 2.9)
set(CHARDET_VERSION 3.0.4)
set(URLLIB3_VERSION 1.25.9)
set(CERTIFI_VERSION 2020.4.5.2)
set(REQUESTS_VERSION 2.23.0)
set(NANOVDB_GIT_UID dc37d8a631922e7bef46712947dc19b755f3e841)
set(NANOVDB_URI https://github.com/AcademySoftwareFoundation/openvdb/archive/${NANOVDB_GIT_UID}.tar.gz)
set(NANOVDB_HASH e7b9e863ec2f3b04ead171dec2322807)
set(NANOVDB_HASH_TYPE MD5)
set(NANOVDB_FILE nano-vdb-${NANOVDB_GIT_UID}.tar.gz)
set(NUMPY_VERSION 1.17.5)
set(NUMPY_SHORT_VERSION 1.17)
set(IDNA_VERSION 2.10)
set(CHARDET_VERSION 4.0.0)
set(URLLIB3_VERSION 1.26.3)
set(CERTIFI_VERSION 2020.12.5)
set(REQUESTS_VERSION 2.25.1)
set(CYTHON_VERSION 0.29.21)
set(NUMPY_VERSION 1.19.5)
set(NUMPY_SHORT_VERSION 1.19)
set(NUMPY_URI https://github.com/numpy/numpy/releases/download/v${NUMPY_VERSION}/numpy-${NUMPY_VERSION}.zip)
set(NUMPY_HASH 763a5646fa6eef7a22f4895bca0524f2)
set(NUMPY_HASH f6a1b48717c552bbc18f1adc3cc1fe0e)
set(NUMPY_HASH_TYPE MD5)
set(NUMPY_FILE numpy-${NUMPY_VERSION}.zip)
set(LAME_VERSION 3.100)
set(LAME_URI http://downloads.sourceforge.net/project/lame/lame/3.100/lame-${LAME_VERSION}.tar.gz)
set(LAME_HASH 83e260acbe4389b54fe08e0bdbf7cddb)
set(LAME_HASH_TYPE MD5)
set(LAME_FILE lame-${LAME_VERSION}.tar.gz)
set(OGG_VERSION 1.3.4)
set(OGG_URI http://downloads.xiph.org/releases/ogg/libogg-${OGG_VERSION}.tar.gz)
set(OGG_HASH fe5670640bd49e828d64d2879c31cb4dde9758681bb664f9bdbf159a01b0c76e)
set(OGG_HASH_TYPE SHA256)
set(OGG_FILE libogg-${OGG_VERSION}.tar.gz)
set(VORBIS_VERSION 1.3.6)
set(VORBIS_URI http://downloads.xiph.org/releases/vorbis/libvorbis-${VORBIS_VERSION}.tar.gz)
set(VORBIS_HASH 6ed40e0241089a42c48604dc00e362beee00036af2d8b3f46338031c9e0351cb)
set(VORBIS_HASH_TYPE SHA256)
set(VORBIS_FILE libvorbis-${VORBIS_VERSION}.tar.gz)
set(THEORA_VERSION 1.1.1)
set(THEORA_URI http://downloads.xiph.org/releases/theora/libtheora-${THEORA_VERSION}.tar.bz2)
set(THEORA_HASH b6ae1ee2fa3d42ac489287d3ec34c5885730b1296f0801ae577a35193d3affbc)
set(THEORA_HASH_TYPE SHA256)
set(THEORA_FILE libtheora-${THEORA_VERSION}.tar.bz2)
set(FLAC_VERSION 1.3.3)
set(FLAC_URI http://downloads.xiph.org/releases/flac/flac-${FLAC_VERSION}.tar.xz)
set(FLAC_HASH 213e82bd716c9de6db2f98bcadbc4c24c7e2efe8c75939a1a84e28539c4e1748)
set(FLAC_HASH_TYPE SHA256)
set(FLAC_FILE flac-${FLAC_VERSION}.tar.xz)
set(VPX_VERSION 1.8.2)
set(VPX_URI https://github.com/webmproject/libvpx/archive/v${VPX_VERSION}/libvpx-v${VPX_VERSION}.tar.gz)
set(VPX_HASH 8735d9fcd1a781ae6917f28f239a8aa358ce4864ba113ea18af4bb2dc8b474ac)
set(VPX_HASH_TYPE SHA256)
set(VPX_FILE libvpx-v${VPX_VERSION}.tar.gz)
set(OPUS_VERSION 1.3.1)
set(OPUS_URI https://archive.mozilla.org/pub/opus/opus-${OPUS_VERSION}.tar.gz)
set(OPUS_HASH 65b58e1e25b2a114157014736a3d9dfeaad8d41be1c8179866f144a2fb44ff9d)
set(OPUS_HASH_TYPE SHA256)
set(OPUS_FILE opus-${OPUS_VERSION}.tar.gz)
set(X264_URI https://code.videolan.org/videolan/x264/-/archive/33f9e1474613f59392be5ab6a7e7abf60fa63622/x264-33f9e1474613f59392be5ab6a7e7abf60fa63622.tar.gz)
set(X264_VERSION 33f9e1474613f59392be5ab6a7e7abf60fa63622)
set(X264_URI https://code.videolan.org/videolan/x264/-/archive/${X264_VERSION}/x264-${X264_VERSION}.tar.gz)
set(X264_HASH 5456450ee1ae02cd2328be3157367a232a0ab73315e8c8f80dab80469524f525)
set(X264_HASH_TYPE SHA256)
set(X264_FILE x264-${X264_VERSION}.tar.gz)
set(XVIDCORE_VERSION 1.3.7)
set(XVIDCORE_URI https://downloads.xvid.com/downloads/xvidcore-${XVIDCORE_VERSION}.tar.gz)
set(XVIDCORE_HASH abbdcbd39555691dd1c9b4d08f0a031376a3b211652c0d8b3b8aa9be1303ce2d)
set(XVIDCORE_HASH_TYPE SHA256)
set(XVIDCORE_FILE xvidcore-${XVIDCORE_VERSION}.tar.gz)
set(OPENJPEG_VERSION 2.3.1)
set(OPENJPEG_SHORT_VERSION 2.3)
set(OPENJPEG_URI https://github.com/uclouvain/openjpeg/archive/v${OPENJPEG_VERSION}.tar.gz)
set(OPENJPEG_HASH 63f5a4713ecafc86de51bfad89cc07bb788e9bba24ebbf0c4ca637621aadb6a9)
set(OPENJPEG_HASH_TYPE SHA256)
set(OPENJPEG_FILE openjpeg-v${OPENJPEG_VERSION}.tar.gz)
set(FFMPEG_VERSION 4.2.3)
set(FFMPEG_VERSION 4.4)
set(FFMPEG_URI http://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.bz2)
set(FFMPEG_HASH 695fad11f3baf27784e24cb0e977b65a)
set(FFMPEG_HASH 42093549751b582cf0f338a21a3664f52e0a9fbe0d238d3c992005e493607d0e)
set(FFMPEG_HASH_TYPE SHA256)
set(FFMPEG_FILE ffmpeg-${FFMPEG_VERSION}.tar.bz2)
set(FFTW_VERSION 3.3.8)
set(FFTW_URI http://www.fftw.org/fftw-${FFTW_VERSION}.tar.gz)
set(FFTW_HASH 8aac833c943d8e90d51b697b27d4384d)
set(FFTW_HASH_TYPE MD5)
set(FFTW_FILE fftw-${FFTW_VERSION}.tar.gz)
set(ICONV_VERSION 1.16)
set(ICONV_URI http://ftp.gnu.org/pub/gnu/libiconv/libiconv-${ICONV_VERSION}.tar.gz)
set(ICONV_HASH 7d2a800b952942bb2880efb00cfd524c)
set(ICONV_HASH_TYPE MD5)
set(ICONV_FILE libiconv-${ICONV_VERSION}.tar.gz)
set(SNDFILE_VERSION 1.0.28)
set(SNDFILE_URI http://www.mega-nerd.com/libsndfile/files/libsndfile-${SNDFILE_VERSION}.tar.gz)
set(SNDFILE_HASH 646b5f98ce89ac60cdb060fcd398247c)
# set(HIDAPI_VERSION 0.8.0-rc1)
# set(HIDAPI_URI https://github.com/signal11/hidapi/archive/hidapi-${HIDAPI_VERSION}.tar.gz)
# set(HIDAPI_HASH 069f9dd746edc37b6b6d0e3656f47199)
set(HIDAPI_UID 89a6c75dc6f45ecabd4ddfbd2bf5ba6ad8ba38b5)
set(HIDAPI_URI https://github.com/TheOnlyJoey/hidapi/archive/${HIDAPI_UID}.zip)
set(HIDAPI_HASH b6e22f6b514f8bcf594989f20ffc46fb)
set(SNDFILE_HASH_TYPE MD5)
set(SNDFILE_FILE libsndfile-${SNDFILE_VERSION}.tar.gz)
set(WEBP_VERSION 0.6.1)
set(WEBP_URI https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-${WEBP_VERSION}.tar.gz)
set(WEBP_HASH b49ce9c3e3e9acae4d91bca44bb85a72)
set(WEBP_HASH_TYPE MD5)
set(WEBP_FILE libwebp-${WEBP_VERSION}.tar.gz)
set(SPNAV_VERSION 0.2.3)
set(SPNAV_URI http://downloads.sourceforge.net/project/spacenav/spacenav%20library%20%28SDK%29/libspnav%20${SPNAV_VERSION}/libspnav-${SPNAV_VERSION}.tar.gz)
set(SPNAV_HASH 44d840540d53326d4a119c0f1aa7bf0a)
set(SPNAV_HASH_TYPE MD5)
set(SPNAV_FILE libspnav-${SPNAV_VERSION}.tar.gz)
set(JEMALLOC_VERSION 5.2.1)
set(JEMALLOC_URI https://github.com/jemalloc/jemalloc/releases/download/${JEMALLOC_VERSION}/jemalloc-${JEMALLOC_VERSION}.tar.bz2)
set(JEMALLOC_HASH 3d41fbf006e6ebffd489bdb304d009ae)
set(JEMALLOC_HASH_TYPE MD5)
set(JEMALLOC_FILE jemalloc-${JEMALLOC_VERSION}.tar.bz2)
set(XML2_VERSION 2.9.10)
set(XML2_URI http://xmlsoft.org/sources/libxml2-${XML2_VERSION}.tar.gz)
set(XML2_HASH 10942a1dc23137a8aa07f0639cbfece5)
set(XML2_HASH_TYPE MD5)
set(XML2_FILE libxml2-${XML2_VERSION}.tar.gz)
set(TINYXML_VERSION 2_6_2)
set(TINYXML_VERSION_DOTS 2.6.2)
set(TINYXML_URI https://nchc.dl.sourceforge.net/project/tinyxml/tinyxml/${TINYXML_VERSION_DOTS}/tinyxml_${TINYXML_VERSION}.tar.gz)
set(TINYXML_HASH c1b864c96804a10526540c664ade67f0)
set(TINYXML_HASH_TYPE MD5)
set(TINYXML_FILE tinyxml_${TINYXML_VERSION}.tar.gz)
set(YAMLCPP_VERSION 0.6.3)
set(YAMLCPP_URI https://codeload.github.com/jbeder/yaml-cpp/tar.gz/yaml-cpp-${YAMLCPP_VERSION})
set(YAMLCPP_HASH b45bf1089a382e81f6b661062c10d0c2)
set(YAMLCPP_HASH_TYPE MD5)
set(YAMLCPP_FILE yaml-cpp-${YAMLCPP_VERSION}.tar.gz)
set(LCMS_VERSION 2.9)
set(LCMS_URI https://nchc.dl.sourceforge.net/project/lcms/lcms/${LCMS_VERSION}/lcms2-${LCMS_VERSION}.tar.gz)
set(LCMS_HASH 8de1b7724f578d2995c8fdfa35c3ad0e)
set(EXPAT_VERSION 2_2_10)
set(EXPAT_URI https://github.com/libexpat/libexpat/archive/R_${EXPAT_VERSION}.tar.gz)
set(EXPAT_HASH 7ca5f09959fcb9a57618368deb627b9f)
set(EXPAT_HASH_TYPE MD5)
set(EXPAT_FILE libexpat-${EXPAT_VERSION}.tar.gz)
set(PUGIXML_VERSION 1.10)
set(PUGIXML_URI https://github.com/zeux/pugixml/archive/v${PUGIXML_VERSION}.tar.gz)
set(PUGIXML_HASH 0c208b0664c7fb822bf1b49ad035e8fd)
set(PUGIXML_HASH_TYPE MD5)
set(PUGIXML_FILE pugixml-${PUGIXML_VERSION}.tar.gz)
set(FLEXBISON_VERSION 2.5.5)
set(FLEXBISON_URI http://prdownloads.sourceforge.net/winflexbison//win_flex_bison-2.5.5.zip)
set(FLEXBISON_HASH d87a3938194520d904013abef3df10ce)
set(FLEXBISON_VERSION 2.5.24)
set(FLEXBISON_URI http://prdownloads.sourceforge.net/winflexbison/win_flex_bison-${FLEXBISON_VERSION}.zip)
set(FLEXBISON_HASH 6b549d43e34ece0e8ed05af92daa31c4)
set(FLEXBISON_HASH_TYPE MD5)
set(FLEXBISON_FILE win_flex_bison-${FLEXBISON_VERSION}.zip)
set(FLEX_VERSION 2.6.4)
set(FLEX_URI https://github.com/westes/flex/releases/download/v${FLEX_VERSION}/flex-${FLEX_VERSION}.tar.gz)
set(FLEX_HASH 2882e3179748cc9f9c23ec593d6adc8d)
set(FLEX_HASH_TYPE MD5)
set(FLEX_FILE flex-${FLEX_VERSION}.tar.gz)
# Libraries to keep Python modules static on Linux.
@@ -274,59 +382,120 @@ set(FLEXBISON_HASH d87a3938194520d904013abef3df10ce)
set(BZIP2_VERSION 1.0.8)
set(BZIP2_URI http://http.debian.net/debian/pool/main/b/bzip2/bzip2_${BZIP2_VERSION}.orig.tar.gz)
set(BZIP2_HASH ab5a03176ee106d3f0fa90e381da478ddae405918153cca248e682cd0c4a2269)
set(BZIP2_HASH_TYPE SHA256)
set(BZIP2_FILE bzip2_${BZIP2_VERSION}.orig.tar.gz)
set(FFI_VERSION 3.3)
set(FFI_URI https://sourceware.org/pub/libffi/libffi-${FFI_VERSION}.tar.gz)
set(FFI_HASH 72fba7922703ddfa7a028d513ac15a85c8d54c8d67f55fa5a4802885dc652056)
set(FFI_HASH_TYPE SHA256)
set(FFI_FILE libffi-${FFI_VERSION}.tar.gz)
set(LZMA_VERSION 5.2.5)
set(LZMA_URI https://tukaani.org/xz/xz-${LZMA_VERSION}.tar.bz2)
set(LZMA_HASH 5117f930900b341493827d63aa910ff5e011e0b994197c3b71c08a20228a42df)
set(LZMA_HASH_TYPE SHA256)
set(LZMA_FILE xz-${LZMA_VERSION}.tar.bz2)
set(SSL_VERSION 1.1.1g)
set(SSL_URI https://www.openssl.org/source/openssl-${SSL_VERSION}.tar.gz)
set(SSL_HASH ddb04774f1e32f0c49751e21b67216ac87852ceb056b75209af2443400636d46)
if(BLENDER_PLATFORM_ARM)
# Need at least 1.1.1i for aarch64 support (https://github.com/openssl/openssl/pull/13218)
set(SSL_VERSION 1.1.1i)
set(SSL_URI https://www.openssl.org/source/openssl-${SSL_VERSION}.tar.gz)
set(SSL_HASH e8be6a35fe41d10603c3cc635e93289ed00bf34b79671a3a4de64fcee00d5242)
set(SSL_HASH_TYPE SHA256)
set(SSL_FILE openssl-${SSL_VERSION}.tar.gz)
else()
set(SSL_VERSION 1.1.1g)
set(SSL_URI https://www.openssl.org/source/openssl-${SSL_VERSION}.tar.gz)
set(SSL_HASH ddb04774f1e32f0c49751e21b67216ac87852ceb056b75209af2443400636d46)
set(SSL_HASH_TYPE SHA256)
set(SSL_FILE openssl-${SSL_VERSION}.tar.gz)
endif()
set(SQLITE_VERSION 3.31.1)
set(SQLITE_URI https://www.sqlite.org/2018/sqlite-src-3240000.zip)
set(SQLITE_HASH fb558c49ee21a837713c4f1e7e413309aabdd9c7)
set(SQLITE_HASH_TYPE SHA1)
set(SQLITE_FILE sqlite-src-3240000.zip)
set(EMBREE_VERSION 3.10.0)
set(EMBREE_URI https://github.com/embree/embree/archive/v${EMBREE_VERSION}.zip)
set(EMBREE_HASH 4bbe29e7eaa46417efc75fc5f1e8eb87)
set(EMBREE_HASH_TYPE MD5)
set(EMBREE_FILE embree-v${EMBREE_VERSION}.zip)
set(EMBREE_ARM_GIT https://github.com/brechtvl/embree.git)
set(USD_VERSION 20.05)
set(USD_VERSION 21.02)
set(USD_URI https://github.com/PixarAnimationStudios/USD/archive/v${USD_VERSION}.tar.gz)
set(USD_HASH 6d679e739e7f65725d9c029e37dda9fc)
set(USD_HASH 1dd1e2092d085ed393c1f7c450a4155a)
set(USD_HASH_TYPE MD5)
set(USD_FILE usd-v${USD_VERSION}.tar.gz)
set(OIDN_VERSION 1.2.3)
set(OIDN_VERSION 1.4.1)
set(OIDN_URI https://github.com/OpenImageDenoise/oidn/releases/download/v${OIDN_VERSION}/oidn-${OIDN_VERSION}.src.tar.gz)
set(OIDN_HASH 1f11466c2c3efc27faba5ec7078d12b2)
set(OIDN_HASH df4007b0ab93b1c41cdf223b075d01c0)
set(OIDN_HASH_TYPE MD5)
set(OIDN_FILE oidn-${OIDN_VERSION}.src.tar.gz)
set(LIBGLU_VERSION 9.0.1)
set(LIBGLU_URI ftp://ftp.freedesktop.org/pub/mesa/glu/glu-${LIBGLU_VERSION}.tar.xz)
set(LIBGLU_HASH 151aef599b8259efe9acd599c96ea2a3)
set(LIBGLU_HASH_TYPE MD5)
set(LIBGLU_FILE glu-${LIBGLU_VERSION}.tar.xz)
set(MESA_VERSION 18.3.1)
set(MESA_URI ftp://ftp.freedesktop.org/pub/mesa//mesa-${MESA_VERSION}.tar.xz)
set(MESA_HASH d60828056d77bfdbae0970f9b15fb1be)
set(MESA_VERSION 21.1.5)
set(MESA_URI ftp://ftp.freedesktop.org/pub/mesa/mesa-${MESA_VERSION}.tar.xz)
set(MESA_HASH 022c7293074aeeced2278c872db4fa693147c70f8595b076cf3f1ef81520766d)
set(MESA_HASH_TYPE SHA256)
set(MESA_FILE mesa-${MESA_VERSION}.tar.xz)
set(NASM_VERSION 2.15.02)
set(NASM_URI https://www.nasm.us/pub/nasm/releasebuilds/${NASM_VERSION}/nasm-${NASM_VERSION}.tar.xz)
set(NASM_HASH f4fd1329b1713e1ccd34b2fc121c4bcd278c9f91cc4cb205ae8fcd2e4728dd14)
set(NASM_URI https://github.com/netwide-assembler/nasm/archive/nasm-${NASM_VERSION}.tar.gz)
set(NASM_HASH aded8b796c996a486a56e0515c83e414116decc3b184d88043480b32eb0a8589)
set(NASM_HASH_TYPE SHA256)
set(NASM_FILE nasm-${NASM_VERSION}.tar.gz)
set(XR_OPENXR_SDK_VERSION 1.0.8)
set(XR_OPENXR_SDK_VERSION 1.0.17)
set(XR_OPENXR_SDK_URI https://github.com/KhronosGroup/OpenXR-SDK/archive/release-${XR_OPENXR_SDK_VERSION}.tar.gz)
set(XR_OPENXR_SDK_HASH c6de63d2e0f9029aa58dfa97cad8ce07)
set(XR_OPENXR_SDK_HASH bf0fd8828837edff01047474e90013e1)
set(XR_OPENXR_SDK_HASH_TYPE MD5)
set(XR_OPENXR_SDK_FILE OpenXR-SDK-${XR_OPENXR_SDK_VERSION}.tar.gz)
set(ISPC_VERSION v1.14.1)
set(WL_PROTOCOLS_VERSION 1.21)
set(WL_PROTOCOLS_FILE wayland-protocols-${WL_PROTOCOLS_VERSION}.tar.gz)
set(WL_PROTOCOLS_URI https://gitlab.freedesktop.org/wayland/wayland-protocols/-/archive/${WL_PROTOCOLS_VERSION}/${WL_PROTOCOLS_FILE})
set(WL_PROTOCOLS_HASH af5ca07e13517cdbab33504492cef54a)
set(WL_PROTOCOLS_HASH_TYPE MD5)
set(ISPC_VERSION v1.16.0)
set(ISPC_URI https://github.com/ispc/ispc/archive/${ISPC_VERSION}.tar.gz)
set(ISPC_HASH 968fbc8dfd16a60ba4e32d2e0e03ea7a)
set(ISPC_HASH 2e3abedbc0ea9aaec17d6562c632454d)
set(ISPC_HASH_TYPE MD5)
set(ISPC_FILE ispc-${ISPC_VERSION}.tar.gz)
set(GMP_VERSION 6.2.0)
set(GMP_URI https://gmplib.org/download/gmp/gmp-${GMP_VERSION}.tar.xz)
set(GMP_HASH a325e3f09e6d91e62101e59f9bda3ec1)
set(GMP_HASH_TYPE MD5)
set(GMP_FILE gmp-${GMP_VERSION}.tar.xz)
set(POTRACE_VERSION 1.16)
set(POTRACE_URI http://potrace.sourceforge.net/download/${POTRACE_VERSION}/potrace-${POTRACE_VERSION}.tar.gz)
set(POTRACE_HASH 5f0bd87ddd9a620b0c4e65652ef93d69)
set(POTRACE_HASH_TYPE MD5)
set(POTRACE_FILE potrace-${POTRACE_VERSION}.tar.gz)
set(HARU_VERSION 2_3_0)
set(HARU_URI https://github.com/libharu/libharu/archive/RELEASE_${HARU_VERSION}.tar.gz)
set(HARU_HASH 4f916aa49c3069b3a10850013c507460)
set(HARU_HASH_TYPE MD5)
set(HARU_FILE libharu-${HARU_VERSION}.tar.gz)
set(ZSTD_VERSION 1.5.0)
set(ZSTD_URI https://github.com/facebook/zstd/releases/download/v${ZSTD_VERSION}/zstd-${ZSTD_VERSION}.tar.gz)
set(ZSTD_HASH 5194fbfa781fcf45b98c5e849651aa7b3b0a008c6b72d4a0db760f3002291e94)
set(ZSTD_HASH_TYPE SHA256)
set(ZSTD_FILE zstd-${ZSTD_VERSION}.tar.gz)
set(SSE2NEON_GIT https://github.com/DLTcollab/sse2neon.git)
set(SSE2NEON_GIT_HASH fe5ff00bb8d19b327714a3c290f3e2ce81ba3525)

View File

@@ -17,9 +17,9 @@
# ***** END GPL LICENSE BLOCK *****
ExternalProject_Add(external_vorbis
URL ${VORBIS_URI}
URL file://${PACKAGE_DIR}/${VORBIS_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH SHA256=${VORBIS_HASH}
URL_HASH ${VORBIS_HASH_TYPE}=${VORBIS_HASH}
PREFIX ${BUILD_DIR}/vorbis
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/vorbis/src/external_vorbis/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/vorbis
--disable-shared

View File

@@ -35,9 +35,9 @@ else()
endif()
ExternalProject_Add(external_vpx
URL ${VPX_URI}
URL file://${PACKAGE_DIR}/${VPX_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH SHA256=${VPX_HASH}
URL_HASH ${VPX_HASH_TYPE}=${VPX_HASH}
PREFIX ${BUILD_DIR}/vpx
CONFIGURE_COMMAND ${CONFIGURE_ENV} &&
cd ${BUILD_DIR}/vpx/src/external_vpx/ &&

View File

@@ -16,16 +16,12 @@
#
# ***** END GPL LICENSE BLOCK *****
set(TINYXML_EXTRA_ARGS
)
ExternalProject_Add(external_tinyxml
URL ${TINYXML_URI}
ExternalProject_Add(external_wayland_protocols
URL file://${PACKAGE_DIR}/${WL_PROTOCOLS_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${TINYXML_HASH}
PREFIX ${BUILD_DIR}/tinyxml
# patch taken from ocio
PATCH_COMMAND ${PATCH_CMD} -p 1 -N -d ${BUILD_DIR}/tinyxml/src/external_tinyxml < ${PATCH_DIR}/tinyxml.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/tinyxml ${DEFAULT_CMAKE_FLAGS} ${TINYXML_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/tinyxml
URL_HASH ${WL_PROTOCOLS_HASH_TYPE}=${WL_PROTOCOLS_HASH}
PREFIX ${BUILD_DIR}/wayland-protocols
CONFIGURE_COMMAND meson --prefix ${LIBDIR}/wayland-protocols . ../external_wayland_protocols -Dtests=false
BUILD_COMMAND ninja
INSTALL_COMMAND ninja install
)

View File

@@ -32,9 +32,9 @@ else()
endif()
ExternalProject_Add(external_webp
URL ${WEBP_URI}
URL file://${PACKAGE_DIR}/${WEBP_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${WEBP_HASH}
URL_HASH ${WEBP_HASH_TYPE}=${WEBP_HASH}
PREFIX ${BUILD_DIR}/webp
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/webp -Wno-dev ${DEFAULT_CMAKE_FLAGS} ${WEBP_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/webp

View File

@@ -20,30 +20,22 @@ if(WIN32)
set(X264_EXTRA_ARGS --enable-win32thread --cross-prefix=${MINGW_HOST}- --host=${MINGW_HOST})
endif()
if(BLENDER_PLATFORM_ARM)
set(X264_EXTRA_ARGS ${X264_EXTRA_ARGS} "--disable-asm")
endif()
if(APPLE)
if("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "arm64")
set(X264_EXTRA_ARGS ${X264_EXTRA_ARGS} "--disable-asm")
set(X264_CONFIGURE_ENV echo .)
else()
set(X264_CONFIGURE_ENV
export AS=${LIBDIR}/nasm/bin/nasm
)
endif()
if((APPLE AND NOT BLENDER_PLATFORM_ARM) OR (UNIX AND NOT APPLE))
set(X264_CONFIGURE_ENV
export AS=${LIBDIR}/nasm/bin/nasm
)
else()
set(X264_CONFIGURE_ENV echo .)
endif()
if(UNIX AND NOT APPLE)
set(X264_CONFIGURE_ENV
export AS=${LIBDIR}/nasm/bin/nasm
)
endif()
ExternalProject_Add(external_x264
URL ${X264_URI}
URL file://${PACKAGE_DIR}/${X264_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH SHA256=${X264_HASH}
URL_HASH ${X264_HASH_TYPE}=${X264_HASH}
PREFIX ${BUILD_DIR}/x264
CONFIGURE_COMMAND ${CONFIGURE_ENV} && ${X264_CONFIGURE_ENV} && cd ${BUILD_DIR}/x264/src/external_x264/ &&
${CONFIGURE_COMMAND} --prefix=${LIBDIR}/x264

View File

@@ -17,9 +17,9 @@
# ***** END GPL LICENSE BLOCK *****
ExternalProject_Add(external_xml2
URL ${XML2_URI}
URL file://${PACKAGE_DIR}/${XML2_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${XML2_HASH}
URL_HASH ${XML2_HASH_TYPE}=${XML2_HASH}
PREFIX ${BUILD_DIR}/xml2
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/xml2/src/external_xml2/ && ${CONFIGURE_COMMAND}
--prefix=${LIBDIR}/xml2

View File

@@ -35,9 +35,9 @@ if(UNIX AND NOT APPLE)
endif()
ExternalProject_Add(external_xr_openxr_sdk
URL ${XR_OPENXR_SDK_URI}
URL file://${PACKAGE_DIR}/${XR_OPENXR_SDK_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${XR_OPENXR_SDK_HASH}
URL_HASH ${XR_OPENXR_SDK_HASH_TYPE}=${XR_OPENXR_SDK_HASH}
PREFIX ${BUILD_DIR}/xr_openxr_sdk
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/xr_openxr_sdk ${DEFAULT_CMAKE_FLAGS} ${XR_OPENXR_SDK_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/xr_openxr_sdk
@@ -53,7 +53,7 @@ if(WIN32)
endif()
if(BUILD_MODE STREQUAL Debug)
ExternalProject_Add_Step(external_xr_openxr_sdk after_install
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/xr_openxr_sdk/lib/openxr_loader.lib ${HARVEST_TARGET}/xr_openxr_sdk/lib/openxr_loader_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/xr_openxr_sdk/lib/openxr_loaderd.lib ${HARVEST_TARGET}/xr_openxr_sdk/lib/openxr_loaderd.lib
DEPENDEES install
)
endif()

View File

@@ -21,9 +21,9 @@ if(WIN32)
endif()
ExternalProject_Add(external_xvidcore
URL ${XVIDCORE_URI}
URL file://${PACKAGE_DIR}/${XVIDCORE_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH SHA256=${XVIDCORE_HASH}
URL_HASH ${XVIDCORE_HASH_TYPE}=${XVIDCORE_HASH}
PREFIX ${BUILD_DIR}/xvidcore
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/xvidcore/src/external_xvidcore/build/generic && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/xvidcore ${XVIDCORE_EXTRA_ARGS}
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/xvidcore/src/external_xvidcore/build/generic && make -j${MAKE_THREADS}

View File

@@ -17,17 +17,22 @@
# ***** END GPL LICENSE BLOCK *****
set(YAMLCPP_EXTRA_ARGS
-DBUILD_GMOCK=OFF
-DYAML_CPP_BUILD_TESTS=OFF
-DYAML_CPP_BUILD_TOOLS=OFF
-DYAML_CPP_BUILD_CONTRIB=OFF
-DYAML_MSVC_SHARED_RT=ON
)
if(WIN32)
set(YAMLCPP_EXTRA_ARGS
${YAMLCPP_EXTRA_ARGS}
-DBUILD_GMOCK=OFF
-DYAML_MSVC_SHARED_RT=ON)
endif()
ExternalProject_Add(external_yamlcpp
URL ${YAMLCPP_URI}
URL file://${PACKAGE_DIR}/${YAMLCPP_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${YAMLCPP_HASH}
URL_HASH ${YAMLCPP_HASH_TYPE}=${YAMLCPP_HASH}
PREFIX ${BUILD_DIR}/yamlcpp
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/yamlcpp ${DEFAULT_CMAKE_FLAGS} ${YAMLCPP_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/yamlcpp

View File

@@ -17,9 +17,8 @@
# ***** END GPL LICENSE BLOCK *****
ExternalProject_Add(external_zlib
URL ${ZLIB_URI}
URL_HASH MD5=${ZLIB_HASH}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL file://${PACKAGE_DIR}/${ZLIB_FILE}
URL_HASH ${ZLIB_HASH_TYPE}=${ZLIB_HASH}
PREFIX ${BUILD_DIR}/zlib
CMAKE_ARGS -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_INSTALL_PREFIX=${LIBDIR}/zlib ${DEFAULT_CMAKE_FLAGS}
INSTALL_DIR ${LIBDIR}/zlib

View File

@@ -17,8 +17,8 @@
# ***** END GPL LICENSE BLOCK *****
ExternalProject_Add(external_zlib_mingw
URL ${ZLIB_URI}
URL_HASH MD5=${ZLIB_HASH}
URL file://${PACKAGE_DIR}/${ZLIB_FILE}
URL_HASH ${ZLIB_HASH_TYPE}=${ZLIB_HASH}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
PREFIX ${BUILD_DIR}/zlib_mingw
CONFIGURE_COMMAND echo .

View File

@@ -0,0 +1,51 @@
# ***** 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.
#
# ***** END GPL LICENSE BLOCK *****
set(ZSTD_EXTRA_ARGS
-DZSTD_BUILD_PROGRAMS=OFF
-DZSTD_BUILD_SHARED=OFF
-DZSTD_BUILD_STATIC=ON
-DZSTD_BUILD_TESTS=OFF
-DZSTD_LEGACY_SUPPORT=OFF
-DZSTD_LZ4_SUPPORT=OFF
-DZSTD_LZMA_SUPPORT=OFF
-DZSTD_MULTITHREAD_SUPPORT=ON
-DZSTD_PROGRAMS_LINK_SHARED=OFF
-DZSTD_USE_STATIC_RUNTIME=OFF
-DZSTD_ZLIB_SUPPORT=OFF
)
ExternalProject_Add(external_zstd
URL file://${PACKAGE_DIR}/${ZSTD_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${ZSTD_HASH_TYPE}=${ZSTD_HASH}
PREFIX ${BUILD_DIR}/zstd
SOURCE_SUBDIR build/cmake
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/zstd ${DEFAULT_CMAKE_FLAGS} ${ZSTD_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/zstd
)
if(WIN32)
if(BUILD_MODE STREQUAL Release)
ExternalProject_Add_Step(external_zstd after_install
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/zstd/lib/zstd_static${LIBEXT} ${HARVEST_TARGET}/zstd/lib/zstd_static${LIBEXT}
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/zstd/include/ ${HARVEST_TARGET}/zstd/include/
DEPENDEES install
)
endif()
endif()

File diff suppressed because it is too large Load Diff

View File

@@ -20,7 +20,7 @@
# ILMBASE_LIBRARIES - list of libraries to link against when using IlmBase.
# ILMBASE_FOUND - True if IlmBase was found.
# Other standarnd issue macros
# Other standard issue macros
include(FindPackageHandleStandardArgs)
include(FindPackageMessage)
include(SelectLibraryConfigurations)

View File

@@ -22,7 +22,7 @@
# These are defined by the FindIlmBase module.
# OPENEXR_FOUND - True if OpenEXR was found.
# Other standarnd issue macros
# Other standard issue macros
include(SelectLibraryConfigurations)
include(FindPackageHandleStandardArgs)
include(FindPackageMessage)

View File

@@ -1,5 +1,32 @@
cmake_minimum_required (VERSION 2.8)
project(tbb CXX)
cmake_minimum_required(VERSION 3.1 FATAL_ERROR)
if (POLICY CMP0048)
# cmake warns if loaded from a min-3.0-required parent dir, so silence the warning:
cmake_policy(SET CMP0048 NEW)
endif()
project (tbb CXX)
include(CheckCXXCompilerFlag)
include(CheckCXXSourceRuns)
if(POLICY CMP0058)
cmake_policy(SET CMP0058 NEW)
endif()
if(POLICY CMP0068)
cmake_policy(SET CMP0068 NEW)
endif()
if (POLICY CMP0078)
# swig standard target names
cmake_policy(SET CMP0078 NEW)
endif ()
if (POLICY CMP0086)
# UseSWIG honors SWIG_MODULE_NAME via -module flag
cmake_policy(SET CMP0086 NEW)
endif ()
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to 'Release' as none was specified.")
@@ -8,18 +35,43 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
"MinSizeRel" "RelWithDebInfo")
endif()
include_directories(include src src/rml/include )
if(NOT TBB_INSTALL_RUNTIME_DIR)
set(TBB_INSTALL_RUNTIME_DIR bin)
endif()
if(NOT TBB_INSTALL_LIBRARY_DIR)
set(TBB_INSTALL_LIBRARY_DIR lib)
endif()
if(NOT TBB_INSTALL_ARCHIVE_DIR)
set(TBB_INSTALL_ARCHIVE_DIR lib)
endif()
if(NOT TBB_INSTALL_INCLUDE_DIR)
set(TBB_INSTALL_INCLUDE_DIR include)
endif()
if(NOT TBB_CMAKE_PACKAGE_INSTALL_DIR)
set(TBB_CMAKE_PACKAGE_INSTALL_DIR lib/cmake/tbb)
endif()
include_directories(include src src/rml/include ${CMAKE_CURRENT_BINARY_DIR})
option(TBB_BUILD_SHARED "Build TBB shared library" ON)
option(TBB_BUILD_STATIC "Build TBB static library" ON)
option(TBB_BUILD_TBBMALLOC "Build TBB malloc library" ON)
option(TBB_BUILD_TBBMALLOC_PROXY "Build TBB malloc proxy library" ON)
option(TBB_BUILD_TESTS "Build TBB tests and enable testing infrastructure" ON)
option(TBB_NO_DATE "Do not save the configure date in the version string" OFF)
option(TBB_BUILD_PYTHON "Build TBB Python bindings" OFF)
option(TBB_SET_SOVERSION "Set the SOVERSION (shared library build version suffix)?" OFF)
# When this repository is part of a larger build system of a parent project
# we may not want TBB to set up default installation targets
option(TBB_INSTALL_TARGETS "Include build targets for 'make install'" ON)
if(APPLE)
set(CMAKE_MACOSX_RPATH ON)
endif()
file(GLOB tbb_src "${CMAKE_CURRENT_SOURCE_DIR}/src/tbb/*.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/src/old/*.cpp")
list(REMOVE_ITEM tbb_src ${CMAKE_CURRENT_SOURCE_DIR}/src/tbb/tbb_bind.cpp)
list(APPEND tbb_src ${CMAKE_CURRENT_SOURCE_DIR}/src/rml/client/rml_tbb.cpp)
file(GLOB to_remove "${CMAKE_CURRENT_SOURCE_DIR}/src/old/test*.cpp")
list(REMOVE_ITEM tbb_src ${to_remove})
@@ -38,66 +90,143 @@ set(tbbmalloc_proxy_src
src/tbbmalloc/proxy.cpp
src/tbbmalloc/tbb_function_replacement.cpp)
if (NOT APPLE)
add_definitions(-DDO_ITT_NOTIFY)
else()
# Disable annoying "has no symbols" warnings
set(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> Scr <TARGET> <LINK_FLAGS> <OBJECTS>")
set(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> Scr <TARGET> <LINK_FLAGS> <OBJECTS>")
set(CMAKE_C_ARCHIVE_FINISH "<CMAKE_RANLIB> -no_warning_for_no_symbols -c <TARGET>")
set(CMAKE_CXX_ARCHIVE_FINISH "<CMAKE_RANLIB> -no_warning_for_no_symbols -c <TARGET>")
add_library (tbb_interface INTERFACE)
add_definitions(-DTBB_SUPPRESS_DEPRECATED_MESSAGES=1)
if (CMAKE_SYSTEM_PROCESSOR MATCHES "(i386|x86_64)")
if (NOT APPLE AND NOT MINGW)
target_compile_definitions(tbb_interface INTERFACE DO_ITT_NOTIFY)
endif()
endif()
if (APPLE)
# Disable annoying "has no symbols" warnings
set(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> Scr <TARGET> <LINK_FLAGS> <OBJECTS>")
set(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> Scr <TARGET> <LINK_FLAGS> <OBJECTS>")
set(CMAKE_C_ARCHIVE_FINISH "<CMAKE_RANLIB> -no_warning_for_no_symbols -c <TARGET>")
set(CMAKE_CXX_ARCHIVE_FINISH "<CMAKE_RANLIB> -no_warning_for_no_symbols -c <TARGET>")
endif()
macro(CHECK_CXX_COMPILER_AND_LINKER_FLAGS _RESULT _CXX_FLAGS _LINKER_FLAGS)
set(CMAKE_REQUIRED_FLAGS ${_CXX_FLAGS})
set(CMAKE_REQUIRED_LIBRARIES ${_LINKER_FLAGS})
set(CMAKE_REQUIRED_QUIET TRUE)
check_cxx_source_runs("#include <iostream>\nint main(int argc, char **argv) { std::cout << \"test\"; return 0; }" ${_RESULT})
set(CMAKE_REQUIRED_FLAGS "")
set(CMAKE_REQUIRED_LIBRARIES "")
endmacro()
# Prefer libc++ in conjunction with Clang
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
if (CMAKE_CXX_FLAGS MATCHES "-stdlib=libc\\+\\+")
message(STATUS "TBB: using libc++.")
else()
CHECK_CXX_COMPILER_AND_LINKER_FLAGS(HAS_LIBCPP "-stdlib=libc++" "-stdlib=libc++")
if (HAS_LIBCPP)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++ -D_LIBCPP_VERSION")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stdlib=libc++")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -stdlib=libc++")
message(STATUS "TBB: using libc++.")
else()
message(STATUS "TBB: NOT using libc++.")
endif()
endif()
endif()
set (CMAKE_CXX_STANDARD 11)
if (UNIX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -DUSE_PTHREAD")
if(NOT CMAKE_CXX_FLAGS MATCHES "-mno-rtm")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mrtm")
endif()
if (APPLE)
set(ARCH_PREFIX "mac")
else()
set(ARCH_PREFIX "lin")
endif()
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
set(ARCH_PREFIX "${ARCH_PREFIX}64")
else()
set(ARCH_PREFIX "${ARCH_PREFIX}32")
endif()
set(ENABLE_RTTI "-frtti -fexceptions ")
set(DISABLE_RTTI "-fno-rtti -fno-exceptions ")
elseif(WIN32)
cmake_minimum_required (VERSION 3.1)
enable_language(ASM_MASM)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /GS- /Zc:wchar_t /Zc:forScope /DUSE_WINTHREAD")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0600 /volatile:iso")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4267 /wd4800 /wd4146 /wd4244 /wd4018")
target_compile_definitions(tbb_interface INTERFACE USE_PTHREAD)
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
list(APPEND tbb_src src/tbb/intel64-masm/atomic_support.asm
src/tbb/intel64-masm/itsx.asm src/tbb/intel64-masm/intel64_misc.asm)
list(APPEND tbbmalloc_src src/tbb/intel64-masm/atomic_support.asm)
set(CMAKE_ASM_MASM_FLAGS "/DEM64T=1")
set(ARCH_PREFIX "win64")
else()
list(APPEND tbb_src src/tbb/ia32-masm/atomic_support.asm
src/tbb/ia32-masm/itsx.asm src/tbb/ia32-masm/lock_byte.asm)
list(APPEND tbbmalloc_src src/tbb/ia32-masm/atomic_support.asm)
set(ARCH_PREFIX "win32")
endif()
set(ENABLE_RTTI "/EHsc /GR ")
set(DISABLE_RTTI "/EHs- /GR- ")
check_cxx_compiler_flag ("-mrtm -Werror" SUPPORTS_MRTM)
if (SUPPORTS_MRTM)
target_compile_options(tbb_interface INTERFACE "-mrtm")
endif ()
elseif(WIN32)
target_compile_definitions(tbb_interface INTERFACE USE_WINTHREAD _WIN32_WINNT=0x0600)
if (MSVC)
enable_language(ASM_MASM)
target_compile_options(tbb_interface INTERFACE /GS- /Zc:wchar_t /Zc:forScope)
check_cxx_compiler_flag ("/volatile:iso" SUPPORTS_VOLATILE_FLAG)
if (SUPPORTS_VOLATILE_FLAG)
target_compile_options(tbb_interface INTERFACE /volatile:iso)
endif ()
target_compile_options(tbb_interface INTERFACE $<$<COMPILE_LANGUAGE:CXX>:/wd4267 /wd4800 /wd4146 /wd4244 /wd4577 /wd4018>)
if (NOT CMAKE_SIZEOF_VOID_P)
message(FATAL_ERROR "'CMAKE_SIZEOF_VOID_P' is undefined. Please delete your build directory and rerun CMake again!")
endif()
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
list(APPEND tbb_src src/tbb/intel64-masm/atomic_support.asm
src/tbb/intel64-masm/itsx.asm src/tbb/intel64-masm/intel64_misc.asm)
list(APPEND tbbmalloc_src src/tbb/intel64-masm/atomic_support.asm)
set(CMAKE_ASM_MASM_FLAGS "/DEM64T=1 ${CMAKE_ASM_MASM_FLAGS}")
else()
list(APPEND tbb_src src/tbb/ia32-masm/atomic_support.asm
src/tbb/ia32-masm/itsx.asm src/tbb/ia32-masm/lock_byte.asm)
# Enable SAFESEH feature for assembly (x86 builds only).
set(CMAKE_ASM_MASM_FLAGS "/safeseh ${CMAKE_ASM_MASM_FLAGS}")
endif()
elseif (MINGW)
target_compile_options(tbb_interface INTERFACE "-mthreads")
endif ()
endif()
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
include(CheckCXXCompilerFlag)
check_cxx_compiler_flag("-flifetime-dse=1" SUPPORTS_FLIFETIME)
if (SUPPORTS_FLIFETIME)
add_definitions(-flifetime-dse=1)
if (MSVC)
set(ENABLE_RTTI "/EHsc /GR ")
set(DISABLE_RTTI "/EHs- /GR- ")
elseif (UNIX)
set(ENABLE_RTTI "-frtti -fexceptions ")
set(DISABLE_RTTI "-fno-rtti -fno-exceptions ")
endif ()
##--------
# - Added TBB_USE_GLIBCXX_VERSION macro to specify the version of GNU
# libstdc++ when it cannot be properly recognized, e.g. when used
# with Clang on Linux* OS. Inspired by a contribution from David A.
if (NOT TBB_USE_GLIBCXX_VERSION AND UNIX AND NOT APPLE)
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
# using Clang
string(REPLACE "." "0" TBB_USE_GLIBCXX_VERSION ${CMAKE_CXX_COMPILER_VERSION})
endif()
endif()
if (TBB_USE_GLIBCXX_VERSION)
target_compile_definitions(tbb_interface INTERFACE TBB_USE_GLIBCXX_VERSION=${TBB_USE_GLIBCXX_VERSION})
endif()
##-------
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
check_cxx_compiler_flag ("-flifetime-dse=1" SUPPORTS_FLIFETIME)
if (SUPPORTS_FLIFETIME)
target_compile_options(tbb_interface INTERFACE -flifetime-dse=1)
endif()
endif()
# Linker export definitions
if (WIN32)
if (APPLE)
set (ARCH_PREFIX "mac")
elseif(WIN32)
set (ARCH_PREFIX "win")
else()
set (ARCH_PREFIX "lin")
endif()
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
set(ARCH_PREFIX "${ARCH_PREFIX}64")
else()
set(ARCH_PREFIX "${ARCH_PREFIX}32")
endif()
if (MINGW)
set (ARCH_PREFIX "${ARCH_PREFIX}-gcc")
# there's no win32-gcc-tbb-export.def, use lin32-tbb-export.def
execute_process (COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/src/tbb/lin32-tbb-export.def ${CMAKE_CURRENT_SOURCE_DIR}/src/tbb/win32-gcc-tbb-export.def)
endif()
if (MSVC)
add_custom_command(OUTPUT tbb.def
COMMAND ${CMAKE_CXX_COMPILER} /TC /EP ${CMAKE_CURRENT_SOURCE_DIR}/src/tbb/${ARCH_PREFIX}-tbb-export.def -I ${CMAKE_CURRENT_SOURCE_DIR}/include > tbb.def
MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/src/tbb/${ARCH_PREFIX}-tbb-export.def
@@ -109,18 +238,15 @@ if (WIN32)
MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/src/tbbmalloc/${ARCH_PREFIX}-tbbmalloc-export.def
COMMENT "Preprocessing tbbmalloc.def"
)
list(APPEND tbb_src ${CMAKE_CURRENT_SOURCE_DIR}/src/tbb/tbb_resource.rc)
list(APPEND tbbmalloc_src ${CMAKE_CURRENT_SOURCE_DIR}/src/tbbmalloc/tbbmalloc.rc)
list(APPEND tbbmalloc_proxy_src ${CMAKE_CURRENT_SOURCE_DIR}/src/tbbmalloc/tbbmalloc.rc)
else()
add_custom_command(OUTPUT tbb.def
COMMAND ${CMAKE_CXX_COMPILER} -xc++ -E ${CMAKE_CURRENT_SOURCE_DIR}/src/tbb/${ARCH_PREFIX}-tbb-export.def -I ${CMAKE_CURRENT_SOURCE_DIR}/include -o tbb.def
COMMAND ${CMAKE_CXX_COMPILER} -xc++ -std=c++11 -E ${CMAKE_CURRENT_SOURCE_DIR}/src/tbb/${ARCH_PREFIX}-tbb-export.def -I ${CMAKE_CURRENT_SOURCE_DIR}/include -o tbb.def
MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/src/tbb/${ARCH_PREFIX}-tbb-export.def
COMMENT "Preprocessing tbb.def"
)
add_custom_command(OUTPUT tbbmalloc.def
COMMAND ${CMAKE_CXX_COMPILER} -xc++ -E ${CMAKE_CURRENT_SOURCE_DIR}/src/tbbmalloc/${ARCH_PREFIX}-tbbmalloc-export.def -I ${CMAKE_CURRENT_SOURCE_DIR}/include -o tbbmalloc.def
COMMAND ${CMAKE_CXX_COMPILER} -xc++ -std=c++11 -E ${CMAKE_CURRENT_SOURCE_DIR}/src/tbbmalloc/${ARCH_PREFIX}-tbbmalloc-export.def -I ${CMAKE_CURRENT_SOURCE_DIR}/include -o tbbmalloc.def
MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/src/tbbmalloc/${ARCH_PREFIX}-tbbmalloc-export.def
COMMENT "Preprocessing tbbmalloc.def"
)
@@ -131,34 +257,80 @@ add_custom_target(tbb_def_files DEPENDS tbb.def tbbmalloc.def)
# TBB library
if (TBB_BUILD_STATIC)
add_library(tbb_static STATIC ${tbb_src})
set_property(TARGET tbb_static APPEND PROPERTY COMPILE_DEFINITIONS "__TBB_BUILD=1")
set_property(TARGET tbb_static APPEND PROPERTY COMPILE_DEFINITIONS "__TBB_SOURCE_DIRECTLY_INCLUDED=1")
target_link_libraries(tbb_static PRIVATE tbb_interface)
target_include_directories(tbb_static INTERFACE "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>" "$<INSTALL_INTERFACE:${TBB_INSTALL_INCLUDE_DIR}>")
set_property(TARGET tbb_static APPEND_STRING PROPERTY COMPILE_FLAGS ${ENABLE_RTTI})
install(TARGETS tbb_static ARCHIVE DESTINATION lib)
if (TBB_INSTALL_TARGETS)
install(TARGETS tbb_static ARCHIVE DESTINATION ${TBB_INSTALL_ARCHIVE_DIR})
endif()
target_compile_definitions(tbb_static
PRIVATE
-D__TBB_BUILD=1
-D__TBB_DYNAMIC_LOAD_ENABLED=0
-D__TBB_SOURCE_DIRECTLY_INCLUDED=1)
if (MSVC)
target_compile_definitions(tbb_static
PUBLIC -D__TBB_NO_IMPLICIT_LINKAGE=1
PRIVATE -D_CRT_SECURE_NO_WARNINGS)
endif()
if (UNIX AND NOT APPLE)
target_link_libraries(tbb_static PUBLIC pthread dl)
endif()
endif()
if (TBB_BUILD_SHARED)
add_library(tbb SHARED ${tbb_src})
set_property(TARGET tbb APPEND PROPERTY COMPILE_DEFINITIONS "__TBB_BUILD=1")
target_link_libraries(tbb PRIVATE tbb_interface)
target_include_directories(tbb INTERFACE "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>" "$<INSTALL_INTERFACE:${TBB_INSTALL_INCLUDE_DIR}>")
set_property(TARGET tbb APPEND_STRING PROPERTY COMPILE_FLAGS ${ENABLE_RTTI})
add_dependencies(tbb tbb_def_files)
if (APPLE)
set_property(TARGET tbb APPEND PROPERTY LINK_FLAGS "-Wl,-exported_symbols_list,${CMAKE_CURRENT_BINARY_DIR}/tbb.def")
elseif(UNIX)
set_property(TARGET tbb APPEND PROPERTY LINK_FLAGS "-Wl,-version-script,${CMAKE_CURRENT_BINARY_DIR}/tbb.def")
elseif(WIN32)
set_property(TARGET tbb APPEND PROPERTY LINK_FLAGS "/DEF:${CMAKE_CURRENT_BINARY_DIR}/tbb.def")
if (TBB_SET_SOVERSION)
set_property(TARGET tbb PROPERTY SOVERSION 2)
endif ()
target_compile_definitions(tbb
PRIVATE -D__TBB_BUILD=1)
if (MSVC)
target_compile_definitions(tbb
PUBLIC -D__TBB_NO_IMPLICIT_LINKAGE=1
PRIVATE -D_CRT_SECURE_NO_WARNINGS)
endif()
install(TARGETS tbb DESTINATION lib)
if(WIN32)
set_target_properties(tbb PROPERTIES OUTPUT_NAME "tbb$<$<CONFIG:Debug>:_debug>")
add_dependencies(tbb tbb_def_files)
if (APPLE)
set_property(TARGET tbb APPEND PROPERTY LINK_FLAGS "-Wl,-exported_symbols_list,\"${CMAKE_CURRENT_BINARY_DIR}/tbb.def\"")
elseif (MSVC)
set_property(TARGET tbb APPEND PROPERTY LINK_FLAGS "/DEF:\"${CMAKE_CURRENT_BINARY_DIR}/tbb.def\"")
else ()
set_property(TARGET tbb APPEND PROPERTY LINK_FLAGS "-Wl,-version-script,\"${CMAKE_CURRENT_BINARY_DIR}/tbb.def\"")
endif()
if (TBB_INSTALL_TARGETS)
install(TARGETS tbb EXPORT TBB
LIBRARY DESTINATION ${TBB_INSTALL_LIBRARY_DIR}
ARCHIVE DESTINATION ${TBB_INSTALL_ARCHIVE_DIR}
RUNTIME DESTINATION ${TBB_INSTALL_RUNTIME_DIR})
if (MSVC)
install(FILES $<TARGET_PDB_FILE:tbb> DESTINATION ${TBB_INSTALL_RUNTIME_DIR} OPTIONAL)
endif()
endif()
if (UNIX AND NOT APPLE)
target_link_libraries(tbb PUBLIC pthread dl)
endif()
endif()
if(CMAKE_COMPILER_IS_GNUCC)
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
# Quench a warning on GCC
set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/src/tbb/governor.cpp COMPILE_FLAGS "-Wno-missing-field-initializers ")
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
# Quench a warning on Clang
set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/src/tbb/itt_notify.cpp COMPILE_FLAGS "-Wno-varargs ")
elseif(MSVC)
# Quench a warning on MSVC
set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/src/tbb/scheduler.cpp COMPILE_FLAGS "/wd4458 ")
@@ -168,24 +340,50 @@ if(TBB_BUILD_TBBMALLOC)
# TBB malloc library
if (TBB_BUILD_STATIC)
add_library(tbbmalloc_static STATIC ${tbbmalloc_static_src})
target_link_libraries(tbbmalloc_static PRIVATE tbb_interface)
set_property(TARGET tbbmalloc_static APPEND PROPERTY COMPILE_DEFINITIONS "__TBBMALLOC_BUILD=1")
set_property(TARGET tbbmalloc_static APPEND PROPERTY COMPILE_DEFINITIONS "__TBB_DYNAMIC_LOAD_ENABLED=0")
set_property(TARGET tbbmalloc_static APPEND PROPERTY COMPILE_DEFINITIONS "__TBB_SOURCE_DIRECTLY_INCLUDED=1")
set_property(TARGET tbbmalloc_static APPEND_STRING PROPERTY COMPILE_FLAGS ${DISABLE_RTTI})
install(TARGETS tbbmalloc_static ARCHIVE DESTINATION lib)
if (MSVC)
target_compile_definitions(tbbmalloc_static PUBLIC __TBB_NO_IMPLICIT_LINKAGE=1 __TBBMALLOC_NO_IMPLICIT_LINKAGE=1)
endif()
if (TBB_INSTALL_TARGETS)
install(TARGETS tbbmalloc_static ARCHIVE DESTINATION ${TBB_INSTALL_ARCHIVE_DIR})
endif()
endif()
if (TBB_BUILD_SHARED)
add_library(tbbmalloc SHARED ${tbbmalloc_src})
target_link_libraries(tbbmalloc PRIVATE tbb_interface)
set_property(TARGET tbbmalloc APPEND PROPERTY COMPILE_DEFINITIONS "__TBBMALLOC_BUILD=1")
set_property(TARGET tbbmalloc APPEND_STRING PROPERTY COMPILE_FLAGS ${DISABLE_RTTI})
if (TBB_SET_SOVERSION)
set_property(TARGET tbbmalloc PROPERTY SOVERSION 2)
endif ()
add_dependencies(tbbmalloc tbb_def_files)
if (APPLE)
set_property(TARGET tbbmalloc APPEND PROPERTY LINK_FLAGS "-Wl,-exported_symbols_list,${CMAKE_CURRENT_BINARY_DIR}/tbbmalloc.def")
elseif(UNIX)
set_property(TARGET tbbmalloc APPEND PROPERTY LINK_FLAGS "-Wl,-version-script,${CMAKE_CURRENT_BINARY_DIR}/tbbmalloc.def")
elseif(WIN32)
set_property(TARGET tbbmalloc APPEND PROPERTY LINK_FLAGS "/DEF:${CMAKE_CURRENT_BINARY_DIR}/tbbmalloc.def")
set_property(TARGET tbbmalloc APPEND PROPERTY LINK_FLAGS "-Wl,-exported_symbols_list,\"${CMAKE_CURRENT_BINARY_DIR}/tbbmalloc.def\"")
elseif (MSVC)
set_property(TARGET tbbmalloc APPEND PROPERTY LINK_FLAGS "/DEF:\"${CMAKE_CURRENT_BINARY_DIR}/tbbmalloc.def\"")
else ()
set_property(TARGET tbbmalloc APPEND PROPERTY LINK_FLAGS "-Wl,-version-script,\"${CMAKE_CURRENT_BINARY_DIR}/tbbmalloc.def\"")
endif()
if (MSVC)
target_compile_definitions(tbbmalloc PUBLIC __TBB_NO_IMPLICIT_LINKAGE=1 __TBBMALLOC_NO_IMPLICIT_LINKAGE=1)
endif()
if (TBB_INSTALL_TARGETS)
install(TARGETS tbbmalloc EXPORT TBB
LIBRARY DESTINATION ${TBB_INSTALL_LIBRARY_DIR}
ARCHIVE DESTINATION ${TBB_INSTALL_ARCHIVE_DIR}
RUNTIME DESTINATION ${TBB_INSTALL_RUNTIME_DIR})
if (MSVC)
install(FILES $<TARGET_PDB_FILE:tbbmalloc> DESTINATION ${TBB_INSTALL_RUNTIME_DIR} OPTIONAL)
endif()
endif()
if (UNIX AND NOT APPLE)
target_link_libraries(tbbmalloc PUBLIC pthread dl)
endif()
install(TARGETS tbbmalloc DESTINATION lib)
endif()
endif()
@@ -193,19 +391,298 @@ if(TBB_BUILD_TBBMALLOC_PROXY)
# TBB malloc proxy library
if (TBB_BUILD_STATIC)
add_library(tbbmalloc_proxy_static STATIC ${tbbmalloc_proxy_src})
target_link_libraries(tbbmalloc_proxy_static PRIVATE tbb_interface)
set_property(TARGET tbbmalloc_proxy_static APPEND PROPERTY COMPILE_DEFINITIONS "__TBBMALLOC_BUILD=1")
set_property(TARGET tbbmalloc_proxy_static APPEND PROPERTY COMPILE_DEFINITIONS "__TBB_DYNAMIC_LOAD_ENABLED=0")
set_property(TARGET tbbmalloc_proxy_static APPEND PROPERTY COMPILE_DEFINITIONS "__TBB_SOURCE_DIRECTLY_INCLUDED=1")
set_property(TARGET tbbmalloc_proxy_static APPEND_STRING PROPERTY COMPILE_FLAGS ${DISABLE_RTTI})
link_libraries(tbbmalloc_proxy_static tbbmalloc)
install(TARGETS tbbmalloc_proxy_static ARCHIVE DESTINATION lib)
if (TBB_INSTALL_TARGETS)
install(TARGETS tbbmalloc_proxy_static ARCHIVE DESTINATION ${TBB_INSTALL_ARCHIVE_DIR})
endif()
endif()
if (TBB_BUILD_SHARED)
add_library(tbbmalloc_proxy SHARED ${tbbmalloc_proxy_src})
target_link_libraries(tbbmalloc_proxy PRIVATE tbb_interface)
set_property(TARGET tbbmalloc_proxy APPEND PROPERTY COMPILE_DEFINITIONS "__TBBMALLOC_BUILD=1")
set_property(TARGET tbbmalloc_proxy APPEND_STRING PROPERTY COMPILE_FLAGS ${DISABLE_RTTI})
target_link_libraries(tbbmalloc_proxy tbbmalloc)
install(TARGETS tbbmalloc_proxy DESTINATION lib)
if (TBB_SET_SOVERSION)
set_property(TARGET tbbmalloc_proxy PROPERTY SOVERSION 2)
endif ()
target_link_libraries(tbbmalloc_proxy PUBLIC tbbmalloc)
if (TBB_INSTALL_TARGETS)
install(TARGETS tbbmalloc_proxy EXPORT TBB
LIBRARY DESTINATION ${TBB_INSTALL_LIBRARY_DIR}
ARCHIVE DESTINATION ${TBB_INSTALL_ARCHIVE_DIR}
RUNTIME DESTINATION ${TBB_INSTALL_RUNTIME_DIR})
if (MSVC)
install(FILES $<TARGET_PDB_FILE:tbbmalloc_proxy> DESTINATION ${TBB_INSTALL_RUNTIME_DIR} OPTIONAL)
endif()
endif()
if (UNIX AND NOT APPLE)
target_link_libraries(tbbmalloc_proxy PUBLIC pthread dl)
endif()
endif()
endif()
install(DIRECTORY include/tbb DESTINATION include)
if (TBB_INSTALL_TARGETS)
install(DIRECTORY include/tbb DESTINATION ${TBB_INSTALL_INCLUDE_DIR})
if (TBB_BUILD_SHARED)
install(EXPORT TBB DESTINATION ${TBB_CMAKE_PACKAGE_INSTALL_DIR} NAMESPACE TBB:: FILE TBBConfig.cmake)
endif()
endif()
# version file
if (TBB_INSTALL_TARGETS)
set (_VERSION_FILE ${CMAKE_CURRENT_SOURCE_DIR}/include/tbb/tbb_stddef.h)
file (STRINGS ${_VERSION_FILE} _VERSION_MAJOR_STRING REGEX ".*define[ ]+TBB_VERSION_MAJOR[ ]+[0-9]+.*")
file (STRINGS ${_VERSION_FILE} _VERSION_MINOR_STRING REGEX ".*define[ ]+TBB_VERSION_MINOR[ ]+[0-9]+.*")
string (REGEX REPLACE ".*TBB_VERSION_MAJOR[ ]+([0-9]+)" "\\1" TBB_MAJOR_VERSION ${_VERSION_MAJOR_STRING})
string (REGEX REPLACE ".*TBB_VERSION_MINOR[ ]+([0-9]+)" "\\1" TBB_MINOR_VERSION ${_VERSION_MINOR_STRING})
set (TBB_VERSION_STRING "${TBB_MAJOR_VERSION}.${TBB_MINOR_VERSION}")
include (CMakePackageConfigHelpers)
write_basic_package_version_file (TBBConfigVersion.cmake VERSION "${TBB_VERSION_STRING}" COMPATIBILITY AnyNewerVersion)
install (FILES ${CMAKE_CURRENT_BINARY_DIR}/TBBConfigVersion.cmake DESTINATION "${TBB_CMAKE_PACKAGE_INSTALL_DIR}")
endif()
# version_string.ver
if (UNIX AND NOT TBB_NO_DATE)
execute_process (COMMAND date "+%a, %d %b %Y %H:%M:%S %z"
OUTPUT_VARIABLE _configure_date
OUTPUT_STRIP_TRAILING_WHITESPACE)
elseif (WIN32 AND NOT TBB_NO_DATE)
execute_process (COMMAND cmd " /C date /T"
OUTPUT_VARIABLE _configure_date
OUTPUT_STRIP_TRAILING_WHITESPACE)
else ()
set (_configure_date "Unknown")
endif()
set (TBB_CONFIG_DATE "${_configure_date}" CACHE STRING "First time that TBB was configured")
set (_configure_date "${TBB_CONFIG_DATE}")
include_directories (${CMAKE_BINARY_DIR})
configure_file (build/version_string.ver.in version_string.ver @ONLY)
if (TBB_BUILD_TESTS)
enable_language (C)
enable_testing ()
find_library (LIBRT_LIBRARIES rt)
find_library (LIDL_LIBRARIES dl)
find_package (Threads)
if (NOT APPLE)
find_package (OpenMP)
endif()
macro (tbb_add_test testname)
set (full_testname tbb_test_${testname})
add_executable (${full_testname} src/test/test_${testname}.cpp)
target_link_libraries(${full_testname} PRIVATE tbb_interface)
if (TBB_BUILD_SHARED)
target_link_libraries (${full_testname} PRIVATE tbb tbbmalloc)
target_compile_definitions (${full_testname} PRIVATE __TBB_LIB_NAME=tbb)
else ()
target_link_libraries (${full_testname} PRIVATE tbb_static tbbmalloc_static)
target_compile_definitions (${full_testname} PRIVATE __TBB_LIB_NAME=tbb_static)
endif ()
if (LIBRT_LIBRARIES)
target_link_libraries (${full_testname} PRIVATE ${LIBRT_LIBRARIES})
endif ()
if (LIDL_LIBRARIES)
target_link_libraries (${full_testname} PRIVATE ${LIDL_LIBRARIES})
endif ()
if (Threads_FOUND)
target_link_libraries (${full_testname} PRIVATE ${CMAKE_THREAD_LIBS_INIT})
endif ()
if (OPENMP_FOUND AND "${testname}" MATCHES "openmp")
set_target_properties (${full_testname} PROPERTIES COMPILE_FLAGS "${OpenMP_CXX_FLAGS}")
set_target_properties (${full_testname} PROPERTIES LINK_FLAGS "${OpenMP_CXX_FLAGS}")
endif()
if (MINGW)
target_link_libraries (${full_testname} PRIVATE psapi)
endif ()
add_test (NAME ${full_testname} COMMAND ${full_testname})
endmacro ()
tbb_add_test (aggregator)
tbb_add_test (aligned_space)
tbb_add_test (assembly)
if (NOT WIN32)
tbb_add_test (async_msg) # msvc64/debug timeouts
endif()
tbb_add_test (async_node)
# tbb_add_test (atomic) # msvc64/debug timeouts: Compile-time initialization fails for static tbb::atomic variables
tbb_add_test (blocked_range2d)
tbb_add_test (blocked_range3d)
tbb_add_test (blocked_range)
tbb_add_test (broadcast_node)
tbb_add_test (buffer_node)
tbb_add_test (cache_aligned_allocator)
if (NOT WIN32)
tbb_add_test (cache_aligned_allocator_STL)
endif()
tbb_add_test (cilk_dynamic_load)
tbb_add_test (cilk_interop)
tbb_add_test (combinable)
tbb_add_test (composite_node)
tbb_add_test (concurrent_hash_map)
tbb_add_test (concurrent_lru_cache)
# tbb_add_test (concurrent_monitor) # too long
# tbb_add_test (concurrent_priority_queue)
if (NOT WIN32)
tbb_add_test (concurrent_queue) # msvc64/debug timeouts
endif()
# tbb_add_test (concurrent_queue_whitebox)
tbb_add_test (concurrent_unordered_map)
# tbb_add_test (concurrent_unordered_set)
tbb_add_test (concurrent_vector)
tbb_add_test (continue_node)
tbb_add_test (critical_section)
tbb_add_test (dynamic_link)
# tbb_add_test (eh_algorithms)
tbb_add_test (eh_flow_graph)
# tbb_add_test (eh_tasks)
tbb_add_test (enumerable_thread_specific)
tbb_add_test (examples_common_utility)
# tbb_add_test (fast_random)
tbb_add_test (flow_graph)
tbb_add_test (flow_graph_whitebox)
# tbb_add_test (fp) # mingw: harness_fp.h:66, assertion !checkConsistency || (ctl.mxcsr & SSE_RND_MODE_MASK) >> 3 == (ctl.x87cw & FE_RND_MODE_MASK): failed
# tbb_add_test (function_node) # mingw:random timeout
# tbb_add_test (global_control)
# tbb_add_test (global_control_whitebox)
tbb_add_test (halt)
tbb_add_test (handle_perror)
# tbb_add_test (hw_concurrency)
tbb_add_test (indexer_node)
tbb_add_test (inits_loop)
tbb_add_test (intrusive_list)
tbb_add_test (ittnotify)
# tbb_add_test (join_node) #msvc/64: fatal error C1128: number of sections exceeded object file format limit: compile with /bigob
tbb_add_test (lambda)
tbb_add_test (limiter_node)
# tbb_add_test (malloc_atexit)
# tbb_add_test (malloc_compliance) #mingw: Limits should be decreased for the test to work
tbb_add_test (malloc_init_shutdown)
# tbb_add_test (malloc_lib_unload)
# tbb_add_test (malloc_overload)
tbb_add_test (malloc_pools)
tbb_add_test (malloc_regression)
# tbb_add_test (malloc_used_by_lib)
# tbb_add_test (malloc_whitebox)
tbb_add_test (model_plugin)
# tbb_add_test (multifunction_node) # too long
tbb_add_test (mutex)
tbb_add_test (mutex_native_threads)
# tbb_add_test (opencl_node)
if (OPENMP_FOUND)
tbb_add_test (openmp)
endif ()
tbb_add_test (overwrite_node)
# tbb_add_test (parallel_do)
# This seems to fail on CI platforms (AppVeyor/Travis), perhaps because the VM exposes just 1 core?
tbb_add_test (parallel_for)
tbb_add_test (parallel_for_each)
tbb_add_test (parallel_for_vectorization)
tbb_add_test (parallel_invoke)
tbb_add_test (parallel_pipeline)
tbb_add_test (parallel_reduce)
tbb_add_test (parallel_scan)
tbb_add_test (parallel_sort)
tbb_add_test (parallel_while)
# tbb_add_test (partitioner_whitebox) # too long
tbb_add_test (pipeline)
# tbb_add_test (pipeline_with_tbf) # takes forever on appveyor
tbb_add_test (priority_queue_node)
tbb_add_test (queue_node)
tbb_add_test (reader_writer_lock)
# tbb_add_test (runtime_loader) # LINK : fatal error LNK1104: cannot open file 'tbbproxy.lib' [C:\projects\tbb\test_runtime_loader.vcxproj]
tbb_add_test (rwm_upgrade_downgrade)
# tbb_add_test (ScalableAllocator)
if (NOT WIN32)
tbb_add_test (ScalableAllocator_STL)
endif()
tbb_add_test (semaphore)
# tbb_add_test (sequencer_node) # msvc: timeout
tbb_add_test (source_node)
tbb_add_test (split_node)
tbb_add_test (static_assert)
tbb_add_test (std_thread)
tbb_add_test (tagged_msg)
# tbb_add_test (task_arena) # LINK : fatal error LNK1104: cannot open file '__TBB_LIB_NAME.lib' [C:\projects\tbb\test_task_arena.vcxproj]
# tbb_add_test (task_assertions)
tbb_add_test (task_auto_init)
tbb_add_test (task)
# tbb_add_test (task_enqueue) # too long
tbb_add_test (task_group)
# tbb_add_test (task_leaks)
# tbb_add_test (task_priority)
# tbb_add_test (task_scheduler_init) # msvc: test_task_scheduler_init.cpp:68, assertion !test_mandatory_parallelism || Harness::CanReachConcurrencyLevel(threads): failed
tbb_add_test (task_scheduler_observer)
tbb_add_test (task_steal_limit)
tbb_add_test (tbb_condition_variable)
tbb_add_test (tbb_fork)
# tbb_add_test (tbb_header)
tbb_add_test (tbb_thread)
# tbb_add_test (tbb_version)
tbb_add_test (tick_count)
tbb_add_test (tuple)
tbb_add_test (write_once_node)
tbb_add_test (yield)
endif ()
if (TBB_BUILD_PYTHON)
find_package(PythonInterp)
find_package(PythonLibs ${PYTHON_VERSION_STRING} EXACT)
find_package(SWIG 3)
if (PythonLibs_FOUND AND SWIG_FOUND AND TBB_BUILD_SHARED)
include (${SWIG_USE_FILE})
set_source_files_properties (python/tbb/api.i PROPERTIES CPLUSPLUS ON)
set (CMAKE_SWIG_FLAGS "-threads")
# swig_add_module is deprecated
if (CMAKE_VERSION VERSION_LESS 3.8)
swig_add_module (api python python/tbb/api.i)
else ()
swig_add_library (api LANGUAGE python SOURCES python/tbb/api.i)
endif ()
# UseSWIG generates now standard target names
if (CMAKE_VERSION VERSION_LESS 3.13)
set (module_target ${SWIG_MODULE_api_REAL_NAME})
else ()
set (module_target api)
endif ()
target_include_directories(${module_target} PRIVATE ${PYTHON_INCLUDE_DIRS})
target_link_libraries(${module_target} PRIVATE tbb)
if(WIN32)
target_link_libraries(${module_target} ${PYTHON_LIBRARIES})
elseif(APPLE)
set_target_properties(${module_target} PROPERTIES LINK_FLAGS "-undefined dynamic_lookup")
endif()
if (WIN32)
set (PYTHON_SITE_PACKAGES Lib/site-packages)
else ()
set (PYTHON_SITE_PACKAGES lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages)
endif ()
if (TBB_INSTALL_TARGETS)
install(FILES python/TBB.py
DESTINATION ${PYTHON_SITE_PACKAGES})
install(FILES python/tbb/__init__.py python/tbb/pool.py python/tbb/test.py python/tbb/__main__.py ${CMAKE_CURRENT_BINARY_DIR}/api.py
DESTINATION ${PYTHON_SITE_PACKAGES}/tbb)
install(TARGETS ${module_target}
DESTINATION ${PYTHON_SITE_PACKAGES}/tbb)
endif()
if(UNIX AND NOT APPLE)
add_library(irml SHARED python/rml/ipc_server.cpp python/rml/ipc_utils.cpp src/tbb/cache_aligned_allocator.cpp src/tbb/dynamic_link.cpp src/tbb/tbb_misc_ex.cpp src/tbb/tbb_misc.cpp)
target_compile_definitions(irml PRIVATE DO_ITT_NOTIFY=0 USE_PTHREAD=1)
target_link_libraries(irml PRIVATE tbb)
set_target_properties(irml PROPERTIES VERSION 1)
if (TBB_INSTALL_TARGETS)
install(TARGETS irml DESTINATION ${TBB_INSTALL_LIBRARY_DIR})
endif()
endif ()
endif ()
endif ()

View File

@@ -68,3 +68,32 @@
+
return ret;
}
--- a/libavcodec/rl.c
+++ b/libavcodec/rl.c
@@ -71,7 +71,7 @@ av_cold void ff_rl_init(RLTable *rl,
av_cold void ff_rl_init_vlc(RLTable *rl, unsigned static_size)
{
int i, q;
- VLC_TYPE table[1500][2] = {{0}};
+ VLC_TYPE (*table)[2] = av_calloc(sizeof(VLC_TYPE), 1500 * 2);
VLC vlc = { .table = table, .table_allocated = static_size };
av_assert0(static_size <= FF_ARRAY_ELEMS(table));
init_vlc(&vlc, 9, rl->n + 1, &rl->table_vlc[0][1], 4, 2, &rl->table_vlc[0][0], 4, 2, INIT_VLC_USE_NEW_STATIC);
@@ -80,8 +80,10 @@ av_cold void ff_rl_init_vlc(RLTable *rl, unsigned static_size)
int qmul = q * 2;
int qadd = (q - 1) | 1;
- if (!rl->rl_vlc[q])
+ if (!rl->rl_vlc[q]){
+ av_free(table);
return;
+ }
if (q == 0) {
qmul = 1;
@@ -113,4 +115,5 @@ av_cold void ff_rl_init_vlc(RLTable *rl, unsigned static_size)
rl->rl_vlc[q][i].run = run;
}
}
+ av_free(table);
}

View File

@@ -0,0 +1,12 @@
diff --git a/src/hpdf_image_ccitt.c b/src/hpdf_image_ccitt.c
index 8672763..9be531a 100644
--- a/src/hpdf_image_ccitt.c
+++ b/src/hpdf_image_ccitt.c
@@ -21,7 +21,6 @@
#include <memory.h>
#include <assert.h>
-#define G3CODES
#include "t4.h"
typedef unsigned int uint32;

View File

@@ -1,5 +1,5 @@
--- a/lib/Support/Unix/Path.inc 2020-02-17 09:24:26.000000000 +0100
+++ b/lib/Support/Unix/Path.inc 2020-02-17 09:26:25.000000000 +0100
--- a/llvm/lib/Support/Unix/Path.inc 2020-02-17 09:24:26.000000000 +0100
+++ b/llvm/lib/Support/Unix/Path.inc 2020-02-17 09:26:25.000000000 +0100
@@ -1200,7 +1200,9 @@
/// implementation.
std::error_code copy_file(const Twine &From, const Twine &To) {

View File

@@ -1,33 +1,16 @@
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index 1eb691b..cff9bd8 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -23,8 +23,6 @@ if(WIN32)
if("${CMAKE_BUILD_TYPE}" STREQUAL "Release")
set(EXTERNAL_COMPILE_FLAGS "${EXTERNAL_COMPILE_FLAGS} /WX")
endif()
-else()
- set(EXTERNAL_COMPILE_FLAGS "${EXTERNAL_COMPILE_FLAGS} -Werror")
endif()
# SHARED
--- a/CMakeLists.txt 2018-09-10 22:15:29.000000000 +0200
+++ b/CMakeLists.txt 2018-09-10 22:17:40.000000000 +0200
@@ -229,7 +229,7 @@
PATCH_COMMAND ${GIT_EXECUTABLE} apply --ignore-whitespace ${TINYXML_PATCHFILE}
BINARY_DIR ext/build/tinyxml
INSTALL_DIR ext/dist
- CMAKE_ARGS ${TINYXML_CMAKE_ARGS}
+ CMAKE_ARGS ${TINYXML_CMAKE_ARGS} -DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES} -DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET} -DCMAKE_OSX_SYSROOT=${CMAKE_OSX_SYSROOT} -DCMAKE_C_FLAGS_DEBUG=${CMAKE_C_FLAGS_DEBUG} -DCMAKE_C_FLAGS_RELEASE=${CMAKE_C_FLAGS_RELEASE} -DCMAKE_CXX_FLAGS_DEBUG=${CMAKE_CXX_FLAGS_DEBUG} -DCMAKE_CXX_FLAGS_RELEASE=${CMAKE_CXX_FLAGS_RELEASE} -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
diff --git a/share/cmake/modules/Findpystring.cmake b/share/cmake/modules/Findpystring.cmake
index 7b894a45..92618215 100644
--- a/share/cmake/modules/Findpystring.cmake
+++ b/share/cmake/modules/Findpystring.cmake
@@ -113,6 +113,11 @@ if(NOT pystring_FOUND)
-DCMAKE_INSTALL_MESSAGE=${CMAKE_INSTALL_MESSAGE}
-DCMAKE_INSTALL_PREFIX=${_EXT_DIST_ROOT}
-DCMAKE_OBJECT_PATH_MAX=${CMAKE_OBJECT_PATH_MAX}
+ -DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES}
+ -DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET}
+ -DCMAKE_OSX_SYSROOT=${CMAKE_OSX_SYSROOT}
+ -DCMAKE_CXX_FLAGS_DEBUG=${CMAKE_CXX_FLAGS_DEBUG}
+ -DCMAKE_CXX_FLAGS_RELEASE=${CMAKE_CXX_FLAGS_RELEASE}
)
if(WIN32)
set(TINYXML_STATIC_LIBRARIES ${PROJECT_BINARY_DIR}/ext/dist/lib/tinyxml.lib)
@@ -343,7 +343,7 @@
PATCH_COMMAND ${GIT_EXECUTABLE} apply --ignore-whitespace ${YAML_CPP_PATCHFILE}
BINARY_DIR ext/build/yaml-cpp
INSTALL_DIR ext/dist
- CMAKE_ARGS ${YAML_CPP_CMAKE_ARGS}
+ CMAKE_ARGS ${YAML_CPP_CMAKE_ARGS} -DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES} -DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET} -DCMAKE_OSX_SYSROOT=${CMAKE_OSX_SYSROOT} -DCMAKE_C_FLAGS_DEBUG=${CMAKE_C_FLAGS_DEBUG} -DCMAKE_C_FLAGS_RELEASE=${CMAKE_C_FLAGS_RELEASE} -DCMAKE_CXX_FLAGS_DEBUG=${CMAKE_CXX_FLAGS_DEBUG} -DCMAKE_CXX_FLAGS_RELEASE=${CMAKE_CXX_FLAGS_RELEASE} -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
)
set(YAML_CPP_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ext/dist/include)
set(YAML_CPP_LIBRARY_DIRS ${PROJECT_BINARY_DIR}/ext/dist/lib)
if(CMAKE_TOOLCHAIN_FILE)
set(pystring_CMAKE_ARGS

View File

@@ -1,51 +0,0 @@
diff -Naur external_opencolorio/CMakeLists.txt external_opencolorio.patched/CMakeLists.txt
--- external_opencolorio/CMakeLists.txt 2018-01-04 18:38:27 -0700
+++ external_opencolorio.patched/CMakeLists.txt 2018-08-15 11:46:53 -0600
@@ -251,25 +251,30 @@
if(USE_EXTERNAL_YAML)
# Set minimum yaml version for non-patched sources.
set(YAML_VERSION_MIN "0.3.0")
- include(FindPkgConfig)
- pkg_check_modules(PC_YAML_CPP REQUIRED QUIET yaml-cpp)
- find_path(YAML_CPP_INCLUDE_DIR yaml-cpp/yaml.h
- HINTS ${PC_YAML_CPP_INCLUDEDIR} ${PC_YAML_CPP_INCLUDE_DIRS} )
- find_library(YAML_CPP_LIBRARY LIBRARY_NAMES yaml-cpp libyaml-cpp
- HINTS ${PC_YAML_CPP_LIBRARY_DIRS} )
- set(YAML_CPP_LIBRARIES ${YAML_CPP_LIBRARY})
- set(YAML_CPP_INCLUDE_DIRS ${YAML_CPP_INCLUDE_DIR})
- set(YAML_CPP_VERSION ${PC_YAML_CPP_VERSION})
+ if(NOT WIN32)
+ include(FindPkgConfig)
+ pkg_check_modules(PC_YAML_CPP REQUIRED QUIET yaml-cpp)
+ find_path(YAML_CPP_INCLUDE_DIR yaml-cpp/yaml.h
+ HINTS ${PC_YAML_CPP_INCLUDEDIR} ${PC_YAML_CPP_INCLUDE_DIRS} )
+ find_library(YAML_CPP_LIBRARY LIBRARY_NAMES yaml-cpp libyaml-cpp
+ HINTS ${PC_YAML_CPP_LIBRARY_DIRS} )
+ set(YAML_CPP_LIBRARIES ${YAML_CPP_LIBRARY})
+ set(YAML_CPP_INCLUDE_DIRS ${YAML_CPP_INCLUDE_DIR})
+ set(YAML_CPP_VERSION ${PC_YAML_CPP_VERSION})
- if(YAML_CPP_VERSION VERSION_LESS ${YAML_VERSION_MIN})
- message(FATAL_ERROR "ERROR: yaml-cpp ${YAML_VERSION_MIN} or greater is required.")
- endif()
-
- find_package_handle_standard_args(yaml-cpp
- REQUIRED_VARS YAML_CPP_LIBRARIES YAML_CPP_INCLUDE_DIRS )
- set(YAML_CPP_FOUND ${YAML-CPP_FOUND})
- mark_as_advanced(YAML_CPP_INCLUDE_DIR YAML_CPP_LIBRARY YAML-CPP_FOUND)
+ if(YAML_CPP_VERSION VERSION_LESS ${YAML_VERSION_MIN})
+ message(FATAL_ERROR "ERROR: yaml-cpp ${YAML_VERSION_MIN} or greater is required.")
+ endif()
+ find_package_handle_standard_args(yaml-cpp
+ REQUIRED_VARS YAML_CPP_LIBRARIES YAML_CPP_INCLUDE_DIRS )
+ set(YAML_CPP_FOUND ${YAML-CPP_FOUND})
+ mark_as_advanced(YAML_CPP_INCLUDE_DIR YAML_CPP_LIBRARY YAML-CPP_FOUND)
+ else()
+ set(EXTERNAL_INCLUDE_DIRS ${EXTERNAL_INCLUDE_DIRS} ${INC_1})
+ set(EXTERNAL_INCLUDE_DIRS ${EXTERNAL_INCLUDE_DIRS} ${INC_2})
+ message("INCLUDE DIRS = i:${EXTERNAL_INCLUDE_DIRS} |1:${INC_1} |2:${INC_2}")
+ endif()
if(YAML_CPP_FOUND)
if(YAML_CPP_VERSION VERSION_GREATER "0.5.0")
# Need to also get the boost headers here, as yaml-cpp 0.5.0+ requires them.

View File

@@ -1,10 +1,10 @@
diff -Naur orig/cmake/FindIlmBase.cmake openvdb/cmake/FindIlmBase.cmake
--- orig/cmake/FindIlmBase.cmake 2019-12-06 12:11:33 -0700
+++ openvdb/cmake/FindIlmBase.cmake 2020-08-12 12:48:44 -0600
@@ -225,6 +225,12 @@
list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES
"-${IlmBase_VERSION_MAJOR}_${IlmBase_VERSION_MINOR}.lib"
)
diff -Naur openvdb-8.0.0/cmake/FindIlmBase.cmake openvdb/cmake/FindIlmBase.cmake
--- openvdb-8.0.0/cmake/FindIlmBase.cmake 2020-12-24 10:13:14 -0700
+++ openvdb/cmake/FindIlmBase.cmake 2021-02-05 12:07:49 -0700
@@ -217,6 +217,12 @@
set(CMAKE_FIND_LIBRARY_SUFFIXES ".lib")
endif()
list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES "${_IlmBase_Version_Suffix}.lib")
+ list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES
+ "_s.lib"
+ )
@@ -13,14 +13,14 @@ diff -Naur orig/cmake/FindIlmBase.cmake openvdb/cmake/FindIlmBase.cmake
+ )
else()
if(ILMBASE_USE_STATIC_LIBS)
list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES
diff -Naur orig/cmake/FindOpenEXR.cmake openvdb/cmake/FindOpenEXR.cmake
--- orig/cmake/FindOpenEXR.cmake 2019-12-06 12:11:33 -0700
+++ openvdb/cmake/FindOpenEXR.cmake 2020-08-12 12:48:44 -0600
@@ -218,6 +218,12 @@
list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES
"-${OpenEXR_VERSION_MAJOR}_${OpenEXR_VERSION_MINOR}.lib"
)
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
diff -Naur openvdb-8.0.0/cmake/FindOpenEXR.cmake openvdb/cmake/FindOpenEXR.cmake
--- openvdb-8.0.0/cmake/FindOpenEXR.cmake 2020-12-24 10:13:14 -0700
+++ openvdb/cmake/FindOpenEXR.cmake 2021-02-05 12:23:39 -0700
@@ -210,6 +210,12 @@
set(CMAKE_FIND_LIBRARY_SUFFIXES ".lib")
endif()
list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES "${_OpenEXR_Version_Suffix}.lib")
+ list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES
+ "_s.lib"
+ )
@@ -29,11 +29,11 @@ diff -Naur orig/cmake/FindOpenEXR.cmake openvdb/cmake/FindOpenEXR.cmake
+ )
else()
if(OPENEXR_USE_STATIC_LIBS)
list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES
diff -Naur orig/openvdb/CMakeLists.txt openvdb/openvdb/CMakeLists.txt
--- orig/openvdb/CMakeLists.txt 2019-12-06 12:11:33 -0700
+++ openvdb/openvdb/CMakeLists.txt 2020-08-12 14:12:26 -0600
@@ -105,7 +105,9 @@
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
diff -Naur openvdb-8.0.0/openvdb/openvdb/CMakeLists.txt openvdb/openvdb/openvdb/CMakeLists.txt
--- openvdb-8.0.0/openvdb/openvdb/CMakeLists.txt 2020-12-24 10:13:14 -0700
+++ openvdb/openvdb/openvdb/CMakeLists.txt 2021-02-05 11:18:33 -0700
@@ -107,7 +107,9 @@
# http://boost.2283326.n4.nabble.com/CMake-config-scripts-broken-in-1-70-td4708957.html
# https://github.com/boostorg/boost_install/commit/160c7cb2b2c720e74463865ef0454d4c4cd9ae7c
set(BUILD_SHARED_LIBS ON)
@@ -44,15 +44,15 @@ diff -Naur orig/openvdb/CMakeLists.txt openvdb/openvdb/CMakeLists.txt
endif()
find_package(Boost ${MINIMUM_BOOST_VERSION} REQUIRED COMPONENTS iostreams system)
@@ -193,6 +195,7 @@
if(OPENVDB_DISABLE_BOOST_IMPLICIT_LINKING)
add_definitions(-DBOOST_ALL_NO_LIB)
@@ -146,6 +148,7 @@
Boost::disable_autolinking # add -DBOOST_ALL_NO_LIB
)
endif()
+ add_definitions(-D__TBB_NO_IMPLICIT_LINKAGE -DOPENVDB_OPENEXR_STATICLIB)
endif()
# @todo Should be target definitions
@@ -383,7 +386,12 @@
if(USE_EXR)
@@ -379,7 +382,12 @@
# imported targets.
if(OPENVDB_CORE_SHARED)
@@ -66,9 +66,9 @@ diff -Naur orig/openvdb/CMakeLists.txt openvdb/openvdb/CMakeLists.txt
endif()
if(OPENVDB_CORE_STATIC)
diff -Naur orig/openvdb/version.rc.in openvdb/openvdb/version.rc.in
--- orig/openvdb/version.rc.in 1969-12-31 17:00:00 -0700
+++ openvdb/openvdb/version.rc.in 2020-08-12 14:15:01 -0600
diff -Naur openvdb-8.0.0/openvdb/openvdb/version.rc.in openvdb/openvdb/openvdb/version.rc.in
--- openvdb-8.0.0/openvdb/openvdb/version.rc.in 1969-12-31 17:00:00 -0700
+++ openvdb/openvdb/openvdb/version.rc.in 2021-02-05 11:18:33 -0700
@@ -0,0 +1,48 @@
+#include <winver.h>
+

View File

@@ -1,135 +0,0 @@
diff -Naur orig/cmake/FindIlmBase.cmake openvdb/cmake/FindIlmBase.cmake
--- orig/cmake/FindIlmBase.cmake 2019-12-06 12:11:33 -0700
+++ openvdb/cmake/FindIlmBase.cmake 2020-08-12 12:48:44 -0600
@@ -217,6 +217,8 @@
set(CMAKE_FIND_LIBRARY_SUFFIXES ".lib")
endif()
list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES "${_IlmBase_Version_Suffix}.lib")
+ list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES "_s.lib")
+ list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES "_s_d.lib")
else()
if(ILMBASE_USE_STATIC_LIBS)
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
diff -Naur orig/cmake/FindOpenEXR.cmake openvdb/cmake/FindOpenEXR.cmake
--- orig/cmake/FindOpenEXR.cmake 2019-12-06 12:11:33 -0700
+++ openvdb/cmake/FindOpenEXR.cmake 2020-08-12 12:48:44 -0600
@@ -210,6 +210,8 @@
set(CMAKE_FIND_LIBRARY_SUFFIXES ".lib")
endif()
list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES "${_OpenEXR_Version_Suffix}.lib")
+ list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES "_s.lib")
+ list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES "_s_d.lib")
else()
if(OPENEXR_USE_STATIC_LIBS)
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
diff -Naur orig/openvdb/openvdb/CMakeLists.txt openvdb/openvdb/openvdb/CMakeLists.txt
--- orig/openvdb/openvdb/CMakeLists.txt 2019-12-06 12:11:33 -0700
+++ openvdb/openvdb/openvdb/CMakeLists.txt 2020-08-12 14:12:26 -0600
@@ -105,7 +105,9 @@
# http://boost.2283326.n4.nabble.com/CMake-config-scripts-broken-in-1-70-td4708957.html
# https://github.com/boostorg/boost_install/commit/160c7cb2b2c720e74463865ef0454d4c4cd9ae7c
set(BUILD_SHARED_LIBS ON)
- set(Boost_USE_STATIC_LIBS OFF)
+ if(NOT WIN32) # blender links boost statically on windows
+ set(Boost_USE_STATIC_LIBS OFF)
+ endif()
endif()
find_package(Boost ${MINIMUM_BOOST_VERSION} REQUIRED COMPONENTS iostreams system)
@@ -193,6 +195,7 @@
if(OPENVDB_DISABLE_BOOST_IMPLICIT_LINKING)
add_definitions(-DBOOST_ALL_NO_LIB)
endif()
+ add_definitions(-D__TBB_NO_IMPLICIT_LINKAGE -DOPENVDB_OPENEXR_STATICLIB)
endif()
# @todo Should be target definitions
@@ -383,7 +386,12 @@
# imported targets.
if(OPENVDB_CORE_SHARED)
- add_library(openvdb_shared SHARED ${OPENVDB_LIBRARY_SOURCE_FILES})
+ if(WIN32)
+ configure_file(version.rc.in ${CMAKE_CURRENT_BINARY_DIR}/version.rc @ONLY)
+ add_library(openvdb_shared SHARED ${OPENVDB_LIBRARY_SOURCE_FILES} ${CMAKE_CURRENT_BINARY_DIR}/version.rc)
+ else()
+ add_library(openvdb_shared SHARED ${OPENVDB_LIBRARY_SOURCE_FILES})
+ endif()
endif()
if(OPENVDB_CORE_STATIC)
diff -Naur orig/openvdb/openvdb/version.rc.in openvdb/openvdb/openvdb/version.rc.in
--- orig/openvdb/openvdb/version.rc.in 1969-12-31 17:00:00 -0700
+++ openvdb/openvdb/openvdb/version.rc.in 2020-08-12 14:15:01 -0600
@@ -0,0 +1,48 @@
+#include <winver.h>
+
+#define VER_FILEVERSION @OpenVDB_MAJOR_VERSION@,@OpenVDB_MINOR_VERSION@,@OpenVDB_PATCH_VERSION@,0
+#define VER_FILEVERSION_STR "@OpenVDB_MAJOR_VERSION@.@OpenVDB_MINOR_VERSION@.@OpenVDB_PATCH_VERSION@.0\0"
+
+#define VER_PRODUCTVERSION @OpenVDB_MAJOR_VERSION@,@OpenVDB_MINOR_VERSION@,@OpenVDB_PATCH_VERSION@,0
+#define VER_PRODUCTVERSION_STR "@OpenVDB_MAJOR_VERSION@.@OpenVDB_MINOR_VERSION@\0"
+
+#ifndef DEBUG
+#define VER_DEBUG 0
+#else
+#define VER_DEBUG VS_FF_DEBUG
+#endif
+
+VS_VERSION_INFO VERSIONINFO
+FILEVERSION VER_FILEVERSION
+PRODUCTVERSION VER_PRODUCTVERSION
+FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
+FILEFLAGS (VER_DEBUG)
+FILEOS VOS__WINDOWS32
+FILETYPE VFT_DLL
+FILESUBTYPE VFT2_UNKNOWN
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904E4"
+ BEGIN
+ VALUE "FileDescription", "OpenVDB"
+ VALUE "FileVersion", VER_FILEVERSION_STR
+ VALUE "InternalName", "OpenVDB"
+ VALUE "ProductName", "OpenVDB"
+ VALUE "ProductVersion", VER_PRODUCTVERSION_STR
+ END
+ END
+
+ BLOCK "VarFileInfo"
+ BEGIN
+ /* The following line should only be modified for localized versions. */
+ /* It consists of any number of WORD,WORD pairs, with each pair */
+ /* describing a language,codepage combination supported by the file. */
+ /* */
+ /* For example, a file might have values "0x409,1252" indicating that it */
+ /* supports English language (0x409) in the Windows ANSI codepage (1252). */
+
+ VALUE "Translation", 0x409, 1252
+
+ END
+END
diff -Naur openvdb-original/CMakeLists.txt openvdb/CMakeLists.txt
--- openvdb-original/CMakeLists.txt 2020-08-27 03:34:02.000000000 +0200
+++ openvdb/CMakeLists.txt 2020-09-02 10:56:21.665735244 +0200
@@ -68,6 +68,7 @@
option(OPENVDB_INSTALL_HOUDINI_PYTHONRC [=[Install a Houdini startup script that sets
the visibilty of OpenVDB nodes and their native equivalents.]=] OFF)
option(OPENVDB_BUILD_MAYA_PLUGIN "Build the Maya plugin" OFF)
+option(OPENVDB_BUILD_NANOVDB "Build nanovdb" ON)
option(OPENVDB_ENABLE_RPATH "Build with RPATH information" ON)
option(OPENVDB_CXX_STRICT "Enable or disable pre-defined compiler warnings" OFF)
option(OPENVDB_CODE_COVERAGE "Enable code coverage. This also overrides CMAKE_BUILD_TYPE to Debug" OFF)
@@ -740,6 +741,10 @@
add_subdirectory(openvdb_maya)
endif()
+if(OPENVDB_BUILD_NANOVDB)
+ add_subdirectory(nanovdb)
+endif()
+
##########################################################################
add_custom_target(uninstall

View File

@@ -1,18 +1,3 @@
diff -Naur OpenShadingLanguage-Release-1.9.9/src/cmake/flexbison.cmake.rej external_osl/src/cmake/flexbison.cmake.rej
--- OpenShadingLanguage-Release-1.9.9/src/cmake/flexbison.cmake.rej 1969-12-31 17:00:00 -0700
+++ external_osl/src/cmake/flexbison.cmake.rej 2018-08-24 17:42:11 -0600
@@ -0,0 +1,11 @@
+--- src/cmake/flexbison.cmake 2018-05-01 16:39:02 -0600
++++ src/cmake/flexbison.cmake 2018-08-24 10:24:03 -0600
+@@ -77,7 +77,7 @@
+ DEPENDS ${${compiler_headers}}
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} )
+ ADD_CUSTOM_COMMAND ( OUTPUT ${flexoutputcxx}
+- COMMAND ${FLEX_EXECUTABLE} -o ${flexoutputcxx} "${CMAKE_CURRENT_SOURCE_DIR}/${flexsrc}"
++ COMMAND ${FLEX_EXECUTABLE} ${FLEX_EXTRA_OPTIONS} -o ${flexoutputcxx} "${CMAKE_CURRENT_SOURCE_DIR}/${flexsrc}"
+ MAIN_DEPENDENCY ${flexsrc}
+ DEPENDS ${${compiler_headers}}
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} )
diff -Naur OpenShadingLanguage-Release-1.9.9/src/include/OSL/llvm_util.h external_osl/src/include/OSL/llvm_util.h
--- OpenShadingLanguage-Release-1.9.9/src/include/OSL/llvm_util.h 2018-05-01 16:39:02 -0600
+++ external_osl/src/include/OSL/llvm_util.h 2018-08-25 14:05:00 -0600
@@ -43,27 +28,70 @@ diff -Naur OpenShadingLanguage-Release-1.9.9/src/liboslexec/llvm_util.cpp extern
-
+void LLVM_Util::Cleanup ()
+{
+ jitmm_hold.clear();
+ if(jitmm_hold) jitmm_hold->clear();
+}
size_t
LLVM_Util::total_jit_memory_held ()
diff -Naur OpenShadingLanguage-Release-1.9.9/CMakeLists.txt external_osl/CMakeLists.txt
--- orig/CMakeLists.txt 2020-01-27 16:22:31 -0700
+++ external_osl/CMakeLists.txt 2020-05-13 18:04:52 -0600
@@ -102,10 +102,11 @@
set (OPTIX_EXTRA_LIBS CACHE STRING "Extra lib targets needed for OptiX")
set (CUDA_TARGET_ARCH "sm_35" CACHE STRING "CUDA GPU architecture (e.g. sm_35)")
-# set (USE_OIIO_STATIC ON CACHE BOOL "If OIIO is built static")
-# if (USE_OIIO_STATIC)
-# add_definitions ("-DOIIO_STATIC_BUILD=1")
-# endif ()
diff -Naur org/CMakeLists.txt external_osl/CMakeLists.txt
--- org/CMakeLists.txt 2020-12-01 12:37:15 -0700
+++ external_osl/CMakeLists.txt 2021-01-20 13:26:50 -0700
@@ -84,6 +84,11 @@
CACHE STRING "Directory where OptiX PTX files will be installed")
set (CMAKE_DEBUG_POSTFIX "" CACHE STRING "Library naming postfix for Debug builds (e.g., '_debug')")
+set (USE_OIIO_STATIC ON CACHE BOOL "If OIIO is built static")
+if (USE_OIIO_STATIC)
+ add_definitions ("-DOIIO_STATIC_BUILD=1")
+ add_definitions ("-DOIIO_STATIC_DEFINE=1")
+endif ()
set (OSL_NO_DEFAULT_TEXTURESYSTEM OFF CACHE BOOL "Do not use create a raw OIIO::TextureSystem")
if (OSL_NO_DEFAULT_TEXTURESYSTEM)
if (OSL_NO_DEFAULT_TEXTURESYSTEM)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 990f50d69..46ef7351d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -252,11 +252,9 @@ install (EXPORT OSL_EXPORTED_TARGETS
FILE ${OSL_TARGETS_EXPORT_NAME}
NAMESPACE ${PROJECT_NAME}::)
-
-
-
-osl_add_all_tests()
-
+if (${PROJECT_NAME}_BUILD_TESTS AND NOT ${PROJECT_NAME}_IS_SUBPROJECT)
+ osl_add_all_tests()
+endif ()
if (NOT ${PROJECT_NAME}_IS_SUBPROJECT)
include (packaging)
diff -Naur external_osl_orig/src/cmake/externalpackages.cmake external_osl/src/cmake/externalpackages.cmake
--- external_osl_orig/src/cmake/externalpackages.cmake 2021-06-01 13:44:18 -0600
+++ external_osl/src/cmake/externalpackages.cmake 2021-06-28 07:44:32 -0600
@@ -80,6 +80,7 @@
checked_find_package (ZLIB REQUIRED) # Needed by several packages
+checked_find_package (PNG REQUIRED) # Needed since OIIO needs it
# IlmBase & OpenEXR
checked_find_package (OpenEXR REQUIRED
diff -Naur external_osl_orig/src/liboslcomp/oslcomp.cpp external_osl/src/liboslcomp/oslcomp.cpp
--- external_osl_orig/src/liboslcomp/oslcomp.cpp 2021-06-01 13:44:18 -0600
+++ external_osl/src/liboslcomp/oslcomp.cpp 2021-06-28 09:11:06 -0600
@@ -21,6 +21,13 @@
#if !defined(__STDC_CONSTANT_MACROS)
# define __STDC_CONSTANT_MACROS 1
#endif
+
+// clang uses CALLBACK in its templates which causes issues if it is already defined
+#ifdef _WIN32 && defined(CALLBACK)
+# undef CALLBACK
+#endif
+
+//
#include <clang/Basic/TargetInfo.h>
#include <clang/Frontend/CompilerInstance.h>
#include <clang/Frontend/TextDiagnosticPrinter.h>

View File

@@ -1,289 +0,0 @@
diff -ru a/Doc/library/ctypes.rst b/Doc/library/ctypes.rst
--- a/Doc/library/ctypes.rst 2020-03-10 07:11:12.000000000 +0100
+++ b/Doc/library/ctypes.rst 2020-07-14 08:10:10.000000000 +0200
@@ -1551,6 +1551,13 @@
value usable as argument (integer, string, ctypes instance). This allows
defining adapters that can adapt custom objects as function parameters.
+ .. attribute:: variadic
+
+ Assign a boolean to specify that the function takes a variable number of
+ arguments. This does not matter on most platforms, but for Apple arm64
+ platforms variadic functions have a different calling convention than
+ normal functions.
+
.. attribute:: errcheck
Assign a Python function or another callable to this attribute. The
diff -ru a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c
--- a/Modules/_ctypes/_ctypes.c 2020-03-10 07:11:12.000000000 +0100
+++ b/Modules/_ctypes/_ctypes.c 2020-07-14 08:14:41.000000000 +0200
@@ -3175,6 +3175,35 @@
}
static int
+PyCFuncPtr_set_variadic(PyCFuncPtrObject *self, PyObject *ob, void *Py_UNUSED(ignored))
+{
+ StgDictObject *dict = PyObject_stgdict((PyObject *)self);
+ assert(dict);
+ int r = PyObject_IsTrue(ob);
+ if (r == 1) {
+ dict->flags |= FUNCFLAG_VARIADIC;
+ return 0;
+ } else if (r == 0) {
+ dict->flags &= ~FUNCFLAG_VARIADIC;
+ return 0;
+ } else {
+ return -1;
+ }
+}
+
+static PyObject *
+PyCFuncPtr_get_variadic(PyCFuncPtrObject *self, void *Py_UNUSED(ignored))
+{
+ StgDictObject *dict = PyObject_stgdict((PyObject *)self);
+ assert(dict); /* Cannot be NULL for PyCFuncPtrObject instances */
+ if (dict->flags & FUNCFLAG_VARIADIC)
+ Py_RETURN_TRUE;
+ else
+ Py_RETURN_FALSE;
+}
+
+
+static int
PyCFuncPtr_set_argtypes(PyCFuncPtrObject *self, PyObject *ob, void *Py_UNUSED(ignored))
{
PyObject *converters;
@@ -5632,6 +5661,7 @@
PyModule_AddObject(m, "FUNCFLAG_USE_ERRNO", PyLong_FromLong(FUNCFLAG_USE_ERRNO));
PyModule_AddObject(m, "FUNCFLAG_USE_LASTERROR", PyLong_FromLong(FUNCFLAG_USE_LASTERROR));
PyModule_AddObject(m, "FUNCFLAG_PYTHONAPI", PyLong_FromLong(FUNCFLAG_PYTHONAPI));
+ PyModule_AddObject(m, "FUNCFLAG_VARIADIC", PyLong_FromLong(FUNCFLAG_VARIADIC));
PyModule_AddStringConstant(m, "__version__", "1.1.0");
PyModule_AddObject(m, "_memmove_addr", PyLong_FromVoidPtr(memmove));
diff -ru a/Modules/_ctypes/callproc.c b/Modules/_ctypes/callproc.c
--- a/Modules/_ctypes/callproc.c 2020-03-10 07:11:12.000000000 +0100
+++ b/Modules/_ctypes/callproc.c 2020-07-14 08:18:33.000000000 +0200
@@ -767,7 +767,8 @@
ffi_type **atypes,
ffi_type *restype,
void *resmem,
- int argcount)
+ int argcount,
+ int argtypecount)
{
PyThreadState *_save = NULL; /* For Py_BLOCK_THREADS and Py_UNBLOCK_THREADS */
PyObject *error_object = NULL;
@@ -793,15 +794,38 @@
if ((flags & FUNCFLAG_CDECL) == 0)
cc = FFI_STDCALL;
#endif
- if (FFI_OK != ffi_prep_cif(&cif,
- cc,
- argcount,
- restype,
- atypes)) {
- PyErr_SetString(PyExc_RuntimeError,
- "ffi_prep_cif failed");
- return -1;
- }
+#if HAVE_FFI_PREP_CIF_VAR
+ /* Everyone SHOULD set f.variadic=True on variadic function pointers, but
+ * lots of existing code will not. If there's at least one arg and more
+ * args are passed than are defined in the prototype, then it must be a
+ * variadic function. */
+ if ((flags & FUNCFLAG_VARIADIC) ||
+ (argtypecount != 0 && argcount > argtypecount))
+ {
+ if (FFI_OK != ffi_prep_cif_var(&cif,
+ cc,
+ argtypecount,
+ argcount,
+ restype,
+ atypes)) {
+ PyErr_SetString(PyExc_RuntimeError,
+ "ffi_prep_cif_var failed");
+ return -1;
+ }
+ } else {
+#endif
+ if (FFI_OK != ffi_prep_cif(&cif,
+ cc,
+ argcount,
+ restype,
+ atypes)) {
+ PyErr_SetString(PyExc_RuntimeError,
+ "ffi_prep_cif failed");
+ return -1;
+ }
+#if HAVE_FFI_PREP_CIF_VAR
+ }
+#endif
if (flags & (FUNCFLAG_USE_ERRNO | FUNCFLAG_USE_LASTERROR)) {
error_object = _ctypes_get_errobj(&space);
@@ -1185,9 +1209,8 @@
if (-1 == _call_function_pointer(flags, pProc, avalues, atypes,
rtype, resbuf,
- Py_SAFE_DOWNCAST(argcount,
- Py_ssize_t,
- int)))
+ Py_SAFE_DOWNCAST(argcount, Py_ssize_t, int),
+ Py_SAFE_DOWNCAST(argtype_count, Py_ssize_t, int)))
goto cleanup;
#ifdef WORDS_BIGENDIAN
diff -ru a/Modules/_ctypes/ctypes.h b/Modules/_ctypes/ctypes.h
--- a/Modules/_ctypes/ctypes.h 2020-03-10 07:11:12.000000000 +0100
+++ b/Modules/_ctypes/ctypes.h 2020-07-14 08:30:53.000000000 +0200
@@ -285,6 +285,7 @@
#define FUNCFLAG_PYTHONAPI 0x4
#define FUNCFLAG_USE_ERRNO 0x8
#define FUNCFLAG_USE_LASTERROR 0x10
+#define FUNCFLAG_VARIADIC 0x20
#define TYPEFLAG_ISPOINTER 0x100
#define TYPEFLAG_HASPOINTER 0x200
diff -ru a/configure b/configure
--- a/configure 2020-03-10 07:11:12.000000000 +0100
+++ b/configure 2020-07-14 08:03:27.000000000 +0200
@@ -3374,7 +3374,7 @@
# has no effect, don't bother defining them
Darwin/[6789].*)
define_xopen_source=no;;
- Darwin/1[0-9].*)
+ Darwin/[12][0-9].*)
define_xopen_source=no;;
# On AIX 4 and 5.1, mbstate_t is defined only when _XOPEN_SOURCE == 500 but
# used in wcsnrtombs() and mbsnrtowcs() even if _XOPEN_SOURCE is not defined
@@ -9251,6 +9251,9 @@
ppc)
MACOSX_DEFAULT_ARCH="ppc64"
;;
+ arm64)
+ MACOSX_DEFAULT_ARCH="arm64"
+ ;;
*)
as_fn_error $? "Unexpected output of 'arch' on OSX" "$LINENO" 5
;;
diff -ru a/configure.ac b/configure.ac
--- a/configure.ac 2020-03-10 07:11:12.000000000 +0100
+++ b/configure.ac 2020-07-14 08:03:27.000000000 +0200
@@ -2456,6 +2456,9 @@
ppc)
MACOSX_DEFAULT_ARCH="ppc64"
;;
+ arm64)
+ MACOSX_DEFAULT_ARCH="arm64"
+ ;;
*)
AC_MSG_ERROR([Unexpected output of 'arch' on OSX])
;;
diff -ru a/setup.py b/setup.py
--- a/setup.py 2020-03-10 07:11:12.000000000 +0100
+++ b/setup.py 2020-07-14 08:28:12.000000000 +0200
@@ -141,6 +141,13 @@
os.unlink(tmpfile)
return MACOS_SDK_ROOT
+
+def is_macosx_at_least(vers):
+ if host_platform == 'darwin':
+ dep_target = sysconfig.get_config_var('MACOSX_DEPLOYMENT_TARGET')
+ if dep_target:
+ return tuple(map(int, dep_target.split('.'))) >= vers
+ return False
def is_macosx_sdk_path(path):
"""
@@ -150,6 +157,13 @@
or path.startswith('/System/')
or path.startswith('/Library/') )
+def grep_headers_for(function, headers):
+ for header in headers:
+ with open(header, 'r') as f:
+ if function in f.read():
+ return True
+ return False
+
def find_file(filename, std_dirs, paths):
"""Searches for the directory where a given file is located,
and returns a possibly-empty list of additional directories, or None
@@ -1972,7 +1986,11 @@
return True
def detect_ctypes(self, inc_dirs, lib_dirs):
- self.use_system_libffi = False
+ if not sysconfig.get_config_var("LIBFFI_INCLUDEDIR") and is_macosx_at_least((10,15)):
+ self.use_system_libffi = True
+ else:
+ self.use_system_libffi = '--with-system-ffi' in sysconfig.get_config_var("CONFIG_ARGS")
+
include_dirs = []
extra_compile_args = []
extra_link_args = []
@@ -2016,32 +2034,48 @@
ext_test = Extension('_ctypes_test',
sources=['_ctypes/_ctypes_test.c'],
libraries=['m'])
+ ffi_inc = sysconfig.get_config_var("LIBFFI_INCLUDEDIR")
+ ffi_lib = None
+
self.extensions.extend([ext, ext_test])
if host_platform == 'darwin':
- if '--with-system-ffi' not in sysconfig.get_config_var("CONFIG_ARGS"):
+ if not self.use_system_libffi:
return
- # OS X 10.5 comes with libffi.dylib; the include files are
- # in /usr/include/ffi
- inc_dirs.append('/usr/include/ffi')
-
- ffi_inc = [sysconfig.get_config_var("LIBFFI_INCLUDEDIR")]
- if not ffi_inc or ffi_inc[0] == '':
- ffi_inc = find_file('ffi.h', [], inc_dirs)
- if ffi_inc is not None:
- ffi_h = ffi_inc[0] + '/ffi.h'
+ ffi_in_sdk = os.path.join(macosx_sdk_root(), "usr/include/ffi")
+ if os.path.exists(ffi_in_sdk):
+ ffi_inc = ffi_in_sdk
+ ffi_lib = 'ffi'
+ else:
+ # OS X 10.5 comes with libffi.dylib; the include files are
+ # in /usr/include/ffi
+ ffi_inc_dirs.append('/usr/include/ffi')
+
+ if not ffi_inc:
+ found = find_file('ffi.h', [], ffi_inc_dirs)
+ if found:
+ ffi_inc = found[0]
+ if ffi_inc:
+ ffi_h = ffi_inc + '/ffi.h'
if not os.path.exists(ffi_h):
ffi_inc = None
print('Header file {} does not exist'.format(ffi_h))
- ffi_lib = None
- if ffi_inc is not None:
+ if ffi_lib is None and ffi_inc:
for lib_name in ('ffi', 'ffi_pic'):
if (self.compiler.find_library_file(lib_dirs, lib_name)):
ffi_lib = lib_name
break
if ffi_inc and ffi_lib:
- ext.include_dirs.extend(ffi_inc)
+ ffi_headers = glob(os.path.join(ffi_inc, '*.h'))
+ if grep_headers_for('ffi_closure_alloc', ffi_headers):
+ try:
+ sources.remove('_ctypes/malloc_closure.c')
+ except ValueError:
+ pass
+ if grep_headers_for('ffi_prep_cif_var', ffi_headers):
+ ext.extra_compile_args.append("-DHAVE_FFI_PREP_CIF_VAR=1")
+ ext.include_dirs.append(ffi_inc)
ext.libraries.append(ffi_lib)
self.use_system_libffi = True

Some files were not shown because too many files have changed in this diff Show More