1
1

Compare commits

...

2985 Commits

Author SHA1 Message Date
73ed9afd03 tag active viewer 2021-06-02 15:22:29 +02:00
de040ccb96 Merge branch 'master' into temp-geometry-nodes-viewer-node 2021-06-02 14:34:28 +02: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
a9ba86c046 Merge branch 'master' into temp-geometry-nodes-viewer-node 2021-06-02 12:17:08 +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
842375e1ed test adding shortcut for geo viewer 2021-06-01 16:23:43 +02:00
41bfb64da1 Merge branch 'master' into temp-geometry-nodes-viewer-node 2021-06-01 16:05:30 +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
db59a5f9f0 Merge branch 'master' into temp-geometry-nodes-viewer-node 2021-06-01 13:54:07 +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
a25dbf243a remove outdated code 2021-05-31 15:06:11 +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
782b0df9c8 recalc when viewer node changed 2021-05-31 13:49:13 +02:00
8969f4ba23 take viewer node into account when searching for output connection 2021-05-31 13:44:15 +02:00
7cea4dc6f5 compute viewed sockets even when it is not required for the output 2021-05-31 13:35:29 +02:00
1e006e58dc remove toggles from node headers 2021-05-31 13:18:35 +02:00
0702871110 handle viewer node in modifier 2021-05-31 13:15:41 +02:00
5ea958a992 update spreadsheet context when activating viewer 2021-05-31 13:08:20 +02:00
7694a098ef initial viewer node 2021-05-31 12:46: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
3545 changed files with 196187 additions and 99852 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,5 @@ 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_VAR_HEAD

View File

@@ -35,13 +35,13 @@ Checks: >
-modernize-use-auto,
-modernize-use-trailing-return-type,
-modernize-avoid-c-arrays,
-modernize-use-equals-default,
-modernize-use-nodiscard,
-modernize-loop-convert,
-modernize-pass-by-value,
-modernize-use-default-member-init,
-modernize-raw-string-literal,
-modernize-avoid-bind,
-modernize-use-transparent-functors,
# Cannot be enabled yet, because using raw string literals in tests breaks
# the windows compiler currently.
-modernize-raw-string-literal
WarningsAsErrors: '*'
CheckOptions:
- key: modernize-use-default-member-init.UseAssignment
value: 1

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.
@@ -164,10 +167,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)")
@@ -237,9 +236,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)
@@ -301,15 +298,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)
@@ -371,8 +386,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)
@@ -417,6 +432,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)
@@ -504,10 +520,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 \
@@ -614,6 +630,7 @@ 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.
@@ -670,16 +687,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")
@@ -690,10 +702,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")
@@ -728,8 +738,9 @@ 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)
@@ -741,6 +752,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)
@@ -763,6 +775,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)
@@ -774,14 +787,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)
@@ -801,7 +806,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()
@@ -830,8 +835,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")
endif()
file(GLOB RESULT "${CMAKE_SOURCE_DIR}/release/scripts/addons")
@@ -906,6 +911,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
#
@@ -961,22 +978,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)
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__)
# 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)
@@ -1022,6 +1066,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}
@@ -1184,6 +1231,8 @@ if(WITH_OPENMP)
if(NOT WITH_OPENMP_STATIC)
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
@@ -1194,6 +1243,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()
@@ -1269,6 +1319,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()
@@ -1437,6 +1488,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
@@ -1474,6 +1526,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")
@@ -1501,11 +1554,13 @@ if(CMAKE_COMPILER_IS_GNUCC)
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)
@@ -1535,6 +1590,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)
@@ -1849,6 +1906,7 @@ if(FIRST_RUN)
info_cfg_text("Build Options:")
info_cfg_option(WITH_ALEMBIC)
info_cfg_option(WITH_BULLET)
info_cfg_option(WITH_CLANG)
info_cfg_option(WITH_CYCLES)
info_cfg_option(WITH_FFTW3)
info_cfg_option(WITH_FREESTYLE)
@@ -1896,11 +1954,15 @@ if(FIRST_RUN)
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)

View File

@@ -26,26 +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.
@@ -85,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:
@@ -120,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"
@@ -466,6 +480,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) \
@@ -498,7 +515,14 @@ 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
@@ -514,6 +538,9 @@ 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)

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)
@@ -70,9 +72,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()
@@ -87,34 +87,38 @@ 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)
include(cmake/pugixml.cmake)
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/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)

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)
@@ -60,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,104 +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
-DLLVM_DIR="${LIBDIR}/llvm/lib/cmake/llvm/"
-DLLVM_USE_CRT_RELEASE=MD
-DLLVM_USE_CRT_DEBUG=MDd
-DLLVM_CONFIG=${LIBDIR}/llvm/bin/llvm-config
)
set(BUILD_CLANG_TOOLS OFF)
if(WIN32)
set(CLANG_GENERATOR "Ninja")
else()
set(CLANG_GENERATOR "Unix Makefiles")
endif()
if(APPLE)
set(BUILD_CLANG_TOOLS ON)
set(CLANG_EXTRA_ARGS ${CLANG_EXTRA_ARGS}
-DLIBXML2_LIBRARY=${LIBDIR}/xml2/lib/libxml2.a
)
endif()
if(BUILD_CLANG_TOOLS)
# ExternalProject_Add does not allow multiple tarballs to be
# downloaded. Work around this by having an empty build action
# for the extra tools, and referring the clang build to the location
# of the clang-tools-extra source.
ExternalProject_Add(external_clang_tools
URL ${CLANG_TOOLS_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${CLANG_TOOLS_HASH}
INSTALL_DIR ${LIBDIR}/clang_tools
PREFIX ${BUILD_DIR}/clang_tools
CONFIGURE_COMMAND echo "."
BUILD_COMMAND echo "."
INSTALL_COMMAND echo "."
)
list(APPEND CLANG_EXTRA_ARGS
-DLLVM_EXTERNAL_CLANG_TOOLS_EXTRA_SOURCE_DIR=${BUILD_DIR}/clang_tools/src/external_clang_tools/
)
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
)
if(BUILD_CLANG_TOOLS)
# `external_clang_tools` is for downloading the source, not compiling it.
add_dependencies(
external_clang
external_clang_tools
)
endif()
# 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,93 @@
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(ISPC)
download_source(GMP)
download_source(POTRACE)
download_source(HARU)

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}
)
@@ -46,15 +47,26 @@ 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

@@ -16,16 +16,20 @@
#
# ***** END GPL LICENSE BLOCK *****
set(TINYXML_EXTRA_ARGS
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_tinyxml
URL ${TINYXML_URI}
ExternalProject_Add(external_expat
URL file://${PACKAGE_DIR}/${EXPAT_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 ${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

@@ -60,9 +60,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

@@ -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

@@ -24,9 +24,9 @@ set(HARU_EXTRA_ARGS
)
ExternalProject_Add(external_haru
URL ${HARU_URI}
URL file://${PACKAGE_DIR}/${HARU_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${HARU_HASH}
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

View File

@@ -97,19 +97,22 @@ 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(llvm/bin llvm/bin "clang-format")
if(BUILD_CLANG_TOOLS)
harvest(clang/bin llvm/bin "clang-tidy")
harvest(clang/share/clang llvm/share "run-clang-tidy.py")
harvest(llvm/bin llvm/bin "clang-tidy")
harvest(llvm/share/clang llvm/share "run-clang-tidy.py")
endif()
harvest(clang/include llvm/include "*")
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")
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)
@@ -139,12 +142,10 @@ 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")
@@ -157,12 +158,12 @@ 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(pugixml/include pugixml/include "*.hpp")
harvest(pugixml/lib pugixml/lib "*.a")
harvest(python/bin python/bin "python${PYTHON_SHORT_VERSION}m")
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")
@@ -192,7 +193,7 @@ harvest(haru/lib haru/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,46 +21,51 @@ 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.
# 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(HOMEBREW_LOCATION "/opt/homebrew")
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(HOMEBREW_LOCATION "/usr/local")
set(ISPC_EXTRA_ARGS_APPLE
-DBISON_EXECUTABLE=/usr/local/opt/bison/bin/bison
-DARM_ENABLED=Off
)
endif()
set(ISPC_EXTRA_ARGS_APPLE
-DBISON_EXECUTABLE=${HOMEBREW_LOCATION}/opt/bison/bin/bison
)
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
)
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
@@ -70,7 +75,6 @@ ExternalProject_Add(external_ispc
add_dependencies(
external_ispc
ll
external_clang
)
if(WIN32)

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
@@ -65,3 +78,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

@@ -37,9 +37,9 @@ set(NANOVDB_EXTRA_ARGS
)
ExternalProject_Add(nanovdb
URL ${NANOVDB_URI}
URL file://${PACKAGE_DIR}/${NANOVDB_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${NANOVDB_HASH}
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}

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,10 +41,11 @@ 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
PATCH_COMMAND ${PATCH_CMD} -p 1 -N -d ${BUILD_DIR}/openimagedenoise/src/external_openimagedenoise < ${PATCH_DIR}/oidn.diff
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
@@ -120,9 +119,9 @@ set(OPENIMAGEIO_EXTRA_ARGS
)
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}

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

@@ -18,9 +18,9 @@
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
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openmp ${DEFAULT_CMAKE_FLAGS}
@@ -30,5 +30,5 @@ ExternalProject_Add(external_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,6 +54,8 @@ set(OPENVDB_EXTRA_ARGS
-DOPENVDB_CORE_STATIC=${OPENVDB_STATIC}
-DOPENVDB_BUILD_BINARIES=Off
-DCMAKE_DEBUG_POSTFIX=_d
-DILMBASE_USE_STATIC_LIBS=On
-DOPENEXR_USE_STATIC_LIBS=On
)
if(WIN32)
@@ -75,9 +77,9 @@ else()
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.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openvdb ${DEFAULT_CMAKE_FLAGS} ${OPENVDB_EXTRA_ARGS}

View File

@@ -21,7 +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)
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")
@@ -35,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}")
@@ -130,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}")
@@ -144,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,12 +19,7 @@
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_SIMD_FLAGS -DOIIO_NOSIMD=1 -DOIIO_SIMD=sse2)
SET(OSL_PLATFORM_FLAGS -DLINKSTATIC=ON)
else()
set(OSL_CMAKE_CXX_STANDARD_LIBRARIES)
@@ -34,7 +29,6 @@ else()
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 +39,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,42 +48,39 @@ 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
-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
-DBUILD_SHARED_LIBS=OFF
${OSL_PLATFORM_FLAGS}
-DOSL_BUILD_PLUGINS=Off
-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_HOME=${LIBDIR}/pugixml
-Dpugixml_ROOT=${LIBDIR}/pugixml
-DUSE_PYTHON=OFF
)
if(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
)
# Apple arm64 uses LLVM 11, LLVM 10+ requires C++14
if (APPLE AND "${CMAKE_OSX_ARCHITECTURES}" STREQUAL "arm64")
list(APPEND OSL_EXTRA_ARGS -DCMAKE_CXX_STANDARD=14)
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}
@@ -105,7 +91,6 @@ add_dependencies(
external_osl
external_boost
ll
external_clang
external_openexr
external_zlib
external_flexbison

View File

@@ -22,14 +22,14 @@ set(PNG_EXTRA_ARGS
-DPNG_STATIC=ON
)
if(APPLE AND ("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "arm64"))
set(PNG_EXTRA_ARGS ${PNG_EXTRA_ARGS} -DPNG_HARDWARE_OPTIMIZATIONS=ON -DPNG_ARM_NEON=on -DCMAKE_SYSTEM_PROCESSOR="aarch64")
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

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 --disable-tcl
--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,7 @@ if(WIN32)
-DTBB_BUILD_TBBMALLOC=On
-DTBB_BUILD_TBBMALLOC_PROXY=On
-DTBB_BUILD_STATIC=Off
-DTBB_BUILD_TESTS=Off
)
set(TBB_LIBRARY tbb)
set(TBB_STATIC_LIBRARY Off)
@@ -30,6 +31,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 +39,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
)

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,204 +86,295 @@ 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)
if(BLENDER_PLATFORM_ARM)
# Newer version required by ISPC with arm support.
set(LLVM_VERSION 11.0.1)
set(LLVM_URI https://github.com/llvm/llvm-project/releases/download/llvmorg-${LLVM_VERSION}/llvm-project-${LLVM_VERSION}.src.tar.xz)
set(LLVM_HASH e700af40ab83463e4e9ab0ba3708312e)
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)
set(OPENMP_VERSION 9.0.1)
set(OPENMP_URI https://github.com/llvm/llvm-project/releases/download/llvmorg-${OPENMP_VERSION}/openmp-${OPENMP_VERSION}.src.tar.xz)
set(OPENMP_HASH 6eade16057edbdecb3c4eef9daa2bfcf)
set(OPENMP_HASH_TYPE MD5)
set(OPENMP_FILE openmp-${OPENMP_VERSION}.src.tar.xz)
else()
set(LLVM_VERSION 9.0.1)
set(LLVM_URI https://github.com/llvm/llvm-project/releases/download/llvmorg-${LLVM_VERSION}/llvm-project-${LLVM_VERSION}.tar.xz)
set(LLVM_HASH b4268e733dfe352960140dc07ef2efcb)
set(LLVM_HASH_TYPE MD5)
set(LLVM_FILE llvm-project-${LLVM_VERSION}.tar.xz)
set(CLANG_TOOLS_URI https://github.com/llvm/llvm-project/releases/download/llvmorg-${LLVM_VERSION}/clang-tools-extra-${LLVM_VERSION}.src.tar.xz)
set(CLANG_TOOLS_HASH c76293870b564c6a7968622b475b7646)
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(OPENMP_URI https://github.com/llvm/llvm-project/releases/download/llvmorg-${LLVM_VERSION}/openmp-${LLVM_VERSION}.src.tar.xz)
set(OPENMP_HASH 6eade16057edbdecb3c4eef9daa2bfcf)
set(OPENMP_HASH_TYPE MD5)
set(OPENMP_FILE openmp-${LLVM_VERSION}.src.tar.xz)
endif()
set(OPENIMAGEIO_VERSION 2.1.15.0)
set(OPENIMAGEIO_URI https://github.com/OpenImageIO/oiio/archive/Release-${OPENIMAGEIO_VERSION}.tar.gz)
set(OPENIMAGEIO_HASH f03aa5e3ac4795af04771ee4146e9832)
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.10.0)
set(OSL_URI https://github.com/imageworks/OpenShadingLanguage/archive/Release-${OSL_VERSION}.tar.gz)
set(OSL_HASH 00dec08a93c8084e53848b9ad047889f)
set(OSL_HASH dfdc23597aeef083832cbada62211756)
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)
set(OPENVDB_VERSION 7.0.0)
set(OPENVDB_VERSION 8.0.1)
set(OPENVDB_URI https://github.com/AcademySoftwareFoundation/openvdb/archive/v${OPENVDB_VERSION}.tar.gz)
set(OPENVDB_HASH fd6c4f168282f7e0e494d290cd531fa8)
set(OPENVDB_HASH 01b490be16cc0e15c690f9a153c21461)
set(OPENVDB_HASH_TYPE MD5)
set(OPENVDB_FILE openvdb-${OPENVDB_VERSION}.tar.gz)
set(NANOVDB_GIT_UID e62f7a0bf1e27397223c61ddeaaf57edf111b77f)
set(NANOVDB_URI https://github.com/AcademySoftwareFoundation/openvdb/archive/${NANOVDB_GIT_UID}.tar.gz)
set(NANOVDB_HASH 90919510bc6ccd630fedc56f748cb199)
set(NANOVDB_HASH_TYPE MD5)
set(NANOVDB_FILE nano-vdb-${NANOVDB_GIT_UID}.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(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.17.5)
set(NUMPY_SHORT_VERSION 1.17)
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_URI http://prdownloads.sourceforge.net/winflexbison/win_flex_bison-${FLEXBISON_VERSION}.zip)
set(FLEXBISON_HASH d87a3938194520d904013abef3df10ce)
set(FLEXBISON_HASH_TYPE MD5)
set(FLEXBISON_FILE win_flex_bison-${FLEXBISON_VERSION}.zip)
# Libraries to keep Python modules static on Linux.
@@ -275,63 +383,116 @@ 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.3.0)
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 301a5a0958d375a942014df0679b9270)
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 20.3.4)
set(MESA_URI ftp://ftp.freedesktop.org/pub/mesa/mesa-${MESA_VERSION}.tar.xz)
set(MESA_HASH 556338446aef8ae947a789b3e0b5e056)
set(MESA_HASH_TYPE MD5)
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.14)
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 0df6b2fd6045423451a77ff6bc3e1a75)
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(ISPC_URI https://github.com/ispc/ispc/archive/${ISPC_VERSION}.tar.gz)
set(ISPC_HASH 968fbc8dfd16a60ba4e32d2e0e03ea7a)
if(BLENDER_PLATFORM_ARM)
# Unreleased version with macOS arm support.
set(ISPC_URI https://github.com/ispc/ispc/archive/f5949c055eb9eeb93696978a3da4bfb3a6a30b35.zip)
set(ISPC_HASH d382fea18d01dbd0cd05d9e1ede36d7d)
set(ISPC_HASH_TYPE MD5)
set(ISPC_FILE f5949c055eb9eeb93696978a3da4bfb3a6a30b35.zip)
else()
set(ISPC_VERSION v1.14.1)
set(ISPC_URI https://github.com/ispc/ispc/archive/${ISPC_VERSION}.tar.gz)
set(ISPC_HASH 968fbc8dfd16a60ba4e32d2e0e03ea7a)
set(ISPC_HASH_TYPE MD5)
set(ISPC_FILE ispc-${ISPC_VERSION}.tar.gz)
endif()
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(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

@@ -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 .

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

@@ -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

@@ -0,0 +1,40 @@
diff -Naur oidn-1.3.0/cmake/FindTBB.cmake external_openimagedenoise/cmake/FindTBB.cmake
--- oidn-1.3.0/cmake/FindTBB.cmake 2021-02-04 16:20:26 -0700
+++ external_openimagedenoise/cmake/FindTBB.cmake 2021-02-12 09:35:53 -0700
@@ -332,20 +332,22 @@
${TBB_ROOT}/lib/${TBB_ARCH}/${TBB_VCVER}
${TBB_ROOT}/lib
)
-
# On Windows, also search the DLL so that the client may install it.
file(GLOB DLL_NAMES
${TBB_ROOT}/bin/${TBB_ARCH}/${TBB_VCVER}/${LIB_NAME}.dll
${TBB_ROOT}/bin/${LIB_NAME}.dll
+ ${TBB_ROOT}/lib/${LIB_NAME}.dll
${TBB_ROOT}/redist/${TBB_ARCH}/${TBB_VCVER}/${LIB_NAME}.dll
${TBB_ROOT}/redist/${TBB_ARCH}/${TBB_VCVER}/${LIB_NAME_GLOB1}.dll
${TBB_ROOT}/redist/${TBB_ARCH}/${TBB_VCVER}/${LIB_NAME_GLOB2}.dll
${TBB_ROOT}/../redist/${TBB_ARCH}/tbb/${TBB_VCVER}/${LIB_NAME}.dll
${TBB_ROOT}/../redist/${TBB_ARCH}_win/tbb/${TBB_VCVER}/${LIB_NAME}.dll
)
- list(GET DLL_NAMES 0 DLL_NAME)
- get_filename_component(${BIN_DIR_VAR} "${DLL_NAME}" DIRECTORY)
- set(${DLL_VAR} "${DLL_NAME}" CACHE PATH "${COMPONENT_NAME} ${BUILD_CONFIG} dll path")
+ if (DLL_NAMES)
+ list(GET DLL_NAMES 0 DLL_NAME)
+ get_filename_component(${BIN_DIR_VAR} "${DLL_NAME}" DIRECTORY)
+ set(${DLL_VAR} "${DLL_NAME}" CACHE PATH "${COMPONENT_NAME} ${BUILD_CONFIG} dll path")
+ endif()
elseif(APPLE)
set(LIB_PATHS ${TBB_ROOT}/lib)
else()
--- external_openimagedenoise/cmake/oidn_ispc.cmake 2021-02-15 17:29:34.000000000 +0100
+++ external_openimagedenoise/cmake/oidn_ispc.cmake2 2021-02-15 17:29:28.000000000 +0100
@@ -98,7 +98,7 @@
elseif(OIDN_ARCH STREQUAL "ARM64")
set(ISPC_ARCHITECTURE "aarch64")
if(APPLE)
- set(ISPC_TARGET_OS "--target-os=ios")
+ set(ISPC_TARGET_OS "--target-os=macos")
endif()
endif()

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

@@ -43,27 +43,39 @@ 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/src/liboslexec/llvm_util.cpp b/src/liboslexec/llvm_util.cpp
index 445f6400..3d468de2 100644
--- a/src/liboslexec/llvm_util.cpp
+++ b/src/liboslexec/llvm_util.cpp
@@ -3430,8 +3430,9 @@ LLVM_Util::call_function (llvm::Value *func, cspan<llvm::Value *> args)
#endif
//llvm_gen_debug_printf (std::string("start ") + std::string(name));
#if OSL_LLVM_VERSION >= 110
- OSL_DASSERT(llvm::isa<llvm::Function>(func));
- llvm::Value *r = builder().CreateCall(llvm::cast<llvm::Function>(func), llvm::ArrayRef<llvm::Value *>(args.data(), args.size()));
+ llvm::Value* r = builder().CreateCall(
+ llvm::cast<llvm::FunctionType>(func->getType()->getPointerElementType()), func,
+ llvm::ArrayRef<llvm::Value*>(args.data(), args.size()));
#else
llvm::Value *r = builder().CreateCall (func, llvm::ArrayRef<llvm::Value *>(args.data(), args.size()));
#endif

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

View File

@@ -2,23 +2,23 @@ diff --git a/setup.py.orig b/setup.py
index a97a755..07ce853 100644
--- a/setup.py.orig
+++ b/setup.py
@@ -1422,13 +1422,13 @@ class PyBuildExt(build_ext):
@@ -1603,13 +1603,13 @@
version = line.split()[2]
break
if version >= version_req:
- if (self.compiler.find_library_file(lib_dirs, 'z')):
+ if (self.compiler.find_library_file(lib_dirs, 'z_pic')):
if host_platform == "darwin":
- if (self.compiler.find_library_file(self.lib_dirs, 'z')):
+ if (self.compiler.find_library_file(self.lib_dirs, 'z_pic')):
if MACOS:
zlib_extra_link_args = ('-Wl,-search_paths_first',)
else:
zlib_extra_link_args = ()
exts.append( Extension('zlib', ['zlibmodule.c'],
- libraries = ['z'],
+ libraries = ['z_pic'],
extra_link_args = zlib_extra_link_args))
self.add(Extension('zlib', ['zlibmodule.c'],
- libraries=['z'],
+ libraries=['z_pic'],
extra_link_args=zlib_extra_link_args))
have_zlib = True
else:
@@ -1442,7 +1442,7 @@ class PyBuildExt(build_ext):
@@ -1623,7 +1623,7 @@
# crc32 if we have it. Otherwise binascii uses its own.
if have_zlib:
extra_compile_args = ['-DUSE_ZLIB_CRC32']
@@ -27,12 +27,12 @@ index a97a755..07ce853 100644
extra_link_args = zlib_extra_link_args
else:
extra_compile_args = []
@@ -1991,7 +1991,7 @@ class PyBuildExt(build_ext):
@@ -2168,7 +2168,7 @@
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'):
+ for lib_name in ('ffi_pic', ):
if (self.compiler.find_library_file(lib_dirs, lib_name)):
if (self.compiler.find_library_file(self.lib_dirs, lib_name)):
ffi_lib = lib_name
break

View File

@@ -0,0 +1,24 @@
diff --git a/include/tbb/tbb_config.h b/include/tbb/tbb_config.h
index 7a8d06a0..886699d8 100644
--- a/include/tbb/tbb_config.h
+++ b/include/tbb/tbb_config.h
@@ -620,7 +620,7 @@ There are four cases that are supported:
// instantiation site, which is too late for suppression of the corresponding messages for internal
// stuff.
#if !defined(__INTEL_COMPILER) && (!defined(TBB_SUPPRESS_DEPRECATED_MESSAGES) || (TBB_SUPPRESS_DEPRECATED_MESSAGES == 0))
- #if (__cplusplus >= 201402L)
+ #if (__cplusplus >= 201402L && (!defined(_MSC_VER) || _MSC_VER >= 1920))
#define __TBB_DEPRECATED [[deprecated]]
#define __TBB_DEPRECATED_MSG(msg) [[deprecated(msg)]]
#elif _MSC_VER
--- a/src/tbb/tools_api/ittnotify_config.h
+++ b/src/tbb/tools_api/ittnotify_config.h
@@ -162,7 +162,7 @@
# define ITT_ARCH ITT_ARCH_IA32E
# elif defined _M_IA64 || defined __ia64__
# define ITT_ARCH ITT_ARCH_IA64
-# elif defined _M_ARM || defined __arm__
+# elif defined _M_ARM || defined __arm__ || defined __aarch64__
# define ITT_ARCH ITT_ARCH_ARM
# elif defined __powerpc64__
# define ITT_ARCH ITT_ARCH_PPC64

View File

@@ -4,7 +4,7 @@
# Some are omitted here because they have special meanings below.
1750a | 580 \
| a29k \
+ | aarch64 \
+ | aarch64 \
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
@@ -12,7 +12,7 @@
# Recognize the basic CPU types with company name.
580-* \
| a29k-* \
+ | aarch64-* \
+ | aarch64-* \
| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \

View File

@@ -26,36 +26,174 @@ diff -Naur external_usd_base/cmake/macros/Public.cmake external_usd/cmake/macros
endforeach()
foreach(lib ${PXR_OBJECT_LIBS})
set(objects "${objects};\$<TARGET_OBJECTS:${lib}>")
diff -ru USD-20.11/pxr/base/tf/pxrLZ4/lz4.cpp external_usd/pxr/base/tf/pxrLZ4/lz4.cpp
--- USD-20.11/pxr/base/tf/pxrLZ4/lz4.cpp 2020-10-14 19:25:19.000000000 +0100
+++ external_usd/pxr/base/tf/pxrLZ4/lz4.cpp 2021-02-09 09:28:51.496190085 +0000
@@ -614,6 +614,15 @@
/*-************************************
* Internal Definitions used in Tests
**************************************/
+
+/*******************************************************************
+ * Disabled in Blender. The BLOSC library also exposes these
+ * functions, and this causes 'duplicate symbol' linker errors.
+ *
+ * This problem has been reported upstream at
+ * https://github.com/PixarAnimationStudios/USD/issues/1447
+ *
+ *******************************************************************
#if defined (__cplusplus)
extern "C" {
#endif
@@ -627,6 +636,7 @@
#if defined (__cplusplus)
}
#endif
+********************************************************************/
/*-******************************
* Compression functions
diff --git a/pxr/base/arch/align.h b/pxr/base/arch/align.h
index f3cabf4..ebc8a69 100644
--- a/pxr/base/arch/align.h
+++ b/pxr/base/arch/align.h
@@ -77,7 +77,11 @@ ArchAlignMemory(void *base)
/// The size of a CPU cache line on the current processor architecture in bytes.
///
/// \hideinitializer
+#if defined(ARCH_OS_DARWIN) && defined(ARCH_CPU_ARM)
+#define ARCH_CACHE_LINE_SIZE 128
From 442d087962f762deeb8b6e49a0955753fcf9aeb9 Mon Sep 17 00:00:00 2001
From: Tsahi Zidenberg <tsahee@amazon.com>
Date: Sun, 15 Nov 2020 15:18:24 +0000
Subject: [PATCH 1/2] stackTrace: support aarch64/linux
stacktrace calls syscall directly via assembler. Create compatible
aarch64 code.
---
pxr/base/arch/stackTrace.cpp | 30 ++++++++++++++++++++++++------
1 file changed, 24 insertions(+), 6 deletions(-)
diff --git a/pxr/base/arch/stackTrace.cpp b/pxr/base/arch/stackTrace.cpp
index dcc1dfd46..c11aabeb1 100644
--- a/pxr/base/arch/stackTrace.cpp
+++ b/pxr/base/arch/stackTrace.cpp
@@ -583,7 +583,6 @@ nonLockingLinux__execve (const char *file,
char *const argv[],
char *const envp[])
{
-#if defined(ARCH_BITS_64)
/*
* We make a direct system call here, because we can't find an
* execve which corresponds with the non-locking fork we call
@@ -594,7 +593,27 @@ nonLockingLinux__execve (const char *file,
* hangs in a threaded app. (We use the non-locking fork to get
* around problems with forking when we have had memory
* corruption.) whew.
- *
+ */
+
+ unsigned long result;
+
+#if defined (__aarch64__)
+ {
+ register long __file_result asm ("x0") = (long)file;
+ register char* const* __argv asm ("x1") = argv;
+ register char* const* __envp asm ("x2") = envp;
+ register long __num_execve asm ("x8") = 221;
+ __asm__ __volatile__ (
+ "svc 0"
+ : "=r" (__file_result)
+ : "r"(__num_execve), "r" (__file_result), "r" (__argv), "r" (__envp)
+ : "memory"
+ );
+ result = __file_result;
+ }
+#elif defined(ARCH_CPU_INTEL) && defined(ARCH_BITS_64)
+
+ /*
* %rdi, %rsi, %rdx, %rcx, %r8, %r9 are args 0-5
* syscall clobbers %rcx and %r11
*
@@ -603,7 +622,6 @@ nonLockingLinux__execve (const char *file,
* constraints to gcc.
*/
- unsigned long result;
__asm__ __volatile__ (
"mov %0, %%rdi \n\t"
"mov %%rcx, %%rsi \n\t"
@@ -614,6 +632,9 @@ nonLockingLinux__execve (const char *file,
: "0" (file), "c" (argv), "d" (envp)
: "memory", "cc", "r11"
);
+#else
#define ARCH_CACHE_LINE_SIZE 64
+#error Unknown architecture
+#endif
///@}
if (result >= 0xfffffffffffff000) {
errno = -result;
@@ -621,9 +642,6 @@ nonLockingLinux__execve (const char *file,
}
diff --git a/pxr/base/arch/math.h b/pxr/base/arch/math.h
index 3e66c37..64a052c 100644
--- a/pxr/base/arch/math.h
+++ b/pxr/base/arch/math.h
@@ -42,7 +42,7 @@ PXR_NAMESPACE_OPEN_SCOPE
/// \addtogroup group_arch_Math
return result;
-#else
-#error Unknown architecture
-#endif
}
#endif
From a1dffe02519bb3c6ccbbe8c6c58304da5db98995 Mon Sep 17 00:00:00 2001
From: Tsahi Zidenberg <tsahee@amazon.com>
Date: Sun, 15 Nov 2020 15:22:52 +0000
Subject: [PATCH 2/2] timing: support aarch64/linux
The aarch64 arch-timer is directly accessible to userspace via two
registers:
CNTVCT_EL0 - holds the current counter value
CNTFRQ_EL0 - holds the counter frequency (in Hz)
---
pxr/base/arch/timing.cpp | 6 ++++++
pxr/base/arch/timing.h | 6 +++++-
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/pxr/base/arch/timing.cpp b/pxr/base/arch/timing.cpp
index 27ad58fed..9022950c1 100644
--- a/pxr/base/arch/timing.cpp
+++ b/pxr/base/arch/timing.cpp
@@ -59,6 +59,11 @@ ARCH_HIDDEN
void
Arch_InitTickTimer()
{
+#ifdef __aarch64__
+ uint64_t counter_hz;
+ __asm __volatile("mrs %0, CNTFRQ_EL0" : "=&r" (counter_hz));
+ Arch_NanosecondsPerTick = double(1e9) / double(counter_hz);
+#else
// NOTE: Normally ifstream would be cleaner, but it causes crashes when
// used in conjunction with DSOs and the Intel Compiler.
FILE *in;
@@ -135,6 +140,7 @@ Arch_InitTickTimer()
}
Arch_NanosecondsPerTick = double(1e9) / double(cpuHz);
+#endif
}
#elif defined(ARCH_OS_WINDOWS)
diff --git a/pxr/base/arch/timing.h b/pxr/base/arch/timing.h
index 67ec0d15f..6dc3e85a0 100644
--- a/pxr/base/arch/timing.h
+++ b/pxr/base/arch/timing.h
@@ -36,7 +36,7 @@
/// \addtogroup group_arch_SystemFunctions
///@{
-#if defined (ARCH_CPU_INTEL) || defined(doxygen)
+#if defined (ARCH_CPU_INTEL) || defined(ARCH_CPU_ARM) || defined(doxygen)
/// This is the smallest value e such that 1+e^2 == 1, using floats.
/// True for all IEEE754 chipsets.
-#if defined(ARCH_OS_LINUX)
+#if defined(ARCH_OS_LINUX) && defined(ARCH_CPU_INTEL)
#include <x86intrin.h>
#elif defined(ARCH_OS_DARWIN)
#include <mach/mach_time.h>
@@ -69,6 +69,10 @@ ArchGetTickTime()
#elif defined(ARCH_CPU_INTEL)
// On Intel we'll use the rdtsc instruction.
return __rdtsc();
+#elif defined (__aarch64__)
+ uint64_t result;
+ __asm __volatile("mrs %0, CNTVCT_EL0" : "=&r" (result));
+ return result;
#else
#error Unknown architecture.
#endif

View File

@@ -117,7 +117,7 @@ set path=%BUILD_DIR%\downloads\mingw\mingw64\msys\1.0\bin\;%BUILD_DIR%\downloads
mkdir %STAGING%\%BuildDir%%ARCH%R
cd %Staging%\%BuildDir%%ARCH%R
echo %DATE% %TIME% : Start > %StatusFile%
cmake -G "%CMAKE_BUILDER%" %SOURCE_DIR% -DDOWNLOAD_DIR=%BUILD_DIR%/downloads -DBUILD_MODE=Release -DHARVEST_TARGET=%HARVEST_DIR%/%HARVESTROOT%%VSVER_SHORT%/
cmake -G "%CMAKE_BUILDER%" -Thost=x64 %SOURCE_DIR% -DPACKAGE_DIR=%BUILD_DIR%/packages -DDOWNLOAD_DIR=%BUILD_DIR%/downloads -DBUILD_MODE=Release -DHARVEST_TARGET=%HARVEST_DIR%/%HARVESTROOT%%VSVER_SHORT%/
echo %DATE% %TIME% : Release Configuration done >> %StatusFile%
if "%dobuild%" == "1" (
msbuild /m "ll.vcxproj" /p:Configuration=Release /fl /flp:logfile=BlenderDeps_llvm.log;Verbosity=normal
@@ -130,7 +130,7 @@ if "%NODEBUG%" == "1" goto exit
cd %BUILD_DIR%
mkdir %STAGING%\%BuildDir%%ARCH%D
cd %Staging%\%BuildDir%%ARCH%D
cmake -G "%CMAKE_BUILDER%" %SOURCE_DIR% -DDOWNLOAD_DIR=%BUILD_DIR%/downloads -DCMAKE_BUILD_TYPE=Debug -DBUILD_MODE=Debug -DHARVEST_TARGET=%HARVEST_DIR%/%HARVESTROOT%%VSVER_SHORT%/ %CMAKE_DEBUG_OPTIONS%
cmake -G "%CMAKE_BUILDER%" -Thost=x64 %SOURCE_DIR% -DPACKAGE_DIR=%BUILD_DIR%/packages -DDOWNLOAD_DIR=%BUILD_DIR%/downloads -DCMAKE_BUILD_TYPE=Debug -DBUILD_MODE=Debug -DHARVEST_TARGET=%HARVEST_DIR%/%HARVESTROOT%%VSVER_SHORT%/ %CMAKE_DEBUG_OPTIONS%
echo %DATE% %TIME% : Debug Configuration done >> %StatusFile%
if "%dobuild%" == "1" (
msbuild /m "ll.vcxproj" /p:Configuration=Debug /fl /flp:logfile=BlenderDeps_llvm.log;;Verbosity=normal

View File

@@ -1,70 +1,4 @@
Blender Buildbot
================
Buildbot Configuration
=====================
Code signing
------------
Code signing is done as part of INSTALL target, which makes it possible to sign
files which are aimed into a bundle and coming from a non-signed source (such as
libraries SVN).
This is achieved by specifying `worker_codesign.cmake` as a post-install script
run by CMake. This CMake script simply involves an utility script written in
Python which takes care of an actual signing.
### Configuration
Client configuration doesn't need anything special, other than variable
`SHARED_STORAGE_DIR` pointing to a location which is watched by a server.
This is done in `config_builder.py` file and is stored in Git (which makes it
possible to have almost zero-configuration buildbot machines).
Server configuration requires copying `config_server_template.py` under the
name of `config_server.py` and tweaking values, which are platform-specific.
#### Windows configuration
There are two things which are needed on Windows in order to have code signing
to work:
- `TIMESTAMP_AUTHORITY_URL` which is most likely set http://timestamp.digicert.com
- `CERTIFICATE_FILEPATH` which is a full file path to a PKCS #12 key (.pfx).
## Tips
### Self-signed certificate on Windows
It is easiest to test configuration using self-signed certificate.
The certificate manipulation utilities are coming with Windows SDK.
Unfortunately, they are not added to PATH. Here is an example of how to make
sure they are easily available:
```
set PATH=C:\Program Files (x86)\Windows Kits\10\App Certification Kit;%PATH%
set PATH=C:\Program Files (x86)\Windows Kits\10\bin\10.0.18362.0\x64;%PATH%
```
Generate CA:
```
makecert -r -pe -n "CN=Blender Test CA" -ss CA -sr CurrentUser -a sha256 ^
-cy authority -sky signature -sv BlenderTestCA.pvk BlenderTestCA.cer
```
Import the generated CA:
```
certutil -user -addstore Root BlenderTestCA.cer
```
Create self-signed certificate and pack it into PKCS #12:
```
makecert -pe -n "CN=Blender Test SPC" -a sha256 -cy end ^
-sky signature ^
-ic BlenderTestCA.cer -iv BlenderTestCA.pvk ^
-sv BlenderTestSPC.pvk BlenderTestSPC.cer
pvk2pfx -pvk BlenderTestSPC.pvk -spc BlenderTestSPC.cer -pfx BlenderTestSPC.pfx
```
Files used by Buildbot's `compile-code` step.

Some files were not shown because too many files have changed in this diff Show More