1
1

Compare commits

...

5139 Commits

Author SHA1 Message Date
1f3233374b Build: update various libraries for 2.93, fixing bugs and security issues
This is based on similar updates in 3.3 and 3.4 from D16269.

expat 2.5.0
ffmpeg 4.4.3
flac 1.3.4
freetype 2.12.1
imath 3.1.5
numpy 1.22.0
ogg 1.3.5
openexr 2.5.8
openjpeg 2.5.0
python 3.9.15
sndfile 1.1.0
sqlite 3.37.2
ssl 1.1.1q
tiff 4.4.0
vorbis 1.3.7
vpx 1.11.0
webp 1.2.2
xml2 2.10.3
zlib 1.2.13
2022-11-18 17:40:34 +01:00
e2ffa58320 Build: get make deps working with Xcode command line tools
Deduplicating code with Xcode detection for Blender builds.
2022-11-07 15:43:44 +01:00
c9df21fac7 deps_builder: harden the package download process
During the 3.3 release some packages were missing
in SVN during the release and it ended up building
the release tarball without issues when re-running
the `make source_archive_complete` command after it
failed initially. The tarball however had 0 byte files
for the missing packages.... not good.

This diff hardens the download process by :

1) Validating all required variables are set. This
catches the erroneously attempt at downloading the
nanovdb package even though we have removed it
from versions.cmake but neglected to remove it
from download.cmake

2) When a download fails (due to either a missing
package, or bad download URL) FILE Download will
warn about a hash mismatch but will carry on
happily, you then have to go into the file system
go delete the 0 byte file to retry the download.
We know for a fact the file is bad when it is 0
bytes, just delete it.

3) When we are using the blender repository
(and likely building a source archive) explicitly
validate the hash of all packages. Normally the
build process does this, however when building
a source archive the build does not actually
run for a dep. So preform this check during the
configuration stage.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D16124
2022-11-07 15:42:48 +01:00
137eae06ad Cleanup: remove unnecessary argument to else() in CMake
We have moved away from duplicating arguments in else() and endif()
commands.
2022-11-07 15:42:26 +01:00
3c3f4aceaf Cleanup: correct indentation of harvest.cmake 2022-11-07 15:41:07 +01:00
7bc5193f5e deps_builder: Add support for cve-bin-tool
This change adds support for intels cve-bin-tool [1]
in the deps builder. This adds 2 new targets to the
builder that do not build automatically but can be
build on demand when required.

`make cve_check` will output to the console.
`make cve_check_html` will output a html file that
can be shared with other people.

Requirements:

- A working installation of cve-bin-tool on the system

Not required but higly recommended:

- Obtaining a key from the nvd [2] to speed up the
  database download. you can pass the key to cmake
  using `-DCVE_CHECK_NVD_KEY=your_api_key`

[1] https://github.com/intel/cve-bin-tool
[2] https://nvd.nist.gov/developers/request-an-api-key

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D16160
2022-11-07 15:41:07 +01:00
d52a0fa115 Bump version cycle for Blender 2.93.11 release. 2022-10-04 20:12:35 +02:00
dfcc8086fb Fix: GPencil animated layer transforms evaluate wrong when identity
Due to (optimization) checks in in `BKE_gpencil_prepare_eval_data` &
`BKE_gpencil_update_layer_transforms`, updates were skipped if animation
reached exact identity transforms.

Now check if the matrix has changed additionally to gain proper updates.
Unsure if this is the cheapest way to check for the animated state of
layer transforms tbh, but I see similar checks elsewhere.

Fixes T101164.

Maniphest Tasks: T101164

Differential Revision: https://developer.blender.org/D16018
2022-10-03 21:19:04 +02:00
1e7e1b151c Fix T101109: Animation on nodes problems when dealing with Node Groups
Whenever animation on nodes was transfered to/from nodegroups (grouping/
ungrouping/separating) via BKE_animdata_transfer_by_basepath, it was
possible to create new nodes with the same name (in the formerly same
path -- see report for an example of this) and animation from the
original node was still performed on them. Issue went away after save/
reload.

In order to fully update the action, a depsgraph is now performed on the
action (similar to what is done when renaming for example).

Maniphest Tasks: T101109

Differential Revision: https://developer.blender.org/D15987
2022-10-03 21:00:03 +02:00
3dce2469ee Fix T101046: missing DEG update changing bone layers in editmode
Following {T54811} (and {rBbb92edd1c802}), DEG updates have been added
to the various operators. This has also been done for the layers
operators (see {rBf998bad211ae}, `ARMATURE_OT_bone_layers` has been
marked done in T54811). However, instead of `ARMATURE_OT_bone_layers`,
the update tagging actually happened for `POSE_OT_bone_layers`.

Now do this for `ARMATURE_OT_bone_layers` as well (keep it for
`POSE_OT_bone_layers`, dont think this is wrong there either).

Maniphest Tasks: T101046

Differential Revision: https://developer.blender.org/D15969
2022-10-03 20:59:23 +02:00
331fe92e46 Fix EEVEE: Screen Space Refraction Artefacts caused by viewport aspect ratio
This was caused by the vertical/horizontal clasification being done in
NDC space which wasn't respecting the Aspect ratio.

Multiplying the test vector by the target size fixes the issue.
2022-10-03 20:58:32 +02:00
170e03aa98 Fix T101138: remove console spam when hovering over toolbar in uv editor
Reviewers: Campbell Barton <ideasman42>, Ryan Inch <Imaginer>

Differential Revision: https://developer.blender.org/D16015
2022-10-03 20:57:36 +02:00
5c20363e37 Fix T100606: Apply object transform fails with delta quaternion rotation
Apply transform failed to clear delta quaternion & axis-angle rotation.
2022-10-03 20:51:26 +02:00
Pratik Borhade
4b3b8156ee Fix T99070: Apply transform fails to clear delta transform values
Clear delta transform value after applying transform.
Include delta location while applying transform.
Use `copy_v3_fl` for resetting object scale

Reviewed By: mano-wii

Maniphest Tasks: T99070

Differential Revision: https://developer.blender.org/D15270
2022-10-03 20:48:39 +02:00
8c148a4f3b Fix T100851: Sync markers does not work for numinput
special_aftertrans_update would always use TransInfo values (not
the values_final -- we need the final values to follow numinput, snapping,
etc).

Maniphest Tasks: T100851

Differential Revision: https://developer.blender.org/D15893
2022-09-19 14:46:27 +02:00
fd248e6bf9 Fix T100578: Surface Deform modifier displays wrong in editmode
This was the case when the "Show in Editmode" option was used and a
vertexgroup affected the areas.

Probably an oversight in {rBdeaff945d0b9}?, seems like deforming
modifiers always need to call `BKE_mesh_wrapper_ensure_mdata` in
`deformVertsEM` when a vertex group is used.

Maniphest Tasks: T100578

Differential Revision: https://developer.blender.org/D15756
2022-09-19 14:45:44 +02:00
52a5c80313 Fix T100191: Crash with the wave modifier using normals in edit-mode 2022-09-19 14:43:01 +02:00
6d24de6c43 Fix T99979: GPencil strokes cannot be edited after set origin
The stroke points were changed but the bounding box calculation was not
done and this produced a problem in any bounding box check done by
different tools.
2022-09-19 14:39:21 +02:00
238cd2b2a4 Release cycle: Blender 2.93.11 candidate. 2022-09-19 14:36:14 +02:00
0a65e1a8e7 Release cycle: Blender 2.93.10 release. 2022-08-02 20:21:24 +02:00
977a5bbee1 Fix T99820: missing 'no more mising' tagging on reloaded libraries.
Backport of rB4d8018948ddb for 2.93 LTS.
2022-08-02 15:11:06 +02:00
d03a5fab7a Python: restrict name-space access for restricted evaluation
From [0], restrict namsepace access to anything with an underscore
prefix since these may be undocumented.

[0]: 00c7e760b3
2022-08-02 10:42:39 +02:00
ddffd1bc9f Fix (studio-reported) crash in some rare cases in blendfile read code.
Crash would happen when a linked ID would become missing, that was
'pre-declared' and used only once as a 'weak link' in another library
stored before the one it came from.

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

This fix should also be backported to 2.93.
2022-08-02 10:33:29 +02:00
bc9d461ab0 Fix Python SystemExit exceptions silently exiting
Any script that raised a SystemExit called by --python, --python-expr
command line args or by executing the text block would exit without
printing a message. This caused the error from T99966 to be hidden.

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

More details noted in code-comments.
2022-08-02 10:16:44 +02:00
41689bb310 Fix: Incorrect coordinates used in BLI_rct*_isect_segment functions
Ref D15330.
2022-08-02 10:05:03 +02:00
a2cadb786f API doc changelog generation: fix issue with version/path.
`BLENDER_VERSION_DOTS` has changed since 2.93, in that version of the
codebase it cannot be used directly to get directory in the API doc
matching Blender version.
2022-07-06 14:46:02 +02:00
3d4cfd228a Py API doc: Add some more dependencies versions requirements.
Copied over from the ones for the manual for 2.93.

This is an attempt to fix API doc generation for 2.93 LTS.
2022-07-06 12:26:08 +02:00
Gaia Clary
d7901ed607 COLLADA: Support for alpha color in vertex data.
Many thanks to the original Author of this patch: Christian Aguilera

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

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

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

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

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

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

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

Reviewed By: cristian64, SonnyCampbell_Unity
Authored by: Christian Aguilera

Differential Revision: https://developer.blender.org/D14246
2022-07-02 22:30:38 +02:00
7ec5ef4e1e Py API Doc: add runtime changelog generation to sphinx_doc_gen.py.
Optionally use `sphinx_changelog_gen.py` to dump current version of the
API in a JSON file, and use closest previous one listed in given index
file to create a changelog RST page for Sphinx.

Part of {T97663}.
2022-07-01 11:14:24 +02:00
5e4a8fa12e Py API Doc: refactor changelog generation script.
Main change is to make it use JSON format for its dump files, instead of
some Python code.

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

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

Part of {T97663}.
2022-07-01 11:12:12 +02:00
d57f57717a Fix T98699: Face dot colors in UV editor was using wrong color from theme 2022-06-16 11:00:49 +02:00
8f530d6a47 Fix (unreported) bad memory access in read/write code of MeshDeform modifier.
This abuse of one one size value to handle another allocated array of a
different size is bad in itself, but at least now read/write code of
this modifier should not risk invalid memory access anymore.

NOTE: invalid memory access would in practice only happen in case endian
switch would be performed at read time I think (those switches only check
for given length being non-zero, not for a NULL data pointer...).
2022-06-16 09:30:12 +02:00
354c22b28c Version bump: 2.93.10-rc 2022-04-20 12:08:38 +02:00
31712ce77a Version bump: 2.93.9-release 2022-04-19 16:25:25 +02:00
d2ca2c6e74 Fix T85467: Mask transform center doesn't take parent Track into account
Coordinate checks in `spline_under_mouse_get` need to take place with
the evaluated mask to get the right center. This is now more in line to
how this is done in `ED_mask_point_find_nearest`.

Note: similar issues are reported with box/circle/lasso selection in
T97135, will tackle these separately though.

Maniphest Tasks: T85467

Differential Revision: https://developer.blender.org/D14598
2022-04-19 16:11:21 +02:00
59e68d8031 Fix T97135: Fix selection issues with parented masks in the MCE
Box, Circle and Lasso select were not taking into account if a
mask(point) was parented; selection was only succeeding in the original
place.

Now check coordinates from evaluated mask (points) instead while
setting selection flags and DEG tagging still happens on the original ID.

Maniphest Tasks: T97135

Differential Revision: https://developer.blender.org/D14651
2022-04-19 16:07:22 +02:00
f1173749c2 Fix T85756: Adjust Last Operation panel is slow.
Extremely subttle bug that would only appear in some specific
circumstances, would cause memfile undo writing code to falsely detect
some ID as changed because it would get the wrong 'starting point' of
comparison with existing previous memfile step.

See T85756 for detailed explanation and reproducible case.
2022-04-19 16:00:59 +02:00
49e1144832 Correct error in 405bff7fd8
Was adding 1 to dietime twice in init_particle_interpolation.
2022-04-19 15:59:09 +02:00
d0bcb6efea Fix T68290: Baked particles don't render in final frame
Particles baked into memory would never load the final frame because
of an off-by-one error calculating the particles `dietime`.

This value indicates the frame which the particle ceases to exist but
was being set to the end-frame which caused this bug as the scenes
end-frame is inclusive.

While the last frame was properly written and read from memory,
the `dietime` was set to the last frame causing all the particles to be
considered dead when calculating the cached particle system.
2022-04-19 15:58:43 +02:00
7dd15b7113 Fix T96790: Gpencil Inverted Fill makes extra stroke at origin
The problem was the stroke was created in the inverted loop before checking if the total of points is 0 and exit the loop.

Also some code Cleanup.
2022-04-19 15:57:38 +02:00
Pratik Borhade
69cea4fce1 Fix T96624: NLA crash when reordering tracks if no object is selected.
Caused by rBc0bd240ad0a1.
To avoid crash, make boolean value false if active object data is NULL.

Should be backported to 2.93 LTS and 3.1 corrective releases.
2022-03-24 10:48:11 +01:00
Ethan-Hall
3dc36b32a1 GPU: Allow the user to set an anisotropic filtering setting below the implementation-defined value of GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT
Allow the user to set an anisotropic filtering setting below the implementation-defined value of `GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT`.

This bug-fix is also needed for 2.93 LTS.

Reviewed By: fclem

Differential Revision: https://developer.blender.org/D14392
2022-03-24 10:47:18 +01:00
b6039cd82f Fix T96243: Workbench Curvature not rendering in background.
When rendering using the command line the curvature wasn't rendered. The reason
was that the ui_scale wasn't initialized and therefore the same pixels where
sampled to detect the curvature. This is fixed by setting the ui_scale to 1 for any
image render.
2022-03-24 10:45:43 +01:00
c3fed26f37 Fix memory leak evaluating PyDrivers
Missed decref in 686ab4c940 caused every
driver evaluation to create the BPy_StructRNA depsgraph without freeing
the previously allocated depsgraph.
2022-03-24 10:44:33 +01:00
Ethan-Hall
fe6999352a Fix T96195: f-curve factorized polynomial generator broken UI
The polynomial parameters were not shown correctly.

Differential Revision: https://developer.blender.org/D14254
2022-03-24 10:43:41 +01:00
fc56ef5f97 Fix broken shapekeys: check for 'NULL' from pointer too.
Add check for `NULL` `from` pointer to `BLO_main_validate_shapekeys`,
and delete these shapekeys, as they are fully invalid and impossible to
recover.

Found in a studio production file (`animation
test/snow_parkour/shots/0040/0040.lighting.blend`, svn rev `1111`).
Would be nice to know how this was generated too...
2022-02-21 11:43:51 +01:00
6d6bb04c19 Fix T95787: Texture paint: Apply Camera Image crash for certain images
This does not happen with **any** image, but with images that have ID
properties.

ID properties are used to store view projection matrices (e.g. for
reprojection with `Image from View` or `Quick Edit` -- these are the
ones we are interested in), but of course they can be used for anything
else, too. The images in the file from the report have ID properties from
an Addon for example.

So the crash can reliably be reproduced with **any** image doing the
following:
```
bpy.data.images['myImage']['myIDprop'] = "foo"
```
This would lead code in `texture_paint_camera_project_exec` to think the
needed `view_data` is on the image (but in reality it was just some
other IDprop).

Solution is simple: just check `view_data` is really valid after getting
it from the IDprops.

Maniphest Tasks: T95787

Differential Revision: https://developer.blender.org/D14116
2022-02-21 11:42:44 +01:00
Bastien Montagne
3a9619af80 Fix T95601: Missing handling of keyingsets ID pointers in lib_query/foreach_id code
Fix T95601: Missing handling of keyingsets ID pointers in lib_query/foreach_id code.

This will have to be backported to 2.93 and possibly 2.83 if possible.
2022-02-21 11:40:35 +01:00
1ee4e6bf31 Fix T89542: Crash when loading certain .hdr files
The direct cause of the bug in question was passing in the raw memory
buffer to sscanf. It should be called with a null-terminated buffer;
which isn't guaranteed when blindly trusting the file data.

When attempting to fuzz this code path, a variety of other crashes were
discovered and fixed.

Differential Revision: https://developer.blender.org/D11952
2022-02-21 10:54:40 +01:00
87b77a97b9 Fix dna_genfile error converting signed int types to floating point
Regression in 51befa4108
caused negative values to overflow into a uint64_t.

Resolve by casting to a signed int from originally signed types.

This caused D14033 not to work properly.
2022-02-21 10:37:00 +01:00
05f631b7ad Cleanup: use an intermediate value for cast_primitive_type
Assign the actual value before casting to large uint64_t/double types.

This improves readability, especially in cases where both pointer
and integer casts were used in one expression, to make matters worse
clang-format treated these casts as a multiplication.

This also made debugging/printing the values more of a hassle.

No functional changes (GCC produced identical output).
2022-02-21 10:30:43 +01:00
3cfccf1199 Fix T95137: Spline calc_length not working with just 1 NURB point
The NURB case did not properly handle a curve with only 1 point.

Ref D13904
2022-02-21 10:23:46 +01:00
df5da16aa1 Cleanup: Avoid possible NULL pointer error
In normal conditions, `gpf` always has a value, but better move inside the NULL checking.
2022-02-21 10:12:07 +01:00
6994f9a978 Version bump: 2.93.9-rc 2022-02-02 13:26:56 +01:00
09da7f489a Version bump: 2.93.8-release 2022-02-01 22:14:24 +01:00
3735e82c27 Fix T94197: Applying boolean with fast solver clears bevel weights
For boolean operations only one of the meshes was checked to determine
if bevel weights should be created.

Now initialize custom data from both meshes flag.
Note that this is a localized fix to be back-ported, further changes
will be made so edit-mode conversion accounts for this
without the caller needing explicit checks for custom-data flags.
2022-02-01 22:09:23 +01:00
fb21201d42 Fix T94837: curve tilt on a 2-point-curve is wrong
2-point-curves are treated separately from 3plus-point-curves (assume a
lot of the twisting reduction can be skipped, so there is a dedicated
function for single segment curves).

And while using the 3plus-point-curves function [`make_bevel_list_3D`]
would actually work in this case, the dedicated function
`make_bevel_list_segment_3D` would only consider the tilt of the second
point and would just copy over the quat to the first point as well. Dont
see a reason for this, now consider the first point's tilt as well.

Maniphest Tasks: T94837

Differential Revision: https://developer.blender.org/D13813
2022-01-17 14:24:12 +01:00
49f25ae23c Fix T94089: GPencil Drawing don't Update after paste in Dopesheet
When paste new frames, the datablock need to be tagged to update the drawings.
2022-01-17 14:11:51 +01:00
4cd881c70f Fix T94903: GPencil: Copying keys doesn't preserve Keyframe Type
When a new frame is created, ensure the keytype of source key is used.
2022-01-17 14:10:55 +01:00
caf362422e Fix crash caused by exception in Python gizmo target get handler 2022-01-17 14:10:01 +01:00
ccb2456df6 Fix T94799: GPencil Strokes drawn at 0.0 Strength still visible
There was a clamp with a value greater than 0.
2022-01-17 14:08:30 +01:00
Richard Antalik
8b749260fb Fix T94768: Crash in VSE prefetching
Only the fix part of rBf2fb9a0c59a applied (P2726).
2022-01-17 14:03:58 +01:00
8e2ee4a3b7 Fix T91005: Autosplit produces unusable files
Audio PTS was reset for each new file. This caused misalignment of video
and audio streams. In Blender, these files can't be loaded, other
players will fail to align audio and video.

Since timestamps are reset intentionally, reset also video stream
timestamps.

There were other bugs:
After timestamp was reset for audio, write_audio_frames started
encoding from timeline start until target frame, so each split video
had more audio than it should.

Also audio for last frame before splitting was written into new file.

Differential Revision: https://developer.blender.org/D13280
2022-01-17 14:00:54 +01:00
1c04d22ebf Fix T93995: Cycles camera motion blur not working in right stereo view
Thanks to Michael (michael64) for identifying the solution.

Ref D13567
2022-01-11 15:52:18 +01:00
Aleksi Juvani
66346a6852 Fix PSYS_GLOBAL_HAIR stripped even if connecting the hair fails
After disconnecting hair on an object, if you then hide the particle system, and try connecting the hair again, the operator is cancelled due to `remap_hair_emitter` returning `false` because `target_psmd->mesh_final` is NULL, but `connect_hair` will still strip the `PSYS_GLOBAL_HAIR` flag, which will cause the hair in the hidden particle system to be positioned incorrectly. The correct behavior is to strip the flag only if `remap_hair_emitter` succeeds.

Differential Revision: https://developer.blender.org/D13703
2022-01-11 15:46:14 +01:00
bbad834f1c Fix T94661: Out-of-bounds memory access due to malformed DDS image file
Harden bounds check in the stream reader avoiding integer overflow.
2022-01-11 15:34:51 +01:00
d294d19d21 Fix T86952: Buffer overflow reading specific DDS images
Add a data boundary check in the flipping code.

This code now also communicates the number of mipmap levels
it processed with an intent to avoid GPU texture from using
more levels than there are in the DDS data.

Differential Revision: https://developer.blender.org/D13755
2022-01-11 15:33:37 +01:00
e07f16776b Fix T94629: The IMB_flip API would fail with large images
Fix IMB_flip[xy] to handle cases where integer overflow might occur when
given sufficiently large image dimensions.

All of these fixes were of a similar class where the intermediate
sub-expression would overflow silently. Widen the types as necessary.

Differential Revision: https://developer.blender.org/D13744
2022-01-11 15:25:49 +01:00
Aleksi Juvani
e38a0eea5c Fix: connecting hair fails on meshes with no generative modifiers
Fixes a bug introduced in rB5dedb39d447b. `mesh_original` is not set if the
mesh has no generative modifiers, in which case we can use `mesh_final`, which
would seem to be consistent with the rest of the particle code. An alternative
approach would be to make sure that `mesh_original` is always set in
`deformVerts`.

Differential Revision: https://developer.blender.org/D13754
2022-01-11 14:48:14 +01:00
Aleksi Juvani
db9ddb8a45 Fix T54488: hair disconnect/reconnect not working with modifiers
Take the Use Modifier Stack setting into account when connecting hair, and
fix wrong results results when using deforming modifiers also.

Differential Revision: https://developer.blender.org/D13704
2022-01-11 14:46:52 +01:00
1f16b5d794 Fix T94137: GPencil: Eraser does not erase first point
The eraser checks the current, previous and next point (and sets pc0,
pc1 & pc2 corresponding to that for futher occlusion/brush/clipping
checks). For the very first point, it sets pc0 to pc1 [which makes sense,
there is no previous point, so we should assume the previous segment is
"visible" as soon as the first point is], but does so *before* pc1 is
even calculated. This makes following occlusion/brush/clipping checks
work with zero values [which leads to no earsing in most cases].

Now *first* calculate pc1, *then* set pc0 to pc1.

Maniphest Tasks: T94137

Differential Revision: https://developer.blender.org/D13593
2022-01-11 14:42:30 +01:00
9336edd060 Fix T94635: Sculpt Smooth in Surface mode with Anchored Stroke crash
Sculpt Smooth in Surface mode (as opposed to Laplacian) needs a cache
initialized on first time. In anchored stroke mode with spherical falloff
this was skipped though (because this starts of with no PBVH nodes and
an early return checks for this) and `first_time` was set to false before
cache initialization.

Now move the cache initalization to happen earlier (same as the cache
initialization for automasking).

Maniphest Tasks: T94635

Differential Revision: https://developer.blender.org/D13746
2022-01-11 14:39:29 +01:00
a597164ea6 Fix T94685: python error adding Space handlers for Spreadsheet
Oversight in {rB9cb5f0a2282a}.

Above commit made an entry in `rna_Space_refine()`, but the entry in
`rna_Space_refine_reverse()` was missing (and this is what python uses
for the Space callbacks).

Maniphest Tasks: T94685

Differential Revision: https://developer.blender.org/D13751
2022-01-11 14:31:48 +01:00
3a79c1d8f5 Fix T94564: Mirror clipping is not properly placed in sculpt mode
If a mirror object is used in a mirror modifier, sculptmode did not take
this into account (and instead always clipped on the sculpt objects
local axis).

Now take this into account by storing a matrix in the preparation
function `sculpt_init_mirror_clipping` and use that later in
`SCULPT_clip`.

Maniphest Tasks: T94564

Differential Revision: https://developer.blender.org/D13711
2022-01-11 14:29:49 +01:00
8a901d4925 Fix T94366: Grease Pencil Automerge no immediate UI update
Just an oversight in rBe9607f45d85d.
Now add notifier that toolsettings changed.

Maniphest Tasks: T94366

Differential Revision: https://developer.blender.org/D13723
2022-01-11 14:17:15 +01:00
9bae5988ba Fix T94544: crash removing image used as camera background via python
Since 2.8, background images are tied to cameras (in 2.79 these were
tied to a View3D I think).
Code in `BKE_library_id_can_use_idtype` wasnt taking this relation
between `Camera` and `Image` into account, thus leading to ID deletion/
unlinking not working properly -- in particular `libblock_remap_data`
not doing its thing (and leaving the camera as a user of the image),
then things went downhill from there...

Now make the "Camera-can-use-an-Image" relation clear in
`BKE_library_id_can_use_idtype`.

Maniphest Tasks: T94544

Differential Revision: https://developer.blender.org/D13722
2022-01-11 14:16:00 +01:00
20d0cddc60 Fix T94262: Grease Pencil Blur Effect DoF mode wrong
This was visible outside of camera view and was not respecting the
"Depth of Field" checkbox on the Camera properties.

Now return early if DoF should not be visible.

Maniphest Tasks: T94262

Differential Revision: https://developer.blender.org/D13631
2022-01-11 14:14:36 +01:00
dfdc7c3f81 Fix T94422: Shading/Normals break on array modifier caps
The array modifier does not necessarily tag normals dirty.
If it doesnt, normals are recalculated "internally" using the offset ob
transform. This was happening for the array items, but not for the caps.

Now do the same thing for caps.

Maniphest Tasks: T94422

Differential Revision: https://developer.blender.org/D13681
2022-01-11 14:12:27 +01:00
81879680e9 Fix T94375: Python error when trying to add Grease Pencil brush preset
The prop name was wrong.
2022-01-11 14:10:59 +01:00
42ab4b60bd Fix T91012: Scene strip doesn't play audio
Issue was caused by adding `seq->sound` check in ded68fb102 in
function `BKE_sound_scene_add_scene_sound` as `offset_time` field was
introduced to resolve sub-frame a/v misalignment.

Scene strips don't have `bSound` allocated but also don't suffer from
a/v misalignment.

Remove `seq->sound` check and don't apply any offset for scene strips.

Reviewed By: zeddb, sergey

Differential Revision: https://developer.blender.org/D12819
2022-01-11 14:09:31 +01:00
Germano Cavalcante
5c6418b077 Fix T94109: 3d cursor crash when using shortcut
Operator was erroneously starting edge_slide operation.

Revert part of the changes in rB3fab16fe8eb4 as obedit_type was being
confused with object_mode.
2022-01-11 14:05:41 +01:00
2926f10ffe Fix/workaround macOS Rosetta crash running Cycles AVX tests
Just disable these tests on macOS for now as fixing seems hard, and we want to
be able to cross-compile and test x86_64 on Arm machines on the buildbot.
2022-01-05 21:22:08 +01:00
deca1be480 Fix Cycles AVX test failure with x86_64 build running on Arm
Don't create const avx vectors before validating if CPU supports AVX.
2022-01-05 20:10:55 +01:00
59a48cc43d Version bump: 2.93.8-rc 2021-12-15 15:37:02 +01:00
a5b7f9dc90 Version bump: 2.93.7-release 2021-12-14 17:35:31 +01:00
d23303e27d LineArt: Shifting fix for different camera fitting.
FOV was expanded to cover the shifting range,
rather than to precisely cut at the image border. Now fixed.

Reviewed By: Sebastian Parborg (zeddb)

Differential Revision: https://developer.blender.org/D11523
2021-12-14 17:31:34 +01:00
39ebb8be4d Fix T91680: viewport selection broken in macOS x86 build with Xcode 13
There is an apparent compiler bug here, tweak the code to avoid it. This did
not affect official builds as we were still using Xcode 12.
2021-12-08 15:44:23 +01:00
fb762eedbe Fix T92043: Relax/Push Pose does nothing for quaternion rotation.
As can be confirmed by checking generic code for this operation,
it is supposed to blend between the result of Breakdown based on
actual frame range, and the current pose. However for some reason
the quaternion specific code was blending between the current pose
and the current keyframed pose. This means that the operation does
nothing if invoked without modifying the pose first.

This rewrites the code to match the non-quaternion behavior.

Differential Revision: https://developer.blender.org/D13030
2021-12-07 15:43:56 +01:00
ef381ffd05 Fix T93563: Crash subdividing with overlapping tri and quad
The first loop was left out when finding the split edge boundary.

Error from f2138686d9.
2021-12-07 15:14:43 +01:00
Bastien Montagne
ca6acceb60 Fix T93353: Reload Library Override file loses Constraints, take II.
When adding `INSERT` operations over RNACollection items, rna diffing
code did not properly report the properties as not being equals.

This in turn triggered the 'purge unused exiting override properties'
mechanism, thus deleting the exitsting (valid) insert override property
operation.

NOTE: This should also be backported to 2.93, and probably 2.83.

Reviewed By: sybren, jbakker

Maniphest Tasks: T93353

Differential Revision: https://developer.blender.org/D13426
2021-12-07 15:11:57 +01:00
654967b0e0 Fix T89564: Spline IK breaks when it is far away from the world origin
The isect_line_sphere algorithm became very imprecise when the line and
the sphere were reasonably far away from the world origin.

This would lead to no intersections being reported even if there was a
guaranteed intersection (line crossing from inside the sphere to the
outside).

To fix this we now use the secant root finding method to get an
intersection point. This is much more stable and robust it seems.
2021-12-07 15:07:36 +01:00
448c838cee Fix missing Blender logo in Windows store package
D9681 was not properly merged to all branches, leaving a path to a non-existent
icon file in the maniphest.
2021-12-02 16:04:48 +01:00
5e2dc507e7 Fix T93290: Rotation without contraint after extrude has wrong axis
The default orientation of the mode was being indicated as overridden,
although the one of constraint was used.
2021-11-28 16:47:13 +01:00
f3ba6ac182 Fix T89081: Freestyle noise seed of zero crash
This leads to division by zero in Freestyle's NoiseShader which also
crashes blender.

Not sure if we really need a do_version patch for old files, as an
alternative we could also force a positive number in the NoiseShader.
This patch does not do either, just force a positive range in RNA from
now on.

Maniphest Tasks: T89081

Differential Revision: https://developer.blender.org/D13332
2021-11-28 16:43:44 +01:00
b02bdd52a4 Fix T93130: Frame Selected with selected paint mask does not work
This broke with {rB20fac2eca723} (which landed in 2.63), so long
standing bug.

Convention for paint modes is:
- when no paint mask is active, `Frame Selected` will focus the last
stroke
- when paint mask is active, `Frame Selected` will focus the selected
mask faces

To check the right vert coords we have to offset with `mp->loopstart`.

Maniphest Tasks: T93130

Differential Revision: https://developer.blender.org/D13247
2021-11-28 16:40:23 +01:00
a29283f43a Fix T93117: Texture paint clone tool crash in certain situation
Caused by {rBaf162658e127}, so long standing bug.

When changing clone slots (report involved a quite complicated sequence
of selecting textures and undo -- but I think this could happen in more
situations) code checks for UV of new clone slot.
However, since above commit the slot and the clone slot were mixed up,
so in this case the responsible NULL check (for when no UV is assigned)
wasnt working.
Now correct this (NULL check the clone slot uv -- instead of the paint
slot UV).

note: not sure why low level CustomData functions actually dont do the
name NULL checks themselves (seems like callers are always responsible).

Maniphest Tasks: T93117

Differential Revision: https://developer.blender.org/D13378
2021-11-28 16:37:06 +01:00
c2971eea84 Fix T93338: Curve Guide force field crash
Caused by {rBcf2baa585cc8}.

For Curve Guide force fields to work, the `Path Animation` option has to
be enabled. With it disabled, we are lacking the necessary
`anim_path_accum_length` data initialized [done by
`BKE_anim_path_calc_data`] which `BKE_where_on_path` relies on since
above commit.

Now just check for this before using it - and return early otherwise.
Prior to said commit, `BKE_where_on_path` would equally return early
with a similar message, so that is expected behavior here.

Maniphest Tasks: T93338

Differential Revision: https://developer.blender.org/D13371
2021-11-28 16:23:16 +01:00
647578b143 Fix T93322: Freestyle Sinus Displacement Division by Zero Crash
This happens if the Wavelength is set to 0.0f.

Not sure if we really need a do_version patch for old files, as an
alternative we could also force a slight offset in the
SinusDisplacementShader. This patch does not do either, just force a
positive range from now on.

Maniphest Tasks: T93322

Differential Revision: https://developer.blender.org/D13329
2021-11-28 16:18:29 +01:00
5121773cc5 Fix T93320: Freestyle LineStyleModifier blend 'Minimum' error
This was just a typo in {rBb408d8af31c9}
Must be 'MINIMUM' (instead of 'MININUM').

Maniphest Tasks: T93320

Differential Revision: https://developer.blender.org/D13328
2021-11-28 16:03:17 +01:00
63aa10802b Fix T93007: Cycles not updating for animated Object properties like color 2021-11-23 09:14:35 +01:00
9f73c9d656 Fix T93198: Frame Selected in greasepencil curve editing does not work
Was not taking into account curve points at all.

Maniphest Tasks: T93198

Differential Revision: https://developer.blender.org/D13281
2021-11-23 09:12:01 +01:00
f043b0334b Fix T93194: greasepencil channel lists ignoring collection visibility
Same fix as rB0a3b4d4c64f1, but this time for greasepencil.

To repeat: dopesheet in greasepencil mode was ignoring the temporariy
visibility flag of collections. As a result, even though the dopesheet
was supposed to show animation data of visible greasepencils only was
still showing such data of greasepencils that were hidden by hiding
their collection.
2021-11-23 09:09:28 +01:00
Jeroen Bakker
419b4e0b00 Fix T89260: Eevee crashes with custom node sockets.
Cause of this issue is that Custom Node Sockets info type was
initialized as SOCK_FLOAT when registering. Areas within the core that
would ignore custom socket types by checking its type would use the
socket as being a float type.

When custom node sockets have a property called default_value blender
tries to store it as an internal default value what failed in debug
builds.

This patch will set the socket type to SOCK_CUSTOM when registering a
custom socket type and allow, but skip storage of custom default values.
In this case the default values should already be stored as custom
properies.

Reviewed By: campbellbarton, JacquesLucke

Maniphest Tasks: T89260

Differential Revision: https://developer.blender.org/D13174
2021-11-23 09:07:39 +01:00
215a6f1c10 Fix T92384: Wrong UV layers used with Boolean Modifier (Fast Solver)
Ensure the layers from the source mesh are used instead of the
object referenced by the boolean modifier.
2021-11-23 08:48:59 +01:00
bf8909eb5d 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-11-23 08:44:48 +01:00
4a8f07a832 Fix T93066: Alembic export ignores Mantaflow particles
`ABCPointsWriter::is_supported` already checked for valid particle
system types (liquid, spray, foam, bubbles, ...).

`AbstractHierarchyIterator::make_writers_particle_systems` did not
create a writer for these though, so now bring these in line and also
create writers for these.
2021-11-22 16:47:55 +01:00
6cad8690c3 Fix T93074: Gpencil cutter not using flat caps in middle cuts
When cut an stroke using the option Flat Caps, the falt was not done if the cut was done in the middle of the stroke.

Now the flat is applied to the segments created and also some cleanup of the code done.
2021-11-22 16:35:51 +01:00
89adf516cd Fix T92760: Crash erasing GPencil when occlusion test is enabled
`pt0` was read when `NULL` and `is_occluded_pt1` could be read even if
it is not initialized.
2021-11-22 16:28:58 +01:00
4796865b46 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-11-22 16:20:25 +01:00
1d8d6c2f62 Fix potential crash opening 3.0 blend files in older versions.
Affects insertion of constraints or NLA tracks in liboverrides. In some
cases, when opening newer post-3.0 .blend files, the source won't be
found anymore, override apply code then needs to fail properly instead
of crashing.

Related to refactor from  rB33c5e7bcd5e5.
2021-11-22 14:29:55 +01:00
0b89b94947 Fix T92090: Eevee crash with Intel HD 4000 and macOS 10.15.7
A recent security update to macOS 10.15.7 causes crashes when using Eevee and
various other 3D viewport features. It appears that glGenerateMipmap is
broken, causing a crash whenever its commands are flushed/submitted to the GPU.

Ideally this would be fixed in a driver update, however it's unlikely this will
happen. Earlier macOS versions have been receiving security updates for 2 years,
and that window has just passed for 10.15. Further, computers with these GPUs
can't upgrade to a newer macOS version.

As a workaround, disable mipmaps on these GPUs, by setting the mipmap max level
to 0 and not calling glGenerateMipmaps. Effects like depth of field also use
mipmaps, but fill in the mip levels by other means. In those cases we keep the
mipmap level.

Differential Revision: https://developer.blender.org/D13295
2021-11-20 17:51:09 +01:00
4ec6cc412d Version bump: 2.93.7-rc 2021-11-17 17:21:44 +01:00
c842a90e2f Version bump: 2.93.6-release 2021-11-16 15:54:38 +01:00
fa99d3e53b Fix T92807: Incorrect display planar tracking.
Issue introduced in {7e66616b7e15} where the shader was replaced with a
2d image shader. This patch reverts several commits that removed the 3d
image shader.
2021-11-10 10:31:53 +01:00
3bd6b80d65 Fix T92515: Incorrect translation when scaling pose bones 2021-11-10 10:19:27 +01:00
1180b4ff4a Fix T89516: Crash on append
Caused by 37458798fa, was doing a NULL-pointer dereference because it used
the wrong pointer to check if the data-block is linked.
2021-11-04 09:11:32 +01:00
9a80455d87 Fix missing proper 'make local' call for liboverrides from outliner.
Also includes minor improvements to
`BKE_lib_override_library_make_local` itself.

This is a complement to rB37458798fa02c.
2021-11-02 14:29:33 +01:00
9a290dd657 LibOverride: Fix crash in ShapeKeys when making a mesh override local.
Weird 'embedded for overrides' flag of embedded IDs (including ShapeKeys
in override context) was not properly cleaned up when making an override
fully local.

Reported by studio, thanks.

@jbakker should be backported to 2.93LTS if possible.
2021-11-02 14:29:19 +01:00
619c51592f Fix T92608: Image Editor does not display stereo images
Caused by own {rB5aa3167e48b2}.
Related commit: {rBebaa3fcedd23}.

For stereo renders, `BKE_image_is_multilayer` is true, however we seem
to get to down to `space_image_gpu_texture_get` [where this is called]
from `IMAGE_cache_init` with a NULL Image->RenderResult.

So what then happens is that `BKE_image_multilayer_index` is called and
even though it has an appropriate codepath for stereo, it earlies out
and does not set multi_index correctly.

Still a bit puzzled why RenderResult is NULL for a render, but since
other places also check for a valid RenderResult before going down the
_multilayer_ route (and doing _multiview_ instead), now do the same
thing, BKE_image_multiview_index is now called in these cases (and seems
to behave correctly, checked with layers and passes and all seems to
display correctly, either in stereo or choosing individual eyes).

thx @jbakker & @brecht for double-checking.

Maniphest Tasks: T92608

Differential Revision: https://developer.blender.org/D13063
2021-11-02 13:25:51 +01:00
f9f6d8de58 Fix T89777 EEVEE: Contact Shadows causes wrong shading in Reflection Plane
The planar reflections being rendered at the same resolution as the HiZ max
buffer, do not need any uv correction during raytracing.

However, the GTAO horizon buffer being at output resolution do need the
uv factors in order to match the pixels visible on screen. To avoid many
complication, we increase the size of the GTAO texture up to the hiz buffer
size. This way, if planar reflections need GTAO the texture is big enough.
We change the viewport of the GTAO framebuffer for the main view in order
to not have to modify Uvs in many places.
2021-11-02 13:17:28 +01:00
Ankit Meel
8e237d83f2 Fix T88877: 2.93: Crash on recent OSX with a non-English locale.
Looks like OSX changed the default format of its locale, which is not
valid anymore for gettext/boost::locale.

Solution based on investigations and patch by Kieun Mun (@kieuns), with
some further tweaks by Ankit Meel (@ankitm), many thanks.

Also add an exception catcher on `std::runtime_error` in
`bl_locale_set()`, since in OSX catching the ancestor `std::exception`
does not work with `boost::locale::conv::conversion_error` and the like
for some reasons.

Reviewed By: #platform_macos, brecht

Maniphest Tasks: T88877

Differential Revision: https://developer.blender.org/D13019
2021-11-02 13:15:45 +01:00
77104bf318 Fix T92355: Quadriflow crashes with zero length edges
Add a check for zero length edges to the manifold check as quadriflow
doesn't handle meshes with these.
2021-11-02 13:13:41 +01:00
28d581af92 Fix T91411: Outliner crash using contextmenu operators from a shortcut
Oversight in {rBb0741e1dcbc5}.

This was guarded by an assert in `get_target_element`, but it can be
valid to have these assigned to a shortcut (and then perform the action
without an active outliner element).

Now remove the assert and let the operator polls check if we really have
a target element.

note: this basically makes `get_target_element` obsolete, could call
`outliner_find_element_with_flag` instead in all cases.

Maniphest Tasks: T91411

Differential Revision: https://developer.blender.org/D12495
2021-11-02 13:10:44 +01:00
Jacob Lewallen
7d2b6a213f Pass correct array size to BKE_object_material_remap_calc
This was patch D12460 from jlewallen and fixes T91339 and T90818.
2021-11-02 12:57:51 +01:00
852d10bd3d Fix T92265: Outliner crash clicking override warning buttons
`outliner_draw_overrides_buts` uses `uiDefIconBlockBut` but doing so
without defining a function callback to actually build a block.
This will make the button go down the route of spawning a popup, but
without a menu. Crash then happens later accesing the (missing) menu in
`ui_handler_region_menu`.

So while we could dive into making this usage failsafe (carefully
checking `BUTTON_STATE_MENU_OPEN` in combination with
`uiHandleButtonData->menu` being NULL all over), but it seems much more
straightforward to just use `uiDefIconBut` (instead of
`uiDefIconBlockBut`) since this Override Warning buttons seem not to
intend spawning a menu anyways?

Maniphest Tasks: T92265

Differential Revision: https://developer.blender.org/D12917
2021-11-02 12:56:35 +01:00
2491bc5ec7 Fix T92314: Auto naming of the Vertex Group doesn't work for Grease
Pencil

Not naming the auto-generated vertexgroup after the selected bone was
just confusing (since the group would not have an effect), so now use
similar code that is used for meshes for greasepencil as well.

Maniphest Tasks: T92314

Differential Revision: https://developer.blender.org/D12906
2021-11-02 12:55:01 +01:00
5a5788ace2 Fix T92246: sculpt crash displaying statistics in certain situations
It seems possible to switch object selection (if `Lock Object Modes` is
turned off) and end up with an object that has a SculptSession but a
NULL PBVH.
(I was not able to repro from scratch, but file from the report was
clearly in that state).

This would crash in displaying scene statistics.

While there might be a deeper fix (making sure PBVH is available early
enough -- possibly using `BKE_sculpt_object_pbvh_ensure`,
`sculpt_update_object` or friends), there are also many checks in tools
for PBVH, so the situation seems to be somewhat vaild/expected also in
other places.
So to fix this, just check for a non-NULL PBVH, returning early
otherwise.
Note: this leaves us with displaying 0/0 Faces & Vertices in the borked
case until an operation takes place that updates the PBVH.

Maniphest Tasks: T92246

Differential Revision: https://developer.blender.org/D12904
2021-11-02 12:53:03 +01:00
554b1b1663 Fix missing null-terminator in BLI_string_join_arrayN
Although the documentation says so, the null-terminator was missing.
This could cause crashes when logging shader linking errors as shader
sources are empty in this case.
2021-11-02 12:50:31 +01:00
272cb6157d Fix T88766 EEVEE: Missing glossy reflections with Shader to RGB & SSR is active.
This was due to the shading evaluation being outdated inside the ShaderToRGBA
glsl code.
2021-11-02 12:48:29 +01:00
71799d46b4 Fix T91398 Overlay: Camera BG jitter offset (regression)
This was caused by camera background being rendered in world space, causing
floating point imprecision issues when camera was far from origin.

Adding a uniform to change vertex shader to process everything in viewspace
to fix the problem.
2021-11-02 12:38:09 +01:00
dff17b0893 Fix T92185: GPencil memory leak removing stroke from python
The API was not removing the weights, points and traingulation data. Only it was removing the stroke itself.
2021-11-02 12:35:22 +01:00
d3f0470289 Fix LLVM 12 symbol conflict with Mesa drivers, after recent Linux libs update 2021-11-02 12:33:35 +01:00
31dfdb6379 Add missing "CUDA_ERROR_UNSUPPORTED_PTX_VERSION" to CUEW
This is required for Cycles to report a meaningful error message when it fails to load a PTX module
created with a newer CUDA toolkit version than the driver supports.

Fix crash when kernel loading failed (T91879)

Ref T91879
2021-11-02 12:30:28 +01:00
Gottfried Hofmann
ac42e58e31 Expose Color Management as argument for gpu.types.GPUOffScreen.draw_view3d()
Fix for https://developer.blender.org/T84227

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

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D11645
2021-11-02 12:02:25 +01:00
71f354a825 Fix T89164: Sculpt "Smooth" brush crash with zero pressure
Caused by {rB3e5431fdf439}

Issue is that sculpting could start with using `SCULPT_smooth` and
(because of the Pressure sensitivity dropping to zero) code would switch
to `SCULPT_enhance_details_brush` at strength zero.
Issue with this though is that this can be in the middle or end of a
stroke and the necessary `ss->cache->detail_directions` are only
initialized for the first brush step (see
`SCULPT_stroke_is_first_brush_step` in `SCULPT_enhance_details_brush`).
With these missing, it could only go downhill from there.

Suggest to prevent the "mode-flip" from `SCULPT_smooth` to
`SCULPT_enhance_details_brush` (happening solely because of pressure
strength) by changing the condition.
Now do `SCULPT_enhance_details_brush` only if strength is **below** zero
and `SCULPT_smooth` else (flipping from enhance_details to regular smooth
is fine).

If inverting the brush in the middle of the stroke will be supported at
some point, the codepath of `smooth` would have to inform the cache that
invert changed and detail_directions would have to be initialized then
(even if not at the start of the stroke).

Maniphest Tasks: T89164

Differential Revision: https://developer.blender.org/D12676
2021-11-02 11:54:35 +01:00
53fd7abfe7 Fix T91237: Wrong Editors could sync animation 'Visible Range'
This was reported for the Outliner.

It was possible to set 'show_locked_time' on any space (via python, not
sure if there are other ways to achieve this).
Navigating in an animation editor obviously ruined the layout in certain
Editors that are not made for this.

Now restrict syncing to editors that support it well (the ones that have
this setting exposed in their menus) and prevent setting this in RNA.

Maniphest Tasks: T91237

Differential Revision: https://developer.blender.org/D12512
2021-11-02 11:35:46 +01:00
aaa85ad2e0 VSE: Implement sanity check for files with more channels than supported
This is a follow up to 8fecc2a852.

This makes sure future .blend files that have more channels than the
limit won't break Blender.

For LTS this happens silently, without warning the users.

This is part of https://developer.blender.org/D12645

Differential Revision: https://developer.blender.org/D12648
2021-11-02 11:32:24 +01:00
5d8a7ba7de Fix T91728: Cycles render artifacts with motion blur and object attributes 2021-11-02 11:16:58 +01:00
6489f2212b Fix T88386: Continuous Grab occasionally jumping on Arm64 MacOS
During the processing of a continuous drag event, other mouse move
events may be in the queue waiting to be processed.

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

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

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

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

Using this updated method fixed the problem.

Differential Revision: https://developer.blender.org/D12202
2021-11-02 10:58:14 +01:00
379ffa75aa Fix T90840: Can't duplicate or copy (Ctrl-C) object from linked file.
We need to separate the flag telling duplicate code to not handle
remapping to new IDs etc., from the one telling the code that we are
currently duplicating a 'root' ID (i.e. not a dependency of another
duplicated ID).

This whole duplicate code/logic is still fairly unsatisfying, think it
will need further refactor, or maybe even re-design, at some point...
2021-11-01 09:59:20 +01:00
d56d5bfafc Fix T87703: Failed assert when dragging object data-block into 3D View
Talked with Bastien and we ended up looking into this. Issue is that the
dupliation through drag & drop should also be considered a
"sub-process", like Shift+D duplicating does. Added a comment explaining
why this is needed.
2021-11-01 09:43:30 +01:00
0930a70e81 Version bump: 2.93.6-rc 2021-10-06 12:52:36 +02:00
a791bdabd0 Versioin bump: 2.93.5-release 2021-10-05 14:04:58 +02:00
af42086e74 Fix building without audaspace 2021-09-27 08:30:29 +02:00
1ff10bb6d1 Fix 'WM_window_find_under_cursor'
This function was not working if the window is partially out of screen space.
2021-09-27 08:28:46 +02:00
4528c9a357 Fix default surface resolution U/V mis-match
The resolution for surfaces was 12 for U, 4 for V,
where both should have been set to 4.

Regression in 9a076dd95a
2021-09-27 08:24:52 +02:00
5b588282a6 Fix T91557: Texture Paint Stencil doesnt use assigned UV Layer
Choosing a UV layer would actually affect the overlay in the viewport
and also painting with the mask brush was in that UV space, but the
resulting stencil mask was always applied with the active UV (not the
explicitly selected stencil UV -- the one one is looking at in the
viewport!) to painting.

This has been like that as far as I have checked back (at least 2.79b),
I am surprised this has not come up before, but it does not seem to make
sense at all...

Now use the UV specified for the stencil layer when applying the mask for
painting, so it corresponds to the stencil mask one is looking at in the
viewport.

Maniphest Tasks: T91557

Differential Revision: https://developer.blender.org/D12583
2021-09-27 08:24:24 +02:00
25440e2a91 Fix T91607: GPencil Tint modifier "apply" removes the effect 2021-09-27 08:23:32 +02:00
93c7e83b2a Audaspace: porting upstream pulseaudio fixes.
Fixes T89045 and T91057.
2021-09-22 08:36:48 +02:00
Jake
651f1b5cf9 EEVEE fix gloss low roughness error
Up lower clamp on spec_angle to prevent NaN from being generated on intel GPUs at low roughness.

Fixes T88754

Reviewed By: fclem

Maniphest Tasks: T88754

Differential Revision: https://developer.blender.org/D12508
2021-09-22 08:36:27 +02:00
f2e96c2473 Fix T87801: Eevee ambient occlusion is incorrect on M1 macMini
The issue was caused by `textureSize()` returning the size of the level 0
even when the min texture level is higher than 0.

Using a uniform to pass the correct size fixes the issue.

This issue also affected the downsampling of radiance for reflections and
refractions.

This does not affect anything other than the recusive downsampling shaders.
2021-09-22 08:33:31 +02:00
934c724755 Fix T91534: GPencil interpolate Sequence fails if stroke has 0 points
In some cases the stroke has 0 points and this must be skipped in the interpolation.
2021-09-22 08:32:52 +02:00
cc31c159a1 Fix T91511: GPencil weight_get and Vertex Groups not working at expected
The API was checking the number of total weights with the first point of the stroke and this was not valid because each point can have different number of weight elemnts,
2021-09-22 08:31:44 +02:00
8235d4dea6 Fix T91448: GPencil Fill simplify not working in render
The simplify was hardcode to be disabled in render.
2021-09-22 08:31:12 +02:00
cbf18b6586 Fix straightline gesture snapping not working for modal tools
This was implemented in {rB14d56b4217f8} but was never working for
tools/operators other than the sculpt line mask tool.

To be precise, the preview actually snapped but the operations (e.g.
mesh bisect, vertex weight gradient) still happened "unsnapped" in
modal. For the sculpt line mask tool this wasnt a problem, because it
only draws a preview while modal, the actual mask was only applied
later.

This solves part one of T91320 (snapping), sculpting also introduced
flipping in {rB7ff6bfd1e0af} which does not make much sense for all
tools, but in bisect this could actually be supported, will add that in
a separate Diff.

ref T91320

Maniphest Tasks: T91320

Differential Revision: https://developer.blender.org/D12470
2021-09-22 08:30:41 +02:00
ec448d5a6a Fix memory leak if an error occurred assigning id-property sequence 2021-09-22 08:29:47 +02:00
e90aabdebf Fix T89241: Scale to fit overflows into a second line 2021-09-22 08:29:26 +02:00
597d9518ef Fix T91159: GPencil Smooth brush is using Affect Pressure but not used
The parameter wa sin the UI but was not used because it was replaced by Use Thickness.
2021-09-06 09:37:00 +02:00
333db02e5d Fix T88433: no greaspencil depsgraph evaluation with certain drivers
When the same stroke was used as a driver variable, this could make this
stroke already tagged as built in the course of building driver
variables (via `build_gpencil`), but then important stuff from
`build_object_data_geometry_datablock` could be missed later on (because
both of these funtions use `checkIsBuiltAndTag`). Most importantly,
setting up operations such as GEOMETRY_EVAL would be skipped entirely.

`build_object_data_geometry_datablock` seems to cover greasepencil just
fine (does the same as `build_gpencil` and more). Proposed solution is to
remove `build_gpencil` entirely. In `build_id` it would then also call
`build_object_data_geometry_datablock` for `ID_GD` IDs. Now the covered
types that _call_ `build_object_data_geometry_datablock` match exactly
to what is covered _inside_ `build_object_data_geometry_datablock`.

Think this "duplication" of functionality was just overseen in
rB66da2f537ae8 [`build_gpencil` existed long before and said commit made
greasepencil a real object with geometry and such].

thx @JacquesLucke for additional input!

Maniphest Tasks: T88433

Differential Revision: https://developer.blender.org/D12324
2021-09-06 09:36:36 +02:00
f0b3b6710c Fix T91060: GPencil Time Offset Modifier breaks evaluation time
Caused by {rBf3bf87e5887c}.

When using a GPencil Time Offset Modifier, the bGPDlayer>actframe can be
NULL. This can be determined though, but above optimization commit
skipped getting the active frame in this case entirely (with the
intention to only get it if framenumbers did not match).

Now also call BKE_gpencil_layer_frame_get() if actframe is NULL in order
to fetch a valid one if present.

Maniphest Tasks: T91060

Differential Revision: https://developer.blender.org/D12355
2021-09-06 09:36:16 +02:00
ae7ec34dfe Fix T88887: Audio causes issues with Playback when PC put to Sleep, Hibernate or when Screensaver appears
Porting WASAPI device reinitialization from upstream.
2021-09-06 09:35:14 +02:00
16637e7ff4 Fix error scaling thumbnails to zero dimensions
Follow up to fix for T89868.
2021-09-06 09:34:19 +02:00
d6facd44b5 Fix T88909: Win32 getTitle() UTF8 Support
In the Win32 platform our setTitle() can properly assign a Unicode
utf-8 window title. Unfortunately our getTitle() will only read regular
8-bit character strings. This means that we can never compare what we
set to what we get. This patch updates getTitle() to use Unicode-aware
GetWindowTextLengthW and GetWindowTextW.

see T88909 for an example of this affecting user experience.

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

Reviewed by Ray Molenkamp
2021-09-06 09:33:45 +02:00
933c6b7d8a Fix "Text to Object" creating invisible object
Newly created objects would not become visible until
another action forced a depsgraph update.
2021-09-06 09:30:29 +02:00
969d6d3a0f Fix invalid mask use for the UV-project modifier
Mistake in a30a817933.
2021-09-06 09:30:03 +02:00
515bdda3d9 Fix buffer size mismatch in SCRIPT_OT_python_file_run
Reading paths over 512 bytes would cause a buffer overrun.
2021-09-06 09:28:46 +02:00
74ba0f8bd8 Fix T88812: Child Windows on Vertical Monitors
This patch improves the positioning of child windows when on monitors
that are arranged vertically (any above any other). When calculating a
window position in Ghost coordinates from GL coordinates we were using
monitor height, which can give incorrect values when desktop is taller
than any single monitor. So use desktop height instead.

See D10637 for more details and examples.

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

Reviewed by Brecht Van Lommel
2021-09-06 09:27:41 +02:00
1341664e48 Audaspace: porting PulseAudio fixes from upstream. 2021-09-06 09:27:12 +02:00
c6c9e361e2 Audaspace: porting pulseaudio fixes from upstream. 2021-09-06 09:26:12 +02:00
1af6e0daaf Fix T90772: Image Editor not sampling color from the the currently
selected pass

Caused by {rBebaa3fcedd23}.

Seems this above commit assumed an ImageUser's multi_index is only used
for Multiview/Stereo? This is not the case, multi_index also stores the
index for layer/pass combination.

If we call both BKE_image_multilayer_index and BKE_image_multiview_index
(even though this is not appropriate/needed for multilayer images?), we
might end up overwriting multi_index again.

note: looking at this I was also wondering why we update the ImageUser
in image-buffer-aquiring funnctions [and not from the UI, e.g.
template_image_layers, but that is a whole different story I guess, see
comment in T90772 as well]

note2: this could also use a utility function (this is not the only
place where this is done), this is fo a cleanup commit.

Maniphest Tasks: T90772

Differential Revision: https://developer.blender.org/D12267
2021-09-06 09:24:38 +02:00
52fdf42d35 Fix T90651: camera reconstruction crash without scene camera
This was working differently in 2.79, tried tracking this down and it
seems this was wrong since the 2.8 beginning in {rB7907dfc40018}.

This would not only crash without an active scene camera, but would also
result in different tracks from different camera's constraints could not
be selected.

So select id depends on corresponding camera, remove the dependency on
scene camera completely.

Maniphest Tasks: T90651

Differential Revision: https://developer.blender.org/D12230
2021-09-06 09:22:46 +02:00
ae1a57a05e Version bump: 2.93.5-rc 2021-09-01 13:53:24 +02:00
b7205031ce Version bump: 2.93.4-release 2021-08-31 11:23:20 +02:00
7ec351c0d5 FFMPEG: Fix building with older versions that need FFMPEG_USE_DURATION_WORKAROUND 2021-08-25 15:43:14 +02:00
85c08c9717 VSE: Flush audio encode after finishing video export
We didn't flush audio after encoding finished which lead to audio
packets being lost.

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

Reviewed By: Richard Antalik

Differential Revision: http://developer.blender.org/D11916
2021-08-25 15:43:01 +02:00
f53cdbdd27 Pipeline: Use more explicit cuda versions. 2021-08-23 13:50:02 +02:00
1a4122d441 Add sanity NULL checks when loading sound sequences
Would cause crashes in files that had lingering invalid sound sequences around.
For example our tests/render/volume/fire.blend test file.
2021-08-23 11:55:26 +02:00
e97a2c228e Fix T87967: M2T video seeking is broken
Bug caused by integer overflow in ffmpeg_generic_seek_workaround().
Function max_ii() was used to limit int_64tvalue.

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

Reviewed By: zeddb

Differential Revision: https://developer.blender.org/D11888
2021-08-23 11:54:30 +02:00
c634d859b2 VSE: Use lines to draw waveform
Refactor and improve waveform drawing.

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

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

Reviewed By: Richard Antalik

Differential Revision: https://developer.blender.org/D11184
2021-08-23 11:53:18 +02:00
489df7ac88 VSE: Fix audaspace not reading ffmpeg files with start offset correctly
The duration and start time for audio strips were not correctly read in
audaspace.

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

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

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

Differential Revision: http://developer.blender.org/D11917
2021-08-23 11:21:31 +02:00
00dd68405d VSE: Fix seeking issues.
The seek pts was not correctly calculated.
In addition to that we were not seeking in the video pts time base.

Reviewed By: Richard Antalik

Differential Revision: http://developer.blender.org/D11921
2021-08-23 11:20:32 +02:00
d486d24868 VSE: Fix video strip duration calculation
The video duration was not read correctly from the video file.

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

Reviewed By: Richard Antalik

Differential Revision: http://developer.blender.org/D11920
2021-08-23 11:19:17 +02:00
54a821e8fd VSE: Fix memory leak when adding bad image/movie strips
If the add strip operator errored out, we wouldn't free custom data allocated

Reviewed By: Richard Antalik

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

Reviewed By: Richard Antalik

Differential Revision: http://developer.blender.org/D11918
2021-08-23 11:17:55 +02:00
ab572f3ac1 Fix: instances are made real when they shouldn't be
The original assumption that the `modifyMesh` function is only
called when the modifier is applied was wrong. There are still a
couple of other places calling it through `BKE_modifier_modify_mesh`.

Now there is an extra check that makes sure instances are only
realized when the modifier is actually applied.
2021-08-23 11:15:17 +02:00
3fa1de6ad6 Fix T90737: VSE adding nested strips could have non-unique names
Caused by {rBbbb1936411a5}.

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

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

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

Maniphest Tasks: T90737

Differential Revision: https://developer.blender.org/D12256
2021-08-23 11:14:53 +02:00
f311542182 Fix T90719: Boost sources dowload address needed to be updated. 2021-08-23 11:10:34 +02:00
Matteo F. Vescovi
9d94b358ca Fix FTBFS on mips64el architecture
While trying to get Blender 2.93.x LTS to build fine on all release architectures in Debian, I noticed that the misleading use of "mips" as integer variable caused problems when compiling on mips64el. The patch should fix the issue.

Reviewed By: fclem

Differential Revision: https://developer.blender.org/D12194
2021-08-23 10:05:49 +02:00
9fb9bf5996 Fix: DNA struct alignment on 32 bit
Some of the dna structs were not properly
aligned for 32 bit builds causing issues
for some of the 32 platforms Debian builds
for.

Reviewed By: sergey, brecht
Differential Revision: https://developer.blender.org/D9389
2021-08-23 10:05:01 +02:00
70df9119f4 Makesdna: Fix detecting 32 bit padding issues.
Makesdna fails to detect issues in 32 bit code that can
only be resolved by adding a padding pointer.

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

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

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

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

Reviewed by: sergey, campbellbarton
2021-08-23 09:43:18 +02:00
06e3e2f21c Fix T90364: buttons (partially) behind animchannel search block search
When channels are scrolled to be (partially) behind the search bar,
their widget buttons would still be interactive, preventing the seach
buttons to be usable.

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

Maniphest Tasks: T90364

Differential Revision: https://developer.blender.org/D12103
2021-08-23 09:34:42 +02:00
c2ba9be098 Fix NLA action cannot be unlinked in certain cases
The poll for unlinking calls `nla_panel_context` without providing an
adt pointer, and there is a check for this pointer in
`nla_panel_context` leading to never returning true if it is not
provided. (this is fine if there are tracks already, poll would succeed
in this case, `nla_panel_context` goes a different code path then)

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

Part of T87681.

Maniphest Tasks: T87681

Differential Revision: https://developer.blender.org/D11041
2021-08-23 09:34:07 +02:00
60dbbaac42 Fix T88498: 'Clear Parent' does not clear parent_bone
Clearing the parent from the UI using the X (or from python) clears the
`parsubstr` and set `partype` back to `PAROBJECT`.

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

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

Maniphest Tasks: T88498

Differential Revision: https://developer.blender.org/D11503
2021-08-23 09:33:24 +02:00
47618781d8 Fix T89805: NLA crash without active track
Was reported for a file which does not have an active track set in
AnimData even though it was in strip twek mode (but this was accessed in
is_nlatrack_evaluatable()).

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

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

Reviewers: sybren

Maniphest Tasks: T89805

Differential Revision: https://developer.blender.org/D12085
2021-08-23 09:33:01 +02:00
c2f74d6243 BLI_math: Fix several division-by-zero cases.
Those were caused by various tools used on degenerate geometry, see
T79775.

Note that fixes are as low-level as possible, to ensure they cover as
much as possible of unreported issues too.

We still probably have many more of those hidden in BLI_math though.
2021-08-23 09:32:38 +02:00
0cd6c1d502 Fix T88998: GPencil not projecting to the most front surface
It was projecting from the stroke position.

The behavior has changed in {rB5400be9ffee2}.
2021-08-23 09:21:44 +02:00
d97e586f58 Geometry Nodes: Fix vector math project bug
Implementation is incorrect compared to Cycles/Eevee.

Reported by @DrDubosc in comments of T88922.

Differential Revision: https://developer.blender.org/D12029
2021-08-23 09:20:41 +02:00
690fa2ba86 PyAPI: resolve build error with Python 3.10
Resolves T89931
2021-08-23 09:19:53 +02:00
7b1e8e244c Fix T90493: Undo a knife-project operation crashes
The crash occurred calling because mesh_get_eval_final in edit-mode
freed all derived mesh data without tagging the object for updating.

However meshes in edit-mode weren't meant to be used as knife-project
source-data, adding support for multi object edit-mode  caused this.
2021-08-23 09:18:47 +02:00
06ecdab9bc Fix T88033: Python reference memory leaks for non main data-blocks
ID data-blocks that could be accessed from Python and weren't freed
using BKE_id_free_ex did not release the Python reference count.

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

Add asserts to ensure no Python reference is held in situations
when ID's are copied for internal use (not exposed through the RNA API),
to ensure these kinds of leaks don't go by unnoticed again.
2021-08-23 09:18:22 +02:00
85b28933f0 Fix T89241: 3D Text "Scale to Fit" wraps onto the second line
Disable wrapping when "scale to fit" is used, assert the error is
small so an invalid scale-to-fit value wont go by unnoticed.
2021-08-23 09:14:53 +02:00
e1e2abd4bf Fix memory leak in edit-mesh dissolve degenerate 2021-08-23 09:08:03 +02:00
2cbfa786f3 Fix T89306: GPencil selection doesn't work correctly with modifiers
The problem was introduced with Bezier modification because the selection code was using the original stroke and not the evaluated version.
2021-08-23 09:07:15 +02:00
9eb62b99bc Fix T90791: Knife project leaks memory with curve/text cutter 2021-08-23 09:06:44 +02:00
1e736d8a95 Cleanup: rename BKE_mesh_free -> BKE_mesh_free_data
It wasn't obvious this didn't free the memory of the mesh it's self
leading to memory leaks.
2021-08-23 09:05:20 +02:00
afde98a826 Cleanup: accidentally included printf 2021-08-23 08:54:42 +02:00
20f04ce62a Fix memory leak with building springs in the cloth simulator
Error in 2788b0261c.
2021-08-23 08:54:06 +02:00
63559a779c Version bump: 2.93.4-rc 2021-08-18 14:30:18 +02:00
8b80d19f36 Fix T88552: Cycles changing Render Passes in viewport does not work
Backporting this fixes T90599.
2021-08-17 20:30:22 +02:00
9fca86d549 Version bump: 2.93.3-release 2021-08-17 15:01:53 +02:00
1eeae9be15 [2.93 only] pose slide factor wrong in redo popup
Originally this was caused by {rBc71a8e837616}.
Above commit wasnt renaming RNA definitions, but not the occurances were
RNA values were set.

In 3.0, we had improvements to pose-sliding tools (D9054) where this was
somewhat ironed out (only partially, see D12187).

But since the pose-sliding improvements are not part of 2.93, we have to
correct this in 2.93 ONLY.

Maniphest Tasks: T89027

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

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

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

Note that both commits adding those lines are from stone ages (2009):
rBcbc2c1886dee and rB50e3bb7f5f34.
2021-08-09 08:25:14 +02:00
45efd0b6a1 Fix T89835: Crash after Instancing to Scene after making linked Collection local.
Even though the ID itself remain the same after being made local, from
depsgraph point of view this is a different ID. Hence we need to tag all
of its users for COW update, as well as rebuild depsgraph relationships.

Should be also backported to LTS 2.93 (and 2.83 if possible).
2021-08-09 08:23:05 +02:00
2ccf4b15cc Fix T87041: Driver Editor not updated in realtime
Caused by {rBbbb2e0614fc3}

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

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

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

Maniphest Tasks: T87041

Differential Revision: https://developer.blender.org/D12003
2021-08-09 08:22:34 +02:00
6e987ca32a Fix T78469: Output Metadata: Strip Name no longer accessible
Caused by rB7fc60bff14a6.

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

Maniphest Tasks: T78469

Differential Revision: https://developer.blender.org/D12084
2021-08-09 08:19:14 +02:00
1fa73076ca Fix T88807: crash when there are multiple links between the same sockets
This commit does two things:

* Disallows creating more than one link from one socket to a multi socket input.
* Properly count links if there happen to be more than one link between the same sockets.

The new link counting should also be more efficient asymptotically.

Differential Revision: https://developer.blender.org/D11570
2021-08-09 08:18:26 +02:00
4e14fe167d Fix particle system duplication duplicates all systems
Followup to rB3834dc2f7b38 (where getting the proper particle system was
fixed for the Adjust Last Operation panel in the Properties Editor). But
since this operator can also be called from the 3DView, get a current
particle system there as well.

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

ref. T83317

Maniphest Tasks: T83317

Differential Revision: https://developer.blender.org/D12033
2021-08-09 08:17:34 +02:00
Jagannadhan Ravi
2ae04254b3 Speedup rigid body "Copy from Active" operator
If there were lots of selected objects without an existing rigid body,
we would add rigid bodies to them one by one.

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

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

Reviewed By: Sebastian Parborg

Differential Revision: http://developer.blender.org/D11957
2021-08-09 08:16:23 +02:00
Yann Lanthony
443ae0f22d Fix T89952: GPencil channel box selection offset
The channel box selection was offset for grease pencil layers.

This is a proposed fix by @yann-lty

Before:
{F10227973}

After:
{F10227974}

Reviewed By: #grease_pencil, antoniov

Maniphest Tasks: T89952

Differential Revision: https://developer.blender.org/D11962
2021-08-09 08:15:29 +02:00
69edb9c7d9 LineArt: Occlusion accuracy fix.
This patch fixes occlusion function to handle one specific case (when an edge shares a point with triangle) better,especially when there's overlapping edges in this case.
2021-08-09 08:14:06 +02:00
a818ad5a54 Fix memory leak with Python RNA property get callback errors
Failure to return a list of the expected size & type wasn't
decrementing the value, leaking a reference.

Caused by 127b5423d6 a workaround for the
real error that was fixed f5e020a7a6.
2021-08-09 08:13:28 +02:00
bc627fbf65 Fix gpu.types.GPUTexture crash when the size argument was too big
Missing length check on the size argument before copying it
into a fixed size buffer.
2021-08-09 08:13:05 +02:00
2be2aeaf0a Fix memory leaks in Python gizmo get/set handlers 2021-08-09 08:11:00 +02:00
db5501eb6e Revert "Fix spin-gizmo not allowing click events to select vertices"
This reverts commit 0b903755a9.

This caused T86030, left-mouse selection override clicking,
which is used for creating a full revolution.
2021-08-09 08:10:04 +02:00
168965835c Fix T85436: Separate by loose parts doesn't show new objects
Only the "changed" state from the last edit-object was used,
this meant the operator would not perform the necessary update
with multi-object edit-mode.

Use "changed" & "changed_multi" naming convention.
2021-08-09 08:09:30 +02:00
2bb38f3022 Fix T90417: font loading creates duplicate ID names
Also repair any errors in existing files.

Error from e0dd3fe587.
2021-08-09 08:06:52 +02:00
a1b687c7a4 Fix broken logic in Windows directory query function
Mistake in a5bbdd6998
2021-08-09 08:02:01 +02:00
f6665f506b Fix T89450: Crash slicing BMEditSelSeq
Slicing with indices greater than the length of the sequence would crash.
2021-08-09 08:01:19 +02:00
e862874606 Fix slicing with negative indices
Negative indices that remained negative after adding the sequence length
caused incorrect slicing.

With the default scene for example:

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

Gave a different result to:

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

Clamp indices above zero so loops that step forward works as intended.
2021-08-09 08:00:16 +02:00
4d7f10d614 Fix fix invalid index use for edit-mesh laplacian smooth
Only vertex indices were ensured to be correct.
2021-08-09 07:59:37 +02:00
ec00d218c9 Fix T90477: Cursor vertex snapping not working in UV editor
`t->obedit_type` is read to indicate if we are in uv edit mode.

Also fixes a crash introduced in {rBdd14ea18190ff27082009f73a556569a43377a71}.
2021-08-09 07:57:24 +02:00
fb7510087f Version bump: 2.93.3-rc 2021-08-04 16:17:57 +02:00
1eb06de260 Version bump: 2.93.2 release. 2021-08-03 07:58:55 +02:00
cb6d1b76dc Remove pipeline_config.json
File is replaced by pipeline_config.yaml.
2021-08-02 14:46:16 +02:00
45ed762124 Cycles: upgrade CUDA to 11.4
This fixes a performance regression on Ampere cards, on specific scenes like
classroom. For cycles-x there is little difference, but this is still helpful
for LTS releases, and we need to upgrade at some point anyway.
2021-07-27 14:05:40 +02:00
fdb811f030 Fix T89884: Cycles stuck on first sample in viewport render
This is a backported of 97f1e47, which was an optimization but also
fixes this bug.

Ref D11279
2021-07-26 18:05:40 +02:00
256ab174d8 Added pipeline config formatted in yaml. 2021-07-26 14:57:21 +02:00
Himanshi Kalra
60a0928f35 Fix T85517: Cannot type Space while holding Shift key in text-field like spaces.
Fix for T85517
Bug: Couldn't type space while holding down the shift key in text spaces (e.g. when saving a file, changing the name of object).

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

Reviewed By: harley, mont29

Maniphest Tasks: T85517

Differential Revision: https://developer.blender.org/D10452
2021-07-26 09:36:11 +02:00
Yann Lanthony
59b77cd688 Fix T89733: Py API: bpy.data.orphans_purge argument parsing
On Windows, using `bpy.data.orphans_purge` with some arguments (eg: `do_recursive=True`) does not produce the expected results. This is due to arguments not being parsed correctly on this platform with the current code.

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

Reviewed By: #python_api, mont29

Maniphest Tasks: T89733

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

Maniphest Tasks: T89982

Differential Revision: https://developer.blender.org/D11972
2021-07-26 08:42:53 +02:00
00b135a379 Fix T89981: missing refresh on the compositors render layer node when adding/removing AOVs
Just refresh the node's outputs via ntreeCompositUpdateRLayers().

Maniphest Tasks: T89981

Differential Revision: https://developer.blender.org/D11973
2021-07-26 08:41:53 +02:00
283481643c Fix T89736: Cycles error with persistent data, displacement and motion blur 2021-07-26 08:40:36 +02:00
3e6ea470ee Fix T89851: Geometry nodes: wrongly detected "Node group has unidentified
nodes or sockets" error

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

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

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

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

Maniphest Tasks: T89851

Differential Revision: https://developer.blender.org/D11911
2021-07-26 08:39:24 +02:00
25a1b27a93 LineArt: Fix crash due to empty duplicollection. 2021-07-26 08:36:55 +02:00
81e12cd9b1 Fix T89455: Cycles crash when rendering a Mesh with autosmooth
The crash was caused by a mistake in 5f9677fe0c
where the pointers to the custom data layers would be overwritten with the one
for the first layer, as CustomData_duplicate_referenced_layer is only about the
first layer. customData_duplicate_referenced_layer_index should be used instead
to duplicate the right layer.
2021-07-26 08:35:33 +02:00
d070cce778 Fix T88756: crash when baking with autosmooth
When baking some data, we create a new Mesh with edits and modifiers applied.
However, in some cases (e.g. when there is no modifier), the returned Mesh is
actually referencing the original one and its data layers. When autosmooth is
enabled we also split the Mesh. However, since the new Mesh is referencing the
original one, although `BKE_mesh_split_faces` is creating new vertices and edges,
the reallocation of the custom data layers is preempted because of the
reference, so adding the new vertices and edges overwrites valid data

To fix this we duplicate referenced layers before splitting the faces.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D11703
2021-07-26 08:32:26 +02:00
b529a84ec3 Fix T88015: Round end caps on Freestyle lines not shaped as documented
This might be an artistic choice, but round end caps are supposed to be
a "half circle centered at the end point of the line" as documented
here: https://docs.blender.org/manual/en/dev/render/freestyle/
parameter_editor/line_style/strokes.html#caps

They are a shashed half circle instead.

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

Maniphest Tasks: T88015

Differential Revision: https://developer.blender.org/D11340
2021-07-26 08:31:23 +02:00
2d32bf14e4 Fix T89765: boolean modifier collection refcount issue
The 'collection' property is flagged PROP_ID_REFCOUNT, so the
modifiers foreachIDLink functions should walk with IDWALK_CB_USER
(instead of IDWALK_CB_NOP).

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

Maniphest Tasks: T89765

Differential Revision: https://developer.blender.org/D11877
2021-07-26 08:30:05 +02:00
563fdaaa39 Fix channel packed images display in the Image/Node editor
Channel packed images should not have their RGB affected by alpha.
rendering in Cycles and Eevee was fine already, but displaying these was
not right in the Image and Node editors.

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

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

ref. T89034

Maniphest Tasks: T89034

Differential Revision: https://developer.blender.org/D11871
2021-07-26 08:27:10 +02:00
7b94e7cca4 Alembic export: evaluation mode option
This option will determine visibility on either render or the viewport
visibility. Same for modifer settings. So it will either evaluate the
depsgrah with DAG_EVAL_RENDER or DAG_EVAL_VIEWPORT.
This not only makes it more flexible, it is also a lot
clearer which visibility / modfier setting is taken into account (up
until now, this was always considered to be DAG_EVAL_RENDER)

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

ref. T89594

Maniphest Tasks: T89594

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

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

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

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

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

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

ref. T89594

Maniphest Tasks: T89594

Differential Revision: https://developer.blender.org/D11808
2021-07-26 08:23:53 +02:00
5d1ef0efd0 Fix object "Set Origin" operating on linked library data
Regression in d25747ee75
2021-07-26 07:59:17 +02:00
41bd164e4c Fix T70356: Scaling up 1x1 pixel image reads past buffer bounds
Also resolve a crash when when displaying thumbnails, see T89868.
2021-07-26 07:56:47 +02:00
062764d5d0 Fix T89861: Checking face selection breaks UV stitch operator 2021-07-26 07:55:18 +02:00
Jesse Yurkovich
d097d35be6 Fix T89868: Crash showing thumbnail of wide-aspect image
Scaling down images could create images with a width or height of zero.

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

Ref D11956
2021-07-26 07:54:11 +02:00
9e64fd461a Line Art Bug FIx: stroke default in-front should be on
See {D11550} for more information.
2021-07-07 07:52:38 +02:00
2659bc5457 Fix T89153: Follow Path for empty works only in negative values
The old code only clamped cyclic curves
2021-07-07 07:47:37 +02:00
aa1bbadb5b Fix T89571: Align Orientation to Target keeps rotation when toggled
Backport of {4546f176eb0f}
2021-07-07 07:41:00 +02:00
d3f7ed08e7 Cleanup: remove compilation warning in previous commit. 2021-06-30 09:45:07 +02:00
e9d6f2164e UI: Hide collection tab when scene master collection is active
CollectionLineart does not care about the configurations
in master collection.
Other options are not applicaple for master collection as well.
Hence hiding it.

Reviewed by Dalai Felinto (dfelinto)

Differential Revision: https://developer.blender.org/D11702
2021-06-30 09:43:42 +02:00
bec8e436a1 Fix: VSE seeking with proxy strips would fail on certain frames
If the last decoded frame had the same timestamp as the GOP current
packet, then we would skip over this frame when fast forwarding and we
would seek until the end of the file.

This would could only be triggered reliably in single threaded mode.

Reviewed By: Richard Antalik

Differential Revision: http://developer.blender.org/D11601
2021-06-30 09:41:44 +02:00
444a8cbc2f Fix: VSE search in mpegts files would fail
ffmpeg_generic_seek_workaround did work properly and our start pts
calculation was wrong.

Reviewed By: Richard Antalik

Differential Revision: http://developer.blender.org/D11562
2021-06-30 09:41:16 +02:00
7616f4ae57 Fix: VSE indexer seeking not working correctly
Because of the added sanity checks in rB14508ef100c9 (D11492), seeking
in proxies would not work correctly any more. This is because it wasn't
working as intended before, but in most cases this wouldn't be
noticeable. However now when the sanity checks are tripped it is very
noticeable that something is wrong

The indexer tried to use dts values for time stamps when we used pts in
our decode functions to get the time positions. This would make it
start in the wrong GOP frames when searching. Now that we enforce no
crossing of GOP frames when decoding after seek, this would lead to
issues.

Now we correctly use pts (or dts if pts is not available) and thus we
don't have any seeking issues because of time stamp format missmatch.

Reviewed By: Richard Antalik

Differential Revision: http://developer.blender.org/D11561
2021-06-30 09:40:54 +02:00
a68f5456e4 Fix: VSE timecodes being used even when turned off.
Reviewed By: Richard Antalik

Differential Revision: http://developer.blender.org/D11567
2021-06-30 09:39:02 +02:00
cea80f1add Fix: Prevent small memory leak in VSE indexer
We need to unref the packet to tell ffmpeg it is ok to free it after
use.
2021-06-30 09:38:01 +02:00
02a6be5443 Fix: Wrong logic for checking if we can reuse decoded frame
We should only check if the new pts value lies inside the duration of
the current frame.
2021-06-30 09:37:43 +02:00
7eb3e77b94 FFmpeg: Fix seeking not returning the correct frame when not using TC index
Fixed the logic for seeking in ffmpeg video files.
The main fix is that we now apply a small offset in ffmpeg_get_seek_pos
to make sure we don't get the frame in front of the seek position when
seeking backward.

The rest of the changes is general cleanup and untangling code.

Reviewed By: Richard Antalik

Differential Revision: http://developer.blender.org/D11492
2021-06-30 09:37:21 +02:00
13ab6b7bb6 Fix T57397: Movies are blurred after sws_scale
Images with 4:2:2 and 4:4:4 chroma subsampling were blurred when
`SWS_FAST_BILINEAR` interpolation is set for `anim->img_convert_ctx`.

Use `SWS_BILINEAR` interpolation for all movies, as performance is
not impacted by this change.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D11457
2021-06-30 09:34:48 +02:00
00ffe02820 FFmpeg: Update proxy settings
Changes in rBce649c73446e, affected established proxy codec preset.
Presets were not working and all presets were similar to `veryfast`.
Tunes are now working too, so `fastdecode` tune can be used. I have
measured little improvement, but I tested this only on 2 machines and
I have been informed that `fastdecode` tune does influence decoding
performance for some users.

Change preset from `slow` to `veryfast` and add tune `fastdecode`

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D11454
2021-06-30 09:34:21 +02:00
19c0666d40 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-06-30 09:33:49 +02:00
14308b0a5e 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-06-30 09:33:12 +02:00
fe4cbe62df 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-06-30 09:32:45 +02:00
f522e8db22 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-06-30 09:32:06 +02:00
3b7a520d88 Fixed issue in previous commit.
During development a test was disabled. Enabling it again.
2021-06-30 09:28:28 +02:00
2c7efe5ac0 Fix T89405: Viewport Render Preview glitching (AMD)
AMD Drivers didn't report an additional space in the rendered. This made
testing for the HQ workaround fail and the issue appeared back on
certain cards.

This fix will test with surrounding spaces or if the renderer name
endswith the given string. If any of these are the case the hq normals
workaround will be enabled.
2021-06-30 09:28:06 +02:00
3c6a981fd9 Fix: Crash Requesting GPU_SHADER_GPENCIL_FILL builtin shader.
Shader doesn't have any shader code. Requesting the shader
would crash blender. Solved by removing the enum_value.
2021-06-30 09:27:33 +02:00
Pratik Borhade
46daaec425 Fix T88808: Set Origin missing from Text object in 2.93
Fix T88808.
Caused by {rB5f2c5e5bb8c15bf0d6679351e3482f9c38c00935}

object type for `TEXT object` was missing in following check
that's why `Set Origin` option was lost from object context menu.

Reviewed By: lichtwerk

Maniphest Tasks: T88808

Differential Revision: https://developer.blender.org/D11495
2021-06-30 09:26:22 +02:00
7573e45103 Fix T89004: Undefined Geometry nodes cause a crash when connected to a Group Output node.
Patch provided by Jacques Lucke.
2021-06-30 09:22:37 +02:00
Fen
129798cacb Fix T89247: Dereference arguments to comparison function correctly
`bm_face_len_cmp` incorrectly interpreted its arguments as `BMFace *`
instead of `BMFace **`, causing an out-of-bounds read.

Ref D11637
2021-06-30 09:19:29 +02:00
32658bb5c9 Fix invalid polygon normal array access building bake data
Pre computed normals index wasn't properly aligned.
Regression from 2ec00ea0c1.
2021-06-30 09:18:48 +02:00
174f39bd03 Fix T89265: Crash when tabbing through num inputs
Fix by reverting the part of ec30cf0b74
that assigned `but->editval` in `ui_numedit_begin_set_values`.

Causing access freed memory when using tab to switch
to a numeric input and then leaving the textbox by clicking outside.
This was because `ui_numedit_begin_set_values` shouldn't need to set
`but->editval` and overwrite the pointer.
This would set a pointer that had previously been freed,
causing a `NULL` check to fail later on.

Ref D11679
2021-06-30 09:18:22 +02:00
Piotr Makal
27e3265267 Fix edit-mesh random select regression in random seed use
Fix regression in 9c20228128
that wasn't using the random seed correctly.
2021-06-30 09:14:16 +02:00
cf9cacd091 Fix T89526: "Toggle Maximize Area" clears context screen properties
Removed in b787581c9c as it's comment
noted it was bad code, the reason for it's necessity was no longer valid.

Add this back with comment explaining why it's still needed.
2021-06-30 09:12:57 +02:00
03d5c8b4ed Blender v2.93.2 candidate version bump. 2021-06-23 14:44:02 +02:00
1b8d33b18c Blender v2.93.1 release version bump. 2021-06-22 07:57:15 +02:00
baa7a53974 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-06-16 13:46:39 +02:00
b4a81d8053 Fix outdated face tessellation use when editing edit-mesh coodinates 2021-06-16 09:31:01 +02:00
b61f4fd8da Fix image space missing mask display panel 2021-06-16 09:30:39 +02:00
bc64801857 Fix modifier deform by armature check ignoring virtual modifiers
Regression in f00cb93dbe (fix for T63125)
2021-06-16 09:30:05 +02:00
ba7f110753 Docs: remove deprecated parameter from bmesh docs
The perimeter itself was removed but the documentation wasn't updated.

Resolves T89013
2021-06-16 09:29:40 +02:00
e24765d7d3 LineArt: Camera marker update fix.
The original fix was probably flushed by some newer
line art commits. Fixed.

See https://developer.blender.org/T88464
2021-06-16 09:28:46 +02:00
5730112174 LineArt: Fix edge clipping index error.
Small bug that's causing edge count to be incorrect in
final culled list, just being offset exactly 1 entry.

Reviewed By: Sebastian Parborg (zeddb)

Differential Revision: https://developer.blender.org/D11513
2021-06-09 08:57:59 +02:00
Philipp Oeser
d354e6a846 Texture Paint: changing paint slots and viewport could go out of sync
When changing to another texture paint slot, the texture displayed in
the viewport should change accordingly (as well as the image displayed
in the Image Editor).

The procedure to find the texture to display in the viewport
(BKE_texpaint_slot_material_find_node) could fail
though because it assumed iterating nodes would always happen in the
same order (it was index based). This is not the case though, nodes can
get sorted differently based on selection (see ED_node_sort).

Now check the actual image being referenced in the paint slot for
comparison.

ref T88788 (probably enough to call this a fix, the other issue(s)
mentioned in the report are more likely a feature request)

Reviewed By: mano-wii

Maniphest Tasks: T88788

Differential Revision: https://developer.blender.org/D11496
2021-06-09 08:49:32 +02:00
706c7d775d Fix T77651: Black screen on Blender startup on ChromeOS
Apparently `textureSize` doesn't work with
`sampler1DArray` on this OS.

Thanks to @dave1853 for finding the source of the
problem.
2021-06-09 08:49:01 +02:00
db909281f2 Fix T88813: Scalable allocator not used on win10
Due to the way we ship the CRT on windows TBB's
malloc proxy was unable to attach it self to
the memory management functions on windows 10.

This change moves ucrtbase.dll out of the blender.crt
folder and back into the main blender folder to side
step some undesirable behaviour on win10 making TBB
once more able to attach it self.

Having this work again, should give a speed
boost in memory allocation heavy workloads
such as mantaflow.

For details on how this only failed on Win10
see T88813
2021-06-09 08:48:16 +02:00
e1d2485fd3 EEVEE: AOVs not same as cycles.
EEVEE uses hashing to sync aov names and types with the gpu.
For the type a hashed value was overridden making `decalA`
and `decalB` choose the same hash. This patches fixes this
by removing the most significant bit.
2021-06-09 08:46:20 +02:00
0b577e977b Fix T88567: Cryptomatte only works for the first View Layer.
The view layer was always set to 0. This patch increments it.
2021-06-09 08:45:45 +02:00
5a612097ab 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-06-09 08:43:40 +02:00
dbb002387d 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-06-09 08:43:07 +02:00
c1d67abcd8 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-06-09 08:42:16 +02:00
b38eb31050 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-06-09 08:41:42 +02:00
8eef2f83e9 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-06-09 08:41:00 +02:00
cc5392b4d9 Fix buffer overrun in paint_line_strokes_spacing
Error in 87cafe92ce
2021-06-09 08:39:33 +02:00
9d134104e4 Fix T88899: __file__ not set for text.as_module() 2021-06-09 08:39:00 +02:00
7edbe463d2 Versionbump: 2.93.1 candidate. 2021-06-02 17:10:44 +02:00
ddb2d71438 Fix typo in Linux appdata 2021-06-02 15:05:09 +02:00
84da05a8b8 Docs: 2.93 release description for Linux appdata 2021-06-02 13:21:47 +02:00
383bc8d9bc Blender version bump 2.93 release. 2021-06-01 16:46:30 +02: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
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
632bfee0a5 Added v2.93 pipeline config for new buildbot. 2021-05-31 11:15:03 +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
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
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
080623b8ac Fix incorrect Denoise node SSE 4.1 warning on macOS Intel 2021-05-28 16:02:43 +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
02395fead7 Docs: Update RNA to User Manual mappings 2021-05-27 21:25:31 -04: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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
41b912925c Blender LTS: match download urls with latest changes in buildbot. 2021-05-19 16:41:51 +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
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
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
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
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
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
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
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
53376ec7fc Tests: Disabled physics ocean test on macOS arm64
Test is failing and needs further investigation.
2021-05-18 12:48:35 +02:00
aa06be9148 Fix error calling select-camera without a 3D view 2021-05-18 19:58:11 +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
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
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
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
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
e3a76feeef Fix PyAPI doc generation error in 43369ca80e
Files without doc-strings were not included.
2021-05-17 18:02:56 +10: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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
0e3475a0ec Fix wrong loop count in Sculpt Expand code
Introduced when refactoring the function in
8815e3e330
2021-05-11 23:31:43 +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
15b180b240 Fix T88099: error with persistent data and motion blur 2021-05-11 14:24:36 +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
cc7691797c Cleanup: remove unused BPy_IDProperty struct member 2021-05-11 12:30:06 +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
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
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
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
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
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
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
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
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
a9eea6d9dc Fix PlayAnim cache size increasing when playing multiple animations
Error in 0499dbc5c1
2021-05-08 16:10:07 +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
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
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
d0c63a2abe Cleanup: make format (clang-format) 2021-05-07 15:41:42 +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
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
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
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
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
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
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
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
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
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
e83a8e9083 Fix memory leak in object.mode_set_with_submode 2021-05-06 15:09:49 +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
2d3379e243 VSE: Fix wrong flag value
`SEQPROP_VIEW_TRANSFORM` value was set incorrectly.
Introduced in 9576612d45
2021-05-06 03:18:42 +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
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
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
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
f7a14b2ac0 Cleanup: clang format
Missing from rB04905c56523a, sorry for the noise.
2021-05-05 12:24:29 +02: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
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
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
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
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
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
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
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
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
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
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
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
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
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
52e977d518 GPencil: Fix unreported problem when save file in Curve Edit mode
This is related to T87905
2021-05-02 15:51:46 +02:00
Robert Guetzkow
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
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
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
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
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
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
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
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
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
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
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
caf1643f4a Fix uninitialized memory use in GLDrawList
GLDrawList::init() used MDI_INDEXED which checks base_index_.
2021-04-30 12:31:52 +10: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
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
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
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
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
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
d8cdc80263 Fix T87808: Connected proportional editing includes hidden geometry
Regression in 21b9231d7f
2021-04-29 23:44:50 +10: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
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
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
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
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
a71d8ecb69 Docs: PyAPI: More specific css selector for long enums
Fixes T87008
2021-04-28 17:57:58 -04: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
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
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
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
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
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
718109e7f0 Remove SMAA generating message during compilation. 2021-04-28 08:38: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
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
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
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
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
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
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
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
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
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
51c13be820 Update RNA/User Manual Mappings 2021-04-26 20:53:15 -04: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
49b3d00c10 Fix: crash after recent commit
This was a mistake in rBb67fe05d4bea2d3c9efbd127e9d9dc3a897e89e6.
2021-04-26 19:19:44 +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
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
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
a17ea1a669 Spreadsheet: combine vector/color spreadsheet columns
Differential Revision: https://developer.blender.org/D11056
2021-04-26 09:09:50 +02: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
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
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
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
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
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
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
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
5441f5fc90 Fix T87582: incorrect interpolation from edge to corner domain 2021-04-23 13:07:38 +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
0817763624 Fix for building with MSVC 2021-04-23 11:32:32 +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
f240b5e5f7 Fix T87701: debug assert generating scene preview render 2021-04-22 15:23:48 +02:00
e0852368bc Fix missing include 2021-04-22 10:04:59 -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
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
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
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
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
0f66dbea90 Fix wrong flag for 'GPUFrameBuffer.viewport_get'
`GPUFrameBuffer.viewport_get` has no args.
2021-04-21 17:15:13 -03:00
aed9b6faee Fix some Cycles random walk SSS precision issues with small radius 2021-04-21 17:42:47 +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
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
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
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
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
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
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
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
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
2125ee4305 Geometry Nodes: skip attribute conversion if src and dst are the same 2021-04-20 11:17:35 +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
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
72fec0f7c5 Fix T87055: Crash applying modifier on mesh with multires data 2021-04-20 15:17:48 +10: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
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
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
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
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
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
c75b2019e1 Fix incorrect compositor denoise node message about SSE on macOS Arm
Ref T78710
2021-04-19 12:12:23 +02: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
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
06888a8970 Fix compile warning
The order of the two parameters was incorrect.
2021-04-18 11:58:44 -05:00
4bce9c5283 Fix memory leak in the BLI_bitmap created in 'looptri_no_hidden_map_get' 2021-04-17 16:55:59 -03: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
ddbfae7a0d Cleanup: quiet compiler warning on macos 2021-04-17 19:19:46 +02: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
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
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
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
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
0bf630493f Fix missing owner_id values from 919558854d
This prevented dynamic enum callbacks being called.
2021-04-17 01:29:51 +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
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
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
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
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
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
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
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
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
a4877f9e54 Fix text in startup file python console
This was a mistake in rBac90c8a7743f6d0
2021-04-15 09:16:00 -05: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
d169314f9b Bump subversion before starting the next release cycle 2021-04-15 15:32:48 +02:00
ecc2db8a3a UI: Rename itmes in point cloud add attribute menu
Since these were added, we decided that builtin and reserved name
attributes start with a lowercase letter. We also use "id" already in
a few nodes, so this change will be consistent with that.
2021-04-15 07:53:45 -05:00
27e13a608f GPencil: Change UI text and tooltip
The text was not changed in the refactor and had the old text.
2021-04-15 14:22:57 +02:00
5c067189e3 Fix T87434: spreadsheet shows same column more than once 2021-04-15 13:19:27 +02:00
4cf3010714 Fix T87171: Update multi input socket indices
When inserting a node on top of a link, the multi input socket
indices weren't updated. This fixes that and keeps the relative
order of the links the same.

Author: Wannes Malfait

Reviewed By: Fabian Schempp

Differential Revision: https://developer.blender.org/D10969
2021-04-15 11:38:46 +02:00
05dbbd83f0 Geometry Nodes: refactor implicit conversions
This refactor simplifies having standalone function pointer that
does a single conversion. It also speeds up implicit type conversion
of attributes.
2021-04-15 11:21:48 +02:00
2c3a9caffe Fix T87356 & T87358: Small multi-input socket issues
T87356 occured because last_node_hovered_while_dragging_a_link was not
set on node_link_init.
The assert in T87358 failed because the sorting operation was called even
if the drag link contained a link to another socket.
A little one frame jump was caused because frame was refreshed after
picking a link and before sorting happened.

Reviewer: Hans Goudey

Differential Revision: https://developer.blender.org/D10940
2021-04-15 10:00:25 +02:00
5ec39fc2e4 Cleanup: rename file
Internally we use the name "context (path)" instead of "breadcrumb".
This was missing from a rename in the original patch.
2021-04-15 09:37:50 +02:00
bbea79ce5e Cleanup: move type conversions to separate file 2021-04-15 09:35:56 +02:00
3810bcc160 Spreadsheet: breadcrumbs and node pinning
This introduces a context path to the spreadsheet editor, which contains
information about what data is shown in the spreadsheet. The context
path (breadcrumbs) can reference a specific node in a node group
hierarchy. During object evaluation, the geometry nodes modifier checks
what data is currently requested by visible spreadsheets and stores
the corresponding geometry sets separately for later access.

The context path can be updated by the user explicitely, by clicking
on the new icon in the header of nodes. Under some circumstances,
the context path is updated automatically based on Blender's context.

This patch also consolidates the "Node" and "Final" object evaluation
mode to just "Evaluated". Based on the current context path, either
the final geometry set of an object will be displayed, or the data at
a specific node.

The new preview icon in geometry nodes now behaves more like
a toggle. It can be clicked again to clear the context path in an
open spreadsheet editor.

Previously, only an object could be pinned in the spreadsheet editor.
Now it is possible to pin the entire context path. That allows two
different spreadsheets to display geometry data from two different
nodes.

The breadcrumbs in the spreadsheet header can be collapsed by
clicking on the arrow icons. It's not ideal but works well for now.
This might be changed again, if we get a data set region on the left.

Differential Revision: https://developer.blender.org/D10931
2021-04-15 09:00:47 +02:00
0bac768223 Fix missing NULL checks in adb21faa83 2021-04-15 15:07:36 +10:00
adb21faa83 Fix T70286: Dissolve vertices/edges creates duplicate face 2021-04-15 14:20:21 +10:00
2cc3a89cf6 CMake/deps: Remove CPP11 option for OpenImageIO
This flag is obsolete. In its current state (missing -D) it also
results in a CMake unknown argument error on macOS.
2021-04-14 21:33:12 +02:00
788a28251b Geometry Nodes: Realize instances when applying modifiers
The fact that geometry from instnances isn't realized when applying
a nodes modifier can be very confusing, especially for new users.
Nodes themselves realize geometry instances implicitly whenever they
need to. We also currently make instances real and convert points to
mesh when a modifier is added after the nodes modifier. With this
commit, we simply do the same thing when applying the modifier.

There are a few downsides though:
 - This can be an extremely heavy operations in some cases where
   geometry nodes is used to instance heavy geometry.
 - We will still have the issues with materials, since instances use
   materials from their original objects, but real geometry uses
   materials from the modifier object.

It was decided to live with the potential performance downsides
for now, the idea is the upsides of the change are more important,
and people making complicated setups will be more likely to know not
to apply the modifier. In the future there could be a warning if it's
necessary though.

Ref T87083
2021-04-14 14:23:48 -05:00
ac90c8a774 UI: Add a workspace for geometry nodes in the default startup file
This will hopefully make it faster to start using the node editor.
The workspace also includes the spreadsheet. Note that while
existing startup files won't have this workspace added, it will be
in the list of options when clicking on the "add workspace" button.

Ref T86499
2021-04-14 13:53:32 -05:00
4dd32f94aa GPencil: Invert color offsetting for Single and Object mode
Now, instead to offset the stroke color to make it visible over fill, the stroke keeps the original color and the fill is offset.

Related to the issue in T87406.
2021-04-14 19:00:18 +02:00
Falk David
7c18fb062d Fix T87406: Stroke color when using object color mode
The color of the strokes was shifted when using `Single Color` or
`Object Color`in Solid Display Mode. This was originally done so
that it was still possible to differentiate strokes and fills.

The fix allows for a completly flat shading by checking if the
Lighting Mode is set to `Flat`. If it is, then the colors are not
shifted for the strokes and everything will use the same color.

Reviewed By: antoniov, fclem

Maniphest Tasks: T87406

Differential Revision: https://developer.blender.org/D10957
2021-04-14 18:52:42 +02:00
71eaf872c2 Geometry Nodes: Add domain and data type to attribute search
This patch adds domain and data type information to each row of the
attribute search menu. The data type is displayed on the right, just
like how the list is exposed for the existing point cloud and hair
attribute panels. The domain is exposed on the left like the menu
hierarchy from menu search.

For the implementation, the attribute hint information is stored as a
set instead of a multi-value map so that every item (which we need to
point to descretely in the search process) contains the necessary data
type and domain information by itself. We also need to allocate a new
struct for every button, which requires a change to allow passing a
newly allocated argument to search buttons.

Note that the search does't yet handle the case where there are two
attributes with the same name but different domains or data types in
the input geometry set. That will be handled as a separate improvement.

Differential Revision: https://developer.blender.org/D10623
2021-04-14 11:11:51 -05:00
Adrian Newton
d705335c2b UI: 2D Animation: Fix Labelling issue within the 'Cursor' dropdown
Within the 2D Animation workspace, the 'Cursor' dropdown currently displays the 'Display Cursor' incorrectly aligned.

This change fixes the alignment issue.

Reviewed By: #user_interface, #grease_pencil, antoniov

Differential Revision: https://developer.blender.org/D10614
2021-04-14 17:56:22 +02:00
b9207fb43d FFmpeg: Adjust default proxy settings
GOP size and quality are adjusted for h264 codec.

These new values are based on result of benchmark on 9 random files:
https://docs.google.com/spreadsheets/d/1nOyUGjoVWUyhQ2y2lAd8VtFfyaY1wQNGj1krCCNbk7Y/edit?usp=sharing

Reducing quality to 50 reduces proxy filesize by about 2x on average
and has no significant impact on decoding performance.

Increasing GOP size from 2 to 10 also reduces proxy filesize 2x-3x
while scrubbing is only about 8% slower. It is still around 100FPS
with 1920x1080 media.
This is unfortunately about 50% slower than MJPEG, but this can be
improved with `fastdecode` tune applied to libx264 encoder

Quite surprisingly h264 codec presets had little influence on proxy
building performance as well as proxy filesize. So far it looks that
FFmpeg does initialize encoder in different way then Blender.
This applies mot only for presets but for tune and profile libx264
setting.
Once this issue is resolved, performance of proxies may be optimized
further.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D10897
2021-04-14 14:25:34 +02:00
9ca55b10b8 Fix T87479: GPencil SVG export outside of camera
When trying to export a GPencil object to SVG from outside the camera
view, the expoted file would contain invalid data. This was because the
calculation of the bounding box did not have any objects to
iterate over.

The fix makes sure we create the object list before trying to calculate
the bounding box.

Reviewed By: antoniov

Maniphest Tasks: T87479

Differential Revision: https://developer.blender.org/D10975
2021-04-14 10:14:04 +02:00
Manuel Castilla
a425b2b25c Fix (unreported) compositor resolution propagation broken by some nodes
Some operations may use no preferredResolution ({0, 0}) when calling determineResolution on inputs to check if they have resolution on their own. See MixOperation or MathOperation determineResolution implementation. In such cases {0, 0} resolution ends up being set when an input doesn't have own resolution, breaking propagation of the original preferredResolution. They don't mean to set it as resolution, it's just a check.

This patch only allows to set valid resolutions (>0). When it's 0 it may be understood as "No preferred or determined resolution" so it should not be set to give output operations another chance of finding a proper resolution by calling determineResolution again with a different preferredResolution.

Test file:
{F9932526}

Reviewed By: #compositing, jbakker

Differential Revision: https://developer.blender.org/D10972
2021-04-14 08:18:44 +02:00
6776b74d0a Cleanup: remove unused BLANK_PYTHON_TYPE define 2021-04-14 12:19:06 +10:00
937b843944 Cleanup: spelling 2021-04-14 12:11:03 +10:00
74cbe6d52c Cleanup: resolve type hinting error with make_source_archive 2021-04-14 11:41:39 +10:00
e45a57656c GNUmakefile: add 'check_mypy' convenience target 2021-04-14 11:36:46 +10:00
d63b72e9f9 Fix T78803: Bad widget drawing with the R600g driver
The SB back-end optimizer for the mesa R600g driver corrupts the vertex
shader for widget drawing. This will not be fixed upstream because SB is
getting replaced as part of the new NIR path. This was thought to be an
issue with instancing and an attempted fix was submitted in D8374, but
it did not fix the issue.

This patch reimplements the array look-up part of the code using switch
case as a workaround and removes the old workaround implemented as part
of D8374.

Reviewed By: Clement Foucault

Differential Revision: https://developer.blender.org/D10967
2021-04-13 22:36:24 +02:00
170293475c Nodes: Tooltip for Group Input properties
With this patch, users can define custom tooltips for the exposed
properties of their Geometry Nodes Groups.
Currently this custom tooltips are only used in the modifier panel,
but its a long term goal to use it in the node editor.

Reviewer: Hans Goudey

Differential Revision: https://developer.blender.org/D10884
2021-04-13 22:11:58 +02:00
86915d04ee Object: Enable transfer mode functionality for switching objects in Sculpt Mode
This implements the changes discussed in T87134 for including switch
object funcionality in 2.93. This includes:

- Remove the switch object operator experimental option
- Remove the option for switching objects in Edit Mode.
- Rename switch_object to transfer_mode.
- Enable the operator only in sculpt mode.
- Expose the operator in the Sculpt menu with an eyedropper modal
option.

On later releases, we could revisit enabling the operator in other mode
and object types as well as its place in the UI.

Reviewed By: JulienKaspar, JacquesLucke

Differential Revision: https://developer.blender.org/D10953
2021-04-13 20:31:50 +02:00
1a81693d38 Sculpt: Update menu entries for new Expand operator
Sculpt menus were using the legacy expand operator. This updates all
entries to use the new one.

It does not make sense to use Expand from the menus as it relies on the
brush cursor position, but now all Expand shortcuts are listed in the
UI.

Reviewed By: JacquesLucke

Differential Revision: https://developer.blender.org/D10952
2021-04-13 20:18:33 +02:00
4baf3964ae Revert 87aa514611: Removal of Lock Camera Gizmo Button
Differential Revision: https://developer.blender.org/D10968

Reviewed by Julian Eisel
2021-04-13 11:09:28 -07:00
d851fc3ad6 Fix T77330, T81704: Spline IK doesn't preserve bone scale correctly
Previously, the bone position outside of "fit to curve length" mode was
incorrect.

It assumed that the curve was completely straight with no bends or
turns. This would lead to bones being scaled down as their final
position would be servery underestimated in some cases.

The solution is to do a sphere -> curve intersection test to see where
to put the bones while still preserving their length. As we are using
the tessellated curve data this essentially boils down to us doing a
sphere -> line intersection check.

Reviewed By: Sybren

Differential Revision: http://developer.blender.org/D10849
2021-04-13 19:18:48 +02:00
5936ef986a deps_builder: Bump download time out to 30 mins
The timeout was set to 60 seconds, which was problematic
for some of the larger files like boost from the blender
svn mirror.
2021-04-13 10:19:09 -06:00
b8479a70c9 Add make source_archive_complete target
Add a `source_archive_complete` target for `make` that creates a source
archive including the source packages of Blender's dependencies.

This expands `make_source_archive.py` to include files from
`${BUILD_DIR}/source_archive/packages/` as well.

Reviewed By: dfelinto

Maniphest Tasks: T86124

Differential Revision: https://developer.blender.org/D10727
2021-04-13 17:47:48 +02:00
1f2a801044 Spreadsheet: rename Point to Vertex
Ref T86821.

Differential Revision: https://developer.blender.org/D10962
2021-04-13 14:49:00 +02:00
7cbd66d42f Cycles: Initialize all OptiX structs to zero before use
This is done to ensure building with newer OptiX SDK releases that add new struct fields gives
deterministic results (no uninitialized fields and therefore random data is passed to OptiX).
2021-04-13 13:56:15 +02:00
93d8c7516a Geometry Nodes: realize instances in subdivide node
This makes it consistent with the Subdivision Surface node.
2021-04-13 13:48:10 +02:00
961b6a6f7e Cleanup: sort cmake file lists 2021-04-13 21:44:20 +10:00
8c2c49ff9f Cleanup: redundant struct declarations 2021-04-13 21:43:07 +10:00
1534da457e Fix snap gizmo flickering while dragging
Ignore click-drag for non-mouse button drag events

Alternative to fix issue detailed in D10886.
2021-04-13 21:36:38 +10:00
2f367db2cc Cleanup: preview rendering, push bContext a bit further down the call stack
Pass `bContext *C` a bit further down the call stack, to prevent
exploding the number of parameters of `ED_preview_icon_render()`. An
upcoming change will require access to yet another context member, and
this can now be done without adding yet another parameter.

No functional changes.
2021-04-13 13:14:49 +02:00
Jesse Y
5b08cbae51 Fix T71960: Malformed .bmp files lead to crash
Adds appropriate checks/guards around all the untrusted parameters
which are used for reading from memory.

Validation:
- All the crashing files within the bug have been checked to not causes
  crashes any longer>
- A handful of correct .bmp were validated: 3 different files at each
  of 1, 4, 8, 24, 32 bpp depth along with a random variety of other 24
  bpp files (around 20 in total).
- ~280 million iterations of fuzzing using AFL were completed with 0
  crashes. The old code experienced several dozen crashes in first
  minutes of running {F8584509}.

Ref D7945
2021-04-13 21:13:09 +10:00
c50d55dd34 Cleanup: use typing for checking utilities 2021-04-13 21:13:09 +10:00
30ee57be60 Motion Tracking: setting Keyframe A & B was not updating UI indicators
Entering the numbers in the keyframe field was not triggering a viewport
update, so the little green lines down in the cache area were only
change when the user e.g. changed the frame.

Now send appropriate notifiers.

Issue spotted in T86456 by sebastian_k.

Maniphest Tasks: T86456

Differential Revision: https://developer.blender.org/D10963
2021-04-13 09:49:14 +02:00
721ff6ad12 Fix compile error: Missing include paths
rB8d9fd0427dd6 added the `WITH_GMP` definition but did not append the
include paths.
2021-04-13 09:47:58 +02:00
e9c548c3c3 CMake: fix error building with the version set to 300
When Blender's minor version was single digits, it wasn't properly
extracted. Resolve by adding zero padding.

Issue raised by @harley in D10954.
2021-04-13 17:43:05 +10:00
9b15c552cc DNA: support int8_t type in DNA structs
Differential Revision: https://developer.blender.org/D8908
2021-04-13 09:39:20 +02:00
7b9d94e073 Fix T87400: GPencil change Select Alternate defaults
Now, the Unselect Ends is disabled by default.
2021-04-13 09:24:34 +02:00
f5060bc901 PyAPI: support retrieving the exception when running a string
- Optionally get the error as a single line.
- Support access the error as an allocated string.
- PyC_ExceptionBuffer_Simple was always printing to the `stdout` while
  PyC_ExceptionBuffer didn't, now either print to the output.

Without this, callers are unable to do anything with the error string.
2021-04-13 15:28:43 +10:00
8d9fd0427d Cleanup: Nodes: Use consistent errors for nodes built without features 2021-04-12 17:43:36 -05:00
1e8a808910 Cleanup: Use C++ types in object_dupli.cc
Using alloca in C++ is not recommended, especially when we have the
blender::Array type that can contain an inline buffer.
2021-04-12 16:24:51 -05:00
ec20b21d04 Fix Cycles broken motion blur pass after recent bugfix 2021-04-12 20:59:05 +02:00
1c357a3c5f UI: Use Consistent name for select mirror
This commit cleans up the RNA names of select mirror operators so that 
they are all "Select mirror".

This makes the select menu in edit/pose mode consistent regardless of 
object type.

Differential Revision: https://developer.blender.org/D7356
2021-04-12 14:52:29 -04:00
2b9e6943cd Fix T86880: Cycles bevel shader not working after editing world 2021-04-12 20:10:30 +02:00
d2f55be7bb Fix T87283: crash with persistent data and motion blur 2021-04-12 20:10:30 +02:00
ce259ca382 Cleanup: fix address sanitizer warning 2021-04-12 20:10:30 +02:00
e45389c1a1 Fix T87324: incorrect parametric coordinates with light spread 2021-04-12 20:10:30 +02:00
2bd9f9d976 UI/Nodes: Improve feedback when adding node fails (e.g. on drag & drop)
This is especially useful when trying to add a node group instance, e.g. via
drag & drop from the Outliner or Asset Browser.
Previously this would just silently fail, with no information why. This is a
source of confusion, e.g. earlier, it took me a moment to realize I was
dragging a node group into itself, which failed of course.
Blender should always try to help the user with useful error messages.

Adds error messages like: "Nesting a node group inside of itself is not
allowed", "Not a compositor node tree", etc.

Adds a disabled hint return argument to node and node tree polling functions.
On error the hint is reported, or could even be shown in advance (e.g. if
checked via an operator poll option).

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

Reviewed by: Jacques Lucke
2021-04-12 18:48:22 +02:00
cbd1932619 Previews: allow undo'ing datablock preview generation
Allow users to undo the effect of the "Generate Preview" operator in the
asset browser (`ED_OT_lib_id_generate_preview`). Without this, the
button is too dangerous.
2021-04-12 18:08:25 +02:00
Damien Picard
15253d18b7 UI: Fix a few RNA description strings
A few strings describing RNA objects were wrong, including copy/paste errors, spelling and case.

Reviewed By: Blendify

Differential Revision: https://developer.blender.org/D10899
2021-04-12 11:30:11 -04:00
c037a02096 Win32: Fix fullscreen errors using Taskbar system menu
Changing window state using taskbar system menu could result in a titleless window.

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

Reviewed by Ray Molenkamp
2021-04-12 07:52:14 -07:00
e96f0d2e2b Fix unreported: Flat Surface objects
Before rBf674976edd88, the flag indicating whether a curve was 2D or 3D was
ignored by Surfaces objects.

So it can be said that Surfaces objects were always 3D.

We could remove updates to 2D on Surface objects, so the behavior is
identical to what it was before.

But this would also cause the return of `data.dimensions` to be misleading,
complicate the code a bit and add a micro overhead.

So the solution here is just to init all Surface objects as 3D.

Surface objects can now be constrained to 2D with the command:
```
data.dimensions = '2D'
```
2021-04-12 11:08:54 -03:00
Szymon Ulatowski
95e010a22e Fix T74680: Incorrect mixing in Glare node
The mixing function was designed to give correct results for Mix values of
-1, 0, and +1, but the behavior between these points was not linear. This is
unavoidable, because the function depends on both Mix and Mix^2 (by
multiplying value and mf) so they could not cancel out completely.

The new formula simply calculates the weighted sum without trying to invent
a smooth function.
Value for MixGlareOperation is now passed directly without scaling because
it is then easier to use.
Note that the previous formula performed max() twice for both input image
and the result, now there is just one max() per channel because the glare
input can't be negative.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D7138
2021-04-12 14:42:13 +02:00
53f277a2e6 Compositor: Allocate OIDN memory after receiving lock.
Related to {T77023}. When using many Denoise nodes the memory in OIDN
are allocated up front. A mutex could stall the process until. This
change will allocate the memory after it received the lock.
2021-04-12 14:29:49 +02:00
71cb0bdc43 Fix: File output uses incorrect resolution when first socket unused.
File output node always received the resolution from the first socket.
When that socket didn't had a link it would use a resolution of 0,0.
What lead to not saving the file at all.

This only effected Multi layer OpenEXR files.
This change would go over all the links to find the first valid
resolution.
2021-04-12 09:50:04 +02:00
75642b4cfd Fix T87252: File output node broken with more than 4 inputs.
In recent refactor the operator sockets were migrated from a std::list to a blender::Vector.
The way how the file output node created the sockets along mapping the sockets could
lead to storing incorrect pointers.

This patch fixes this by defining and mapping the sockets in separate loops.
2021-04-12 09:50:04 +02:00
175c1382da Fix T87348: convert vertex colors to linear color space
Differential Revision: https://developer.blender.org/D10956
2021-04-12 09:18:35 +02:00
1a4d0fa72d Spreadsheet: add spreadsheet width unit
This also fixes the issue that the width of the "Name" column
when viewing instances does not resize correctly.

Differential Revision: https://developer.blender.org/D10926
2021-04-12 09:14:41 +02:00
59f49072d0 Fix T87308: don't show columns when there are no instances 2021-04-12 09:10:26 +02:00
2a14ab998a Fix T87259: Un-Subdivide creates duplicate faces
Add argument to BM_vert_collapse_faces to remove any faces that become
duplicate as result of the collapse.
2021-04-12 14:24:09 +10:00
3a05135e12 Cleanup: defer 'os' imports in startup scripts 2021-04-12 13:36:55 +10:00
b58c1f6b1c project_info: use type hints
'mypy --strict' passes without errors.
2021-04-12 12:23:05 +10:00
b60c168e43 cmake_consistency_check: use type hints
'mypy --strict' passes without errors.
2021-04-12 12:22:20 +10:00
cf8773b525 Cleanup: remove make_quicky and enum generation utilities
- Remove `make_quicky` as on modern systems linking is the main
  bottleneck, and there isn't such a gain from partial builds.

- Remove enum generator as `PyC_StringEnumItems` & `EnumPropertyItem`
  are used in most places to access enums from Python, otherwise macros
  are added via macros.
2021-04-12 12:04:29 +10:00
09d7d88cc4 Fix T87157: GPencil subdivide last segment
Previously it was not possible to subdivide the last segment of a cyclic
stroke.

The fix makes sure that the correct number of new points is calculated
correctly and adds the new points to the last segment.

Reviewed By: antoniov

Maniphest Tasks: T87157

Differential Revision: https://developer.blender.org/D10902
2021-04-11 22:10:54 +02:00
d3cb1d845b Fix error extracting date in manpage generator
Error from recent cleanup 0e3bc2e321
2021-04-11 16:02:00 +10:00
1241e91707 Cleanup: use ELEM, STREQ macros 2021-04-11 14:43:05 +10:00
f9c0d7261a Cleanup: clang-format 2021-04-11 14:37:37 +10:00
1198b187b5 Cleanup: spelling 2021-04-11 13:09:27 +10:00
947ba0d27b Fix T87355: Crash using menu search from the top bar
Menu search used an area with a NULL data pointer,
replace this with a dummy pointer.

Caused by 3f3b4745b6.
2021-04-11 12:14:42 +10:00
0e3bc2e321 Cleanup: further cleanup to man page generator
- Raw strings (since backslashes were used for un-escaped characters).
- Parse the version string, avoiding color management errors being
  included.
2021-04-11 12:00:44 +10:00
ed5507de8a LibOverride: Fix resync bug on recursive overrides.
Linked override were not properly ignored in some part of the code,
leading to invalid resync results in some cases with recursive overrides
(i.e. overrides of overrides).

Reported by Andy @eyecandy from the studio.
2021-04-10 18:36:43 +02:00
3bd892a74c LibOverride: Fix (unreported) assert when creating overrides of linked overrides.
We do not want to copy exiting overrides data from linked ID when
creating its local override (be it either a template, or because linked
ID is itself an override of another lib data).

Note that this was not a very serious issue, would just cause some memory
leak since override data is re-created on newly copied local data
anyway.

These use cases have been very little tested so far, but both complex
production pipeline and future restrictive workflow will make them fairly
common...
2021-04-10 15:25:58 +02:00
c9e054c5de LibOverride: Add own flag to copy or not overrides to ID copy code.
Relying on only no-main for that was weak, and inn the end it turns out
we sometimes also need to ifnore override data during copy of Main
data-blocks.

NOTE: The new `LIB_ID_COPY_NO_LIB_OVERRIDE` is also added to the
`LIB_ID_COPY_LOCALIZE` set of flags.

NOTE: The fact that we may now copy liboverrides in some non-main cases
may cause issues in some cases, pretty impossible to track all possible
ones from reading the code... Would not expect too many problem though,
usages of `LIB_ID_CREATE_NO_MAIN` by itself are not so common.
2021-04-10 15:25:32 +02:00
f337310b43 Cleanup: minor improvements & type hints for man-page generator
- Use main() function.
- Use argparse for parsing arguments.
- Keep under 120 column width.
- Use type hints (passes `mypy --strict`).
2021-04-10 17:54:42 +10:00
0515ff70ec Transform: Use "orient_matrix" as a default when available
The "orient_matrix" parameter was only used when contraint was defined.

This change will hardly be noticed by the user, but it can be useful for
addon developers.

Possibly resolves T85734.
2021-04-09 18:26:27 -03:00
a272eb38f4 Fix T87167: Object dragged from Outliner into Geo Nodes doesn't auto update
Add call to `DEG_relations_tag_update`

Differential Revision: https://developer.blender.org/D10928
2021-04-09 16:05:12 +01:00
e3a06420b2 Compositor: Output where debug is stored. 2021-04-09 16:26:34 +02:00
a631a9eb1f Fix T86928: OSL script compilation failed
Tell `FindOSL.cmake` where to find the shader header files. These have
moved from `${LIBDIR}/osl/shaders` to `${LIBDIR}/osl/share/OSL/shaders`
when OSL was upgraded (T85365).
2021-04-09 13:48:56 +02:00
7ab8a3838c Cleanup: use nullptr. 2021-04-09 13:09:15 +02:00
87bfa2b207 GPU: Enable suggest-override for CPP. 2021-04-09 13:07:53 +02:00
e4a2fc57d5 Blender README: Fix the full license name.
Patch suggested and reviewed by Sergey Sharybin.
2021-04-09 12:39:33 +02:00
Jeroen Bakker
7cef01b090 Compositor: Enable suggest-override warning.
Compostior relies heavilly on overridden methods. The override keyword has been added
in this module and is desired. The benefit of the override keyword is
that it reports an error when not applied to a (base) virtual method and report
what will not match when refactoring the code to be closer to blender style guide.

Reviewed By: sybren

Differential Revision: https://developer.blender.org/D10846
2021-04-09 12:04:45 +02:00
27dcccb20f Cleanup: defer importing nodeitems_utils (missed last commit) 2021-04-09 20:03:04 +10:00
3515036319 Cleanup: defer importing nodeitems_utils 2021-04-09 19:00:04 +10:00
bae66609b4 Cleanup: use our own code style for doxy-gen comment blocks 2021-04-09 19:00:04 +10:00
Charlie Jolly
b08394d57a Fix T87117: Geometry Nodes: Add missing Map Range modes to shader node
Add missing modes as reported in T87117 bug report.

Reviewed By: JacquesLucke

Differential Revision: https://developer.blender.org/D10885
2021-04-09 09:26:37 +01:00
75491fe100 Spreadsheet: persistent column storage and data source
A `DataSource` provides columns for the spreadsheet to display.
Every column has a SpreadsheetColumnID as identifier. Columns
are not generated eagerly anymore, instead the main spreadsheet
code can request a column from a data source with an column
identifier. The column identifiers can be stored in DNA and allow us
to store persistent data per column.

On the user level the only thing that changes is that columns are
not shown in alphabetical order anymore. Instead, new columns
are always added on the left. The behavior can be changed,
however I'd prefer not to automate this too much currently. I think
we should just add operators to hide/reorder/resize columns soonish.

Differential Revision: https://developer.blender.org/D10901
2021-04-09 10:20:46 +02:00
22574f741c Geometry Nodes: quiet warning when using object info node
Some object types don't have a geometry component in the depsgraph.
Before, there always was a warning printed when such an object was
used in the object info node (e.g. to get its location).
2021-04-09 10:07:49 +02:00
2110239547 Fix T87150: bad points appearance in orthographic view
Points are drawn as half octahedron (aligned to the camera).
Getting the appropriate matrix for facing the camera would fail in in
orthographic view, points were not facing the camera (revealing their
missing other half octahedron)

Maniphest Tasks: T87150

Differential Revision: https://developer.blender.org/D10923
2021-04-09 09:14:53 +02:00
3f91591c1d Cleanup: use const for BKE_where_on_path and related structs 2021-04-09 15:00:03 +10:00
71da3f31d4 Fix use of uninitialized memory in BKE_scene_objects_as_gset
Share macro for setting BLI_Iterator defaults to ensure
this doesn't happen again in cases the ITER_* macros aren't used.

Oversight in 14d74fb341.
2021-04-09 14:49:32 +10:00
3d7e3d5ad0 Fix: Missing GeometryNodeCustomGroup
This is a minor change to add some plumbing code
to support custom geo nodes. This is working the
same way as the custom cycles and compositor nodes.

An example add-in is attached to D10784

Reviewed By: JacquesLucke

Differential Revision: http://developer.blender.org/D10784
2021-04-08 16:25:09 -06:00
500045a0d3 Geometry Nodes: Support volumes in the bounding box node
Where possible, nodes in the "Geometry" category should support all
geometry component types. This adds support for volumes in the
recently added bounding box node, based on functions added in the
previous two commits.

Differential Revision: https://developer.blender.org/D10906
2021-04-08 14:32:41 -05:00
57fe650b76 BKE: Refactor volume bounding box code
This commit splits of the function that generates a bounding box for a
volume into a new function, so that the min and max coordinate can
be retrieved from volume data without an object. Also some cleanup:
using the float3 type.
2021-04-08 13:44:54 -05:00
0e2a1ef132 BKE: Add a utility to transform a shallow copy of a volume grid
Often you need to apply a transformation to a grid without changing the
original, and it's necessary to avoid a deep copy of the actual data.
OpenVDB has a function to do this, this commit simply adds a wrapper
to transform and use that function with blender's `float4x4` data type.

Split from D10906
2021-04-08 13:28:35 -05:00
223093ed17 Cleanup: Remove unused includes, use consistent order 2021-04-08 13:07:25 -05:00
1ec9ac2016 Geometry Nodes: Support instances in attribute search
Previously only attributes of "real" geometry were displayed in
attribute search. This commit adds code to look through attributes
on instances and add those to the search drop-down too.

This required implementing the same sort of recursive traversal as
the realize instances code. The situation is a bit different though,
this can return early and doesn't need to keep track of transforms.

I added a limit so that it doesn't look through the attributes of
too many instanced geometry sets. I think this is important, since
this isn't a trivial operation and it could potentially happen for
every node in a large node tree. Currently the limit is set at 8
geometry sets, which I expect will be enough, since the set of
attributes is mostly not very unique anyway.

Fixes T86282

Diffrential Revision: https://developer.blender.org/D10919
2021-04-08 12:19:09 -05:00
fd414b4906 Cleanup: Use const arguments for volume code
The problem was that you could getting write access to a grid from a
`const Volume *` without breaking const correctness. I encountered this
when working on support for volumes in the bounding box node. For
geometry nodes there is an important distinction between getting data
"for read" and "for write", with the former returning a `const` version
of the data.

Also, for volumes it was necessary to cast away const, since all of
the relevant functions in `volume.cc` didn't have const versions. This
patch adds `const` in these places, distinguising between "for read"
and "for write" versions of functions where necessary.

The downside is that loading and unloading in the global volume cache
needs const write-access to some member variables. I see that as an
inherent problem that comes up with caching that never has a beautiful
solution anyway.

Some of the const-ness could probably be propogated futher in EEVEE
code, but I'll leave that out, since there is another level of caching.

Differential Revision: https://developer.blender.org/D10916
2021-04-08 12:00:26 -05:00
b51562ed76 Fix T87232: Crash when evaluating object with unsupported modifier
Fix `nullptr` redeference when setting 'orig_data' pointers on CoW copies,
by stopping the loop also when `element_cow == nullptr`. This avoids a
crash of Blender when the original list of pointers is longer than the
CoW list of pointers.

I've also added a `BLI_assert()` that checks for equal lengths of the
two `ListBase`s, so that problems like these aren't hidden away completely.

The root cause of the crash was actually a modifier that was assigned to
an object of the wrong type (an Armature object doesn't support modifiers).
This caused the list of modifiers on the CoW copy to be shorter than the
list of modifiers on the original Object. It's still a mystery how that
object got that modifier in the first place.
2021-04-08 18:59:22 +02:00
8777a44ccb VSE: Fix crash when building proxy
When video file for strip doesn't exist, building crashes on NULL
dereference.

This check was removed by 04e1feb830.
2021-04-08 18:51:47 +02:00
a19aa090d2 VSE: Fix building image proxies
Broken by 04e1feb830

Caused by accidentaly moving `SEQ_proxy_rebuild_finish` outside of
`if (nseq->type == SEQ_TYPE_MOVIE)` condition in function
`SEQ_proxy_rebuild_context()`.
2021-04-08 18:44:38 +02:00
18dca6911b Cleanup: 2021-04-08 13:19:02 -03:00
dbb4d51971 Fix previous commit: wrong is_mesh_verts_only check 2021-04-08 13:12:43 -03:00
Germano Cavalcante
3d6798962c Fix T86762: Inconsistent show of result of modifier Screw in edit mode
To check if an "is_mesh_verts_only" mesh, the overlay engine checks if the
mesh has no "totedge" and has "totvert".

However, sometimes this engine can check the wrong mesh since editmesh
works on `embm->mesh_eval_final`.

Reviewed By: fclem

Differential Revision: https://developer.blender.org/D10917
2021-04-08 13:07:47 -03:00
08ae545de4 Fix T87107 EEVEE: Principled BSDF doesn't handle negative specular
Negative speculars are evil.
2021-04-08 17:45:16 +02:00
2e3b0e8a99 Fix: Dragging a modifier to the same index recalculates modifier stack
The fix is to simply check if the final index is the same as the start
index and not call the "reorder" callback in that case.
2021-04-08 10:44:33 -05:00
c6ff722a1f Spreadsheet: support showing data of specific node
Previously, the spreadsheet editor could only show data of the original
and of the final evaluated object. Now it is possible to show the data
at some intermediate stages too.

For that the mode has to be set to "Node" in the spreadsheet editor.
Furthermore, the preview of a specific node has to be activated by
clicking the new icon in the header of geometry nodes.

The exact ui of this feature might be refined in upcoming commits.
It is already very useful for debugging node groups in it's current
state though.

Differential Revision: https://developer.blender.org/D10875
2021-04-08 17:35:37 +02:00
5e77ff79cc Add ability to get a selection list of bones
This adds the ability to get a selection list for both edit mode bones
and pose mode bones.

To do this the selection menu list logic had to be reworked a bit.
Before it only stored the names of objects. This might work will of
objects, however as stated in the code, it might fail for linked objects
(so multiple object can have the same name in some corner cases).

For bones it is a very common occurance where you can have multiple
armature that has the same bone names. So now it also stores the object
and bone pointers for this case.

Reviewed By: Sybren

Differential Revision: http://developer.blender.org/D10570

Fix T85796
2021-04-08 17:26:33 +02:00
5c4d24e1fd EEVEE: Ensure Reflection: Use new implementation
Use same implementation as Cycles. Is also a bit faster.

Should also fix T86578 at the same time.
2021-04-08 17:09:59 +02:00
cf2baa585c Fix T81707: Spline IK Joints "Floating" above curve
The issue was that where_on_path uses a resampled curve to get the data
from the curve. This leads to disconnects between the curve the user
sees and the evaluated location data.

To fix this we simply use the actual curve data the user can see.

The older code needed a cleanup either way as there were hacks in other
parts of the code trying to work around some brokenness. This is now
fixed and we no longer need to clamp the evaluation range to 0-1 or make
helper functions to make it do what we actually want.

Reviewed By: Campbell, Sybren

Differential Revision: http://developer.blender.org/D10898
2021-04-08 15:52:33 +02:00
f031791185 Cleanup: modernize-use-equals-default
This was missing from rB19dfb6ea1f6745c0dbc2ce21839c30184b553878.
2021-04-08 15:51:39 +02:00
89b3c9da48 Text Editor: don't force other views to follow the cursor
While the existing behavior worked as intended,
it wasn't possible to have two views on the same file at different
locations.

Since there isn't much use in having two views open at the same location
allow one view to be at a different scroll location.

UI edit-source and selecting a text data block now need explicit calls
to scroll to the cursor location.

Resolves T87284
2021-04-08 22:15:51 +10:00
945b1143df Cleanup: renaming, comments and removing unused code in render pipeline 2021-04-08 13:13:07 +02:00
d244067d12 Fix T87291: assert on exit with preview render
Don't keep around persistent data in this case.
2021-04-08 13:13:07 +02:00
76cc8e8436 Fix T85974: Edit-mode undo/redo causes assertion
Without legacy-undo, loading memfile undo only cleared edit-mode data
for mesh and armature object types.
This causes an assertion when loading edit-mode undo steps afterwards
for other object types as the existence of this data made entering
object mode fail.

Resolve this by freeing all objects types undo data from ED_editors_exit
2021-04-08 20:39:56 +10:00
ed2639c722 Object: add ED_object_editmode_free_ex utility function 2021-04-08 20:39:44 +10:00
5e7331f12b Cleanup: rename variable (using underscore separator)
Prepare for adding another variable that
reads poorly without a separator.
2021-04-08 20:35:13 +10:00
0c0e9390d1 Revert "Fix entering edit-mode when object mode and edit-data don't match"
Before this change, object-data could only have
one of the objects referencing it in edit-mode.

Reverting since multiple meshes in edit-mode (for the same object data)
isn't thread-safe as the evaluated edit-meshes are created in the
original edit-mesh, causing a crash updating the depsgraph
for linked duplicates, see: T86767.

While we could support this case, it's a bigger project without
significant benefits, so reinstate the limitation of only
allowing a single object to be in edit-mode for each object data.

This adds back the error from T85974 which caused an assertion
but didn't crash in release builds.

This reverts commit 2b60d7d09c.
2021-04-08 20:34:29 +10:00
3249ab70ef Cleanup: spelling 2021-04-08 20:22:45 +10:00
4d43683899 PyAPI: ImBuf.copy now copies the underlying imbuf
Without this, copy wasn't useful.
2021-04-08 20:19:26 +10:00
e92a7800b5 LibOverride: Fix several issues with resync code.
This commit essentially touches to post-processing of collections and
objects after resync itself has been done, to ensure their proper
instantiation in the scene:

 - Remove a lot of the process in resync case (resynced data are assumed
   to be already instantiated in the scene, unlike override creation
   case).

 - For auto-resync, only do post-processing once after all overrides
   have been resynced (doing it after each individual resynced was
   causing a lot of instantiation glitches, with a lot of unwanted
   extra objects and collections being added to the master collection).

It also deals in a much more reliable way with detection of objects
missing from the scene, by using the new `BKE_scene_objects_as_gset`
utils.

As a bonus this makes auto-resync process slightly faster (only by a few
percents, but that's always good to get).
2021-04-08 11:45:55 +02:00
c1b1ed4d5b Minor cleanup to scene_collection_array.
Use array allocation, and remove useless check.
2021-04-08 11:45:44 +02:00
14d74fb341 BKE_collection: Add a util returning a gset with all objects in given scene's collections.
This is internaly using the code of `BKE_scene_objects_iterator` and
steals its gset. More efficient than using that iterator directly to
rebuild another GSet...
2021-04-08 11:45:44 +02:00
b4d6fe1f87 Cleanup: Typos in comments. 2021-04-08 11:45:44 +02:00
89e353354f Outliner Override: Tweak to order of error messages. 2021-04-08 11:45:44 +02:00
92dfc8f267 Outliner: regroup more type of entries under a single icon.
In folded view, some type of data are listed as one icon per item,
others are 'compacted' as a single icon with a counter.

This commit adds bones (edit, normal and pose ones), pose groups and
vertex groups as 'compacted' ones in folded view.

Part of D10855.
2021-04-08 11:45:37 +02:00
e1ae5bd45f LibOverride: Add a dedicated view in the Outliner.
This is a minimal, information-only view currently, listing by default
all the override data-blocks, with their user-edited override
properties.

System-generated overrides (like the overrides of pointers to other
override data-blocks) can be shown through a filter option.

Finally, potential info or warning messages from (auto-)resync propcess
are also shown, as an icon + tooltip next to the affected items.

Part of D10855.
2021-04-08 11:45:28 +02:00
8b68a75872 LibOverride: Add a new 'leftover' flag to ID.
This flag is set for liboverride IDs that are detected as no longer
needed by resync process, while having been user-edited, so
auto-handling code cannot silently delete them.

Exposing those to users will be part of the new incoming Override
Outliner view.

Part of D10855.
2021-04-08 11:31:24 +02:00
de6f19ce22 Cleanup: modernize-use-equals-default
This was missing from rB19dfb6ea1f6745c0dbc2ce21839c30184b553878.
2021-04-08 11:24:02 +02:00
19dfb6ea1f Cleanup: enable modernize-use-equals-default check
This removes a lot of unnecessary code that is generated by
the compiler automatically.

In very few cases, a defaulted destructor in a .cc file is
still necessary, because of forward declarations in the header.

I removed some defaulted virtual destructors, because they are not
necessary, when the parent class has a virtual destructor already.

Defaulted constructors are only necessary when there is another
constructor, but the class should still be default constructible.

Differential Revision: https://developer.blender.org/D10911
2021-04-08 11:07:27 +02:00
0ea66039dd Fix T87267: Texture Paint stencil texture not drawing
Typo in {rBafcfc6eb0842}.

Maniphest Tasks: T87267

Differential Revision: https://developer.blender.org/D10915
2021-04-08 08:36:23 +02:00
b7b1b2325c Fix T87274: Curve 2D resets to 3D on reload
This code is incompatible with .blend files from subversion 16 and 17.

The ideal would be to create a new subversion when landed rBf674976edd88.

But for now, due to the delay, moving the code to the previous subversion
can solve it.
2021-04-07 18:03:10 -03:00
79ba4fde15 Cleanup: Rename function, switch order of arguments
The function name was not very specific, this makes it clearer that it
works on instances rather than only real geometry. Also use `r_`
prefix for the return argument.
2021-04-07 15:49:02 -05:00
1a8db9ec04 Geometry Nodes: Rename grid output UV attribute
During review of D10730 it was discovered that the "uv" name causes
issues for cycles, which uses it as a default internal data name. While
that could be fixed in the future, there was no particular reason to use
"uv" instead of "uv_map", so we use the latter instead here, which
is consistent with the lowercase naming scheme chosen for attributes.
2021-04-07 13:23:32 -05:00
22ba85b510 Geometry Nodes: Greatly improve speed of some mesh primitives
Some of the BMesh primitive operators have a lot of overhead due to the
fact that they use other operators like extrusion, removing doubles,
and rotation, to build each shape rather than filling arrays directly.

Implementing the primitives directly with the Mesh data structure is
much more efficient, since it's simple to fill the result data based
on the known inputs. It also allows also skip the conversion from BMesh
to Mesh after the calculations.

Speed matters more for procedural operations than for the existing
operators accessible from the add menu, since they will be executed
every evaluation rather than once before a destructive workflow.

| Shape    |  Before (ms) |  After (ms) | Speedup (x times faster) |
| -------- | -------------| ------------| -------------------------|
| Cylinder | 1.1676       | 0.31327     | 3.72                     |
| Cone     | 4.5890       | 0.17762     | 25.8                     |
| Sphere   | 64213.3      | 13.595      | 4720                     |

The downside of this change is that there will be two implementations
for these three primitives, in these nodes and in `bmo_primitive.c`.
One option would be re-implementing the BMesh primitives in terms of
this code, but that would require `BMesh` to depend on `Mesh`, which
is currently avoided. On the other hand, it will be easier to add new
features to these nodes like different fill types for the top and the
bottom of a cylinder, rings for a cylinder, and tagging the output with
boolean attributes. Another factor to consider is that the add mesh
object operator could be implemented with these nodes, just providing
more benefit for a faster implementation.

As a future cleanup, there is room to share code that generates the
"rings" topology between different nodes that generate meshes.

Differential Revision: https://developer.blender.org/D10730
2021-04-07 13:15:43 -05:00
7c04ef210e Fix T87263: Animation decorator not working on Grease Pencil Build modifier Factor value
When having a checkbox and a value both in one row together with an
animation decorator it is questionable whether the decorator should act
on animating the checkbox or the corresponding value. At the moment,
usage in modifiers does not seem to be very consistent:

Here the animation decorator works for animating the checkbox:
- `Build` (greasepencil) > `Factor` (this was reported and is changed in
this patch to act on the value instead of the checkbox)
- `DataTransfer` > `Topology Mapping` > `Max Distance` (this I guess
should also act on the value instead of the checkbox)
- `Edge Split` > `Edge Angle` (questionable)
- `Mirror` > `Merge` (questionable)
- `Screw` > `Merge` (questionable)
- `Wireframe` > `Crease Edges` (questionable)

Here the animation decorator works for animating the value:
- `VertexWeightEdit` > `Group Add/Remove Threshold`
- `Decimate` > `Symmetry`

So in this patch only the behavior in the greasepencil Build modifier UI
is changed, since I think it is quite obvious that one would more often
use the decorator for animating the factor value than for animating the
checkbox.

Maniphest Tasks: T87263

Differential Revision: https://developer.blender.org/D10910
2021-04-07 18:44:15 +02:00
554d921124 UI: Remove confusing "Unset" context menu entry
This was added in 37b82a2d26, doesn't have much purpose and doesn't even do
anything in the vast majority of cases. It only affects custom properties. So
at the very least it shouldn't be shown for regular RNA property buttons. But
even for cases where it may do something, we couldn't find a good use-case. If
this operator has use-cases with some add-ons, the add-ons can expose it
differently, e.g. with a little 'x' icon next to the button, like it's done in
the keymap editor.

So removing the context menu entry now. Should this turn out to be a problem,
it can be brought back but much more selectively (only where it actually does
something). Or we could combine it with "Reset to Default".

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

Reviewed by: Brecht Van Lommel, Hans Goudey
2021-04-07 18:04:43 +02:00
Leon Leno
965425bcbc Fix T86463: Colored collection icons don't scale with zoom level
This patch fixes the issue in T86463 that colored collection icons in
the collection search box don't scale according to the zoom level.

The issue was caused by the drawing function for the colored
collection icons not allowing to change the size of the icons.
This patch addresses that by scaling the icon based on the drawing
width.

Reviewed By: #user_interface, natecraddock, Severin

Differential Revision: https://developer.blender.org/D10708
2021-04-07 08:54:05 -06:00
02a7289fe3 Fix T87264: Button to remove physics modifier doesn't work
This is caused by rB9f323e9bf79f. When hover shortcuts are used,
we cannot use the modifier from the context (which will be the
active modifier), or they won't be hover shortcuts anymore!

There didn't use to be an editor-level "modifier" context variable,
which is why this worked before.

The fix is simple, just specify the modifier name for this particular
remove button.

Differential Revision: https://developer.blender.org/D10870
2021-04-07 09:12:34 -05:00
15670ebb95 Cleanup: Fix pessimizing move warning. 2021-04-07 15:20:45 +05:30
2fbee4598c Fix T87195: Boolean node multi-input socket only accepts one link
The default insert link callback for nodes was trying to move the
existing link away, since it didn't properly handle multi-input sockets
(though the problem wasn't exposed for the join node). We can basically
skip all of this "moving existing links" for multi-input sockets, unless
we are at the link limit.
2021-04-07 00:32:16 -05:00
fd0a0096dd Cleanup: Various cleanup of node link handling functions
Use LISTBASE_FOREACH macro, rename variables, comment formatting,
simplification of logic, etc.
2021-04-07 00:26:03 -05:00
e0a1a2f49d Geometry Nodes: Bounding Box Node
This commit adds a simple node to output the min and max of an
axis-aligned bounding box for the input geometry, as well a rectangular
prism mesh created from these values for convenience.

The initial use case for this node is a "bounding box boolean", where
doing the boolean with just a bounding box could be signigicantly
faster, for cases like cutting a hole in a wall for a window. But it's
easy to imagine other cases where it could be useful.

This node supports mesh and point cloud data right now, volume support
will come as a separate patch. Also note that there is plenty of room
to improve the performance of this node through parallelization.

Differential Revision: https://developer.blender.org/D10420
2021-04-06 16:02:55 -05:00
Wannes Malfait
93114180d7 Geometry Nodes: Use distance units for socket values
This adds the property subtybe `PROP_DISTANCE` where appropriate.

Differential Revision: https://developer.blender.org/D10900
2021-04-06 12:02:28 -05:00
b61b34a5d2 Fix T87236: crash reading file with grease pencil palettes
Caused by typo in {rB76689e851700}.

Since Palettes and bGPDpalette are not the same size, this would not
only cause a crash in versioning code, but could only go downhill from
here on.

Maniphest Tasks: T87236

Differential Revision: https://developer.blender.org/D10903
2021-04-06 17:01:06 +02:00
b93c445809 BLI: return pointer to added resource
Without this, the caller often has to get the pointer to the
resource before adding it to the resource scope.
2021-04-06 15:49:43 +02:00
Germano Cavalcante
490801ba1d Fix T86889: Rotation with top plane view glitches
The `InputAngle` function uses a flawed algorithm to fix precision issues.

This commit refactor the logic of that function by using BLI utilities.

Differential Revision: https://developer.blender.org/D10880
2021-04-06 10:41:45 -03:00
24d71acd86 Fix Cycles rendering files with Simplify wrong after recent changes
The versioning code was not taking into account the old default for AO
bounces.
2021-04-06 15:34:13 +02:00
9676a1f61e Fix render crash in some .blend files after Persistent Data changes
Must always clear recalc flags, even if no editors use them, the depsgraph
execution itself also depends on them.
2021-04-06 15:02:30 +02:00
19ff2479cf Compositor: Add Streaming Operator for NodeOperationBuilder.
For debugging purposes to convert the internal state of the
NodeOperationBuilder to a graphviz.

Usage:

	std::cout << *this << "\n";

Inside any method of the NodeOperationBuilder.
2021-04-06 12:06:47 +02:00
663a82b10d Fix T86932: Curve: pick shortest path missing update of active point drawing
For curves, we need to tag the curve ID_RECALC_COPY_ON_WRITE for batch
cache update (same as in {rB24b2fe50f3ec}).

Maniphest Tasks: T86932

Differential Revision: https://developer.blender.org/D10826
2021-04-06 11:14:38 +02:00
e71408d0d7 Fix T84623: Curve/Surface force not working in normal direction
Tweaking e.g. a field strength would then not use the curve/surface
normal anymore [but the object center instead].

If a curve has a forcefield with effector shape Curve (in code its shape
is PFIELD_SHAPE_SURFACE then), it wil get a SurfaceModifier.

Changing properties will free the SurfaceModifierData's bvhtree and mesh
And these dont get copied along when doing the CoW copy, these are
explicitly set to NULL. So this was also failing for meshes, not just
curves.

Without the mesh & bvhtree though, get_effector_data() will not set the
EffectorData's normal correctly (it is closest_point_on_surface() which
does this). And without the right EffectorData's normal, the effector
will of course work unexpected.

Going in and out of editmode made this work because that goes down this
route:
- BKE_object_handle_data_update
- BKE_displist_make_curveTypes
- do_makeDispListCurveTypes
- curve_calc_modifiers_post
-- BKE_mesh_new_nomain_from_curve_displist
-- we then have our desired updated mesh from the curve
-- this will also call the SurfaceModifiers deformVerts [which - given we
have a valid mesh - will update the bvhtree properly]

Also note that _animating_ the effector actually works, (have not done
the deep dive why this works, assume the curve geometry is updated in
this case)

So, now just carefully tag the curve ID_RECALC_GEOMETRY in
rna_FieldSettings_update for this specific case.

Maniphest Tasks: T84623

Differential Revision: https://developer.blender.org/D10092
2021-04-06 11:06:24 +02:00
Evan Wilson
7334c481c0 Fix T86175: Missing viewport update when toggling HDRI preview
Caused by rB0f95f51361d7.

Similar to T85515, T84717, T85543 and their related fixes.
In this case, add missing shading notifier as in rB9274bd457a25.

Reviewed By: brecht, lichtwerk

Maniphest Tasks: T86175

Differential Revision: https://developer.blender.org/D10604
2021-04-06 09:57:40 +02:00
c6ddc2abd3 Suppress compiler warning. 2021-04-06 08:39:41 +02:00
9c20228128 Fix T48167: Mesh select random factor is not accurate
Selecting random percentage would not reliably guarantee the precise
percentage of selected elements now randomize an index array instead
and use the precise number of elements from this array.

Note that this change has only been made to edit-mesh
and should be applied to all random selection operators.
2021-04-06 14:59:10 +10:00
3f3b4745b6 Fix T87187: Area.type & ui_type empty area access fails
Reading Area.type & ui_type printed an error from `pyrna_enum_to_py`
and returned an empty string.

As empty is a valid value, include it in the property enum list.
2021-04-06 13:08:35 +10:00
074b0b6da0 Py API Docs: Update sphinx and theme versions 2021-04-05 17:28:36 -04:00
cf0e7af07e BLI: fix axis order in 'BLI_array_iter_spiral_square'
x and y were inverted.
2021-04-05 14:28:43 -03:00
44c76e4ce3 3D View Utils: Add 'margin' parameter to 'ED_view3d_depth_read_cached'
Matches the alternative function ED_view3d_autodist_depth, but is more
efficient since it uses the cache.

No functional changes.
2021-04-05 10:48:37 -03:00
50782df425 Render: faster animation and re-rendering with Persistent Data
For Cycles, when enabling the Persistent Data option, the full render data
will be preserved from frame-to-frame in animation renders and between
re-renders of the scene. This means that any modifier evaluation, BVH
building, OpenGL vertex buffer uploads, etc, can be done only once for
unchanged objects. This comes at an increased memory cost.

Previously there option was named Persistent Images and had a more limited
impact on render time and memory.

When using multiple view layers, only data from a single view layer is
preserved to keep memory usage somewhat under control. However objects
shared between view layers are preserved, and so this can speedup such
renders as well, even single frame renders.

For Eevee and Workbench this option is not available, however these engines
will now always reuse the depsgraph for animation and multiple view layers.
This can significantly speed up rendering.

These engines do not support sharing the depsgraph between re-renders, due
to technical issues regarding OpenGL contexts. Support for this could be added
if those are solved, see the code comments for details.
2021-04-05 14:05:01 +02:00
3fa580866e Cycles: update Light Paths preset
* Add Fast GI / AO bounces to presets
* Add Default preset matching defaults
* Add Fast Approximate GI preset
* Lower Full GI depths to 32
2021-04-05 14:05:01 +02:00
edd2f51b4e Cycles: make AO bounces settings more discoverable
* Move out of Simplify panel, into Light Paths > Fast Global Illumination
* Add separate boolan setting to enable/disable it separate from Simplify
* Default AO bounces to 1
* Put ambient occlusion distance in this panel as well
2021-04-04 15:20:23 +02:00
8681504f06 Fix inversion of snapping failing in measure tool
Comparison of event change has to be more specific and compare the x and y
values of the mouse as well.
2021-04-03 13:32:42 -03:00
62f8d9e478 Fix T87162: Measure Tool Not Working
The non-enabled gizmo was overwriting the projected coordinate value.
2021-04-03 12:48:46 -03:00
321eef6a0c UI: Align Spreadsheet Booleans to Center
Aligning spreadsheet Booleans to the middle of their cells.

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

Reviewed by Hans Goudey
2021-04-02 14:26:16 -07:00
46d75052eb Geometry Nodes: Separate grid primitive X and Y size
Since you can already specify a separate size for X and Y with the
grid node, it makes sense to be able to specify the size separately
for each axis also.

This also avoids some awkward math with a Transform node afterwards
when you want a specific size for each direction.

Versioning (except for animation and drivers) is handled in this commit.

Differential Revision: https://developer.blender.org/D10834
2021-04-02 14:35:48 -05:00
e0a07700bf GPencil: Prevent RNA assignment of invalid materials in modifiers
Materials used in grease pencil modifiers have the requirement that they
are already used on the object. In the UI dropdown, this restriction is
ensured by calling uiItemPointerR with appropriate searchptr and
searchpropname, so only giving the user the choice of materials already
used on the object.

From python though, it was still possible to assign materials outside of
this this restriction. This led to reports like T86981 [which have been
partially solved by clamping the material index in the modifier code to
be in the valid range].

Now make sure we dont assign "invalid" materials through RNA by
appropriate RNA pointer functions.

This also adds a proper warning (red, alert) in case of the LineArt
modifier if such a invalid material is still in the file [same as other
modifiers already do].

Differential Revision: https://developer.blender.org/D10873
2021-04-02 21:23:37 +02:00
fcc3227efd Fix T86654: wrong Vertex Interpolation option default when importing alembic caches
This resulted in bad motion blur from alembic animation when imported
after rB83980506957c (because it was now OFF by default).
When imported in a version prior to rB83980506957c and saved, this was
still working fine.

Vertex interpolation option introduced in rBbab2260b59c7 was defaulting
to ON (correct) in that commit, but was lost in rB83980506957c.

Now switch this to ON by default again.

Note: if you have a file that was (incorrectly) imported with a version
after rB83980506957c you'll have to enable Vertex Interpolation option
on every MeshSequenceCache modifier by hand.

Maniphest Tasks: T86654

Differential Revision: https://developer.blender.org/D10876
2021-04-02 21:18:34 +02:00
0e8fa1d44b Geometry Nodes: Allow float input for point scale node
This allows easily changing the scale attribute with a uniform scale
within a single simple node.
2021-04-02 12:03:27 -05:00
bd9c479475 Geometry Nodes: Change point translate and scale node defaults
Since these nodes are usually used for more basic operations and the
attribute nodes are used when more complexity is necessary, it makes
sense to give these nodes more accessible defaults-- hopefully this can
make learning about the core concepts of geometry nodes a bit easier.
2021-04-02 11:45:05 -05:00
8bd0bde012 UI: Align Spreadsheet Reals and Integers to Right
Aligning spreadsheet cell numbers to the right to aid readability.

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

Reviewed by Hans Goudey
2021-04-02 09:03:36 -07:00
8aff86a0c7 Cleanup: Remove blender namespace from Map. 2021-04-02 16:16:33 +02:00
36427a8d03 Cleanup: remove loading blender namespace from Vector. 2021-04-02 16:13:27 +02:00
b6ab1107c2 Cleanup: Added leading e to enum types. 2021-04-02 16:11:13 +02:00
5a491adc17 Cleanup: rename eChunkExecutionState to eWorkPackageState. 2021-04-02 16:07:46 +02:00
210f7f0f8e Compositor: stream operators for WorkPackages.
Helps developers during debugging.
2021-04-02 15:41:16 +02:00
a0f705f18c Compositor: Debug stream operator.
Stream operators for NodeOperator and ExecutionGroup to help during
debugging.
2021-04-02 15:24:34 +02:00
fa9b05149c Fix T84520: Make the different weight paint code paths exclusive to each other
Before this change, you could have the new sculpt symmetry code and the
older weight paint symmetry code active at the same time. This would
lead to users easily trashing their weigh paint data if they were not
careful when switching between modes.

Now the specific weight paint symmetry code is an exclusive toggle so
the user can't accidentally mirror strokes and vertex groups at the same
time. This also paves the way of supporting Y and Z symmetry in the
future for weight groups mirroring if we decide to add it in the future.

Reviewed By: Sybren

Differential Revision: http://developer.blender.org/D10426
2021-04-02 14:44:26 +02:00
e7a0a75919 Fix T87131: SVG as GPencil elements with both Stroke and Fill fails
The importer was not checking if both were enabled. Now a new material is created if it's needed.
2021-04-02 13:45:58 +02:00
548d16d4a5 BKE: attempt to fix build error on windows 2021-04-02 17:06:24 +05:30
Kris
3fcac26362 Fix T86874: Wireframe not drawing for geometry node mesh primitives
The following primitives needed ME_EDGEDRAW, ME_EDGERENDER edge flags:
* Grid
* Circle

Set flags on the inside edges for grid and circle triangle fan (mesh primitive nodes)
so they are visible and selectable.

Reviewed By: HooglyBoogly
Differential Revision: https://developer.blender.org/D10878
2021-04-02 10:43:43 +02:00
6578f9d1e9 Modifiers: Fix build error with GMP 2021-04-02 13:48:22 +05:30
a0e1080428 Cleanup: Remove unecessary C API for direct mesh boolean
The main goal here is to remove the need for a C API to the code in
`mesh_boolean_convert.cc`. This is achieved by moving `MOD_boolean.c`
to C++ and making the necessary changes for it to compile. On top of
that there are some other slight simplifications possible to the
direct mesh boolean code: it doesn't need to copy the material
remaps, and the modifier code can use some other C++ types directly.
2021-04-02 00:16:23 -05:00
77f6857740 Cleanup: Use const arguments 2021-04-02 00:04:53 -05:00
d91fec1a85 Cleanup: Remove unused code in boolean modifier
The old path that didn't skip the conversion to and from BMesh for
the exact solver was not yet removed from this file. At this point no
problems have came up in the new implementation, so it's safe
to remove it.
2021-04-01 16:49:10 -05:00
c5d9968392 Cleanup: Remove unecessary part of instances component C API
Now that object_dupli.cc is a C++ file, we don't have to have a specific
function to retrieve the instance data from the geometry set.
2021-04-01 16:23:16 -05:00
3ca1cf2b51 Cleanup: Move object_dupli.cc to C++
This will hopefully allow more refactoring in the future to improve
the instancing system, especially how it relates to geometry nodes
instances.
2021-04-01 15:54:48 -05:00
e8573a59f6 Geometry Nodes: Improve speed of boolean node, use multi-input socket
This commit improves the performance of the node by up to 40% in some
cases when there are only two input meshes, mainly by skipping the
conversion to and from BMesh.

When there are more than two input meshes (note the distinction from
"Geometries", a geometry set can have many mesh instances), the
performance is actually worse, since boolean currently always does
self intersection in that case. Theoretically this could be improved
in the boolean code, or another option is automatically realizing
instances for each input geometry set.

Another improvement is using multi-input sockets for the inputs, which
removes the need to have a separate boolean node for every operation,
which can hopefully simplify some node trees.

The changes necessary for transforms in `mesh_boolean_convert.cc` are
somewhat subtle; they come from the fact that the collecting the
geometry set instances already gives transforms in the local space
of the modifier object. There is also a very small amount of cleanup
to those lines, using `float4x4::identity()`.

This commit also fixes T87078, where overlapping difference meshes
makes the operation not work, though I haven't investigated why.

Differential Revision: https://developer.blender.org/D10599
2021-04-01 15:00:47 -05:00
76cdcc2bca Cleanup/Refactor: Use flags instead of bool to configure the snap gizmo
This simplifies the addition of future improvements.

Also make it more practical to expose as a parameter of gizmo for Python.
2021-04-01 12:32:59 -03:00
5da5fb31db Cleanup: Remove unused enum value in editmesh_knife.c 2021-04-01 12:15:00 -03:00
2dc16223de Fix compilation error: "too many arguments to function"
Seem on linux.

Caused by rB6ec463a4b754bf69baf94ba6b3683655f6834ccd
2021-04-01 12:12:31 -03:00
6ec463a4b7 Cleanup/Refactor: Transform Orientation: Use 'orient_index' instead 'orient_type'
`orient_index` is a more comprehensive value as it reveals both the type and index.

Differential Revision: https://developer.blender.org/D9595
2021-04-01 11:20:32 -03:00
952c4e41bb Fix T87065: Deformed Lattice undeforms after setting keyframe
Handle Lattice object the same way as Mesh objects. This is mostly to
execute the `object->data = data_eval;` line, which ensures that the
evaluated mesh is assigned to the evaluated object, and thus prevents
the lattice from un-deforming.
2021-04-01 15:59:52 +02:00
75b675ceab Cleanup: typo fix in comment
No functional changes.
2021-04-01 15:59:52 +02:00
b5c2c3aba8 BLI: rename resource collector to resource scope
Differential Revision: https://developer.blender.org/D10857
2021-04-01 15:55:23 +02:00
Germano Cavalcante
f674976edd Curve: Remove 'CU_2D' flag used for nurbs
This fixes T86440

As the CU_2D flag is set for nurbs, a Curve can have 2D nurbs mixed with 3D.

But the UI does not allow this mixing. It updates all nurbs to 2D or 3D when set.

So remove this specific flag for nurbs.

This may break old files, since 2D curves with mixed 3D are now set as 3D.

Differential Revision: https://developer.blender.org/D10738
2021-04-01 10:54:49 -03:00
7a757662bc Cleanup: use bool instead of int 2021-04-01 15:45:56 +02:00
6be964e267 Cleanup: Remove unused code
There was a note about reusing this for "texture nodes", but that will
probably not be implemented in this way anyway.
2021-04-01 08:42:03 -05:00
2a2a4c8a27 Cleanup: move node_exec.c to c++
Doing this, because it might make it easier to replace the implementation
of `bNodeInstanceHash`.
2021-04-01 15:14:53 +02:00
b00727950c Nodes: separate node name and display name in bNodeTreePath
Previously, `node_name` was rarely actually a name of a node. It is set
correctly as node name in `ED_node_tree_push`. However, later on it
was overwritten by the name of an id data block in `node_draw_space`.

Now, the node_name stays the name of the "parent" node. Whereas
display_name is the name that will be displayed in the breadcrumbs.

With this change, the `node_name` can be used to reconstruct the
actual path from the root node tree to the currently visible tree.

Differential Revision: https://developer.blender.org/D10874
2021-04-01 14:39:12 +02:00
1bdceb813c Cleanup: spelling 2021-04-01 22:20:53 +11:00
2a5c0c3491 Geometry Nodes: add socket value logging capability
The node tree evaluator now calls a callback for every used socket with
its corresponding value(s). Right now the callback does nothing.
However, we can use it to collect attribute name hints, socket values
for debugging or data that will be displayed in the spreadsheet.

The main difficulty here was to also call the callback for sockets in
nodes that are not directly executed (such as group nodes, muted
nodes and reroutes).

No functional changes are expected.
2021-04-01 13:10:22 +02:00
328b39335e BLI: add call_safe method for FunctionRef
This is useful to avoid nullity checks in some places.
2021-04-01 12:38:14 +02:00
fa50edc999 BLI: return early when copying empty array 2021-04-01 12:38:14 +02:00
0ffbcc4416 Fix "unused variable" warning when compiling without nanovdb 2021-04-01 12:36:23 +02:00
496df39e6f LineArt: Remove "soft selection" option.
After some back and forth with the GP module and some artists, this
option was deemed not that useful. The use case was considered too
obscure so we'll remove it.

It is still posible to have this functionality by using the vertex
weight modiifers or manually clamping the weights.
2021-04-01 12:36:23 +02:00
e1b2cf887f LineArt: Remove resampling settings.
This can be done with an other GP modifier already.
2021-04-01 12:36:23 +02:00
d5cefc1844 Fix T50103: Transform not working if scale is zero
If any axis of the scale of an object was zero, transforming failed.
This was because `td->smtx` was set to a zero matrix.

orthogonalize_m3_zero_axes is used to fill in the zeroed axes.

Thanks to @filedescriptor for the initial fix: D10869.
2021-04-01 21:35:19 +11:00
8a144b73c0 BLI_math: add orthogonalize_m#_zero_axes
Expose a this function to initialize any zeroed axes
to an orthogonal vector based on other non-zeroed axes.

This functionality already existed for `invert_m#_m#_safe_ortho`,
expose as a public function as it's useful to be able to fill in zeroed
axes of transformation matrices since they may be used in matrix
multiplication which would create degenerate matrices.
2021-04-01 21:34:35 +11:00
3f24cfb958 Cycles: light spread importance sampling for rectangular area lights
Compute a subset of the area light that actually affects the shading point
and only samples points within that.

It's not perfect as the real subset is a circle instead of a rectangle, and
the attenuation is not accounted for. However it massively reduces noise for
shading points near the area light anyway.

Ellipse shaped area lights do not have this importance sampling, but do not
have solid angle importance sampling either.

Ref D10594
2021-04-01 12:31:01 +02:00
Matteo Falduto
a4260ac219 Cycles: add a spread setting for area lights
This simulates the effect of a honeycomb or grid placed in front of a softbox.
In practice, it works by attenuating rays coming off-angle as a function of the
provided spread angle parameter.

Setting the parameter to 180 degrees poses no restrictions to the rays, making
the light behave the same way as before this patch.

The total light power is normalized based on the spread angle, so that the
light strength remains the same.

Differential Revision: https://developer.blender.org/D10594
2021-04-01 12:31:01 +02:00
c859e1afa0 Fix: incorrect versioning code for lights properties
Due to T64791 we must still use the old Lamp name rather than Light, work
around that for now.
2021-04-01 12:31:01 +02:00
Nikita Sirgienko
b30cc7071b Fix Cycles build error with "make developer" on some CPUs
The combination of building unit tests and WITH_CYCLES_NATIVE_ONLY did not
correctly detect when AVX/AVX2 support is available.

Differential Revision: https://developer.blender.org/D8201
2021-04-01 12:31:01 +02:00
64538532d4 Fix T87056: Segfault in GPU_batch_clear() involing Lattice evaluation
Fix a segfault by setting the `batch_cache` pointer to `NULL` when copying
a Lattice. That way the copy can get its own batch cache when needed,
preventing a use-after-free.
2021-04-01 12:28:26 +02:00
d904271d09 Libmv: Add clang-format for third party sources
Got ignored in the initial commit of clang-format support to the Libmv.
2021-04-01 11:32:47 +02:00
7faf5b0e02 Fix condition for ffmpeg seek workaround
This condition was in contradiction with comment for function
`ffmpeg_generic_seek_workaround()`.

I have noticed, that formats that seeked well used this workaround.
Problem was that I misunderstood code from `av_seek_frame()` - formats
with `read_seek()` function stil don't use generic seeking method.
This is defined in `seek_frame_internal()`
2021-04-01 11:30:11 +02:00
546fa9a759 Fix T87037: Add tooltip for "Paste Flipped"
The "Paste Flipped" operator was missing its own tooltip.

This patch adds the tooltip by implementing the `get_description` callback for
`GRAPH_OT_paste` and `ACTION_OT_paste`.

Reviewed By: sybren

Maniphest Tasks: T87037

Differential Revision: https://developer.blender.org/D10859
2021-04-01 11:04:05 +02:00
6fe2d6b8c8 Fix freezed proxy frames
`ffmpeg_generic_seek_workaround()` applied negative offset for seqrched
packet timestamp, but proxies always start from 0 and timestamp can be
 negative.

Limit timestamp value to 0, because `av_seek_frame()` doesn't accept
negative timestamps and returns with error. This prevents seeking from
working correctly.
2021-04-01 10:45:53 +02:00
a9fc5be5fa Fix T86331: Preferences menu inaccessible until window resize
The RGN_TYPE_EXECUTE region was zero height - with the "Load & Save"
button drawing outside of those bounds - so it didn't respond to events.

This is because the region started off this size and does not change
with simply adding the buttons. Although it has RGN_FLAG_DYNAMIC_SIZE,
delayed reinit of regions is only currently supported on headers.

This gives the execute region an initial (minimum) vertical size but
also makes the region **hidden** by default.

- Showing Prefs as an editor among others it will show the header
  but not the execute region.

- Showing the Prefs in a popup window, hides the header region
  and shows the execute region.

Ref D10636
2021-04-01 17:42:01 +11:00
ab652c2c90 Cleanup: method naming. 2021-04-01 08:16:43 +02:00
4b595de5e6 Cleanup: Split up methods. 2021-04-01 08:16:43 +02:00
d5c6485372 Cleanup: clang format 2021-04-01 11:18:26 +11:00
93972c8910 Clang Format: bump the minimum version to 8
Make use of `StatementMacros` so Python structs are formatted correctly.

The comment about STRINGIFY doesn't seem to be valid anymore,
so this has been left out.
2021-04-01 11:18:05 +11:00
a641e08227 Cleanup: Use const arguments in curve code 2021-03-31 18:07:15 -05:00
1a100d2d78 Cleanup/CMake: tweak messages in platform_apple 2021-04-01 01:13:22 +05:30
f061de9b3e Cleanup/CMake: warning to status to reduce noise
Correction in e5f0d176d4
2021-04-01 01:12:48 +05:30
910469eccf Cleanup: Remove remaining unused code for DispList "bevel_split"
This was added in rB93aeb6b318a7, last changed in rB8f0a44a5d55d,
and removed in rB51b796ff1528. I assume it was a way for curves to
have split edges at corners. As far as I can tell it only ever worked
in Blender Internal, and that has been gone for years.

Another possible route here would be restoring this functionality,
but it's generally preferrable to reduce complexity in this
area of curve code than adding it back, especially in the context
of other improvements planned related to curves in geometry nodes.

Differential Revision: https://developer.blender.org/D9966
2021-03-31 11:37:21 -05:00
46ee9b599a Fix T87094: Transforming geometry instances component is broken
Caused by an incorrect transformation order in cleanup commit
rBd037fef3bd1dc2e. The fix is to simply reverse the order.
2021-03-31 11:32:52 -05:00
94bfb1ab62 Alembic procedural: fix missing update when editing shaders 2021-03-31 17:18:32 +02:00
6f2e9e9f90 Alembic procedural: comment, speficy the behavior of a function 2021-03-31 17:18:32 +02:00
5580f64d80 Alembic procedural: cleanup, make add_object private
This should only be accessed from within the procedural.
2021-03-31 17:18:32 +02:00
b4e584949c Alembic procedural: fix out of bound access when editing object properties or shaders
The index_data_map was not cleared when clearing a cache, so this would just append
the new correct data to the end of the array instead of overwriting it, which would
cause us to then use outdated indices.
2021-03-31 17:18:32 +02:00
4fd7b1f3db Geometry Nodes: Rename "Grid" to "Density"
For other "Attribute Name" fields we usually give a more specific name
that relates to what the attribute is actually used for, like "Mask" in
the point separate node. This is a similar situation, and would also
be consistent with the naming planned in D10506.
2021-03-31 10:10:44 -05:00
482a42c0f6 Fix T87087: attributes were removed automatically even though they are still needed
The geometry nodes modifier did not specify that it needs all custom data layers.
Therefore the modifier evaluation code tagged some layers so that they will not be
copied later on by calling `mesh_set_only_copy` in `mesh_calc_modifiers`.
2021-03-31 16:25:39 +02:00
23bd6cff81 GPencil: Avoid LineArt modifier uses negative material index
In some situations the material index could be negative, and this is wrong.
2021-03-31 16:17:31 +02:00
d55d4fee30 Fix compiler error in Windows
C7555	use of designated initializers requires at least '/std:c++latest'

This is not supported by the current Windows compiler version.
2021-03-31 16:01:18 +02:00
10272ca788 GPencil: Remove flag PROP_ID_SELF_CHECK from materials
This flag was used by error when the code of RNA object was used as base, but it's not logic in materials.
2021-03-31 15:50:48 +02:00
94079ffc7f Fix T86879 Boolean exact crash with dependency loop.
When boolean's Object also has a modifier that depends back on
the target Object, a crash occurred.
In a case like this, BKE_modifier_get_evaluated_mesh_from_evaluated_object
returns NULL, so just have to protect against that case.
2021-03-31 09:35:40 -04:00
23c1e48e19 Cleanup: naming for edit-mesh nearest distance values
- Don't use `r_` prefix for an argument that's also read from
  (this is meant for return only arguments).
- Rename variables to make it clear the distance is pixels,
  using manhattan length measurement.
2021-04-01 00:01:23 +11:00
5f787b290c Cleanup: Removed Unused Definition. 2021-03-31 14:47:38 +02:00
bc837ad14e Fix: Cryptomatte Picker on Legacy Node Failing.
The new Cryptomatte workflow assumes that the picker is used in the new
workflow. The legacy node wasn't working as it would never find a
correct cryptomatte layer. This fix will use the color sampling like we
used to do.
2021-03-31 14:43:14 +02:00
1a7b94236e Compositor: Keep WorkPackages and Data Around.
WorkPackages struct was created when scheduled. This patch keeps the
WorkPackages around and stores additional data with the workpackages.

The speedup is to small to notice, but it is needed as preparation
to introduce a faster scheduling method.
2021-03-31 14:43:14 +02:00
14901e3774 Fix T87080: Select shortest path fails in face mode
Regression in 80cbbd2843.

Unfortunately keeping selection picking behavior as well as
supporting finding the nearest face within a radius requires an
inconsistency between x-ray and back-buffer selection that
doesn't work well using the current arguments.

Resolve by adding an argument that causes the input distance
to be ignored for back-buffer selection.

This is used by selection picking but not the knife tool.

This changes behavior for path-selection in face mode,
which now uses a margin for back-buffer selection.

From my own testing this doesn't seem to be a problem like it could be
for regular selection picking.
2021-03-31 23:36:51 +11:00
d97dca5106 Fix T86947: Drag & Drop tooltip in Scene mode
The tooltip while dragging a collection in Scene mode in the Outliner
was always "Link inside Collection" even if the action performed was
different. This was because the `collection_drop_init` set the
`from_collection` always to `NULL` if the Outliner display mode was
currently set to Scene.
Commit that introduced this issue:
rB0f54c3a9b75be8f8db9022fb0aeb0f8d0d4f0299

The fix removes the check of the display mode and only sets the
`from_collection` to `NULL` if the ctrl (linking) key is held.

Reviewed By: JacquesLucke

Maniphest Tasks: T86947

Differential Revision: https://developer.blender.org/D10864
2021-03-31 14:23:08 +02:00
8d45a96789 Fix T87082: Smooth thickness not working
When using the smooth operator, the thickness would not be
smoothed on the first iteration. This was becasue the inner loop
was set to run `r * 20` times but `r` starts at 0.

The fix makes sure that "Smooth Thickness" works on the first
iteration by using  a fixed value of `20` as the loop limit. This
makes sure that for every iteration, we run the smoothing of the
thickness 20 more times.

Reviewed By: antoniov

Maniphest Tasks: T87082

Differential Revision: https://developer.blender.org/D10867
2021-03-31 14:19:01 +02:00
f02e1a77c9 Makefile: add update_code target
Convenience target for updating the code, skipping SVN.

The Python script supports it, but this wasn't exposed in the makefile.

Ref D10457
2021-03-31 22:34:11 +11:00
4d856ecb11 Cleanup: Fix warnings
Introduced in b128ffd539
2021-03-31 12:34:44 +02:00
e9616c82bd Cleanup: use constexpr for num channels.
Don't assume all compilers are smart. MSVC doesn't inline the call away like CLANG and GCC did.
2021-03-31 11:00:07 +02:00
645fc0c767 Fix build error on windows
Error was caused by using `#if` directive in `PyDoc_STRVAR` macro.

This partially reverts 1e4c35d910
2021-03-31 09:46:38 +02:00
b128ffd539 Cleanup: Remove SEQ_CURRENT_BEGIN macro
Use LISTBASE_FOREACH instead.
SEQ_CURRENT_BEGIN did null checks, so now these must be explicit.

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D10823
2021-03-31 09:27:31 +02:00
43369ca80e PyDoc: quiet warning with literalinclude including blank lines
Files that only contain a doc-string still included the last blank line,
since this normally contains code examples.

There are some cases where only a docstring exists
which made sphinx report warnings.
2021-03-31 17:47:31 +11:00
d5f2043ab3 PyDoc: fix indentation with multi-line property descriptions
New lines were written without indentation,
causing invalid RST to be generated.
2021-03-31 17:43:30 +11:00
1e4c35d910 PyDoc: correct sphinx syntax for gpu.state.blend_set 2021-03-31 17:42:21 +11:00
b547ac32d9 Cleanup: use early return for imbuf image loader functions
Most imbuf loaders already did this, use early exit for the remaining
loaders that didn't.
2021-03-31 17:05:57 +11:00
e7f890aa59 WM: use data-path utility functions for WM operators
Use utility functions to decompose data paths and resolve the
RNA property from a data-path.
Replaces in-line string manipulation and RNA access.

This allows more complex data paths to be used, where previously string
literals in a data path could break the simple data-path handling logic.
2021-03-31 15:29:50 +11:00
1beca76934 PyAPI: add bl_rna_utils.decompose_data_path
Utility function for splitting an RNA path, to be used by `bpy.ops.wm.*`
2021-03-31 15:03:19 +11:00
c59a7f44a1 Fix bl_rna_utils._TokenizeDataPath function argument extraction error
Converting functions with single arguments to a string
added an additional comma.
2021-03-31 15:01:44 +11:00
5678e6c2bc Cleanup: improve navigation gizmo flag use
Flag check for V3D_LOCK_CAMERA used boolean style assignment to a char,
which worked with this flag but could fail if other flags are added
that use this convention in the future.

- Add static type checks for values so any change to DNA types
  will need to be made in the navigation gizmo too.
- Move camera lock check from `rv3d` to `v3d`,
  as this isn't stored in the region data.
2021-03-31 13:04:12 +11:00
87aa514611 UI: Gizmo Button to Lock Camera to View
2D gizmo navigation button that toggles 'Lock Camera to View' while in Camera View.

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

Reviewed by Campbell Barton
2021-03-30 14:09:26 -07:00
1425411249 Cleanup/Refactor: Unify functions that redraw the depth buffer
Now `ED_view3d_backbuf_depth_validate`, `ED_view3d_draw_depth` and
`ED_view3d_draw_depth_gpencil` are unified in `ED_view3d_depth_override`.

This new function replaces `ED_view3d_autodist_init`.

Also, since `ED_view3d_depth_update` depends on the render context, and
changing the context is a slow operation, that function also was removed,
and the depth buffer cached is now updated inside the new unified drawing
function when the "bool update_cache" parameter is true.

Finally `V3D_INVALID_BACKBUF` flag has been renamed and moved to
`runtime.flag`.

Differential revision: https://developer.blender.org/D10678
2021-03-30 16:23:58 -03:00
da1b002c8d UI: Skip undo steps when changing properties of the 3d cursor
Differential revision: https://developer.blender.org/D10695
2021-03-30 16:13:21 -03:00
54d7dea283 Fix: buttons whose property contains an 'owner_id' ignore rna undo check
Introduced in rBce462fa1 but harmless since curretly only `StructRNA`
without `owner_id` have the `STRUCT_UNDO` flag cleared.

So this commit does not bring any functional changes but it will be
useful for {D10695}.
2021-03-30 16:10:58 -03:00
67b40f829e Fix T87058: GPencil Cutter delete all strokes if they are selected and the layer is locked
The problem was produced because the strokes were selected, but the loop to clear this flag before applying cutter was using unlocked layers only, and the protected layer flag was not reset.

Now, the flag is reset for all layers, locked and unlocked.
2021-03-30 19:43:45 +02:00
Wannes Malfait
6ddd280b21 Nodes: Expose multi input socket in python API
It was not possible to determine if a socket was multi input previously
with BPY. This patch exposes the flag as a read-only property of a node
socket. This is important for addons which automatically add connections
between nodes.

Differential Revision: https://developer.blender.org/D10847
2021-03-30 10:15:23 -05:00
6ea09db7a1 Cleanup: Improve comment 2021-03-30 10:03:11 -05:00
e5f0d176d4 CMake: issue warnings when changing options
Only done in top level CMakeLists, and platform_apple.

Reviewed By: campbellbarton
Differential Revision: https://developer.blender.org/D10343
2021-03-30 20:28:45 +05:30
9f323e9bf7 UI: Bring back hover shortcuts for mesh modifiers
Earlier last year, the shortcuts on hover were built as a way to regain
speed lost by removing the "Apply" and "Copy" buttons from the panel.
For the active modifier concept introduced for geometry nodes, the
shortcuts were changed to only affect the active modifier.

Based on feedback, this change slowed down many people's interaction
with the modifier stack so the UI team decided to return hover shortcuts
for modifier panels.

The downside of this change is that it looks like the active modifier is
"selected" and it could be confusing that the modifier shortcuts don't
apply to it. We can explore different ways to display the active status
to address this.

Ref T87012
2021-03-30 09:56:04 -05:00
1f58a0ea3c Cleanup: use doxy sections and rearrange editmesh_knife.c 2021-03-30 11:50:05 -03:00
b1380101df Geometry Nodes: Set default grid vertices to 3 by 3
This is a relatively arbitrary value, but a good starting point-- it's
simple while also showing the possibility of the subdivisions.

Ref T86819
2021-03-30 09:33:42 -05:00
a4b6c222fa Fix unused variable warning caused by recent cleanup
Caused by a cleanup, rBd037fef3bd1dc.
2021-03-30 09:18:33 -05:00
88b5d7f5f3 Cleanup: remove unneeded method.
size can be accessed via instance attribute.
2021-03-30 16:03:43 +02:00
094c950915 Cleanup: clang-format. 2021-03-30 16:03:43 +02:00
88e0ed3288 Cleanup: Use constexpr. 2021-03-30 16:03:43 +02:00
b48a573adb Compositor: Fix Incorrect Attaching NodeSockets.
Introduced by recent commit.
2021-03-30 16:03:43 +02:00
04a92297dd Cleanup: Replace std::vector with blender::Vector. 2021-03-30 16:03:43 +02:00
d4e76712d4 Cryptomatte: Fix When Image based Cryptomatte Aren't On The First Render Layer.
The image user wasn't updated to reflect the correct render layer.
2021-03-30 16:03:43 +02:00
e125c9329d Fix: Compile Error COM_Debug.
We should replace `ifdef COM_Debug` with a constexpr function.
2021-03-30 16:03:43 +02:00
3ead9b2b36 Cleanup: Replace virtual methods with bitflags. 2021-03-30 16:03:43 +02:00
5a6d5d20de UI: add description methods for wm.context_* operators
Generic context operators now look-up the RNA properties to extract
their description (when it's available).

Add `bl_rna_utils.data_path.property_definition_from_data_path()`
to handle the details of accessing the RNA property definition.
2021-03-31 01:02:08 +11:00
88d94d89fa Fix T87007: Cycles Background not updated if strength is initially null
When the strength is initially set to zero, the shader graph is
optimized out to remove any node which will not be executed because of
this, which removes pretty much every single node, except for the
output. As the graph is empty, the world shader is made invisible to
rays so it is not evaluated in the kernel.

However, when the strength is then modified, the Background is not
updated as the modification happens on the Shader Node and not on the
Background Node, so it is never tagged as modified.

To fix this, we need to tag the Background as modified when its shader
is also modified so the Kernel data is properly updated.

Regression caused by rBbbe6d44928235cd4a5cfbeaf1a1de78ed861bb92.
2021-03-30 15:41:33 +02:00
f1fe42d912 Cycles: Do not allocate tile buffers on all devices when peer memory is active and denoising is not
Separate tile buffers on all devices only need to exist when denoising is active (so any overlap
being rendered simultaneously does not write to the same memory region).
When denoising is not active they can be distributed like all other memory when peer
memory support is available.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D10858
2021-03-30 14:04:56 +02:00
7fd3b07da1 Build Environment: set MAKE_THREADS as per the CPU
It is a better default.

Reviewed By: sebbas, sybren
Differential Revision: https://developer.blender.org/D10652
2021-03-30 16:42:19 +05:30
681a7d724b PyAPI: replace repr with our own escape function in animsys_refactor
Use the same string escaping logic shared by RNA path resolving code.
2021-03-30 21:57:23 +11:00
5da5a1cc2d Geometry Nodes: support multiple group input nodes
Previously this was only supported within nested node groups.
Now it is also supported for the root node group that is referenced
by the modifier.
2021-03-30 12:34:16 +02:00
05fa5ca337 Cleanup: Typo in comment. 2021-03-30 12:15:19 +02:00
Scott Wilson
74d5a93b2b Armature: Add Display Axis Offset
Display the bone axes at the head (root) of the bone by default, instead
of the tail (tip), and add a slider so that it's possible to adjust this
position.

Versioning code is in place to ensure existing files behave the same
(axes shown at tail), whereas new Armatures will be using the new
default (axes shown at head).

Reviewed By: #animation_rigging, #user_interface, Severin, Sybren

Differential Revision: https://developer.blender.org/D7685
2021-03-30 11:40:26 +02:00
0d65d27386 Python: clarify error message when accessing datablock by library
When using `bpy.data.actions[action_name, "nonexistant-library"]`,
use the term `filepath` instead of `name` in the error message.

Also increase the size to match the file path length.

Ref D10253
2021-03-30 19:31:50 +11:00
Henrik Dick
39bead4d51 Fix simple solidify wrong custom data on large ngons
Fixes an unreported issue that vertex data on large ngons (>255)
is messed up due to type conversion to char and back to int.

Ref D10734
2021-03-30 19:13:36 +11:00
fd10c21f51 Cleanup: animation, remove BONE_UNKEYED flag
Remove the `BONE_UNKEYED` flag. It was only written (set/cleared) but
never actually read.

Also remove `framechange_poses_clear_unkeyed()` as its only function was
to clear the `BONE_UNKEYED` flag. It wasn't used anywhere either.

The only code that used the flag was the `extract_pose_from_action()`,
which was removed in 2869ce6cfa (2009).

No functional changes.
2021-03-30 09:46:26 +02:00
563d513e37 Cleanup: clang-tidy warning. 2021-03-30 08:08:43 +02:00
89e46f578f Cleanup: clang-tidy warning. 2021-03-30 08:08:15 +02:00
52d09dad9c Knife: snap refactor, prepare for snap gizmo
Minor changes preparing for snap gizmo inclusion.

- Extract `knife_snap_edge_in_angle` into a utility function.
- Check the snap vertex on closest edge instead of the face.
- Add MODE_INVOKING state.
- Remove unnecessary NULL checks.
- Control 'ignore_edge_snapping' while dragging instead of checking
  dragging in `knife_snap_update_from_mval`.

Ref D8220
2021-03-30 16:19:33 +11:00
73b5afd352 Cleanup: Fix incorrect socket list name 2021-03-29 22:41:34 -05:00
d037fef3bd Cleanup: Use float4x4 type and constructor 2021-03-29 22:15:07 -05:00
f9eaf93d37 MSVC: ASAN support for VS 16.9
This enables ASAN support when used with VS 16.9
enable as usual in cmake with the WITH_COMPILER_ASAN
option, or when using make.bat just tag on `asan'
to the invocation, ie: `make lite 2019 asan`

MSVC: Asan support for 16.9

This enables ASAN support when used with VS 16.9
enable as usual in cmake with the WITH_COMPILER_ASAN
option, or when using make.bat just tag on `asan'
to the invocation, ie: `make lite 2019 asan`

Differential Revision: https://developer.blender.org/D7794
Reviewed By: brecht, sergey
2021-03-29 19:11:17 -06:00
6c33d3d01b Fix T86944: Incorrect seeking in some movies
`av_seek_frame()` failed to seek to nearest I-frame. This seems to be
a bug or not implemented feature in FFmpeg. Looks like same issue as
ticket https://trac.ffmpeg.org/ticket/1607 on ffmpeg tracker.

If seeking is done using format specific function (`read_seek2`)
field of `AVInputFormat` is set, `see av_seek_frame()`, use
`av_seek_frame()` function. Otherwise use wrapper that actively searches
for I-frame packet.

Searching is flexible and tries to do minimum amount of work. Currently
it is limited to equivalent of 25 frames, which may not be enough for
some files, but there may be files with no I-frames at all, so it is
best to keep this limit as low as possible. Previously this problem was
masked by preseek, which was hard-coded to 25 frames. This was removed
in rB88604b79b7d1.

If this approach would be unnecessary for some formats, in worst case
file would be seeked 2 times which is very fast, so there will be no
visible impact on performance.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D10845
2021-03-30 02:58:53 +02:00
ffbe803505 VSE: Add fit method to RNA API
Add fit_method argument to new movie and image RNA API functions.
This argument is optional.

ref T86925

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D10816
2021-03-30 02:58:53 +02:00
6c6f3baaa8 VSE: Fix image adding inconsistency
When adding images with operator, image file path is split into filename
and directory passed to load function in name and path fields of
SeqLoadData struct. This is because when loading images directory
and filenames are split.

RNA API function passes whole path in path filed.

Apart from loading API inconsistency, this causes initial image loading
to fail, so strip resolution is not set. Also name field of SeqLoadData
should be reserved for strip name.

Let operator code concatenate and split filepath when needed so loading
API can be consistent with RNA API and also between strip types.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D10818
2021-03-30 02:58:53 +02:00
7d467915a4 Cleanup: Decrease variable scope 2021-03-29 18:48:34 -05:00
91c44fe885 Cycles: disable NanoVDB for AMD OpenCL
It is causing issue with AMD OpenCL drivers, due to a potential driver bug.

Ref T84461
2021-03-30 00:00:17 +02:00
661e6e0966 Gizmo: Use a utility function to read snap gizmo values
No functional changes.

This makes the `ED_gizmotypes_snap_3d_update` function more specialized.
2021-03-29 14:32:48 -03:00
Germano Cavalcante
d0dd85a820 Snap Gizmo: Minor optimization when updating gizmo properties
As the Snap Gizmo properties are used as return of snapping values and
therefore updated with each change, use callbacks to get these values
through RNA properties.

Differential Revision: https://developer.blender.org/D8525
2021-03-29 14:07:51 -03:00
a702ca3faa Tests/bpy: Add installation verification test
Makes it slightly easier to test whether the installed module works
or not. Depends on D10656

Ref T86579
Reviewed By: mont29, campbellbarton
Differential Revision: https://developer.blender.org/D10665
2021-03-29 22:26:54 +05:30
fbe2c3f422 Tests: disable python tests for blender as python module
Avoid CTest errors and exit codes due to test failures which depend
on Blender executable.

Ref T86579
Reviewed By: mont29, campbellbarton
Differential Revision: https://developer.blender.org/D10656
2021-03-29 22:25:52 +05:30
241f05d53c macOS/bpy: accommodate portable builds, and multi-config generators.
Old code's `install` step did not guarantee that all script files
will be copied from source folder to build folder _before_ copying from
build folder to site-packages. That caused incomplete installation.
Fixed by copying scripts etc., only once. Also match the behavior on
Linux: install to site-packages only if `WITH_INSTALL_PORTABLE` is OFF.

Also fix install and launch issues with Xcode.
2021-03-29 22:25:13 +05:30
77ac67dae4 Cleanup/CMake: remove trailing /; whitespace. 2021-03-29 22:24:33 +05:30
2db2b7de55 Cleanup: Replace is...Operation() methods with a flag. 2021-03-29 17:10:01 +02:00
fe60062a99 Cleanup: Use Bitflags For Booleans. 2021-03-29 17:10:01 +02:00
ca516e78c4 Fix T87013: GPencil SVG export wrong svg xml header settings
The attribute was missing.
2021-03-29 17:02:25 +02:00
f99e703df3 Fix T86975: GPencil interpolate wrong stroke order
When interpolate, the stroke order was not correct because it was assumed the GHash iter would return the items in the same order of insertion, but this is false.

Now, a list is used to keep the order of the strokes and the Hash is used to get the relationship between strokes as before.
2021-03-29 17:02:25 +02:00
81fae56cb9 Fix T86298: crash when loading "corrupted" geometry node tree
The file was not really corrupted (as in, Blender did everything
correctly while saving). I only did not consider the case when
a .blend file is resaved in an older version before.
2021-03-29 16:57:03 +02:00
bc872e0c8e Fix: Line Art panel in properties showing in the wrong order with add-ons
It should set bl_order to show below panels registered by render engine add-ons
like Cycles.
2021-03-29 16:40:31 +02:00
2e7e13442c Fix T76872: Mask created after existing keyframe gets broken handles
The issue was caused by handles not being written to the new mask
spline shape: it was always written as (0, 0), which was making the
handle calculation go wrong later on.

Solved by allocating a temporary array of bezier points and calculating
handles for them. While this is an extra array allocation it is only
done for a small amount of points and it is not in the critical code
path. Having this as an extra array helps to overcome a limitation of
the current mask shape API.

Additionally, disable the interpolation for the shape change:
the spline is brand new, there is nothing to be interpolated there.
2021-03-29 16:19:22 +02:00
51f8dbe081 Mask: Fix possible nan values in the weight interpolation
Noticed while looking into animation data being created as per
steps to reproduce bug in T76872.
2021-03-29 16:19:22 +02:00
10e05bb413 GPencil Cleanup: Remove legacy key to cancel drawing
The 'E' key was set to cancel drawing. This was a change in the
old grease pencil system and is no longer used.
2021-03-29 15:56:25 +02:00
fa8269cc4e Animation: add PBONE_SELECTED macro
Add `PBONE_SELECTED` macro to determine selection state of bones, while
also taking visibility into account.
2021-03-29 15:01:45 +02:00
4d3a2ba6a9 Cleanup: clang-format. 2021-03-29 15:01:09 +02:00
8f38534300 Tracking: Avoid integer overflow in dopesheet update
Straightforward check to discard cases when dopesheet is being updated
for a movie clip which has no markers at all.

Possible bugfix for T86847.
2021-03-29 14:43:58 +02:00
e0ce76f1c5 Fix T86983: bl_description = None crash on RNA class registration 2021-03-29 22:05:05 +11:00
Jeroen Bakker
1ea5157051 Fix: Cryptomatte Metadata Trimmed to 1024.
When reading metadata from image files the metadata is trimmed to 1024.
For cryptomatte the metadata can contain json data and should not be
trimmed. Resulting additional checks in the manifest parser for
incomplete json data.

You could argue to add an exception for cryptomatte, but that would
still allows misuse. When the direction of this patch is accepted we
should consider removing `maxlen` from `IDP_AssignString` as it
doesn't seem to be used anywhere else.

Reviewed By: #images_movies, mont29, sergey

Differential Revision: https://developer.blender.org/D10825
2021-03-29 12:16:39 +02:00
35cf34de6d Fix T86851: PulseAudio randomly asserts in background rendering
Upstream fix from Audaspace with simplified PulseAudio code.

Maniphest Tasks: T86851

Differential Revision: https://developer.blender.org/D10840
2021-03-29 12:16:01 +02:00
Élie Michel
ae9d61e7fe Python API: add template for image processing
Since a few releases it is possible to process Blenders images much
more effficiently than before thanks to the `foreach_get`/`foreach_set`
methods. This new template shows how those methods can be used together
with numpy.

Differential Revision: https://developer.blender.org/D9400
2021-03-29 12:08:41 +02:00
075a19049f Cleanup: Updated Documentation Library Overrides. 2021-03-29 12:04:29 +02:00
ac6d8241fb Fix: Override Test Cases Failing With Asserts. 2021-03-29 11:51:34 +02:00
Sergey Sharybin
19f1c52269 Cleanup: Remove no-op id recalc statement
Initially this is a typo when solving merge conflict back in 2017
in commit rBf4140f2c8138.

The code was so for 3 years, so it is safer to assume that this is
the new expected design. The affected codepath only comes from the
BKE_object_modifier_update_subframe() which is discouraged from use
and have other issues.

Eventually those offending codepaths will be removed completely.

The grade-schema for now is more localized: remove ID_RECALC_ALL
which seems to be misused and is causing issues like the ones which
are described and discussed in T81340.

On user level there should be no measurable changes. In fact, no
functional changes at all are expected to happen.

Reviewed By: sybren

Differential Revision: https://developer.blender.org/D9220
2021-03-29 11:37:30 +02:00
f56fddbf9a Clang Tidy: disable WarningsAsErrors
This makes regular development more pleasant, because one does not have
to fix unrelated clang tidy mistakes when one is in the middle of something.
Before this change, I would usually turn clang-tidy off entirely, but then
forget to turn it on again.

This change has been agreed on by Sergey as well.
2021-03-29 11:04:34 +02:00
3681a619de Fix T78650: Lattice evaluation writes to shared data
Fix the data management bug where evaluation of lattice objects would
write back to the CoW copy of the Lattice ID, even when that copy was
shared between objects.

Each lattice object evaluation now stores its own evaluated data copy
via `BKE_object_eval_assign_data()`.

Reviewed By: sergey

Maniphest Tasks: T78650

Differential Revision: https://developer.blender.org/D10790
2021-03-29 11:00:32 +02:00
8034b276ba Fix T86876: cannot modify float properties of geometry nodes modifier from Python
Previously, the code expected the id property to have the `IDP_FLOAT` type.
However, when assigning a Python float (which is a double internally)
to an id property, it would change the type to `IDP_DOUBLE`.
The fix is to allow both types in the geometry nodes modifier.
2021-03-29 10:54:04 +02:00
fa1569a072 Fix T86966: crash when rendering with geometry nodes
UI hints should only be modified when the depsgraph is active.
Otherwise two threads evaluating the same object in different depsgraphs
can conflict with each other.
2021-03-29 10:14:54 +02:00
4e34baddb9 Overrides: Make Experimental API Fail On Usage.
It used to give a warning so test cases couldn't fail. This has been
changed in the test case so we could use an error here.
2021-03-29 09:57:06 +02:00
87f9405c9a Overrides: API to create an override template.
This is functionality that isn't accessible via the user interface. The
API allows the creation and modification of an override template that
holds rules that needs to be checked when overriding the asset.

The API is setup that it cannot be changed after creation. Later on when
the system is more mature we will allow changing overrides operations.

NOTE: This is an experimental feature and should not be used in productions.

Reviewed By: mont29, sebbas

Differential Revision: https://developer.blender.org/D10792
2021-03-29 09:54:34 +02:00
27fa2507a1 Fix T86972: transform node transforms shape keys 2021-03-29 09:35:19 +02:00
240f15c1b6 Comments: improve docstring for ED_view3d_clipping_test
The meaning of the return value wasn't obvious.
2021-03-29 18:30:45 +11:00
b9734f7716 Cleanup: Remove unused node.c.
Was wrongly added back with the anti aliasing node patch.
2021-03-29 09:25:08 +02:00
80cbbd2843 Knife: support vert/edge snapping when not directly over a face
Respect the distance argument to EDBM_face_find_nearest,
when zero, sample a single pixel, otherwise sample a region.

Knife uses the selection-buffer to pick a face when the ray-cast failed.
This was meant to allow snapping to nearby faces however as the margin
was ignored, it was only used in edge cases where the ray-cast missed
but the pixel didn't.

Now the face-picking threshold is working as expected.

Note that other callers to EDBM_face_find_nearest have been updated
so set their distance argument to zero so this only impacts the knife.
Regular selection and path select could be modified separately if users
prefer this behavior.
2021-03-29 18:08:57 +11:00
3659340571 Cleanup: logical error in path select picking
Resolve logical error in edbm_shortest_path_pick_invoke
where any discrepancy between EDBM_unified_findnearest and
edbm_elem_find_nearest caused the active-object to be cleared.

While it's not a problem at the moment, using a larger threshold
for path picking exposes the error.
2021-03-29 18:08:57 +11:00
8994f09a4a Knife: scale points & snapping threshold by the DPI factor
The points were too small on hi-dpi displays.
2021-03-29 18:08:57 +11:00
fc889615f7 Fix vert/edge knife snapping when the cursor wasn't over a face
In this case, the cage location was left zeroed which was then
projected back onto the screen to find the nearest screen space
edge/vertex.

This made snapping to the vertex/edge fail in some corner-cases
where it was intended to work.
2021-03-29 18:08:57 +11:00
ab26be8ff7 Cleanup: use pragma once. 2021-03-29 08:20:21 +02:00
25c02ea703 Cleanup: Add namespace to compositor. 2021-03-29 08:18:33 +02:00
9975af5ffa Cleanup: Add override Keyword. 2021-03-29 08:04:58 +02:00
Habib Gahbiche
805d947810 Compositor: Add Anti-Aliasing node
This is an implementation of Enhanced Subpixel Morphological Antialiasing (SMAA)

The algorithm was proposed by:
  Jorge Jimenez, Jose I. Echevarria, Tiago Sousa, Diego Gutierrez

This node provides only SMAA 1x mode, so the operation will be done with no spatial
multisampling nor temporal supersampling. See Patch for comparisons.

The existing AA operation seems to be used only for binary images by some other nodes.
Using SMAA for binary images needs no important parameter such as "threshold", so we
perhaps can switch the operation to SMAA, though that changes existing behavior.

Notes:
1. The program code assumes the screen coordinates are DirectX style that the
   vertical direction is upside-down, so "top" and "bottom" actually represent bottom
   and top, respectively.

Thanks for Habib Gahbiche (zazizizou) to polish and finalize this patch.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D2411
2021-03-29 07:56:58 +02:00
6af4163a3f Knife: reduce redundant face picking queries
Reduce the maximum number of queries to find the face under the
mouse cursor from 6x to 2x on cursor motion.

Calculating the screen-space detail could perform 2x look-ups
which have already been calculated.
2021-03-29 14:31:05 +11:00
27a7b2e27a Fix T83391: Knife sometimes snaps to object center
Knife snapping logic assumed having a face under the cursor meant
the projected positions were set.

This is not always the case as failure to ray-cast uses the back-buffer
as a fallback.
2021-03-29 13:29:14 +11:00
e47f5cf197 Cleanup: deduplicate attribute creating code 2021-03-28 12:50:14 +02:00
9289c358fb Cleanup: use parentheses in macro 2021-03-28 12:50:14 +02:00
afcfc6eb08 Fix T86060: Texture Paint clone tool misleading texture UI
For projection painting tools besides the `DRAW` tool:

- Don't show the texture from viewport stencil drawing.
- Don't show the texture panel.

Based on D10564 by @lichtwerk with own changes.
2021-03-28 19:45:56 +11:00
3944560b4a Cleanup: re-order expensive checks for indirect ID use
Check for indirect ID use after other simple user count checks are made.

Also assert ED_object_base_free_and_unlink_no_indirect_check object
argument isn't indirectly used.
2021-03-28 18:48:57 +11:00
0a6bca1f75 Cleanup: revert part of da160dc32d
The grease-pencil parent check was enabled when deleting objects,
when previously it was only done when unlinking.

While harmless, the previous logic is correct.
2021-03-28 18:48:57 +11:00
46d980228b Fix T86992: Tagged ID deletion conflicts with freeing objects
Check LIB_TAG_COPIED_ON_WRITE instead of LIB_TAG_NO_MAIN,
matching the behavior of rigid-body shared data.
2021-03-28 18:16:07 +11:00
5b1980859a Workaround T86992: Tagged ID deletion conflicts with freeing objects
da160dc32d exposed a bug in
`BKE_id_multi_tagged_delete` causing a memory leak in soft-body that
made `physics_softbody` test fail.

Use a loop to remove ID's to keep tests working until T86992 is fixed.
2021-03-28 17:32:37 +11:00
a9e7d503dd Cleanup: Apply clang format 2021-03-27 15:01:41 +01:00
Marcelo Demian Gómez
e7c4c9e538 Fix T86967 : Artifacts when tracing image to Grease Pencil
Tracing images to grease pencil objects creates sometimes artifacts, as seen, for example, when tracing the attached image.  {F9910821}
I have found the same behavior both in the 2.92 release and in the current 2.93 master.
The artifacts are caused by a variable that's not initialized or updated when finding a point tagged as POTRACE_CORNER.
This patch solves this issue.

Maniphest Tasks: T86967

Differential Revision: https://developer.blender.org/D10832
2021-03-27 15:01:36 +01:00
dc873c4a7b Fix T86975: GPencil interpolate sequence error when strokes are not selected
If the selection order is not used, need to put the strokes in inverse order because the Hash Iter returns the strokes in inverse order.
2021-03-27 12:51:18 +01:00
c4ab1891cc Automated testing: selection operators test cases
added 22 more test cases for following operators:
    - edges select sharp
    - loop multi select
    - select all
    - select faces by sides
    - select interior faces
    - select less
    - select linked

{F9853218}

Reviewed By: calra, mont29

Differential Revision: https://developer.blender.org/D10400
2021-03-27 09:48:54 +01:00
Pratik Borhade
99dabc156a Cleanup: spelling and comments
- comment added in struct `KnifeTool_OpData`
- struct pointer name `lst` updated to `list` ( Guess its more readable )
- `KNF_MODEL_IGNORE_SNAP_ON` updated to `KNF_MODAL_IGNORE_SNAP_ON`
- `KNF_MODEL_IGNORE_SNAP_OFF` updated to `KNF_MODAL_IGNORE_SNAP_OFF`

Ref D10824
2021-03-27 16:21:37 +11:00
Siddhartha Jejurkar
9f3d41d4ee Fix T86924: UV Sync selection breaks individual origin calculation
Use uvedit_uv_select_test which accounts for UV Sync selection.

Ref D10830
2021-03-27 15:58:31 +11:00
a6ec2de96a Correct header rename error 10cfa75e1d 2021-03-27 15:48:59 +11:00
Fabrício Luis
8e6e8dd871 UV Editor: Add cursor center operator
This matches cursor center operator from the 3D view.

Reviewed By: campbellbarton

Resolves T70142

Ref D8271
2021-03-27 15:07:26 +11:00
414017ac86 Cleanup: clang-format 2021-03-27 14:49:59 +11:00
ee367084a7 Comment: note that structs are zeroed instead of using defaults 2021-03-27 14:48:26 +11:00
10cfa75e1d Cleanup: use .hh extension for C++ headers
Follow documented convention for file naming.
2021-03-27 14:05:30 +11:00
da160dc32d Object: faster object deletion
The `object_delete_exec` lead to `BKE_library_ID_is_indirectly_used`
being called twice. With this patch deleting is around 20% faster.

Example when deleting 10000 objects:
Current: 35.6s
This patch: 18.8s (updated, last rev 29.7s)

Reviewed By: campbellbarton

Ref D9857
2021-03-27 13:38:44 +11:00
Vincent Blankfield
9b87d3f029 Win32: Allow return from fullscreen to maximized
If window is maximized when toggling fullscreen, go back to maximized when done.

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

Reviewed by Harley Acheson
2021-03-26 14:30:57 -07:00
0ec82477af macOS/bpy: install into site-packages
Reviewed By: #platform_macos, brecht
Maniphest Tasks: T86579
Differential Revision: https://developer.blender.org/D10664
2021-03-27 01:14:45 +05:30
ad31b13f91 macOS/bpy: add support for OpenMP
Changes made:
* Add OpenMP linker flags.
* Copy the libomp.dylib to `2.93/lib/libomp.dylib`.
* Change the `LC_LOAD_DYLIB` item such that
  the lib is found at `bpy.so/../../Resources/2.93/lib/libomp.dylib`.
Installation is done by D10664.

Reviewed By: #platform_macos, brecht
Maniphest Tasks: T86579
Differential Revision: https://developer.blender.org/D10657
2021-03-27 01:08:51 +05:30
35d5cc8982 Cleanup: Use enum for "in" vs. "out" node sockets 2021-03-26 14:25:52 -04:00
Vincent Blankfield
12193035ed Fix T86859: Allow covering of Taskbar when Fullscreen from Maximized
When the window is already maximized allow covering Windows Taskbar when toggling fullscreen.

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

Reviewed by Harley Acheson
2021-03-26 10:19:50 -07:00
8408a8fda2 LibOverride: Fix outliner menu showing 'override editing' entries for linked overrides.
One can only resync, reset, delete etc. locl overrides, linked ones are
basically regular linked IDs and fully not editable.

Reported by Demeter from the Studio, thanks.
2021-03-26 18:15:20 +01:00
80530edcae Geometry Nodes: Rename "Plane" primitive to "Grid"
Although "Grid" may not be techincally correct since a grid could be 3D,
it was decided to rename the "Plane" primtive to "Grid". The primitive
node allows subdivisions, so the name is more consistent with the
operator in the 3D view.

Ref T86819

This commit includes a file subversion bump for the versioning.
2021-03-26 13:09:35 -04:00
Yevgeny Makarov
e684c170f9 UI: Change Usages of 'WPaint' to 'Weight Paint'
Changing to a more informative 'Weight Paint' rather than 'WPaint'.

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

Reviewed by Julian Eisel
2021-03-26 09:58:07 -07:00
Charlie Jolly
70061c69b7 Geometry Nodes: Implicit conversion change for float/int/color to bool
Change `float to boolean` and `int32 to boolean` to return false for zero and negative values.

This aligns with how artists would expect these values to work. This is in contrast to what a coder would expect. It was determined on blender.chat that this was a better default. This means that a negative float value would give a boolean false.

Change `Color4f to boolean` to return false for zero and negative grayscale values.

Likewise, for color to boolean, to account for negative value colors, the grayscale value would be used for determining if a colour was false or not.

See {T86454}

Reviewed By: JacquesLucke

Differential Revision: https://developer.blender.org/D10685
2021-03-26 16:29:48 +00:00
1e855149b2 Nodes: match Multi-input socket activation distance
Activation distance for multi input sockets had different length
dependend of dpi factor. That caused jumping when activation distance
became shorter than snapping distance.

Fixed by removing activation distance and using same function
which is used to evaluate snapping.

Reviewer: Dalai Felinto

Differential Revision: https://developer.blender.org/D10809
2021-03-26 17:29:10 +01:00
f560bc90c7 OSL: add basic OSL shader template
Add a basic OSL shader that shows how inputs
and outputs work and do some simple math with
them.

This template is a happy medium between the
templates we already ship, empty_shader is a
little too bare, and the other templates are
a little "too much" and you end up having to
delete a whole bunch of stuff.

a great starting point for some experimentation!

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

reviewed by: brecht
2021-03-26 10:27:31 -06:00
689d6032ff Compositor: Fix array out of bounds. 2021-03-26 17:23:14 +01:00
William Reynish
dcd90bf188 UI: Remove "Enable physics for:" text in physics properties
The "Enable physics for:" text makes no semantic sense- i.e.
"Enable physics for Fluid". Additionally, the leading text is just not
necessary, this section is just as clear without it.

Differential Revision: https://developer.blender.org/D10537
2021-03-26 12:21:03 -04:00
Leon Leno
97e212f52e Geometry Nodes: Add remaining operations to the Vector Math node
This patch adds support for the remaining operations of the Vector Math
node within Geometry Nodes.  While the operations are already available
in the UI, they hadn't been implemented, yet. With this patch the node
uses the implementation that was added for the Attribute Vector Math
node - similar to how it's handled with the Math node and Attribute
Math node.

Differential Revision: https://developer.blender.org/D10650
2021-03-26 12:15:33 -04:00
Yevgeny Makarov
63a6268e83 UI: Use unified format for "Warning" in descriptions
Warnings in tooltips were using inconsistent formatting, some in
parantheses, some not, some in caps, others not, some on new lines,
some not, etc.

This patch uses a consistent new line and no capitals for these cases.

Differential Revision: https://developer.blender.org/D9904
2021-03-26 12:07:50 -04:00
3d25669486 Cleanup: Geometry Nodes: Allow using "Auto" domain to avoid adapting
Now that we have `ATTR_DOMAIN_AUTO`, it makes sense to use it to skip
automatic domain interpolation. This can make code that depends on the
non-interpolated domain of the attribute a bit simpler.
2021-03-26 11:38:46 -04:00
Habib Gahbiche
252c87b9e8 Compositor automated testing
Added support for compositor tests. Compositor tests can be added, executed and viewed in a similar way to cycles
and other render engines tests.

Running test:
`ctest -R compositor`

Updating test:
`BLENDER_TEST_UPDATE=1 ctest -R compositor`

Viewing test results:
typically saved under `build_folder/tests/compositor/report.html`

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D6334
2021-03-26 16:15:02 +01:00
39ecf90185 LibOverride optimization; Do not compare bound box of objects.
This is runtime only data, no need to deal with it.
2021-03-26 16:13:16 +01:00
921d0851b5 Fix T86942: GPencil does not export SVG or PDF in orthographic camera
The calculation of the 2D point was wrong when using orthographic mode.

Also small cleanup in float3 variable.

Differential Revision: https://developer.blender.org/D10828
2021-03-26 16:07:02 +01:00
2371454b2d Cleanup: Replace Methode Overloading With Default Value. 2021-03-26 16:02:59 +01:00
6524ceb8cf Cleanup: Remove ptr For Owned Children. 2021-03-26 15:51:06 +01:00
930b8a3932 Cleanup: Replace std::vector With blender::Vector. 2021-03-26 15:51:06 +01:00
9d80b3a69c Cleanup: Replaced Typedef Enum With Enum Class. 2021-03-26 15:51:06 +01:00
f725f42af5 Cleanup: Remove SocketReader.
SocketReader was added as an easier to understand interface on top of
the NodeOperation. It was implemented as a base class of the
NodeOperation and adds an additional hierarchy level.

Ths change replaces the abstract class with a typedef. In the end we
want to remove the typedef but will wait for some new nodes before doing
so.
2021-03-26 15:51:06 +01:00
e5fb7eac85 Cleanup: Use Enum Class For PixelSampler. 2021-03-26 15:51:06 +01:00
23b1872d6e Cleanup: Replace std::vector with blender::Vector. 2021-03-26 15:51:06 +01:00
acc6e5c315 LineArt: Fix unreported material user count error when apply modifier
The number of users was 0 after applying the modifier.
2021-03-26 15:48:54 +01:00
4bb70e0ba5 Geometry-Nodes: Sort the Nodes Categories alphabetically
The exception is still Group and Layout to be consistent with the
other node editors. This could use a separator though.
2021-03-26 14:44:15 +01:00
1614795ae2 FFmpeg: improve threading settings
Generalize threading settings in proxy building and use them for encoding
and decoding in general. Check codec capabilities, prefer FF_THREAD_FRAME
threading over FF_THREAD_SLICE and automatic thread count over setting it
explicitly.

ffmpeg-codecs man page suggests that threads option is global and used by
codecs, that supports this option. Form some tests I have done, it seems that

`av_dict_set_int(&codec_opts, "threads", BLI_system_thread_count(), 0)`

has same effect as

```
pCodecCtx->thread_count = BLI_system_thread_count();
pCodecCtx->thread_type = FF_THREAD_FRAME;
```

Looking at `ff_frame_thread_encoder_init()` code, these cases are not
equivalent. It is probably safer to leave threading setup on libavcodec than
setting up each codec threading individually.

From what I have read all over the internet, frame multithreading should be
faster than slice multithreading. Slice multithreading is mainly used for low
latency streaming.

When running Blender with --debug-ffmpeg it complains about
`pCodecCtx->thread_count = BLI_system_thread_count()` that using thread count
above 16 is not recommended. Using too many threads can negatively affect image
quality, but I am not sure if this is the case for decoding as well - see
https://streaminglearningcenter.com/blogs/ffmpeg-command-threads-how-it-affects-quality-and-performance.html
This is fine for proxies but may be undesirable for final renders.

Number of threads is limited by image size, because of size of motion vectors,
so if it is possible let libavcodec determine optimal thread count.

Performance difference:
Proxy building: None
Playback speed: 2x better on 1920x1080 sample h264 file
Scrubbing: Hard to quantify, but it's much more responsive
Rendering speed: None on 1920x1080 sample h264 file, there is improvement with codecs that do support FF_THREAD_FRAME for encoding like MPNG

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D10791
2021-03-26 12:43:46 +01:00
847002e1f8 FFMPEG: refactor seeking
Split seeking section of `ffmpeg_fetchibuf()` function into multiple
smaller functions.

Conditional statements are moved to own funtions with human readable
names, so code flow is more clear.

To remove one branch of seeking, first frame is now decoded by
scanning, which will do only one iteration. So nothing has technically
changed.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D10638
2021-03-26 12:43:46 +01:00
Charlie Jolly
43455f3857 Geometry Nodes: Add Attribute Clamp Node
This adds a Clamp node for Geometry Nodes Attributes.

Supports both Min-Max and Range clamp modes.

Float, Vector, Color and Int data types supported.

Reviewed By: HooglyBoogly, simonthommes

Differential Revision: https://developer.blender.org/D10526
2021-03-26 10:52:50 +00:00
e867f40611 Cleanup: Replaced unneeded branch with assert. 2021-03-26 11:27:28 +01:00
fb6c29f59c Cleanup: redundant expression 2021-03-26 10:50:34 +01:00
ea12df51b8 Fix T86939: Cycles objects bounds not updated when transforming objects
As a rather premature optimization from rBbbe6d4492823, Object bounds
were only computed when either the Object or its Geometry were modified.
Prior to rB42198e9eb03b, this would work, as the Geometry was tagged as
modified if the Object's transform was also modified.

Since this tagging is not done anymore due to side effects, and since at
the time bounds are computed Objects were already processed and tag as
unmodified, the check on the modified status was always false.

For now remove this check, so the bounds are always unconditionally
updated. If this ever becomes a performance problem in large scenes with
motion blur, we will then try to find a way to nicely optimize it.

This would only affect BHV2 as OptiX and Embree handle object bounds
themselves.
2021-03-26 10:50:34 +01:00
d982ea9a9e Fix error when an addon has no __init__.py
When an addon has been removed, but its `.pyc` files are still there,
the Python module can still be loaded. However, because `__init__.py` is
missing, it becomes a namespace instead of a module, and its `__file__`
will be set to `None`. As a result, it's impossible to get the mtime
from the file (because there is none).

This should not influence any regularly uninstalled add-on, as that
would just remove the add-on's directory; I ran into the problem when
switching Git branches caused an add-on's Python files to disappear
while keeping the `__pycache__` directory around.
2021-03-26 10:46:26 +01:00
fda50625cd Cryptomatte: Fix error loading incomplete metadata.
When rendering with cycles at some point the manifest is trimmed. This
leads to incomplete/corrupted metadata. This patch will make sure that
the manifest parser doesn't crash.

This solved the issue when the manifest is trimmed at the start of a
hash. Eg '"Name":"'.
2021-03-26 09:13:46 +01:00
4425bacec4 Cleanup: Fix clang-tidy errors. 2021-03-26 08:38:58 +01:00
64d4e722a0 UV: warn when unwrapping fails
Report an error when unwrapping can't solve some UV islands,
note that edge-seams may need to be set.

Address T86936
2021-03-26 17:59:36 +11:00
8adeab4b0e Cleanup: use code doxy command for Python snippet 2021-03-26 14:58:30 +11:00
ce528d02e1 Cleanup: spelling 2021-03-26 14:55:55 +11:00
Victor-Louis De Gusseme
dda02a448a Geometry Nodes: Add Attribute Map Range Node
This commit adds a node with a "Map Range" operation for attributes
just like the non-attribute version of the node. However, unlike the
regular version of the node, it also supports operations on vectors.

Differential Revision: https://developer.blender.org/D10344
2021-03-25 23:29:33 -04:00
e18091650b Animation: action mirror RNA API using pose contents
This adds a new RNA method `Action.flip_with_pose(ob)` to flip the
action channels that control a pose.
The rest-pose is used to properly flip the bones transformation.

This is useful as a way to flip actions used in pose libraries,
so the same action need not be included for each side.

Reviewed By: sybren

Ref D10781
2021-03-26 13:37:40 +11:00
ff017df318 Animation: add BKE_fcurve_pathcache_find API
Support a cache for fast RNA path look-ups for RNA-path + index.

Unlike a regular hash lookup, this supports using a single lookup
for the RNA path which is then used to fill an array of F-curves.

Reviewed By: sybren

Ref D10781
2021-03-26 13:37:40 +11:00
6fd799c72c Animation: add BKE_fcurves_calc_keyed_frames utility
This function returns an array of keyed frames with rounding,
to avoid duplicates caused by subtle floating point difference.

Reviewed By: sybren

Ref D10781
2021-03-26 13:37:40 +11:00
758c2210ae Cleanup: clang-format 2021-03-26 12:28:49 +11:00
62f5a6bfa7 CMake: add headers to source lists, sort file-lists 2021-03-26 12:24:41 +11:00
Leon Leno
2f77252086 Fix: Geometry Nodes: Incorrect offsets for plane primitive
The recent commit that changed the size (rB83df3545246aada) left out
a few changed. This patch also adjusts the positioning and UV scale of
the generated plane accordingly.

Differential Revision: https://developer.blender.org/D10822
2021-03-25 20:59:29 -04:00
de1eeaa3d2 LibOverride: fix bad ID relationships handling during resync.
Purely local IDs would not always be used as proper barriers when
generating override hierarchy data, leading to imporperly trying to
resync override IDs from other hierarchies, which would break/cause
issues in case they would be duplicate overrides of the same linked
data.

Reported by Pablo from Sprite team, thanks.
2021-03-25 22:32:04 +01:00
2281db72b0 LibOverride: Fix mistake in recent commit.
We do not want to re-generate auto-overrides until everything that
needed to be resynced has been resynced. Otherwise it's a waste of time
and guaranteed loss of some override properties.

Mistake in rB9947f2095610 earlier today.
2021-03-25 22:32:04 +01:00
64ca286540 Cleanup: Pass instance group result vector as an argument
This will allow retrieving the instance groups from multiple geometry
sets and avoiding needing vectors of vectors to store the results.
This is useful when retrieving instances from a multi-input socket
of geometries.
2021-03-25 14:54:27 -04:00
926f7612fd Fix T86867: Node Editor: Avoid deselect-all triggering on every box-
select

In 'Set/Replace' mode this is not a problem, but 'Extend' or 'Subtract'
modes were useless with the current behavior.
The problem here is that 'node.select' fires before 'node.select_box'
(which is fine) but deselects immediately on click.

This issue has come up before in other editors, see
{T70457}
{rB395dfff103e1}
{rBa8ea1ea1b7d5}

Now delay deselection in empty space to mouse release (same as done in
before mentioned report).

also related:
ref T57918
ref T63994

Maniphest Task: T86867

Differential Revision: https://developer.blender.org/D10801
2021-03-25 17:05:35 +01:00
25c4118651 LibOverride: Silence noisy warnings in console.
That one skiped the move to CLOG a few weeks ago, could spam a lot in
the console in some cases.
2021-03-25 16:57:32 +01:00
0f13bded46 Fix T86852: Allow Font Style Changes to Affect Spreadsheet Text Size
Replacing a hard-coded font size with font style widget size so it can be set by user.

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

Reviewed by Dalai Felinto
2021-03-25 08:35:36 -07:00
5ebe74e779 GPencil: Fix compiler warning when HARU and PUGIXML are disabled
The function only must be included if Haru or Pugixml is enabled.
2021-03-25 16:06:31 +01:00
1d7adb6d8a BLI: simplify using DefaultHash 2021-03-25 16:01:41 +01:00
9b42626918 BLI: fix Set.lookup_key_or_add 2021-03-25 16:01:41 +01:00
56df673be2 Fix T86796: moving the cursor in the UV Editor does not take aspect into
account

UV coords are scaled by aspects (see UVsToTransData). This also applies
for the Cursor in the UV Editor which also means that for display and
when the cursor coords are flushed (new 'recalcData_cursor_image' was
added for this), these need to be converted each time.

Maniphest Tasks: T86796

Differential Revision: https://developer.blender.org/D10817
2021-03-25 15:36:53 +01:00
a9cd90135a Make moving the cursor in UV Editor a 2d edit transform
This flags moving the cursor in the Image Editor T_2D_EDIT with the
following benefits:

- dissallowing e.g. Z constraints
- improving the header display:
-- it should not use scene units
-- now respects if we are moving in pixel coords or not

part of upcoming fix for T86796
ref D10817
2021-03-25 15:36:53 +01:00
Erik Abrahamsson
5ffbe439c6 Fix for T86613: Renaming in outliner doesn't trigger rename event
When subscribing to name-changes through the API,
the event doesn't trigger if the object is renamed in the outliner.
Fixed by publishing the RNA changes.

Reviewed By: lichtwerk

Ref D10732
2021-03-26 00:39:35 +11:00
543becac36 Fix T86921: Executing "Operator Cheat Sheet" Crashes Blender
This was only happening without an active object.

The "Operator Cheat Sheet" operator collects info about all operators,
and as part of that executes the callbacks to create dynamic enums. The
callback to enumerate the geometry operators (introduced in
rB370d6e50252b) attribute domains depends on a context object. If this
isn't available, we just have to return `DummyRNA_NULL_items`.

Maniphest Tasks: T86921

Differential Revision: https://developer.blender.org/D10814
2021-03-25 14:03:20 +01:00
0083a7615e Revert "Cleanup: Fix unused-private-field warning."
This reverts commit 43c48965d7.
It created a new warning on GCC: -Wattribute (ignored attribute) as
GCC doesn't warn about unused private fields.
2021-03-25 17:23:46 +05:30
9947f20956 LibOverride; Fix missing re-creation of auto-generated override rules after resync.
While not useful for the override system itself, this is rather
important for user feedback.
2021-03-25 12:45:01 +01:00
51b316dbc2 Fix T83390: Remove temporary, for-one-release deprecation hints
Revert "Point users to new location of "Show Group Colors" option",
commit rB6ed6741ee35930bf81fad9a5eb6bb17eea168725.

These deprecation hints were intended for one release only, and thus can
be removed now.
2021-03-25 12:15:28 +01:00
f7fa0d3974 Geometry Nodes: change order of domains in drop down
This has been requested in D10803.
2021-03-25 12:04:38 +01:00
28cf851a5c Geometry Nodes: rename attribute domains
This patch renames two domains:
* `Polygon` -> `Face`
* `Corner` -> `Face Corner`

For the change from `polygon` to `face` I did a "deep rename" where I updated
all (most?) cases where we refere to the attribute domain in code as well.
The change from `corner` to `face corner` is only a ui change. I did not see
a real need to update all code the code for that. It does not seem to improve
the code, more on the contrary.

Ref T86818.

Differential Revision: https://developer.blender.org/D10803
2021-03-25 12:02:50 +01:00
150e0553da Fix T86853: Critical bug in write code of CacheFile ID.
CacheFile writing code would not write generic ID data (call for it has
been missing since the initial commit, rB61050f75b13e).

While potentially affecting other areas (mostly CustomProperties/IDProperties),
this was a critical failure for liboverrides. Also added some workaround
code to allow opening broken files (though the override of the CacheFile
data-block will be lost).
2021-03-25 11:21:15 +01:00
3b0531154e UI: rename node editor sidebar categories
* `Node` -> `Group`
* `Item` -> `Node`

Differential Revision: https://developer.blender.org/D10804
2021-03-25 09:16:03 +01:00
9ac7946dd0 GPencil: Fix wrong file extension when exporting SVG
Due a code cleanup it was using .PDF all times.
2021-03-24 18:47:33 +01:00
43c48965d7 Cleanup: Fix unused-private-field warning. 2021-03-24 22:45:43 +05:30
e2d362757f Cleanup: Add override keyword. 2021-03-24 17:56:29 +01:00
9ad3d1d36b Cleanup: Remove unecessary enum funcs
The separator can be added directly in the enum items rather than in
a callback.

Differential Revision: https://developer.blender.org/D10806
2021-03-24 12:44:48 -04:00
a363d64b93 UI: Use correct property split ratio for node socket buttons
This makes the buttons drawn on nodes for unconnected string and color
sockets draw with the correct 40% ratio for the label split rather than
the old 50% ratio not used elsewhere in Blender anymore. The benefit is
a cleaner look, because the button edges line up better with others, and
a bit more space to type in attribute names.
2021-03-24 12:36:19 -04:00
d0d0d9d7c6 Fix broken compilation after recent GPencil commit.
rBa8a92cd15a52 was adding external libraries includes to `INC`, which is
reserved to internal project includes.

`INC` does not allow duplicates, and when using system libs both PugiXML
and Haru headers are under the same path.
2021-03-24 17:01:19 +01:00
a6664383c6 Fix (unreported) Outliner: missing override tree items for collections in Viewlayer view.
Probably lost at some point in recent refactor moving the whole tree
building towards a more modular, C++ code.
2021-03-24 16:38:03 +01:00
bf0454b78b Fix build error and warnings in new grease pencil IO code 2021-03-24 11:33:39 -04:00
80450331c7 Fix T86884: Don't remove the "line art object add" enum item
We would not add the "object line art" enum to the operator enum list,
if there were no active object in the scene.

This would make it impossible to call this operator from python code as
the enum would we hidden when we were not in a viewport context.

Always make the operator available, having no active object is not a
strict requirement for the operator to work, so expose it always.
2021-03-24 16:23:32 +01:00
8060293656 Fix T86875: "Show on Cage" crash for geometry nodes primitives
Without `calc_object_remap` turned off in the conversion to and from
BMesh for the primitive nodes, the `CD_ORIGINDEX` custom data layer
has incorrect values. By using a different function to do the conversions,
we can avoid this problem.

Thanks to Jacques for finding the fix here.

Differential Revision: https://developer.blender.org/D10805
2021-03-24 11:05:55 -04:00
a478d502dd GPencil: Fix unreported crash when apply Lattice modifier
This error was produced because now it is possible to have several Lattice modifiers and the Bake was removing the lattice data of all modifiers.

Now the data is only recalculated and removed for the current modifier.

Also some cleanup of comments.
2021-03-24 16:01:44 +01:00
a8a92cd15a GPencil: New modules for Import and Export
This patch adds support to export and import grease pencil in several formats.

Inlude:

* Export SVG
* Export PDF (always from camera view)

* Import SVG

The import and export only support solid colors and not gradients or textures.

Requires libharu and pugixml.

For importing SVG, the NanoSVG lib is used, but this does not require installation (just a .h file embedded in the project  folder)

Example of PDF export: https://youtu.be/BMm0KeMJsI4

Reviewed By: #grease_pencil, HooglyBoogly

Maniphest Tasks: T83190, T79875, T83191, T83192

Differential Revision: https://developer.blender.org/D10482
2021-03-24 15:28:58 +01:00
ce359da5b3 Fix T86894: Geometry nodes drag and drop creates a duplicate node
Added a condition to the poll so that it ignores drag and drop on the button. The Paste Name operator is just not implemented. Doesn't work for shading nodes either.

Reviewed By: HooglyBoogly

Differential Revision: https://developer.blender.org/D10769
2021-03-24 14:24:56 +00:00
Charlie Jolly
337a122e44 Fix T86722: Missing updates after geometry nodes drag and drop
Add missing call to ED_node_tag_update_nodetree which solves the missing update on initial drag.

Reviewed By: HooglyBoogly

Differential Revision: https://developer.blender.org/D10769
2021-03-24 14:24:55 +00:00
8bbd6ba8b7 Tweak default ID types processing order, step 17: Group and comments.
Regroup ID type indices by categories, and add some comments about
reasoning of current order.
2021-03-24 15:11:54 +01:00
c1f5a56e32 Tweak default ID types processing order, step 16: Palettes.
Move Palettes type with other weird, not-really-data ID types (like
PaintCurves and Brushes), higher in the process.

Those preset-like types may use a lot of other ID types, but should only
be used by UI-related (and Scene, for tool settings) types.
2021-03-24 15:11:54 +01:00
fd75a4cbd8 Tweak default ID types processing order, step 15: ShapeKeys.
Move shape keys type just after all obdata types, since they are some
sort of sub-geometry data.
2021-03-24 15:11:54 +01:00
7db4ef98fe Tweak default ID types processing order, step 14: Fonts.
Move Font type toward the end of the list, this is a file-wrapper type
with typically no dependency to any other ID.
2021-03-24 15:11:54 +01:00
55683fafc5 Tweak default ID types processing order, step 13: Texts.
Move Texts type toward the end of the list, this is a file-wrapper type
with typically no dependency to any other ID.
2021-03-24 15:11:54 +01:00
fe55ede5ce Tweak default ID types processing order, step 12: Sounds.
Move Sound type toward the end of the list, this is a file-wrapper type
with typically no dependency to any other ID.
2021-03-24 15:11:54 +01:00
f3fe3d965f Tweak default ID types processing order, step 11: Worlds.
Move World type with the other shading types.
2021-03-24 15:11:54 +01:00
ae84a1363d Tweak default ID types processing order, step 10: LineStyles.
Move LineStyles (Freestyle) type with the rest of the shading types.
2021-03-24 15:11:54 +01:00
0e6088f467 Tweak default ID types processing order, step 09: Particles.
Move Particles next to the other physics/simulation types, after obdata
types.
2021-03-24 15:11:54 +01:00
be073d8baf Tweak default ID types processing order, step 08: CacheFiles.
Move them with the rest of the simulation types.
2021-03-24 15:11:54 +01:00
a35d145b72 Tweak default ID types processing order, step 07: MovieClips.
Move them with the other shading/image types, just before Images.
2021-03-24 15:11:54 +01:00
72fa0d48ea Tweak default ID types processing order, step 06: Brushes.
Move Brushes type with other weird, not-really-data ID types (like
Palette and Brushes), higher in the process.

Those preset-like types may use a lot of other ID types, but should only
be used by UI-related (and Scene, for tool settings) types.
2021-03-24 15:11:54 +01:00
c0f5f9ad6e Tweak default ID types processing order, step 05: PaintCurve.
Move PaintCurve type with other weird, not-really-data ID types (like
Palette and Brushes), higher in the process.

Those preset-like types may use a lot of other ID types, but should only
be used by UI-related (and Scene, for tool settings) types.
2021-03-24 15:11:54 +01:00
e96c286e53 Tweak default ID types processing order, step 04: Screen.
Move Screen data type higher in the list, just after the other
UI-related types, and before Scenes.
2021-03-24 15:11:54 +01:00
950f0b8b97 Tweak default ID types processing order, step 03: Mask.
Move it with the rest of the image/shading related types.
2021-03-24 15:11:54 +01:00
39bf5e5022 Tweak default ID types processing order, step 02: Simulations.
This is a fairly low-level ID type, so it needs to be higher in the
list, for now put it just before the shading-related types.
2021-03-24 15:11:54 +01:00
4d18fa268c Tweak default ID types processing order, step 01: Collections.
Move `OB_GR` processing just after scenes, and before objects.

This is much more sensible in general, and fixes glitches in auto-resync
process of library overrides in particular.
2021-03-24 15:11:54 +01:00
93bedcb96a Fix T86895: bpy.ops.curve.select_all(action='INVERT')
The operator should not assume v3d is valid.
2021-03-24 15:00:17 +01:00
c06042afc6 Spelling: getRenderPriotrity -> getRenderPriority 2021-03-24 14:30:22 +01:00
b2246d25a2 Cleanup: Removed commented out code. 2021-03-24 14:30:22 +01:00
31f8d894b9 Cleanup: replace index based forloops with iterators. 2021-03-24 14:30:22 +01:00
0d5cef9898 Cleanup: removed unnecessary allocations. 2021-03-24 14:30:22 +01:00
392efc7d76 Cleanup: Use const in region queries 2021-03-24 14:28:25 +01:00
d37deb19be Cleanup: Move button context based operator poll into utility function
Using the button context for operators is useful for other cases as well (where
the operator isn't the button operator itself). For example we'll need this for
the asset view UI template, where there will be additional operators that
should be able to act on button context.
2021-03-24 14:28:25 +01:00
781f41f633 Alembic procedural: deduplicate cached data accross frames
Currently the procedural will add an entry to the cache for every frame
even if the data only changes seldomly. This means that in some cases we
will have duplicate data accross frames.

The cached data is now stored separately from the time information, and
an index is used to retrieve it based on time. This decoupling allows
for multiple frames to point to the same data.

To check if two arrays are the same, we compute their keys using the
Alembic library's routines (which is based on murmur3), and tell the
cache to reuse the last data if the keys match.

This can drastically reduce memory usage at the cost of more processing
time, although processing time is only increased if the topology may
change.
2021-03-24 14:18:51 +01:00
9b8262021b Geometry Nodes: add versioning for attribute fill
The attribute domain of old nodes should be set to `ATTR_DOMAIN_AUTO`.
2021-03-24 13:27:47 +01:00
Dirk
c0a4c8c3fa Fix T86891: only sort query results for shortest string if there is a query
Differential Revision: https://developer.blender.org/D10802
2021-03-24 12:53:58 +01:00
26b45448ab Fix: Memory Leak When Using Compositor.
When using the compositor inlined static vectors could allocate
memory. This memory wasn't freed. This patch would make them inline
again.
2021-03-24 11:57:04 +01:00
715c746296 Cleanup: clang-tidy errors. 2021-03-24 11:00:31 +01:00
665d8c0e34 Cleanup: unused variable 2021-03-24 10:41:29 +01:00
42198e9eb0 Fix T86601: Cycles accumulates displacement when transforming an Object
In order to update the BVH when only the transformations are changing,
we would tag the Object's Geometry as modified. However, when
displacement is used, and the vertices were not themselves modified,
this would cause us to redo the displacement on already displaced
vertices.

To fix this, use a specific update flag for detecting and notifying that
transformations were modified.

Regression caused by rBbbe6d44928235cd4a5cfbeaf1a1de78ed861bb92.
2021-03-24 10:41:29 +01:00
6b18678e34 Fix T86314: materials not updated correctly after collada import
Make sure we have valid links and link pointers using
'ntreeUpdateTree()'.

Maniphest Tasks: T86314

Differential Revision: https://developer.blender.org/D10793
2021-03-24 10:29:34 +01:00
865025c343 Cleanup: remove stdio.h header from MEM_guardedalloc.h
This was included for `FILE *` which isn't used in the header.

Ref D10799
2021-03-24 19:34:44 +11:00
3f47df577d Cleanup: use new BLI_assert_unreachable macro 2021-03-24 12:38:08 +11:00
3ea1779365 Fix T86753: Connected Proportional editing with individual origins using different orientation than set
The problem happened when the selection only allowed "single_islands"
(only vertices are selected, no edges or faces).

The result of `is_zero_v3(v->no)` was erroneously being compared to `0.0f`

This commit corrects the wrong condition and optimizes it by adding a
earlier return when the islands don't need to be calculated.

(It also improves the code's readability by joining some variables in the
`struct TransIslandData`).
2021-03-23 15:34:31 -03:00
3a68dcb1e6 Cleanup: allow looking up size of unsupported domains
There isn't really a reason for not supporting it.
2021-03-23 16:56:38 +01:00
9a2e623372 Cleanup: use BLI_assert_unreachable in some places 2021-03-23 16:49:47 +01:00
433fb9326e BLI: add macro to indicate unreachable code
This adds a `BLI_assert_unreachable()` macro, that should be used instead
of `BLI_assert(false)` in many places.

* `BLI_assert_unreachable` provides more information than `BLI_assert(false)`
  to people reading the code.
* `BLI_assert_unreachable` will print an error to `stderr` in a release build.
  This makes it more likely that we will get bug reports when the assumptions
  of a developer were wrong.

Differential Revision: https://developer.blender.org/D10780
2021-03-23 16:45:44 +01:00
7046e37ede Cleanup: WorkScheduler.
- Use constexpr for better readability.
- Split in functions per backend.
- Split work scheduler global struct in smaller structs.
- Replaced std::vector with blender::Vector.
- Removed threading defines in COM_defines.h
2021-03-23 16:14:11 +01:00
83df354524 Geometry Nodes: Make plane primitive size consistent
This means the "Size" input is treated as a "diameter" instead of
a "radius", just like the 3D view primitives.
2021-03-23 11:05:18 -04:00
29c0b34b20 Fix (unreported) object duplicate code wrongly duplicating linked objects.
Linked data should only be duplicated if relevant `eDupli_ID_Flags` flag
is set (`USER_DUP_LINKED_ID`), this is being taken care of by generic
`BKE_id_copy_for_duplicate` function, but for some reasons (?)
`BKE_object_duplicate` was directly using `BKE_id_copy` for itself...

Note that this had especially bad consequences when duplicating
overrides of collections...
2021-03-23 16:03:12 +01:00
9f19d01e3c Geometry Nodes: Move mesh primitives to their own category
It makes more sense to avoid mixing the primitives with other mesh
operations. We considered adding a "Mesh" prefix to the names too,
but decided to prioritize improvements to the node search menu instead,
and only consider that if there is an overlapping prefix name for
another data type.
2021-03-23 11:02:38 -04:00
96e60cc22c Fix T86567: Cycles crashes when playing back animated volumes
The crash is caused by an out of bound access in the kernel due to
missing data update when a Volume's voxel data changes. Although the
previous bounding mesh is cleared, the Volume Node was not tagged as
modified, and therefore never rebuilt.

To fix this, tag the Geometries (not just Volumes, to be more robust) as
modified in Geometry.clear().

Regression caused by rBbbe6d44928235cd4a5cfbeaf1a1de78ed861bb92.
2021-03-23 15:59:29 +01:00
9e206039d4 Fix T86073 : Ctrl clicking 3 times without selecting any of the verts in NurbsPath leads crash.
Crash occurs at `assert(builder->index_len < builder->max_index_len)`.

Non-bezier nurbs were being created with abnormal values causing the
causing edge count in the draw manager to be incorrect.

This commit also deduplicates and adds descriptions to the code.

Thanks @PratikPB2123 for pointing out where the error is.
2021-03-23 11:33:53 -03:00
6d97fdc37e Outliner: Do not crash when drawing unknown view type.
Instead default to Viewlayer view.
2021-03-23 14:59:30 +01:00
0fabd045a5 LibOverride: Also consider RNA Collection in 'need resync' detection.
RNA collections can store lists of ID pointers, so they require a similar handling for RNA pointers.
2021-03-23 14:59:19 +01:00
19da44f869 Cleanup: remove internal functions from interface. 2021-03-23 12:05:37 +01:00
Manuel Castilla
9fb5559a0f Compositor: Display generated inputs in Viewers and Previews
Currently viewers and previews only display node trees that have at least one node with fixed resolution size. When all inputs are generated, nothing is displayed in most cases (RGB Node is displayed as a single pixel on previews). By generated I mean inputs not having resolution on their own, they create content dynamically given an output resolution.

This patch adds support for those cases by using an appropriate preferred resolution on Viewers/Previews which propagates to generated inputs as output resolution. Now:
- Viewers will display generated inputs with scene render resolution.
- Previews will display them with scene aspect ratio.
This is consistent with final render result and respects relative space.

The benefit for the user is being able to compose images without any input source. For example for creating mask images or simple backgrounds.

Reviewed By: Jeroen Bakker

Differential Revision: https://developer.blender.org/D10611
2021-03-23 12:04:51 +01:00
8cac85abfe Cleanup: Silence compile warning. 2021-03-23 11:59:42 +01:00
36cb66384d Cleanup: remove unused include. 2021-03-23 11:59:07 +01:00
eed45b655c RNA: support automatically mapping string property to char pointer
The goal of this patch is to remove the boilerplate code required to get
a string property that maps to an allocated char pointer in dna.
Previously, one to to provide three callbacks, all of which are not necessary
anymore for a simple string property.

Currently, when an empty string is assigned, the `set` function will always
allocate it as well, instead of assigning `NULL` to the pointer. Some structs
might support `NULL` while others don't, so this is the safer option for now.

Differential Revision: https://developer.blender.org/D10773
2021-03-23 11:47:09 +01:00
4e0fd7fff1 VSE: Sanitize move_to_meta usage
There were multiple cases that could lead to problems like moving meta
strip into itself or into it's children meta strips.

Print error string to console when invalid action is requested.
2021-03-23 11:23:20 +01:00
Charlie Jolly
d375889298 Nodes: Add Refract and Faceforward functions to Vector Maths nodes
Cycles, Eevee, OSL, Geo, Attribute

Based on outdated refract patch D6619 by @cubic_sloth

`refract` and `faceforward` are standard functions in GLSL, OSL and Godot shader languages.
Adding these functions provides Blender shader artists access to these standard functions.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D10622
2021-03-23 09:59:20 +00:00
4c19fcacc0 Cryptomatte: Node Size.
Made it just a bit smaller (same size as renderlayers node).
2021-03-23 10:50:39 +01:00
028ca67a8d Spreadsheet: show comma separators in number of rows 2021-03-23 10:41:04 +01:00
1dea9701e6 Cryptomatte: Default Node Size.
Set the min/max and default node size of the cryptomatte node.
2021-03-23 10:39:47 +01:00
9c7492e2e0 Geometry Nodes: show domain in attribute fill node
Differential Revision: https://developer.blender.org/D10789
2021-03-23 10:28:52 +01:00
Omar Emara
ec97450ac6 Curves: add taper mode option
Currently, when a taper object is specified, the radius of the spline is
ignored. This patch adds a new option to control how the taper object
affect the effective radius of the spline. The option allow three modes
of operation:

- Override: The old method. The radius of the spline is ignored and
  overridden.
- Multiply: The radius of the spline is multiplied by the taper radius.
- Add: The radius of the spline is added to the taper radius.

Ref D10779
2021-03-23 18:34:46 +11:00
f2f796e623 FIX: Incorrect link drawing after link cutting tool
Sorting of links on multi-input sockets where not recalculated after
 using the knife operator. Added call to resort function before
 cutting operator finishes.

Reviewer: Jacques Lucke

Differential Revision: https://developer.blender.org/D10783
2021-03-23 08:14:29 +01:00
2600b27d26 Cleanup/CMake: Fix comment, sort order of options. 2021-03-23 12:11:46 +05:30
08151b52a2 Fix error in clip.setup_tracking_scene with cycles
Regression in e9182a0f5d
2021-03-23 16:49:38 +11:00
70d2456ff1 Cleanup: unused variables, imports 2021-03-23 16:21:51 +11:00
bb78f38bd1 Cleanup: single quotes for Python enums, spelling 2021-03-23 16:08:53 +11:00
3117de3a73 Cleanup: import operator class directly for Python operators 2021-03-23 16:08:02 +11:00
32301a0700 Fix sequencer text leaving bold & italic flags enabled
Regression in 913b71bb8b
2021-03-23 16:06:02 +11:00
ee07bfa3a0 Fix crash transforming sequences
Regression in 3d9ee83d88
2021-03-23 15:11:38 +11:00
e5b973100d Update RNA to Manual Map 2021-03-22 23:23:47 -04:00
38b7563a4f Cleanup: de-duplicate gpencil logic to ensure materials
- Rename:
  `BKE_gpencil_object_material_get_index_name`, to
  `BKE_gpencil_object_material_index_get_by_name`
  Matching `BKE_gpencil_layer_get_by_name`.
- Move logic to ensure named materials into a new function:
  `BKE_gpencil_object_material_ensure_by_name`
2021-03-23 13:58:09 +11:00
a7239c2bad Fix incorrect flag usage in line art modifier 2021-03-23 13:29:20 +11:00
db5d9ddb1a Cleanup: use e prefix for enum, comment on misleading flag values
Also replace "Feature" with "LineArt" in enum names.
2021-03-23 13:27:17 +11:00
80c86e274d Cleanup: move line art panel into properties_objects
No need for a module to define a single panel, since this is an
object panel it can be included with other object panels.

If centralizing line-art properties is needed in the future,
this can be done in a `*_common` module.
2021-03-23 12:41:45 +11:00
b787581c9c WM: don't set the area when toggling full-screen
The stated reason for this no longer applies.
2021-03-23 11:57:41 +11:00
4820f16b7f RNA: correction to a05cbc9914
The clipping plane bias is an implementation detail,
don't use this in the RNA name.
2021-03-23 11:31:40 +11:00
62987a6f98 Cleanup: lattices, use bool is_editmode instead of int editmode
Replace `int editmode` with `const bool is_editmode`.

No functional changes.
2021-03-22 18:02:02 +01:00
7d4dcfe879 Fix T86822: context.collection not available in Object/Object Data Properties
We need to return the global context collection if it is not found in
the data path.

Also fix pinning of the collection tab.
2021-03-22 17:37:44 +01:00
Jishan Singh
2c427d594f Fix T83638: mirror modifier with mirror object renders wrong motion blur
In this case both the mirror object and object itself moving in time may
change the geometry and must be checked.

Differential Revision: https://developer.blender.org/D10757
2021-03-22 17:22:45 +01:00
21268ad20a Functions: devirtualize virtual arrays in simple functions
In some multi-functions (such as a simple add function), the virtual method
call overhead to access array elements adds significant overhead. For these
simple functions it makes sense to generate optimized versions for different
types of virtual arrays. This is done by giving the compiler all the information
it needs to devirtualize virtual arrays.

In my benchmark this speeds up processing a lot of data with small function 2-3x.

This devirtualization should not be done for larger functions, because it increases
compile time and binary size, while providing a negilible performance benefit.
2021-03-22 17:06:27 +01:00
6cec782970 Cleanup: Collection check return type in button_context 2021-03-22 16:59:08 +01:00
23d2174d6b Geometry Nodes: Remove location and rotation from mesh primitives
Following some discussion among the geometry nodes team, it was decided
that keeping the primitive nodes simpler and requiring a separate
transform node to move the generated geometry from the origin would
be better.
 - It's more consistent with the current general idea of "building
   block nodes"
 - It makes more sense for the future when it will be possible to
   use instancing to control the transforms.
 - It reduces UI clutter when the controls are not necessary.
2021-03-22 11:58:46 -04:00
2d1120c171 BLI: Add "identity" constructor to float4x4 type 2021-03-22 11:52:44 -04:00
9baf39c8da Fix T86666: Lasso and Circle select tools selecting objects behind clip_min
Although it works well in most cases, the algorithm to detect if a point
is within the limits of the camera does not work well in othographic mode.

This commit also adds the option `V3D_PROJ_TEST_CLIP_FAR` (currently unused).

Differential Revision: https://developer.blender.org/D10771
2021-03-22 12:46:29 -03:00
fb1265c5cf Tracking: Fix movie file prefetch freezing interface
The issue was caused by the prefetch code having LOCK_MOVIECLIP lock
acquired while reading frames from the movie files. The need of the
lock was coming from the fact that `clip->anim` can not be accessed
from multiple threads, so that was guarded by a lock. The side effect
of this lock was that the main thread (from which drawing is happening)
did not have any chance passing through it in the cache code because
the prefetch happens so quickly.

The solution is to create a local copy of the clip with its own
anim handler, so that read can happen without such lock.

The prefetch is slower by an absolute number in seconds (within 10%
in tests here), but it is interactive now.
2021-03-22 16:27:35 +01:00
Johannes Jakob
4b9c9a7bea Fix missing document icons on macOS 10.4 and earlier
Re-adds a legacy document icon for macOS 10.14 Mojave that is
consistent with the system generated document icon on macOS 11
Big Sur. It uses the old-style document sheet icon, but includes the
file extension underneath the Blender icon (unlike the previous
legacy document icon that was removed in D10267).

Adds the missing description for the exported type identifier.
Finder now correctly displays “Blender File” instead of “data”
for Blender files.

Differential Revision: https://developer.blender.org/D10746
2021-03-22 16:05:10 +01:00
3e44221b57 Fix build error on macOS/clang 2021-03-22 16:05:10 +01:00
a31b162c6e GPencil: Hide Interpolate Only Selected in Draw Mode
This option is only valid in Edit mode. Also changed the space between options to improve UI.

Reviewed by: @mendio
2021-03-22 15:58:59 +01:00
2889d8dca9 GPencil: Move Automerge button position in topbar
This helps to keep animation buttons grouped.
2021-03-22 15:47:59 +01:00
d955ce1170 Fix T86591: Tracking backwards is slower
The root of the issue was caused by the PredictMarkerPosition()
always returning false when tracking backwards. This was making
it so tracker always had to run brute initialization, which is
an expensive operation.

From own timing here:

- Tracking forward takes 0.667637 seconds
- Tracking backward used to take 2.591856 seconds
- Tracking backward now takes 0.827724 seconds

This is a very nice speedup, although the tracking backwards is
still somewhat slower. Will be investigated further as part of
a regular development.
2021-03-22 15:20:13 +01:00
e3f2c94d39 Fix T86741: Remapping could create doublons of collections in hierarchy.
Code rebuilding/ensuring the sanity of the collection hierarchy was not
checking for a same collection being child of the same parent multiple
times.

This was already prevented to happen in code adding collections to other
collections, but not for the remapping case.
2021-03-22 15:10:27 +01:00
56dabfac5c Fix (unreported) memleak in collection/viewlayer code.
In collection/viewlayer synchronization code, in some cases, there are
extra unused view layer collections left in old list after all needed
ones have been moved to the new list.

Found while working on T86741.
2021-03-22 15:10:27 +01:00
7b7b554f94 Fix: wrong use of assert in recent commit. 2021-03-22 14:11:58 +01:00
1a7f9b5005 UI: Remove text for add and remove buttons in cryptomatte node
The text is unecessary and it's always cut off anyway.
2021-03-22 08:58:20 -04:00
c4c195672d Cleanup: remove unexposed nodes
Those nodes are leftovers from my work on particle nodes and are not needed currently.
They can be added back easily if they become necessary.
2021-03-22 12:23:25 +01:00
77887f95cc Geometry Nodes: make random float node more consistent with other nodes
Previously, different Random Float nodes would generate different values
depending on where they are in the node group hierarchy. This can be useful,
but should definitely not be the default behavior, because it is very inconsistent
with other nodes.
2021-03-22 12:09:06 +01:00
01b6c4b32b Functions: make multi functions smaller and cheaper to construct in many cases
Previously, the signature of a `MultiFunction` was always embedded into the function.
There are two issues with that. First, `MFSignature` is relatively large, because it contains
multiple strings and vectors. Secondly, constructing it can add overhead that should not
be necessary, because often the same signature can be reused.

The solution is to only keep a pointer to a signature in `MultiFunction` that is set during
construction. Child classes are responsible for making sure that the signature lives
long enough. In most cases, the signature is either embedded into the child class or
it is allocated statically (and is only created once).
2021-03-22 12:01:07 +01:00
ccb372d17c Fix regression in bd79691599
The sequencer header needs to be drawn, even if the returned
variables aren't used.
2021-03-22 21:59:55 +11:00
Jeroen Bakker
36fdbed2f0 LibraryOverrides: Initial Test Case.
Added a first test case for review. This will be the base for future test cases.

The current API is sufficient for what is expected for such a low level API.
One concern is that you need to trigger a save in order to update the library overrides
structure. Not expected from TD/Dev point of view.

Test cases are very important when implementing restrictive mode as it is a second evaluation mode that
has impact on the (current) permissive mode.

Reviewed By: Sebastián Barschkis, Bastien Montagne

Differential Revision: https://developer.blender.org/D10747
2021-03-22 11:51:44 +01:00
7a05ebf84b Fix T86405: Always translate when in en_US locale too.
The impact of translations on UI performances is neglectable, and this
gives better handling of some odd cases where original language of an
add-on is not English.
2021-03-22 11:50:15 +01:00
2e213003b8 Cleanup: add comment
See rBb9cd2f4531ca670c196b0b14b1359d0f375103c2 for more info.
2021-03-22 11:35:19 +01:00
Nikhil Shringarpurey
414596cd83 Cleanup, LineArt: Fix MSVC compiler warnings.
Currently 3 of the printf lines use the format specifier "%lu" for data
of type size_t instead of "%zu". While this works, this creates compiler
warnings.

This diff fixes those warnings by using the correct format specifier.
Tested using MSVC, but should be correct on any compliant compiler.

Reviewed By: Sebastian Parborg

Differential Revision: http://developer.blender.org/D10761
2021-03-22 11:30:36 +01:00
a506f87c90 Clang Tidy: disable modernize-raw-string-literal again
This check does not work when gtests are enabled yet.
See rBb9cd2f4531ca670c196b0b14b1359d0f375103c2 for more details.
2021-03-22 11:26:48 +01:00
82d3b0f927 Fix UI (and code!) typos. 2021-03-22 10:56:25 +01:00
14caab7257 Cleanup: check the space type instead of the operators poll function
The poll function may fail for reasons other than the space type,
as this menu is selected based on space-type, check this instead.
2021-03-22 20:12:08 +11:00
a05cbc9914 RNA: rename recently added line-art properties
- Use `use_` prefix for boolean properties.
- Use `_all` instead of `_everything`,
  following existing conventions and the properties UI text.
- Use `object_instances` instead of old term `dupli` / `duplication`.
- Use `clip_plane` instead of `clipping_boundaries`,
  matching the RegionView3D property naming.
2021-03-22 18:09:19 +11:00
958e3a8cc1 RNA: use boolean array for transarency masks
There is no need to expose this as multiple properties,
also use `use_` prefix for boolean properties.
2021-03-22 18:04:12 +11:00
cb521bd37b Cleanup: spelling, expand on comments 2021-03-22 14:48:36 +11:00
f051146ae6 Cleanup: clang-format 2021-03-22 14:39:39 +11:00
dfbaf96753 Revert "Disable clang-format for objective-C bits in GHOST."
This reverts commit 1cb9612d73.

We can now rely on the clang-format version as it's distributed
with pre-compiled binaries.
2021-03-22 14:38:45 +11:00
e6cf74515f Cleanup: disable clang-format for 'intern/libmv/third_party' headers 2021-03-22 14:35:20 +11:00
544b3ab1de Cleanup: clang-format, trailing space
Minor manual tweak to prevent wrapping an array into columns.
2021-03-22 14:25:42 +11:00
2a06657eca Cleanup: Don't use class method to override equality operator
This won't make a difference in this case, but it's consider better
practice since there is no vagueness about implicit conversion.
2021-03-21 20:21:05 -04:00
54bbaa26de Cleanup: compile errors on macos 2021-03-21 19:49:29 +01:00
4fe8d0419c Functions: refactor virtual array data structures
When a function is executed for many elements (e.g. per point) it is often the case
that some parameters are different for every element and other parameters are
the same (there are some more less common cases). To simplify writing such
functions one can use a "virtual array". This is a data structure that has a value
for every index, but might not be stored as an actual array internally. Instead, it
might be just a single value or is computed on the fly. There are various tradeoffs
involved when using this data structure which are mentioned in `BLI_virtual_array.hh`.
It is called "virtual", because it uses inheritance and virtual methods.

Furthermore, there is a new virtual vector array data structure, which is an array
of vectors. Both these types have corresponding generic variants, which can be used
when the data type is not known at compile time. This is typically the case when
building a somewhat generic execution system. The function system used these virtual
data structures before, but now they are more versatile.

I've done this refactor in preparation for the attribute processor and other features of
geometry nodes. I moved the typed virtual arrays to blenlib, so that they can be used
independent of the function system.

One open question for me is whether all the generic data structures (and `CPPType`)
should be moved to blenlib as well. They are well isolated and don't really contain
any business logic. That can be done later if necessary.
2021-03-21 19:33:13 +01:00
68c31c41e5 UI: Title case for Proxy Setup and fix typo 2021-03-21 18:40:38 +01:00
2ddbb2c64f Functions: move CPPType creation related code to separate header
This does not need to be included everywhere, because it is only
needed in very few translation units that actually define CPPType's.
2021-03-21 15:33:30 +01:00
9e437aabdb Cleanup: fix compiling with older compiler on macos
We cannot use `std::variant` yet, because not all of the compilers
we support have a working version of it yet. For now, I just replaced
it with multiple `std::option` which is good enough, because currently
`CellValue` is only used for the cells that are actually drawn in
the spreadsheet.
2021-03-21 14:29:26 +01:00
dcf1a1045d Cleanup: move some headers from MOD_lineart.h to source files 2021-03-21 14:51:37 +11:00
b8cc8b30ec Cleanup: redundant headers in 'source/blender/gpencil_modifiers' 2021-03-21 14:30:08 +11:00
9c0eb1700e Cleanup: correct variable name mixup in BLI_str_quoted_substrN
Also expand doc-string for `BLI_str_escape_find_quote`
2021-03-21 14:22:14 +11:00
dfefafa814 Fix uninitialized memory use loading movie sequence strips
When the movie wasn't found, uninitialized values would be used for
the original width/height.

Also use int instead of float as the image size is stored as an int.
2021-03-21 14:12:58 +11:00
fce3e6646e Fix failure to set transform rotate around single
Regression in 201ab7c540
2021-03-21 14:01:41 +11:00
87b6283918 Cleanup: remove redundant NULL checks 2021-03-21 14:00:40 +11:00
bf13a4d3ff Cleanup: unused return statements 2021-03-21 14:00:40 +11:00
6d97f9a5c1 Cleanup: use static local variables 2021-03-21 14:00:40 +11:00
4abafa2062 Cleanup: remove window manager headers from MOD_lineart
This was only used to return success, which is currently never checked.
2021-03-21 13:47:05 +11:00
dcd9945ebe Cleanup: replace 'unsigned char' with 'uchar' 2021-03-21 13:25:31 +11:00
31e7bc6869 Cleanup: remove redundant casts 2021-03-21 13:24:42 +11:00
6db1fb197c Cleanup: spelling, doxygen comment formatting 2021-03-21 13:18:20 +11:00
b4e96550ce Fix T86643: Win32 Entering Full Screen While Maximized
SetWindowPos must be called after SetWindowLongPtr in order to see changes to window frame style.

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

Reviewed by Ray Molenkamp
2021-03-20 17:24:06 -07:00
9ca67c47a1 Fix T86660 EEVEE: Undefined behaviour in specular_occlusion
Define visibility error to be 1 by default to avoid undefined behaviour.
2021-03-20 22:00:08 +01:00
057292e75a Bevel code: add a null pointer check. 2021-03-20 13:03:43 -04:00
90959c2372 Cleanup: quiet warning 2021-03-20 15:54:52 +01:00
98721c8543 BLI: improve support for generic algorithms with c++ containers
Some generic algorithms from the standard library like `std::any_of`
did not work with all container and iterator types. To improve the
situation, this patch adds various type members to containers
and iterators.

Custom iterators for Set, Map and IndexRange now have an iterator
category, which soe algorithms require. IndexRange could become
a random access iterator, but adding all the missing methods can
be done when it is necessary.
2021-03-20 15:42:35 +01:00
59d3ec1eef Cleanup: quiet warning 2021-03-20 15:38:17 +01:00
56da5ae2ac LineArt: Fix blank baking for when source type is object. 2021-03-20 14:07:51 +01:00
b19bd3692d Fix T86746: Description missing from Quick Liquid
The description was missing from the Quick Liquid operator.

The fix adds the following description:
"Make selected objects liquid"

Reviewed By: sebbas

Maniphest Tasks: T86746

Differential Revision: https://developer.blender.org/D10777
2021-03-20 13:44:36 +01:00
95a2549d90 Fix T86745: trace sequence keyframe offset
The offset when creating the keyframes was set to `frame_target + i` but
`i` starts iterating from the current frame number.

The fix uses just `i` as the frame number.

Reviewed By: antoniov

Maniphest Tasks: T86745

Differential Revision: https://developer.blender.org/D10772
2021-03-20 13:43:00 +01:00
d0f05bfbcd LineArt: Fixed source selection for nested-instanced collection. 2021-03-20 12:36:35 +01:00
3d5239ff40 Fix T86730: LineArt: keep contour when there's perpendicular faces. 2021-03-20 12:36:27 +01:00
d5a705873e Join curves: compensate for different bevel depths
When joining curves, the resulting curve will inherit the bevel depth of
the active curve, but the radii would stay the same which leads to
changed appearance when joining.

Now compensate for this taking the different bevel depths into account
(if present).

Was a feature request here (and I also think we had reports about this
-- which were usually turned down as not-a-bug):
https://blender.community/c/rightclickselect/bhhbbc/

Differential Revision: https://developer.blender.org/D10752
2021-03-20 08:14:49 +01:00
f65a3172a8 Fix issues introduced strip loading refactoring
- Adding effect strip resulted in strip with no name
 - Adding sound strip attempted to read `fit_method` RNA property,
   that did not exist, causing error messages in console

These issues were introduced in bbb1936411.
2021-03-20 01:53:03 +01:00
3433d1b7f4 Fix T86355: Added effect strip has wrong length
SEQ_add_effect_strip used SeqLoadData.image.end_frame to set end
frame. This was mistake introduced in last refactoring patch.

Use effect data, not image data, when adding effect strips.

Reviewed By: sergey

Differential Revision: D10633
2021-03-20 01:40:53 +01:00
c81dfa2426 Fix T85824: Transition between adjustment regression
When transition effect is placed between 2 adjustment layer strips,
only first adjustment layer was rendered by effect.

Limit timeline_frame range to adjustment strip frame range.

This timeline configuration is technically invalid, because strips
should overlap when using transition effect. This was never restricted
and instead of producing no image, transition effect used first and
last frame of source strip. Many users got used to this "feature" so
I think it make sense to fix this case so it behaves like other strip
types.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D10562
2021-03-20 01:40:53 +01:00
Peter Fog
8b3f5f755e VSE UI: Cleanup scene panel style
- Make properties alligned
 - Add decorate to volume
 - Add heading to Grease Pencil and Transparent

Reviewed By: ISS

Differential Revision: https://developer.blender.org/D10663
2021-03-20 01:40:53 +01:00
Peter Fog
3d9ee83d88 VSE: Preview images when moving strip handles
Add option to override current frame whem transforming strip handles.
Option can be found in View menu of VSE preview, or in timeline when
using backdrop.

Reviewed By: ISS

Differential Revision: https://developer.blender.org/D10424
2021-03-20 01:40:53 +01:00
Peter Fog
1c095203c2 VSE: Text strip improvements
- Position text in center of image
 - Increase default font size so it's more visible
 - Increase font size limit
 - Increase limit for location, so text can be scolled off screen
 - Wrap text by default
 - Tweak default box and shadow color
 - Change text shadow position
 - Text box no longer casts shadow

Reviewed By: ISS

Differential Revision: https://developer.blender.org/D10571
2021-03-20 01:40:53 +01:00
Peter Fog
913b71bb8b VSE: Add bold and italic option for text strip
Bold and italic fonts can be switched quickly by presing corresponding
button.

Reviewed By: ISS

Differential Revision: https://developer.blender.org/D10542
2021-03-20 01:40:53 +01:00
Eitan
7bf977e9f0 Fix T54395: Original image size set incorrectly
`SequenceElement` type `orig_height` and `orig_width` members were
set to incorrect size when using proxies and not set when strip was
added which caused value to be unset.

Since now image dimensions must be read when strip is created,
these members can be initialized. When proxies are used, do not set
original size since it is not guaranteed, that proxies are exact size.

These values are not guaranteed to be up to date or exact. They should
be used for strictly informative purposes.

Reviewed By: ISS

Differential Revision: https://developer.blender.org/D6506
2021-03-20 01:40:53 +01:00
Félix
bfad8deb0b VSE: Add new_meta RNA API function
This function can be used to create empty meta strip, which is not
straightforward when using operators. Very useful for import/export
scripts.

Reviewed By: ISS

Differential Revision: https://developer.blender.org/D10661
2021-03-20 01:40:53 +01:00
Félix
4158405c0b VSE: Add move_to_meta RNA API function
This function can be used to move strips into meta strips with no
side effects like change of selection state.

Reviewed By: ISS

Differential Revision: https://developer.blender.org/D10759
2021-03-20 01:40:53 +01:00
01f028a677 Theme: Use curved noodles in the nodes editor.
Curved noodles increase readability especially in nodes with multiple input sockets.
2021-03-20 01:12:49 +01:00
3494946560 Nodes: implement dot graph exporter for derived node tree
This visualization of nested node groups makes it easier to debug
some issues. Muted nodes, muted links, reroute nodes and unavailable
sockets are removed from the visualization to keep it clean.

Nested node groups are visualized using colored clusters.
2021-03-19 22:37:48 +01:00
087f8a78f8 Nodes: expose tree name and whether a node is a frame in node tree ref 2021-03-19 22:33:43 +01:00
2dd055b2d4 Geometry Nodes: fix crash when inserting certain invalid links
For example, it would crash when connecting a float to a geometry socket,
under some circumstances.
2021-03-19 22:26:55 +01:00
250a69ee82 Fix T86728: Blender freezes when playhead is dragged in this .blend
Porting the deadlock bugfix in WASAPI from upstream Audaspace.
2021-03-19 21:42:55 +01:00
00215692d1 Nodes: make distinction between directly and logically linked sockets more clear
This also moves the handling of muted nodes from derived node tree to
node tree ref.
2021-03-19 21:13:10 +01:00
48731f45c2 Nodes: provide access to type specific data through node tree ref 2021-03-19 21:13:10 +01:00
b96acd0663 EEVEE: Volumetrics: Add back support for light clamp
The new clamping works by modifying the lamp internal radius which
then soften the light contribution.

However this does remove more light compare to the old solution.
This is because the clamp now affects the light over a much larger
distance since it is smoother. Old scene needs manual tweaking.
2021-03-19 21:11:06 +01:00
89ef0da551 EEVEE: Volumetrics: Add support for soft volumetric shadows
Soft surface shadows were already supported but now we support
soft shadows of the volume themselves.

This is only enabled if the light casts shadow and the scene soft
shadows toggle is enabled.
2021-03-19 21:11:06 +01:00
355f884b2f EEVEE: Volumetrics: Add Area light shape support
Previously area lights were just considered as point lights.
We now use a "most representative point" technique that make the
light shape appearant and gives more homogenous result.

This technique is quite cheap but it is not physically correct.

So I came up with a power function to have almost the same intensity
output as cycles in the general case.
2021-03-19 21:11:06 +01:00
0a0f737f91 EEVEE: Volumetrics: Add special attenuation volume for lights
This makes volume lights more efficient if they have lower power.
2021-03-19 21:11:06 +01:00
54f52cac7c EEVEE: Volumetrics: Fix sun volumetric shadow
Sun lights are treated as distant light source and need to gather
shadowing from the full frustum.

This might have performance impact on certain scenes.
2021-03-19 21:11:06 +01:00
884f934a85 EEVEE: Lights: Add Volume and diffuse light power slider
This adds 2 new sliders for light objects that modulates the diffuse
light and the volume light intensities.

This also changes the way volume light is computed using point lamp
representation. We use "Point Light Attenuation Without Singularity"
from Cem Yuksel instead of the usual inverse square law.
2021-03-19 21:11:06 +01:00
fb3e5b7f98 LineArt: Add missing modifer and sanity checks to bake operator
Previously we could crash because we would not check if the modifier in
question actually was a line art modifier. We also did not query if the
modifier was disabled.
2021-03-19 21:02:21 +01:00
17a5db7303 Geometry Nodes: Add geometry instances data to the spreadsheet
This patch adds data about instances generated by geometry nodes
to the spreadsheet. The transform data is decomposed into position,
rotation, and scale, and there is a name column to display the name
of the instanced object or collection.

This data is implemented specifically for the spreadsheet, because
we're not sure that we want to expose this data as attributes for the
use elsewhere.

Differential Revision: https://developer.blender.org/D10770
2021-03-19 15:30:41 -04:00
9de8c2fa18 BLI: Add accessors for translation, rotation, and scale of float4x4 2021-03-19 15:28:58 -04:00
dd7feb09c9 Cleanup: rename x1/x2/y1/y2 to x/y/width/height 2021-03-19 20:24:56 +01:00
9b806c49d0 Geometry Nodes: Refactor / fix point separate node
The point separate node was failing in situations where one of the
outputs was empty. In addition, the code was not structured very well.
This new implementation stores less temporary information, is more
geometry component type agnostic, and is more self-descriptive.
It also solves the problems mentioned above.

Fixes T86573

Differential Revision: https://developer.blender.org/D10764
2021-03-19 15:09:17 -04:00
a6ab232f8a LineArt: Added back the missing "allow_clipping_boundaries" option.
This option was missing from the UI.
Also add missing camera settings depsgraph relation.
2021-03-19 18:56:26 +01:00
cff4445a86 LineArt: Modifier defaults settings optimization.
Make options that are usually only useful in edge cases off by default.
These settings would requite extra work and thus the modifier evaluation
would be needlessly slower as most users do not need these options to be
on.
2021-03-19 18:31:03 +01:00
3420c3d8c6 LineArt: Remove geometry space chaining
It caused some chaining errors when used in combination with image space
chaining. After some internal discussion, we realized it is not
useful as chaining in image space essentially does the same thing.
2021-03-19 18:26:33 +01:00
a00249dd22 LibOverride: Stash away 'leftover' objects/collections from auto-resync process.
Instead of storing those in scne's master collection, which is fairly
annoying, we now add them to a (hidden) specific collection. Easy to
ignore, or check and cleanup.
2021-03-19 17:33:08 +01:00
a9e64d8613 Cleanup: Use uint8_t for num of channels. 2021-03-19 17:11:47 +01:00
b9d2e2ec97 Cleanup: Use enum class for MemoryBufferExtend. 2021-03-19 17:11:47 +01:00
9f86933f2e Cleanup: Remove unused states and vars from MemoryBuffer. 2021-03-19 17:11:47 +01:00
31d5c5078c Cleanup: MemoryBuffer do not store width and height. 2021-03-19 17:11:47 +01:00
8cb1089795 Cleanup: Rename copyContentFrom to fill_from. 2021-03-19 17:11:47 +01:00
dc9aea9903 Cleanup: Add copy constructor to MemoryBuffer. 2021-03-19 17:11:47 +01:00
260e50ed82 Cleanup: Use ref to read from encapsuled data.
MemoryBuffer->getRect was returning a ptr.
2021-03-19 17:11:47 +01:00
c905dd24b6 Cleanup: Replace ptr with ref (COM_MemoryBuffer). 2021-03-19 17:11:47 +01:00
b9447ab053 Cleanup: Replace ptr with ref. 2021-03-19 17:11:47 +01:00
e5ffefe606 Cleanup: Use enum class for DataType. 2021-03-19 17:11:47 +01:00
b5f70d92c2 Cleanup: enum class ChunkOrdering. 2021-03-19 17:11:47 +01:00
9c2d4ffbc1 Cleanup: Use enum class for CompositorQuality. 2021-03-19 17:11:47 +01:00
de504e6dec Cleanup: Use enum class for CompositorPriority. 2021-03-19 17:11:47 +01:00
50c5435438 Cleanup: compositor - chunk order
No functional changes.
2021-03-19 17:11:47 +01:00
18b87e2e0b Cleanup: Remove unneeded complexity
`determineDependingMemoryProxies` was mapping a value in a temp vector.
2021-03-19 17:11:47 +01:00
eb7a601e1b Geometry Nodes: Make cone primitive 2m tall by default
This gives the cone mesh primitive more pleasing proportions by default.
2021-03-19 11:22:39 -04:00
dbe45073d2 Geometry Nodes: Move cone primtive to rest on its base by default
This is generally what people expect when generating a cone. Note that
this translation currently happens after the rotation, but since the rotation
will likely be removed in the future, that won't be a problem for long.
2021-03-19 11:21:24 -04:00
97b83b6a67 Geometry Nodes: Implicit interpolations to and from the edge domain
This patch adds the remaining 6 interpolations for mesh domains.
The new interpolations are:
 - Corner / point / polygon to edge
 - Edge to corner / point / polygon

After this it is possible to adapt an attribute to and from every
mesh domain. This is simple to test with the "Attribute Convert" node.

Though, as a note for the future, there are still some improvements
possible to the interpolations, like lazily calculating values for the
interpolations where it's possible, and slightly improving the
algorithms used for some interpolations, like using corner angles
for polygon to point.

Differential Revision: https://developer.blender.org/D10765
2021-03-19 08:59:56 -04:00
a7f4270748 Fix Cycles NaN assert in random walk SSS due to very small throughput
Now terminate if there are many bounces and the throughput gets so small
that we get precision issues.
2021-03-19 13:20:42 +01:00
d235f6a48e LibOverride: fix code trying to auto-resync linked overrides.
This is not only potentially extremely expensive, it is also fairly
futile, and code is not designed to handle it currently anyway (could
easily end up in inifinite loops and other crashes).
2021-03-19 12:24:53 +01:00
Angus Stanton
ae650b016f Fix T86208: copy node group button is inconsistent in geometry nodes
Differential Revision: https://developer.blender.org/D10740
2021-03-19 11:24:27 +01:00
de296e8429 Cleanup: add const. 2021-03-19 08:18:00 +01:00
ef944b5020 Cleanup: Replace std::vector with blender::Vector. 2021-03-19 08:11:11 +01:00
64a413b0c7 Fix T86710: Crash When Adding Node Group.
When adding a node group there can be no inputs in the input map that
was triggering an assert.
2021-03-19 08:04:30 +01:00
a7455ae5f8 Cleanup: remove unused function 2021-03-19 16:23:52 +11:00
74609bfd51 Cleanup: minor changes to pose-mode apply visual transform
- Remove use of evaluated poses, instead calculate transformations
  into an array which is applied afterwards.

- Only update ID's for poses that have been changed.
2021-03-19 15:33:43 +11:00
36deb8a48e BLI: Add location, rotation, scale constructor to float4x4
This is simply a convenience when using this type. More similar
constructors can be added in the future when they are useful.

Differential Revision: https://developer.blender.org/D10714
2021-03-18 17:29:39 -04:00
Patrick Busch
fc62d38ce1 Python API: Expose CurveProfile Reset View function
Allow python access to the `reset_view` functionality which before
was only available through the menu. This was suggested for
consistency after D10561.

Differential Revision: https://developer.blender.org/D10595
2021-03-18 17:25:36 -04:00
Pratik Borhade
7e3efac9a8 Fix T86701: Geometry nodes Cube and UV Sphere mesh size
The size in the transform matrices was extra, since it is also
passed as an argument to the BMesh operators.

Differential Revision: https://developer.blender.org/D10763
2021-03-18 17:00:47 -04:00
894e8b18e4 Geometry Nodes: Don't create empty components when realizing instances
Previously even if the input goemetry set had no point cloud or no mesh
instances, `geometry_set_realize_instances` would create empty data.
This isn't necessarily bad, but it can complicate things down the line if
there are a bunch of empty components getting passed around.
2021-03-18 16:32:49 -04:00
b1150fa1f5 Fix T86448 EEVEE: SSRefraction Depth regression
Caused by recent change for contact shadow raytracing. rB4e236326c137
2021-03-18 18:07:46 +01:00
51c7ff9222 GPencil: Rename Options panel to Settings
This change is to keep consistency with other panels with the same functionality.

Reviewed by @pablovazquez
2021-03-18 17:24:20 +01:00
1e1d96f0a8 Fix T86677: select grouped in node editor crashes without active node
This was reported for geometry nodes, but was true for all nodetrees
(e.g. after deleting the active node). Geometry node trees just made
this more obvious since they start without an active node to begin with.

Fix provided by @lone_noel, thx!

Maniphest Tasks: T86677

Differential Revision: https://developer.blender.org/D10762
2021-03-18 17:15:42 +01:00
cddfd11581 Fix T86548: Sculpt: Mask by Color tool not working
Caused by {rB2917f550caa9} which renamed the entry in the toolsystem,
but not the corresponding keymap.

Maniphest Tasks: T86548

Differential Revision: https://developer.blender.org/D10725
2021-03-18 17:10:50 +01:00
1919b104d3 LibOverride: Fix missing update after an override reset.
We need to brute-force reset IDs with `ID_RECALC_ALL` here...
2021-03-18 15:59:18 +01:00
59f92a218a LibOverride: Outliner: Rename Add... to Make....
Also more consistent with the name used for the 3DView operator.
2021-03-18 15:59:18 +01:00
07f9a73a8f Fix 3DView not updating on some NC_ID notifiers.
Outliner uses a lot `NC_ID | NA_EDITED` e.g., which was not caught by
the View3D editor for update.
2021-03-18 15:59:18 +01:00
06351c0504 LibOverride: Outliner: Tweak override creation from instancing empty.
Now behavior is similar to the one from 3DView: once override of the
collection is successfuly created, we remove the instancing empty from
the scene.
2021-03-18 15:59:18 +01:00
7ee365d8c7 Fix missing view3d updates after recent NC_SPACE notifier filters
Since {rB46aa70cb486d}, using `NC_SPACE | ND_SPACE_VIEW3D` as notifier is
restricted to space data as a reference. This was still used though for
RNA updates in other places (namely `rna_camera`, `rna_scene`,
`rna_animviz`), and passing NULL would automatically set the notifier
reference to the owner id. Above commit would happily filter these out,
leading to missing refreshes.

Now use more specific notifiers (in case of animviz a new
`ND_DRAW_ANIMVIZ` was added).

This was reported for Camera background images btw.
Fixes T86670.

Maniphest Tasks: T86670

Differential Revision: https://developer.blender.org/D10758
2021-03-18 15:23:23 +01:00
2dd040a349 UI: Dynamically increase data-block name button size if there's space
Data-block selectors (or other selectors using the
`UILayout.teamplate_search` or `UILayout.template_search_preview`)
in headers used a fixed size width for the name button. Often that meant
the text would be clipped to fit even though there was plenty of
whitespace surrounding the data-block selector.

Now the name button can increase in width with the contained string,
clamped to some arbitrary and quite big maximum (3 times the minimum
width).
We could further take the available space into account, to reduce the
need for scrolling in the header. But I don't think that is much of an
issue and the name clipping it would re-introduce would probably be more
annoying.
2021-03-18 15:09:31 +01:00
248d9809ca Fix T86594: Overrides: Possible collection "duplication".
Issue was actually in some Collection management code, a bit too eager
to add collection to the scene master one when it was not actually
needed.
2021-03-18 14:26:29 +01:00
f75d690ee4 LineArt: Add missing dna variable rename
Forgot to add this in: "Cleanup, LineArt: Rename LineartLine -> LineartEdge"
df28063795
2021-03-18 14:21:18 +01:00
6f7e632a6f Cleanup, LineArt: Sample -> Resample
Clear up what sample length does by renaming the option and variables.
2021-03-18 13:20:44 +01:00
3f0cd3fcc1 Cleanup: Remove unused variable in gpencil_add_lineart.c 2021-03-18 13:16:00 +01:00
1b05948e4d LineArt: Expose the allow_duplication property for instanced objects.
It was missing from the UI.
2021-03-18 13:13:08 +01:00
d39a1e3cab Fix T86692: Start Line Art GP objects on frame 0
If playback starts before the first GP frame, we will get "ghost"
strokes.
2021-03-18 12:50:55 +01:00
c114c78f57 LineArt: Do not calculate lines for objects not included
Only use non included objects for potential occlusion queries.
Don't calculate lines for them.

This fixes intersection lines appearing on objects not included by the
lineart modifier.
2021-03-18 12:42:41 +01:00
df28063795 Cleanup, LineArt: Rename LineartLine -> LineartEdge
Also cleanup various other "line" variable names
2021-03-18 12:41:44 +01:00
d7fb38ddd4 GPencil: Fix unreported datablock type changed using Dopesheet box select
When doing a box selection in the dopesheet in the header area, the data block type was changed to annotation because the pointer was not usable and produced an unexpected result.

Thanks to @pullup for finding a way to reproduce the bug.
2021-03-18 12:37:00 +01:00
8ab52daa3a BLO: Functions for temporarily loading a single datablock
This introduces two functions to the blenloader module, here shown as
calls for brevity:

* `temp_lib_ctx = BLO_library_temp_load_id(real_main, blend_file_path, idcode, idname, reports);`
* Now the data in `temp_lib_ctx->temp_id` can be used (but ought not to
  be not assigned to non-temp datablocks).
* `BLO_library_temp_free(temp_lib_ctx);`

The first loads a datablock from a blend file, and returns it as part of
a `struct TempLibraryContext`. This struct contains the temp-loaded ID,
as well as enough information to correctly free everything again.

Differential Revision: https://developer.blender.org/D10736
2021-03-18 11:09:15 +01:00
aeff59073b Fix T86219: Compositor backdrop not using Color Management View
Transforms in certain cases

This was caused by wrong flag checking in {rB278011e44d43}, which just
seems to be a copy-paste error.

For example, enabeling 'Auto-Offset' in the View menu would lead to CM
being ignored.

Maniphest Tasks: T86219

Differential Revision: https://developer.blender.org/D10751
2021-03-18 09:16:58 +01:00
decfd5c169 Cleanup: use doxy sections for pose_transform.c 2021-03-18 13:55:32 +11:00
30b5fd1a3c Cleanup: remove MJPEG reference from error message
Proxy coded has been changed to h264. Error code is more generic now.
2021-03-18 00:14:41 +01:00
bb6765f28f Cleanup: spelling 2021-03-18 09:36:44 +11:00
0c58ad8a34 Cleanup: remove unused common_restrict_check function
Since c10ad8e9ea hiding edit-mode objects
is supported.

Although this function had already been removed in
aeb8e81f27.
2021-03-18 09:06:56 +11:00
de6d6e171e Cleanup: Remove commented code
Mistake in earlier commit rBbe33d3eccdcdf252. Also use const and
set layouts disabled when the line art is baked.
2021-03-17 14:54:30 -04:00
a41d3c0ebe Geometry Nodes: Rename "Subdivide Smooth" back to "Subdivision Surface"
Following concerns raised in the commit that changed the name initially,
rB2e19509e60b39837, it makes more sense to keep the "Surface" name for
this node because it has a specific meaning that should not be confused
with other types of subdivision.
2021-03-17 14:40:38 -04:00
1cc427ce2b Geometry Nodes: Use consistent default for cylinder node
- Use 2m height instead of 1m
 - Default to N-Gon fill for the top and bottom
2021-03-17 14:17:52 -04:00
be33d3eccd UI: Tweak labels, descriptions, and panel layout for line art
Changes include:
 - Use `IFACE_` for UI labels set in the modifier panels
 - Use a sub-sub-panel for transparency
 - Fix grammar and spelling mistakes
 - Use more natural user-friendly wording
 - Make descriptions more specific and more useful
 - Don't capitalize "line art" in descriptions (tooltips)

These changes are aimed at making the UI strings more consistent with
the rest of the UI and being more helpful to someone trying to understand
how to use the modifier.

Differential Revision: https://developer.blender.org/D10750
2021-03-17 13:46:41 -04:00
0ff3f96a1b Nodes: make derived link data more obvious in NodeTreeRef
`NodeTreeRef` is a thin wrapper on top of `bNodeTree`. By default it
should not hide anything from the underlying `bNodeTree` (before this
it was hiding muted links).

For convenience some "derived" data is cached on sockets. For example
all the connected sockets when reroutes and muted links are ignored.

A nice side benefit of this refactor is that `NodeTreeRef` requires
less memory than before.
2021-03-17 16:43:54 +01:00
e9eb08fea1 BLI: support equality operator on Span and Vector
This is quite convenient sometimes and is available for `std::vector` as well.
2021-03-17 16:38:49 +01:00
bf620020f1 BLI: improve implicit conversions of spans
Some conversions that should work did not work before.
For example, `MutableSpan<int *> -> MutableSpan<const int *>`.
2021-03-17 15:27:31 +01:00
256da1c4b9 LineArt: Fix transparenct mask in cutting function. 2021-03-17 15:24:26 +01:00
0bae3002cf LineArt: Fix transparency flag error during cutting and chaining. 2021-03-17 15:23:48 +01:00
7f769567d0 LineArt: Remove "Render" in structure names. 2021-03-17 15:23:20 +01:00
0f1482279c LineArt: better explaination in lineart_line_cut() 2021-03-17 15:21:12 +01:00
4de7dc42c9 UI: Correct icon and description for "Object Line Art"
The icon should be the same as other object icons rather than "Cube",
and the description was just the collection description copy and pasted.
2021-03-17 08:51:59 -04:00
9cf25b9c44 Cleanup: Reduce variable scope 2021-03-17 13:01:30 +01:00
296984b40e Modify Dopesheet block between keyframes
This makes more visible where ends each keyframe. To use, as we did before, full block sometimes looks hard to view where a keyframe ends.

Reviewed By: pepeland, mendio, Severin

Differential Revision: https://developer.blender.org/D10588
2021-03-17 12:57:44 +01:00
Charlie Jolly
266cd7bb82 Nodes: Add support to mute node wires
This patch adds the ability to mute individual wires in the node editor.
This is invoked like the cut links operator but with a new shortcut.

Mute = Ctrl + Alt
Cut = Ctrl

Dragging over wires will toggle the mute state for that wire.
The muted wires are drawn in red with a bar across the center.
Red is used in the nodes context to indicate invalid links, muted links and internal links.

When a wire is muted it exposes the original node buttons which are normally hidden when a wire is connected.

Downstream and upstream links connected using reroute nodes are also muted.

Outside scope of patch:
- Add support for pynodes e.g. Animation Nodes
- Requires minor change to check for muted links using the `is_muted` link property or the `is_linked` socket property.

Maniphest Tasks: T52659

Differential Revision: https://developer.blender.org/D2807
2021-03-17 11:54:16 +00:00
20bf736ff8 Fix T86645: Executing "Operator Cheat Sheet" Crashes Blender
The "Operator Cheat Sheet" operator collects info about all operators, and as
part of that executes the callbacks to create dynamic enums. The callback to
enumerate the Outliner ID operations depends on Outliner context. If this isn't
available, it can just return a context-less version of the enum, that is, a
static enum with all available items. This was already done in case no context
is available at all.
2021-03-17 12:51:27 +01:00
Wannes Malfait
2a4bde04c5 Fix T86655: remove doubled transforms
Differential Revision: https://developer.blender.org/D10744
2021-03-17 12:23:17 +01:00
1185708911 Cleanup: clang format 2021-03-17 12:18:35 +01:00
3157c3680b Cleanup: remove unnecessary namespace specifiers 2021-03-17 11:52:02 +01:00
633f1cdec9 Cleanup: improve gathering supported domains by geometry type 2021-03-17 11:52:02 +01:00
e6bdd57191 Fix T86609: GPencil: Sculpt brush cursor disappears on undo.
Regression from rB2a8122fb65c5, somehow that piece of code was lost
during the refactor.
2021-03-17 11:38:31 +01:00
ac60e64745 BLI: provide a default hash for enums
This avoids some boilerplate code that was necessary when using enums
as keys in maps or sets.
2021-03-17 11:37:46 +01:00
e00a47ffd6 Geometry Nodes: store domain and data type in attribute hints
The information is not exposed in the attribute search yet.
2021-03-17 11:15:39 +01:00
e91dd645a9 Fix concern: lookup could fail.
Concern raised on {93e2491ee724}.
2021-03-17 09:18:39 +01:00
187f358f33 Cleanup: Use blender::MultiValueMap.
Fixed concern raise on {93e2491ee724}.
2021-03-17 09:14:38 +01:00
97defd9cd7 Cryptomatte: Show Name of Object/Material Under The Cursor.
This change shows the object or material name with the cursor when picking for a cryptomatte node.

Reviewed By: Julian Eisel

Differential Revision: https://developer.blender.org/D10705
2021-03-17 08:59:04 +01:00
f4639276ee Fix outliner multi-object edit-armature operations
Recursive restrict selection (hide/selectable flag) & renaming
edit-bones both used the active object, even when bones for another
non-active object were being operated on.

Bone renaming would rename a bone in the active object
(if that name exists).
2021-03-17 17:19:41 +11:00
d512fe441b Comments: document memory management for BPyPropStore 2021-03-17 15:27:37 +11:00
277e9b4355 PyAPI: use union to store pointer poll callback
Reduces `BPyPropStore` size by one pointer.
2021-03-17 15:15:16 +11:00
e8f6c65b44 UI: Rename Init to Initialize Face Sets in menu
Reviewed By: HooglyBoogly

Differential Revision: https://developer.blender.org/D10741
2021-03-17 02:43:46 +01:00
96abe8a3e8 Add versioning code removed in 91561629cd
rB91561629cd0b removed the versioning code added in rBb617b4441961
for the spreadsheet status bar. This commit simply adds it back.
2021-03-16 21:27:32 -04:00
de06cb8559 Bugfix: properly rename Null audio device to None 2021-03-16 23:45:49 +01:00
12c08ceee3 Audaspace: add support for CoreAudio on macOS
This adds CoreAudio as audio backend on macOS.
CoreAudio is the standard audio API on macOS.

Ref T86590
2021-03-16 23:21:45 +01:00
bc57985306 Audaspace: add support for WASAPI on Windows
This adds WASAPI as audio backend on Windows.
WASAPI is the modern standard audio API on
Windows introduced with Windows Vista.

Ref T86590
2021-03-16 23:21:45 +01:00
d33339ebf4 Audaspace: add support for PulseAudio on Linux
This adds PulseAudio as audio backend on Linux.
PulseAudio is the main audio engine used on most,
if not all, Linux distributions today.

Ref T86590
2021-03-16 23:21:45 +01:00
7b8fc307dc Audaspace: porting minor improvements from upstream
- NullDevice is now called None
- Automatic choice of best available device.
- Minor formatting, documentation and cmake fixes.
2021-03-16 23:21:45 +01:00
262a098846 Fix issues with automatic proxy building
After merging patches and resolving conflicts, typo prevented correct operation.
This uncovered crash on NULL dereference as well.
2021-03-16 23:18:21 +01:00
9a56a3865c Geometry Nodes: Add initial version of mesh primitives
This commit includes nodes to build the following primitives:
 - Cone
 - Cylinder
 - Circle
 - Cube
 - UV Sphere
 - Ico Sphere
 - Line
 - Plane/Grid

In general the inputs are the same as the corresponding operators
in the 3D view.

**Line Primitive**
The line primitive has two modes-- adding vertices between two end
points, or adding vertices each at an offset from the start point.
For the former mode, there is a choice between a vertex count
and a distance between each point.

**Plane Primitive**
This commit includes the "Plane" and "Grid" primitives as one node.
Generally primitives are named after the simpler form of the shape they
create (i.e. "Cone" can make some more complex shapes). Also, generally
you want to tweak the number of subdivisions anyway, so defaulting to
plane is not an inconvenience. And generally having fewer redundant
base primitives is better.

**Future Improvements**
A following patch proposes to improve the speed of the cylinder, cone,
and sphere primitives: D10730. Additional possible future improvements
would be adding subdivisions to the cube node and rings to the cone
and cylinder nodes.

Differential Revision: https://developer.blender.org/D10715
2021-03-16 17:35:36 -04:00
3e87d8a431 Grease Pencil: Add LineArt modifier
This adds the LineArt grease pencil modifier.

It takes objects or collections as input and generates various grease
pencil lines from these objects with the help of the active scene
camera. For example it can generate contour lines, intersection lines
and crease lines to name a few.

This is really useful as artists can then use 3D meshes to automatically
generate grease pencil lines for characters, enviroments or other
visualization purposes.

These lines can then be baked and edited as regular grease pencil lines.

Reviewed By: Sebastian Parborg, Antonio Vazquez, Matias Mendiola

Differential Revision: http://developer.blender.org/D8758
2021-03-16 19:59:09 +01:00
877238e2b7 make_deps: Update blender package mirror URI
Final location in SVN was slightly different
than we were planning on.
2021-03-16 12:42:09 -06:00
Charlie Jolly
e183f2b6a9 Geometry Nodes: Implicit conversion add int to color
Add implicit `int32 to Color4f` conversion. Matches `int32 to float3` conversion logic.

This may not be the most useful conversion but prevents an error in the Attribute Convert node.

Reviewed By: JacquesLucke

Differential Revision: https://developer.blender.org/D10686
2021-03-16 18:14:30 +00:00
Charlie Jolly
f8497caf59 Geometry Nodes: Implicit conversion change from distance to average
Use average instead of distance when converting from float3/float2 to float. This matches behaviour of shader nodes.

See: https://developer.blender.org/T86454

Reviewed By: JacquesLucke

Differential Revision: https://developer.blender.org/D10684
2021-03-16 18:04:41 +00:00
04e1feb830 VSE: Automatic proxy building
Build proxies automatically when added to sequencer timeline and when
switching preview size.

This behavior can be disabled in user preferences.

Reviewed By: sergey, fsiddi

Differential Revision: https://developer.blender.org/D10363
2021-03-16 18:56:44 +01:00
e4f3477833 FFmpeg: Improve proxy building performance
Use h264 codec for output. This codec produces smaller files, can be
multithreaded and decodes even faster than MJPEG.

Quality setting 0-100 corresponds to "Lowest Quality" to
"Perceptually Lossless" in Blender's h264 encoding presets.

All available cores are used for decoding.
Same goes for decoding but only for codecs that supports this
(h264, vp9 seems to support this option out of th box as well).
Other decoders can probably be optimized in similar way, but threaded
encoding provides significant boost already.

I have tested variety of codecs, and all were transcoded properly.

Reviewed By: sergey, fsiddi

Differential Revision: https://developer.blender.org/D10731
2021-03-16 18:50:32 +01:00
91561629cd VSE: Simplify proxy settings
- Remove Full Render size from VSE preview size. Use just 100% instead.
- Add Use Proxies checkbox to control whether proxies are used globally
- Move preview size to top so it is most prominent
- Set default to 100% preview size and use proxies

Reviewed By: sergey, fsiddi

Differential Revision: https://developer.blender.org/D10362
2021-03-16 18:50:32 +01:00
0449da5460 Outliner: Refactor: Move overrides tree items to new CPP code.
Fairly straight forwards.

Also fixes the bug from recent refactor that would not show overrides as
a tree, but as a flat list directly under IDs.
2021-03-16 18:35:53 +01:00
Matias Mendiola
15a4ed3aff Dopesheet Context Menu updates
Dopesheet context menu rearranging to include proper operators for Grease Pencil submode

Before:
{F9828095}

After:
{F9828096}

Reviewed By: antoniov, pablovazquez

Differential Revision: https://developer.blender.org/D10502
2021-03-16 17:26:44 +01:00
21236af80c Libraries: Fix deps build on macOS arm64
Minor adjustments that were missing when D10598 landed.
2021-03-16 17:08:48 +01:00
970e246ccc CMake/deps: Updated deps build requirements prompt for macOS arm64
Building deps on macOS arm64 has slightly different requirements.
Belongs to 4b3dcd8069
2021-03-16 17:08:48 +01:00
5ac47cded1 LibOverride: Resync: Fix most remaining 'overrides in master collection' issues.
Problem is, when a collection is excluded from the scene, none of its
objects are technically instantiated.

This should not happen when *creating* an override, but can be fairly
common during resync process.

For now, use a lesser precise check in resync case, only relying on
object usercount. This might lead to some objects being left without any
collection in some rare weird case, but this cannot really be avoided
currently.
2021-03-16 16:57:04 +01:00
1ba88d4d2f LibOverride: Resync: Fix too many objects being rooted in master collection.
No need to instantiate systematically the root object if it is already
instantiated in the scene...

Issue reported by the studio.
2021-03-16 16:57:04 +01:00
18371f2780 LibOverride: tweak log messages, fix crash in log code.
One of the log call could use freed memory.
2021-03-16 16:57:04 +01:00
b71b1ae384 Python GPU: Improve the Python GPU API documentation
This fixes some errors of continuity and consistency of formatting on
https://docs.blender.org/api/current/gpu.html

This also details the description of some parameters.

Differential Revision: https://developer.blender.org/D10531
2021-03-16 12:48:39 -03:00
6b6bcbe60c Fix T86612 EEVEE: Wrong AmbientOcclusion on refractive materials
This is because the refractive materials were using the deferred AO
computation instead of tracing their own.
2021-03-16 15:31:04 +01:00
4ce5dfe54c Cleanup: NULL -> nullptr. 2021-03-16 15:08:23 +01:00
93e2491ee7 Cleanup: replace std::map with blender::Map. 2021-03-16 15:03:30 +01:00
4ca8e09b24 Cleanup: Replace std::vector with blender::Vector. 2021-03-16 15:03:30 +01:00
5266e17ed5 Cleanup: Modernize iterators. 2021-03-16 15:03:30 +01:00
0efca18df7 Cleanup: Modernize iter. 2021-03-16 15:03:30 +01:00
b43d4c63cf Cleanup: Removed commented out code. 2021-03-16 15:03:30 +01:00
8ea3ab5b42 Cleanup: Remove unimplemented declarations. 2021-03-16 15:03:30 +01:00
d07a7697cf Fix T86124: Self-hosting external libraries packages
Allow downloading of source packages of Blender's dependencies, so that
it's easier to provide a "full source archive" that contains the blender
source + all dependencies archives. A `make` command for this will be
introduced soon.

This changes the deps builder slightly to be more flexible with the
origin of our source packages.

To support this a new CMake variable has been added called `PACKAGE_DIR`
where all sources archives will be stored.

default: a directory called `packages` in the build folder.

alternative-default: if a directory called `packages` exists in the
blender source folder that will be used. This is to support the "full
source archive" use case.

The download phase have been moved from the build phase to the configure
phase. Configure will download all sources validate the hashes while
downloading.

All `[depname].cmake` files have been changed to take a local
`file://[path_to_local_tarball]` path rather than a remote URI.

A second requirement was that there needed to be an option to grab the
sources from the blender SVN mirror rather than upstream. For this an
option has been added PACKAGE_USE_UPSTREAM_SOURCES (default ON). The
exact location in SVN still needs to be worked out, I tested with my
local webserver and codewise it checks out. The path that is in there
currently will not work (given there is no mirror there yet).

To build this mirror our local package caches can be used.

Reviewed By: lazydodo

Differential Revision: https://developer.blender.org/D10598
2021-03-16 14:10:30 +01:00
Pratik Borhade
4d3cdb32d3 Fix T86168: Add primitive Grid. Wrong number of subdivisions
Changes to increase subdivision by one along both axis (X and Y)

For example with x_segment = 3 and y_segment = 3.
There should be 16 vertices ((3 + 1) * (3 + 1)) for correct
number of subdivisions. Currently they are 3 * 3 = 9 vertices.

Ref D10699
2021-03-16 23:10:32 +11:00
6d011d0e27 Fix: Cryptomatte load corrupt manifests.
Seems like one of the example files on the cryptomatte github is
malformed and blender crashes when loading that file. This change will
try to load as much as possible from the manifest so it can still be
used.

This has also been reported to cryptomatte project.
2021-03-16 10:12:03 +01:00
cb3005c263 Fix: read cryptomatte manifests when images aren't loaded yet.
A check was preventing the actual image to load and was therefore not
parsed.
2021-03-16 10:12:03 +01:00
0a34fec56a Fix T86561: Edit-mode crash with multiple objects sharing a mesh
Use a for loop that always begins with the active object,
instead of moving the active object in the array,
which failed when it's data already being handled.

While the existing logic could have been fixed,
it's simpler to change the loop order.
2021-03-16 19:30:30 +11:00
d49e7b82da Compositor: Redesign Cryptomatte node for better usability
In the current implementation, cryptomatte passes are connected to the node
and elements are picked by using the eyedropper tool on a special pick channel.

This design has two disadvantages - both connecting all passes individually
and always having to switch to the picker channel are tedious.

With the new design, the user selects the RenderLayer or Image from which the
Cryptomatte layers are directly loaded (the type of pass is determined by an
enum). This allows the node to automatically detect all relevant passes.

Then, when using the eyedropper tool, the operator looks up the selected
coordinates from the picked Image, Node backdrop or Clip and reads the picked
object directly from the Renderlayer/Image, therefore allowing to pick in any
context (e.g. by clicking on the Combined pass in the Image Viewer). The
sampled color is looked up in the metadata and the actual name is stored
in the cryptomatte node. This also allows to remove a hash by just removing
the name from the matte id.

Technically there is some loss of flexibility because the Cryptomatte pass
inputs can no longer be connected to other nodes, but since any compositing
done on them is likely to break the Cryptomatte system anyways, this isn't
really a concern in practise.

In the future, this would also allow to automatically translate values to names
by looking up the value in the associated metadata of the input, or to get a
better visualization of overlapping areas in the Pick output since we could
blend colors now that the output doesn't have to contain the exact value.

Idea + Original patch: Lucas Stockner
Reviewed By: Brecht van Lommel

Differential Revision: https://developer.blender.org/D3959
2021-03-16 07:43:17 +01:00
269536d47e Cleanup: use doxy sections for 'bpy.props' module 2021-03-16 17:34:52 +11:00
95bb41a3e3 Cleanup: use _fn suffix in bpy.props 2021-03-16 17:22:34 +11:00
81178eca7c Revert removal of lambda usage for Python RNA callbacks
This reverts commits
- 476be3746e
- 8d50a3e19e
- 08dbc4f996 (partially).
2021-03-16 15:18:02 +11:00
e125305af4 Fix T86332: Error using lambda in annotations in Python 3.10
Callbacks used in `bpy.props` didn't hold a references to the functions
they used.

While this has been the case since early 2.5x it didn't cause any
problems as long as the class held a reference.

With Python 3.10 or when using `from __future__ import annotations`,
the annotations are no longer owned by the class once evaluated.

Resolve this by holding a reference in the module, which now supports
traverse & clear callbacks so the objects are visible to Python's
garbage collector.

Also refactor storage of Python data, moving from an array into a struct.
2021-03-16 15:17:45 +11:00
be51d671b5 Fix T86121: Cycles Attribute returning wrong results with OSL
Fix uninitialized variable in the OSL shader.
2021-03-15 20:47:07 +01:00
8f93386e62 Fix (apparently harmless) Cycles asan warnings 2021-03-15 20:46:57 +01:00
Mikhail
21bc1a99ba Cycles: optimize ensure_valid_reflection(), reduces render time by about 1%
This is an implementation that is about 1.5-2.1 times faster. It gives a result
that is on average 6° different from the old implementation. The difference is
because normals (Ng, N, N') are not selected to be coplanar, but instead
reflection R is lifted the least amount and the N' is computed as a bisector.

Differential Revision: https://developer.blender.org/D10084
2021-03-15 18:01:57 +01:00
Mikhail Matrosov
fbe0165aad Fix T56925: Cycles banding artifacts in dense volumes
Offset the starting point of segments by a random amount to avoid the bounding
box shape affecting the result and creating artifacts.

Differential Revision: https://developer.blender.org/D10576
2021-03-15 17:49:52 +01:00
cd3fade2aa Fix Cycles rendering crash on OpenBSD
Static initialization order was not guaranteed to be correct for node base
types. Now wrap all initialization in accessor functions to ensure the order
is correct.

Did not cause any known bug on Linux/macOS/Windows, but showed up on this
platform.
2021-03-15 16:47:07 +01:00
Charlie Jolly
3fdef12162 Geometry Nodes: Support drag & drop object to create Object Info, Collection Info and Sample Texture nodes
See: {T86296}

Reviewed By: JacquesLucke

Differential Revision: https://developer.blender.org/D10648
2021-03-15 15:36:22 +00:00
1b29e84c18 Fix Libmv tests after recent fix
Forgot to update regression test to the changed API.
2021-03-15 16:11:37 +01:00
e7f59e6f94 Spreadsheet: show number of filtered rows only when necessary 2021-03-15 16:11:18 +01:00
c82f65b096 Fix T86262: Tracking backwards fails after gap in track
The issue was caused by a prediction algorithm detecting tracking the
wrong way. Solved by passing tracking direction explicitly, so that
prediction will always happen correctly regardless of the state of the
Tracks context.
2021-03-15 15:55:09 +01:00
618c4b9daf Refactor Libmv C-API motion model conversion
Mode to an own utility function and guard missing enumerator values
with a LOG(FATAL).
2021-03-15 15:55:09 +01:00
1f7140e709 Tracking: Mention TODO about DNA to Libmv API conversion
Current code works, but is heavily relying on matched enum definition
in the Blender's DNA and Libmv's API, which is suboptimal and fragile.
2021-03-15 15:55:09 +01:00
d8e1750e34 Cleanup: Spelling in Libmv comments 2021-03-15 15:55:09 +01:00
4e236326c1 EEVEE: Contact Shadow: Fix self intersection issues
This was cause by the change of some epsilon values for reflections.

This commit changes the planar reflection tracing to have correct
handling of parallel rays and discard any self intersection with normal
screen raytrace.
2021-03-15 15:52:02 +01:00
098c595e51 Cleanup: EEVEE: Remove unused variable 2021-03-15 15:52:02 +01:00
cf5cada6b2 Nodes: fix crash after undo after recent multi-input-socket changes
The issue is that the `last_node_hovered_while_dragging_a_link` pointer is invalidated on undo.
The pointer does not have to be on the space runtime data, because it only needs to exist
as long as the operator is running.

Differential Revision: https://developer.blender.org/D10726
2021-03-15 15:41:41 +01:00
3618948df8 Geometry Nodes: expose builtin crease attribute
This exposes the `crease` attribute, that is used by the Subdivide Smooth node.
It is also the first attribute on the edge domain. Domain interpolations for the
edge domain have not been implemented yet.

Ref T86397.

Differential Revision: https://developer.blender.org/D10660
2021-03-15 15:38:57 +01:00
992abd4734 LibOverride: Add checks to address some degenerate blend file cases
Attempt to work around some full-corruption cases created at the studio.
Not clear how those were created, so not really fixing anything here,
just detecting and 'solving' as best as possible some high corruption of
local overrides.

This is good to have in general anyway, might help prevent further
corruption to happen too.
2021-03-15 15:21:40 +01:00
ab6e67767e Comments: notes on sculpt/image undo looping logic 2021-03-15 23:31:35 +11:00
14863b3d4d Fix T86542: Crash going to UV editing workspace with an instancer that
is hidden from the viewport

Check visibilty (as done in workbench_cache_populate) in
overlay_edit_uv_cache_populate as well.

Maniphest Tasks: T86542

Differential Revision: https://developer.blender.org/D10724
2021-03-15 12:46:21 +01:00
880c840c0b Fix macos compile error
`std::get` does not seem to be available. Using `std::get_if` might work instead.

(Found the error on the buildbot.)
2021-03-15 12:42:20 +01:00
5ad4713cd8 Spreadsheet: improve separation of drawing and data generation
This is a refactor and no functional changes are expected.

The goal is to make it simpler to add other data sources without having
to repeat the drawing code everywhere. Also, having the `CellValue` class
allows us to implement filtering and sorting in a more generic way.
2021-03-15 12:23:03 +01:00
4ed208bcd8 Spreadsheet: support showing data from original/unevaluated object
There are two caveats of the current implementation which still need
to be resolved in a separate step:
* In theory the data on the original object can be editable in the spreadsheet.
* If a complex object is in edit mode, and its original data is displayed,
  the drawing code can be slow, because the bmesh is converted to a mesh
  every time. The proper solution is to draw the data from the bmesh directly.
  This should become easier after an upcoming refactor.

Ref T86141.

Differential Revision: https://developer.blender.org/D10701
2021-03-15 10:16:11 +01:00
b617b44419 Spreadsheet: add status bar
This implements the status bar as footer region in the
spreadsheet editor.

It shows the total number of rows and columns as well
as how many rows are actually visible (based on the filter).

The implementation stores the stats in a runtime struct during
drawing and the status bar reads from that struct.

Ref T86142.

Differential Revision: https://developer.blender.org/D10693
2021-03-15 10:00:02 +01:00
2ca48b9678 Fix T86370: Select color for glow is inverted
The shader was filtering everything but the selected color.
The fix inverts the check to make sure that color is selected.

Reviewed By: fclem

Maniphest Tasks: T86370

Differential Revision: https://developer.blender.org/D10670
2021-03-15 09:51:52 +01:00
4ecd47de6b Cleanup: clang modernize-use-override errors. 2021-03-15 08:34:33 +01:00
2939251a05 Fix regression with modal operator file load check
As of 2cc5af9c55, checking the window
managers pointer for changes is no longer a valid way
to check a file has been loaded.
2021-03-15 16:37:20 +11:00
684971c2f2 WM: fallback to regular writing if auto-save can't access undo data
While this is very unlikely, always write the autosave file,
even if the `memfile` undo data is unexpectedly NULL.

Also use CLG for logging warnings.
2021-03-15 14:53:29 +11:00
244315afc9 Cleanup: refactor auto-save timer usage
- Split out auto-save file writing from timer code.
- Add wm_autosave_timer_begin so there are both begin & end functions.
- Replace WM_event_add_timer/WM_event_remove_timer with begin/end calls.
2021-03-15 14:48:17 +11:00
d611f2889e Cleanup: remove unused auto-save read function
Also make wm_autosave_location a static function.
2021-03-15 14:48:17 +11:00
6cd1520378 Cleanup: replace 'timer_ended' with 'timer_end'
The previous naming made it seem as if the timer had already ended
where as this function ends the timers.
2021-03-15 14:48:17 +11:00
88b24bc6bb Writefile: only include recovery info in auto-save & quit.blend
Previously all blend files included the path they were saved,
causing files distributed publicly to include users local paths.
This also included developers home directories for startup & userprefs
defaults & app-templates bundled with Blender.

Now recovery information is only written for auto-save & quit.blend
since this is the only time they're intended to be used.
2021-03-15 14:48:17 +11:00
d3b4ff6eaa Cleanup: rename G_FILE_RECOVER -> G_FILE_RECOVER_READ
No functional changes, make room for a write equivalent.
2021-03-15 14:48:17 +11:00
042f06ef3c Cleanup: update comments, remove ifdef'd code 2021-03-15 14:48:17 +11:00
c23da7a5c9 BLI: Add "is_zero" method to float2 and float3 types
This is not necessary, but a nice convenience to avoid using `is_zero_v3`.

Differential Revision: https://developer.blender.org/D10713
2021-03-14 22:36:35 -04:00
070010e203 Nodes: multi-input support for Attribute Remove node
This patch adds multi-input support to the Attribute Remove node.

Reviewed By: Hans Goudey

Differential Revision: https://developer.blender.org/D10698
2021-03-14 23:11:36 +01:00
a01fb22f28 Fix T86427 Exact solver does not apply target material.
I had done some experiments to see what Fast boolean did for material
mapping and thought it just used the same slot in the target as the
slot in the source. The truth is more complicated: if the target material
exists in any slot of the destination, we need to remap to whatever
slot has the matching material. I fixed Exact Boolean to do this.
Since the materials may be in the object, this means that BKE_mesh_boolean
had to get another argument, the remapping arrays.

I will note that the current behavior of Fast, and now Exact, is not ideal.
Ideally, if the source material does not exist in the target, a new material
slot should be created in the target and the source material copied there
(and incrementing the material's reference count). Maybe a future project,
but for now, I want the behavior of Exact to match that of Fast.
2021-03-14 13:20:03 -04:00
8936550269 EEVEE: Specular Occlusion: Avoid overdarkening on smooth surfaces
Accumulate error caused by the low amount of integration slices and
correct it for the low roughness surfaces.

This increases light leak but it is less distracting than dark fringe
everywhere.
2021-03-14 17:19:39 +01:00
448cb5d55b CMake/guardedalloc: add header file to TEST_SRC 2021-03-14 18:11:24 +05:30
85b209e02e Tests: add script_validate_keymap
This checks the generated key-map data matches the result of
re-exporting and re-importing.

This shows up various inconsistencies, including:

- Unused keymaps.
- Unknown/unused data in the keymap.
- Event arguments that don't make sense.
- Event values that don't match the event type
  (tweak direction on keyboard event for example).
2021-03-14 23:31:09 +11:00
b0fbd1ff6f Cleanup: unused argument warnings 2021-03-14 18:08:05 +11:00
8dd9bb1749 Cleanup: avoid risky list as default argument in keymap 2021-03-14 18:08:05 +11:00
06245d0d94 Cleanup: remove redundant keymap arguments
Also add missing space-type argument, while not required
this is used by convention elsewhere in the key-map.
2021-03-14 18:08:05 +11:00
2e95eaed55 Cleanup: remove invalid repeat argument 2021-03-14 18:08:05 +11:00
8301cbd64f Cleanup: remove unused "Gizmo" & "Header" keymaps 2021-03-14 18:08:05 +11:00
2919c4bf9d Cleanup: use explicit check for WM_KEYMAP_UPDATE_RECONFIGURE
A block of code ran when `wm_keymap_update_flag` was non-zero,
replace this with explicit flag check since it wasn't
immediately obvious which flag needed to be set.
2021-03-14 18:08:05 +11:00
d2f4fc8275 WM: support loading keymaps in background mode
While this still isn't done by default on startup,
activating a key-config will load it as expected.

Needed to perform key-map loading tests in background mode.
2021-03-14 18:00:15 +11:00
15d728531a Fix pivot pie menu missing in the clip editor
Regression in a4226a050b.
2021-03-14 18:00:14 +11:00
e8e4a79512 Fix T86390 Exact Boolean crash.
The code has to keep track of "zero volume" cells and I forgot
that there were cases where that needed be be invalidated.
2021-03-13 19:23:14 -05:00
1f8d27a191 Cleanup: EEVEE: Replace brightness() by max_v3()
It is more straightforward to understand and is define in common file.
2021-03-13 23:49:31 +01:00
8041b1dd1c Cleanup: EEVEE: Remove unused mipmapping on main color buffer 2021-03-13 23:49:31 +01:00
9f68f5c1e1 Nodes: Add distance float socket type
This is necessary to make float sockets display a value with the unit
system. `PROP_DISTANCE` will be used quite a lot by the mesh primitives
geometry nodes patch.

Differential Revision: https://developer.blender.org/D10711
2021-03-13 17:15:50 -05:00
dcfea4a1e5 Cleanup: EEVEE: Silence warning 2021-03-13 23:13:08 +01:00
e30315ba95 EEVEE: RenderPass: Fix Ambient Occlusion pass
The shader was not using the horizon texture and was trying to
trace the AO again.

Also the depth reconstruction was off because now using the maxzBuffer.
2021-03-13 23:11:53 +01:00
75fc6e3b2b Cleanup: EEVEE: Remove the horizon search layered shader
This shader is of no use now that we the fullres hizbuffer.
2021-03-13 22:51:23 +01:00
00baf875ef EEVEE: Planar reflections: Fix ambient occlusion broken in reflections
Use the maxzbuffer to get the correct depth information.
2021-03-13 22:51:22 +01:00
2c216413d5 Nodes: Move group input and output to a consistent menu location
Currently (in geometry nodes) you can delete the group input or group
output nodes with no way to get them back without copy and paste. This
adds them to the "Group" submenu of the add menu so at least there is
a way to add them back.

Additionally, these nodes are moved to the "Group" submenu for all node
editors. This makes sense since they are not like the other input or
output nodes, they really just relate to how groups are organized.

Differential Revision: https://developer.blender.org/D10241
2021-03-13 16:00:56 -05:00
03490618a2 EEVEE: ScreenSpaceReflections: Avoid outputing NaNs
This happens when the normal is too much deformed to give valid
reflection even after ensure_valid_reflection.

Cycles seems to not handle this case either so we just discard the
rays.
2021-03-13 20:59:20 +01:00
09e77d2c89 Fix T86476 EEVEE: SSS material with variable radius can produce NaNs
Simple divide by 0 error. The input radius was assumed to be safe
but is not when the user can scale it arbitrarly.

This also move the division out of the loop.
2021-03-13 20:59:20 +01:00
165a2da753 EEVEE: Fix wrong sss component being affected by alpha
This fixes NaNs / blown up values when using alpha-hashed transparency
or alpha clip with SSS.
2021-03-13 20:59:20 +01:00
267a9e14f5 EEVEE: ScreenSpaceReflections: Add back multi ray-hitpoint reuse
We now reuse 9 hitpoints from the neighboorhood using a blue noise
sample distribution as mentionned in the reference presentation.

Reusing more rays does however make some area a bit more blury.

The resulting noise is quite lower compared to previous implementation
which was only reusing 4 hits.
2021-03-13 20:59:20 +01:00
b79f209041 EEVEE: ScreenSpaceReflections: Increase depth threshold
This avoids going through geometry when ray have certain angle.
2021-03-13 20:59:20 +01:00
bbc5e26051 EEVEE: ScreenSpaceReflections: Jitter starting texel
This make sure the rays are generated randomly from a fullres
texel center.

This creates more noise but increase the convergence when doing
half res tracing.
2021-03-13 20:59:20 +01:00
ff07a4afb8 EEVEE: Fix split commit 2021-03-13 20:59:20 +01:00
83b7f7dfb7 Cleanup: EEVEE: Remove SSR shader variations 2021-03-13 20:59:20 +01:00
40d579b69f Cleanup: EEVEE: Split effect_ssr.glsl
This split is to make code easier to manage and rename the files to
`effect_reflection_*` to avoid confusion.

Also this cleans up a bit of the branching mess in the trace shader.
2021-03-13 20:59:20 +01:00
6a7f6f2867 Cleanup: EEVEE: Remove hammersley texture and split hammersley code 2021-03-13 20:59:20 +01:00
5fee9dae5d Cleanup: EEVEE: Make bsdf_sampling_lib.glsl more tidy 2021-03-13 20:59:20 +01:00
ba3a0dc9ba Geometry Nodes: Add "normal" attribute for face normals
This commit adds a `normal` attribute on the polygon domain. Since
normal data is derived data purely based off of the location of each
face's vertices, it is exposed as a read-only attribute. After
rB80f7f1070f17, this attribute can be interpolated to the other domains.

Since this attribute is a special case compared to the others, the
implementation subclasses `BuiltinAttributeProvider`. It's possible
there is a better way to abstract this. Something else might also
become apparent if we add similar read-only attributes.

See rB2966871a7a891bf36 for why this is preferred over the previous
implementation.

Differential Revision: https://developer.blender.org/D10677
2021-03-13 14:13:16 -05:00
2966871a7a Geometry Nodes: Revert current normal attribute implementation
After further thought, the implementation of the "normal" attribute
from D10541 is not the best approach to expose this data, mainly
because it blindly copied existing design rather than using the
best method in the context of the generalized attribute system.

In Blender, vertex normals are simply a cache of the average normals
from the surrounding / connected faces. Because we have automatic
interpolation between domains already, we don't need a special
`vertex_normal` attribute for this case, we can just let the
generalized interpolation do the hard work where necessary,
simplifying the set of built-in attributes to only include the
`normal` attribute from faces.

The fact that vertex normals are just a cache also raised another
issue, because the cache could be dirty, so mutex locks were
necessary to calculate normals. That isn't necessarily a problem,
but it's nice to avoid where possible.

Another downside of the current attribute naming is that after the
point distribute node there would be two normal attributes.

This commit reverts the `vertex_normal` attribute so that
it can be replaced by the implementation in D10677.

Differential Revision: https://developer.blender.org/D10676
2021-03-13 14:05:00 -05:00
88f845c881 GPencil: Remove word "Strokes" in menu
This remove redundant word.
2021-03-13 19:52:10 +01:00
Charlie Jolly
670453d1ec Geometry Nodes: Add Attribute Convert node
The Attribute Convert node provides functionality to change attributes
between different domains and data types. Before it was impossible to
write to a UV Map attribute with the attribute math nodes since they
did not output a 2D vector type. This makes it possible to
"convert into" a UV map attribute.

The data type conversion uses the implicit conversions provided by
`\nodes\intern\node_tree_multi_function.cc`.

The `Auto` domain mode chooses the domain based on the following rules:
1. If the result attribute already exists, use that domain.
2. If the result attribute doesn't exist, use the source attribute domain.
3. Otherwise use the default domain (points).

See {T85700}

Differential Revision: https://developer.blender.org/D10624
2021-03-13 11:49:56 -05:00
8ab6450abb Fix geometry nodes implicit conversion to booleans reversed
The result value should be true if the input values are not zero.
Note that there is ongoing conversation about these conversions
in D10685. This is simply a fix though.
2021-03-13 11:39:48 -05:00
258b15da74 Cleanup: add BKE_pbvh_vertex_iter_begin to clang-format
Reviewed By: JacquesLucke

Differential Revision: https://developer.blender.org/D10707
2021-03-12 22:29:37 +01:00
74052a9f02 Sculpt: Mask Init operator
This operator initializes mask values for the entire mesh. It supports
different modes for initializing those values, and more will be added in
the future.

The initial version supports generating a random mask per vertex, Face
Sets or loose parts. These masks are useful for introducing variations
in the model using the filters (both shapes and colors).

Reviewed By: JacquesLucke

Differential Revision: https://developer.blender.org/D10679
2021-03-12 21:37:12 +01:00
9d08c169d1 GPencil: Interpolate can use all keyframe types except breakdown
Before only it was only possible interpolate frames of `Keyframe` type. Now all types except `Breakdown` can be used. 

`Breakdown` cannot be used because it would be impossible interpolate two times because the extremes of the interpolation would change and the clean operator would not work.
2021-03-12 19:43:13 +01:00
5788f608d3 GPencil: UI menu cleanup
Remove duplicate words Stroke and Point already in menu header.

Reviewed by: @mendio,  @filedescriptor
2021-03-12 19:12:27 +01:00
476be3746e Fix T86332: setting Cycles dicing camera fails after recent changes
Somehow "from __future__ import annotations" and "lambda" are not working
together well here, work around it by not using a lambda function.
2021-03-12 17:49:56 +01:00
b01e9ad4f0 Fluid: Enable scale options for fluid particles
There is no reason to hide the 'Scale' and 'Scale Randomness' options
for fluid particles that are rendered as 'Object'.

It is possible that hiding these options was just an oversight and
not intentional.
2021-03-12 17:24:53 +01:00
abe1a061f8 Docs: add doc-string for TransDataContainer 2021-03-13 03:14:56 +11:00
651fe243e6 Cleanup: const warning 2021-03-13 03:14:56 +11:00
f707783d5f LibOverride Auto Resync: Add option to disable it in Experimental userpref.
Some older .blend files won't react nicely to auto-resync, they need to
get manually fixed with `resync enforce` first.
2021-03-12 16:45:45 +01:00
Bastien Montagne
ef5782e297 CLOG: add support for substring matching.
So that `--log "*undo*"` matches any log identifier containing `undo`.

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D10647
2021-03-12 16:01:46 +01:00
bcac17196a Fix heap buffer overflow appending/linking from a blend file
Add new function `blo_bhead_is_id_valid_type()` to correctly check the
blend file block type.

File block type codes have four bytes, and two of those are only in use
when these blocks contain ID datablocks (like `"OB\0\0"`). However,
there are other types defined in `BLO_blend_defs.h` that have four
bytes, like `TEST`, `ENDB`, etc.

The function `BKE_idtype_idcode_is_valid(short idcode)` was used to
check for ID datablocks while reading a blend file. This only takes a
2-byte parameter, and thus its result is invalid for the 4-byte codes.
For `TEST` blocks, it would actually consider it a `TE` block, which is
a valid identifier for a Texture. This caused the heap buffer overflow,
as the datablock is not a valid ID, and thus the bytes that were
expected to form an ID name actually encode something completely
different.

Reviewed By: mont29

Differential Revision: https://developer.blender.org/D10703
2021-03-12 15:58:58 +01:00
f0c3ec3dc8 Fix T82532: Sculpt fails to redo the first sculpt session stroke
Sculpt undo relied on having a mode-changing undo step to properly
apply changes.

However this isn't the case with startup files or when mixing
global undo steps with sculpt (see T82851, also fixed).

Undo stepping logic follows image_undosys_step_decode_undo.
2021-03-13 01:36:26 +11:00
c7354cc64b Fix another crash in LibOverride resync code.
Another case where newly overridden ID (stored in `newid` of its linked
reference) gets immediately deleted in old broken overrides.

Re T86501.
2021-03-12 15:27:01 +01:00
20ee6c0f16 Fix compiler warning when building Cycles without Embree 2021-03-12 15:17:08 +01:00
fd905c1059 Cleanup: fix clang-tidy errors when COM_debug is active. 2021-03-12 14:32:24 +01:00
7388f9df71 Cleanup: Compiler warnings with COM_TM_NOTHREAD active. 2021-03-12 13:36:49 +01:00
583df9a5f8 Cleanup: document FileSelectAssetLibraryUID::type
No functional changes.
2021-03-12 13:24:31 +01:00
74557ca4f7 LibOverride: Add a new operation to Outliner to enforce resync of hierarchies.
This is basically done by ignoring override operations from old override
affecting ID pointer properties, when the new (destination) one is not
NULL.

Fix T86501: New object added to overridden collection doesn't show up in linking file on Resync.

This is more of a work-around actually, since there is no real way to
fix the issue in a fully automated and consistent way, it is caused by
older blender files being saved with 'broken' overrides.

WARNING: This cannot ensure that some purposedly edited/overridden ID
pointer properties won't be lost in the process.
2021-03-12 12:31:25 +01:00
fe2ceef729 Fix first part of T86501: Crash during resync process.
Code would end up freeing some of the newly created overrides, which
were assigned to the matching linked ID's `newid` pointer, accessed
again further down the code.

Note that this is not a normal expected situation, and it won't give a
proper resync result anyway, but it might happen in some complicated
corner cases, and also quite often when dealing with older .blend files.
2021-03-12 09:46:11 +01:00
4781ab0969 IDRemap: Add option to also remap internal runtime ID pointers.
In some cases (advanced, low-level), we also want to remap pointers like
`ID.newid` or `ID.orig_id`.

Only known case currently is `id_delete`, to avoid leaving potential access to freed memory. See next commit and T86501.
2021-03-12 09:46:11 +01:00
fd4c01a75c LibQuery: Add an option to process internal runtime ID pointers.
In some cases (advanced, low-level code) we also want to process ID
pointers like `ID.newid` or `ID.orig_id`.
2021-03-12 09:46:11 +01:00
960337f17a Fix T86455: vertex color baking issue with sculpt vertex colors
Baking to Vertex Colors would always bake to sculpt vertex colors (if
such a layer is present) even if those are not enabled in the
experimental preferences. This would bake without an error but leave the
user without a result to look in the viewport.

Now check if sculpt vertex colors are enabled and only bake to them in
that case.

Maniphest Tasks: T86455

Differential Revision: https://developer.blender.org/D10692
2021-03-12 09:22:47 +01:00
a5c44265a3 Cleanup: remove workaround for MSVC PyTypeObject declarations
This is no longer needed for MSVC-2017.
2021-03-12 16:13:36 +11:00
2a5f22c1af Cleanup: set the window manager to the updated context on load
While this happened to be corrected by code that runs afterwards,
leaving this in an invalid state could cause problems in the future.
2021-03-12 16:13:36 +11:00
2e9fb211c6 Cleanup: make_source_archive.py minor changes & comments
- Add notes on portability.
- Use encoding argument for all file IO.
- Use integer math to calculate major/minor version, while float
  division should be fine prefer matching Blender.
2021-03-12 16:13:36 +11:00
7f4530dad2 Cleanup: incorrect doxy section title
Also correct typo.
2021-03-12 16:13:36 +11:00
8125731cae Cleanup: break out of loop early 2021-03-12 16:13:36 +11:00
d3fa576aa7 Cleanup: redundant flag check 2021-03-12 16:13:36 +11:00
406d9749d8 Cleanup: redundant outliner includes 2021-03-12 16:13:36 +11:00
8922d177c1 Alembic procedural: specific result type for cache lookups
This type, CacheLookupResult, holds the data for the current time, or an
explanation as to why no data is available (already loaded, or simply
nothing available). This is useful to document the behavior of the code
but also, in future changes, to respond appropriately for missing data.
2021-03-12 01:57:41 +01:00
d72fc36ec5 Alembic procedural: add support for instancing
Inside of the procedural, instances are AlembicObjects which point to
the AlembicObject that they instance.

In Alembic, an instance is an untyped Object pointing to the original
(instanced) one through its source path. During the archive traversal we
detect such instances and, only if the instanced object is asked to be
rendered, set the instance's AlembicObject to point to the original's
AlembicObject.

Cycles Object Nodes are created for each AlembicObject, but only for
non-instances are Geometries created, which are then shared between
Object Nodes. It is supposed, and expected, that all instances share the
same shaders, which will be set to be the ones found on the original
object.

As for caching, the data cache for an AlembicObject is only valid for
non-instances and should not be read to or from as it is implicitly
shared.
2021-03-12 01:30:12 +01:00
7017844c5e Alembic procedural: move cache building out of object update methods
This will help support instancing as cache building is now decoupled
from the logic to update the Nodes' sockets as data (and cache) will
need to be shared by different Geometries somehow, and also simplify
implementing different data caching methods by centralizing this
operation.
2021-03-12 00:15:17 +01:00
7a028d5b99 Alembic procedural: fix missing attribute update
We need to explicitely tag the Attribute and AttributeSet as modified if
we change or add/remove data. This is more of a bandaid until attributes
handling is refactored to be able to reuse routines from the Attribute
API.
2021-03-12 00:15:16 +01:00
62e2fdf40b Cleanup: unused variable 2021-03-12 00:15:16 +01:00
2ebf4fbbfb Alembic procedural: fix potential zero scale matrix generation
This can happen during user edits or with files missing the global scale
property.
2021-03-12 00:15:15 +01:00
3256f0d52c Added missing file to last commit:
Nodes: Add Attribute Remove Node D10697
2021-03-11 23:42:19 +01:00
60f7275f7f Nodes: Add Attribute Remove Node
This patch adds a node, that removes an attribute if possible,
otherwise it adds an error message.

Differential Revision: https://developer.blender.org/D10697
2021-03-11 23:06:16 +01:00
afa30f1a9d Nodes: Fix drag link from output to already linked Multi-Input Socket
This patch fixes a visual bug related to connecting an output socket to
a Multi-Input Socket, that already has a link to that same output.
In this case, the drag link got a new index and snapped to a new
position. This path makes the drag link snap to the same position as the
first link between the two sockets.

Differential Revision: https://developer.blender.org/D10689
2021-03-11 18:53:29 +01:00
8c6337e587 Fix missing UI updates, caused by own earlier commit
Caused by 46aa70cb48.

RNA would send property update notifiers with the owner ID as `reference` data.
Since above's commit we'd only send the notifiers to editors if the reference
data address matches the space's address. So editors wouldn't get the notifiers
at all.

The owner ID for space properties is always the screen AFAIK. So allow
notifiers with the screen as reference to be passed to editors as well, think
this is reasonable to do either way.

For example, steps to reproduce were:
* Open Asset Browser
* Mark some data-blocks of different types as assets (e.g. object & its
  material)
* Switch between the categories in the Asset Browser. The asset list wouldn't
  be updated.
2021-03-11 18:47:14 +01:00
1b1f8da5dd Cleanup: remove unnecessary const from function declaration
No functional changes.
2021-03-11 18:20:34 +01:00
670c1fdf64 GPencil: Remove limitation to use only one Lattice modifier
This limitation was necessary in older versions, but now can be removed.
2021-03-11 18:17:30 +01:00
7092d6a7a3 Fix warning from own previous commit 2021-03-11 17:57:05 +01:00
46aa70cb48 UI: Avoid unnecessary redraws of unrelated editors on space changes
When adding a notifier, `reference` data can be passed. The notifier system
uses this to filter out listeners, for example if data of a scene changes,
windows showing a different scene won't get the notifiers sent to their
listeners.

For the `NC_SPACE` notifiers, a number of places also passed the space as
`reference`, but that wasn't used at all. The notifier would still be sent to
all listeners in all windows (and the listeners didn't use it either). Causing
some unnecessary updates (e.g. see ed2c4825d3).
With this commit, passing a space will make sure the notifier is only sent to
that exact space. Some code seems to already have expected that to be the case.

However there were some cases that passed the space as `reference` without
reason, which would break with this commit (meaning they wouldn't redraw or
update correctly).
Corrected these so they don't pass the space anymore.
2021-03-11 17:43:45 +01:00
ed2c4825d3 Fix Asset Browser showing oudated list for changes done while browser is hidden
Steps to reproduce were:
* Open an Asset Browser
* "Mark Asset" on some data-block
* Change the Asset Browser into a different editor (not File Browser!)
* "Clear Asset" on the data-block again, or mark another asset
* Change back to the Asset Browser, it will show an outdated list

Now the file-browser reloads local file data after spaces were changed. Note
that the current notifier code doesn't limit the space-change notifiers to the
affected spaces, so changing any visible space will trigger this. That's an
issue to be fixed separately.
2021-03-11 17:43:33 +01:00
a1b01edf45 GPencil: Fix unreported Fill fails if the stroke was tagged
In some situations the strokes could be tagged before filling, so it's necessary to reset before.
2021-03-11 17:23:04 +01:00
9dfc81ccf1 Fix regression in 2cc5af9c55
The check for undo-depth increment/decrement assumed a newly loaded
window manager would have a different pointer.

This broke bl_animation_fcurves test indirectly,
the change to undo-depth caused the redo panel to attempt to popup
in background mode - which isn't supported.

Now the pointer is unchanged, the undo-depth is assumed to match
the value used when calling the operator.

The undo-depth is now properly maintained between file loads,
which is an improvement on the original behavior which reset it.
2021-03-12 03:21:39 +11:00
Siddhartha Jejurkar
350ad4bcb1 Fix T86199: error when adding custom fluid diffusion preset
Differential Revision: https://developer.blender.org/D10694
2021-03-11 16:51:01 +01:00
d518b0fda5 Fluid: Updated hidden symbol visibility comment
It turns out that on official arm64 devices (not DevKit) the linker
warnings still show up. So just leaving this as is.

Ref D9002
2021-03-11 16:15:45 +01:00
5b91a52944 Cleanup: spelling 2021-03-12 00:51:29 +11:00
2cc5af9c55 Fix T86431: Keep memory location of the window manager on file load
Keep the pointer location from the initial window-manager
between file load operations.

This is needed as the Python API may hold references to keymaps for e.g.
which are transferred to the newly loaded window manager,
without their `PointerRNA.owner_id` fields being updated.

Since there is only ever one window manager, keep the memory at the same location so the Python ID pointers stay valid.

Reviewed By: mont29

Ref D10690
2021-03-12 00:40:52 +11:00
2cdebf293d WM: keep the current state when a blend fails to load
Previously many operations would run on file load, even if the file
did not load. Pre/post load handlers were called, timers canceled,
all undo data freed, editors exited ... etc.

Now keep the blend file in it's current state.

This simplifies updating this area of code as there is one less
possible situation to account for.
2021-03-12 00:40:52 +11:00
5812bc7d89 Cleanup: split file read and setup into separate steps
Currently file loading performs almost all reloading logic
even in the case loading the file fails, causing the file to be in
a state that isn't well defined: undo is cleared, timers are canceled &
scripts are re-registered.
2021-03-12 00:40:52 +11:00
f7616c6eaf Cleanup: file loading/recover checks
- Don't set G.relbase_valid until the file is loaded.
- Remove unnecessary string pointer comparison.
- Remove unused filename being passed to 'setup_app_data'.
2021-03-12 00:40:25 +11:00
93f8c9b823 LibOverride: auto-run resync process on file reading.
Part of T83811 & D10649.
2021-03-11 14:26:19 +01:00
a023c1a34c LibOverride: Add second part of auto-resync code.
`BKE_lib_override_library_main_resync` uses
`LIB_TAG_LIB_OVERRIDE_NEED_RESYNC` tags set by RNA override apply code,
and perform detection for the remaining cases (those were new overrides
need to be created for data that was not present before in the library).

And then it actually resync all needed local overrides.

Part of T83811 & D10649.
2021-03-11 14:26:19 +01:00
534f4e90fd LibOverride: First stage of detection of 'need resync'.
We can fairly easily detect some resync-needed cases when applying the
overrides operations on a Pointer RNA property.

This should cover all cases where an existing override's ID pointer is
changed in its linked data.

We still have to add code to detect when a not-yet-overridden linked ID
needs to become overridden (because its relations to other data-blocks
changed in a way that requires it).

Part of T83811 & D10649.
2021-03-11 14:26:19 +01:00
96064c3bb7 LibOverride: Do not delete no-more-used overrides during resync if they are user-edited.
Ultimately those will be listed with a special icon in the upcomming
Outliner overrides view.

Part of T83811 & D10649.
2021-03-11 14:26:19 +01:00
0a6ed7f035 LibOverride: Add a utils to check if override has been user-edited.
Part of T83811 & D10649.
2021-03-11 14:26:19 +01:00
f4f8b6dde3 Cycles: Change device-only memory to actually only allocate on the device
This patch changes the `MEM_DEVICE_ONLY` type to only allocate on the device and fail if
that is not possible anymore because out-of-memory (since OptiX acceleration structures may
not be allocated in host memory). It also fixes high peak memory usage during OptiX
acceleration structure building.

Reviewed By: brecht

Maniphest Tasks: T85985

Differential Revision: https://developer.blender.org/D10535
2021-03-11 14:12:35 +01:00
ba996ddb3a Cleanup: Add comment explaining plan for new Outliner tree-element code design
Explains how we can get rid of implicit assumptions and `void *`
arguments/storage in the future.
2021-03-11 13:49:16 +01:00
0f60dbe4bf Cleanup: Pass anim-data directly to Outliner anim-data tree element constructor
Rather than letting the `TreeElementAnimData` constructor take an ID from which
we get the animation-data based on an assumption on how it's stored, let the
constructor take the animation-data directly. That way we further centralize
the assumptions on the data passed to the element creation to
`tree_element_create()`.
The following commit will add a comment explaining the plan to entirely get rid
of those assumptions in the future.
2021-03-11 13:49:16 +01:00
d4d03f736b Fix (unreported): crash on undo when using pinned id in spreadsheet
Now the behavior is the same as in the properties editor, as far as I can tell.
2021-03-11 13:28:28 +01:00
fade765bf3 Outliner: Add assert to make assumption for new code design explicit
There was an implicit assumption that tree element types using the new code
design set their name on creation. Use an assert to make this explicit. See
f59ff9e03a, which was an error because of this broken assumption.
2021-03-11 13:20:27 +01:00
f59ff9e03a Fix crash when showing NLA actions in the Outliner
Caused by 2e221de4ce in combination with 4292bb060d.
In the former I forgot to set the name for NLA actions in the new code design,
in the latter I made it an assumtion that tree element types using the new
design set the name.
The following commit will make this assumption explicit with an assert.
2021-03-11 13:18:17 +01:00
018fffbe77 Fix failing assert when loading file with untraceable custom asset library
When loading a file with an asset browser open, and it showed a custom asset
library that can't be found currently (e.g. because the file is from somebody
else), the `BLI_assert(0)` in `rna_FileAssetSelectParams_asset_library_get()`
would fail.

There was code to handle this case already, but unlike I thought it didn't run
right after file read. Now it does.
2021-03-11 13:06:31 +01:00
42c5303409 Cleanup: Typos in comments (window-manager files)
Typos from a509e79a4c. Looks like issues with an automated cleanup tool.
2021-03-11 13:06:31 +01:00
5f1f233dc9 Spreadsheet: expore more domains and point cloud data
Ref T86135.

Differential Revision: https://developer.blender.org/D10681
2021-03-11 12:23:01 +01:00
Rahul Chaudhary
74f3edc343 Fix T86458: Simple Subdivision node does not preserve vertex groups
Differential Revision: https://developer.blender.org/D10683
2021-03-11 11:56:40 +01:00
28e83bca9d Geometry Nodes: improve handling when the same socket is connected twice
The multi-input-socket cannot be connected to the same socket twice currently.
However, it is still possible to achieve this using an intermediate reroute node.

In this case the origin socket should be listed twice in the `linked_sockets_` list.
Higher level functions can still deduplicate the list of they want.
2021-03-11 11:35:02 +01:00
Aaron Carlisle
85623f6a55 UI: Add Copy Full Data Path to RMB menu
This commit adds an operator to the RMB-menu "Copy Full Data Path“,
to copy the full RNA path to the clipboard. It aims to complement
"Copy Data Path“, which only copies the part of the path that is needed
for drivers, but for writing addons, etc. it is useful to have an option that
gives the full data path.

Similar patch have been submitted before, see D763 and D2746

This time I did not split the operator (as D2746) and does not contain the UI reorganization (as D763)

Note, the fixes from D2746 were committed in rB09eac0159db8 so that patch can be closed.

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D10539
2021-03-10 22:10:49 -05:00
9ef24d5aaa Geometry Nodes: fix error adding a value node
Caused by own rBcf2933c38a34 which changed the poll on this node to be
"shading-only", but this one is actually supported.
2021-03-10 22:19:36 +01:00
4cd9a1164b EEVEE: ScreenSpaceReflections: Improve minimal hit threshold
This makes the hit delta threshold dependant on the ray angle.
If the ray is more aligned with the view, its intersection
threshold gets bigger to avoid going through geometry.

This improves reflections and fix T86448 refraction issue.
2021-03-10 17:57:09 +01:00
352385d109 Cleanup: EEVEE: Remove unused function and fix comment 2021-03-10 17:57:09 +01:00
5ab2252a66 Fix T86429 EEVEE: Ambient occlusion broken on some platform
This was cause by a division by 0 if the ray direction had no
depth difference. Adding a small epsilon fix the issue.
2021-03-10 17:57:09 +01:00
56bf4f3fb3 EEVEE: ScreenSpaceReflections: Add back support for planar reflections
We now have a new buffer to output reflection depth. This buffer is
only usefull for non planar SSR but we use it to tag the planar rays.

This also touch the raytrace algo for planars to avoid degenerate
lines on vert sharp reflections.
2021-03-10 17:57:09 +01:00
793335f3e2 Cleanup: EEVEE: Use correct prefix for view space vectors 2021-03-10 17:57:09 +01:00
d89fb77d89 EEVEE: GGX: Use distribution of visible normal for sampling
This changes the sampling routine to use the method described in
"A Simpler and Exact Sampling Routine for the GGXDistribution of Visible Normals"
by Eric Heitz.
http://jcgt.org/published/0007/04/01/slides.pdf

This avoids generating bad rays and thus improve noise level in screen-
space reflections / refraction.
2021-03-10 17:57:09 +01:00
9957096f35 EEVEE: ScreenSpaceReflections: Improve hit quality
This changes the hitBuffer to store `ReflectionDir * HitTime, invPdf`
just as the reference presentation.

This avoids issues when the hit refinement produce a coordinate that
does not land on the correct surface.

We now store the pdf in the same texture and store it inversed so we can
remove some ALU from the resolve shader.

This also rewrite the resolve shader to not be vectorized to improve
readability and scalability.
2021-03-10 17:57:09 +01:00
79bc4962d3 Fix T86416: geometry nodes crash choosing a group node link menu
Since rBb279fef85d1a, the nodes properties for geometry nodes using a
texture are displayed in the Properties Editor.

It was possible to create recursive nodetrees when choosing the 'root'
nodegroup in the node link menu though leading to a crash.

Now poll if a group node of a particular node could actually be added to
the current tree.

Also check if the tree types actually match.

Maniphest Tasks: T86416

Differential Revision: https://developer.blender.org/D10671
2021-03-10 17:03:38 +01:00
cf2933c38a Add 'foreach_nodeclass' for geometry nodetrees
This way we get a choice when we click on node links in the Properties
Editor.

This also changes some of the more permissive poll functions on some
nodes back to being "shading-only" (these were made permissive in
rBb78f2675d7e5 for simulation nodes, but have not found their way into
geometry nodes yet).

ref b279fef85d / T86416 / D10671

Maniphest Tasks: T86416

Differential Revision: https://developer.blender.org/D10673
2021-03-10 17:03:38 +01:00
eb20250d2a Fix wrong white point of Linear ACES in config reading and the bundled config
The Blender/Cycles XYZ color space has a D65 white point instead of E, and
this was not correctly accounted for both in the OpenColor config reading code
and the bundled config.

This meant that since the OpenColorIO v2 upgrade, the Linear ACES color space
was not working correctly, and other OpenColorIO configs defining
aces_interchange were not interpreted correctly.
2021-03-10 16:56:27 +01:00
1e7b2d0bc6 Geometry Nodes: Add color to boolean implicit conversion
This conversion works the same way as a combination of the existing
color to float3 to boolean conversions, so the boolean result will be
false if the color is black, otherwise true, and the alpha is ignored.
2021-03-10 10:51:44 -05:00
7f07eff588 Cryptomatte tests: Fix layer_from_manifest failure.
Error in rBc6a831cfbc9b24fa8b1ed4852178c139e6ed79a6
2021-03-10 20:13:20 +05:30
576c392241 Nodes: Sortable Multi Input Sockets
This Patch removes the auto sorting from Multi-Input Sockets and allows
the links to be sorted by drag and drop instead.
As a minor related change, it fixes the drawing of the mute line to
connect to the first input instead of the socket's center.
2021-03-10 14:57:57 +01:00
5991c5c928 Cleanup: unused warning building as a Python module 2021-03-10 23:13:03 +11:00
Pratik Borhade
493628e541 Fix T67190: Edge Loop Select doesn't support non-manifold edges
- New Walker added `bmw_NonManifoldedgeWalker_type`.
- This walks over edges connected with 3 or more faces connected.

Ref D10497 with edits.
2021-03-10 23:04:37 +11:00
4fece16d45 Geometry Nodes: transfer polygon attributes to points in Point Distribute node 2021-03-10 12:41:50 +01:00
368647bd25 Geometry Nodes: move geometry component type enum to C
This allows us to use it in rna for the spreadsheet editor.
2021-03-10 11:53:31 +01:00
Siddhartha Jejurkar
122fefcc85 DNA: add defaults for UnifiedPaintSettings
Newly created scenes had unified paint settings zeroed. see T80164

Ref D10658
2021-03-10 21:45:12 +11:00
3dab6f8b7b Spreadsheet: new spreadsheet editor
This implements the MVP for the new spreadsheet editor (T85879). The functionality
is still very limited, but it proved to be useful already. A more complete picture
of where we want to go with the new editor can be found in T86279.

Supported features:
* Show point attributes of evaluated meshes (no original data, no other domains,
  no other geometry types, yet). Since only meshes are supported right now, the
  output of the Point Distribute is not shown, because it is a point cloud.
* Only show data for selected vertices when the mesh is in edit mode.
  Different parts of Blender keep track of selection state and original-indices with
  varying degrees of success. Therefore, when the selected-only filter is used, the
  result might be a bit confusing when using some modifiers or nodes. This will
  be improved in the future.
* All data is readonly. Since only evaluated data is displayed currently, it has to
  be readonly. However, this is not an inherent limitation of the spreadsheet editor.
  In the future editable data will be displayed as well.

Some boilerplate code for the new editor has been committed before in
rB9cb5f0a2282a7a84f7f8636b43a32bdc04b51cd5.

It would be good to let the spreadsheet editor mature for a couple of weeks as part
of the geometry nodes project. Then other modules are invited to show their own data
in the new editor!

Differential Revision: https://developer.blender.org/D10566
2021-03-10 11:35:42 +01:00
f247a14468 Geometry Nodes: handle same socket being linked to input more than once better
Note, this does not allow users to connect the same socket more than once to
a multi-input-socket in the UI. However, the situation could still happen when
using node muting.
2021-03-10 11:12:38 +01:00
70e73974b5 Cleanup: spelling 2021-03-10 15:47:50 +11:00
548e2e2f25 Cleanup: remove annotations from startup scripts
The current convention is not to use annotations for UI/startup scripts.
2021-03-10 15:36:23 +11:00
3e67e2a36e Cleanup: compiler warning (ignored-qualifiers) 2021-03-10 15:35:58 +11:00
53b82efed6 Fix (unreported) geometry node attribute search not working in the
Properties Editor

Since rBb279fef85d1a, the nodes properties for geometry nodes using a
texture are displayed in the Properties Editor.

rB85421c4fab02 added an attribute search button, but this was missing
still (gave just the regular text button) if this was displayed in the
Properties Editor.

ref b279fef85d / T86416 / D10671 / D10673

Maniphest Tasks: T86416

Differential Revision: https://developer.blender.org/D10674
2021-03-10 00:01:28 +01:00
90520026e9 Fix: only follow first input of multi-input-socket when muted
Otherwise muting a Join Geometry node has no effect, when there
are multiple Join Geometry nodes in a row.
2021-03-09 21:22:30 +01:00
7d827d0e9e Fix T86422: Expand crashing with EEVEE enabled
Using EEVEE (as well as some other actions like saving the file or
tweaking mesh parameters) can cause a PBVH rebuild. The different sculpt
tools can store PBVH nodes or other related data in their caches, so
this data becomes invalid if the PBVH rebuilds during evaluation. This
ensures that the PBVH does not rebuild while the cache of Expand is
being used, like it already happens for brushes and filters.

Reviewed By: JacquesLucke

Maniphest Tasks: T86422

Differential Revision: https://developer.blender.org/D10675
2021-03-09 21:21:08 +01:00
dcd7dacc4f Graph Editor: FCurve Show Extrapolation Toggle
Adds toggle to graph editor (View->Show Extrapolation). When disabled,
then fcurves only draw over the keyframe range. For baked fcurves and
ghost fcurves, the range is all sampled points.

It is intended for frequent use so anybody could assign hotkey or add
to quick favorites that's why GE-View is the best place for it.

Show Extrapolation is the default.

Reviewed By: sybren, Stan1, looch

Differential Revision: http://developer.blender.org/D10442
2021-03-09 15:09:09 -05:00
cfd7b4d1cd BLI: New 'BLI_array_iter_spiral_square'
No functional changes.

This function replaces some of the logic in
`DRW_select_buffer_find_nearest_to_point` that traverses a buffer in a
spiral way to search for a closer pixel (not the closest).

Differential Revision: https://developer.blender.org/D10548
2021-03-09 16:03:56 -03:00
80f7f1070f Geometry Nodes: Add Attribute interpolation for polygon domains
This commit adds interpolation to and from attribute on the polygon
domain. Interpolation is done automatically when a node uses attributes
on two different domains. The following are the new interpolations and
corresponding simple test cases:
- **Point to Polygon**: Painting the shade smooth attribute in weight
  paint mode
- **Polygon to Point**: Moving points along a normal based on the
  material index
- **Polygon to Corner**: Scaling a UV map with the material index
  before sampling a texture

{F9881516}

This is also necessary for an improved implementation of the `normal`
attribute.

Differential Revision: https://developer.blender.org/D10393
2021-03-09 13:39:05 -05:00
996586860b Cleanup: Do not pass stack allocated string to MEM_callocN 2021-03-09 13:31:51 -05:00
3f7b585a08 Fix crash in boundary brush after refactor
A missing continue in this loop.

Reviewed By: JacquesLucke

Differential Revision: https://developer.blender.org/D10610
2021-03-09 18:56:19 +01:00
e5c1e13ef0 Sculpt: Init Face Sets by Face Sets boundaries
This adds an extra option to the Face Sets Init operator to initialize
individual Face Sets based on the current Face Sets boundaries.
In particular, this is useful for splitting the patterns created by
Expand into individual Face Sets for further editing.

Reviewed By: JacquesLucke

Differential Revision: https://developer.blender.org/D10608
2021-03-09 18:55:20 +01:00
b1ef55abdb Cleanup: Document ensure()-like behaviour of KeyMaps.new()
Document the fact that `bpy.types.KeyMaps.new()` will not create a new
keymap but instead return an existing one, if one with the given
name/space/region already exists.

No functional changes.
2021-03-09 17:42:23 +01:00
8351e2d4b9 Cleanup: add missing full stop to docstring of function
No functional changes.
2021-03-09 17:42:23 +01:00
Corbin Dunn
4069016de8 macOS/Ghost: Simplify pasteboard and screen count code
Reviewed By: #platform_macos, sebbas, ankitm
Differential Revision: https://developer.blender.org/D10616
2021-03-09 21:38:47 +05:30
Corbin Dunn
9d046019e2 macOS/Ghost: Remove unnecessary nil checks.
Reviewed By: #platform_macos, sebbas, ankitm
Differential Revision: https://developer.blender.org/D10616
2021-03-09 21:38:44 +05:30
Corbin Dunn
cd1e6df534 macOS/Ghost: Replace NSAutoreleasePool with @autoreleasepool
- Automatic and guaranteed cleanup.
- Improves readability and reduces chances of errors by removing
`[pool drain]` statements.

Reviewed By: #platform_macos, sebbas, ankitm
Differential Revision: https://developer.blender.org/D10616
2021-03-09 21:38:41 +05:30
04e816bd11 Fix T86432: missing check if attribute is available
This failed when the component did exist, but did not contain any data.
2021-03-09 17:00:17 +01:00
c6a831cfbc Cleanup: use raw strings. 2021-03-09 16:50:47 +01:00
077beb738c Cleanup: use nullptr in cpp. 2021-03-09 16:34:43 +01:00
0700441578 Geometry Nodes: Expose "shade smooth" as an attribute
This patch exposes the "Shade Smooth" value as a boolean attribute.
This setting is exposed as a check-box in the mesh data properties,
but the value is actually stored for every face, allowing some faces
to be shaded smooth with a simple per-face control.

One bonus, this allows at least a workaround to the lack of control
of whether meshes created by nodes are shaded smooth or not: just use
an attribute fill node.

Differential Revision: https://developer.blender.org/D10538
2021-03-09 09:27:44 -05:00
Jeroen Bakker
eaada56591 Cleanup: add resource manager for cryptomatte session.
Auto frees cryptomatte session when it the pointer is collected from the
stack.

Reviewed By: Jacques Lucke

Differential Revision: https://developer.blender.org/D10667
2021-03-09 15:19:12 +01:00
cdb0b3cedc Compositor: Silence -Wself-assign
Use member initializer list for constructor.
Use `this->` for member function.
Introduced in rBef53859d24a9720882e3ca6c5415faefec6fb82c

Reviewed By: jbakker
Differential Revision: https://developer.blender.org/D10653
2021-03-09 19:19:21 +05:30
be6b3923f5 Compositor: silence clang/clang-tidy override warnings
`-Winconsistent-missing-override` and `modernize-use-override`.

Reviewed By: jbakker
Differential Revision: https://developer.blender.org/D10654
2021-03-09 19:19:08 +05:30
6114d909d6 Fix T86417: Crash deleting Shader AOV from an empty list
Missing NULL check in {rB2bae11d5c08a}.

Candidate for corrective release I guess.

Maniphest Tasks: T86417

Differential Revision: https://developer.blender.org/D10666
2021-03-09 14:45:38 +01:00
68ff213cd4 Cleanup: Correct area writing function name
This function writes areas, not regions. The old name read as if it was
regions.
2021-03-09 14:18:09 +01:00
7f9b6b1dc9 Sculpt: 'Unifiy' Dyntopo Detail Size operators
Prior to rB99a7c917eab7, Shift + D was used to set detail size for both
constant and relative detail (using radial control). The commit added an
improved operator for doing this for constant detail (showing the
triangle grid representation), but left the user without a shortcut to
do this for relative detail.

Interestingly rB99a7c917eab7 only changed this for the Blender keymap,
the Industy Compatible keymap still has the "old" entry.

This patch changes both keymaps to have both entries.

For user experience, the real change here is to have both available on
one 'primary' shortcut (Shift+D), the improved
'dyntopo_detail_size_edit' operator will now act on all possible cases.
If it deals with constant detail, it acts as before, if it deals with
relative detail etc, it will fallback to the "old" way of doing it via
radial control instead. I assume this adresses what was stated in
rB99a7c917eab7: "Deciding if both detail sizes can be unified needs a
separate discussion"

Also, move dyntopo_detail_size_edit to sculpt_detail.c

Fixes T83828

Maniphest Tasks: T83828

Differential Revision: https://developer.blender.org/D9871
2021-03-09 13:55:37 +01:00
2283b6ef69 Fix the session UUID being set for temporary blend file data
Triggered by temporarily appending library linked data from Python.
2021-03-09 23:47:43 +11:00
07a9d39f57 Fix: unconnected multi socket input crashes
The crash would only happen when the output of the Join Geometry node is used.
2021-03-09 09:45:18 +01:00
dc3e9048ae Cleanup: fix warnings 2021-03-09 09:31:14 +01:00
745576b16e UI: Clean up sub-panel for new boolean modifier options
A few changes to make this consistent with other modifier panels:
 - Title case for UI labels
 - Use property split (and therefore decorators)
 - Declare sublayout variables after getting modifier info
2021-03-08 22:22:16 -05:00
d25ab68cf4 Cleanup: Complete earlier geometry component refactor
This was meant to be part of rB9ce950daabbf, but the change dropped from
the set at some point in the process of updating and committing.
Sorry for the noise.
2021-03-08 16:31:51 -05:00
8df968d69f "Show Texture in texture tab" button: full support for Sculpt / Paint
In {rBb279fef85d1a} the button that displays a texture in a Properties
Editor texture tab was added for geometry nodes.
Same commit will actually show them for Brush textures as well (but
disabled -- because the Texture users dont match).
This task is for finanlizing proper support for Brush textures as well.
There was originally a separate patch for this (see {D9813}) but most of
it was already implemented by above commit.

**what this solves**
from the default startup file:
- go to any sculpt or paint mode and add a texture to your brush
- observe the button to edit this texture in the Properties editor is
greyed out

{F9860470}

There are two possible solutions:
- [1] call the texture template for the brush `texture_slot` texture
(instead of the brush 'texture') from the python UI code, this is then
working in harmony how ButsTextureUser works for brushes
- [2] tweak the way `ButsTextureUser` works (dont rely on
`RNA_BrushTextureSlot` there)

This patch implements the first solution.
Since `brush.texture_slot` is `br->mtex` RNA wrapped and `brush.texture`
is `br->mtex.tex` RNA wrapped, this really comes down to doing the same
thing. I checked that creating a new texture and unlinking/deleting will
have the same results even though they take slightly different code
paths: assignment and NULLing the pointers are working on the same (see
above) and RNA update callbacks also do the same [even though in
different functions]:
- brush.texture will do rna_Brush_main_tex_update
- brush.texture_slot.texture will do rna_TextureSlotTexture_update /
rna_TextureSlot_update
(only difference here is an additional DEG relations update in the case
of texture_slot which should not do harm)

Differential Revision: https://developer.blender.org/D10626
2021-03-08 19:38:35 +01:00
2e19509e60 Geometry Nodes: Rename subdivision nodes
This makes the following changes to the name of the two
geometry nodes subvision nodes:
 - `Subdivision Surface` -> `Subdivide Smooth`
 - `Subdivision Surface Simple` -> `Subdivide`
Most of the benefit is that the names are shorter, but it also better
mirrors the naming of operations in edit mode, and phrases the names
more like actions. This was discussed with the geometry nodes team.
2021-03-08 13:37:49 -05:00
Mark Stead
a45af290f3 Fix T86357: EEVEE: Shadows: Casters have exponential performance degradation with many objects
When you have many distinct objects, in an Eevee render then the shadow caster gets exponentially slower as the number of (distinct) objects increase.

This is because of the way that frontbuffer->bbox (EEVEE_BoundBox array) and the associated frontbuffer->update bitmap are resized.
Currently the resizing is done by reserving space for SH_CASTER_ALLOC_CHUNK (32) objects at a time.
When the number of objects is large, then the MEM_reallocN() gets progressively slower because it must memcpy the entire bbox/bitmap data to the new memory chunk.
And there will be a lot of *memcpy* operations for a large scene.
(Obviously there are a significant number of memory allocations/deallocations too - though this would be linear performance.)

I've switched to doubling the frontbuffer->alloc_count (buffer capacity) instead of adding SH_CASTER_ALLOC_CHUNK (32).  As I understand this is the only way to eliminate exponential slowdown.  Just increasing the size of SH_CASTER_ALLOC_CHUNK would still result in exponential slowdown eventually.

In other changes, the "+ 1" in this expression is not necessary.
if (id + 1 >= frontbuffer->alloc_count)
The buffer is 0-based.  So when the buffer is initially allocated then id values from bbox[0] to bbox[31] are valid.  Hence when frontbuffer->count == frontbuffer->alloc_count, is when the resizing should be triggered.
As it stands the "+ 1" results in resizing the buffer, when there is still capacity for one more object in the buffer.

I've changed the initial buffer allocation to use MEM_mallocN() instead of MEM_callocN().  The difference is that malloc() doesn't memset buffer (with zeros) when allocated.  I've checked the code where new bbox records are created, and it does not rely on the buffer being initialised with zeros.
Anyway, isn't calloc() safer than using malloc()?  Well no, it's actually the opposite in this case.  Every time the buffer size is increased, it is done using realloc(), and this does not zero-out the uniniitialised portion of the buffer.  So the code would break if it was modified to assume that the buffer contains zeros.  Hence I believe initialising the buffer using calloc() could be misleading to a new developer.

Won't this result in increased memory usage?  Yes, if you have millions of objects in your scene, then you are potentially using up-to twice the memory for the shadow caster.  (However if you have millions of objects in your scene you're probably finding the Eevee render times a slow.)
Note that once the render gets going the frontbuffer bbox/bitmap will be shrunk to a multiple of SH_CASTER_ALLOC_CHUNK (32), therefore releasing the overallocation of memory.
As observed in Visual Studio - this appears to be prior to peak memory usage anyway.
Note this shrinking is executed in EEVEE_shadows_update() - during the first render sample pass.  If necessary you could consider shrinking the buffer immediately after the EEVEE_shadows_caster_register() has done it's work.  (Note however it appears you would need to add that function call is multiple places.)
Anyway as per the bug report I raised, I observed a 5% increase in peak-memory.  And I'm unclear whether this difference in memory is due to me running the debug build.  (It could be that there is no difference because of the shrinking.)

I couldn't figure out how the shadow caster backbuffer works.  I see that EEVEE_shadows_init() has an explicit command to swap the front/back buffers.  However this is done only when the buffers are first initialised and there is nothing in there yet.  In my testing, the backbuffer->count was always zero, EEVEE_shadows_update() never did anything with the backbuffer.

Finally this problem is most evident when using Geometry Nodes or a Particle System to instantiate many objects.  Objects created through say the array modifier do not cause any issues because it is considered one object by the shadow caster.

Reviewed By: #eevee_viewport, fclem

Differential Revision: https://developer.blender.org/D10631
2021-03-08 18:51:48 +01:00
84a4f2ae68 Geometry Nodes: Improve performance of point distribute node
This commit refactors the point distribute node to skip realizing
the instances created by the point instance node or the collection
and object info nodes. Realizing instances is not necessary here
because it copies all the mesh data and and interpolates all
attributes from the instances when this operation does not
need to modify the input geometry at all.

In the tree leaves test file this patch improves the performance of
the node by about 14%. That's not very much, the gain is likely larger
for more complicated input instances with more attributes (especially
attributes on different domains, where interpolation would be necessary
to join all of the instances). Another possible performance improvement
would be to parallelize the code in this node where possible.

The point distribution code unfortunately gets quite a bit more
complicated because it has to handle the complexity of having many
inputs instead of just one.

Note that this commit changes the randomness of the distribution
in some cases, as if the seed input had changed.

Differential Revision: https://developer.blender.org/D10596
2021-03-08 12:45:06 -05:00
fc0de69471 Cleanup: Split up new files for Outliner ID tree-elements
Splits up `tree_element_id.cc`/`tree_element_id.hh`.
If we move all ID types into this one file, it will become rather big. Smaller
files are probably easier to work with. We could still keep small classes like
`TreeElementIDLibrary` in the general file, don't mind really, but this creates
separate files for that too.
2021-03-08 18:38:23 +01:00
f0ad78e17c Cleanup: Rename recently added Outliner files to exclude "_base" suffix
These files can contain more than just the "base" tree element types. E.g. the
class for the view-layer base element can also contain the class for the
view-layer elements. Otherwise we'd end up with like >50 files for the
individual types, most of them very small.
So just give the files a general name and put the related classes in there.
2021-03-08 18:38:23 +01:00
4292bb060d Outliner: Port scene elements and some related types to new tree-element code design
Continuation of work in 2e221de4ce, 249e4df110 and 3a907e7425.

Adds new tree-element classes for the scene-ID, scene collections, scene
objects, and the view layers base.
There is some more temporary stuff in here, which can be removed once we're
further along with the porting. Noted that in comments.
2021-03-08 18:38:23 +01:00
8771f015f5 Python version of make_source_archive.sh
This is a Python version of the existing `make_source_archive.sh`
script. IMO it's easier to read, and it'll also be easier to extend with
the necessary functionality for D10598.

The number of lines of code is larger than `make_source_archive.sh`, but
it has considerably less invocations of `awk` ;-) And also the filtering
is integrated, instead of forking out to Python to prevent certain files
to be included in the tarball.

Reviewed By: dfelinto, campbellbarton

Differential Revision: https://developer.blender.org/D10629
2021-03-08 18:10:26 +01:00
9ce950daab Cleanup: Move geometry component implementations to separate files
Currently the implementations specific to each geometry type are in
the same file. This makes it difficult to tell which code is generic
for all component types and which is specific to a certain type.
The two files, `attribute_access.cc`, and `geometry_set.cc` are
also getting quite long.

This commit splits up the implementation for every geometry component,
and adds an internal header file for the common parts of the attribute
access code. This was discussed with Jacques Lucke.
2021-03-08 11:41:23 -05:00
bf799cb12c Fix T81741 EEVEE: Ambient Occlusion does not converge properly
This was due to the AO random sampling using the same "seed" as
the AA jitter. Decorelating the noise fixes the issue.
2021-03-08 17:25:38 +01:00
30cb4326fe EEVEE: Ambient Occlusion: Add sample parameter support for the AO node
The actual sample count is rounded up to a multiple of 4 because we
sample 4 horizons directions.

Changing this setting forces the shader to recompile (because using a
GPU_constant).
2021-03-08 17:25:38 +01:00
1540f1df07 EEVEE: RenderPass: Improve AO pass if screen space radius is small
This just bypass the occlusion computation if there is no occlusion
data. This avoids weird looking occlusion due to the screen space
geometric normal reconstruction.
2021-03-08 17:25:38 +01:00
0983e66e03 EEVEE: Occlusion: Use ScreenSpaceRay for iteration
The sampling is now optimum with every samples being at least one pixel
appart. Also use a squared repartition to improve the sampling near the
center.

This also removes the thickness heuristic since it seems to remove
a lot of details and bias the AO too much.
2021-03-08 17:25:38 +01:00
5db5966cdb EEVEE: Sampling: Split hemisphere sampling just like GGX
This is useful for debugging raycasting.
2021-03-08 17:25:16 +01:00
6842c549bb EEVEE: SSRayTrace: Cleanup/Refactor
This is a major rewrite that improves the screen space raytracing
a little bit.

This also decouple ray preparation from raytracing to be reuse in other
part of the code.

This changes a few things:
- Reflections have lower grazing angle failure
- Reflections have less self intersection issues
- Contact shadows are now fully opaque (faster)

Unrelated but some self intersection / incorrect bad rays are caused by
the ray reconstruction technique used by the SSR. This is not fixed by
this commit but I added a TODO.
2021-03-08 17:25:16 +01:00
ba75ea8012 EEVEE: Use Fullscreen maxZBuffer instead of halfres
This removes the need for per mipmap scalling factor and trilinear interpolation
issues. We pad the texture so that all mipmaps have pixels in the next mip.

This simplifies the downsampling shader too.

This also change the SSR radiance buffer as well in the same fashion.
2021-03-08 17:25:16 +01:00
6afe2d373a Fix ID preview not updating in Asset Browser
Fix ID preview not updating in Asset Browser, by actually sending an
explicit `NA_EDITED` along with the `NC_ASSET` notifier.
2021-03-08 17:20:23 +01:00
a6a8ca9212 Fix T86063: support 'Relative Path' setting opening (alembic) caches
This was reported as opening alembic caches ignoring the
'use_relative_paths' preference, but this operator just did not have
this setting. Fortunately, adding this is just a simple switch.

Maniphest Tasks: T86063

Differential Revision: https://developer.blender.org/D10568
2021-03-08 17:01:03 +01:00
1aa59464b6 Cleanup: Move LibOverride debug prints to CLOG. 2021-03-08 16:53:16 +01:00
9cb5f0a228 Spreadsheet: add boilerplate code for new editor type
This adds the initial boilerplate code that is required to introduce
the new spreadsheet editor. The editor is still hidden from the ui.

It can be made visible by undoing the change in `rna_screen.c`.

This patch does not contain any business logic for the spreadsheet editor.

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

Ref T86279.
2021-03-08 16:25:08 +01:00
d230c9b96c Alembic: avoid red overwrite warning when opening a file
Pass `FILE_OPENFILE` instead of `FILE_SAVE` when selecting a file for
reading.
2021-03-08 15:49:16 +01:00
5a67407d5a File Browser: scroll selected files into view
Add operator `FILE_OT_view_selected` to the file browser (and thus also
to the asset browser) that scrolls selected files into view.

This includes the active file, even though it is not selected. In
certain cases the active file can loose its selected state (clicking
next to it, or refreshing the asset browser), but then it's still shown
in the right-hand sidebar. Because of this, I found it important to take
it into account when scrolling.

This also includes a change to the keymaps:
- Blender default: {key NUMPAD_PERIOD} is removed from the "reload"
  operator, and assigned to the new "view selected files" operator. The
  reload operator was already doubly bound, and now {key R} is the only
  remaining hotkey for it.
- Industry compatible: {key F} is assigned to the new "view selected
  files" operator. This is consistent with the other "view selected"
  operators in other editors.

Reviewed By: Severin

Differential Revision: https://developer.blender.org/D10583
2021-03-08 15:21:34 +01:00
e20b31504a Fix T86347: Add Primitive Tool fails for 1x1x1 scale
The Tool stores desired dimensions as `scale` and thus had to half the
scale again in `make_prim_init()` because by default all primitives are
created at a size of 2 in blender.

This worked, but:
- [1] it logged something like size=2, scale=2,2,2 for a 2x2x2 cube
[which does not sound right, it should be size=2 scale=1,1,1]
- [2] it had to make an exception for the case scale is exactly 1x1x1
[this happens when the property is not set specifically, e.g. adding
primitives from the menu]
-- this exception led to double sized primitives being created when the
tool asked for exact dimensions of 1x1x1

Now - instead of compensating in `make_prim_init()` - do this earlier in
the tool itself, see `view3d_interactive_add_modal`, this fixes the bug
and now also correctly logs size=2 scale 0.5,0.5,0.5 for a 1x1x1 cube.

Maniphest Tasks: T86347

Differential Revision: https://developer.blender.org/D10632
2021-03-08 15:18:16 +01:00
91825ebfe2 UI: UVProject modifier: clarify aspect & scale are only for camera
projectors

Make this clear in property UI descriptions and deactivate aspect &
scale fields if no camera projectors are present.

ref T86268

Maniphest Tasks: T86268

Differential Revision: https://developer.blender.org/D10634
2021-03-08 15:09:17 +01:00
9e09214979 PyAPI: add bpy.types.BlendFile.temp_data for temporary library loading
This adds support for creating a `BlendFile` (internally called `Main`),
which is limited to a context.

Temporary data can now be created which can then use
`.libraries.load()` the same as with `bpy.data`.

To prevent errors caused by mixing the temporary ID's with data in
`bpy.data` they are tagged as temporary so they can't be assigned
to properties, however they can be passed as arguments to functions.

Reviewed By: mont29, sybren

Ref D10612
2021-03-09 01:01:31 +11:00
cfd11af981 readfile: add id_tag_extra argument
This allows adding ID tags when linking/loading data.

This is needed to implement loading non 'G.main' ID data-blocks,
see D10612.
2021-03-09 00:55:55 +11:00
09a8f5ebca Fix T86384: Click detection fails in some cases with modifiers
Regression in b5d154f400
2021-03-09 00:44:46 +11:00
Germano Cavalcante
b6c07d69e2 Fix T86106: bpy.types.SpaceView3D.draw_handler_remove(...) causes Blender to crash
The handle of a drawing callback can be removed within the drawing function itself.

This causes `var = (type)(((Link *)(var))->next` to read an invalid memory value in C.
2021-03-08 10:38:11 -03:00
171ba42439 Fix error in unused argument cleanup
Bad keyword argument rename from
9dc0c44aa1
2021-03-09 00:25:46 +11:00
3669a3e2e9 Fix Cycles CUDA build error with Visual Studio 2019 v16.9
Something in this update broke the floor() function in CUDA, instead use
floorf() like we do everywhere else in the kernel code. Thanks to Ray
Molenkamp for identifying the solution.
2021-03-08 14:06:16 +01:00
240e721dd3 Fix T86210: No preview icons for non-8bit images
It looks like we never generated correct icon previews for images with
float_rects (non-8bit-images). Images from the report were 16bit pngs.

In this case, `icon_preview_startjob` would return early (it only
checked if the ImBuf `rect` was NULL -- which is the case if it has a
`rect_float` instead). This is not neccessary since `icon_copy_rect` is
perfectly capable of taking float rects.

Now correct the check and only return early if both `rect` & `rect_float`
are NULL.

note: this will not refresh icon previews from existing files
automatically. For this, use File > Data Previews > Clear Data-Block
Previews.

Maniphest Tasks: T86210

Differential Revision: https://developer.blender.org/D10601
2021-03-08 13:51:56 +01:00
9ba1ff1c63 Fix T86373: crash picking colors in geometry nodesockets
Caused by {rB85421c4fab02}.

Above commit treated `SOCK_RGBA` and `SOCK_STRING` the same in
`std_node_socket_draw`.
That would turn a RGBA button into a text button (for attribute search),
leading to trouble.
Note these were just treated the same prior to above commit because both
were doing the layout split.

Now just give RGBA sockets their own case.

Maniphest Tasks: T86373

Differential Revision: https://developer.blender.org/D10646
2021-03-08 13:47:39 +01:00
1775ea74c1 Cleanup: Change extension .cpp to .cc 2021-03-08 13:41:52 +01:00
b9cd2f4531 Revert "Fix modernize-raw-string-literal complaints from clang-tidy."
This reverts commit 7a34bd7c28.

Broke windows build. Can apparently fix with /Zc:preprocessor flag
for windows but need a Windows dev to make that fix.
2021-03-08 06:45:45 -05:00
e9e53ff3a6 Cleanup: Removed duplicate slash in macOS SDK path
Cleanup although it's harmless.
2021-03-08 11:55:35 +01:00
Leon Leno
e12ad2bce0 Geometry Nodes: support Vector Rotate node
Differential Revision: https://developer.blender.org/D10410
2021-03-08 11:37:37 +01:00
2b9eea17cc Particles: change default name to "ParticleSystem"
Since {rB7a6b46aac56b}, particle systems were named "ParticleSettings"
by default, same as particle settings themselves. These are not the same
thing and their names should reflect that.

Issue came up in T86366.

Now name them "ParticleSystem" by default, name uniqueness is preserved
for both system and settings.

Maniphest Tasks: T86366

Differential Revision: https://developer.blender.org/D10641
2021-03-08 10:47:27 +01:00
74c50d0c77 Cleanup: Remove unused variable. 2021-03-08 08:52:43 +01:00
cbf033c055 Fix T86026: Crash Opening Cryptomatte File.
But this time the root cause. Writing undo files is done in a separate
thread. This patch moved the updating of the matte_id when the user
actually changes the matte.
2021-03-08 08:47:22 +01:00
89757f918c Revert "Fix T86026: Crash Opening Cryptomatte File."
This reverts commit 7f36498740.
2021-03-08 08:28:31 +01:00
a1bc7729f2 Cleanup: use ofs instead of offs as an abbreviation for offset
Used for local structs/variables,
since `ofs` is by far the most widely used abbreviation.
2021-03-08 14:54:23 +11:00
b4f5128b21 Cleanup: rename offs to offset 2021-03-08 14:44:57 +11:00
242a278b56 Cleanup: rename offs to offscreen 2021-03-08 14:40:57 +11:00
c950e08cbb Cleanup: add use prefix for boolean 2021-03-08 14:39:28 +11:00
1ba15f1f7f Speedup for usual non-manifold exact boolean case.
The commit rB6f63417b500d that made exact boolean work on meshes
with holes (like Suzanne) unfortunately dramatically slowed things
down on other non-manifold meshes that don't have holes and didn't
need the per-triangle insideness test.
This adds a hole_tolerant parameter, false by default, that the user
can enable to get good results on non-manifold meshes with holes.
Using false for this parameter speeds up the time from 90 seconds
to 10 seconds on an example with 1.2M triangles.
2021-03-07 18:13:19 -05:00
7a34bd7c28 Fix modernize-raw-string-literal complaints from clang-tidy. 2021-03-07 17:03:24 -05:00
239a7d93ae Cleanup: fix compiler warning 2021-03-07 18:05:25 +01:00
74979459cb Geometry Nodes: simplify allocating dynamically sized buffer on stack 2021-03-07 17:53:05 +01:00
9c8382e618 Cleanup: do not pass class member to class methods 2021-03-07 17:22:00 +01:00
00f218602d Alembic procedural: fix missing update when only the transforms change
The missing update has two sources:

The TimeSampling used for looking up transformations in the cache was
uninitialized. To fix this, simply use the TimeSampling from the last
transformation in the hierarchy (that is the object's parent), which
should also contain the time information for all of its parents.

The objects are not tagged for update when their trasformations change.
2021-03-07 17:16:16 +01:00
ac4d45dbf1 Alembic procedural: fix infinite update loop when modifying Object level properties 2021-03-07 17:16:16 +01:00
111a77e818 Cleanup: remove dead code 2021-03-07 17:03:20 +01:00
a9fc9ce0ae Cleanup: remove dead code 2021-03-07 16:08:59 +01:00
b30f89918e Fix T85632 Improve Exact boolean in cell fracture of Suzanne.
The Exact boolean used in the cell fracture addon incorrectly
kept some outside faces: due to some raycasts going into open
eye socket then out of the head, leading to one ray direction
(out of 8) saying the face was inside the head. The current
code allowed 1 of 8 rays only as "inside" to accommodate the
case of a plane used in boolean to bisect. But this cell fracture
case needs more confidence of being inside. So changed the
test for intersection to require at least 3 of 8 rays to be inside.

Maybe the number of rays to indicate insideness should be exposed
as an option, to allow user tuning according to the degree of
"non-volumeness" of the arguments, but will try at least for now
to magically guess the right value of the rays-inside threshold.

Note: all of this only for the case where the arguments are not
all PWN (approx: manifold). The all-PWN case doesn't use raycast.
2021-03-07 08:55:11 -05:00
e72dc1e6c6 Cleanup: compiler warnings 2021-03-07 14:46:48 +01:00
c14770370f Cleanup: fix implicit conversion warning 2021-03-07 14:27:08 +01:00
649916f098 BLI: make it harder to forget to destruct a value
Instead of returning a raw pointer, `LinearAllocator.construct(...)` now returns
a `destruct_ptr`, which is similar to `unique_ptr`, but does not deallocate
the memory and only calls the destructor instead.
2021-03-07 14:24:52 +01:00
456d3cc85e BLI: reduce wasted memory in linear allocator
The main change is that large allocations are done separately now.
Also, buffers that small allocations are packed into, have a maximum
size now. Using larger buffers does not really provider performance
benefits, but increases wasted memory.
2021-03-07 14:15:20 +01:00
84da76a96c Cleanup: use POINTER_OFFSET macro 2021-03-07 19:27:11 +11:00
8618c4159c Cleanup: use class instead of struct in forward declaration 2021-03-06 17:54:28 +01:00
9828882b8e Cleanup: clang tidy 2021-03-06 16:54:09 +01:00
d2869943d2 Nodes: refactor derived node tree
This is a complete rewrite of the derived node tree data structure.
It is a much thinner abstraction about `NodeTreeRef` than before.
This gives the user of the derived node tree more control and allows
for greater introspection capabilities (e.g. before muted nodes were
completely abstracted away; this was convenient, but came with
limitations).

Another nice benefit of the new structure is that it is much cheaper
to build, because it does not inline all nodes and sockets in nested
node groups.

Differential Revision: https://developer.blender.org/D10620
2021-03-06 16:51:06 +01:00
cfd766cebd Fix T86308 Crash in Exact Boolean when have custom normal layer.
Custom Normal layers can't be interpolated, so needed a check
for non-interpolatable layers before trying to interpolate.
2021-03-06 09:05:55 -05:00
11efc9087b Cleanup: remove workaround for Python 3.7x crashing with libedit
This removes workaround for T43491. It's no longer needed as
Python 3.9x supports libedit as an alternative to readline
on all platforms.
2021-03-06 19:31:49 +11:00
995bb0860a Cleanup: remove redundant draw callback 2021-03-06 19:26:18 +11:00
37793b90be Cleanup: unused imports 2021-03-06 19:26:18 +11:00
9dc0c44aa1 Cleanup: unused arguments 2021-03-06 19:26:18 +11:00
bd79691599 Cleanup: unused variables 2021-03-06 19:00:18 +11:00
753f1cf0ad Cleanup: redundant pose bone assignment 2021-03-06 18:33:54 +11:00
b22b037229 Cleanup: rename wm_get_cursor_position
Match naming of other wm_cursor_position_* functions.
2021-03-06 18:33:54 +11:00
3bc406274b Cleanup: comments 2021-03-06 18:33:54 +11:00
f117ea2624 Geometry Nodes: Expose vertex normals as an attribute
This attribute exposes mesh vertex normals as a `vertex_normal`
attribute for use with nodes. Since the normal vector stored in
vertices is only a cache of data computable from the surrounding faces,
the attribute is read-only. A proper error message for attempting to
write this attribute is part of T85749. A write-only normal attribute
will likely come later, most likely called `corner_normal`.

The normals are recomputed before reading if they are marked dirty.
This involves const write-access to the mesh, protected by the mutex
stored in `Mesh_Runtime`. This is essential for correct behavior after
nodes like "Edge Split" or nodes that adjust the position attribute.

Ref T84297, T85880, T86206

Differential Revision: https://developer.blender.org/D10541
2021-03-05 15:16:25 -06:00
becc36cce5 Geometry Nodes: Sort attribute search items when menu opens
Because the search didn't run when the menu first opens, the attributes
appeared in a different order than after you typed anything into the
search field. This commit instead runs the search when the menu
is first opened, but it only sorts items without filtering.
2021-03-05 14:45:09 -06:00
4addcf1efc Cleanup: Remove redundant special handling after previous commit
Not needed anymore since 3a907e7425.
2021-03-05 18:14:56 +01:00
3a907e7425 Outliner: Barebones to port IDs to new Outliner tree-element code design
Continuation of work in 2e221de4ce and 249e4df110 .
This prepares things so we can start porting the individual ID types to
the new code design. I already added some code for library IDs, because
they need some special handling during construction, which I didn't want
to break.

The `AbstractTreeElement::isExpandValid()` check can be removed once
types were ported and can be assumed to have a proper `expand()`
implemenation.

Also makes `TreeElementGPencilLayer` `final` which I forgot in
e0442a955b.
2021-03-05 18:07:35 +01:00
ae005393dc Fix incorrect assert in Outliner ID deletion
Mistake in aa3a4973a3. The expanded `ELEM()` check would include
`0 && te->idcode != 0`, which always evaluates to `false`/`0`. That
wouldn't cause the asset to fail, but the `te->idcode` part would never
be checked.

Fixed the error and cleaned up the check against "0" with a check
against `TSE_SOME_ID`, see b9e54566e3.
2021-03-05 17:46:49 +01:00
b9e54566e3 Cleanup: Add & use enum value for ID Outliner element type
Code to check if the Outliner tree-element type was the general ID one
would always check against "0" (explicity or even implicitly). For
somebody unfamiliar with the code this is very confusing. Instead the
value should be given a name, e.g. through an enum.

Adds `TSE_SOME_ID` as the "default" ID tree-element type. Other types
may still represent IDs, as I explained in a comment at the definition.

There may also still be cases where the type is checked against "0". I
noted in the comment that such cases should be cleaned up if found.
2021-03-05 17:46:33 +01:00
ed84161529 Cleanup: Rename func occurences to _fn
Use _fn as a suffix for callbacks.
2021-03-05 17:35:35 +01:00
f882bee431 Fix crash with pinned geometry node tree with no active object
The check for a null active object was after trying to retrieve the active
modifier from the object.
2021-03-05 10:13:42 -06:00
d5c727c6ea Fix windows compilation. 2021-03-05 16:08:11 +01:00
ffd5b0d91e Cleanup: Use blender::Vector. 2021-03-05 16:56:14 +01:00
0729376a13 Fix: compilation OpenCL kernels Compositor.
introduced during cleanup.
2021-03-05 16:56:14 +01:00
d4c673d4c6 Cleanup: use blender::Vector. 2021-03-05 16:56:14 +01:00
7c8ec99b9a Cleanup: use blender::Vector. 2021-03-05 16:56:14 +01:00
7bccbce512 Cleanup: use snake case. 2021-03-05 16:56:14 +01:00
921138cf5f Cleanup: rename private attribtue m_max_read_buffer_offset. 2021-03-05 16:56:14 +01:00
87842d6388 Cleanup: Use blender::Vector in ExecutionGroup. 2021-03-05 16:56:14 +01:00
fde150fee4 Cleanup: Use std::Vector for chunk execution status. 2021-03-05 16:56:14 +01:00
e1d9b095e4 Cleanup: Use enum class for eChunkExecutionState. 2021-03-05 16:56:14 +01:00
3d4a844a50 Cleanup: ExecutionSystem::find_output_execution_groups. 2021-03-05 16:56:14 +01:00
8b2fb7aeed Cleanup: Remove unused method. 2021-03-05 16:56:14 +01:00
6ebd34c802 Cleanup: Make WorkPackage a struct 2021-03-05 16:56:14 +01:00
ba5961b4cd Cleanup: use MIN2/MAX2 in compositor. 2021-03-05 16:56:14 +01:00
3d3a5bb892 Cleanup: Remove using statements. 2021-03-05 16:56:14 +01:00
bf030decd4 Animation: add function to apply a pose from an Action
Add `BKE_pose_apply_action(object, action, anim_eval_context)` function
and expose in RNA as `Pose.apply_action(action, evaluation_time)`.

This makes it possible to do the following:

- Have a rig in pose mode.
- Select a subset of the bones.
- Have some Action loaded that contains the pose you want to apply.
- Run `C.object.pose.apply_pose_from_action(D.actions['PoseName'])`
- The selected bones are now posed as determined by the Action.

Just like Blender's current pose library, having no bones selected acts
the same as having all bones selected.

Manifest Task: T86159

Reviewed By: Severin

Differential Revision: https://developer.blender.org/D10578
2021-03-05 16:35:08 +01:00
8d0fbcd6df Nodes: move vector rotate node to C++
This makes it easier to add an implementation that can
be used in Geometry Nodes.

There should be no functional changes.
2021-03-05 16:09:19 +01:00
fe35551df2 Asset Browser Space API: add activate_asset_by_id() function
Add an RNA function `activate_asset_by_id(asset_id: ID, deferred: bool)`
to the File Browser space type, which intended to be used to activate an
asset's entry as identified by its `ID *`. Calling it changes the active
asset, but only if the given ID can actually be found.

The activation can be deferred (by passing `deferred=True`) until the
next refresh operation has finished. This is necessary when an asset has
just been added, as it will be loaded by the filebrowser in a background
job.

Reviewed By: Severin

Differential Revision: https://developer.blender.org/D10549
2021-03-05 15:11:40 +01:00
0dd9a4a576 Cleanup: Libmv, clang-format
Is based on Google style which was used in the Libmv project before,
but is now consistently applied for the sources of the library itself
and to C-API. With some time C-API will likely be removed, and it
makes it easier to make it follow Libmv style, hence the diversion
from Blender's style.

There are quite some exceptions (clang-format off) in the code around
Eigen matrix initialization. It is rather annoying, and there could be
some neat way to make initialization readable without such exception.

Could be some places where loss of readability in matrix initialization
got lost as the change is quite big. If this has happened it is easier
to address readability once actually working on the code.

This change allowed to spot some missing header guards, so that's nice.

Doing it in bundled version, as the upstream library needs to have some
of the recent development ported over from bundle to upstream.

There should be no functional changes.
2021-03-05 15:05:08 +01:00
e0442a955b UI Code Quality: Port Outliner Grease Pencil layers to new design
Continuation of work in 2e221de4ce and 249e4df110. Now the tree-element
types have to be ported one by one. This is probably the most straight forward
type to port.
2021-03-05 14:45:46 +01:00
a592f7e6cb Cleanup: COM_convert_data_types parameters. 2021-03-05 13:46:25 +01:00
b12be5a872 Cleanup: Remove static struct without data. 2021-03-05 13:46:25 +01:00
f3fb1df192 Fix T86293: crash undoing after executing the python console in certain
scenarios

In general, I could not find a reason executing from the python console
should not do an Undo push. Running a script from the Text Editor does
this as well and this seems generally useful.

Without an Undo push, one can easily run into situations were IDs have
been added or removed and undo on would then cause trouble (e.g. first
selection then bpy.ops.object.duplicate() -- this crashed as reported in
T86293 -- duplicate does not get its own undo push because it is not the
last op in the list, wm->op_undo_depth is not zero). This has changed
with the Undo refactor, so in essence the root cause is the same as
T77557, Legacy Undo does not suffer from the crash (but misses
the generally useful undo push from the console still)

Now add Undo to CONSOLE_OT_execute bl_options ('UNDO_GROUPED' seems more
appropriate than plain 'UNDO' since pasting multiple lines of code will
call CONSOLE_OT_execute multiple times in a row).

Maniphest Tasks: T86293

Differential Revision: https://developer.blender.org/D10625
2021-03-05 12:50:55 +01:00
5668901ced Cleanup: remove redundant NULL window checks handling events 2021-03-05 21:30:16 +11:00
6bc01222c6 Cleanup: Sync header+implementaiton definition.
Gave warning on Windows platform. There are more of these cases.
2021-03-05 09:48:49 +01:00
99e1866712 Cleanup: Use boolean in WM_cursor_wait 2021-03-05 10:36:57 +01:00
b5d154f400 Cleanup: move check_drag & check_click out of wmEvent
These variables track the wmWindow.event_queue state,
however they were used in a way that wasn't correct.

- check_drag & check_click from wmWindow.eventstate
  were used to track the click/drag status of events handled in
  wmWindow.event_queue.
- Event's in the queue read from wmEvent.check_drag.
- Once a drag action was detected, wmWindow.eventstate.check_drag
  was disabled.

Disabling drag in the event state would not change the drag state
for values already in the event queue.

Simplify logic by moving these values into the window,
so there is one place these variables are tracked.
2021-03-05 17:10:11 +11:00
663b0bb04c UI: minor changes to preset sorting
- Only sort by the preset name (not it's directory).
- Remove redundant string conversion.
- Only call lower() once on the input.
- Don't assign the lambda to a variable for single use.
2021-03-05 17:10:11 +11:00
511ff8b6b4 UI: Add Presets for high framerate video
It is quite common to high framerate video with modern cameras. To make
it easier to edit this footage new framerate presets are added and the
soft limit increased.

Note there is a bug with preset ordering, Blender thinks "120" goes
before "24" this bug needs to be fixed before these changes can be
merged.

Differential Revision: https://developer.blender.org/D10553
2021-03-04 23:22:47 -05:00
c2a8676544 Presets: Improve sort order of presets
Pythons sort function does not sort naturally,
to solve this a custom sort key is used.

This issue is apparent when trying D10553
2021-03-04 23:22:47 -05:00
78bd155f5c Cleanup: disambiguate 'queue' struct members
The term queue isn't very descruptive on it's own, use:

- wmWindow.event_queue
- wmWindowManager.notifier_queue
2021-03-05 14:59:38 +11:00
c2e73a1225 UI: save-preview tip now states that it's used for blend thumbnails 2021-03-05 14:44:39 +11:00
23dfcc5ac7 Cleanup: rename event to event_type
Reserve `event` for wmEvent.
2021-03-05 14:44:28 +11:00
aa86710242 Cleanup: spelling 2021-03-05 14:44:28 +11:00
b9833860e5 Cleanup: maintain include order without disabling clang format 2021-03-05 14:08:00 +11:00
e0ba6a4411 Cleanup: rename evt to event
Following naming convention of most operators.
2021-03-05 14:04:22 +11:00
59889d9b4f Cleanup: rename variables in wm_event_add_ghostevent
Using both evt and event together was confusing.

Renamed:

- event_state          <- evt
- event_state_other    <- oevt
- event_other          <- oevent
- win_other            <- owin
2021-03-05 14:03:54 +11:00
97fabc3c1c Fix T86185: Win32 Multiple Monitor Window Position
Because of D10469 we can now not force child windows onto parent's monitor and allow them to go where they wish.

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

Reviewed by Ray Molenkamp
2021-03-04 17:54:46 -08:00
Jacob Møller
57812c7e4f Windows/CLog: Support color logging on Win 10
Windows 10 supports V100 on all consoles given
you enable the ENABLE_VIRTUAL_TERMINAL_PROCESSING
flag for the console.

This patch enables color logging only on windows
10 and only if the log is not being redirected
to a file.

Differential Revision: https://developer.blender.org/D10546
2021-03-04 18:20:52 -07:00
6a662ffda8 GPencil: Implement Autokey button for Draw/Edit and Sculpt mode
Now, if the Autokey is not enabled, a new frame is not created and it is used the last active one. If no active frame, a message is displayed and the operation is canceled.

This is a common request for 2D artists.

Also, grease pencil was not working as Blender does in other areas.

Reviewed By: pepeland

Differential Revision: https://developer.blender.org/D10557
2021-03-04 21:32:37 +01:00
1668f883fb Fix T59376: UV project modifier not working after modifiers that dont provide a UVMap
This was reported for remesh and skin modifiers.
These dont preserve UV layers (and probably cannot in a reasonable way),
so instead let the UV Project modifier create a new (equally named) UV
layer (as was suggested by @brecht in T59376).

Maniphest Tasks: T59376

Differential Revision: https://developer.blender.org/D10617
2021-03-04 20:20:05 +01:00
63b7ff9f4e Cleanup: Main foreach ID code: Remove MAX_LIBARRAY and improve comments.
The `MAX_LIBARRAY` define was an annoying doublon to the `INDEX_ID_MAX` enum value
now defined in `DNA_ID.h`, and it is no more useful.

And comments were somewhat outdated. Also added an explanation about
chosen order for the `INDEX_ID_<IDTYPE>` order.
2021-03-04 18:43:30 +01:00
f951aa063f UI: prefer shorter search items in fuzzy search
This is a simple heuristic that seems to improve the search results in many cases.

Differential Revision: https://developer.blender.org/D10618
2021-03-04 18:39:31 +01:00
7d685391a0 Nodes: improve NodeTreeRef
This adds a couple more utility methods to various node tree ref types.
Also `InternalLinkRef` has been added to get simpler access to internal links.
2021-03-04 18:15:22 +01:00
bb1f02510b BLI: support mutable lookup from multi value map 2021-03-04 17:38:01 +01:00
Corbin Dunn
d09b874244 macOS/Ghost: Opt out of AppKit’s automatic window tabbing
Since Blender is single-tabbed, this will prevent extraneous
tab-related options from appearing in "Window" menu in case AppKit's
internals change.

Reviewed By: #platform_macos, sebbas, ankitm
Differential Revision: https://developer.blender.org/D10606
2021-03-04 21:53:27 +05:30
3de5fbba3a Fix T86050: use material count from correct data block
See comment in code for more details.

Differential Revision: https://developer.blender.org/D10615
2021-03-04 15:27:33 +01:00
a988099ee4 Fix T86172: tag relations update when pasting nodes
Pasting nodes can create new id relations, because nodes can reference IDs.
Therefore the depsgraph has to be updated when nodes are pasted.
We could somehow check if the pasted nodes referenced IDs, but I'm not sure
if this complexity is worth it.
2021-03-04 13:33:03 +01:00
386e3dd842 PyAPI: use methods for bpy.data.libraries.load & write
Replace static methods with regular methods.
Now the 'Main' value is taken from the collection.

Needed to support multiple 'Main' instances in Python, see T86183.
2021-03-04 23:13:07 +11:00
d9e567d365 PyAPI: support methods for collection properties
Previously only static methods were supported.

Now C/API functions added to collections can receive a 'self' argument.
2021-03-04 23:09:11 +11:00
7fd6c7f371 Fix T86204: support multiple group inputs in node group
Note that this still does not work when in the node group directly referenced
by the modifier, only in sub-node-groups. This limitation will be removed
at some point.
2021-03-04 12:50:23 +01:00
bda95ac0f9 Fix T86209: Preference Defaults "Relative Paths" tooltip could be improved.
This UserPref setting is only used when no path is set yet.
2021-03-04 12:20:10 +01:00
06d33a6876 Fix Saving startup file changing paths of the current file
Saving the startup file now uses "Save Copy", so paths are preserved.
2021-03-04 20:56:17 +11:00
9fffb78343 Fix T86231: Saving startup file always remaps relative 2021-03-04 20:52:03 +11:00
ef7efc3751 Tests: don't write thumbnails when running tests
Also replace WM_OT_read_factory_settings with WM_OT_read_homefile
so the preferences don't have to be reloaded.
2021-03-04 17:43:12 +11:00
753a2a34ce Cleanup: include '--open-last' in "Misc Options"
This was using fall-back category "Other Options"
which should be kept empty.
2021-03-04 17:43:11 +11:00
12b529b3a6 Cleanup: redundant struct declarations 2021-03-04 17:17:19 +11:00
2df2f1c908 Cleanup: use non-zero comparisons for event modifiers
Use event modifier checks that follow most of Blender's code.
2021-03-04 17:10:56 +11:00
abaa6c3ace Cleanup: use BM_mesh_copy_init_customdata utility function 2021-03-04 17:06:50 +11:00
be627ab9e2 Cleanup: comments 2021-03-04 17:00:42 +11:00
39b86a989d Cleanup: use const arrays 2021-03-04 16:58:03 +11:00
d10700a3ac Cleanup: number literals 2021-03-04 16:55:50 +11:00
24f0807550 Cleanup: replace Py_CLEAR with Py_DECREF in bpy.app modules
In this case, there is no benefit to using Py_CLEAR
as the value will never be NULL and can't be used later on.
2021-03-04 15:46:07 +11:00
a40ccde405 Fix logic for calling PyObject_GC_UnTrack
All tracked objects need a matching un-track,
also remove redundant Py_XDECREF call.
2021-03-04 15:18:10 +11:00
0d28e2a334 PyAPI: correct garbage collection for StructRNA types
By default objects are no longer GC tracked, this removes some overhead
although it's not significant in my own testing.

- Only enable GC for StructRNA when 'WITH_PYTHON_SAFETY' is on.
- Only track StructRNA when their 'reference' is set.
- Add missing NULL check when 'WITH_PYTHON_SAFETY' is on
  and objects new objects be created.
2021-03-04 15:18:10 +11:00
67856d8c4a macOS/GTests: add_dependencies to fix build error
When building `install`, linking blender_test fails because
test libraries do not exist. This happened on lite + Xcode. Error in
{rBdcb2821292f962951e88f146cb304160f21f73da}.

Reviewed By: #platform_macos, brecht
Differential Revision: https://developer.blender.org/D10607
2021-03-04 08:04:17 +05:30
e4a55b46c4 UI: Remove extra blank space for decorators in FCurve modifiers
None of these properties can be animated, so it doesn't make sense
to leave space for decorators on the right side of the panels. In fact
that is what was intended, but they were not manually disabled
in all of the panels.
2021-03-03 16:32:55 -06:00
b450d2d148 Fix T86042 EEVEE: incorrect irradiance bake
The environment (world) irradiance wasn't correctly skipped.
2021-03-03 23:14:06 +01:00
dd43a37016 Geometry Nodes: Allow clearing an attribute text field
Because pressing enter will choose the current search item from the menu,
and there was no search item with an empty string, it was impossible to
clear the text of an attribute text field. This commit adds a simple "X"
icon in the top row when you delete the string.
2021-03-03 13:48:39 -06:00
f53221bff7 UI: Allow translation for node error messages
This commit exposes the strings used in the node error messages for
localization. It also changes the message tooltip creation to
automatically add the period at the end, to be more consistent with
the (arguably bad) design of other tooltips in Blender.

Calling `TIP_` directly in the node implementation files allows us to
continue using `std::string` concatenation instead of passing variadic
arguments. It's also more explicit about which part of the message is
translated and which isn't. The files already include the translation
header anyway.
2021-03-03 12:58:33 -06:00
Corbin Dunn
93cdf461f3 macOS/Ghost: Remove redundant nil check after initWithContentRect
AppKit’s NSWindow.h has NS_ASSUME_NONNULL_BEGIN, and only methods/
properties explicitly marked nullable will ever return nil.

Reviewed By: #platform_macos, sebbas
Differential Revision: https://developer.blender.org/D10603
2021-03-03 21:26:09 +05:30
Corbin Dunn
87c949a3bd macOS/Ghost: Fix memory leak.
`new` allocates a new object that needs to be autoreleased.

Reviewed By: #platform_macos, sebbas, ankitm
Maniphest Tasks: T86222
Differential Revision: https://developer.blender.org/D10597
2021-03-03 21:25:20 +05:30
b9bb69a114 EEVEE: Avoid old files with too many volume shadow sample being too slow
This clamp the volumetric shadow samples to the actual old max to avoid
problematic slowdown after the bugfix rB3a29c19b2bff.
2021-03-03 15:20:35 +01:00
Mikhail
cd9a6a0f93 EEVEE: SSS: Fix light leaking bewteen object at different depths
The SSS shader in Eevee has the following drawbacks (elaborated in {T79933}):

1. Glowing
2. Ringing. On low SSS jittering it is rendered a bunch of sharp lines
3. Overall blurriness due to the nature of the effect
4. Shadows near occlusions as in T65849
5. Too much SSS near the edge and on highly-tilted surfaces

{F9438636}
{F9427302}

In the original shader code there was a depth correction factor, as far as I can understand for fixing light bleeding from one object to another. But it was scaled incorrectly. I modified its scale to depend on SSS scale*radius and made it independent from the scene scale. The scale parameter (`-4`) is chosen so that it makes tilted surfaces to have visually the same SSS radius as straight surfaces (surfaces with normal pointed directly to the camera).

This depth correction factor alone fixes all the problems except for ringing (pt. 2). Because of float-point precision errors and irradiance interpolation some samples near the border of an object might leak light, causing sparkly or dashed (because of aliasing) patterns around the highlights. Switching from `texture()` to `texelFetch()` fixes this problem and makes textures on renders visually sharper.

An alternative solution would be to detect object borders and somehow prevent samples from crossing it. This can be done by:
1. Adding an `object_id` texture. I think it requires much more code changing and makes the shader more complicated. Again, `object_id` is not interpolatable.
2. Watch gradient of depth and discard samples if the gradient is too big. This solution depends on scene scale and requires more texture lookups. Since SSS is usually a minor effect, it probably doesn't require that level of accuracy.

I haven't notice it in practice, but I assume it can make visible SSS radius slightly off (up to 0.5 px in screen space, which is negligible). It is completely mitigated with render sampling.

Reviewed By: Clément Foucault
Differential Revision: https://developer.blender.org/D9740
2021-03-03 14:57:25 +01:00
f746b568f3 EEVEE: SSR: Check reflection ray against geometric normal
This improve self intersection prevention. Also reduce the bias
that was making a lot of rays not being shoot at grazing angles.
2021-03-03 14:57:25 +01:00
1c22b551d0 EEVEE: Add ensure_valid_reflection to glossy closures
This is ported from Cycles and fixes issues with bump/normal mapping
giving weird reflections/lighting.

Fixes T81070 Specular light should be limited to normal pointing toward the camera
Fixes T78501 Normal mapping making specular artifact
2021-03-03 14:57:25 +01:00
87da26404f Fix compiler issues introduced in recent commit.
{73af762e9cd595ea708647c02c7e74752d844e80}
2021-03-03 13:42:28 +01:00
dcf7313e73 Cleanup: use zero_v3 to clear colors. 2021-03-03 12:37:52 +01:00
73af762e9c Cleanup: Make node_composite_cryptomatte CPP.
Core API of cryptomatte is also CPP.
2021-03-03 12:37:52 +01:00
3f716bb626 Cleanup: clang tidy
Warnings:
* readability-inconsistent-declaration-parameter-name
* readability-redundant-smartptr-get
2021-03-03 12:23:02 +01:00
7d2f27244c Cleanup: clang tidy
Can use const parameter.
2021-03-03 12:17:48 +01:00
e9c50913f8 Cleanup: clang tidy
Warning: else-after-return/break
2021-03-03 12:17:16 +01:00
b9ee877752 Cleanup: make format 2021-03-03 12:14:06 +01:00
a915e47ca1 Fix (unreported) Outliner missing updates copying IDs via python
Steps to reproduce:
- switch to Scripting workspace
- execute bpy.data.meshes['Cube'].copy()
- Outliner will not show the new mesh immediately

Now just send appropriate notifier.

Differential Revision: https://developer.blender.org/D10584
2021-03-03 08:53:13 +01:00
44ab908c86 Nodes: store references to bNodeLinks in NodeTreeRef
Sometimes it is useful to have this information available to be able
to read information from links.
2021-03-03 07:59:07 +01:00
4dd1068a57 Fix crash when dragging nodes
The `bNodeLinkDrag` struct was NULL when dragging a node instead of
a link. It is allocated with `calloc` anyway, so this field doesn't
need to be explitely cleared.
2021-03-02 22:53:25 -06:00
7fddf383b1 Cleanup: minor changes to Python RNA pointer assignment
Don't assign the BPy_StructRNA a value which can be 'None',
instead, set it to NULL.
2021-03-03 15:06:59 +11:00
023788ef9a Cleanup: Use span and float matrix type in direct boolean code
This commit includes a few simple improvements to the direct mesh
boolean code added recently.
 - Passing the transforms and meshes to `direct_mesh_boolean` as spans
   makes the function easier to call from C++.
 - The definition of `TransMat`, was unecessary when we have the
   `float4x4` type already used elsewhere in C++ code.

Differential Revision: https://developer.blender.org/D10592
2021-03-02 20:58:05 -06:00
a4f81c6838 Fix T85966: Wrong link picked when dragging multi-input socket
The socket drag operator stored the index of the last picked socket
into RNA in case the mouse cursor leaves the link while dragging.

This id was not unique which is why sometimes a link from an other node
with the same id is picked.

This patch changes the way the last picked link is stored and stores a
pointer to the link directly into bNodeLinkDrag struct instead.

Differential Revision: https://developer.blender.org/D10590
2021-03-02 23:13:59 +01:00
6aec6568a0 Cleanup: spelling, minor corrections
Also use doxygen comments for sculpt functions.
2021-03-03 06:20:27 +11:00
Patrick Busch
3eb8307160 Python API: Expose CurveMapping Reset View function
The Python API for the curve mapping widget offers the `update`
function, but no way to reset the view to the clipping rectangle.

This commit adds a blenkernel function for this operation,
and exposes it to the CurvMapping RNA API. This allows addons
to display a more user-friendly view of the data in this widget.

Differential Revision: https://developer.blender.org/D10561
2021-03-02 13:13:36 -06:00
85421c4fab Geometry Nodes: Attribute search drop-down
This commit adds a search for existing attributes when you click
on an attribute field. This is useful because otherwise you have
to remember which attributes should be available at each node in
the tree.

The fundamental complication is that this information is not
accessible statically. So the search data is only a cache from
the previous node tree evaluation. The information is added
with `BKE_nodetree_attribute_hint_add`, currently for every
input geometry socket for a single node.

This is only an initial implementation, and later versions will
expose the data type and domain of the attributes.

Differential Revision: https://developer.blender.org/D10519
2021-03-02 13:01:33 -06:00
a344f20346 UI: Rename search button variable
I landed D10527 in rB1a8aee0a7cec accidentally, and the version there was
missing a name change discussed in review. This commit just renames the
boolean variable controlling the special behavior for attribute search.

Original message meant for this change:
For geometry nodes we will use search buttons to display a list of
attributes available the last time the node tree was executed (D10519).
Because this list is just a hint, we need to be able to enter any string,
not just strings from the search items.

This patch adds a boolean option to string buttons to enable this.
The change is quite simple, changes to behavior are only required in
two places. The type-specific button struct changes help a lot here.

Differential Revision: https://developer.blender.org/D10527
2021-03-02 12:43:27 -06:00
81c770944c CMake/deps: Append platform CFLAGS and LDFLAGS to Python build to ensure compatibility with minimum macOS version
Similarly to other dependencies, the Python build should make use of the default CMake arguments. On macOS, for example, these arguments are required to set the deployment target correctly.

See also: https://devtalk.blender.org/t/compiling-latest-branch-on-macos-fails-undefined-symbol/17649

Reviewed By: brecht, sybren

Differential Revision: https://developer.blender.org/D10498
2021-03-02 19:08:26 +01:00
William Reynish
6471cf6bc8 UI: Clean up labels and descriptions: "Draw" to "Display"
In Blender, we used to use the term 'draw' to refer to information
displayed to the user. For version 2.80, it was decided to change these
instances to 'display' instead. This was to avoid the ambiguity between
end-user drawing tools and display options.

From the Oxford English Dictionary:
 - Draw: produce (a picture or diagram) by making lines and marks on
   paper with a pencil, pen, etc.
 - Display: show (data or an image) on a computer, television, or
   other screen.

Therefore, we should use draw when referring to drawing tools for
making marks, but use display when referring to information
shown/displayed to the user. From a user POV, the computer displays
certain information, whereas the user draws a mark.

Apparently this change was not implemented consistently, so this patch
changes all remaining relevant instances of "draw".

Differential Revision: https://developer.blender.org/D10551
2021-03-02 11:58:25 -06:00
1a8aee0a7c UI: Expose an "is first search" boolean to search button callbacks
Currently when you open an RNA collection search button, like a
vertex group selector, the search filter isn't applied until you
start typing, in order to display every option at the start.
Otherwise they wouldn't be visible, since the search filter would
run for the current text.

Currently this check happens in one place, but it relies on the
`changed` value of `uiBut`. This is fine in the interface directory,
but anywhere else it would require exposing `uiBut.changed`, which
is probably too low-level to expose.

The solution is adding an `is_first` argument to the search callbacks,
which is nice for a few reasons:
  - They work at a higher level of abstraction, meaning they don't
    have to worry about how exactly to tell if this is the first
    search.
  - It makes it easier to do special behavior when the search menu
    is first opened.
  - Then, obviously, it makes that state accessible without including
    `interface_intern.h`.

Needed for attribute search: T85658

Differential Revision: https://developer.blender.org/D10528
2021-03-02 11:42:05 -06:00
5a3b7c5329 Fix Node UI Storage Threading Issues
Since the same node tree can be used in modifiers on different objects,
there can be multiple threads writing to the maps in the node tree UI
storage at the same time. The additions for attribute name hints and
error messages made it so this would often cause a crash or at least
an ASAN report. This patch adds locks to prevent multiple threads
from using the maps concurrently.

In a brief test I actually didn't observe a crash without the global
`bNodeTree` UI storage mutex, but I think it's necessary for the change
to be correct, and I did notice some unfreed memory without it anyway.
Ideally it would be in a node tree runtime struct though.

Differential Revision: https://developer.blender.org/D10577
2021-03-02 11:08:36 -06:00
3a29c19b2b EEVEE: Fix incorrect volumetric light shadowing
The shadowing was computed on the light distance squared,
leaking to much light since it was integrating the extinction behind
the ligth itself.

Also bump the maximum shadow max step to the actual UI values. Otherwise
we get shadowing under evaluated because `dd` is too small.
2021-03-02 18:00:02 +01:00
3d7a00b8aa Fix (unreported) light cache bake crash
missing NULL check if there is no cache there to begin with.

Differential Revision: https://developer.blender.org/D10581
2021-03-02 17:54:45 +01:00
9c604ab0ca Fix Fuild error with lite build
With audaspace disabled, function SEQ_add_sound_strip was declared as prototype.
2021-03-02 17:47:21 +01:00
82e7032477 Sculpt: Expand Operator
Expand is a new operator for Sculpt Mode which is intended to be the main
tool for masking, Face Set editing, interacting with the filters and pattern
creation.

The fundamentals of the tool are similar to the previous sculpt.mask_expand
operator. It shares the same default shortcuts and functionality, making
the previous operator obsolete.

The shortcuts to execute the operator are:
- Shift + A: Expand mask
- Shift + Alt + A: Expand mask by normals
- Shift + W: Expand Face Set
- Shift + Alt + W: Resize current Face Set

The main changes compared to the previous sculpt.mask_expand operator are:
- Modal keymap, all operator options can be changed in real time while the
operator is running.
- Supports creating Mask, Face Sets and Sculpt Vertex Colors.
- Much better code, new features can be easily integrated.

Limitations:
- All Mask operations are supported for Sculpt Vertex colors, but not exposed
by default as their support is still experimental.
- Dyntopo does not support any Face Set or Sculpt Vertex Colors. functionality
 (they are not implemented in general for Dyntopo).
- Multires does not support any feature related to geodesic distances.
- Multires does not support vertex colors.
- Multires does not support recursions.
- In Multires, Face Sets snaping does not initialize all current enabled Face
Sets when toggling snapping.
- In Multires, Face Sets are created at base mesh level (works by this by
 design, like any other tool).
- Unlike the previous mask_expand operator, this one does not blur the mask
by default after finishing Expand as that does not fit the new design.
The mask can still be blurred by using the mask filter manually.

Reviewed By: JacquesLucke

Differential Revision: https://developer.blender.org/D10455
2021-03-02 16:53:56 +01:00
7f36498740 Fix T86026: Crash Opening Cryptomatte File.
Not sure this fixes the root cause. It seems that memory corruption
happens in dynstr. This patch replaces dynstr with a streamstring.
2021-03-02 16:21:31 +01:00
b3886c1f2a Fix crash on NULL dereference
Caused by e1f3996d74, `seq_update_meta_disp_range()` did not check if
sequencer data exists.
2021-03-02 15:21:09 +01:00
ca2044f72b Fix T86122: Performance Debug View Viewport Not Working
The performance debug menu isn't used that often anymore as render doc
also show the timings. This patch will make sure that enabling the
performance debug view (21) does not crash blender.
2021-03-02 14:27:52 +01:00
fece538e3d Cleanup: remove unused arguments 2021-03-02 14:21:30 +01:00
8d6a79ffc2 Fix error in rBb9e1cc931ee9
Bad copy paste...
2021-03-02 14:11:16 +01:00
b9e1cc931e Fix T86138 EEVEE: Bake Indirect Lighting crash in 2.93 with older files
This was caused by a missing version check.
2021-03-02 13:56:24 +01:00
f094b4fa08 Fix T86172: check if attribute is actually accessible
The crash happened when the density in the Point Distribute node was
above zero but so small, that no point was generated. In this case, there
was a point cloud component, but the point cloud was empty, making some
attributes unavailable.

One could also make more attributes available in this case, but that can
be done separately if necessary.
2021-03-02 13:29:35 +01:00
1e7d8a4ad5 EEVEE: Depth of field: Do not shrink highlights when using overblur
This fixes the issue of bokeh size being smaller when using overblur.

The additional overblur needs to be centered on the outer radius.
2021-03-02 13:08:57 +01:00
e1f3996d74 VSE: Refactor meta operators
Move low level logic to module code and versioning logic to versioning code.

Metas strip position was handled in diffrent way compared to other strips.
This was introduced in c8b0d25794 as bugfix for T28158.
I disagree with such design. Meta strips should be handled in same way as
any other strips.

I have tested this change and haven't found any problems.
No problems after checking T28158 as well.
There should be no functional changes on user level.

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D9972
2021-03-02 12:54:45 +01:00
b3005bf688 Fix T85981, part II: bone's custom shape disappear on undo in some cases.
Nicely hidden bug in pose read library code, it was using the library
from the wrong ID as reference to relink the custom shape object pointer
(pose is data from Object, not Armature).
2021-03-02 12:41:03 +01:00
3059c0b386 Fix T85970: Incorrect scaling of meta strips
This is same issue as fixed by d857892553, but I forgot to check meta
strips. Meta strip output is always in render size.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D10560
2021-03-02 12:23:04 +01:00
88604b79b7 FFmpeg: Improve scrubbing performance
Applying negative offset to seek position before scanning doesnn't have
any effect. This change results in 1.5x faster seeking (random frame,
average value) in sample file with 30 frame GOP length.

If I am not mistaken, B frames can have pts that can be less than
pts of I frame that must be decoded. Even in this case though, B frame
packet will be stored after that I frame.

In addition, preseek value is de facto hardcoded so seeking would fail
if it could. This can be hard to spot though.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D10529
2021-03-02 12:23:04 +01:00
bbb1936411 VSE: Refactor VSE strip loading code
Isolate RNA and operator logic from functions that create strips.
 - Operator specific code was removed from `SeqLoadInfo` structure and
   `SEQ_add_*` functions.
 - Strip loading code was removed from RNA and operator functions.
 - `SEQ_add_*` API was unified to work on `SeqLoadData` struct.
   Only exception is image strip, which require files to be loaded
   separately to strip creation itself. This is not ideal, but I think
   it's acceptable.
 - Some functions and variables were refactored so the code reads
   better.

There are minor functional changes (coincidental bugfixes):
 - Operator errors are reported per-strip. Previously they were not
   reported at all?
 - `new_sound()` RNA API function now create sound with length of 1
   if source file does not exist. Previously it created strip with
   length of 0.
 - Replace selection operator property wasn't working correctly.
   Fixed in this patch.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9760
2021-03-02 12:23:04 +01:00
b279fef85d Geometry Nodes: show "Show Texture in texture tab" button
This enables the quick access button [to show the relevant Texture in
the Properties Editor] for textures used in geometry nodes.

This goes in line to what we do for other textures:
- modifier textures have this button
- particle textures have this button
- brush textures will soon have it, too (see D9813)

When outside of the Properties Editor, the button will always show (if a
texture is actually assigned), but will be inactive if no suiting
Properties Editor to show the texture in can be found.

Note this also changes the behavior to not show the button if _no_
texture is assigned (as in: we are still showing the "New" button).
Previously it was always there (e.g. for modifier textures), even if it
would take us to an empty texture tab. (Sure, we could add a texture
there then, but imho it makes more sense to just start showing it once a
texture is already there)

For this to work with geometry nodes, the following chages were done:
- implement foreachTexLink for geonode modifiers
- new buttons_texture_user_node_property_add() that stores prop as well
as node
- also use NODE_ACTIVE_TEXTURE flag in geometry nodetrees

notes:
- this still uses the first suiting (as in: pinning does not interfere)
Properties Editor it finds, this should (maybe?) find the _closest_
Property Editor instead (see related feedback in D9813).
- this will already show the button for brush textures as well
(disabled), but there is another mandatory change in an upcomming commit
to make it work there as well (see D9813)

ref. T85278

Maniphest Tasks: T85278

Differential Revision: https://developer.blender.org/D10293
2021-03-02 12:08:44 +01:00
00f27a8568 Cleanup: RNA: Remove useless setter of PoseBone's custom shape.
If the property is properly tagged, RNA knows how to deal with ID
usercount by itself, no need of a custom setter callback for that.
2021-03-02 11:54:25 +01:00
Jeroen Bakker
2d4b638a67 Cryptomatte: Read metadata from multilayer OpenEXR.
Currently the compositor reads cryptomatte meta-data from the render
result. When loading a multilayer open exr file the meta-data was ignored.
This patch will also load the cryptomatte meta-data from multilayer open
exr files.

This enabled workflows where the rendering and compositing are done in
separate scenes or for future changes where the cryptomatte node will
use the meta-data for name matching and color picking.

Reviewed By: Sergey Sharybin

Differential Revision: https://developer.blender.org/D10384
2021-03-02 11:20:01 +01:00
8dec6452f2 Cryptomatte: Session from Existing Render Result.
Utility to construct a cryptomatte session from a render result or
openexr file. This will allow D3959 to be more aware of the context
it is working on and would also support external render engines in
the cryptomatte color picker.
2021-03-02 10:14:10 +01:00
c4ef90f5a0 Fix click-drag regression in fix for T86116
1638af109e &
bfc70a6a95
caused a regression with click-drag (not tweak which has it's own logic).

Restore some changes from these commits with added comments.

Minor changes from previous functionality from
39919e3532.

- `prevval` & `prevtype` are now set for all kinds of new events
  in the queue previously this was not done for some kinds of events
  (mouse wheel, ndof - for example).

- Set `prevval` & `prevtype` for other windows for mouse buttons.
2021-03-02 18:40:15 +11:00
ae96db0cf5 WM: log errors when wmWindow.eventstate values are invalid
Ensure they're working as documented (only for debug builds).
2021-03-02 17:02:57 +11:00
f8415261a6 WM: window.event_simulate now sets previous values properly
Match wm_event_add_ghostevent behavior for setting previous values.
2021-03-02 17:02:55 +11:00
bf1ee49e20 WM: use wmEvent.is_repeat instead of previous event checks
This check was added before is_repeat was supported, use this variable
instead since it's more a more reliable way of detecting held keys.

Also remove outdated comment.
2021-03-02 17:02:54 +11:00
92dac21e6b Docs: notes on wmEvent previous state struct member use 2021-03-02 17:02:54 +11:00
7093e8b40a Cleanup: remove Python 2.x support from complete_calltip 2021-03-02 17:02:52 +11:00
8f2c3c63e9 Fix build error after last commit 2021-03-01 15:45:06 -06:00
3084f6a8e0 Cleanup: Rename node UI storage function
"ensure" makes more sense in this case because the function actually
adds an item to the map if one doesn't exist yet.
2021-03-01 15:43:40 -06:00
Germano Cavalcante
6c6b1c015c GPU Python: Implement gpu.texture.from_image
It can be useful to replace `image.bindcode` and `image.gl_load`.

Used for example in https://docs.blender.org/api/current/gpu.html#d-image

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D10458
2021-03-01 17:38:57 -03:00
f39143bc2e CMake: reduce Neon related output on Intel platforms
* Only try to find sse2neon if Neon detected
* Only run Neon support test once
2021-03-01 19:43:54 +01:00
77bc5510a9 Cleanup: rename some animation-related functions
Rename:
- `BKE_animsys_store_rna_setting` → `BKE_animsys_rna_path_resolve`
- `BKE_animsys_read_rna_setting` → `BKE_animsys_read_from_rna_path`
- `BKE_animsys_write_rna_setting` → `BKE_animsys_write_to_rna_path`

The concept of "RNA setting" is unclear; the new names reflect better
what the functions actually do.

No functional changes.
2021-03-01 18:44:26 +01:00
4cc04beb77 Fix T85981: Undo on linked rig with overrides loses custom shapes.
While generally speaking bone shapes objects should not be overridden,
it can happens in some cases, and should be properly supported then.
2021-03-01 18:25:35 +01:00
03ab698921 Cleanup: refactor BKE_animsys_store_rna_setting()
Lower the cognitive complexity of `BKE_animsys_store_rna_setting()` by
flipping conditions and using early returns.

No functional changes.
2021-03-01 18:18:20 +01:00
fdbc54ca74 Cleanup: remove superfluous animsys_evaluate_action_ex() call
Remove `animsys_evaluate_action()` and rename
`animsys_evaluate_action_ex()` to it. The only function of the former
was to call the latter, with the exact same parameters.

No functional changes.
2021-03-01 17:37:46 +01:00
aeb7bc5beb GLog: Lower default logging severity to INFO
Before this change messages of ERROR and above were printed.
This change makes it so LOG(INFO), LOG(WARNING), LOG(ERROR)
and LOG(FATAL) will be printed to the console by default
(without --debug-libmv and --debug-cycles).

On a user level nothing is changed because neither INFO nor
WARNING severity are used in our codebase. For developers this
change allows to use LOG(INFO) to print relevant for debugging
information. Bering able to see WARNING messages is also nice,
since those are not related to debugging, but are about some
detected "bad" state.

After this change the LOG(INFO) is really treated as a printf.
Why not to use printf to begin with? Because it is often more
annoying to print non-scalar types. Why not to use cout? Just
a convenience, so that all type of logging is handled in the
same way. When one is familiar with Glog used in the area, it
is easy to use same utilities during development. Also, it is
easy to change LOG(INFO) to VLOG(2) when development is done
and one wants to keep the log print but make it only appear
when using special verbosity flags.

The initial reason why default severity was set to maximum
possible value is because of misuse of VLOG with verbosity
level 0, which is the same as LOG(INFO). This is also why
back in the days --debug-libmv was introduced.

Now there is some redundancy between --debug-libmv, --debug-cyles
and --verbose, but changes in their meaning will cause user
level side effects.

Differential Revision: https://developer.blender.org/D10513
2021-03-01 16:56:34 +01:00
ea95ea644a Libmv: Avoid use of LOG(INFO) in solver
Usage of LOG(INFO) actually went against own guidelines in the
logging.h: the INFO is for messages which are to be printed
regardless of debug/verbosity settings.
2021-03-01 16:54:14 +01:00
61b3870981 Cryptomatte: Flexible Definition of CryptomatteLayers.
Cryptomatte layers in Blender are predefined. Other render engines
might have other naming schemes. This patch will allow creation of
cryptomatte layers with other names. This will be used by D3959 to
load cryptomatte openexr files from other render engines.

EEVEE and Cycles still use our fix naming scheme so no changes are
detectable by users.
2021-03-01 16:37:42 +01:00
1d9092f632 Fix Crash: Access Unallocated Memory. 2021-03-01 16:37:42 +01:00
6b20ccb753 Cleanup: Missing const keyword. 2021-03-01 16:37:42 +01:00
82dccff809 Cleanup: Mention Correct Types In Comments 2021-03-01 16:37:42 +01:00
5da418d4e6 Fix Cycles build error without Embree on Windows
Don't use ssize_t, it's not available in MSVC.
2021-03-01 16:33:31 +01:00
f4a9883294 UI: Correct output attribute name in proximity node
I made an incorrect comment in patch review that "Location"
should be used instead of position. "Position" is more appropriate
here since it refers to generic data rather than an object origin.
"Position" is also the name we chose for the attribute for this reason.
2021-03-01 09:32:48 -06:00
b35a3933ee Build-system: Use C-linkage for internal interface header
That way the header can be included in C++ files.
2021-03-01 16:30:51 +01:00
Christoph Lendenfeld
fdb2c24c09 Cleanup: move some drawing code into ed_draw.c
Move some drawing code from `area.c` and `ed_util.c`  into `ed_draw.c`.
This is to support the new generic slider that wil be used in T81785.

No functional changes.

Reviewed By: #animation_rigging, #user_interface, Severin, sybren

Maniphest Tasks: T81785

Differential Revision: https://developer.blender.org/D9313
2021-03-01 16:23:15 +01:00
3649b5b6df Add --open-last CLI argument that opens the most recent file
Add a CLI argument `--open-last` that opens the most recent file,
effectively doing the same as {key Ctrl Shift O}, {key Enter} after
starting Blender.

When there are no known recent files, print a warning and do nothing,
showing the startup file instead.

Note that this does not try to be smart about restoring the last Blender
session. It just opens the file from disk, as if the user had typed
`blender $(head -n1 ~/.config/blender/2.93/config/recent-files.txt)`.

There is also no smartness when that file cannot be opened; it behaves
exactly the same as typing the most recent filename on the CLI.

Reviewed by: mont29, campbellbarton

Differential Revision: https://developer.blender.org/D10563
2021-03-01 14:37:33 +01:00
e06f5f64ae Cleanup: Use LISTBASE_FOREACH and LISTBASE_FOREACH_MUTABLE macro 2021-03-01 09:35:27 -03:00
4b3dcd8069 CMake/deps: Added new macOS arm64 build dependency to instructions
macOS arm64 has extra requirements.
2021-03-01 13:08:01 +01:00
e81034f75d Harden checks in datatoc_icon binary
The goal of the change is to perform check for attempts of icons
being overwritten on canvas. The check is based on checking original
coordinate of icons against all read icons. If there are two icon
files which have same original an error will be reported. The report
includes both file names to make it easier to troubleshoot.

This change will allow to early-on catch issues which we currently
have with the release environment: official Linux builds might have
different icon from Blender compiled locally. This is because the
order in which directory listing is traversed is not defined, so
it's like a race condition between two files to win the place in
the final canvas.

There is still possible improvement in the code to move more fields
into the context structure. This is beyond of goal of this change.

Note that before committing this change icons must be brought back
to their consistent state. Otherwise the build will fail.

Differential Revision: https://developer.blender.org/D9715
2021-03-01 12:00:32 +01:00
9def00a8ca Work around T86015: Crash undoing in certain scenario (disabling Global Undo).
Simply disable advanced 're-use current blend data` process when loading
a memfile step and Global Undo is disabled, since there is no way to
ensure we have a proper 'differential' state in the stack then.

NOTE: this is a quick work-around to fix the crash, not a satisfying
solution by far (pretty sure there can still be crashes if you then
re-enable Global Undo afterwards e.g.).
2021-03-01 11:27:24 +01:00
ca63729a5b Fix T86087: Assert when changing compositor node value or invoking tooltip.
Regression from rBde25b79ff5c4, this flag is inconsistent currently for
embedded IDs, needs to be sorted out, see T86119.
2021-03-01 10:59:07 +01:00
71ed6f32d2 Fix T84658: Anisotropic BSDF - most modes not using Screen Space
Reflection

Anisotropic is not really supported in Eevee, but since code looks like
it is just intended to make it behave like glossy, it should function
like it too.

Seems like the internal calling from `node_bsdf_glossy` from
`node_bsdf_anisotropic` has swapped arguments.
Also: ssr_id is available for SH_NODE_BSDF_ANISOTROPIC as well (see
`ntree_tag_bsdf_cb`), so why not use it?

Maniphest Tasks: T84658

Differential Revision: https://developer.blender.org/D10547
2021-03-01 09:04:07 +01:00
bfc70a6a95 Fix T86116: Failure to detect click events with modifier held
Click detection logic relied on the event queue not accumulating events
as newly added events at the end of the queue adjusted
`wm->eventstate->prev{val/type}` which was then compared with events
at the front of the queue.

This made Ctrl-Click fail to detect the click as releasing Ctrl
set the previous value before the previous event was handled.

In practice this only happened in heavy scenes,
updating 10 fps or lower. It also made automated tests fail that
accumulate events before handling them.
2021-03-01 17:12:46 +11:00
d8b35219d1 WM: set previous values for events in the event queue
This makes event's prevval and prevtype usable for events in the queue.

Previously they were unused, except as a hack for modal keymap handling.

This is needed to fix T86116, where the `wm->eventstate->prev{val/type}`
are set to values from events that have not been processed.
2021-03-01 16:54:59 +11:00
8da58dc85b WM: prevent model keymap handling overwriting previous event values
`wmEvent.prevtype` & `wmEvent.prevval` were overwritten
when used in modal keymaps.

Now they are restored to their original values.
2021-03-01 16:54:59 +11:00
6de41bed2f Cleanup: move logic to copy the previous event state to a function 2021-03-01 16:54:52 +11:00
72d1545ec2 Cleanup: minor change to click detection checks
Change order of checks for more convenient click-detection debugging.
2021-03-01 12:21:57 +11:00
1638af109e WM: don't set event prevval/prevtype on cursor motion
Currently the intended behavior regarding prevval/prevtype isn't
handled consistently. However, including cursor motion causes events
in `wm->queue` and `wm->eventstate` to behave differently,
where `wm->eventstate` ignores motion (necessary for click detection).

This makes checks from `wm->eventstate` to events in the queue fail.

This reverts 39919e3532,
using the `event.type` instead of it's previous type.
This works as it includes mouse button release events.
2021-03-01 12:00:29 +11:00
fc08fe82ae Cleanup: spelling 2021-03-01 11:00:22 +11:00
fbba239e3a Fix T86082 Bevel messed up UVs on some multisegment bevels.
When polygons around a bevel are rebuilt, sometimes UVs are merged
around a new vertex in the case of the face opposite a single edge
being beveled on a 3-edge vertex. This should not have been done
if any of the edges at that vertex were a seam.
2021-02-28 11:33:25 -05:00
f3d60c68ef Fix T85948 Exact boolean crash with some nonplanar ngons.
Triangulating ngons could fail with the method that was being
used: projecting along the dominant normal axis and then using CDT.
It could fail if the ngon has self crossings or might be so after
the described projection.
Switched to using projection along the normal itself, and also to
using polyfill which produces some kind of triangulation no matter
what in such circumstances. This will also likely be faster if
there are a lot of ngons in the meshes, since the exact arithmetic
CDT was being used before, and now float arithmetic is used.
2021-02-27 18:51:48 -05:00
92743cc895 Fix T85886: Rotate Tool and Adjust Last Operation - angles inverted
The constraint was not set when redoing.

This commit also removes `postInputRotation`. I really couldn't see a use for it.
2021-02-27 17:22:47 -03:00
aad2f1510a Fix T86028: Crash when loading file with missing libraries.
Regression from rB53d13b6f5387c68.
2021-02-27 13:12:07 +01:00
28f0a4b27e Fix (unreported) broken OCIO from install_deps.
Looks like they removed static libs by default in OCIO 2.0, for some
historical reasons `install_deps` was enforcing using only static libs
for this one, now removed it so that Blender buil can use usual so's.
2021-02-27 13:12:07 +01:00
4b16cb1e9a Fix T85987: Selection when GP is parented
When a GP object was parented to e.g. a bone, box selection as well as
point selection were broken in that the selection from the user would
not correlate with what was actually being selected.

The issue was that box and point selection did not use the active
evaluated stroke data. The fix uses the correct data.

Reviewed By: antoniov

Maniphest Tasks: T85987

Differential Revision: https://developer.blender.org/D10555
2021-02-27 13:08:46 +01:00
e3c11b36da Fix error converting simulated events press/release to clicks
Move logic that sets previous event state into WM_event_add_simulate.
2021-02-27 22:05:01 +11:00
9cfb320208 RNA: add Region.data member to access RegionView3D
Without this, the RegionView3D could only be accessed from
`context.region_data`, not the region.
2021-02-27 16:30:07 +11:00
Victor-Louis De Gusseme
f7933d0744 Geometry Nodes: Add "Location" output to Attribute Proximity node
This patch adds an output field to the Attribute Proximity node and
renames the existing string socket from "Result" to "Distance".
  - The "Distance" output contains distance to the closest position
    on the Target geometry.
  - The new "Location" output contains the coordinates of the closest
    position on the Target geometry.

A basic use case for this data is a simple shrinkwrap operation.

Differential Revision: https://developer.blender.org/D10415
2021-02-26 15:23:09 -06:00
e00a87163c CMake/deps: Adjust OSL shader directory
The location of the shaders changed with OSL 1.11.10. This commit is therefore in addition to D10212.

@sybren With the latest SVN libraries, I am fairly certain there is a "OSL not found" in the CMake output. Can you check on Linux?

@LazyDodo Since you haven't pushed the new OSL libs yet, this should not be a problem on Windows. So this will only be needed whenever those land.

Reviewed By: LazyDodo

Differential Revision: https://developer.blender.org/D10552
2021-02-26 21:35:54 +01:00
5c6cd5f8cd Cleanup: unused class member 2021-02-26 20:57:24 +01:00
c0d8a14ae3 Fix crash with dyntopo on tools that use cached vertex info
Tools can cache data related to the mesh topology for later use. This
data is indexed by vertex index, so it will be invalid after dyntopo
changes the topology during the stroke.

Reviewed By: JacquesLucke

Differential Revision: https://developer.blender.org/D10550
2021-02-26 19:27:56 +01:00
fb7751f3e6 CMake/deps: Fix LLVM and OSL builds
This commit is addition to D10212. Apple arm64 support was left out in that patch.
2021-02-26 17:38:14 +01:00
cd388ef2f1 Fix (unreported) missing 3DView update after some Outliner Override operations. 2021-02-26 17:15:03 +01:00
b2eb674731 Cleanup: Use find_first_not_of. 2021-02-26 16:32:53 +01:00
6ccfb9e0ea Fix: Compile issue Windows. 2021-02-26 15:36:04 +01:00
87ace46827 Cryptomatte: Manifest Parsing.
This patch adds manifest parsing to Cryptomatte. Normally when loading
cryptomatte layer from an OpenEXR file the manifest contains data to
convert a hash to its original name of the object/material. In the
future we want to use this to support lookup of cryptomatte
hashes and show it to the user.

Currently this logic isn't available to users (for now), but is required
by D3959 where a new cryptomatte workflow is implemented.
2021-02-26 14:13:15 +01:00
c489bb7c01 GPencil: Cancel Fill if the filled area is not closed
Fill only if it never comes in contact with an edge. It is better not to fill than to fill the entire area, as this is confusing for the artist.

Differential Revision: https://developer.blender.org/D10536
2021-02-26 13:25:06 +01:00
17534e28ff Assets: Preview rendering for Action datablocks
Render previews for Action datablocks by rendering the scene camera with
the Workbench (solid) engine. The //look// can be configured by setting
the scene's render engine to Workbench and editing the scene's shading
properties.

It is assumed that the pose has already been applied and that the scene
camera is capturing the pose. In other words, the render function just
renders from the scene camera without evaluating/applying the Action
stored in `preview->id`. The ID is only used to determine its type and
to store the resulting preview.

Not all code paths that lead to the `action_preview_render()` function
actually provide a depsgraph. The "Refresh Asset Preview" button
(`ED_OT_lib_id_generate_preview`) does, but `WM_OT_previews_ensure` does
not.

Reviewed By: Severin

Differential Revision: https://developer.blender.org/D10543
2021-02-26 12:44:08 +01:00
e1a541c689 CMake/Deps: Python 3.9.2
Straight up minor version bump, no anomalies to report

Reviewed By: sebbas, sybren

Differential Revision: https://developer.blender.org/D10523
2021-02-26 12:25:45 +01:00
53d13b6f53 UX: Readfile: Libraries error messages: avoid wall of warnings.
When a lot of libraries or linked IDs were missing/not found when
loading a .blend file, Blender used to show one warning report for each
missing item, potentially covering the user's screen with a giant
unuable popup.

Now it will instead generate a single warning with amount of missing lib
files and linked IDs. Each missing item is still reported individually,
but only as `INFO`, so it will still show up in the console or Info editor.
2021-02-26 11:59:14 +01:00
72ceab8ab2 Cleanup: use early exit 2021-02-26 16:59:26 +11:00
7cb55a79d8 Cleanup: use boolean arguments 2021-02-26 16:55:58 +11:00
9059ee81ef Fix particle-edit crash on undo/redo
Undo/redo was crashing & asserting.

There ware two bugs:

- Entering particle system edit-mode requires an evaluated depsgraph.

- The active object could get out of sync when undo/redo
  moves between different modes.

The new test 'view3d_mesh_particle_edit_mode_simple'
in `tests/ui_simulate/test_undo.py` exposes both issues.
2021-02-26 16:32:49 +11:00
b7939a059f Undo: use low level API calls to enable font edit-mode
While I couldn't redo a bug in this case, it's possible for the
active object to become out of sync in rare cases,
so best use these functions.
2021-02-26 16:31:11 +11:00
0c9607312f Undo: don't log an error when the undo limit has been exceeded 2021-02-26 16:31:11 +11:00
c402cfa308 Cleanup: move comment into function doc-string 2021-02-26 16:31:11 +11:00
c67b03b810 Cleanup: Clang Format 2021-02-25 20:31:55 -05:00
81e795e7f0 Fix T84953: Incorrect tooltip for dragging collections
"Shift to parent" does not make any sense for collections since they
don't have parenting like objects. This commit just adds a simple check
for whether the first drag ID is an object before displaying
that part of the message.

Differential Revision: https://developer.blender.org/D10203
2021-02-25 19:23:19 -06:00
b1b9671c93 Cleanup: commented/out of date rpdb2 import 2021-02-25 18:27:57 -05:00
fbb0017c90 PyAPI Docs: Update Sphinx to 3.5.1 2021-02-25 17:51:48 -05:00
57c41a9c63 Icons: Add icon for the upcoming spreadsheet editor
The editor is being worked on by the geometry nodes team.
Icon created by Andrzej Ambroz (jendrzych).

Addresses https://developer.blender.org/T85925.
2021-02-25 18:09:00 +01:00
16504ed4a2 Icons: Update blender_icons.svg to have a document background
When opening the SVG you wouldn't even see the icons, since they are all white
now. You'd always have to set up a document background color and make sure to
undo that again before saving the file, so it's not written into it.
Just make everyone's life easier by saving the file with a proper background
(gray with checkerboard).
2021-02-25 18:09:00 +01:00
1981f04b0f Icons: Resaved blender_icons.svg in new Inkscape version
Inkscape often does a number of unrelated changes when saving an SVG, not sure
if these are just formatting changes in the source SVG text or if there's more
to it. Either way this makes adding new icons hard since you want to avoid
these unrelated changes. Saving the file in a new Inkscape version every once
in a while should mitigate the problem a bit.
Regenerating the icons (e.g. through `make icons`) shows no difference in the
output.

Note that I also ran "Clean Up Document" in Inkscape, but that doesn't seem to
have changed anything/much.
2021-02-25 18:09:00 +01:00
2718ea80d2 Improve Purge operator.
The Purge operator to remove unused IDs can now also remove 'indirectly
unused' data-blocks (those only used by unused ones, recursively).

It can also now only operate on linked, or on local data.

All those options are exposed in the `File -> Cleanup` main menu.

The behavior of the `Purge` button in the Outliner remains unchanged,
needs some UI/UX design task for that.
2021-02-25 17:48:54 +01:00
ec4d412c9c Py API: update bpy.data.orphans_purge to support new options.
This API function can now purge recursively in a single call, and choose
to ignore (not purge) local or linked IDs.

Default behavior (with not argument) remains unchanged, so no API
breackage here.
2021-02-25 17:48:54 +01:00
1df6cd67a1 Fix (unreported) bad usercount handling in batch ID deletion.
This was rather obscure and non-critical issue, but in some cases ID
usercount of some deleted IDs from batch-deletion code would not be
properly nullified, which would then assert later in actual deletion
code.
2021-02-25 17:48:54 +01:00
b958a59c79 BKE_lib_query: Add a function to detect and tag all unused IDs.
With the option to detect orphaned data recursively (i.e. if ID `a` is the
only user of ID `b`, and ID `a` is unused, ID `b` will also get tagged
as unused).

To be used by the Purge operation.
2021-02-25 17:48:54 +01:00
6daff9a08e UI: Fix icon width and padding in search menus
Previously the padding size and the width saved for the icon were
constant regardless of the zoom level. This resulted in overlapping
icons and text, and ugly padding with more extreme zoom levels.
We can retrieve the size of the row from the `rect` argument.
2021-02-25 10:28:39 -06:00
f908ff1ccd BLI: simplify adding an arbitrary value to a resource container
With this is becomes easily possible to store a lambda in a resource
collector so that it will be freed when the resource collector is freed.
2021-02-25 17:17:45 +01:00
35df354e4a Cleanup: quiet warning
"loop variable 'item' is always a copy because the range of type ..."
2021-02-25 16:56:01 +01:00
400f2e4be6 Fix T85959 EEVEE: DOF with "Jitter Camera" broken
Was caused by recent changes in window_translate_m4 by rBbb2af40ec7dd.
2021-02-25 15:27:10 +01:00
626a8e0f10 Fix T85979: Attribute missing warning with empty geometry
An error doesn't make sense in these situations because we don't expect
to find attributes on empty geometry, and an empty geometry set is a
valid situation.

Note that we can't use `component.is_empty` here, because often the
component is visually "empty" but still has a point cloud with no
points or a mesh with no vertices.
2021-02-25 08:20:02 -06:00
bcd369c3c1 Fix macOS SSE support not detected correctly after recent changes
Due to moving the code the test binary was incorrectly compiled with OpenMP
flags. Move setting of the OpenMP flags to the appropriate place.
2021-02-25 15:09:10 +01:00
ae581f9445 Fix T85976: Outliner crash deleting collection with multiple windows 2021-02-26 00:17:43 +11:00
cccdd6626d PyAPI Docs: Add 'gpu.state' module
Also exclude `gpu.shader` from quick tests.
2021-02-25 09:16:48 -03:00
59c1029e20 install_deps: bump USD version to 21.02.
Should have been part of D10367/rBa923a34de19c, but for some reasons it
did not make it into final commit...

Re T85365.
2021-02-25 11:56:14 +01:00
adf1525171 install_deps: bump python version to 3.9.2.
Also bump exlusive maximal version to 3.11, since 3.10 is now supported.

Re T85365.
2021-02-25 11:50:38 +01:00
de25b79ff5 Refactor: IDTypeInfo: Add owner_get to get owner of embedded IDs.
This concerns currently only collections (`master_collection` of scenes)
and root node trees. It removes the matching type-specific helpers
(`BKE_collection_master_scene_search` and `BKE_node_tree_find_owner_ID`).

No functional change expected here.

NOTE: Current implementation of `owner_get` is far from optimal, we
could probably do it better, see {T69169}.

NOTE: While it could also have it, shapekeys IDTypeInfo was left out of
this change for now. Mainly because it sould not be used currently, and
we ultimately want to demote shape keys from ID status anyway.
2021-02-25 11:39:10 +01:00
b5d39f9b46 Merge remote-tracking branch 'origin/blender-v2.92-release' 2021-02-25 10:17:02 +01:00
0e1c6a29cb Cleanup: spelling 2021-02-25 16:34:50 +11:00
94dc6ceaa7 Cleanup: remove assert left in by accident, outdated comment 2021-02-25 16:33:55 +11:00
b073e59d4e Fix T85975: Edit-mode undo/redo removes overlays
Setting the active object when decoding undo steps missed
a call to ED_object_base_active_refresh.
2021-02-25 16:13:53 +11:00
e301f3422d Fix T85974: Edit-mode undo/redo causes assertion
Assert the poll function succeeds after setting the active object.
2021-02-25 16:13:53 +11:00
2b60d7d09c Fix entering edit-mode when object mode and edit-data don't match
In rare cases, it's possible for an object to have edit-mode data
without it's Object.mode set to edit-mode.

This could happen with undo, part of fix for: T85974.
2021-02-25 16:13:47 +11:00
3ed6d9f966 Cleanup: use low level edit-object access functions for undo
Use OBEDIT_FROM_VIEW_LAYER macro for curve & fonts (matching edit-mesh).

While the difference isn't significant at the moment,
there are no reason these should be different between undo systems.
2021-02-25 12:20:23 +11:00
72370b92be Fix T85926: Cycles missing viewport updates when making materials single user
This issue seems to be caused by the reallocation flag not being set on
the device shader data array so it was never updated on the GPU although
the host memory was modified.
2021-02-25 02:18:02 +01:00
c47990f41c PyAPI: expose imbuf.types.ImBuf, include in API docs
Without this, the ImBuf type wasn't part of documentation.
2021-02-25 12:04:23 +11:00
17260c9b9a Fix T85963: Combine and separate XYZ nodes don't work on instances
They were missing the `geometry_set_realize_instances` function used to
make any input instances real for writing.
2021-02-24 16:11:21 -06:00
01e13e2c95 Cleanup: Remove unused node editor button event defines
These defines seem to be left over from the initial implementation
of the node editor. In a few places the values were used in button
creation, but the callbacks never checked the value anyway.
Node uiBlocks also had a callback what would never do anything
since the value it checked for was never used.
2021-02-24 14:53:37 -06:00
Yevgeny Makarov
a50f6bc40b UI: Clean up "Dupli" to "Instance"
Following the naming conventions defined in T56648, where in this
instance there were still a few remaining uses of the old term.

Differential Revision: https://developer.blender.org/D9817
2021-02-24 13:49:14 -06:00
Yevgeny Makarov
962b87f06a UI: Clean up use of the term "Metaballs"
Clear the weird term "Metaelement".
These are the metaballs (elements) inside one metaball objects.
  - "Meta Ball" to "Metaball"
  - "Metaelement", "Meta element" to "Metaball element"

Differential Revision: https://developer.blender.org/D9910
2021-02-24 13:44:24 -06:00
Yevgeny Makarov
4f247dba5e UI: Cleanup and fix labels and descriptions in various places
Changes include using proper and consistent grammar, simplifying
phrasing, using correct terminology, and not including python API
identifiers in tooltips.

Differential Revision: https://developer.blender.org/D9924
2021-02-24 13:25:44 -06:00
9a1b29e16c CMake: Removed temporarily disabled clang block
Was disabled in rBc778fd981e63. Libraries have been updated in rBL62576.
2021-02-24 20:23:42 +01:00
7a8a8241b9 Revert "t"
This reverts commit d3a96e5022.
2021-02-24 16:23:18 -03:00
201ab7c540 Fix T85823: bpy.ops.transform... ignoring 'center_override' for Bezier control points
`transform_around_single_fallback_ex` ignored that the center could be overwritten.
2021-02-24 16:20:03 -03:00
d3a96e5022 t 2021-02-24 16:20:02 -03:00
Yevgeny Makarov
8cc4366a98 UI: Remove colons from some labels
The colons are not necessary in these situations because it's clear
that the label applies to the next group of buttons anyway, and they
add unecessary visual complexity. Committing as part of D9924.
2021-02-24 13:15:48 -06:00
bc0e121bce UI: Reorder mesh merge operator types for consistent shortcuts
In vertex selection mode, the "At First" and "At Last" options are
contextually added to the beginning of the list of merge operations.
This means the automatic shortcuts in the merge menu are different,
making learning the shortcuts much more difficult than necessary.

This patch reorders the items so that "At First" and "At Last" are
added after the first three options so the shortcuts are always
consistent.

Fixes T84335

Differential Revision: https://developer.blender.org/D10008
2021-02-24 13:08:26 -06:00
66874824e6 GPencil: Fix missing change material menu using U key
The menu was not activated when vertex mode was enabled.
2021-02-24 20:04:10 +01:00
Fabian Schempp
b54b56fcbe UI: Make node virtual sockets more visible
This commit tweaks how virtual sockets (unconnected node group input
and output sockets) are drawn to make them more recognizable. The
outline is changed to a gray color, and they get a dark inner color.

Differential Revision: https://developer.blender.org/D10080
2021-02-24 13:01:24 -06:00
89196765ba Cleanup: Clang tidy else after return 2021-02-24 12:57:49 -06:00
Kdaf
e8a99dda25 Fix T84796: Particle tool properties displayed for select tool
When using particle mode, the particle tool settings were always
displayed, even if select/cursor is the active tool. This patch
hides the properties of the particle tools for non-brush tools,
using the same check as in other modes.

Differential Revision: https://developer.blender.org/D10266
2021-02-24 12:27:25 -06:00
5dd176cde8 PyAPI: Ensure GIL state only when a callback exists
There are fewer python callbacks than `ARegionType`s.

This also broke GTests's `bf_blenderloader_tests`.
2021-02-24 13:57:06 -03:00
02948a2cab Blender 2.92.0 release tagging 2021-02-24 17:25:10 +01:00
069d96fce5 Docs: 2.92 release description for Linux appdata 2021-02-24 17:24:11 +01:00
b0b33b77fa Workbench: Fix typo in rB32ca8e58a374
This was creating incorrectly occluded overlays.
2021-02-24 17:10:18 +01:00
b22204fa37 Cleanup: Simplify vector direction comparison
Multiply the two number together. If the sign of the result is positive, then the sign was the same. If the sign of the result is negative, then the signs were different.
2021-02-24 16:44:34 +01:00
c778fd981e CMake: Temporarily removing find clang block
New libs have not landed in the SVN repository. Once they are up, this commit will be reverted.
2021-02-24 16:13:06 +01:00
c0b2c75c44 Geometry Nodes: store available attribute names in node ui storage
This information will be used by the attribute search in string sockets.

Ref T85657.

Differential Revision: https://developer.blender.org/D10462
2021-02-24 16:00:33 +01:00
7972785d7b PyAPI: Fix memory leak of parameters used for python 'draw_callbacks'
When closing the blender, while the callbacks are removed, the
reference count of the object used as `customdata` is not decremented.

This commit adds two functions that correctly release the
python `draw_callbacks` before releasing all `draw_callbacks`.

Differential Revision: https://developer.blender.org/D10478
2021-02-24 11:57:29 -03:00
6b6469a2e5 Cleanup: Fix comment 2021-02-24 15:47:11 +01:00
7bbf27891c GPencil: Improve Interpolate AutoFlip algorithm II
Improved the calculation of the distances and changed the variable names to make it more readable.

Still, there are some corner cases that could be not handled properly, but we keep as is to test more real drawings to analyze if the small number of corner cases needs to be fixed or not.
2021-02-24 15:34:24 +01:00
9243d286f4 Cleanup: CryptomatteLayer
Missing code flow.
2021-02-24 15:30:29 +01:00
bb3e54d8be Cleanup: Cryptomatte Use StringRef(Null). 2021-02-24 15:29:23 +01:00
79f34447d6 Cleanup: CryptomatteLayer structure.
Current implementation was to restricting for future enhancements where
the CryptomatterLayer could be read from existing metadata.
2021-02-24 15:18:31 +01:00
4fb0c83c1c Cmake/deps: Update OSL to 1.11.10.0
This bumps OSL to 1.11.10.0. OSL Has a new build time
dependency: Clang, and more importantly it expects
clang and llvm to share a library folder, which it
previously for us did not.

This patch changes:

-OSL Update to 1.11.10.0

-refactor the llvm/clang/clang-tools-extra builds into the llvm
 build using the llvm-project tarball for building that has all
 of the subprojects in it.

-update ispc/openmp builds since clang no longer its own dependency
 and they have to depend on the llvm build now.

-Update the windows builder to use the 64 bit host tools since it
 ran out of ram linking clang

-Since OSL now needs clang to link successfully a findclang.cmake
 has been provided for linux/OSX

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

Reviewed By: brecht, sebbas, sybren
2021-02-24 07:13:37 -07:00
5be72125bf Cleanup: Move some utilities to 'gpu_py.h' 2021-02-24 10:58:15 -03:00
8f6fd07b54 Fix T85947: Missing check of master collection for objects being instanced.
`object_in_any_collection` used during linking/appending to check
whether an object is already instanced by at least one collection, was
not taking into account embedded master collections from scenes.
2021-02-24 14:14:46 +01:00
0c0553ace7 Fix T85915: Cannot save new theme preset
Since making bpy.types a real module `dir(bpy.types)` now includes
__dir__ and __getattr__ methods which need to be ignored.
2021-02-24 23:39:38 +11:00
5c098ef58c Fix crash updating themes in background mode 2021-02-24 23:39:38 +11:00
812a362bd8 Docs: 2.91 release description for Linux appdata 2021-02-24 12:53:00 +01:00
12b805148f Cleanup: quiet asan overflow warning 2021-02-24 12:10:45 +01:00
32ca8e58a3 Workbench: Fix samples taken outside of pixel footprint
With the previous implementation, we could have pixels with offset larger
than 1 pixel.

Also fix a bug when the closest_index is not last. The sample positions
were incorrect in this case.
2021-02-24 11:37:03 +01:00
bb2af40ec7 Fix T85726 Workbench: Orthographic view is blurry
This was caused by the window_translate_m4 not offsetting the winmat in the
right direction for perspective view. Thus leading to incorrect weights.
The workbench sample weight computation was also inverted.

This fix will change the sampling pattern for EEVEE too (it will just
mirror it in perspective view).
2021-02-24 11:37:03 +01:00
1a427973b4 Fix incorrect icon .dat files after recent commit
Using `make icons` for 420f538fad changed some icons that it shouldn't have
touched on my system. Not sure what caused this, maybe a bug in the slightly
outdated Inkscape version there (1.0.1). Here on macOS the version is only
reported as 1.0 so I'm not sure what the situation is. Either way, this fixes
the icons.
2021-02-24 11:29:01 +01:00
daf7f42364 Fix line width broken for consecutive line draw calls
D9054 did multiple consecutive `immBegin()`/`immEnd()` draw calls to draw
multiple lines at varying thickness. This would only work for the first line,
then they'd all get a 1px thickness (at least on macOS).

Issue was that `wide_line_workaround_end()` called `immBindShader()` directly
to restore the old shader (which the workaround overrides). However this
doesn't set `imm->builtin_shader_bound` which has to be done for the workaround
to work on the next `immBegin()` call. Instead `immBindBuiltinProgram()` can be
called.

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

Reviewed by: Clément Foucault
2021-02-24 11:16:51 +01:00
0fe25a6232 Fix T85939: Eevee Specular BSDF shader compile error
Introduced by 7f7e683099.
2021-02-24 10:45:25 +01:00
8d50a3e19e Fix T85930: Custom Property Error: Wrong Subtype
Regression in 08dbc4f996

Unfortunately lambda functions don't work with postponed annotations.
2021-02-24 16:16:53 +11:00
d4c0c40015 Cleanup: spelling 2021-02-24 15:53:03 +11:00
5c2e10d5ed Docs: clarify radial/cycle use for BMesh loops
Also add minor corrections clarifications elsewhere.
2021-02-24 15:39:43 +11:00
b2c7ea6d82 Geometry Nodes: Move node UI storage function to BKE
This function will be used in another file with attribute search,
so it makes sense to share from the UI storage header.
2021-02-23 17:15:03 -06:00
dde7d4417a GPencil: Fix typo error in previous commit 2021-02-23 23:09:33 +01:00
4d9d87d2bf GPencil: Improve Flip algorithm for Interpolate
If the lines cross, but the angle is very sharp, check the distance between the extremes.
2021-02-23 23:06:06 +01:00
b67b1d59c3 Merge branch 'blender-v2.92-release' 2021-02-23 13:59:24 -08:00
eb554051e7 Revert Automatic Tablet API dynamic fallback.
Removes fallback to Windows Ink when Wintab reports no devices present.
Returns to old behavior of using only Wintab if Wintab.dll exists.
2021-02-23 13:29:59 -08:00
ee4f306509 Fix T85844: high pressure at start of line.
m_tabletInRange is no longer set for Wintab after 2e81f2c01a
reverted Wintab changes. This reverts most button processing to
behavior present in 2.91.2.

Left in place is a bugfix for Windows Ink: button events while a
Windows Ink pen is in range should still be processed. Events processed
by Windows Ink and not passed to DefWindowProc do not create WM_*BUTTON
events, but button events from e.g. tablet pad express keys do create
WM_*BUTTON events and should be handled.
2021-02-23 13:29:59 -08:00
f227a69a87 Revert high fequency mouse input for Windows.
Windows mouse history function GetMouesMovePointsEx has well documented
bugs where it receives and returns 32 bit screen coordinates, but
internally truncates to unsigned 16 bits. For mouse (relative position)
input this is not a problem as motion events and the resulting screen
coordinates reliably fit within 16 bit precision.

For tablets (absolute position) the 16 bit truncation results in
corrupt history when tablet drivers use mouse_event or SendInput from
the Windows API to move the mouse cursor. Both of these functions take
absolute mouse position as singed 32 bit value on the range of 0-65535
(or 0x0-0xFFFF) inclusive. Values larger than 0x7FFF (the largest
signed 16 bit value) are reliably corrupt when retrieved from
GetMouesMovePointsEx history. This is true regardless of whether mouse
history is retrieved using display resolution (GMMP_USE_DISPLAY_POINTS)
or high resolution points (GMMP_USE_HIGH_RESOLUTION_POINTS), the latter
of which should return points in range 0-65535.

Reviewed By: brecht

Maniphest Tasks: T85874

Differential Revision: https://developer.blender.org/D10507
2021-02-23 13:29:51 -08:00
8d02fdc7e0 WM_MOUSEMOVE cleanup. 2021-02-23 11:47:53 -08:00
6844b768f3 Revert Automatic Tablet API dynamic fallback.
Removes fallback to Windows Ink when Wintab reports no devices present.
Returns to old behavior of using only Wintab if Wintab.dll exists.
2021-02-23 11:27:40 -08:00
37afeb7eaa Fix T85844: high pressure at start of line.
m_tabletInRange is no longer set for Wintab after 2e81f2c01a
reverted Wintab changes. This reverts most button processing to
behavior present in 2.91.2.

Left in place is a bugfix for Windows Ink: button events while a
Windows Ink pen is in range should still be processed. Events processed
by Windows Ink and not passed to DefWindowProc do not create WM_*BUTTON
events, but button events from e.g. tablet pad express keys do create
WM_*BUTTON events and should be handled.
2021-02-23 11:27:40 -08:00
cd9dbe317d Revert high fequency mouse input for Windows.
Windows mouse history function GetMouesMovePointsEx has well documented
bugs where it receives and returns 32 bit screen coordinates, but
internally truncates to unsigned 16 bits. For mouse (relative position)
input this is not a problem as motion events and the resulting screen
coordinates reliably fit within 16 bit precision.

For tablets (absolute position) the 16 bit truncation results in
corrupt history when tablet drivers use mouse_event or SendInput from
the Windows API to move the mouse cursor. Both of these functions take
absolute mouse position as singed 32 bit value on the range of 0-65535
(or 0x0-0xFFFF) inclusive. Values larger than 0x7FFF (the largest
signed 16 bit value) are reliably corrupt when retrieved from
GetMouesMovePointsEx history. This is true regardless of whether mouse
history is retrieved using display resolution (GMMP_USE_DISPLAY_POINTS)
or high resolution points (GMMP_USE_HIGH_RESOLUTION_POINTS), the latter
of which should return points in range 0-65535.

Reviewed By: brecht

Maniphest Tasks: T85874

Differential Revision: https://developer.blender.org/D10507
2021-02-23 11:25:27 -08:00
b123aadeee Fix T85895: Viewing value passes in Image Editor displays the value as alpha
There was a similar report prior to the introduction of the Image
Engine, see T74586.
This was fixed by rB6a5bd812b569 at that time, but got lost in the
refactor it seems.

Above commit introduced the `ED_space_image_get_display_channel_mask`
function that will determine
the valid bitflags for the display channel of a given ImBuf.

But since the refactor, this is not called anymore (`draw_image_main` is
not called anymore)
Now it seems we can safely reuse that said function
`ED_space_image_get_display_channel_mask` also for the Image Engine.

Maniphest Tasks: T85895

Differential Revision: https://developer.blender.org/D10510
2021-02-23 18:32:09 +01:00
64c35769f9 Cleanup: Remove unecessary double negative 2021-02-23 11:25:13 -06:00
c62e60f01f Annotations: Add layer Opacity paramater
This option was removed in the refactor of grease pencil and never was set again.
2021-02-23 16:14:56 +01:00
18be02b859 Geometry Nodes: improve accessing attribute meta data
This allows accessing attribute meta data like domain and data type
without having to create a `ReadAttribute`. I kept the `attribute_names`
method for now to keep the patch more self contained.

Differential Revision: https://developer.blender.org/D10511
2021-02-23 15:15:29 +01:00
Yevgeny Makarov
420f538fad Fix T84707: Wrong icon for Movie Clip Editor
Sync the list of icons in CMakeLists.txt with UI_icons.h.
Restore, in the source file, the FUND icon that was accidentally
deleted.
Delete four old/unused icons.

See also D9715.
2021-02-23 12:07:25 +01:00
aa4882506c BLI: new FunctionRef type
Using `FunctionRef` is better than using `std::function`, templates and c function
pointers in some cases. The trade offs are explained in more detail in code documentation.

The following are some of the main benefits of using `FunctionRef`:
* It is convenient to use with all kinds of callables.
* It is cheaper to construct, copy and (possibly) call compared to `std::function`.
* Functions taking a `FunctionRef` as parameter don't need to be declared
  in header files (as is necessary when using templates usually).

Differential Revision:  https://developer.blender.org/D10476
2021-02-23 11:52:06 +01:00
b2e1b13abd Cycles: Add option to change input passes for viewport denoising
There are cases where the default input passes of color+albedo do not yield useful results
and while this was possible to change that for final frame rendering (in the layer settings),
viewport denoising always used a fixed color+albedo. This adds an option to change the
input passes for viewport denoising too, so that one can use it in scenes that otherwise
wouldn't work well with it.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D10404
2021-02-23 11:45:02 +01:00
bfb2e87a9e Cleanup: Use shorter enum names
With the full node name at the beginning, these names can get quite long.
Slightly different words shorten them just a bit.
2021-02-22 23:33:04 -06:00
82605093e9 Alembic procedural: avoid storing constant hair topology for each frame
Only store the curve keys and radiuses for each frame if the topology does not change through time, this helps saving quit a bit of memory.
2021-02-23 06:06:54 +01:00
87ef037459 Alembic procedural: cleanup, demultiply Object and Geometry Node
creation
2021-02-23 06:06:50 +01:00
3d5e290ee0 Alembic procedural: use an enumeration to discriminate IObjects
Using the various IObject::matches() to do so was expensive and would
show up in profiles as requires creating std::strings for each call.
2021-02-23 05:31:34 +01:00
d9abcee47e Alembic procedural: fix crash when accessing data out of frame bounds 2021-02-23 05:16:49 +01:00
9fe53bd4a1 Build Environment/macOS/Python: link against zlib statically
rBc70eb30240f8b5d5a8f2ac509f0eb585936142b5 added patch to use static
zlib on Linux. But also added flags to use the zlib in LIBDIR for
Python on macOS. That causes some shared libraries (binascii for one)
to link against libz.1.dylib which will not be there on users' systems.
Reuse the said patch for macOS also to avoid rpath issues.

Fix T85648.
Reviewed By: #platform_macos, brecht
Differential Revision: https://developer.blender.org/D10479
2021-02-23 08:34:33 +05:30
d447bd3e4a Fix T85638: Child Window Positioning on Multiple Monitors
Constraint of new window position can be incorrect when using multiple monitors.

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

Reviewed by Brecht Van Lommel
2021-02-22 13:47:21 -08:00
beb1f1b805 Win32: Do not (yet) set window styles for Dialog
Remove the setting of Dialog window styles until we confirm expected behavior between platforms.

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

Own Code
2021-02-22 12:46:45 -08:00
9c395d6275 UI: Remove Blend Thumb Passepartout
Removal of 'camera frame' around blend file thumbnail images.

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

Reviewed by Brecht Van Lommel
2021-02-22 11:52:19 -08:00
be9842f65b UI: Simplify Window Creation
Refactoring: WM_window_open() that can open different types of windows. 'New Window' with simplified layout.

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

Reviewed by Brecht Van Lommel
2021-02-22 11:38:21 -08:00
3d2d8a1aab Fix: Geometry nodes not depending on instanced collections properly
Geometry nodes were not adding referenced instanced collections as
dependencies to depsgraph.

This would lead to meshes and data not being ready on evaluation in
certain cases.
2021-02-22 20:28:47 +01:00
441c660270 Cleanup: Use bool instead of char 2021-02-22 13:18:49 -06:00
449ccf07e0 CMake/Windows: Update for new XR_OPENXR version
This updates platform/platform_win32.cmake to support
both the old and new library names for OpenXR.

The new version links against one additional system
library and the debug library filename changed ever
so slightly.

This is a temporary workaround and can be removed
once the new lib versions have landed.
2021-02-22 11:08:52 -07:00
cd8f2dfecc CMake/Windows: Detect Boost version
Rather than hardcoding the lib names, read
boosts version.hpp and extract the version
from there.

This will make it easier to land lib changes
in the near future.
2021-02-22 11:03:44 -07:00
5f8b6a9c0e Fix T85753: Default UVs for Icosphere are flipped horizontally
These were flipped since their introduction in rBa070a5befa11.

Maniphest Tasks: T85753

Differential Revision: https://developer.blender.org/D10465
2021-02-22 18:47:47 +01:00
Pascal Schön
277b4f4b93 Fix Principled BSDF specular color for black base color
Specular color is set to black instead of white inside the Principled BSDF
when the base color is set to fully black. This is contradictory to the sample
code of the Disney BRDF in BRDF Explorer. This patch aligns both
implementations.

Differential Revision: https://developer.blender.org/D10448
2021-02-22 18:33:05 +01:00
32073993a8 i18n messages extraction script: fix handling of C unicode-escapes.
rB1f5647c07d15 introduced for the first time a unicode escape in strings
to be translated, directly extracted from C-code itself.

This revealed that this case was not properly handled by current code,
for now we work around using `raw_unicode_escape` encoding/decoding of
python.
2021-02-22 18:32:49 +01:00
46bdf6d59f Fix T85768: Win32 Full-Screen Owned Windows
Improvements to how window states are determined and changed.

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

Reviewed by Brecht Van Lommel
2021-02-22 09:32:15 -08:00
d45a89ee44 Fix T85609 EEVEE: Viewport "vibrates" when mouse input is active
Taa offset was applied on first sample. This wasn't happening before
DOF refactor.

Also fixes T85618 Wireframe Displays Strangely in Eevee (Rendered,
material Preview)
2021-02-22 17:34:09 +01:00
cd1a083984 Fix T85720 EEVEE: Contact shadows do not appear when enabling SSR
Contact shadows needed correct `gl_FragCoord.z` but this is not
correctly set for fullscreen passes. Need to pass depth using a global
variable until we get rid of `cl_eval.tracing_depth`.
2021-02-22 17:34:09 +01:00
1ec626f4bd Fix T85549: GPencil draw tool offset when UI scale is not 1
There was a mistake in the variables saved and when resolution of the UI was not 1.0, the viewport was offset.
2021-02-22 17:18:32 +01:00
80793fc740 Cleanup: Use more clear field name
Disambiguate which time the frames are measured in.
2021-02-22 16:30:04 +01:00
dec73ed409 Cleanup: Tracking, reduce indentation level 2021-02-22 16:30:04 +01:00
da5eed7ee6 Cleanup: Spelling in comment 2021-02-22 16:30:04 +01:00
af89c9f9a6 Cleanup: Decrease variable scope 2021-02-22 09:28:17 -06:00
9ef2679ca9 Cleanup: Clang tidy inconsistent parameter name
Use the most recent names for the conflicting parameters.
2021-02-22 09:28:00 -06:00
fcac3d04f5 Fix T85850: GPencil Interpolate tool panel wrongly aligned
The layout was wrong.
2021-02-22 16:12:40 +01:00
046fe55e63 Fix T85869: GPencill Fill tool panel was not aligned as expected
The direction of the brush was displayed vertically.
2021-02-22 16:05:12 +01:00
6cd8c33d00 Fix compilation error in bypass bmesh commit when GMP not defined. 2021-02-22 09:54:18 -05:00
dd2e0150ae Various UI messages fixes and tweaks. 2021-02-22 15:48:54 +01:00
Evan Wilson
bc851700a6 Fix T85820: False Color not available in color management
Differential Revision: https://developer.blender.org/D10489
2021-02-22 14:52:04 +01:00
Pablo Dobarro
1a5027449a Fix proportional connected not working with loose edges due to hidden geometry
This was introduced in the new geodesic distances algorithm for proportional
editing. When all faces of an edge are hidden, that edge should be considered
as loose geometry.

Initial patch by Pablo with modifications by Brecht.

Differential Revision: https://developer.blender.org/D10488
2021-02-22 13:31:07 +01:00
4577ccc603 Merge branch 'blender-v2.92-release' 2021-02-22 13:28:52 +01:00
e497c1b93c Fix T85865: Crash when selecting Image texture node
Typo in rB7470c10601d0.

Maniphest Tasks: T85865

Differential Revision: https://developer.blender.org/D10496
2021-02-22 13:21:39 +01:00
c44c611c6d PyAPI: expose unstable type bpy.props._PropertyDeferred
Even though this might change, rigify, animation-nodes & translation
extraction depend on being able to extract this information.
2021-02-22 23:00:11 +11:00
Germano Cavalcante
086d70e910 GPU Python: Use 'PyC_ParseStringEnum' to parse items
Currently the GPU module for python has different ways to handle enums.
- Organizing items in `PyC_StringEnumItems` arrays and parsing them with `PyC_ParseStringEnum`.
- Using dedicated functions for each type of enum (`bpygpu_ParsePrimType`, `pygpu_ParseVertCompType` and `pygpu_ParseVertFetchMode`).

Although apparently more efficient (especially `pygpu_ParseVertCompType`
which transforms strings into integers for simple comparison), these
dedicated functions duplicate functionality, increase the complexity of
the code and consequently make it less readable.

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D10456
2021-02-22 08:35:52 -03:00
78c3caf3c1 Fix crash auto-completing bpy.types in the Python console
Reference counting error in dc61a63e3f
2021-02-22 22:30:13 +11:00
623ddc4aa6 Fix i18n messages extraction tool after update to support py 3.10.
The new defferred approach broke existing way to access items from
struct definition...

See T85872.
2021-02-22 12:20:25 +01:00
06212759bc Fix missing NULL check on macOS when system-python isn't found
Regression from cafd6b519c.

D10494 by @ysano with edits.
2021-02-22 21:20:48 +11:00
b4147aeeab Cleanup: unused variable 2021-02-22 10:29:34 +01:00
29a28a87e4 Added a cast needed to shut up an error in last commit. 2021-02-21 22:11:59 -05:00
af940c68cb Fix Cycles world volume scattering missing light in some cases
With very large distances there were precision / overflow errors, normalize
the average albedo to avoid that. This was causing test failures on macOS
Arm, but also other architectures had slightly wrong results.

Ref T78710
2021-02-22 00:22:20 +01:00
a3f091d7ce Change Exact Boolean modifier to skip round trip through BMesh.
The Exact modifier code had been written to avoid using BMesh but
in the initial release the modifier still converted all Meshes to
BMeshes, and then after running the boolean code on the BMeshes,
converted the result back to a Mesh.
This change skips that. Most of the work here is in getting the
Custom Data layers right. The approach taken is to merge default
layers from all operand meshes into the final result, and then
use the original verts, edges, polys, and loops to copy or interpolate
the appropriate custom data layers from all operands into the result.
2021-02-21 17:57:03 -05:00
7883eb04ed CMake/Deps: OpenEXR 2.5.5 2021-02-21 09:34:22 -07:00
e6b7905fe6 Fix memory leak when loading previous preferences from splash screen
When opening a Blender version for which there are no preferences, the splash
shows a button like "Load 2.92 Settings". Using this could cause a memory leak
of the storage for recently opened files.
2021-02-21 17:32:33 +01:00
Yevgeny Makarov
0c62906a41 UI: Correct the text alignment in the quick setup (splash screen) dialog
The "quick setup" dialog is actually a 'menu', and the "splash screen" block
contains the UI_BLOCK_LOOP flag which causes the buttons' text to align
to the left, however, usually regular buttons have centered text.

As a workaround, add the UI_BLOCK_QUICK_SETUP flag which prevents
the text from being left-aligned.

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

Reviewed by: Julian Eisel
2021-02-21 17:32:33 +01:00
08dbc4f996 PyAPI: use postponed annotations to support Python 3.10
Support Python 3.10a5 or 3.9x with support explicitly enabled.

- Enable Python's postponed annotations for Blender's RNA classes
  types registered on startup.

- Using postponed annotations has implications for how they are defined,
  since they must evaluate in the modules name-space instead of the
  classes name-space. See changes to annotations in `release/scripts`.

- Use `from __future__ import annotations` at the top of the module
  to ensure the script will run with Python 3.10.

- Old logic is kept since it could be used if PEP-649 is supported.

Resolves T83626

Ref D10474
2021-02-21 22:37:53 +11:00
de67e3c0c0 PyAPI: expose bpy_prop_deferred function & keywords
While not needed for Blender, Animation Nodes uses this information,
expose this information for scripts to access that need it.
2021-02-21 21:15:13 +11:00
c6ddb68b7a Cleanup: remove unused layers property from template
Also remove unused imports.
2021-02-21 20:55:31 +11:00
af37c3e8f1 Cleanup: remove duplicate settings from operator_mesh_add template
Also move align items into the enum call as there is no need to have
this accessible from the class.
2021-02-21 19:48:11 +11:00
4dd782a1a3 Fix T85714 Crash when Viewport Rending an image using EEVEE.
Was caused by non initialized render_timesteps.
2021-02-21 01:52:57 +01:00
48167644b7 Fix T85603 EEVEE: Baking Indirect lighting crashes Blender
Was caused by non initialized render_timesteps.
2021-02-21 01:33:56 +01:00
ba43b4c04d Cleanup: EEVEE: Rename variable named sample because ...
.. it's a reserved keyword on GL > 4.0.
2021-02-21 01:33:56 +01:00
2ce4a403d9 Cleanup: EEVEE: Rename aperture to cone angle when it make sense
Aperture for a cone is 2 times the cone angle.
2021-02-21 01:33:56 +01:00
33b4a03ca9 Cleanup: EEVEE: Use P and vP instead of worldPosition and viewPosition
... for local variables.
2021-02-21 01:33:56 +01:00
d0959924ad Cleanup: EEVEE: Use P for world position instead of W
This removes the last places where this was not the case.

We follow cycles convention of P being for Postion.
2021-02-21 01:33:56 +01:00
1d51cb6be2 Cleanup: EEVEE: change cameraVec macro to cameraVec(P)
This makes is clearer and avoid having to setup worldPosition if
shader is not a material shader.
2021-02-21 01:33:56 +01:00
dee94afd03 EEVEE: Ambient Occlusion Node: Support inverted and distance parameters
This adds an approximation of inverted AO by reversing the max horizon
search (becoming a min horizon). The horizons are correctly clamped in
the reverse direction to the shading and geometric normals.

The arc integration is untouched as it seems to be symetrical.

The limitation of this technique is that since it is still screen-space
AO you don't get other hidden surfaces occlusion. This is more
problematic in the case of inverted AO than for normal AO but it's
better than no support AO.

Support of distance parameter was easy thanks to recent AO refactor.
2021-02-21 01:33:56 +01:00
764082676b GPU: Add define to ouput more context lines for GLSL errors
This is work in progress, but it is very useful even as it is.
2021-02-21 01:33:56 +01:00
6fa984a1af GPU: Add RGB10_A2 format support
Nice format to output high definition normals or normalized colors.
2021-02-21 01:33:56 +01:00
1a9fe57a9f EEVEE: Planar Reflections: Fix regression
Fix regression with roughness not masking reflections when not using
Screen Space raytracing.

The trick was to only evaluate one planar per pixel, the one with
the most influence. This should not be too limiting since this is what
we do for SSR.

Also change evaluation order do not apply occlusion on planars probes.
2021-02-21 01:33:56 +01:00
274d7b87fd Cleanup: EEVEE: Remove SSR variant with AO
AO is always on in this case.
2021-02-21 01:33:56 +01:00
64d96f68d6 EEVEE: Ambient Occlusion: Refactor
- Fix noise/banding artifact on distant geometry.
- Fix overshadowing on un-occluded surfaces at grazing angle producing "fresnel"
  like shadowing. Some of it still appears but this is caused to the low number
  of horizons per pixel.
- Improve performance by using a fixed number of samples and fixing the
  sampling area size. A better sampling pattern is planned to recover
  the lost precision on large AO radius.
- Improved normal reconstruction for the AO pass.
- Improve Bent Normal reconstruction resulting in less faceted look on
  smoothed geometry.
- Add Thickness heuristic to avoid overshadowing of thin objects.
  Factor is currently hardcoded.
- Add bent normal support to Glossy reflections.
- Change Glossy occlusion to give less light leaks from lightprobes.
  It can overshadow on smooth surface but this should be mitigated by
  using SSR.
- Use Bent Normal for rough Glossy surfaces.
- Occlusion is now correctly evaluated for each BSDF. However this does make
  everything slower. This is mitigated by the fact the search is a lot faster
  than before.
2021-02-21 01:33:56 +01:00
6c2e1f3398 BLI: cleanup StringRef and Span and improve parameter validation
Previously, methods like `Span.drop_front` would crash when more
elements would be dropped than are available. While this is most
efficient, it is not very practical in some use cases. Also other languages
silently clamp the index, so one can easily write wrong code accidentally.

Now, `Span.drop_front` and similar methods will only crash when n
is negative. Too large values will be clamped down to their maximum
possible value. While this is slightly less efficient, I did not have a case
where this actually mattered yet. If it does matter in the future, we can
add a separate `*_unchecked` method.

This should not change the behavior of existing code.
2021-02-20 22:05:50 +01:00
d8b4246b9f GPencil: Remove old Interpolate menu option
This option was before move this action as a tool.
2021-02-20 19:29:24 +01:00
Yevgeny Makarov
cab26abbdb UI: Correct the text alignment of the RGB/HSV/Hex toggle in the color picker
Expanded enum items like this usually have centered text, but there are
limitations in the popup code that break this here. Add a workaround for this
limitation.

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

Reviewed by: Julian Eisel
2021-02-20 18:54:40 +01:00
f2c0bbed1c Python: Add to_curve method to the object API
This patch adds a to_curve method to the Object ID. This method is
analogous to the to_mesh method. The method can operate on curve and
text objects. For text objects, the text is converted into a 3D Curve ID
and that curve is returned. For curve objects, if apply_modifiers is
true, the spline deform modifiers will be applied and a Curve ID with
the result will be returned, otherwise a copy of the curve will be
returned.

The goal of this addition is to allow the developer to access the splines
of text objects and to get the result of modifier applications which was
otherwise not possible.

Reviewed By: Brecht

Differential Revision: https://developer.blender.org/D10354
2021-02-20 18:05:13 +02:00
5dced2a063 Geometry Nodes: expose float2 attribute in rna
This also fixes the issue reported in T85651.

Differential Revision: https://developer.blender.org/D10477
2021-02-20 11:33:43 +01:00
173b6b792c Cleanup: Split grease pencil selection index functions
This makes the code more readable.
2021-02-20 10:16:59 +01:00
37e6a1995a PyAPI: use a new type for storing the deferred result of bpy.props
This is needed to support Python 3.10's Postponed annotation evaluation.

It also simplifies type checking.
2021-02-20 16:19:33 +11:00
4cd808f912 Cleanup: spelling 2021-02-20 15:38:14 +11:00
7bb2b910c0 Cleanup: doxygen sections 2021-02-20 15:35:00 +11:00
83f285f56f Cleanup: reference near duplicate enum definitions 2021-02-20 15:34:55 +11:00
6e64d97ede Cleanup: remove duplicate enum 2021-02-20 15:34:55 +11:00
2d5b89be89 Cleanup: Disentangle outliner active status "get" and "set"
Previously the same functions were used to both set and get the active
state for outliner tree elements. This has quite a few problems.
 - It's hard to tell when data is changed or simply read
 - It prevents using `const`
 - The code is full of if statements, making it longer and less readable.

This commit replaces the `tree_element_type_active` and
`tree_element_active` functions with `_get` and `_set` variants. One
has const arguments and returns the active state, the other deals only
with setting the state. While this refactor results in slightly more
lines of code, the result is much better in my opinion.

This commit also removes unused variables from arguments of the affected
functions.

Differential Revision: https://developer.blender.org/D10232
2021-02-19 16:29:11 -06:00
Edgar Roman Cervantes
a961a2189c Geometry Nodes: Add string input node
This commit adds a simple string input node, intended for use in the
attribute workflow to make using the same attribute name in multiple
places easier. The node is function node similar to the existing vector
input node.

Ref T84971

Differential Revision: https://developer.blender.org/D10316
2021-02-19 16:03:14 -06:00
ee1c674775 UI: Use property split in geometry node properties
This makes the nodes look more consistent with the rest of the UI
by using the same split with right aligned labels as the property editor
and elsewhere. Additionally, for consistency, the "Type" part of some
dropdowns is removed. It already wasn't displayed everywhere, and
it gets redundant quite quickly.
2021-02-19 14:39:27 -06:00
b8bf662cce Cleanup: Comment formatting, spelling 2021-02-19 14:05:54 -06:00
34580748dc Fix T83027: Incorrect outliner collection state after operator
The "Hide Collection" operators assigned to the number keys in edit mode
trigger a redraw of the outliner, but as an optimization, they do *not*
trigger a rebuild of the tree.

This optimization is valid because unlike the collection exclude toggle,
the heirarchy is not affected by collection visibility. However, it means
that currently you must trigger a rebuild to get the correct "grayed out"
status after using the operator.

Rather than trigger a rebuild in this case to solve the bug, this patch
moves the decision for whether to gray out the text of a tree element
to the draw step rather than the build step. This means that any change
to the corresponding properties doesn't require a full tree rebuild.

Note that changing the "hide_viewport" property from the outliner still
causes a tree rebuild. I think that's because of the checks in
`outliner_collection_set_flag_recursive_fn`.
That could be optimized in the future.

Differential Revision: https://developer.blender.org/D10240
2021-02-19 13:56:49 -06:00
55700ac390 Cleanup: Fix clang tidy warning
0 cannot be used to initialize the whole settings struct.
2021-02-19 13:50:38 -06:00
Eitan
4891d4b3d1 Geometry Nodes: Add simple subdivision surface node
Add the Simple subdivision option to Geometry nodes, as a new node
instead of part of the existing subdivision node because of future
backend changes to the Simple option. (See T85584)

https://developer.blender.org/D10409
2021-02-19 13:20:04 -06:00
720d76a978 Merge branch 'blender-v2.92-release' 2021-02-19 19:05:38 +01:00
b1142858d4 Revert "Fix T80313: Fix clipped text in splash screen on hiDPI monitors"
This reverts commit 7ee518cf70.

Causes T84869. The initial issue is less bad than this. We are looking into
alternative fixes for 2.93 (see D9854 and D9853).
2021-02-19 19:02:57 +01:00
a23c7fd570 Geometry Nodes: forbid creating attribute with empty name
Empty attribute names are just a recipe for problems.
2021-02-19 18:10:03 +01:00
a346a7dd10 GPencil: Don't show only lines in draw mode
As now is possible to use multiframe in Draw mode, the option to display only lines must be disabled.
2021-02-19 18:00:34 +01:00
116cda65a2 UI: fuzzy search in collection search
This adds fuzzy search functionality to various input fields in Blender
where one can choose a value from many existing values (e.g. the
Vertex Group property in the Displace modifier).

Differential Revision: https://developer.blender.org/D10446
2021-02-19 17:56:24 +01:00
6bba830589 GPencil: Interpolate Tools refactor
Following with the changes included to interpolate strokes of different number of points, a full review has been done in the interpolation tools.

* Interpolate now is a tool and not an operator. It was not logic to have this tool as a button.
* Interpolate tool parameters have been moved to topbar.
* Interpolate popover has been removed from topbar and interpolate `Sequence` operator has been moved to grease pencil menu.
* Interpolate Sequence now include a Redo panel.
* Interpolate tool now allows to select the strokes by pairs. This allows to interpolate any stroke with any stroke and not as before that it was only possible by drawing order. If no stroke is selected, the interpolation is done as before.
* Now is possible interpolate again if a previous keyframe exist. Before, it was impossible to interpolate two times in same frame and this made impossible to do the interpolation by groups of frames.
* New automatic option to `Flip strokes` if the stroke and end are not in the right position. Also the flip can be set manually for corner cases.
* Cleanup of menus related to interpolate.
* Fixed some bugs and removed parameters from scene because now all are tool or operator contained.
* Some code cleanup and function renames.

This commit also includes the some codebase to future implementation of the concept `Vertex Active` that now does not exist in grease pencil.
2021-02-19 17:41:28 +01:00
2441886c58 UI: Use title case for label 2021-02-19 10:17:08 -06:00
1f5647c07d UI: FModifier layout updates, drag and drop
This patch implements the list panel system D7490 for FCurve modifiers.

The UI layouts are updated to make use of subpanels and to be consistent
with the rest of the interface, and easier to understand.

See the differential revision for screenshots.

This commit also significantly cleans up the FModifier UI code, and
improves, mainly by replacing the old button creation code is with
the newer interface API using RNA. In turn there is a bit of complexity
added because each FModifier has a separate panel.

Although reordering of FModifiers was not implemented before, we get
drag and drop basically for free here, so it is also included.
As noted in some older to do tasks, FModifiers aren't evaluated
in perfect order, which may be a point of improvement for the future.

Differential Revision: https://developer.blender.org/D7997
2021-02-19 10:11:35 -06:00
0d94695cc4 Fix T85745: Render grease pencil with time offset modifier fails
The problem was introduced fixing task T85035. 

As the frame was set again when render, if there was a time modifier, the frame was not remaped to the right frame number.
2021-02-19 16:18:36 +01:00
2b8c2438e4 Cleanup: Use braces after if statement 2021-02-19 08:07:18 -06:00
b6f9f83daf CMake/Deps: Mesa, harvest lib files from new location
The upgraded Mesa (see D10282) stores library files in `mesa/lib64`.
2021-02-19 14:33:45 +01:00
c97ea30e95 Merge branch 'blender-v2.92-release' 2021-02-19 13:49:56 +01:00
Peter Fog
94cd52a162 VSE: Fix duplicate menu entries
Commit rBf448ff2afe7a accidentally added menu entries that were removed.
`use_zoom_to_fit` is duplicated in menu, others were moved to overlays menu.

Remove these entries.

Reviewed By: ISS, campbellbarton

Differential Revision: https://developer.blender.org/D10453
2021-02-19 13:46:44 +01:00
3ae7a0f059 Cleanup: typo 2021-02-19 12:31:38 +01:00
e2caca1796 Nodes: only show warning icon if there are warnings 2021-02-19 12:31:38 +01:00
14f1d8962f Geometry Nodes: add method to get all geometry components in a set
Previously, functions would have to ask for every geometry type explicitely.

Using a vector is return type is fine. In practice this will probably never
allocate because of the small buffer optimization in vector.
2021-02-19 12:31:38 +01:00
ed070dd51d Docs: corrections to vertex group & face-map docstrings
Address issue raised by T77920
2021-02-19 22:12:41 +11:00
dc61a63e3f PyAPI: include all members in dir(bpy.types)
C/Python defined types were accessible but not exposed in dir(bpy.types)
2021-02-19 22:12:41 +11:00
eafcbbb4f7 PyAPI: use real module for bpy.types
This is needed to support `typing.get_type_hints`,
which expects each classes module to have a module '__dict__'.
2021-02-19 22:12:41 +11:00
80e5697b0b Cleanup: fix asan warnings 2021-02-19 12:05:59 +01:00
55c1021be4 Cleanup: extract function to get node ui storage
This function will be used by multiple functions.
2021-02-19 12:03:27 +01:00
Wannes Malfait
359d0029fe Fix T85763: Align Rotation to Vector node fails for collinear vectors
If the axes are aligned in auto pivot mode then the rotation axis would be (0,0,0).
We now fall back to the x axis in this case. If that fails, we fall back to the y axis.

Differential Revision: https://developer.blender.org/D10466
2021-02-19 11:37:35 +01:00
47fc1e11db Nodes: ensure ui storage implicitely
This makes it easier to use the api.
2021-02-19 11:27:40 +01:00
51c2ee4346 Geometry Nodes: use corner domain for densities in Point Distribute node
Previously, the density was set per point. That implies that when a
point has a non-zero weight, points might be distributed in all
connected polygons. By specifying the density per corner, this
limitation is removed. Note, per-point density maps (such as vertex
groups) can still be used. They will be adapted to the corner domain
without loss of information.

Differential Revision: https://developer.blender.org/D10461
2021-02-19 10:32:39 +01:00
cb3e092d45 Merge branch 'blender-v2.92-release' 2021-02-19 02:00:56 -05:00
241273d362 API Docs: Fix generation failing with unused context members
Instead of raising an expection a warnign is generated instead. This 
fixes the issue where `['hair', 'pointcloud']` are disabled for release 
builds. In the future a better solution would be to generate the context 
map dynamically but this would require refactoring of the API: D9988
2021-02-19 01:58:16 -05:00
7266d8e32a PyAPI Docs: Fix deprecation warning with new theme version 2021-02-18 23:55:23 -05:00
62c1b33f5e PyAPI Docs: Clarifiy vertex group index list paramater
See T77920
2021-02-18 23:13:30 -05:00
f75f447ce8 Merge branch 'blender-v2.92-release' 2021-02-18 22:54:22 -05:00
e6acc4db72 Instead of raising an expection a warnign is generated instead.
This fixes the issue where `['hair', 'pointcloud']` are disabled for 
release builds.
In the future a better solution would be to generate the context map 
dynamically but this would require refactoring of the API: D9988

Fixes T80364

Differential revision: https://developer.blender.org/D10468
2021-02-18 22:51:24 -05:00
eecb90d8d2 PyAPI: bpy.utils.execfile temporarily overrides the __main__ module
This is needed to support Python 3.10's `typing.get_type_hints`,
to access the name-space used when creating the class.

Also added a docstring for execfile.
2021-02-19 11:23:30 +11:00
4604350eef UI: Expand enum in collection info node 2021-02-18 17:56:47 -06:00
a7c1aa245f Cleanup: Remove type from global namespace in C++ header 2021-02-18 17:53:08 -06:00
27fd066baf Cleanup: Clang tidy inconsistent parameter name 2021-02-18 13:59:08 -06:00
73f4dfa3c5 Cleanup: Clang tidy else after return 2021-02-18 13:58:27 -06:00
Matt Hill
d519b33b32 Fix T85410: Quick liquid domain alignment
When `Preferences → Editing → New Objects → Align To` is set to `3D
Cursor`, the fluid domain added by `Object → Quick Effects → Quick
Liquid` is aligned to the 3D cursor.  This shouldn't be the case, since
these aren't new objects created directly by the user.

Differential Revision: https://developer.blender.org/D10467
2021-02-18 13:51:39 -06:00
782bed1984 Merge branch 'blender-v2.92-release' 2021-02-18 19:05:09 +01:00
c297bef9af Fix T85762: Crash when opening 2.83 VSE file
Crash happened in versioning code on NULL dereference in function
seq_convert_transform_crop() for Strip crop and transform
fields.

Strips created after rB1fd7b380f4cf were assumed to have crop and
transform always initialized, but this wasn't the case. This has been
fixed in 2.90, but not in versioning code.

Initialize these fields if they are not initialized already.

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D10463
2021-02-18 18:59:42 +01:00
f3bf87e588 GPencil: Small frame evaluation speed up improvement
Avoid look for frame if the actual frame is already available.
2021-02-18 18:30:07 +01:00
62b8c2a66a GPencil: Add missing edit lines in Multiframe mode
When edit using Onion skin, the edit line was missing.
2021-02-18 17:21:21 +01:00
81ac0bf759 Fix failing "Edit Source" (asserts) while number slider was visible
E.g. steps to reproduce:
* Enter Vertex Paint mode
* In the tool settings, right-click > "Edit Source"

When creating a number slider via `layout.prop(..., slider=True)`, the UI code
would reallocate the number button to be a number-slider button. That's because
we now actually have different button data-structures for these (see
e6f0b60c2e). The edit source code stored data based on the button pointers,
which didn't get updated after changing the type. The fix just adds this
updating.
2021-02-18 17:17:48 +01:00
afa5da9ce0 Cleanup: remove check for non-annotation properties in classes
This was added to assist upgrading scripts to Blender 2.8x,
now 2.9x is released there is no need to keep this block.
2021-02-19 02:19:53 +11:00
9df9269173 Cleanup: sort structs, file-lists 2021-02-19 02:19:53 +11:00
7e11595364 Cleanup: clang-format 2021-02-19 02:19:53 +11:00
aa2da44b82 Cleanup: use doxy sections 2021-02-19 02:19:53 +11:00
e79916eb47 Cleanup: order shape_len after shape argument
This matches nearly all other argument ordering in Blender,
including Python mathutils API.
2021-02-19 02:19:53 +11:00
10a54bbd06 Cleanup: spelling, correct doc-string arguments 2021-02-19 02:19:53 +11:00
bcb9e8e1a7 Fix T85769: Grease Pencil Fill option when drawing no longer works
The fill unclamped thickness value was not properly initialized for using with the new antialiasing.

The error was introduced in commit 09f7c93858
2021-02-18 16:16:02 +01:00
74383a332b Cleanup: Fix unused variable warning
exception was not used and can be safely removed
2021-02-18 08:09:08 -07:00
f521aa445d Merge branch 'blender-v2.92-release' 2021-02-18 15:36:32 +01:00
f1f8074b8d GPencil: Fix unreported broken use only lines in multiframe
This option was broken since the draw engine refactor and it was impossible to display only edit lines for multiframe mode.
2021-02-18 15:34:52 +01:00
0fe5be3525 Cleanup: return const reference instead of copy
There isn't really a reason for why this has to return a copy of
the data instead of a reference.
2021-02-18 12:40:27 +01:00
e1fe1fcc79 Cleanup: rename AttributeInfo to AttributeKind
"Kind" is a bit less generic than "Info" for me. Especially, it implies
that the struct does not contain the name of a specific attribute
(for me anyway).
2021-02-18 12:32:40 +01:00
b166429fc9 Merge branch 'blender-v2.92-release' 2021-02-18 11:11:00 +01:00
75580fa6a6 Fix flashing eevee render passes in viewport
Caused by rB85fe12071ad7.

When looking at a render pass in viewport and move the camera, there's a
"flash" effect in this AOVs test file:

{F9753476}

{F9753473}

The cause seems to be that taa_current_sample when rendering
(DRW_state_is_image_render()) is ok because it has been incremented in
EEVEE_temporal_sampling_draw but taa_current_sample is wrong when we are
not rendering.

D10375 by Ulysse Martin (youle) with clang format changes.

Reviewed By: jbakker, lichtwerk, also blessing from fclem

Differential Revision: https://developer.blender.org/D10375
2021-02-18 11:05:39 +01:00
72e2b5060d Geometry Nodes: support adapting point to corner domain
This allows accessing per-point attributes on the corner domain,
which can be useful e.g. when adding per-point displacement
to per-corner uv coordinates.

Also it is required to make an upcoming patch work well, that
makes the Point Distribute node use density weights per corner
instead of per point, giving the user more precise control over
the distribution.
2021-02-18 11:03:38 +01:00
e3f0b6d5cb Geometry Nodes: support accessing vertex colors
This makes vertex colors available in geometry nodes similar to
how uvs are available. They can be used using the attribute system.
Vertex colors are stored per corner (as are uvs, but not like vertex weights).

Ref T84297.

Differential Revision: https://developer.blender.org/D10454
2021-02-18 10:24:02 +01:00
999abee874 Geometry Nodes: convert point cloud to mesh vertices for modifiers
Previously, when a Geometry Nodes modifier outputs a point cloud
(e.g. generated using the Point Distribute node), other modifiers
could not use that data. Now, the point cloud data is converted to
mesh vertices for such modifiers.

Ref T85281.

Differential Revision: https://developer.blender.org/D10451
2021-02-18 10:13:56 +01:00
1bcc8f8410 Cleanup: Python: naming mismatch in bvh.ray_cast. 2021-02-18 09:09:31 +01:00
450ea1b755 Cleanup: Decrease variable scope 2021-02-17 16:59:50 -06:00
5fef212e31 Cleanup: Use const argument, decrease variable scope 2021-02-17 16:42:20 -06:00
fd75f7c135 Cleanup: Use Vector instead of of raw array 2021-02-17 16:19:50 -06:00
78116a1edc macOS: support building with command line tools without full Xcode
Latest Xcode takes up 15GB, command line tools are only 1.2GB.
2021-02-17 21:05:09 +01:00
eeeb85baf8 Cleanup: Comment formatting in node_draw.cc 2021-02-17 13:34:49 -06:00
af824b09c7 MSVC: Suppress C4251 in OpenVDB/Mantaflow
All headers in the svn libraries should be
building with /W0 however MSVC 16.8/16.9
has broken this functionality making OpenVDB
emit lots of warnings.

The breakage was reported [1] in august to MS
but they still have not gotten around to
addressing the issue.

This change explicitly suppresses C4251 in the
module that emitted these warnings. As the warning
is useful in other parts of blender a localized
approach is taken rather than a global suppression.

[1] https://developercommunity.visualstudio.com/content/problem/1167590/bug.html
2021-02-17 12:23:01 -07:00
f29a1d87e8 Fix: Attribute randomize node broken for integer attributes
The integer mode still needs a random value in a 0 to 1 range, just like
floats. So slightly refactor to let the integer randomization use the
float implementation and then round to an int afterwards.
2021-02-17 12:21:31 -06:00
c8b064f032 Merge remote-tracking branch 'origin/blender-v2.92-release'
Making sure the rc tag doesn't get carried over to master.
2021-02-17 19:08:29 +01:00
3bb58e2a7c Blender 2.92 bcon4 - change release cycle to release candidate
This is still a rolling release candidate with new builds every day
as a preparation to the final release.
2021-02-17 18:55:20 +01:00
8095aad47e Cycles: Fix build error on windows
Function __bsf was in util/util_simd.h twice

problem located by @EAW on chat.
2021-02-17 10:21:00 -07:00
4d28a1d75f Fix OpenColorIO 2.0 GPU shader error in uniform assignment
And fix a (harmless) compiler warning.
2021-02-17 18:03:52 +01:00
a7750f95b9 GPU Python: Rename 'uniform_buffer' to 'uniform_block'
From the the opengl wiki:
> Buffer objects are associated with a program's uniform block similarly to the way that texture objects are associated with sampler uniforms.
2021-02-17 13:23:35 -03:00
0da10b279a Cleanup: Use static struct for work scheduler. 2021-02-17 16:49:27 +01:00
3a4b7e2bc6 Cleanup: Use struct for WorkScheduler. 2021-02-17 16:49:27 +01:00
b452438d0a Cleanup: Use snake case for method names. 2021-02-17 16:49:27 +01:00
cc45dfa07f Cleanup: Remove definition in header without implementation. 2021-02-17 16:49:27 +01:00
89c79c3ed8 Cleanup: Abbreviate enums with 'UNSIGNED_' in the name 2021-02-17 12:38:21 -03:00
4430e8a008 Python: gpu module: add new submodules and types
This commit extends the gpu python API with:
```
gpu.types.Buffer         #"__init__", "to_list"
gpu.types.GPUTexture     #"__init__", "clear", "read", "format"
gpu.types.GPUFrameBuffer #"__init__", "bind", "clear", "is_bound", "viewport", ("__enter__",  "__exit__" with "GPUFrameBufferStackContext")
gpu.types.GPUUniformBuf  #"__init__", "update"
gpu.state                #"blend_set",  "blend_get",  "depth_test_set",  "depth_test_get",  "depth_mask_set",  "depth_mask_get",  "viewport_set",  "viewport_get",  "line_width_set",  "line_width_get",  "point_size_set",  "color_mask_set",  "face_culling_set", "front_facing_set",  "program_point_size_set"
```

Add these methods to existing objects:
```
gpu.types.GPUShader  #"uniform_sample", "uniform_buffer"
```

Maniphest Tasks: T80481

Differential Revision: https://developer.blender.org/D8826
2021-02-17 12:27:19 -03:00
ec8c09f2aa Cleanup: fix compiler warnings 2021-02-17 16:26:24 +01:00
351d8bfc41 Fix T85694: Cycles incorrect grayscale conversion with some OpenColorIO configs 2021-02-17 16:26:24 +01:00
0e9497e886 Cycles: add support for Arm Neon instructions using sse2neon
Based on patch contributed by Apple and Stefan Werner.

Ref D8237, T78710
2021-02-17 16:26:24 +01:00
68dd7617d7 Cycles: add utility functions for zero float2/float3/float4/transform
Ref D8237, T78710
2021-02-17 16:26:24 +01:00
8119f0aad2 Cycles: refactor intrinsic functions implementation
* Add processor independent fallbacks
* Use uint32_t and uint64_t types
* Remove unused functions
* Better comments and less indentation

Ref D8237, T78710
2021-02-17 16:26:24 +01:00
db28411fd9 BLI: use sse2neon to emulate SSE instructions with Arm Neon
* WITH_CPU_SSE was renamed to WITH_CPU_SIMD, and now covers both SSE and Neon.
* For macOS sse2neon.h is included as part of the precompiled libraries.
* For Linux it is enabled if the sse2neon.h header file is detected. However
  this library does not have official releases and is not shipped with any Linux
  distribution, so manual installation and configuration is required to get this
  working.

Ref D8237, T78710
2021-02-17 16:26:24 +01:00
859118d8f6 BLI: add BLI_simd.h header to wrap SSE includes
In preparation of adding Neon support.

Ref D8237, T78710
2021-02-17 16:26:24 +01:00
ac680c569e Merge branch 'blender-v2.92-release' 2021-02-17 08:13:42 -07:00
e3dad81164 Cleanup: Missing word in rna description
One of the sentences changed recently in rBc63df3b33f01 was missing
a word. No functional changes.
2021-02-17 08:12:51 -07:00
56f4397a3b Merge branch 'blender-v2.92-release' 2021-02-17 16:05:33 +01:00
6247b8cc77 Fix T85722: missing updates adding modifiers via python
Was reported for Geometry Nodes Editor "New" button, but was true for
any modifier added via modifiers.new().

Now just add appropriate nofifier.

Maniphest Tasks: T85722

Differential Revision: https://developer.blender.org/D10450
2021-02-17 15:57:29 +01:00
5b6a3a57fb Merge branch 'blender-v2.92-release' 2021-02-17 15:56:24 +01:00
0cbbb9edd7 Cleanup: Split COM_compositor into multiple functions. 2021-02-17 15:41:03 +01:00
53bf04f284 Geometry Nodes: Expose material index attribute
The `material_index` attribute can adjust which material in the list
will be applied to each face of the mesh. There are two new things
about this attribute that haven't been exposed by the attribute API yet.
Each comes with limitations:
 1. Integer data type: Most attribute nodes are currently written to use
    float data types. This means that they can't write to this attribute
    because they can't change the type of a built-in attribute.
 2. Polygon domain: This is our first attribute using the polygon domain,
    meaning until some of the interpolations are implemented, some
    operations may not work as expected.

Currently the two nodes that work with this attribute are Attribute Fill
and Attribute Randomize.

Differential Revision: https://developer.blender.org/D10444
2021-02-17 08:30:15 -06:00
37de612104 Cleanup: make local vars const. 2021-02-17 15:25:24 +01:00
4329a01d37 Cleanup: Bundle static globals in struct 2021-02-17 15:25:24 +01:00
52b2cb6ea3 Cleanup: Comment style 2021-02-17 15:25:24 +01:00
6afc04f2a0 Cleanup: Allocate Execution System on stack. 2021-02-17 15:25:24 +01:00
ef53859d24 Cleanup: Make ChunkOrderHotspot a struct 2021-02-17 15:25:24 +01:00
8bca03056c Cleanup: Make ChunkOrder a struct. 2021-02-17 15:25:24 +01:00
2217719feb Fix T85440: crash with displacement shaders and updating geometry in viewport
When primitive offsets change we need to rebuild or refit BVHs, however this
was also tagging other data as modified too late in the geometry update process.
Now ensure only the BVHs are updated.

Ref D10441
2021-02-17 15:22:37 +01:00
b7e1660d40 Cleanup: Use 'pygpu_' prefix in the cpython GPU module
`py_` prefix can be confused with the Python's own API's.
2021-02-17 10:38:59 -03:00
1ea6394fc8 Cleanup: Fix typo error 2021-02-17 13:40:39 +01:00
Jamell Moore
09f7c93858 Fix T80862: Small stroke opacity modulation is best done in the fragment shader
To avoid anti-aliasing artifacts on GPencil strokes that have a size smaller than 1 the thickness
is clamped and the opacity reduced. This was done in vertex shader but this had the side effect
of causing strokes that go from large to small to fade across their lengths.

**Solution**

The opacity modulation has now been moved to the fragment shader as advised by Clément Foucault.

The strokeThickness that was passed to the shader was clamped to prevent it from being too small so an additional
unclamped thickness has been passed to the fragment to calculate the opacity modulation. Alternatively I could have chosen
strokeThickness and clampedThickness but I decided against renaming the variables in the current code.


Reviewed By: fclem

Differential Revision: https://developer.blender.org/D10438
2021-02-17 13:40:38 +01:00
55a69d5707 Geometry Nodes: realize instances before deform modifier
This is a follow up commit for rB96da8e9ca302b8d879744.

Ref T85281.
2021-02-17 13:17:50 +01:00
96da8e9ca3 Geometry Nodes: realize instances before passing geometry to constructive mesh modifier
Previously, when the output of a Geometry Nodes modifier would
contain instances, those could not be accessed by other existing
modifiers (e.g. the Array modifier). That is because those modifiers
don't know about instances.

Upcoming commits will improve an this in two ways:
* Also realize instances before deform modifiers.
* Convert a point cloud in the geometry to mesh vertices so that
  they can be accessed as well.

Note, making instances real can result in loosing some information
that we do not support in Geometry Nodes yet. That includes some
special builtin attributes like bevel weights.

Ref T85281.

Differential Revision: https://developer.blender.org/D10432
2021-02-17 12:28:00 +01:00
3a6d6299d7 Cycles: support accessing custom mesh attributes
This makes custom mesh attributes available in Cycles. Typically,
these attributes are generated by Geometry Nodes, but they can also
be created with a Python script.

* The `subdivision` code path is not yet supported.
* This does not make vertex weights and some other builtin attributes
  available in Cycles, even though they are accesible in Geometry Nodes.
  All attributes generated in Geometry Nodes should be accessible though.
* In some cases memory consumption could be removed by not storing all
  attributes in floats. E.g. booleans and integer attributes for which
  all values are within a certain range, could be stored in less than
  4 bytes per element.

Differential Revision: https://developer.blender.org/D10210
2021-02-17 12:13:30 +01:00
9419452f85 Cycles: detect when attributes have changed
This patch has originally been written by Kévin Dietrich, thanks!
It is part of D10210.

As Brecht noted in D10210, this might not handle all cases yet.
I better solution should come soonish.
2021-02-17 12:06:10 +01:00
17dddc9417 Fix: NLA Blend Domain Enable All Typo
Introduced by my recent commit: rBc48360c2559a

Accidentally used 4 instead of `necs->length`.
2021-02-17 01:07:08 -05:00
2da0f3e523 Geometry Nodes: Support integer type in the Attribute Fill Node
This will be used by the material index attribute when it is added.
2021-02-17 00:01:33 -06:00
47a269745e Fix T85716: "Applied Modifier:" report hides more important message
Since "Applied Modifier" was always added last, it obscured more important
messages when using the shortcut to delete modifiers. The purpose of the
report when using the shortcut was to make it clear that something
happened. Since another report does that anyway, only display the
"Applied Modifier" report if the report list length hasn't changed.
2021-02-16 23:39:58 -06:00
Wayde Moss
c48360c255 Fix: NLA Blends Non-Animated Upper Channel Values
Issue introduced by my commit: rB40b7929cc040

**User-level Problem**:
The issue resulted in a full-replace upper strip with only a Z location
channel full-replacing the XY location channels of the lower stack.
replaced to default. The expected behavior is that only the Z location
channel is affected.

**Technical-level Problem**:
Before the problematic commit, fcurves were blended as they were read.
So only existing animated channels would blend. My recent commit
changed the process to read all fcurve values into an isolated
upper_snapshot then blend with the lower stack. There is no data stored
to know whether the upper snapshot channel values were sampled from
fcurves or were default values. Only those sampled from fcurves should
be blended.

**Solution**:
Added a `blend_domain` bitmask member to NlaEvalChannelSnapshot.
The blending function only blends values within the `blend_domain`.
Sampled fcurve values are now marked as within the `blend_domain`.
We also now always copy the lower snapshot to the result snapshot which
only matters when they aren't the same. Currently, it's always the same
so the change is more for future unseen cases.

Reviewed By: sybren, #animation_rigging

Differential Revision: https://developer.blender.org/D10339
2021-02-17 00:21:07 -05:00
585db47d99 Cleanup: Return bool instead of int 2021-02-16 23:02:33 -06:00
bfc7994d93 Cleanup: use edituv prefix for stretch area/angle data 2021-02-17 15:36:18 +11:00
2853ad775e Merge branch 'blender-v2.92-release' 2021-02-17 15:19:21 +11:00
6ce06957c9 Fix T85680: Crash displaying UV stretch/area with modifiers
This uses the same logic as drawing UV's,
where non-bmesh defaults to mesh.
2021-02-17 15:12:39 +11:00
20a6255d49 Cleanup: spelling 2021-02-17 15:04:29 +11:00
62592af843 Cleanup: pass scene as const 2021-02-17 14:50:08 +11:00
99b4c856ef Cleanup: remove commented function 2021-02-17 14:50:08 +11:00
ab484ff22f Fix T85664: 3D Viewport issues with curve poly splines
Caused by cleanup in rBcdb3cbd64401, where an index
was used to index `float *` instead of `float[3]`.
2021-02-16 21:40:16 -06:00
5c523c6578 Merge branch 'blender-v2.92-release' 2021-02-16 18:10:42 -08:00
ab21009842 Fix T84701: Popup closes on release while dragging parameter.
Windows Ghost cursor movement was previously changed to use SendInput
because SetCursorPos sporadically allows the cursor to escape the
window. This is now reverted because SendInput causes mouse history via
GetMouseMovePointsEx to contain invalid movement history, likely due to
interaction with mouse acceleration. This resulted in popups closing
when the cursor appeared to leave their range.
2021-02-16 17:45:57 -08:00
461d4fc1aa Geometry Nodes: Node error messages
This patch adds icons to the right side of nodes when they encounter a
a problem. When hovered, a tooltip displays describing the encountered
while evaluating the node.

Some examples are: attribute doesn't exist, mesh has no faces,
incorrect attribute type, etc. Exposing more messages to the system
will be an ongoing process. Multiple warnings per node are supported.

The system is implemented somewhat generically so that the basic
structure can also be used to store more information from evaluation
for the interface, like a list of available attributes.

Currently the messages are just button tooltips. They could be styled
differently in the future. Another limitation is that every instance of
a node group in a parent node tree will have the same error messages,
the "evaluation context" used to decide when to display the tooltips
must be extended to support node tree paths.

Differential Revision: https://developer.blender.org/D10290
2021-02-16 17:15:08 -06:00
c9c4802c1c Fix T85671: color management crash with Medium Contrast look 2021-02-16 23:29:06 +01:00
ba79b8013f Cleanup: Use consistent order placement for include 2021-02-16 16:17:03 -06:00
eb2e260540 Cleanup: Used derived node in geometry exec params
Since the derived node tree is already build for the evaluation system,
it's simpler to pass a derived node to the params struct. This will also
allow context lookups in nested node groups for node error messages,
since the derived node has that information readily accessible.
2021-02-16 13:06:18 -06:00
c075b8bff2 Cleanup: Remove use of designated initializers in C++ 2021-02-16 12:02:45 -06:00
520d965c77 Cleanup: Compile node_draw.c with C++
This will allow using C++ data structures to draw  node error messages.
This required removing a forward declared enum for grease pencil undo.
Compiles with clang tidy.
2021-02-16 10:55:10 -06:00
8971018eb6 UI: Add support for bl_description for panels
This commit adds support for `bl_description` and python docstrings for panels.
This is useful for pop-over panel types so they can have a label and description.

This commit also includes an example use case.

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D10429
2021-02-16 09:51:37 -05:00
e81fca1ed3 Assets: Remove appended asset when dropping operation fails
When dropping an asset somewhere, it is appended and then a drop operation is
called to actually add it to the scene based on current context. If this drop
operation fails, the appended data-block is now still in the .blend. The user
may not notice and not expect this.
Instead idea is to rollback any changes done by dropping code if the operation
fails, namely removing the appended data-block again.

Adds a new `cancel()` callback which is called if the drop operator returns
`OPERATOR_CANCELLED` to drop-boxes and a generic function to deal with assets
on drop failure.

Also removes the `free_id_on_error` property of the `NODE_OT_add_group`
operator, which was used as ad-hoc solution to get this same behavior.
2021-02-16 15:34:32 +01:00
500bc99da5 Fix T85697: implement interpolation for float custom data type
This just hasn't been implemented before.
2021-02-16 14:25:55 +01:00
82ade44299 LibOverride: Add support for rotation mode of PoseBones.
Request from the studio.
2021-02-16 14:23:22 +01:00
2442c85dc3 Merge branch 'blender-v2.92-release' 2021-02-16 13:58:03 +01:00
Pratik Borhade
c13754e647 Fixes T84928 : Lattice vertices at unexpected positions when changing lattice resolution from 1 to 3 or more.
Fix for T84928 .
Considering the changes , issue is resolved ( Ignoring readability issues) .

**Changes **:

  - `Change in value assignment of fu/v/w :`  Observing previous code , I noticed ,value assigned to them is equivalent to -0.5 ( i.e. co-ordinate of left most vertex of lattice size =1 where  centre of lattice is origin ) .

  - `Change in value assignment of du/v/w :`    Margin ( distance ) between each division of surface along any axis is equivalent to **( (length of surface along axis ) / (no of division line - 1) )** . that's why is changed it to (default_size/unew -1) .

  - ` New variable declared "default_size"  :`  As far as I gone through the code , I noticed values  1 < du ,fu < 1  , which indicates these values were calculated with respect to default lattice of size 1 .

  - `removed pntsu/v/w != 1 check :`  Following changes inside the if block worked properly for pntsu/v/w = 1 .

Reviewed By: lichtwerk, campbellbarton

Differential Revision: https://developer.blender.org/D10353
2021-02-16 13:47:12 +01:00
1ec30d4b15 Fix T85697: subdivision surface node output does not contain vertex group names
The vertex weights were actually interpolated correctly. The issue was that
vertex group names were removed from the output geometry set. We have
to keep track of these names separately from the mesh, for legacy reasons.
Vertex group names are not stored on meshes but objects instead.
2021-02-16 13:35:06 +01:00
5688f791f5 Geometry Nodes: move realize-instances code to blenkernel
I need to access this functionality from modifier code. Therefore it should
not be in the nodes module.
2021-02-16 12:30:42 +01:00
21de1f9148 Geometry Nodes: move geometry set instance handling to separate file
In an upcoming commit I'll also move the make-instances-real functionality
to this file. This code is not essential to working with geometry sets in general,
so it makes sense to move it to a separate header.
2021-02-16 12:07:10 +01:00
39f60e6909 Geometry Nodes: move some attribute utilities to blenkernel
I need to access these utilities from modifier code as well.
Therefore, they should not live in the nodes module.
2021-02-16 11:55:12 +01:00
c03650073e Cleanup: spelling 2021-02-16 21:15:45 +11:00
a059f07274 Fix add-on & app-template installation logic for overwriting modules
The logic to remove one Python module before installing another
only worked in simple cases where a file replaced a file.

- Installing a single file add-on over a Python package with the same
  name caused an error as the directory isn't empty.

- Removing existing module directories from the zip-file did nothing
  as the directories from the zip-file that end with a slash were
  compared with directories from `os.listdir` that don't.

- `module_filesystem_remove` assumed ZipFile.namelist() was a list of
  files in the root of the zip-file when it's a list of all files.

  While I couldn't find any bugs caused by this, it performed checks
  that don't make sense, comparing files at different depths of the
  file-system.
2021-02-16 20:52:09 +11:00
36814ddc94 Workbench: Improve AntiAliasing sampling
This improves stability and convergence speed of Workbench Temporal AntiAliasing.

This adds a filtering kernel (blackmann-haris, same as EEVEE/Cycles) to the
temporal antialiasing sampling. We also gather neighbor pixels since they might
end up in the pixel footprint.

We use a 1px radius for the filter window which is a bit less than the 1.5 default
of cycles and EEVEE since it does blur quite a bit more than what we have now.

Another improvement is that the filtering is now in log space which improves
AntiAliasing around highlights.

Theses improvement may not be very useful for every day case but it was an
experiment to try to make TAA usable for GPencil.

Test file used :
{F9798807}

|filtered+logspace|filtered|original|
|{F9798847}|{F9798848}|{F9798849}|

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D10414
2021-02-16 09:05:44 +01:00
dd79a715c9 Merge branch 'blender-v2.92-release'
# Conflicts:
#	intern/ghost/intern/GHOST_SystemWin32.cpp
#	intern/ghost/intern/GHOST_WindowWin32.cpp
#	intern/ghost/intern/GHOST_WindowWin32.h
2021-02-15 23:27:21 -08:00
2e81f2c01a Revert Wintab High Frequency Input.
This revert removes handling of cursor move and button press events
during Wintab's WT_PACKET event, instead storing pressure and tilt
information to be combined with Window's WM_MOUSEMOVE events.

This also reverts dynamic enabling and disabling of Wintab, dependent
on the chosen Tablet API. If the Tablet API is not explictly Windows
Ink during startup, Wintab is loaded and enabled.

Left in place is a fallback to Windows Ink when the Tablet API is set
to Automatic and no Wintab devices are present. This allows devices
with Wintab installed but not active to fallback to Windows Ink.

Using position provided by Wintab was found to have too many
regressions to include in Blender 2.93. The primary source of
regressions was tablets which mapped coordinates incorrectly on multi-
monitor and scaled displays. This resulted in an offset between what
the driver controlled Win32 cursor position and the Wintab reported
position. A special case of this included tablets set to mouse mode,
where Wintab reported absolute position while the system cursor moved
as a relative mouse with mouse acceleration.
2021-02-15 23:06:00 -08:00
63fb53ad95 Docs: add a docstring for UserDef.pythondir 2021-02-16 16:28:48 +11:00
7bb5e4a3c1 Fix reloading preferences ignoring 'script_directory'
Reloading preferences didn't update Python's `sys.path` to account
for the modified `script_directory`.

This meant the operator to load settings from a previous version
required a restart to initialize Python when this directory was set.
2021-02-16 16:00:03 +11:00
f34d5d99dc Cleanup: remove local copy of shutil.copytree from Python 3.8 2021-02-16 15:58:34 +11:00
4a784f32fe Calm Win32 Window Creation Warning
Removing warning that 'GHOST_TUns32' to 'LONG' requires a narrowing conversion.

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

Own Code
2021-02-15 17:44:49 -08:00
23de16414a UI: Clarify descriptions in properties popover
Updates the descriptions and labels for outliner sync in the properties
editor popover to be more clear.

Differential Revision: https://developer.blender.org/D10010
2021-02-15 18:25:06 -07:00
c63df3b33f UI: Clarify descriptions in properties popover
Updates the descriptions and labels for outliner sync in the properties
editor popover to be more clear.

Differential Revision: https://developer.blender.org/D10010
2021-02-15 18:07:40 -07:00
c53022768b Fix T85587: Crash on selecting multiple frames
Blender would crash when selecting multiple keyframes while multiframe edit was
active. This was due to the active frame being NULL in some instances.

The fix checks if the active frame is not NULL.

Reviewed By: antoniov

Maniphest Tasks: T85587

Differential Revision: https://developer.blender.org/D10421
2021-02-15 20:30:13 +01:00
ae370e292a macOS: add Embree, OpenImageDenoise and sse2neon libraries for ARM
This required using a fork of Embree, newer LLVM version, unreleased ISPC
version and sse2neon directly from Git. Hopefully over time all the required
changes end up in official releases. For now we deviate from other platforms.

Based on contributions by Apple and Stefan Werner.

Ref D9527, D8237, T78710
2021-02-15 20:22:34 +01:00
4ce57f6eb8 macOS: fix Cycles not detecting 64 bit and failing to build with Embree
Contributed by Apple

Ref D9527, T78710
2021-02-15 20:22:34 +01:00
7baf796886 macOS Deps: NumPy: Remove buggy Accelerate framework
Building NumPy from source with default options of builder
causes it to link against Accelerate framework which is buggy and
raises a warning mentioned in [2].
"RankWarning: Polyfit may be poorly conditioned"
Accelerate is deprecated with NumPy 1.20+.[1]

So either we build OpenBLAS in dependencies also and set appropriate
env variables suggested in [1] while building NumPy for it to find
OpenBLAS. Or download NumPy wheel from pip and never allow pip to
build NumPy from source while installing.

After this change, pip wheels are used for NumPy for macOS with x86_64.

[1] https://numpy.org/doc/stable/user/building.html#lapack
[2] https://github.com/numpy/numpy/issues/15947
Reviewed By: #platform_macos, sebbas
Differential Revision: https://developer.blender.org/D10368
2021-02-16 00:47:50 +05:30
35145db056 Merge branch 'blender-v2.92-release' 2021-02-15 20:11:42 +01:00
3e55d7d605 Fix T85499: Crash on switching to edit mode with uv editor open
A fix for T83187 (rBf83aa830) assumed in the overlay code of the uv editor that the object was a mesh
when it did not have to be - causing a crash.

The fix makes sure that the object is a mesh.

Reviewed By: jbakker, campbellbarton

Maniphest Tasks: T85499, T85495

Differential Revision: https://developer.blender.org/D10369
2021-02-15 20:10:46 +01:00
604e61d81d UI/Nodes: Adding node groups via drag & drop (e.g. from Asset Browser)
Adds `NODE_OT_add_group` operator to add a node group from a given name, and
uses that to register a node editor drop-box.
When dropping a node-group asset, the ID will be appended. This is what we do
for other ID assets too.

Should the node group insertion fail (e.g. the group is not compatible with the
current tree, as checked by the poll), the appended data-block is removed.

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

Reviewed by: Jacques Lucke
2021-02-15 19:39:46 +01:00
45852532d5 Merge branch 'blender-v2.92-release' 2021-02-15 19:33:16 +01:00
9cccbbebaa Fix T84624: node group data-block has phantom user
This is because the node editor added a "real user" to the node group
that it displays. It was mainly added as a hack to solve issues with custom
tree types (T36024). Since we can store id references in custom properties
now, this "real user" is not really necessary anymore.

Given that we are close to a release, I'll only disable line for geometry nodes,
for which the bug has been reported.

Discussed this solution with Hans Goudey.
2021-02-15 19:29:09 +01:00
cab8a76abf Fix: wrong clang tidy cleanup
This reverts a part of rBd3960164163c910d5031a8f076c41b39e0a5503d.
It is not a `std::shared_ptr` but a `boost::shared_ptr`.
This could probably be fixed differently, but `NOLINT` is fine now.
2021-02-15 19:03:32 +01:00
e2ab535e6f install_deps: Bump OpenEXR to 2.5.5 version. 2021-02-15 17:44:03 +01:00
0df76ecbf3 Cleanup: Remove code duplication (merge error) 2021-02-15 15:44:52 +01:00
d396016416 Cleanup: clang tidy 2021-02-15 15:30:17 +01:00
b55e7e4895 Cleanup: Spelling in function name 2021-02-15 14:25:21 +01:00
Peter Fog
d8754de7c3 FFmpeg: Improve multi-threading settings for VSE proxies
Following code from D8627 this patch corrects multi threaded processing
of proxies, where a 60 sec proxy generation drops to 35 sec.

Differential Revision: https://developer.blender.org/D8659
2021-02-15 12:29:14 +01:00
5b2bfb2fed FFmpeg: Improve multi-threading settings
Allow use all system threads for frame encoding/decoding. This is very
straightforward: the value of zero basically disables threading.

Change threading policy to slice when decoding frames. The reason for
this is because decoding happens frame-by-frame, so inter-frame threading
policy will not bring any speedup.

The change for threading policy to slice is less obvious and is based on
benchmark of the demo files from T78986. This gives best performance so
far.

Rendering the following file went down from 190sec down to 160sec.

  https://storage.googleapis.com/institute-storage/vse_simplified_example.zip

This change makes both reading and writing faster. The animation render
is just easiest to get actual time metrics.

Differential Revision: https://developer.blender.org/D8627
2021-02-15 12:29:14 +01:00
a923a34de1 CMake/Deps: upgrade USD 20.05 → 21.02
USD version 21.02 includes two of the changes Blender used to patch in,
which have now been removed from `usd.diff`. Unfortunately 21.02
introduces another issue where LZ4 symbols are accidentally exported,
causing linker errors. Fortunately these symbols are only used for
resting, so I added a patch hunk that simply removes their `extern "C"`
declaration.

The LZ4 linker issue has been reported upstream at
https://github.com/PixarAnimationStudios/USD/issues/1447.

Reviewed By: sebbas, mont29

Differential Revision: https://developer.blender.org/D10367
2021-02-15 12:17:08 +01:00
ebdf68a0bb CMake/Deps: OpenImageDenoise 1.2.3 → 1.3.0 2021-02-15 12:17:08 +01:00
Ray molenkamp
da0c5e7224 CMake/Deps: XR_OpenXR v1.0.14
Straight up version bump

Things of note:

They started using API calls only available in windows 8, however given
the Python 3.9 update will forcibly bump us to 8.1+ anyhow this is not
an issue.

Will require some minor tweaks to platform_win32.cmake after adding the
libs to svn which are not included in this diff so this diff can land
without having to have the libs in place yet.

Reviewed By: sebbas, sybren

Differential Revision: https://developer.blender.org/D10349
2021-02-15 12:17:08 +01:00
Ray molenkamp
0a3b076961 CMake/Deps: OpenVDB 8.0.1
Straight forward version bump, some of the variables to detect a static
OpenEXR changed and the folder structure seemingly changed a little
requiring updates to the diff

Reviewed By: sebbas, sybren

Differential Revision: https://developer.blender.org/D10340
2021-02-15 12:17:08 +01:00
649f99b6bc CMake/Deps: Alembic 1.7.16
Version bump + no longer using Boost.

Building Alembic with Boost gave compiler errors, and having one less
inter-dependency is good as well.

Reviewed By: sebbas, sybren

Differential Revision: https://developer.blender.org/D10329
2021-02-15 12:17:08 +01:00
Ray molenkamp
227fa68696 CMake/Deps: TBB 2020U2
Straight forward version bump.

2020U2 is significantly louder in the deprecated header usage warning
department, we should probably see if we need to act on this: P1949

Differential Revision: https://developer.blender.org/D10359
2021-02-15 12:17:08 +01:00
Ray molenkamp
3ba20aa866 CMake/Deps: Boost 1.73
Just a simple version bump.

Maniphest Tasks: T85365

Differential Revision: https://developer.blender.org/D10314
2021-02-15 12:17:08 +01:00
d6b2c18481 Attributes: return refined Attribute from attributes.new method
Previously `mesh.attributes.new(...)` would return a generic attribute that
one could not do much with. Now it returns refined attributes like `FloatAttribute`.
2021-02-15 12:06:40 +01:00
c233f081d6 Merge branch 'blender-v2.92-release' 2021-02-15 11:22:12 +01:00
0ed0b1164a Cleanup: Use enum class for CryptomatteLayerState. 2021-02-15 11:09:17 +01:00
853c4e74ee Cleanup: Grammar in comments 2021-02-15 11:07:11 +01:00
ef02e1be5d Fix: incorrect versioning for Attribute Randomize node 2021-02-15 10:36:35 +01:00
32060ca1f1 Cleanup: unused variable 2021-02-15 10:31:41 +01:00
7c864388fc Fix T71960: Malformed .bmp files lead to crash
Add a boundary check, avoiding access past actual data.

Ideally would need to report error to the user somehow,
but it doesn't seem to be easy to do.

This is a minimal safe patch. The proper complete fix is
being worked on by Jesse.

Differential Revision: https://developer.blender.org/D10357
2021-02-15 10:30:43 +01:00
7a608f88a7 Fix T85633: Misspelling of "neighborhood" in description 2021-02-14 15:31:01 -06:00
80a8df72be Merge branch 'blender-v2.92-release' 2021-02-14 20:52:23 +01:00
2d3b29de4f Fix T85488: Display units inset operator
The inset operator would display the inset thickness and depth as
Blender units during transform. This meant that when the scene units
were set to something different than meters, the display value would
give different results than entering the same number using the value
input. (Similar to D10325)

The fix makes sure that the numbers are always displayed in the correct
scene units.

Reviewed By: campbellbarton

Maniphest Tasks: T85488

Differential Revision: https://developer.blender.org/D10366
2021-02-14 20:51:10 +01:00
Lukas Stockner
2f6d62bf88 Cycles: Implement Dwivedi guiding for path-traced subsurface scattering
Cycles has supported path-traced subsurface scattering for a while, but while it's
more accurate than other approaches, the increase in noise makes it an expensive option.

To improve this, this patch implements Dwivedi guiding, a technique that is based on
zero-variance random walk theory from particle physics and helps to produce shorter
random walks with more consistent throughput.

The idea behind this is that in non-white materials, each scattering event inside the
medium reduces the path throughput. Therefore, the darker the material is, the lower the
contribution of paths that travel far from the origin is.
In order to reduce variance, Dwivedi guiding uses modified direction and distance sampling
functions that favor paths which go back towards the medium interface.
By carefully selecting these sampling distributions, variance can be greatly reduced, and
as a neat side effect shorter paths are produced, which speeds up the process.

One limitation of just blindly applying this is that the guiding is derived from the
assumption of a medium that covers an infinite half-space. Therefore, at corners or thin
geometry where this does not hold, the algorithm might lead to fireflies.
To avoid this, the implementation here uses MIS to combine the classic and guided sampling.
Since each of those works on one of the three color channels, the final estimator combines
six sampling techniques. This results in some unintuitive math, but I tried to structure
it in a way that makes some sense.

Another improvement is that in areas where the other side of the mesh is close (e.g. ears),
the algorithm has a chance to switch to guiding towards the other side. This chance is based
on how deep the random walk is inside the object, and once again MIS is applied to the
decision, giving a total of nine techniques.

Combining all this, the noise of path-traced subsurface scattering is reduced significantly.
In my testing with the Rain character model and a simple lighting setup, the path-traced
SSS is now actually less noisy than the Christensen-Burley approximation at same render time
while of course still being significantly more realistic.

Differential Revision: https://developer.blender.org/D9932
2021-02-14 17:07:19 +01:00
67c8d97db3 Cleanup: spelling 2021-02-14 20:58:04 +11:00
07c6a57507 cmake/deps: Update mesa to 20.3.4
This resolves build error with Py3.9x, use meson build system
since autoconf/automake are no longer supported.

This adds ninja & meson as dependencies for Linux.

Reviewed By: brecht, sybren

Ref D10282
2021-02-14 19:56:55 +11:00
0bc281a6dd Cleanup: Simplify geometry nodes attribute API usage
Getting an "ouput" attribute is equivalent to creating an attribute and
then getting a write attribute. Replace the latter with the former for
consistency with other code, and to decrease the used surface area
of the attribute API to hopefully facilitate future cleanup.
2021-02-13 21:27:39 -06:00
237175e747 Cleanup: use doxy sections 2021-02-14 12:18:42 +11:00
2ff2900f7f Cleanup: use return argument prefix 2021-02-14 11:44:47 +11:00
fa093ef2ff Cleanup: correct/update comments 2021-02-14 11:44:37 +11:00
c2b73dfe91 Cleanup: unused function 2021-02-14 11:27:33 +11:00
90c2307826 Cleanup: remove commented logic for Alt-Pad0 to use previous camera
While this could be useful, it's been removed since 2.4x, keeping this
here doesn't help add it back since it would need to be re-implemented.
2021-02-14 11:20:29 +11:00
3c1e70dedf Cleanup: spelling 2021-02-14 11:19:06 +11:00
luzpaz
f362dad19b Cleanup: Source Code Typos
Corrects approximately 36 spelling errors in source variable names.

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

Reviewed by Hans Goudey
2021-02-13 15:23:49 -08:00
9e81e1c33f EEVEE: Fix glass with sharp distribution not ignoring roughness 2021-02-13 19:08:16 +01:00
aaf1650b09 EEVEE: Change cubemap roughness fit
This changes the roughness mapping to better utilize the mip chain resolution.
This improves glossy reflections with small roughness.

Lightcache version bumped because old data does not have the same roughness
mapping and cannot be used.
2021-02-13 18:55:52 +01:00
e7f61685ed EEVEE: Update Offline LUT
This follows a change in the LUT generation code.
2021-02-13 18:53:51 +01:00
83ac8628c4 EEVEE: Update LUT GGX generation shader
This modifies the principled BSDF and the Glass BSDF which now
have better fit to multiscatter GGX.

Code to generate the LUT have been updated and can run at runtime.

The refraction LUT has been changed to have the critical angle always
centered around one pixel so that interpolation can be mitigated.

Offline LUT data will be updated in another commit

This simplify the BTDF retreival removing the manual clean cut at
low roughness. This maximize the precision of the LUT by scalling
the sides by the critical angle.
I also touched the ior > 1.0 approximation to be smoother.

Also incluse some cleanup of bsdf_sampling.glsl
2021-02-13 18:52:19 +01:00
06492fd619 EEVEE: Fix incorrect fresnel function.
The optimized version was not correct. Also it is not showing any benefit
over the non optimized version.
2021-02-13 18:49:42 +01:00
7f7e683099 EEVEE: Refactor closure_lit_lib.glsl
This refactor was needed for some reasons:
- closure_lit_lib.glsl was unreadable and could not be easily extended to use new features.
- It was generating ~5K LOC for any shader. Slowing down compilation.
- Some calculations were incorrect and BSDF/Closure code had lots of workaround/hacks.

What this refactor does:
- Add some macros to define the light object loops / eval.
- Clear separation between each closures which now have separate files. Each closure implements the eval functions.
- Make principled BSDF a bit more correct in some cases (specular coloring, mix between glass and opaque).
- The BSDF term are applied outside of the eval function and on the whole lighting (was separated for lights before).
- Make light iteration last to avoid carrying more data than needed.
- Makes sure that all inputs are within correct ranges before evaluating the closures (use `safe_normalize` on normals).
- Making each BSDF isolated means that we might carry duplicated data (normals for instance) but this should be optimized by compilers.
- Makes Translucent BSDF its own closure type to avoid having to disable raytraced shadows using hacks.
- Separate transmission roughness is now working on Principled BSDF.
- Makes principled shader variations using constants. Removing a lot of duplicated code. This needed `const` keyword detection in `gpu_material_library.c`.
- SSR/SSS masking and data loading is a bit more consistent and defined outside of closure eval. The loading functions will act as accumulator if the lighting is not to be separated.
- SSR pass now do a full deferred lighting evaluation, including lights, in order to avoid interference with the closure eval code. However, it seems that the cost of having a global SSR toggle uniform is making the surface shader more expensive (which is already the case, by the way).
- Principle fully black specular tint now returns black instead of white.
- This fixed some artifact issue on my AMD computer on normal surfaces (which might have been some uninitialized variables).
- This touched the Ambient Occlusion because it needs to be evaluated for each closure. But to avoid the cost of this, we use another approach to just pass the result of the occlusion on interpolated normals and modify it using the bent normal for each Closure. This tends to reduce shadowing. I'm still looking into improving this but this is out of the scope of this patch.
- Performance might be a bit worse with this patch since it is more oriented towards code modularity. But not by a lot.

Render tests needs to be updated after this.

Reviewed By: jbakker
Differential Revision: https://developer.blender.org/D10390

# Conflicts:
#	source/blender/draw/engines/eevee/eevee_shaders.c
#	source/blender/draw/engines/eevee/shaders/common_utiltex_lib.glsl
#	source/blender/draw/intern/shaders/common_math_lib.glsl
2021-02-13 18:43:09 +01:00
40aadd8940 Build: fix macOS minimum version link warning with pystring
Patch OpenColorIO again to pass along build flags, and remove outdated
patches which were no longer being used.
2021-02-13 15:37:48 +01:00
ec882b8033 Fix geometry nodes build error with TBB enabled and OpenVDB disabled
Don't rely on TBB includes coming along with OpenVDB.
2021-02-13 15:35:33 +01:00
dae445d94a Fix T85573: Building with Python 3.10a5 fails
Replace deprecated _PyUnicode_AsString{AndSize} usage.

T83626 still needs to be resolved before 3.10 is usable.
2021-02-13 23:09:55 +11:00
32660201ac Fixes T84651: Weight paint gradient doesn't auto-normalize weights
Auto-normalize when the option is enabled.

Ref D10239 by @PratikPB2123 with minor edits.
2021-02-13 21:17:35 +11:00
376eedae16 Merge branch 'blender-v2.92-release' 2021-02-13 08:39:39 +01:00
a9092768c0 GPencil: Try again to fix compiler warnings
The windows compiler is not as sensible to this warnings as Linux.
2021-02-13 08:38:38 +01:00
fea335fe8b Cleanup: spelling 2021-02-13 17:44:51 +11:00
474947c465 Cleanup: clang-format 2021-02-13 17:40:10 +11:00
69e9e45744 Cleanup: macro hygiene, use parenthesis around operators 2021-02-13 17:40:10 +11:00
2da649cc50 Cleanup: use doxy sections 2021-02-13 17:40:03 +11:00
0b80201c94 Merge branch 'blender-v2.92-release' 2021-02-13 16:29:37 +11:00
e72ad982ea Merge branch 'blender-v2.92-release' 2021-02-13 16:29:34 +11:00
17a37ed938 Fix brace placement from recent fix for T85581
ccea44e76b missed this expression.
2021-02-13 16:27:04 +11:00
17daf917ee Cleanup: Remove unused outliner enum values
Removes values from various Outliner context menu enums that were unused.
Many of these had been commented out for years. Also deletes some
unused code related to the removed enums. No functional changes.
2021-02-12 18:31:49 -07:00
327e8fb913 RNA Manual Reference: Update mappings 2021-02-12 19:33:32 -05:00
Stephan Seitz
1065b413ed Cleanup: Fix clang compile warning
Use a reference instead of copying the string.

Differential Revision: https://developer.blender.org/D10411
2021-02-12 16:08:01 -06:00
cdb3cbd644 Cleanup: Simplify three functions in displist.c
A few related improvements to the three functions:
 - Reduce variable scope
 - Use for loops instead of while loops
 - Use const, bool instead of int
 - Generally make logic easier to read
2021-02-12 16:06:17 -06:00
85f6674241 Tests: Add additional object to convert curve to mesh file 2021-02-12 16:02:04 -06:00
000a340afa EEVEE: Depth of field: New implementation
This is a complete refactor over the old system. The goal was to increase quality
first and then have something more flexible and optimised.

|{F9603145} | {F9603142}|{F9603147}|

This fixes issues we had with the old system which were:
- Too much overdraw (low performance).
- Not enough precision in render targets (hugly color banding/drifting).
- Poor resolution near in-focus regions.
- Wrong support of orthographic views.
- Missing alpha support in viewport.
- Missing bokeh shape inversion on foreground field.
- Issues on some GPUs. (see T72489) (But I'm sure this one will have other issues as well heh...)
- Fix T81092

I chose Unreal's Diaphragm DOF as a reference / goal implementation.
It is well described in the presentation "A Life of a Bokeh" by Guillaume Abadie.
You can check about it here https://epicgames.ent.box.com/s/s86j70iamxvsuu6j35pilypficznec04

Along side the main implementation we provide a way to increase the quality by jittering the
camera position for each sample (the ones specified under the Sampling tab).

The jittering is dividing the actual post processing dof radius so that it fills the undersampling.
The user can still add more overblur to have a noiseless image, but reducing bokeh shape sharpness.

Effect of overblur (left without, right with):
| {F9603122} | {F9603123}|

The actual implementation differs a bit:
- Foreground gather implementation uses the same "ring binning" accumulator as background
  but uses a custom occlusion method. This gives the problem of inflating the foreground elements
  when they are over background or in-focus regions.
  This is was a hard decision but this was preferable to the other method that was giving poor
  opacity masks for foreground and had other more noticeable issues. Do note it is possible
  to improve this part in the future if a better alternative is found.
- Use occlusion texture for foreground. Presentation says it wasn't really needed for them.
- The TAA stabilisation pass is replace by a simple neighborhood clamping at the reduce copy
  stage for simplicity.
- We don't do a brute-force in-focus separate gather pass. Instead we just do the brute force
  pass during resolve. Using the separate pass could be a future optimization if needed but
  might give less precise results.
- We don't use compute shaders at all so shader branching might not be optimal. But performance
  is still way better than our previous implementation.
- We mainly rely on density change to fix all undersampling issues even for foreground (which
  is something the reference implementation is not doing strangely).

Remaining issues (not considered blocking for me):
- Slight defocus stability: Due to slight defocus bruteforce gather using the bare scene color,
  highlights are dilated and make convergence quite slow or imposible when using jittered DOF
  (or gives )
- ~~Slight defocus inflating: There seems to be a 1px inflation discontinuity of the slight focus
  convolution compared to the half resolution. This is not really noticeable if using jittered
  camera.~~ Fixed
- Foreground occlusion approximation is a bit glitchy and gives incorrect result if the
  a defocus foreground element overlaps a farther foreground element. Note that this is easily
  mitigated using the jittered camera position.
|{F9603114}|{F9603115}|{F9603116}|
- Foreground is inflating,  not revealing background. However this avoids some other bugs too
  as discussed previously. Also mitigated with jittered camera position.
|{F9603130}|{F9603129}|
- Sensor vertical fit is still broken (does not match cycles).
- Scattred bokeh shapes can be a bit strange at polygon vertices. This is due to the distance field
  stored in the Bokeh LUT which is not rounded at the edges. This is barely noticeable if the
  shape does not rotate.
- ~~Sampling pattern of the jittered camera position is suboptimal. Could try something like hammersley
  or poisson disc distribution.~~Used hexaweb sampling pattern which is not random but has better
stability and overall coverage.
- Very large bokeh (> 300 px) can exhibit undersampling artifact in gather pass and quite a bit of
  bleeding. But at this size it is preferable to use jittered camera position.

Codewise the changes are pretty much self contained and each pass are well documented.
However the whole pipeline is quite complex to understand from bird's-eye view.

Notes:
- There is the possibility of using arbitrary bokeh texture with this implementation.
  However implementation is a bit involved.
- Gathering max sample count is hardcoded to avoid to deal with shader variations. The actual
  max sample count is already quite high but samples are not evenly distributed due to the
  ring binning method.
- While this implementation does not need 32bit/channel textures to render correctly it does use
  many other textures so actual VRAM usage is higher than previous method for viewport but less
  for render. Textures are reused to avoid many allocations.
- Bokeh LUT computation is fast and done for each redraw because it can be animated. Also the
  texture can be shared with other viewport with different camera settings.
2021-02-12 22:35:52 +01:00
dd2ff266ac Cleanup: Decrease scope of RNA enum definitions
Since these enums are only used in a single function, they can be
defined where they are used. Similar to rB2f60e5d1b56dfb8c9104.
2021-02-12 13:40:08 -06:00
d4fd06d6ce Geometry Nodes: Add operation setting to attribute randomize node
This commit adds a drop-down to the attribute randomize node to support
a few operations on the values of existing attributes: "Replace/Create"
(the existing behavior), "Add", "Subtract", and "Multiply".
At this point, the operations are limited by what is simple to implement.
More could be added in the future, but there isn't a strong use case
for more complex operations anyway, and a second math node can be used.

Differential Revision: https://developer.blender.org/D10269
2021-02-12 13:25:45 -06:00
d7c2c889a6 Geometry Nodes: Allow attribute nodes to use different domains
Currently every attribute node assumes that the attribute exists on the
"points" domain, so it generally isn't possible to work with attributes
on other domains like edges, polygons, and corners.

This commit adds a heuristic to each attribute node to determine the
correct domain for the result attribute. In general, it works like this:
 - If the output attribute already exists, use that domain.
 - Otherwise, use the highest priority domain of the input attributes.
 - If none of the inputs are attributes, use the default domain (points).

For the implementation I abstracted the check a bit, but in each
node has a slightly different situation, so we end up with slightly
different `get_result_domain` functions in each node. I think this makes
sense, it keeps the code flexible and more easily understandable.

Note that we might eventually want to expose a domain drop-down to some
of the nodes. But that will be a separate discussion; this commit focuses
on making a more useful choice automatically.

Differential Revision: https://developer.blender.org/D10389
2021-02-12 12:46:17 -06:00
ba03f7f0b1 Fix T85562: Remove Win32 RIM_INPUTSINK
Removal of Win32 code that allows background windows to receive raw input.

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

Reviewed by Brecht Van Lommel
2021-02-12 10:40:20 -08:00
97072e0135 Py Doc: Fix rst syntax errors 2021-02-12 13:14:43 -05:00
95cba37190 Py Doc: Delete old deployment scripts
Now, the API docs are deployed via the new devops pipeline developed by 
James.
2021-02-12 13:14:43 -05:00
432b758ae3 Py Doc: Update Sphinx and theme versions 2021-02-12 13:14:43 -05:00
1b4961b318 OpenColorIO: upgrade to version 2.0.0
Ref T84819

Build System
============

This is an API breaking new version, and the updated code only builds with
OpenColorIO 2.0 and later. Adding backwards compatibility was too complicated.

* Tinyxml was replaced with Expat, adding a new dependency.
* Yaml-cpp is now built as a dependency on Unix, as was already done on Windows.
* Removed currently unused LCMS code.
* Pystring remains built as part of OCIO itself, since it has no good build system.
* Linux and macOS check for the OpenColorIO verison, and disable it if too old.

Ref D10270

Processors and Transforms
=========================

CPU processors now need to be created to do CPU processing. These are cached
internally, but the cache lookup is not fast enough to execute per pixel or
texture sample, so for performance these are now also exposed in the C API.

The C API for transforms will no longer be needed afer all changes, so remove
it to simplify the API and fallback implementation.

Ref D10271

Display Transforms
==================

Needs a bit more manual work constructing the transform. LegacyViewingPipeline
could also have been used, but isn't really any simpler and since it's legacy
we better not rely on it.

We moved more logic into the opencolorio module, to simplify the API. There is
no need to wrap a dozen functions just to be able to do this in C rather than C++.
It's also tightly coupled to the GPU shader logic, and so should be in the same
module.

Ref D10271

GPU Display Shader
==================

To avoid baking exposure and gamma into the GLSL shader and requiring slow
recompiles when tweaking, we manually apply them in the shader. This leads
to some logic duplicaton between the CPU and GPU display processor, but it
seems unavoidable.

Caching was also changed. Previously this was done both on the imbuf and
opencolorio module levels. Now it's all done in the opencolorio module by
simply matching color space names. We no longer use cacheIDs from OpenColorIO
since computing them is expensive, and they are unlikely to match now that
more is baked into the shader code.

Shaders can now use multiple 2D textures, 3D textures and uniforms, rather
than a single 3D texture. So allocating and binding those adds some code.

Color space conversions for blending with overlays is now hardcoded in the
shader. This was using harcoded numbers anyway, if this every becomes a
general OpenColorIO transform it can be changed, but for now there is no
point to add code complexity.

Ref D10273

CIE XYZ
=======

We need standard CIE XYZ values for rendering effects like blackbody emission.
The relation to the scene linear role is based on OpenColorIO configuration.

In OpenColorIO 2.0 configs roles can no longer have the same name as color
spaces, which means our XYZ role and colorspace in the configuration give an
error.

Instead use the new standard aces_interchange role, which relates scene linear
to a known scene referred color space. Compatibility with the old XYZ role is
preserved, if the configuration file has no conflicting names.

Also includes a non-functional change to the configuraton file to use an
XYZ-to-ACES matrix instead of REC709-to-ACES, makes debugging a little easier
since the matrix is the same one we have in the code now and that is also
found easily in the ACES specs.

Ref D10274
2021-02-12 19:06:35 +01:00
6b40ee608c OpenColorIO: remove default display workaround
A fix for this is in 2.0 (and recent 1.1.x versions), no need for this anymore.

Differential Revision: https://developer.blender.org/D10275
2021-02-12 19:06:35 +01:00
5393054a5d Geometry Nodes: Add dependency relation for collection objects
Currently moving or changing an object references in a node modifier's
node group does not trigger re-evaluation. Because there is no collection
relation in the dependency graph, we must add the relation to all objects
in the collection individually.
2021-02-12 12:03:38 -06:00
a4baedea91 Geometry Nodes: Make instances real on-demand
This commit makes the geometry output of the collection info usable.
The output is the geometry of a collection instance, but this commit
adds a utility to convert the instances to real geometry, used in the
background whenever it is needed, like copy on write.

The recursive nature of the "realize instances" code is essential,
because collection instances in the `InstancesComponent`, might have no
geometry sets of their own containing even more collection instances,
which might then contain object instances, etc.

Another consideration is that currently, every single instance contains
a reference to its data. This is inefficient since most of the time
there are many locations and only a few sets of unique data. So this
commit adds a `GeometryInstanceGroup` to support this future optimization.
The API for instances returns a vector of `GeometryInstanceGroup`.
This may be less efficient when there are many instances, but it makes
more complicated operations like point distribution that need to iterate
over input geometry multiple times much simpler.

Any code that needs to change data, like most of the attribute nodes,
can simply call `geometry_set_realize_instances(geometry_set)`,
which will move any geometry in the `InstancesComponent` to new "real"
geometry components.

Many nodes can support read-only access to instances in order to avoid
making them real, this will be addressed where needed in the near future.

Instances from the existing "dupli" system are not supported yet.

Differential Revision: https://developer.blender.org/D10327
2021-02-12 11:58:15 -06:00
ff3df2ea56 Merge branch 'blender-v2.92-release' 2021-02-12 17:50:44 +01:00
98db4cc639 Fix T84899: instance ids are not unique in common cases
Ids stored in the `id` attribute cannot be assumed to be unique. While they
might be unique in some cases, this is not something that can be guaranteed
in general. For some use cases (e.g. generating "stable randomness" on points)
uniqueness is not important. To support features like motion blur, unique ids
are important though.

This patch implements a simple algorithm that turns non-unique ids into
unique ones. It might fail to do so under very unlikely circumstances, in
which it returns non-unique ids instead of possibly going into an endless
loop.

Here are some requirements I set for the algorithm:
* Ids that are unique already, must not be changed.
* The same input should generate the same output.
* Handle cases when all ids are different and when all ids are the same
  equally well (in expected linear time).
* Small changes in the input id array should ideally only have a small
  impact on the output id array.

The reported bug happened because cycles found multiple objects with
the same id and thought that it was a single object that moved on every
check.

Differential Revision: https://developer.blender.org/D10402
2021-02-12 17:44:27 +01:00
c04bcc87fe Merge branch 'blender-v2.92-release' 2021-02-12 16:54:50 +01:00
ccea44e76b GPencil: Fix compiler warnings after previous commit
These warnings were not detected by Windows compiler as the Linux compiler does.
2021-02-12 16:54:22 +01:00
5b073a9590 Merge branch 'blender-v2.92-release' 2021-02-12 15:24:20 +01:00
72989f9d0b Fix T85581: GPencil draw on surface does not work
The problem was the stroke was reproject flat to view if the axis was View. Now, if the operation is using depth, the stroke is not reprojected.

Related to T85082
2021-02-12 15:23:47 +01:00
dad32cbd17 Merge branch 'blender-v2.92-release' 2021-02-12 15:22:21 +01:00
9febda912b Baking: support vertex color baking of normal material, UV discontinuities
Baking vertex colors per-corner leads to unwanted discontinuities when there is
sampling noise, for example in ambient occlusion or with a bevel shader node for
normals. For this reason the code used to always average results per-vertex.

However when using split normals, multiple materials or UV islands, we do want to
preserve discontinuities. So now bake per corner, but make sure the sampling seed
is shared for vertices.

Fix T85550: vertex color baking crash with split normals, Ref D10399
Fix T84663: vertex color baking blending at UV seams
2021-02-12 15:01:29 +01:00
7db00556fa CMake/Deps: fix build of nasm when asciidoc and xmlto are unavailable
Create zero-byte manual page files `nasm.1` and `ndisasm.1` such that
nasm's `make install` step succeeds.

Installing nasm requires that its manual pages are built. This requires
local packages `asciidoc` and `xmlto` to be installed.

Not only does `asciidoc` pull in 110 MB of packages (itself +
dependencies), there is also no need for these manual pages. Nasm is
just used for building other dependencies, and not even part of our
precompiled libraries in SVN.

Reviewed By: sebbas

Differential Revision: https://developer.blender.org/D10396
2021-02-12 14:54:08 +01:00
780cabb7a8 Fix T85558: crash changing the resolution mode of the "volume to mesh" node
The nodes update function geo_node_volume_to_mesh_update would not run
if it is not the very first node in the tree.
If the update function is not run, there are sockets not cleared from
the SOCK_UNAVAIL flag (but this needs to be done -- these get available
depending on the chosen mode).

Havent tracked down why this was actually updating when it was the first
node in the tree, but now make sure we always get an update by specifing
an appropriate RNA update callback for the property.

Maniphest Tasks: T85558

Differential Revision: https://developer.blender.org/D10403
2021-02-12 13:59:53 +01:00
fd8ac0b0f4 Merge branch 'blender-v2.92-release' 2021-02-12 12:34:41 +01:00
9fa6e06287 Geometry Nodes: remove incorrect assert
It is perfectly valid that an attribute does not exist and cannot be created.
For example, this can happen when a mesh does not contain any vertices.
2021-02-12 12:33:04 +01:00
ed667e344d Merge branch 'blender-v2.92-release' 2021-02-12 11:55:42 +01:00
26481eabe1 Cycles: Use Blender Settings For AOV
This patch will share the AOV settings between Cycles and Eevee.
It enable using the AOV name conflict detection of Blender. This
means that unlike how Cycles used to work it isn't possible to add an
AOV with a similar name. Conflicts with internal render pass names will
be indicated with an Warning icon.

Reviewed By: Brecht van Lommel

Differential Revision: https://developer.blender.org/D9774
2021-02-12 11:35:05 +01:00
9a7dc41dd9 Fix T85545: changing position attribute does not tag normals dirty
This makes it so that normals are tagged dirty whenever the position
attribute is requested for writing. This seems like a good default. If the
calling code is aware of normals, it could untag normals when they are
not changed by the operation.

Differential Revision: https://developer.blender.org/D10397
2021-02-12 11:31:15 +01:00
837b5743ce Fix T79999: Double color management applied during viewport animation render
In 2.81 there was a change to increase the performance of viewport
animation rendering. This change would perform the color management on the
GPU if the only 8bit was needed. This saved CPU cycles and data
transfer.

The issue is that in the image editor or when saving the image the CM
will be reapplied. Although the speed is desired, exporting the actual
colors has more priority.

In the ticket there is an analysis that shows that shows that this fix
is the correct short term step to take. It would be better that the
render result is aware of the color space of its buffers so the applying
color management could be skipped when saving to disk or drawing in the
image editor.

The issue with this change is the performance penalty it has.

Reviewed By: Brecht van Lommel

Maniphest Tasks: T79999

Differential Revision: https://developer.blender.org/D10371
2021-02-12 08:23:03 +01:00
33145dd187 Fix T79999: Double color management applied during viewport animation render
In 2.81 there was a change to increase the performance of viewport
animation rendering. This change would perform the color management on the
GPU if the only 8bit was needed. This saved CPU cycles and data
transfer.

The issue is that in the image editor or when saving the image the CM
will be reapplied. Although the speed is desired, exporting the actual
colors has more priority.

In the ticket there is an analysis that shows that shows that this fix
is the correct short term step to take. It would be better that the
render result is aware of the color space of its buffers so the applying
color management could be skipped when saving to disk or drawing in the
image editor.

The issue with this change is the performance penalty it has.

Reviewed By: Brecht van Lommel

Maniphest Tasks: T79999

Differential Revision: https://developer.blender.org/D10371
2021-02-12 07:53:50 +01:00
c10ad8e9ea UI: expose the 3D views active object, even when hidden
The previous behavior meant that changing an objects visibility
effectively changed the current mode - which missed necessary
updates for the tool-system (for example).

There was already a check for edit-mode, now expected to all modes.

This makes the test-case described in T83013 work as expected.
2021-02-12 17:09:34 +11:00
Juanfran Matheu
631cc5d56e WM: Add 'Confirm On Release' option for WM_OT_radial_control
Adds a new property called "Confirm On Release" that does what it says,
confirm the action without having to do left-click or to press any other
extra-key which concludes in a more dynamic and efficient way of changing
brush size or strength for example, especially for tablet users.

Reviewed By: campbellbarton

Ref D10233
2021-02-12 16:45:29 +11:00
5a15039530 Cleanup: use the assignment operator with list-comprehension 2021-02-12 16:35:16 +11:00
9d3d2fa031 Cleanup: don't subclass 'Panel' for mix-in classes
This reports warnings with `--debug-python` since all panel
sub-classes are expected to be registered.
2021-02-12 16:35:16 +11:00
fae3057084 Cleanup: remove unused panel SEQUENCER_PT_sound
These have since been moved to SEQUENCER_PT_source.
2021-02-12 16:35:16 +11:00
6a12c50703 Docs: add notes to 'make deps' & the sqlite build configuration
- Move non-blender build targets into their own section.
- Expand 'make help' text, noting a local 'make deps' overrides.
- Note where the spell checkers word-list is maintained.
- Note on why sqlite is built without 'tcl'.
2021-02-12 16:33:59 +11:00
3fea77ceed CMake: update MSVC PDB path reference
Replace literal number with a variable.
2021-02-12 08:15:09 +11:00
cafd6b519c PyAPI: Use PyPreConfig & PyConfig for Python initialization
Use Python 3.8's API for setting the initial configuration.

This replaces a mix of our logic and direct calls to the Python API
and has no user visible changes.

Using the Python API makes the logic easier to follow and provides
utilities such as `PyConfig_SetBytesArgv`
that wasn't available in previous releases.

Note that this uses Python's utf8/wchar_t conversions,
which used to cause problems (see T31506).

Since `Py_UTF8Mode` was set, the systems locale isn't used for decoding,
allowing us to use Python's utility functions that call
`Py_DecodeLocale` internally.

Ref D10382
2021-02-12 08:10:12 +11:00
aa43e2ec29 PyAPI: use PyModule_AddType utility function 2021-02-12 08:08:16 +11:00
d21f445469 PyAPI: remove Python 3.7x compatibility code
This removes Python version checks needed to build with 3.8+ and 3.7x.

Ref D10381
2021-02-12 08:08:15 +11:00
7952ed872a CMake: update python to 3.9.1
Default to Python version 3.9.

Reviewed By: LazyDodo, sybren, sebbas

Ref D10380
2021-02-12 07:50:01 +11:00
35ddcb4041 Cleanup: clang-format, spelling 2021-02-12 07:49:40 +11:00
Habib Gahbiche
b6d7aa9e13 Mesh automated testing: compare selection
MeshTest now compares selection between evaluated mesh and expected mesh. This way, we can test more operators
such as `faces_select_linked_flat`

Note: selection comparison intentionally does not happen in BKE_mesh_cmp() on C side but rather on Python side, because
selection is independent of mesh generation.

Reviewed By: calra, mont29

Differential Revision: https://developer.blender.org/D10279
2021-02-12 01:33:56 +05:30
847da6176e Fix finding system Haru library on Debian.
Paths and names of system packages-installed libhpdf on Debian (and
probably its derived distributions?) are slightly different than what
was given to CMake finding script.
2021-02-11 20:28:10 +01:00
ed817d62bd Cleanup: Python GPU: Use consistent prefixes for local API
It was not following the own documentation at the top code that mentions
that for local API the prefix is "bpygpu_".
2021-02-11 16:13:02 -03:00
Habib Gahbiche
a608313860 Mesh automated testing: improve progress printing
Print number of total tests with each test to show how many tests have been executed and how many are left.
Example: `Running test 27/36: PlaneFaceSplitByEdges...`

Reviewed By: calra, mont29

Differential Revision: https://developer.blender.org/D10278
2021-02-11 23:07:03 +05:30
Habib Gahbiche
916e3b6e3d Cleanup: delete comments with test index
Tests are not identified with indexes, so no need to maintain comments with indexes anymore

Reviewed By: calra, mont29

Differential Revision: https://developer.blender.org/D10277
2021-02-11 22:56:54 +05:30
6a5d17bfb2 Cleanup: Remove unused variable 2021-02-11 10:27:25 -06:00
05bbe3f8ef Merge branch 'blender-v2.92-release' 2021-02-11 10:23:33 -06:00
314525b8cf Fix T85555: Geometry Nodes: Attribute Vector Math Wrap is broken
This was just a copy and paste error / typo. The proper DNA variable
wasn't used. Thanks @charlie for finding the issue.
2021-02-11 10:22:57 -06:00
4f8bc3e35c GPencil: Move Autofit parameter from topbar to advanced panel
As this is used only in corner cases, it is better keep in advanced panel.

Also renamed to "Limit to Viewport"
2021-02-11 15:59:53 +01:00
18ac37a39b Merge branch 'blender-v2.92-release' 2021-02-12 00:42:36 +11:00
196dfc01a3 Fix T84114: Existence of vertex groups slows down mesh editing
Having a vertex group in a mesh slowed down unrelated operations
such as selection.

De-duplicating custom-data arrays for layers that contain pointers
can become slow without any benefit as the content never matches.

Use full copies when storing custom-data for edit-mesh undo.
2021-02-12 00:40:58 +11:00
dabf96f732 Attributes: support bool attribute in rna
Differential Revision: https://developer.blender.org/D10387
2021-02-11 13:44:58 +01:00
6ca992b017 Merge branch 'blender-v2.92-release' 2021-02-11 12:34:51 +01:00
b20872d36e Fix T85543: Object Types Visibility missing shading notifier
Caused by rB0f95f51361d7.

Similar to T85515, T84717 and their related fixes.
In this case, add missing shading notifier as in rB9274bd457a25.

Maniphest Tasks: T85543

Differential Revision: https://developer.blender.org/D10395
2021-02-11 12:30:41 +01:00
349c17cf54 Fix T85462: crash in render mode while removing instances
This crash is caused by accessing object data in the kernel at an out of bound index from a deleted instance.

Cycles represents instances as Object nodes sharing the same Geometry node, so we need to tag the GeometryManager for an update if some objects are added or removed as no geometry might have been added or removed in order to properly update the BVH and its associated data arrays.

Regression caused by rBbbe6d4492823.
2021-02-11 12:03:26 +01:00
69e191604b Fix T85541: crash when replacing an existing node link
It's not necessary to check if the link has to be removed,
if it was removed already.

This regression was caused by rB8f707a72e81833bb835324ddc635b29dfbe87a9f.
2021-02-11 11:50:12 +01:00
Fabian Schempp
8f707a72e8 UI: Multi-input node socket spacing and interaction
This commit makes links connected to multi-input sockets spread verticaly
along the socket. Sockets grow if more links are connected and the node
layout updates accordingly. Links are sorted by their incoming angle
to avoid crossing links. Also, link picking is updated to work with
spread links and bezier links.

Currently the multi-input sockets are used in the join geometry node.

The mutli-input sockets look like a vertical rounded rectangle.
Currently they do not support the other custom socket shapes.

Reviewed By Hans Goudey, with cleanup and additional edits

Differential Revision: https://developer.blender.org/D10181
2021-02-11 01:16:17 -06:00
Fabian Schempp
9a9e19fdcc Geometry Nodes: Use multi-input socket in join geometry node
This updates the join node to use the new multi-input socket from D10067.
The change just requires slightly changing the arguments of the exec
function, and changing the socket input list.

Note that this commit does not contain the UI changes, it only allows for
more input links, and combines the two sockets into one. The UI changes
will come next.

Reviewed By: Hans Goudey

Differential Revision: https://developer.blender.org/D10069
2021-02-11 00:23:15 -06:00
faad487b58 Cleanup: remove version check for unsupported cmake version 2021-02-11 15:57:24 +11:00
b0e483c373 Fix ASAN report when creating attribute math node
The DNA struct name for the node storage was incorrect.
2021-02-10 22:54:45 -06:00
ed1945c801 Merge branch 'blender-v2.92-release' 2021-02-11 12:40:07 +11:00
52cfc620c8 Fix T83013: Annotation with hidden object in sculpt mode crashes
This just avoids the crash, the annotation tool still doesn't work.

Larger changes will be needed to resolve this, see T85532.
2021-02-11 12:34:41 +11:00
175325ebdb Merge branch 'blender-v2.92-release' 2021-02-11 08:40:19 +11:00
16c621e529 Merge branch 'blender-v2.92-release' 2021-02-11 08:40:16 +11:00
1a52b5f7d3 Merge branch 'blender-v2.92-release' 2021-02-11 08:40:12 +11:00
15785b35f3 Merge branch 'blender-v2.92-release' 2021-02-11 08:40:09 +11:00
f1ee345f99 Cleanup: incompatible-pointer-types warning 2021-02-11 08:38:52 +11:00
2d252b6d26 Fix T85508: UV select overlap fails on identical faces
The triangle overlap test failed for exactly overlapping triangles.

When none of the segments intersect, testing a if a single corner
is inside the other triangle fails when the triangles share UV
coordinates.

Resolve by comparing the triangle centers.
2021-02-11 08:35:16 +11:00
4719836eca BLI_math: add mid_v2_v2v2v2 2021-02-11 08:27:28 +11:00
9274bd457a Fix T85515: missing viewport update when toggling Hidden Wire
This is in the overlay popover but also affects shading.
2021-02-10 19:49:10 +01:00
Brecht Van Lommel
677e63d518 TBB: fix deprecation warnings with newer TBB versions
* USD and OpenVDB headers use deprecated TBB headers, suppress all deprecation
  warnings there since we have no control over them.
* For our own TBB includes, use the individual headers rather than the tbb.h that
  includes everything to avoid warnings, rather than suppressing all.

This is in anticipation of the TBB 2020 upgrade in D10359. Ref D10361.
2021-02-10 19:32:24 +01:00
69c7ffff8b Transform: refactor createTransData splitting into more specific functions
Currently, `createTransData` is doing much more than the name implies.

This commit makes it clearer through smaller and more specific functions
what the real purpose of that function.
2021-02-10 15:29:05 -03:00
62f0d51681 Fix T85494: Click and drag of the 3d cursor turns off proportional editing
Missed `CTX_NO_PET`.

This commit also reorganizes the code to make it clearer when using flags.
2021-02-10 15:23:28 -03:00
f75a711178 CMake/Deps: Fix building cython on windows
For the debug version of cython pip was trying to link
against the release version of python for some strange
reason. Passing some flags to explicitly target the
debug version fixes the issue.

Given other platforms do not have different builds for
debug/release this is not an issue there.
2021-02-10 11:20:49 -07:00
4818ed1c76 Cleanup: Unindent if statements in sculpt tools code
This removes indentations from if statements by converting them to early
returns and continue.
Most of the code of brushes and tools has loops with a full indented
body inside of an if, which was also copied into some of the new tools.

Reviewed By: JacquesLucke

Differential Revision: https://developer.blender.org/D10333
2021-02-10 18:06:56 +01:00
54cbfeedd7 Cleanup/fix warnings.
Own dummy mistakes in rBf269fbd64a5a0cb7.
2021-02-10 17:48:49 +01:00
e03cfc2374 Fix T85420: moving color ramp handles via position input does not work
This just needed some special case handling for the new attribute color ramp node...
2021-02-10 17:29:52 +01:00
f269fbd64a LibOverride: Refactor: Switch more code to using Main.relations.
This potentially could fix some missed cases in dependency tagging (when
dealing with overrides hierarchies), since relying on tag in ID itself
is not a good idea to check whether an ID has been propcessed or not
(exterior code may have forced that tag on some IDs e.g., which would
prevent them from ever being processed properly).
2021-02-10 17:10:43 +01:00
b5536c97b7 Merge branch 'blender-v2.92-release' 2021-02-10 16:53:40 +01:00
40a1861265 Fix T85514: exact match is not showing up in search menu
The `get_shortest_word_index_that_startswith` function was not doing
what it was supposed to do. This resulted in wrong matches.
2021-02-10 16:52:09 +01:00
806b22d130 Cleanup: typo
Committing this to the release branch, to avoid merge conflicts with an
upcoming fix.
2021-02-10 16:52:09 +01:00
bdb83cc32c Fix T85471: Wrong orientation in transforming objects in weight paint mode
The local orientation chosen was that of the active object, but as
confirmed in other parts of the code, the orientation of the selected
Bone has priority.
2021-02-10 12:32:46 -03:00
d9eeb7840f Merge branch 'blender-v2.92-release' 2021-02-10 13:30:07 +01:00
97cc130f47 Fix T85395: Texture paint external edit wrong projection on reapply
Caused by rB5b34d11b55e0.

Above commit restored the view matrices in ED_view3d_draw_offscreen
_before_ they can be stored in the ImBuff (see ED_view3d_draw_offscreen
/ texture_paint_image_from_view_exec).

Now make restoring the view matrices optional and dont do this in case
of reprojection, so the used matrices can still be saved in the ImBuff
later.

Reviewed By: campbellbarton

Maniphest Tasks: T85395

Differential Revision: https://developer.blender.org/D10331
2021-02-10 13:25:31 +01:00
4c883fd04e Merge branch 'blender-v2.92-release' 2021-02-10 12:49:54 +01:00
d76890bfb0 Fix T85492: fix check if object has visible instances
Without this, `OB_VISIBLE_INSTANCES` would be added to `visibility` incorrectly,
leading to unexpected visibility changes down the line.
2021-02-10 12:48:17 +01:00
db9d40b9d3 CMake: set compiler-ccache & build-type-init variables as advanced
These settings aren't useful for basic configuration.
2021-02-10 17:44:14 +11:00
328a8c68b7 Fix Geometry Nodes: Broken built-in attribute exists check
Fixes an issue in a node setup with the point separate node, where muting
a node that does nothing breaks the operation, resulting in the point
separate not copying the position attrbute to either result.

The fix is straightfoward, it looks just like a typo.

Differential Revision: https://developer.blender.org/D10379
2021-02-09 22:55:59 -06:00
d72595a594 Cleanup: Remove unecessary padding from small DNA structs
After {rBa0867f05a48e2017a}, it is no longer necessary to pad
structs with 1 and 2 byte sizes. Most of these are geometry node
structs, where we've been avoiding using `node.custom1`.

I only found two others, the freestyle flags in custom data DNA.

Differential Revision: https://developer.blender.org/D10335
2021-02-09 20:26:58 -06:00
53ae2c2a40 Merge branch 'blender-v2.92-release' 2021-02-10 01:18:37 +01:00
f617782fc1 Fix Sculpt Gestures using normal orientation with translated objects
This fixes two issues that were preveting normal orientation for working:

- The translation of component of the object matrix should not be
considered when converting a normal to world space.
- Whe using cursor for depth, the depth for the shape should be taken
directly from the cursor (which is already unprojected and updated)
instead of from the brush, which may have not been updated.

Reviewed By: dbystedt, JacquesLucke

Differential Revision: https://developer.blender.org/D10231
2021-02-10 01:16:53 +01:00
1c4ae8a11c UI: Removal of GHOST_CreateDialogWindow
Simplification of window creation code to allow greater flexibility.

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

Reviewed by Brecht Van Lommel
2021-02-09 16:14:31 -08:00
2a670a34be Fix T83047: Texture paint symmetry options not in topbar
The texture paint mode was accidentally removed from the list

Reviewed By: JacquesLucke

Maniphest Tasks: T83047

Differential Revision: https://developer.blender.org/D10216
2021-02-10 01:10:58 +01:00
8fcf3e96fe Fix T85079: Thumb brush unstable when producing larger displacements
The thumb brush was updating the area normal per brush sample, which was
making unstable sampled normals for setting the displacement direction
when the vertices are moved too much from their original positions.
Now it always uses the original normal except when using anchored
strokes. In those cases, the normal always needs to be updated.

Reviewed By: JacquesLucke

Maniphest Tasks: T85079

Differential Revision: https://developer.blender.org/D10214
2021-02-10 01:09:25 +01:00
5bddfde217 cmake/deps: update Python to 3.9.1
The following packages also have received updates:

- IDNA 2.10
- CHARDET 4.0.0
- URLLIB3 1.26.3
- CERTIFI 2020.12.5
- REQUESTS 2.25.1
- NUMPY 1.19.5

numpy has gained a hard dependency on cython:

- CYTHON 0.29.21

Notes:

- This only updates the build environment files,
  once these are built, Blender can default to Python 3.9.
- The 'm' suffix for Python binaries/libs has been removed.
- The macOS patch in Python 3.7 is has been removed.

Reviewed By: sybren, campbellbarton, sebbas

Ref D10257
2021-02-10 09:38:48 +11:00
bdb42c2c2d Cleanup: remove redundant headers in source/blender/editors/
Remove redundant headers using
`./source/tools/utils_maintenance/code_clean.py`

Reviewed By: jmonteath

Ref D10364
2021-02-10 09:38:24 +11:00
7b84a5a370 Cleanup: spelling 2021-02-10 09:38:24 +11:00
201865b6f7 Cleanup: update old comments 2021-02-10 09:38:19 +11:00
de0801c3d6 Cleanup: clang-format 2021-02-10 09:29:48 +11:00
048dd8454c Cleanup: warning (useless type qualifier) 2021-02-10 09:29:48 +11:00
Victor-Louis De Gusseme
722790e8d2 Fix T85493: Attribute glitches while using Attribute Proximity node
The span fill was in multithreaded code, so calculated values were
sometimes reset. The fix is to move FLT_MAX fill outside of parallel_for.

Differential Revision: https://developer.blender.org/D10378
2021-02-09 16:24:49 -06:00
a86605fffd LibOverride: Refactor: Switch more code to using Main.relations.
This potentially could fix some missed cases in dependency tagging (when
dealing with overrides hierarchies), since relying on tag in ID itself
is not a good idea to check whether an ID has been propcessed or not
(exterior code may have forced that tag on some IDs e.g., which would
prevent them from ever being processed properly).
2021-02-09 21:53:47 +01:00
87c75767b3 Fixed (unreported) memleak in recent BMain relations new code.
Forgot to free the GHash iterator.
2021-02-09 21:38:57 +01:00
510db9512f Outliner: Enable render visibility column by default
The render visibility column in the outliner should be enabled by
default. This change makes it more obvious which objects will be
rendered which can be misleading when only viewport visibility toggles
are shown by default. This commit enables the render visibility column
in all existing and new Outliner editors.

Differential Revision: https://developer.blender.org/D10365
2021-02-09 12:03:53 -07:00
bace031b65 Fix (unreported) assert in liboverride reset code.
Invalid override properties ( i.e. invalid RNA paths) are not strictly
speaking errors, many things can lead to that situation. Just ignore and
skip those cases.
2021-02-09 18:53:52 +01:00
ebdaa52fa7 LibOverride: Refactor a bit override hierarchy utils.
Use LibOverrideGroupTagData helper struct a bit more widely.
2021-02-09 18:53:04 +01:00
Wannes Malfait
a2ba37e5b6 Geometry Nodes: Add Combine and Separate XYZ nodes for attributes
These are similar to the regular "Combine XYZ" and "Separate XYZ" nodes,
but they work on attributes. They will make it easier to switch between
vector attributes and float attributes.

Differential Revision: https://developer.blender.org/D10308
2021-02-09 11:12:24 -06:00
34155dd29b install_deps: Update OpenXR repository info
The repository information for cloning the OpenXR repository, rather than just
downloading the source archive, was outdated.
* Use the OpenXR-SDK repository link, not the OpenXR-SDK-Source one. Only the
  former is needed, it contains pregenerated files with minimum dependencies.
  The latter contains additional tools and the un-generated source files.
* Update the commit hash to the version we currently use, 1.0.14 (was 1.0.6).

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

Reviewed by: Bastien Montagne
2021-02-09 17:10:26 +01:00
4e92be6d72 LibOverride: Verious minor cleanups and fixes to code tagging IDs in an override hierarchy. 2021-02-09 16:52:53 +01:00
9e1065ead2 LibOverride: cleanup: code consistency.
Properly fully extract
`lib_override_hierarchy_dependencies_recursive_tag` from
`lib_override_linked_group_tag`.

Was supposed to be that way already (see comment of
`lib_override_linked_group_tag`), for some reasons this case was missed.
2021-02-09 16:52:53 +01:00
b926c9f345 Transform: Expose the hardcoded Precision Key
As shown on the T85383, attempts are made to edit the precision mode key.

But that key was hardcoded.

That key now appears among the custom modal keymap items.
2021-02-09 12:29:00 -03:00
e44b2ada3e GPencil: Basic block drawing in Dopesheet
Add a bar between keyframes to indicate that keyframe is still used. This is part of a change to make the rec button be used by gpencil.

Example:

Before:
{F9592704}

After:
{F9592702}

Reviewed By: #user_interface, #grease_pencil, pepeland, Severin

Maniphest Tasks: T85463

Differential Revision: https://developer.blender.org/D10179
2021-02-09 16:08:45 +01:00
1352d81b17 GPencil: Fill tool refactor and Multiframe in Draw mode
This commit is a refactor of the fill tool to solve several problems we had since the first version of the tool.

Changes:

* The filling speed has been improved for each step of the process with the optimization of each algorithm/function.
* New `AutoFit` option to fill areas outside of the viewport. When enable, the total size of the frame is calculated to fit the filling area.
* New support multiframe filling. Now it is possible to fill multiple similar frames in one go.
* New `Stroke Extension` option to create temporary closing strokes. These strokes can be displayed and adjusted dynamically using wheel mouse or PageUp/Down keys.
* Parameter `Resolution` now is named `Precision` and has been moved to topbar.
* `Resolution` now has decimals and can be lower than 1 to allow quick filling in storyboarding workflows. Maximum value has been set as 5.
* Parameter `Simplify` has been moved to Advanced panel.
* Improved fill outline detection. In some cases, the outline penetrated the area to be filled with unexpected results.
* Fixes some corner case bugs with infinite loops.

As a result of this refactor, also these new functionalities has been added.

* New support for multiframe in `Draw` mode. Any drawing in active frame is duplicated to all selected frame.
* New multiframe display mode. Keyframes before or after of the active frame are displayed using onion colors. This can be disable using Onion overlay options.
2021-02-09 16:00:36 +01:00
5213b18eb2 Cycles: fix wrong flags used to tag device data as dirty
Also fixes missing modified tag for float2 and float3 attributes arrays.
2021-02-09 14:50:00 +01:00
5321e844d3 CMake/Linux: Add libharu to platform_linux.cmake
Since GPencil changes depending on libharu may be committed to master
before SVN libraries for all platforms are in place, avoid build issues.
Extension of D9928.

Reviewed By: sybren

Differential Revision: https://developer.blender.org/D10280
2021-02-09 14:36:29 +01:00
a7b931e87f Cleanup: comments, replace German expression with English 2021-02-09 22:31:28 +11:00
62195fb5b3 Cleanup: comments, replace 'undoes' with 'undo-steps' 2021-02-09 22:31:28 +11:00
ee585b9c21 Fix: use class instead of struct in forward declaration 2021-02-09 11:47:49 +01:00
17672efa0e Geometry Nodes: initial attribute interpolation between domains
This patch adds support for accessing corner attributes on the point domain.
The immediate benefit of this is that now (interpolated) uv coordinates are
available on points without having to use the Point Distribute node.

This is also very useful for parts of T84297, because once we have vertex
colors, those will also be available on points, even though they are stored
per corner.

Differential Revision: https://developer.blender.org/D10305
2021-02-09 11:45:04 +01:00
4601e3a591 Geometry Nodes: refactor internal attribute access architecture
Goals:
* Clarify the distinction between builtin and other attributes at the code level.
* Reduce number of places that need to be modified to add more builtin attributes.
* Reduce number of virtual methods that need to be implemented by e.g. `MeshComponent`.

To achieve these goals, this patch implements the concept of "attribute providers".
An attribute provider knows how to give access to attributes on a geometry component.
Each geometry component can have multiple attribute providers, whereby each provider
manages an different set of attributes.

The separation of builtin and other attributes is now done at the attribute provider level.
There are two types of attribute providers. One for builtin attributes and one for all others.

This refactor also helps with T84297.

Differential Revision: https://developer.blender.org/D10341
2021-02-09 11:24:28 +01:00
494913f17a Merge branch 'blender-v2.92-release' 2021-02-09 08:13:33 +01:00
549d9f8727 Fix T81206: Do not limit gl texture size in image editor
This patch will show textures in the image editor with the maximum
available resolution determined by the GPU Hardware/Driver.
Currently the size is limited by the user preference texture size limit.

An image user can set the `IMA_SHOW_MAX_RESOLUTION` flag to request
gpu textures in the max supported resolution. When this flag isn't
set the gpu texture is limited by the user preference setting.

When the gl resolution limit is disabled the GPU texture is always
created for the max supported resolution.

Reviewed By: Clément Foucault

Maniphest Tasks: T81206

Differential Revision: https://developer.blender.org/D9160
2021-02-09 08:12:29 +01:00
10f44a4135 Fix versioning code of previous commit 2021-02-09 08:11:56 +01:00
eab9165c25 Cleanup: spelling 2021-02-09 10:42:00 +11:00
3b1c7a6d6f Cleanup: move eIconSizes, ID_Type enums into own file
This avoids adding DNA_ID.h into other headers, recently changed in
cfa48c84d0

Note that other enums could be moved too, this is a smaller change
to avoid indirectly including DNA_ID.h in many places.
2021-02-09 09:58:06 +11:00
cfa48c84d0 Cleanup: Register node property layout callbacks in files
This commit moves the property layout callbacks for node types to their
implementation files from `drawnode.c`. This was proposed a while ago in
T75724.

**Benefits**
 - Fewer files need to be changed when adding a new node.
 - Makes it possible to reuse functions from the node's implementation
   in the layout code.
 - Except for RNA, all of the node "inputs" are in the same place.
 - Code gets shorter overall, avoids the large switch statements.

**Downsides**
 - Requires including two UI headers.
 - Requires adding an editors dependency to the nodes folder.

This commit only changes function nodes and geometry nodes, more can be
moved later.

Differential Revision: https://developer.blender.org/D10352
2021-02-08 15:09:49 -06:00
13299a7367 Docs: Remove CLI arguments removed in recent commit
This commit follows up on rBbc94036a76b63254181788ce5814fb946f52a287
and removes the arguments from the CLI args docs.
2021-02-08 15:27:49 -05:00
694bc4d040 Fix for T84038: Improved Report Warnings
Improved contrast for Status Bar report warning messages.

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

Reviewed by Hans Goudey
2021-02-08 08:19:23 -08:00
21a2b975b8 Cleanup: Remove using-directive from freestyle headers
The header files in freestyle utilize the using-directive at the global
file scope. This is a bad practice as it pollutes the global name space
causing possible ambiguous reference compilation errors. In particular,
the DNA files that are included by freestyle will cause those ambiguous
reference errors when the developers adds a DNA member with a type name
that also exist in the Freestyle name space, such as Curve and possibly
others.

This patch does the minimal work needed to resolve that by moving the
using-directives from the headers into the corresponding translation
units.

Reviewed By: Brecht

Differential Revision: https://developer.blender.org/D10351
2021-02-08 17:29:42 +02:00
048135e2c8 Fix T85448: File Browser sidebar collapses when selecting a file
The logic to ensure a valid region state was too aggressive in setting the
region hiding. It would just always update it based on the operator's
`hide_props_region` option, not only when file browser was newly opened.
It's more selective now.
2021-02-08 16:14:10 +01:00
302625eb37 Fix (studio-reported) crash in readfile code.
Essentially, `lib_link_all` would perform some post-processing over data
in given `bmain` that **may** fail when not all data from all libraries
has been properly loaded yet.

This happens when `lib_link_all` is called from `read_libraries`, where
the bmains are split by libraries.

Now those post-processing is put into its own utils function, which
asserts that it is only called on a merged bmain.

Bonus point, this will avoid re-runing those not-so-cheap operations
more than once on the same data.

Reproducible in r1442 of Sprite repository when opening
`pro/animation_test/rex/performance/rex_crowdcamping/rex_crowdcamping.lighting.blend`

NOTE: Not so sure why we have to call `lib_link_all` several times (once
for each library, and then once on the whole merged bmain, including
local IDs then). So that it can get called for libs while we still have
that specific .blend file handle around?
In any case, the overhead here is minimal since we do ensure a data-block is
never lib-linked more than once, so this is not a serious concern right now.

Differential Revision: https://developer.blender.org/D10307
2021-02-08 15:59:08 +01:00
df0bce3f7d Fix T81206: Do not limit gl texture size in image editor
This patch will show textures in the image editor with the maximum
available resolution determined by the GPU Hardware/Driver.
Currently the size is limited by the user preference texture size limit.

An image user can set the `IMA_SHOW_MAX_RESOLUTION` flag to request
gpu textures in the max supported resolution. When this flag isn't
set the gpu texture is limited by the user preference setting.

When the gl resolution limit is disabled the GPU texture is always
created for the max supported resolution.

Reviewed By: Clément Foucault

Maniphest Tasks: T81206

Differential Revision: https://developer.blender.org/D9160
2021-02-08 15:44:54 +01:00
f5c781af56 install_deps: Updated OpenImageDenoise to 1.3.0 2021-02-08 14:44:54 +01:00
db1e50262b Fix compilation error after recent refactor
Thanks Germano for review!
2021-02-08 14:36:48 +01:00
e35182fc05 install_deps: Updare OpenVDB to 8.0.1. 2021-02-08 14:35:05 +01:00
711b65407f Transform: Refactor texture space 'transform_convert' data
The changes are:
- Split conversion of the texture space data to its own file.
- Skip adding keyframes with AutoKeyframes.
- Skip recalculation of the trasform dependencies between objects.
- Skip `special_aftertrans_update_...`.

No real user functional changes
2021-02-08 10:01:07 -03:00
0bc07ea090 Cleanup: Unify, move and rename transform flags
Flags unified:
T_CURSOR -> CTX_CURSOR
T_TEXTURE -> CTX_TEXTURE

Flags moved:
T_CAMERA -> CTX_CAMERA
T_POSE -> CTX_POSE_BONE
T_OBJECT -> CTX_OBJECT
T_TEXTURE -> CTX_TEXTURE_SPACE

Flag renamed:
CTX_EDGE -> CTX_EDGE_DATA
2021-02-08 09:54:54 -03:00
be60b3b239 Transform: Grid snap target refactor
The code takes many turns to get a suitable "target" for the snap to grid.

Perhaps there were other reasons awaited for `transformCenter_from_type`
and `TransCenterData center_cache[5]`.

But since nothing is defined, it is better to simplify the code.

No user functional changes
2021-02-08 09:54:54 -03:00
bc56c12770 Cleanup: Rearrange and name the enums and flags used in the transform code
Simple change that shows all the enums used in the transform code and helps
to better understand the role of the members of the struct TransInfo.

It also allows the IDE to show the name of the value represented by the
member instead of a number that needs to be consulted.

Differential Revision: https://developer.blender.org/D10312
2021-02-08 09:54:54 -03:00
dfa3e0d9b5 Merge branch 'blender-v2.92-release' 2021-02-08 13:36:51 +01:00
Sam Miller
bb0b250cbd Fix T85368: map range node clamps incorrectly in geometry nodes
When clamp is enabled, it should clamp between the output min and max
and not between 0 and 1.

Differential Revision: https://developer.blender.org/D10324
2021-02-08 13:33:23 +01:00
2ca3a1d2ae install_deps: Update TBB to 2020_U2 2021-02-08 12:45:59 +01:00
15d1a43445 install_deps: Update OpenXR to 1.0.14. 2021-02-08 12:26:27 +01:00
ecfd5360a1 Merge branch 'blender-v2.92-release' 2021-02-08 11:36:11 +01:00
4402f43b71 Fix T85426: Speed effect stretch to input not working
`seq_effect_speed_get_strip_content_length()` checked only for number
of inputs of target strip, even if it's not an effect.

Only effects are treated in different way, so check for type as well.
Broken by 93c10797dc

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D10356
2021-02-08 11:30:26 +01:00
Sebastian Koenig
c33a3cfd9a Mask: Use control point position when handle is selected
This is something what comes after an experiment, which makes behavior
more desirable. Basically, for Lock-to-Selection functionality always
use control point position if any of control point itself or handles
are selected.

Initial patch from Sebastian, modification from Sergey.

Differential Revision: https://developer.blender.org/D10265
2021-02-08 11:14:34 +01:00
62ef35db6d Fix strict uninitialized warning for C++
Allows to compile Blender without uninitialized warning in Bullet code.
2021-02-08 11:10:21 +01:00
9d6059504c Cleanup: Remove unused tree element types
These weren't used since ages. Comment out the DNA define (value shouldn't be
reused to avoid compatibility breakage) and remove icon code for the types.
2021-02-08 10:32:18 +01:00
fd05e31d3f Cleanup: Use enum for Outliner tree-store element types
We generally prefer using enums over precompiler defines. This adds an actual
type for the values, which the compiler can use to throw warnings, give better
messages, etc.
2021-02-08 10:32:18 +01:00
8acd58a1a9 Cleanup: Remove dead code for keymap Outliner display mode
This wasn't used for a long time and there are no plans to bring this back.
2021-02-08 10:32:18 +01:00
04be1e9980 Code quality: Refactor asset operators using C++
* Attempt to improve readability by using focused, coherent helper classes.
* Replace ListBase with blender::Vector, which is more efficient and has a
  better API.
* Split user reporting from error checking.
* Use namespace (as we usually do for C++ code).
* Remove unused headers
2021-02-08 10:32:18 +01:00
eb7d9e2a1b Cleanup: Alphabetize function order 2021-02-07 17:21:21 -06:00
0376b2f566 Forgot to free a bvhtree with previous commit. 2021-02-07 17:41:03 -05:00
6f63417b50 Fix T84493 et al: New Boolean on Suzanne.
While Boolean is not guaranteed to work if the operands are not
volume-enclosing (technically: PWN - piecewise constant winding number),
it needs to do something in those cases. This change makes
more cases meet user expectations in T84493, T64544, T83403,
T82642 (though very slow on that one).
The original new boolean code used "generalized winding number"
for this fallback; replaced this with code that uses raycasting.
Raycasting would have been faster, but for unfortunately also
switchd to per-triangle tests rather than per-patch tests since
it is possible (e.g., with Suzanne) to have patches that are
both inside and outside the other shape. That can make it much
slower in some cases, sadly.
2021-02-07 11:25:07 -05:00
71e63153eb GPencil: Fix wrong python API for Point weights
The old property never worked as expected because it was impossible expose the data as props.

Now, there are two methods to handle this: weight_get and weight_set

Example use:
```import bpy
ob = bpy.context.active_object
gpd = ob.data
gps = gpd.layers[0].frames[0].strokes[0]
i = 0
print("Weights\n================================")
for pt in gps.points:
    gps.points.weight_set(vertex_group_index=0, point_index=i, weight=0.5)
    i +=1

i = 0
for pt in gps.points:
    weight = gps.points.weight_get(vertex_group_index=0, point_index=i)
    print(weight)
    i +=1
```

Reviewed By: brecht

Maniphest Tasks: T84967

Differential Revision: https://developer.blender.org/D10177
b3f989
2021-02-07 13:02:11 +01:00
699b2d9855 Code quality: Port recently added utility file to C++
It seems generally preferred to have new files be created with C++.
The only reason I didn't do that when I initially created the files is that I
was unsure about some C-API aspect.

Also use nullptr instead of NULL.
2021-02-06 19:27:55 +01:00
ef29ebb31b Code quality: Port recently added asset files to C++
It seems generally preferred to have new files be created with C++.
The only reason I didn't do that when I initially created the files is that I
was unsure about some C-API aspect.

Also includes some minor C++ related cleanup (nullptr instead of NULL, remove
redundant `struct` keyword).
2021-02-06 19:27:55 +01:00
4cca64f4ad Merge branch 'blender-v2.92-release' 2021-02-06 09:09:17 +01:00
eccc57aa5c Fix T85378: Shrink/Fatten display number units
Currently the displayed distance when using the shrink/fatten transform
operator does not respect the scene units (they would always be in
blender units).

This changes makes sure the number is displayed in the correct unit.

Reviewed By: mano-wii

Maniphest Tasks: T85378

Differential Revision: https://developer.blender.org/D10325
2021-02-06 09:07:50 +01:00
luzpaz
a4a9d14ba7 UI: Fix Typos in Comments and Docs
Approximately 91 spelling corrections, almost all in comments.

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

Reviewed by Harley Acheson
2021-02-05 19:08:14 -08:00
3560f5c1e6 Cleanup: compare with zero for flag checks
This is done almost everywhere already,
use this more straightforward convention.
2021-02-06 13:33:18 +11:00
f10825d573 Cleanup: malformed web addresses in comments 2021-02-06 13:29:19 +11:00
abfb9dbf59 Fix: Disabled NLA Interferes with Action Eval
Introduced by my commit: rB09709a7e64ff

This bug effectively enabled the NLA when it should be disabled, when
all tracks muted or no strips exist. Specifically, the NLA Action Track
settings would be used (extrapolation, blendmode, influence).
2021-02-05 17:47:56 -05:00
Wayde Moss
10e23fd104 NLA: Refactor Transition, Use Snapshot Blend Func
The function `nlastrip_evaluate_transition()` has been slightly
modified to use `nlasnapshot_blend()` instead of it's own special
blending function `nlaeval_snapshot_mix_and_free()`.

No user functional changes

Reviewed By: sybren, #animation_rigging

Differential Revision: https://developer.blender.org/D10221
2021-02-05 16:52:43 -05:00
5bc9ddd98b Fix T85380: NLA Evaluation Missing Null Check
Introduced by commit: rB40b7929cc040
2021-02-05 14:19:38 -05:00
7d874b0343 Image: Flip image operator
This implements an operator to flip the contents of an image buffer. It
supports flipping the image horizontally and vertically.

Reviewed By: JacquesLucke

Differential Revision: https://developer.blender.org/D10310
2021-02-05 19:15:43 +01:00
faf45091b4 GPencil: New python API to force stroke triangulation data update
In some python scripts, the coordinates of the points are manipulated, but there are no way to force the recalculation and need hack to force the refresh.

The new api allows to call to the refresh function directly.

example: `gp_stroke.points.update()`
2021-02-05 19:15:12 +01:00
5dc87a3ca5 Massive install_deps update.
Unfortunately one issue raising another one, this ended up being a
fairly big update, with:

*Fixes:
** Dependencies between libraries are better handled (would fail
   previously in some cases when the lib was also available as package).
** Dependency of Boost over Python is now taken into account.
** Fix CMake flags to use local own built boost.
** Fix building numpy.

*Changes:
** We now use pip for all python modules (including numpy).
** Added all missing python modules (requests etc.).

*Updates:
**USD: 20.08, Due to build failing with 20.05 (missing include).
2021-02-05 19:02:11 +01:00
07521b1627 Depsgraph: Remove no-op evaluation function
Make the SHADING_PARAMETERS operation on node tree a real no-op.
The function used as a callback was only doing a debug print.

The issue with this function was that an original ID was passed
as an argument. This is a violation of design, and if anything it
should be left up to the implementation to check whether depsgraph
is active.

There are no functional changes for users in the interface. The
only difference is that the debug print will no longer happen.
2021-02-05 17:13:59 +01:00
b4dca4ea2c Cleanup: Use raw string literal
Resolves modernize-raw-string-literal Clang-Tidy warning

The way warning works is it suggests to use raw literal when
overhead of having escape characters is higher than the overhead
of having raw literal syntax (talking about code size overhead).
This means that the warning will not trigger for "foo\"bar".

Differential Revision: https://developer.blender.org/D10322
2021-02-05 16:43:23 +01:00
5ec4ba8080 Cleanup: Use lambda instead of function bind
More detailed explanation why it is a preferred way of coding
nowadays can be found at

https://clang.llvm.org/extra/clang-tidy/checks/modernize-avoid-bind.html

Resolves modernize-avoid-bind Clang-Tidy warning.

Differential Revision: https://developer.blender.org/D10320
2021-02-05 16:43:23 +01:00
a0867f05a4 DNA: support structs with a size of 1 or 2 bytes.
Before the smallest possible dna struct size was 4 bytes.

Differential Revision: https://developer.blender.org/D10287
2021-02-05 16:24:46 +01:00
e8a5744cda Merge branch 'blender-v2.92-release' 2021-02-05 16:24:03 +01:00
a563775649 Fluid: Updated Mantaflow source files
This updates fixes the following issues (critical for 2.92):

- Issue that prevented dense 'int' grids from being exported (incorrect clip value)
- Issue with particles outside out of domain bounds (position between -1 and 0) not being deleted
2021-02-05 16:23:02 +01:00
66923031e6 Cleanup: Minimize seq->tmp usage
Using this persistent field in `select_more_less_seq__internal` was
inapropriate in this case.

Split select more/less and linked code, because it was mixed in
`select_more_less_seq__internal()`
These operators work in completely different way.
`select_linked_internal()` doesn't use seq->tmp at all.

`seq->tmp` was used to mask strips selected by operator while iterating.
Use GSet to store temporary data instead of `seq->tmp`.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D10326
2021-02-05 16:21:58 +01:00
16abe9343a Geometry Nodes: add Volume to Mesh node
This node takes a volume and generates a mesh on it's "surface".
The surface is defined by a threshold value.

Currently, the node only works on volumes generated by the
Points to Volume node. This limitation will be resolved soonish.

Ref T84605.

Differential Revision: https://developer.blender.org/D10243
2021-02-05 16:20:14 +01:00
46e0efb462 Geometry Nodes: support fixed pivot axis in Align Rotation to Vector node
When the pivot axis is not set to auto, the node will try to align the rotation
to vector as best as possible, given the selected rotation axis.

Ref T85211.

Differential Revision: https://developer.blender.org/D10292
2021-02-05 16:10:54 +01:00
56903024dc Cleanup: Use transparent functor
Resolves modernize-use-transparent-functors Clang-Tidy warning.

Differential Revision: https://developer.blender.org/D10323
2021-02-05 15:39:50 +01:00
Victor-Louis De Gusseme
4d39a0f8eb Geometry Nodes: Add Attribute Proximity Node
This node calculates a distance from each point to the closest position
on a target geometry, similar to the vertex weight proximity modifier.
Mapping the output distance to a different range can be done with an
attribute math node after this node.

A drop-down changes whether to calculate distances from points,
edges, or faces. In points mode, the node also calculates distances
from point cloud points.

Design task and use cases: T84842

Differential Revision: https://developer.blender.org/D10154
2021-02-05 08:28:31 -06:00
7054d03701 Cleanup: Clang-tidy modernize-use-default-member-init
Using assignment syntax as we don't use `{}` initialization yet.

Reviewed By: sergey
Differential Revision: https://developer.blender.org/D9501
2021-02-05 19:09:36 +05:30
be636f72dc Cleanup: Remove LibAV support
Ubuntu and Debian dropped libav in 2015 in favor of ffmpeg.
Development stopped of libav in 2018, so it should be save to remove.
2021-02-05 14:30:35 +01:00
6b4cd92e4d Merge branch 'blender-v2.92-release' 2021-02-05 13:07:14 +01:00
4212ea7b7d Fix T85260: Viewport render does not draw background
Regression introduced by {rBed809866b172} where overlays weren't drawn
when overlays are turned off. The background in wireframe, solid
(always) and material preview and render preview (when not using scene
world) are also part of the overlays.
2021-02-05 13:05:58 +01:00
8c0b0b7c96 Merge branch 'blender-v2.92-release' 2021-02-05 12:46:42 +01:00
0a546beb1f Fix T85396: Display Texture Paint UV only working in editmode
Caused by rBf83aa830cd00.

Since above commit, only meshes in editmode were considered for drawing
(because
BKE_view_layer_array_from_objects_in_edit_mode_unique_data_with_uvs was
used), but the option needs to work for texture paint mode as well, so
use BKE_view_layer_array_from_objects_in_mode_unique_data instead on
pass the draw_ctx->object_mode.

note: there is no good filter_fn to check if we have UVs if mesh is not
in editmode, this shouldnt cause much of a performance hit though.

Maniphest Tasks: T85396

Differential Revision: https://developer.blender.org/D10319
2021-02-05 12:43:00 +01:00
606805d1b7 Cleanup: use 'r_' prefix for return arguments, order last 2021-02-05 22:34:03 +11:00
f8cbd333d6 Cleanup: outdated/unhelpful comments 2021-02-05 22:33:27 +11:00
f21b4e69b0 Fix T82973: Strips overlap after transforming
When transforming multiple strips to limits of sequencer timeline they get
squashed into one channel.

Store selection minimum and maximum channel in TransSeq and limit
transformation so no strip can be transformed beyond timeline boundary.

Reviewed By: Sergey, mano-wii

Differential Revision: https://developer.blender.org/D10013
2021-02-05 10:40:35 +01:00
fa96aa5811 Fix missing preview images for actions when browsing in external files
When reading the preview images of external .blend files, action data-blocks
were not handled.
Preview support for actions was added in 2397ccc583.
2021-02-05 11:28:34 +01:00
db40d5ed97 Cleanup: Modernize type definition in Alembic
Use newer `using` semantic for type definition.
Solves modernize-use-using Clang-Tidy warning.
2021-02-05 11:04:28 +01:00
b6921506c9 Fix integer types in ImBuf leading to warnings
Replace `long long` with an explicit `int64_t`. This is also what is
used in the FFmpeg headers.

Fixes clang diagnostics warning about wrong format used in the log.

Should be no functional changes.
2021-02-05 10:58:44 +01:00
600625794d install_deps: Add libharu.
Old lib available as packages everywhere, easy. ;)
2021-02-05 09:41:35 +01:00
38420f19b6 Cleanup: rename USER_ZOOM_{CONT->CONTINUE} improve comments
USER_ZOOM_CONT only had comments saying this was 'oldstyle',
remove these comments, add brief explanations of the zoom style
in the enum.
2021-02-05 17:04:14 +11:00
f2bf5acd58 Keymap: use Shift-Tab to cycle backwards over edit-buttons
All modifiers were being checked, a hang-over from 2.4x
where this checked the modifier flag was non-zero.
2021-02-05 16:44:42 +11:00
d975e19583 Cleanup: correct spelling in code 2021-02-05 16:30:49 +11:00
17e1e2bfd8 Cleanup: correct spelling in comments 2021-02-05 16:23:34 +11:00
b62b923f54 Cleanup: replace inline loops with RNA_enum_from_identifier 2021-02-05 09:45:17 +11:00
7e850ffa73 Cleanup: cmake indentation, white-space 2021-02-05 09:45:16 +11:00
94cf74afbb Cleanup/refactor: Undosys: Get rid of the magic values for undo direction.
Move `eUndoStepDir` to `BKE_undo_system.h` and use its values
everywhere.

Note that this also introduce the `STEP_INVALID` value in that enum.

Finally, kept the matching struct members in some lower-level readfile
code as an `int` to avoid having to include `BKE_undo_system.h` in a lot
of unrelated files.
2021-02-04 22:03:39 +01:00
7d5640ee10 LibOverride: Improve/Fix issues in override resync process.
When we have a local override, its linked reference may not be detected
as needing to be overridden anymore.

In that case, if there is no actual override defined by the user, assume
that we can get rid of this local override as part of the resync
process, and use the linked data directly instead.
2021-02-04 19:23:10 +01:00
0f893656f4 Fix T85356: Dope Sheet not showing keyframes of Geometry Nodes graph
The animation filter wasn't following ID pointers to Node Trees yet.
2021-02-04 18:56:41 +01:00
2397ccc583 Animation: Add PreviewImage to bAction struct
Make it possible to attach a preview image to an Action.

In the #asset_browser_pose_libraries project, poses will be stored as
individual Action datablocks. Having a thumbnail for each pose is of
course essential.

Reviewed By: mont29

Differential Revision: https://developer.blender.org/D10306
2021-02-04 18:56:41 +01:00
e027d93ab0 Merge branch 'blender-v2.92-release' 2021-02-04 10:40:35 -07:00
7fb540b4cf Fix T85357: Setting collection color restricted to View Layer mode
Allow setting collection color in Scenes and Blender File outliner
display modes in addition to View Layer mode.
2021-02-04 10:38:44 -07:00
e7af04db07 Geometry Nodes: new Is Viewport node
This node outputs true when geometry nodes is currently evaluated
for the viewport and false for final renders.

Ref T85277.

Differential Revision: https://developer.blender.org/D10302
2021-02-04 16:36:34 +01:00
95703d19e0 Liboverride: clean-up/sanitize tagging of root overrides.
now do this in utils that also handle the hierarchy tagging, doing it in
caller code is prone to errors.

Issue reported by @sebbas, thanks.
2021-02-04 16:15:16 +01:00
07f7483296 LibOverride: Added log statements in liboverride operator functions
As discussed in D10301.

Reviewed By: mont29

Differential Revision: https://developer.blender.org/D10303
2021-02-04 15:11:42 +01:00
bd973dbc44 LibOverride: Only show relevant operators in outliner menu
No need to show certain operators when they have no functionality.

For example, when adding a library override from the outliner menu, there should only be an option to add one (i.e. reset, delete, resync operators not relevant for objects without library override).

Reviewed By: mont29

Differential Revision: https://developer.blender.org/D10301
2021-02-04 15:09:12 +01:00
4ef8033116 Merge branch 'blender-v2.92-release' 2021-02-04 10:50:43 -03:00
760a16b88b Fix for 3D view transform: flipped rotation direction for numeric input
The rotation direction was flipped recently.

This meant that rotation on a single axis gave negative results compared
with previous Blender releases.

This partially reverts a9b53daf23.

Differential Revision: https://developer.blender.org/D10299
2021-02-04 10:43:57 -03:00
Johannes Jakob
bec08621d6 Fix T85363: Cmd + Tab shortcut overridden on macOS
Adds an exception so that the key-binding `control + Tab` does not get
duplicated as `command + Tab` on macOS because this is a global system
shortcut for the app switcher.

The key-binding `command + Tab` was shown for the operators “Toggle
Graph Editor“ and “Toggle Dope Sheet” in Dope Sheet and Graph Editor,
but only `control + Tab` actually worked.

Differential Revision: https://developer.blender.org/D10304
2021-02-04 14:27:44 +01:00
3be5859b21 Cleanup: pass keymap items as const where possible 2021-02-04 22:21:10 +11:00
dff51d418a Fix: window manager can reference scenes and workspaces
This also fixes T83592 for me.

Differential Revision: https://developer.blender.org/D10046
2021-02-04 11:31:01 +01:00
4895d1f9ce Cleanup: replace '_imp' function suffix with '_impl'
Use the more common abbreviation for `implementation`.
2021-02-04 13:10:29 +11:00
54cb9e1d79 PyAPI: correct docstring 2021-02-04 13:10:29 +11:00
492e64c7bc UI: Win32 Child Windows On Top
Win32 child windows on top of parents. Short-term solution of forcing is_dialog when owned.

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

Reviewed by Brecht Van Lommel
2021-02-03 17:51:19 -08:00
261fa052ac UI: Win32 Window Creation Refactor
Simplification of Win32 GHOST_WindowWin32 with improved support for owned windows.

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

Reviewed by Brecht Van Lommel
2021-02-03 17:44:24 -08:00
Ankur Deria
1ad1ecf1c9 Fix T79822: Custom preset casing not preserved
When adding a new preset the name would be converted to lower case and
then displayed in the interface in title case. This was confusing
because the name didn't reflect what was typed, and there are many cases
when the name shouldn't be forced into title case (like 8K UHDTV for
example).

This commit leaves the custom preset names in the original casing, and
removes the conversion of filenames to title case for preset lists.

Differential Revision: https://developer.blender.org/D10224
2021-02-03 17:48:39 -07:00
01d49d1542 Presets: Cleanup preset naming
Before committing D10224, bundled preset names that are lowercase need
updating to title case for display in the UI. This changes several of
the preset file names to title case, and fixes a couple of other naming
issues in the preset names. A few strings in the code are also changed
to reflect the new filename of the Blender keymap.
2021-02-03 17:34:27 -07:00
d30320b4f5 Merge branch 'blender-v2.92-release' 2021-02-04 11:22:11 +11:00
3f90c11621 Fix T85318: Driver variable don't resolve collection indices
The driver variable `splines[0]` (on a curve)
behaved as if the path was `splines`.

Resolve pointers was well as properties as it's supported by the caller.

Error in original commit that added property support
82b0a9e369.
2021-02-04 11:19:09 +11:00
d85c5accec Cleanup: unused function warning 2021-02-04 10:01:19 +11:00
0352546cdd NLA: Fix nlasnapshot_blend() Misplaced Null Check
From original commit: rB40b7929cc040
2021-02-03 17:35:21 -05:00
Wayde Moss
40b7929cc0 NLA: Extract nlasnapshot_blend()
Refactor
//nlastrip_evaluate_actionclip()// and //nlaeval_blend_value()// into
//nlasnapshot_blend()//, //nlastrip_evaluate_actionclip()//,
//nlasnapshot_from_action()//.

**Motivations**:
* {T83615} Requires reading all pose bone fcurves before being able to
apply pre-blend transforms. The function //nlasnapshot_from_action()//
achieves this. This effectively removed the need to specially handle
Quaternion blend queuing so that code has been removed.

* {D8296} Adds support for keyframe remapping through an upper stack of
strips. Instead of introducing a variant of the form:
//nlastrip_evaluate_actionclip_inverted_get_lower()//,
//nlastrip_evaluate_actionclip()// will later be extended to take an
`evaluation_mode` as input to avoid duplicating the recursion functions
related to //nlastrip_evaluate()//.

* //nlasnapshot_blend()// will eventually have variants of
//nlasnapshot_blend_get_inverted_lower_snapshot()// and
//nlasnapshot_blend_get_inverted_upper_snapshot()// which are all
independent of NlaStrips and NlaTracks, further simplifying the
blending implementation. Ideally, //nlastrip_evaluate()// would get
renamed to //nlasnapshot_blend_strip()// but that'll be a later patch
to avoid unnecessary patches slowing the review of more important
patches.

No User-side Functional changes

Reviewed By: sybren, #animation_rigging

Differential Revision: https://developer.blender.org/D10220
2021-02-03 16:45:53 -05:00
Wayde Moss
264af1519e NLA: Fix Strip Truncate When Next to Transition
**Problem**:
Translating a strip will truncate it when next to a transition.

**Solution**:
The code only accounted for the prev/next strip for whether it exceeds.
When it was a transition, the exceed logic fails. Now, we use the
nearest non-transition strip instead.

Reviewed By: sybren, #animation_rigging

Differential Revision: https://developer.blender.org/D10083
2021-02-03 16:19:07 -05:00
70371299ae Merge branch 'blender-v2.92-release' 2021-02-03 21:06:56 +01:00
ebd2aa789e Fix T85230: Face Set Boundary automasking not working with dyntopo
Dyntopo does not have Face Sets implemented yet, so the entire mesh is
considered a single Face Set. In that case, the check unique face set
function should always return true.

Reviewed By: JacquesLucke

Maniphest Tasks: T85230

Differential Revision: https://developer.blender.org/D10259
2021-02-03 21:05:48 +01:00
0f238c5bcb Fix T85136: Sculpt geometry extract not using updated mesh
This ensured that the sculpt mode deformation is flushed to the mesh
datablock after leaving sculpt mode, so it can be duplicated and
extracted correctly.

Reviewed By: JacquesLucke

Maniphest Tasks: T85136

Differential Revision: https://developer.blender.org/D10254
2021-02-03 21:00:28 +01:00
1081eee4c5 Fix T84370: Project tool not working with shape keys
A missing flush of the deformed PBVH coordinates to the shape key.

Reviewed By: JacquesLucke

Maniphest Tasks: T84370

Differential Revision: https://developer.blender.org/D10174
2021-02-03 20:58:42 +01:00
Pablo Dobarro
7bde2844ae Fix memory leak in boundary brush preview data
The edge preview data of the boundary needs to be freed with the
boundary data created for the brush. Also, all data for the
ScultpSession preview that is used to render the cursor needs to be
freed with the ##SculptSession##.

Found by Jacques Lucke

Reviewed By: JacquesLucke

Differential Revision: https://developer.blender.org/D10173
2021-02-03 20:55:17 +01:00
fec6a4e24a Cleanup: don't end description with dot 2021-02-03 20:04:28 +01:00
55c88e5582 Alembic procedural: fix crash when cancelling a render during
synchronization
2021-02-03 19:15:49 +01:00
9734a78bc8 macOS: Fix build error due to std::optional<T>::value
Added in rBc5514d3a2a03242ddc43f83be4bb72df7f85469f
2021-02-03 23:30:10 +05:30
9d902d1b30 Merge branch 'blender-v2.92-release'
# Conflicts:
#	source/blender/editors/transform/transform_constraints.c
2021-02-03 14:57:06 -03:00
5eb5a7f4b7 Fix unreported: Rotation Gizmo "C" influenced by custom orientation
The white rotation Gizmo should always use the View orientation.

Before, if you set an orientation for the gizmo other than the default,
that gizmo would behave like the contraint Z Gizmo.
2021-02-03 14:54:58 -03:00
dcb2821292 macOS/GTest: Fix duplicate symbol errors with some generators
Don't force load _and_ link against a library in case
linker fails to deduplicate them.
https://devtalk.blender.org/t/macos-duplicate-symbol-errors/17343

Reviewed By: #platform_macos, brecht
Differential Revision: https://developer.blender.org/D10294
2021-02-03 23:20:27 +05:30
bbd74e9fd4 Fix T85340: Gizmo rotation inverted (in some perspective angles)
This is an old bug (strange not to have been reported before).

To define the direction of rotation, the View Vector is used.

However, only the projection matrix was being considered, but in
perspective mode, the position of the pivot also matters.
2021-02-03 14:48:17 -03:00
9042532085 Cleanup: Move and rename 'getViewVector' utility
This function is only being used by the constraint code.
2021-02-03 14:48:17 -03:00
8c7b78672e Fix 'getViewVector' returning inverted vector
Despite the wrong value, this change is harmless since the direction of
the vector is not really required.
2021-02-03 14:48:17 -03:00
46e66cecb3 install_deps: Update OSL to 1.11.10.
Good news is, this version support LLVM 11.

But it was a serious pain to get working, even ended having to add an
ugly hack to manually specify the OIIO include dir...

Ref: T83631.
2021-02-03 18:07:48 +01:00
Fabian Schempp
c5514d3a2a Geometry Nodes: Multi-Input Sockets
Normally sockets only have one input link. This commit adds the back-end
changes needed to use multiple input links per socket.

Multi-input sockets can be defined with a new flag in `bNodeSocketType`.
The changes necessary to make the sockets work in the geometry nodes
evaluator are generalizing input socket values as a vector of values,
and supporting this in the derived node tree structure.

This patch should contain no functional changes. Two upcoming patches
will use this system for the "Join Geometry" node and expose link picking
and updated display in the UI: D10069 and D10181.

Reviewed By: Jacques Lucke, Hans Goudey

Differential Revision: https://developer.blender.org/D10067
2021-02-03 11:03:00 -06:00
894cc9c915 Geometry Nodes: Add Collection Info Node
Implements a node to get collection objects.
These objects are then passed along as instances in the node tree.

Follow up tasks:
Multiple nodes does not support instancing yet: T85159
Changing collection offset does not trigger a refresh: T85274

Reviewed By: Jacques, Dalai, Hans

Differential Revision: http://developer.blender.org/D10151
2021-02-03 17:54:33 +01:00
Johannes Jakob
54a4eb5e17 UI: use system generated document icon on macOS
Adds Document Type Identifier configuration to use a system generated
document icon for Blender files on macOS. The system composites the
app’s icon and the extension name onto the document sheet icon
(new style on macOS 11 Big Sur and old style on macOS 10.15 Catalina
and earlier). This is in line with Apple’s Human Interface Guidelines.

Removes the previously used file icon because it is no longer needed.

Differential Revision: https://developer.blender.org/D10267
2021-02-03 17:14:46 +01:00
Yevgeny Makarov
e54f88f092 macOS: trackpad scroll direction reversed in list views
The 'ui_pan_to_scroll' uses 'WM_event_absolute_delta_y'. For scrolling the List View
we need to invert the direction to respect "natural scroll direction" system preferences.

Differential Revision: https://developer.blender.org/D10291
2021-02-03 17:13:27 +01:00
e49b702527 GL: Improve framebuffer error message by adding framebuffer name
Framebuffer error can be hard to track. This makes it much easier to
find the wrong framebuffer configuration.
2021-02-03 17:11:17 +01:00
f4f4495586 install_deps: OIIO: tweak to max version, and cleanup compile code.
OSL 1.10.10 does not build with OIIO 2.2.10.
2021-02-03 16:04:18 +01:00
8e98983945 install_deps: Upgrade Alembic to 1.17.16.
See T83246.
2021-02-03 16:04:18 +01:00
1a1aa5392d install_deps: Update Boost to 1.73.
See T83246.
2021-02-03 16:04:18 +01:00
3200a135be install_deps: update Python to 3.9.1, numpy to 1.19.5.
See T83246.
2021-02-03 16:04:18 +01:00
2b18c41c4d Merge branch 'blender-v2.92-release' 2021-02-03 15:53:55 +01:00
85fe12071a Fix T85261: Eevee passes have slight inaccurate colors
In everything in `EEVEE_renderpasses_postprocess` (or the corresponding
renderpass_postprocess_frag.glsl) colors get divided by a
'currentSample'.

This 'currentSample' is always incremented in
`EEVEE_temporal_sampling_draw` (and also one more time before we reach
`EEVEE_renderpasses_postprocess`.
This results in a "off-by-one", slightly inacurate colors and slight
inaccurate transparency (in certain passes like AOVs).

Now decrement the currentSample `EEVEE_renderpasses_postprocess` again
by one to compensate.

Maniphest Tasks: T85261

Differential Revision: https://developer.blender.org/D10286
2021-02-03 15:50:17 +01:00
3a446f2d9f Merge branch 'blender-v2.92-release' 2021-02-03 15:30:15 +01:00
487fe5abfc Cryptomatte: Incorrect Coverage with Volumetrics
Related to {D10286}. When volumetrics are used in the scene the coverage
is incorrect. The reason is that the current sample is 1 over the num
samples that are calculated.
2021-02-03 15:30:03 +01:00
10e3b2dc8e Cryptomatte: Incorrect Coverage with Volumetrics
Related to {D10286}. When volumetrics are used in the scene the coverage
is incorrect. The reason is that the current sample is 1 over the num
samples that are calculated.
2021-02-03 15:27:52 +01:00
e1f38b2169 Fix incorrect mesh selection duplication in internal utility function
`BKE_mesh_new_nomain_from_template_ex()` would duplicate the mesh selection
storage of the destination mesh to the destination mesh. Since that mesh was
default initialized at this point, the selection was `NULL`, so the duplication
call is essentially a no-op.

Mistake in 7efc75c709.

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

Reviewed by: Sybren Stüvel
2021-02-03 15:09:06 +01:00
e69217b283 UI: Improve tooltip for continuous grab
Attempt to explain the feature better follow a better writing style.
2021-02-03 15:07:37 +01:00
c9d6737e3e BKE UndoSys refactor: deduplicate and simplify code, sanitize naming.
Now we only use 'undo' or 'redo' in function names when the direction is
clear (and we assert about it). Otherwise, use 'load' instead.

When passing an undo step to BKE functions, consider calling code has
done its work and is actually passing the target step (i.e. the final
step intended to be loaded), instead of assuming we have to load the
step before/after it.

Also deduplicate and simplify a lot of core undo code in BKE, now
`BKE_undosys_step_load_data_ex` is the only place where all the complex
logic of undo/redo loop (to handle several steps in a row) is placed. We also
only use a single loop there, instead of the two existing ones in
previous code.

Note that here we consider that when we are loading the current active
step, we are undoing. This makes sense in that doing so //may// undo
some changes (ideally it should never do so), but should never, ever
redo anything.

`BKE_undosys_step_load_from_index` also gets heavily simplified, it's
not basically a shallow wrapper around
`BKE_undosys_step_load_from_index`.

And some general update of variable names, commenting, etc.

Part of T83806.

Differential Revision: https://developer.blender.org/D10227
2021-02-03 11:11:12 +01:00
4884153823 BPY: allow bpy.data.libraries.load() to filter out non-asset data-blocks.
Differential Revision: https://developer.blender.org/D10237
2021-02-03 09:53:56 +01:00
2ce1400297 Merge branch 'blender-v2.92-release' 2021-02-03 00:17:52 +01:00
0fc456f091 Fix T85314 GPU: Drawlist submit data overflows.
This was caused by an incorrect bound check. Since we now use different
data type for indexed and non-indexed drawcalls, we need to check if the
next drawcall is going to overflow the buffer.
2021-02-03 00:15:52 +01:00
78ff852680 Force Fields: implement early filtering by the Affect flags.
Most fields have Affect Location and Rotation options that switch
off their effect, but they are only checked as the last step after
the force is already computed. It is more efficient to check it
when building the list of field objects, just like zero weight.
It is also possible to check the strength-related fields for 0.

As an aside, this adds Location to Texture fields (they don't
handle rotation) and both Location & Rotation checkboxes to
Fluid Flow. Boid and Curve Guide remain without options for
now as they are completely different from others.

Differential Revision: https://developer.blender.org/D10087
2021-02-02 23:03:16 +03:00
64a963486f Merge branch 'blender-v2.92-release' 2021-02-02 20:42:54 +01:00
Robert Guetzkow
4a80c0e275 Fix T85225: Variable scope in ridged multi-fractal noise
This patch fixes a bug introduced in
rB74188e65028d268af887ab2140e4253087410c1e.
The commit incorrectly moved the declaration and intialization of the
variable `pwr` inside the loop. Since the value was originally modified
in each iteration based on it's previous value and `pwHL` through
`pwr *= pwHL`, this change in scope was wrong. It resetted the value in
each iteration. This patch moves the declaration of `pwr` outside the
loop again.

Reviewed By: JacquesLucke

Differential Revision: https://developer.blender.org/D10258
2021-02-02 20:37:28 +01:00
f2781e1c7c Fix for T82459 - Input Language Independent of Display Language
Allow OS input language to initiate IME, regardless of Blender output language.

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

Reviewed by Julian Eisel
2021-02-02 10:58:02 -08:00
b3f9895ab0 Fix build error on windows after recent commit
rB198ff4703f84d0c3267 neglected to remove designated initializers,
which are not supported in the C++ 17 standard.
2021-02-02 11:26:17 -06:00
1a5b988509 Merge branch 'blender-v2.92-release' 2021-02-02 17:51:18 +01:00
8c36f6becf Fix T84649: Quick liquid causing crash on scale operation
This commit makes use of the updated fluid sources files (previous commit rB9ad828dbad94d279521875db47a3472a38cc9b29)
2021-02-02 17:50:08 +01:00
9ad828dbad Fluid: Updated Mantaflow source files
Includes improvements for the file IO. Namely, more meta data will be written from now on.

This change is required to prevent IO issues (e.g. T84649) that arised through the use of sparse grids caching (introduced in 2.92).
2021-02-02 17:46:48 +01:00
4ff5051ffc BKE BMain relations: add utils to (re)set tags of the entries. 2021-02-02 17:26:59 +01:00
2262e18269 Cleanup: LibOverride: group logically utils static functions. 2021-02-02 17:26:59 +01:00
198ff4703f Blenkernel: Move node.c to C++
Required changes to compile `node.cc` with clang tidy:
* Use c++ includes like (e.g. climits instead limits.h).
* Insert type casts when casting from `void *`.
* Replace `NULL` with `nullptr`.
* Replace typedef statements.

This change is in order to use the `blender::Map` data structure
for node error messages.
2021-02-02 09:51:38 -06:00
d0aa7d5562 Merge branch 'blender-v2.92-release' 2021-02-02 16:47:21 +01:00
f8359b5f52 Fix freestyle render pass not being created when there are no strokes
It could lead to missing images when outputing the pass to an image
sequence.
2021-02-02 16:45:23 +01:00
326102f498 Merge branch 'blender-v2.92-release' 2021-02-02 08:26:21 -07:00
56bccd2395 Fix T83450: Missing 4th studio light in preview icon
Due to an off-by-one error the generated studio light icons did not show
the influence of the 4th light. This fix changes the loop to iterate
over all of the lights when computing the lighting.

Differential Revision: https://developer.blender.org/D10283
2021-02-02 08:23:13 -07:00
b7865f77c3 Merge branch 'blender-v2.92-release' 2021-02-02 09:21:14 -06:00
a1c7cab06c Fix T85155: Vertex groups from object don't transfer to next nodes modifier
Because the the vertex group name-to-index map is stored in the object
rather than object data, the object info node has to replace the
map when it replaces the mesh component on the geometry set with mesh
data from another object.

This normally works fine as a way to use the vertex groups from the
input mesh, but when passing this mesh to the next modifier, the entire
mesh component was replaced, removing the vertex group name map.

This commit adds a function to replace only the mesh data in mesh
component, uses it in the modifier code, and updates the relevant
comments.

Note that the fact that vertex group names are stored in object data
is a legacy design decision that should be reevaluated at some point.

Differential Revision: https://developer.blender.org/D10256
2021-02-02 09:20:54 -06:00
ed00f7c65e Merge branch 'blender-v2.92-release' 2021-02-02 15:34:39 +01:00
9e0c876aad Fix T85301: Eevee does not respect collection instance offset for hair
This resulted in hair drawing with an offset if an instance_offset was
set.

note: Usually the instance_offset gets combined with the objects obmat
in 'make_duplis_collection' / 'make_dupli', see
> /* Combine collection offset and `obmat`. */
Using the resulting DupliObject->mat instead does include the
instance_offset, but this results in double-transforms (something that I
have not investigated further), so now reconstruct the correct matrix
from scratch.

Maniphest Tasks: T85301

Differential Revision: https://developer.blender.org/D10285
2021-02-02 15:32:35 +01:00
Miguel Pozo
1428544528 Python API: option for render engines to delegate Freestyle render to Eevee
Eevee is now used for Freestyle rendering by default, since other engines are
unlikely to have support for this. Workbench and Cycles do their own rendering.

RenderEngine add-ons can do their own Freestyle rendering by setting
bl_use_custom_freestyle = True.

Differential Revision: https://developer.blender.org/D8335
2021-02-02 14:19:04 +01:00
e3c8363ce0 Fix T83064: Missing tooltips, caused by string property search button
When a searchbox-button for string properties (e.g. to reference a vertex
group) was created, and a value was set, the tooltip timer would constantly get
cancelled.
That was because the code to validate the current value
(`ui_but_search_refresh()` - early exists for non-string properties) would call
a helper function to update the search results (`ui_searchbox_update_fn()`),
which always reset tooltips. Resetting them in the helper makes sense, for as
long as the searchbox is open. But while it's not, and we just validate the
current value, it shouldn't do this.

This was also noticable in the output settings of dynamic paint, and probably a
number of other cases (especially with script UIs which tend to use string
properties more often).

Likely caused by de53c039ad.
2021-02-02 13:54:18 +01:00
f3a2434bb6 Cleanup: Use bool instead of int 2021-02-02 13:54:18 +01:00
fed191fd89 Cleanup: take grid reference instead of shared pointer as parameter
This makes the function usable in more contexts.
2021-02-02 13:17:51 +01:00
Brecht Van Lommel
886486615b macOS: use precompiled libraries for arm64 build
Standard wiki build instructions for building Blender on macOS can now be used
on Macs with ARM processors.

This contains all libraries except for Embree and OpenImageDenoise, so Cycles
performance does not yet have full performance and features in this build. An
x86-64 build is likely to still render faster than arm64 until Embree is added.

Uses the new lib/darwin_arm64 folder. For simplicity and to keep download size
under control, both for end users and builders, we are not planning to ship
universal binaries. So this is a separate folder from lib/darwin.

Ref T78710

Differential Revision: https://developer.blender.org/D10276
2021-02-02 12:08:23 +01:00
62419975b7 macOS: fix warning about unkown GPU with Apple M1 chip 2021-02-02 12:08:23 +01:00
d19aaad0bc Fix regression: Crash garbage collecting VBOs on never evaluated scenes
Committing fix again, since it is somehow got lost when merging release
branch into master.
2021-02-02 11:10:56 +01:00
356c62fe32 Merge branch 'blender-v2.92-release' 2021-02-02 19:36:18 +11:00
1d77302fd9 creator: add missing '--debug-*' arguments under debugging options
Only print "Other Options" when the heading has content to show.
2021-02-02 19:34:47 +11:00
bde797c172 Merge branch 'blender-v2.92-release' 2021-02-02 09:33:05 +01:00
d917d7cf94 Fix T85194: Smart UV does not respect "Correct Aspect" correctly
This lead to wrong, stretched UVs regardless of the ON/OFF state of
"Correct Aspect" option (some code in the operator respected this
setting properly, whereas it was hardcoded in another part).

Before rB9296ba867462, `uvedit_pack_islands_multi` was always called
with `correct_aspect` = false for the UnwrapOptions.
After rB9296ba867462, `ED_uvedit_pack_islands_multi` was always called
with `correct_aspect` = true for the UVPackIsland_Params.

Both seem wrong [in that they do not take the operator setting into
account]. Now respect that setting [same as the following
`uv_map_clip_correct_multi` does as well btw.]

Now results match 2.90 [where this was still python] perfectly.

Maniphest Tasks: T85194

Differential Revision: https://developer.blender.org/D10246
2021-02-02 09:30:58 +01:00
1422c28ef1 Merge branch 'blender-v2.92-release' 2021-02-02 19:18:20 +11:00
3ae74bcd29 cmake/deps: remove 'tcl' language support from sqlite
Build sqlite without `tcl` support, as it's causes an error on
installation when `tcl` is installed into the systems `/usr/lib/` and
install isn't running as root.

This could be resolves by adding `tcl` as a dependency
however it's not needed for Python's sqlite integration.

Linux distributions (Debian & Arch at least) split this off
into a separate package (which Python doesn't depend on),
so there is no need for Blender to include sqlite's `tcl`
integration either.

Reviewed By: brecht, LazyDodo

Ref D10281
2021-02-02 19:12:45 +11:00
33b8063b1f CMake: Remove duplicated code for Haru-TIFF dependency. 2021-02-02 02:15:40 +05:30
038d72752d CMake/Windows: Fix build issue in lite+haru
Haru depends on some symbols defined in libtiff
which will cause linker errors if not enabled.
Disable haru if WITH_IMAGE_TIFF is off.
2021-02-01 11:35:23 -07:00
59054d906f CMake/Windows/macOS: Add Libharu
Decision: https://lists.blender.org/pipermail/bf-committers/2020-December/050836.html
Adds CMake dependency builder support. Tested on
macOS and Windows (Thanks @LazyDodo).

Reviewed By: #platform_macos, LazyDodo, sebbas
Maniphest Task: T84836
Differential Revision: https://developer.blender.org/D9928
2021-02-01 21:58:57 +05:30
84dddf641e Merge branch 'blender-v2.92-release' 2021-02-01 16:40:43 +01:00
d5d8655ca1 Fix T81843 Bones invisible using Weight Paint + Wireframe shading + Bone X-Ray
This was caused by the paint overlay drawing after the infront pass.

Moving the paint overlay before it fixes the issue. We might even do
that for more mode overlays.
2021-02-01 16:40:23 +01:00
bc41aaaaaa Overlay: Fix Z axis planes rendered even if not needed
This remove some drawn completely transparent pixels.
2021-02-01 16:40:23 +01:00
5ec9e3a26e Merge branch 'blender-v2.92-release' 2021-02-01 16:27:42 +01:00
006e70dbd7 Fix T85203: GPencil: Drawing on locked axis plane
Drawing on e.g. the X-Z plane was broken due to an earlier
commit (rBef28da262342). This was causing the projection when drawing
on an axis plane to fail.

The fix checks that the user is in view plane projection mode.

Reviewed By: antoniov

Maniphest Tasks: T85203

Differential Revision: https://developer.blender.org/D10252
2021-02-01 16:26:31 +01:00
82e2d70024 Merge branch 'blender-v2.92-release' 2021-02-01 15:20:01 +01:00
a69983f30e Fix T85229: Transform operator saving a different orientation than the chosen one
Some orientations are not possible to be calculated for certain scenes.

In these cases, others are chosen and informed by the operator.

However, the user may prefer that the chosen one be displayed (even if it
is not actually used).

This corresponds to older versions of Blender.
2021-02-01 11:16:58 -03:00
c02f2d7371 Fix T81177 EEVEE: Missing shadow if last material has no shadow
This was caused by the boolean not being a union of all the material
slots.
2021-02-01 14:54:08 +01:00
9e9ebaba8d Fix crash when creating lib overrides.
Own mistake in recent commit rB2a81d948ad00c50.
2021-02-01 14:09:49 +01:00
88d9eb14d1 Merge branch 'blender-v2.92-release' 2021-02-01 14:01:33 +01:00
d1ee8a0502 DRW: Fix render wrong orthographic depth conversion
Fix for both workbench and Gpencil.

Fixes T78574 GPencil: Z pass combine not work
2021-02-01 14:00:08 +01:00
f04ddd398f Merge branch 'blender-v2.92-release' 2021-02-01 13:41:21 +01:00
03c1c5f3a4 GPU: Fix performance regression on AMD GPU
This was caused by a missing check left over during the GL isolation.

Fix T84277 Solid and Wireframe viewport performance hit on AMD Radeon GPUs
2021-02-01 13:41:07 +01:00
5c72a4d452 Fix T84780: Corrupt screen layout when loading file with area full-screen
This could happen with files saved before ef4aa42ea4, so before global areas
were written to .blend files.
We would just always add the top- and status-bar, even though the screen wasn't
supposed to have them. I'm not entirely sure what caused the further issues
observed there, most code should probably handle the case fine still. But
apparently something didn't.

Steps to reproduce were:
* Open Blender from before ef4aa42ea4 (e.g 2.91 release)
* In 3D View, View > Area > Toggle Fullscreen Area
* Save the file
* Open the saved file (can be in newer version too)
The fullscreen is corrupt now, especially noticable after duplicating the
workspace.
2021-02-01 12:48:05 +01:00
fa2ffb1a2f Merge branch 'blender-v2.92-release' 2021-02-01 12:01:23 +01:00
5e117b1226 Usual UI messages fix... 2021-02-01 12:00:32 +01:00
f4cb93b55d Merge branch 'blender-v2.92-release' 2021-02-01 11:03:13 +01:00
d857892553 VSE: Fix proxy images have incorrect size
This bug happens when media size doesn't match scene size and proxies
are enabled. This is because some strips are rendered in preview size
already -  effects, mask or strips using proxies.
If strip input is prescaled it needs to be known when transforming
images, which does also scaling to preview size as one operation.

whether image needs prescaling is defined in function
`seq_need_scale_to_render_size()`

Problem was introduced in 5713626422. Previously all images were
scaled to fit into preview, and this was considered as baseline for
further image transformation.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D10183
2021-02-01 11:02:25 +01:00
e94c38e005 Merge branch 'blender-v2.92-release' 2021-02-01 11:01:29 +01:00
54ac63f06b Fix T85252: Gpencil interpolate sequence crash in new scenes
The value of the step was not initializated for new scenes.
2021-02-01 11:00:50 +01:00
1e55d28a4e Fix T85035: Gpencil render in background render wrong frame
Due a thread priority, the calculation of the current frame is not done before the frames are available. This produces wrong render frames.

The solution is verify the current frame before doing the real render. This adds only a few milliseconds, but it assures the frame is correct.

As the problem is only when render in background, the recalculation of the frame is only necessary when do real render and not a viewport render, so there is no impact in the animation FPS.
2021-02-01 10:27:03 +01:00
9c244820d1 Merge branch 'blender-v2.92-release' 2021-02-01 10:00:45 +01:00
30ac21bf33 Fix regression: Crash garbage collecting VBOs on never evaluated scenes
Introduced in rB087777f2b9b8.

Fixes issues with scene from T82808.
2021-02-01 09:59:09 +01:00
b10fac0432 Docs: Remove wrong debug flag info
Removed the `--debug-gpu-shaders` argument in bc94036a76 but forgot to amend
these changes.
2021-01-31 15:53:09 +01:00
d4aa5b2166 Merge branch 'blender-v2.92-release'
# Conflicts:
#	source/blender/editors/transform/transform_constraints.c
2021-01-31 10:36:01 -03:00
a9b53daf23 Fix T83092: Direction of rotation with View orientation changed in 2.91
This solution replaces {rBf9e994d0f463}.

That commit created an inverted orientation matrix but the 'Align to
Transform Orientation' operator doesn't work well with inverted matrices.

This new solution makes the rotate operator use the negative vector of the
axis.
2021-01-31 10:31:15 -03:00
c828a505c2 Revert "Fix T83092: Direction of rotation with View orientation changed in 2.91"
This reverts commit f9e994d0f4.
And fixes T85227.

That commit created an inverted orientation matrix but the 'Align to
Transform Orientation' operator doesn't work well with inverted matrices.
2021-01-31 10:30:02 -03:00
419c67c851 Fix error in recent commit
Unused argument in rB216ebe0b7392d6
2021-01-31 10:26:54 -03:00
a80c0ee167 Revert "Cleanup: remove unused argument"
This reverts commit 780857f8e8.

The `axismtx` argument was supposed to be used.
2021-01-31 10:26:36 -03:00
194f6c7880 Merge branch 'blender-v2.92-release' 2021-01-31 19:45:15 +11:00
fecce5dc09 Fix T85236: "Zoom to Mouse Position" inverts "Dolly View" direction 2021-01-31 19:44:01 +11:00
088fbc0286 Cleanup: remove unused BMesh.currentop struct member 2021-01-31 18:20:12 +11:00
e6a5e548d5 Cleanup: correct and update comments for bmesh walkers
- Correct variable names which were missed when refactoring.
- Use full sentences.
2021-01-31 17:42:42 +11:00
6b8f28a6b5 Cleanup: use doxygen for transform_constraints 2021-01-31 17:23:46 +11:00
1939911c54 Merge branch 'blender-v2.92-release' 2021-01-31 17:16:16 +11:00
780857f8e8 Cleanup: remove unused argument 2021-01-31 17:15:58 +11:00
cdf01f7750 Cleanup: use switch for Add Object Tool event handling 2021-01-31 17:05:12 +11:00
2e84edea97 Add Object Tool: make automatic axis selection an option
While useful in some cases, this meant it wasn't possible to use the
"Floor" for object placement without looking top-down or bottom up.
2021-01-31 17:05:12 +11:00
ae3fee3f47 Merge branch 'blender-v2.92-release' 2021-01-30 21:54:10 -07:00
7a64e93761 Fix T79797: Compositor backdrop gizmo not updating after zoom
The gizmo for the compositor backdrop image did not redraw when zooming
in and out with the backimage_zoom operator. This adds the missing
notifier.
2021-01-30 21:49:56 -07:00
016bd284fb Fix T84465 Bevel Percent and Absolute when limit type is Weight.
The previous fix to the width modes Percent and Absolute did
not take into account that with limit mode Weight, the amount
needs to be scaled by the bevel weight of the beveled edge in
question. (Sometimes there are two beveled edges in question,
in which case an average is used.)
2021-01-30 15:58:08 -05:00
40061911d2 Fix T84465 Bevel Percent and Absolute when limit type is Weight.
The previous fix to the width modes Percent and Absolute did
not take into account that with limit mode Weight, the amount
needs to be scaled by the bevel weight of the beveled edge in
question. (Sometimes there are two beveled edges in question,
in which case an average is used.)
2021-01-30 15:50:58 -05:00
38bb263422 Fix T81193 EEVEE: Crash when motion blur is aborted at cache finish
This was caused by a use after free. The issue was that the motion steps
were successfully gathered but failling the last vertex count check,
discarding the copied VBOs but not removing the reference of the first
VBO which was passing the test.
2021-01-30 16:56:38 +01:00
216ebe0b73 Fix T83092: Direction of rotation with View orientation changed in 2.91
This solution replaces {rBf9e994d0f463}.

That commit created an inverted orientation matrix but the 'Align to
Transform Orientation' operator doesn't work well with inverted matrices.

This new solution makes the rotate operator use the negative vector of the
axis.
2021-01-30 12:55:07 -03:00
acc662ea5a Revert "Fix T83092: Direction of rotation with View orientation changed in 2.91"
This reverts commit f9e994d0f4.
And fixes T85227.

That commit created an inverted orientation matrix but the 'Align to
Transform Orientation' operator doesn't work well with inverted matrices.
2021-01-30 12:51:03 -03:00
3a954af862 EEVEE: Fix crash when using animated visibility with motion blur steps
This was caused by the same VBO being remapped twice by
`EEVEE_motion_blur_cache_finish`. Leading to memory corruption.
2021-01-30 16:35:52 +01:00
036b65d778 Fix T85149: Wrong reroute position when adding with quick gesture
In the operation of adding reroute node to the intersection with the
gesture segment, each rerount was added to the middle of two points that
are part of the segment.

Now add the reroute point to the intersection position.

Maniphest Tasks: T85149

Differential Revision: https://developer.blender.org/D10247
2021-01-30 10:46:05 -03:00
d0f59d3842 Fix T85144: Cycles crashes when editing render properties in viewport
rendering

Issue was caused by the sample pattern LUT always being freed and not
rebuilt when properties driving its dimensions were modified.
2021-01-29 17:35:28 +01:00
171f2e4949 Merge branch 'blender-v2.92-release' 2021-01-29 17:09:58 +01:00
Michael Möller
5d215d5225 EEVEE: Fix GPUNodeLink memory leak for displacement nodes using SHD_SPACE_WORLD
When the displacement space is set to SHD_SPACE_WORLD, the GLSL method
"node_displacement_world" is used instead of the "node_displacement_object" method. The two GLSL methods:
```
void node_displacement_object(
    float height, float midlevel, float scale, vec3 N, mat4 obmat, out vec3 result)
{
  N = (vec4(N, 0.0) * obmat).xyz;
  result = (height - midlevel) * scale * normalize(N);
  result = (obmat * vec4(result, 0.0)).xyz;
}

void node_displacement_world(float height, float midlevel, float scale, vec3 N, out vec3 result)
{
  result = (height - midlevel) * scale * normalize(N);
}
```
In contrast to the "node_displacement_object" method, the "node_displacement_world"
does not require an "obmat" parameter. Attempting to still pass "GPU_builtin(GPU_OBJECT_MATRIX)"
as additional parameter will result in a memory leak. The "GPUNodeLink" allocated in
the "GPU_builtin" method will never get released.

Fixes T83941 Memory leak when using the Displacement shader node in Eevee with the displacement
space set to "World Space"
2021-01-29 17:08:46 +01:00
c7d75a6616 Merge branch 'blender-v2.92-release' 2021-01-29 16:06:11 +01:00
b3fc885544 Depsgraph: Remove redundant copy-on-write operations
This change removes copy-on-write operations from ID nodes which do not
need copy-on-write.

Should be no functional changes, as before the copy-on-write operation
would do nothing for those nodes anyway.
2021-01-29 15:52:53 +01:00
876fd40643 Fix T83411: Crash when using a workspace/layout data path in a driver
Building IDs which are not covered by copy-on-write process was not
implemented, which was causing parameters block not present, and, hence
causing crashes in areas which expected parameters to present.

First part of this change is related on making it so Copy-on-Write is
optional for ID nodes in the dependency graph.

Second part is related on using a generic builder for all ID types
which were not covered by Copy-on-Write before.

The final part is related on making it so build_id() is properly
handling ParticleSettings and Grease Pencil Data. Before they were not
covered there at all, and they need special handling because they do
have own build functions.

Not sure it worth trying to split those parts, as they are related to
each other and are not really possible to be tested standalone. Open
for a second opinion though.

Possible nut-tightening is to re-organize build_id() function so
that every branch does return and have an assert at the end, so that
missing ID type in the switch statement is easier to spot even when
using compilers which do not report missing switch cases.

As for question "why not use default" the answer is: to make it more
explicit and clear what is a decision when adding new ID types. We do
not want to quietly fall-back to a non-copy-on-write case for a newly
added ID types.

Differential Revision: https://developer.blender.org/D10075
2021-01-29 15:52:53 +01:00
0e37d3efc0 Fix T84717: missing 3D viewport updates when changing shading settings
Previously this relied on the dependency graph to detect changes in the screen
datablock, which would then notify the renderers. This was rather indirect an
not even really by design. Instead use notifiers to tag specific 3D viewports
to be updated.

Includes changes to BKE_scene_get_depsgraph to accept a const Scene pointer.

Testing if this works correctly requires adding back commits 81d444c and 088904d,
since those have been temporarily reverted.

Differential Revision: https://developer.blender.org/D10235
2021-01-29 15:52:53 +01:00
087777f2b9 Cleanup: accept const pointer for BKE_scene_get_depsgraph 2021-01-29 15:52:53 +01:00
cacc1d723c Fix T81169: Grease Pencil Z-depth drawing issue on OSX + AMD Graphic Cards
The grease pencil merge depth shader is designed to only work correctly
in octographic mode. The uv coordinates used `noperspective` attribute.
Somehow this doesn't lead to render artifacts on most platforms and was
only detected on OSX + AMD cards.

This fix would calculate the uv coordinate inside the fragment shader
and isn't passed along from the vertex shader.

Thanks to Sebastián Barschkis for providing the hardware and time and
Clément Foucault for helping out with the final fix.
2021-01-29 15:19:01 +01:00
bc94036a76 GPU: Remove unused GPU debugging command line options
Removes two unused --debug-gpu command line flags (unused as in, does nothing):
* `--debug-gpumem`: Unused since c08d847488, the info is now available in
  the status-bar if enabled in the Preferences. Initially added in
  fec317de8d.
* `--debug-gpu-shaders`: Unused since 216d78687d, double checked with
  Clément, he says it's not that useful nowadays. Initially added in
  fec317de8d.

Addresses T83954 and T83953.

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

Reviewed by: Clément Foucault
2021-01-29 14:17:49 +01:00
75e8e01124 Fix wrong command line argument description for --debug--gpu-force-workarounds
Was using the same description as `--debug-gpumem`.

`--debug-gpu-shaders` actually has the same issue, but will be removed in the
next commit.
2021-01-29 14:13:30 +01:00
b2e00e8f8e Merge branch 'blender-v2.92-release' 2021-01-29 13:35:21 +01:00
9f89166b52 Fix T85148: OptiX viewport denoising regression
Commit 6e74a8b69f changed the denoiser input passes default to
include the normal pass. This does not always produce optimal images though, hence why the
default was previously set to only include the color and albedo passes. This restores that behavior, so
that viewport denoising with OptiX produces the same results as before.
2021-01-29 13:35:00 +01:00
b8feac9c81 Merge branch 'blender-v2.92-release' 2021-01-29 13:16:41 +01:00
Robert Guetzkow
821df20797 Fix T84588: Set parameter as required for uv_on_emitter
This commit fixes T84588's second issue. The `particle` parameter was
declared optional in the Python API of `bpy.types.ParticleSystem.uv_on_emitter`
due to a typo in the RNA definition. This commit marks it as required.

Reviewed By: JacquesLucke

Differential Revision: https://developer.blender.org/D10127
2021-01-29 13:10:54 +01:00
02bb3595d0 Merge branch 'blender-v2.92-release' 2021-01-29 12:58:39 +01:00
1b32679284 Fix T85169: UV scale gizmo swaps X/Y
Introduced with swapped axis in rB0d67eb277f9b.
Similar was fixed for the translate gizmo in rB567212c3434a.
Now do the same for scaling as well.

Maniphest Tasks: T85169

Differential Revision: https://developer.blender.org/D10245
2021-01-29 12:56:08 +01:00
bc794109db Merge branch 'blender-v2.92-release' 2021-01-29 22:31:24 +11:00
cf91fb347d Fix T85178: edit-mesh show_edges overlay option toggles face-dots
When this behavior was added it made sense,
since then show_edges has changed to make edge-display more subtle
(see 1a4b60c30d) instead of removing
edge-selection display entirely.
2021-01-29 22:30:02 +11:00
954af8c182 Geometry Nodes: missing null check for volume objects
The problem was found by Dalai in T84606.
2021-01-29 11:44:30 +01:00
b62e98d4e2 Merge branch 'blender-v2.92-release' 2021-01-29 11:38:33 +01:00
6f88053d85 Fix T84661: read jpg pixel density
For jpeg, an image.resolution was always based on the default 72dpi, now
read the pixel density from the jpeg_decompress_struct, convert
according to unit and store in IMBuf's ppm.

Not 100% sure of all implications tbh., files I have checked seem to work
as expected now in the context of the report.

Maniphest Tasks: T84661

Differential Revision: https://developer.blender.org/D10166
2021-01-29 11:07:58 +01:00
45d952e045 Merge branch 'blender-v2.92-release' 2021-01-29 10:21:17 +01:00
3fb5e83867 Fix T85139: Force field texture missing depsgraph relation
If a force field was of type "Texture", any changes of that texture (e.g.
its type - as reported in T85139 - or also its properties) were not
properly updating rigid bodies and particle systems.

Now ensure that texture is actually in the depsgraph and set up relation
accordingly.

Also fixes T75198.

Maniphest Tasks: T85139

Differential Revision: https://developer.blender.org/D10234
2021-01-29 10:18:53 +01:00
27e2c5ab78 Tests, docs: Use sanitizer options from environment too.
Don't overwrite environment variables that may
contain options like suppression files, symboliser etc.
It's similar to rBa181b156399a13fa429159112e30c8005d5e8a59
and rBA589d13408a60cbec34a8bc3cc798c586043743ae .
For Blender Add-ons repo, see the equivalent in D9816.

Reviewed By: Blendify
Differential Revision: https://developer.blender.org/D9815
2021-01-29 14:13:26 +05:30
16fab8ebc4 Cleanup: git-blame-ignore-revs: Update policy & commits
Discussion:
https://lists.blender.org/pipermail/bf-committers/2020-December/thread.html#50844

*Remove clang-tidy commits altogether as they have a history of
introducing bugs/ build issues.
*Remove renames.

Reviewed By: brecht
Differential Revision: https://developer.blender.org/D9986
2021-01-29 13:20:32 +05:30
ca4ac742f4 UI: clarify edit-mesh face center behavior
- Grey out in wire/xray display.
- Expand the description for when this is used.

While this is working, the intended behavior wasn't clear,
address T85177.
2021-01-29 16:41:15 +11:00
93706de594 Docs: notes on the 2.7x keymap
Note the key-map items that don't match the original 2.7x key-map,
since some of these are quite obscure.
2021-01-29 16:00:23 +11:00
cba5d38256 Merge branch 'blender-v2.92-release' 2021-01-29 11:44:13 +11:00
3e5091bb21 Merge branch 'blender-v2.92-release' 2021-01-29 11:44:08 +11:00
b2ce1b0758 Cleanup: rename variables for gizmo templates
The abbreviation was from 'manipulator',
which was changed to gizmo during development.

Also correct operator description.
2021-01-29 11:43:19 +11:00
82b06f3112 PyAPI: Add error when registering a 3D gizmo into a 2D gizmo group
Address issue raised in T85145.
2021-01-29 11:43:14 +11:00
f560dc6892 Cleanup: rename variables for gizmo templates
The abbreviation was from 'manipulator',
which was changed to gizmo during development.

Also correct operator description.
2021-01-29 11:33:54 +11:00
b0ab4b815a PyAPI: Add error when registering a 3D gizmo into a 2D gizmo group
Address issue raised in T85145.
2021-01-29 11:12:57 +11:00
213f8294b5 Fix T84906: Loop select can fail when starting from an ngon
When stepping over an ngon's edges, check the number of edges & faces,
to ensure the topology connected to the ngon would be walked along.
2021-01-29 10:06:56 +11:00
1e355b0992 Docs: add diagrams describing the purpose of BMwEdgeLoopWalker.f_hub
Without this the purpose of this feature isn't clear.

While 01b3e9cc9f linked to an image,
add inline ascii diagrams with detailed explanations.
2021-01-29 10:06:52 +11:00
92b0803f35 Merge branch 'blender-v2.92-release' 2021-01-28 16:25:59 -06:00
71cb6923f5 Fix T83988: Active modifier outline uses search theme color
The outline for the active modifier was abusing the property search
match theme color, as noted in a comment. This commit adds a new
theme color in RNA specifically for the active modifier outline.
2021-01-28 16:16:24 -06:00
323b7ad9cd Merge remote-tracking branch 'origin/blender-v2.92-release' 2021-01-28 22:59:18 +01:00
2f60e5d1b5 Cleanup: Move geonodes object info RNA enum
This enum is only used by the node. So it does not need to be declared outside
the scope of its function.

Originally I thought this may be relevant to the collection info node as well,
but the patch for it is defining its own enums.
2021-01-28 22:44:20 +01:00
7a62574338 Cleanup: Reduce variable scope
Also some minimal white space changes
2021-01-28 13:52:39 -06:00
fcb7b0adcc Fix T85157: join node not working when the second mesh is empty
The issue was that the `offset` in `dst_span[offset]` was out of bounds
when the domain size is 0. The fix is to simply skip copying attributes
in that case.
2021-01-28 17:03:34 +01:00
133966423a Revert "Depsgraph: Remove redundant copy-on-write operations"
This reverts commit 76fd41e9db. This should have
been reverted along with 0f95f51361, since this
change by itself is causing crashes when the depsgraph accesses a non-existent
copy-on-write component.

Ref T84717
2021-01-28 13:16:49 +01:00
a51ff5208b Fix alpha transparency slider range being influenced by RGB values
For buttons that edit array properties, the soft min/max and slider ranges are
based on the range of all values in the array. However for alpha this does not
make much sense, the only reasonable range is 0..1 even when there are RGB
values larger than 1. So treat alpha as an individual property.
2021-01-28 13:16:49 +01:00
3c7d5ec829 Surface Deform: fix binding vertex artifacts causing spikes.
There are two issues here. First, like in T81988 there are cases
where the modifier would deform some vertices immediately after
bind. This is caused by wrong assumptions in the code about the
possible relative angles between various vectors, which can cause
negative weights that don't blend correctly to appear.

Specifically, it seems originally the code assumes that the
centroid-point vector in the polygon plane lies somewhere
between the mid-edge vectors. This is however not necessarily
the case for distant vertices, because the polygon is not
guaranteed to be truly planar, so normal projection may be
a bit off. The code has to use signed angles and checks to
support all possible angular arrangements.

The second issue is very thin and long triangles, which tend
to be very spatially unstable in their thin dimension, resulting
in excess deformation. The code was weighting distance using
the distances between the centroid and the mid-edge points, which
in this case end up as nearly opposite vectors of sizable length
and don't correctly represent how thin the triangle actually is.
It is thus better to use centroid-to-line distances, and an
additional even stricter value for the midpoint that will use
only 3 vertices at evaluation time.

Differential Revision: https://developer.blender.org/D10065
2021-01-28 14:42:53 +03:00
a6b31af37e Merge branch 'blender-v2.92-release' 2021-01-28 12:36:13 +01:00
Yevgeny Makarov
3726aa68c3 Fix T83935: Superimposed icon's hotspot is misaligned
Now the icon's rect are drawn wider than it should be, and with
overlapping, probably in order to compensate for the icon's offsets
inside the rect. The solution is to draw icon's rect of the correct
size and center the icon itself.

And make the hotspot exactly match the icon's rect. The last/right
button's hotspot also covers the extra padding on the right.

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

Reviewed by: Julian Eisel
2021-01-28 12:36:00 +01:00
Yevgeny Makarov
6f054f5ac7 Fix T83935: Superimposed icon's hotspot is misaligned
Now the icon's rect are drawn wider than it should be, and with
overlapping, probably in order to compensate for the icon's offsets
inside the rect. The solution is to draw icon's rect of the correct
size and center the icon itself.

And make the hotspot exactly match the icon's rect. The last/right
button's hotspot also covers the extra padding on the right.

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

Reviewed by: Julian Eisel
2021-01-28 12:33:46 +01:00
c0d2b10c59 Fix T69001: Custom icons won't load while using workbench engine
Preview icons (e.g. material preview or other data-block previews) use the same
background-job code as deferred loading of custom icons/previews. There was a
check to skip preview generation if the render engine does not support preview
rendering mode, which workbench doesn't. However this check should only be used
when actually rendering a preview, not when doing deferred loading.
2021-01-28 12:23:15 +01:00
0bd2f18a85 Merge branch 'blender-v2.92-release' 2021-01-28 22:11:20 +11:00
07e66f58cc Fix T85121: Sequencer key conflict with Lock & Select Linked
"Lock Strips" (Shift-L), conflicted with "Select Pick Linked".

Use Ctrl-H, Ctrl-Alt-H for lock & unlock since selected linked
uses bindings which are used in other parts of Blender.
2021-01-28 22:06:05 +11:00
a64a8d2b79 Cleanup: spelling
Also remove replace 'playblast' with terminology used in Blender's UI.
2021-01-28 22:02:11 +11:00
dfcfc8ee95 Merge branch 'blender-v2.92-release' 2021-01-28 21:56:10 +11:00
8948f73784 Fix T81334: Python view-port drawing depth-test regression
Since 216d78687d the depth function
(glDepthFunc) was left in an undefined state for drawing callbacks that
use the `bgl` module.

This meant enabling depth-test from Python's bgl module also needed
to set the depth function (which previously wasn't necessary).

Set the depth function as part of GPU_bgl_start
2021-01-28 21:53:56 +11:00
bf721fb679 Fix panning with Lock-to-Selection and no selection in Clip Editor
Rather self-explanatory. Never worked since the initial implementation.
It is possible to preserve lock-to-selection option with no selection
nowadays (since the fix for T84850). So now the Lock-to-Selection option
is fully under user control. Surely, the panning and zooming is also
properly supported now in the described scenario.

Differential Revision: https://developer.blender.org/D10226
2021-01-28 11:34:53 +01:00
3b66f40d40 Fix T85124: Undo assert changing property in redo panel.
Logical mistake in recent refactor (rB2a8122fb65c5).
2021-01-28 11:33:37 +01:00
573bda1fae Fix unused result from mmap() call
The unused result was reported by Clang-Tidy 11.

It does make sense to check for the failed mmap() calls rather than
quietly suppress errors.

In this change failures are reported, but application execution is
not aborted. This is a bit disputable, but it feels to be a safer
thing to do now.

It is unclear how to test the code though, as we don't have any
tools in-place to simulate read errors.

Differential Revision: https://developer.blender.org/D10223
2021-01-28 11:05:38 +01:00
92567c072a Cleanup: Fix clang format
Due a problem in the mergetool, the clang format was totally wrong in the previous commit.
2021-01-28 11:02:49 +01:00
8214a63493 Merge branch 'blender-v2.92-release' 2021-01-28 10:54:20 +01:00
Habib Gahbiche
51c8d53a7d Fix T84512: Crash if size input of Blur node is too large
Gaussian filter with a too large kernel doesn't make much sense.
This commit caps the Gaussian function radius to MAX_GAUSSTAB_RADIUS.

Reviewed By: sergey

Maniphest Tasks: T84512

Differential Revision: https://developer.blender.org/D10122
2021-01-28 10:43:46 +01:00
7000eb00f8 Merge branch 'blender-v2.92-release' 2021-01-28 10:37:19 +01:00
b379f626ce Fix T85035: Gpencil render in background render wrong frame
Due a thread priority, the calculation of the current frame is not done before the frames are available. This produces wrong render frames.

The solution is verify the current frame before doing the real render. This adds only a few milliseconds, but it assures the frame is correct.

As the problem is only when render in background, the recalculation of the frame is only necessary when do real render and not a viewport render, so there is no impact in the animation FPS.
2021-01-28 10:36:05 +01:00
9fdb32bf51 Merge branch 'blender-v2.92-release' 2021-01-28 10:34:33 +01:00
61d1fd7e2f Fix T85142: BMW scene quits Blender
Technically, the crash was caused by revert which happened in
rBcd24712c2c5: it reverted some code which is essential for
rB76fd41e9db1.

Bring back the essential code for the removal of un-needed
Copy-on-Write operations, so that the crash doesn't happen.

What was causing the crash is the ID tag assuming Copy-on-Write
operation always exists.
2021-01-28 10:34:18 +01:00
39cfc95c2c Merge branch 'blender-v2.92-release' 2021-01-28 18:54:45 +11:00
78f7377c88 Fix T85107: Active tool doesn't update when mouse is already over it 2021-01-28 18:53:03 +11:00
fcda0c7eb9 Merge branch 'blender-v2.92-release' 2021-01-28 18:27:53 +11:00
9509e18564 Fix T82785: Setting Image.alpha_mode clears generated image data 2021-01-28 18:27:25 +11:00
c1c77b7b9a Merge branch 'blender-v2.92-release' 2021-01-28 16:23:01 +11:00
10e093b30d Fix T83539: 'activate_init' fails with buttons that have popups
Activating buttons was running too early, before the popup was
positioned on the screen,
causing data-selectors to be positioned incorrectly.

As the early button activation isn't needed, remove this call.

Ensure this doesn't happen again with an assert.
2021-01-28 16:12:43 +11:00
862aa2a66b Merge branch 'blender-v2.92-release' 2021-01-28 14:59:27 +11:00
e6a5e33c09 Merge branch 'blender-v2.92-release' 2021-01-28 14:59:24 +11:00
057859620d Merge branch 'blender-v2.92-release' 2021-01-28 14:59:20 +11:00
93412cb4e7 Fix jpeg200 4k cinema preset
Used the wrong define, also remove local defines.
2021-01-28 14:50:46 +11:00
87d3f4aff3 Fix T82675: Crash on exit when Blender is built as a Python module 2021-01-28 14:38:08 +11:00
198980693b Fix T84931: Keys that open menus can also activate menu items
Disable key-accelerators for key-repeat events.

When a key was held it could open the menu and activate the menu
item associated with that key.

With the RMB select option: edit-meshes & edge-selection caused
holding W to open & activate "Edge Bevel Weight".
2021-01-28 10:50:47 +11:00
df135b74fc PyAPI: use PYTHONUTF8/Py_UTF8Mode on all platforms
System encoding issues have been a paint-point for us with Python 3,
since Blender always uses UTF-8 which might not be the case for the OS.

While the Py_SetStandardStreamEncoding was already set to utf-8,
the file-system could still have an incompatible encoding.

See PEP-540 for details.
2021-01-28 09:47:05 +11:00
e285765a6b Fix incorrect RNA enum default
Also another copy and paste error in the attribute compare node.
2021-01-27 12:48:10 -06:00
c604fd56a7 Merge branch 'blender-v2.92-release' 2021-01-27 18:44:59 +01:00
37e60289c2 Fix T85110: moving markers num input confuses time vs frames
Looks like a typo in rB66b84ad1592d.

Maniphest Tasks: T85110

Differential Revision: https://developer.blender.org/D10225
2021-01-27 18:40:07 +01:00
4c4ccdfa36 RNA: Add warning to float percentage property definition
As a followup to rBc71a8e837616159735, add a debug-only check for
incorrect range, when the percentage and factor functions were likely
confused.
2021-01-27 11:22:55 -06:00
c71a8e8376 UI: Fix incorrect RNA percentage property definitions
In two cases the percentage property was actually used incorrectly, as
pointed out in T82070. The range was [0, 1], but the properties were still
displayed as percentages.

There is a preference to control whether to display factors or
percentages, so it usually doesn't make sense to manually define
properties as percentages.

Resolves T82070

Differential Revision: https://developer.blender.org/D9344
2021-01-27 11:19:54 -06:00
0e39c526d8 Fix RNA debug build error after recent Sky texture altitude change
Reduce step size within the allowed range.
2021-01-27 17:54:38 +01:00
ded4940901 Fix possible dereference of nullptr mask 2021-01-27 16:54:29 +01:00
Marco
0af512abdf Sky Texture: change Nishita Altitude to use unit system
Differential Revision: https://developer.blender.org/D9968
2021-01-27 16:48:50 +01:00
97e646b54a Documented color management issue.
When using the viewport render animation and saving to an 8 bit
image/movie file, the color management is applied twice. Once on the GPU
and once when saving to disk. Removing this option currently leads to
incorrect Scene strip rendering so needs more research.
2021-01-27 16:07:17 +01:00
a4d07bafc6 Cleanup: Moved update ratio stretching overlay to cache_finish 2021-01-27 16:07:17 +01:00
f83aa830cd Fix T83187: Unselected UVs shows selected on linked meshes.
When uv editing objects that share the same mesh only the selection
state can get confused. The cause is that the UV editor uses a
particular order of objects and store its state in the first object of a
mesh it hasn't handled. During drawing this state is updated into the
GPU buffers. In the case of linked meshes it can happen that the GPU
buffers are updated based on the object that does not have the correct
selection state making th selection VBOs incorrect.

This patch adds a work around that uses the order that the UV editor is
also using so the GPU buffers are built with the right data.
2021-01-27 16:07:17 +01:00
9b80291412 Merge branch 'blender-v2.92-release' 2021-01-27 15:29:39 +01:00
James Horsley
4fbeb3e6be Fix T85089: Crash when rendering scene that does not fit into GPU memory with CUDA/OptiX
The "cuda_mem_map_mutex" was potentially being locked recursively during the call to
"CUDADevice::move_textures_to_host", which crashed. This moves around the locking and
unlocking of "cuda_mem_map_mutex", so that it doesn't call a function that locks it while
still holding the lock.

Reviewed By: pmoursnv

Maniphest Tasks: T85089, T84734

Differential Revision: https://developer.blender.org/D10219
2021-01-27 15:27:57 +01:00
6f7e2bf170 Fix T84329: Crash when loading the blender with deprecated graphics driver
Add the driver `4.5.13467` related to `Radeon R5 Graphics` to the
workaround list.
2021-01-27 10:52:40 -03:00
8e52d76bcd Merge branch 'blender-v2.92-release' 2021-01-27 14:25:28 +01:00
cd24712c2c Fix T84717: Missing viewport update after shading changes
Revert "Fix T83411: Crash when using a workspace/layout data path in a driver"

The fix for the crash exposed design violation in the viewport shading updates,
which is for some reason relying on dependency graph tag of interface data.

The viewport module did not respond to the issue in 2 weeks, and the architect
considered missing update for multiple users a more serious issue than a crash
in a very specific case.

This reverts commit 0f95f51361.
2021-01-27 14:20:31 +01:00
c92b5622ad CMake: Detect Clang-Tidy 11 and 12 2021-01-27 13:01:01 +01:00
3f8816eb6a Merge branch 'blender-v2.92-release' 2021-01-27 20:26:22 +11:00
75c426a60a Merge branch 'blender-v2.92-release' 2021-01-27 20:26:19 +11:00
ea01c8c5f6 Fix T84402: Off-screen rendering works only once from Python
Off-screen drawing doesn't work once the 'bgl' workaround is enabled.
Disable this for off-screen drawing.
2021-01-27 20:23:00 +11:00
4b7b4efd5b Fix T81834: Images not properly duplicated in node_shader_utils
Oversight in fb10eaf6e8
2021-01-27 18:16:02 +11:00
fc669a4c3e Cleanup: spelling 2021-01-27 15:28:24 +11:00
6e03a66e78 Merge branch 'blender-v2.92-release' 2021-01-27 15:18:56 +11:00
abb2215061 Merge branch 'blender-v2.92-release' 2021-01-27 15:18:52 +11:00
fb10eaf6e8 UI: add ellipsis to batch rename menu item 2021-01-27 15:17:01 +11:00
7d24aa8aa8 RNA Manual Reference: Update Mappings 2021-01-26 17:19:03 -05:00
e41a8bfabe Merge remote-tracking branch 'origin/blender-v2.92-release' 2021-01-26 14:57:17 -07:00
5496d8cd36 Windows: Fix wchar_t truncation
BLI_strncpy_wchar_from_utf8 made the assumption that
wchar_t is UTF-32 bit regardless of environment, while
this holds true on both mac and linux, on windows
wchar_t is actually actually UTF-16.

This resulted in the upper 16 bits being dropped from
from some string conversions and prevented blender
from starting when installed in a path with unicode
code-points over 0xffff.

There was also a fair bit of code duplication between
BLI_strncpy_wchar_from_utf8 and BLI_str_utf8_as_unicode_and_size

this change essentially removes all logic from
BLI_strncpy_wchar_from_utf8 and calls the right function
for the right environment.

Reviewed By: brecht , Robert Guetzkow

Differential Revision: https://developer.blender.org/D9822
2021-01-26 14:56:39 -07:00
d096d9c4d6 UI: Tooltip for data-block selector menus, showing full name and library info
Long data-block names are clipped to fit into data-block selector menus. For
linked data-blocks, there's also a hint indicating the source library, which
takes further space and may get clipped too.

So this commit adds a tooltip to the menu items, which displays the full,
unclipped data-block name and the unclipped library name. Plus, the library
path is shown too, which is also useful info.

Adds helper functions for search menu item tooltips, so these are easier to add
to other search menus in future.

Part of T84188.
2021-01-26 22:17:17 +01:00
656f6ae643 Cleanup: Use const parameters for active button lookups/tests
Needed for const-correctness in the following commit.
2021-01-26 22:17:17 +01:00
733bcbed46 Cleanup: Comment formatting, grammar 2021-01-26 15:09:02 -06:00
1f81195fb9 Cleanup: Use LISTBASE_FOREACH macro 2021-01-26 14:59:03 -06:00
c32c6a5f85 UI: Current Frame Marker Cleanup
Draw current frame marker in a single pass.

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

Reviewed by Hans Goudey
2021-01-26 11:15:42 -08:00
1c4b0c47dd Geometry Nodes: Support all operations in the "Attribute Math" node
This adds the ability to use all the math operations in the regular
utility "Math" node. The code is quite similar to the attribute vector
math node, with the simplification that the result is always a float.

Differential Revision: https://developer.blender.org/D10199
2021-01-26 12:57:31 -06:00
de3f369b30 UI: Use Ellipsis for Short Truncated Text
Allow use of ellipsis to indicate truncated text down to a single character.

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

Reviewed by Hans Goudey
2021-01-26 10:17:37 -08:00
cdb8209b35 Merge branch 'blender-v2.92-release' 2021-01-26 12:13:42 -06:00
d9a63d40e2 Fix build error
An extra `p->` was added for some reason in a recent commit.
Additionally, there's no reason for the flag to be kept as a pointer,
so just dereference it at the start of both functions.
2021-01-26 12:13:28 -06:00
3d7d0f1f2e Merge branch 'blender-v2.92-release' 2021-01-26 11:56:08 -06:00
a6016bf5af UI: Fix ugly alignment of timeline popover buttons
Apparently things have changed since {rB98d205508977a6f72bf55},
and putting the buttons in two separate rows is no longer enough
to keep the right-most popover button in the timeline header from
aligning with the menu buttons. This just adds a separator large
enough to avoid the alignment.
2021-01-26 11:55:36 -06:00
60d85a3e60 Merge branch 'blender-v2.92-release' 2021-01-26 18:38:07 +01:00
23e108c5b6 Fix T85082: Perspective distortion while drawing
When the drawing plane was set to view and the user would pan their
camera sideways, the drawing would be more and more distorted and
projected further back.

The fix projects the strokes to view when the user is looking through
the camera or has the drawing plane set to view.

Reviewed By: antoniov

Maniphest Tasks: T85082

Differential Revision: https://developer.blender.org/D10213
2021-01-26 18:37:08 +01:00
ef28da2623 Fix T85082: Perspective distortion while drawing
When the drawing plane was set to view and the user would pan their
camera sideways, the drawing would be more and more distorted and
projected further back.

The fix projects the strokes to view when the user is looking through
the camera or has the drawing plane set to view.

Reviewed By: antoniov

Maniphest Tasks: T85082

Differential Revision: https://developer.blender.org/D10213
2021-01-26 18:32:49 +01:00
6157c45445 Fix T85049: Geometry Nodes: How to handle instances with shear? (part2)
Update to changes in master.

Reviewed By: JacquesLucke

Differential Revision: http://developer.blender.org/D10211
2021-01-26 18:25:16 +01:00
82523840cd Merge branch 'blender-v2.92-release' 2021-01-26 18:23:13 +01:00
abd6b1d7b2 Fix T85049: Geometry Nodes: How to handle instances with shear?
Use transform matrices instead of loc, rot, scale variables to store instance transforms.

Reviewed By: JacquesLucke

Differential Revision: http://developer.blender.org/D10211
2021-01-26 18:21:12 +01:00
ae5c15bb43 Merge branch 'blender-v2.92-release' 2021-01-26 17:51:51 +01:00
6d40d72189 Fix T84847: Crash after splitting effect strip
`seq->tmp` was left in invalid state after
`SEQ_sequence_base_dupli_recursive()` which is run by
`scene_copy_data()`

Ensure all strips have `seq->tmp` set to `NULL` before splitting strips.
2021-01-26 17:50:44 +01:00
c967208460 Fix T79922: Cache of meta strip not invalidated
Meta strip cache is not invalidated if strip inside of meta strip is
invalidated.

Find all metastrips that contain invalidated strip and invalidate them
recursively.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D10192
2021-01-26 17:50:44 +01:00
41979fc03b Fix T84160: Wrong DOF when camera is overriden
Workbench engine used active camera to setup DOF effect even when
camera was overridden.

Store camera override in `WORKBENCH_PrivateData` and use it in
`workbench_dof_engine_init()`

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D9952
2021-01-26 17:50:44 +01:00
981380cf6d VSE: Fix memory leak when building proxies
With no valid strips selected, file_list is not freed.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D10191
2021-01-26 17:50:44 +01:00
20504e555e Fix T84979: No sound after changing strip datablock
Tag relations to update to load new sound.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D10182
2021-01-26 17:50:44 +01:00
f22e85d721 Fix T84935: improve previous fix for boolean custom data layers
This improves the fix introduced in rBdc8b31af578bfcf9f77dbce6d7b7da1006a3c8c1.
While it did not result in other bugs afaik, I thought it would be
good to make the fix more specific, in case some other code did
expect `layer->data` to be null. This updated fix checks for the
very specific case the fix was intended for.
2021-01-26 17:49:58 +01:00
ff7a557c67 Geometry Nodes: new Points to Volume node
This implements a new geometry node based on T84606.
It is the first node that generates a `VolumeComponent`.

Differential Revision: https://developer.blender.org/D10169
2021-01-26 17:37:58 +01:00
89484e9754 Geometry Nodes: Use highest complexity attribute in join node
This just implements a todo with a utility function that didn't exist
at the time. For example, if one geometry has a "scale" attribute with
a float type and another has a "scale" attribute with a vector type,
the vector type will be used for the resulting geometry.

Differential Revision: https://developer.blender.org/D10206
2021-01-26 10:10:07 -06:00
66f8835f9c Fix T84850: "Lock to Selection" causes unwanted jumps
Adding new tracks, mask points, mask primitives, changing selection was
causing an unwanted jumps in the view.

This change makes it so those operations are preserving view offset.

Differential Revision: https://developer.blender.org/D10146
2021-01-26 16:23:09 +01:00
3d3b6d94e6 Subdiv: Use better default UV interpolation
The default one is now UVs are smoothed, boundaries are kept sharp.

After some time of experimentation seems this is better default from
interoperability point of view.

This fixes distortion reported in T83470.

Differential Revision: https://developer.blender.org/D10111
2021-01-26 16:23:09 +01:00
66151b5de3 Subsurf: Expose all UV interpolation options
Useful for interoperability, and allows to change default mode
without breaking compatibility.
2021-01-26 16:23:09 +01:00
c1d0b234fb Subdiv: Fix typo in RNA enum value name
Was duplicated from SUBSURF_UV_SMOOTH_PRESERVE_BOUNDARIES value.
2021-01-26 16:23:09 +01:00
8d51c06611 Cleanup: Reduce variable scope 2021-01-26 09:21:42 -06:00
20d0bb43af GPencil: Swap positions of Pie menu options for Vertex Paint and Weight Paint
This keep the same logic used with meshes because now the Weight Paint and Vertex Paint are not in the same position for grease pencil.
2021-01-26 16:11:06 +01:00
31f568c336 Fix: incomplete integration of PugiXML and Potrace build options
Add them to the standard build configurations, disable properly when library
not found and print as part of configuration overview.
2021-01-26 15:55:27 +01:00
dde3ecc1a8 Cleanup: compiler warnings
If one method is marked as override, clang warns if others are not.
2021-01-26 15:52:05 +01:00
c51a5b204c Fix T85048: Cycles sculpt vertex color issues after recent changes
Attribute fields were not fully copied.

Ref D10208
2021-01-26 15:32:05 +01:00
26b5760d6d Fix T85038: No curve is "active" after selecting all curves
Check for selection status beforec learing the "active" flag from an
FCurve. This allows the "Select All Curves" operator to retain what is
seen as the active curve.
2021-01-26 15:13:42 +01:00
Charles Flèche
76ab0381d1 Fix Cycles standalone compilation following API changes
The changes to the socket API were not applied to the standalone app.

Also modify Camera.compute_auto_viewplane() to use Camera.full_width and Camera.full_height as it is not possible to publicly access Camera.width and Camera.height anymore, so the aspect ratio could be computed with stale data.

Differential Revision: https://developer.blender.org/D9961
2021-01-26 14:39:32 +01:00
Charles Flèche
532d3a103a Cycles standalone: fix missing dependencies in CMake files
Also set default CYCLES_INSTALL_PATH to CMAKE_INSTALL_PREFIX.

By default with a `make cycles` this will build to ${CMAKE_BINARY_DIR}/bin

Differential Revision: https://developer.blender.org/D9961
2021-01-26 14:39:32 +01:00
84671d796d Merge remote-tracking branch 'origin/blender-v2.92-release' 2021-01-26 14:38:40 +01:00
b665781808 Asset Browser: fix context properties reported to Python
Change `"active_id"` to `"id"` so that tab completion in the asset browser
context returns the correct properties.

055ef5df61 renamed the `active_id` property
to `id`, but `dir(thecontext)` still returned `"active_id"`.
2021-01-26 14:27:33 +01:00
ed809866b1 Viewport Rendering: Don't clamp when overlays are disabled.
During viewport rendering the color values were clamped in order to
apply the overlay on top of it. This clamping would show the scene
colors washed out.

This patch adds a work around to skip the clamping when the overlays are
turned off.

Parial fix for {T77909}
2021-01-26 14:25:18 +01:00
e6aece32a0 GPU: Enable HQ normals workaround for any AMD Drivers on Polaris. 2021-01-26 12:48:50 +01:00
74633c0456 Merge branch 'blender-v2.92-release' 2021-01-26 12:41:47 +01:00
Robert Guetzkow
c399651637 Fix T84708: Versioning for Set Alpha node
The versioning code introduced in rB38df935c0985 skips the composite node
tree that is used by the scene thus not correctly versioning Set Alpha
nodes outside of node groups. This fix iterates through all node trees to
version all Set Alpha nodes.

Reviewed By: JacquesLucke

Differential Revision: https://developer.blender.org/D10110
2021-01-26 12:38:43 +01:00
c3a4c6c209 GPU: Enable HQ normals workaround for AMD 21.1.1 driver.
AMD 21.1.1 still has the same issues as reported in T82856.
2021-01-26 12:30:54 +01:00
4935ed6ce6 Fix T84907: incorrect dirty mask after geometry join node
Hans noticed that these dirty flags are only used for normals currently
and that the edge flag is not used at all. This patch still applies the
"entire" fix with all four flags.

Differential Revision: https://developer.blender.org/D10193
2021-01-26 12:09:44 +01:00
dc8b31af57 Fix T84935: boolean custom data layers not saved correctly
The issue was that boolean custom data layers were not written to files,
because the dna struct name `bool` does not exist. Adding a struct that
just contains a `bool/uint8_t` does not seem to be possible, it looks like
the minimum dna struct size is 4 bytes.

The proposed solution has two parts:

1. Write the custom data layer using `BLO_write_raw` instead of
   `BLO_write_struct_array_by_name`.
2. When loading a file, reinitialize any custom data layer that was
   not saved correctly (this is just a fix for existing files).

Differential Revision: https://developer.blender.org/D10194
2021-01-26 12:05:40 +01:00
f066cee92f Merge branch 'blender-v2.92-release' 2021-01-26 22:04:21 +11:00
548d8a397c Fix T85011: "Allow Execution" reloads the wrong file when recovering
Support custom revert actions, necessary for recover operations
to be able to reload the file with scripts enabled.
2021-01-26 21:56:49 +11:00
2a8122fb65 ed_undo refactor: split/remove ed_undo_step_impl.
This function was doing too many things, with behaviors fairly different
depending on its input parameters. This was making the code fragile and
hard to follow.

Split it in three:
* `ed_undo_step_pre` does the common actions before we actually undo
  data.
* `ed_undo_step_post` does the common actions after we have undone/redone
  data.

Then, `ed_undo_step_direction`, `ed_undo_step_by_name` and
`ed_undo_step_by_index` do their actual specific actions, with their own
logic.

Note: Since the actual behavior of those three funtions is fairly
different (the first only undo/redo one effective step, the second is only
supposed to **undo** //before// given named step, and the third actually
undo/redo until given indexed step become active), we could also find
better names for those. right now, it sounds like they are doing the
same thing, with just different ways to specify the target step.

Note: This is part of on-going refactor work on undo system, see T83806.

Differential Revision: https://developer.blender.org/D10112
2021-01-26 09:44:46 +01:00
0d9f79b163 Cleanup: Reduce variable scope, use LISTBASE_FOREACH macro 2021-01-25 23:47:56 -06:00
f21de01b84 Merge branch 'blender-v2.92-release' 2021-01-26 15:38:08 +11:00
7909f70f64 WM: add "use_scripts" to recover auto-save/session operators
Support recovering blend files with scripts enabled,
needed to fix T85011, can be useful in general too.

Adding this also resolves an assert in BKE_autoexec_match,
since it ran even when scripts were enabled.
2021-01-26 15:34:38 +11:00
e9e054b987 Geometry Nodes: Add float2 to attribute complexity map 2021-01-25 22:20:41 -06:00
71a8e32dc0 Merge branch 'blender-v2.92-release' 2021-01-26 15:18:10 +11:00
d55d95b04d WM: return success from WM_recover_last_session, minor cleanup
- Return success from WM_recover_last_session
- Avoid setting global variables is already called in WM_file_read.
  While it didn't cause any problems, these assignments ran even when
  recovering the session failed to load the file.
- Return OPERATOR_CANCELLED when the operator fails.

Returning success is needed to fix T85011.
2021-01-26 15:16:12 +11:00
Juanfran Matheu
7d2f746369 TEXTURE PAINT: Tools with wrong cursor
Texture paint tools were using DEFAULT cursor instead of PAINT_CROSS cursor as vertex paint, weight paint and sculpt modes.

Before
{F9591366}

After
{F9591370}

Reviewed By: Blendify

Differential Revision: https://developer.blender.org/D10172
2021-01-25 22:37:14 -05:00
Zev Eisenberg
6499a2ec5c Fix typos in driver_functions.py
I'm learning how driver functions work, and I found a couple of typos in the driver_functions.py template file. Here's a quick patch to fix them up.

Reviewed By: Blendify

Differential Revision: https://developer.blender.org/D10149
2021-01-25 22:37:14 -05:00
d7a2e0b83c Cleanup: Use const arguments 2021-01-25 21:11:57 -06:00
Juanfran Matheu
be262cf561 TEXTURE PAINT: Tools with wrong cursor
Texture paint tools were using DEFAULT cursor instead of PAINT_CROSS cursor as vertex paint, weight paint and sculpt modes.

Before
{F9591366}

After
{F9591370}

Reviewed By: Blendify

Differential Revision: https://developer.blender.org/D10172
2021-01-25 22:01:12 -05:00
Zev Eisenberg
0734b235d2 Fix typos in driver_functions.py
I'm learning how driver functions work, and I found a couple of typos in the driver_functions.py template file. Here's a quick patch to fix them up.

Reviewed By: Blendify

Differential Revision: https://developer.blender.org/D10149
2021-01-25 21:59:25 -05:00
ae1e68f514 Cleanup: Declare variables where initialized 2021-01-25 17:22:52 -06:00
70e064f111 Cleanup: Correct comments in ID type enum 2021-01-25 16:28:00 -06:00
c4f3475612 Cleanup: update comment from 77f73a9284 2021-01-26 09:23:44 +11:00
6249995c5e Fix T85054: undo/redo app handlers broken
Regression in recent commit c13383da41
which swapped undo/redo when calling the handlers.

Ref D10200
2021-01-26 09:18:26 +11:00
eaa726542e Merge branch 'blender-v2.92-release' 2021-01-25 23:12:02 +01:00
77f73a9284 Fix library name clipping most of the data-block name in data-block menus
Issue is visible here https://developer.blender.org/F8626313.

If there is enough space for both the item name and the library hint, display
both. Otherwise, clip either the item name, the library hint, or both so that
not more than 60% and 40% of the available width are used repectively.
There are further improvements we could do, as noted in T84188, this just fixes
the regression for the release.

Part of T84188. There were multiple reports about this, see merged in and
mentioned reports in T84188 and T78012.
2021-01-25 23:10:16 +01:00
a35c0fe6ce Merge branch 'blender-v2.92-release' 2021-01-26 08:16:22 +11:00
14f61c619b Fix wm.context_* operators reusing values when it's not expected
wm.context_* operators typically have their options set by menus
or key bindings.

Re-using options in this case can cause problems where two
actions that change unrelated properties will re-use a setting
from the previous execution.

For example changing the lights Power impacted
changing it's Radius afterwards.
2021-01-26 08:13:58 +11:00
4fc54ddae1 Cleanup: spelling 2021-01-26 07:50:40 +11:00
1559aa3da0 Merge branch 'blender-v2.92-release' 2021-01-25 21:11:48 +01:00
Greg Neumiller
c134d7437d Fix T84031 initialize connectivity info of the base mesh before using Displacement Smear brush.
Reviewed By: pablodp606

Maniphest Tasks: T84031

Differential Revision: https://developer.blender.org/D9956
2021-01-25 21:09:58 +01:00
93e3aed041 Merge branch 'blender-v2.92-release' 2021-01-25 11:48:53 -06:00
aa030d3459 Fix: Unable to animate nodes modifier exposed properties
The RNA path used for animating the settings passed to the node tree
is incorrect. Currently it's just `settings.property_name`, but it's
the path from the ID, not the modifier, so it should be
`modifiers[modifier_name].settings.property_name`.

However, the "Settings" struct is separated in RNA and DNA, which means
that the callback to get the RNA path does not know about the modifier's
name in order to fill the above path, so some reference to the modifier
in the "Settings" struct would be necessary, which would create a
convoluted layout in the `ModifierData` struct.

Instead, this commit simply removes the "Settings" struct from RNA,
which isn't as elegant from the point of view of the Python API,
but otherwise it's a nice simplification. Note that we don't remove the
"Settings" struct from DNA, because it would break reading old files.

Differential Revision: https://developer.blender.org/D10175
2021-01-25 11:46:55 -06:00
51c433f1a5 Windows: Remove zero terminator from stack trace
Important lesson to be learned here, leaving comments
is great and in the moment, they usually make sense.

Many months later they may not quite make as much sense
any more and time will have to be spend to figure out
what was meant, all of this would have been averted with a
better comment.

The zero terminator in this case, I can find no evidence
of it being used or relied on at any point. It does however
break GTests's `EXPECT_EXIT` macro that stops looking in
the output as soon as it sees the zts and doesn't end up
looking at the actual assert text being thrown. Which in
turn makes the`fcurve_active_keyframe`test fail when run
in debug mode on windows.
2021-01-25 08:50:37 -07:00
8a77019474 Cycles: modernize usage of rna iterators
Using rna iterators in range-based for loops is possible since {rBc4286ddb095d32714c9d5f10751a14f5871b3844}.

This patch only updates the places that are easy to update
without more changes in surrounding code.

Differential Revision: https://developer.blender.org/D10195
2021-01-25 16:25:27 +01:00
04f91bce53 Fix build error after Cycles Amembic procedural commit 2021-01-25 16:15:35 +01:00
b64f0fab06 Cycles: internal support for Alembic procedurals
The implementation is currently optimized to load animation sequences once
and then quickly scrubbing through them. Later on an option should be added
to optimize for memory usage and only load the current frame into memory.

Currently mesh and curve objects are supported, including support for UV and
vertex color attributes. Missing still is support for arbitrary attributes and
motion blur, as well as better handling of changing topology. Shader assignments
are made using FaceSets found in the Alembic archive.

The animation (and constant) data of the objects inside the Alembic archive is
loaded at once at the beginning of the render and kept inside a cache. At each
frame change we simply update the right socket of the corresponding Cycles node
if the data is animated. This allows for fast playback in the viewport
(depending on the scene size and compute power).

Note this is not yet exposed in the Blender UI, it's a feature that is still under
development and not ready for general use.

Ref T79174, D3089
2021-01-25 15:51:42 +01:00
2e67191c86 Cycles: internal support for the concept of procedurals
Procedurals are nodes in the scene that can generate an arbitrary number of
other nodes at render time. This will be used to implement an Alembic procedural
that can load an Alembic file into Cycles nodes. In the future we also expect to
have a USD procedural.

Direct loading of such files at render time is a standard feature in other
production renderers. Reasons to support this are memory usage and performance,
delayed loading of heavy scene data until rendering, Cycles standalone rendering
using standard file formats beyond our XML files, and shared functionality for
Cycles integration in multiple 3D apps.

Ref T79174, D3089
2021-01-25 15:51:38 +01:00
3656fc3aee Cleanup: move code to find geometry shaders into own function
Ref D3089
2021-01-25 15:48:39 +01:00
2a81d948ad LibOverride: refactor of relationships handling in library overrides.
First step towards a better handling of relationships between IDs in
override context, especially when a resync is needed.

First, introduce a new flag to override operations,
`IDOVERRIDE_LIBRARY_FLAG_IDPOINTER_MATCH_REFERENCE`, for ID pointers.
It keeps track of whether an RNA ID pointer has been kept to its
'natural overriden ID' (in override hierarchy context), or has actually
been re-assigned to some other data-block.

Second, refactor how we deal with relationships between IDs in override
hierarchy code, especially in resync case. This will fixe several cases
listed in T83811, especially the case where an ID pointer to an existing
override needs to be updated to a new one due to a matching change in
linked data.
2021-01-25 14:48:51 +01:00
5c490bcbc8 Fix T85027: Crash dragging a collection over empty Outliner
Filtering may make the Outliner tree empty. The function to find the drop
element should just return null then and let the caller decide how to deal with
it.
2021-01-25 14:37:24 +01:00
ef6d652428 Fix T83344: Cycles baking with progressive refine fails on GPU 2021-01-25 14:27:01 +01:00
f226687bb9 Cleanup: Knife Tool: Remove redundant 'view3d_operator_needs_opengl' calls
This function sets the `RegionView3D` matrices to the GPU.
But the OpenGL library is not actually being used by the operator.
2021-01-25 10:07:50 -03:00
4792d988fb Fix T84964: Crash when running Knife Project in the background
Although the Knife Project operator converts 3D coordinates to screen
space, it doesn't really need opengl.

Differential Revision: https://developer.blender.org/D10178
2021-01-25 10:07:50 -03:00
e9a47223cb Merge branch 'blender-v2.92-release' 2021-01-25 23:48:00 +11:00
4bc7996e2e Merge branch 'blender-v2.92-release' 2021-01-25 23:47:56 +11:00
72a207de35 Merge branch 'blender-v2.92-release' 2021-01-25 23:47:52 +11:00
William Reynish
601b690a24 Fix T84911: Add Primitive and IC keymap - 3d navigation conflict
Ref D10176
2021-01-25 23:46:57 +11:00
William Reynish
da2955fdf6 UI: improve categorization in Grease Pencil Layers sub-panels
The "Layers" panel for Grease Pencil objects uses sub-panels to organize
their properties in categories. Currently, this isn't so clear.
This patch cleans up these sub-panels with clearer categorization.

Reviewed By: #grease_pencil, antoniov, Blendify, HooglyBoogly

Ref D10184
2021-01-25 23:41:00 +11:00
7a005fb7d1 Fix T84324: Crash when combining two scenes in compositor.
In the CompositorOperation::deinitExecution the viewer could be freed at
the same time it was drawn in the image editor or node editor. There is
a guard for that but wasn't added during the migration of the two
editors to the draw manager.
2021-01-25 12:44:18 +01:00
dd2b616320 Buildbot: Fixed crash when building RC builds
Building RC builds would parse `BLENDER_VERSION_CYCLE_NUMBER` that
doesn't exist anymore. It was removed by {D7748}.

This change removes it from `buildbot_utils.py`.
2021-01-25 11:53:35 +01:00
06fdbe6664 Merge branch 'blender-v2.92-release' 2021-01-25 11:36:31 +01:00
fba35a02c6 Fix padding issue in DNA
Was introduced in the previous change in the image.
2021-01-25 11:35:29 +01:00
William Reynish
5f2c5e5bb8 UI: object context menu tweaks for consistency
Currently, the object context menu includes some inconsistencies
between object types. This is a small patch that fixes these.

- Adds the same ability to Join and Set Origin
  to all supported object types.
- Adds Set Active Camera for cameras.
- Adds Adjust Stroke Width for GP Objects.
- Adds Trace Image to Grease Pencil for Image Empties.

Reviewed By: #grease_pencil

Ref D10144
2021-01-25 21:28:39 +11:00
ebaa3fcedd Fix T84398: Multiview images show only one view.
The `image_get_gpu_texture` didn't use the iuser->view_index but
recalculated the requested view again. This lead to inconsistent
behavior when switching between multi view textures or stereo textures.

This has been fixed by ensuring that the `iuser->view_index` is always
used.

An Image has only place to store 2 view textures. This is done for
right/left eye compositing. A multi view texture can have more views.
This would lead to reading and writing to unallocated space.

When a multiview texture is requested that is larger than 1. It will
always be cached as being the first eye. The `gpu_view` of the Image is
also used as a cache key to check this.
2021-01-25 11:27:55 +01:00
7cb65a1e67 Fix T84990: Proportional Editing falloff drawing for masks in MCE is broken
This got broken in 4b1112c8c9. A fix which will be consistent with image
editor is not obviously clear, so for the time being revert the change and
go back to state which was working for a long time.
2021-01-25 11:10:42 +01:00
be8b60aa20 Merge branch 'blender-v2.92-release' 2021-01-25 11:07:08 +01:00
02404ded80 Fix UI message typo in own previous commit.
//sigh//
2021-01-25 11:06:21 +01:00
a0b85800ec Merge branch 'blender-v2.92-release' 2021-01-25 10:56:55 +01:00
3df2bea88b Fix UI messages.
Avoid sticking words together when it's not absolutely necessary.
2021-01-25 10:56:36 +01:00
4d94e2afc8 Merge branch 'blender-v2.92-release' 2021-01-25 20:37:50 +11:00
2188047d9d Merge branch 'blender-v2.92-release' 2021-01-25 20:37:46 +11:00
52022cba78 UI: increase the context menu's light power
This roughly matches the behavior when
editing this value via the buttons.

Part of D10144
2021-01-25 20:35:56 +11:00
William Reynish
5f55022276 UI: tweak object context menu labels
A number of naming changes for consistency and clarity

- Use 'Adjust...' for all entries that adjust properties
  rather than being normal operators.
- Follow naming conventions (ie Draw -> Display etc).
- Less naming ambiguity and more correctness and consistency.

Part of D10144
2021-01-25 20:12:39 +11:00
292685ea39 Fix T84878: Eevee cryptomatte broken with stereoscopy
During multiview rendering the `cryptomatte_accum_buffer` is not cleared
between the views and leaves artifacts on the next view to be rendered.
This change clears the accum buffer when it already exists and will be
reused for the next view.
2021-01-25 09:40:03 +01:00
0cb264a282 Cleanup: pass 'rctf' rectangle to 2D box drawing functions
Passing 4x arguments for the rectangle,
mixed in with round-box radius & color wasn't very readable.

Instead, pass a `rctf` as the first argument to UI box drawing functions.
2021-01-25 18:34:29 +11:00
17ac860cef Cleanup: remove redundant len() calls 2021-01-25 18:09:15 +11:00
32fd000b4b UI: Round-box drawing cleanup
The new GPU_SHADER_2D_WIDGET_BASE shader allows us to draw
many complex shapes with anti-aliasing.
One thing it can do is draw an opaque rounded rectangle with colors
that differ between its interior and outline.

In order to do the above in a single pass I recently added an "_ex"
version of UI_draw_roundbox that exposes most of that shaders features.

This simplifies interface_draw.c by removing redundancy in the calling
of this shader by using this new uber "_ex" version.

Ref D10189
2021-01-25 18:06:39 +11:00
1ac3c861fd Cleanup: remove unused UI_draw_roundbox_shade_y function
Marked unused 2017 f69678482c)

Remove since this remains unused,
split from D10189 to allow reverting if we ever need it back.
2021-01-25 17:57:59 +11:00
William Reynish
5a1cef2e76 UI: move 'Trace Image to Grease Pencil' to 'Convert' sub-menu
This operator is very specific, and may not warrant being placed in
such a prominent place. Move it together with other convert operators.

Ref D10188
2021-01-25 17:49:02 +11:00
bf329d37da Merge branch 'blender-v2.92-release' 2021-01-25 17:43:00 +11:00
7a0281914e Fix T85010: Cycles viewport not showing certain material changes when using GPU compute
Modifications to triangle shader association were not considered when checking for updates and the associated device data array was not tagged as modified so it was not resent to the device(s).
2021-01-25 07:40:49 +01:00
7f9ed0178a Cleanup: compiler warning, clang-format, spelling 2021-01-25 17:40:40 +11:00
b90ccaa067 Merge branch 'blender-v2.92-release' 2021-01-25 06:01:14 +01:00
Olivier Jolly
5501a5de32 Fix T84705: Snapping strip handle offset animation
Only offset animation if whole strip is snapped.

Bug introduced in e36c05b3d1.

Reviewed By: ISS

Differential Revision: https://developer.blender.org/D10116
2021-01-25 05:51:36 +01:00
Peter Fog
d6bbcc4f66 VSE: Inherit blend mode with single input effects
It is very likely, that after applying effect like transform or speed on
strip with certain blending, user would want to change effect blending
to match original strip.

Feature suggested on RCS:
https://blender.community/c/rightclickselect/HVgbbc/

Reviewed By: ISS

Differential Revision: https://developer.blender.org/D10156
2021-01-25 05:42:10 +01:00
6d21703e89 Merge branch 'blender-v2.92-release' 2021-01-25 05:09:13 +01:00
e16c786022 Fix T83267: Crash prefetching scene strip in meta strip
Scene strips can't be prefetched and seq_prefetch_do_skip_frame()
should check if scene strip is in timeline. But it did not recurse into
meta strips, which resulted in crash.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9999
2021-01-25 05:03:15 +01:00
93c10797dc Fix T82698: Speed effect not working on generator strips
Generator strips with zero inputs have their length set to 1 pernamently.

In some cases it is useful to use speed effect on these strips because they
can be animated. This can be done by using their length as is on timeline as
content length.

This is very simplified and temporary solution, as cutting these strips won't
give expected results. Lot of code relies on length of these strips being fixed
to 1, resolving this properly should be done by T59540.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D10026
2021-01-25 04:55:10 +01:00
744fa41e7e Fix T83266: Proxy building with meta strips fails
Building proxy with meta strip selected resulted in attempt to render
meta strip itself and save result as image as is done when building
image proxies.

Remove meta strip from list of supported strips.

Multicam, Meta and scene strip are cleared from poll function in UI as well.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D10001
2021-01-25 04:42:46 +01:00
77b51d4e58 VSE: Remove skip_disk_cache argument
This argument was used to prevent infinite loop in lookups between disk
and RAM cache.

Code was refactored, so this can be handled internally in cache.

Reviewed By: sybren, sergey

Differential Revision: https://developer.blender.org/D9955
2021-01-25 04:28:13 +01:00
6623d572aa Cleanup: minor changes and comments to screen_bounds_get access 2021-01-25 13:49:32 +11:00
9708aa6341 Fix view-axis gizmo tool-tip placement
Bounding box calculation ignored the gizmo size preference.
2021-01-25 13:44:42 +11:00
c5e409b013 Merge branch 'blender-v2.92-release' 2021-01-25 13:38:02 +11:00
850115531d Merge branch 'blender-v2.92-release' 2021-01-25 13:37:54 +11:00
652dd4e27f Fix ruler end-caps not following interface scale 2021-01-25 13:34:15 +11:00
d1c6704413 UV: tweak island select behavior
Selecting inside an island no longer de-selects
when it's too far from an edge.

When edge select fails fall back to inside-face test.

This follows 908b383b7d
which made this change for face-select.

Apply to island selection since it doesn't make sense
for island select to behave differently.
2021-01-25 13:30:02 +11:00
cf6d17a6aa UI: Gizmo Tooltip Positioning
Position Gizmo tooltips below their bounds so they do not obscure the content.

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

Reviewed by Julian Eisel
2021-01-24 15:16:05 -08:00
2fec46c3e6 Asset Browser: Support dragging in object-data assets (meshes, curves, etc.)
The Asset Browser already displayed object-data assets, but you couldn't
actually drag & drop them. This is now supported.

The object-data drop poll needed access to the data-block. But with a small
tweak it doesn't need that and can just check the ID type (which is known for
asset dragging too).

Part of T82661.
2021-01-24 22:33:17 +01:00
c8d6e2dfa0 UI: Avoid showing drop hint on drag & drop if dropping won't succeed
If the poll check of the operator fails, the operator won't run. We can check
that in advance to hide the drop hint if dropping will fail anyway.
This improves feedback during dragging.
2021-01-24 21:29:14 +01:00
e90a2a3f01 Asset Browser: Avoid appending asset data-block when drop operator will fail
For assets, the copy callback of the drop-box would append the asset
data-block. Check if the operator's poll succeeds before calling the copy
callback.
Otherwise the data-block is "secretly" appended, which the user doesn't expect
and won't notice without checking the file data in the Outliner.

For masks I had to extend the poll function, it didn't check context
sufficiently.
2021-01-24 21:29:14 +01:00
f04206cbc7 Cleanup: Add/use helper to check if dragging a certain ID type or asset ID type
This check is a common pattern, avoid duplication by using a helper function.
2021-01-24 21:29:14 +01:00
e747c07156 GPencil: New option to trace current frame
Instead to trace the image of the sequence starting in first frame, now it uses the current frame by default.
2021-01-24 17:22:44 +01:00
b449da3a7d Asset Browser: Support dragging mask assets into compositors
The normal drag & drop support was already there, just needed minor tweaks to
respect asset importing. The dragged in mask will create a mask node for
compositor node editors.

Part of T82661.
2021-01-24 17:16:20 +01:00
db15df0baa Asset Browser: Support dragging image assets into node editors
The normal drag & drop support was already there, just needed minor tweaks to
respect asset importing. The dragged in image will create a image/texture node
for the internally known node-tree types (shader, texture and compositing
nodes).

Part of T82661.
2021-01-24 16:53:34 +01:00
aa065a2951 Merge branch 'blender-v2.92-release' 2021-01-24 18:43:58 +11:00
d3506c86da Fix UV editor vertex/face drawing ignoring UI scale 2021-01-24 18:38:05 +11:00
9ad181a5d0 Cleanup: email address formatting
Match git style email addresses, ignored by the spell checker.
2021-01-24 16:08:17 +11:00
9c088b1b97 Cleanup: spelling 2021-01-24 16:06:58 +11:00
2b0d08961a Cleanup: remove toolbar popup release hack
This isn't needed since key-map items can ignore repeat events.
2021-01-24 15:51:05 +11:00
de9977260c Merge branch 'blender-v2.92-release' 2021-01-24 15:25:57 +11:00
e9cd3d50a7 Fix T84988: Armature symmetries crashes with action constraint
Action constraint without an action pointer set was crashing.
2021-01-24 15:24:04 +11:00
9f3c5a061d Fix outliner and animation editors exiting multi-object edit-mode
When multiple objects were in edit-mode,
only the active object would exit edit-mode.
2021-01-24 15:24:04 +11:00
e77c65f73c Cleanup: group navigation gizmo size with generic gizmo size
Also use `char` for these gizmo size & flag.
2021-01-24 13:45:17 +11:00
bd4ed5ca9a Fix "use after scope" reported by ASAN
The float array is declared inside a smaller scope, pointed to, and then
used later. This simply moves the declaration outside of the if statement.
Also remove two redundant lines.
2021-01-23 18:38:51 -06:00
ded9484925 UI: Viewport Navigate Gizmo Refactor
Simplification and changes to the Navigation gizmo. Better indication of negative axes, consistent use of color and size to indicate orientation, ability to be resized.

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

Reviewed by Campbell Barton
2021-01-23 13:10:07 -08:00
aaa1d58054 Merge branch 'blender-v2.92-release' 2021-01-22 19:30:23 +01:00
90bcd5e724 Cleanup: remove unused render camera code 2021-01-22 19:30:17 +01:00
a1f44e43a2 Fix T84745: more build errors with TBB 2021
* tbb::blocked_range moved to a different namespace and since the fix is
  non-trivial, remove some unused code that used this.
* Task group priorities are no longer supported. It's unclear if they are
  useful at all right now and even set correctly, for now all tasks are equal
  priority with TBB 2021.
2021-01-22 19:24:13 +01:00
5d6e5a9076 Fix vertex color baking using wrong color space
Now light baking should match the render.
2021-01-22 19:24:13 +01:00
e91b59b589 Merge branch 'blender-v2.92-release' 2021-01-22 11:28:59 -06:00
e845467d93 Fix: Mouse presses in some areas do not set active modifier
There are a couple of operations that are meant to set the active
modifier that currently don't. The first is a mouse press on the drag
icon on the right of the header, and the second is mouse presses on
modifier sub-panels headers.

This was an oversight in the implementation, especially the second,
because the blank space on the right of a sub-panel header often looks
just like the blank space elsewhere on the modifier's panel that
*does* set the active modifier.

Note that this purposefully doesn't include collapsing and expanding
the modifier as operations that set the active, since regardless of
whether that makes sense, it wasn't in the agreed upon design, which
would ideally not need changing for 2.92.

Differential Revision: https://developer.blender.org/D10155
2021-01-22 11:08:58 -06:00
735093dee8 Fix crashes from recent refactor rB131a758b6f88.
Much better to add a relation entry for all IDs, even if they are not
connected to any other ID.
2021-01-22 17:37:09 +01:00
3469e06c1a Fix memory leak when opening file browser
The name string of each file was duplicated but not freed. The new flag to
ensure the file-list frees the name wasn't set. Mistake in ca475479eb.
2021-01-22 16:58:23 +01:00
bbe6d44928 Cycles: optimize device updates
This optimizes device updates (during user edits or frame changes in
the viewport) by avoiding unnecessary computations. To achieve this,
we use a combination of the sockets' update flags as well as some new
flags passed to the various managers when tagging for an update to tell
exactly what the tagging is for (e.g. shader was modified, object was
removed, etc.).

Besides avoiding recomputations, we also avoid resending to the devices
unmodified data arrays, thus reducing bandwidth usage. For OptiX and
Embree, BVH packing was also multithreaded.

The performance improvements may vary depending on the used device (CPU
or GPU), and the content of the scene. Simple scenes (e.g. with no adaptive
subdivision or volumes) rendered using OptiX will benefit from this work
the most.

On average, for a variety of animated scenes, this gives a 3x speedup.

Reviewed By: #cycles, brecht

Maniphest Tasks: T79174

Differential Revision: https://developer.blender.org/D9555
2021-01-22 16:08:25 +01:00
131a758b6f Refactor BMain relations temp data.
`bmain.relations` is used to store temp data of relations between IDs,
to speed-up some complex processes heavily relying on such information.

Previous implementation was failry unclear/confusing, and required a
not-so-nice hack to 'tag' some ID as processed.

New code changes as such:
* Using `from`/`to` naming (instead of `user`/`used`).
* More clear separation between `to` `id_pointer` and `from` one,
  using an union instead of hacking around difference between `ID *` and
  `ID **` pointers.
* Adds storage of `session_uuid` informations (mainly useful as
  debug/ensuring proper consistency of data currently).
* Adds a structure per ID in the mapping. This enables possibility of
  storing tags (and potentially more  data in the future) per-ID,
  without polluting the IDs themselves with very short-life info.

Differential Revision: https://developer.blender.org/D10164
2021-01-22 16:05:17 +01:00
be7106a974 LibOverride: Add an 'post apply' callback to IDTypeInfo.
Currently this is needed to properly tag PointCache's for info update
(fixes an issue reported in T82503).

Suspect we may need this in more cases in the future though, RNA
assign/update processes are not always 100% enough to deal with
complicated corner cases.
2021-01-22 15:31:15 +01:00
7e32bb8492 Merge branch 'blender-v2.92-release' 2021-01-22 14:32:01 +01:00
226eb5e366 Cycles: Fix usage of double floating precision in CNanoVDB
Double floating point precision is an extension of OpenCL, which might
not be implemented by certain drivers, such as Intel Xe graphics.

Cycles does not use double floating point precision, and there is no
need on keeping doubles unless there is an explicit decision to use
them.

This is a simple fix from Cycles side to replace double floating point
type with a type of same size and alignment rules. Inspired by Brecht
and Patrick.

Tested on NVidia Titan V, Radeon RX Vega M, and TGL laptop.

Differential Revision: https://developer.blender.org/D10143
2021-01-22 14:31:06 +01:00
18e063b69d Functions: use better conversion from float2 to float3
Previously float2 was converted to float3 by implicitly converting to a
float pointer first, which was then passed to the float3 constructor.
This leads to uninitialized memory in the z component of the new float3.

Ideally this should be solved in float2/float3 itself, but my first fix for
that resulted in a compile error: rB6ac0a3d83c8e5a39bd5356aa0d68e3166bd91e82

This is an alternative fix that can be used for now. Will have to look
into the conversion in more detail again.
2021-01-22 13:46:13 +01:00
7a07ca1f8c Merge branch 'blender-v2.92-release' 2021-01-22 13:41:35 +01:00
644976548d Revert "BLI: add conversion from float2 to float3"
This reverts commit 6ac0a3d83c.
2021-01-22 13:40:45 +01:00
9fbf3075ad Merge branch 'blender-v2.92-release' 2021-01-22 12:26:23 +01:00
2ba2d2bd9d Fix T76936: Mesh shape amended upon undoing in sculpt mode
Was happening when there are deform modifiers prior to the multires.

There are detail in the comment around sculpt_undo_refine_subdiv(),
but briefly: the subdiv was refined with wrong base mesh coordinates.

Differential Revision: https://developer.blender.org/D10158
2021-01-22 12:26:02 +01:00
7f96e6ed7e Merge branch 'blender-v2.92-release' 2021-01-22 12:17:44 +01:00
6ac0a3d83c BLI: add conversion from float2 to float3
Previously float2 was converted to float3 by implicitly converting to a
float pointer first, which was then passed to the float3 constructor.
This leads to uninitialized memory in the z component of the new float3.
2021-01-22 12:16:53 +01:00
ae4a430755 Merge branch 'blender-v2.92-release' 2021-01-22 11:54:43 +01:00
526373b897 Cleanup - Point Instance: Use own DNA struct
We will need to expand this node soon to add weight/count for different
elements inside the collection. For that it is better to have the node
to use its own DNA.
2021-01-22 11:47:47 +01:00
cd8893d446 Fix (unreported) LibOverride: hair cache settings not working.
Thanks to that same point cache being exposed in **four** different RNA
paths (twice in particle system, and twice in its embedded cloth
simulation settings).

Only way is to also make particle system overridable.
2021-01-22 11:39:56 +01:00
d179e1c6e4 Merge branch 'blender-v2.92-release' 2021-01-22 11:26:15 +01:00
0373d1b09f GPencil: Fix unreported Vertex Paint masking error
The masking was not working as expected and allowed to paint non selected strokes.
2021-01-22 11:25:32 +01:00
8eaea99d98 Merge branch 'blender-v2.92-release' 2021-01-22 20:00:14 +11:00
Stefan Werner
927d099ec0 Particles: Fixed thread work size calculation.
Dividing the workload by number of tasks in float is imprecise and
lead in some cases to particles not being calculated at all
(example: 20000 particles, 144 tasks).

Switching this calculation to integer makes sure we don't lose count.

Differential Revision: https://developer.blender.org/D10157
2021-01-22 09:30:35 +01:00
Stefan Werner
cdf564277c Particles: Fixed thread work size calculation.
Dividing the workload by number of tasks in float is imprecise and
lead in some cases to particles not being calculated at all
(example: 20000 particles, 144 tasks).

Switching this calculation to integer makes sure we don't lose count.

Differential Revision: https://developer.blender.org/D10157
2021-01-22 09:22:13 +01:00
3a9d43cf31 Fix outliner and animation editors exiting multi-object edit-mode
When multiple objects were in edit-mode,
only the active object would exit edit-mode.
2021-01-22 18:43:00 +11:00
2469ddc1a9 Cleanup: correct last spelling cleanup 2021-01-22 17:12:11 +11:00
c0bbb93b88 Cleanup: spelling, remove outdated/invalid comments 2021-01-22 16:54:35 +11:00
421c5127f4 Merge branch 'blender-v2.92-release' 2021-01-22 16:43:48 +11:00
295b21f56a Merge branch 'blender-v2.92-release' 2021-01-22 16:43:44 +11:00
ee5a4f41eb Fix the NLA setting the active object without exiting edit-mode
This is done by convention in the outliner and dope-sheet.

Missing edit-mode exit causes glitches with mixed object/edit-mode undo.
2021-01-22 16:08:12 +11:00
141f17eaf4 Fix dope-sheet exiting edit-mode when activating an object
Regression from d8992192e5
The original code relied on having a separate edit-object pointer
than the active object.
2021-01-22 16:00:31 +11:00
8d958fe685 Merge branch 'blender-v2.92-release' 2021-01-22 15:45:48 +11:00
1a30687c24 Fix undo crash on active object change without exiting edit-mode
While the previous fix for T84920 is correct, the crash could still be
triggered by changing the active object while in edit-mode.

Ensure stale data isn't used by tagging for depsgraph update when
edit-mode data is freed on undo.

While exiting edit-mode normally does this, it's possible to set the
active object to a non edit-mode mesh, skipping the mode-switch
operator and it's depsgraph tagging.
2021-01-22 15:43:25 +11:00
4f3fba2aa7 Merge branch 'blender-v2.92-release' 2021-01-22 12:42:20 +11:00
665eca85ba Merge branch 'blender-v2.92-release' 2021-01-22 12:42:15 +11:00
7b528b2a3a Fix T84920: Crash undoing object activation in the outliner
Regression from d8992192e5
The original code relied on having a separate edit-object pointer
than the active object.

Use a utility function to avoid code duplication as there are
other areas that have similar functionality.
2021-01-22 12:38:55 +11:00
99e5d5ba21 Fix marker camera switch + undo crashes in edit-mode
Selecting markers and cameras could crash when in edit-mode.

Only support this in object mode as mode-switching as part of
activating cameras doesn't seem like a priority.

This has the same root cause as T84920.
2021-01-22 12:38:55 +11:00
e391ad7bbc Merge branch 'blender-v2.92-release' 2021-01-21 23:24:19 +01:00
b9e07c1e0b Fix T84896: Boundary brush not affected by automasking
This uses the values form the stroke automasking cache to control the
falloff of all deformers in the boundary brush. Usually this is already
considered in the general brush falloff function for the rest of the
brushes, but this is one of the exceptions where the brush implements
its custom falloff.

Reviewed By: JacquesLucke

Maniphest Tasks: T84896

Differential Revision: https://developer.blender.org/D10161
2021-01-21 23:23:08 +01:00
96fa78f5b0 Fix editors showing old data-block name after renaming in Outliner
E.g. the graph editor channels list would still show the old name of a material
that was renamed in the Outliner. Same for the Asset Browser when showing
data-blocks in the "Current File" repository.

The Outliner didn't send the notifier for some data-block types that editors
listen to for data-block name changes.
2021-01-21 22:56:38 +01:00
ca475479eb Fix Asset Browser showing old name after renaming data-block
The "Current File" asset library didn't get refreshed after the data-block name
changed. But rather than entirely refreshing the file list, or doing possibly
problematic partial refreshes, reference the data-block name directly, so a
simple redraw gets the new name displayed.

Addresses T83751
2021-01-21 22:23:43 +01:00
41982af6a0 Merge branch 'blender-v2.92-release' 2021-01-21 21:59:56 +01:00
f24992d2ec GPencil: Deactivate interpolation of gpencil curves
To avoid unexpected behavior and desync issues with
stroke and curve data, the interpolation operators are deactivated
in curve edit mode.
2021-01-21 21:58:39 +01:00
b4b02eb4ff UI: Transform Arrow Cursor Refactor
Mouse cursors used during transforms made to work better with changes of user scale and line width.

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

Reviewed by Campbell Barton
2021-01-21 08:19:26 -08:00
ceb500df03 Geometry Nodes: fix losing data when attribute has incorrect type
Differential Revision: https://developer.blender.org/D10165
2021-01-21 17:02:07 +01:00
425e706921 Geometry Nodes: new Attribute Sample Texture node
This node allows sampling a texture for every vertex based on some
mapping attribute. Typical attribute names are the name of a uv map
(e.g. "UVMap") and "position". However, every attribute that can be
converted to a vector implicitly is supported.

It should be noted that as of right now, uv map attributes can only be
accessed after a Point Distribute node.

Ref T82584.

Differential Revision: https://developer.blender.org/D10121
2021-01-21 16:49:06 +01:00
a92ebab5da Windows: Add "--debug-cycles" argument to "blender_debug_gpu.bat" batch file
This extends the "blender_debug_gpu.bat" batch file to also be useful for triaging Cycles
problems. OptiX initialization errors or problem while iterating CUDA devices are only
logged when the `--debug-cycles` flag is specified, so adding that here.

Reviewed By: brecht, LazyDodo

Differential Revision: https://developer.blender.org/D10167
2021-01-21 16:47:16 +01:00
b32e8e5ba7 Gpencil: Fix missing change in previous commit
This was related to the changes for Layer and Frame duplication.
2021-01-21 16:04:12 +01:00
cfd54ad7d7 GPencil: New option to Duplicate Layers with Empty Keyframes
This option allows to duplicate the layer and keyframes but without copying the strokes. This is very handy for the cleanup and paint process.
2021-01-21 16:00:12 +01:00
9c4c3fbabc GPencil: Make Layer and Frame duplicate functions more flexible
Now it's possible to copy only part of the data. This will be used in future operators.
2021-01-21 15:57:10 +01:00
3fd92b5c22 Fix T83344: Cycles baking + progressive refine fails 2021-01-21 15:12:17 +01:00
f817a11dc6 Cleanup: variable rename.
Avoid using two or three chars names when it's not absolutely obvious
what they mean.
2021-01-21 14:59:25 +01:00
1135790ad5 Asset Browser: Enable by default in alpha builds
The Asset Browser is still considered an experimental feature right now. But it
can be enabled by default for alpha builds, to get further testing and
feedback. It will hopefully be a non-experimental feature by the end of bcon1.
This is done in agreement with Dalai.
2021-01-21 14:40:13 +01:00
84702bd3d8 Fix T84242: freestyle animated camera shift lags behind in animation render 2021-01-21 14:21:49 +01:00
f4d07196bd Merge branch 'blender-v2.92-release' 2021-01-21 13:20:58 +01:00
aff7d59986 Fix T84908: Cycles GPU + CPU and denoising failure after recent fix 2021-01-21 13:20:05 +01:00
324d6d2192 Tracking: Cleanup, yet another spelling in the same line
Spotted by Jacques, thanks!
2021-01-21 12:53:14 +01:00
649c87814d Merge branch 'blender-v2.92-release' 2021-01-21 12:42:21 +01:00
9237b2019c Fix T84867: Transform node applies transforms in the wrong order 2021-01-21 12:39:30 +01:00
35f379ba26 Tracking: Actual spelling cleanup in the comment
The previous spelling cleanup did not catch this, so didn't the
review of the coming proportional editing code change.
2021-01-21 12:34:37 +01:00
793547e7d1 Geometry Nodes: initial support for volumes
For the most part, this just adds boilerplate code for volume support in geometry nodes:
* Add `VolumeComponent` next to `MeshComponent`, etc.
* Support `VolumeComponent` in depsgraph object iterator.

Furthermore, I added initial volume support in a few nodes:
* The Object Info node outputs an object instance when the input is a volume object
  (that will be the same for mesh objects soonish, to avoid copies).
* Support transforming a `VolumeComponent` in the Transform node.
* Support the `VolumeComponent` in Join Geometry nodes, but only when just one of the
  inputs has a volume component for now.

Right now, there is no way to create a `VolumeComponent`, because the Object Info node
outputs an object instance. The `VolumeComponent` will be necessary for upcoming nodes,
which will generate volumes on the fly.

Viewport selection does not work correctly with `VolumeComponent`s currently. I don't
know why that is. That can be figured out a bit later, once we can actually create
new volumes in geometry nodes.

Ref T84604.

Differential Revision: https://developer.blender.org/D10147
2021-01-21 10:32:42 +01:00
985bc08688 Merge branch 'blender-v2.92-release' 2021-01-21 16:37:52 +11:00
eb45e7be47 UI: particle tool properties layout tweaks
Adopt some of the newer layout abilities to
clean up the Particle Tool Properties a bit.

- Use in-line check-boxes next to values.
- Use text heading for Preserve toggles and mirror/topology mirror.

Reads clearer. Uses less space. Is more consistent.

Reviewed By: #user_interface, pablovazquez, Blendify, campbellbarton

Ref D10130
2021-01-21 16:08:43 +11:00
William Reynish
cd4e27a4a1 Industry Compat Keymap: Fix box/lasso selection for GP edit mode
There was a bug which which prevented box and lasso select to work
correctly in GP Edit Mode. It would select a nearby vertex before the
box selection.

This patch fixes it so it works with a click event,
like the default keymap, which fixes box and lasso selection.

Ref D10119
2021-01-21 15:11:33 +11:00
011a79215d Merge branch 'blender-v2.92-release' 2021-01-21 15:00:58 +11:00
d7cfee0b68 Fix use of uninitialized variable in image sequence detection
Uninitialized stack memory was being re-used in a loop.

Error in original commit from 04f81c8225

This happened to work as the same memory location was re-used
between iterations and not overwritten.
2021-01-21 14:59:40 +11:00
b243fab16b Merge branch 'blender-v2.92-release' 2021-01-21 14:05:59 +11:00
eaf5ee8981 Cleanup: NULL used for boolean 2021-01-21 14:05:16 +11:00
41a945d746 Docs: add note on convention for setting line-width 2021-01-21 11:12:11 +11:00
7b45850eac Cleanup: spelling 2021-01-21 10:59:50 +11:00
b303769d2e Merge branch 'blender-v2.92-release' 2021-01-20 20:01:40 +01:00
c60c30205d Fix T82966, T78152: Cycles GPU render hair ribbon artifacts and differences
Now it should match CPU rendering much more closely.
2021-01-20 19:59:43 +01:00
c07c110467 Merge branch 'blender-v2.92-release' 2021-01-20 18:18:38 +01:00
b33d839162 Fix T84867: Transform node does not rotate/scale instances
The manipulation of rot/scale was simply not implemented.
2021-01-20 18:17:25 +01:00
a823e825c8 Fix T84569: crash when trying to bake an object with no faces
Differential Revision: https://developer.blender.org/D10125
2021-01-20 18:07:51 +01:00
0d599ce95a GPencil: Fix unreported NaN value for UV Rotation in Primitives
Using primitive drawings, the point UV rotation was not initialized.
2021-01-20 16:53:42 +01:00
e12eb89f22 Fix T81429: move tool's axis constraints not drawn completely when using local orientation
In fact, the drawing was that of the local contraint axis (which is
summarized so as not to fill the screen with too much information).

Use the local contraint axis only when more than one object is selected.
2021-01-20 12:35:38 -03:00
736b0d6894 Revert "Transform: Use orientation of active object with Auto Constraint"
This reverts commit 54f248fa87.

And fixes T84259.

Apparently the ideal behavior was the previous one.
2021-01-20 12:28:00 -03:00
1f691050e5 Fix T84539: cryptomatte metadata lost when using save buffers option 2021-01-20 14:59:23 +01:00
10d2cbfa36 Fix T84872: OptiX GPU + CPU rendering uses branched path samples
Branched path tracing is not supported for OptiX, and it would still use the
number of AA samples from there when branched path was enabled by the user
earlier but auto disabled and hidden in the UI when using OptiX.

Ref D10159
2021-01-20 14:59:23 +01:00
1451f7d093 Fix T84813: enabling Cycles OpenImageDenoise during GPU viewport render fails 2021-01-20 14:59:23 +01:00
fc5f9a8ac9 Merge branch 'blender-v2.92-release' 2021-01-20 14:40:46 +01:00
4a09907eab Fix T84049: Crash when using Cycles Progressive Refine with OptiX+CPU
Tile stealing may steal a CPU tile buffer and move it to the GPU, but next time around that
tile may be re-used on the CPU again (in progressive refinement mode). The buffer would
still be on the GPU then though, so is inaccessible to the CPU. As a result Blender crashed
when the CPU tried to write results to that tile buffer.
This fixes that by ensuring a stolen tile buffer is moved back to the device it is used on before
rendering.
2021-01-20 14:40:27 +01:00
6a8f4bfc60 Tracking: Fix missing average of track offset 2021-01-20 14:07:48 +01:00
b01c865687 Merge branch 'blender-v2.92-release' 2021-01-20 13:48:44 +01:00
87db3423c9 Fix Lock to Selection does not work in mask mode
A regression since 2.80: need to use evaluated mask to calculate
its bounds. Non-evaluated mask does not contain state for the
current frame, so iterating over control points of the original
mask gives points state from the time they were edited last (aka,
not affected by the animation).
2021-01-20 13:46:39 +01:00
Yevgeny Makarov
a73dfac519 Fix T73575: Zooming out a lot faster than zooming in
- Zooming out a lot faster than zooming in,
  it had the wrong aspect ratio, make all the preparations
  with the factors instead of deltas.
- Improved following the `zoom_invert`
  (should not apply to `MOUSEZOOM`) and "trackpad natural scroll"
  preferences.
- `zoomfac` adjustment, same as in `view_zoomdrag_modal`.

Ref D8686
2021-01-20 22:56:35 +11:00
Yevgeny Makarov
9425628c84 Fix T65837: Zoom Axis is not working in the Node Editor
It was already fixed for the mouse in
bcda8cc89b, T65837
now the same logic is applied for the track-pad.

Ref D8685
2021-01-20 22:56:35 +11:00
f2988543c2 Merge branch 'blender-v2.92-release' 2021-01-20 22:10:15 +11:00
8e5b6320a6 Add Object Tool: minor improvements to tool-tips 2021-01-20 21:47:52 +11:00
William Reynish
685419d6be UI: Object "Make Links" sub-menu overhaul
- Rename to "Link/Transfer Data".
- Move Mesh Data Transfer operators here from the Relations sub-menu.
- Clarify which operations links to, copies or transfers/projects
  data using Link, Copy and Transfer leading text.
- Re-order contents to fit each category and add separators.
- Add enum tool-tips.

Reviewed By: Blendify, campbellbarton pablovazquez, mont29

Ref D10090
2021-01-20 20:51:44 +11:00
91bf24dd00 Cleanup: clang-format 2021-01-20 20:43:58 +11:00
f0ab9034d9 Merge branch 'blender-v2.92-release' 2021-01-20 20:42:54 +11:00
aee7d8f411 Cleanup: clang-format 2021-01-20 20:42:15 +11:00
e69034e6d9 Merge branch 'blender-v2.92-release' 2021-01-20 10:16:30 +01:00
c082b21625 Fix typo in UI message.
Noted by Satoshi Yamasaki (@yamyam) in rBTS5522.
2021-01-20 10:15:59 +01:00
160d8c1ea6 Merge branch 'blender-v2.92-release' 2021-01-20 18:56:29 +11:00
fad8a753a9 Add Object Tool: adjust cursor alpha when near view aligned
The cursor-plane was too dense/bright when approaching view alignment.
2021-01-20 18:55:44 +11:00
2c31a84bd1 Merge branch 'blender-v2.92-release' 2021-01-20 17:08:56 +11:00
1db904d954 Merge branch 'blender-v2.92-release' 2021-01-20 17:08:53 +11:00
74c6c504b2 Merge branch 'blender-v2.92-release' 2021-01-20 17:08:49 +11:00
908b383b7d UV: tweak face select behavior
When the mouse cursor is inside the UV face,
extend the selection threshold.

This means when zoomed in, a face can always be selected when the cursor
is inside it.
In the case of multiple overlapping faces - the face with the closest
center is used.

----

Prior to 246efd7286, the UV selection
threshold was scaled by the zoom level, so selecting a face when zoomed
in close would often often select faces even when the on-screen center
was outside the intended threshold.

Having a zoom-independent threshold may require more precision than
users are used to.

This change addresses this.
2021-01-20 17:07:20 +11:00
9f337bef80 Cleanup: move UvNearestHit.ob assignment in find nearest functions
Splitting assignments between functions complicates refactoring.

Also rename 'hit_final' to 'hit', since there are no longer a local
'hit' variable defined in these functions.
2021-01-20 17:00:39 +11:00
8bd5d58860 BMesh: add function to check if a point is inside a faces UV's 2021-01-20 16:56:59 +11:00
255c850e0b Cleanup: spelling 2021-01-20 16:15:53 +11:00
b2a6e2abdb Cleanup: remove extra in trailing asterisk
Comment blocks not conforming to convention.
2021-01-20 16:14:00 +11:00
69d30c1543 Merge branch 'blender-v2.92-release' 2021-01-20 16:11:22 +11:00
41d1729148 Merge branch 'blender-v2.92-release' 2021-01-20 16:11:19 +11:00
6f47549fe5 Merge branch 'blender-v2.92-release' 2021-01-20 16:11:15 +11:00
c7f6309437 Merge branch 'blender-v2.92-release' 2021-01-20 16:11:12 +11:00
b2037464e4 CMake: add missing headers
Resolves 'cmake_consistency_check' reports.
2021-01-20 16:08:52 +11:00
be970c03c2 Cleanup: spelling & cleanup for cmake_consistency_check
Much more could be done here, some obvious corrections.
2021-01-20 16:04:03 +11:00
d3fe320b83 CMake: update checking utility to ignore nanovdb files 2021-01-20 16:03:57 +11:00
0706a756f9 Cleanup: remove unused file SEQ_util.h
Committed by accident when SEQ_utils.h was also created.
2021-01-20 16:01:40 +11:00
6290091bac Cleanup: Store runtime space node variables in a separate struct
This commit moves runtime-only variables from the `SpaceNode`
DNA struct to a private struct in `node_intern.h`. Before, it was hard
to tell which data needed to be saved in files, this should make it
more clear.

Node that the `edittree` field is basically a runtime variable, since
it's set from the `treepath` list on read, but moving it would require
some more invasive changes that I don't think are worth it right now.
Also, not all of the moved variables were explicitly cleared on read--
`aspect` is set at the start of a redraw, `cursor` is set in a region
callback, and `recalc` was used as an update flag.

Differential Revision: https://developer.blender.org/D10141
2021-01-19 16:43:08 -06:00
da6dea5701 Cleanup: Use const arguments, explicit type 2021-01-19 16:09:34 -06:00
694032c9d1 Merge branch 'blender-v2.92-release' 2021-01-19 19:02:57 +01:00
c2e6969c56 Refactor modifier copying code.
Things like pointers to particle systems, or softbody data being stored
outside of its modifier, make it impossible for internal modifier copy
data code to be self-contained currently. It requires extra processing.

In existing code this was handled in several different places, in
several ways, and alltogether fairly inconsistently. Some cases were
even not properly handled, causing e.g. crashes as in T82945.

This commit addresses those issues by:
 * Adding comments about the hackish/unsafe parts `psys` implies when
   copying some modifier data (since we need to ensure particle system
   copying and remapping of those pointers separately).
 * Adding as-best-as-possible handling of those cases to
   `BKE_object_copy_modifier` (note that it remains fragile, but is
   expected to behave 'good enough' in any practical usecase).
 * Remove special handling for specific editor code
   (`copy_or_reuse_particle_system`). This should never have been
   accepted in ED code area, and is now handled by
   `BKE_object_copy_modifier`.
 * Factorize copying of the whole modifier stack into new
   `BKE_object_modifier_stack_copy`, now used by both `object_copy_data`
   and `BKE_object_link_modifiers`.

Note that this implies that `BKE_object_copy_modifier` and
`BKE_object_copy_gpencil_modifier` are now to be used exclusively to
copy single modifiers. Full modifier stack copy should always use
`BKE_object_modifier_stack_copy` instead.

Fix T82945: Crash when dragging modifiers in Outliner.

Maniphest Tasks: T82945

Differential Revision: https://developer.blender.org/D10148
2021-01-19 18:58:35 +01:00
bc95c249a7 Refactor modifier copying code.
Things like pointers to particle systems, or softbody data being stored
outside of its modifier, make it impossible for internal modifier copy
data code to be self-contained currently. It requires extra processing.

In existing code this was handled in several different places, in
several ways, and alltogether fairly inconsistently. Some cases were
even not properly handled, causing e.g. crashes as in T82945.

This commit addresses those issues by:
 * Adding comments about the hackish/unsafe parts `psys` implies when
   copying some modifier data (since we need to ensure particle system
   copying and remapping of those pointers separately).
 * Adding as-best-as-possible handling of those cases to
   `BKE_object_copy_modifier` (note that it remains fragile, but is
   expected to behave 'good enough' in any practical usecase).
 * Remove special handling for specific editor code
   (`copy_or_reuse_particle_system`). This should never have been
   accepted in ED code area, and is now handled by
   `BKE_object_copy_modifier`.
 * Factorize copying of the whole modifier stack into new
   `BKE_object_modifier_stack_copy`, now used by both `object_copy_data`
   and `BKE_object_link_modifiers`.

Note that this implies that `BKE_object_copy_modifier` and
`BKE_object_copy_gpencil_modifier` are now to be used exclusively to
copy single modifiers. Full modifier stack copy should always use
`BKE_object_modifier_stack_copy` instead.

Fix T82945: Crash when dragging modifiers in Outliner.

Maniphest Tasks: T82945

Differential Revision: https://developer.blender.org/D10148
2021-01-19 18:50:32 +01:00
bcdba7c34d UI: Deselect other objects when dragging into 3D View
When dragging an object into the 3D View, e.g. from the Outliner or the Asset
Browser, other objects wouldn't get deselected. That differs from what other
drop operations do, which create a new object. They deselect other objects in a
lower-level function, which happens to not be called for just dropping objects.
So I guess this is an oversight.
Old behavior was also a bit annoying because users seem to expect this to
deselect.
2021-01-19 18:47:20 +01:00
02a63115d2 Merge branch 'blender-v2.92-release' 2021-01-19 18:40:40 +01:00
c371d699ca Fix T84784: Time Remapping not displaying in the timeline
Caused by rBbbb2e0614fc3.

Oversight to not take the remapped framelength into account.

Maniphest Tasks: T84784

Differential Revision: https://developer.blender.org/D10134
2021-01-19 18:31:21 +01:00
7d114e5d87 Merge branch 'blender-v2.92-release' 2021-01-19 18:28:45 +01:00
36f0a1ead7 Fix T84823: crash rendering with unconnected input socket in File Output node
Caused by rB957e292c5864.

Now just skip unconnected sockets.

Maniphest Tasks: T84823

Differential Revision: https://developer.blender.org/D10137
2021-01-19 18:23:53 +01:00
b39ee69789 Merge remote-tracking branch 'origin/blender-v2.92-release' 2021-01-19 18:23:08 +01:00
d311a76931 Fix merge from 2.92 (subversion bump 292.14) 2021-01-19 18:20:12 +01:00
c3207d88c2 Object Info: Fix tooltip for the transform space option
This was agreed outside the patch discussion. And it did not make into
the submitted code on 8b777ee6d6.
2021-01-19 18:13:50 +01:00
40e089716b Merge branch 'blender-v2.92-release' 2021-01-19 18:12:34 +01:00
05179a0ba4 Volumes: fix calling BKE_volume_load from multiple threads
`BKE_volume_is_loaded` uses `grids.filepath` to determine if the
grids are already loaded. The issue was that `grids.filepath` was
set before the grids were loaded, resulting in incorrect early
returns for other threads.

Differential Revision: https://developer.blender.org/D10150
2021-01-19 18:01:22 +01:00
8b777ee6d6 Geometry Nodes - Object Info: option to apply obj transform to the geometry
By design the modified object transformations should still work and
affect the geometry nodes results. The current behaviour, however, would
make the geometry from the object info to not be affected by the
modified object transformations. This patch changes that by default.

In a similar fashion the Location, Rotation and Scale sockets outputs
should be aware of whether the output should be in the global space or in the
space of the nodetree.

To solve this, the patch introduces a new transformation space "enum"
where users can pick "Original" or "Relative" space.

Original
--------
Output the geometry relative to the input object transform, and the
location, rotation and scale relative to the world origin.

Relative
--------
Bring the input object geometry, location, rotation and scale into the
modified object maintaining the relative position between the two objects in
the scene.

Relative space violates a bit the design of the nodetree. The geometry in this
case is transformed so that moving the modified object doesn't interfere with
the geometry. This is particularly useful for the boolean node for instance.

"Original" is the default space, but old files are set to "Relative" for
backwards compatibility.

Differential Revision: https://developer.blender.org/D10124
2021-01-19 17:30:44 +01:00
9a32c7130b Geometry Nodes: pass depsgraph to nodes during execution
The depsgraph will have to be accessed in an upcoming patch.
2021-01-19 16:58:05 +01:00
d60b128274 Merge branch 'blender-v2.92-release' 2021-01-19 12:32:07 +01:00
a9203e25a2 Fix T84642: Reassign effect-strip ignores animdata
When reassigning an effect strip to another sequence, any animation data
in the effect strip will not be offset like expected.

The fix calls `SEQ_offset_animdata` to offset the animation data after
the seqence has been moved.

Reviewed By: ISS

Maniphest Tasks: T84642

Differential Revision: https://developer.blender.org/D10096
2021-01-19 12:31:02 +01:00
089cd25982 Merge branch 'blender-v2.92-release' 2021-01-19 20:43:49 +11:00
a86bb2594f Fix T84698: error adding movie clip tracks
The movie clip's `region->v2d` was being resized by the view2d code,
causing mouse cursor to movie-clip coordinate mapping to fail.

This commit removes `UI_view2d_region_reinit`,
matching the behavior for the image editor's 2D view.

Reviewed By: sergey

Ref D10106
2021-01-19 20:39:31 +11:00
df2ed1550d Fix T74755: Cap of curve doesn't have smooth shading
Copy the smooth setting when filling in curve caps.

For drawing this doesn't change behavior as a single normal is used
for all faces.

The difference may be noticed when converting to a mesh or with
modifiers applied.
2021-01-19 17:24:25 +11:00
1cc54107a9 Merge branch 'blender-v2.92-release' 2021-01-19 17:14:47 +11:00
d26588268d Merge branch 'blender-v2.92-release' 2021-01-19 17:14:43 +11:00
418cd7c4ba Fix T84041: Bevel caps have invalid normals
Bevel caps always had incorrect normals, causing display glitches
in some cases.

It seems this never worked properly (at least 2.79 also had this bug).

Use the projection vector as the normal.
2021-01-19 17:12:01 +11:00
e25f7e33ff Fix T84568: UV loop selection marks edges sharp
Regression in 6a10e69d27
(added when testing).
2021-01-19 15:32:00 +11:00
94e9d3ca3e Merge branch 'blender-v2.92-release' 2021-01-19 13:36:53 +11:00
d31dd1da80 Fix T84824: Incorrect height using interactive add tool
When using the interactive add tool for primitives with a fixed
height and base aspect ratio, the height of the created primitive
would be incorrect (two times too small or two times too big).

When the base origin was centered, the `fixed_aspect_dimension`
was not changed even though the base length was doubled.
Additionally, when the height origin was centered but the height
aspect ratio was fixed, the height was doubled leading to an
incorrect size.

The fix doubles `fixed_aspect_dimension` when the base origin is
centered and correctly calculates the height of the primitive when
the aspect ratio is set to fixed.

Ref D10140
2021-01-19 13:20:02 +11:00
2fa7e81d9c Cleanup: use 'const' argument for parameter argument 2021-01-19 12:59:00 +11:00
d144337098 Merge branch 'blender-v2.92-release' 2021-01-19 12:45:11 +11:00
58e554a55c Fix T66681: Blender 2.7x keymap inconsistencies
Match Blender 2.7x keymap more closely.

- Image Editor: F3 for save image as.
- Node Editor: Ctrl-LMB to cut links.
- Cycle the falloff types instead of showing a pie-menu.
- Use regular menu instead of pie menu for snapping.
2021-01-19 12:20:48 +11:00
09c7c63890 UI Code Quality: Use "params" struct for area and region callbacks
These functions with many arguments can be unwieldy. Aside from the obvious issues
with rewriting the list of arguments and the opportunities for error and frustration
that presents, the long list of arguments make these systems hard to change. So when
an argument should be added, someone might skip that and add some hack instead.

So, as proposed in T73586#1037210, this patch instead uses a "params" struct for
each of these callbacks.

- Use param argument for `ARegionType.listener`
    - Remove unused window field in region listener
- Use param argument for `SpaceType.listener`
- Use params struct for `ARegionType.message_subscribe`

Differential Revision: https://developer.blender.org/D9750
2021-01-18 17:28:47 -06:00
4b4aec2884 Cleanup: Clang tidy else after return 2021-01-18 14:21:24 -06:00
bfa083f873 Cleanup: Clang tidy else after return 2021-01-18 12:48:51 -06:00
40d6ee5304 Merge branch 'blender-v2.92-release' 2021-01-18 20:08:41 +03:00
b5c3f26cba Armature: fix B-Bone deformation blending artifacts with Preserve Volume.
The double quaternion blending method in addition to the deformation
matrix of each bone requires their rest matrices. For ordinary bones
this literally should use the bone rest matrix without any ambiguity.

However, it was also using the bone rest matrix for all of its
B-Bone segments, which is incorrect and causes strange deformation
in some cases involving extreme non-uniform scale, especially
at boundaries between different B-Bones. There is also a similar
known issue that happens with scale at bending joints, and this
fix reduces the distortion when both bones are B-Bones.

This changes both the Armature modifier and the Armature constraint
to use the actual segment rest matrices. Unlike bones, these can have
scale even in rest pose, so normalization is required.

Differential Revision: https://developer.blender.org/D10003
2021-01-18 20:08:16 +03:00
f17b26bbed Tracking: Implement tracks average operator
Average selected tracks into the new one. This can be used to improve
stability of tracking on blurry or non-very-sharp feature shapes.

Averaging happens for all position, pattern corners and search area.
Disabled markers do not take effect on averaging. Keyframed flag is
copied from source.

Gaps in the source tracks will be linearly interpolated, to reduce
result track jump. Note that this only applies to gaps "inbetween".
This means that if an input track doesn't have markers in the
beginning/end of it, there is nothing to interpolate with and the
result track will jump.

Available from the Track panel, under the Merge category.

Differential Revision: https://developer.blender.org/D6323
2021-01-18 16:38:40 +01:00
0ac8fec3be Tracking: Add interpolated accessor for markers
Allows to get marker position interpolated through out a gap.

Currently unused, but is covered with test. Aimed to be used for
track average operator.
2021-01-18 16:38:40 +01:00
0ca0d3366d Tracking: Re-write marker request function
There are two main things.

First, remove the marker index caching. Thins makes it possible to
safely use function from a threaded environment.

Second, replace linear search with binary search, which speeds up
random lookup.

There is no measurable difference in the stabilization which had a
comment about caching nature of track lookup. The random lookup
complexity changed from O(N) to O(log N). In practice this also
unlikely to be measurable, but thread-safety worth it.
2021-01-18 16:38:40 +01:00
f508292277 Fix T84719: Doversion for curve edit settings
Make sure default values for curve edit mode are filled for older files.

Reviewed By: antoniov

Maniphest Tasks: T84719

Differential Revision: https://developer.blender.org/D10136
2021-01-18 16:29:09 +01:00
5e0ef4ef85 Fix T84719: Doversion for curve edit settings
Make sure default values for curve edit mode are filled for older files.

Reviewed By: antoniov

Maniphest Tasks: T84719

Differential Revision: https://developer.blender.org/D10136
2021-01-18 16:23:13 +01:00
0145c8d484 Merge branch 'blender-v2.92-release' 2021-01-18 15:47:33 +01:00
0d8948387e Cycles: Fix missing OpenCL extensions in certain cases
If extensions string is longer than 1024 then the old code would have
reported empty string instead of extensions.

Now the code does dynamic string allocation to store result of request,
similar to what is done in `OpenCLInfo::get_hardware_id`.

The code looks a bit ugly, but it didn't really change much with this
patch. In other words, the code can become more modern and clear, but
it is considered to be outside of the scope of this change.

Differential Revision: https://developer.blender.org/D10135
2021-01-18 15:47:00 +01:00
ce0f212498 Merge branch 'blender-v2.92-release' 2021-01-18 15:30:48 +01:00
4fde594fda Fix T84650: CPU render + OptiX denoiser leaves empty tiles unprocessed
The OptiX denoiser is part of the OptiX device, so to the tile manager looks like a GPU device. As a
result the tile stealing implementation erroneously stole CPU tiles and moved them to that OptiX
device, even though in this configuration the OptiX device was only set up for denoising and not
rendering. Launching the render kernel therefore caused a crash because of a missing AS etc.
This fixes that by ensuring tiles can only be stolen by devices that support render tiles.
2021-01-18 15:30:25 +01:00
023ebb890b Merge branch 'blender-v2.92-release' 2021-01-18 15:02:24 +01:00
1c2b203795 Fix T84600: prevent bone groups operators on proxies and library
overrides

Editing bone groups is not supported on proxies/overrides [changes a re
lost on file reload], need to do proper polling (and also prevent this
from rna) for:

- adding bone groups
- removing bone groups
- renaming bone groups
- setting bone groups colors

Previously, this was hinted at by setting the layout inactive, with
preoper polls, this is now not needed anymore.

note: Selection of bone groups actually makes sense here and is
supported, so this is not prevented in this patch, but UI wise this is
not nice in the override case, because one cannot set an active_index
(aka select) in the UI list.

Maniphest Tasks: T84600

Differential Revision: https://developer.blender.org/D10131
2021-01-18 15:00:37 +01:00
a1fb3dc7ae Fix T84808: Individual projection works even when snap options don't affect the transform mode
Individual projection is a different branch of snap and always projects
the transformed elements on the surface of objects.

Perhaps this option should be limited to the Move mode due to similarity.

But in order not to change the current behavior too much, this commit only
disables this option in modes not affected by snap.
2021-01-18 10:57:45 -03:00
3584f1d224 Merge branch 'blender-v2.92-release' 2021-01-18 14:07:11 +01:00
b4530deec4 Fix T84586: missing Outliner redraws for certain NLA operators
Outliner display under 'Animation' > 'NLA Tracks' was not updating in
the following cases:
- adding strips
- removing strips
- duplicating strips (possibly to different track)
- swapping strips
- reordering tracks
- changing strip order by translating
- translating strips between tracks
- renaming tracks

In the case of deleting strips/tracks, this was also resulting in a use-
after-free error in Outliner drawing code (this was reported specifically
in T84586).

Most of these operators already sent a ND_NLA|NA_EDITED notifier, but the
Outliner is not listening to these. Listening to NA_EDITED is also not
what we want since this also happens a lot in cases irrelevant to the
Outliner. Now be a bit more specific and send ND_NLA|NA_ADDED / ND_NLA|
NA_REMOVED or a new ND_NLA_ORDER (to distinguish from NA_EDITED
'only' - where a redraw is not neccessary) and listen to these from the
Outliner.

(note: places that were listening to ND_NLA|NA_EDITED before are also
listening to NA_ADDED or NA_REMOVED, so changing NA_EDITED should not be
a problem here)

(note 2: for cases like swapping tracks/strips order, NA_ADDED or
NA_REMOVED does not make sense, neither can we use NA_EDITED [since we
dont want to listen to this], so in this case an additional ND_NLA_ORDER
is now sent)

(note 3: in nla transform code, this is now always sent on confirm. There
are cases were the notifier would not be needed, but checking exactly all
cases were it actually would be needed seems overkill [history of D10073
has example code to check if strips moved between tracks])

Maniphest Tasks: T84586

Differential Revision: https://developer.blender.org/D10073
2021-01-18 13:58:31 +01:00
e061bbadec Merge branch 'blender-v2.92-release' 2021-01-18 13:55:11 +01:00
dfdf79fb03 Fix T84250: Eevee world/material parameter animation not updating the viewport
The WORLD_UPDATE operation (needed to free the gpu material) was already
defined in DepsgraphNodeBuilder::build_world, but corresponding relation
was only set up for changes in the nodetree, not for changes in the
world/material itself in DepsgraphRelationBuilder::build_world.
Direct changes to these surface properties in the UI were updating
properly through RNA property update callbacks, but these are not called
from the animation system.

So now add these relations in the depsgraph.

Not 100% sure this is the right place for this (since e.g. eevee engine
seems to handle e.g. animated light paramters just fine through
EEVEE_cache_populate / eevee_light_setup, but properly freeing gpu
materials wont happen for worlds in e.g eevee_id_world_update and also
not for materials)

Maniphest Tasks: T84250

Differential Revision: https://developer.blender.org/D9959
2021-01-18 13:51:28 +01:00
95af2e39f6 Merge branch 'blender-v2.92-release' 2021-01-18 12:18:31 +01:00
9f2271d354 Fix T84739: Crash with curve brush in sculpt mode.
No idea why we did not pass context to `ED_paintcurve_undo_push_end`, it
is easily availbale everywhere...
2021-01-18 12:15:46 +01:00
6251eb8bda Merge remote-tracking branch 'origin/blender-v2.92-release' 2021-01-18 12:02:55 +01:00
Karthik Rangasai Sivaraman
c85317e669 Fix T83657: Pose Mode: Clearing transform doesn't respect Mirror X
Extend the pose bone "clear loc/rot/scale" functions so that they
respect the "Mirror X" option.

Reviewed By: sybren

Maniphest Tasks: T83657

Differential Revision: https://developer.blender.org/D9938
2021-01-18 11:59:45 +01:00
Karthik Rangasai Sivaraman
f7a5695676 Fix T83657: Pose Mode: Clearing transform doesn't respect Mirror X
Extend the pose bone "clear loc/rot/scale" functions so that they
respect the "Mirror X" option.

Reviewed By: sybren

Maniphest Tasks: T83657

Differential Revision: https://developer.blender.org/D9938
2021-01-18 11:59:14 +01:00
4ef0654449 GPencil: Fix Autojoin error using layer transform
The target stroke bounding box was not checked properly and when using layer transform the error was noticeable, but really the error was before the layer transform commit.
2021-01-17 12:35:27 +01:00
502eadb2f7 Merge branch 'blender-v2.92-release' 2021-01-17 21:40:11 +11:00
ced673c833 Merge branch 'blender-v2.92-release' 2021-01-17 21:40:07 +11:00
9fb755fe4c Merge branch 'blender-v2.92-release' 2021-01-17 21:40:03 +11:00
2ee2f87f29 Add Object Tool: move extra settings popover last
This is intended to be used when settings don't fit in the top bar,
so it makes sense to keep them last.
2021-01-17 21:36:49 +11:00
06da6e2eaf Add Object Tool: scale the cursor plane based on the depth
Draw the cursor plane smaller then further away from the view.

This makes the plane being drawn onto easier to perceive.
2021-01-17 21:21:18 +11:00
5f9358a373 Add Object Tool: split aspect & origin options for base/height
In practice it's common these settings shouldn't be linked for drawing
the initial (base) plane, compared with the height.
2021-01-17 21:16:22 +11:00
14bb9f09ab Merge branch 'blender-v2.92-release' 2021-01-17 18:30:14 +11:00
54c28e5bfb Merge branch 'blender-v2.92-release' 2021-01-17 18:30:10 +11:00
ca476a638c RNA: report an error when the name property is set twice
This helps avoid copy-paste errors which have happened a few times,
no functional changes.
2021-01-17 18:24:34 +11:00
66a87fc9f4 Fix workspace tool name property
The fallback tool was used as the tool name.

Regression in a8ce9a143a
2021-01-17 18:24:34 +11:00
1e8ed36a90 Merge branch 'blender-v2.92-release' 2021-01-16 13:11:33 -06:00
Wannes Malfait
6fb7d0f559 Fix T84713: Geometry nodes reroute sockets have incorrect type
This implements the node tree update function, which is needed so that the
reroutes get updated to the correct type. It is based on the same code in
the shader and compositor node trees.

Differential Revision: https://developer.blender.org/D10123
2021-01-16 13:09:19 -06:00
4e8c78245d GPencil: Hide layer if the scale is zero
When scale a layer to zero must be hidden.
2021-01-16 19:36:00 +01:00
24cdffde55 GPencil: Cleanup - Rename ED_gpencil_stroke_color_use to ED_gpencil_stroke_material_editable 2021-01-16 16:44:49 +01:00
f5ec29023d GPencil: Fix initial value for fill factor after last changes
The value has changed due a previous commit and the minimum value cannot be 0.
2021-01-16 16:36:49 +01:00
e02d84eb3b GPencil: Add new parameteres to transform layers
When using grease pencil for drawing Storyboards, it's very common to require a transform of the layers. This transform can be done using the offset modifier, but in some cases, the scene requires a lot of modifiers and makes the file hard to work.

This new feature adds a transforms Location, Rotation and Scale at Layer level, and allows to transform the layer without using a modifier, keeping the scene more clean.

{F9480695}

This feature was suggested by @pepeland after receiving feedback from several artists.

Also, done some code cleanup and rename some functions to get a better naming.

Maniphest Tasks: T83660

Differential Revision: https://developer.blender.org/D9761
2021-01-16 15:46:45 +01:00
0a44c4b594 Merge branch 'blender-v2.92-release' 2021-01-16 15:26:43 +01:00
1e193a0b56 Fix T84757: feedback loop with when modifying vertex group with nodes
The issue was that the mesh shared its vertex weights with the
original mesh (to reduce memory consumption). The solution is
to make a local copy of the vertex weights in this case.
2021-01-16 15:24:22 +01:00
79dd9fedb2 Fix T84758: Revert "LibOverride: Also consider regular embedded IDs as virtual overrides."
This made Blender considers all materials to be overridden.

This reverts commit 2aa7bc06e7.
2021-01-16 10:28:47 +01:00
3cc1bcce4f Merge branch 'blender-v2.92-release' 2021-01-16 11:39:37 +11:00
7573631d69 Merge branch 'blender-v2.92-release' 2021-01-16 11:39:34 +11:00
d4ffccbeae Merge branch 'blender-v2.92-release' 2021-01-16 11:39:31 +11:00
3adb9530bb Merge branch 'blender-v2.92-release' 2021-01-16 11:39:29 +11:00
3856c58f5d Merge branch 'blender-v2.92-release' 2021-01-16 11:39:27 +11:00
6403c8c025 Merge branch 'blender-v2.92-release' 2021-01-16 11:39:23 +11:00
39b752316d Merge branch 'blender-v2.92-release' 2021-01-16 11:39:21 +11:00
66161ba3a1 Merge branch 'blender-v2.92-release' 2021-01-16 11:39:12 +11:00
f7829961c6 Add Object Tool: include shortcuts in the tool-tip 2021-01-16 11:37:52 +11:00
ecffd231a0 Add Object Tool: add initial "Fixed Aspect" option
This makes it more convent to add many objects with a fixed aspect ratio.
2021-01-16 11:37:52 +11:00
fef7b792e7 Add Object Tool: make UI more compact
Move some of the more obscure options into a popover,
so they don't take up so much room in the top-bar.
2021-01-16 11:37:52 +11:00
cdfa3feb91 Add Object Tool: support incremental snapping
This adds a "Snap to" option that allows using all the scenes snap
settings which includes incremental & absolute grid snapping options.

This is optional because always following scene snapping would not
snap to geometry by default (which seems to be the most useful default).
2021-01-16 11:36:55 +11:00
c4bbe44e47 Add Object Tool: workaround non-orthogonal orientation matrices 2021-01-16 11:32:00 +11:00
2f0d919f89 Add Object Tool: quiet warning setting size
The size property was only used for the cube
2021-01-16 11:32:00 +11:00
8fd3ffcb31 Add Object Tool: rename keymap, expose in keymap editor
Make the name follow the convention of other View3D keymaps.
2021-01-16 11:31:35 +11:00
27c142aa29 Add Object Tool: remove from experimental
Based on feedback from @dbystedt, include this in 2.92
with some updates (coming next).
2021-01-16 11:28:02 +11:00
a8436334bd Merge branch 'blender-v2.92-release' 2021-01-15 12:23:13 -08:00
957de39191 Fix T84645 cursor moves when clicking selector.
The absolute position desktop mapping has been corrected. The correct
mapping is 0-65535 inclusive. Additionally, division by the virtual
desktop width and height needed to be subtracted by 1 as width and
height are one more than the final pixel index.
2021-01-15 12:18:13 -08:00
Aaron Carlisle
f71a7d3914 Cleanup: Remove Unused tracking properties
These properties are unused and serve no purpose.

Reviewed By: sergey, #motion_tracking

Differential Revision: https://developer.blender.org/D9803
2021-01-15 14:58:24 -05:00
fa817b8c96 Merge remote-tracking branch 'origin/blender-v2.92-release' 2021-01-15 12:36:35 -07:00
de60dc84e2 Fix: Build error with MSVC 2017
BKE_cryptomatte_extract_layer_name was using std::isdigit
without including <cctype> somehow only MSVC 2017 had a
problem with that.
2021-01-15 12:36:03 -07:00
bf7fdd0f67 Cleanup: LibOverride: Update comment. 2021-01-15 19:36:38 +01:00
2aa7bc06e7 LibOverride: Also consider regular embedded IDs as virtual overrides.
Those (aka root node trees and master collections) share same 'traits'
as the shapekeys: RNA cannot assign them, so we need to handle them as
sub-data of their owner IDs.

Not sure how much this will help in improving support of overrides for
scenes and nodetrees, but this is a mandatory step towards that goal for
sure.
2021-01-15 19:27:49 +01:00
ce317c9faa LibOverride: fix/update/re-enable ID-related debug checks in diffing code.
We should now have the tools to ensure consistency of ID pointers
diffing in `rna_property_override_diff_propptr`.

As a reminder, for most ID pointers we just check the actual pointer value,
but this is not possible for embedded IDs like root node trees or master
collections, and for fake embedded ones like shapekeys, so those should be
handled as mere sub-data of their owner IDs in override context.
2021-01-15 19:18:26 +01:00
f1a577b38a Merge branch 'blender-v2.92-release' 2021-01-15 19:00:46 +01:00
dc69ef6f3b Fix T84373: Overrides : shapes keys driven by armature don't work on second instance.
Code generating override operations would not deal properly with Pointer
RNA properties, trying by default to use and check pointers' names
properties like it does with items of a collection.

However, using name property in pointer RNA property case makes no
sense, so specialize the `no_prop_name` flag for each case (pointer or
collection).

here, since second override would generate local data-blocks with
different names than the linked data ones, name matching would fail and
breck handling of override diffing in shapekeys.

Note that shape keys are the only one concerned by that problem, since
other embedded IDs (root node trees and master collections) are fully
real ones, so they always get the same names.
2021-01-15 19:00:38 +01:00
5cf04fe2ba Fix (unreported) copying liboverride of mesh breaks overrides of shape keys.
Our beloved shapekeys are 'virtual' overrides, they need special
snowflake treatment here as well.

They do not have any override data, from override perspective they are
considered as mere sub-data from their owning ID (mesh, lattice, etc.).
Therefore, we should not copy override data from them, but instead
properly flag those new IDs as `LIB_EMBEDDED_DATA_LIB_OVERRIDE`.

Found while investigating T84373.
2021-01-15 19:00:38 +01:00
319056679b Fix T84373: Overrides : shapes keys driven by armature don't work on second instance.
Code generating override operations would not deal properly with Pointer
RNA properties, trying by default to use and check pointers' names
properties like it does with items of a collection.

However, using name property in pointer RNA property case makes no
sense, so specialize the `no_prop_name` flag for each case (pointer or
collection).

here, since second override would generate local data-blocks with
different names than the linked data ones, name matching would fail and
breck handling of override diffing in shapekeys.

Note that shape keys are the only one concerned by that problem, since
other embedded IDs (root node trees and master collections) are fully
real ones, so they always get the same names.
2021-01-15 18:51:04 +01:00
69a7015e12 Fix (unreported) copying liboverride of mesh breaks overrides of shape keys.
Our beloved shapekeys are 'virtual' overrides, they need special
snowflake treatment here as well.

They do not have any override data, from override perspective they are
considered as mere sub-data from their owning ID (mesh, lattice, etc.).
Therefore, we should not copy override data from them, but instead
properly flag those new IDs as `LIB_EMBEDDED_DATA_LIB_OVERRIDE`.

Found while investigating T84373.
2021-01-15 18:50:50 +01:00
3459f75f5b Merge branch 'blender-v2.92-release' 2021-01-15 11:04:53 -06:00
0b0e45252b Geometry Nodes: Use a default value in the point scale node
This commit adds the ability to provide a default value to
`attribute_try_get_for_output` and uses it for the `Point Scale` node,
which is important because the node uses multiplication.

The idea is to keep "name-specific" functionality in nodes rather than in
the attribute API, otherwise the complexity will be hard to keep track of.
So this fix doesn't apply to the Attribute Vector Math node, but hopfully
that is okay since that's now a lower level node for this purpose anyway.

Differential Revision: https://developer.blender.org/D10115
2021-01-15 11:04:32 -06:00
237e27e161 Cleanup: Add const in various places in node code
Also includes some various other minor cleanups, like using bool
instead of int in a couple places.
2021-01-15 10:48:22 -06:00
20a54347ee Tracking: Fix transform cancel for plane tracks
Use exact marker accessor. Harmless due to the current way the
transform system is used by tracking. But for the future development
proper accessor needs to be used.
2021-01-15 17:42:13 +01:00
3732508c64 Fix T84745: build error with TBB 2021
task_group::is_canceling() was removed.
2021-01-15 17:29:36 +01:00
c4286ddb09 RNA: support range-based for loops in C++ api
Cycles has a lot of code like this:
```lang=c++
BL::Object::modifiers_iterator b_mod;
for (b_ob->modifiers.begin(b_mod); b_mod != b_ob->modifiers.end(); ++b_mod) {
```

Range-based for loops allow us to simplify this to:
```lang=c++
for (BL::Modifier &b_mod : b_ob->modifiers) {
```

In order to support this, a collection (such as `b_ob->modifiers`) must have
a `begin()` and `end()` method, that take no parameters and return an iterator.
The `end` method already exists, but the `begin` method takes the iterator as
argument currently.

This patch adds a new `begin` method that returns the iterator. The old `begin`
method is still available to avoid breaking existing code.

My assumption is that the old `begin` method took the iterator as parameter so
that the iterator is not copied or moved, i.e. its memory address is stable and
the destructor is only called once. I'm not sure if both of these requirements
are really necessary to ensure that the iterators work correctly. To be on the
safe side, I deleted the copy/move constructors/assignment operators.

Since C++17 there is "guaranteed copy elision" which basically allows us to
return a non-copyable and non-movable type from a function. To make that work,
I had to add a new constructor to `CollectionIterator` that calls `begin` on itself.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D10120
2021-01-15 16:35:22 +01:00
Piotr Barejko
340529a845 Fix Cycles build error with OSL 1.12
Differential Revision: https://developer.blender.org/D10118
2021-01-15 15:41:17 +01:00
df96a9c6ea Merge branch 'blender-v2.92-release' 2021-01-15 11:28:15 -03:00
c63442d2f2 Fix T84673: Skin resize operator always using object origin as pivot
The TransData converted to work in Skin Resize had no defined center.

Caused by rB54ee4109143b
2021-01-15 11:24:45 -03:00
cab6d5e94a Merge branch 'blender-v2.92-release' 2021-01-15 08:19:19 -06:00
6c840a2cb9 Fix "Make Instances Real" to work with nodes modifier instances
This commit changes the check at the beginning of the
"Make Instances Real" operator to account for the instances
created by nodes modifiers in the modifier stack.

Differential Revision: https://developer.blender.org/D10059
2021-01-15 08:18:52 -06:00
a51584dc70 Geometry Nodes: transfer corner and point attributes in Point Distribute node
If the mesh has any corner or point attributes (e.g. vertex weights or
uv maps), those attributes will now be available on the generated points
as well.

Other domains can be supported as well. I just did not implement those yet,
because we don't have a use case for them.

Differential Revision: https://developer.blender.org/D10114
2021-01-15 12:00:38 +01:00
04572f0899 Cleanup: spelling 2021-01-15 12:23:50 +11:00
dc59955481 Cleanup: use 'pragma once' 2021-01-15 12:17:11 +11:00
f03752b92f Nla: Rename NlaEvalChannel->valid to domain
For term consistency with usage.

The clarity is more for consistency with the nla domain() processing
function names and the core struct member name it stores the results
in, "valid". The name "domain", which implies a function can operate
on it, seems more natural than "valid", which implies something is
wrong if false.

No functional changes.

Reviewed by: sybren

Differential Revision: http://developer.blender.org/D9692
2021-01-14 19:27:46 -05:00
10ce2a1016 NLA: Redundant NlaEvalChannel Valid Mask Write
The field will already be properly written to in (anim_sys.c)
nla_eval_domain_action(). It's easier to understand the property's
usage after removing the redundancy.

No functional changes.

Reviewed by: ChrisLend, sybren

Differential Revision: http://developer.blender.org/D9689
2021-01-14 19:04:40 -05:00
32e4ded24b Nla Refactor: is_fcurve_evaluatable()
No functional changes.

Future patches {D8867} {D8296} make use of it.

Reviewed by: sybren, ChrisLend

Differential Revision: http://developer.blender.org/D9691
2021-01-14 18:47:12 -05:00
09709a7e64 Nla Refactor: Split animsys_evaluate_nla()
No intended functional changes.

Refactors animsys_evaluate_nla() into 2 versions:
animsys_evaluate_nla_for_keyframing(), animsys_evaluate_nla_for_flush()
to make it clear what data is being calculated and why.

Dummy strip creation has been refactored to two separate functions,
animsys_create_tweak_strip() and animsys_create_action_track_strip().
Both are evaluated differently from other strips and eachother. There's
no need to interweave them. A future patch D8296, generally requires
both strips.

___

XXX anim_sys.c) nlatrack_find_tweaked() is a temporary work around.
If anyone has any insight into this problem, help is appreciated.

Reviewed by: sybren

Differential Revision: http://developer.blender.org/D9696
2021-01-14 18:25:01 -05:00
b75552ebbb UI: Draw socket type colors on the left in group sockets list
Previously the colors were on the right for outputs, but this is now
unecessary because of the organization in separate panels after
rBb1d1a58c77fb1658.
2021-01-14 16:49:20 -06:00
40d391fa60 Fix T81533: NLA Properly Draw FModifiers
When NLA strips weren't time-aligned with the underlying action, then
fcurve modifiers would not be drawn anchored to the strip. Fmodifiers
were evaluating properly, they just weren't drawn with the proper
offset and scale.

To fix it in this specific case, I've chosen to undo the keyframe
remapping then remap the draw-evaluation-time from scene time to
fcurve time. Afterward, I redo the keyframe remapping so the controls
are properly drawn.

The Envelope fmodifier has special drawing code which was fixed too. In
this case, no mapping at all was happening. The solution was similar,
to remap the envelope control points from fcurve time to scene time.
2021-01-14 16:50:14 -05:00
Cody Winchester
7a4bdc3a4f Gpencil Noise - Add noise offset parameter
This patch adds a noise offset option to the grease pencil noise modifier.
It allows the user to animate the noise along the length of the stroke to create movement that is currently not possible.

It works by adding an offset to the noise table and adding the remaining floating point value to the noise table sampling.

Reviewed By: #grease_pencil

Differential Revision: https://developer.blender.org/D10021
2021-01-14 22:25:36 +01:00
Lukas Stockner
0f2ae614a1 Use mmap() IO for reading uncompressed .blends
Instead of submitting tons of tiny IO syscalls, we can speed things up
significantly by `mmap`ing the .blend file into virtual memory and directly
accessing it.

In my local testing, this speeds up loading the Dweebs file with all its
linked files from 19sec to 10sec (on Linux).

As far as I can see, this should be supported on Linux, OSX and BSD.
For Windows, a second code path uses `CreateFileMapping` and
`MapViewOfFile` to achieve the same result.

Reviewed By: mont29, brecht

Differential Revision: https://developer.blender.org/D8246
2021-01-14 22:03:29 +01:00
30dd31a7b3 Fix T81533: NLA Properly Draw FModifiers
When NLA strips weren't time-aligned with the underlying action, then
fcurve modifiers would not be drawn anchored to the strip. Fmodifiers
were evaluating properly, they just weren't drawn with the proper
offset and scale.

To fix it in this specific case, I've chosen to undo the keyframe
remapping then remap the draw-evaluation-time from scene time to
fcurve time. Afterward, I redo the keyframe remapping so the controls
are properly drawn.

The Envelope fmodifier has special drawing code which was fixed too. In
this case, no mapping at all was happening. The solution was similar,
to remap the envelope control points from fcurve time to scene time.
2021-01-14 15:13:26 -05:00
33a558bf21 Geometry Nodes: support accessing UV layers with attribute system
Note that uv layers still can't be accessed with nodes, because those
only access attributes on the point domain currently, while uv data
is stored per corner. Implicit domain conversion hasn't been
implemented yet.
2021-01-14 18:11:44 +01:00
5c1b740f1e Geometry Nodes: add implicit conversions for float2 and others
Some of these conversions are arbitrary to some degree.
However, the user experience is better when at least something
happens when converting between types, instead of just getting
zeros. I left out a few conversions that I wasn't sure about yet.

I also added conversions for float2.
2021-01-14 18:02:59 +01:00
0815e2fdb1 Fix automated tests when building with GCC and march=native
When building with more aggressive optimization flags, GCC will add FMA
(Fused Multiply Add) instructions that will slightly alter the floating
point operation results.

This causes some automated tests to fail in blender.

In clang and the intel compiler ffp-contract is set to off per default
it seems from my research.  (They do not have the exact same setting,
but the default seems to match the off behavior)

Reviewed By: Brecht

Differential Revision: http://developer.blender.org/D9047
2021-01-14 17:37:39 +01:00
406d747695 Fix automated tests when building with GCC and march=native
When building with more aggressive optimization flags, GCC will add FMA
(Fused Multiply Add) instructions that will slightly alter the floating
point operation results.

This causes some automated tests to fail in blender.

In clang and the intel compiler ffp-contract is set to off per default
it seems from my research.  (They do not have the exact same setting,
but the default seems to match the off behavior)

Reviewed By: Brecht

Differential Revision: http://developer.blender.org/D9047
2021-01-14 17:32:21 +01:00
9131c697dd Merge branch 'blender-v2.92-release' 2021-01-14 15:55:51 +01:00
e5ee7e9a2d Geometry Nodes: don't delete existing attribute before new attribute is computed
This fixes the behavior of some nodes when the same attribute
name is used for input and output. If both attributes have a
different type, they can't exist at the same time. Therefore,
the input attribute has to be removed in order to create the
output attribute.

Previously, the input attribute was remove before it was used
in any computations. Now, the output is written to a temporary
buffer and only later saved in the geometry component. This
allows both attributes to coexist within the node.

The temporary attribute is only create when necessary. The
normal case without name collisions still works the same
as before.

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

Ref T83793.
2021-01-14 15:52:08 +01:00
8795514384 Merge branch 'blender-v2.92-release' 2021-01-14 15:19:24 +01:00
8ed7ed0255 Geometry Nodes: extract function for adding attributes in distribute node
This shouldn't have any functional changes.
2021-01-14 15:16:20 +01:00
53bd58993e Fix T84167: Saving half-float EXR might result in NaN pixels
Clamp value to the -HALF_MAX .. HALF_MAX.

The non-clamped values were causing NaN and inf values saved to
the file, which was the root cause of glare node giving unexpected
result.

The nan/inf on overflow is something mentioned in the half data
type in OpenEXR header.

Differential Revision: https://developer.blender.org/D10105
2021-01-14 14:54:08 +01:00
3cc7e2ad9d Fix various issues with regions in Asset Browser
Fixes a number of glitches, e.g. the sidebar disappearing when selecting an
asset or wrong AZones (the little chevrons to indicate a hidden region).

There were a couple of issues:
* Execution region was created, but not used.
* If an execution region already existed when refreshing the area, it was
  tagged as hidden, not removed.
* The sidebar was always set to be hidden on refreshes.
* When toggling from Asset Browser to File Browser as regular editor (i.e. not
  opened temporary via Ctrl+O or such), the sidebar region wasn't removed.

Adresses T83644.
2021-01-14 13:45:22 +01:00
Sebastian Parborg
74f6b81c12 Tests: skip OSL render tests in build without OSL
Differential Revision: https://developer.blender.org/D9990
2021-01-14 13:14:43 +01:00
4e90266fd8 Tests: enable bake and shader raytracing tests for OptiX
These are now supported and so can be tested.

Also refactor the code a bit to move Cycles specific blacklist out of generic
render test code.
2021-01-14 13:14:43 +01:00
6704372f04 GPencil: Allow small resolution for Fill tool
Now the resolution can be reduced to get less details. This is very useful for doing storyboards to get a quick fill of any character.

Following UI review, the name "Resolution" has been changed to "Precision" because is more clear.

Differential Revision: https://developer.blender.org/D10076
2021-01-14 12:57:17 +01:00
10423d462a Geometry Nodes: output color from Attribute Color Ramp node
The other output types did not work currently anyway.
There is not a significant benefit in somehow deducing the output
attribute type from the existing attribute types.
2021-01-14 12:44:37 +01:00
6f28c199b3 Cleanup: ed_undo: naming of parameters, const, etc.
No behavrioral change expected here.
2021-01-14 12:02:51 +01:00
a0029a678f Cleanup/refactor: Remove logically broken code from GPencil undo.
`ED_undo_gpencil_step` only support valid undo step direction, passing
step name here is useless and only add confusion to what works or not.

Undo by step name or step index is fully not supported by GPencil undo
mode currently.

Note that since GPencil undo mode does not seem to ever be used anyway,
this is not an urgent issue in practice, but this needs to be cleaned up
at some point. See also T84703.
2021-01-14 12:02:51 +01:00
8cdd701b45 Merge remote-tracking branch 'origin/blender-v2.92-release' 2021-01-14 11:42:22 +01:00
442b6e5e09 MeshCache: add error handling to fread() calls
Handle return value of `fread()`, by showing an error message when the
file cannot be read from and stopping further processing. Not only is
error handing a good idea, it also prevents GCC from warning that the
return value of `fread()` should not be ignored.

This is similar to {D9916}.

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D10079
2021-01-14 11:38:14 +01:00
9e038a2c6b Tracking: Make transform cancel use explicit frame number
Before transform cancel will request marker at a current frame number
and restore transform flags to it. This worked fine if there was only
one marker from track in the transform data. This did not work correct
when multiple markers from track were added to transform data.

This allows to implement proportional editing in the clip editor.
2021-01-14 11:37:36 +01:00
4b1112c8c9 Tracking: Fix wrong projection for post-draw pass
Allows to draw proportional editing circle at a proper location.
2021-01-14 11:37:36 +01:00
5cf87b4a8e Tracking: Re-duplicate logic used to count and initialize data
Allows to easily implement more comprehensive checks about which
markers get added to the transformation context.

No user measurable changes are expected, purely house-keeping to
ease an upcoming development.
2021-01-14 11:37:36 +01:00
ab536824a6 Tracking: Simplify transform code
Reduce amount of duplicated pointer offset logic: advance transform
data pointers deep in the loop rather than have offset duplicated in
the outer loop.

Array size calculation still has duplicated, but that is another story.
2021-01-14 11:37:36 +01:00
4b0871af87 Bmesh: Deprecate deform parameter of from_object()
The deform parameter of the Bmesh from_object method is deprecated,
always assumed to be True, and will be removed in version 3.0.

That is because the cases where it is False don't work correctly and are
subject to memory leaks. One of the symptoms of the incorrect behavior
is the application of constructive modifiers twice if the input object
is an evaluated one, as demonstrated in D10053.

Reviewed By: Brecht

Differential Revision: https://developer.blender.org/D10086
2021-01-14 12:20:46 +02:00
Cody Winchester
3191b76eb5 GPencil: Noise Modifier - Move noise seed value outside of randomize subpanel
Currently the grease pencil noise modifier seed value is under the randomize subpanel.

Moved the seed value outside of this panel because it doesn't only change the noise when using the randomize option. Moving the seed value prevents it from being hidden/greyed out so the user can manually keyframe it to control the noise animation.

Reviewed By: #grease_pencil, antoniov

Differential Revision: https://developer.blender.org/D10020
2021-01-14 11:10:33 +01:00
024ac9c089 Fix T84549: Keymap presets written without repeat enabled
Key map items using TEXTINPUT didn't include the repeat setting.
2021-01-14 20:52:36 +11:00
e7c36ce43c GPencil: Disable Multiframe edition when play animation
When the multiframe is enabled, playing animation must be disabled or the animation is not visible,

{F9527854}

Reviewed By: fclem

Differential Revision: https://developer.blender.org/D9930
2021-01-14 10:44:45 +01:00
3e4dd7b000 Merge branch 'blender-v2.92-release' 2021-01-14 15:55:34 +11:00
a4226a050b Fix T64518: Blender 2.7 keymap inconsistencies
- Add missing Shift-Space for toggle maximize area.
- Add missing Alt-F10 for toggle fullscreen area.
- Match 2.7x keymap for setting the pivot center.
2021-01-14 15:53:06 +11:00
646f1cc89a Merge branch 'blender-v2.92-release' 2021-01-14 11:50:55 +11:00
f64746177f Fix add-object tool snap placement when activated from tweak event
When activating add-object from from a tweak event (default keymap),
the snap gizmo could snap to a new location while dragging.

Workaround this by re-calculating the snap position where the tweak
event starts.

Reported T57210#1077747
2021-01-14 11:50:08 +11:00
0876829e7a Merge branch 'blender-v2.92-release' 2021-01-14 10:58:19 +11:00
5804bf25bd Fix uninitialized stack memory use accessing the snap normal
Using the add-object tool, snapping to object types such as
curve, armature ... etc, copied uninitialized stack memory.
2021-01-14 10:55:49 +11:00
c13383da41 Cleanup: use enum for undo step direction
The step direction was confusingly 1 for undo, -1 for redo.
This convention is from 2004 (562d6958cb).

Use enum for ed_undo.c for better readability.
2021-01-14 09:53:38 +11:00
01b9dfeab4 Fix T84684: Undo operators not working
Mistake in 2771dfd563. The commit left the new editors operator registration
in `ed_util_ops.c`, but removed the function call to it.
In other words, the ED-utils operators were not registered.
2021-01-13 23:41:14 +01:00
73169628a1 Fix T84684: Undo operators not working
Mistake in 2771dfd563. The commit left the new editors operator registration
in `ed_util_ops.c`, but removed the function call to it.
In other words, the ED-utils operators were not registered.
2021-01-13 23:39:04 +01:00
b6aa8daf49 Fix T84645 cursor moves when clicking selector.
The absolute position desktop mapping has been corrected. The correct
mapping is 0-65535 inclusive. Additionally, division by the virtual
desktop width and height needed to be subtracted by 1 as width and
height are one more than the final pixel index.
2021-01-13 14:07:49 -08:00
c4c2c4bdb8 Merge branch 'blender-v2.92-release' 2021-01-13 14:33:53 -06:00
cf9709fd1e Fix T84686: Node vector socket default values not animate-able
{rB1d3b92bdeabc} disabled animating other properties of the socket default
values, like the "min" and "max" properties, as well as the "default_value"
of the "default_value". That naming confusion lead to the commit
inadvertently removing animation for the vector socket in RNA.

I checked that the other socket types don't have the same issue.
2021-01-13 14:33:28 -06:00
21b9231d7f Transform: geodesic distances for proportional edit connected mode
Use approximate geodesic distance computatiom that crosses through triangles
rather than only along edges. Using only edges would give artifacts already
on a simple grid.

Fixes T78752, T35590, T43393, T53602

Differential Revision: https://developer.blender.org/D10068
2021-01-13 18:24:33 +01:00
00b2c7c5cc Merge branch 'blender-v2.92-release' 2021-01-13 11:21:09 -06:00
9dab489d51 Bump file subversion after recent node versioning commit 2021-01-13 11:16:11 -06:00
08ee5573a9 Fix Python warnings in node editor after revert of datablock changes
Revert was done in 2771dfd, ref T84669
2021-01-13 18:06:39 +01:00
09fe0e8aa9 Nodes: use green color again for shader sockets and shader category
The green is still distinct from the more turquoise use for geometry, and
they are never used in the same node graph. The use of red makes sense, but
would need changes to other sockets and categories to set it apart well.

Ref T82689
2021-01-13 18:00:14 +01:00
d08ec3120f Revert "2.92 splashscreen"
This reverts commit 5d826866a3.
2021-01-13 17:49:28 +01:00
84c08748d8 Revert "Blender 2.92 beta - bcon3"
This reverts commit cfc9b95abd.
2021-01-13 17:49:24 +01:00
a60e270efb Merge branch 'blender-v2.92-release' 2021-01-13 17:49:08 +01:00
8ad305382e Blender 2.93 bcon1 - alpha
Bump the version number for the new release cycle.
2021-01-13 17:33:27 +01:00
5d826866a3 2.92 splashscreen
Credit: Joanna Kobierska - artstation.com/joanna_kobierska
2021-01-13 17:33:22 +01:00
cfc9b95abd Blender 2.92 beta - bcon3
Bump the release cycle to beta. This also hides away the experimental features
from the user interface.
2021-01-13 17:33:22 +01:00
1f4c1c5fc7 Geometry Nodes: Add "Point Translate" and "Point Scale" nodes
The translate node moves every point in the geometry, and the scale
node multiplies the "scale" attribute of the input geometry by its input.
While these operations are already possible with the "Attribute" nodes,
these new nodes fit nicely with the nodes specifically for changing the
"rotation" attribute that already exist, and they provide a simpler way
to do the same thing.

Differential Revision: https://developer.blender.org/D10100
2021-01-13 10:32:06 -06:00
bae4d00e2a UI: Use gray color for float sockets in nodes
The shade is too close to RGBA sockets.

Related to T82689
2021-01-13 17:17:54 +01:00
7d749720ad UI: Use capital letters for X Y and Z axes
Also add another comma and use plural "axes".
2021-01-13 10:13:00 -06:00
8df0268e2b Geometry Nodes: Rename "Rotate Points" to "Point Rotate"
This is consistent with the other node names, giving (almost) all of the
nodes in the "Point" category the same prefix.
2021-01-13 10:10:25 -06:00
80578a9d54 Geometry Nodes: Rename boolean input sockets
"Geometry A" becomes "Geometry 1", just to be more consistent
with other nodes.
2021-01-13 10:00:20 -06:00
2771dfd563 UI: Revert design changes to data-block selector for the 2.92 release
Partially reverts 2250b5cefe.

Removing the user count and fake user count icons was controversial (which was
expected) and there are a few further changes needed, that won't make it in
time for the release, see D9946.
While there is a design to bring back the user count and fake user indicators,
a new design idea was proposed that the UI team wants to follow. This came too
late for the 2.92 release, the new design is targeted at the 2.93 release now.
Meanwhile, UI team decision was to simply revert the design changes.

The new design is being worked on in https://developer.blender.org/T84669.

Note that this commit does not revert some internal changes done in
2250b5cefe. Namely the introduction of `ed_util_ops.c` and data-block
operators in there. These will still be needed in the new design.
2021-01-13 15:31:02 +01:00
ad4202a14f Cleanup: Remove unecessary namespace prefixes 2021-01-13 08:29:03 -06:00
89f490932f Geometry Nodes: Enable exposing object and collection sockets
This patch allows connecting wires for object and collection socket
types to the "Group Input" node, which exposes them to be adjusted
in the modifier.

Thanks to @angavrilov's recent work in rB8964c02348f6, it is now
possible to edit pointer IDProperties in the interface when they are
drawn with `uiItemPointerR`.

This patch is composed of a few changes:
  - Add code to create pointer properties in the modifier settings for
    object and collection sockets, and also to draw them in the UI.
  - Also search through the modifier's `IDProperty` settings to find IDs
    used by the modifier.
  - Change the setting's UI layout to support the change.

Differential Revision: https://developer.blender.org/D10056
2021-01-13 08:13:57 -06:00
Eric Bickle
55c56f1ffb Fix T79356: Improved icons for MSIX builds
Fixed an issue that was causing the app icon to render with a
'plated' background color in the taskbar and other areas of Windows.

Updated all app icons in Microsoft Store package to match Microsoft's
design recommendations.

Added multiple scales for app icons for high resolution displays.

Added high contrast app icons.

Reviewed By: pablovazquez, jmonteath

Maniphest Tasks: T79356

Differential Revision: https://developer.blender.org/D9681
2021-01-13 14:42:05 +01:00
5f411f7f38 Revert "Fix T79356: Improved icons for MSIX builds"
This reverts commit 78011d712d.
2021-01-13 14:31:52 +01:00
Eric Bickle
78011d712d Fix T79356: Improved icons for MSIX builds
Fixed an issue that was causing the app icon to render with a
'plated' background color in the taskbar and other areas of Windows.

Updated all app icons in Microsoft Store package to match Microsoft's
design recommendations.

Added multiple scales for app icons for high resolution displays.

Added high contrast app icons.

Reviewed By: pablovazquez, jmonteath

Maniphest Tasks: T79356

Differential Revision: https://developer.blender.org/D9681
2021-01-13 13:32:00 +01:00
d985751324 Geometry Nodes: improve Point Distribute node
This greatly simplifies the Point Distribute node. For a poisson disk
distribution, it now uses a simpler dart throwing variant. This results
in a slightly lower quality poisson disk distribution, but it still
fulfills our requirements: have a max density, minimum distance input
and stability while painting the density attribute.

This new implementation has a number of benefits over the old one:
* Much less and more readable code.
* Easier to extend with other distribution algorithms.
* Easier to transfer more attributes to the generated points later on.
* More predictable output when changing the max density and min distance.
* Works in 3d, so no projection on the xy plane is necessary.

This is related to T84640.

Differential Revision: https://developer.blender.org/D10104
2021-01-13 12:44:17 +01:00
ed1042ee06 Geometry Nodes: cleanup attribute usage
Now that typed attribute wrappers don't need to own the
attribute anymore, many `std::move` calls can be removed.
2021-01-13 12:27:38 +01:00
76fd41e9db Depsgraph: Remove redundant copy-on-write operations
This change removes copy-on-write operations from ID nodes which do not
need copy-on-write.

Should be no functional changes, as before the copy-on-write operation
would do nothing for those nodes anyway.
2021-01-13 12:13:35 +01:00
0f95f51361 Fix T83411: Crash when using a workspace/layout data path in a driver
Building IDs which are not covered by copy-on-write process was not
implemented, which was causing parameters block not present, and, hence
causing crashes in areas which expected parameters to present.

First part of this change is related on making it so Copy-on-Write is
optional for ID nodes in the dependency graph.

Second part is related on using a generic builder for all ID types
which were not covered by Copy-on-Write before.

The final part is related on making it so build_id() is properly
handling ParticleSettings and Grease Pencil Data. Before they were not
covered there at all, and they need special handling because they do
have own build functions.

Not sure it worth trying to split those parts, as they are related to
each other and are not really possible to be tested standalone. Open
for a second opinion though.

Possible nut-tightening is to re-organize build_id() function so
that every branch does return and have an assert at the end, so that
missing ID type in the switch statement is easier to spot even when
using compilers which do not report missing switch cases.

As for question "why not use default" the answer is: to make it more
explicit and clear what is a decision when adding new ID types. We do
not want to quietly fall-back to a non-copy-on-write case for a newly
added ID types.

Differential Revision: https://developer.blender.org/D10075
2021-01-13 12:13:34 +01:00
2cd091e9c7 Fix Cycles not taking into account CYCLES_SHADER_PATH for finding stdcycles.h
Contributed by howetuft.

Differential Revision: https://developer.blender.org/D9973
2021-01-13 12:12:36 +01:00
Jesse Y
dc170a6d67 Fix: popout windows are sized incorrectly on high DPI screens
There should be a conversion to native pixel size as expected by GHOST at the
window manager level, the dimensions at screen level do not need a conversion.

Differential Revision: https://developer.blender.org/D9976
2021-01-13 12:12:36 +01:00
8964c02348 RNA: allow editing pointer IDProperty values from the UI.
Currently it is not possible to edit bare IDProperty pointer
values which are not explicitly defined through python via
UI fields. This is likely mostly because, unlike numeric values,
pointers aren't marked PROP_EDITABLE by default. However there
are also some bugs in the RNA code that need fixing.

The Geometry Nodes modifier uses bare properties to store
input settings for the node group it wraps, so supporting
Object and Collection sockets requires editable pointers.

This patch marks bare IDProperties editable, and ensures
that changing ID pointers rebuilds the dependency graph.
A type check is needed because an IDPROPERTY PointerPropertyRNA
can actually wrap a group value rather than an ID pointer.

Making pointers editable is not likely to accidentally
affect UI fields that were not intended to be editable,
because a simple `layout.prop` cannot determine which
datablocks to display in the menu and remains read-only.

The PROP_NEVER_UNLINK flag is also removed: it seems it
was added because the edit field that couldn't produce
a menu to set the pointer used to still display the unlink
button, but that seems not to be the case anymore.

Actual support for Object & Collection inputs in the modifier
is added in D10056, which can be used to test this code.

Differential Revision: https://developer.blender.org/D10098
2021-01-13 14:09:31 +03:00
8185d07ace RNA: fix a crash when setting bare IDProperty pointers.
The rna_idproperty_check call should be done before accessing
the prop pointer so that it can detect IDProperty values and
replace them with the actual PointerPropertyRNA object.

Ref D10098
2021-01-13 14:09:31 +03:00
38df935c09 Fix T84646: Compositor: In Blender 292 "Set Alpha" node is undefined
Incorrect version code introduced by 9dbea1db66 would not check inside
node groups.
2021-01-13 12:07:26 +01:00
aed5b88ec1 Asset System: Disable Asset Browser as experimental feature
The Asset Browser will be disabled and not available for the 2.92 release. In
alpha/beta builds, there will be an "Asset Browser" option under Preferences >
Experimental, if the developer extras are enabled.
Note that this also disables related UI elements (e.g. "Mark Asset" buttons,
Preferences settings for asset libraries, etc.).

The code is still in master of course, development and testing will continue
there. But there simply needs to be too much polishing and fixing before the
2.92 release, plus there are some design decisions to be reevaluated.

Check the milestone 1 project to follow ongoing work:
https://developer.blender.org/project/view/124/
2021-01-13 11:10:17 +01:00
Robert Guetzkow
27b78c9c94 Compositor: "Save as Render" for the file output node
This commit adds the "Save as Render" feature to the file output node,
that allows to disable the application of the configured view transform
and other color management settings on the image. If disable it uses
the standard view transform instead. This feature was originally
suggested in T83842 and is part of the color management improvements
task in T68926. With this feature it is possible to toggle the
application of the color management settings for each input socket
of the File Output node individually.

Reviewed By: brecht

Maniphest Tasks: T68926, T83842

Differential Revision: https://developer.blender.org/D9921
2021-01-13 11:04:02 +01:00
614bd239f8 Geometry Nodes: support optional ownership for typed attributes
This will simplify some code in an upcoming commit and will be
useful for T83793.
2021-01-13 10:48:39 +01:00
7b68d0679e Cleanup: rename enum for event value items
This contains all value items (with overlapping values),
name this to make it clear it contains all items.
2021-01-13 19:58:57 +11:00
7af8271c34 Fix WM_event_print error printing tweak events value 2021-01-13 19:56:49 +11:00
ba44919601 Fix Event.value RNA access with tweak event types
Accessing event.value would return unrelated values such as
PRESS, RELEASE, CLICK... etc. instead of NORTH, SOUTH... etc.
2021-01-13 19:56:40 +11:00
0b711e6758 Fluid: Updated Mantaflow source files
Includes minor fixes / cleanups from the viscosity plugin.
2021-01-13 09:49:38 +01:00
3f7c294a95 Mix modifiers test after commit to bevel modifier defaults
{rB6b5e4ad5899d} neglected to update the modifier tests to reflect
the fact that the default limit method is no longer "NONE".
2021-01-12 23:54:46 -06:00
97a6b3ceee Cleanup: use single quotes for enum literals 2021-01-13 16:41:12 +11:00
37c5552742 Fix memory leak with image drag and drop
Dragging an image from the file selector into the sequencer
was leaking memory.

Regression in b5d778a7d4.
2021-01-13 16:23:14 +11:00
Philipp Oeser
5d99199880 Fix T83084: Smart UV Project inverts the resulting UVs
Caused by 850234c1b1,

Flip the normal to avoid flipped projection.
2021-01-13 13:37:14 +11:00
92826a921c Cleanup: spelling 2021-01-13 13:21:29 +11:00
bc58425862 Cleanup: clang-format, trailing space 2021-01-13 13:15:22 +11:00
b9e02eace6 UI: Clarify the property name of "F-Curve Visibility"
"F-Curve Visibility" is a bad UI label for a property that only affects
the display of unselected F-Curves. This commit clarifies the property
name by making it more specific with the word "Unselected", and by using
the word "Opacity". "F-Curve" is redundant in the UI label anyway because
it is included in the panel title.

Resolves T82587

Differential Revision: https://developer.blender.org/D10027
2021-01-12 19:14:57 -06:00
6b5e4ad589 Bevel Modifier: Use angle limit method by default
This right click select post outlines the reasons to make "Angle" the
default limit method: https://blender.community/c/rightclickselect/BVfbbc/
In short: Beveling every single edge rather than just sharp edges is
rarely the desired behavior, and the placement of the property in the UI
makes it easy to see the property's importance and toggle it.

Differential Revision: https://developer.blender.org/D8961
2021-01-12 18:55:27 -06:00
719bea0d6d Geometry Nodes: Output the most complex attribute data type
In order to avoid losing information, it sometimes makes sense for the
output attribute type to depend on the types of the input attributes.

Such a function already exists, `attribute_data_type_highest_complexity`,
it just needs to be used in a few more places. The change for the attribute
compare node is just so the code there uses the same code style as in the
attribute mix node.

Addresses part of T83793
Differential Revision: https://developer.blender.org/D10099
2021-01-12 14:03:35 -06:00
Aaron Carlisle
6c15b70279 UI: Update Clip Tracking menus
- Add operators that previously could only be found in panels
- Re order menus to match other menus
- Organize Code

|Before|After|
|{F9493583}|{F9493584}|
|{F9493585}|{F9493586}|
|{F9493588}|{F9493590}|
|{F9493591}|{F9493592}|

Reviewed By: sergey, sebastian_k, #motion_tracking

Differential Revision: https://developer.blender.org/D9781
2021-01-12 14:45:20 -05:00
bf5d45fd99 Cleanup: Fix incorrect function name
The function used "domain" incorrectly where it meant "data type".
2021-01-12 11:47:51 -06:00
abbc43e4e4 Fix T84397: Creating and removing many objects very quickly causes a crash
The root of the issue was caused by the dependency graph using ID pointer
to map evaluated state from old depsgraph to new one upon relations update.
This was failing when IDs were re-allocated rapidly: was possible that
Object ID's evaluated state assigned to Mesh and vice versa.

Now depsgraph uses Session UUID to identify which IDs to restore evaluated
state to. The session UUID is stored in the IDNode, so that id_orig is not
dereferenced on depsgraph update since the ID might be freed.

The root of the issue is identified by Campbell, original patch was done
by Bastien, thanks! Also thanks to Oliver and Ray and everyone else for
testing!
2021-01-12 17:16:48 +01:00
957e292c58 Fix T64953: Add cryptomatte meta data to file output node.
This change will try to add meta data when using a multilayered open
exr file output node in the compositor. It adds the current scene meta
data and converts existing cryptomatte keys so it follows the
naming that is configured in the file output node.

This change supports the basic use-case where the compositor is
used to output cryptomatte layers with a different naming scheme to
support external compositors. In this case the Multilayered OpenEXR
files are used and the meta data is read from the render result.

Meta data is found when render layer node is connected with the
file output node without any other nodes in between. Redirects and empty
node groups are allowed.

The patch has been verified to work with external compositors.
See https://devtalk.blender.org/t/making-sense-of-cryptomatte-usage-in-third-party-programs/16576/17

See patch for example files.

Reviewed By: Sergey Sharybin

Differential Revision: https://developer.blender.org/D10016
2021-01-12 16:24:26 +01:00
c3b68fa7b1 Fix T81965: Library-Override Not able to edit Keyframe properties
Fix keyframe properties not being editable when animating a
library-overridden datablock.

The problem was that RNA pointers were created based on the datablock
affected by the animation (for example an Object), instead of the
datablock that contains the FCurve itself (the Action). The latter can
be local to the current blend file and should thus be editable, even
when the former is not.

Reviewed By: mont29

Maniphest Tasks: T81965

Differential Revision: https://developer.blender.org/D10091
2021-01-12 15:43:42 +01:00
c96d596f43 GPU: Remove Limited Support AMD Polaris
Removing the limited support message as the known opengl issues of the
recent drivers with polaris cards have been tackled.
2021-01-12 13:54:50 +01:00
b2ad52a763 Tests: skip unit test if built without ocean sim modifier
Disable the Ocean Sim test when building with `WITH_MOD_OCEANSIM=OFF`.
2021-01-12 13:50:29 +01:00
e0a4b392f3 Cleanup: use exact check for fread, move out of the loop
Without this, additional items could be added in the future
which wouldn't be included in the check.

Move the check out of the loop since this is such an unlikely
situation that checking every iteration isn't needed.

Also remove redundant casts.
2021-01-12 23:31:34 +11:00
28b17ef0e6 Cleanup: replace 'long long' with int64_t in imbuf indexer 2021-01-12 23:31:34 +11:00
3b77bd48f9 Geometry Nodes: new Align Rotation to Vector node
This adds a new Align Rotation to Vector node based on the mockup
in T83669.

Reviewers: HooglyBoogly, simonthommes

Differential Revision: https://developer.blender.org/D10081
2021-01-12 12:55:14 +01:00
3a254b93fd Geometry Nodes: support reading from spans of WriteAttribute
Previously, the span returned by `WriteAttribute`s might not contain the
current value of the attribute for performance reasons. To avoid some
bugs, the span now always contains the old values (they might have to
be copied over from the internal storage, dependending on how the
attribute is stored).
The old behavior is still available with the `get_span_for_write_only`
method. The span that it returns might not contain the current
attribute values. Therefore, it should only be used when you want
to overwrite an attribute without looking at the old values.
2021-01-12 12:50:29 +01:00
58dae919e5 Weight Paint: avoid creating very small values with locked weights.
When painting using Auto-Normalize or Lock Relative with some
groups locked, the locked weights may not add up precisely to
1 because of precision limitations, which results in creating
nonzero weights close to FLT_EPSILON. With Lock Relative display
mode this is very obvious and annoying (random red points amid
black or blue), so add an epsilon check to consider less than
1e-6 unlocked weight to be the same as 0.

In addition, in cases when no weight can be painted due to locks,
don't create vertex group entries at all if they don't exist yet.
Also, don't run Auto Normalize when not painting a deform group.

Differential Revision: https://developer.blender.org/D10000
2021-01-12 14:32:05 +03:00
Robert Guetzkow
f5c0ef52cf Fix T84588: Cache access in rna_Particle_uv_on_emitter
The function `rna_Particle_uv_on_emitter` did not handle the case where
`particle->num_dmcache` was `DMCACHE_ISCHILD`. This resulted in an
incorrect offset for the `mtface` pointer. The commit checks for the
case and sets the offset accordingly, similar to existing code in
e.g. `particle_calculate_parent_uvs`.

Reviewed By: JacquesLucke

Differential Revision: https://developer.blender.org/D10072
2021-01-12 12:14:34 +01:00
c56da67716 Fix: Bmesh from_object applies modifiers twice
The Bmesh from_object method applies modifiers twice when the input
deform is enabled and the input depsgraph is a render one.

The evaluated object already have modifiers applied, and
mesh_create_eval_final() applies modifiers again. To fix this, the
BKE_mesh_new_from_object() function is used instead.

Reviewed By: Brecht

Differential Revision: https://developer.blender.org/D10053
2021-01-12 13:07:12 +02:00
26fd55fad1 UndoSys: Refactor step 1: cleanup and simplify logic in main undo/redo handlers.
* Simplify and clarify logic in `BKE_undosys_step_undo/redo_with_data_ex`,
  by adding early return on invalid situations, renaming some variables,
  and adding comments.
* Add more sanity checks in those functions.

No behavioral change are expected here, besides in potential edge-case,
invalid situations.

This is a preliminary change, before some deeper modifications of
`BKE_undosys` undo/redo API.

Differential Revision: https://developer.blender.org/D10033
2021-01-12 11:58:14 +01:00
1dc9650d20 Cycles: upgrade to OptiX SDK version 7.1 on buildbot
This means that NVIDIA driver version 450 or newer is now required for Cycles
OptiX rendering. This upgrade is required to take advantage of new features and
improvements.

Ref T81431
2021-01-12 11:51:42 +01:00
89ae4a7a2a Fix NLA liboverride issues re tracks handling.
From original rBc0bd240ad0a1 commit, issues reported with suggested
fixes by Wayde Moss (@GuiltyGhost), thx.
2021-01-12 11:32:17 +01:00
Oliver Weissbarth
401279253e Fix T84515: Status bar is reporting the average solve error of the wrong tracking object
Reviewed By: sergey

Maniphest Tasks: T84515

Differential Revision: https://developer.blender.org/D10047
2021-01-12 11:02:12 +01:00
Janusch Patas
2a23addf52 Fix T83122: NURBS Extruding multiple points only moves existing points
The Surface -> Nurbs Curve behaves now like the Curve -> Nurbs Curve,
if you initially select less than all points. So, multiple points can
be selected and extruded which just moves the selected points similar
to Curve -> Nurbs Curve object.

Differential Revision: https://developer.blender.org/D9934
2021-01-12 10:56:51 +01:00
ff51afb194 Fix T84593: Operators on material (linked to local object but with
linked obdata) fail

Caused by rB1a650fdcb286.

Above commit made polling more restricitive in that it did not allow for
actions on material slots (linked to object, not object data) on objects
with liked object data. This should be allowed though.

Maniphest Tasks: T84593

https://developer.blender.org/D10078
2021-01-12 10:03:48 +01:00
55059af01d Fix T84455: Circle select tool cursor draws in overlapping regions 2021-01-12 14:19:32 +11:00
Rahul Chaudhary
acbda123ad UI: Icon for Multires Displacement Smear Tool
This commit adds the icon for the new tool.
2021-01-11 15:30:26 -06:00
b9b59aa6de UI: Update geometry icon files
None of these changes should be visible, but the files were somehow
out of sync with the blend file, so they need to be updated to reflect
those changes.
2021-01-11 15:29:20 -06:00
Lukas Stockner
688e5c6d38 Fix T82351: Cycles: Tile stealing glitches with adaptive sampling
In my testing this works, but it requires me to remove the min(start_sample...) part in the
adaptive sampling kernel, and I assume there's a reason why it was there?

Reviewed By: brecht

Maniphest Tasks: T82351

Differential Revision: https://developer.blender.org/D9445
2021-01-11 21:04:49 +01:00
b70f4a265a Fix T84496: Cycles: Tile stealing does not work with NLM
Reviewed By: brecht

Maniphest Tasks: T84496

Differential Revision: https://developer.blender.org/D10066
2021-01-11 21:04:49 +01:00
Nicholas Rishel
d5c59913de Fix T81211 Add high frequency mouse input for Windows.
Also send mouse move event instead of moving cursor via SetCursorPos.
SetCursorPos did not reliably move the mouse when it is leaving the
window quickly.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D9981
2021-01-11 11:40:21 -08:00
ecdbd83a8d Geometry Nodes: Attribute Vector Math Node
This patch implements the same operations and interface as the regular
vector math node, but it runs for every element of the attribute. This
should expand what's possible with geometry nodes quite a bit.

Differential Revision: https://developer.blender.org/D9914
2021-01-11 12:06:52 -06:00
5bd822dc46 Geometry Nodes Point Distribution: Align points to face normals
This patch makes the point distribute node write to the "rotation"
attribute with the normal of each face at each distributed point.
The "normal" attribute is also created with the triangle normal
at each point.

The conversion from the triangle normal to an Euler rotation is somewhat
arbitrary, since we only have one direction vector. For a more flexible
rotation for each point, the "Align Rotation to Vector" node can be used
in the future.

Differential Revision: https://developer.blender.org/D9965
2021-01-11 11:42:16 -06:00
2a8b987e9e Fix T83422: Dimensions incorrect after undoing if it has modified geometry.
Root of the issue is that `BKE_object_eval_boundbox` (that ports back
evaluated bbox to orig object during active depsgraph evaluation) is
only called when object's geometry actually is evaluated.

However, with new undo, often Object itself can be changed by undo,
without requiring its geometry to be re-evaluated, which was leading to
the evaluated bbox not being copied back into orig object anymore.

Fixing that by moving bbox copying-to-orig code into
`BKE_object_sync_to_original` instead, which is always executed when
object is evaluated (as hinted by the comment above
`BKE_object_eval_boundbox` actually).

Also allows to cleanup code for armature eval, apparently.

Maniphest Tasks: T83422

Differential Revision: https://developer.blender.org/D9789
2021-01-11 17:59:21 +01:00
e44e0e4e78 Cloth: add a vertex group setting to exclude from object collision.
This can be useful as a workaround on the boundary with the pinned
vertices in some situations among other things, and completely copies
the existing design of the self collision vertex group setting.

Differential Revision: https://developer.blender.org/D10043
2021-01-11 19:34:33 +03:00
ac290bfbe4 Collision: allow disabling collision without removing the modifier.
The `object.collision.use` flag was treated as a redundant marker
of the existence of the modifier, going as far as adding/removing
it when the value was changed, which is not actually very useful.
Removing the modifier loses its position in the stack, and requires
a dependency graph rebuild. It feels it may be a legacy flag?

What would be useful however is the ability to toggle collisions
dynamically without removing the modifier. This patch adjusts the
code to keep the modifier when the flag is disabled, and add it
if it doesn't exist when the flag is enabled. The modifier now
checks the flag at the start and quickly exits after cleaning
up stale data. The redesigned setting is exposed in the UI.

Collisions can't be disabled by simply using the modifier enable
flags because the modifier merely saves a snapshot of the mesh at
a certain point of the modifier stack for other objects to use,
and thus has to be able to clear the stale data.

Differential Revision: https://developer.blender.org/D10064
2021-01-11 19:34:32 +03:00
b271475a9e ImBuf: Add error handling to IMB_indexer_open
Handle return value of `fread()` by printing an error and closing the
file when it cannot be read from. Not only is error handing a good idea,
it also prevents GCC from warning that the return value of `fread()`
should not be ignored:

```
.../blender/source/blender/imbuf/intern/indexer.c: In function ‘IMB_indexer_open’:
.../blender/source/blender/imbuf/intern/indexer.c:201:5: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
  201 |     fread(&idx->entries[i].frameno, sizeof(int), 1, fp);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.../blender/source/blender/imbuf/intern/indexer.c:202:5: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
  202 |     fread(&idx->entries[i].seek_pos, sizeof(unsigned long long), 1, fp);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.../blender/source/blender/imbuf/intern/indexer.c:203:5: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
  203 |     fread(&idx->entries[i].seek_pos_dts, sizeof(unsigned long long), 1, fp);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.../blender/source/blender/imbuf/intern/indexer.c:204:5: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
  204 |     fread(&idx->entries[i].pts, sizeof(unsigned long long), 1, fp);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```

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

Reviewed by: campbellbarton
2021-01-11 17:29:21 +01:00
bf90fcda47 ID Creation: generate session_uuid in more cases.
Previous code would not generate a session uuid for embedded IDs (like
root node trees or master collections). While this is not a problem
currently since those are not directly stored in Main data-base, this is
conceptually wrong, since those IDs still pertain the Main data.

Further more, this is blocking using `session_uuid` more in depsgraph in
place from ID pointer itself, as identifier (related to T84397).
2021-01-11 16:44:19 +01:00
1a26d15763 Fix Embedded IDs creation bypassing ID management completely.
No ID (even remotely) related to Main database should ever be created
directly through MEM_mallocN. Using `BKE_libblock_alloc` is the bare
minimum.

Note that there is no behavior change expected here.
2021-01-11 16:44:19 +01:00
2f9073adb1 Fix missing IDType init in ViewLayer tests.
Kinda miracle this did not cause problems so far, but was breaking tests
with some upcoming changes.
2021-01-11 16:44:19 +01:00
9e1ec5033d Fix T84516: ID properties have incorrect names in Python dir() list
Caused by not going through the proper accessor function to access the
property identifier.
2021-01-11 16:10:29 +01:00
98268e5c68 Cleanup: remove trailing whitespace 2021-01-11 15:49:42 +01:00
beb5863ed4 Geometry Nodes: transform Object Info outputs to local space
Ref T83670.

Differential Revision: https://developer.blender.org/D10071
2021-01-11 15:00:29 +01:00
c083398921 BLI: fix math operation
That fixes a stupid mistake of mine that was copied a couple of times.
2021-01-11 14:59:05 +01:00
7b6e55b933 Cleanup: remove redundant UV edge selection calls
Selecting vertices and faces first checked edge selection,
this was called to set vert1 & vert2 variables which have since been
removed.

These calls should have been removed in
51f04bf7b8.
2021-01-12 00:53:33 +11:00
2a297366f0 Fix T84565: UV face select fails when zoomed in
Exposed by recent commit 246efd7286

Although this was an existing logical error causing
`uv_find_nearest_face` to only work properly when the hit distance was
initialized to FLT_MAX, which wasn't the case in multi-object edit mode.
2021-01-12 00:31:54 +11:00
fe53b6a7fb Fluid: Adjusted viscosity strength step size in UI
Step size was too small.
2021-01-11 12:55:33 +01:00
Pi Lanningham
f0ae0f490e Fix T84327: outliner_id_copy_tag was only copying from expanded nodes.
If a node was closed in the hierarchy, we would only copy that node,
even if child nodes were selected.

Reviewed By: brecht, mont29

Maniphest Tasks: T84327

Differential Revision: https://developer.blender.org/D9995
2021-01-11 12:02:06 +01:00
6e7716f32e Cleanup: Added const to RenderLayersProg methods 2021-01-11 11:46:32 +01:00
445ebcaa30 VSE: store raw images in cache
Previously raw images were not cached if image wasn't preprocessed.
This caused issue, that image had to be read from disk on every redraw.

Effect strips must be excluded, because this would cause problem with
invalidation. Effect strips can use preprocessing however. This is
mainly to allow usimg modifiers on them.

This change should follow rBf448ff2afe7a77, but I have wrongly assumed,
that it has been implemented already.

ref T80278
2021-01-11 11:38:33 +01:00
54f8a5dd73 Tests: run suites instead of individual test cases
Group all tests of a test suite into a single test command invocation.
This reduces the number of invocations by `ctest` by an order of
magnitude.

Since rB56aa5b0d8c6b663, `bin/tests/blender_test` was run for every
individual test. Having over a 1000 tests made testing slower than
necessary. Individual tests can still be run if desired by invocation of
`bin/tests/blender_test --gtest_filter=suitename.testname`.

NOTE: For this commit to have an immediate effect, it may be necessary
to remove the `tests` and `Testing` directories and some CMake files
from your build directory and rebuild. Run `ctest -N` to see the list of
tests; there should be less than 200.

Reviewed By: sergey, LazyDodo, sebbas

Maniphest Tasks: T83222

Differential Revision: https://developer.blender.org/D9649
2021-01-11 11:29:30 +01:00
63cea2b793 Fix versioning code outside of version check
Bug introduced in f448ff2afe probably due to mistake when resolving
conflicts and not checking functionality.
2021-01-11 10:55:27 +01:00
d095411002 Fix T83544: Cycles crash when rendering with Save Buffers enabled
The issue is that the "Noisy Image" pass is added even though it should not.

`use_denoising` has to be enabled on the scene and on the view layer
to actually enable it.

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

Reviewers: lukasstockner97, brecht
2021-01-11 10:21:38 +01:00
4c44a5309c Fix T84459: Face normals not displaying (AMD GPU)
This is part two of the fix for T84459.
Issue appears to be caused by AMD graphics driver later than 20.11.1 and
affects older GPUs (Polaris/FIJI cards). Drawing normals in edit mode
uses the same OpenGL data type for storing normals that is known to be
faulty.

This change fixes the face dot normals by using GPU_COMP_I16.
2021-01-11 09:52:16 +01:00
618f7df7fc Cleanup: Incorrect comment 2021-01-11 09:52:16 +01:00
9fb32b2b29 Fix T84459: Wireframe not displaying with AMD GPU
Issue appears to be caused by AMD graphics driver later than 20.11.1 and
affects older GPUs (Polaris/FIJI cards). Wireframe drawing uses the same
OpenGL data type for storing normals what is known to be faulty.

This patch enabled storing the normals using GPU_COMP_I16. It also
solves the normals drawing in edit mode for vertex and loop normals.
2021-01-11 09:52:16 +01:00
64929398fb Cleanup: skip accessing sequence strip name/source when hidden 2021-01-11 17:58:08 +11:00
a83c67c183 Fix incorrect use of BLI_snprintf in sequencer text concatenation
The start of the text was stepped over without subtracting it's length
(introduced in fad80a95fd).

Replace this logic with BLI_string_join_array to simplify construction.
2021-01-11 17:51:42 +11:00
b01e62e399 Fix missing directory separator in image/movie strip identifier 2021-01-11 17:17:10 +11:00
16aefea9fa Cleanup: use switch statement for sequence types
Also remove duplicate NULL pointer check and replace
BLI_snprintf with BLI_strncpy.
2021-01-11 17:13:27 +11:00
50104b11a1 Fix T84582: WalkNavigation.mouse_speed ignored with tablet
Scale the speed up 4x instead of clamping the value to a minimum of 4.
2021-01-11 16:33:15 +11:00
ab5986cf3a Fix T84501: Wintab button lag.
Multiple Wintab tablets do not send relative button state when
configured to do so. This causes button events to be delayed until
processed as Win32 button events.

This commit fixes the issue by configuring Wintab to use absolute
button state and tracking changes manually.
2021-01-10 21:18:46 -08:00
af88d23ffa Revert "Fix typo; Documentation; Expose layer for framebuffer attachament; Add framebuffer viewport setter; Remove framebuffer restore; Expose framebuffer push/pop stack API; Remove blend modes; Remove depth_range_set; Implement GPU_face_culling, GPU_front_facing, GPU_point_size, GPU_line_width, GPU_viewport, GPU_color_mask and GPU_depth_mask"
This reverts commit 9db3d1951d.

This was an accidental commit of the patch D8826
2021-01-10 21:07:04 -03:00
d4330ae70b Transform: In the Header, show translation value in local space only with constraint
This partially reverts commit ad15e764dd.
The local value is only useful with constraint.
2021-01-10 20:58:45 -03:00
ad15e764dd Transform: In the Header, show the translation value in local space
Showing value in the global space was an unintentional change.
2021-01-10 20:30:25 -03:00
08e44b5e3e Fix Increment Snapping Without Constraints in Non-Axis-Aligned Views
The incremental snap was always operating in the local space, which in most
cases is the VIEW type orientation.

Use only local space when the operation is affected by constraint.

Differential Revision: https://developer.blender.org/D10052
2021-01-10 20:24:46 -03:00
9db3d1951d Fix typo; Documentation; Expose layer for framebuffer attachament; Add framebuffer viewport setter; Remove framebuffer restore; Expose framebuffer push/pop stack API; Remove blend modes; Remove depth_range_set; Implement GPU_face_culling, GPU_front_facing, GPU_point_size, GPU_line_width, GPU_viewport, GPU_color_mask and GPU_depth_mask 2021-01-10 19:01:53 -03:00
1d3b92bdea UI: Improve node group input / output list interface
This commit replaces the two-column list for editing node group inputs
and outputs with a cleaner solution with two panels. The new layout
has several benefits:
 - It uses the vertical space in the node editor sidebar better.
 - It should be more familiar because of similarity with other UI lists.
 - It should look better with consistent alignment and icons.

Note that displaying the "Name" property outside of the list itself is
a bit inconsistent and could possibly be removed in the future.

Differential Revision: https://developer.blender.org/D9683
2021-01-10 13:24:37 -06:00
30310a4fc8 Fix T83777: Crash when enabling guides
Also adjusted adjusted guiding UI parameters so that guiding will not get invalidated when changing domain values.
2021-01-10 19:16:44 +01:00
5b90ed6c06 Fluid: Fix cache saving issue with OpenVDB IO
Fixes issue where files would not be written when 'resumable' option was checked.
2021-01-10 19:16:44 +01:00
Peter Fog
544e371908 Fix T84529: Crash with strip using deleted scene
If scene strip has no scene assigned, leave source string empty.
Same goes for all other strips, that use ID datablocks.

Reviewed By: ISS

Differential Revision: https://developer.blender.org/D10058
2021-01-10 17:37:07 +01:00
e45630a99f Fix sequencer disk cache not writing data
Error handling added in 512a23c3d6 caused that reading header of new
file failed, since it is empty.

Don't attempt to read header if file is empty. If header can not be read
anyway, try to delete the file. Add asserts, as this should never
happen.

Reviewed By: sybren

Differential Revision: https://developer.blender.org/D9954
2021-01-10 16:50:08 +01:00
9441413cb2 VSE: Remove fit method tool setting from header
This property was intended to affect fit method for added strips prior
to running operator. However UI team did not agree with current
implementation.

ref T84535

Reviewed By: HooglyBoogly

Differential Revision: https://developer.blender.org/D10055
2021-01-10 16:37:18 +01:00
6154aa1529 Cleanup: remove redundant decorator for eevee 'overscan_size'
All eevee scene properties are not animatable due to
`RNA_define_animate_sdna(false)` so there is no need for an animation
decorator here (would not show anyways).

Not sure if setting use_property_decorate to False and then manually
adding one again was a hack in rB7fc60bff14a6 to get the alignment
right, but seems to work good now without it.

Note: there also seems to be an inconsistency here generally:
- Eevee reserves room for an animation decorator in almost every panel
(except for "Sampling" and "Indirect Lighting") even though almost none
are animatable (except for stuff in "Hair" and "Film"). This looks nice
if multiple panels are expanded (except for mentioned "Sampling" and
"Indirect Lighting" -- maybe these should also reserve the room?)
- Cycles does not use animation decorators at all (even though pretty
much everything is animatable here -- maybe these should also use
animation decorators?)
- Then there is also the 'shared' "Grease Pencil", "Freestyle" and
"Colormanagement" -- these dont use animation decorators, but some stuff
is animatable...

Regarding the note: not sure what the guidelines here are, if this is
isolated to each panel then there is lots of stuff for eevee that could
set use_property_decorate to False, if multiple open panels are
considered (for nice visual consistency between them), then there is
romm for improvement elsewhere, too.

Maniphest Tasks: T81411

Differential Revision: https://developer.blender.org/D9164
2021-01-09 15:02:14 +01:00
fa82a15676 Cleanup: remove unused struct members
Non-projection painting in the viewport is no longer supported,
remove struct members used for this.
2021-01-09 19:07:31 +11:00
e718004edf Cleanup: use bool arguments & variables 2021-01-09 19:07:14 +11:00
246efd7286 Fix UV selection threshold which ignored image aspect and zoom level
Selecting UVs wasn't properly scaling based on the zoom or image aspect.

This now matches vertex selection in the 3D view.
2021-01-09 18:42:36 +11:00
645298be29 Fix build error after last commit 2021-01-08 23:10:58 -06:00
1bb530745f Cleanup: Use bool instead of int 2021-01-08 23:09:31 -06:00
9c07454816 Keymap: Enable repeat for "Make Edge/Face" operator
The "repeat" property was turned off by default in rBf5080c82dd91, but
it's important to have repeat turned on for this operator since it can be
used to fill large areas. This commit is similar to rBaa77689f77b4.

Fixes T84531
2021-01-08 17:19:04 -06:00
69a22a70ac Geometry Nodes: Don't start with empty group nodes selected
The nodes were selected in new node groups because they are by default,
but there's no particular reason for them to be selected, and it can
be distracting.
2021-01-08 16:29:10 -06:00
7fd19c20e0 Geometry Nodes: Gray out "New" button when curve object is active
Currently curve objects aren't supported by the node modifier, so the
new node group and modifier operator shouldn't be available.
2021-01-08 15:04:38 -06:00
3c1fcec652 Fix T84517: Two geometry node trees added with "New" button
Adding the modifier itself already adds a new node tree, which is
then displayed in the node editor because of the active object and
active modifier context. So there's no need to create the node tree
in the python code in this case.
2021-01-08 12:12:43 -06:00
bc788929aa Scenes: forbid deleting last local scene
Previously, it was only forbidden to delete the last scene. This can
lead to the situation where a .blend file only contains linked scenes.
This is problematic, because linked data might not always be available
or can be removed from a .blend file without having an additional check
for remaining scenes.

Now there always has to be at least one local scene.

Reviewers: mont29

Differential Revision: https://developer.blender.org/D10049
2021-01-08 16:39:42 +01:00
2d3f96cace Fix T84453: Crash bezier curves transfrom
The pointer allocated to the `TransData` was being incorrectly incremented,
causing misalignment and consequently `heap-buffer-overflow`.

Because of this, `TD_NOTCONNECTED` was being set in a strange way that did
not correspond to other types of `TransData`.

The solution is to not increment the `TransData` pointer and set
`TD_NOTCONNECTED` only for "unconnected" segments.

The code was also a bit deduplicated.
2021-01-08 11:22:58 -03:00
c549d736cf Icons: Update script to generate icons from SVGs for Inkscape 1.0
The command line syntax for Inkscape changed quite a bit for the 1.0 release,
see https://wiki.inkscape.org/wiki/index.php/Release_notes/1.0#Command_Line.
Think it's reasonable to expect Inkscape 1.0 or later be installed if you want
to generate the icons with the script. It's easy to get via the website, if the
distribution doesn't provide new enough packages. Only few people would use the
script anyway.

I also had to change the path for command line access on macOS which apparently
changed (https://stackoverflow.com/a/60068607). Although I didn't find a
mention of this change in the Inkscape release notes.
2021-01-08 15:07:54 +01:00
c66f00dc26 Fix Cycles rendering with OptiX after instance limit increase when building with old SDK
Commit d259e7dcfb increased the instance limit, but only provided
a fall back for the host code for older OptiX SDKs, not for kernel code. This caused a mismatch when
an old SDK was used (as is currently the case on buildbot) and subsequent rendering artifacts. This
fixes that by moving the bit that is checked to a common location that works with both old an new
SDK versions.
2021-01-08 13:38:26 +01:00
e3ae7d1f2f Fix T83942: improve error checking when trying to render high resolution volume
Reviewers: fclem

Differential Revision: https://developer.blender.org/D10032
2021-01-08 12:14:12 +01:00
c889ec916c Cleanup: clang format 2021-01-08 11:54:53 +01:00
c44a17ec4b Fix T84475: Outliner missing update when adding IDs to main via RNA
Was reported for meshes, but was true for any type.
Now add appropriate notifier to refresh the Outliner.

Maniphest Tasks: T84475

Differential Revision: https://developer.blender.org/D10030
2021-01-08 11:50:36 +01:00
1698678231 GPU: Mark AMD Polaris 20.11+ drivers with limited support.
The issue does not render wireframes correctly.
2021-01-08 11:44:31 +01:00
03f1d8acab Use the term "N-gon" instead of "Polygon" for triangulation method
This was reported for the Triangulate geometry node, but was also true
for the triangulate modifier and in exporters.

Note the modifier was introduced with "Ngon Method" in rBa7b44c82e5b9 but
was renamed to "Polygon Method" in rBf4762eb12ba5.

Since quads are also polygons (and quads have their own method), the
term "N-gon" is more appropriate here and is also described in the
glossary https://docs.blender.org/manual/en/2.92/glossary/
index.html#term-N-gon

Docs have been updated in rBM7539 (partially - the method would also
have to be renamed once this patch lands).

Note this also fixes the wrong enum used for the alembic exporter.

Fixes T83907

Maniphest Tasks: T83907

Differential Revision: https://developer.blender.org/D10022
2021-01-08 11:20:42 +01:00
4a0b8c9427 Cloth: completely exclude fully pinned triangles from collision.
Currently such triangles are effectively already excluded, because
the calculated forces are not applied to pinned vertices. However
these forces are still being computed, which is inefficient.

This adds an early check for triangles where all vertices are
pinned during BVH overlap detection, which significantly speeds
up certain use cases with big fully pinned areas that happen to
overlap a collider. In case of self collision both triangles must
be fully pinned to exclude safely, because the computation is
symmetric and handles two triangles at the same time.

Differential Revision: https://developer.blender.org/D10041
2021-01-08 12:24:50 +03:00
8877e294df Surface Deform: the Strength setting is not bind-specific.
It is used during evaluation so it shouldn't be greyed out in the UI.

Ref D10040
2021-01-08 12:24:50 +03:00
662b7c3edf Surface Deform: optimize memory allocation in the evaluation code.
Using malloc to allocate a temporary array for each vertex,
which most commonly contains just 4 elements, is not efficient.
Checking the mode with a switch is also better.

Differential Revision: https://developer.blender.org/D10040
2021-01-08 12:24:50 +03:00
ceaed47bf9 GPU: Enable HQ normal work around on Linux.
Linux does not report the driver version. It does report the OpenGL
version. This change will check the OpenGL version to enable the HQ
normal work around.
2021-01-08 10:23:20 +01:00
f448ff2afe VSE: Hide cache settings and adjust defaults
Adjust default cache settings for all files to store raw and final
images.

All settings are still available when developer extras option is
enabled in user preferences.

This is part of design task T80278

Differential Revision: https://developer.blender.org/D9745
2021-01-08 07:24:55 +01:00
09ea339a6c Cleanup: Use LISTBASE_FOREACH macro 2021-01-07 21:24:46 -06:00
15bb8f9f93 Fix file-handle leak when parsing xdg user directories 2021-01-08 13:19:11 +11:00
61f1faac3f Fix T83868: Disabled or inactive list items are not grayed out
The cause for this was quite simple-- a misplaced bitwise operation
before passing a value to the function that grayed out buttons based on
their state, caused by refactoring in rB933bf62a611f before committing.

What makes the situation a little more confusing is that the theme colors
are overridden for list buttons in UI lists, necessitating a second
call to `ui_widget_color_disabled()`. Ideally that wouldn't be necessary.
2021-01-07 16:28:26 -06:00
5530d6f86f PyAPI Docs: Terminal instructions for Windows incorrect
Fixes T84498
2021-01-07 15:58:47 -05:00
95c63babbb Cleanup: Declare variables where initialized 2021-01-07 12:30:18 -06:00
d259e7dcfb Cycles: Increase instance limit for OptiX acceleration structure building
For a while now OptiX had support for 28-bits of instance IDs, instead of the initial 24-bits (see also
value reported by OPTIX_DEVICE_PROPERTY_LIMIT_MAX_INSTANCE_ID). This change makes use of
that and also adds an error reported when the number of instances an OptiX acceleration structure is
created with goes beyond the limit, to make this clear instead of just rendering an image with artifacts.

Manifest Tasks: T81431
2021-01-07 19:23:13 +01:00
3db2bc82aa Surface Deform: optimize handling of the vertex group weight.
There is no need to first copy weights to a separate array,
or create the data layer if it doesn't exist. The threaded
code can retrieve the weight directly from the layer.

Differential Revision: https://developer.blender.org/D10015
2021-01-07 21:08:44 +03:00
Juanfran Matheu
64277e8f3a UI: Use Eyedropper Cursor with Sample Weight Tool
While using the Sample Weight tool in Weight Paint mode, user eyedropper mouse cursor.

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

Reviewed by Pablo Vazquez
2021-01-07 09:44:48 -08:00
Juanfran Matheu
e3d9241a05 UI: Show Weight Value with Sample Weight Tool
While using the Sample Weight tool in Weight Paint mode, show weight value in tool header.

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

Reviewed by Pablo Vazquez
2021-01-07 09:29:36 -08:00
3db975f30d Fix T84326: No ID for geometry nodes instances after scattering
Instances are created with an "index" parameter used for persistence over
time through animation. Currently the geometry nodes instancer passes
the index in the array for this value, but the arrays created by the
"Point Distribution" node aren't necessarily stable  in this way when
the input mesh is deformed. In D9832 we already mostly solved this
problem with an `id` attribute. The solution here is to create instances
with this attribute as well.

It's important to note that deforming the instanced points *after*
distribution will usually be a better solution for this problem. This
solution is likely still important though.

Differential Revision: https://developer.blender.org/D10024
2021-01-07 09:27:42 -06:00
4c0fc60105 UndoSystem: Early out from core undo/redo handlers when undo step is NULL.
Also added `undosys_stack_validate` debug check to redo case.
2021-01-07 15:58:23 +01:00
044dd42a05 Cleanup: Undo system: minor simplification in non-debug code. 2021-01-07 15:58:23 +01:00
987e9e2145 Fix T84469: Online manual raises an exception with key-map options
Report an error instead of raising a Python exception.

Currently these properties aren't written to the manual
so it's best to show an error.
2021-01-07 23:36:25 +11:00
c55b578c9e Fix T84142: crash when mirroring hair emitted from vertices
The hair mirroring code seems to expect that hair is emitted from faces.
The PE_mirror_x contains the following expression: mirrorfaces[pa->num * 2].
This only makes sense when pa->num is a face index.

The simplest short term solution is to disable the mirror operator when
the particles haven't been emitted from faces.

Diffferential Revision: https://developer.blender.org/D10002
2021-01-07 13:32:36 +01:00
c26f46cb95 Fix T83497: missing relations update when group node changes
Changing which node group a group node references needs a depsgraph
relations update in some cases.

Differential Revision: https://developer.blender.org/D10018
2021-01-07 13:31:17 +01:00
0d042c8cca RNA: document Python instancing for ID's and RNA types
Document some of the less obvious implications for
re-using Python instances.
2021-01-07 21:36:39 +11:00
4a771263fd Outliner: use the scene ID for ObjectBase PointerRNA
While this didn't cause any problems, `Base` structs are part of the
scene which is being set in other uses of this type.
2021-01-07 16:20:08 +11:00
Yevgeny Makarov
dd0df3c5d2 UI: Fix various issues with UI text
- Use the name "Point Cloud" instead of "Pointcloud"
 - Fix a typo in UV_OT_smart_project.
 - Use the name "Install Light" to for the installation
   operator for MatCaps, HDRIs, and Studio Lights.

Fixes T83585, T65291, and T54921

Differential Revision: https://developer.blender.org/D9867
2021-01-06 22:54:10 -06:00
2dfd117ab5 Fix memory leak duplicating a scene with "Copy Settings" 2021-01-07 15:04:26 +11:00
a9dea9cfaa PyAPI: don't raise & clear exceptions when setting context members
BPY_context_dict_clear_members_array used PyDict_DelItemString
which raised & cleared the exception when the key didn't exist.

Even though setting/clearing the exception is supported,
it's worth avoiding where possible as it adds some overhead as well as
overwriting the previous error which can free PyObject's which are
unrelated to the code being executed.

Possible fix for T82552, crashing on Windows when setting the exception.
2021-01-07 14:41:52 +11:00
f35a38fba7 Fix BKE_blender_atexit_unregister error removing from linked list
This is an old bug exposed by having multiple atexit calls since
c65c4149c9.
2021-01-07 13:31:57 +11:00
27426c05b1 PyAPI Docs: Link to user docs instead of describing in API doc 2021-01-06 19:52:13 -05:00
b138c8f5b3 PyAPI Docs: Update Indirect Data Access docs
Fixes T84432
2021-01-06 19:34:21 -05:00
a9c607e60e PyAPI Docs: Fix wrong modifier path usage
Fixes T84430
2021-01-06 18:54:56 -05:00
133bdac306 PyAPI Docs: Clarify quick start guide tips
Some of the text here was outdated with 2.8x.
See T84427
2021-01-06 18:45:34 -05:00
211e161d76 Fix T84416: Vertex color baking checks for UVMap
Since the introduction in rB2221389d6e8e, baking to vertex colors would
still check for the existence of a valid UVMap (as if baking to image
textures).

Now check for vertex colors instead if target is
R_BAKE_TARGET_VERTEX_COLORS.

Maniphest Tasks: T84416

Differential Revision: https://developer.blender.org/D10006
2021-01-06 22:26:20 +01:00
6ea01dc509 UI: Use the 3D cursor icon for the RNA struct
Since there is a specific icon to represent the 3D cursor it makes sense
to add it to the RNA struct. This struct's icon is only displayed in the
Data API section of the outliner.
2021-01-06 14:00:44 -06:00
3028de9527 UndoType: Refactor: replace use_context boolean by a bitflag.
We will soon need more options here, sinmpler and cleaner to use a
bitflag then.
2021-01-06 18:07:09 +01:00
5cdf279ef4 Fix T84420: Linking regular materials to gpencil
When using "Make Links"->"Materials" regular materials could be linked
onto grease pencil objects. This caused a number of issues.

The fix changes the `allow_make_links_data` function to make sure that
if one object is of type `OB_GPENCIL`, the other has to be aswell.

Reviewed By: antoniov

Maniphest Tasks: T84420

Differential Revision: https://developer.blender.org/D10014
2021-01-06 17:54:44 +01:00
6672cbeb23 Fix T84202: Sculpt lasso mask crash after remesh.
'Caused'/revealed by rBd29a720c45e5: Operators that fully re-create the
mesh would previously rely on `sculpt_update_object` called from update
code to get required sculpt-specific data layers re-added to the new
mesh.

Now instead put all code adding data to orig mesh for sculpt purpose
into a new util function (`BKE_sculpt_ensure_orig_mesh_data`), and call
that function when entering sculpt mode, and from voxel remesher code.

This is contonuing effort to more clearly separate orig data from evaluated
data handling/usage in sculpt code.

TODO: there are likely other code paths that would need to call that
new function?

Reviewers: @sergey, @pablodp606

Subscribers:
2021-01-06 16:25:39 +01:00
a584aef470 Undo: Further tweak/fixes the 'use context' flag of undo types.
Note that this is fairly fragile still, especially in cases like paint
cureve undo, which actually does not use context in most cases (and can
be called with a NULL context), but do need it in one case. This will
need a proper rework at some point.
2021-01-06 15:59:23 +01:00
691c021679 Fix T82952: Crash changing mesh data block and switching scenes
Regression in 33ac3582bb.
2021-01-07 01:35:05 +11:00
f0071dfa10 Fix T79779: Pick shortest UV face-path ignores sticky setting 2021-01-07 00:37:05 +11:00
0e4f8ed90e UndoType: Fix some incinsistencies re context usage flag.
`use_context_for_encode` was not properly set regarding actual `encode` code for a few types.
2021-01-06 14:11:25 +01:00
eb1ff4b3a4 Cleanup: CodeStyle format 2021-01-06 13:55:27 +01:00
1c72a2f47d Cleanup: CodeStyle Format 2021-01-06 13:54:12 +01:00
967cf303f3 Fix T83372: Point.select can be True when unselected 2021-01-06 23:27:03 +11:00
bc3e38ca3a Cleanup/refactor: UndoType: Clarify use_context variable.
Rename it to mark it is only for `encode` callbacks, fix `encode`
callback of text undo to early fail in case it gets a NULL context, add
an assert to `BKE_undosys_step_push_with_type` that context is not NULL
when undotype requires a valid one.

Note that in practice this should not change anything, currently it
seems that we always get a valid context in
`BKE_undosys_step_push_with_type`?
2021-01-06 12:28:06 +01:00
4e23f08807 Fix object moved to cursor when editing last operation after dropping object
Steps to reproduce were:
* Drag object icon from the Outliner into the 3D view (or an object asset from
  the Asset Browser)
* Open the "Adjust Last Operation" panel
* Edit options in there - the object would move to the mouse location

The same issue happens with collection instance and object data adding (e.g.
via drag & drop). This patch addresses them too.

The operator used the event state stored in the window. This shouldn't be
accessed from the operator execute callback generally which happened here.
Especially not if the operator supports editing properties.
2021-01-06 11:55:21 +01:00
290b6d7ef3 Fix T70316: Custom "Delete Keyframes" shortcut still requires
confirmation

Deleting keyframes in the dopesheet or graph editor always required
confirmation, even if used ouside of the "Delete" menus.

Now add a "confirm" option [same as for deleting objects], which can be
disabled for immediate keyframe deletion.

This will also change the default behavior and bring this in line with
how object deletion works so there is one shortcut for bringing up the
menu/confirmation and another shortcut to delete immediately without
requiring confirmation / another click:

- Blender Default keymap: "X" for menu, "Del" for immediate
- Industry Compatible: "Backspace" for menu, "Del" for immediate

Maniphest Tasks: T70316

Differential Revision: https://developer.blender.org/D9651
2021-01-06 11:35:06 +01:00
4b56c18290 Fix T84426: Limit dissolve ignores selection with custom normals
Regression in 9969c2dd16.

Add note that custom normal calculation functions write into to tags.
2021-01-06 19:04:53 +11:00
947dc92083 BMesh: assert when a mesh has two kinds of shake-key data
Assert with comment to avoid confusion caused by
mixing two kinds of shape-key data.

This problem was exposed when investigating T84364.
2021-01-06 18:11:46 +11:00
Yevgeny Makarov
5424b4821d Fix T83094: Alternate rows in the Sequencer are green (macOS)
The issue is that `UI_GetThemeColorBlendShade4fv()` creates a color
with alpha, but there is not any background underneath to blend in with.

The solution is just to draw an opaque background first, which also
halves the number of rects to draw. Note that the brighter rows get
very slightly darker after this change.

Differential Revision: https://developer.blender.org/D9947
2021-01-05 14:21:54 -06:00
2ed6055209 Fix T79146: Sculpt Mode lags until the entire mesh is visible
This was caused when the BKE_pbvh_draw_cb function was used with
update_only_visible set to false. In that case, all nodes with the flag
were updating, but the update flag was only cleared for visible nodes.
This was causing constant updates per redraw in no visible nodes until
they enter the view frustum and their flag was cleared.

In order to fix this and prevent it from happening again:
 - Updating the buffers, flushing the updates and clearing the flags are
now part of the same function. It does not make sense to do these in
separate places.

 - The BKE_pbvh_draw_cb function was refactored so the
pbvh_update_draw_buffers is only called once. It should now be easier to
understand what the function does when it is used to update only visible
nodes or all nodes.

Reviewed By: mont29

Maniphest Tasks: T79146

Differential Revision: https://developer.blender.org/D9935
2021-01-05 20:23:41 +01:00
c20e482714 Fix T78681: "Add Primitive" icons are cropped in tool header
The issue can be simply resolved by moving the primitives and plus
icons slightly. They still bump up against the top and bottom of the
header but it looks much better now.
2021-01-05 13:00:35 -06:00
4ade409a87 Cleanup: Reduce variable scope 2021-01-05 12:22:23 -06:00
3373d14b1b Fix T83925: Crash when rendering on the CPU with OptiX denoiser enabled
Rendering on the CPU uses the Embree BVH layout, whether the OptiX denoiser is enabled or not.
This means the "build_bvh" function gets a "BVHEmbree" object to fill and not a "BVHMulti" as it
was assuming before, which caused crashes due to memory geting overwritten incorrectly. This
fixes that by redirecting Embree BVH builds to the Embree device.

Manifest Tasks: T83925
2021-01-05 18:37:31 +01:00
491a9e9ec4 Cleanup: Undo code: poll function.
Remove obviously outdated comment, and explictely set `poll` to `NULL`
in the one case it is not actually defined (sculpt undo).
2021-01-05 18:21:09 +01:00
90a26f900c Cleanup: UndoType: use size_t for memory size of structs. 2021-01-05 18:21:09 +01:00
166c0db3f9 Fix T83915: Subdivision Surface modifier causes visual artifacts in Cycles rendered viewport - CPU and OptiX
Changing the geometry in the current scene caused the primitive offsets for all geometry to
change, but the values would not be updated in all bottom-level BVH structures. Rendering
artifacts and crashes where the result. This fixes that by ensuring all BVH structures are
updated when the primitive offsets change.
2021-01-05 17:59:38 +01:00
da9d471e1d Fix T84389: RGB Curves node shows "tone" option outside of compositor
Since the introduction in rB4de7c0c3105a, the option is only used in the
compositor, it has no effect elsewhere [texture nodes, shader nodes].

Now only show the option for the compositor.

Maniphest Tasks: T84389

Differential Revision: https://developer.blender.org/D10005
2021-01-05 17:04:56 +01:00
583006d0ef Cleanup: clang tidy 2021-01-05 17:04:02 +01:00
39f99fd05c Fix: tried to set error message on modifier that does not exist
Without this, the example file in T83730 crashes in a debug build
when deleting the hair edit bake in the particle settings.
2021-01-05 16:50:23 +01:00
9dbea1db66 Compositor: Alpha Mode
{D9211} introduced pre-multiplying the color for the keying node. This
pre-multiplication should also be done by other keying nodes and should be
the default operation for alpha node.

This patch will change the logic of keying nodes (Cryptomatte Node,
Channel Matte, Chroma Matte, Color Matte, Difference Matte, Distance
Matte, Luminance Matte) and breaks old files.

The Set alpha node has a mode parameter. This parameter changes
the logic to `Apply Mask` the alpha on the RGBA channels of the input color
or only replace the alpha channel (old behavior).

The replace mode is automatically set for older files. When adding
new files the the multiply mode is set.

Reviewed By: Sergey Sharybin

Differential Revision: https://developer.blender.org/D9630
2021-01-05 16:34:55 +01:00
357e519575 Fix T83282: division by zero when creating psys tasks 2021-01-05 16:17:37 +01:00
cffa39358f Cleanup: Compositor comment style 2021-01-05 15:50:58 +01:00
36ae6e66c1 Fix T84367: Fix crash when showing invalid/legacy constraints
Exposed by rBeaa44afe703e.

Definition for CONSTRAINT_TYPE_NULL is not totally clear (it is set for
constraints without data, see an old comment from Ton), but for these, a
TypeInfo cannot be fetched.

Avoid processing those constraints in UI code, just do nothing instead.

Maniphest Tasks: T84367

Differential Revision: https://developer.blender.org/D9987
2021-01-05 15:31:40 +01:00
Jeroen Bakker
1f41bdc6f3 Eevee Cryptomatte: Store hashes in render result meta data
Stores cryptomatte hashes as meta data to the render result. Compositors could
use this for lookup on names in stead of hashes.

Differential Revision: https://developer.blender.org/D9553
2021-01-05 15:03:05 +01:00
7cd6f667e3 Fix T84053: Mask overlay in image editor not working
The mask overlay wasn't part of the overlay engine. The reasoning nehind
this was that more editors used the mask overlay and most of them used
old drawing code. This patch adds the mask overlay drawing to the draw
overlay engine. This code path will only be used by the image editor
VSE, Compositor and Movie Clip editor will still use the previous
method.

During this patch some alternatives have been researched:
1. `ED_mask_draw_region`: this would lead to different code paths when
   drawing in the image editor, and some hacks to retrieve the correct
   framebuffer.
2. Add mask drawing to image engine: Would lead to incorrect color
   management when viewing the mask.
3. Add mask drawing to image engine and overlay engine: Would lead to
   duplicated code.
4. Add mask drawing to overlay engine and for combined overlay select
   the correct framebuffer.

Option 4 was chosen as the exception (switching framebuffers) can be
done without hacks. The code stays clean.
2021-01-05 13:53:33 +01:00
f41de6dc46 Fix T84404: Crash when using Skin Resize in mesh without Skin modifier
Caused by rB54ee4109143b

Before that commit `TD_SKIP` was marked for all vertices.

Now skip the whole operation as all vertices are skipped.
2021-01-05 09:46:07 -03:00
fab772860d Asset browser: workspace in the wrong category
Workspaces [FILTER_ID_WS] were in the `Environment` category
IDFilterBoolean, whereas they are in the `Miscellaneous` category in
`rna_def_fileselect_asset_params`.

Make this consistent ['Miscellaneous'] in both cases.

(note this was already done in rB2c317457cbf2 for the file browser case)

Spotted while looking into T83983.

Maniphest Tasks: T83983

Differential Revision: https://developer.blender.org/D9911
2021-01-05 13:30:51 +01:00
acfa7b102b Sculpt: use distance threshold for dyntopo symmetrize
This was only used for non-dyntopo symmetrize.
There is no reason to use a hard-coded value in this case.
2021-01-05 23:19:34 +11:00
1f6846fa4e Cleanup: remove UNUSED(..) from public function declarations
This doesn't serve any purpose and can become out of sync
with the function it's self without reporting warnings.
2021-01-05 23:09:50 +11:00
e4884d224c Cleanup: remove redundant RNA_types.h header from UI_interface.h 2021-01-05 23:04:51 +11:00
105d385e4b Fix T84364: Sculpt symmetrize fails with shape keys
Use the BMesh symmetrize operator instead of using the modifier code.

While we could support shape-keys with the existing code used by the
mirror modifier, we'd need to add code-paths for evaluated mesh & bmesh
conversion to handle shape-keys differently just for this one case,
since we want to avoid copying & processing shape-keys layers for
evaluated meshes in general.
2021-01-05 22:48:12 +11:00
7241104877 Enabled Physics Particle Instance test 2021-01-05 16:16:08 +05:30
c0a8dd943f Fix T84018: bulk selection (box, circle, lasso) - unwarranted selection
of islands in vertex mode if "UV Sync Selection" is on

Caused by rB72b422c1e101: UV: support select linked with sync-select in
vert/edge modes

If you had island selection mode enabled in the UV editor with UV Sync
Selection off, and switch UV Sync Selection on, then in vertex selection
mode all bulk selection ops (box, circle, lasso) will be selecting whole
islands.

Prior to culprit commit, for sync selection ON plus island selection ON,
BM_uv_vert_map_create would always return a NULL vmap (it was called
with `use_select` = True, no faces tagged selected). After said commit,
for sync selection ON plus island selection ON, BM_uv_vert_map_create
would return a valid vmap (it is now called with `use_select` = False,
no faces tagged selected - but if `use_select` is False, all UVs will be
added here).

If I am not mistaken, it is never wanted to actually select islands with
box/lasso/circle when sync selection is turned ON [after all you dont
have the UI for it showing], so solution is now to check for this
earlier and not even call uv_select_linked_multi in those cases. (Maybe
in the future this can be unified and we dont need separate selection
modes fo UV and 3D?)

Maniphest Tasks: T84018

Differential Revision: https://developer.blender.org/D9917
2021-01-05 10:26:23 +01:00
dc4014c676 Cleanup: Enum for mask overlay mode 2021-01-05 10:13:00 +01:00
7d152bedc5 Fix T84216: Drawing a paintcurve [vertexpaint / weightpaint] fails
Caused by rB35e3dc9192e7.

Above commit moved 'Weight Paint' & 'Vertex Paint' keymap also before
'Paint Curve' keymap.
This way, paintcurve.add_point_slide would be overriden by:
- paint.vertex_paint (inverted)
- paint.weight_sample

Now move 'Paint Curve' above again.

Reviewers: campbellbarton

Maniphest Tasks: T84216

Differential Revision: https://developer.blender.org/D9939
2021-01-05 10:02:03 +01:00
08f00f4f6e BMesh: Add shape-key support to edit-mesh symmetrize
Symmetrize now flips shape-keys too since using the un-flipped
locations creates an overlapping surface which isn't useful.
2021-01-05 18:03:56 +11:00
4150facd61 BMesh: add use_shapekey to BMesh transform operators
Currently unused, needed for symmetrize to support shape keys.
2021-01-05 15:51:50 +11:00
5370a7dd40 Cleanup: use scale's 'space' argument instead of two transform calls 2021-01-05 15:51:50 +11:00
d3c62b682d Fix bmesh.mirror operator
Checks for merging vertices assumed all the geometry was being mirrored.
2021-01-05 15:51:50 +11:00
a0db43cd7b Fix T84388: Invalid operator reference in the quick-start 2021-01-05 15:51:50 +11:00
6990b6ed3b Cleanup: typos (repeated words) 2021-01-05 15:51:50 +11:00
f359102589 VSE: Fix incorrect condition for skipping prefetch frames
This error was overlooked in commit be69f23b68.
2021-01-05 04:04:06 +01:00
9b17e71c23 Cleanup: Use flag type explicitly
Using the `uiButtonGroupFlag` type explicitly can avoid the need
to look up which enum should be used as an argument.
2021-01-04 17:35:14 -06:00
5a6dfb7571 Fix T78017: Broken layout in "View Lock" panel with armature
The property split layout was broken when the bone dialog appeared,
because the name field was not set. Theoretically property split should
work in this case, but it makes sense to use the label anyway.
2021-01-04 17:32:22 -06:00
9316cb33d8 Cleanup: Remove unused variables in transform mesh skin code
Differential Revision: https://developer.blender.org/D9992
2021-01-04 17:11:59 -06:00
102eff0bd4 Fix T84382: Geometry Nodes: Vertex group attributes are removed
In the report, the geometry is copied because it has two users and the
final join node needs to write to it. The join node also happens to
remove attributes apparently, because it exposed a mistake in the "copy"
method of the `MeshComponent` class. The copy is supposed to be
a deep copy, but the vertex group name map was not duplicated.

Differential Revision: https://developer.blender.org/D9991
2021-01-04 17:07:10 -06:00
ec90dda318 UI: Fix typo in operator description 2021-01-04 15:42:15 -06:00
Pi Lanningham
5a498e6a7b Fix T84183: Dark area in the bevel custom profile widget
If there was a control point at an extreme position when drawing a curve
profile (in the bottom corner), the fill's trianglulation could fail, giving
a misleading view of the curve. This is because the extra points added to
create a closed shape were exactly on the border of the view.

This commit adds a small margin to those points, so the triangulation
doesn't fail because the line overlaps itself.

Another possible solution is to use a different algorithm to fill
the polygon, such as scanfill, which is used by curve objects.
This seemed simpler, and seems to work fairly robustly.

Differential Revision: https://developer.blender.org/D9989
2021-01-04 15:13:08 -06:00
54ee410914 Fix T84376: Skin Resize(Ctrl + A) does not work in Symmetry
Since the `TransData` converted from vertices is the same used for other
transform modes (Move, Rotate, Resize), the logic used for mirroring
focused only on the position of the vertices.

The solution here is to create a specific `TansData` for `CD_MVERT_SKIN`.
2021-01-04 17:37:08 -03:00
8c80299fc4 Make mesh modifier tests not fail with optimized OSD lib
When building opensubdiv with more aggressive optimization flags
(-march=native -02) the output meshes would differ a bit from what we
expected in the current automated modifier test file.

The differences in vertex position is within the 1e-6 range, which I
would call is acceptable for floats. In addition to this, all the
modifier test that tests the subdiv modifier in particular pass without
any modifications. I've updated two tests in the modifier test file and
script to make it pass (listed below).

Updated following test categories:

1. Decimate test

Here there was a subdiv modifier applied before the actual decimate
modifier. Because the decimate modifier creates a queue of potential
vertices it can remove, it is highly sensitive to even small changes as
it drastically changes in which order the vertices are decimated in.

As this test should only be testing the decimate modifier, I pre-applied
the subdiv modifier in the test file.

2. RandomCubeModifier
For these tests I removed the subdiv modifier as well. As with decimate,
a small change in vertex position here can lead to quite different
results.

Reviewed By: Sergey, Bastien

Differential Revision: http://developer.blender.org/D9004
2021-01-04 19:30:20 +01:00
5aab7f66a0 Fix T83876: blender crashes when baking particles + smoke sim
This was introduced in rBe5c0d4613a8943c712b57fb336997ecd78e6508e.

The issue is that the new fluid system does not use the pointcache
system for caching anymore, but still relies on pointcache for
other things. For example, it uses DEG_add_collision_relations
which internally creates relations with pointcache. Not sure if
there are other issues.

Ideally, this dependence should be resolved in one way or another
at some point, but that is out of scope for this fix.

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

Reviewers: brecht
2021-01-04 15:58:51 +01:00
09c1cb8a17 Fix T84260: NURBS edit mode lines not showing
When in edit mode, the edit lines for de-selected surfaces did not
show up.

The bug was caused by the is_gpencil bool which reused another flag.
Both grease pencil and nurbs surfaces use the edit_curve_handle shader.
A dedicated flag was added to make sure the is_gpencil bool is
set correctly.

Reviewed By: fclem

Maniphest Tasks: T84260

Differential Revision: https://developer.blender.org/D9985
2021-01-04 15:34:02 +01:00
c6e5b3f42d Fix T84095: Eevee vextex color isn't working with hair
Regression introduced by {c766d9b9dc56}. When converting the vertex
buffer to a texture buffer the fetch mode wasn't checked and the short
was bitwise interpreted as a float. This change checks the fetch_mode
and select the correct texture buffer.

This could also be added to other places when needed. At this time it is
only added here to support vertex colors when used with hair particles.
2021-01-04 15:05:37 +01:00
c716b9862a Fix: Update normals when switching scene quality
Recent commits also updated normals for metaballs, curves and volumetric
objects. This change tags will tag to generate geometry for these new
types.
2021-01-04 13:04:37 +01:00
cb2517016b GPU: Enable HQ normal work around for AMD Polaris
THe high quality normals work around is enabled for Polaris cards using
the official drivers. Since driver version 2.11.2 they fail to render
using low quality normals.

The detection of polaris cards is done by matching the opengl renderer.
The renderer strings have been extracted from various reports linked to
{T82856} but isn't complete as some reports are missing the exact
renderer as users don't always report via the help menu.
2021-01-04 12:19:51 +01:00
a3fcbb54f4 GPU: Add HQ normals workaround.
This change makes it possible for platforms to only support high quality
normal rendering. This is part of {T82856} where current AMD drivers
running on the polaris architecture does not support the low quality
setting due to a driver bug.

In a next commit the work around will be enabled.
2021-01-04 12:19:51 +01:00
02d1f1482a Fix mistake in rBef90a8e12caf in data transfer code.
Old mistake from 2.80 era when we got rid of DerivedMesh...

Not critical, but could be backported to 2.90LTS too.
2021-01-04 11:30:04 +01:00
5e38384034 Fix T84362: Crash when use Vertex Paint in subdivide strokes
Maniphest Tasks: T84362

Differential Revision: https://developer.blender.org/D9983
2021-01-04 11:29:47 +01:00
c7085be6c6 Fix T84345: Transforming the cursor fails with absolute grid-snap
Absolute grid snapping was using the pivot, which doesn't make sense
when transforming the cursor.
2021-01-04 21:15:00 +11:00
d11a87b88c DrawManager: High quality normals for non meshes
This adds high quality normals for non meshes. These include

* Volumetric Object Wireframe
* Metaballs
* Extracted Curves
* Curves in edit mode

This is in preparation to fix a regression in recent AMD
drivers where the `GL_INT_2_10_10_10_REV` data type isn't
working in Polaris cards.
2021-01-04 11:09:56 +01:00
17be2149a8 Fix T84106: attribute mix node worked incorrectly on float attributes 2021-01-04 10:43:56 +01:00
b8e536f381 Fix imbuf.new & resize allowing zero & negative dimensions 2021-01-04 20:05:32 +11:00
a6285339ba Cleanup: remove unused optional argument to imbuf.new
While this didn't cause any problems, it was incorrect.
2021-01-04 20:00:27 +11:00
Philipp Oeser
80e720ee4a Fix T84191: remove python API limits for Image.scale() dimensions
Since the introduction in 2c23bb8389,
these were set to 10000 each.

This seems like an arbitrary limit (BKE_image_scale / IMB_scaleImBuf
don't have limits and I couldn't spot similar size restrictions in
image relating functions), now match what we do for creating images
(rna_Main_images_new), use INT_MAX.

Ref D9950
2021-01-04 19:05:46 +11:00
14ee48d898 Fix crash reading files with unknown modifier ID's
Missing NULL check for the modifier type.
2021-01-04 17:40:05 +11:00
f43e8cceb3 Fix early exit check in BKE_appdir_app_template_has_userpref
Logical error in 84f21c170d
This check was a no-op, replace this with a check for an empty string.
2021-01-04 17:40:05 +11:00
f17184bfeb Fix clang_array_check checking utility
Use python3 which is now supported,
only use CLANG_BIND_DIR & CLANG_LIB_DIR when they are set.

Also add immediate mode GPU API function calls.
2021-01-04 17:40:05 +11:00
3254a63218 Cleanup: correct array size in argument 2021-01-04 17:40:05 +11:00
dcdc0f177a Cleanup: use const variables 2021-01-04 17:40:05 +11:00
cd29d76ab6 Cleanup: typo in c484b54453 2021-01-04 17:38:11 +11:00
2008c24123 Cleanup: add NULL check for filename argument which could be NULL
While it's never NULL at the moment, checks elsewhere in this function
support passing in a NULL filename, so keep this working as intended
in case RNAProcessItem.filename is NULL in the future.
2021-01-04 17:38:11 +11:00
82bbe257ee Cleanup: redundant call to WM_modalkeymap_find 2021-01-04 17:38:11 +11:00
a5081896bc Cleanup: redundant code, minor inconsistencies
- Remove ternary operators when both values are the same.
- Remove break after return.
- Remove redundant NULL checks for code which handles
  those cases immediately beforehand.
2021-01-04 17:38:11 +11:00
b5c2a75d26 Cleanup: use ARRAY_SIZE when when looping over the array indicies 2021-01-04 17:38:11 +11:00
22895d0f32 Cleanup: remove self-assignment
Use CLAMP_MAX to remove redundant comparison.
2021-01-04 17:38:11 +11:00
b34eded930 Cleanup: remove redundant code
Fix for T62504 missed removing return call.
2021-01-04 17:38:11 +11:00
9ff4012711 Cleanup: sort cmake file lists 2021-01-04 17:38:11 +11:00
fea1026bb8 Cleanup: use 'pragma once'
Add explanations for cases the header-guard defines are still used.
2021-01-04 17:38:11 +11:00
dfbda59a66 Cleanup: redundant struct declarations 2021-01-04 17:38:11 +11:00
f03c25bda8 Cleanup: sort structs 2021-01-04 17:38:11 +11:00
54f89e8704 Cleanup: docy comments beginning with '/**' don't end with '**/' 2021-01-04 17:38:11 +11:00
9b10b3930b Cleanup: clang-format 2021-01-04 17:38:11 +11:00
c61c7d9926 Cleanup: spelling (use 'gimbal' instead of 'gimble') 2021-01-04 17:38:07 +11:00
613c568df2 Cleanup: use doxy sections for render_preview.c 2021-01-04 17:37:44 +11:00
12409b2069 Cleanup: rename get_brush_icon, make it a static function
Group with other icon preview API functions.
2021-01-04 17:37:44 +11:00
01f38c10cb Cleanup: use const casts in DerivedMesh.cc 2021-01-04 17:37:44 +11:00
1e8f266591 API Docs: CSS: Fix long enum list
This commit makes some adjustments to a previous fix which broke with 
new versions of sphinx/theme.

Fixes T76453
2021-01-02 20:04:25 -05:00
c7e92e379d Update RNA to manual url mappings 2021-01-02 17:51:56 -05:00
Aaron Carlisle
e1b8af9ba7 Fix Unreported: Run time error in UI code
Steps to reproduce:

1. Add clip to clip editor
2. Open the tracking settings & tracking settings extra panels

To fix this the sub panel is only drawn if a track is active.
The main panel will exit early and display a "No active track" message.
This is consistent with other panels in the clip editor.

Reviewed By: HooglyBoogly

Differential Revision: https://developer.blender.org/D9727
2021-01-02 16:11:14 -05:00
0330b0552b Cleanup: Explicitly pass icon size to generation function, not just bool
* This way you don't have to look up the function declaration to know what the
  boolean value means.
* You can call the function in a loop over the available sizes and pass the
  index as size.
* Makes it easier to add a new size in future if needed.
2021-01-02 15:36:51 +01:00
057a8afb87 Fix T84024: Empty image opacity labeled transparency
This value really is the opacity, or the alpha, since a value of 1.0 means
that the image is fully visible, not invisible like "full transparency"
would suggest. Mistake in rBea4d28aea0343a.

Differential Revision: https://developer.blender.org/D9920
2021-01-01 12:07:42 -06:00
0da1fc2fc4 Fix T84029: Point Distribution node crash on mesh with no faces
This bug exposes some ugliness in the implementation in poisson disk
distribution implementation with likely incorrect resizing of vectors and
some other assumptions. However, a simple quick fix is to return early
when the input mesh has no faces. This makes sense anyway because
there is no surface to scatter on.
2020-12-31 17:01:29 -06:00
cda8979005 Fix mistake in recent rB8c135fa9a834 commit. 2020-12-31 15:12:06 +01:00
8c135fa9a8 LibOverride/RNA: refactor rna_property_override_property_real_id_owner.
Makes it more in line with more generic `RNA_find_real_ID_and_path`, and
avoids generating the rna path string if we do not need it.
2020-12-31 14:25:29 +01:00
85951f8fde Cleanup: Move functions from sequencer_edit.c
These are utility functions that are not used in this file.

No functional changes.
2020-12-31 05:22:19 +01:00
e5e57fe0a2 Cleanup: Remove unused functions from sequencer_edit.c
No functional changes.
2020-12-31 05:02:10 +01:00
8373f497bd Add regression tests for curve conversion to mesh
This adds a basic set of tests for curve sampling and bevel generation.
At the moment there are basic test cases for bevels, caps, and the
filling of 2D curves, but more tests can be added in the future.

Curves are actually converted to "DispLists" for displaying them in the
viewport, so it's much simpler to rely on the mesh conversion operator
instead of building a new test framework for another data structure.

Differential Revision: https://developer.blender.org/D9958
2020-12-30 13:12:29 -06:00
Yevgeny Makarov
2d86175bac Fix unreported: Sequencer grid lines are not drawn
By design, there should be lines between the alternating horizontal
stripes in the Sequencer. But currently they are all drawn in one place,
on top of each other. Mistake in rBfae895125efe.

Differential Revision: https://developer.blender.org/D9962
2020-12-30 12:56:24 -06:00
2be2165dd6 Cleanup: Use LISTBASE_FOREACH macro
Differential Revision: https://developer.blender.org/D9960
2020-12-30 17:03:06 +01:00
f910342c8d Outliner: Fix useless assert in new liboverride showing code.
It is perfectly 'valid' to find invalid RNA properties references in
override properties list. Data change, RNA changes, IDProperties change,
some linked ID may become unavailable, etc.

Note that those invaldi override properties are cleaned up when updating
the override info (so typically on undo step storage, and .blend file save).
2020-12-30 12:38:53 +01:00
761ef45a24 Cleanup: Fix typo in tests error message 2020-12-29 20:46:29 -06:00
c1740e9ad0 Fix T83991: Pasting sound strip not working correctly
New UUID was generated for original strip not new one.

Bug caused "invisible" sound strip playing that is impossible to
remove. Especially noticable when transforming pasted strips. In such
case, file reload was necessary.

Reviewed By: mont29

Differential Revision: https://developer.blender.org/D9912
2020-12-29 19:57:56 +01:00
48e0e0e2ac Fix T83439: Sculpt: Radial symmetry combined with mirroring results in texture offsets
Looks like this has been wrong since the introduction in rB5505697ac508
10 years ago.

To get the proper texture lookup in the mirrored area, first rotate, then
translate/flip [instead of the other way around].

Maniphest Tasks: T83439

Differential Revision: https://developer.blender.org/D9897
2020-12-29 18:38:16 +01:00
ae82410329 Fix T83749: Better handling of alpha in generic Nodes material wrapper for IO add-ons.
Try to detect if a given image may have valid alpha data or not (based
on number of channels and depth). This may be a bit doggy in theory, but
in practice it should cover most fields as expected. We can always
adjust the euristic here in other wrong cases appear.

This will affect all import add-ons using that node shader wrapper (at
least OBJ and FBX ones).
2020-12-29 16:38:40 +01:00
e22a36e80a Cleanup: Use proper RNA_pointer_is_null helper.
Followup to rB7f3601e70dd and rBad63d2f60e2.
2020-12-29 12:11:18 +01:00
5428ad40e8 Test: Add utility to do near comparison for float[2] 2020-12-29 10:38:38 +01:00
81c57c9471 Fix T84144 cursor wrap broken for Windows.
Modifies WM_BUTTON processing to reuse existing mousemove logic. Fixes
case where cursor wrap was not being handled on mouse release.

Bonus: flattened mouse move logic so all paths lead to a single return.
Removed case where wrap is not handled until subsequent mousemove as
button press may rely on updated mouse move position.
2020-12-28 13:34:58 -08:00
1db27af38f Fix T84200: Rotating a paintcurve [all paintmodes] doesn’t work correctly
The transform code did not provide a 2d context to be used in 3d space.

The solution is to set all matrices for the screen space in these cases.

This commit also removes the dial3d drawing in these cases.
It was not correct anyway.
2020-12-28 16:19:37 -03:00
Erik Abrahamsson
6fbeb6e2e0 Add operator to copy a modifier to all selected objects
These two operators (one for grease pencil, one for other objects)
copy a single modifier from the active object to all selected objects.
The operators are exposed in the dropdown menus in modifier headers.

Note that It's currently possible to drag and drop modifiers between
objects in the outliner, but that only works for dragging to one object
at a time. Modifiers can also be copied with the "Make Links" operator,
but that copies *all* modifiers rather than just one. The placement
and scope of these new operators allow for more useful poll messages
and error messages as well.

Every object type that supports modifiers is supported. Although hook
and collision modifiers aren't supported because of an unexplained
comment in `BKE_object_copy_modifier`, other than that, every modifier
type is supported, including particle systems, nodes modifiers, etc.

The new modifiers are set active, which required two small tweaks to
`object.c` and `particle.c`.

Reviewed By: Hans Goudey (with additional edits)

Differential Revision: https://developer.blender.org/D9537
2020-12-28 11:18:52 -06:00
7f3601e70d Cleanup/refactor rna_idp_path code.
Factorize common processes and checks, early `continue` in invalid
cases, etc.
2020-12-28 17:40:27 +01:00
ad63d2f60e Fix T84091: IDProperties/RNA: Crash due to colliding name between custom data and static RNA property.
We have to check that the RNAProperty found in `rna_idp_path` from the
currently checked IDProperty name is actually a real runtime RNA-defined
one, and not a static C-defined RNAProperty...
2020-12-28 17:40:27 +01:00
b1d8aeeab2 Snap: Decrease the distance of the incremental snap in ortho view
This matches more the older versions (as shown in the T77819).
2020-12-28 11:44:43 -03:00
26c34a2a3a Tweak comment regarding Sculpt mode undo issues in object update code.
Original comment from rB8a9dedf82954. See also T84084.
2020-12-28 14:16:14 +01:00
823f0da702 Cleanup: UI messages fixes. 2020-12-28 10:22:02 +01:00
e6bb2cdec7 Cleanup: Typo: overriden -> overridden. 2020-12-28 10:22:02 +01:00
e0b6c8f777 Fix possible fall-through in outliner region listener
Reported as a strict compiler warning, and the need of fall-through is
not needed from just reading the code.

If it is something what must happen, the reasoning is to be explained
in the comment, and ATTR_FALLTHROUGH is to be used.
2020-12-28 09:57:59 +01:00
e590d2d167 Cleanup: Declare variables where initialized 2020-12-27 21:46:57 -06:00
57fe65b17e Cleanup: Reduce indentation
Since the if statement is just a NULL check, returning early is simpler
and makes reading the rest of the funtion easier.
2020-12-27 21:26:53 -06:00
aa64fd69e7 UI: List library overrides in the Outliner
Having a centeral place to find a list of all library overrides should be
useful for managing production scenes where library overrides are used a lot.
This change adds the individually overridden properties of a data-block under
the data-block itself. Just how we show modifiers, constraints or pose channels
there. This way we can also expose library override operations/options better
in future.

There's also a filter option for the library overrides now, so they can be
hidden. It is only available in the View Layer display mode though, like the
other filter options.

One internal change this has to do is adding more informative return values to
undo pushes and the library override functions called by it. That way we can
send a notifier when library overrides change for the Outliner to know when to
rebuild the tree.

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

Reviewed by: Andy Goralczyk, Bastien Montagne, William Reynish
2020-12-27 22:45:41 +01:00
960a0b892c Fix T84101: Duplicate operator not available for some data-block selectors
In some operators that previously allowed duplicating the selected data-block,
the operator would not be available now. 2250b5cefe split the "new" operators
into "new" and "delete" to allow clearly differentiating between the two. But I
apparently didn't amend all affected data-block selectors to use the added
"duplicate" operators.
I went over all operators that were split now and made sure all affected
data-block selectors are updated.
2020-12-27 15:55:58 +01:00
e56fe47748 Fix crash when saving render from temporarily maximized render window
Steps to reproduce were:
* Start with factory defaults
* Set "Render in" to "Maximized Area"
* Render
* Open "Save as"
* Click Cancel

Mistake in  78d2ce19c4. Was using the wrong area pointer, which I think
didn't make a difference in most cases, but here it did.
2020-12-27 15:11:26 +01:00
7916c59304 UI: Grammar: "Clean Up" vs "Cleanup" in operator name
"Cleanup" is a noun while "Clean Up" is the verb.
2020-12-26 16:50:44 -06:00
8491e4ab86 Fix unreported: Cycles CLI device override doesn't set peer memory usage flag
Reviewed By: brecht

Differential Revision: https://developer.blender.org/D9929
2020-12-25 23:13:03 +01:00
Nicholas Rishel
565ea3df60 Simplification of Wintab event handling.
Previously Wintab packets were added to a local queue to be processed
during Win32 mouse events, in order to correlate Wintab to Win32
mouse buttons. Wintab packets before Win32 mouse down events were
expired on a timer.

This commit drives mouse events during Wintab events when a device is
in range. When a Wintab button is found it is dispatched if an
equivalent event can be popped from the Win32 event queue. If a Win32
mouse button event is not associated with a Wintab event, it falls
through to WM_BUTTON handling. All Wintab packets are handled as they
are received.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D9908
2020-12-24 16:41:19 -08:00
Yevgeny Makarov
af316d2761 UI: Cleanup spelling of compound words
Approximately 138 changes in the spelling of compound words
and proper names like "Light Probe", "Shrink/Fatten", "Face Map".
In many cases, hyphens were used where they aren't correct, like
"re-fit". Other common changes include:
 - "Datablock" -> "data-block"
 - "Floating point" -> "floating-point"
 - "Ngons" -> "n-gons"

These changes help give the language used in the interface
a consistent, more professional feel.

Differential Revision: https://developer.blender.org/D9923
2020-12-24 13:11:22 -06:00
Yevgeny Makarov
2917f550ca Cleanup: Fix capitalization in various UI strings
Approximately 195 changes of capitalization to conform to MLA title style.
UI labels and property names should use MLA title case, while descriptions
should be capitalized like regular prose, generally with only the start of
a sentence capitalized.

Differential Revision: https://developer.blender.org/D9922
2020-12-24 11:07:32 -06:00
fe440a92e9 Cleanup: compiler warning 2020-12-24 14:19:21 +01:00
29cd99e7fd Cycles: remove surface area computation for meshes with OSL
This is relatively expensive and as per the OSL spec, this value is not
expected to be meaningful for non-light shaders. This makes viewport updates
a little faster.

As a side effect also fixes T82723, viewport refresh issue with volume density.
2020-12-24 13:53:33 +01:00
c4f8aedbc2 Fix T84016: Cycles baking crash with OptiX after recent changes
This worked for CPU + GPU, but not GPU only.
2020-12-24 12:59:35 +01:00
2221389d6e Bake: vertex color baking support for Cycles
In the Bake > Output panel, there is now a choice between Image Textures and
Vertex Colors. The active vertex color layer is used for baking. This works
with both existing per-corner and sculpt per-vertex vertex colors.
2020-12-24 12:40:48 +01:00
0b4fae7a51 Cleanup: refactoring of bake code in preparation of vertex color baking
Split of internal/external image bake target code off into smaller functions and
refactor associated data structures for clarity. Designed so that a vertex color
bake target is easy to fit in.

Also avoid passing in a huge number of arguments into the main baking function,
pass a struct instead.
2020-12-24 12:00:58 +01:00
58c697a9ec Audaspace: port accuracy improvement from upstream. 2020-12-24 10:42:16 +01:00
83ad35cb9c Fix T83997: Duplicated audio does not sound the same
The issue was that sounds were always faded from 0 volume when they
started and depending on the currently used buffer size, the fading took
longer or shorter.

The solution stores whether the sound has ever been played back and
consequently does not fade when starting to play back.
2020-12-24 10:42:16 +01:00
c9efb54240 Cleanup: Clang format 2020-12-23 12:13:44 -06:00
d8dc4c5b32 Geometry Nodes: new Rotate Points node
This node updates the "rotation" attribute on points.
Multiple ways to specify the rotation are supported.

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

Ref T83668.
2020-12-23 16:37:47 +01:00
8a9dedf829 Workaround T84084: Assert/crash when undoing from Sculpt mode to Object one.
Disclaimer: This workaround avoids crashing with current state of the
code and is only committed as temporary band-aid until we can assess the
full issue and decide if/how it needs to be adressed.
2020-12-23 16:03:42 +01:00
d29a720c45 Fix T84002: Sculpt: Masking operations crash if multires is in play.
This fixes the main issue there (essentially a followup to
rB90e12e823ff0: Fix T81854: crash when undoing switch between sculpt and
edit mode).

We basically remove more (hopefully all the remaining!) modifications of
orig mesh from `sculpt_update_object`, as those done here will not be
immediately available in the evaluated data (that specific bug happened
because masking data was added to orig mesh there, but not flushed to
depsgraph evaluated one).

This also goes towards a better separation between handling of evaluated
data and orig one.

Note that modification of orig mesh data can still happen, e.g. values
in some cdlayers, but at least all pointers should now be valid in the
evaluated mesh.

There are still some issues, e.g. we now get an assert/crash in
`multires_reshape_assign_final_coords_from_ccg` when undoing out of the
Sculpt mode, presumably because subdiv_ccg data remains unchanged then
(and hence still has the `has_mask` flag set), while actual mesh data do
not have that cdlayer anymore...

This commit also cleans up/simplifies some code,
`ED_object_sculptmode_enter_ex` was (indirectly) calling
`BKE_sculpt_face_sets_ensure_from_base_mesh_visibility` twice e.g.
2020-12-23 16:03:42 +01:00
9d04fa39d1 Fix T84063: crash reading pointer properties in Attribute shader node
Path resolving can find e.g. a datablock rather than a float or integer,
treat that as a failure to find a valid property.
2020-12-23 15:50:31 +01:00
635694c0ff Fluid: Added new viscosity solver
Mainly updated the Mantaflow version. It includes the new viscosity solver plugin based on the method from 'Accurate Viscous Free Surfaces for Buckling, Coiling, and Rotating Liquids' (Batty & Bridson).

In the UI, this update adds a new 'Viscosity' section to the fluid modifier UI (liquid domains only). For now, there is a single 'strength' value to control the viscosity of liquids.
2020-12-23 15:48:38 +01:00
5cfda8e7f7 Fix crash closing File Browser window after closing temporary render window
This seems to be a longer standing issue. Steps to reproduce were:
* With factory settings, Ctrl+O then F12
* Close the render window using the window close button
* Close the File Browser window using the window close button

This could be OS specific though, at least on macOS this caused a crash.
2020-12-23 15:31:31 +01:00
21cb288029 Fix incorrect debugging text in extra operator icons for buttons 2020-12-23 14:43:40 +01:00
27fcaa6173 Cleanup: Move functions to new ED (editor) operators file & general cleanup
With the new `ed_util_ops.c` introduced in 2250b5cefe, existing code can be
cleaned up to use it.

* Move new ID preview operators to `ed_util_ops.c`
* Move ED operator registration to `ed_util_ops.c`
* Use doxygen sections in `ed_util_ops.c`
* Rename ID related ED operators to use `ED_OT_lib_id_` prefix.
* Remove unused `#include`s
2020-12-23 14:34:24 +01:00
78d2ce19c4 Fix T84013: Crash closing maximized File Browser opened from Preferences
After 1e799dd26e, the logic to recognize a temporary File Browser window
didn't work correctly anymore. It would recognize a maximized File Browser
inside a temporary window as a temporary File Browser window, and attempt to
close this (rather than returning to the previous layout).
The logic there was pretty weak, and still is I think. A more stable solution
would need bigger refactoring.

With this, it's also not possible to maximize or fullscreen an area within a
temporary window (Preferences, File Browser, render window) anymore. Think that
won't make a noticable difference, since you couldn't open multiple areas there
anyway, and the area seems to be maximized already.

Cleaned up the code a bit to not become more confusing with the changes.
2020-12-23 14:34:24 +01:00
9460051c1a Sculpt Undo: Fix broken memory size and potential use of uninitialized variables.
That code looked really like a joke tbh... Random reported memory usage
is not really that important, but the uninitialized items counts was
potentially fairly severe.
2020-12-23 11:17:58 +01:00
b4b888fd2a Cleanup: Reduce Variable scope clip_buttons 2020-12-22 20:13:05 -05:00
8d3d4c8840 Cleanup: Use true and false for booleans 2020-12-22 14:58:57 -06:00
4b46afae09 WM: minor optimization for when there is a large number of notifiers
Don't add the same stats refresh notifiers multiple times, it can be slow to
search the full list of notifiers for duplicates when there are many.

Fundamentally the time complexity in searching for duplicates is still bad.

Inspired by D9901 from Erik Abrahamsson
2020-12-22 19:26:06 +01:00
ac82904c49 UI: keep image open button always visible in image editor datablock selector
Does not need to be hidden in the menu.
2020-12-22 18:18:22 +01:00
00ff3dfb23 Cleanup: Reduce variable scope in object.c 2020-12-22 10:35:18 -06:00
b2edc716c1 Fix Cycles OptiX runtime compilation broken after shader raytracing
Need to pass the appropriate flags as we do for compilation as part of the
CMake build.
2020-12-22 15:08:59 +01:00
dad5aded0c Fix T84006: Cycles AOV not written with some mix shader node set ups 2020-12-22 14:25:50 +01:00
2601501fce RNA: make bpy.data.orphans_purge() return number of deleted datablocks
Sometimes multiple calls to `bpy.data.orphans_purge()` are needed to
delete all orphans, because a call can turn previously-used datablocks
into orphans. Returning the number of deleted datablocks makes it
possible to keep looping until nothing can be deleted any more.

This patch keeps track of deletions in `id_delete()` so that it can be
returned up the call stack.

Reviewed By: mont29

Differential Revision: https://developer.blender.org/D9918
2020-12-22 14:05:49 +01:00
512a23c3d6 VSE: handle IO errors when reading disk cache header and version
Respond to return values of `fscanf()` and `fread()` to detect and
handle I/O errors. Not only is error handling a good idea, this also
prevents warnings from GCC that `fread()` and `fscanf()` return values
are ignored.

Reviewed By: ISS

Differential Revision: https://developer.blender.org/D9915
2020-12-22 11:43:33 +01:00
0e85d701c6 Animation: Bake Action, improved discontinuity filter for bones
Perform the same filtering as e5528904f1
introduced for object rotations, for bone rotations.
2020-12-22 10:04:21 +01:00
9f34f2b20d VSE: Fix animation versioning for bezier F-curves
`seq_convert_transform_animation()` converted only keyframed value, but
when bezier interpolation is used, posotion of handles was unchanged.
This caused significant difference in animation.

I have checked only linear interpolation when testing versioning originally.
2020-12-22 05:50:34 +01:00
ffacce5be4 UI: Properties editor popover and outliner sync
This adds a popover to the properties editor. Currently the only setting
is for controlling outliner to properties syncing.

Because we cannot define a perfect heuristic to determine when
properties editors should change tabs based on outliner icon selection,
we need an option to enable or disable this behavior per properties
editor.

There are 3 options for controlling the syncing. Auto uses the heuristic
to only allow tab switching when a properties editor and outliner share
a border. On and off enable and disable syncing respectively.

Differential Revision: https://developer.blender.org/D9758
2020-12-21 14:31:32 -07:00
Wayde Moss
2d6e6d035b Nla Refactor: Better blend function parm naming
**Renames parms**:
| **old name** | **new name**
| old_value | lower_value
| target_value | blended_value
| value | strip_value
| inf | influence

**Reason**: {D8296} allows full nla stack evaluation with proper
keyframing support. These names should make it more intuitive how all
the data gets processed and inverted. Note, that I do use the term
"strip_value" instead of something like "fcurve_value" of the tweak
strip. Technically, "strip_value" is closer to what is solved for.
For example, if a noise fmodifier was active for the fcurve, then the
remapping would appear to be wrong. In the future, further solving can
be done afterward, outside of the nla system, to remove the effects of
fmodifiers.

**Renames functions**:
| nla_invert_blend_value | nla_blend_get_inverted_strip_value
| nla_invert_combine_value | nla_combine_get_inverted_strip_value

**Reason**: D8296 adds get_inverted_lower_value() variants,
so "invert" alone is too vague.

**Renames NlaKeyframingContext member**:
| nla_channels | lower_eval_data

**Reason**: D8296 evaluates the upper stack. This name makes it more
obvious what data is stored there.

No functional changes (relative to the dependency below)
Split from {D9247}
Depends on {D9694} since the code was so close to eachother.

Reviewed By: sybren

Differential Revision: https://developer.blender.org/D9695
2020-12-21 14:07:16 -05:00
1e2c028a3a Fix/workaround geometry nodes not working with deformation motion blur
Always assume geometry nodes produce potentially animated meshes or point
clouds. In general it is hard to check if geometry nodes are animated, and
for modifiers this was already weak.

The better solution will likely involving checking which geometry was
modified by the depsgraph on frame change, to replace the current mechanism
of manually checking for certain types of modifiers and animation.
2020-12-21 19:19:59 +01:00
36b6ea6cb1 Weight Paint: fix Multi-Paint weight display after rB5502517c3.
Weight Paint Multi-Paint definitely depends on the weight specific
flag, and vertex group locking also involves group name symmetry
via BKE_object_defgroup_mirror_selection. These two are also
features implemented by me so I feel confident.

The rest of object_vgroup.c possibly should be changed too, but
that requires more consideration than these obvious cases.
2020-12-21 20:50:05 +03:00
be71bd8fcc Cleanup: Reduce indentation 2020-12-21 09:43:54 -06:00
Matteo Falduto
985528c9b9 UI: make light spot shape panel consistent between Cycles and Eevee
Differential Revision: https://developer.blender.org/D9906
2020-12-21 14:15:21 +01:00
d2239b685c UI: Use better icon for identifying assets
Use the `ASSET_MANAGER` icon which is more appropriate than the current one
which was just an unused icon that seemed sorta fitting, but was only meant to
be temporary.
The `ASSET_MANAGER` icon is already used for the Asset Browser, so it's being
reused which we normally avoid. So we may still want to create a dedicated one,
maybe a variation of this one.
2020-12-21 13:33:48 +01:00
626a9aae6d Fix part of T84004: Some 2.92 alpha UI strings can't be translated.
Adding 'new' (?) `heading` parameter of some UILayout functions...
2020-12-21 11:50:38 +01:00
5fe24ce295 Fix T84010: Missing scale animation versioning code
Code was removed in 247b10e6a2 but it was incorrect in first place.
Conversion was done for `offset_x` and `offset_y` channel originally,
but it should be done for `scale_x` and `scale_y`
2020-12-21 11:36:39 +01:00
c34ba26856 Fix part of T84004: Some 2.92 alpha UI strings can't be translated.
Not sure why, but py files from `bl_operators` were never considered for
i18n string extraction... They do define some UI strings though.
2020-12-21 11:35:02 +01:00
c9c3bf9833 Some more UI messages fixes... 2020-12-21 10:52:15 +01:00
42e2dd2178 Fix some UI messages and update i18n spellcheck utils. 2020-12-21 10:49:33 +01:00
720b2c6655 install-deps: Install OIIO utils, re-enable package on RPMs.
OIIO utils are mandatory for a whole set of tests (Cycles, VSE), and
it's a small package, no reason to not install it.

Also re-enabling package handling of OIIO on RPM-based distro, not sure
why it was disabled but this has become a fairly stable and standard
library now, would not expect issues anymore.
2020-12-21 09:49:08 +01:00
Matt Hill
fdb7623e09 Unix/macOS: support building with Ccache
This adds an option (WITH_COMPILER_CCACHE) to build using Ccache if it's
found. Makefiles-based, Ninja-based and Xcode generators are supported.

Pass `-DWITH_COMPILER_CCACHE=ON` to cmake to enable Ccache.
Utility option in GNUmakefile is also added: for e.g.,
`make ninja ccache`.

Reviewed By: brecht, ankitm
Differential Revision: https://developer.blender.org/D9665
2020-12-21 10:47:35 +05:30
Garry R. Osgood
84cc00f3b6 Fix T83989: Attribute Math node ignores its operation setting
T83989 observes that the Attribute Math node always adds its
operands regardless of its operator setting. This was caused
by an oversight committed in rB23233fcf056e42, which overlooked
adjusting the exec function to use the new storage location.

Differential Revision: https://developer.blender.org/D9909
2020-12-20 18:46:24 -06:00
c229d9876b Cleanup: Correct comment 2020-12-20 18:42:35 -06:00
d283a093d6 fix T83880: Added check for valid context object to avoid null pointer exception when no object in scene 2020-12-20 18:48:40 +01:00
Yevgeny Makarov
478ba53270 UI: Fix text padding in some list widgets
Normally, pure text buttons have no padding at their edges so they
align with edges of buttons, see D9058. However, in several cases
there are labels aligned to the right side of a list widget row,
so they're missing padding against the right edge.

The fix is to use emboss = 'NONE' for such labels, which changes
the drawing style, adding padding on the right edge. (Normally so
labels aligned with the text from non-embossed buttons). This is
not necessarily intended, but it works properly.

For more information, see the revision.

Differential Revision: https://developer.blender.org/D9874
2020-12-20 11:27:02 -06:00
16527ebaba UI: Slightly improve alignment in selection tool icons
Parts of the tool icons for box, circle, lasso, and tweak select that were
meant to be flat or at a 45 degree angle were slightly misaligned, making
the edge look blurry.
2020-12-20 10:53:23 -06:00
Peter Fog
5a69f70751 VSE: Add options to select neighboring handles
Options added to `sequencer.select_handles()` operator.

Reviewed By: ISS

Differential Revision: https://developer.blender.org/D7707
2020-12-20 06:23:08 +01:00
Yevgeny Makarov
864c806863 UI: Reorder enums in render results image editor header
The convention is to put the label at the bottom of the enum, or in the
spot furthest away from the button. This commit reorders the items in
the "Slot", "Layer", and "Pass" menus to be consistent with this
convention. It also reorders the numbering so that higher numbers are
lower.

The original patch was by Adrian Newton (@TFS), with slight changes
and additions.

Differential Revision: https://developer.blender.org/D7142
2020-12-19 21:52:45 -06:00
38b77ef8b2 VSE: Remove cost calculation from cache
This value was meant to be used for keeping images that are slowest to
render in cache. Method of measurement was flawed, because it doesn't
take UI overhead into consideration.

Cache panel is to be removed because users should not have to tweak
settings like this. It is not useful for development either, therefore
it is removed completely.
2020-12-20 03:58:38 +01:00
c4ff91aab7 VSE: Fix incorrect cache memory usage calculation
If image is cached twice, it's size has been counted twice as well, but
only image reference count is increased, not memory usage.

Use `MEM_get_memory_in_use()` instead of size own tracking.
2020-12-20 03:51:56 +01:00
Aaron Carlisle
0144b70948 Movie Clip: Annotation UI Improvements
Previously, the Annotation panels were a bit buggy in the movie clip editor.
This commit fixes the issue of the panel in the sidebar would disappear
when selecting  "Tracks" if no tracks were added to the clip.
To solve this issue the user if given a label text saying "No annotation source"

This commit also removes some grease pencil operators from the toolbar
that do not work with the new annotation system.

This commit also moves the data source choice from the toolbar to the sidebar.
This is needed to migrate the current toolbar to the new tool system
(see T83612)

Some old invalid code was also removed.

Reviewed By: #grease_pencil, antoniov

Differential Revision: https://developer.blender.org/D9729
2020-12-19 14:49:38 -05:00
Aaron Carlisle
6538f1e600 Compositor: New Exposure Node
This new node increases the radiance of an image by a scalar value.
Previously, the only way to adjust the the exposure of an image was with
math node or using the scene's color management.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D9677
2020-12-19 14:41:14 -05:00
09be4a0917 Cleanup: Use typedef for UI emboss type enum
Previously both `char` and `int` were used to represent this enum.

Differential Revision: https://developer.blender.org/D9903
2020-12-19 10:07:20 -06:00
a5a302bd18 Cleanup: Split SEQ_sequencer.h file 2020-12-19 07:25:01 +01:00
046ca0749a Cleanup: Rename BKE_sequencer functions
API functions get SEQ_ prefix.
Intern functions get seq_ prefix

Functions also have appropriate category included in name.
2020-12-19 06:29:15 +01:00
6942dd9f49 Fix T83868: Button animation states no longer visible without emboss
This bug was caused by making it so that non-embossed modifier icon
buttons could become an operator button and retain their red highlight
for disabled modifiers. The icon button needs emboss turned off, but
in earlier versions of Blender, `UI_EMBOSS_NONE` would be overridden
by animation or red alert states.

Instead of abusing "NONE" to mean "none unless there is animation or
red alert", this commit adds a new emboss flag for that situation,
`UI_EMBOSS_NONE_OR_STATUS`, which uses no emboss unless there is an
animation state, or another status. There are only a few situations
where this is necessary, so the change isn't too big.

Differential Revision: https://developer.blender.org/D9902
2020-12-18 17:13:15 -06:00
002722bb80 Fix build error after previous commit
I tested building so many times while making this patch, but somehow
the previous commit was missing a padding variable, I have no idea how.
2020-12-18 17:08:49 -06:00
c106b07e23 Cleanup: Remove unused variables from the bNode struct
In some cases the variables were set but never used anywhere.

Differential Revision: https://developer.blender.org/D9889
2020-12-18 17:04:52 -06:00
6367bc716a Cleanup: Use true and false for booleans 2020-12-18 15:12:15 -06:00
e298339289 Cleanup: Declare variables where initialized
Also decrease scope of some variable declarations.
2020-12-18 12:39:50 -06:00
6be9747b96 Cleanup: Use bool instead of int 2020-12-18 12:12:32 -06:00
2250b5cefe UI: Redesigned data-block selectors
The previous design is rather old and has a couple of problems:

* Scalability: The current solution of adding little icon buttons next to the
  data-block name field doesn't scale well. It only works if there's a small
  number of operations. We need to be able to place more items there for better
  data-block management. Especially with the introduction of library overrides.
* Discoverability: It's not obvious what some of the icons do. They appear and
  disappear, but it's not obvious why some are available at times and others
  not.
* Unclear Status: Currently their library status (linked, indirectly linked,
  broken link, library override) isn't really clear.
* Unusual behavior: Some of the icon buttons allow Shift or Ctrl clicking to
  invoke alternative behaviors. This is not a usual pattern in Blender.

This patch does the following changes:

* Adds a menu to the right of the name button to access all kinds of operations
  (create, delete, unlink, user management, library overrides, etc).
* Make good use of the "disabled hint" for tooltips, to explain why buttons are
  disabled. The UI team wants to establish this as a good practise.
* Use superimposed icons for duplicate and unlink, rather than extra buttons
  (uses less space, looks less distracting and is a nice + consistent design
  language).
* Remove fake user and user count button, they are available from the menu now.
* Support tooltips for superimposed icons (committed mouse hover feedback to
  master already).
* Slightly increase size of the name button - it was already a bit small
  before, and the move from real buttons to superimposed icons reduces usable
  space for the name itself.
* More clearly differentiate between duplicate and creating a new data-block.
  The latter is only available in the menu.
* Display library status icon on the left (linked, missing library, overridden,
  asset)
* Disables "Make Single User" button - in review we weren't sure if there are
  good use-cases for it, so better to see if we can remove it.

Note that I do expect some aspects of this design to change still. I think some
changes are problematic, but others disagreed. I will open a feedback thread on
devtalk to see what others think.

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

Reviewed by: Bastien Montagne

Design discussed and agreed on with the UI team, also see T79959.
2020-12-18 18:28:04 +01:00
7bee1489c1 UI: Rename "Float Color" attribute data type to "Color"
Since "Float Color" is more commonly used than "Byte Color",
which is not exposed in the interface yet anyway, it makes sense to
drop the "Float" label on the color data type name.
2020-12-18 09:34:21 -06:00
3deb21055a Geometry Nodes: support randomly picking instances from collection
This uses the "id" attribute to randomly pick instances from a collection
for each point.

There is one issue. When the collection is updated (e.g. when an object is
added to it), the nodes modifier is not automatically updated. It seems
like we don't have the infrastructure to support this dependency yet.
The same issue exists in the Boolean modifier and with collision collections.
This should be solved separately soonish.

When "Whole Collection" is disabled, one direct child of the input collection
is instanced at each point. A direct child can be an object or a collection.

Currently, all objects are picked approximately equally often. In the future,
we will provide more control over which point gets which instance.

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

Ref T82372.
2020-12-18 16:02:23 +01:00
1be465cccb GPencil: Fix potential error in interpolate frame
As now it is using a duplicated frame, the untag must be done before copying the frames.
2020-12-18 15:57:19 +01:00
f3b50380f0 Fix T83916: Cannot drag link from socket if node is inside frame
Caused by rB7470c10601d0 where iterating nodetree nodes was changed from
backwards to forwards by mistake.

Maniphest Tasks: T83916

Differential Revision: https://developer.blender.org/D9890
2020-12-18 14:41:38 +01:00
Vincent Blankfield
95afc53604 Fix T83716: Dope Sheet, incorrect scaling of channel UI elements
Change the top coordinate of the animation channel list UI elements to
`rect->ymin` so they correctly span from `rect->ymin` to
`channel_height`.

Some buttons in the dope sheet channels didn't scale properly with the
`Keyframe Scale Factor` preferences setting. This was caused by using
the `ymid` value (`ymid = BLI_rctf_cent_y(rect) - 0.5f * ICON_WIDTH`) to
position the buttons that supposed to fill all vertical space in the
channel (with `channel_height` height). The `ymid` value is only
appropriate for the UI elements that with `ICON_WIDTH` height.

Maniphest Tasks: T83716

Reviewed by: sybren

Differential Revision: https://developer.blender.org/D9841
2020-12-18 14:13:52 +01:00
e5764013b0 Geometry Nodes: move Boolean node to mesh category
This node works on meshes specifically.
2020-12-18 13:33:24 +01:00
c5569ba140 Geometry Nodes: do not crash when there are undefined nodes
Undefined geometry nodes will just output a default value now.
2020-12-18 13:28:55 +01:00
79d6bd9a22 Functions: add generic pointer class for const pointers
This adds a GPointer class, which is mostly the same as GMutablePointer.
The main difference is that GPointer references const data, while GMutablePointer
references non-const data.
2020-12-18 13:28:55 +01:00
f43561eae6 Function Nodes: Input Vector
Ref: T82651

Normally people use "Combine XYZ" to input a vector, but it is more
interesting to have an explicit vector input.

So this is basically "Combine XYZ" without any input sockets, the values
are stored in the node itself.

Differential Revision: https://developer.blender.org/D9885
2020-12-18 13:03:27 +01:00
b342e089c3 Fix mistake in Bake Action discontinuity fix
Fix mistake in e5528904f1 where one change accidentally wasn't included
in the commit.
2020-12-18 13:02:28 +01:00
e5528904f1 Fix T83351: Baked object rotation has discontinuities
Fix Euler discontinuities in the Bake Action operator, by explicitly
using the previous Euler angles when converting from matrix to rotation.

This basically follows the same approach as used in e4ca1fc4ea, although
the Euler Discontinuity Filter also performs single-channel filtering which
the Bake Action operator doesn't.
2020-12-18 12:50:36 +01:00
fe5d2448c6 Fix T83494: Eevee clamp node incorrect when min > max.
In glsl the clamp function has undefined behavior when min > max. For
the clamp node this resulted in differences between cycles and eevee.
This patch adds the expected implementation for minmax.

The old clamp function is still used in cases where we know for certain
that the input values are correct (math node clamp option). GPU uses
optimized code and silicon in these cases.
2020-12-18 10:26:02 +01:00
ffb6648a97 Fix T83625: Shading attribute names cause compilation error.
Some GPU platforms don't support having more than one underscore in
sequence in an attribute name. This change will remove the underscore
as a possible character when encoding to save names.
2020-12-18 09:56:28 +01:00
4f9e21bdc9 Fix T82591: Performance regression when rendering at very high resolution
This patch introduces a partial update of GPUTexture. When rendering
a large image the GPUTexture could have been scaled. The old implementation
would rescale the image on CPU and create a new GPUTexture. This
resulted in flooding the PCI bus.

The new solution would only scale and upload the parts of the GPUTexture
that has been changed. It does this by keeping track of areas of 256x256
pixels. When something changes the tiles that cover that changes will be
rescaled and uploaded the next time the GPUTexture is requested.

Test situation: Default Cube, 4 samples, 19200x10800 tile size 512.

Blender 2.83.9: 4m27s.
Blender 2.91:   20+m (regression)
This patch:     1m01s.

There is still room for more optimizations:
* Reduce the time that an image is locked.
** Use task scheduling to update the tiles of an image.
** Generic optimization of the ImBuf scale method.

Maniphest Tasks: T82591

Differential Revision: https://developer.blender.org/D9591
2020-12-18 09:18:44 +01:00
095b693614 Outliner: Set active modifier on click
The outliner already expands the panel for the modifier you click on,
this just extends that idea to also set it active, which is consistent
with behavior of active and selected items elsewhere in Blender.
2020-12-17 23:35:05 -06:00
9dbc014af7 Cleanup: Various clang tidy warnings
There are more in the new mesh fairing code and in the poisson
distribution code, this commit doesn't fix those.
2020-12-17 22:53:47 -06:00
7d25139eaf Fix T82960: Inaccurate selection on collapsed outliner rows
After rB15083d9e1 the outliner tree is not rebuilt after expanding or
collapsing rows. Because the tree is no longer rebuilt the positions
and flags of the elements are not cleared when collapsing a row. This
caused hover highlights and selections on the collapsed child icons to
be incorrect in many cases.

For example, only the direct children of a collapsed element are drawn
inline. If any grandchild elements had been previously icon row flagged
they would continue to be evaluated as icon row elements despite being
hidden. In this case the x coordinates of the child and grandchild would
overlap causing selection to appear erratic.

Now the flags for inline row icons are explicitly cleared, which was
previously only done because the tree was rebuilt on collapsing rows.
2020-12-17 20:10:20 -07:00
7cbcfb7f49 Cleanup: Use LISTBASE_FOREACH macro in outliner code
No functional changes.
2020-12-17 19:59:49 -07:00
f880fe2d66 Fix T82288 Wintab walk navigation erratic.
Walk navigation relies on tablet data being set to detect if motion is
absolute. This patch sets tablet data in Ghost to dummy values when a
tablet pen is in range and not handled by Wintab processing.
2020-12-17 17:21:15 -08:00
Yevgeny Makarov
ef17fb2715 UI: Don't use abbreviations in label text
Expand abbreviations for words like "Bright" (instead of "Brightness"),
"Premul", "Lib", "Dir", etc.

Differential Revision: https://developer.blender.org/D9862
2020-12-17 19:06:21 -06:00
23233fcf05 Cleanup: Use abstraction for attribute math node input
Since creating the attribute node, a helper function has been added to
automatically get the input attribute or a constant value, depending on
the "input type" values for the node. This commit replaces the specific
implementation of that behavior with the new helper function.

The versioning is necessary since the node now has a "storage" struct.
2020-12-17 14:43:01 -06:00
b10d8e330e Cleanup: renaming and code deduplication for color space clarity in picker
Ref T68926
2020-12-17 20:08:58 +01:00
f193b1afb3 Color Management: use scene linear HSV for number buttons in color pickers
Previously these HSV values were in the color picking space, which meant the
relation to the scene linear RGB values was confusing.

The new situation:
* RGB number buttons: scene linear color space
* HSV number buttons: scene linear color space
* Picker widgets: color picking color space
* Hex: sRGB color space

Fixes T69562, T83853, Ref T68926
2020-12-17 20:08:58 +01:00
48ddb94a26 Geometry Nodes: Point separate and attribute compare nodes
This patch adds two related nodes, a node for separating points
and mesh vertices based on a boolean attribute input, and a node
for creating boolean attributes with comparisons.

See the differential for an example file and video.

Point Separate (T83059)
The output in both geometries is just point data, contained in the mesh
and point cloud components, depending which components had data in the
input geometry. Any points with the mask attribute set to true will be
moved from the first geometry output to the second. This means that
for meshes, all edge and face data will be removed. Any point domain
attributes are moved to the correct output geometry as well.

Attribute Compare (T83057)
The attribute compare does the "Equal" and "Not Equal" operations by
comparing vectors and colors based on their distance from each other.
For other operations, the comparison is between the lengths of the
vector inputs. In general, the highest complexity data type is used
for the operation, and a new function to determine that is added.

Differential Revision: https://developer.blender.org/D9876
2020-12-17 12:22:47 -06:00
Himanshi Kalra
e7b698327c Updated and extended Regression Testing frameworks (Gsoc 2020)
This revision contains the following changes-

  - Updated the existing testing framework for Modifiers for Regression
  Testing.
  - Tests for Physics modifiers and remaining Generate and Deform modifiers are added.
  - The existing `ModifierSpec` is updated with backward compatibility to support Physics Modifiers.
  - Now there is support for frame number and giving nested parameters for attributes.
  - Some Deform modifiers required Object Operators, e.g. "Bind" in Mesh Deform, so a new class was added to support that functionality.
  - A separate class for holding Particles System, they are tested by converting all the particles to mesh and joining it to the mesh they were added.
  - Updated the format to add tests for Bevel, Boolean and Operators as
  well.

Reviewed By: zazizizou, mont29, campbellbarton

Differential Revision: https://developer.blender.org/D8507
2020-12-17 20:58:20 +05:30
fed995ced5 Fix T83888: Ctrl F in Asset Browser crashes blender
In case of being in Asset browsing mode, the search field is located in
the header (RGN_TYPE_HEADER not RGN_TYPE_UI as for file browsing mode).
To be future proof, now iterate all regions and act if the
"filter_search" can be activated.

Maniphest Tasks: T83888

Differential Revision: https://developer.blender.org/D9882
2020-12-17 16:05:20 +01:00
3fc07d1e74 Fix T83886: Particle instance modifier broken
Caused by Caused by rB83980506957c.

Since above commit, the modifier was created with wrong initial values
[amount was 0.0 and offset was 1.0 -- instead of the other way around].

Since there is no way to fix existing files in a reasonable way I guess,
all we can do here is to make sure that from now on, the defaults are
correct.

Maniphest Tasks: T83886

Differential Revision: https://developer.blender.org/D9881
2020-12-17 16:00:18 +01:00
c9f8f7915f Geometry Nodes: Make random attribute node stable
Currently, the random attribute node doesn't work well for most
workflows because for any change in the input data it outputs
completely different results.

This patch adds an implicit seed attribute input to the node, referred
to by "id". The attribute is hashed for each element using the CPPType
system's hash method, meaning the attribute can have any data type.
Supporting any data type is also important so any attribute can be
copied into the "id" attribute and used as a seed.

The "id" attribute is an example of a "reserved name" attribute,
meaning attributes with this name can be used implicitly by nodes like
the random attribute node. Although it makes it a bit more difficult
to dig deeper, using the name implicitly rather than exposing it as an
input should make the system more accessible and predictable.

Differential Revision: https://developer.blender.org/D9832
2020-12-17 07:43:31 -06:00
a9edf2c869 Geometry-Nodes: Point Distribute - Sockets Renaming
The size of the nodes is not enough to give enough context to users what
the sockets are about.

Minimum Distance -> Distance Min
Maximum Density -> Distance Min

Note this does not handle doversion. That means users will have to
manually.
2020-12-17 14:31:41 +01:00
9258b70453 Explicitly link X11 libraries
Fix X11 library underlinking, which was breaking Debian and Ubuntu
packages.

From Ubuntu Hirsute changelog:

```
blender (2.83.5+dfsg-4ubuntu1) hirsute; urgency=medium

  * Try to also link ghost library with x11, needed because of missing
    XConvertSelection symbol link (used in ghost static library).
  * Don't use gold, but switch to bfd linker that seems to be working better
    on ppc64el.

 -- Gianfranco Costamagna <locutusofborg@debian.org>  Wed, 11 Nov 2020 14:17:29 +0100
```

Reviewed by: sybren

Differential Revision: https://developer.blender.org/D9617
2020-12-17 13:24:35 +01:00
cf2ebaf27c Fix T83875: Converting Proxy to override crashes blender.
Some weird proxies apparently can have a local collection instancing...
Not sure this is even really valid for proxies, but in any case we
cannot override that, just detect and properly cancel the operation
then.

Should be backported to 2.91.1 should we do it.
2020-12-17 12:05:30 +01:00
0eedba328d Geometry Nodes: add Attribute Color Ramp node
Differential Revision: https://developer.blender.org/D9861

Ref T82585.
2020-12-17 11:56:18 +01:00
2945c1e3e5 Fix asset data-block name button not showing up in custom repositories
The Python syntax was wrong, as noted by Campbell in 0ae15e68c7.
2020-12-17 11:39:45 +01:00
6203a3ee68 Fix T83878: Crash right-clicking in Asset Browser with no asset active
Data of the File Browser context callback needs to be validated and
return `CTX_RESULT_NO_DATA` if the context member is valid but not set
in the current context.
2020-12-17 11:24:08 +01:00
7e535499d5 Clean-up: Fix build warning with MSVC
Callback function was using int while update_render_passes_cb_t was
using eNodeSocketDatatype leading to a build warning about different
argument types with MSVC.
2020-12-16 21:03:42 -07:00
8df6589585 VSE: Fix crash when adding image strip
Crash happens when using relative path to image in operator properties
and checking image dimensions by loading image with `IMB_loadiffname()`

Ensure path is absolute.
2020-12-17 02:32:24 +01:00
d11b219d40 Fix T83869: Crash when creating Sequencer in new scene
Crash on null dereference in `SEQ_timeline_boundbox()`. This function was
generalized in rB9e4a4c2e996c to work on arbitrary `seqbase`.

Fixed by refactoring `SEQ_timeline_boundbox()` functions to return default
sane values if `seqbase` is `NULL`

Reviewed By: HooglyBoogly

Differential Revision: https://developer.blender.org/D9878
2020-12-17 02:19:34 +01:00
3a1d1aaa86 Synchronize Wintab and Win32 time.
Time is synchronized by the difference between the WT_PACKET receive
time and the last received PACKET's pkTime. This is used to prevent
Wintab packets from being prematurely expired.
2020-12-16 15:32:18 -08:00
9f588432e9 Fix T83861: Snapping panel from shortcut dissapears after click
This simple change sets the call_panel operator's "keep_open" property
to True for the viewport snapping panel called with `ctrl-shift-tab`.
There are quite a few settings in this panel, it often makes sense to
change more than one of them at a time, especially because multiple
snap elements can be active at the same time.
2020-12-16 14:40:30 -06:00
07c4615431 Fix T83856: Sculpt: anchored brushes with spherical falloff ignore topology automasking
Anchored brushes with spherical falloff start off with zero radius, thus
we have no pbvh nodes on the first brush step. This would prevent
initializing the automasking cache [which only happens on the first brush
step].

Maniphest Tasks: T83856

Differential Revision: https://developer.blender.org/D9873
2020-12-16 21:36:15 +01:00
247b10e6a2 Fix sequencer transform test failing
This was casued by incorrect versioning keyframe conversion in
recent commit 5713626422.
2020-12-16 21:28:01 +01:00
Gaia Clary
ad7682ffdb Allow vertex tools to operate on weight groups when armature is in object mode
Since a few versions (even before 2.79) we have an option that allows to restrict the vertex tools to operate only on deform groups. This was originally implemented for working with vertex groups for skeletal animation. In that case it is fortunate to have weight tools operate only on deforming vertext groups (vgroups assigned to bones)

In previous versions of Blender (up to 2.79) we have been able to use this option in Mesh Edit mode regardless of the armature mode. The current implementation (since 2.80 as far as i know) enables this option only when the associated armature is in pose mode. this has a bad consequence:

It is not at all intuitive that you have to put the armature into Pose mode before you can make use of the option in mesh edit mode.
Besides this it is not even necessary in the case when the user wants to restrict the tool only to all pose bones. In that case the armature can safely be kept in Object mode. However, when the tool shall apply only to selected pose bones, then it actually makes sense to have the armature in pose mode (as it is implemented right now)

I do not know why this feature has been restricted as described above. It must have got lost somewhere on the way to Blender 2.90

This patch fixes the issue as it allows to select the "restrict to pose bones" option when the armature is in any mode. I see no downsides of this change, actually this is a fix for a feature that once worked and apparently got forgotten in newer releases.

Reviewed By: sybren, campbellbarton

Differential Revision: https://developer.blender.org/D9658
2020-12-16 20:46:50 +01:00
5713626422 VSE: Improve motion-picture workflow
This commit resolves problem introduced in e1665c3d31 - it was
difficult to import media at their original resolution.
This is done by using original resolution as reference for scale.

All crop and strip transform values and their animation is converted
form old files.

To make both workflows easy to use, sequencer tool settings have been
created with preset for preffered scaling method. This setting is in
sequencer timeline header and add image or movie strip operator
properties.

Two new operators have been added:
`sequencer.strip_transform_fit` operator with 3 options: Scale To Fit,
Scale to Fill and Stretch To Fill.
Operator can fail if strip image or video is not loaded currently, this
case should be either sanitized or data loaded on demand.

`sequencer.strip_transform_clear` operator with 4 options:
Clear position, scale, rotation and all (previous 3 options combined).

Reviewed By: sergey, fsiddi

Differential Revision: https://developer.blender.org/D9582
2020-12-16 20:38:28 +01:00
9d15226383 Ghost/Linux: Avoid error print if special directory can't be determined
The function is supposed to fail gracefully if there is some error. That
includes not being able to find `xdg-user-dir`. So don't let the error
be printed to the console, it's misleading/annoying.
From what I can tell we'll detect that problem fine and return NULL
then.
2020-12-16 20:36:37 +01:00
a8da70f70a Geometry Nodes: Add boolean attribute in utility function
This follows up rBc484b54453e607, adding the boolean custom property
data type in one more place that was missed.
2020-12-16 12:50:45 -06:00
c484b54453 Geometry Nodes: Boolean attribute type
This adds a boolean attribute and custom data type, to be used in the
point separate node. It also adds it as supported data types in the
random attribute and attribute fill nodes.

There are more clever ways of storing a boolean attribute that make
more sense in certain situations-- sets, bitfields, and others, this
commit keeps it simple, saving those changes for when there is a proper
use case for them. In any case, we will still probably always want the
idea of a boolean attribute.

Differential Revision: https://developer.blender.org/D9818
2020-12-16 12:33:13 -06:00
c06c5d617a Cleanup: Replace mempcpy with memcpy
There is no need of using mempcpy here, memcpy is enough.

Note: This also fix building in Windows which was broken since a7628ec22a.
2020-12-16 18:02:55 +01:00
ebd8a703cc Fix T83851: Python: operator macros cause a crash
Caused by rB7447eb7e7430.

This is just a copy-paste error [previous LISTBASE_FOREACH substitution
of marco loop in that file has a different starting point which is not
appropriate here]

Maniphest Tasks: T83851

Differential Revision: https://developer.blender.org/D9872
2020-12-16 17:16:01 +01:00
a7628ec22a Geometry Nodes: Poisson disk point distribution node/method
This patch does two things:
* Introduce a Seed to the random distribution method
* Bring in a new distribution method for the point scattering node

Patch Review: https://developer.blender.org/D9787

Note: This commit doesn't not handle doversion. Which means that users
need to manually update their files that were using the Point Distribute
node and reconnect inputs to the "Maximum Density" socket.

Original patch by Sebastian Parborg, with changes to not rely on the cy
libraries and overall cleanup.

Patch review by Jacques Lucke, besides help with the new "heap" system
that was required for this algorithm.

Based on Cem Yuksel. 2015. Sample Elimination for Generating Poisson Disk
Sample. Sets. Computer Graphics Forum 34, 2 (May 2015), 25-32
http://www.cemyuksel.com/research/sampleelimination/
2020-12-16 17:13:46 +01:00
Pablo Dobarro
d23894d3ef Sculpt: Multires Displacement Smear
This tool implements smearing for multires displacement over the limit
surface, similar to how smearing for colors and topology slide works.
When used the displacement values of the vertices "slide" over the
topology, creating the effect of smearing the surface detail.

As the brush just modifies displacement values instead of coordinates,
the total displacement of the affected area doesn't change. This means
that this smearing effect can be used multiple times over the same area
without generating any artifacts in the topology.

When the brush is used with the pinch or expand smear modes,
displacement differences are pushed into the same area, creating hard
surface effects without pinching the topology.

As any other brush that relies on the limit surface (like displacement
erasers), this will work better after using apply base.

Reviewed By: sergey, JulienKaspar, dbystedt

Differential Revision: https://developer.blender.org/D9659
2020-12-16 17:08:19 +01:00
f3ab123e33 Cleanup: Remove unused crop field from RenderResult.
The `crop` field was used by Blender Internal to do an overscan per
tile and merge it back to the render result.
2020-12-16 16:54:24 +01:00
5c5550f7b8 Asset Browser: For assets without preview, show type icon in sidebar
Otherwise it would just show empty space where the icon is supposed to
be.
Unfortunately this icon is upscaled quite a bit and doesn't look too
great. Would be good to improve but not a high priority.
2020-12-16 16:38:56 +01:00
7ed69bd672 Fix T83843: Crash in Asset Browser sidebar with geometry asset selected
No icon should be created if the preview doesn't exist.
2020-12-16 16:38:56 +01:00
4463087223 BLI: remove implicit casts between some span types
Casting pointers from one type to another does change the
value of the pointer in some cases. Therefore, casting a span
that contains pointers of one type to a span that contains
pointers of another type, is not generally safe. In practice, this
issue mainly comes up when dealing with classes that have a
vtable.

There are some special cases that are still allowed. For example,
adding const to the pointer does not change the address.
Also, casting to a void pointer is fine.

In cases where implicit conversion is disabled, but one is sure
that the cast is valid, an explicit call of `span.cast<NewType>()`
can be used.
2020-12-16 16:00:17 +01:00
684c771263 Fix: Python warning in windows debug builds
When doing a debug build on windows, blender will
start with the following warning:

"Unable to find the python binary, the multiprocessing
module may not be functional!"

The root cause for this issue is: for a debug build
the python binary is called python_d.exe rather than
just python.exe

This change fixes BKE_appdir_program_python_search
to look for the _d suffix for debug builds on windows

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

Reviewed by: Campbell Barton
2020-12-16 07:27:47 -07:00
25543e6983 LibOverride: Better handling of missing linked data during resync.
We do not generate overrides for missing data-blocks (aka placeholder
ones) anymore, and properly delete the remaining old overrides of those
during the resync process.

This should prevent constant 'missing data-blocks' messages when opening
blend files with overrides whose libraries have beed edited.

Issue reported by @andy from Blender studio, thanks.
2020-12-16 15:12:56 +01:00
8d590e4b86 Fix T83801: UVEditor translation ignores "Pixel Coordinates" and aspect
ratio

Caused by rB4eda60c2d82d.

T83801 reported not moving in pixel space, but even without that toggle
above commit caused the translation to not take apsect ratio into
account properly [a translation of 1 on the x axis for example on an
image with non 1:1 aspect ration caused the UVs to not end up in the
same place on the next 'tile']

Above commit removed 'removeAspectRatio()' [the counterpart of
applyAspectRatio -- which does the pixel coord correction internally]
from 'applyTranslation()'.

This was also reported in T83352 [which was closed by rBf3b08af24c9f --
but that only solved the displax in header, not the actual
transformation]

Now bring back 'removeAspectRatio()'.

Maniphest Tasks: T83801

Differential Revision: https://developer.blender.org/D9869
2020-12-16 15:03:46 +01:00
8da62a9a86 Fix T83547: UV Editor stitching preview is gone.
Issue was related that the draw manager didn't invoked the draw handlers
for image editors.
2020-12-16 15:02:48 +01:00
245450b144 Fix exported keymaps loading in 2.91 and older
The generated keymaps used a keyword argument that doesn't exist
in older Blender versions.
2020-12-17 00:53:28 +11:00
Valdemar Lindberg
69c3f4a46d Fix 3D View is red when using stereo
Fix T83415: 3D View is red when using stereo

The red view was caused by SRGB not being enabled for an SRGB texture attached to the framebuffer.
Currently, when configuring a framebuffer, the first texture attachment needs to be an SRGB format in order for the framebuffer to be binded with SRGB enabled.
Thus, simply changing the SRGB texture attachment as the first texture attachment removes the red color in the view.

Reviewed By: #eevee_viewport, jbakker

Maniphest Tasks: T83415

Differential Revision: https://developer.blender.org/D9845
2020-12-16 14:21:51 +01:00
29f923b27c Fix T83557: Alpha blend + emissive colors renders white artifacts
Issue was that not all code paths were taken to determine if
the GPU Texture was premultiplied or not. In this case the result
was set to unpremultiplied what is incorrect.

This fixes broken test case image alpha blend from image_colorspace.
2020-12-16 13:57:28 +01:00
4c26dd430d Geometry Nodes: rename node to Attribute Randomize
Previously, the node was called Random Attribute. For consistency reasons,
we move the "Attribute" part of the name to the front.
2020-12-16 13:31:56 +01:00
985d673374 BLI: add new InplacePriorityQueue data structure
This data structure adds priority queue functionality to an existing array.
The underlying array is not changed. Instead, the priority queue maintains
indices into the original array.

Changing priorities of elements dynamically is supported, but the priority
queue has to  be informed of such changes.

This data structure is needed for D9787.
2020-12-16 12:19:17 +01:00
Eric Cosky
4f128269b2 Fix possible crash with custom (add-on defined) icons
This change is a simple null check on the ID provided to icon_set_image() which
appears to be a legitimate value for the ID when used by some addins
(discovered with PowerSave shortly after syncing to main).

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

Reviewed by: Julian Eisel
2020-12-16 12:13:49 +01:00
3fc9fc1cb4 UI: Indicate asset data-blocks with an icon in Outliners & search menus
It's useful to easily see which data-blocks are assets and which not. So just
like we usually show the library linking/override icons, we show the asset icon
there (these are mutually exclusive data-block states).

Uses the `'MAT_SPHERE_SKY` icon, which wasn't used before (except by an
add-on!) and is sorta fitting, but not quite. We should either change this one
or add an own asset icon. Meanwhile this isn't too bad :)

Also adds an internal macro to check if a data-block is an asset, consistent to
how we do it for libraries and library overrides.
2020-12-16 12:10:58 +01:00
58d818f8be Assets: Add operator & button to regenerate the automatic preview
This makes it possible to trigger a refresh of the data-block preview,
available next to the preview in the Asset Browser sidebar. The previews get
easily outdated and automatically refreshing it all the time is not an option
because it would be a consistently running, quite expensive process. So a
button to cause a refresh should be reasonable.

This button can also be used to switch back from a custom preview to a
generated one. Although that may not be clear, and we should probably think of
a way to explain that better.

Addresses T82719.
2020-12-16 12:10:58 +01:00
c7a500e3a0 Asset Browser UI: Changes to the sidebar layout
The current layout wasn't great at all, and it was planned to polish this. This
does a first round of improvements, some more tweaking may follow.
* Place name button at the top, with no panel and no leading label.
* Add "Preview" panel, people may not want to see the preview all the time,
  it's already visible in the file list.
* Move button to browse for a custom preview to the right of the preview, as
  icon-only. We have a similar layout in other places (UI-lists, matcaps).
* Don't make the details panel a sub-panel. Looked weird because the parent
  doesn't have a header.
* Add info icon to "No asset selected", looks a bit friendlier.
* Minor cleanups in the UI script.

Based on designs and feedback by William Reynish.
2020-12-16 12:10:58 +01:00
19fc30c15f Assets UI: Tweak position of the "Add Asset Library" icon-button in Preferences
It's weird to have a button that adds a new item at the bottom be placed at the
top. So rather move it below the list of custom asset library paths.
2020-12-16 12:10:58 +01:00
0ae15e68c7 Asset Browser: Allow renaming asset data-blocks from the sidebar directly
This is something we wanted to support doing. It's confusing if users see the
name but it's always grayed out. So be convenient and avoid the confusion.
2020-12-16 12:10:58 +01:00
055ef5df61 Cleanup: Rename Asset Browser context member from "active_id" to "id"
This is the same name we use elsewhere for the focused/active ID context
member, so this should follow it.
2020-12-16 12:10:58 +01:00
Nathan Letwory
975ca91939 Steam Release: Script creation of Steam build files
Script tool for automation of Steam build files for tasks like {T77348}

This script automates creation of the Steam files: download of the archives,
extraction of the archives, preparation of the build scripts (VDF files), actual
building of the Steam game files.

Requirements
============

* MacOS machine - Tested on Catalina 10.15.6. Extracting contents from the DMG
  archive did not work Windows nor on Linux using 7-zip. All DMG archives tested
  failed to be extracted. As such only MacOS is known to work.
* Steam SDK downloaded from SteamWorks - The `steamcmd` is used to generate the
  Steam game files. The path to the `steamcmd` is what is actually needed.
* SteamWorks credentials - Needed to log in using `steamcmd`.
* Login to SteamWorks with the `steamcmd` from the command-line at least once -
  Needded to ensure the user is properly logged in. On a new machine the user
  will have to go through two-factor authentication.
* App ID and Depot IDs - Needed to create the VDF files.
* Python 3.x - 3.7 was tested.
* Base URL - for downloading the archives.

Reviewed By: Jeroen Bakker

Differential Revision: https://developer.blender.org/D8429
2020-12-16 11:15:18 +01:00
9cbfcc4af5 Revert "Steam Release: Script creation of Steam build files"
This reverts commit 1a375d6ece.
2020-12-16 11:11:15 +01:00
Nathan Letwory
1a375d6ece Steam Release: Script creation of Steam build files
Script tool for automation of Steam build files for tasks like {T77348}

For in-depth information see the README.

Related Wiki page: https://wiki.blender.org/wiki/Process/Release_On_Steam

Reviewed By: jbakker

Maniphest Tasks: T77348

Differential Revision: https://developer.blender.org/D8429
2020-12-16 11:07:10 +01:00
d23a5b1d88 BLI: constexpr Span, IndexRange, StringRef(Null/Base)
Motivated by `std::string_view` being usable in
const (compile-time) context.
One functional change was needed for StringRef:
`std::char_traits<char>::length(str)` instead of `strlen`.

Reviewed By: JacquesLucke, LazyDodo
Differential Revision: https://developer.blender.org/D9788
2020-12-16 13:03:46 +05:30
e671c548e6 Cleanup: pep8 2020-12-16 18:02:40 +11:00
Vincent Blankfield
f34ca933a8 UI: include the category for add-ons search
This lead to some confusion, see T83747.

Now the category is included in the search when the category is "All".

Ref D9848
2020-12-16 16:35:26 +11:00
a869a61c88 Cleanup: sort struct blocks 2020-12-16 16:26:23 +11:00
b347c4e9ca Cleanup: remove redundant struct declarations 2020-12-16 16:25:56 +11:00
588f107f11 Cleanup: clang-format 2020-12-16 16:13:05 +11:00
87fdb71438 Cleanup: use static declarations 2020-12-16 16:12:50 +11:00
977bd7937a Fix warnings introduced in previous commit 2020-12-16 00:20:20 +01:00
Peter Fog
fad80a95fd VSE: Add Overlay popover panels
Add panels with overlay settings for strips and preview and overlay
enable/disable button.

Entries from the View menus moved to the overlay panels, which will
simplify cluttered View menus.

Additional options have been added:
 - Strip Name
 - Strip Source(ex. path)
 - Strip Duration

So users can now select what info they need to see on the strips. When
No text is displayed, waveforms are drawn in full height.

Reviewed By: ISS, HooglyBoogly, pablovazquez

Differential Revision: https://developer.blender.org/D9751
2020-12-15 23:50:18 +01:00
Peter Fog
f44dea0558 VSE: Reorder Tools in Sequencer/Preview
When in Sequencer/Preview mode, the Sampler was on top, which normally
is the place of Select, and Annotation seems to be after Sampler in the
bottom in the various editors.

Reviewed By: ISS

Differential Revision: https://developer.blender.org/D9821
2020-12-15 22:30:01 +01:00
Peter Fog
dd9d12bf45 VSE: Paste strips after playhead by default
Paste copied strips after playhead, because this is more intuitive.

Previous functionality is still available by enabling "Keep Offset"
property, or under shortcut Ctrl+Shift+V.

Reviewed By: ISS

Differential Revision: https://developer.blender.org/D9734
2020-12-15 22:30:01 +01:00
Falk David
151e847b87 GPencil: Improve interpolation of strokes with unequal lengths
Use the BKE_gpencil_stroke_uniform_subdivide function to subdivide strokes
before interpolation. When the target/source stroke is smaller than the other
stroke, it is subdivided until the lengths match. This improves the overall quality
of the interpolation of different sized strokes.

Before/After video:
{F9511779}

Reviewed By: #grease_pencil, antoniov, pepeland, mendio

Differential Revision: https://developer.blender.org/D9839
2020-12-15 22:29:21 +01:00
Cody Winchester
5535b0b887 GPencil Array - Add option for uniform random scaling
This patch adds the option to make the random scaling from the grease pencil array modifier uniform.
The current settings allow a separate value for each of the 3 scaling axis. The modifier also creates different seed values for each axis so there is no way to keep the random scaling uniform.
This patch creates 1 random seed value and applies it to each of the scaling axis.

Here is a demonstration of the previous behavior and the new optional behavior.
{F9485973}
{F9485981}

{F9485798}

Reviewed By: #grease_pencil, antoniov, pepeland

Differential Revision: https://developer.blender.org/D9764
2020-12-15 22:16:49 +01:00
9e4a4c2e99 VSE: Move remove gaps operator logic to module code
Logic was broken into finding gaps and ofsetting strips.
Functions were modified so they work on explicitly defined seqbase,
so they can be used as python API functions.

Functional changes:
 - Improve performance by calculating gap length and offseting strips
   at once. Previously strips were offset by one frame.
 - Calculate gap from start frame. Previously gap was considered only
   inbetween strips.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9730
2020-12-15 21:49:15 +01:00
7e8f6985d8 Fix crash selecting custom asset preview from maximized File Browser
If Preferences > Interface > Temporary Editors > File Browser is set to
"Maximized Area", "Load Custom Preview" in the Asset Browser would crash
after selecting the file.

1e799dd26e was important to get this issue fixed. This commit just
ensures the file-list is recreated correctly after closing the temporary
File Browser, so the custom preview operator can execute on valid
context.
2020-12-15 21:31:45 +01:00
1e799dd26e Fix various issues with temporary, maximized File Browsers
If Preferences > Interface > Temporary Editors > File Browser is set to
"Maximized Area", opening a File Browser from a File or Asset Browser as
regular editor would cause some issues. For example after closing the
temporary File Browser, the regular browser would take over the file
path and display settings from the temporary one. This is because they
used to share the same area data.

Some similar issues may have happend with temporary image editors.

Now, this commit finally separates the space data of temporary maximized
editors from the regular ones. So the editor data is entirely
independent now, as it should be.
2020-12-15 21:31:33 +01:00
c9b4d75336 Sculpt: Fair Face Sets operation for Face Set Edit
This implements a mesh fairing algorithm and implements the fair
operations for Face Set edit. This edit operations create a smooth as
possible geometry patch in the area of the selected Face Set.

The mesh fairing algorithm is designed by Brett Fedack for the addon
"Mesh Fairing": https://github.com/fedackb/mesh-fairing, with some
modifications:

- The main fairing function in BKE_mesh_fair.h does not triangulate
 the mesh. For the test I did in sculpt mode results are good enough
 without triangulating the topology. Depending on the use and the
 result quality needed for a particular tool, the mesh can be
 triangulate in the affected area before starting fairing.

- Cotangents loop weights are not implemented yet. The idea is to
also expose the vertex and loop weights in a different function in
 case a tool needs to set up custom weights.

This algorithm will also be used to solve the limitations of line
project and implement the Lasso Project and Polyline Project tools.
It can also be used in tools in other areas of Blender, like Edit Mode
or future retopology tools.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D9603
2020-12-15 20:32:58 +01:00
288f2efbd4 Fix T83504: Cancel trim operators when there is no geometry
The boolean solver crashes when there is no geometry in the mesh. Also,
using the trimming tools without a valid intersection in the PBVH will
make the orientation and position functionality of the trimming shape
not work, so this is the safer solution.

Reviewed By: mont29

Maniphest Tasks: T83504

Differential Revision: https://developer.blender.org/D9777
2020-12-15 20:23:17 +01:00
c9de65679b Fix T83201: Cloth brush performance regression
The if statement of the dynamic area mode branch should be an else if.
When using local mode, this was running both the local and global code.

I moved this code to sculpt_cloth and refactored it to use a switch case
to prevent this from happening again.

Reviewed By: mont29

Maniphest Tasks: T83201

Differential Revision: https://developer.blender.org/D9762
2020-12-15 20:22:26 +01:00
26e9c2147e Blenloader: Add utility function to write double array
It makes sense to support writing double arrays just like floats.
This is just split from a patch (D9697) to slim it down some.
2020-12-15 12:43:21 -06:00
d59e87acf0 Cleanup: Use nullptr instead of NULL in C++ code 2020-12-15 12:41:41 -06:00
8df167873a Cleanup: Clang tidy else after return 2020-12-15 12:39:27 -06:00
3834dc2f7b Fix Adjust Last Operation popup for operators relying on button context
This was reported for duplicating particle systems, then using F9 to
enable the 'Duplicate Settings' option (see T83317).
In this case, the operator gets the particle_system from (buttons)
context and if none can get found will duplicate all settings instead.

The reason why none gets found here is that buttons_context() doesnt
have a valid path when called from F9/SCREEN_OT_redo_last, path is
cleared when global undo does a file-read which clears the path (see
lib_link_workspace_layout_restore). It can be recomputed though to be
valid even from redo_last (at least when in the Properties Editor).

This was likely causing other operators (relying on buttons context)
from the Properties Editor to fail as well.

Fixes T83317

Maniphest Tasks: T83317

Differential Revision: https://developer.blender.org/D9825
2020-12-15 19:10:35 +01:00
ffe63b0440 Fix crash opening maximized File Browser from Asset Browser
If Preferences > Interface > Temporary Editors > File Browser is set to
"Maximized Area", opening a File Browser from an Asset Browser would
cause the new maximized editor to be an Asset Browser. Exiting it again
would crash.

This fixes the wrong behavior and the crash. There's still an issue with
exiting the editor again, it stays a File Browser then and doesn't go
back to being an Asset Browser. That's to be fixed separately.
2020-12-15 18:56:26 +01:00
b24712a9ca Fix (studio-reported) broken handling of relative font paths.
`blf_dir_search` BLF util would not properly handle relative fonts not
found in pre-defined 'system fonts' directoriesi stored in
`global_font_dir` global variable.

Now it rebases relative paths to current .blend file location as
expected.

Note: the fact that VSE is setting font ptaths relative by default is
probably not actually desired, but this is another issue really. See
`BKE_sequencer_text_font_load` code.
2020-12-15 18:22:22 +01:00
c6692014cf Fix redundant declaration warning
Function was declared twice (caused by merge conflicts) which GCC would
rightfully complain about.
2020-12-15 17:19:55 +01:00
990406e1ff Fix crash when deleting/renaming asset library while it's visible
Storing the asset library reference by name wasn't a good idea, I thought it
would work with a careful fallback, but it's easier to just use the index
instead. So change to using indices, make sure fallback methods work reliable
and make sure the file list is updated when asset libraries are removed.

I added a new notifier type for the latter, I prefer not using file notifiers
in asset-library/preferences code. We have more than enough values for
notifiers left.
2020-12-15 17:03:49 +01:00
7dc8db7cd1 Fix failing assert when generating material preview
The `!BKE_previewimg_is_finished()` in `icon_preview_startjob_all_sizes()`
would fail.

Caused by 990bd9acf243ae. We have to be more picky about tagging previews as
unfinished after file read. But we also have to consider files stored in old
versions and set the unfinished tag as needed.
2020-12-15 17:03:49 +01:00
9caeb9dfc7 Fix Asset Browser crash with undo in "Current File" library with sidebar
When the Asset Browser was showing the "Current File" repository and the
sidebar was open, undoing could crash, because the context API returned freed
data.

Don't let context return anything if a refresh is pending due to data changes
like undo/redo.
2020-12-15 17:03:49 +01:00
68e4a90240 Assets: Better path for the default asset library
In D9722 we agreed on using `[home-directory]/Documents/Blender/Assets` for
the default asset library. I just forgot to do the change before committing.

(The default repository is just a named path, it's *not* a default library with
bundled assets.)
2020-12-15 17:03:48 +01:00
303aceb917 Fix asset previews not showing in "Current File" repository after reading
Previews would be flagged as unfinished when reading. Instead clear the flag
and always consider them finished upon reading. If we wouldn't do this, the
File Browser would keep running the preview updating to wait for the preview to
finish. It could be smarter and also check if there's actually a preview job
running.
Instead, I think it will just display an unfilled buffer for now. Up until
today we wouldn't even know if a stored preview is finished or not, so it would
always assume they are finished. We do the same now, but have the option to
make it smarter.
2020-12-15 17:03:48 +01:00
2d6a69ae4e Asset System: New Asset Browser editor
This introduces the User Interface part of the Asset Browser, based on the
design in T54642.

Additions:
* New Asset Browser (internally a sub-editor of the File Browser).
* Navigation region showing asset categories.
* Main region showing the assets of the selected asset library with previews.
  The assets may be stored over multiple .blends in the directory that's
  "mounted" as asset library in the Preferences. They will all be shown in this
  list.
* Header with an asset library dropdown, allowing to choose the active asset
  library to show. Options are the "Current File" as asset library and all
  custom libraries.
* Display popover, filter popover and search box (partially dummies, see
  T82680).
* Sidebar showing the metadata of the currently active file (name, preview,
  description and tags), which can be edited for assets in the "Current File"
  asset library. (For others it will reset on reload.)
* The sidebar includes a button to load a custom preview image from a file.
* Make asset files draggable (with preview image).
* If a library with invalid path is selected, a message is drawn in the main
  region to help the user understand what's wrong.
* Operators to add and remove asset tags. Exposed in the sidebar.
* "Only Assets" option for Link/Append.
* Internal utilities for asset UI scripts.

For screenshots or demo videos, please see D9725. Or the 2.92 release notes.

Note that there are many things to be tweaked and polished in the Asset Browser
UI still. For example, the filter and display popovers are mostly dummies. See
T82680.

Part of the first Asset Browser milestone. Check the #asset_browser_milestone_1
project milestone on developer.blender.org.

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

Reviewed by: Brecht Van Lommel, Hans Goudey
2020-12-15 17:03:48 +01:00
70474e1a7c Asset System: Prepare File Browser backend for the Asset Browser
The Asset Browser will be a sub-editor of the File Browser. This prepares the
File Browser code for that.

**File-Lists**
* Support loading assets with metadata read from external files into the
  file-list.
* New main based file-list type, for the "Current File" asset library.
* Refresh file-list when switching between browse modes or asset libraries.
* Support empty file-lists (asset library with no assets).
* Store file previews as icons, so scripts can reference them via icon-id. See
  previous commit.

**Space Data**
* Introduce "browse mode" to differeniate between file and asset browsing.
* Add `FileAssetSelectParams` to `SpaceFile`, with `FileSelectParams` as base.
  Makes sure data is separated between asset and file browsing when switching
  between them. The active params can be obtained through
  `ED_fileselect_get_active_params()`.
* `FileAssetSelectParams` stores the currently visible asset library ID.
* Introduce file history abstraction so file and asset browsing can keep a
  separate history (previous and next directories).

**General**
* Option to only show asset data-blocks while file browsing (not exposed here).
* Add "active_file" context member, so scripts can get and display info about
  the active file.
* Add "active_id" context member, so `ED_OT_lib_id_load_custom_preview` can set
  a custom ID preview. (Only for "Current File" asset library)
* Expose some of `FileDirEntry` in RNA as (non-editable). That way scripts can
  obtain name, preview icon and asset-data.

Part of the first Asset Browser milestone. Check the #asset_browser_milestone_1
project milestone on developer.blender.org.

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

Reviewed by: Bastien Montagne
2020-12-15 17:03:48 +01:00
e413c80371 Asset System: Support custom asset library paths through Preferences
One of the core design aspects of the Asset Browser is that users can "mount"
custom asset libraries via the Preferences. Currently an asset library is just
a directory with one or more .blend files in it. We could easily support a
single .blend file as asset library as well (rather than a directory). It's
just disabled currently.

Note that in earlier designs, asset libraries were called repositories.

Idea is simple: In Preferences > File Paths, you can create custom libraries,
by setting a name and selecting a path. The name is ensured to be unique. If
the name or path are empty, the Asset Browser will not show it in the list of
available asset libraries.
The library path is not checked for validity, the Asset Browser will allow
selecting invalid libraries, but show a message instead of the file list, to
help the user understand what's going on.
Of course the actual Asset Browser UI is not part of this commit, it's in one
of the following ones.

{F9497950}

Part of the first Asset Browser milestone. Check the #asset_browser_milestone_1
project milestone on developer.blender.org.

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

Reviewed by: Brecht Van Lommel, Hans Goudey
2020-12-15 17:03:48 +01:00
b5d778a7d4 Asset System: Support dragging assets and appending on drop
For the Asset Browser, it needs to be possible to drag assets into various
editors, which may not come from the current .blend file. In other words, the
dragging needs to work with just the asset metadata, without direct access to
the data-block itself.

Idea is simple: When dragging an asset, store the source file-path and
data-block name and when dropping, append the data-block. It uses existing drop
operators, but the function to get the dropped data-block is replaced with one
that returns the local data-block, or, in case of an external asset, appends
the data-block first.

The drop operators need to be adjusted to use this new function that respects
assets. With this patch it only works for dragging assets into the 3D view.

Note that I expect this to be a short-lived change. A refactor like D4071 is
needed to make the drag & drop system more future proof for assets and other
use cases.

Part of the first Asset Browser milestone. Check the #asset_browser_milestone_1
project milestone on developer.blender.org.

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

Reviewed by: Bastien Montagne, Brecht Van Lommel
2020-12-15 17:03:48 +01:00
9363132c86 Asset System: Various changes to previews in preparation for Asset Browser
* Support defining (not necessarily rendering) icons in threads. Needed so the
  File Browser can expose file previews with an icon-id to scripts.
** For that, ported `icons.c` to C++, to be able to use scope based mutex locks
   (cleaner & safer code). Had to do some cleanups and minor refactoring for
   that.
* Added support for ImBuf icons, as a decent way for icons to hold the file
  preview buffers.
* Tag previews as "unfinished" while they render in a thread, for the File
  Browser to dynamically load previews as they get finished.
* Better handle cases where threaded preview generation is requested, but the
  ID type doesn't support it (fallback to single threaded). This is for general
  sanity of the code (as in, safety and cleanness)
* Enabled asset notifier for custom preview loading operator, was just disabled
  because `NC_ASSET` wasn't defined in master yet.

Part of the first Asset Browser milestone. Check the #asset_browser_milestone_1
project milestone on developer.blender.org.

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

Reviewed by: Bastien Montagne, Brecht Van Lommel
2020-12-15 17:03:45 +01:00
c25e031049 Asset System: "Mark Asset" & "Clear Asset" operators and UI integration
This makes it possible to turn data-blocks into assets and back into normal
data-blocks. A core design decision made for the asset system is that not every
data-block should be an asset, because not every data-block is made for reuse.
Users have to explicitly mark data-blocks as assets.

Exposes "Mark Asset" and "Clear Asset" in Outliner context menus (currently ID
Data submenu) and button context menus. We are still not too happy with the
names, they may change.

This uses the new context members to pass data-blocks to operators, added in
af008f5532 and 0c1d476923.

Part of the first Asset Browser milestone. Check the #asset_browser_milestone_1
project milestone on developer.blender.org.

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

Reviewed by: Brecht Van Lommel
2020-12-15 17:03:00 +01:00
b71eb3a105 Asset System: Data-block asset metadata storage, reading and API
Asset metadata is what turns a regular data-block into an asset. It is a small
data-structure, but a key part of the technical design of the asset system.

The design foresees that asset data-blocks store an `ID.asset_data` pointer of
type `AssetMetaData`. This data **must not** have dependencies on other
data-blocks or data-block data, it must be an independent unit. That way we can
read asset-metadata from .blends without reading anything else from the file.
The Asset Browser will use this metadata (together with the data-block name,
preview and file path) to represent assets in the file list.

Includes:
* New `ID.asset_data` for asset metadata.
* Asset tags, description and custom properties.
* BKE code to manage asset meta-data and asset tags.
* Code to read asset data from files, without reading IDs.
* RNA for asset metadata (including tags)

Part of the first Asset Browser milestone. Check the #asset_browser_milestone_1
project milestone on developer.blender.org.

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

Reviewed by: Bastien Montagne, Brecht Van Lommel
2020-12-15 17:03:00 +01:00
82645ff739 Move Point Cloud object back to Experimental Features
The geometry-nodes features no longer depend on the point cloud object.
Therefore the point cloud object, although important in the future, can
be postponed until we have render and edit mode fully working.

This reverts commits:
* ea74ed5a7a.
* dc614c68ef.
2020-12-15 13:07:55 +01:00
0d58eabee6 Geometry Nodes: support evaluating mesh object to geometry set
This implements the design proposed in T83357.

The goal is to allow the geometry nodes modifier on mesh objects to
output instances and potentially other geometry types. Both problems
are tackled by allowing mesh objects to evaluate to a geometry set,
instead of just a single mesh id data block. The geometry set can
contain a mesh but also other data like instances and a point cloud.

I can't say that I'm sure that this commit won't introduce bugs. Mainly
the temporary object creation during rendering seems a bit brittle.
BUT, we can be reasonably sure that this commit will not introduce
regressions (at least not ones, that are hard to fix). This is because
the code has been written in a way that minimizes changes for existing
functionality.

Given that we intend to hide the point cloud object for the next release,
we won't even have to worry about temporary object creation for now.

An important part of the technical design is to make sure that
`ObjectRuntime->data_eval` contains the same data before and after this
patch. This helps to make sure, that existing code paths are impacted as
little as possible.

Instead of fully replacing `data_eval`, there is `geometry_set_eval`,
which contains all the geometry components an object evaluated to
(including the data referenced by `data_eval`).

For now, not much code has to be aware of `geometry_set_eval`. Mainly
the depsgraph object iterator and the instances system have to know
about it.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D9851
2020-12-15 12:42:10 +01:00
d8db5cb600 Fix: upward compatibility of cryptomatte matte id.
The matte_id is stored in a different structure in 2.92. This patch will
write the old matte_id field so the files can be opened correctly in
older versions.
2020-12-15 12:17:31 +01:00
ef2151d73d Fix T83776: Crashes with add-on's icon preview in menus
Apparently the ID pointer can be NULL, which most code here assumes is
not the case. But it's very fragile & finicky, there is one code path
were it's allowed to be NULL.

Add necessary NULL-checks, an assert as sanity check and a comment to
note the possibility of NULL.
2020-12-15 12:05:12 +01:00
1b130f17c9 Cleanup: make format 2020-12-15 12:01:45 +01:00
35368e8bfc Fix: mattes of cryptomatte node lost after write
Fix an issue introduced by {f4df036bc497} where the read/write
code missed to store and read the mattes from its new location.
2020-12-15 11:15:01 +01:00
12792ee70c Fix T83788: Topology mirror crashes for vertices aren't mirrored
Caused by da8dc204bd
2020-12-15 18:10:04 +11:00
e035d7301c Fix crash sliding effect sequence strips
Off by one error in array access.
2020-12-15 16:14:59 +11:00
a05d98884a RNA: disallow negative fcurve data-path array index 2020-12-15 12:48:33 +11:00
612598acd7 Cleanup: doxy comments (use colon after parameter name)
Also remove colon after `\note`.
2020-12-15 12:34:25 +11:00
001f2c5d50 Cleanup: spelling 2020-12-15 12:34:25 +11:00
e995296acb Cleanup: unused variables 2020-12-15 12:34:25 +11:00
525364be31 Cleanup: reduce indirect DNA header inclusion
Remove DNA headers, using forward declarations where possible.

Also removed duplicate header, header including it's self
and unnecessary inclusion of libc system headers from BKE header.
2020-12-15 12:34:14 +11:00
15f2f69694 Cleanup: Reduce variable scope 2020-12-14 17:48:57 -06:00
1e38e32cf6 Cleanup: type check failure, discarded-qualifiers warnings
Caused by 7f6ffe9195
2020-12-15 10:27:36 +11:00
7470c10601 Cleanup: Use LISTBASE_FOREACH macro, reduce variable scope 2020-12-14 17:19:43 -06:00
Wayde Moss
6074636387 NLA: Action Strip Defaults Sync Length On
See T82309#1055564 {T63675} and their duplicates for how Default-off
can cause confusion.

This is just for convenience since it allows animators to keyframe
outside of the strip's bounds by default. This was likely off by
default before since Syncing Length would undesirably shift the whole
animation after leaving tweak mode (fixed by {D7602}) and the animator
wasn't able to keyframe outside the strip bounds anyways
(fixed by {D7533}). Now it's better if the flag was on by default.
While the animator is still roughly developing their animation NLA-wise
they won't have to worry about strip bound keying failures. When they
are more certain of the strip bounds, they can disable the flag to
prevent affecting the rest of the NLA system.

Reviewed By: sybren

Differential Revision: https://developer.blender.org/D9661
2020-12-14 17:32:14 -05:00
Wayde Moss
7f6ffe9195 Nla Refactor: Blend functions explicit Div0 check
It's an explicit check to prevent division by zero if caller hasn't
done the check. Future patch {D8867} will not use the nla remap
function and thus not do the check. This patch also replaces some
float (==) equality checks with IS_EQF().

Split from {D9247}

Reviewed By: sybren

Differential Revision: https://developer.blender.org/D9694
2020-12-14 17:11:41 -05:00
Wayde Moss
fa6bf8f5b6 Nla Refactor: nlaevalchan_validate_index_ex()
And removes redundant index local variable. Future patches {D8296} and
{D8867} make use of this function.

No functional changes.
Split from {D9247}

Reviewed By: sybren

Differential Revision: https://developer.blender.org/D9693
2020-12-14 17:06:59 -05:00
Wayde Moss
04ca93ef9b NLA: Fix context.selected_nla_strips PointerRNA
The strips were given the wrong owner ID.  This only caused issues for
python based UI as far as I know. Property changes would not properly
update the viewport.

Reviewed By: lichtwerk

Differential Revision: https://developer.blender.org/D9685
2020-12-14 17:00:04 -05:00
20bc1ab275 Fix incorrect RNA type warning
Using the RNA type for regular modifiers instead of grease pencil
modifiers caused a warning in context.c.
2020-12-14 15:12:18 -06:00
49ec3cef69 Geometry Nodes: Input data type utility function
This commit adds a simple utility function for getting the data type of an
attribute or its "constant" socket counterparts. No functional changes.

Differential Revision: https://developer.blender.org/D9819
2020-12-14 11:43:54 -06:00
010f44b855 Fix several issues with handling of numpy in CMake.
Issues were:
* Abusing of `WITH_PYTHON_INSTALL_NUMPY` by both Audaspace and
  Mantaflow.
    - `PYTHON_INSTALL` options only decide whether we copy python (and
      some extra modules) in our Blender installation. On linux it
      makes much more sense to use global python installation.
    - Now we have instead a proper `WITH_PYTHON_NUMPY`
* Bad assumptions regarding path of headers relative to path of python
  module.
    - In current Debian testing, modules are under `python3.9`
      directory, while headers are under `python3` directory.
    - Now we properly `find_path` for headers as well, modifying
      `find_python_package` to take an optional argument for headers.

Note that the required changes done to `extern` libraries are in
blender-specific files that do not exist upstream.

Differential Revision: https://developer.blender.org/D9773
2020-12-14 16:44:55 +01:00
f4df036bc4 Cryptomatte: Data structure in compositor node
This changes the way how the mattes are stored in the compositor node. This used to
be a single string what was decoded/encoded when needed. The new data structure
stores all entries in `CryptomatteEntry` and is converted to the old `matte_id`
property on the fly.

This is done for some future changes in the workflow where a more structured
approach leads to less confusing and easier to read code.
2020-12-14 16:14:38 +01:00
07ce9910f7 Geometry Nodes: enabled supports-mapping in nodes modifier
Sometimes the geometry nodes modifier does support mapping and
sometimes it does not. We have no infrastruture to determine this ahead
of time currently. In order to support common use cases, it makes sense
to add this flag to the modifier.

One such common use case is to use the mesh as surface that other
things are distributed on. Often, the distribution is controlled by vertex
groups. Therefore, it would be helpful if the modifier is evaluated
when the object is in vertex paint mode. This allows the user to see the
distributed objects while painting.

If the nodes modifier transforms the mesh in any way, vertex painting
might not work as expected anymore, because the `deformMatrices`
callback is not implemented. I'm not sure how this can be solved nicely, yet.
2020-12-14 15:44:28 +01:00
9ee7270e0a Geometry Nodes: require vertex groups data in nodes modifier
Without this, the modifier evaluation code might remove any
vertex groups from the mesh for performance reasons.
We can't say for sure whether the node group will need the vertex
groups, but it is quite likely.

Ref T83357.
2020-12-14 15:29:50 +01:00
6714b800d1 Cryptomatte: apply volume transmittance to Eevee.
This patch will add volumetric transmittance to the cryptomatte coverage
data of all samples when post processing the cryptomatte passes.

It was discussed with Cycles that this is desired, but tricky to
implement in Cycles.
2020-12-14 15:03:29 +01:00
e3068f38c8 Fix memory leak and possible other issues with custom previews
Mistake in 812ea91842. Fixed that same one before in the branch, I may have
brought it back when resolving merge conflicts.
2020-12-14 14:57:30 +01:00
Joan Bonet Orantos
68d5ad9983 Fix T75539: Cycles missing geometry update when switching displacement method
The shaders were not tagged for a needed geometry update when the displacement method was modified, neither were the Geometry and Object managers.

Reviewed By: kevindietrich

Maniphest Tasks: T75539

Differential Revision: https://developer.blender.org/D8896
2020-12-14 13:44:29 +01:00
4b0396695c UI/Assets: Support generating object preview images
Object previews are really helpful for visual data-block selection, like asset
browsing. Having them be generative should also be quite handy and should work
well enough in many, if not most cases.

What this does is simple:
* Place the object (actually a deep copy of it, for thread safety) in a virtual
  .blend into an empty scene/view-layer.
* Add a camera, point it towards the front of the object, assuming that means
  pointing towards its +Y axis.
* Use "Camera Fit Frame to Selected" logic to put the object into frame.
* Create a threaded off-screen render.

Of course, such an automatic preview will not work in all situations. E.g. it
currently does a bad job capturing a single plane. We could add options for
more advanced automatic previews, but probably custom previews is more
important, which I committed already (812ea91842).

Part of the first Asset Browser milestone. Check the #asset_browser_milestone_1
project milestone on developer.blender.org.

Reviewed as part of https://developer.blender.org/D9719.
Reviewed by: Bastien Montagne, Brecht Van Lommel
2020-12-14 13:17:57 +01:00
732d0b458b Blenkernel: move DerivedMesh.c to c++
Required changes to make it compile with clang tidy:
* Use c++ includes like (e.g. climits instead limits.h).
* Insert type casts when casting from void* to something else.
* Replace NULL with nullptr.
* Insert casts from int to enum.
* Replace designed initializers (not supported in C++ yet).
* Use blender::Vector instead of BLI_array_staticdeclare (does not compile with C++).
* Replace typedef statements.

Ref T83357.
2020-12-14 13:08:02 +01:00
551856ed32 Revert "Fix several issues with handling of numpy in CMake."
This reverts commit 5d570c875e.

Buildbots are still borken, need more time to investigate.
2020-12-14 12:29:34 +01:00
fdc9350a9f Revert "Fix own error in rB5d570c875eda in CMake script."
This reverts commit 6da609fcb3.

Buildbots are still broken, need more time to investigate.
2020-12-14 12:29:08 +01:00
6da609fcb3 Fix own error in rB5d570c875eda in CMake script.
My mistake, though CMake could handle default arguments but it needs to
be explicitly passed actually.
2020-12-14 12:23:21 +01:00
812ea91842 UI/Assets: Operator to load custom preview images for data-blocks
No automatic preview generation will ever be good enough to cover all cases
well. So custom preview images are a must for a preview driven data-block
selection - like for asset browsing.

The operator simply allows selecting an image file, which will then be read and
copied into the data-blocks preview (resized if necessary).

There's no UI for this currently and the operator won't be available in the
search menu yet. It will later once the Asset Browser UI is merged.

Reviewed as part of https://developer.blender.org/D9719.
Reviewed by: Bastien Montagne, Brecht Van Lommel
2020-12-14 12:16:59 +01:00
6f7ced77e3 Fix windows build. 2020-12-14 14:09:18 +03:00
Bastien Montagne
f5a019ed43 LibOverride: Do not store some heavy data from override IDs.
This commit removes geometry from meshes and shapekeys, and embedded
files, from liboverride IDs.

This data is never overrideable, there is no reason to store extra
useless copies of it in production files.

See T78944.

Note that we may add more data to be skipped on write for liboverrides
in the future, but this commit should address all the most important
cases already.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D9810
2020-12-14 11:37:01 +01:00
8e1b63d4bd GPencil: Add missing Pin icon for default eraser
This icon allows to set the default eraser when press Ctrl key and was removed by error in the brush refactor.
2020-12-14 11:31:01 +01:00
5d570c875e Fix several issues with handling of numpy in CMake.
Issues were:
* Abusing of `WITH_PYTHON_INSTALL_NUMPY` by both Audaspace and
  Mantaflow.
    - `PYTHON_INSTALL` options only decide whether we copy python (and
      some extra modules) in our Blender installation. On linux it
      makes much more sense to use global python installation.
    - Now we have instead a proper `WITH_PYTHON_NUMPY`
* Bad assumptions regarding path of headers relative to path of python
  module.
    - In current Debian testing, modules are under `python3.9`
      directory, while headers are under `python3` directory.
    - Now we properly `find_path` for headers as well, modifying
      `find_python_package` to take an optional argument for headers.

Note that the required changes done to `extern` libraries are in
blender-specific files that do not exist upstream.

Differential Revision: https://developer.blender.org/D9773
2020-12-14 11:00:28 +01:00
53ed96641c Cleanup: clang tidy 2020-12-14 10:48:11 +01:00
45bf470ee9 Fix T83712: arctangent math node does not work in Eevee
Caused by my refactoring of the math node.
Somehow this operation slipped through my double checking procedure.
2020-12-14 10:47:17 +01:00
067046c26a Cleanup: path_util.c comments 2020-12-14 20:44:26 +11:00
088df2bb03 Fix missing string escape for RNA path creation 2020-12-14 20:44:26 +11:00
b8ae90263a Fix version patching sequence strip alpha from 2.4x files
Regression in 4f5f868a52
2020-12-14 20:44:26 +11:00
7d4536cacc Fix enum-conversion, old-style-declaration warnings
Introduced in 8f3a401975
2020-12-14 20:44:26 +11:00
6327771bc9 Fix T83696: Add Additional menu to Effects panel
This adds the missing options for the effects as it is done in modifiers.

Reviewed By: HooglyBoogly

Maniphest Tasks: T83696

Differential Revision: https://developer.blender.org/D9838
2020-12-14 10:25:37 +01:00
8f3a401975 Eevee: Add Volume Transmittance to Color Render Passes.
In Cycles the volume transmittance is already composited into the color
passes. In Eevee the volume transmittance pass was separate and needed
to be composited in the compositor. This patch adds the volume
transmittance pass direct in the next render passes:

 * Diffuse Color
 * Specular Color
 * Emission
 * Environment

This patch includes the removal of the volume transmittance render pass.
It also renames the volume render passes to match Cycles. The setting
themselves aren't unified.

Maniphest Tasks: T81134
2020-12-14 09:27:58 +01:00
fddbcb5757 UI: Click modifier icon to set active modifier
This should be a final piece of the changes for the active modifier
interface. Before, it was necessary to click on the blank space of a
modifier panel to set it active (not the header), this commit allows
clicking on the icon also.

The spacing with the spacing with the expand button would ideally
be a bit larger, but the layout system doesn't offer much flexibility
here.
2020-12-13 23:49:14 -06:00
260fca5d08 Fix T83673: Custom node trees selectable in nodes modifier
Node tree types from addons were selectable in the modifier's drop-down.
Obviously they didn't do anything, but it shouldn't be possible anyway.
This was just caused by an unimplemented poll function.
2020-12-13 22:59:52 -06:00
Yevgeny Makarov
977ef04746 Cleanup: Fix capitalization in various places
Approximately 33 changes of capitalization to conform to MLA title style.

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

Reviewed by Julian Eisel
2020-12-13 13:12:56 -08:00
dd0520b93b Fix T83725 Inconsistent vertex group between exact and fast boolean.
This makes the exact boolean have zero weights for any vertex groups
on any newly created vertices, which is what the fast solver does.

The exact boolean solver was interpolating vertex data when interpolating
loop data in newly created faces. Not sure why I chose that. The Fast
boolean solver doesn't do that, so I stopped doing it too.
2020-12-13 16:04:05 -05:00
Yevgeny Makarov
a2693ba43e Cleanup: removing some uses of equal sign in descriptions
Using 'is/means/equal' words in place of equal sign in descriptions.

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

Reviewed by Hans Goudey
2020-12-13 12:59:36 -08:00
Yevgeny Makarov
afeaac8b18 Fix cursor position on HighDPI in stereo side-by-side mode
Could not select left quarter of the screen in stereo side-by-side mode on high dpi displays.

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

Reviewed by Julian Eisel
2020-12-13 12:48:50 -08:00
Yevgeny Makarov
2e5d9a73f7 UI: Improved Script Execution Warning
New dialog box layout with large alert icon for the Python script execution warning popup.

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

Reviewed by Hans Goudey
2020-12-13 12:39:28 -08:00
Yevgeny Makarov
bec583951d UI: Remove Unused 'U.wheellinescroll' Property
Remove 'U.wheellinescroll' preference, currently hidden and unused.

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

Reviewed by Brecht Van Lommel
2020-12-13 12:30:03 -08:00
9c0df8e275 Fix weird Swing+Twist decomposition with noncanonical quaternions.
It turns out that after the fix to T83196 (rB814b2787cadd) the matrix
to quaternion conversion can produce noncanonical results in large
areas of the rotation space, when previously this was limited to
way smaller areas. This in turn causes Swing+Twist math to produce
angles beyond 180 degrees, e.g. outputting a -120..240 range.

This fixes both issues, ensuring that conversion outputs a canonical
result, and decomposition canonifies its input.

This was reported in chat by @jpbouza.
2020-12-13 22:06:01 +03:00
c6075118d5 Cleanup: Reduce variable scope in view_2d_ops.c 2020-12-13 09:27:37 -06:00
4797c13e8f UI: Add more property editor operators to IC keymap
As a followup for rB2b3d85d7d6771, this commit adds the remove and
copy operators for grease pencil modifiers, effects, and constraints
where they apply.
2020-12-12 12:07:22 -06:00
57f900e4ef Fix T83705: GPencil - Duplicate strokes of destination layer when merge layer
If the destination layer hadn't keyframe, a new keyframe was added and later the merge layer strokes were added, but this could change the animation because the new frame replaced the old drawings of the target layer.

Now, before merge the layer, all keyframes are added in the target layer in order to keep the drawings.
2020-12-12 18:49:57 +01:00
3eb6649453 GPencil: Add uniform subdivide BKE to improve interpolation
This patch introduces a new BKE function that performs a uniform subdivide.

The goal of this function is to subdivide the stroke to reach a target number of points while maintaining its shape, color, and weights.
This is done by repeatedly subdividing the longest edge in the stroke. Every subdivision adds a new point at the exact middle point of an edge.

The function is intended to be used in the interpolation operators to give better results when interpolating between different sized strokes.

Reviewed By: antoniov

Differential Revision: https://developer.blender.org/D9835
2020-12-12 16:49:38 +01:00
ae94a390a7 Cleanup: clang tidy 2020-12-12 12:24:14 +01:00
0c1d476923 UI: Allow UI to pass focused data-block to operators via context
This is similar to c4a2067130130d, but applies to the general UI and is only
about single data-blocks. Here there was a similar problem: How can buttons
pass the data they represent to operators? We currently resort to ugly ad-hoc
solutions like `UI_context_active_but_get_tab_ID()`. So the operator would need
to know that it is executed on a tab button that represents a data-block.

A single button can now hand operators a data-block to operate on. The operator
can request it via the "id" context member (`CTX_data_pointer_get_type(C, "id",
&RNA_ID)` in C, `bpy.context.id` in .py).
In this commit, it is already set in the following places:
* Generic RNA button code sets it to the pointed to data-block, if the button
  represents a data-block RNA pointer property. (I.e for general data-block
  search buttons.)
* Data-block selectors (`templateID`) set it to the currently active data-block.
* The material slot UI-List sets it for each slot to the material it represents.
The button context menu code is modified so its operators use the context set
for the layout of its parent button (i.e. `layout.context_pointer_set()`).

No user visible changes. This new design isn't actually used yet. It will be
soon for asset operators.

Reviewed as part of https://developer.blender.org/D9717.
Reviewed by: Brecht Van Lommel
2020-12-11 23:08:29 +01:00
af008f5532 UI: Allow Outliners to pass selected data-blocks to operators via context
The way the Outliner integrates operations on selected tree elements is known
to be quite problematic amongst developers. The context menu is generated in an
unusual way and doesn't use the normal operator system. Instead, changes are
applied via a recursive callback system. Things are quite ad-hoc, and the
callbacks often implement logic that should not be in the Outliner, but in
entirely different modules. Often these modules already contain the logic, but
as proper operators.

This commit is a step into a hopefully better direction that should allow us to
put actual operators into Outliner context menus. It starts solving the problem
of: How can the Outliner pass selected data to operators. It implements it for
data-blocks only, but other data could do it in the same way.

Idea is to keep doing what operators were initially designed to do: Operate on
context.
Operators can now query a "selected_ids" context member
(`CTX_data_selected_ids()` in C, `bpy.context.selected_ids` in .py). If an
Outliner is active, it will generate a list of selected data-blocks as a
response, via its `SpaceType.context` callback.
Any other editor could do the same.

No user visible changes. This new design isn't actually used yet. It will be
soon for asset operators.

Reviewed as part of https://developer.blender.org/D9717.
Reviewed by: Brecht Van Lommel
2020-12-11 23:08:29 +01:00
ba83ad226d Fix error in recent commit
Introduced in rBcada56b1f72f537f9ab007cfafd430ac10c292fb
2020-12-11 17:54:27 -03:00
0dbbcaf1e6 Fix: Fix potential memory leak in BLI_getenv
Issue introduced in rB87b19b3aba0c and unlikely to occur
but no reason not to have correct code.
2020-12-11 12:09:18 -07:00
bbd7f94d8a Cleanup: Python GPU: change prefix 'bpygpu_' to 'py_' in static functions 2020-12-11 16:06:22 -03:00
cada56b1f7 Cleanup: GPU Python: Use 'PyC_ParseStringEnum' for string enum 2020-12-11 16:06:22 -03:00
87b19b3aba Fix: BLI_getenv returns ascii not UTF8 on windows
BLI_getenv has always incorrectly returned ascii rather
than UTF-8. This change corrects this behaviour.

This resolves issues when the `BLENDER_USER_CONFIG`
environment variable contains a path with Unicode characters
on windows as reported in T74510 (but unlikely the root
cause for the issue at hand there)

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

Reviewed by: brecht
2020-12-11 11:59:14 -07:00
92ab76c38f Cleanup: clang-format
Forgot to run Make Format on recent spelling changes
2020-12-11 10:48:30 -08:00
Valdemar Lindberg
93c67b0b8e Fix T83586: Cycles failing to load OpenEXR image with EXR RGBAZ channels
Don't refuse to load 5-channel images, instead drop any channels after the 4th
and hope that the first channels represent RGBA.

Differential Revision: https://developer.blender.org/D9820
2020-12-11 19:36:09 +01:00
97651f428b Fix T83050: Crash dragging shared collection to master collection
The flag syncing code expects to find collection flags in same view
layer before and after the move, it even has an assert for it. However,
there is one case where this doesn't happen, when dragging a collection
that exists in two scenes to the master collection.

This commit removes this assert, frees the temporary flag structs
separately, and updates some comments with this information.
There is more detail in the adjusted comment.

Differential Revision: https://developer.blender.org/D9785
2020-12-11 12:15:51 -06:00
b73ed882c0 Cleanup: clang tidy 2020-12-11 19:02:46 +01:00
cef5d0923b Readme file to extern libraries about the attribution document 2020-12-11 18:53:22 +01:00
561d9169fe Fix T83280: Crash when deleting hair collision collection.
Root of the issue was missing management of ID pointers in the cloth
modifier data stored in ParticleSystem for hair physics, in the
'foreach_id' particle system code.

Using modifier's 'foreach_id' code in psys one unfortunately requires
some ugly conversion gymnastics, but this is still better than having
dedicated code for that case.

Note that this is actually a fairly critical issue, fix should be
backported to 2.91.1 should we do it, and to 2.83 LTS as well I think.
2020-12-11 18:46:21 +01:00
85cb238820 Licenses: Attribution document
This document helps Blender users to known what is the library of each
individual 3rd party components that Blender depend on.

Generated using:
https://github.com/amzn/oss-attribution-builder

This is based on the libraries in extern and the svn libraries.

For the libraries in extern the README.blender was used as reference.
For the libraries in svn I used `cmake/versions.cmake`.

Note that the crediting is a bit of hit and miss. For some projects this
is very clear, while for others I had to do some digging. Either way I
gave my best shot.

The sources to (re-)generate this file is local at the moment. But it
should be moved to our infra-structure at some point.

Differential Revision: https://developer.blender.org/D9798
2020-12-11 18:44:11 +01:00
f5dc34ec9c Geometry Nodes: support instancing collections
The Point Instance node can instance entire collections now.
Before, only individual collections were supported.

Randomly selecting objects from the collection on a per point basis
is not support, yet.

Last part of D9739.

Ref T82372.
2020-12-11 18:00:37 +01:00
5ced167336 Geometry Nodes: support collection sockets
Part of D9739.
2020-12-11 17:47:58 +01:00
4885fbc07b Nodes: add Collection socket type
The implementation is pretty much the same as for Object sockets.
The socket color is the one that is used for collections in the outliner.

Part of D9739.
2020-12-11 17:38:32 +01:00
f762d37790 Cycles: enable OpenCL rendering on recent Intel GPUs
Based on testing by Intel, rendering on Iris GPUs and upcoming Xe GPUs
should work. This is enabled on Windows and Linux.

More testing is needed to verify correctness and performance in production
scenes, but our basic benchmark files seem to give correct results.
2020-12-11 17:37:54 +01:00
c6626a2f8a Cleanup: compiler warnings
If you mark one function as override in a class, all must be marked.
2020-12-11 17:37:31 +01:00
Yevgeny Makarov
f7069d71aa Trackpad: Fix wrong scroll deltas on Retina
Scale Mac trackpad scrolling changes by pixel size of output device.

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

Reviewed by Brecht Van Lommel
2020-12-11 08:28:56 -08:00
Yevgeny Makarov
badbf816b8 UI: Consistent Range Descriptions
Unifying range descriptions as a value 'to' a value.

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

Reviewed by Julian Eisel
2020-12-11 07:35:44 -08:00
273aca964e Refactor/extend BKE API to get special user directories
The previous `BKE_appdir_folder_default()` was confusing, it would return the
home directory on Linux and macOS, but the Documents directory on Windows.
Plus, for the Asset Browser, we want to use the Documents directory for the
default asset library on all platforms.
This attempts to clean up the API to avoid confusion, while adding the newly
needed functionality.

* `BKE_appdir_folder_default()` should behave as before, but the implementation
  changed:
** Removes apparently incorrect usage of `XDG_DOCUMENTS_DIR` on Unix systems -
   this seems to be a config file variable, not an environment variable. Always
   use `$HOME` instead, which this ended up using anyway.
** On Windows it doesn't attempt to use `%HOME%` anymore and gets the Documents
   directory directly.
* Add `BKE_appdir_folder_home()` to gives the top-level user directory on all
  platforms.
* Add `BKE_appdir_folder_documents()` to always get the user documents
  directory on all platforms.

There should be no user noticable behavior change.

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

Reviewed by: Brecht Van Lommel
2020-12-11 16:20:53 +01:00
6de85a0cc0 Ghost: Support queries for special user directories (desktop, documents, etc.)
When we had to get special user directories, we'd usually do it in varying,
rather ad-hoc ways. It would be done with a bunch of `#ifdef`s for the
different operating systems. Also, some of the used Win32 functions were legacy
ones and the API docs recommend using newer ones.
Further, seems `BKE_appdir_folder_default()` used `XDG_DOCUMENTS_DIR` wrong.
It's not supposed to be an environment variable but a value inside a config
file.

This adds the platform dependent logic to Ghost, so we can abstract it away
nicely using the `GHOST_ISystemPaths` interface. Getting the desktop directory
for example can now easily be done with:
`GHOST_getUserSpecialDir(GHOST_kUserSpecialDirDesktop).`

For now I added the logic for desktop, documents, downloads, videos, images and
music directories, even though we only use the Documents one. We can extend/
change this as needed, it's easy to do now.
On Windows and macOS, it uses pretty much the same way to access the
directories as elsewhere already. On Linux, it uses the `xdg-user-dir` command
that seems to be available by default on most Linux systems.

No functional changes. The new queries are not actually used yet.

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

Reviewed by: Brecht Van Lommel
2020-12-11 16:20:53 +01:00
c8a3d1a1fa GPencil: Add Link support to Effects using Ctrl+L
The effects were not supported in this operator, but it was supported in the Outliner.

Differential Revision: https://developer.blender.org/D9824
2020-12-11 15:53:22 +01:00
727d5013a7 Fix T82881: Paint mask 'deselect on nothing' missed viewport update
Was failing for weightpaint and vertexpaint.

Selection flags were actually changed, but the update in the viewport
wasnt immediate, leading to confusion when the update happened later
(e.g. when using the weight gradient tool as done in the report).

We need to tag ID_RECALC_SELECT and send ND_SELECT notifier here. This
could be done explicitly, but there is also existing functionality
available that does this.
Note: the way updates happen for paintfaces vs. paintverts looks a bit
inconsistent (so this could be part of a later cleanup commit)

Maniphest Tasks: T82881

Differential Revision: https://developer.blender.org/D9631
2020-12-11 15:32:31 +01:00
7c8e01341f UI: Correct help text in the Parent panel
Tracking Axis and Up Axis were still referring to duplis (DupliFrame) - changed it to be in line with Aaron's info about them in our manual
2020-12-11 14:11:17 +01:00
bfb6fce659 Cycles: Add CPU+GPU rendering support with OptiX
Adds support for building multiple BVH types in order to support using both CPU and OptiX
devices for rendering simultaneously. Primitive packing for Embree and OptiX is now
standalone, so it only needs to be run once and can be shared between the two. Additionally,
BVH building was made a device call, so that each device backend can decide how to
perform the building. The multi-device for instance creates a special multi-BVH that holds
references to several sub-BVHs, one for each sub-device.

Reviewed By: brecht, kevindietrich

Differential Revision: https://developer.blender.org/D9718
2020-12-11 13:24:29 +01:00
d72ec16e70 Geometry Nodes: add Attribute Mix node
This node can be used to mix two attributes in various ways.
The blend modes are the same as in the MixRGB shader node.

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

Ref T82374.
2020-12-11 12:00:48 +01:00
150a1d158a Cleanup: remove some forward declared enums
Forward declaring enums are not allowed in C++.

Differential Revision: https://developer.blender.org/D9811
2020-12-11 11:48:58 +01:00
f5c7246717 Fix wrong operator return values in Outliner code.
Mistakes in rBac8b641b77e0 and rBf254f66587f2.

Spotted while inverstigating T83592.
2020-12-11 11:05:28 +01:00
f7e5f96f56 GeometryNodes: Make properties exposed in modifier overridable. 2020-12-11 10:53:08 +01:00
b62a9ef66f Cleanup: Fix typo in comment. 2020-12-11 10:53:08 +01:00
Evan Wilson
6e4fccd9fa Correct the order of the last two arguments in eevee_cryptomatte_shading_group_create
When compiling on Windows, the following warnings occur:
```[3468/4560] Building C object source\blender\draw\CMakeFiles\bf_draw.dir\engines\eevee\eevee_cryptomatte.c.obj
C:\blender-git\blender\source\blender\draw\engines\eevee\eevee_cryptomatte.c(306): warning C4047: 'function': 'bool' differs in levels of indirection from 'void *'
C:\blender-git\blender\source\blender\draw\engines\eevee\eevee_cryptomatte.c(306): warning C4024: 'eevee_cryptomatte_shading_group_create': different types for formal and actual parameter 5```

As @Severin pointed out [here](https://developer.blender.org/rB76a0b322e4d3244e59a154c8255b84a4fbc33117#288960), this is due to the last two arguments being flipped.  This diff corrects the order.

Reviewed By: Severin, fclem

Differential Revision: https://developer.blender.org/D9809
2020-12-11 08:45:05 +01:00
219dba8506 Workaround T83651: Crash dragging multiple buttons in the clip editor
Avoid the crash, dragging multiple buttons still needs fixing.
2020-12-11 15:32:14 +11:00
392a8e2907 Cleanup: sort cmake file lists 2020-12-11 15:32:14 +11:00
8cc951d2ae Cleanup: trailing space 2020-12-11 15:32:14 +11:00
ff6d7e9072 Cleanup: spelling, expand on FCurve.rna_path docstring 2020-12-11 15:32:14 +11:00
Yevgeny Makarov
a4a42f3171 UI: Use 'and' Instead of '&' in Descriptions
Use 'and' instead of ampersand in descriptions and comments.

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

Reviewed by Aaron Carlisle
2020-12-10 18:22:16 -08:00
caed4849d0 Fix T83640: No immediate updates when changing the settings of a just-
duplicated particle system

When particle settings are duplicated along with the particle system,
this means a change in relations, was missing
'DEG_relations_tag_update'.

Maniphest Tasks: T83640

Differential Revision: https://developer.blender.org/D9823
2020-12-10 22:48:47 +01:00
a7fcca1062 UI: Use words instead of symbols for float comparison items
Though they are nice and concise, users should not be expected to know
the meaning of symbols like `!=`.
2020-12-10 11:07:26 -06:00
8bdd996cd0 Geometry Nodes: Add helper function to check if attribute exists 2020-12-10 10:50:37 -06:00
3d25312617 Nodes: fix incorrectly parameter name and type
The parameter type was incorrectly changed in rB6be56c13e96048cbc494ba5473a8deaf2cf5a6f8 by me.
This can be any id and does not have to be a node tree.
2020-12-10 16:15:28 +01:00
1d447dcd19 Fix T83630 Exact Boolean assert failure in Debug build.
I thought I had reasoned that the add_patch would only happen
when the patch was not already in a cell, but I missed reasoning
about merged cells. So switched to a set 'add' instead of 'add_new'.
2020-12-10 09:15:16 -05:00
348bd319d5 Geometry Nodes: Attribute Fill Node
This commit adds a node that fills every element of an attribute
with the same value. Currently it supports float, vector, and color
attributes. An immediate use case is for "billboard" scattering.

Currently people are using the same input to a Random Attribute node's
min and max input to fill every element of a vector with the same value,
which is an unintuitive way to accomplish the same thing.

Differential Revision: https://developer.blender.org/D9790
2020-12-10 07:58:45 -06:00
efb741b280 Geometry Nodes: rename modifyPointCloud to modifyGeometrySet
Since the initial merge of the geometry nodes project, the modifyPointCloud
function already was already modifying a geometry set. The function wasn't
renamed back then, because then the merge would have touched many
more files.

Ref T83357.
2020-12-10 14:35:15 +01:00
2b9eb5eee5 Fix T83361: UV Editor does not draw pinned selected UVs as pinned
Caused by rB4212b6528af.

outlineColor is computed by the vertex shader, so not a uniform.
So outlineColor was undefined.

note: it was still possible to run into the situation that a selected UV
is drawn ontop of a selected pinned UV [you had to disable sticky
selection for this], now also make sure selected-pinned are drawn
topmost, then selected, then unselected UVs.

Maniphest Tasks: T83361

Differential Revision: https://developer.blender.org/D9786
2020-12-10 13:20:15 +01:00
e795ba1529 Geometry Nodes: fix recursive instance transforms
Previously, the transformation of recursive instances did not work as
on would expect. Second-level instances would detach from first-level
instances when the object was moved.
2020-12-10 10:23:54 +01:00
22959dc866 Fix missing custom-property escaping for whole-character keying set
Custom properties with characters that needed escaping
had f-curves created with invalid paths.
2020-12-10 19:31:22 +11:00
83f5a0b972 Fix missing string escaping in RNA_path_append
This was escaping the '[' character, which isn't needed for quoted text.
2020-12-10 17:57:59 +11:00
e21f1136c2 Tests: fix 'ctest -j' running multiple tests at once
bl_blendfile_io & bl_blendfile_liblink shared a filename,
which could make these tests fail.
2020-12-10 17:18:38 +11:00
2fbf9cb551 Cleanup: remove unused function bc_find_bonename_in_path 2020-12-10 17:10:19 +11:00
d97845a693 BLI_string: return NULL from BLI_str_quoted_substrN on failure
This was returning an empty allocated string, however almost
all callers checked if the return value was NULL before freeing,
making for misunderstandings on the intended use of this function.

BCAnimationSampler::initialize_curves for example detected the
f-curves animation type to 'bone' based on a non-NULL return value
which never failed.

Also fixes two leaks where the the result of BLI_str_quoted_substrN
wasn't freed.
2020-12-10 16:56:09 +11:00
3ec7cf64bc Fix BLI_str_quoted_substrN use with escaped strings
BLI_str_quoted_substrN didn't unescape the resulting string,
yet all callers were using this with animation paths which are
created using BLI_str_escape().

- Fix BLI_str_quoted_substrN use with escaped strings by calling
  BLI_str_unescape().

  Note that it's possible we want an a version of this function that
  keeps escape characters. This could be added if it's required.

- Fix end quote detection using BLI_str_escape_find_quote
  checking for `\"` isn't reliable since an even number of back-slashes
  before a quote means it's not escaped.
2020-12-10 16:12:25 +11:00
2814cdbd86 BLI_string: extract quote utility into BLI_str_escape_find_quote
Duplicate logic for this exists in BLI_str_quoted_substrN,
which doesn't properly support escaping.
2020-12-10 15:06:16 +11:00
aef9243ebb Cleanup: remove unnecessary vars in RNA token reading 2020-12-10 14:55:28 +11:00
ed2556e22c Cleanup: declare variables when used (RNA) 2020-12-10 14:55:28 +11:00
c5aaa11c3b Cleanup: declare variables when used (bpy) 2020-12-10 14:55:28 +11:00
51cbd5d91d Cleanup: avoid '_ln' suffix
Use '_len' or '_line_number'.
2020-12-10 14:55:28 +11:00
564ef8279b Cleanup: use snake-case instead of camel-case 2020-12-10 14:55:28 +11:00
b5bc9d80a1 PyAPI: add bpy.utils.unescape_identifier
Utility to perform the reverse of `bpy.utils.escape_identifier`
2020-12-10 14:40:01 +11:00
2f86518ac0 RNA: use BLI_str_unescape utility for parsing escaped strings 2020-12-10 14:40:01 +11:00
82e1b65d91 BLI_string: support escaping additional control character
Add support for escaping \a, \b & \f for completeness,
currently it's not required.
2020-12-10 14:40:01 +11:00
15d801625c BLI_string: add BLI_str_unescape utility function
Performs the reverse of BLI_str_escape.
This allows logic to be removed from RNA path handling.
2020-12-10 14:40:01 +11:00
7fc1d76037 Fix BLI_str_escape with control characters, add unit tests 2020-12-10 14:40:01 +11:00
65f139117d Cleanup: rename BLI_strescape to BLI_str_escape
Prepare for `BLI_str_unescape` which doesn't read well
without the separator.
2020-12-10 14:40:01 +11:00
548e9624d0 Fix T82852: Cycles crashes when editing a mesh with adaptive subdivision
The issue is caused by stale data on the Mesh Node which is not cleared
during synchronizing since the socket API refactor so that we can detect
changes. However, synchronization only updates the sockets of the Mesh,
so other properties were left with outdated values.

This caused an underflow when computing attribute size for undisplaced
coordinates as it was using the current number of vertices minus the
previous count of subdivision vertices, which at this point should be 0.

Added a simple method to clear non socket data. Also modified
Mesh.add_undisplaced to always use an ATTR_PRIM_GEOMETRY as the data is
not subdivided yet and it avoids any further issues regarding computing
attribute sizes.
2020-12-10 02:31:25 +01:00
b379f93484 Cleanup: Use const for filter queries 2020-12-09 23:43:01 +01:00
d870a60dd9 Sculpt: Elastic deform type for Snake Hook
This adds deformation types to snake hook and the elastic deformation
type. This mode deforms the mesh using a kelvinlet instead of applying
the displacement directly inside the brush radius, which is great for
stylized shapes sketching.

Changes in rake rotation when using elastic are too strong when set
to 1, so I'll add a nicer way to support rake rotations with smoother
transitions in the future.

Reviewed By: sergey, JulienKaspar

Differential Revision: https://developer.blender.org/D9560
2020-12-09 22:25:16 +01:00
19560eef1a Cleanup: Remove unused c popup menu for text editor
This code hase been usused for 10 years and the right click menu is now 
in python.
2020-12-09 16:09:51 -05:00
3b57927651 Fix T82242: creating particle influence textures does not set up DEG
relation immediately

Texture and ParticleSettings have a DEG relation, but
`DEG_relations_tag_update` was not called when the texture changed.
This lead to no updates when e.g. texture size changes, relation only
went into full effect after save/reload or adding/removing keyframes.

Two places were additional relation tagging is needed:
- ParticleSettings `active_texture` changes
- ParticleSettingsTextureSlot (basically any TextureSlots') texture
changes

Maniphest Tasks: T82242

Differential Revision: https://developer.blender.org/D9393
2020-12-09 21:45:36 +01:00
ac7694aee0 UI: Update theme to match Shader nodes category color with socket color
The change to match socket color and category was already done, but it was missing
versioning code to update the theme on load.

Fixes T83500 (already closed as invalid, but this would solve the non-matching colors)

Reviewed by Hans Goudey (HooglyBoogly)
2020-12-09 21:09:37 +01:00
41bca5a3ee Fix T83581: "Only local" ambient occlusion option causes error on OptiX 2.92
The SVM AO node calls "scene_intersect_local" with a NULL pointer for the intersection
information, which caused a crash with OptiX since it was not checking for this case and
always dereferencing this pointer. This fixes that by checking whether any hit information
was requested first (like is done in the BVH2 intersection routines).
2020-12-09 17:06:28 +01:00
c93f826661 Cleanup: various clang tidy fixes 2020-12-09 16:29:11 +01:00
4a5f36638b Geometry Nodes: simplify supporting different input socket types for attributes
This is a non-functional change. The functionality introduced in this commit
is not used in master yet. It is used by nodes that are being developed in
other branches though.
2020-12-09 16:20:57 +01:00
25e151cc34 Fix T83575: GPencil: VFX Blur is not disabled when samples are zero
Before the number of samples was not checked, only the pixel size.
2020-12-09 15:41:07 +01:00
37bf71ad04 Fix T83588: Crash with Shrink/Fatten and Offset Even
`t->keymap` can be `NULL`.

Bug introduced in rBc822f66bb83
2020-12-09 10:30:23 -03:00
Germano Cavalcante
b9eb592133 Fix T83460: Regression in snap for measure tool
Now the gizmo is drawn only when the eventstate located in
`wm->winactive->eventstate` has not changed.

So it doesn't matter if it's "selected" or not.

This commit also removes the use of the private header "wm.h"

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D9539
2020-12-09 09:34:44 -03:00
5a8012b6a6 Degraded AMD 20.11.3 driver to limited support. 2020-12-09 12:37:20 +01:00
baf84ecbe4 Workaround for Access Violation startup crash on deprecated Radeon GPUs on Windows
This is a workaround for T80804.

There's a startup crash that happens on 2.91.0 on Windows, an `EXCEPTION_ACCESS_VIOLATION`
on `atio6axx.dll`. It is triggered by `glClear` on the `detect_mip_render_workaround`
function. The workaround moves the function after the device/driver workaround section and
sets the flag to the affected one to avoid running the check.

It is deprecated hardware that has not meet the minimum requirements since 2.79, but is
still usable and this extends its usability a bit before the cards are finally blacklisted.

Reviewed By: Jeroen Bakker

Differential Revision: https://developer.blender.org/D9667
2020-12-09 12:15:15 +01:00
1a959e9fa8 Raised AMD/Terascale2 from unsupported to supported.
There is a patch that fixes the crash on startup {D9667}.
2020-12-09 12:12:35 +01:00
55d14210cc Raised AMD CEDAR on Linux from unsupported to limited support
There is a workaround available by setting the environment variable `R600_DEBUG=nosb`.
2020-12-09 12:10:32 +01:00
3a23f18e02 Blender LTS: Download + Release notes CMS scripts
This patch contains 2 scripts that will help with LTS releases

create_download_urls.py

    This python script is used to generate the download urls which we can
    copy-paste directly into the CMS of www.blender.org.

    Usage: create_download_urls.py --version 2.83.7

    Arguments:
      --version VERSION  Version string in the form of {major}.{minor}.{build}
                         (eg 2.83.7)

    The resulting html will be printed to the console.

create_release_notes.py
=======================

    This python script is used to generate the release notes which we can
    copy-paste directly into the CMS of www.blender.org and stores.

    Usage: ./create_release_notes.py --task=T77348 --version=2.83.7

    Arguments:
      --version VERSION  Version string in the form of {major}.{minor}.{build}
                         (e.g. 2.83.7)
      --task TASK        Phabricator ticket that is contains the release notes
                         information (e.g. T77348)
      --format FORMAT    Format the result in `text`, `steam`, `wiki` or `html`

Requirements
============

* Python 3.8 or later
* Python phabricator client version 0.7.0
  https://pypi.org/project/phabricator/

For convenience the python modules can be installed using pip.

    pip3 install -r ./requirements.txt

Differential Revision: https://developer.blender.org/D9055
2020-12-09 09:14:53 +01:00
abddd7d5f9 Fix T83566: bpy.props.CollectionProperty gives incorrect error
Error in commit a7b3047cef.
2020-12-09 18:46:07 +11:00
ebe4bf6286 Fix another id-property name length check
Missed this in 6c9263d817
2020-12-09 17:33:11 +11:00
acc6373939 Fix custom-property UI allowing long names that raised errors
Rename `rna_property` to `rna_custom_property`
to differentiate it from a more general property.
2020-12-09 17:20:44 +11:00
6c9263d817 Fix off by one error in id-property name validation
The Python API accepted a name with 64 bytes, clipping it to 63.
2020-12-09 17:16:43 +11:00
3b5a81936d Fix custom property UI handling names with quotes and back-slashes
Custom property names wasn't escaping strings, causing exceptions
editing custom properties with characters that needed to be escaped.
2020-12-09 17:04:05 +11:00
9d8aefaa5c Fix RNA un-escaping multiple slashes and strings ending with a slash
Fix for T78823 resolved the issue reported but didn't
properly support multiple back-slashes.
2020-12-09 16:56:08 +11:00
ceba6b2c21 Fix T78823: Slash in custom property name does not work
This fixes inserting key-frames for any collection names
containing a back-slash too (bones, modifiers, sequence strips etc).
2020-12-09 16:04:21 +11:00
d1cedf53fa Revert "Fix T78823: Slash in custom property name does not work"
This reverts commit cbae82ba96.

This change introduced the following problems:

- We could no longer reliably duplicate or use an existing
  custom property names.
- We could no longer assume a bone or ID name
  can be used in a custom-property.
- Importers that support custom properties (such as FBX)
  could fail with an exception creating custom properties.
2020-12-09 15:29:28 +11:00
cdfe733e70 Cleanup: use doxy sections for graph_edit.c 2020-12-09 14:34:40 +11:00
9c5d67411a creator: remove reference to SDL_AUDIODRIVER from --help text
This was added when Linux's audio support
often needed to be manually configured.

Further 3rd party libraries have their own environment variables & docs
these need not be part of Blender's help message unless they're likely
to be needed to properly run Blender.
2020-12-09 14:15:24 +11:00
5cdfceaa1a Cleanup: use common 'MOD_WELD_MODE_' prefix 2020-12-09 14:10:30 +11:00
Henrik Dick
9b11a7776f Modifier: Add "Connected" mode to the weld modifier
Implement improvement from T73139 for merging along edges.
It is now called "Connected" mode, while the default is called "All".

With the recent performance improvement, the Connected Mode is in some
cases only double the speed than the usual merge all strategy but in
other cases it may be even faster. The bottleneck is somewhere further
down the line of merging geometry.

The motivation for this patch came from T80897, because the merging in
complex solidify is making it very slow.
Now merging can be removed from solidify without greater consequences,
as this is just a quicker and more advanced algorithm to do the same
thing that solidify currently does slowly.

Reviewed by: mano-wii, campbellbarton

Ref D8966
2020-12-09 12:29:48 +11:00
e17967f890 Fix T83559: File Browser uses wrong operation
When opening a temporary File Browser, we have to make sure the file selection
parameters are refreshed. When opening it in a new Window that would always be
the case, if the File Browser uses a maximized window (as set in the
Preferences), it might reuse space-data from a previous use. So we have to
force the refresh.
Also renamed the relevant function to be more clear about what it's doing.

Mistake in 95b3c4c966.
2020-12-08 21:23:55 +01:00
41fa1fea40 Removing ISC license
Blender actually uses the ICS license, not ISC.
2020-12-08 18:51:56 +01:00
46e66d154c Missing README.blender license files + New BSD cases
I also changed New BSD to BSD 3 Clause.

Differential Revision: https://developer.blender.org/D9791
2020-12-08 18:51:14 +01:00
e08de974c3 Fix T83114: incorrect normals after joining subdivided meshes
This just makes sure that the mesh coming out of the subdivision
surface node has correct normals. Ideally, we would lazily compute
derived data like normals in more cases, but that can be solved later.
Correctness is more important right now.

In order to solve this better, it would be nice if functions like
`BKE_mesh_ensure_normals` would take a `const Mesh *`.
The mesh could be considered to be logically const, because
normals are derived data that is only cached for the current
state of the mesh.
2020-12-08 18:07:50 +01:00
Léo Depoix
40dd70882c Fix T83337: boundary smooth input in subdivision surface node is inverted
Differential Revision: https://developer.blender.org/D9753
2020-12-08 17:49:12 +01:00
Jamell Moore
5b73083d4f Fix T81950: GPencil - Draw - Stoke Placement Stroke Feature Broken
Buffer strokes weren't being the excluded from depth only draw calls
so were being included in depth tests. They are now excluded by
bypassing the creation of the buffer strokes.

Reviewed By: fclem

Differential Revision: https://developer.blender.org/D9742
2020-12-08 16:48:22 +01:00
d7cf464b49 Cycles: Remove "OptiX support is experimental" notice
OptiX support is not in fact experimental anymore, so it is time for that notice to go.
All Cycles features that are currently supported on the GPU do work now when OptiX is selected.
2020-12-08 16:13:04 +01:00
612b83bbd1 Cycles: Enable baking panel in OptiX and redirect those requests to CUDA for now
This enables support for baking when OptiX is active, but uses CUDA for that behind the scenes, since
the way baking is currently implemented does not work well with OptiX.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D9784
2020-12-08 16:06:39 +01:00
9962e5936d Cleanup: Use enum for file selection type definitions
Makes it more clear that these belong together and allows using the enum type
rather than just `int`.
2020-12-08 15:43:15 +01:00
2678953f69 Cleanup: Correct an own earlier commit to use an existing utility function
Didn't know this function existed, better to use it then to avoid verbosity.
2020-12-08 15:00:31 +01:00
95b3c4c966 File Browser: Refactor access to the selection parameters struct
* Avoid direct access to `SpaceFile.params`, use a getter instead. This matters
  because once the asset-browser changes are in, there will be an alternative
  selection parameter object. The getter can return the correct one.
* Rename the function to ensure the parameters. The old name
  `ED_fileselect_get_params()` wasn't a mere getter, it would create the
  parameters if necessary. Now we have an actual getter, so better be clear.
* In some instances, I replaced the old "get" function with the new mere
  getter. So the ensure logic is called less often. However, in these cases we
  should be able to assume the selection parameters were created already as
  part of the editor creation routine.

The term "active" in the new function names may seem a bit odd in the current
context, but that is a preparation for the Asset Browser merge as well. Like
said, there will be two file selection parameter objects in the space.
2020-12-08 14:39:31 +01:00
2a4fe88c13 Cleanup: Use guarded allocator for data-block names returned from file reading
Direcly using the C library allocator functions is usually avoided in favor of
our guarded allocator. It's more useful when debugging.
2020-12-08 12:56:11 +01:00
296bc35638 Fix unexpected "/" path after normalizing empty directory path
Caused problems in the Asset Browser branch when passing an empty path. The
function shouldn't blindly add a slash but sanity-check the input parameters
first.
2020-12-08 12:42:02 +01:00
Bastien Montagne
c0bd240ad0 LibOverride: Add initial support for adding new NLA tracks.
Also makes NLA tracks and strips overridable.

User can either edit existing strips in existing NLA tracks (but not add or remove them), and/or add new NLA tracks after those comming from the linked data.

Most of the work was as usual checking operators and adding protections against illegal operations in override context.

Note that since we can only rely on indices to deal with local added tracks, we forbid any local track being before any linked/original track.

Maniphest Tasks: T72629

Differential Revision: https://developer.blender.org/D9611
2020-12-08 10:55:57 +01:00
78080337f8 PyDoc: expanded documentation for bpy_struct.is_property_set
This patch expands on the `is_property_set` doc-string,
detailing the purpose of the `ghost` argument added in
d3bcbe10c2.

Reviewed By: sybren

Ref D9780
2020-12-08 20:52:31 +11:00
28169cea3d PyDoc: avoid blank lines at the beginning of code-examples 2020-12-08 20:49:28 +11:00
276f6840ed CMake: fix linking with WITH_SDL_DYNLOAD
While this was only needed in 'source/blender/python',
add to ghost to avoid problems in the future.
2020-12-08 20:48:11 +11:00
f43c9499bf Cleanup: use static declarations 2020-12-08 20:44:45 +11:00
d9918e3e53 shaders_test: correct arguments to EEVEE_shaders_cryptomatte_sh_get 2020-12-08 20:44:14 +11:00
922b8abea5 Cleanup: LibOverride: Forgot to update comments in previous commit. 2020-12-08 09:48:20 +01:00
682ccd770c LibOverride: Refactor collection items 'local' helper functions.
It's easier to read and less 'weird' to check that an item is non-local
in a liboverride data-block, than the other way around. Thanks to
@sybren for noticing it.
2020-12-08 09:40:42 +01:00
5f1a155a5e Fix T83117: Curve bevel not handle aligned at end-points
Caused by fix for T80742, 4987b7d347.

Keep the fix that calculates the start/end direction
from adjacent points but only use it as a fallback.
2020-12-08 12:20:27 +11:00
Yevgeny Makarov
ab9952e55f Spelling: Bit Depth Compound Modifiers
Correct usage of compound modifiers like '32-bit'.

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

Reviewed by Julian Eisel
2020-12-07 14:51:06 -08:00
Yevgeny Makarov
41e236c527 UI: Correct Usage of 'Eevee' Name
Use accepted capitalization of Eevee, not 'EEVEE'.

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

Reviewed by Julian Eisel
2020-12-07 13:46:01 -08:00
William Reynish
e258dfa421 UI: Add Heading to Curve Deform Toggles
Adds a heading to the three Properties Curve Deform toggles.

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

Reviewed by Julian Eisel
2020-12-07 13:35:50 -08:00
William Reynish
2b3d85d7d6 IC keymap: Properties and Modifier Changes
Updating Industry Compatible keymap for Property filtering and new Modifier behavior.

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

Reviewed by Julian Eisel
2020-12-07 13:34:06 -08:00
William Reynish
6858065754 Userprefs: Tooltips Section Layout Tweaks
Small improvements to the layout of the Tooltips section in Preferences.

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

Reviewed by Pablo Vazquez
2020-12-07 13:29:53 -08:00
c822f66bb8 Fix T83307: Some modal keys of transform operators don't correspond to the expected effect
The transform modes `shrinkfatten` and `seq_slide` have a special way of
handling events.

They use modal events in a different way than expected.

Therefore, this commit adds special event handles for these modes and
removes the keymodal tips from the status bar.

These effects are already described in the header anyway.
2020-12-07 17:36:23 -03:00
29fb12da58 Fix T83510: Convert Gpencil to curve crash when stroke has zero points
If the stroke had zero points the pointer returned NULL.

Also replaced for loop by FOREACH macro.

This is a corner case of "empty" strokes without points.
2020-12-07 19:08:29 +01:00
3e005a3214 Cleanup: Use LISTBASE_FOREACH in node transform code
Also decrease variable scope.
2020-12-07 11:11:03 -06:00
a61febe739 Add comment to clarify the use of mesh::symmetry
Reviewed By: sybren

Differential Revision: https://developer.blender.org/D9776
2020-12-07 17:17:56 +01:00
4f25e168a2 Fix DPX image output having invalid float metadata
Casting 0xFFFFFFFF to float does not give NaN as is needed here. Found through
compiler warning which is now fixed.
2020-12-07 17:09:34 +01:00
b14b57fc05 Fix failing Eevee render tests after recent changes 2020-12-07 17:09:34 +01:00
Jim Eckerlein
3012446f02 glTF: update Draco library to new version
To support decoding and enhanced encoding of Draco compressed glTF files.

Differential Revision: https://developer.blender.org/D9642
2020-12-07 17:09:34 +01:00
fb82cfb539 Animation: Show Channel Group Colors is now off by default
Change the default for the Show Channel Group Colors preference to OFF.

This option in the user preferences was introduced in rBad85256e7108. It
moved a per-file-per-editor option to the user preferences. As this
option would be frequently turned off by animators, this would now have
to happen only once. This commit takes this one step further, and turns
it off by default, as it can cause major readability issues of the
animation channel list.
2020-12-07 16:58:39 +01:00
bab57550b6 LibOverride: Abstract a bit handling of local items of RNA collections.
RNA collections that support insertion of new items in liboverride
data-block need a special way to distiguish between locale and
orig-from-linked items (since some operations are allowed on the forer,
but no the latter).

In future we want a proper solution to abstract that at the
`BKE_lib_override` level, but for now we need to add some code for each
case.

Note that this commit also fixes a few potential issues with GPencil
modifiers, and constraints, regarding their handling of local overrides.
2020-12-07 16:55:51 +01:00
513578b182 Fix (unreported) LibOverride: GPencil local Modifiers not fully editable.
Missing case in `RNA_property_overridable_get`
2020-12-07 16:55:51 +01:00
c51a70537b Fix T81745: Auto Weights fails with Mirror mod + Vertex Groups X
Fix the Assign Automatic Weights operator in weight paint mode when the
Vertex Groups X option is enabled. This issue was probably introduced in
rB5502517c3c12 where `me->editflag & ME_EDIT_MIRROR_X` was replaced by
either `me->editflag & ME_EDIT_VERTEX_GROUPS_X_SYMMETRY` or
`me->symmetry & ME_SYMMETRY_X`. In this case, the former wasn't working,
so I replaced it with the latter.
2020-12-07 16:30:14 +01:00
2e221de4ce UI Code Quality: Start refactoring Outliner tree-element building (using C++)
Continuation of the work started with 249e4df110. After all display modes
were ported to this new design, this commit starts the (more complex) work on
the individual tree-element types. More concretely it ports animation
tree-elements (action data-blocks, drivers and NLA data).

The commit above explains motivations. In short, we need a better design that's
easier to reason about and better testable.

Changes done here are pretty straight forward and introduce similar class
hierarchy and building patterns as introduced for the display modes already.
I.e. an abstract base class, `AbstractTreeElement` with derived classes for the
concrete types, and a C-API with a switch to create the needed objects from a
type enum. The latter should be replacable with something nicer later on (RAII
based, and type-safer through meta-programming).
Each tree-element type has its own class, with an own header and source file
(okay some closely related types can share a header and source file, like the
NLA ones).

I added some further temporary bits for the transition to the new design, such
as the `TreeElement.type`. It should entirely replace `TreeElement` eventually,
just as `outliner_add_element()` should be quite small by then and easily
replacable by a `TreeBuilder` helper.
2020-12-07 14:51:15 +01:00
634b10acbb Fix missing type check for Outliner eyedropper query
Mistake in 35a5dee2ef.

Code would simply assume that the element under the cursor is an Object if it
was an ID (but not a collection).

This wouldn't cause any issues in current code, since the only other ID that
set the direct-data were collections, which are special in that they don't have
a `TreeStoreElem.type` of 0, which is already being checked for here. And if
there was no direct-data set, the object lookup in the View-Layer would
correctly fail too.
2020-12-07 14:35:54 +01:00
95734e32bf Cleanup: Avoid setting (unsafe) Outliner tree element data that won't be used
I carefully checked and am quite sure for `TSE_ANIMATION_DATA` and
`TSE_NLA_ACTION` the direct-data isn't used at all. This data is stored and
accessed in unsafe ways based on conventions anyway (`void *`). We should aim
for a safer design but it will be difficult to get there. Any removed
complexity will help.
2020-12-07 14:35:54 +01:00
0c0bc61918 Fix access to invalid data in Outliner tree building
Non-ID tree-elements would cast their data pointer to `ID *` and take the name
and ID-Code from there. The name would actually be overridden a few lines
later, so that didn't cause issues. But the ID-Code stored inside the tree
element kept an undefined value. In practice that probably didn't cause many
issues either, since it's just an undefined value that was very unlikely to
take a valid 16-bit ID-code value, meaning ID-Code checks would simply fail as
they should. Further there typically are other checks to see if the element
actually represents an ID.
However, in theory this may have caused a few random crashes or
data-corruptions.
2020-12-07 14:35:54 +01:00
cf9275dd4e Fix failing Cycles tests after Cryptomatte changes
For old files without Cycles cryptomatte settings, must provide the defaults.
2020-12-07 13:13:49 +01:00
d329a6a937 Fix bug in cleanup commit
Fix a copy-paste error in rB11c4066159e
2020-12-07 12:54:46 +01:00
11c4066159 Cleanup: partial Clang-Tidy modernize-loop-convert
Modernize loops by using the `for(type variable : container)` syntax.

Some loops were trivial to fix, whereas others required more attention
to avoid semantic changes. I couldn't address all old-style loops, so
this commit doesn't enable the `modernize-loop-convert` rule.

Although Clang-Tidy's auto-fixer prefers to use `auto` for the loop
variable declaration, I made as many declarations as possible explicit.
To me this increases local readability, as you don't need to fully
understand the container in order to understand the loop variable type.

No functional changes.
2020-12-07 12:41:17 +01:00
2072134faa UI: Fix mistakes in UI messages. 2020-12-07 10:57:27 +01:00
7d2745f8b3 Fix Cryptomatte panel not visible in EEVEE
Caused by {rB5baae026a86f}
2020-12-07 09:31:05 +01:00
9ac6ef7036 File Subversion Bump: 2.92.5 2020-12-07 08:07:18 +01:00
Jeroen Bakker
5baae026a8 Cycles: Use Blender Cryptomatte Settings.
Blender has now the place to store the Cryptomatte settings. This patch
migrates Cycles to use the new settings.

Reviewed By: Brecht van Lommel

Differential Revision: https://developer.blender.org/D9746
2020-12-07 08:01:49 +01:00
Greg Neumiller
3d0b65f89b Fix T83296: Unknown actions no longer perform an undo push
str_len_clip is initialized to 0, so when "Unknown Action"
occurs, set str_len_clip appropriately.
Regression in 0688309988

Ref D9759
2020-12-07 13:44:23 +11:00
Greg Neumiller
c2a01a6c11 Fix T83347: Smart UV project crashes with wire edges
Missing NULL check.
Regression in 9296ba8674

Ref D9757
2020-12-07 13:44:17 +11:00
fff0032a25 Cleanup: spelling 2020-12-07 13:25:53 +11:00
5c3fa5a424 Cleanup: correct enum type 2020-12-07 13:25:49 +11:00
ba740ad2ab GPencil: Enable Layer Onion Skin by default 2020-12-06 22:27:28 +01:00
6f22a536e6 Fluid: Updated Mantaflow source files
Includes outflow optimization - might have been the cause of instabilities.
2020-12-06 21:56:43 +01:00
Yevgeny Makarov
ee70eb96cf UI: Alert Dialog Helper Function
Shared helper function to create a split layout with an alert icon for popup dialogs.

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

Reviewed by Julian Eisel
2020-12-06 11:17:51 -08:00
Yevgeny Makarov
79eeabafb3 UI: 'About Blender' with Full Logo
New layout for the 'About' dialog featuring the full version of the Blender logo.

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

Reviewed by Hans Goudey
2020-12-06 10:29:26 -08:00
a90504303e Reorder fields in boolean's ITT_value to save memory. 2020-12-06 10:58:14 -05:00
538f41e949 Doxygen: Increase lookup cache
I could not measure any major speedup/memory usage but this resolves a 
message while running doxygen.
2020-12-05 20:17:32 -05:00
eb4eb07065 Doxygen: Disable HTMLHELP
This feature is intended to generate Microsoft Compiled HTML Help files 
which is not something we use/need.
This also fixes an error in generation because the executable cannot be 
found.
2020-12-05 20:17:32 -05:00
52a6c4f34d Fix crashes with invisible Outliners on fullscreen or window closing
I didn't actually confirm this is caused by invisible Outliners. But I'm pretty
sure the error happens with Outliners that aren't initialized (so were open in
an area before, but another editor is active there currently).
In that case, the runtime data may not be set yet and that is fine.

Fixes T83420.
2020-12-05 14:56:13 +01:00
237f9da4a0 Fix T83400: GPencil onion skin not visible when Edit Lines is enabled
The Edit Lines flag was not checking if Onion was enabled. In 2D template this is disabled by default, but default template has enabled it.
2020-12-05 13:55:10 +01:00
8982a315b7 Add more timing hooks for boolean. 2020-12-05 07:48:41 -05:00
887a602448 Cleanup: Finish porting outliner tree building to C++
No functional changes. This is a few minor cleanups to the remaining C
code for building the outliner tree after parts have been moved to C++.

Differential Revision: https://developer.blender.org/D9741
2020-12-04 17:58:46 -07:00
48acf15f98 Cleanup: Outliner Data API display mode
No functional changes. Moves the data API display building code to C++.

Differential Revision: https://developer.blender.org/D9741
2020-12-04 17:54:19 -07:00
aaa02984d3 Cleanup: Outliner scenes display mode
No functional changes. The scene display building code has been moved
to C++.

Differential Revision: https://developer.blender.org/D9741
2020-12-04 17:53:42 -07:00
1db40c29e5 Cleanup: Outliner orphan data display mode
No functional changes. Code is ported to C++ with additional cleanups to
the logic and variable names.

Differential Revision: https://developer.blender.org/D9741
2020-12-04 17:51:51 -07:00
1cc0a59be6 Cleanup: Outliner video sequencer display mode
No functional changes. Code is ported to C++. Variable names and logic
are also improved.

Differential Revision: https://developer.blender.org/D9741
2020-12-04 17:50:46 -07:00
ea37e4ea5a Fix incorrect variable name after last commit 2020-12-04 14:46:51 -06:00
67faa85fb0 Cleanup: Use LISTBASE_FOREACH macro in windowmanager intern
Also decrease the scope of variables related to the loops.
2020-12-04 13:50:53 -06:00
3daf28388b Cleanup: Move Outliner runtime hash into internal runtime struct, out of DNA
This way Outliner internal data stays internal, non-Outliner code will not be
able to access and mess with this. Further it allows us to use the real type
(rather than `void *`), change the type to a C++ container if needed and
slightly reduces the size for every Outliner stored in files.

Slightly changed how we set the `SO_TREESTORE_REBUILD` for this, but it should
effectively behave the same way as before.
2020-12-04 20:00:45 +01:00
f5eaf67e34 Atomics: Add 16 bit fetch + AND and fetch + OR signed integer operations
I could use a 16 bit atomic fetch + AND for D9719. The alternative would be to
turn a `short` into a `int` in DNA, which isn't a nice workaround.

Also adds tests for the new functions.
2020-12-04 18:28:46 +01:00
1d2c70d761 Fix API doc generation.
BMesh auto-extracting API info does not support comments inside BMesh
operators parameters definition.
2020-12-04 16:45:10 +01:00
719dfd4088 macOS deps: Support building clang tidy
This patch builds clang-extra-tools on macOS for the
clang-tidy binary. The script "run-clang-tidy.py" is
also harvested because using the `CMAKE_C[XX]_CLANG_TIDY`
option can miss out some files (like makesrna), and using the
script is faster as it does not compile the files.
Thanks to `@LazyDodo` for the base patch D8502.

Reviewed By: LazyDodo, sebbas, #platform_macos
Differential Revision: https://developer.blender.org/D9450
2020-12-04 21:13:15 +05:30
d07009498a Transform: Don't use Automatic Constraint Plane in 2D editors
Technically it shouldn't have any effect on these editors.

The key tips in the header can be misleading.

The effect it previously had was not intended.
2020-12-04 12:31:30 -03:00
b919511607 Cleanup: Deduplicate constraint event code 2020-12-04 12:31:30 -03:00
fe1f05de1b i18n utils CLI: add missing RTL process command. 2020-12-04 15:54:50 +01:00
ca4b809e63 i18n utils: Add first version of the CLI wrapper around i18n tools.
Plan is to use that in new 'buildbot' pipeline to automate generation of
i18n files for Blender.
2020-12-04 15:14:16 +01:00
b3306cf669 i18n utils: Add a helper to list and match po files with languages codes.
This code was previously done in the add-on, but we'll need it for the
CLI tool as well, so now it is a utils generator instead.
2020-12-04 15:14:16 +01:00
06ae2e3a60 i18n utils : Reduce dependency to Blender bpy API, step 2.
Remove some top imports of bpy, only import it in a few specific
functions that only make sense when used whithin Blender anyway.
2020-12-04 15:14:16 +01:00
7bd8b8cdac i18n utils: reduce dependency to Blender bpy API, step 1.
This involves re-implementing some of Blender-defined helpers in utils,
we keep debug code to ensure those are still matching on
behavior/results sides.

This will allow to get more i18n tools independent from blender
executable.
2020-12-04 15:14:16 +01:00
69dd7e42c8 i18n utils: Cleanup. 2020-12-04 15:14:16 +01:00
04d3b54000 Cleanup: Declare variables where initialized 2020-12-04 08:03:14 -06:00
4bb5314754 Cleanup: Use typedef for button string info type
Before, it wasn't clear what the int in `uiStringInfo` was supposed to
store. Using a typedef can make this someone more explicit.
2020-12-04 08:01:54 -06:00
6fda30cc54 Fix T83177: Industry Compatible keymap: MMB-dragging to transform engages axis-constraining on release
With rBc0677b662f4b, we try to track all modal events in order to detect the
one corresponding to the release.

But modifier keys can mask the modal event and thus confirm realease ends up
being skipped.

This resulted in the T83387.

With this commit we now read the actual key drop value in the modal event.

This fixes T83387
2020-12-04 10:49:58 -03:00
2de49d1ff7 Revert "Fix T83177: Industry Compatible keymap: MMB-dragging to transform engages axis-constraining on release"
This reverts commit c0677b662f.
2020-12-04 10:49:58 -03:00
c10546f5e9 Cycles: Add support for shader raytracing in OptiX
Support for the AO and bevel shader nodes requires calling "optixTrace" from within the shading
VM, which is only allowed from inlined functions to the raygen program or callables. This patch
therefore converts the shading VM to use direct callables to make it work. To prevent performance
regressions a separate kernel module is compiled and used for this purpose.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D9733
2020-12-04 13:04:11 +01:00
7f2d356a67 Cleanup: Clang-Tidy, modernize-use-using
Replace `typedef` with `using` in C++ code.

In the case of `typedef struct SomeName { ... } SomeName;` I removed the
`typedef` altogether, as this is unnecessary in C++. Such cases have been
rewritten to `struct SomeName { ... };`

No functional changes.
2020-12-04 12:46:43 +01:00
10a8286a26 Cleanup: Clang-tidy, actually enable the modernize-use-override rule
Forgot this in rB168909d9741.

No functional changes.
2020-12-04 12:31:49 +01:00
168909d974 Cleanup: Clang-Tidy, modernize-use-override
No functional changes.
2020-12-04 12:02:52 +01:00
1166110a9d Cleanup: clang-format
Rerun `make format`.

No functional changes.
2020-12-04 11:28:56 +01:00
958df2ed1b Cleanup: Clang-Tidy, modernize-deprecated-headers
No functional changes.
2020-12-04 11:28:09 +01:00
f0df46287a Cleanup: replace NULL with nullptr in C++ code
No functional changes.
2020-12-04 10:50:06 +01:00
6ed6741ee3 Point users to new location of "Show Group Colors" option
In ad85256e71 the "Show Group Colors" option was changed from a
per-editor option to a user preference. Since so many people wanted to
turn this option off, this makes sense. However, this move caused some
confusion because the option was just gone from the menu.

This commit adds a dummy menu item. It's disabled, and the tooltip
explains that the option can now be found in Preferences.

T83390 was created to track the removal of these hints.

Reviewed by: Severin

Differential Revision: https://developer.blender.org/D9735
2020-12-04 10:14:44 +01:00
Jeroen Bakker
76a0b322e4 EEVEE Cryptomatte
Cryptomatte is a standard to efficiently create mattes for compositing. The
renderer outputs the required render passes, which can then be used in the
compositor to create masks for specified objects. Unlike the Material and Object
Index passes, the objects to isolate are selected in compositing, and mattes
will be anti-aliased.

Cryptomatte was already available in Cycles this patch adds it to the EEVEE
render engine. Original specification can be found at
https://raw.githubusercontent.com/Psyop/Cryptomatte/master/specification/IDmattes_poster.pdf

**Accurate mode**

Following Cycles, there are two accuracy modes. The difference between the two
modes is the number of render samples they take into account to create the
render passes. When accurate mode is off the number of levels is used. When
accuracy mode is active, the number of render samples is used.

**Deviation from standard**

Cryptomatte specification is based on a path trace approach where samples and
coverage are calculated at the same time. In EEVEE a sample is an exact match on
top of a prepared depth buffer. Coverage is at that moment always 1. By sampling
multiple times the number of surface hits decides the actual surface coverage
for a matte per pixel.

**Implementation Overview**

When drawing to the cryptomatte GPU buffer the depth of the fragment is matched
to the active depth buffer. The hashes of each cryptomatte layer is written in
the GPU buffer. The exact layout depends on the active cryptomatte layers. The
GPU buffer is downloaded and integrated into an accumulation buffer (stored in
CPU RAM).

The accumulation buffer stores the hashes + weights for a number of levels,
layers per pixel. When a hash already exists the weight will be increased. When
the hash doesn't exists it will be added to the buffer.

After all the samples have been calculated the accumulation buffer is processed.
During this phase the total pixel weights of each layer is mapped to be in a
range between 0 and 1. The hashes are also sorted (highest weight first).

Blender Kernel now has a `BKE_cryptomatte` header that access to common
functions for cryptomatte. This will in the future be used by the API.

* Alpha blended materials aren't supported. Alpha blended materials support in
  render passes needs research how to implement it in a maintainable way for any
  render pass.

This is a list of tasks that needs to be done for the same release that this
patch lands on (Blender 2.92)

* T82571 Add render tests.
* T82572 Documentation.
* T82573 Store hashes + Object names in the render result header.
* T82574 Use threading to increase performance in accumulation and post
  processing.
* T82575 Merge the cycles and EEVEE settings as they are identical.
* T82576 Add RNA to extract the cryptomatte hashes to use in python scripts.

Reviewed By: Clément Foucault

Maniphest Tasks: T81058

Differential Revision: https://developer.blender.org/D9165
2020-12-04 08:46:34 +01:00
Jeroen Bakker
2bae11d5c0 EEVEE: Arbitrary Output Variables
This patch adds support for AOVs in EEVEE. AOV Outputs can be defined in the
render pass tab and used in shader materials. Both Object and World based
shaders are supported. The AOV can be previewed in the viewport using the
renderpass selector in the shading popover.

AOV names that conflict with other AOVs are automatically corrected. AOV
conflicts with render passes get a warning icon. The reason behind this is that
changing render engines/passes can change the conflict, but you might not notice
it. Changing this automatically would also make the materials incorrect, so best
to leave this to the user.

**Implementation**

The patch adds a copies the AOV structures of Cycles into Blender. The goal is
that the Cycles will use Blenders AOV defintions. In the Blender kernel
(`layer.c`) the logic of these structures are implemented.

The GLSL shader of any GPUMaterial can hold multiple outputs (the main output
and the AOV outputs) based on the renderPassUBO the right output is selected.
This selection uses an hash that encodes the AOV structure. The full AOV needed
to be encoded when actually drawing the material pass as the AOV type changes
the behavior of the AOV. This isn't known yet when the GLSL is compiled.

**Future Developments**

* The AOV definitions in the render layer panel isn't shared with Cycles.
  Cycles should be migrated to use the same viewlayer aovs. During a previous
  attempt this failed as the AOV validation in cycles and in Blender have
  implementation differences what made it crash when an aov name was invalid.
  This could be fixed by extending the external render engine API.
* Add support to Cycles to render AOVs in the 3d viewport.
* Use a drop down list for selecting AOVs in the AOV Output node.
* Give user feedback when multiple AOV output nodes with the same AOV name
  exists in the same shader.
* Fix viewing single channel images in the image editor [T83314]
* Reduce viewport render time by only render needed draw passes. [T83316]

Reviewed By: Brecht van Lommel, Clément Foucault

Differential Revision: https://developer.blender.org/D7010
2020-12-04 08:14:07 +01:00
2bd0263fbf Fix T83346: Scrolling doesn't work with mouse over panel header
Just a misplaced assignment to the return value from the panel handler
in rB600fb28b6295.
2020-12-03 23:37:16 -06:00
Yevgeny Makarov
a88e6261db UI: Remove Decorators from Keymap Preferences
Improvements to the layout of the Keymaps section of Preferences by removing unneeded Decorator columns.

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

Reviewed by Hans Goudey
2020-12-03 17:23:13 -08:00
cc6ec71b19 Sculpt: Wet paint area radius
This adds a new property to the sculpt vertex color paint brush to limit
the area of the brush that is going to be used to sample the wet paint
color. This is exactly the same concept as normal radius and area radius
that exist for sculpting brushes for sampling the surface depth and
orientation.

When working near color hard edges, this allows to prevent the color
from the other side of the edge to blend into the wet paint.

With 1.0 (the previous default) wet paint radius, as soon as the brush touches
one vertex of the other color, the wet paint mix color changes, making it
impossible to maintain the border between the two colors.

Reviewed By: sergey, dbystedt, JulienKaspar

Differential Revision: https://developer.blender.org/D9587
2020-12-03 22:55:35 +01:00
9234a6a619 Fix T82872: Add design task link for tilt support
Reviewed By: sergey, Blendify

Maniphest Tasks: T82872

Differential Revision: https://developer.blender.org/D9615
2020-12-03 22:50:02 +01:00
1bc75dfa4a Sculpt: Allow inverting the Erase Displacement mesh filter
When inverting erase displacement the filter can increase the
displacement over the limit surface. After using apply base, this can be
used as an alternative intensify details as it usually gives better
results.

This is the same concept as smoothing inverting to intensify details.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9679
2020-12-03 22:48:12 +01:00
92e44ce67c UI: Add sculpt stats to statusbar
This was missing from D9623. Now the same sculpt scene stats are also
displayed in the status bar.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9700
2020-12-03 22:46:32 +01:00
82e401031f UI: Fix Node Groups color in Geometry Nodes
Node Groups didn't have a category assigned so they looked like inputs (red)
instead of the Node Group theme color (green by default).
2020-12-03 20:21:09 +01:00
f3b08af24c Fix T83352: Move with constraint showing an incorrect value in the header
The displayed value was always that of the x axis.
2020-12-03 15:29:32 -03:00
f637b47064 MSVC: Enable clang-tidy analyser
This enables the use of clang-tidy in the VS IDE.

To use it:

1 - Enable WITH_CLANG_TIDY in your cmake configuration
2 - From the Analyse pull down menu select Run Code Analysis on...

The analyser is currently not enabled by default on build
given it is quite slow and there are quite a few problems
it reports that we still need to deal with.
2020-12-03 11:00:58 -07:00
769818f7f4 GPencil: Reduce UI range for Simplify Adaptive factor
The old range was too big, so now the soft limit is between 0 and 5
2020-12-03 17:42:12 +01:00
c821aa8ca7 GPencil: Fix unreported refresh of stroke after using Arrange operator
When change the order of the stroke using the arrange operator, the arrange was done, but the viewport did not display the result until you refresh the viewport.
2020-12-03 17:18:01 +01:00
986955a2d5 GPencil: Add Vertex Paint operators to Paint menu
These operators existed since 2.83, but the menu was hidden by error.

Also the operators have been cleanup and make multiframe compatible.

Reviewed By: mendio

Differential Revision: https://developer.blender.org/D9671
2020-12-03 16:49:40 +01:00
570a16da18 Fix: remove show_group_colors from graph editor menu
The `show_group_colors` option was moved to the user preferences in
ad85256e71, but accidentally remained in the graph editor menu.
2020-12-03 16:32:58 +01:00
107231eb95 Geometry Nodes: improve support for Color attributes
* Add typed attribute accessors for color attributes.
* Support implicit conversions between colors and floats.
2020-12-03 16:25:48 +01:00
2c181521ec Geometry Nodes: add custom data type getter for attribute accessor
This is just an utility method, that avoids that the caller has to do
the conversion every time it is necessary.
2020-12-03 16:20:09 +01:00
675d84826e Fix T83315: Crash showing animation channel context menu after baking sound
Fix a crash when right-clicking in the Graph Editor animation channel
list. The code for getting selected keyframes was not checking for baked
curves.
2020-12-03 15:28:14 +01:00
a3c4091215 Fix Cycles device kernels containing debug assertation code
NanoVDB includes "assert.h" and makes use of "assert" in several places and since the compile
pipeline for CUDA/OptiX kernels does not define "NDEBUG" for release builds, those debug
checks were always added. This is not intended, so this patch disables "assert" for CUDA/OptiX
by defining "NDEBUG" before including NanoVDB headers.
This also fixes a warning about unknown pragmas in NanoVDB thrown by the CUDA compiler.
2020-12-03 15:20:50 +01:00
5d13082622 Tracking: Improve multithreading of tracking many markers
This change solves a bottleneck which was caused by attempt to cache
postprocessed search areas used for tracking. It was a single cache
used by all threads, which required to have some synchronization
mechanism. This synchronization turned out to be making all threads
to idle while one thread is accessing the cache. The access was not
cheap, so the multi-threading did not provide expected speedup.

Current solution is to remove the cache of search areas. This avoids
any threading synchronization overhead because there is no need for
it anymore. The downside is that for certain configurations tracking
became slower when comparing to master branch. There is no expected
slowdown compared to 2.91 release.

The slowdown is mainly experienced when using big search area and
keyframe matching strategy. Other cases should still be within a
ballpark of performance of single-threaded code prior to this change.
The reason why is it so is because while this change makes it so the
image accessors needs to process images multiple times the complexity
of this process is almost the same as all the overhead for the cache
lookup and maintenance.

Here are Some numbers gained on different configurations.

CPU: Intel Xeom CPU E5-2699 v4
OS: Linux
Footage: Old_Factory MVI_4005.mov from the first part of Track Match
Blend training which can be found on the Blender Cloud.

Tracking 443 markers across 250 frames. The unit is seconds.
File: F9433209

  2.91: 401.520874
before: 358.650055
 after:  14.966302

Tracking single marker across 250 frames. The unit is seconds.
File: F9433211

                         2.91      before     after
        Big keyframe   1.307203   1.005324   1.227300
  Big previous frame   1.144055   0.881139   0.944044
      Small keyframe   0.434015   0.197760   0.224982
Small previous frame   0.463207   0.218058   0.234172
         All at once   2.338268   1.481220   1.518060
2020-12-03 14:51:11 +01:00
Henrik Dick
a6c4e39876 Add Custom Object Space to Constraints
Add Custom Space to the list of space conversions for constraints.

Constraints can use World Space, Local Space, Pose Space, Local with
Parent, and now also Custom Space with a custom object to define the
evaluation space.

The Custom Space option uses the Local Space of an other
object/bone/vertex group. If selected on owner or target it will show a
box for object selection. If an armature is selected, then it will also
show a box for bone selection. If a mesh object is selected it will show
the option for using the local space of a vertex group.

Reviewed By: #animation_rigging, sybren, Severin, angavrilov

Differential Revision: https://developer.blender.org/D7437
2020-12-03 11:20:21 +01:00
899dcc5f60 Fix linker errors when building without Cycles
Fix linker errors by explicitly linking PugiXML when OpenImageIO is
used.

PugiXML has been separated from OpenImageIO (D8628). This means that any
time OpenImageIO libraries are linked, the PugiXML libraries have to be
linked as well. This was set up correctly for Cycles, but not for imbuf.
Because of this, building without Cycles but with OIIO would produce
linker errors.
2020-12-03 11:07:06 +01:00
acaee97c2f Fix accendental copy/paste errors after last commit 2020-12-02 22:26:14 -05:00
fc05e2c0e0 Bmesh: Improve documentation of op parameters
These comments are used to generate Py API docs.
Most of the comments are just copies of the mesh operator counterparts.

More improvements can be made here in the future.

Thanks to Jon Denning on twitter:

https://twitter.com/gfxcoder/status/1334178566993555459
2020-12-02 22:01:00 -05:00
dc4feed59d Cleanup: view-port --> 2D/3D Viewport 2020-12-02 18:16:23 -05:00
cba5137f32 Fix crash in outliner on cursor hover
The previous commit surfaced a bug introduced in rBab4654cdfe8f in which
a boolean wasn't initialized to false.
2020-12-02 09:25:45 -07:00
3fc178b19e Outliner: Highlight icons on cursor hover
The icons for collapsed children already draw highlighted when hovered.
Because the item icons are now select targets (for outliner to properties
editor tab switching) this adds highlights on hover for all outliner
element icons.
2020-12-02 08:58:32 -07:00
3d0c5455ed Cleanup: Store "is_active" instead of pointer property in panel type
This is consistent with the way other panel type fields are stored.
2020-12-02 16:44:40 +01:00
9281a1f4eb UI: Add new node colors for geometry nodes
During the development of the new nodes in the `geometry-nodes` branch
the color of the new nodes wasn't considered, so all of the nodes ended
up red, the color for "input" nodes. This patch introduces two new
colors, one for "Geometry" and one for "Attributes". There are only two
attribute nodes currently, but the next sprint will add two more,
attribute mix, and sample from texture. The attribute nodes are
conceptually different enough from the nodes that modify the geometry
that they deserve their own color.

Differential Revision: https://developer.blender.org/D9682
2020-12-02 16:34:06 +01:00
8522b1b6fb Geometry Nodes: automatically reconnect when swapping inputs
This makes it easier to swap the inputs to the Join Geometry node.
The behavior is the same as in the Math node.
2020-12-02 16:34:06 +01:00
074de755e9 Geometry Nodes: correct modifier name when creating from node editor
The name should be the same as when the modifier is created in the
modifier tab of the properties editor.
2020-12-02 16:34:06 +01:00
58cc8938e1 Fix T83309: Hide metadata when overlays are off.
Inconsistency between overlay popover and implementation. Now the
metadata will not be visible when the overlays are turned off.
2020-12-02 16:19:15 +01:00
60760bd470 Geometry Nodes: unify icons -> use ICON_NODETREE for everything
Until there is a icon made specially for this, the nodetree icon is up
for grabs. Using it in the nodegroup + modifier + editor helps the users
to make a connection on where to edit those modifiers.
2020-12-02 15:38:47 +01:00
ea74ed5a7a Cleanup: remove all of "#ifdef WITH_POINT_CLOUD"
Since Point Cloud was removed from experimental this is no longer needed.
2020-12-02 15:38:47 +01:00
3d3a20d6d1 Cleanup: remove most of "#ifdef WITH_GEOMETRY_NODES"
The ones around the simulation datablock are still there, since they are not
needed for the features planned for master yet.
2020-12-02 15:38:47 +01:00
dc614c68ef Preferences: remove Point Cloud object from experimental
The point cloud object is the only one that will support instancing at
first. So we can expose it as a regular object.

It is limited since it has no edit mode. But this is not different than
the volume object.
2020-12-02 15:38:47 +01:00
56931f63c6 Preferences: remove Geometry Nodes from experimental 2020-12-02 15:38:47 +01:00
b1d1a58c77 Geometry Nodes: improve operators for node editor header
This allows users to create new modifiers directly from the
Geometry Nodes Editor.
2020-12-02 15:38:47 +01:00
600fb28b62 Geometry Nodes: active modifier + geometry nodes editor
This commit adds functions to set and get the object's active
modifier, which is stored as a flag in the ModifierData struct,
similar to constraints. This will be used to set the context in
the node editor. There are no visible changes in this commit.

Similar to how the node editor context works for materials, this commit
makes the node group displayed in the node editor depend on the active
object and its active modifier. To keep the node group from changing,
just pin the node group in the header.

* Shortcuts performed while there is an active modifier will affect
  only that modifier (the exception is the A to expand the modifiers).
* Clicking anywhere on the empty space in a modifier's panel will make it active.

These changes require some refactoring of object modifier code. First
is splitting up the modifier property invoke callback, which now needs
to be able to get the active modifier separately from the hovered
modifier for the different operators.

Second is a change to removing modifiers, where there is now a separate
function to remove a modifier from an object's list, in order to handle
changing the active.

Finally, the panel handler needs a small tweak so that this "click in panel"
event can be handled afterwards.
2020-12-02 15:38:47 +01:00
fc4a853846 Geometry Nodes: support muted nodes
The handling of muted nodes is handled at the derived node tree
level now. This is also where expanding node groups is handled.
Muted nodes are relinked and removed from the derived tree
during construction. The geometry node evaluation code does
not have to know about muted nodes this way.
2020-12-02 15:38:47 +01:00
ae0aa4b94c Geometry Nodes: support geometry components in depsgraph object iterator
Objects can evaluate to a geometry set instead of a single ID (only point cloud
objects for now). In the depsgraph object iterator, the evaluated geometry
components are expanded into temporary objects.

It's important to note that instanced objects can also contain geometry
components. Therefore, they have to be split up into multiple objects
as well in some cases.

At a high level the iterator works like so:

```
for object in depsgraph:
    for component in object:
        yield object_from_component(component)
    for dupli in make_duplis_list(object):
        for component in dupli:
            yield object_from_component(component)
```

DEG_iterator_objects_next has been cleaned up, to make this structure
a bit more apparent.

This should not change anything for objects that are not point clouds.
2020-12-02 15:38:47 +01:00
6be56c13e9 Geometry Nodes: initial scattering and geometry nodes
This is the initial merge from the geometry-nodes branch.
Nodes:
* Attribute Math
* Boolean
* Edge Split
* Float Compare
* Object Info
* Point Distribute
* Point Instance
* Random Attribute
* Random Float
* Subdivision Surface
* Transform
* Triangulate

It includes the initial evaluation of geometry node groups in the Geometry Nodes modifier.

Notes on the Generic attribute access API

The API adds an indirection for attribute access. That has the following benefits:
* Most code does not have to care about how an attribute is stored internally.
  This is mainly necessary, because we have to deal with "legacy" attributes
  such as vertex weights and attributes that are embedded into other structs
  such as vertex positions.
* When reading from an attribute, we generally don't care what domain the
  attribute is stored on. So we want to abstract away the interpolation that
  that adapts attributes from one domain to another domain (this is not
  actually implemented yet).

Other possible improvements for later iterations include:
* Actually implement interpolation between domains.
* Don't use inheritance for the different attribute types. A single class for read
  access and one for write access might be enough, because we know all the ways
  in which attributes are stored internally. We don't want more different internal
  structures in the future. On the contrary, ideally we can consolidate the different
  storage formats in the future to reduce the need for this indirection.
* Remove the need for heap allocations when creating attribute accessors.

It includes commits from:
* Dalai Felinto
* Hans Goudey
* Jacques Lucke
* Léo Depoix
2020-12-02 15:38:47 +01:00
ddbe3274ef BLI: add missing const 2020-12-02 15:38:47 +01:00
d65628466a Functions: add float2 cpp type
This also adds a hash function for `float2`, because `CPPType`
expects that currently.
2020-12-02 15:38:47 +01:00
8268b9827a Theme: update shader node color to match socket color
Reviewed by Brecht

Ref T82689.
2020-12-02 15:38:47 +01:00
96e131f246 UI: update node socket colors
Note: This also changes the Shader socket color, to match "Shading" in the Outliner.

Theme update for shader nodes will be committed separately.

Ref T82689.
2020-12-02 15:38:47 +01:00
69f57550bc Nodes: add geometry socket type
We still have to pick a color for this socket.

Ref T81848.
2020-12-02 15:38:47 +01:00
1d6284a6d5 Functions: add generic pointer class
This class represents a pointer whose type is only known at runtime.
2020-12-02 15:38:47 +01:00
c7f518fe35 Functions: add move operations to CPPType
Those are sometimes needed when dealing with c++ types in a generic way.
2020-12-02 15:38:47 +01:00
85f9d319a4 Fix T83293: crash when selecting bone
This partially reverts rBe922dd7d8a307c54d49bc01649a12610b022192b.
The issues fixed by that commit is still fixed.

Reviewers: fclem
2020-12-02 15:33:51 +01:00
13c3ad7e76 GPU: Show Limited support message for polaris + 20.11.2 drivers.
See T82856 for details.
2020-12-02 15:30:00 +01:00
f8d1378b84 Deps: Additional changes for PugiXML on macOS
This commit expands the Windows-specific code in rBdca9aa0053f7 and Linux-specific code in rB33b7d53df08a.

It also fixes a capitalization issue in FindPugiXML.cmake
2020-12-02 15:18:05 +01:00
d40f5d41af GPU: Blacklist unsupported GPUs that crash during startup.
Since Blender 2.91 the TeraScale 2 based cards crash during startup.
This patch will show the user a screen that the platform they are using
isn't supported.

The GPUs have been carefully handpicked from dozens of reports. T83124,
T83127, T83103, T83091, T83045, T83065, T82750, T82889, T82925, T82640,
T82429, T82436, T82446.
2020-12-02 15:17:13 +01:00
c576d65c2f Fix T83161: Crash when moving ruler endpoints and opening or closing the toolshelf
`invert_snap` could be called before `snap_gizmo->keymap` was found.

Use the lazy initialization in `invert_snap` then.
2020-12-02 10:27:41 -03:00
Henrik Dick
ec39d8de4a Transform: Correct Mirror for Object Mode along arbitrary axis
This fixes T68521, T82334.

The object are not properly mirrored in object mode.

For mirroring an object that has an arbitrary rotation along the X axis
this is the procedure:
1. mirror x location.
2. negate x scale of the
3. negate y and z component of the rotation (independent of which rotation mode is used).

This knowledge applies now for all angles and axes to finally make the
mirror operation work in object mode.

The new mirror function has the downside that it can not (in this form)
be used with proportional editing.

This is no problem since the old behavior can still be replicated by
scaling with -1 along any axis.

The solution to get perfect mirrors can not work for scaling in general,
because in that case there could be scew created.

Reviewed By: mano-wii

Differential Revision: https://developer.blender.org/D9625
2020-12-02 09:22:37 -03:00
da8dc204bd Fix T83119: Crash with topology mirror affecting a hidden vertex
Caused by rBba97da21acf2.

For non-topology mirror hidden verts were never respected/included in
EDBM_verts_mirror_cache_begin (they were excluded from the kdtree).

Prior to said commit, hidden mirrored verts that were still in the map
would have been excluded in a separate loop over vertices in
'editmesh_mirror_data_calc()' by checking BM_ELEM_HIDDEN. Due to the new
nature of this function this check was now moved to
EDBM_verts_mirror_cache_begin.

Maniphest Tasks: T83119

Differential Revision: https://developer.blender.org/D9673
2020-12-02 12:35:51 +01:00
Christian Friedrich
e4204a3979 Add Custom Falloff Curve to the Vertex Weight Proximity Modifier.
The Vertex Weight Edit Modifier already got the Custom Curve, there was no
real reason for the proximity not to have it as well.

With some fixes by Bastien Montagne (@mont29).

Reviewed By: mont29

Differential Revision: https://developer.blender.org/D9594
2020-12-02 11:20:03 +01:00
84451f89f5 Fix T83300: constant scene refreshing in Cycles with empty volumes
This infinite loop is caused by a conflict between the volume mesh
creation which unintentionally clears the shaders before early exiting
when no grid is found, and the Blender exporter which adds back the
shaders causing us to reupdate as the shaders changed.

To fix this simply preserve the shaders on the Volume node.
2020-12-02 11:18:45 +01:00
67353ae630 Fix build error on builds without audaspace
This was caused by incorrect argument type in dummy function
`rna_Sequences_new_sound()`

Caused by 13ca11ac52
2020-12-02 10:13:45 +01:00
2afc508eb4 Fix T83090: Multiple warnings accessing brush enum data.
We already have generic enums for empty and default 'none' value.
2020-12-02 09:29:37 +01:00
da22ec1254 Cleanup: Fix CMake syntax error in the last commit. 2020-12-02 13:55:52 +05:30
6535135ef7 CMake/macOS: consider MinSizeRel too for ASan. 2020-12-02 13:23:25 +05:30
a715839a55 Cleanup: add commits to .git-blame-ignore-revs. 2020-12-02 13:20:43 +05:30
13ca11ac52 VSE: Unify sequences collections API
Use RNA_api_sequences() for SequenceEditor and MetaSequence
sequences member.

Defines pair of dispatch functions rna_Sequences_editing_* and
rna_Sequences_meta_* that pass pointer to seqbase to
rna_Sequences_* function.

Downside of this implementation is, that it defines 2 seemingly
different RNA collections - SequencesMeta and SequencesTopLevel

Reviewed By: mont29

Differential Revision: https://developer.blender.org/D9601
2020-12-02 05:51:22 +01:00
1176591574 Codesign: Allo non-zero exit code for signtool on Windows 2020-12-01 17:16:48 +01:00
33b7d53df0 Deps: Add PugiXML as an official dependency
PugiXML was historically shipped hidden embedded into OIIO, the Grease
Pencil team had a requirement for an XML library recently so pugi seems
like a natural choice since it's not really a 'new' library, we just
turn an implicit dependency into an explicit one.

This commit expands the Windows-specific code in rBdca9aa0053f7 to
include Linux. macOS support will be handled in a later commit.

NOTE: run `cmake -U'*PUGIXML*' .` in the build directory to ensure CMake
finds PugiXML in the new location.

For details see D8628
2020-12-01 16:25:51 +01:00
29401d38d1 Tracking: Refactor autotrack tracking implementation
The idea is to avoid any synchronization needed in the worker threads
and make them to operate on a local data. From implementation detail
this is achieved by keeping track of "wavefront" of markers which are
to be tracked and the tracking result. Insertion of results to the
AutoTrack context happens from main thread, which avoids need in the
lock when accessing AutoTrack.

This change makes tracking of many (300+) about 10% faster on the
Xeon) CPU E5-2699 v4. More speedup will be gained by minimizing
threading overhead in the frame cache.

Another important aspect of this change is that it fixes non-thread
safe access which was often causing crashes. Quite surprising the
crash was never reported.
2020-12-01 15:24:34 +01:00
4c92fb6715 Libmv: Tweak default logging verbosity level
Log to verbosity level 1 rather than INFO severity.

Avoids a lot of overhead coming from construction of the INFO stream
and improves performance and threadability of code which uses logging.

This makes tracking of 250 frames of a track of default settings to
drop down from 0.6sec to 0.4sec.
2020-12-01 14:55:22 +01:00
c21265b29e Libmv: Cleanup, remove unused logging macros
Unused and was not entirely happy with such short abbreviations.
2020-12-01 14:46:35 +01:00
01b94c5d8a Cleanup: De-duplicate object mullptr checks
Makes it more clear whether object is allowed or not allowed to be NULL.
Also, avoids possible access to the different object mode enumerator.

Should be no functional changes.
2020-12-01 10:45:02 +01:00
edf1095176 Fix T83275: Crash with scene statics and empty scene
ob can be NULL, so it needs to be checked before accessing ob->mode

Differential Revision: https://developer.blender.org/D9680
2020-12-01 10:27:51 +01:00
645c2bd4d0 Fix sculpt transform incorrently flipping displacement in Y and Z axis
These functions were only checking the X axis for flipping the
displacement for a symmetry area depending on the initial position of
the pivot.
This affects transform and any other tools that transform vertices and
applies symmetry based on areas (the pose brush, for example).

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9654
2020-11-30 23:40:06 +01:00
ea064133e5 UI: Add Sculpt Session info to stats
This adds the vertex and face count info to the scene stats in sculpt
mode. These stats count the active vertices and faces in the
sculptsession for the active object. This has the following advantages:
- It is possible to know how many vertices the sculptsession has active
comparted to the vertex count of the entire scene from sculpt mode
- When sculpting with constructive modifiers, these stats will report the
number of vertices that you can actually sculpt with, instead of the
vertex count of the modified mesh and the entire scene.

Reviewed By: sergey, dbystedt

Differential Revision: https://developer.blender.org/D9623
2020-11-30 23:35:39 +01:00
6b12dad190 Cleanup: Use LISTBASE_FOREACH for node tree sockets RNA code 2020-11-30 16:39:07 -05:00
007a0e43a0 Cleanup: Reduce variable scope in node drawing code
Also use LISTBASE_FOREACH in a few places and generally clean up
the code for the two sidebar panels "Sockets" and "Interface".
2020-11-30 13:56:46 -05:00
5a35e56bcb Cleanup: Remove unecessary code.
We already `memset` the whole mesh runtime to zero, no need to set some
of its pointer explicitly to NULL afterward.
2020-11-30 19:47:42 +01:00
814b2787ca Fix T83196: bad matrix to quaternion precision near 180 degrees rotation.
Adjust the threshold for switching from the base case to trace > 0,
based on very similar example code from www.euclideanspace.com to
avoid float precision issues when trace is close to -1.

Also, remove conversions to and from double, because using double
here doesn't really have benefit, especially with the new threshold.

Finally, add quaternion-matrix-quaternion round trip tests with
full coverage for all 4 branches.

Differential Revision: https://developer.blender.org/D9675
2020-11-30 21:46:45 +03:00
6022103264 Cleanup: Clang tidy void argument 2020-11-30 13:44:58 -05:00
c0677b662f Fix T83177: Industry Compatible keymap: MMB-dragging to transform engages axis-constraining on release
Release confirm did not consider modal keymap events.
2020-11-30 14:50:35 -03:00
3bdc42f97a Fix T82996: Library Overrides: Duplicate of overridden collection on Resync
Properly use given reference pointer in
`lib_override_library_create_post_process` when it is a Collection one
too.
2020-11-30 17:19:27 +01:00
a7cf6ad547 Fix (unreported) broken logic in BKE_collection_add_from_collection.
That function was adding given new collection to all ancestors of the
reference one, instead of only to its immediate parents.
2020-11-30 17:19:27 +01:00
c760ab0dda Cleanup: Graph Editor, refactor selection operators
Extract initialisation code of box selection into separate functions.

No functional changes.

Reviewed By: zeddb, sybren

Differential Revision: https://developer.blender.org/D9196
2020-11-30 17:14:55 +01:00
8c74c35ecb Fix T81628: Moving Python-made channels freezes Blender
Fix various problems in the Action Group rearranging code. All fixes are
necessary to resolve the bug.

- Before groups are rearranged, the channels are moved into their
  respective groups (so no longer referenced by `action->channels`). A
  temporary group is made for ungrouped channels. The code made
  assumptions about the channels being in the same order as the groups;
  that assumption has been removed.
- Looping over channels in an Action Group should stop when reaching the
  last channel, and not until `NULL`.
- After all the reshuffling is done, the `action->channels` linked list
  wasn't terminated properly. Now `first.prev` and `last.next` are set
  to `NULL` to avoid infinite loops.
2020-11-30 16:30:44 +01:00
ed9b70393c Cleanup: Animation, clean up action group rearranging code
Some minor cleanups to make an upcoming bugfix easier.

No functional changes.
2020-11-30 16:30:44 +01:00
0f30edc20c Tracking: Make image accessor own what it needs
Previously image accessor was sharing array pointer for tracks access.
Now it is possible to pass a temporary array valid only during the
initialization process.

Should be no functional changes.
2020-11-30 16:24:11 +01:00
13ce25d24c Tracking: Clarify tracks and options storage once again
This is something not-so-trivial to see from just reading code, which
shown an important of proper comments and clear naming.

Main source of confusion was that it is not immediately clear that
AutoTrack context is to see all tracks, but tracking to only operate on
selected ones.
2020-11-30 16:24:11 +01:00
83c872085d Windows/Ninja: allow parameters for rebuild.cmd
The windows build leaves a convenience helper script
in the build folder called, rebuild.cmd. This change
passes any parameters you give rebuild.cmd to ninja
so you can easily pass it additional parameters without
having to edit the batch file manually.
2020-11-30 08:22:50 -07:00
9081b80d15 GPencil: New operator to reset Vertex Colors
This operators reset the vertex color information of the strokes.

If nothing is selected, all strokes are reset. If any is selected, only selected strokes are reset.

Also added a new menu Paint in Vertex Color mode.

Differential Revision: https://developer.blender.org/D9647
2020-11-30 15:52:44 +01:00
f280300b6a Tracking: Cleanup, remove unused argument from image accessor 2020-11-30 15:50:21 +01:00
ba3bf822a1 Tracking: Cleanup, remove unused field
Was re-introduced after previous round of cleanups when was merging
refactor and master branches.
2020-11-30 15:44:42 +01:00
ecfacb7706 Tracking: Cleanup, use explicit frame match option
No functional changes, just allows to potentially extend the options
in the future, and also makes code more explicit.
2020-11-30 15:03:31 +01:00
c949062c6e Tracking: Cleanup pattern match DNA definition
Wrong comment was used for enumerator.

Also made it a real typed enumerator to ease use in the implementation
code.

Should be no functional changes.
2020-11-30 14:58:12 +01:00
f61ad0e101 Fix T83203 BGL: shader.program wrongly always returns 0
This was a leftover from the 2.91 GPU module refactor.

This is an exception that should be removed when we remove BGL.
2020-11-30 14:55:46 +01:00
6fba2726c7 Tracking: Cleanup, finish pass of comments in the context
Some fields are still not really documented, but they are subject of
refactor/fix which will happen shortly.
2020-11-30 14:48:48 +01:00
2f08906c47 Tracking: Cleanup, replace clip user with frame number
Makes it more clear from intent and usage point of view.
The user was not used for anything else than frame number.
2020-11-30 14:44:51 +01:00
9d3b6f75a1 Tracking: Cleanup, more clear variable naming
A no-functional-followup of the previous commit.
2020-11-30 14:40:00 +01:00
d61a6a8cc3 Tracking: Fix missing frame remap for plane tracks
Tracking track which is used for plane track and movie clip having
a scene frame offset would have trigger re-calculation from a wrong
frame.
2020-11-30 14:36:03 +01:00
88289d8f84 Tracking: Cleanup, clear variable names and indentation
Should be no functional changes.
2020-11-30 14:25:42 +01:00
8dac88b54a Tracking: Cleanup, unused field in autotrack context
Was only assigned to truth, always. Never read back.
2020-11-30 14:13:34 +01:00
Yevgeny Makarov
9306e01b10 Fix T82870: on macOS, continuous grab jumps when crossing editor border
The event queue can contain events from before pointer warping, ignore those
now. This is an old issue, but became more common now that we disabled event
coalescing and started using the event mouse location rather than the current
mouse location.

Thanks to Yevgeny Makarov and Nicholas Rishel for helping solve this.

Ref D9662
2020-11-30 13:41:38 +01:00
2a430a670c Tests: blacklist failing tests for Cycles CUDA and OptiX devices
Blacklist a bunch of tests on the GPU, which are known to currently have
differences with CPU. These can be enabled as they are fixed or the test
is modified to give compatible results when there are known limitations.

OSL tests were also moved to their own directory since those are not
supported on the GPU.

Ref T82193
2020-11-30 13:40:33 +01:00
dd391d38f6 Tests: add CMake option to run Cycles regression tests on GPU devices
CYCLES_TEST_DEVICES is a list of devices (CPU, CUDA, OPTIX, OPENCL). It is set
to CPU only by default.

Test output is now writen to build/tests/cycles/<device>, and the HTML report
has separate report pages for the different devices, with option to compare
between CPU and GPU renders.

Various GPU tests are still failing due to CPU/GPU differences, these are to be
fixed or blacklisted still.

Ref T82193
2020-11-30 13:40:33 +01:00
c986e46be7 Cleanup: avoid harmless but unnecessary float division by zero 2020-11-30 13:40:33 +01:00
057c15b549 Libmv: Add threading primitives
Allows to use mutex, scoped_lock, and conditional_variable from within
the libmv namespace.

Implementation is coming from C++11. Other configurations are easy to
implement, but currently C++11 is the way to go.
2020-11-30 12:12:39 +01:00
0f0c982ff4 Libmv: Add build configuration header
Allows to easily access build platform information, such as bitness,
compiler, supported C++ version and so on.
2020-11-30 12:12:39 +01:00
d3dd61aab3 Libmv: add missing files to bundler
Bundler wouldn't be able to pull changes form upstream until all the
changes are upstreamed, but is better to have information consistent.
2020-11-30 12:12:39 +01:00
Monique Dewanchand
c751d40e07 Cleanup hardcoded render percentage to factor conversion
During revision of {D8952} one of the comments was to make a function that converts the render percentage to a factor. This to avoid code duplication. However the duplicated code was already all over the compositor code. So in order to avoid this code duplication for {D8952} I propose to first cleanup the duplicated code and build patch {D8952} based on this clean up.

The method that converts the render percentage to a factor is put in the CompositorContext. Why? The CompositorContext keeps DNA information like the renderdata. DNA, and thus the CompositorContext, keeps the size of the render resolution in percentage (user oriented). The compositor needs the size of the render resolution as a factor. So the CompositorContext seems like the obvious place to have this conversion method.

Why not in de NodeBase? The method could've been added to the nodebase, but I wanted to keep the nodebase as clean as possible and not put simple "conversion" methods into this base class. Also I didn't really like the call flow: you'd always have to get the renderdata size from the context and then convert.
Putting it in the CompositorContext avoids this extra invoke of a call.

Why not in the Converter? See nodebase. And the Converter seems more like a class for "structural" and complex node tree conversions. Not the simple conversions.

Reviewed By: Sergey Sharybin

Differential Revision: https://developer.blender.org/D9566
2020-11-30 08:00:40 +01:00
f38cd7e188 RNA Manual Reference: Update 2020-11-29 22:01:23 -05:00
dc40bea003 Cleanup: Use LISTBASE_FOREACH macro in screen.c
This commit replaces while loops and for loops with the equivalent
macro. This results in much more readable code in some places,
and it's now more apparent when the situation is more complicated
than just iterating through a linked list.
2020-11-29 20:30:11 -05:00
748f468fdc Cleanup: Use "region" for ARegion variable names
As proposed in T74432 and already implemented in several commits,
"region" is the preferred name for `ARegion` variables, rather than
any variant of "ar". This commit changes a few "ar" variables that have
popped up over time and also adjusted names of variants like "arnew".
2020-11-29 18:10:47 -05:00
dca9aa0053 Deps: PugiXML 1.10
This separates out PugiXML that was previously
bundled by OIIO.

As this linux/mac libs are not available
this commit only contains the builder and windows
changes, and the option to enable pugixml is
guarded by a platform if, this can be removed
once all platforms have committed the svn libs.

For details see D8628
2020-11-29 14:01:33 -07:00
176324aa5c QuadriFlow: Fix std::allocator deprecation warnings
https://en.cppreference.com/w/cpp/memory/allocator/construct
"(deprecated in C++17) (removed in C++20)"
Same for `destroy`.

Reviewed By: zeddb

Differential Revision: https://developer.blender.org/D9657
2020-11-30 00:46:27 +05:30
11f0169e88 Run clang-format to fix line length after D8915. 2020-11-29 17:26:33 +03:00
Rebecca Dengate
13c820d87b CMake/macOS: Use custom LIBDIR if set on CLI
Reviewed By: ankitm
Maniphest Tasks: T83174
Differential Revision: https://developer.blender.org/D9664
2020-11-29 13:34:33 +05:30
458d8a423a Speed up finding patch components in new boolean.
By checking if a cell has already been processed in the finding patch
component code, an enormous speedup happens. This only will be
noticeable if there are lots of patches, and some cells with a
large number of patches.
2020-11-28 14:27:10 -05:00
1169507308 Speedups for finding cells in new boolean.
In case where there are coplanar instersections where
each part has a lot of triangles, the finding-cells algorithm was
very inefficient. This uses a Set instead of a Vector to keep track
of a cell's patches, avoids going through all patch x patch combinations,
avoids going through all patches to renumber after a merge, and
merges smaller patch-sixe cells into larger ones.
All this reduces the time to find cells in the cited case by a factor of 10.
2020-11-28 13:26:52 -05:00
566e7e6145 Fix Auto Clamped limits when smoothing the transition of cyclic curves.
The value of l[count-1] should be ready by the time hmin/hmax is computed.
Otherwise the left limit for the transition key would be scaled wrong.
2020-11-28 15:54:18 +03:00
c99d767735 Fix some naming and comments in F-Curve smoothing code. 2020-11-28 15:54:18 +03:00
b3f20eed6e Fix T83023: incorrect shape of cyclic F-Curve with only two points.
The equation solver didn't handle the one unknown case correctly.
2020-11-28 15:54:17 +03:00
f8553de2cd GPencil: Fix unreported vertex size for Bezier handles
By error, the Bezier points were using the mesh vertex size, not the grease pencil vertex size.
2020-11-28 11:10:35 +01:00
fbdf1af355 Fix T82758: Convert Proxy to Override: Local constraints aren't saved.
Ensure consistent order of pose bones. Now it should always match the
one from bones in armature obdata (as exposed by e.g. RNA, i.e.
children-first).

Previously when some pose bones would need to be added or removed from a
pose due to changes in the bone armature, or if bones in armature were
re-ordered, the bones order in pose would not match anymore the one from
armature, and could even become different between e.g. a proxy and its
linked source.

This was not really nice, but not a big issue before either. But with
diffing process of override, consistent order of items between reference
linked collection and local override one is crucial.

Reviewed By: #animation_rigging, sybren

Maniphest Tasks: T82758

Differential Revision: https://developer.blender.org/D9646
2020-11-27 16:18:59 +01:00
e4e7dfc1d8 Fix transform snap mixed with incremental
The incremental was taking priority but the other elements are mandatory.
2020-11-27 10:51:33 -03:00
f9e994d0f4 Fix T83092: Direction of rotation with View orientation changed in 2.91
The change was intentional so that the orientation matrices match
(`rv3d->viewinv` becomes equal to the orientation matrix).

But, although in a projection matrix the Z axis is negative, this
should not be so from the user's point of view.

So the solution here is to negate the Z axis when the View orientation
is chosen.

This affects all modes, but is only evident for rotation.

---
Another change here is to use the final rotation value (`values_final`)
for the gizmo drawing since this value can be changed by the mode.
2020-11-27 10:41:33 -03:00
24e57eea43 Fix T82156: Object with constraints translates when parented
Avoid the evaluation of constraints when computing the parent-inverse
matrix.

Constraints are meant to be evaluated last; object transforms are
computed this order:

1. `parent->obmat` (the parent object's world matrix)
2. `ob->parentinv` (the object's parent-inverse matrix)
3. Object's loc/rot/scale
4. Object's constraint evaluation

When the constraints are used to compute the parent-inverse matrix,
their effect is moved from step 4 to step 2 in this list, potentially
rotating or scaling the object's local transform. This causes unwanted
movement as reported in T82156.

Reviewed By: looch

Differential Revision: https://developer.blender.org/D9413
2020-11-27 12:11:43 +01:00
e4b6afbe6b Cleanup: Animation, clean up FCurve Cycles modifier
Simplify conditions and declare variables `const` where possible.

No functional changes.
2020-11-27 10:15:20 +01:00
45dca05b1c Cleanup: Add r_ to return parameter
Prefix a return parameter with `r_` to follow the style guide. No
functional changes.
2020-11-26 20:37:54 -07:00
ab4654cdfe Cleanup: Move logic to outliner_find_item_at_x_in_row
Move the logic for determining if the item at a given x position is an
icon into the function. This is used for determining selection over an
icon, and will be used in a later commit for checking for hover over an
icon. No functional changes.
2020-11-26 20:37:21 -07:00
1709bc5164 Add performance timing to mesh_boolean.cc.
You can uncomment the PERFDEBUG define to get timings.
2020-11-26 18:29:11 -05:00
64b58888fb Sculpt: Refactor transform code to allow incremental updates
This adds support for incremental updates in the sculpt transform
code. Now tools can define if they need the displacement applied
for the original coordinates or incrementally.

This is needed for features like elastic transform or cloth deformation
target in the transform tool.

No functional changes.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9547
2020-11-27 00:18:41 +01:00
26eb8d6aa0 UI: Use decorators in volume modifiers
This is consistent with the UI for other modifier types.
2020-11-26 12:56:12 -05:00
226b028523 GPencil: Cleanup - Remove unused old shaders
These fill shaders were used with the old draw engine.
2020-11-26 17:44:43 +01:00
9add12ff05 Transform: Improve event detection for AutoConstrain
The event "value" is not really required since this operation works as a toogle.

This change cleans and simplifies the code.
2020-11-26 13:42:56 -03:00
dd0e2da00e Cleanup unintentional change in rB8a2270efc52a
Note that the whole thing need to be redone/properly fixed, but this is
a bit more complicated so for now fix in  rB8a2270efc52a is 'good
enough'.
2020-11-26 17:30:20 +01:00
841ae18605 Fix T83055: setting rna pointer properties can create bogus custom properties
This was reported in the form of the eyedropper of the 'Parent' property
creating a custom property 'parent' if self was picked.

Problem arises when certain checks for setting rna pointer properties
failed (for example: the PROP_ID_SELF_CHECK check) and then a different
code path was entered (which was only meant for IDProperties).

Problem was introduced in rBa7b3047cefcb.

To solve, now first enter the branch for rna-based pointer properties,
then perform the sanity-checks (and if these fail: dont enter the other
unrelated codepath but instead do nothing)

Maniphest Tasks: T83055

Differential Revision: https://developer.blender.org/D9652
2020-11-26 17:18:48 +01:00
4b248c1658 Fix T82729: Crash in rna_EffectorWeight_path when object has fluid and
dynamic paint modifiers

Looks like prior to the introduction of mantaflow, the former
SmokeModifierData always had a domain initialized (even if its type was
set to None). Since mataflow, the FluidModifierData type needs to be set
to MOD_FLUID_TYPE_DOMAIN (otherwise domain is invalid)

Maniphest Tasks: T82729

Differential Revision: https://developer.blender.org/D9644
2020-11-26 16:57:02 +01:00
87030d8be5 Fix T83046: Material change not updating in the link of an override.
Code was actually not applying any override operation over linked data.

Reasonn behind that was that if library file is saved with latest
override applied then this is not needed, since data saved for the
override in the lib file is already up to date.

But this is actually fully breaking in case someone update the lib file
of the lib file, without re-saving the libfile itself.

So now we alwaya apply overrides also on linked data.

Note that this will not fix the case where a resync is needed.
2020-11-26 16:43:31 +01:00
4705fafa7e UI: Fix incorrect offset for panel label when zooming in
The panel title text intersected any buttons in the header because
the label offset retrieved from the layout code was not scaled by
the block's zoom level. Error in rB0d93bd8d63980.
2020-11-26 10:29:03 -05:00
44f5d99cbf Fix T83020: Transform: AutoConstraint being confirmed without releasing the MMB
The transform modifiers are confirmed by releasing any button.

Thus, the operation can be falsely confirmed if the button that launched
the operation is released after the modifier has been activated.

Previously the events that confirmed the modifiers were hardcoded.

An option to fix this would be to add custom confirmation keyitens for
specific modifiers. But this can be a bit confusing and would make the
modal keymap even bigger.

So the solution here is to skip the button that launched the operation
when confirming the modifier.
2020-11-26 11:42:28 -03:00
Joseph Brandenburg
849debe36c Fix T80970: Copy Rotation constraint incorrect under shear
Orthogonalize the constraint target's matrix before decomposing it into
Euler angles. This removes sheer, and is actually a requirement for
correct decomposition.

It's conceivable that someone has used the incorrect behaviour in a rig.
As the shear caused unpredictable flipping of the constrained object,
this is unlikely.

Reviewed By: angavrilov, sybren

Differential Revision: https://developer.blender.org/D8915
2020-11-26 13:12:13 +01:00
781429a8b0 Cleanup: clearer marking of what was changed in GTestAddTests.cmake
Replace `Blender` with `BLENDER` so that it's more clearly a marker, and
not just the name.

No functional changes.
2020-11-26 13:05:46 +01:00
Stefan Werner
0062b34e94 macOS: Patch OpenImageIO's ustring for ARM.
OpenImageIO's ustring makes assumptions about the interals of
std::string which aren't true on macOS/ARM. A patch for OpenImageIO
addresses this for macOS/ARM builds only, at the expense of potentially
duplicated allocations of strings.
2020-11-26 12:22:56 +01:00
Stefan Werner
05f410dd84 macOS: Added new location for Homebrew.
The build script for macOS dependencies expects to find bison provided
by Homebrew under /usr/local. Since the default install location for
Homebrew changes on macOS/ARM, the script now looks at the host
architecture and switches to /opt/homebrew on Macs with Apple Silicon.
2020-11-26 11:30:53 +01:00
8a2270efc5 Fix T81265: Animation is not evaluated when collection is included into view layer.
Just tag objects in un-excluded viewlayer for animation update.
2020-11-26 11:08:51 +01:00
774d18804f Fix T82452: Outliner: Cyclic "Original ID" panel in Data API.
I cannot think of any case where we'd want to show this pointer in UI
anyway, so just tag it with `PROP_HIDDEN`.
2020-11-26 10:46:35 +01:00
e09d0c0d07 Fluid: Updated Mantaflow source files
This update introduces two improvements from the Mantaflow repository:

(1) Improved particle sampling:
- Liquid and secondary particles are sampled more predictably. With all parameters being equal, baked particles will be computed at the exact same position during every bake.
- Before, this was not guaranteed.

(2) Sparse grid caching:
- While saving grid data to disk, grids will from now on be saved in a sparse structure whenever possible (e.g. density, flame but not levelsets).
- With the sparse optimization grid cells with a value under the 'Empty Space' value (already present in domain settings) will not be cached.
- The main benefits of this optimization are: Smaller cache sizes and faster playback of simulation data in the viewport.
- This optimization works 'out-of-the-box'. There is no option in the UI to enable it.
- For now, only smoke simulation grids will take advantage of this optimization.
2020-11-25 23:18:12 +01:00
Erik Abrahamsson
f7223d5f72 UI: Allow theming the alternate row color in the sequencer
Previously, the alternate row color in the Video Sequence Editor was
just a shaded version of the editor's background color. This makes it
theme-able just like in the file browser and outliner, although the
default color is very slightly different.

Differential Revision: https://developer.blender.org/D9634
2020-11-25 16:37:33 -05:00
05c4efc9b1 Fix Edit Face Set operator not being cancelled when the cursor is not over the mesh
If the cursor is not over the mesh, the operator was still using the
last Face Set ID updated by the drawing cursor code when the cursor was
over the mesh.

This now cancels the operator instead of modifying a Face Set that will
look random to the user.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9545
2020-11-25 22:22:12 +01:00
8b9b3d98e0 Rename use paint symmetry to use mesh symmetry in quadriflow
The original name was chosen because symmetry was a property of
the Paint struct. Now symmetry is a property of meshes, which
also makes the name of the property easier to understand.

Reviewed By: sergey, dbystedt

Differential Revision: https://developer.blender.org/D9618
2020-11-25 22:21:02 +01:00
41a73909de Cleanup: Typo in print_default_info function name. 2020-11-25 20:45:47 +01:00
02a0f6b04a Fluid Particles: fix viscoelastic spring threading crash again after D7394.
Since D6133 fluid particle code uses thread local storage to collect
springs created during a time step before adding them to the actual
spring array.

Prior to the switch to TBB there was a single finalize callback which
was called on the main thread, so it could use psys_sph_flush_springs
and insert the new entries into the final buffer. However in D7394 it
was replaced with a reduce callback, which is supposed to be thread
safe and have no side effects. This means that the only thing it can
safely do is copy entries to the other temporary buffer.

In addition, careful checking reveals that the 'classical' solver
doesn't actually add springs, so reduce isn't needed there.

Differential Revision: https://developer.blender.org/D9632
2020-11-25 22:31:47 +03:00
8330e19cb2 RNA Armature: Improve the description of AxisRollFromMatrix
The roll value may not be as expected when a matrix is not orthogonal
or has a negative determinant.

This can lead to confusion as seen in T82930.

Therefore, make it clear that this is a limitation and that a value for
the roll is somewhat indeterminable in these cases.

This fixes T82930
2020-11-25 13:55:05 -03:00
f67f895770 GPencil: Disable vertex color when use holdout
If the material has the holdout enabled, the value of the vertex color must not be used.
2020-11-25 16:01:30 +01:00
436fd5663e Fix T82988: Div by zero with curve deform modifier
In `calc_curve_deform` a factor is calculated without checking if
the divisior is zero or close to zero. This patch adds the missing
checks and sets the factor to zero if the division shouldn't be
computed.

Reviewed By: mont29

Differential Revision: https://developer.blender.org/D9645
2020-11-25 15:18:18 +01:00
4a179e8e3e Atomics: Fix missing 64bit implementation for 32bit platforms
Blender uses 64bit atomics to manipulate SessionUUID, and these atomics
were not defined on any of 32bit platforms.

While official support is limited to 64bit platforms only, the code
should not make assumptions about bitness or endianess, in terms that
there should be codepaths and fallback (or provision of them) for 32bit
platforms.

This change makes 64bit atomic functions defined for all platforms.
The atomic_test was compiled and successfully tested on i686 and armv7l
platforms. The rest of compilation process of Blender will be very
tedious, so that was not done.

This change is essential, but not necessarily enough to make Blender
compilable on i686 (ability to compile Blender on 32bit platforms was
lost during the 2.91 development).

This is a functional part of original fix done by Brecht in D9577.
2020-11-25 12:43:43 +01:00
4323886123 Atomics: Cleanup, move defines closer to usage
There is a special defines block needed for ARM on Linux. Move it from
public header to an implementation file.

No functional changes.

This is a non-functional part of original fix done by Brecht in D9577.
2020-11-25 12:43:43 +01:00
1c86d32fa7 Nodes: deduplicate ping pong math operation
The formula did not change. The only side effect of this change should be
that the compositor node now does not divide by zero in some cases.
2020-11-25 12:24:44 +01:00
9e77fc533c Cleanup: remove useless cast. 2020-11-25 11:19:28 +01:00
b1533f8fa4 Tracking: Cleanup, de-duplicate implementation of marker lookup
The logic was duplicated.

Should be no functional changes. The modified function is expected
to give same exact results for all inputs.

On the "caching last-used track" topic. The code was using last_marker
to allow faster lookup of marker closest to the frame. With this
change it is still the case since the BKE_tracking_marker_get() does
cache last used marker.
2020-11-25 09:37:24 +01:00
e922dd7d8a Viewport: cannot select object by clicking on its instances
Selecting an object by clicking on its instances only worked,
when the object itself is visible. However, it is possible to hide
the object and still keep the instances visible.

The solution is to give every object the correct `select_id` in the
depsgraph object iterator right before rendering.

Reviewers: fclem, brecht

Differential Revision: https://developer.blender.org/D9640
2020-11-24 17:32:56 +01:00
256a9d983d Merge remote-tracking branch 'origin/blender-v2.91-release' 2020-11-24 16:05:58 +01:00
278011e44d Fix T80748: Render Emissive Colors in Compositor Backdrop
This change will use the image engine to draw the backdrop of the compositor. With this patch the alpha blending will be done in Linear Scene Reference space and shows pure emissive colors.

See differential for an example image.

**Technical changes**

As only the backdrop drawing is done using the draw manager there are some technical changes.
1. The overlay buffer is partly drawn outside the draw manager. When drawing the backdrop image the overlay buffer needs to be masked to simulate premultiplied alpha under.
2. The backdrop of the node editor is done in region pixel space. A `DRWView` is constructed with this space.
3. UDIM textures uses world position to generate the UV coordinates. This has been implemented more strict by the `IMAGE_DRAW_FLAG_USE_WORLD_POS`. When the flag isn't used the local coordinates are used to generate the UV coordinates what is image space.
4. The draw manager now checks the actual `eSpaceType` of the space data to use different code paths. In the future the movie clip editor will be added.

NOTE: The preview images in nodes are drawn in display space and cannot show pure emissive colors. As preview images are used on more locations it is best to fix this in a separate patch.

Reviewed By: Clément Foucault

Differential Revision: https://developer.blender.org/D9451
2020-11-24 13:22:17 +01:00
82cc21d5e4 Fix T77261: Multires creates spikes when subdividing ngons
The spikes were caused by non-initialized tangent matrix used during
smoothing process. The reason tangent matrix was not initialized was
because wrong usage of API: n-gons should pass corner of 0 to the
matrix construction function.

Corrected usage of the API and added assert() to help catching such
kind of non-initialized issues easier.
2020-11-24 12:40:42 +01:00
31bf8307af Graph Editor: fix keyframe not activating in certain cases
When clicking on an already-selected keyframe, mark it as active if the
click caused the previously-active keyframe to become deselected.

When clicking on a key in the graph editor, it is selected and all other
keys are deselected. If that key was already selected before the click,
it would not become the active keyframe. This is now fixed.

Reviewed by: Severin

Differential Revision: https://developer.blender.org/D9639
2020-11-24 12:27:43 +01:00
bb5c4de009 Fix T82962: Crash changing lattice resolution with Vertex Group
Regression introduced by {rB042143440d76}. The deform group lookup was
performed on the wrong object. Before the lookup was performed on
the lattice object. This patch changes this back.

Reviewed By: Bastien Montagne

Differential Revision: https://developer.blender.org/D9638
2020-11-24 11:46:38 +01:00
aca8eadb63 Animation: Remove debug prints
Remove accidentally-commited debug prints.

No functional changes.

Reviewed by: sergey

Differential Revision: https://developer.blender.org/D9637
2020-11-24 11:13:43 +01:00
e74f61b49a Fix Python API docs for the render API
The API doc for free_blender_memory() was used in
get_preview_pixel_size()

Issue introduced in 5494683651.
2020-11-24 10:42:28 +01:00
037ce662e5 Outliner: Switch properties tabs only on icon click
According to feedback the outliner to properties editor tab switching
was annoying when it always changed tabs on selection, especially for
selecting individual objects. This limits the tab switching behavior to
only when the icons in the outliner are selected.
2020-11-23 22:21:02 -07:00
Yevgeny Makarov
d86fcde39c UI: Batch Rename Layout Improvements
Improvements to the layout of the Batch Rename dialog.

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

Reviewed by Reviewed by Hans Goudey
2020-11-23 17:27:01 -08:00
Yevgeny Makarov
df31ecf0c3 UI: Add Trackpad Smooth Scrolling for Popovers
Adds smooth scrolling with the trackpad for popovers. Also fixes the position of the scroll arrows on high-DPI.

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

Reviewed by Brecht Van Lommel
2020-11-23 17:22:20 -08:00
Yevgeny Makarov
b6a50b5dcb UI: Block Safety Not Scaled Correctly
Layout block safety sizes were not scaled correctly with interface scale.

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

Reviewed by Brecht Van Lommel
2020-11-23 16:56:01 -08:00
246c11634f Speedups for new boolean. Better hash function for verts.
The existing hash function didn't work well with Set's method of
masking to the lower bits, because many verts have zeros in the
lower bits.
Also, replaced VectorSet with Set for Vert deduping.
2020-11-23 19:30:40 -05:00
Jeroen Bakker
b0a9081883 Fix T82884: Cycles Compilation Error OpenCL/NanoVDB
Recent changes introduced `acc` parameter into the texture read
functions. When nanovdb isn't enabled this leads to compilation errors
as the `acc` variable wasn't defined. OpenCL only compiles needed
features what made it more prominent.

Reviewed By: Patrick Mours

Differential Revision: https://developer.blender.org/D9629
2020-11-23 16:42:48 +01:00
Jeroen Bakker
8351760ed0 Cycles: Remove Compilation Warning
ROCm 3.9 already defined `NULL`. This patch will first check if it was
already defined to remove compilation warnings.

NOTE: This doesn't add official support for ROCm as it still fails to
render correctly (crashes with default cube).

Reviewed By: Brecht van Lommel

Differential Revision: https://developer.blender.org/D9610
2020-11-23 16:36:15 +01:00
Christoph Lendenfeld
1f09dcc121 Cleanup: Animation, split graph_edit.c into separate files
Split some of the code of `graph_edit.c` into:
* `graph_view.c`: preview range, view all, view selected etc.
* `graph_slider_ops.c`: the decimate modal operator code.

The latter file will be extended later with more slider-based operators.

Maniphest Tasks: T81785

Reviewed By: sybren

Differential Revision: https://developer.blender.org/D9312
2020-11-23 15:26:54 +01:00
152754a477 Tracking: Cleanup, typos and spelling in DNA comments 2020-11-23 15:25:55 +01:00
e4ca1fc4ea Animation: New Euler filter implementation
This new discontinuity filter performs actions on the entire Euler
rotation, rather than only on the individual X/Y/Z channels. This makes
it fix a wider range of discontinuities, for example those in T52744.

The filter now runs twice on the selected channels, in this order:
- New: Convert X+Y+Z rotation to matrix, then back to Euler angles.
- Old: Add/remove factors of 360° to minimize jumps.

The messaging is streamlined; it now reports how many channels were
filtered, and only warns (instead of errors) when there was an actual
problem with the selected channels (like selecting three or more
channels, but without X/Y/Z triplet).

A new kernel function `BKE_fcurve_keyframe_move_value_with_handles()` is
introduced, to make it possible to move a keyframe's value and move its
handles at the same time.

Manifest Task: T52744

Reviewed By: looch

Differential Revision: https://developer.blender.org/D9602
2020-11-23 12:48:04 +01:00
1318eaf166 Cleanup: CMake: use string(APPEND..), not set(..)
Left out in {rB7f28a99dd5a57216fb477d844ae1fec5510ad5d5}
2020-11-23 16:34:17 +05:30
36426b0a68 CMake/macOS: Replace -Xlinker with -Wl.
Causes link issues on Xcode's "New Build System" which was introduced
in Xcode 10 and is default on Xcode 12.
https://devtalk.blender.org/t/16273

Differential Revision: https://developer.blender.org/D9624
Reviewed by: brecht, #platform_macos
2020-11-23 16:34:17 +05:30
64513df8b6 Fix T82849: Assert When Unlinking "Edit Source" Text Data-block.
Simplify and sanitize handling of usercounts for Text IDs generated
trhough `BKE_text_load_ex`.
2020-11-23 11:56:40 +01:00
401612b8e1 Tracking: Cover markers access with basic tests
Just a beginning of tests coverage, related on the planned upcoming
development.
2020-11-23 09:23:19 +01:00
1e0ff6b723 Tracking: Cleanup, make units explicit in new track creation 2020-11-23 09:23:19 +01:00
6d314c940e Tracking: Cleanup, clarify comments in tracking settings
Make unit more explicit.

Ideally would be "embedded" into the field name itself, but this will be
more involved change.
2020-11-23 09:23:19 +01:00
2ee5bc33ea Tracking: Refactor, move track allocation to helper function
The caller is still responsible for allocating list of markers,
but the track allocation and initialization can now be reused.

Currently no functional changes, preparing for an upcoming
development.
2020-11-23 09:23:19 +01:00
7bab87c119 Fix T82918: File menu "Save Copy" shows "Save As" in File Browser
Use a dynamic name/description based on the set properties. This makes it more
clear what's going on and avoids confusion, as explained in the report.
2020-11-22 19:21:30 +01:00
4c01fbb564 Cleanup: Use const arguments in curve bevel
This makes it clear that only the final "r_data" is being changed.
Also rename a variable to be less vague.
2020-11-22 12:11:15 -05:00
b11d409ac4 Cleanup: Improve readability of curve displist building
Just a few minor improvements: declare variables where they are
initialized, decrease scope, expand some variable names, and use
LISTBASE_FOREACH.
2020-11-22 11:47:37 -05:00
1cc3a0e2cf Cleanup: Reduce indentation
Having up to nine levels of indentation make this function hard to
follow. Instead of indenting the rest of the loop for a simple special
case, just continue.
2020-11-22 11:25:10 -05:00
0f3ca3f4bc Fix unclear tooltip for the Affect Transform option of constraints. 2020-11-22 13:33:27 +03:00
d25e116889 Previous commit forgot to guard some things with #ifdef WITH_GMP. 2020-11-21 22:44:35 -05:00
df8cc5662b Improve speed of Constrained Delaunay Triangulation with exact arith.
By using floating point filters, the speed improves by a factor of 2 to 10.
This will help speed up some cases of the Exact Boolean modifier.
Changed the interface of mpq2::isect_seg_seg to not return mu, as it was
not needed and not calculating it saved 15% time.
2020-11-21 11:55:14 -05:00
38fe962d95 Merge branch 'blender-v2.91-release' 2020-11-21 14:18:12 +01:00
6c6a5a72c2 GPencil: Fix unreported assert when use select Box in single point strokes
The assert was when use segment selection mode.
2020-11-21 14:17:26 +01:00
0eb096f406 Cleanup: Declare variables where initialized
Reduce variable scope, and in a few cases, use bool instead of int.
2020-11-20 21:54:52 -05:00
c850ce93a4 Fix wireframe opacity creating artifacts on sculpt overlay edges
When lowering the wireframe opacity with sculpt overlays enabled, the
wireframe overlay was creating white artifacts along the edges.

Reviewed By: fclem

Differential Revision: https://developer.blender.org/D9607
2020-11-20 18:02:07 +01:00
cec22ba8db Cleanup: Use LISTBASE_FOREACH macro 2020-11-20 11:00:51 -05:00
05ef031f37 UI: Remove excess row spacing in outliner popover
Some checkboxes had nonessential spacing between rows which made the
popover taller than needed.
2020-11-20 08:55:27 -07:00
2afdb4ba87 Outliner: Object state filter invert toggle
This adds an invert toggle for the outliner object state filters.
There are some cases where we want a filter for invertable states (Selected,
Unselected) and having a single toggle to invert the filter reduces the
number of separate filter types needed. This removes the "Hidden" filter
which can now be replicated with an inverted "Visible" filter.

Differential Revision: https://developer.blender.org/D9598
2020-11-20 08:47:51 -07:00
96995b2343 Fix (unreported) bug in liboverride diffing code for collection item insertion.
In case we do not use names, code adding new insert operations in
collections was broken.

Not a proble in practice so far, since this case was not yet in use, but
will be soon with NLA overrides.
2020-11-20 11:41:15 +01:00
07db110add Fix T82493: PyDoc generation throws exception on exit
Since add-ons now unregister on exit
(as of fa566157a5)
clearing functions in `bpy.app.handlers` caused an error on exit.

Resolve by restoring handlers before exiting.
2020-11-20 18:59:59 +11:00
056c9de30d Merge branch 'blender-v2.91-release' 2020-11-20 08:57:58 +01:00
93850c74c1 Fix add-object cursor plane failing to update on zoom
Zoom with an orthographic view wasn't refreshing the preview plane.
2020-11-20 17:32:09 +11:00
1501c3adad Add Object Tool: support placing objects in orthographic axis views
When an projecting onto a plane that is orthogonal to the views Z axis,
project onto a view aligned axis then map it back to the original plane.
see: ED_view3d_win_to_3d_on_plane_with_fallback

Since the depth can't be properly visualized in 3D, display a 2D so
it's possible to to tell the depth from the cursor motion.
2020-11-20 17:15:18 +11:00
a8f4affb2e Add Object Tool: use the closest view-aligned axis as a fallback
When using surface orientation and nothing is under the mouse-cursor,
pick the axis that's closest to the view's Z axis.

Now by default default, drawing into empty spaces wont use a plane
orthogonal to the view.
2020-11-20 16:45:06 +11:00
a1120892b0 UI: Fix panel drag icon added to redo panel
Error in cleanup commit 0d93bd8d63. Currently floating panels
cannot be dragged, so the widget should not be displayed.
2020-11-19 20:43:10 -05:00
5b34d11b55 Fix add-object tools cursor distorted drawing on save
Generating the thumbnail left the view matrices set to values
that couldn't be used for cursor drawing.

Backup/restore the matrices for off-screen drawing.
2020-11-20 12:15:04 +11:00
f0b75cc19d Cleanup: use a struct to backup/restore values for offscreen drawing
Variables to temporarily override values was scattered,
making it harder to follow.
2020-11-20 12:15:04 +11:00
cf780e0f67 Cleanup: remove unused off-screen drawing struct 2020-11-20 12:14:50 +11:00
f166fa67b7 Cleanup: rename do_sky argument to draw_background
This was leftover from Blender internal, follow the naming
already used by the draw manager.
2020-11-20 12:14:50 +11:00
219c3aa653 Cleanup: remove unused perspective argument to off-screen drawing
Some callers were passing in dummy values, this can be accessed from
`RegionView3D.is_persp` can be used to check this.
2020-11-20 12:14:50 +11:00
25266caa45 Cleanup: spelling 2020-11-20 11:39:22 +11:00
5f1bb8da96 Cleanup: clang-format 2020-11-20 11:28:58 +11:00
Stefan Werner
fdd3032f8f Cycles: Fixed zero sized normals when certain attributes were missing.
The Normal Map node was falling back to (0, 0, 0) when it was missing
the required attributes to calculate a new normal.
(0, 0, 0) is not a valid normal and can lead to NaNs when it is
normalized later in the shader. Instead, we now return sd->N,
the unperturbed surface normal.
2020-11-19 23:15:09 +01:00
dca36a8ec9 Fix T82769: remove thread local data from PTCacheMem
The issue was that the same point cache was read by multiple
threads at the same time (the same object was evaluated for
render and for the viewport).
Both threads incremented PTCacheMem->cur which lead to the crash.

The fix is to remove the PTCacheMem->cur and store it on the
stack instead. This way every thread has its own cur.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D9606
2020-11-19 19:09:24 +01:00
72a199e148 Atomic: Cover with unit tests
Cover all atomic functions with unit tests.

The tests are quite simple, nothing special so far. The goal is to:

- Make sure implementation exists.
- Implementation behaves the same way on all platforms
  (We had issue when MSVC and GCC were behaving differently in the
  past).
- Proper bitness is used for implementation and non-fixed-size
  function implementation.

The tests can be extended further to make sure, for example, that
CAS operations do not cast arguments to a more narrow type for
comparison. Considering it a possible further improvement, as it is
better be done being focused on that specific task.

There is an annoying ifdef around 64bit implementation, which uses
same internal ifdef as the header does. This check is aimed to be
removed, so is easier to simply accept such duplication for now.

The tests seems somewhat duplicate for signed/unsigned variants and
things like this. The reason for that is to keep test code as simple
as possible: attempting to do something smart/tricky in the test code
often causes the test code to be a subject of being covered with its
own unit tests.

Differential Revision: https://developer.blender.org/D9590
2020-11-19 17:19:48 +01:00
0d027b4583 Fix RNA not giving error with invalid identifiers for collection properties 2020-11-19 16:29:29 +01:00
a44bb8603e Guarded allocator: Fix lock-free allocator tests
Previously the lock-free tests were actually testing guarded allocator
because the main entry point of tests was switching allocator to the
guarded one.

There seems to be no allocations happening between the initialization
sequence and the fixture's SetUp(), so easiest seems to be just to
switch to lockfree implementation in the fixture's SetUp().

The test are passing locally, so the "should work" has high chance
of actually being truth :)

Differential Revision: https://developer.blender.org/D9584
2020-11-19 16:17:48 +01:00
39ec64b13d Guarded allocator: Add safety around type change
While it might not cover all possible abuse of API, it does provide
basic checks against most obvious usage mistakes.
2020-11-19 16:17:48 +01:00
4a8cf9d182 Guarded allocator: Add explicit switch to the lockfree implementation
Previously the only way to use lockfree implementation was to start
executable and never switch to guarded allocator.

Surely, it is not possible to switch implementation once any allocation
did happen, but some tests are desired to test lock-free implementation
of the allocator. Those tests did not operate properly because the main
entry point of tests are forcing guarded allocator to help catching
bugs.

This change makes it possible for those tests to ensure they do operate
on lock-free implementation.

There is no functional changes here, preparing boilerplate for an
upcoming work on the allocator tests themselves.
2020-11-19 16:17:48 +01:00
42b2ae5f69 Fix lost node links when linked node group datablock is temporarily missing
Don't refresh the list of sockets, so that when the .blend file is restored the
links remain valid. Also display such nodes in red to indicate an error, same
as when the node type info is missing.
2020-11-19 15:55:05 +01:00
c5306dd0cd Merge branch 'blender-v2.91-release' 2020-11-20 01:41:17 +11:00
e01bf7a92e Fix T82540: Smart UV project ignores seams
The seam check was missed in 9296ba8674
which calculates islands from the BMesh.
2020-11-20 01:35:26 +11:00
ad4b7741db Build-system: Force C linkage for all DNA type headers
Some DNA headers already did this, most did not. Even though many of them would
be included in C++ files and thus compiled as C++. This would be confusing and
developers may think they have to add `extern "C"` too a whole lot of
(indirect) includes to be able to use a C header in C++.

However, this is a misconception.
`extern "C"` does not cause code to be compiled with C rather than C++! It only
causes the linker to not use C++ function name mangling. See
https://stackoverflow.com/a/1041880.
Because extern DNA headers don't have function declarations, using `extern "C"`
actually should not have any effect. On the other hand, adding it causes no
harm and avoids confusion. So let's just have it consistently in C header
files.

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

Reviewed by: Bastien Montagne, Sybren Stüvel
2020-11-19 13:41:50 +01:00
1395ba70bf Fix crash when adding strip using RNA API call
Don't allocate StripElem for movieclip, scene and mask strips. This
struct is not handled in seq_dupli function. This caused field to be
uninitialized in COW datablock.

StripElem is not allocated when adding strip with operator and it is
not needed for these strip types.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9600
2020-11-19 13:10:42 +01:00
abe95fbdff Cleanup: refactor sequencer_edit.c file
Move RNA enums and utility functions closer to operator definition.

No functional changes.
2020-11-19 13:04:17 +01:00
af7af488d4 Cleanup: Animation, fix uninitialised variable in Euler filter code
No functional changes.
2020-11-19 13:02:13 +01:00
226feb52ec Cleanup: Animation, refactor Euler filter
Split up the Euler filter function into two more functions. The Euler
filter operator works in two stages (find channels that define the X/Y/Z
Euler rotations, and perform filtering on those channels), and each
stage now has its own function. This makes it clearer which data are
used in which part of the code, and makes future improvements easier.

No functional changes.
2020-11-19 12:57:29 +01:00
b5e85321dc Docs: document bmesh.utils.vert_collapse_faces join_faces argument 2020-11-19 22:18:47 +11:00
fd88246d61 Fix error message prefix in Quaternion.to_euler()
Fix copy-paste error of error message prefix, so that the Quaternion
function no longer says it's a Matrix function error.
2020-11-19 11:26:54 +01:00
ae64898147 Cleanup: fix bad comment separator
Replace `* /` with `*/` to actually end the comment. As it was, the code
compiled but caused an "`/*` in comment" warning.

No functional changes.
2020-11-19 11:04:30 +01:00
71c6c95aec Merge remote-tracking branch 'origin/blender-v2.91-release' 2020-11-19 10:43:46 +01:00
256e77c987 Fix T82833: GreasePencil crash when changing to Vertex Color mode
This is actually a user interface issue, introduced on 0688309988.

but->tip is checked for NULL in other parts, and rightly so, since here
it crashes Blender.

On a side note I don't know how to reliably reproduce the original bug
whose fix introduced this issue. That got on the way of seeing whether
this is the correct fix, if it happens outside greasepencil operators.

Maybe it is an operator that is missing a tooltip? Impossible to tell
without more information from said commit. That said since this happened
during the end of bcon3 and we are not in bcon4 I'm going ahead with
this NULL check commit.

Patch reviewed by Philipp Oeser and Sergey Sharybin.
2020-11-19 10:33:08 +01:00
e5df87b1b9 Cleanup: split sequencer_edit.c file
Move proxy operator functions to own file.

No functional changes.
2020-11-19 09:54:40 +01:00
8ec6b34b8e VSE: Move split operator logic to module code
Code was rewritten to work on per-sequence basis returning reference to
created strip.

There should be no functional changes.

Selection logic is left as is for now. I could simplify it, but it
belongs to operator, not split logic.

Reviewed By: sergey

Differential Revision: developer.blender.org/D9592
2020-11-19 05:31:40 +01:00
9d6d5b9beb Fix T82445: Wintab packets being discarded.
Switched timer to use GetTickCount instead of QueryPerformanceCounter
as Wintab's pkTime seems to (but is not guaranteed to) use the former.
2020-11-18 14:29:51 -08:00
e9ddb21df3 Cleanup: Grammar: "Allow to" vs gerund missed in last commit 2020-11-18 16:31:26 -05:00
8f30a88e63 Cleanup: Grammar: "Allow to" vs gerund
In cases where "Allow" is followed by an infinitive, a noun needs
to directly follow it. But it makes more sense to follow it with a
gerund instead.
2020-11-18 16:14:48 -05:00
038828f49a Fix: Sub-panel backdrop sometimes draws when closed
My last cleanup commit for this function missed this case. It likely
happens because the panel's block size doesn't update properly somewhere.
Short of investigating that right now, it makes sense to return early
in this case anyway.
2020-11-18 15:54:41 -05:00
e9607f45d8 GPencil: Automerge last drawn stroke with previous strokes
This option joins any stroke with an end near  the actual stroke. Now it is not limited to the last stroke, any stroke in the same layer for the actual frame can be joined. The join can join two strokes drawing a third stroke.

If the end and the start of the result stroke are very small, the stroke is changed to be cyclic automatically.

There is a limit distance to join the stroke, if the distance is greater than this value, the strokes are not joined. Actually, a constant, threshold distance is used, but we could expose 
as a parameter in the UI in the future.

The tool can be used with freehand drawing or with primitives.

Note: Great part of the patch is just a refactor of the old code to make it accessible and to keep code organized.

Reviewed By: mendio

Maniphest Tasks: T82377

Differential Revision: https://developer.blender.org/D9440
2020-11-18 21:35:06 +01:00
c126e27cdc Cleanup: Move function to proper section 2020-11-18 15:16:17 -05:00
0d93bd8d63 UI Code Quality: Refactor panel drawing function
The existing panel drawing function was a bit convoluted with dependent
conditions in different scopes, redundant and unecessary computations,
and un-helpful naming.

This commit separates the function into two parts, the backdrop and the
widgets. It also improves naming and uses const where possible, and in
general cleans up the code.

There are some slight visual changes, mostly with the placement of the
drag icon, which moves a bit downward to be centered with the triangle
icon. The black rectangle displayed while dragging is also removed.
2020-11-18 15:14:11 -05:00
ad58999b0d Fix pin icon in Properties not right-aligned after zooming
The logic for separator-spacers (used here for right-alignment) didn't take
region scaling into account. Usually that's not an issue because they are
otherwise only used in headers which can't zoom.
2020-11-18 19:54:35 +01:00
d6d7965307 Fix pin icon in Properties not right-aligned after zooming
The logic for separator-spacers (used here for right-alignment) didn't take
region scaling into account. Usually that's not an issue because they are
otherwise only used in headers which can't zoom.
2020-11-18 19:49:20 +01:00
56ef6fdb9e Merge branch 'blender-v2.91-release' 2020-11-18 08:19:37 -07:00
9a8f5022b7 Fix: Outliner hierarchy line width variations
During some operators like rotate in grease pencil edit mode the
hierarchy lines in the outliner would draw twice as thick. Set the width
before drawing the lines in the outliner.

Differential Revision: https://developer.blender.org/D9589
2020-11-18 08:17:42 -07:00
898231fdbc Fix transform redo panel showing only the first custom orientation
The error was introduced in rBf470a02afaea, but the problem is in
`ED_transform_calc_orientation_from_type_ex`
2020-11-18 11:57:08 -03:00
20f8130d6f Fix T82777: Some transform modes using incorrect default orientation
Some modes were always using `"Global"` orientation as the default.
2020-11-18 11:57:08 -03:00
466cd2535b Fix exact boolean coplanar problem due to inexact transform.
This is an addendum to previous boolean fix, where the object
transformation was "cleaned". Now the operand one is too.
This fixes the issue shown in the video in T82301 when you move
a column around the XY plane with the top and bottom faces
supposedly coplanar with a cube. The transformation matrix when
you do that has a tiny offset in the z component.
2020-11-18 09:56:20 -05:00
957f14a689 Merge branch 'blender-v2.91-release' 2020-11-18 15:39:43 +01:00
4edaa796d3 Fluid: Revert changes from T82488
Scaling of forces needs more work. Before making changes to them it would be nice to have a setup, that works physically correct across multiple modifiers (cloth, rigid bodies, fluid).

This will be a to do for 2.92.
2020-11-18 15:38:00 +01:00
f132d74c7d Merge branch 'blender-v2.91-release' 2020-11-18 14:26:01 +01:00
549a1cac88 Fix T82810: UV Editor, Crash with switching between single image and UDIM tile
Active tile could be NULL when it was on the second tile before
switching back and forth between the Image/UDIM.

In the future we might also check that the active_tile_index is always
valid.
2020-11-18 13:12:19 +01:00
4b55abc335 Fix T82586: Sculpt normals not updating with EEVEE enabled
The root cause of this bug is that the function that updates the PBVH
normals is drw_sculpt_generate_calls. As now both the overlays and
mesh can be drawn without using pbvh drawing, the normals were not
updating. This patch forces a normals updates also in the no PBVH
drawing code path of the overlays. This was affecting both shading and
sculpt surface sampling in both flat and smooth shading modes.

Having the sculpt normals being updated by the drawing code is a wrong
design which also causes other issues like:

    Brushes that sample the surface and do multiple stroke steps between

redraws will sample invalid normals, creating artifacts during the
stroke clearly visible in some brushes.

    Brushes that do not need to sample the surface update the normals on

each redraw. This affects performance a lot as in some cases, updating the
normals takes more time than doing the brush deformation. If flat shading
is being used, this is only necessary to do once after the stroke ends.

Reviewed By: fclem
Differential Revision: https://developer.blender.org/D9535
2020-11-18 12:20:57 +01:00
d2cddb1fda Merge branch 'blender-v2.91-release' 2020-11-18 16:43:01 +11:00
dfa2b0e1c9 Fix T82800: Changing settings from a pie menu doesn't add undo steps
Pie menu had inconsistent behavior for dragging & releasing the key
compared to clicking on the button.

This was caused by the `onfree` argument being set to true,
preventing the button from running callbacks such as setting
up undo data & auto-keyframe

This argument should only be used when freeing the button,
set this to false as is done for regular menus.
2020-11-18 16:40:48 +11:00
8b8328fbfc Merge branch 'blender-v2.91-release' 2020-11-18 15:13:26 +11:00
0688309988 Fix undo UI text containing shortcuts & newlines
- Shortcuts were being shown in the undo history.
- Multi-line tool-tips now only use the first line.
2020-11-18 15:10:51 +11:00
80a701c4e6 Merge branch 'blender-v2.91-release' 2020-11-17 19:55:49 -07:00
a352baccc3 Fix grease pencil draw mode icon color in outliner
ICON_GREASEPENCIL was defined as an object data icon when it was used as
a mode icon. This caused it to draw green in the outliner.
2020-11-17 19:51:14 -07:00
a3833abe2c Fix wrong grease pencil datablock icon in file browser
The datablock shown in the file browser was the draw mode icon rather
than the datablock icon.
2020-11-17 19:49:28 -07:00
bbdfeb751e Cleanup: remove break after return statements 2020-11-18 13:36:30 +11:00
88512646c0 Cleanup: clarify precedence of operations 2020-11-18 13:36:26 +11:00
d13edeaed4 Cleanup: 'false' use as NULL pointer 2020-11-18 13:19:53 +11:00
eb2c26bd38 Fix use of operator flag as boolean
Error in cb9de95d61
2020-11-18 13:13:52 +11:00
2485ee997b Cleanup: use descriptive argument name for uv parametrizer 2020-11-18 12:59:39 +11:00
ec6e88d4b2 Cleanup: simplify array usage for Python box packing API 2020-11-18 12:50:44 +11:00
75a4872c90 Cleanup: declare original function storage variables static
Also minor comment formatting changes.
2020-11-18 12:44:08 +11:00
3e325c35f8 Merge branch 'blender-v2.91-release' 2020-11-17 23:10:13 +01:00
e580c18853 Fix T82542: Boundary brush crash with dyntopo
This brush needs to be disabled for dyntopo as it stores its custom data
and deforms from original coordiantes.

Reviewed By: sergey

Maniphest Tasks: T82542

Differential Revision: https://developer.blender.org/D9516
2020-11-17 23:01:33 +01:00
9b20bbc3bf LibOverride: PointCache: Add UI feedback about need to enable Disk Cache.
Note that I chose to modify the label of the main `Bake` button instead
of adding an extra label line, as that would disturb the UI in a
annoying way.
2020-11-17 21:33:28 +01:00
df2bf164c7 Cleanup: Use LISTBASE_FOREACH macro 2020-11-17 13:00:43 -05:00
da6c968a95 Cleanup: Clang tidy else after return 2020-11-17 12:58:26 -05:00
7d23dd4430 Cleanup: Clang tidy inconsistent parameter name 2020-11-17 12:57:35 -05:00
75dbbaeda6 Merge branch 'blender-v2.91-release' 2020-11-17 17:39:47 +01:00
22161b6451 Cleanup: Fix incorrect RNA property label/tooltip re active NLA track.
The joys of copy/paste again.
2020-11-17 17:39:08 +01:00
ea7aae88cf Cleanup: Remove unecessary NULL check
Panels for active uiBlocks always have a type, because the process that
makes them uses the types. Add an assert just to make it clear that the
assumption is purposeful.
2020-11-17 10:28:57 -05:00
d952d1792a Merge branch 'blender-v2.91-release' 2020-11-17 10:17:00 -05:00
Jeroen Bakker
d73130cc28 Fix T82770: Artifacts when painting on generated transparent image
Regression introduced by {b17cca6966}. When centralizing the gpu texture
premultiplication setting it was assumed that generated images
(`IMA_TYPE_UV_TEST`) were stored as premultiplied. That assumption was
totally wrong as the alpha association is determined by the existing of
the float/byte buffer.

NOTE: This change will render generated images with pure emissive
colors (show colors when alpha=0.0) what might add more reports. Any
reports could be merged in the next report {T82790}.

Reviewed By: Clément Foucault, Philipp Oeser

Differential Revision: https://developer.blender.org/D9585
2020-11-17 16:10:42 +01:00
cc0b8cb359 Fix T82341: Warning in terminal during property search
After recent changes to the context panel layout (rB187cc5e26d28b1a8),
there has been an error printed when running propery search:

> Error: separator_spacer() not supported in popups.

The layout code thinks it's drawing in a menu because region->visible
isn't properly set for the other tab searches. This patch sets that field
for the temporary searching region, but it also disables searching in the
context breadcrumbs panel, because at best this will just give results
for the names of the active object, etc. This isn't helpful since
those labels are mostly in every tab anyway.

Differential Revision: https://developer.blender.org/D9425
2020-11-17 10:08:39 -05:00
0724fabcf5 Fix T81227: Modifier menu and text switch places
Logic was incorrect, mistake in f3b8792b96.

Updated comment to make intent more clear.

Same as fd78f8699e, but needed conflict resolution as the panel-type
flags where renamed in master.
2020-11-17 15:58:05 +01:00
dede4aac5b Fix T77561 EEVEE: Refraction BSDF is using world probe during glossy bake
This fixes light leaking during baking indoor environment when using
refraction bsdfs.
2020-11-17 15:56:24 +01:00
fd78f8699e Fix T81227: Modifier menu and text switch places
Logic was incorrect, mistake in f3b8792b96.

Updated comment to make intent more clear.
2020-11-17 15:31:50 +01:00
c12664a37f Merge branch 'blender-v2.91-release' 2020-11-18 00:27:40 +11:00
9d716b929d Merge branch 'blender-v2.91-release' 2020-11-18 00:27:36 +11:00
90e516d1a5 Merge branch 'blender-v2.91-release' 2020-11-18 00:27:33 +11:00
71def9738e Merge branch 'blender-v2.91-release' 2020-11-18 00:27:29 +11:00
9296ba8674 Fix T82637: pack UV islands fails with some non-manifold meshes
Edges with 3 or more connected UV's caused UV pack to fail.

Instead of using functions from uvedit_parametrizer.c which are intended
specifically for ABF/LSCM unwrapping, use a simpler method for packing
which stores arrays of BMesh faces.
2020-11-18 00:25:30 +11:00
a993600323 BMesh: support for comparing loops when calculating face-groups
Add an optional callback to check source/destination loops for
BM_mesh_calc_face_groups.

This is needed so it can be used to calculate UV islands.
2020-11-18 00:02:54 +11:00
6694d7ac5f BMesh: add UV face transform and minmax utility functions 2020-11-17 23:57:16 +11:00
7785a9c9d2 BLI_rect: add a float version of the 'pad' function 2020-11-17 23:57:16 +11:00
03ad2958d3 Merge branch 'blender-v2.91-release' 2020-11-17 13:12:21 +01:00
1e1c39fc89 Fix T82064: Add Image Clone tool to overlay engine
The clone tool in the image editor can show a second texture on top
of the image. This wasn't ported and now results into alpha and depth
issues. This fix adds the clone tool drawing to the overlay engine.

Reviewed By: Clément Foucault

Differential Revision: https://developer.blender.org/D9352
2020-11-17 13:10:39 +01:00
Ankit Meel
88de58fd1a Clang-tidy, fix bugprone-exception-escape.
Remove redundant call to `ofstream::close()` from `~PSStrokeRenderer`
and `~TextStrokeRenderer`. ofstream will be destructed automatically.

- For `~Depsgraph`, `std::function`'s constructor can throw.
- Passing throwing statements in the lambda will not be detected by
  clang-tidy.
Fix these issues by using lambda as function argument.

Reviewed By: sergey, sybren
Differential Revision: https://developer.blender.org/D9497
2020-11-17 17:33:25 +05:30
417224a31b Merge branch 'blender-v2.91-release' 2020-11-17 13:02:30 +01:00
8b6ce77f16 VSE: Fix prefetch initialization sequence
In 8d1978a8e0 bmain entry is updated when prefetching is started,
but this must be done before seq_prefetch_update_context(). Otherwise
created cache keys will be incorrect.

This happens immediately after prefetch is started. When it's refreshed
problem goes away.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9581
2020-11-17 13:00:00 +01:00
cd9ce01657 RNA define: check and report invalid usages of ID pointers properties.
Some RNA structs, like operators or keymaps, are not allowed to have ID
pointer properties. now this check will ignore those, and report an
error message in the console.

Related to T82597.

Notes: While a bit more involved than rBf39fbb3e6046, this commit
remains fairly localized and non-intrusive.

It relies on some rather obscure and weird behaviors of our RNA code
though, a cleaner solution could be e.g. to add a tye to
`StructOrFunctionRNA`, so that we could properly 'rebuild' (re-cast) the
pointer to either `StructRNA` or `FunctionRNA` when needed in internal
code...
2020-11-17 12:56:26 +01:00
a25bc79633 Merge remote-tracking branch 'origin/blender-v2.91-release' 2020-11-17 11:11:34 +01:00
Wayde Moss
709ceddab2 Fix T82774: NLA Sync Length Typo Fix
When offsetting strips to the left, to make space when syncing strip
length, move the preceding NLA strips instead of the succeeding strips.

The bug seems to be from a copy/pasting typo.

Reviewed By: sybren

Differential Revision: https://developer.blender.org/D9583
2020-11-17 11:01:28 +01:00
02efc0111c Fix T82588: Box Select selects keyframes hidden by "Only Show Selected"
Select only editable keys on selected curves when "Only Show Selected
Curves" is enabled in the Graph Editor's View menu.

This prevents selecting invisible keys with box, circle, and lasso
select in the Graph Editor.

Reviewed By: looch

Differential Revision: https://developer.blender.org/D9580
2020-11-17 10:58:40 +01:00
fb033341f9 Merge branch 'blender-v2.91-release' 2020-11-17 09:37:41 +01:00
2e1498ff16 Fix T82042: Crash when rendering huge images
Crash is related to the definition of the GL_MAX_TEXTURE_SIZE. OpenGL does not clearly
defined `GL_MAX_TEXTURE_SIZE` exactly means. Both on AMD and NVIDIA we have issues with
huge textures that they don't get created even if they are smaller. (See {D9530} for
research).

This patch will try to create the texture in a smaller size when the texture creation
failed.

Final implementation by: Clément Foucault

We should create a solution that doesn't need downscaling. For this specific case ARB_sparse_texture might help to create cleaner code, but you still have to commit the whole image what introduces several draw calls. Other improvement is to optimize the scaling; current implementation isn't optimized for performance.

Reviewed By: Clément Foucault

Differential Revision: https://developer.blender.org/D9524
2020-11-17 09:33:47 +01:00
797dfa6a0a Merge branch 'blender-v2.91-release'
Conflicts:
	source/blender/editors/render/render_opengl.c
	source/blender/sequencer/intern/effects.c
2020-11-17 04:10:51 +01:00
75bd286813 Fix T82703: Image not scaled when rendering
This is was caused by incorrectly set preview_render_size in VSE
rendering context. Value was set to SEQ_PROXY_RENDER_SIZE_FULL, but
it should be SEQ_PROXY_RENDER_SIZE_SCENE as scene render size is
being used.

This is same fix as 0d7036b40e, but I did not checked openGL
render pipeline.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9562
2020-11-17 03:56:53 +01:00
55be1dde5c Fix incorrect text size with downscaled preview
Use either scene render size or fixed preview scale factor.

Previously scene render size was used as baseline value for text size
correction. This is incorrect.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9563
2020-11-17 03:55:52 +01:00
4095835db1 Cycles: Fix compilation error and warning without OPENVDB 2020-11-17 01:31:33 +01:00
82b8c15684 Fix T81827: MacOS lines that should be thick are green instead
The issue was the use of alpha values of 0 when there were no blending
enabled.

This patch just disables the smoothing of the wires in this case.
2020-11-17 01:31:32 +01:00
09045ff64d Merge branch 'blender-v2.91-release' 2020-11-16 14:19:11 -07:00
906ff7b8fe Fix wrong collection icon in outliner popover
This icon was missed in rB0633a89e1827
2020-11-16 14:13:23 -07:00
1d4f3e2a26 Outliner: Collection icon color tweaks
The icons originally chosen for the collection colors were selected
during development and had a few issues with contrast in the light
theme, and the gray color was not a good choice against the default gray
backgrounds.

The new colors are more readable in both default Blender themes. Gray
was replaced with pink.

Differential Revision: https://developer.blender.org/D9504
2020-11-16 13:54:05 -07:00
96200110eb Fix T76699: Support macOS inbetween mouse/tablet.
Coalescing on macOS overwrites a singular unprocessed mouse event. To
receive all mouse and tablet events coalescing is disabled.

Disabling coalescing for macOS disables coalescing for trackpad
gestures. Repeat trackpad events are unnecessary and found to
negatively impact performance thus are re-coalesced in Window Manager.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D9574
2020-11-16 12:46:16 -08:00
5d13cb5c2a Merge branch 'blender-v2.91-release' 2020-11-16 19:30:37 +01:00
457d537fe4 Fix T82673: Cycles crash with zero emission strength and linked emission color 2020-11-16 19:29:59 +01:00
07bd8eab97 Fix unreported wireframe opacity color blending broken
This was introduced by rBdb7d8281c5a2.

The color needs to be premultiplied as there is no blend mode and
the output color is replacing the framebuffer color & alpha.
2020-11-16 18:31:43 +01:00
13ec512f4b Fix T81983: volume tiles missing in Cycles renders
The OpenVDB data structure can store voxel data in leaf nodes or tiles
when all the nodes in a given region have a constant value. However,
Cycles is using the leaf nodes to generate the acceleration structure
for computing volume intersections which did not include constant tiles.

To fix this, we simply voxelize all the active tiles prior to generating
the volume bounding mesh. As we are using a MaskGrid, this will not
allocate actual voxel buffers for each leaf, so the memory usage will be
kept low.

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

Reviewed by: brecht, JacquesLucke
2020-11-16 17:55:39 +01:00
328aad8c98 UI: Remove X axis panel dragging
X axis panel dragging traces back to Blender versions before 2.5,
where panels could be aligned horizontally. But for many years now
panels have been vertically aligned. Considering this, keeping the
X axis dragging around is a bit odd. It makes interaction confusing,
or at least more complicated. It also looks bad, since any part of
the panel outside the region is cropped.

Differential Revision: https://developer.blender.org/D9549
2020-11-16 11:47:11 -05:00
c1d8df47f6 Revert "RNA define: check and report invalid usages of ID pointers properties."
This reverts commit f39fbb3e60.

Code is not valid, `DefRNA.laststruct` does not always point to the
proper struct when defined from Python, need to be done differently.
2020-11-16 17:13:12 +01:00
c48063d1f6 Merge branch 'blender-v2.91-release' 2020-11-16 11:00:23 -05:00
c645da98d8 Fix T82439: Crash moving collections between scenes
The original code for viewlayer collection flag syncing across moves
from D9158 didn't consider the case where the collection could no longer
be found in its original view layer (moving a collections betwen scenes).

The fix is to just check if the collection starts in the same scene as
it will be moved to before trying to do the flag syncing. I thought about
this for a while and tried a couple other solutions, but I couldn't come
up with a proper way to support syncing the layer collection flags across
scenes without making too many changes.

Differential Revision: https://developer.blender.org/D9568
2020-11-16 10:59:49 -05:00
13bcb000fa Fix broken pointcache on disk in some cases.
Root of the issue is that point caches are added to the object's list
on-demand, which often ends up with them being added only during
depsgraph evaluation, i.e. on COW objects.

This could result in having 'orig' data caches with invalid/unset stack
index at some points (e.g. when reading a file and applying
liboverrides), leading to discarding valid existing disk cache files.
Fact that one of those index is signed, and the other not, does not
help...

While this is very weak, fixing broken PointCache code is out of the
scope of a bug fix, so this patch merely:
* Simplifies and factorizes the code generating the 'extension' part of
  caches filenames;
* Ensures `BKE_object_insert_ptcache` is called when needed so that we
  always have a valid stack index to generate that filename extension.

This is only a bandaid, but it is simple and should be safe enough for
now.

Related to T82503.
2020-11-16 14:39:31 +01:00
97d52daf96 Fix (unreported) potential buffer overflow in PointCache code. 2020-11-16 14:39:31 +01:00
f39fbb3e60 RNA define: check and report invalid usages of ID pointers properties.
Some RNA structs, like operators or keymaps, are not allowed to have ID
pointer properties. now this check will ignore those, and report an
error message in the console.

Related to T82597.
2020-11-16 14:39:31 +01:00
b78bebb2af Merge remote-tracking branch 'origin/blender-v2.91-release' 2020-11-16 14:15:01 +01:00
Fabrício Luis
75af3165ca Fix T82519: Adding 2nd driver doesn't recalculate
Remove `return` from for-loop which blocked the recalculation of driven
values when it found the first driver.

Reviewed By: sybren, sergey

Differential Revision: https://developer.blender.org/D9515
2020-11-16 14:10:24 +01:00
62c4d0419c Merge branch 'blender-v2.91-release' 2020-11-16 13:23:59 +01:00
8b815c7ce5 Fix T81271: Fix crash in BLI_gzopen on Windows
Previously the return value of `ufopen` wasn't checked and if it failed,
`NULL` was passed into `fclose()` which resulted in a crash. This patch
avoids this by returning from `BLI_gzopen` when the file cannot be created.

Reviewed By: sebbas, iss

Differential Revision: https://developer.blender.org/D9576
2020-11-16 13:17:24 +01:00
8b88739848 Merge branch 'blender-v2.91-release' into master 2020-11-16 12:55:50 +01:00
7db42b8f2a Fix T82460: Color Management Curves do not update when Image/UV Editor
is present

Caused by rB4212b6528afb.

'updateGLSLCurveMapping()' compares cacheIDs and in certain scenarios,
these are the same when they should not.

- whenever we had multiple viewports that are colormanaged with
curvemappings this worked right (cacheIDs were different)
- for example, this also worked right when the ImageEditor displays a
Render Result or a Compositor Viewer
- but it worked wrong when the Image Editor displays any other Image (or
no Image at all)
- it also worked right if there were multiple Image Editors [and one of
them displays a Render Result e.g]

Now why is this so?

For comparison, the curve mapping's pointer/address is used.

- update_glsl_display_processor frees the curve_mapping, see
BKE_curvemapping_free(global_glsl_state.curve_mapping)
- similar, update_glsl_display_processor creates a new curvemapping, see
BKE_curvemapping_copy(view_settings->curve_mapping)
- now for the situation that a viewport with curvemapping and a viewport
without curvemapping is present and you make changes to the curvemapping
the following happens:
-- curve_mapping_settings->cache_id is set once [to the memory address
of curvemapping before change]
-- change happens
-- viewport 1 frees curvemapping
-- viewport 2 duplicates using BKE_curvemapping_copy, but this one gets
the same address like before the change
-- this means we have different data on the same address with the same
cacheID...

Solution: to really make the cache ID unique we can combine the pointer
with its 'changed_timestamp' [which increases on every change].

Reviewers: jbakker

Maniphest Tasks: T82460

Differential Revision: https://developer.blender.org/D9559
2020-11-16 12:52:24 +01:00
cb9f6dfebd Merge remote-tracking branch 'origin/blender-v2.91-release' 2020-11-16 12:23:05 +01:00
ada79b4707 Fix T82740: Drivers on movie clip datablock crash on file open
Add call to `BKE_animdata_blend_read_data()` after remapping the MovieClip
datablock address.
2020-11-16 12:21:03 +01:00
af013ff76f Cleanup: clang-tidy 2020-11-16 21:54:28 +11:00
64aa6c68d5 Fix T81817: use-after-free when trying to open file from splash screen
The issues was that Blender was trying to refresh the
splash screen region. However, opening the file browser
closed the splash screen and freed the region.

The fix is to simply not refresh the region.

Has been approved in T81817.
2020-11-16 11:30:24 +01:00
8fd27c152a Correct T82753 Fix from 979fe4f1be 2020-11-16 18:27:11 +11:00
979fe4f1be Fix T82753: Crash using add-object tool when gizmos are disabled 2020-11-16 18:24:02 +11:00
64ab084ca5 Grease Pencil: adjust behavior of target object detection
First detect the other selected object, then check it can be written to.

Otherwise the target object could be the first one found when
looping over objects which is random from the user perspective.

Move the type check to the operator, which also checks the data isn't
library data which was being ignored.
2020-11-16 16:48:44 +11:00
a3a6d6a670 Cleanup: spelling 2020-11-16 16:48:41 +11:00
4eac03d821 Cleanup: clang-format 2020-11-16 16:48:19 +11:00
01db805a82 Cleanup: split sequencer.c file
Move most functions into separate files.

File sequencer.c is reserved for alloc, free and duplicating functions.

There should be no functional changes.
2020-11-16 05:02:30 +01:00
52a189936b Merge branch 'blender-v2.91-release'
Bring in exact boolean fix.
2020-11-15 20:26:14 -05:00
fbffff26e4 Fix T82736, Exact Boolean fail with repeated subtraction of same object.
Two problems were fixed. One, the code for dissolving vertices
left a face around if dissolving a vertex would leave less than
three vertices. Instead, the face should be deleted.
Two, with transformations like "rotate 180 degrees", this should
be no problem with exact, but the current transformation matrix
has very small non-zero entries where it shouldn't. Cleaning the
transformation matrix makes it more likely that user expectations
about coplanar faces will be fulfilled.
2020-11-15 20:24:59 -05:00
194a57fd63 Outliner: Fix memory errors in runtime data
Fix a heap-use-after-free when duplicating outliner editors, and fully
free runtime data when freeing outliner editors.
2020-11-14 14:24:40 -07:00
6ac5e0b3e8 GPencil: Missing initialization in previous commit 2020-11-14 15:21:20 +01:00
c2f76f1550 GPencil: Cleanup clang format 2020-11-14 15:16:27 +01:00
b6041bfc6c GPencil: Fix unreported crash in some cases when duplicate a stroke
Some pointers were not initialized.
2020-11-14 15:16:02 +01:00
a3ce05d00e GPencil: Fix callback parameter list error
In the previous commit the bGPDframe parameter was removed, but this parameter is required to keep the same function signature.
2020-11-14 09:44:55 +01:00
83d0810a9f Merge branch 'blender-v2.91-release' 2020-11-13 20:52:06 -07:00
9b54c81414 Collections: Prevent setting scene collection color tag from rna
It should not be possible to set the scene collection's color tag
through rna. Also adds a missing notifier for setting the collection
color tag from python.
2020-11-13 20:36:35 -07:00
0633a89e18 UI: Remove remaining uses of old collection icon
After rB452a1c7b3838 there were still a few cases where the old
collection icon was used in the interface. Replace these with the new
filled collection icon.
2020-11-13 20:28:28 -07:00
2abbcaa021 GPencil: Fix compiler warning, unused variable 2020-11-13 22:31:58 +01:00
0be88c7d15 GPencil: Merge GSoC curve edit mode
Differential Revision: https://developer.blender.org/D8660

This patch is the result of the GSoC 2020 "Editing Grease Pencil Strokes
Using Curves" project. It adds a submode to greasepencil edit mode that
allows for the transformation of greasepencil strokes using bezier
curves. More information about the project can be found
here: https://wiki.blender.org/wiki/User:Filedescriptor/GSoC_2020.
2020-11-13 21:43:00 +01:00
9d28353b52 Cleanup: Make panel type flag names more clear
The overlap with the `Panel` flags that start with "PNL" was quite
confusing because wasn't clear which enum a flag was from. The
new names are a bit longer, but the clarity is worth it.
2020-11-13 13:57:20 -05:00
4c193f731e Cleanup: Move PanelType flag from DNA to BKE header
Since this flag isn't saved in files and PanelType itself is defined in
BKE, the flag makes more sense there.
2020-11-13 13:15:41 -05:00
e9b955b99c GPencil: Remove ID from operators to fix T82597
Instead to use the ID of the object, now the parameter is an Enum with Selected object or New.

If use selected mode, the first grease pencil object selected is used. If none of the selected objects is a grease pencil object, a new object is created.

Small cleanup changes to the original patch.

Differential Revision: https://developer.blender.org/D9529
2020-11-13 15:21:15 +01:00
50ccf346f0 LibOverride: Adjust PointCache operators to properly handle overrides.
LibOverrides only support a small sub-set of PointCache features for now
(one cannot add new caches, baking in memory is not supported...).

Part of first step of T82503: support disk cache in liboverrides.
2020-11-13 14:21:27 +01:00
7e210e68ba LibOverride: Do not tag overrides for complete recalc.
This was done as some sort of safety, but should not actually be needed,
and including tags like `ID_RECALC_POINT_CACHE` e.g. makes usage of
point caches impossible with liboverrides (since it would systematically
invalidate all cache on file load).

In theory we should not have to tag anything here in fact, RNA accessors
are supposed to take care of it, but for now we keep the
`ID_RECALC_COPY_ON_WRITE` one.

Part of first step of T82503: support disk cache in liboverrides.
2020-11-13 14:21:27 +01:00
59910f7217 LibOverride: Make PointCache RNA properties overridable.
Note that due to convoluted layout of point caches in RNA (active one
also storing list of all available ones), we'll often have the
pointcache overrides rules twice. Should not be a huge problem,
practically speaking.

Part of first step of T82503: support disk cache in liboverrides.
2020-11-13 14:21:27 +01:00
75ea4b8a1f Ceres: Update to upstream version 2.0.0
We already were using one of earlier RC of the library, so there is no
expected big changes. Just making the update official, using official
version and stating it in the readme file.
2020-11-13 11:52:59 +01:00
7146e9696e CMake: Extend strict flags cancellation flags
Becomes rather annoying to duplicate them across C/C++ GCC/Clang sets,
almost as if the test should test both C and C++, and to do it for all
compilers.

Solves strict warning in the upstream of Ceres library.
2020-11-13 11:51:49 +01:00
a2e00236d0 Revert "Codesign: Versioning code to support older branches"
This reverts commit 9d172f007e.

Got a second thought and remembered why it was not done in the first place.
The issue here is that the server needs to communicate codesign result back
and that must happen within the new protocol. So if the client talks old
protocol it is possible to receieve data from it, but is not possible to
communicate result back to it.
2020-11-13 11:35:04 +01:00
a8f9a24939 Cleanup: use IMB_FTYPE_NONE instead of 0 for imbuf format comparison
Image format code checked the file type against an enum except for
zero which is used when the format can't be detected.

Also add doc-strings to some of the image file type callbacks.
2020-11-13 20:32:15 +11:00
4a3b26dd5e Fix building after 2e53b646f6f02ab112e0823b9577ff2e1920faaeq 2020-11-13 20:32:15 +11:00
2e53b646f6 GPencil: Remove "angle_split" from Multiply modifier. 2020-11-13 17:20:20 +08:00
5035057281 Object: show preview plane for add-object tool
The orientation & depth settings are used to show the preview plane
that is used when adding the object.
2020-11-13 20:15:03 +11:00
9d172f007e Codesign: Versioning code to support older branches
Turns out it is easier to have suboptimal versioning code on the server
side than to deal with branches where changes are to be merged into.
2020-11-13 09:49:02 +01:00
12f394ece7 refactor vec_roll_to_mat3_normalized() for clarity
the function vec_roll_to_mat3_normalized() has a bug as described in T82455. This Differential is only for refactoring the code such that it becomes more clear what the function does and how the bug can be fixed. This differential is supposed to not introduce any functional changes.

Reviewed By: sybren

Differential Revision: https://developer.blender.org/D9410
2020-11-13 09:46:18 +01:00
Ivan Perevala
4efd87d56b UI: Adaptive HDRI preview resolution
HDRI preview should have resolution dependent on dpi, viewport scale and HDRI gizmo size.
This patch uses a LOD to render a more round sphere.

Reviewed By: Jeroen Bakker

Differential Revision: https://developer.blender.org/D9382
2020-11-13 08:26:27 +01:00
YimingWu
b35b8c8849 Adding 3D_POLYLINE_UNIFORM_COLOR to PyGPU shader API
This would allow python script to access `lineWidth` uniform when drawing lines
without using `glLineWidth`.

Reviewed By: Jeroen Bakker

Differential Revision: https://developer.blender.org/D9518
2020-11-13 08:23:04 +01:00
Manuel Castilla
4dc5920525 Fix CalculateStandardDeviationOperation incorrect results for R G B channels
Standard deviation formula wasn't being applied correctly when selecting
R G B cases. Issue is there since Blender 2.64 as it was incorrectly
ported over from the previous compositor.

Reviewed By: Sergey Sharybin, Jeroen Bakker

Differential Revision: https://developer.blender.org/D9384
2020-11-13 08:20:15 +01:00
Jun Mizutani
db7d8281c5 Add An Opacity Slider to Overlay Wireframe
This patch adds an opacity slider to the wireframe overlay. The previous
wireframe in dense geometry scenes could be too dark and sometimes the
user just wants an impression of the geometry during modelling.

Reviewed By: Jeroen Bakker

Differential Revision: https://developer.blender.org/D7622
2020-11-13 08:14:56 +01:00
f00ebd4dba UI: make add object tool experimental
Some changes here are planned which need feedback from users before
declaring this ready for the next release.
2020-11-13 17:27:39 +11:00
ccf8df66fe BLI_math: add floor_power_of_10, ceil_power_of_10
Add utility functions to get the floor/ceiling of a float value
to the next power of 10.
2020-11-13 17:05:46 +11:00
40b2ce5ea7 Cleanup: Remove unecessary logic in panel code
Also use short for panel flag arguments to functions since it matches
the type in DNA, and remove a comment that isn't helpful.
2020-11-12 23:32:50 -05:00
f3ab698951 Cleanup: Simplify panel activate state function
This commit moves some of the logic around so that the logic in
panel_activate_state is clearly separated by the state being activated.
There are fewer nested and redundant checks, and it's easier to see
the progression of interaction with the panel handler.
2020-11-12 23:28:53 -05:00
4eb57d00bb Merge branch 'blender-v2.91-release' 2020-11-13 11:37:47 +11:00
2e08500d04 Fix memory leak writing PNG when opening the file fails 2020-11-13 11:36:29 +11:00
454b7876ff Cleanup: remove unnecessary ImFileType.ftype callback
This callback made some sense before moving the file-type information
from a bit-flag to an enum: e142ae77ca

Since then, we can compare the type value directly.

Also replace loops over file types with IMB_file_type_from_{ibuf/ftype}.
2020-11-13 11:28:24 +11:00
ac299bb453 Cleanup: imbuf file format callback declaration
Use named members as this wasn't very readable given the number
of unnamed NULL members.
2020-11-13 10:39:48 +11:00
9a73417337 Fix T82349: file extension not added to unpacked images
Ensure the appropriate extension is set when unpacking generated images
that don't have a filepath set.

Ref D9500
2020-11-13 10:11:00 +11:00
cd49afc596 Fix T82596: Fly/walk navigation crash
Add a NULL check for the View3D's camera, because these
modes can be entered even without an active camera.
2020-11-12 17:06:57 -05:00
55e2930c18 Outliner: Sync with property editor physics tab
This commit makes the property editor switch to the physics tab instead
of the modifier tab when selecting physics modifiers. Since the modifier
isn't visible then, it's confusing to change the expansion, so this commit
also disables the modifier expansion for these modifiers.

Differential Revision: https://developer.blender.org/D9544
2020-11-12 16:59:30 -05:00
b6988de22a Merge branch 'blender-v2.91-release' 2020-11-12 20:30:14 +01:00
d59fa12f2a Fix T82607: crash cancelling Cycles render during adaptive subdivision update
Now that the Blender sync mechanism deletes nodes from the scene, we need to
ensure scene update is stopped before we do this.

Also add some more early out in scene geometry update to ensure we do not
continue working on incomplete geometry data, though that was not the cause of
this crash.
2020-11-12 20:14:12 +01:00
a6c1c0427c Cleanup: remove accidentally committed merge files 2020-11-12 19:52:04 +01:00
ddc6a45a54 Cleanup: compiler warning 2020-11-12 19:52:04 +01:00
5c01ecd2bf Fix T82516: Cycles crash updateding animated volumes after NanoVDB
Two issues:
* Automatic deduplication of OpenVDB grid data was failing when Cycles had
  already cleared the OpenVDB grid, causing an empty grid. Instead rely on
  Blender return the same OpenVDB grid pointer when deduplication is possible.
* The volume bounds mesh was not properly cleared when the OpenVDB grid was
  empty, causing a mismatch between mesh and voxel data.
2020-11-12 19:48:59 +01:00
c43283d10b fix: added missing float declarations 2020-11-12 19:27:12 +01:00
923b314a7a Test cases for vec_roll_to_mat3_normalized
The function vec_roll_to_mat3_normalized() basically has to handle 3 scenarios:

- When a bone is oriented along the negative Y axis
- When a bone is very close to the negative Y axis
- All other cases

The tests in the Differential make sure that all 3 situations are covered.

Reviewed By: sybren, mont29

Differential Revision: https://developer.blender.org/D9525
2020-11-12 18:16:35 +01:00
f17dfd575c Fix empty Cycles render devices panel showing in preferences on macOS
There is no GPU rendering support on macOS, so showing the panel only adds
confusion. Also hide the panels in builds without Cycles.
2020-11-12 17:39:19 +01:00
b9bd47c2e2 Merge branch 'blender-v2.91-release' into master 2020-11-12 16:24:18 +01:00
dad228a19c Fix asserts when two (or more) SplineIK constraints have the same root
Only a single DEG operation node `POSE_SPLINE_IK_SOLVER` should
be added in this case [ see `build_splineik_pose`, same is already done
for overlapping IK in `build_ik_pose`]

ref T82347.

Reviewers: sybren

Maniphest Tasks: T82347

Differential Revision: https://developer.blender.org/D9471
2020-11-12 16:20:48 +01:00
987732181f Merge branch 'blender-v2.91-release' 2020-11-12 14:04:02 +01:00
d0c1d93b7e Fluid: Removed clamp from force assignment
The clamp is too aggressive and results in forces being too weak.
2020-11-12 14:03:03 +01:00
a8f1bea590 Fix NanoVDB not being enabled/disabled correctly in CMake profiles
This caused warnings when e.g. building the lite profile because NanoVDB was not disabled, but
OpenVDB was. This Fixes this by setting the "WITH_NANOVDB" flag too.
2020-11-12 12:49:12 +01:00
dbbfba9428 Fix T81813: Keyframe handles don't follow keyframes
Add a new property `co_ui` to Keyframes, the modification of which will
apply to the keyframe itself as well as its Bézier handles.

Dragging the "Keyframe" slider in the properties panel now maintains the
deltas between the keyframe and its handles, just like moving the key in
the graph editor would.

Reviewed by @sybren in T81813.
2020-11-12 12:02:49 +01:00
5db114ae0f Merge branch 'blender-v2.91-release' into master 2020-11-12 11:51:25 +01:00
9067cd64a5 Fix T82466: Library Overrides: overrides disappear when appending.
`BKE_library_make_local` was not properly checking for tags and/or libs
in liboverrides case.
2020-11-12 11:50:33 +01:00
0d04bcd566 Merge branch 'blender-v2.91-release' into master 2020-11-12 11:39:34 +01:00
12dd26a2bb Sculpt: fix face set extract clicking in empty space
Should not do anything in that case.

ref T82615

Maniphest Tasks: T82615

Differential Revision: https://developer.blender.org/D9532
2020-11-12 11:36:29 +01:00
b4b4532ce0 Sculpt: use ESC key in addition to RMB to cancel eyedropper
This is more in line to other eyedropper usages throughout blender.

Affected operators:
- Sample Dyntopo detail
- Extract Face Set (as reported in T82615)

ref T82615

Maniphest Tasks: T82615

Differential Revision: https://developer.blender.org/D9531
2020-11-12 11:36:18 +01:00
d706aaa53d Merge branch 'blender-v2.91-release' into master 2020-11-12 11:26:24 +01:00
beb1460f8e Codesign: Report codesign errors from server to worker
Pass codesign errors (if any) from codesign buildbot server to the
buildbot worker, so that the latter one can abort build process if
the error happens. This solves issues when non-properly-notarized
DMG package gets uploaded to the buildbot website.
2020-11-12 11:26:06 +01:00
d7a2032846 Merge branch 'blender-v2.91-release' into master 2020-11-12 11:23:16 +01:00
eaf9ae643b Fix T82624: Skin modifiers root bone cannot be moved
When creating an armature from the skin modifier, resulting bones would
always be flagged BONE_CONNECTED.
Those bones cannot be transformed (just rotated).

Now only flag bones that really have a parent BONE_CONNECTED.

Maniphest Tasks: T82624

Differential Revision: https://developer.blender.org/D9534
2020-11-12 11:20:24 +01:00
bc090387ac Fix T82388: Sculpt mode: Unexpected undo behavior.
Issue exposed by rB4c7b1766a7f1.

Main idea is that non-memfile first undo step should check into previous
memfile and tag the ID it is editing as `future_changed`.

That way, when we go back and undo to the memfile, said IDs are properly
detected as changed and re-read from the memfile.

Otherwise, undo system sees them as unchanged, and just re-use the
current data instead.

Note that currently only Sculpt mode seems affected (probably because it
is storing the mode switch itself as a Sculpt undo step instead of a
memfile one), but similar action might be needed in some other cases
too.

Maniphest Tasks: T82388

Differential Revision: https://developer.blender.org/D9510
2020-11-12 10:47:50 +01:00
fb4113defb Codesign: Report codesign errors from server to worker
Pass codesign errors (if any) from codesign buildbot server to the
buildbot worker, so that the latter one can abort build process if
the error happens. This solves issues when non-properly-notarized
DMG package gets uploaded to the buildbot website.
2020-11-12 10:12:56 +01:00
88bb29dea6 Fix T82617: artifacts in Cycles viewport when changing subdivision attributes
The old attributes were not cleared when synchronizing the geometries, this could also lead to crashes in other cases.

Ref T82608.
2020-11-12 09:17:38 +01:00
08452d9956 Merge branch 'blender-v2.91-release' 2020-11-12 09:14:36 +01:00
cd2dfacfa5 Merge branch 'blender-v2.91-release' 2020-11-12 09:14:05 +01:00
Jeroen Bakker
c08827e659 Fix T82093: Sampled Colors Mismatch When Painting (Partial)
When painting in the image editor on data images (Non-color, Raw) the
color mismatched between the sampled color and the actual effect that
the painting has on the image. The root cause is that the sampling is
color managed, but the painting still uses a fixed color management
pipeline with a lot of assumptions. Due to recent changes the drawing
of the image editor is color managed, but the painting isn't what made
these changes show up.

This patch is a work-a-round so that the sampled colors and the effect
the paint has on the texture matches. This isn't the correct solution
as that would be to migrate all the painting tools to use proper color
management.

Reviewed By: Pablo Dobarro

Differential Revision: https://developer.blender.org/D9411
2020-11-12 09:13:06 +01:00
Jeroen Bakker
f93081a01b Fix T81673: Color picker picks up UI and Overlay
There are two implementations of the Sample Color operation. One is used
by the paint texture and one by the image editor. The image editor
variant sampled from the ibuf directly, but the paint texture variant
was sampling from the screen front buffer. This can lead into incorrect
samples due to color pipeline.

This patch will use the image editor variant when sampling a color for
2d texture painting

Reviewed By: Pablo Dobarro

Differential Revision: https://developer.blender.org/D9408
2020-11-12 09:08:32 +01:00
89c8b074e7 Cleanup: split view3d_placement depth & orientation calculation
Split out functionality needed for preview plane drawing.
2020-11-12 16:16:49 +11:00
934c2c8ac5 Cleanup: clang-tidy, remove invalid comments 2020-11-12 15:18:08 +11:00
977b6ca305 Cleanup: Imperative tense in property description 2020-11-12 04:59:50 +01:00
f284a40385 ImBuf: pass the number of bytes read to 'is_a' callbacks
Previously the header was a fixed size and assumed to be zeroed.
Now read in bytes up to `HEADER_SIZE`, pass the number or bytes
read to the callback which must not read past those bytes.
2020-11-12 12:30:18 +11:00
fa81a42539 Cleanup: RNA ID enum utility function
- Avoid calling `GS(id->name)` on each iteration.
- Remove unused arguments.
- Pass `const ID *` to the filter callback.
2020-11-12 11:46:30 +11:00
e00bb5a4b7 Cleanup: spelling 2020-11-12 11:35:31 +11:00
9e1e9516a0 Cleanup: warnings 2020-11-12 11:23:21 +11:00
Aaron Carlisle
2ef2b3e0fd Cleanup: Remove SSE math optimization i386 macOS builds
We haven't supported 32bit mac builds for a while so this should be safe to remove.

Reviewed By: #platform_macos, brecht

Differential Revision: https://developer.blender.org/D9489
2020-11-11 17:08:48 -05:00
1043ec7991 Merge branch 'blender-v2.91-release' 2020-11-11 16:37:22 -05:00
b99faa0f56 Fix T80475, bad bevel: side vertex in bad plane in some cases.
Needed a better normal to for plane to offset into when there are
non in-plane edges between two beveled edges. It was using the vertex
normal, which is just wrong.

Differential Revision: https://developer.blender.org/D9508
2020-11-11 16:24:01 -05:00
88e6341ce8 UI: Tooltips: dont add period to labels
These are generally only one or two word phrases and are not sentences.
This change slightly improves readability.

Note, the check when display labels:

```
Tip Label (only for buttons not already showing the label).
```

Could be improved here because there are a lot of false positives.
2020-11-11 14:58:50 -05:00
40aa69e2eb Cleanup: Split header for Outliner tree building into C and C++ headers
See https://developer.blender.org/D9499.

It's odd to include a C++ header (".hh") in C code, we should avoid that. All
of the Outliner code should be moved to C++, I don't expect this C header to
stay for long.
2020-11-11 19:09:15 +01:00
c2b3a68f24 Cleanup: Rename Outliner "tree-view" types to "tree-display" & update comments
See https://developer.blender.org/D9499.

"View" leads to weird names like `TreeViewViewLayer` and after all they are
specific to what we call a "display mode", so "display" is more appropriate.

Also add, update and correct comments.
2020-11-11 19:09:11 +01:00
01318b3112 Cleanup: Follow C++ code style for new Outliner building code
See https://developer.blender.org/D9499.

* Use C++17 nested namespaces.
* Use `_` suffix rather than prefix for private member variables.

Also: Simplify code visually in `tree_view.cc` with `using namespace`.
2020-11-11 19:09:06 +01:00
43b4570dcf Cleanup: General cleanup of Outliner Blender File display mode building
See https://developer.blender.org/D9499.

* Turn functions into member functions (makes API for a type more obvious &
  local, allows implicitly sharing data through member variables, enables order
  independend definition of functions, allows more natural language for
  function names because of the obvious context).
* Prefer references over pointers for passing by reference (makes clear that
  NULL is not a valid value and that the current scope is not the owner).
* Reduce indentation levels, use `continue` in loops to ensure preconditions
  are met.
* Add asserts for sanity checks.
2020-11-11 19:09:01 +01:00
44d8fafd7f UI Code Quality: Convert Outliner Blender File mode to new tree buiding design
See https://developer.blender.org/D9499.

Also:
* Add `space_outliner/tree/common.cc` for functions shared between display
  modes.
* I had to add a cast to `ListBaseWrapper` to make it work with ID lists.
* Cleanup: Remove internal `Tree` alias for `ListBase`. That was more confusing
  than helpful.
2020-11-11 19:08:56 +01:00
ad0c387fdf Cleanup: Put Outliner C++ namespace into blender::ed namespace, add comments
See https://developer.blender.org/D9499.

Also remove unnecessary forward declaration.
2020-11-11 19:08:49 +01:00
5fb67573b5 Fix possible null-pointer dereference in new Outliner tree building code 2020-11-11 19:08:43 +01:00
dc9a52a303 Cleanup: Remove redundant parameter from new Outliner tree building code
See https://developer.blender.org/D9499.
2020-11-11 19:08:36 +01:00
cad2fd99e7 Cleanup: Comments and style improvements for new Outliner C++ code
See https://developer.blender.org/D9499.

* Add comments to explain the design ideas better.
* Follow code style guide for class layout.
* Avoid uninitialized value after construction (general good practice).
2020-11-11 19:08:29 +01:00
6b18e13c5b UI Code Quality: Use C++ data-structures for Outliner object hierarchy building
See https://developer.blender.org/D9499.

* Use `blender::Map` over `GHash`
* Use `blender::Vector` over allocated `ListBase *`

Benefits:
* Significantly reduces the amount of heap allocations in large trees (e.g.
  from O(n) to O(log(n)), where n is number of objects).
* Higher type safety (no `void *`, virtually no casts).
* More optimized (e.g. small buffer optimization).
* More practicable, const-correct APIs with well-defined exception behavior.

Code generally becomes more readable (less lines of code, less boilerplate,
more logic-focused APIs because of greater language flexibility).
2020-11-11 19:08:13 +01:00
c9cc03b688 UI Code Quality: General refactor of Outliner View Layer display mode creation
See https://developer.blender.org/D9499.

* Turn functions into member functions (makes API for a type more obvious &
  local, allows implicitly sharing data through member variables, enables order
  independend definition of functions, allows more natural language for
  function names because of the obvious context).
* Move important variables to classes rather than passing around all the time
  (shorter, more task-focused code, localizes important data names).
* Add helper class for adding object children sub-trees (smaller, more focused
  units are easier to reason about, have higher coherence, better testability,
  can manage own resources easily with RAII).
* Use C++ iterators over C-macros (arguably more readable, less macros is
  generally preferred)
* Add doxygen groups (visually emphasizes the coherence of code sections,
  provide place for higher level comments on sections).
* Prefer references over pointers for passing by reference (makes clear that
  NULL is not a valid value and that the current scope is not the owner).
2020-11-11 19:07:55 +01:00
249e4df110 UI Code Quality: Start refactoring Outliner tree building (using C++)
This introduces a new C++ abstraction "tree-display" (in this commit named
tree-view, renamed in a followup) to help constructing and managing the tree
for the different display types (View Layer, Scene, Blender file, etc.).

See https://developer.blender.org/D9499 for more context. Other developers
approved this rather significantly different design approach there.

----

Motivation

General problems with current design:
* The Outliner tree building code is messy and hard to follow.
* Hard-coded display mode checks are scattered over many places.
* Data is passed around in rather unsafe ways (e.g. lots of `void *`).
* There are no individually testable units.
* Data-structure use is inefficient.

The current Outliner code needs quite some untangling, the tree building seems
like a good place to start. This and the followup commits tackle that.

----

Design Idea

Idea is to have an abstract base class (`AbstractTreeDisplay`), and then
sub-classes with the implementation for each display type (e.g.
`TreeDisplayViewLayer`, `TreeDisplayDataAPI`, etc). The tree-display is kept
alive until tree-rebuild as runtime data of the space, so that further queries
based on the display type can be executed (e.g. "does the display support
selection syncing?", "does it support restriction toggle columns?", etc.).

New files are in a new `space_outliner/tree` sub-directory.

With the new design, display modes become proper units, making them more
maintainable, safer and testable. It should also be easier now to add new
display modes.
2020-11-11 18:51:57 +01:00
5b5ec0a2e9 Fix T82521: Bump OpenImageIO minimum version 1.8 > 2.2.1 for install_deps.sh
Since rB6fdcca8de64cd70f, we need at least OpenImageIO 2.1.12 to build
Blender.
2020-11-11 15:10:01 +01:00
e47ea9fbc7 GPencil: Fix unreported crash when style is NULL 2020-11-11 12:16:22 +01:00
7b6d76f387 Cleanup: correct argument order to callback
Currently the callback isn't used,
found when testing a new enum callback.
2020-11-11 20:40:42 +11:00
251b7d77b3 Merge branch 'blender-v2.91-release' into master 2020-11-11 10:27:44 +01:00
7ba971d6d8 Fix T82553: Outliner F2 renaming issue when item is out of view
- scrolling would be restricted (usually, if the object to be renamed is
in view, this prevents scrolling away without finishing the rename
operation)
- renaming by typing and confirming with Enter was not possible (you
would have to escape, scroll to the object and use F2 again)
- other shortcuts like A and H are still active instead of being handled
as text input

Avoid all these issue by forcing the item into view using
outliner_show_active / outliner_scroll_view.

Maniphest Tasks: T82553

Differential Revision: https://developer.blender.org/D9521
2020-11-11 10:18:47 +01:00
9b3dabacbc Cleanup: Use NDEBUG define, DEBUG one is not reliable. 2020-11-11 10:15:58 +01:00
2d48f3e445 Fix 'outliner_scroll_view()' not reaching wanted element
Scrolling to an item after opening relevant parents can go wrong if said
parent e.g. the last in the list [as in: then the Outliner does not
scroll down all the way]
It stems from the fact that 'region->v2d.tot.ymin' is not up-to-date in
outliner_scroll_view after outliner_show_active opens up parents, 'tot'
will only update on a redraw.

Now calculate the trees height on the fly using
'outliner_tree_dimensions()'.

ref D9521
ref T82553

Maniphest Tasks: T82553

Differential Revision: https://developer.blender.org/D9523
2020-11-11 10:12:28 +01:00
15ffda3bcd Fix T82602: checking image header reads past buffer bounds
Use the size argument to ensure checking the header doesn't read
past the buffer bounds when reading corrupt/truncated headers
from image files.
2020-11-11 16:14:09 +11:00
2d60845786 Cleanup: pass header size to 'is_a' callbacks
No functional changes, prepare for fixing out-of-bounds access
when reading headers.
2020-11-11 16:14:06 +11:00
99f56b4c16 Cleanup: use 'filepath' instead of 'name' for ImBuf utilities 2020-11-11 16:14:06 +11:00
a5f8071bdf Cleanup: use bool for imbuf save callbacks 2020-11-11 16:14:05 +11:00
e9c19b2820 Cleanup: avoid boolean literals for functions that return int 2020-11-11 16:14:05 +11:00
11bf3b7035 Cleanup: use define for targa header size 2020-11-11 15:05:30 +11:00
75c18b989c Cleanup: remove redundant NULL checks in ImFileType.is_a callback
Most of these callbacks don't do a NULL check,
so there is no need to do this for bmp/png.

Also correct radiance_hdr comments.
2020-11-11 14:54:04 +11:00
36e5c9e026 Merge branch 'blender-v2.91-release' 2020-11-11 14:44:27 +11:00
12168ccf18 ImBuf: replace incorrect strstr use with memcmp
Besides being incorrect as only the first two bytes should be tested,
searching binary data using `strstr` can easily read past buffer bounds.
2020-11-11 14:41:04 +11:00
eeeb2c1967 Merge branch 'blender-v2.91-release' 2020-11-10 17:34:29 -07:00
8953485f56 Fix: Selection not possible from outliner gutter
Selection should be possible from the left gutter in object mode. When
in other modes the mode column displays icon buttons which should be
prioritized for selection only in those modes.

Introduced in rB2110af20f5e6.
2020-11-10 17:29:32 -07:00
c4d8f6a4a8 Cleanup: clang-format 2020-11-11 09:11:43 +11:00
cd9acfed4f Cleanup: use preprocessor version check for PyTypeObject declaration
While `tp_print` was deprecated, Python 3.8+ uses this for
'tp_vectorcall_offset' which wasn't stated in the comment from
efd71aad4f.

Instead of suppressing clang-tidy, use preprocessor a check since
this properly represents the difference between Python versions.
2020-11-11 09:11:21 +11:00
86bdd2acc6 Windows: Fix build issue with VCPKG
For blender we disable VCPKG to prevent it from picking
up the wrong libraries from VCPKG rather than our lib folder
some of the cycles tests needed this to link correctly.

reported by @alef on chat
2020-11-10 13:23:55 -07:00
b980cd163a Cycles: fix compilation of OSL shaders following API change
The names of the parameters are based on those of those of the sockets, so they also need to be updated. This was forgotten about in the previous commit (rBa284e559b90e).

Ref T82561.
2020-11-10 18:59:30 +01:00
a63208823c Fix NanoVDB compile errors with recent NanoVDB versions
There were some changes to the NanoVDB API that broke the way Cycles was previously using it.
With these changes it compiles successfully again and also still compiles with the NanoVDB revision
that is currently part of the Blender dependencies. Ref T81454.
2020-11-10 18:28:14 +01:00
339f442a93 Fix (unreported) potential assert in viewlayer synchronization.
Some operations, like remapping and ID (Object) to another, can lead to
having the same object in more than one base.

While this is not a valid state, this is being taken care of by the
`BKE_layer_collection_sync` call, so the object-to-base GHash generation
itself should be resilient to such issue.

Note: another way to fix this would be to make remapping post-process
code check explicitely for such doublons, but I would rather avoid
adding even more 'specialized' code there, it already has to deal with
too many of those corner cases.
2020-11-10 17:16:28 +01:00
626a79204e MSVC: Fix build warning
If a define of NOMINMAX was made before BLI_task.hh was included,
the compiler would emit a

warning C4005: 'NOMINMAX': macro redefinition

warning, to work around this only define it if it is not already
defined, and only undefine it if we were the ones that made the
define earlier.
2020-11-10 08:48:18 -07:00
bd6bfba64d Cycles: Enable NanoVDB usage by default
As discussed during the Rendering Metting. Ref T81454.
2020-11-10 16:20:15 +01:00
Germano Cavalcante
23614c49e9 Fix T81951: Add Cube new tool surface snaping not working
For the `plane_depth` of type `PLACE_DEPTH_SURFACE` to take effect, a `snap_context` is needed.

But, even if a temporary `snap_context` was created for `plane_orient == PLACE_ORIENT_SURFACE`,
this context was not used for `plane_depth`.

So, use a temporary `snap_context` for `PLACE_DEPTH_SURFACE` (as it is done for `PLACE_ORIENT_SURFACE`).

Differential Revision: https://developer.blender.org/D9345
Differential Revision: https://developer.blender.org/D9435
2020-11-10 12:18:19 -03:00
2ecab4c8a6 LibOverride: Optimize deletion of overrides in liboverride delete. 2020-11-10 16:14:16 +01:00
de8d7003bc Cleanup/Update comments in liboverride code. 2020-11-10 16:14:16 +01:00
a284e559b9 Fix T82561: shader compilation crashes in OSL
The "type" sockets on shader nodes were renamed in rB31a620b9420cab to
avoid clashes with the `NodeType type` member from the Node base class,
but the OSL shader compilation was missing those changes.
2020-11-10 16:05:47 +01:00
feb71f1d71 Animation: Expand unit tests for BKE_fcurve_active_keyframe_index()
Expand unit test for `BKE_fcurve_active_keyframe_index()` to test edge
cases better.

This also introduces a new test macro `EXPECT_BLI_ASSERT()`, which can be
used to test that an assertion fails successfully.

No functional changes to actual Blender code.
2020-11-10 15:36:21 +01:00
75a2db5d97 Multires: Cleanup, clarify comment 2020-11-10 15:32:06 +01:00
11c19c24bd Cleanup/Update comments in liboverride code. 2020-11-10 15:30:36 +01:00
01c7a94cdd install_deps: fix a typo in argument handling of new nanovdb option.
Spotted by  Patrick Mours (@pmoursnv), thanks!
2020-11-10 14:11:13 +01:00
2a2bc09096 Merge remote-tracking branch 'origin/blender-v2.91-release' 2020-11-10 14:02:28 +01:00
4960780d76 Animation: More explicit boundary checks when setting active keyframe
Fix unit test failing in debug mode by having more explicit boundary checks
when setting an FCurve's active keyframe.

No functional changes.
2020-11-10 13:44:47 +01:00
23c71a5fab ImBuf: support detecting the file format from in-memory images
Add `IMB_ispic_type_from_memory` so we can detect the file format
of in-memory images.

This removes `is_a_filepath` callback and uses a magic check for
photo-shop files that's compatible with OIIO.

Even though OIIO doesn't support packed images, we can still use the
file magic for detecting the format.

This change allows D9500 (a fix for unpacking images),
to be implemented without a significant performance penalty,
although the actual performance cost would depend heavily on the
blend file.

Reviewed By: dfelinto, sergey

Ref D9517
2020-11-10 22:25:05 +11:00
d2ab9b568e Merge branch 'blender-v2.91-release' 2020-11-10 19:09:04 +11:00
05a2382c08 Fix T82540: Smart UV project ignores seams
Functionality was lost in the Python to C conversion from
850234c1b1
2020-11-10 19:05:07 +11:00
291473bb3e Merge branch 'blender-v2.91-release' 2020-11-10 17:50:15 +11:00
476a0d2311 Fix T82555: Crash using copied object from Python
Also clear `gpd_eval` as this wasn't being copied either.
2020-11-10 17:44:56 +11:00
3bb6902235 Merge branch 'blender-v2.91-release' 2020-11-10 16:30:10 +11:00
b902edae75 Fix T65585: Knife fails when cursor away from the object
Zeroed mouse coordinates were being used making projection fail.
2020-11-10 16:25:58 +11:00
bff1707aae Cleanup: remove hard coded file format check in IMB_ispic_type
This is already being checked in the 'is_a' callback.
2020-11-10 11:58:56 +11:00
b5d310b569 Cleanup: clang-format 2020-11-10 09:42:03 +11:00
efd71aad4f Cleanup: clang-tidy suppress warnings for PyTypeObject.tp_print
Clang-tidy behavior changes from Python 3.7 to 3.8+ so it's simplest
to suppress the warning in this instance.
2020-11-10 09:40:20 +11:00
3a764c3e6d Cleanup: suppress clang-tidy warnings without FFMPEG/AVI/AUDASPACE 2020-11-10 09:40:20 +11:00
6faba2db08 Merge branch 'blender-v2.91-release' 2020-11-09 21:18:28 +01:00
f923b6faa9 Fix assert in the sculpt pen tilt code
Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D9422
2020-11-09 21:17:17 +01:00
850f9452a4 Fix wrong DNA flag for hide face sets
It was using the same flag as SCULPT_DYNTOPO_DETAIL_MANUAL

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9484
2020-11-09 21:15:33 +01:00
716b7a60df install_deps: add support for NanoVDB.
re T81454.
2020-11-09 19:08:01 +01:00
cdb1da6bf6 Install_deps: update URLS for OpenVDB repo/sources. 2020-11-09 19:08:01 +01:00
cf751e3914 Merge branch 'blender-v2.91-release' 2020-11-09 18:50:56 +01:00
60c4d0b5fb Fix T78028: crash with grease pencil and save buffers
Perform grease pencil rendering delayed in this case, as there are no render
buffers available for compositing. This keeps memory usage lower, but does
involve multiple depsgraph evaluation. This seems in line with the intent of
the save buffers feature, to use minimal memory.
2020-11-09 18:49:28 +01:00
cc5294bd91 Fix potential crash closing Blender with persistent data option enabled
Found by address sanitizer.
2020-11-09 18:49:28 +01:00
cde2bd1828 Merge branch 'blender-v2.91-release' 2020-11-09 17:37:21 +01:00
ec6a9322e8 Fix T78956: banding artifacts of vertex colors in Cycles
Byte colors must be encoded in sRGB and converted to linear on lookup,
to avoid precision loss.
2020-11-09 17:30:34 +01:00
bd2dda90b6 Cleanup: Clang-tidy, inconsistent parameter name
readability-inconsistent-declaration-parameter-name
2020-11-09 21:31:13 +05:30
94b44a5228 Cleanup: Clang-tidy, modernize-use-nullptr. 2020-11-09 21:31:13 +05:30
880b0f981d Cleanup: more renaming in the render/ module for consistency 2020-11-09 16:19:49 +01:00
4f66cf3b8b Pointclouds: move blenkernel code to c++ 2020-11-09 15:47:16 +01:00
dfe50ef2d8 Fluid: Fix strict compiler warning
Proper way to check for DEBUG_PRINT is to do `if defined` check rather
than `if`: this is because in non-debug builds the symbol is not defined.
2020-11-09 15:43:22 +01:00
6507449e54 Cleanup: fix wrong merge, remove extra unique_ptr.
Mistakes added in 3cb4c51308 and
bec1765340

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9514
2020-11-09 19:32:16 +05:30
4d544d6ae7 Fix T80068: skin modifier not working with motion blur
The skin modifier did not output consistent results, causing failure to find
corresponding vertices across frames.

Remove unnecessary use of GSet, all we need is an array.
2020-11-09 14:54:50 +01:00
021c40167d Cycles: fix Node::tag_modified not setting modified flag's upper bits
Previous code was flipping the bits on a 32-bit number and doing a zero extension to cast to 64-bit, so mark the constant as long to begin with.

This would also erase previously set bits in this part the flag.
2020-11-09 14:52:48 +01:00
ed75a50119 Cycles: Fix function inline attributes
forceinline attribute is only applicable for function which are
marked inline. Interestingly, it can be used for class methods
without explicit inline statement. But for functions it is another
story.
2020-11-09 14:41:00 +01:00
1f4062cf6e Fluid: Fix strict compiler warning
Proper way to check for DEBUG_PRINT is to do `if defined` check rather
than `if`: this is because in non-debug builds the symbol is not defined.
2020-11-09 14:35:20 +01:00
Yevgeny Makarov
055ed335a1 macOS: follow system preference for natural trackpad scroll direction
And remove Blender preference, which was expected to be set to match the system
preference for correct behavior. Instead just handle this automatically.

Differential Revision: https://developer.blender.org/D9402
2020-11-09 13:51:08 +01:00
0c4d12986a Merge branch 'blender-v2.91-release' 2020-11-09 12:54:26 +01:00
0e6820cc5d Fix T82488: Mantaflow - force fields have very low influence compare to 2.90.1
Removed 0.2f factor when setting forces. Why this factor has been used when forces should only be clamped, nobody knows ..
2020-11-09 12:53:27 +01:00
5da05dd627 Fix T82210: Animation, Bake Action cleanup
Make post-bake cleanup of the Bake Action operator optional, and disable
by default.

Previously Bake Action would do two things:
- Bake the Action
- Clean up the FCurves

It is now possible (and even the default) to only perform the baking
operation.

Reviewed By: #animation_rigging, looch, sybren

Maniphest Tasks: T82210

Differential Revision: https://developer.blender.org/D9453
2020-11-09 12:41:51 +01:00
118e31a0a9 Cycles: Fix tricubic sampling with NanoVDB
Volumes using tricubic sampling were producing different results with NanoVDB compared
to dense textures. This fixes that by using the same tricubic sampling algorithm in both
cases. It also fixes some remaining offset issues and some minor things that broke OpenCL
kernel compilation on NVIDIA.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D9491
2020-11-09 12:37:47 +01:00
92083772e7 Libmv: Fix warning about unused parameter in Ceres
Ceres is an external library, so consider it a system header which
makes it so all strict flags are properly ignored for them.
2020-11-09 12:12:00 +01:00
f26e267770 CMake: Extend supported strict flags cancelation for Clang 2020-11-09 12:12:00 +01:00
525a042c5c Cleanup: fix some clang tidy issues 2020-11-09 12:05:07 +01:00
5837ffc143 Merge branch 'blender-v2.91-release' into master 2020-11-09 11:49:44 +01:00
29693c7b07 Sculpt: Fix off-by-one error when creating bitmap for lasso gesture
Reviewers: pablodp606

Differential Revision: https://developer.blender.org/D9472
2020-11-09 11:48:55 +01:00
ad85256e71 Animation: move group colors switch to user preferences
Move the "Show Group Colors" toggle from a per-editor option to a single
user preference in the Animation preferences. The Grease Pencil
animation channel side panel allows picking a channel color; this now
shows a message when channel colors are disabled.

The old "Show Group Colors" toggle had to be set per editor, and was on
by default. This meant that disabling group colors would require an
action for every file, for every editor. It is very hard to select a
color that works both as bone color in the 3D Viewport (needs to be
bright there) as well as the channel list (needs to be dark there), most
animators turn channel list colors off.

Differential Revision: https://developer.blender.org/D9391
2020-11-09 11:11:05 +01:00
25375c769a Cleanup: Sequencer, remove unused function
Remove `static int clear_scene_in_allseqs_fn(...)`. It was a utility
function for `BKE_sequencer_clear_scene_in_allseqs()`, which was removed
in c063813c30.

No functional changes.
2020-11-09 11:11:05 +01:00
c356a3654d Merge branch 'blender-v2.91-release' 2020-11-09 20:37:03 +11:00
3c04a06178 Merge branch 'blender-v2.91-release' 2020-11-09 20:36:34 +11:00
ba179e3dd5 Merge branch 'blender-v2.91-release' 2020-11-09 20:36:31 +11:00
71ff935fd6 Revert "Fix T80742: curve bevel fails with zero length handles at end-point"
This reverts commit 4987b7d347.

This introduced a slight change in curve direction at end-points
(while correct), it caused tests to fail.

Keep this change for 2.92, revert for 2.91.
2020-11-09 20:33:27 +11:00
067e200564 Fix T82495: assert with cast modifier in edit-mode 2020-11-09 19:01:48 +11:00
af4c389f99 Cleanup: imbuf callback naming
Use `is_a` & `is_a_filepath` in callback names.
2020-11-09 17:03:28 +11:00
e118426e46 Fix T82520: error building freestyle with Python3.8
Caused by 16732def37,
This is a 'Py_ssize_t' in Python 3.8,
replace with zero as this works in both 3.7 and 3.8.
2020-11-09 16:08:29 +11:00
8c846cccd6 Cleanup: clang-format 2020-11-09 15:47:08 +11:00
39012146e1 Fix T81651, exact boolean modifier incorrect if operand hidden.
The code was trying to ignore hidden geometry when doing boolean,
which is correct when used as a tool, but not when a modifier.
Added a "keep_hidden" argument to bmesh_boolean to distinguish the
two cases.
Also fixed a bug when the tool is used with hidden geometry that
is attached to unhidden geometry that is deleted by the operation.
2020-11-08 10:12:53 -05:00
06dac0a453 Fix T81651, exact boolean modifier incorrect if operand hidden.
The code was trying to ignore hidden geometry when doing boolean,
which is correct when used as a tool, but not when a modifier.
Added a "keep_hidden" argument to bmesh_boolean to distinguish the
two cases.
Also fixed a bug when the tool is used with hidden geometry that
is attached to unhidden geometry that is deleted by the operation.
2020-11-08 08:39:01 -05:00
7be47dadea Cleanup: Clang-tidy, readability-else-after-return 2020-11-07 21:52:53 +05:30
4429b4b77e Cleanup: Clang-tidy, readability-non-const-parameter. 2020-11-07 21:52:53 +05:30
9cd9ea591f Cleanup: NULL to nullptr. 2020-11-07 21:52:53 +05:30
bec1765340 Merge new boolean fix from blender-v2.91-release. 2020-11-07 09:33:56 -05:00
46da8e9eb9 Fix T82301, exact boolean fail on cube with bump.
The code for determining coplanar clusters had a bug where it would
miss some triangles. The fix for now is to just put triangles in
the cluster if their bounding boxes overlap. This works but maybe
makes clusters bigger then they have to be. I'll follow this commit
with work on making the CDT routine faster when using exact arithmetic.
Also removed a lot of unused code, and added some new intersect
performance tests.
2020-11-07 09:02:58 -05:00
40d4a4cb1a Cleanup: Clang-format. 2020-11-07 18:48:13 +05:30
6e6b5e147c Noise: fix uninitialized variable warning.
Mistake in 74188e6502
2020-11-07 18:48:13 +05:30
ae342ed451 Cleanup: Clang-tidy else-after-return 2020-11-07 18:48:13 +05:30
4525049aa0 Cleanup: Clang-tidy, modernize-concat-nested-namespaces 2020-11-07 18:48:13 +05:30
a452fcb9a5 View3D: take clipping into account for Frame All
Clamp the min/max used for Frame All/Selected
by the clipping region if it's set.

Resolve T81050
2020-11-07 21:20:57 +11:00
19a0df25e3 Cleanup: move plane array intersection into a function
Also add check to ensure a point isn't occluded by it's own plane,
which could happen if a small epsilon values are passed in.
2020-11-07 21:01:42 +11:00
Yevgeny Makarov
d7b0ec9cb5 Fix for T78211: Trackpad Zoom to Mouse Position Error
When using a trackpad Zoom to Mouse Position would always zoom to center of canvas.

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

Reviewed by Brecht Van Lommel
2020-11-06 17:56:45 -08:00
Yevgeny Makarov
c87b7fdd8a Fix for T65714: Pinch Zooming Crash using Mac Trackpad
Ensure that Zoom does not crash on Mac Trackpad by checking for existence of Continuous Zoom timer.

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

Reviewed by Julian Eisel
2020-11-06 17:43:11 -08:00
d2c102060d Cleanup: Rename render texture files to texture_* 2020-11-06 14:20:44 -05:00
b3e71ee098 Cleanup: Remove unused variable 2020-11-06 12:50:03 -06:00
c2b7e83fae Cleanup: remove unused includes in readfile.c and writefile.c 2020-11-06 19:11:53 +01:00
2d26057751 Fix missing include warning
Caused by rB580ff2cb937daf43699908afe1190baea8d117aa
2020-11-06 12:48:13 -05:00
b0dcabdf65 Cleanup: fix naming and remove unnecessary code 2020-11-06 18:41:03 +01:00
992b8f6f5f Refactor: move Screen .blend data read to blenkernel
Ref T76372.
2020-11-06 18:37:52 +01:00
1762d5f43a Refactor: move Ipo .blend I/O to IDTypeInfo callbacks 2020-11-06 18:33:33 +01:00
638913a3c0 Refactor: move Object .blend I/O to IDTypeInfo callbacks 2020-11-06 18:25:51 +01:00
16732def37 Cleanup: Clang-Tidy modernize-use-nullptr
Replace `NULL` with `nullptr` in C++ code.

No functional changes.
2020-11-06 18:08:25 +01:00
88926375a0 Clang-Tidy: error out when executable not found
Stop with an error when the Clang-Tidy executable cannot be found.

Without this check, CMake will happily report "Found Clang-Tidy" but with
the fallback version (0, 0, 0), when `CLANG_TIDY_EXECUTABLE` points to a
non-existing executable.
2020-11-06 18:08:25 +01:00
2acf01ec62 Refactor: move Pose .blend I/O to blenkernel
Ref T76372.
2020-11-06 17:58:25 +01:00
Yevgeny Makarov
60ad4a761a UI: Improved macOS Application Icon Progress Bar
Nicer appearance for the progress bar that is drawn over the application icon during long processes on macOS.

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

Reviewed by Brecht Van Lommel
2020-11-06 08:55:05 -08:00
58e9b51f95 Refactor: move Constraint .blend I/O to blenkernel
Ref T76372.
2020-11-06 17:45:29 +01:00
37ef37711d Refactor: move MotionPath .blend I/O to blenkernel
Ref T76372.
2020-11-06 17:33:13 +01:00
a3a6443bfd Merge branch 'blender-v2.91-release' into master 2020-11-06 17:29:18 +01:00
42980abf8d Fix T81997: Subsurf Optimal Display sticks after object conversion
When using Optimal Display, some edges are not flagged `ME_EDGEDRAW` |
`ME_EDGERENDER`.
When the modifier is applied through the UI in the modifier stack this is
not an issue because the `modifyMesh` callback is run with
`MOD_APPLY_TO_BASE_MESH` (this will effectively turn of Optimal
Display).
When converting to mesh though, this will just get an evaluated mesh
(where the edge flags are still the same as with the subdivision
modifier).
Now ensure every edge is flagged to draw after conversion.

Maniphest Tasks: T81997

Differential Revision: https://developer.blender.org/D9331
2020-11-06 17:25:52 +01:00
57414e6d1d Refactor: move gpencil modifier .blend I/O to blenkernel
Ref T76372.
2020-11-06 17:22:20 +01:00
019407810b Refactor: move modifier .blend I/O to blenkernel
Ref T76372.
2020-11-06 17:13:16 +01:00
f6ad56b1bc Merge branch 'blender-v2.91-release' into master 2020-11-06 16:58:06 +01:00
1019df81ff Fix T82251: Outliner Material Drag&Drop missing tree update
Caused by rBb077de086e14.

Not entirely sure why this was rebuilding the tree prior to above
commit, but sending an ND_OB_SHADING notifier is appropriate (and also
what the Outliners listener listens to).

Maniphest Tasks: T82251

Differential Revision: https://developer.blender.org/D9396
2020-11-06 16:55:04 +01:00
3cb4c51308 Cleanup: Clang-Tidy, modernize-make-unique 2020-11-06 16:47:16 +01:00
ce70f2e1e0 Cleanup: Sort includes after recent render module cleanup 2020-11-06 10:45:18 -05:00
998ae29549 Fix T82220 Missing viewport update after manual "HDRI Preview Size" input
This is caused by the TAA being reset after the init phase, leading to
1 sample being kept as valid when it is clearly not.

To fix this, we run the lookdev validation before TAA init.

Reviewed By: Jeroen Bakker

Differential Revision: https://developer.blender.org/D9452
2020-11-06 16:44:15 +01:00
c063813c30 Cleanup: remove unused functions 2020-11-06 16:43:48 +01:00
af24532612 Refactor: move ShaderFx .blend I/O to blenkernel
Ref T76372.
2020-11-06 16:42:50 +01:00
580ff2cb93 Cleanup: Render Module: combine intern/ source & include 2020-11-06 10:37:40 -05:00
90ac9770a4 Cleanup: whitespace 2020-11-06 16:16:14 +01:00
e15076b22f Cleanup: Render Module: move header files to main directory
Move headers files from `render/extern/` to `render/`

Part of T73586
2020-11-06 10:10:41 -05:00
Paul Melis
235c309e5f Add background rectangle option to video sequencer Text strip
This adds a Box option to the Text strip's style properties, plus related Box Margin value:

{F9208309}

When enabled the text is placed on top of a solid-filled rectangle of a chosen color, as shown below:

{F9208324}

When the box option is disabled the text strip works the same as it does now. When the box option is enabled the meaning of the Shadow option changes to provide a drop-shadow on the rectangle (and not on the text itself). The latter made more sense to me.

The box margin is specified as a fraction of the image width. The offset of the drop-down box shadow is fixed to a specific fraction of the image width as well.

I tested this feature on a movie of a couple of minutes containing dozens of text strips (all with box background), edge cases like multi-line strings and text overlapping the image edges.

Reviewed By: ISS

Differential Revision: https://developer.blender.org/D9468
2020-11-06 16:05:50 +01:00
f6524aaa80 Refactor: move ParticleSystem .blend I/O to blenkernel
Ref T76372.
2020-11-06 15:58:39 +01:00
ba4da217ce Sequencer: Make naming consistent in header and implementation files 2020-11-06 15:46:56 +01:00
c74086376f VSE: Don't store proxy images in cache
Proxies are expected to be fast to read. Storing them in cache has
little to no effect on performance.

This change also allows to omit invalidation of cache when user switch
between proxies and original media.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9473
2020-11-06 15:38:44 +01:00
958ceaf5bf Refactor: move Scene .blend expand to IDTypeInfo callback 2020-11-06 15:37:56 +01:00
2f3181d0f2 Refactor: move Scene .blend lib reading to IDTypeInfo callback 2020-11-06 15:21:57 +01:00
1e7d29b012 Cleanup: rename time related variables
Variables renaned:
 - cfra -> timeline_frame
 - nr -> frame index
 - cfra_over -> overlap_frame

Function seq_give_stripelem_index was renamed to seq_give_frame_index.
2020-11-06 15:13:53 +01:00
e91d2ee777 Blenloader: access report list via api 2020-11-06 15:13:31 +01:00
0c26a44c76 Blenloader: expose BLO_reportf_wrap in api
This function is used by a couple of functions that are moved out of blenloader.
2020-11-06 15:07:10 +01:00
6ab0bd4798 Refactor: move Scene .blend data reading to IDTypeInfo callback 2020-11-06 14:57:36 +01:00
140d6cc4a2 Refactor: move Scene .blend writing to IDTypeInfo callback 2020-11-06 14:49:30 +01:00
a83fcf2b35 CMake: Fix wrong library used for dependency
Was causing compilation failure on fresh builds.
2020-11-06 14:47:46 +01:00
7dd76329e1 Refactor: move PointCache .blend I/O to blenkernel
Ref T76372.
2020-11-06 14:40:54 +01:00
6bca9d8c11 Cleanup: Fluid engine API return types
Use bool return type where possible instead of int (the return values from fluid object are already boolean instead of int).

Also removed several if guards in API functions. If one of the arguments is in fact invalid / nullptr (should not happen though), it better to catch them directly where they failed and not silently escape them.
2020-11-06 14:35:40 +01:00
af35ada2f3 Cleanup: Clang-Tidy, modernize-use-bool-literals 2020-11-06 14:32:51 +01:00
dfa027fe09 Refactor: move sequencer modifier .blend I/O to sequencer module
Ref T76372.
2020-11-06 14:28:33 +01:00
94ce248b30 Cleanup: Alembic, simplify expression
Change `1 + current_mat++` to `++current_mat`.

No functional changes.
2020-11-06 14:24:50 +01:00
047819e728 Cleanup: Alembic, simplify material assignment code
Refactor material assignment code such that:
- `build_mat_map()` just returns the built map (instead of relying on
  modifying a map passed as parameter),
- `LISTBASE_FOREACH` is used to loop over a `ListBase` (instead of a
  hand-crafted for-loop),
- just `return` when not enough material slots can be created (instead
  of setting a boolean to false, then doing some useless work, then
  checking the boolean),
- reorder some code for clarity, and
- rename `mat_map` to `matname_to_material` so that the semantics are
  clearer.

No functional changes.
2020-11-06 14:24:50 +01:00
c32a5ce17c Refactor: move Paint lib linking to blenkernel
Ref T76372.
2020-11-06 14:10:31 +01:00
62223e9851 Refactor: move color settings .blend I/O to blenkernel
Ref T76372.
2020-11-06 14:10:31 +01:00
8d5073345d Cleanup: Clang-Tidy, modernize-use-emplace 2020-11-06 14:06:52 +01:00
cee5a41518 Fix compilation error of bf_draw
Similar to previous commit, missing build dependency.
2020-11-06 13:53:47 +01:00
187adc64b4 Fix compilation error when building from scratch
Make sure the DNA offset files is ready at a time bf_windowmanager
need it.
2020-11-06 13:49:56 +01:00
a331d5c992 Cleanup: Clang-Tidy, modernize-redundant-void-arg 2020-11-06 13:40:46 +01:00
41db8f2fce Refactor: move LightCache .blend I/O to eevee_lightcache.c
Ref T76372.
2020-11-06 13:35:19 +01:00
da96389dcb Refactor: move remaining ViewLayer .blend I/O to blenkernel
Ref T76372.
2020-11-06 13:22:10 +01:00
3ee9e3a04f Cleanup: remove unnecessary function 2020-11-06 13:17:31 +01:00
9ad2965921 Refactor: move Paint .blend I/O to blenkernel
Ref T76372.
2020-11-06 13:16:17 +01:00
e810a16d75 Refactor: move wmWindowManager .blend I/O to IDTypeInfo callbacks 2020-11-06 13:04:56 +01:00
2de454c514 Merge branch 'blender-v2.91-release' into master 2020-11-06 12:57:27 +01:00
8df84f7be4 Fix T82364: Widget anim state not updated when deleting channel in Graph Editor
So a keyframed e.g. location slider would stay yellow/green even if its
corresponding channel was removed.

Needs a appropriate notifier so the listeners (e.g.
buttons_area_listener, view3d_buttons_region_listener) would cause a
redraw.

Maniphest Tasks: T82364

Differential Revision: https://developer.blender.org/D9438
2020-11-06 12:52:52 +01:00
3310e6d63e Merge remote-tracking branch 'origin/blender-v2.91-release' 2020-11-06 12:29:45 +01:00
b35e3f2460 Fix T82457: Python error when clicking on a tool in the viewport
Ths variable was initialized for false, while it was expected to be
true.
2020-11-06 12:29:19 +01:00
3b77c670f0 Clang Tidy: Expand modernize category
Gives an idea of which warnings are affecting Blender code base.
2020-11-06 12:16:02 +01:00
311031ecd0 Cleanup: Use nullptr everywhere in fluid code
Switched from NULL to nullptr.
2020-11-06 12:06:05 +01:00
37b155420b Merge branch 'blender-v2.91-release' into master 2020-11-06 12:00:50 +01:00
390a0d5624 Fix T82387: Crash loading file saved with recent master in old versions
This fix makes sure new files save `wmWindow.global_areas` under a different
name, so old Blender versions don't recognize and 0-initialize it.

Since enabling global area writing (ef4aa42ea4), loading a file in old
Blender versions would cause `wmWindow.global_areas` to be read, because there
was already reading code for it and `ScrAreaMap` was in SDNA.
However the `ScrArea.global` of the global areas would be NULL, because it was
*not* in SDNA (`ScrGlobalAreaData` was excluded).
Now, issue is that the code assumes that areas in the global area-map have a
valid ScrArea.global pointer.

Think this was a mistake in rB5f6c45498c92. We should have cleared all this data
on reading, until the global area writing was enabled.

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

Reviewed by: Brecht Van Lommel
2020-11-06 11:58:06 +01:00
e6739ed91d Fix T82407: Negative number input gives syntax error for velocities and
accelerations

Caused by rB45dbc38a8b15.

Above commit would place parentheses surrounding a block until the next
operator was found.
For velocities and accelerations though, the '/' in 'm/s' or 'ft/s'
should not be considered an operator.

Maniphest Tasks: T82407

Differential Revision: https://developer.blender.org/D9467
2020-11-06 11:56:57 +01:00
190170d4cc Cleanup: Clang-Tidy, readability-redundant-member-init 2020-11-06 11:54:53 +01:00
dae004557a Merge branch 'blender-v2.91-release' into master 2020-11-06 10:45:39 +01:00
28e703b0a1 Fix Outliner editbone selection with 'Sync Selection'
When editbones were selected from the Outliner (and they were connected
to a parent) with the 'Sync Selection' option turned ON, they could not
get duplicated.

For duplication to work, the (connected) parent bone's tip also has to
be selected [which was not the case when selection is done from the
Outliner under above circumstances]. The reason being that
armature_duplicate_selected_exec ->
ED_armature_edit_sync_selection clears the BONE_ROOTSEL flag if the
parent bone's BONE_TIPSEL is not set.

Caused by rB71eb65328078 btw.

The correct "parent-tip-selection" would actually happen in activation
- `tree_element_active_ebone`
-- `tree_element_active_ebone__sel`
but for 'Sync Selection' this happens [also] in
- `outliner_sync_selection_from_outliner`
-- `outliner_select_sync_to_edit_bone`
which did not do the "flushing" to the parent bone's tip

Now use existing dedicated function for this.

ref. T82347

Reviewers: Zachman

Differential Revision: https://developer.blender.org/D9470
2020-11-06 10:42:14 +01:00
0573f86587 Cleanup: Clang-Tidy warnings 2020-11-06 09:54:02 +01:00
9c34391e0c Fix compilation error in GHOST
ELEM macro isn't available in GHOST library.
2020-11-06 08:23:13 +01:00
84bbdfb8af Cleanup: Fix the order of info_cfg_option. 2020-11-06 12:46:58 +05:30
ec9241cd59 Cleanup: add missing doxygen group 2020-11-06 01:46:50 -05:00
df4935b29b Cleanup: Fix wrong doxygen groups
Was missed in rB9b6088cb9da4df1a893361997fc1a22986bf6f2e
2020-11-06 01:46:50 -05:00
9762a0992b CMake: configue_file() to pass strings for build-info
Using configue_file(..) would have avoided the breakage from
1daa3c3f0a, caused by buildinfo not properly escaping quotes.

Rely on CMake to escaping strings instead using configure_file().
2020-11-06 17:26:29 +11:00
9a7da1242d Fix uninitialized value
Own mistake in rB74188e65028d268af887ab2140e4253087410c1e
2020-11-06 01:10:51 -05:00
d9e7a42640 Cleanup: use 'BKE_' prefix for initialization functions 2020-11-06 16:43:09 +11:00
3c097af51f Cleanup: use doxy sections for node_group.c 2020-11-06 16:25:09 +11:00
2f58535b78 Cleanup: use if/else check for property poll 2020-11-06 16:02:42 +11:00
f38ad4c66b Cleanup: replace STREQLEN with STRPREFIX for constant strings 2020-11-06 15:56:03 +11:00
2d803d3f6d Cleanup: use STR_ELEM macro 2020-11-06 15:42:03 +11:00
4f140ec7cc Cleanup: Use LISTBASE_FOREACH macro 2020-11-05 22:39:30 -06:00
06c030eaa4 Cleanup: Use descriptive variable names 2020-11-05 22:33:01 -06:00
a51455918c Cleanup: de-duplicate code for instancing objects when linking
Ref D8843
2020-11-06 15:00:07 +11:00
605425c006 Cleanup: doxygen comments 2020-11-06 14:35:38 +11:00
eed6bf22a4 Cleanup: doxygen comments in ghost
Use colon after parameters, use hash to reference symbols.
2020-11-06 14:25:44 +11:00
f11f7ce08e Cleanup: use ELEM macro (>2 args) 2020-11-06 12:54:19 +11:00
d89fedf266 Cleanup: clang-format
Missed this last commit.
2020-11-06 12:46:17 +11:00
aa3a4973a3 Cleanup: use ELEM macro 2020-11-06 12:32:54 +11:00
7cb20d841d Cleanup: follow our code style for float literals 2020-11-06 12:32:54 +11:00
4a78a2774b Cleanup: use bool argument in BLI_noise 2020-11-06 12:32:54 +11:00
29401f8ca2 Cleanup: BLI_noise
Use common prefix as this collided with existing API's (eg BLI_voronoi).

Also expand some non-obvious abbreviations:

- 'g'  -> 'generic'
- 'vl' -> 'variable_lacunarity'
- 'V'  -> 'v3'
2020-11-06 12:32:54 +11:00
155f42a12f Cleanup: remove unused BLI_turbulence1
A slightly modified version of BLI_turbulence1, unused for years.
2020-11-06 12:32:54 +11:00
548b351647 Cleanup: use snake case for BLI_args API 2020-11-06 12:32:54 +11:00
c8f2ad0ab9 Cleanup: remove unused BLI_argsArgv 2020-11-06 12:32:54 +11:00
2bd8f7e059 Cleanup: use string APPEND/PREPEND
Replace 'set' with 'string(APPEND/PREPEND ...)'.
This avoids duplicating the variable name.
2020-11-06 12:32:54 +11:00
7160682b0d Cleanup: transform.h comments, use doxy sections 2020-11-06 12:32:54 +11:00
262eeb3e95 Cleanup: sort structs, files 2020-11-06 12:32:54 +11:00
c19e4b706e Cleanup: clang-format 2020-11-06 12:32:54 +11:00
73ea68d0ca Cleanup: unused variable 2020-11-06 12:32:53 +11:00
Yevgeny Makarov
c99c02d3ba UI: Tweaks to the Warning Icon
Warning Sign Alert Icon given a more rounded border.

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

Reviewed by Pablo Vazquez
2020-11-05 16:11:59 -08:00
1682a47876 Merge branch 'blender-v2.91-release' 2020-11-05 23:42:11 +01:00
02677ec4e0 Fix T81915: Draw Face Sets not working with deformed sculpt mesh
The draw face sets brush uses the poly center when used in meshes to increase
its precision when working in low poly geometry. For this to work with deformed
meshes, the deformed coordinates from the PBVH should be used instead.

Reviewed By: sergey

Maniphest Tasks: T81915

Differential Revision: https://developer.blender.org/D9424
2020-11-05 23:40:30 +01:00
e041d0fc02 Fix memory leaks in sculpt mode trimming tools
BKE_mesh_free() seems to not free the meshes correctly, so using BKE_id_free() instead.
The looptri array was also not freed.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9426
2020-11-05 23:31:58 +01:00
057f9caac6 Fix T82400: Dyntopo detail size edit operator visual glitch
Just a missing immUnbindProgram

Reviewed By: sergey

Maniphest Tasks: T82400

Differential Revision: https://developer.blender.org/D9459
2020-11-05 23:28:16 +01:00
e2b3681f09 Fix Dyntopo detail size preview orientation not matching the cursor
Used the sampled cursor normal when available instead of the raycast face normal.
This makes the preview match the previous orientation of the cursor.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9460
2020-11-05 23:26:18 +01:00
00374fbde2 Move "Camera Parent Lock" from preferences to Object Relations
"Camera Parent Lock" can be useful when rigging cameras, but it is not
intuitive, and has also generated a lot of confusion (bug reports).
This is because it breaks the fundamental parent <-> child relationship
conventions in Blender, and there is no indication that it's intended
without diving into the preferences.

This commit moves the setting to the object level, and exposes it in
the relations panel in the property editor. It is exposed for every
object type because any object type can be "View Locked" in the 3D view.
The property description is also updated to reflect this change and be
more specific without getting too long.

In the future this could become a more general feature of the transform
system, but for now it is limited to "Lock Camera to View".

Differential Revision: https://developer.blender.org/D9239
2020-11-05 16:08:00 -06:00
ad481bdd35 Fix T82423: Add modifier key back into keymap
Commit rBf5080c82dd915db6c7b9dd68a52aaaccf2600137
accidentally remove the Shift modifier key from
the `AUTOCONSTRAINPLANE` shortcut.

Differential Revision: https://developer.blender.org/D9480
2020-11-05 23:03:41 +01:00
1b9d9cb1ed Fix T82164: Knife tool draws huge vertices after using bgl.glPointSize
Since it is possible to have multiple draw callbacks, (some of which
use bgl and others gpu), check and force the reset of the drawing status
at the end of each callback.

Differential Revision: https://developer.blender.org/D9476
2020-11-05 18:34:47 -03:00
69e567cfe8 Merge branch 'blender-v2.91-release' 2020-11-05 21:35:27 +01:00
Robert Guetzkow
7fed420877 Fix T82423: Replace duplicate name in keymap
The two entries `TFM_MODAL_AUTOCONSTRAINT` and
`TFM_MODAL_AUTOCONSTRAINTPLANE` had the same name
displayed in the UI. The latter is now includes
"plane" in it's name.

Reviewed By: mano-wii

Differential Revision: https://developer.blender.org/D9474
2020-11-05 21:29:15 +01:00
74188e6502 Cleanup: Reduce variable scope
Differential Revision: https://developer.blender.org/D9475
2020-11-05 14:11:32 -05:00
b053312bdd Fix T80043: missing Cycles displacement update when relinking output sockets 2020-11-05 19:35:39 +01:00
60859d8912 Fluid: Potential fix for T74559: Adaptive Domain creates lines in smoke
This commit corrects the maximum resolution field in Fluid objects. The field should be set to the maximum possible resolution, i.e. it should not adjust with adaptive domains and stay constant all the time.

The reason for this is that this resolution value will be used to scale gravity. And this gravity should be constant for adaptive domains too.

It remains to be shown if this issue was the only reason for line-artifacts as seen in T74559.
2020-11-05 18:55:08 +01:00
6a2a6fa514 Fix T82428: Cycles crashes when building volume meshes
The Volume Node did not have all of the sockets from its Mesh base class
which are now required due to the recent socket API change.
2020-11-05 18:46:26 +01:00
d9dd408b42 Merge branch 'blender-v2.91-release' into master 2020-11-05 18:00:48 +01:00
c3e832144b GPU: Fix valgrind warnings about branching on uninitialized variables 2020-11-05 18:00:27 +01:00
aae60f0fec Fix T81752 EEVEE: Camera Motion Blur is not blending steps properly
This was due to improper calculation of velocity factor and an
error in the camera data swapping between two steps.
2020-11-05 18:00:27 +01:00
15eec7f8b9 Fix T80842 Grease Pencil: Subtract mode is not working as expected
The blend equation was not set correctly inside the GL Module
since the refactor.
2020-11-05 18:00:27 +01:00
8819a4dce8 Spelling: Predefined, Look Up, No One
Fixes 18 misspellings of 'predefined', 'Look Up', 'Lookup', and 'No One'.

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

Reviewed by Hans Goudey
2020-11-05 07:52:58 -08:00
d837923a56 VSE: cache performance optimization
Map frame for cached raw images to strip input media frame range. This
means that static images or extended frame range of movies will only
generate one cache entry.

timeline_frame is stored in cache key as a reference - on what frame
was this entry created, so we don't have to reverse lookup frame range.

Since each media frame corresponds to one cache frame with same frame
index key, there is no need to invalidate raw cache when changing time
remapping properties like use_reverse_frames or strobe

No changes are needed for disk cache, since invalidating raw entry
assumes all data will be invalidated.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9462
2020-11-05 15:55:17 +01:00
8720c66009 Fluid: Potential fix for T74559: Adaptive Domain creates lines in smoke
This commit corrects the maximum resolution field in Fluid objects. The field should be set to the maximum possible resolution, i.e. it should not adjust with adaptive domains and stay constant all the time.

The reason for this is that this resolution value will be used to scale gravity. And this gravity should be constant for adaptive domains too.

It remains to be shown if this issue was the only reason for line-artifacts as seen in T74559.
2020-11-05 15:06:01 +01:00
cba6b4f4a1 Cleanup: add commits to .git-blame-ignore-revs.
Quick python script to print commit messages, and finding
duplicates: P1736
2020-11-05 19:24:07 +05:30
2a6a26bbd7 Rename extern rendering and proxy functions
Replace BKE_sequencer wirh SEQ_render or SEQ_proxy prefixes.
In cases where function is very generic, only SEQ prefix is used.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9439
2020-11-05 14:05:25 +01:00
0f43fe7fa6 Cleanup: split sequencer.c file
Move functions closely related to rendering images and proxies into
render.c and proxy.c files. render.h and proxy.h are created for
functions used internally.

There should be no functional changes.
2020-11-05 13:33:27 +01:00
4988f5f39c Fix T82292: Set encoding for keymap export to UTF-8
Keymaps have previously been exported with an encoding dependent
on the current system locale. This caused issues when the
keymap contained non-ASCII characters, for instance in a string
property for an operator.

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D9449
2020-11-05 09:50:51 +01:00
7bc7b7da2d Merge branch 'blender-v2.91-release' 2020-11-05 18:27:47 +11:00
4987b7d347 Fix T80742: curve bevel fails with zero length handles at end-point
Initialize the direction on the first/last points of the curve.

The fix from 23a4149778 exposed this error.
2020-11-05 18:15:45 +11:00
e0db650483 Merge branch 'blender-v2.91-release' 2020-11-05 16:13:16 +11:00
60c3ef3d61 Fix T81136: Mesh.loop_triangles kept after applying modifiers 2020-11-05 16:10:30 +11:00
9ac0541563 Merge branch 'blender-v2.91-release' 2020-11-05 15:48:37 +11:00
a88b9a4e00 Merge branch 'blender-v2.91-release' 2020-11-05 15:48:24 +11:00
52a2d5cbd2 Transform: support individual origins for "To Sphere" 2020-11-05 15:45:48 +11:00
8d88d9fd33 Fix T65205: "To Sphere" radius too large with proportional editing
The radius is now calculated based on the vertices being transformed
by proportional editing, updated when the falloff changes.
2020-11-05 15:39:04 +11:00
63f7e69829 UI: Fix Support for Anonymous Menu Separators
Re-enables support for menus to have items without identifier or name that can be used to separate sections.

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

Reviewed by Hans Goudey
2020-11-04 17:19:46 -08:00
c23ee2a293 Cleanup: Use const for function arguments 2020-11-04 18:53:17 -06:00
86bdc959a3 Fix T82417: Panels draw below others while animating after drag
This adds a new runtime flag for panels that is set during the entire
drag and animation operation. The flag is set recursively so that
sub-panels know to draw on top too.

Note that this also replaces most of the fixes in 1960b8a361 and
8e08d80e52 (D7462) with a more "built-in" solution.
2020-11-04 18:02:27 -06:00
6c3849ea08 Cleanup: Simplify panel collapse handler logic 2020-11-04 16:35:54 -06:00
4572428e86 Cleanup: Remove unused Panel.snap from DNA and handler code
This was a remnant of floating panels from the horizontal layout in
pre 2.5 horizontal panels.
2020-11-04 16:25:38 -06:00
bf36080501 Cleanup: Remove unused drag scaling code for panels
This is done more universally now, and this implementation of this is
no longer used.
2020-11-04 16:05:23 -06:00
f888f3aa1f Cleanup: Make panel function static
These functions were not used elsewhere, and the handling for the panel
tabs should be kept local to this file where possible. Also remove
another unused function and removed an unecessary "_ex" function.
2020-11-04 15:54:56 -06:00
76416f336a Cleanup: Move function to proper file
This lower level drawing function didn't make sense in the panel code,
especially when it is used in multiple other places.
2020-11-04 15:38:11 -06:00
7ee518cf70 Fix T80313: Fix clipped text in splash screen on hiDPI monitors
The current layout gave too little space for the full "Search" string inside
the button.
Fix this by making sure radio-buttons have their text center aligned by default
in pop-ups too, like they do anywhere else.

This does affect a few other cases, e.g. the "RGB"/"HSV"/"Hex" radio-toggles
for color pickers. But this should be fine, I don't think they were ever
intentionally using left-aligned text (while similar buttons outside of pop-ups
didn't).
2020-11-04 22:32:26 +01:00
f9fbe4efd6 Cleanup: Improve property search related comments panel code
The comments related to property search changes should be generally
more correct and more helpful.
2020-11-04 15:30:56 -06:00
4d7ad82347 Cleanup: Use LISTBASE_FOREACH 2020-11-04 14:14:16 -06:00
f45d79f180 UI: Replace uses of "loc/rot" with full words
Use "Rotation" in place of "Rot" for the rotation header text.
Cleanup various RNA titles and tooltips.

Differential Revision: https://developer.blender.org/D9457
2020-11-04 12:36:59 -07:00
eca8cd8449 Cleanup: Remove incorrect comment
This function for replacing a button pointer in button groups is
needed by the block update from old code, so it cannot be removed
like its layout equivalent.
2020-11-04 13:30:59 -06:00
10914987a2 Merge branch 'blender-v2.91-release' 2020-11-04 13:27:13 -06:00
29780b8101 Remove incorrect assert in button group code
Even after the last commit to fix this assert, it still fails in the
case where a button was added before there was a button group
added to the block. Another fix for this would be to always create
a button group in UI_block_begin, but this assert has no particular
purpose, so it's simpler to just remove it.
2020-11-04 13:21:26 -06:00
568dc2665e Fix T73126 Eevee: light probe baking ignores indirect bounces from SSS 2020-11-04 19:36:48 +01:00
eb21222e64 Transform: Disable snap to plane-face intersection
This feature was added in D5608.
But in practice this confuses more than it helps.
This fixes T82386.
2020-11-04 15:23:08 -03:00
331614e09b Fix T82384: Custom Properties for ShaderNodeTree do not save in blend files.
Not sure why those were excluded, there is no reason not to write ID
data itself for embedded IDs...
2020-11-04 18:16:07 +01:00
afe5345a3f Fix (unreported) memory leak when freeing Master collections.
Potential ID properties there (or any other ID data itself) would not be
freed.
2020-11-04 18:16:07 +01:00
7a8c8ec5e9 Merge branch 'blender-v2.91-release' 2020-11-04 18:13:57 +01:00
fd110291a5 Fix T81794: ColorRampElement step regression
Set step in RNA property definition.

There was a hardcoded setting of a1 for this specific button, which
used to be the variable to store the step size of number buttons until
rBe6f0b60c2e91. hardcoded value is removed in rBe29206f86a5f.

Reviewed By: Severin

Differential Revision: https://developer.blender.org/D9277
2020-11-04 18:09:21 +01:00
96e8dadda0 Fix T82385 EEVEE: Alpha Clip shadows actually using Alpha Hashed shadows
The shadow path was not using the alpha threshold.
2020-11-04 17:16:20 +01:00
c937f9c4e7 Cycles: fix another race condition in Geometry synchronization
This was forgotten in the previous fix, we should not modify sockets
updated in a separated thread.
2020-11-04 16:35:00 +01:00
0802e9cf54 Use compiler check for -fmacro-prefix-map
Use a more reliable method to check the availability of the flag than
compiler versions. Some compilers have different behaviors for
C and C++.

Reviewed By: campbellbarton, ChrisLend

Differential Revision: https://developer.blender.org/D9446
2020-11-04 21:00:29 +05:30
78234eb214 Fix T82197: Freestyle settings not visible for Workbench render engine
These had an effect but were not exposed in the UI.
2020-11-04 16:20:44 +01:00
abc5e7d596 Annotations: Set as visible when use the annotation tool
If the annotation draw operator is used, enable the annotations in the current area.

Before this change, some editors had the annotation flag set to OFF, but this could be solved with a versioning code, but this did not solve the root problem. The user can disable annotation visibility in the overlay or side panel, depending on the editor. If the user uses the annotation tool and this flag is OFF, the annotation is not visible, and this is not correct. With this patch, every time the user uses the tool, the annotation visibility flag is set to ON to ensure the annotation is visible.

This solves the problem of T82273, T79578 and T80294

Maniphest Tasks: T82273

Differential Revision: https://developer.blender.org/D9409
2020-11-04 16:13:39 +01:00
b63490bc4b Merge branch 'blender-v2.91-release' 2020-11-04 16:07:03 +01:00
cf9ea111bf macOS: remove deprecated touch event API call
Now that the minimum version is macOS 10.13, we can use the new API.

This reverts commit f97a64aa9b.
2020-11-04 16:01:03 +01:00
4dddd54393 Fix T82016: Cycles assert with empty OpenVDB volumes 2020-11-04 15:51:39 +01:00
fd9124ed6b Fix Cycles volume render differences with NanoVDB when using linear sampling
The NanoVDB sampling implementation behaves different from dense texture sampling, so this
adds a small offset to the voxel indices to correct for that.
Also removes the need to modify the sampling coordinates by moving all the necessary
transformations into the image transform. See also T81454.
2020-11-04 15:09:06 +01:00
43ceb0f047 UI: avoid using "loc/rot", use full words instead. 2020-11-04 14:27:18 +01:00
5af9b9f45b Merge branch 'blender-v2.91-release' 2020-11-04 14:14:38 +01:00
3ffa0452af Fix T67832: Camera Background Images View Transform
This patch will apply the view transform when a movie clip is used as
camera background image. It does this by rendering the image in the
color buffer when it needs the view transform. For other images it uses
the overlay buffer.

Reviewed By: Clément Foucault

Differential Revision: https://developer.blender.org/D7067
2020-11-04 14:13:24 +01:00
7a7f294940 Fix T81775: Object Disappears During Texture Painting
Issue was that the `tris_per_mat` are not created when the first batch is drawn
during select operator and then is not created when needed by the workbench pass
since they are not tracked by mesh_buffer_cache_create_requested.

This change will create the `tris_per_mat` just in case they are needed later.
Solution by Clément Foucault

Differential Revision: https://developer.blender.org/D9430
2020-11-04 14:08:03 +01:00
17ccda4fe1 Cycles: fix multithreading issue introduced in previous commit
The issue is that the shaders are stolen from the original Geometry by
the temporary Geometry used to accumulate data, but the main thread
still needs them for syncing the attributes.

So make a copy of the shader array to preserve the data on the original
Geometry.
2020-11-04 14:03:35 +01:00
ed4855ecb4 Modifiers: Fix wrong object when setting error in modifier
This was introduced in rBe4facbbea54019abe257787a7e9e8594a6ce3609.
2020-11-04 13:43:00 +01:00
25a718aa90 Merge branch 'blender-v2.91-release' into master 2020-11-04 13:34:41 +01:00
27648ed537 Modifiers: return empty mesh in case of error in Volume to Mesh modifier
Passing on the original mesh does not really make sense.
For that one should simply disable the modifier.
2020-11-04 13:31:23 +01:00
cfcdae5549 Fix T82393: Volume to Mesh modifier with sequence fails during rendering
The issue was that the volume for the current frame
might not have been loaded already by the time the
modifier runs.

The solution is simply to make sure that the volume
is loaded. This is similar to the Volume Displace modifier.
2020-11-04 13:21:43 +01:00
f7320c3bf1 Fix T82292: Set encoding for keymap export to UTF-8
Keymaps have previously been exported with an encoding dependent
on the current system locale. This caused issues when the
keymap contained non-ASCII characters, for instance in a string
property for an operator.

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D9449
2020-11-04 13:20:10 +01:00
31a620b942 Cycles API: encapsulate Node socket members
This encapsulates Node socket members behind a set of specific methods;
as such it is no longer possible to directly access Node class members
from exporters and parts of Cycles.

The methods are defined via the NODE_SOCKET_API macros in `graph/
node.h`, and are for getting or setting a specific socket's value, as
well as querying or modifying the state of its update flag.

The setters will check whether the value has changed and tag the socket
as modified appropriately. This will let us know how a Node has changed
and what to update, which is the first concrete step toward a more
granular scene update system.

Since the setters will tag the Node sockets as modified when passed
different data, this patch also removes the various modified methods
on Nodes in favor of Node::is_modified which checks the sockets'
update flags status.

Reviewed By: brecht

Maniphest Tasks: T79174

Differential Revision: https://developer.blender.org/D8544
2020-11-04 13:03:33 +01:00
ba6977cb8b Fix assert on mouseover of blocks not using the layout system
When there was an active button in the "old" block from the last redraw,
this code tried to replace its pointer in the new block's button groups.
But in cases like the outliner or file browser, there are no groups
because the block doesn't use the layout system at all. This commit
just tweaks the assert to check whether there are any button groups.
2020-11-04 12:46:05 +01:00
a4a848d01b Merge branch 'blender-v2.91-release' 2020-11-04 22:17:29 +11:00
a0db971acf UI: disable add-object tool for 2.91 2020-11-04 22:16:03 +11:00
febfe436b9 Merge branch 'blender-v2.91-release' 2020-11-04 21:59:14 +11:00
e6a940a9b6 Merge branch 'blender-v2.91-release' 2020-11-04 21:59:10 +11:00
819a9622e9 CMake: remove -fmacro-prefix-map from build-info
Quotes caused build-info to fail,
remove these flags since they're not necessary.
2020-11-04 18:41:40 +11:00
9af147b5d3 Cleanup: make format 2020-11-04 02:14:48 -05:00
0523994687 Fix T63495: Add torus changes size each time when unit scale != 1.0
This matches behavior in WM_operator_view3d_unit_defaults.
2020-11-04 18:11:04 +11:00
029e1f066e Cleanup: Add BLI prefix to some BLI_noise functions 2020-11-04 02:07:21 -05:00
d3bcbe10c2 PyAPI: add Struct.is_property_set(..., ghost) option
This exposes the use_ghost argument to RNA_property_is_set_ex.
2020-11-04 18:06:34 +11:00
72f8a08880 CMake: use path_ensure_trailing_slash for fmacro-prefix-map
Use the native system slash so this can work on windows.
2020-11-04 16:00:37 +11:00
43a2494058 CMake: add path_ensure_trailing_slash utility macro 2020-11-04 15:59:55 +11:00
2f7ec507f4 Cleanup: spelling in curve.c 2020-11-04 15:59:51 +11:00
18729aff27 Merge branch 'blender-v2.91-release' 2020-11-04 15:47:06 +11:00
d3b85af6ca Fix T49850: Detailed curves are heavily reduced
Divide the threshold by the resolution to prevent duplicates
being detected in high resolution curves.
2020-11-04 15:39:41 +11:00
0511640815 Fix assert on mouseover of blocks not using the layout system
When there was an active button in the "old" block from the last redraw,
this code tried to replace its pointer in the new block's button groups.
But in cases like the outliner or file browser, there are no groups
because the block doesn't use the layout system at all. This commit
just tweaks the assert to check whether there are any button groups.
2020-11-03 22:03:08 -06:00
293cc70e4f Update RNA to Manual mapping 2020-11-03 22:56:57 -05:00
a31039e1ed Merge branch 'blender-v2.91-release' 2020-11-04 14:54:11 +11:00
0eb1cceea1 Fix T65449: Rip wire edges show error even when it works
Thanks to @zeddb for finding the root cause.
2020-11-04 14:52:45 +11:00
11843e7c29 UI: set the message for disabled vertex weight operators 2020-11-04 11:36:55 +11:00
951758c01f Merge branch 'blender-v2.91-release' 2020-11-04 11:33:12 +11:00
4d358855b8 Cleanup: avoid back-slash line continuations 2020-11-04 11:31:43 +11:00
ffa7bfdda5 Cleanup: unused argument 2020-11-04 11:28:31 +11:00
Jesse Y
c861517ca6 UI: Swap order of "Fade Inactive Geometry" in overlays popover
This simply makes the panel a bit nicer given how things are layed out--
the items with larger visual weight are grouped at the top.

Differential Revision: https://developer.blender.org/D9366
2020-11-03 18:21:02 -06:00
101c3d4ce4 Fix T60517: "Fix Deforms" crashes for meshes without vgroup data 2020-11-04 11:13:39 +11:00
564f3be20a Merge branch 'blender-v2.91-release' 2020-11-04 00:04:15 +01:00
c9fb25342b Fix T81799: Enable use self in trimming tool booleans
This enables self intersections in the sculpt trimming tools boolean operations.
This should fix wrong booleans results after using the operator to add new disconnected
geometry with the join mode.

Reviewed By: sergey

Maniphest Tasks: T81799

Differential Revision: https://developer.blender.org/D9423
2020-11-04 00:03:09 +01:00
e836c806e4 Fix T81842: Cloth brush not creating simulation areas for each tiling symmetry pass
The cloth brush fixed simulation areas are created using the initial_location variable in the
 StrokeCache. This variable was not being updated by tiling symmetry, so all symmetry passes
were using the same simulation area location.

Reviewed By: sergey

Maniphest Tasks: T81842

Differential Revision: https://developer.blender.org/D9421
2020-11-04 00:01:33 +01:00
a5aa56cd71 Fix mask extract and slice not preserving mesh symmetry options
When extracting new objects from a mesh in sculpt mode, it makes sense to keep
the current symmetry options and settings in the new mesh. In previous versions symmetry
options were stored in the tool settings, so this bug was not that obvious.

This also preserves the remember settings in the new object, which is also the desired
behaviour.

Reviewed By: sergey, mont29

Differential Revision: https://developer.blender.org/D9417
2020-11-03 23:59:24 +01:00
0dd599f916 Fix mask slice to new object preserving the mask
If the new object contains the mask it always needs to be cleared before starting
sculpting on it.

This fix was also committed before in the mask extract operator.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9416
2020-11-03 23:57:12 +01:00
dc3fb012e7 Fix T82297: Brush alpha not affecting smear tools strength
The strength of this brush needs to take alpha into account

Reviewed By: sergey

Maniphest Tasks: T82297

Differential Revision: https://developer.blender.org/D9419
2020-11-03 23:55:39 +01:00
4413f481be Merge branch 'blender-v2.91-release' 2020-11-03 16:31:17 -06:00
9e8a488af2 Fix T81691: Use-after-free with property search and hovered button
The list of buttons in the button group needs to be updated to take into
account the old button inserted into the button list for the new block.

Differential Revision: https://developer.blender.org/D9428
2020-11-03 16:30:58 -06:00
47876e9c5e Merge branch 'blender-v2.91-release' 2020-11-03 16:25:47 -06:00
5650468c84 Property Search: Fix missing update switching tabs after search
What I thought was an "optimization" was really a bug. The "use search
for expansion" value needs to be set for every panel, even panels in
other tabs. Otherwise it won't be properly set when switching back to
a tab that was visited during search.

Differential Revision: https://developer.blender.org/D9427
2020-11-03 16:24:22 -06:00
e29206f86a Cleanup: Remove broken/deprecated setting of color-ramp button step size
Setting the button's step size like this wouldn't work anymore after
e6f0b60c2e, which is reported in T81794. Instead, the step size should be set
for the RNA property, as proposed in D9277. That will be committed separately
as bug fix.
2020-11-03 22:31:46 +01:00
db7cf3652c Fix for previous cleanup commit 2020-11-03 15:26:23 -06:00
cabec08253 Cleanup: Clang tidy 2020-11-03 15:12:50 -06:00
f109b63431 Merge branch 'blender-v2.91-release' into master 2020-11-04 01:58:10 +05:30
Ankit Meel
8f2ebcf93f macOS: find Jack framework in system directories
Until it is decided whether to ship JACK with pre-compiled libraries,
search for the same in system directories.

Ref T79261
Reviewed By: brecht
Differential Revision: https://developer.blender.org/D9436
2020-11-04 01:53:33 +05:30
fe7093fae4 Cleanup: Remove dead code in bevel operator
The `poll_property` callback is only used when the `ui` callback isn't
defined.
2020-11-03 14:10:20 -06:00
76683af38c Cleanup: Declare variables where initialized 2020-11-03 13:57:20 -06:00
e3858f4716 Fluid: Updated APIC plugin
Updated version of APIC plugin in order to resolve ASAN issues.
2020-11-03 19:34:31 +01:00
57d1aea64f Cycles: add support for BVH refit in OptiX
This avoids recomputing the BVH for geometries that do not have changes in topology but whose vertices are modified (like a simple character animation), and gives up to 40% speedup for BVH building.

This is only available for viewport renders at the moment.

Reviewed By: pmoursnv, brecht

Differential Revision: https://developer.blender.org/D9353
2020-11-03 18:05:29 +01:00
216880bb47 GPencil: Reorganize Cleanup menu
Reviewed by @mendio
2020-11-03 17:22:03 +01:00
7567086276 GPencil: Add Recalculate Geometry operator to Cleanup menu
This operators was only accesible using the search menu.
2020-11-03 17:22:03 +01:00
ed4540b799 Fix paste f-curve modifiers default "Only Active" value
The tooltip implies that this option should be off per default instead
of on. Some talking with the animators at the studio and in the
animation module confirmed that this seems to be the most logical
default.
2020-11-03 17:21:14 +01:00
5deb2d42d9 Merge branch 'blender-v2.91-release' 2020-11-03 16:39:27 +01:00
0cf46631e1 Fix T82356: Gpencil merge freezes Blender
The `gps_next` variable had a typo error and was wrongly used as `gps->next`
2020-11-03 16:38:43 +01:00
e699546bde Fix T81756: relinking multiple links to group input removes links
The links where added to the socket one after the other. However,
the virtual socket had a link limit of 1, so whenever a new link was
added, the previously added one was removed.

There is not really a reason for why the link limit should be 1 instead
of something higher. I'm setting it to the max value: `0xFFF`.

I'm also setting the `input_link_limit` to that value. Blender does not
need this currently, but addons might have input sockets that allow
more than one incident link.
2020-11-03 15:11:40 +01:00
313086e212 GL: Fix default framebuffers being bound using srgb
Default backbuffers needs not to be bound with sRGB encoding
enabled. This works when using `GPU_framebuffer_restore` but
using `GPU_framebuffer_bind` would trigger the wrong behavior.

This fix T81969 UI turns whiteish when playing video sequence
based on a scene and moving in the image editor after saving
2020-11-03 14:44:28 +01:00
6fdcca8de6 Materials: add custom object properties as uniform attributes.
This patch allows the user to type a property name into the
Attribute node, which will then output the value of the property
for each individual object, allowing to e.g. customize shaders
by object without duplicating the shader.

In order to make supporting this easier for Eevee, it is necessary
to explicitly choose whether the attribute is varying or uniform
via a dropdown option of the Attribute node. The dropdown also
allows choosing whether instancing should be taken into account.

The Cycles design treats all attributes as one common namespace,
so the Blender interface converts the enum to a name prefix that
can't be entered using keyboard.

In Eevee, the attributes are provided to the shader via a UBO indexed
with resource_id, similar to the existing Object Info data. Unlike it,
however, it is necessary to maintain a separate buffer for every
requested combination of attributes.

This is done using a hash table with the attribute set as the key,
as it is expected that technically different but similar materials
may use the same set of attributes. In addition, in order to minimize
wasted memory, a sparse UBO pool is implemented, so that chunks that
don't contain any data don't have to be allocated.

The back-end Cycles code is already refactored and committed by Brecht.

Differential Revision: https://developer.blender.org/D2057
2020-11-03 16:35:44 +03:00
91d320edc3 Cycles: immediately store the used_shader list in Blender interface.
Uniform attributes require immediate access to the shader list
in object update code, so setting the field can't be deferred
to a background task. This required adding a parameter to the
clear method of Geometry.

Ref D2057
2020-11-03 16:35:43 +03:00
9bc177d8de Materials: support true float4 attributes in the Attribute node.
Add a new Alpha socket to the Attribute node that outputs the
fourth component of the attribute. Currently the only such
attribute is vertex color, but there may be more in the future.
If the attribute has no alpha channel, the expected value is 1.

The Cycles code is already refactored and committed by Brecht.

Ref D2057
2020-11-03 16:35:43 +03:00
da93da45ee Docs: add comments to some surface deform internal structures 2020-11-04 00:04:48 +11:00
3c953a1b09 Fix T82074: Volume to Mesh normals are inverted
OpenVDB seems to have a different winding order convention.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D9434
2020-11-03 14:01:07 +01:00
7ceb622fd3 Cleanup: doxy param syntax 2020-11-04 00:01:00 +11:00
f278d814fd Cleanup: spelling 2020-11-03 23:59:24 +11:00
b1efea986d Fix sequence tests writing HTML report to wrong directory
It was missing from tests/report.html that gathers all tests reports.
2020-11-03 13:31:31 +01:00
c21ba10e0b Merge branch 'blender-v2.91-release' 2020-11-03 13:22:22 +01:00
df2a0cd6f4 Fluid: Fix crash with viewport display options
Overlay extras should not be drawn outside of the fluid domain cache range.
2020-11-03 13:21:07 +01:00
c32bee0099 Cleanup: Use recently added helper function to find File Browser UI data
`ED_fileselect_handler_area_find()` was added in a750acab78 and makes this
case more readable and avoids code duplication as well.
2020-11-03 12:27:20 +01:00
bc0a6b0400 Fix T71759: Sculpt/Vertex/Weight Paint Brush Size Gets Undone After Undoing a Stroke.
Add code preserving scene's toolsettings accross undo.

IDPointers are dealt with special care, we try to keep existing ones for
some (like brushes) when possible.

Note that this covers ToolSettings, Brushes and Palettes currently.

I'm not especially happy about how this new code mixes with existing
'foreach_id' one, in particular in scene. But cannot think of a better,
more generic way to do it currently.

Maniphest Tasks: T71759

Differential Revision: https://developer.blender.org/D9311
2020-11-03 12:09:00 +01:00
5610ccdc08 Add a callback to IDTypeInfo to allow preservation of some data accross memfile undos
This is essentially adding that new callback, and using it only for already
existing Scene's 3DCursor.

Note that the place where this is called has been moved again, after all
have been lib-linked, such that those callbacks may also work on ID pointers.

Maniphest Tasks: T71759

Differential Revision: https://developer.blender.org/D9237
2020-11-03 11:40:29 +01:00
da03eb854b Merge branch 'blender-v2.91-release' 2020-11-03 20:54:26 +11:00
e03575768f Merge branch 'blender-v2.91-release' 2020-11-03 20:54:22 +11:00
fc9f1b1754 Fix T81988: Surface Deform "Bind" causes vertices to spike
Surface deform weight calculation assigned weights in a non-uniform
way that caused vertices to deform upon binding.

This was caused by the face-corner angle being used in
calculations which where squared & scaled.
Causing a triangle fan of many thin faces to have a much greater
influence compared to the same shape made from a single triangle.

Change the calculation of the weight so each face-corner is scaled
by it's angle.
2020-11-03 20:52:53 +11:00
d93a6cdf00 DrawManager: Cleanup unneeded memory allocation
`tris_per_mat` is only valid for the final buffer cache. It was
allocated for every buffer cache.
2020-11-03 10:44:56 +01:00
093dfdfc94 Merge branch 'blender-v2.91-release' 2020-11-02 22:59:00 -07:00
Manuel Castilla
20e982e78d Fix T77161: Outliner - Hiding a Collection does not gray out children objects
Ensure that When checking "Hide in Viewport" option for a collection
that child objects are drawn grayed out for consistency with the
"Disable in Viewports" toggle.

For checking an object visibility in the viewport the flag
BASE_VISIBLE_VIEWLAYER should be used instead of BASE_VISIBLE_DEPSGRAPH
because the latter ignores viewport visibility.

Manifest Task: T77161

Differential Revision: https://developer.blender.org/D7904
2020-11-02 22:56:44 -07:00
Jaggz H
fbf2908674 Outliner: Add "Selectable" object filter
This addition to the filters allows the user to enable the
outliner tree to restrict the listing to only Selectable objects.

Differential Revision: https://developer.blender.org/D7310
2020-11-02 22:09:47 -07:00
084db58fbd Cleanup: Use typedef for bevel angle kind enum
This makes debugging slightly easier, and makes the code slightly more
explicit about its intentions.
2020-11-02 23:05:15 -06:00
6290bc4a37 Merge branch 'blender-v2.91-release' 2020-11-02 22:35:15 -06:00
c6d8300823 Fix T82120: Arc miter bevel creates miters on straight edges
In some situations where two beveled edges were very close to in-line
but not quite straight, bevel would build a miter when it shouldn't.
The code that chose whether to use a miter at each vertex was slightly
incorrect.

For outer miters there is a check for 3 or more selected edges, but an
inner miter can still be useful with only two beveled edges at a vertex,
so we can't use that here. Instead I changed the check for in-line edges
to run before determining whether the angle is reflex or not. The logic
ends up a bit more straightforward as well. This doesn't completely
remove the rather strange looking triangle vertex meshes at each corner,
but it does make it stable when locations are slightly adjusted.

The only other place this `edges_angle_kind` function was used is for
profile=1.0 vertex meshes. I tested and made sure that still works well.

Differential Revision: https://developer.blender.org/D9420
2020-11-02 22:34:57 -06:00
23f3c30b58 Fix T64138: Windows Ink continuous grab at window edge.
WM_POINTERLEAVE occurs when the pen goes out of range or when a
hovering pen leaves the window's boundary. When leaving the window
boundary the xy position is invalid for some Wacom devices.

This change removes creation of GHOST_EventCursor during
WM_POINTERLEAVE events. This prevents unexpected jumping behavior
during continuous grab.
2020-11-02 19:02:16 -08:00
3049704b15 Cleanup: Remove unused parameter in panel code
This is no longer used after rB54da72d3cd546ecb, but passing it to a
recursive call hid the warning.
2020-11-02 18:00:46 -06:00
c067b7460a Fix C operators can't set default display or sort type for File Browser
`WM_operator_properties_filesel()` allows C operators to set a display or sort
type for the File Browser to use. But the File Browser would always override
that because of an invalid `_is_set()` check. (The operators don't actually set
the value, they only set the property's default value.)

The only operator affected by this is "Recover Auto Save". It is supposed to
show a vertical list ordered chronologically. It used settings from the
previous File Browser usage before this patch.

Operators using the File Browser should generally use
`FILE_DEFAULTDISPLAY`/`FILE_SORT_DEFAULT` now, except if they have a reason not
to. See comments at their definition.

----

This makes it so operators that set a different display or sort type
don't change the sort or display type for the next File Browser operation.
So using "Recover Auto Save" entirely isolates display and sort type from other
operations.

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

Reviewed by: Bastien Montagne
2020-11-03 00:00:41 +01:00
a750acab78 Fix possible use-after-free when closing Blender with File Browser open
I think there wasn't actually any issue currently, but only by luck. We still
passed around and NULL-checked a pointer to freed memory (the file operator,
`SpaceFile.op`) which is easy to break and should be avoided.
Noticed while testing D8598.
2020-11-03 00:00:41 +01:00
9cfcc27319 Cleanup: Mark arguments as const 2020-11-02 16:25:59 -06:00
e1665c3d31 VSE: Media transform redesign
This patch changes behavior of strip transform and crop feature.

Purpose of this change is to allow display arbitrary portion of input
image, simplify user interface and workflow.
Offset and Crop values in old files are converted in versioning.
Offset animation is also converted. Crop animation and animation of
crop or offset enable properties is not taken into account

Changes in behavior and interface:
- If image is added to timeline it is scaled to fit inside preview area
while maintaining aspect ratio. Image is centered. This is considered
as a baseline for further transformation.
- Scale and rotation was added, so it is possible to transform image at
it's original resolution.
- Crop will not affect image transformation (does not move image).
- Values of Crop and Transform Position are in pixels, these values are
corrected if preview is fraction of project resolution.
- Transform and Mirror panel has been removed and new Transform panel
and Crop panel is moved to Adjust panel. Mirror is now part of new
Transform panel.

Technical changes:
- Preprocessing stage must work on duplicated image, because original is
cached. Previously Crop and Offset could run at once and required only
one duplication of image. This is not the case with new algorithms, so
duplication on demand is implemented. Transformation can read original
image and will output new image that is safe to modify. It should be
possible to add crop step to transform algorithm, so that Crop won't
require previous duplication though.
- Use Crop and Use Translation checkboxes were removed. Individual
values are compared to default values to check if image needs to be
processed. In case of transform this will be done also if resolution of
source.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8393
2020-11-02 22:15:52 +01:00
6b3eca661d Revert "VSE: Media transform redesign"
This reverts commit 0277579b28.

This commit caused build errors on Linux.
2020-11-02 20:59:21 +01:00
b9ec6c305c Revert "Cleanup: store results of function calls in const values."
This reverts commit 20c4aa13de.

Wrong buggy commit breaking tests, and not actually adding anything to
code quality.
2020-11-02 20:31:12 +01:00
0277579b28 VSE: Media transform redesign
This patch changes behavior of strip transform and crop feature.

Purpose of this change is to allow display arbitrary portion of input
image, simplify user interface and workflow.
Offset and Crop values in old files are converted in versioning.
Offset animation is also converted. Crop animation and animation of
crop or offset enable properties is not taken into account

Changes in behavior and interface:
- If image is added to timeline it is scaled to fit inside preview area
while maintaining aspect ratio. Image is centered. This is considered
as a baseline for further transformation.
- Scale and rotation was added, so it is possible to transform image at
it's original resolution.
- Crop will not affect image transformation (does not move image).
- Values of Crop and Transform Position are in pixels, these values are
corrected if preview is fraction of project resolution.
- Transform and Mirror panel has been removed and new Transform panel
and Crop panel is moved to Adjust panel. Mirror is now part of new
Transform panel.

Technical changes:
- Preprocessing stage must work on duplicated image, because original is
cached. Previously Crop and Offset could run at once and required only
one duplication of image. This is not the case with new algorithms, so
duplication on demand is implemented. Transformation can read original
image and will output new image that is safe to modify. It should be
possible to add crop step to transform algorithm, so that Crop won't
require previous duplication though.
- Use Crop and Use Translation checkboxes were removed. Individual
values are compared to default values to check if image needs to be
processed. In case of transform this will be done also if resolution of
source.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8393
2020-11-02 20:19:16 +01:00
5ed4e1e23a Fix T77819: Snap Incremental does not match grid in all cases
The behavior of the incremental snap did not take into account the
relative dimensions of the window, which resulted in a different behavior
if the area height was greater than the width.
2020-11-02 16:14:03 -03:00
ef4aa42ea4 UI: Enable writing global area data (top-bar, status-bar) to .blend's
There should not be much user visible here (other than T73668 being addressed).

I added the writing code already for the initial implementation of workspaces,
but we decided to keep it disabled until the top-bar design is more clear. It
was never planned to keep this disabled for so long.

Fixes T73668.
2020-11-02 18:35:13 +01:00
cf7343a355 Fix Cycles kernel compile error with NanoVDB because of type redefinition
Cycles defines some basic integer types since it cannot use the standard headers when
compiling with NVRTC. NanoVDB however only does this when the "__CUDACC_RTC__" define
is set and otherwise includes the standard "stdint.h" header which clashes with those typedefs.
So for compatibility do the same thing in the Cycles kernel headers. See also T81454.
2020-11-02 18:00:13 +01:00
1408052781 LibOverride: make some pose options overridable.
Request from the studio.
2020-11-02 17:29:04 +01:00
576bd98622 Grease Pencil UI code: use row for rows in the UI
Rename `col` to `row` when it's actually a row (and not a column).

No functional changes.
2020-11-02 17:18:55 +01:00
aee1e4fc6a UI: Simplify some tool icon geometry
Removing interior vertices can remove some complexity from the final
exports. Also improved the topology slightly in some cases.
2020-11-02 10:10:49 -06:00
20c4aa13de Cleanup: store results of function calls in const values. 2020-11-02 17:08:10 +01:00
db18ba07b5 Fix py-defined pointer properties wrong tag re ID ownership.
This fixes critical bug with liboverride when soe add-ons add some
RNA ID Pointer properties.

ID pointers should **never** have ownership of their ID when defined
from python.

(As a reminder, RNA properties owning their ID pointers are extremely
rare even from C code, only embedded IDs (root node trees, master
collections) and the shape keys snowflakes are concerned.)
2020-11-02 17:08:10 +01:00
4c460a2dbd Fix incorrect colors in grease pencil strength tool icon 2020-11-02 09:52:23 -06:00
7872bcafa0 Cleanup: Document output of BKE_object_where_is_calc and friends
Add a comment to the declaration of the `BKE_object_where_is_calc...()`
functions to explain where the result of the calculation is stored.

No functional changes.
2020-11-02 15:36:18 +01:00
7887e91d31 Cleanup: Sanitise return value of ED_object_parent_set()
Consistently return `false` from `ED_object_parent_set()` when parenting
is not possible. Before, when parent and child were the same object, the
function would return `true` even though the parent-child relation was
not made.

Just returning `false` in the `parent == child` case would break the
parenting operator, as `false` stops its loop over all selected objects.
This tight coupling caused T82312. The loop now has its own check for
this, so that it properly continues, and the implementation of
`ED_object_parent_set()` is decoupled from its surrounding code.

No functional changes.
2020-11-02 15:36:18 +01:00
417ba6aa1c GPencil: Cleanup comments typo error 2020-11-02 15:27:33 +01:00
b1213e8cf9 Add comment about size of generated previews of filebrowser thumnails. 2020-11-02 15:10:38 +01:00
42f6aada98 Fix crash opening some 2.4x .blend files with drivers or NLA editor
For example, outlinertest.blend from test240.zip.
2020-11-02 14:28:10 +01:00
dca65390f0 Another attempt at fixing T81963: Random rare crashes in override code.
Adding another pass of ensuring valid up-to-date pose data in RNA
function itself...
2020-11-02 11:58:01 +01:00
2b98a9269b LibOverride: Do not assert on missing operands in apply function.
This can happen after some changes in lib file and resync in user file
e.g..
2020-11-02 11:58:01 +01:00
f2c7b4a1c5 Re-enable WITH_COMPILER_SHORT_FILE_MACRO, fix build error.
The issue was in `buildinfo.c`:
  char build_c[xx]flags[] = BUILD_C[XX]FLAGS;

Non-escaped double-quotes were terminating the string early, and
causing the compile error. So use single-quotes.
2020-11-02 16:11:10 +05:30
19dec6c8a7 Turn off WITH_COMPILER_SHORT_FILE_MACRO temporarily.
It's causing build errors on compilers that I don't have. Turn it off
while I fix them.

Added in {rB1daa3c3f0a1cfd74bef527e0207f38154e591d46}.
2020-11-02 15:45:59 +05:30
b801369c8e Merge remote-tracking branch 'origin/blender-v2.91-release' 2020-11-02 11:06:22 +01:00
9e736fc984 Revert "Parenting: fix return value when parenting object to itself"
This reverts commit ad35fa1993, it had
unintended side-effects (T82312).
2020-11-02 11:00:52 +01:00
1daa3c3f0a Clang/GCC: use relative path in __FILE__ macro
This change removes the user-specific information from
macros like `__FILE__` and keeps it relative to top level
source or build (for generated files) directory.
It makes traces concise.

Added option `WITH_COMPILER_SHORT_FILE_MACRO` enabled by default.

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D9386
2020-11-02 15:12:10 +05:30
cc09c0d048 Revert "Parenting: fix return value when parenting object to itself"
This reverts commit ad35fa1993, it had
unintended side-effects (T82312).
2020-11-02 10:11:46 +01:00
d49c71e96e Cleanup: use logging for "Found bundled Python" message
This was added when Python was initially bundled so any problems
finding Python could be investigated.

Move this to use logging so we can show this information when needed.
2020-11-02 19:33:32 +11:00
27acf8ced8 Cleanup: remove unused FileList.prv_w/h 2020-11-02 17:09:08 +11:00
0d10621630 Fix incompatible pointer types warning with GCC 2020-11-02 16:49:12 +11:00
Richard Antalik
c887a50f62 Add sequencer transform tests
Tests files are based on test from D8393

Test files should be in `lib\tests\sequence_editing`
These are files, I will add few more tests including animation test.
{F9155273}

Using generic tool to compare rendered vs reference image as other render engines.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9394
2020-11-01 21:34:18 +01:00
Richard Antalik
ea1c5a6c15 Rename BKE_sequencer.h
Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9349
2020-11-01 21:10:36 +01:00
a1f46ac9dc Revert "PyAPI: remove bpy.app.binary_path_python"
This reverts commit 6527a14cd2.

Some 3rd party scripts made use of this so scripts can work with
2.90 to 2.92, although eventually this can still be removed.
2020-11-01 19:11:08 +11:00
4012c6e86f Merge branch 'blender-v2.91-release' 2020-11-01 18:22:19 +11:00
f4d6823fd6 Merge branch 'blender-v2.91-release' 2020-11-01 18:22:16 +11:00
f2fb26575c Merge branch 'blender-v2.91-release' 2020-11-01 18:22:12 +11:00
276d19f63b PyAPI: set sys.executable to None when Python can't be found
Without this, sys.executable may be set to Blender's
executable instead.
2020-11-01 18:12:26 +11:00
9de42337c8 Cleanup: Fix typo in comment 2020-10-31 22:54:13 -05:00
c271600101 Fix T82089 Boolean on empty mesh with collection fails.
For the fast solver, there was an optimization carried over
from the non-collection case for empty meshes which did not
work in the chained boolean code for collection operands.
Removed that optimization in the collection case.
2020-10-31 20:48:24 -04:00
4158b7f674 Fix T82089 Boolean on empty mesh with collection fails.
For the fast solver, there was an optimization carried over
from the non-collection case for empty meshes which did not
work in the chained boolean code for collection operands.
Removed that optimization in the collection case.
2020-10-31 20:07:00 -04:00
c249eb7a8d Fix new boolean performance bug.
The code that decided to use a faster double version of plane
side testing forgot to take an absolute value, so half the time
the exact code was being used when it was unnecessary.
2020-10-31 17:21:18 -04:00
30826a5e49 Fix new boolean performance bug.
The code that decided to use a faster double version of plane
side testing forgot to take an absolute value, so half the time
the exact code was being used when it was unnecessary.
2020-10-31 16:46:11 -04:00
64faa59846 Cycles: Fix debug compilation after tile stealing commit 2020-10-31 14:04:30 +01:00
e7dc3c91ab GPencil: Change maximum limit of Join stroke
Also, clarify comments.
2020-10-31 09:37:10 +01:00
fe90bb86c0 Merge branch 'blender-v2.91-release' 2020-10-31 09:25:13 +01:00
9af6c041e8 Fix T82265: GPencil interpolate crash when next frame was NULL
If the next frame of the layer was NULL and it was not the active layer crashed.
2020-10-31 09:24:43 +01:00
517ff40b12 Cycles: Implement tile stealing to improve CPU+GPU rendering performance
While Cycles already supports using both CPU and GPU at the same time, there
currently is a large problem with it: Since the CPU grabs one tile per thread,
at the end of the render the GPU runs out of new work but the CPU still needs
quite some time to finish its current times.

Having smaller tiles helps somewhat, but especially OpenCL rendering tends to
lose performance with smaller tiles.

Therefore, this commit adds support for tile stealing: When a GPU device runs
out of new tiles, it can signal the CPU to release one of its tiles.
This way, at the end of the render, the GPU quickly finishes the remaining
tiles instead of having to wait for the CPU.

Thanks to AMD for sponsoring this work!

Differential Revision: https://developer.blender.org/D9324
2020-10-31 01:57:39 +01:00
523414dda2 Cleanup: clang-format 2020-10-31 01:57:39 +01:00
316a5914bc Previous check seems to have a race condition, resulting in Wintab not being enabled. 2020-10-30 16:29:04 -07:00
af7b0003cb Add explanation for dequing Wintab PACKETs during WT_PACKET event into a local queue to consume during WM_* mouse events. 2020-10-30 16:29:04 -07:00
50558416b9 Commented assumption was incorrect, using tickCountToMillis causes underflow when compared to current time. 2020-10-30 16:29:04 -07:00
792e145c22 Cleanup: rename functions for consistency with other process*Events functions. 2020-10-30 16:29:04 -07:00
2b01c5a148 Cleanup: Use C style comments, punctuation, and capitalization.
Added missing function documentation.
2020-10-30 16:29:04 -07:00
632b345d35 Update tooltip, Tablet API can now be changed at runtime. 2020-10-30 16:29:04 -07:00
cbc1c83154 Remove Wintab logging. 2020-10-30 16:29:04 -07:00
a9d6eb8f0b Add Wintab debug logging as a CMake option WITH_WINTAB_DEBUG.
Signed-off-by: Nicholas Rishel <rishel.nick@gmail.com>
2020-10-30 16:29:04 -07:00
d9b0ef2de4 Finish the comment's thought explaining pessimistic button ups events for
Wintab.
2020-10-30 16:29:04 -07:00
5badaa8390 Return of the Wintab refactor.
Previously Wintab was handled by saving the most recent tablet pressure and tilt information and deferred appending tablet infromation to Windows mouse events. This caused synchronization issues evident at the beginning and ending of strokes where pressure and tilt were either ahead or behind in time from mouse button up or down events. This also dicarded swaths of data which resulted in blockly grease pencil lines most apparent when a context switch resulted in several coalesced mouse events.

This patch changes the behavior of Wintab to instead rely entirely on Wintab information for pressure, tilt, position, and button input.

Wintab has several design decisions and conventions which complicate relying soley on it's input while retaining current workflows reliant on non-API behavior. For example, many device optionally allow the user to map barrel buttons to non-mouse actions. These mappings may or may not modify the intended behavior when touching the stylus down, such as scroll vs alt mappings. This behavior is not exposed in the Wintab API, but Wintab will continue updating button state sans this necessary context.

To work around the problem, this refactor synchronizations tablet input to Windows mouse down and up events, this captures events which should result in pen input while allowing events such as pen scrolling. Until a Windows mouse down event fires Wintab input is left unprocessed; when a Windows up event occurs Wintab is processed until a corresponding button up event is found.

Wintab allows for either button state or changes to be reported, but not both. An earlier refactor tried to use button changes to let state to be managed by Wintab. This was replaced when it was found that button change events were unreliable at corner cases such as switching windows. It was also found that with Wacom drivers Wintab peek functions would modify events in the queue causing errant and loss of button events.

For the latter stated reason this patch opts to read all Wintab events into a queue as they arrive, removing events as they become stale. This was chosen over using Wintab peek functions due to the afformentioned issue. As a bonus this seems to work better as it prevents the queue in Wintab from filling, thus neither a flood of events need to be handled when Wintab processing begins and a Wintab implementation need not be trusted to overwrite old events in it's queue.

Maniphest Tasks: T75566

Differential Revision: https://developer.blender.org/D7840
2020-10-30 16:29:04 -07:00
0ee4b0b965 Before a wintab button event is generated, generate a GHOST mouse move
event to the button down location as this should be a more accurate point
of contact than the last mouse move event.

Signed-off-by: Nicholas Rishel <rishel.nick@gmail.com>
2020-10-30 16:29:04 -07:00
7599571904 Adding explanitory comment to explain why tablet API check is necessary
for Pointer input even when Wintab should be preventing Pointer events.

Signed-off-by: Nicholas Rishel <rishel.nick@gmail.com>
2020-10-30 16:29:04 -07:00
a080accdb6 When there are not associated button events, assume there is no button
events until one is found. This prevents errant cursor moves that occur
before the Wintab button event is reported. We need to skip these events
because if no button event exists, we generate one assuming it will either
arrive later in the Wintab queue or that the button was from a non-Wintab
device. For the case that this was generated by a non-wintab device, such
as buttons mapped to mouse on the tablet pad, these cursor move events can
significantly move the cursor from the intended click position.

Signed-off-by: Nicholas Rishel <rishel.nick@gmail.com>
2020-10-30 16:29:03 -07:00
1f25235ec3 Clarify comment to be more specific so that in the future someone knows
the issue with Wintab button events are more significant than simply
setting what buttons should receive button up/down events during context
initialization.

Signed-off-by: Nicholas Rishel <rishel.nick@gmail.com>
2020-10-30 16:29:03 -07:00
efe3e4f023 Save Wintab packets to a local queue as WT_PACKET events arrive or when
handling mouse input. This Wintab to mouse synchronization issues, and
likely prevents queue exhaustion for some Wintab implmenetations.

Signed-off-by: Nicholas Rishel <rishel.nick@gmail.com>
2020-10-30 16:29:03 -07:00
d58387cdda Correcting the type for indexing Wintab buttons.
Signed-off-by: Nicholas Rishel <rishel.nick@gmail.com>
2020-10-30 16:29:03 -07:00
14cddad034 Change updateWintab interface to include whether window is visible so that
window intitialization can specify whether it will be visible regardless
of whether it is yet visible.

Signed-off-by: Nicholas Rishel <rishel.nick@gmail.com>
2020-10-30 16:29:03 -07:00
b98ea1b268 Revert "Mask all button down/up and switch back to using relative button input."
This reverts commit 045aaf6f78f1fbb6e2bbefd234b7bae04844d42b.
2020-10-30 16:29:03 -07:00
c4821079b7 Fix type for physicalButton in wintabMouseToGhost.
Signed-off-by: Nicholas Rishel <rishel.nick@gmail.com>
2020-10-30 16:29:03 -07:00
a6e31482e9 Fix return value of WTPacketsGet.
Signed-off-by: Nicholas Rishel <rishel.nick@gmail.com>
2020-10-30 16:29:03 -07:00
a5f3c0e563 Move assignments into initializer list for GHOST_EventButton
and GHOST_EventCursor.

Signed-off-by: Nicholas Rishel <rishel.nick@gmail.com>
2020-10-30 16:29:03 -07:00
1b535e8719 Mask all button down/up and switch back to using relative button input.
Signed-off-by: Nicholas Rishel <rishel.nick@gmail.com>
2020-10-30 16:29:03 -07:00
3281507f7b Document inline that PACKETDATA and PACKETMODE modify external headers to
discourage reducing their scope to the only place they're used internally.

Signed-off-by: Nicholas Rishel <rishel.nick@gmail.com>
2020-10-30 16:29:03 -07:00
538a2ac58f Allow double button up, otherwise there may be a trailing 0 pressure line.
Signed-off-by: Nicholas Rishel <rishel.nick@gmail.com>
2020-10-30 16:29:03 -07:00
7c84f25453 Fix T75566
Button events now include tabletdata, so move is unnecessary.

Generate mouse button events when the system has an event but Wintab did not find a correlated event.

Only filter mouse button events, not Win32 Pointer events.

Signed-off-by: Nicholas Rishel <rishel.nick@gmail.com>

Maniphest Tasks: T75566

Differential Revision: https://developer.blender.org/D7404
2020-10-30 16:29:03 -07:00
70ca48b67f Button events now include tabletdata, so move is unnecessary.
Signed-off-by: Nicholas Rishel <rishel.nick@gmail.com>
2020-10-30 16:29:03 -07:00
abbdfc8bf7 Revert "Revert "Windows: support high resolution tablet pen events for Wintab""
This reverts commit e90d8422d0.
2020-10-30 16:29:03 -07:00
c503c5f756 Fix T82244: Crash when trying to use the rotate operator on the timeline
Some tranform modes are not expected to be used in the `SPACE_ACTION`.
2020-10-30 20:13:05 -03:00
81090ded0d Fluid: Removed binary_python from fluid script
This hack is no longer required. It was fixed in rB52b38d9c3d84 and temporarily disabled in rBa877248ac203.
2020-10-30 18:36:21 +01:00
99a7c917ea Sculpt: Dyntopo detail size edit operator
This introduces a new operator to edit the detail size of constant
detail mode in dyntopo. The way this operator works and the
functionality it provides is similar to the "Voxel size edit" operator
for the voxel remesher.

It also includes a sample mode. When pressing Ctrl, the detail size
will be sampled from the surface under the cursor, updating the
preview in real time. This allows quick resolution changes without
using the operator multiple times.

The operator is set to Shift + D, replacing the old way to change
the constant detail size of dyntopo. Shift + R will remain available to
be enabled when the voxel remesher works with dyntopo. Deciding
if both detail sizes can be unified needs a separate discussion as the
new dyntopo can work with detail sizes in parts of the mesh that can
easily crash the remesher.

The structure of these operators is similar, but the data they control,
ranges, drawing and setup functions are completely different, making it
hard to merge them into one.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9355
2020-10-30 18:13:25 +01:00
39be996452 Sculpt: Add pie menu for global automasking options
Global automasking options are usually turned on/off for quick
adjustments both in brushes and filters, so it is convenient to have them
in a pie menu.

This uses the Alt + A shortcut.

Reviewed By: dbystedt, HooglyBoogly

Differential Revision: https://developer.blender.org/D9282
2020-10-30 18:09:54 +01:00
15cb67e0b0 Sculpt: Add normal orientation to lasso trim tool
This adds an option to orientate the trimming shape using the surface
normal instead of the view when lasso trim is used.

Reviewed By: dbystedt, sergey

Differential Revision: https://developer.blender.org/D9231
2020-10-30 18:09:03 +01:00
492a9e4023 Fix crash when using multiple Sculpt Vertex Color layers for rendering
This line was probable left there after a bad merge.

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D9367
2020-10-30 18:07:51 +01:00
0270223552 Merge branch 'blender-v2.91-release' 2020-10-30 17:37:23 +01:00
8b806c86e1 Fix T82027, T81718: Cycles crash with volume animation playback 2020-10-30 17:36:41 +01:00
62e532785d Refactor: move WorkSpace .blend I/O to IDTypeInfo callbacks 2020-10-30 16:32:55 +01:00
a877248ac2 Fluid: Switch to binary_python
This change is required since rB52b38d9c3d84. Why a bpy reference is there in the first place is to be investigated.
2020-10-30 16:25:43 +01:00
12c92433d8 Refactor: move bScreen .blend I/O to IDTypeInfo callbacks
I could not easily move `direct_link_screen` yet, because it
has a return value. That has to be solved differently at some point.
2020-10-30 16:01:26 +01:00
e6f61a4a37 GPencil: New material parameter to rotate texture
Add a parameter to rotate the texture for Dots and Squares

Differential Revision: https://developer.blender.org/D9369
2020-10-30 15:45:00 +01:00
aacdc39958 Merge branch 'blender-v2.91-release' into master 2020-10-30 15:34:12 +01:00
8b836f6894 Fix (unreported) buffer-overflow in new lattice code.
Follow-up to rBc0beeeb5de0cbc, fixing overflow accesses on arrays
introduced by rB042143440d76.

It's never 'OK' to access invalid memory...
2020-10-30 15:33:25 +01:00
fc9ec1b9d8 Refactor: move Area .blend I/O to blenkernel
There should be no functional changes.
Eventually, it would be good to handle the different space types
using callbacks.

Ref T76372.
2020-10-30 15:28:17 +01:00
a8c165f2a4 Merge branch 'blender-v2.91-release' 2020-10-30 15:16:04 +01:00
a1d8559a42 Fix Cycles map range node missing clamp socket
No effect on the Blender integration yet, but needs to be solved for the
upcoming change to encapsulate sockets.
2020-10-30 14:58:34 +01:00
c0beeeb5de Fix buffer-overflow in lattice deform evaluation
Caused Victor.blend from the cloud to crash with ASan. Four floats are
fetched from the stack, but the buffer was only three wide.

Caused by 042143440d. Issue was probably harmless since the fourth
element wasn't actually touched.
2020-10-30 14:56:32 +01:00
bcb612e361 Refactor: move view3dshading .blend I/O to blenkernel
Ref T76372.
2020-10-30 14:44:03 +01:00
ada45463b3 Refactor: move ParticleSettings .blend I/O to IDTypeInfo callbacks 2020-10-30 13:43:34 +01:00
f6d9a36534 Merge remote-tracking branch 'origin/blender-v2.91-release' 2020-10-30 13:17:49 +01:00
ad35fa1993 Parenting: fix return value when parenting object to itself
Ensure parenting an object to itself is seen as error, by returning
`false`.

This error was introduced as part of a supposed-to-be-non-functional
cleanup rBb8d4a2aff8069dd7d6fb91ad0d9427eed489b68f.
2020-10-30 12:40:03 +01:00
4c7b1766a7 Fix undo steps not allowing re-using old BMain in non-global undo.
Non-memfile undo steps never properly initialized the flag allowing to
re-use old Main data during undo/redo. This lead to doing a complete
full re-reading of data when undoing/redoing mode switches e.g.

Note that current undo system is supposed to support any kind of mode
switch across those steps, however this needs to be properly deeply
tested, so only comitting this to master. It would be way too risky for
2.91 release.
2020-10-30 11:51:48 +01:00
30b17e30f8 Fluid: Cleanup for APIC debug build setup
Fixes build issue
2020-10-30 11:15:24 +01:00
57d77bd922 Cleanup: malformed doxygen sections 2020-10-30 21:10:09 +11:00
9333f660d0 Docs: note the purpose of UserDef_Runtime.is_dirty 2020-10-30 21:00:43 +11:00
08d40ecbd8 Merge branch 'blender-v2.91-release' 2020-10-30 20:56:55 +11:00
62b68745fd Merge branch 'blender-v2.91-release' 2020-10-30 20:56:52 +11:00
ebb8f8fffc Merge branch 'blender-v2.91-release' 2020-10-30 20:56:48 +11:00
841517ca81 Merge branch 'blender-v2.91-release' 2020-10-30 20:56:45 +11:00
ff73dc244c Merge remote-tracking branch 'origin/blender-v2.91-release' 2020-10-30 10:52:25 +01:00
9ab4536218 Outliner: use undo-group for outliner mode switching
Switching modes no longer adds multiple undo steps
from a user perspective.
2020-10-30 20:50:27 +11:00
3cc6b423b1 Object: use undo-group for object.switch_object
object.switch_object no longer adds multiple undo steps
from a user perspective.
2020-10-30 20:50:22 +11:00
8d2576fd29 Undo System: support for grouping steps with begin/end calls
This adds support for treating multiple undo steps as a single step
from the user perspective.

This is needed for outliner mode switching and `object.switch_object`
operator which change active object and mode in a single action.
2020-10-30 20:48:15 +11:00
3624c06007 Fix outliner mode toggling with multi-object pose/edit mode
For edit/pose modes clicking in the mode-column would include other
selected objects (besides the active object), causing other objects to
remain in the mode even though Control wasn't held.

Also replace `ED_object_mode_generic_exit(...)` on all objects with a
single call to `ED_object_mode_set(...)` so switching modes will only
exit the current mode, leaving objects in other modes unchanged.
2020-10-30 20:48:10 +11:00
8bdf191461 Fluid: Added APIC simulation method
Basic support for velocity updates with the APIC method.

This commit adds APIC to the already existing dropdown menu for the simulation method. The APIC plugin within Mantaflow has been updated to the latest version.
2020-10-30 09:52:05 +01:00
e3e5d595f6 Outliner: Remove "ID" from tooltip
The concept of IDs shouldn't be exposed to the user.
2020-10-29 21:50:47 -06:00
b018582cd3 Cleanup: parse '--thread' as part of ARG_PASS_ENVIRONMENT
While this isn't needed at the moment, it's possible
the animation player uses the scheduler in the future.
2020-10-30 13:30:16 +11:00
6ab8cbc68c Text: support "Text to 3D Object" for read-only data
Add poll function for read-only text data,
for operators that don't require the text to be editable.
2020-10-30 12:51:38 +11:00
6250a8725e Cleanup: Use an enum to set instanced panel expansion
This commit uses an enum to access expansion for specific panels for
each modifier, constraint, etc. Even though these values are quite simple,
 this can help make the code more explicit when the ui_expand_flag is
accessed directly. Also update comments about this bitfield to make
them consistent.
2020-10-29 19:34:29 -05:00
81a0fffb2d Fix T82205: Curve Hooks not working
Caused by my own cleanup commit rBa308607a5334. Just a simple copy-paste
error. Here the difference between `curve` and `editnurb` makes quite a bit
of difference.
2020-10-29 18:21:48 -05:00
d35cd32d56 Cleanup: Use doxygen sections
After the changes in D7997, this whole file will use doxygen sections.
2020-10-29 17:37:44 -05:00
e997eb8bf7 GPencil: Fix compiler warnings
These warnings were not vivible in MSVSC
2020-10-29 23:32:19 +01:00
9e85812acc Fix macOS mouse positions inaccuracy
Don't use the current mouse position at the time the event is handled, but
rather the position at the time of the event. This should make e.g. brush
stroke paths more accurate.

In addition, this may solve issues with other software that does mouse
position smoothing. Ref T82143.

Use of the current mouse position was added in 12b642062c as part of a
large commit that also made continuous grab work. But it appears to still
work getting the mouse position from the event.
2020-10-29 22:28:28 +01:00
21f201e25e GPencil: Improve join operator
Now the strokes join the points near, not always end with start.

Differential Revision: https://developer.blender.org/D9359
2020-10-29 20:15:00 +01:00
b85504337e Refactor: move Collection .blend I/O to IDTypeInfo callbacks
This one was a bit more tricky, because the file loading is
mixed with versioning code and because collections are
embedded into scenes.

All tests that passed before, still pass.
2020-10-29 19:34:15 +01:00
7bf0682aa9 GPencil: Add interpolate operators in Draw mode
Now the interpolate is available in draw mode (except the option of selected strokes).

Differential Revision: https://developer.blender.org/D9325
2020-10-29 19:22:42 +01:00
4a8146eb8f Cycles: silence unused variable warning 2020-10-29 18:33:29 +01:00
d9b22b8094 Merge branch 'blender-v2.91-release' 2020-10-29 17:41:46 +01:00
8c3d42bd0f Fix T82129: Cycles "Persistent Images" incorrectly retains scene data
The issue stems from the fact that scene arrays are not cleared when rendering is done. This was not really an issue before the introduction of the ownership system (rB429afe0c626a) as the id_map would recreate scene data arrays based on their new content. However, now that the id_maps do not have access to the scene data anymore the arrays are never created.

Another related issue is that the BlenderSync instance is never freed when the persistent data option is activated.

To fix this, we delete nodes created by the id_maps in their destructors, and delete the BlenderSync instance before creating a new one, so the id_maps destructors are actually called.

Reviewed By: brecht

Maniphest Tasks: T82129

Differential Revision: https://developer.blender.org/D9378
2020-10-29 17:39:21 +01:00
4bf565460d Merge branch 'blender-v2.91-release' 2020-10-29 17:27:21 +01:00
2e41db5277 Fix Zoom to Mouse Position ignored when zooming out
Own mistake in rB3a1cf838ca09. Thanks to @jenkm for pointing this out.
2020-10-29 17:24:34 +01:00
Yevgeny Makarov
dfc576426b Allow Trackpad Ctrl-Pan to Cycle Enum Values
Allow Trackpad Ctrl-Pan to cycle enum values. Also allows cycling in more button types.

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

Reviewed by Brecht Van Lommel
2020-10-29 09:03:49 -07:00
c26ad42ea4 Simplify and enable NanoVDB dependency installation
Changes NanoVDB to be a standalone dependency that is independent of the OpenVDB one.
It works by downloading the "feature/nanovdb" branch of OpenVDB, but using the NanoVDB
CMake in the "nanovdb" subdirectory. Since it is header-only, only the install target is used.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D9383
2020-10-29 17:02:12 +01:00
Yevgeny Makarov
c1b30e0ed1 Fix for T78211: Trackpad Zoom to Mouse Position Error
When using a trackpad Zoom to Mouse Position would always zoom to center of canvas.

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

Reviewed by Brecht Van Lommel
2020-10-29 08:27:48 -07:00
Yevgeny Makarov
962a0a6c66 Allow Building Without UI_PROP_DECORATE
Allow project to build without definition of optional UI_PROP_DECORATE.

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

Reviewed by Julian Eisel
2020-10-29 08:16:34 -07:00
f75b09e7e6 Cycles: abort rendering when --cycles-device not found
Rather than just printing a message and falling back to the CPU. For render
farms it's better to avoid a potentially slow render on the CPU if the intent
was to render on the GPU.

Ref T82193, D9086
2020-10-29 16:01:38 +01:00
09be2a8358 BLI: use forwarding reference in Map
The is necessary when Map.add_or_modify is called with callbacks that
return a reference.
2020-10-29 15:19:43 +01:00
569b7c2821 Cleanup: remove unused Blender Internal render stats code 2020-10-29 14:23:06 +01:00
f4e8c0c104 Anim UI: Playback Sync menu improvement
Relabel the Playback Synchronisation menu so that it's clear:
- what does happen (instead of describing what does //not// happen), and
- that the synchronisation options don't just affect audio.

The changes are:
- Change label from "Audio" to "Sync"
- Change the labels of the sync enum:
    - No Sync → Play Every Frame
    - Frame Dropping stays the same
    - AV-sync → Sync to Audio

The "Audio" label has moved one option down, as that option does
actually relate to audio.

Reviewed By: looch, Severin, HooglyBoogly, campbellbarton

Differential Revision: https://developer.blender.org/D9269
2020-10-29 12:31:53 +01:00
b866100c1f Cleanup: spelling 2020-10-29 21:38:40 +11:00
Yevgeny Makarov
d26b746e36 UI: use "Save As" when saving un-saved image/text files
Now the behaviors are consistent for blend, image and text files:

- If the file is not writable, will report it.
- If the file is new (without a path), save as will be used.
- If the file was deleted, will try to recreate it.

Ref D6755
2020-10-29 21:11:23 +11:00
Ivan Perevala
cf78053027 Libmv: Fix clang inconsistent-missing-override warnings.
Reviewed By: sergey, ankitm

Differential Revision: https://developer.blender.org/D9377
2020-10-29 10:19:50 +01:00
e652ea5ab3 Merge branch 'blender-v2.91-release' 2020-10-29 10:05:29 +01:00
ee4cdef4e3 RNA properties subtypes enum: sync definitions everywhere
Some subtypes never made it to all neccessary places when they were
introduced. This was throwing warnings when accessing such a properties
subtype from python.

The sub_type enums were also defined in 4 different places:
- RNA_types.h 'PropertySubType'
- rna_rna.c 'rna_enum_property_subtype_items'
- rna_rna.c 'subtype_items'
- bpy_props.c as multiple enums

This patch syncs the definitions across all places so that they are the
same everywhere. It also looks redundant to define these twice in
rna_rna.c, now just use 'rna_enum_property_subtype_items' there (and get
rid off 'subtype_items').

Also moved 'POWER' & 'TEMPERATURE' to number enum in bpy_props (these
were defined in the array enum).

Fixes T82167.

Maniphest Tasks: T82167

Differential Revision: https://developer.blender.org/D9371
2020-10-29 10:03:56 +01:00
440ed3ade8 Fix T82188: Sculpt Grab Silhouette and symmetry fails
Wasnt checking the symmetrized 'grab_delta_symmetry' so result could
flip around.

Maniphest Tasks: T82188

Differential Revision: https://developer.blender.org/D9373
2020-10-29 09:47:05 +01:00
110d6a5130 Merge branch 'blender-v2.91-release' 2020-10-29 09:45:28 +01:00
3fc97727df CustomData color copying: use interpolated alpha
The alpha of the first layer was always used
here since introduction in rBee4453f08369 and was not updated when
customdata support for alpha was added.

Now also use the interpolated alpha.

thx @brecht noticing!

ref T81914

Reviewers: brecht, mont29

Maniphest Tasks: T81914

Differential Revision: https://developer.blender.org/D9358
2020-10-29 09:41:26 +01:00
6a5d2f4ea2 Fix blend_color_interpolate_byte returning wrong alpha in certain case
When the combined alpha [the 'tmp' variable having the mixfactor applied
already] - reached zero it was handled like a no-op (for the alpha as
well) and just copied the first color.

So e.g mixing 255/255/255/255 with 0/0/0/0 with a factor of 1.0 gave
alpha of 255, which looks wrong.

cases where tmp gets zero:
src1 alpha:0 src2 alpha:whatever mixfactor 0.0
src1 alpha:whatever src2 alpha:0 mixfactor 1.0
src1 alpha:0 src2 alpha:0 mixfactor whatever

Now set alpha to zero in that case.

ref T81914

Maniphest Tasks: T81914

Differential Revision: https://developer.blender.org/D9357
2020-10-29 09:27:10 +01:00
e78ded8b0f Merge branch 'blender-v2.91-release' 2020-10-29 13:15:49 +11:00
Erik Abrahamsson
01d02e78b5 Fix 3D smooth-view ignoring lens when exiting camera view
Add NULL checks for `sview->ofs`, while it's currently never NULL
when a camera is set. The API allows for each member
to be set independently.
2020-10-29 12:45:52 +11:00
83f369a0b9 Merge branch 'blender-v2.91-release' 2020-10-29 11:29:13 +11:00
52b38d9c3d PyAPI: point sys.executable to the Python binary
`sys.executable` is documented to be a Python interpreter or None.

This was set to Blender's executable which caused the multiprocessing
module to spawn new instances of Blender instead of Python on WIN32.
See issue described in D7815.

Deprecate 'bpy.app.binary_path_python' & warn when using.

Blender's executable remains accessible via `bpy.app.binary_path`.

Modified 04c5471cee, setting `sys.executable` instead of using
Py_SetProgramName, which is needed for a bundled Python installation.
2020-10-29 11:22:39 +11:00
Yevgeny Makarov
cac8a7cddb Fix for T65714: Pinch Zooming Crash using Mac Trackpad
Ensure that Zoom does not crash on Mac Trackpad by checking for existence of Continuous Zoom timer.

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

Reviewed by Julian Eisel
2020-10-28 16:40:28 -07:00
Yevgeny Makarov
b0a9a04f62 UI: Improvements to Close File Dialog
Improved alignment of items on the File Close Dialog.

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

Reviewed by Hans Goudey
2020-10-28 16:22:37 -07:00
Yevgeny Makarov
6bf043ac94 UI: Improved alignment of labels and buttons
Improved alignment of labels with other buttons.

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

Reviewed by Julian Eisel
2020-10-28 16:01:51 -07:00
d32188b85b Mesh: Fix BKE_mesh_translate changes referenced layer
This is the same fix that is implemented in rB3791dbea1e79.
2020-10-28 20:15:50 +01:00
911f9e00d1 Animation: Improve labels on Snap menu in NLA & Dopesheet
Add "Selection to" as prefix for those menu items that move the selected
keyframes to something, for both the Key → Snap menu and the Shift+S pie
menu.

No functional changes.

This was missed in rB477d983c2e8ab298cbf638d5aadd77fad9c2f677

Differential Revision: https://developer.blender.org/D9304
2020-10-28 14:06:26 -04:00
0e47e57eb7 Outliner: Properties editor sync on selection
When outliner datablocks are selected, switch to the corresponding tab
for that datablock in properties editors. Only properties editors
that share an edge with the outliner will change tabs.

Additionally, when modifiers, constraints, and shader effects are
selected from the outliner, the panel will be expanded in all properties
editors.

Part of T77408

Manifest Task: https://developer.blender.org/T63991

Differential Revision: https://developer.blender.org/D8638
2020-10-28 11:54:29 -06:00
Yevgeny Makarov
5af8fc8192 UI: Improved Checkbox Width Calculation
Improved calculation of checkbox width to include line width preference.

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

Reviewed by Hans Goudey
2020-10-28 10:21:18 -07:00
Yevgeny Makarov
f7e4b209e2 UI: Misc Label and Description Changes
Various changes to some labels and descriptions to be more accurate, clear, or less confusing.

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

Reviewed by Hans Goudey
2020-10-28 10:10:41 -07:00
9f8acce3ab Cleanup: name parameters instead of commenting them.
It generates warning C4138 in MSVC:
> '*/' found outside of comment

Old code added in {rBafd13710b897}
2020-10-28 21:48:33 +05:30
Yevgeny Makarov
683dc71c3c UI: Improve Text on 'Color Grid' Image
Change the sequence of characters shown on the 'Color Grid' generated image.

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

Reviewed by Hans Goudey
2020-10-28 09:03:42 -07:00
Yevgeny Makarov
1ebb7afe1d UI: Popover Position Change
Move popover down a very slight amount to fix clipping of its arrow tip.

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

Reviewed by Julian Eisel
2020-10-28 08:53:41 -07:00
8c04337231 Merge branch 'blender-v2.91-release' into master 2020-10-28 21:18:55 +05:30
30ec0753c7 Revert "Fix T81077 id_management test on macOS"
This reverts commit 2ddecfffc3.

The correct fix is to compile with -fno-strict-aliasing on
release/relwithdebinfo builds also.

See the last commit/ {D9372}.

Maniphest Task T81077
2020-10-28 20:54:10 +05:30
fc6a1f44d2 macOS: use -fno-strict-aliasing for all build types.
The old code was added in {rBbaa4a9c7d4dd}

While the hotfix committed in {rB2ddecfffc3d3a3a1db4ae45e8665ca} fixed
the id_management test, the correct reason was found at
https://bugs.llvm.org/show_bug.cgi?id=47984

This matches the behavior on Linux.
2020-10-28 20:53:32 +05:30
a087196a45 GPencil: Change trace tooltip for Threshold 2020-10-28 16:07:33 +01:00
abdd0198c0 GPencil: Change Trace tooltips 2020-10-28 15:41:16 +01:00
a5d237ac85 GPencil: New support to trace sequence images
Now it's possible to trace a sequence of images and not just a single one

When the trace is for more than one image, a bacth job is started to process all frames.

Note: All trace data is generated by Potrace library.

Differential revision: https://developer.blender.org/D9316
2020-10-28 15:36:01 +01:00
73378c2ba2 BLI: improve Map.add_new
Now it is possible to use Map.add_new_as which supports different types
for the key and value.
2020-10-28 13:57:53 +01:00
322b6ac52b UI: Save Preferences Button Not Translating
Ref D9338
2020-10-28 23:04:50 +11:00
4921b5d1c9 UI: Save Preferences Button Not Translating
Ref D9338
2020-10-28 22:57:54 +11:00
70040e7b0b Cycles: internal support for alpha output for attribute node
Not exposed in Blender yet.

Ref D2057
2020-10-28 12:43:42 +01:00
b7558e3c9c Cycles: internal support for per-instance and per-geometry attributes
The existing code for this was incomplete. Each instance can now have a set
of attributes stored separately from geometry attributes. Geometry attributes
take precedence over instance attributes.

Ref D2057
2020-10-28 12:43:42 +01:00
0767683496 Cycles: refactor to make attribute lookup slightly more efficient
Ref D2057
2020-10-28 12:43:42 +01:00
d58b55b55a Cycles: internal support for float4 geometry attributes
Previously only float3 and byte4 was supported.

Ref D2057
2020-10-28 12:43:42 +01:00
ee6b989f8e Cycles: refactor to split surface and volume attribute lookup more
This avoids OpenCL inlining heavy volume interpolation code once for every
data type, which could cause a performance regression when we add a float4
data type in the next commit.

Ref D2057
2020-10-28 12:43:42 +01:00
fb88d4eda8 Add a Un-Bake FCurves operator
We already had the ability to bake fcurves but no way to convert the
baked result back without using python. This patch adds and operator
that is available now next to the bake operator in the drop down menu,

Reviewed By: Sybren

Differential Revision: http://developer.blender.org/D6379
2020-10-28 11:45:24 +01:00
2f7c6149fc Merge branch 'blender-v2.91-release' into master 2020-10-28 11:08:42 +01:00
Bastien Montagne
0d772221c6 Fix T82149: Blender crash when using collection user_id remapping (python).
Not sure why Collection was the only ID for which depsgraph building did
not check for potential recursion?

Reviewed By: sergey

Maniphest Tasks: T82149

Differential Revision: https://developer.blender.org/D9365
2020-10-28 11:05:25 +01:00
2468635174 Tracking: Move optical center to lens panel
Optical center is in fact a property of lens rather than a camera body.
2020-10-28 10:39:37 +01:00
0269f0c574 Tracking: Simplify configuration of intrinsics to refine
Previously, only predefined and limited set of intrinsics combinations
could have been refined. This was caused by a bundle adjustment library
used in the early days of the solver.

Now it is possible to fully customize which intrinsics are to be refined
during camera solving. Internally solver supports per-parameter settings
but in the interface they are grouped as following:

* Focal length
* Optical center
* Radial distortion coefficients (which includes k1, k2, k3, k4)
* Tangential distortion coefficients (which includes p1, p2)

Differential Revision: https://developer.blender.org/D9294
2020-10-28 10:21:07 +01:00
1b1f46a98c Libmv: Fix typo in packed intrinsics
Was using doing an implicit cast of floating point value to boolean.
Was not noticed before because the boolean value was never never used.
2020-10-28 10:13:08 +01:00
283c7fecf9 Tracking: Decouple refine settings
Historically the refine options had a hardcoded list of possibilities.
This was caused by an old bundle adjustment code which did not support
all possible combinations.

Now the bundle adjuster is based on Ceres solver, allowing to refine
anything in any combination.
2020-10-28 10:13:08 +01:00
02ecf29d05 Merge branch 'blender-v2.91-release' 2020-10-28 19:43:58 +11:00
a8ca79cbe6 Revert "PyAPI: point sys.executable to the Python binary"
This reverts commit 04c5471cee.

This causes Blender not to start on some systems.
2020-10-28 19:40:52 +11:00
6527a14cd2 PyAPI: remove bpy.app.binary_path_python
This is deprecated in 2.91,
remove for 2.92 in favor of 'sys.executable'.
2020-10-28 17:40:07 +11:00
fb3f0d3cf0 Merge branch 'blender-v2.91-release' 2020-10-28 17:33:17 +11:00
4f24808d08 Fix T82049: material select button now only works for active object
Include edit-mode objects from space-properties context
unless there is a pinned object.

Regression caused by change in 12bc34b0b8.
2020-10-28 17:30:12 +11:00
1be819ea66 Cleanup: update comments
Some references to argument levels were still in comments.
2020-10-28 16:00:26 +11:00
a0f2866a8e Cleanup: update old comment for why we can't use PySys_SetArgv 2020-10-28 14:04:44 +11:00
58fc155976 Cleanup: move WM_init & arg parsing out of if/else branch 2020-10-28 14:04:44 +11:00
6445caa9b5 BLI_args: disallow zero to be used as a pass value
Introduced recently in 09139e41ed.
While this worked in the cases it was used, '--threads' for example
was failing to parse the number when it's pass was set to 0.

Increase the enum values to start at 1 &
add asserts so this wont happen again.
2020-10-28 14:04:44 +11:00
c518cd73cd Cleanup: use enum for command line argument passes 2020-10-28 14:04:44 +11:00
6ac46c9708 BLI_args: refactor argument passes
Avoid passing the pass argument to BLI_argsAdd, instead set this
once for each group of passes.

This means we can add new passes without having to bump the arguments
to BLI_argsAdd.
2020-10-28 14:04:41 +11:00
5711b85147 Cleanup: Remove unused IDProperty function
This function from 2017 came with a comment: "TODO Nuke this once its
only user has been correctly converted to use generic IDmanagement"
Since it is unused after rB91462fbb31ba, now is time to remove it.

Differential Revision: https://developer.blender.org/D9368
2020-10-27 20:12:42 -05:00
9dac5456b9 Merge branch 'blender-v2.91-release' 2020-10-28 11:52:15 +11:00
04c5471cee PyAPI: point sys.executable to the Python binary
`sys.executable` is documented to be a Python interpreter or None.

This was set to Blender's executable which caused the multiprocessing
module to spawn new instances of Blender instead of Python on WIN32.
See issue described in D7815.

Deprecate 'bpy.app.binary_path_python' & warn when using.

Blender's executable remains accessible via `bpy.app.binary_path`.
2020-10-28 11:49:29 +11:00
Yevgeny Makarov
d28676d89a UI: Move the 'Resolve Conflict' button closer to the text data-block
Moves the Text Editor 'Resolve Conflict' button closer to data-block selector and with 'Question' icon.

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

Reviewed by Hans Goudey
2020-10-27 16:30:37 -07:00
024b65b5e5 Cleanup: Update comment
This comment has to be updated since it was moved
from the header file to the source file.
2020-10-27 17:14:40 -05:00
1504ed99e6 Fix use after free in interface handler
ASAN reported a use after free in after rB15d78ea85b602c. This commit
removed a reassignment of the `data` variable here that was actually
required because it may have been freed earlier in the function. This
sort of error would be avoided if the same variable wasn't reused for
different purposes.
2020-10-27 13:44:47 -05:00
c80594f57f GPencil: New parameter in Texture modifier to rotate Dot textures
This new parameter allows to rotate the texture of any Dot or Square stroke.

Differential Revision:  https://developer.blender.org/D9343
2020-10-27 17:59:48 +01:00
3a7a936525 Merge branch 'blender-v2.91-release' 2020-10-27 17:39:59 +01:00
bee5921e82 GPencil: Fix unreported Fill when use boundary and Visble layers
The new option to filter the layers used by the Fill tool was not using the boundary strokes. The problem was the layers were skipped and any boundary stroke was not used.

Now, the layer is not skipped, but the strokes that are not boundary are skipped.
2020-10-27 17:38:44 +01:00
471c0bcd44 git blame: add file to help ignore cleanup commits
wiki.blender.org/wiki/Tools/Git#Tips has been updated.

A follow up to
lists.blender.org/pipermail/bf-committers/2020-October/050698.html
will be sent after commit.

Reviewed By: brecht, campbellbarton

Differential Revision: https://developer.blender.org/D9234
2020-10-27 20:20:39 +05:30
90e12e823f Fix T81854: crash when undoing switch between sculpt and edit mode.
The logic of `BKE_sculpt_update_object_for_edit` was not correct. such
low-level functions should typically never preform depsgraph evaluation
themselves, they should be able to rely on getting a fully evaluated
depsgraph and just get needed data from there.

Supporting that required fixing other broken code higher in the
callstack, namely:
* `ED_object_sculptmode_enter_ex` was freeing evaluated data, for no
  valid reason it would seem.
* `sculpt_undosys_step_decode` was ensuring an evaluated depsgraph
  **before** calling `ED_object_mode_generic_exit`, which would
  invalidate a lot of evaluated data.

Note that it is fairly difficult to track down all code paths leading to
`BKE_sculpt_update_object_for_edit`, so there may be still cases where
this gets called with improperly evaluated depsgraph.

Reviewed By: sergey

Maniphest Tasks: T81854

Differential Revision: https://developer.blender.org/D9270
2020-10-27 15:27:07 +01:00
f6990c235a Merge branch 'blender-v2.91-release' 2020-10-27 15:13:39 +01:00
4975aa410c Fix T81844: Change Bone Layers fails in Pose Mode
When selecting multiple layers, the redo operator might not correctly
update the pose data. To make sure it is in a good state we have to
ensure that the pose data is good.

Reviewed By: Bastien

Differential Revision: http://developer.blender.org/D9354
2020-10-27 15:10:44 +01:00
4b188bb08c Cleanup: use over-line for doxy comments
Follow our code style for doxygen sections.
2020-10-27 21:45:55 +11:00
30f626fe4c Revert "Cycles API: encapsulate Node socket members"
This reverts commit 527f8b32b3. It is causing
motion blur test failures and crashes in some renders, reverting until this is
fixed.
2020-10-27 11:40:42 +01:00
17381c7b90 Multires: Remove simple subdivision type
The simple subdivision as a type only causes issues like no-continuous
normals across edges, inability to reliably switch the type and things
like this.

The new subdivision operators supports wider variety of how to add
details to the model, which are more powerful than a single one-time
decision on the subdivision type.

The versioning code is adjusting topology converter to specify all
edges as infinitely sharp. The reason for this (instead of using
settings.is_simple) is because in a longer term the simple subdivision
will be removed from Subsurf modifier as well, and will be replaced
with more efficient bmesh-based modifier.

This is finished up version of D8436.

Differential Revision: https://developer.blender.org/D9350
2020-10-27 10:31:48 +01:00
09139e41ed Cleanup: simplify order of initialization with argument parsing
Sub-systems that use directories from BKE_appdir needed to be
initialized after parsing '--env-system-datafiles'.

This meant the animation player needed to call IMB_init it's self.

Avoid this complication by having a pass that can be used to setup
the environment before Blender's resources are accessed.

This reverts the workaround from 9ea345d1cf
2020-10-27 18:45:42 +11:00
Ivan Perevala
eebe274312 RNA: remove duplicate of Brush.tex_paint_map_mode
Use Brush.map_mode instead.

Ref D9290
2020-10-27 17:38:29 +11:00
4d15f4ac5b Cleanup: Use const for PointCloud variable 2020-10-26 23:12:22 -05:00
c686951233 Cleanup: improve comment about shape keys, correct spelling 2020-10-27 14:16:26 +11:00
6133159311 Merge branch 'blender-v2.91-release' 2020-10-27 14:13:39 +11:00
5e8c135540 Merge branch 'blender-v2.91-release' 2020-10-27 14:13:35 +11:00
Erik Abrahamsson
77a6b6fb1a Fix T80819: Border zoom is isn't accurate in perspective view
Improved user experience by using viewport focal length
to calculate the new camera distance.

Also resizing the border to the same aspect ratio as
the window will help not zooming in more than expected.

Ref D9341
2020-10-27 14:10:58 +11:00
66800a1deb BLI_rect: add resize_x/y functions
Without this, it's inconvenient to resize a single axis
and doesn't read very well.
2020-10-27 14:07:34 +11:00
Erik Abrahamsson
716af6a470 Modifier: apply modifier now works for lattice
Ref D9337
2020-10-27 13:27:08 +11:00
527f8b32b3 Cycles API: encapsulate Node socket members
This encapsulates Node socket members behind a set of specific methods;
as such it is no longer possible to directly access Node class members
from exporters and parts of Cycles.

The methods are defined via the NODE_SOCKET_API macros in `graph/
node.h`, and are for getting or setting a specific socket's value, as
well as querying or modifying the state of its update flag.

The setters will check whether the value has changed and tag the socket
as modified appropriately. This will let us know how a Node has changed
and what to update, which is the first concrete step toward a more
granular scene update system.

Since the setters will tag the Node sockets as modified when passed
different data, this patch also removes the various `modified` methods
on Nodes in favor of `Node::is_modified` which checks the sockets'
update flags status.

Reviewed By: brecht

Maniphest Tasks: T79174

Differential Revision: https://developer.blender.org/D8544
2020-10-26 23:11:14 +01:00
Pablo Dobarro
d6180dd2f7 Sculpt/Paint: Add Paint Studio Light preset
This studio light preset is designed for color painting tasks. As color
are multiplied on top of the current studio light/matcap, this should be
as white as possible and with very soft speculars to avoid color
distorsion while showing the volume of the mesh.

Reviewed By: jbakker, JulienKaspar

Differential Revision: https://developer.blender.org/D8209
2020-10-26 20:35:37 +01:00
45e8218f90 Merge branch 'blender-v2.91-release' into master 2020-10-26 18:35:34 +01:00
edf4378c44 Fix own previous commit re testing of BLI_rel_path.
Windows would need its own version of those tests, for now just
disabling them on that platform.
2020-10-26 18:29:54 +01:00
183c2fe031 Merge branch 'blender-v2.91-release' into master 2020-10-26 17:37:16 +01:00
01d3fbc496 Fix T81421: "Saving As..." a blend file with a Script node file path filled with 1023 symbols crashes Blender.
Usual lack of protection against buffer overflows when manipulating
strings.

Also add some basic tests for `BLI_path_rel`.
2020-10-26 17:36:53 +01:00
501854e4ee Fix T81421: "Saving As..." a blend file with a Script node file path filled with 1023 symbols crashes Blender.
Usual lack of protection against buffer overflows when manipulating
strings.

Also add some basic tests for `BLI_path_rel`.
2020-10-26 17:22:34 +01:00
253ae3d3f0 Merge branch 'blender-v2.91-release' 2020-10-26 16:33:54 +01:00
47eabae951 UI: Datatransfer modifier: set mix factor inactive when not in use
For Customdata layer copying, interpolation with the mixfactor is only
done for certain mix modes, now set the UI inactive if the mixfactor is
not in use.

Namely, the modes are the "Above / Below Threshold" which are only used
for flags, colors and normals and mixing is not supported in these cases.

Spotted while looking into T81914.

Differential Revision: https://developer.blender.org/D9327
2020-10-26 16:24:22 +01:00
841eaebfa4 Cycles: Add support for OptiX 7.2 SDK 2020-10-26 15:43:55 +01:00
9d24d1b20c Merge branch 'blender-v2.91-release' 2020-10-26 14:34:03 +01:00
5365409ec0 Fix T82079: Missing viewport redraw changing volume slicing axis
Send appropriate notifiers (via rna_Volume_update_display).

Maniphest Tasks: T82079

Differential Revision: https://developer.blender.org/D9351
2020-10-26 14:31:30 +01:00
786e160aff Merge remote-tracking branch 'origin/blender-v2.91-release' 2020-10-26 13:52:36 +01:00
8a51178df9 Fix: Animation, Draw active keyframe handles only when Bézier
Draw the handles for the active keyframe only when the interpolation type
is set to Bézier. This now matches the behaviour of handles of regular
(non-active) keyframes.
2020-10-26 13:52:12 +01:00
d62309a20e Fix T81890: Active keyframe changes on deselect of keyframe
Activate an FCurve only on selecting, and not on deselecting a keyframe
or a handle.

Reviewed By: HooglyBoogly, Severin, looch, #animation_rigging

Differential Revision: https://developer.blender.org/D9328
2020-10-26 13:52:12 +01:00
4d5e0a8520 Merge branch 'blender-v2.91-release' 2020-10-26 13:07:00 +01:00
Philipp Oeser
f76f48c3d3 Fix T69911: Adaptive subdivision offscreen dicing does not work correctly if the camera is shifted
Code was assuming frustrum planes are symmetrical which is not the case
for shifting. This lead to a shrinking region if shift was negative (and
a growing region if shift was positive)

So instead of only keeping track of plane on one side (and mirroring
over in code) get the actual planes after shifting and use these
instead.

This code corrects this for ortho and perspective cameras, it does not
touch panoramic cameras.

Reviewed By: brecht

Maniphest Tasks: T69911

Differential Revision: https://developer.blender.org/D9342
2020-10-26 12:52:25 +01:00
ae5fd92228 Fix T81893: Cycles viewport crash changing mesh to smoke domain
Now that volume is a dedicated geometry type in Cycles, we need to re-allocate
the geometry when a mesh changes into a volume.
2020-10-26 12:31:01 +01:00
6fc0d743f1 Cleanup: compiler warnings 2020-10-26 12:31:01 +01:00
57fc44de6c Merge branch 'blender-v2.91-release' 2020-10-26 22:06:57 +11:00
9969c2dd16 Fix custom-normal support for mesh editing operations
Account for custom normals for edit-mesh tools:

- Limited Dissolve
- Split
- Split (Edges/Vertices)
- Triangulate
2020-10-26 22:02:31 +11:00
a207fb7ea7 Merge branch 'blender-v2.91-release' into master
Conflicts:
	source/blender/blenkernel/intern/armature.c
2020-10-26 11:29:20 +01:00
25c3a2e42d Proper, cleaner fix for T81963: Random rare crashes in override code.
Use new `BKE_pose_ensure` utils, and do so for reference linked object
too everywhere.
2020-10-26 11:26:55 +01:00
fff08e81ea Pose: Add a 'pose_ensure' new utils that only rebuilds if needed.
Avoids having to spread the check logic everywhere in the code.
2020-10-26 11:26:55 +01:00
19f74e4022 Merge branch 'blender-v2.91-release' 2020-10-26 21:10:33 +11:00
Ryan Inch
cf6c076046 Fix T82077: Tools popup error in the image editor
Add check for an image space type.

Ref D9347
2020-10-26 21:08:34 +11:00
38ba8a441f Merge branch 'blender-v2.91-release' 2020-10-26 11:03:30 +01:00
Jeroen Bakker
042143440d LatticeDeform: Performance
This patch improves the single core performance of the lattice deform.

1. Prefetching deform vert during initialization. This data is constant for
   each innerloop. This reduces the complexity of the inner loop what makes
   more CPU resources free for other optimizations.
2. Prefetching the Lattice instance. It was constant. Although performance
   wise this isn't noticeable it is always good to free some space in the
   branch prediction tables.
3. Remove branching in all loops by not exiting when the effect of the loop
   isn't there. The checks in the inner loops detected if this loop didn't
   have any effect on the final result and then continue to the next loop.
   This made the branch prediction unpredictable and a lot of mis
   predictions were done. For smaller inner loops it is always better
   to remove unpredictable if statements by using branchless code patterns.
4. Use SSE2 instruction when available.

This gives 50% performance increase measured on a
Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz with GCC 9.3.
Also check other compilers.

Before:
```
performance_no_dvert_10000 (4 ms)
performance_no_dvert_100000 (30 ms)
performance_no_dvert_1000000 (268 ms)
performance_no_dvert_10000000 (2637 ms)
```

After:
```
performance_no_dvert_10000 (3 ms)
performance_no_dvert_100000 (21 ms)
performance_no_dvert_1000000 (180 ms)
performance_no_dvert_10000000 (1756 ms)
```

Reviewed By: Campbell Barton

Differential Revision: https://developer.blender.org/D9087
2020-10-26 11:02:03 +01:00
336a675c64 Merge branch 'blender-v2.91-release' into master 2020-10-26 15:06:55 +05:30
2ddecfffc3 Fix T81077 id_management test on macOS
This looks like a optimizer bug where it makes wrong assumptions.
The code inside lib_id_delete:264 on rBafd13710b897cc1c11b
`for (id = last_remapped_id->next; id; id = id->next) {..}`
is not executed in release/relwithdebinfo builds.

This can be "fixed" by several ways:
- Adding a line that prints the `last_remapped_id->name` right before
  the said for-loop starts.
- Turning off optimization for the whole function `id_delete`:
  `#pragma clang optimize off/on` Ray Molenkamp
- Marking `last_remapped_id` volatile. Julian Eisel
- Marking `tagged_deleted_ids` volatile. But it adds a warning when
  calling `BLI_addtail`: discards volatile qualifier. Discovered by
  accident.

Fix T81077

Reviewed By: mont29

Maniphest Tasks: T81077

Differential Revision: https://developer.blender.org/D9315
2020-10-26 15:02:20 +05:30
2c024bd335 Merge branch 'blender-v2.91-release' into master 2020-10-26 09:52:37 +01:00
4b7abde11d Fix T81963: Random rare crashes in override code.
Finaly managed to reproduce, we not only have to ensure pose data is up
to date for the override armature, but also for the reference linked
data.
2020-10-26 09:51:49 +01:00
cd16a5cea8 Merge branch 'blender-v2.91-release' into master 2020-10-26 09:17:06 +01:00
81462f86bc Fix T81984: Crash in sculpt undo with mask extract after dyntopo toggle
More operators missing the mandatory undo flag...
2020-10-26 09:16:33 +01:00
e4facbbea5 Modifiers: include the object & modifier when logging errors
Without this, there was no way of finding out which object, modifier
combination caused the error, making the logs not very useful
for debugging.
2020-10-26 18:16:30 +11:00
aa77689f77 Keymap: enable repeat for text editing paste operations 2020-10-26 15:59:24 +11:00
4d3a386af2 Cleanup: spelling 2020-10-26 15:59:08 +11:00
6c7f30a6f6 UI: Use property split in vertex paint symmetry panels
Set property split in the higher level panel functions so that it carries
over to buttons added after. Also discard the redundant "Symmetry"
to make sure there is enough space for the checkbox label.
2020-10-25 23:23:38 -05:00
e9d21136ce UI: Fix Symmetry options in weight paint panels
The now redundant "X" checkbox is removed since it's also present in the
Symmetry panel above. The Topology Mirror is moved into the Symmetry
panel also.

This was needed because `Mesh.use_x_mirror` has recently been turned into
different functionality, and its old functionality now lives under
`Mesh.use_mirror_vertex_group_x`. Something went wrong in the UI in This
transition.

Differential Revision: https://developer.blender.org/D9287
2020-10-25 23:16:11 -05:00
3baf65975c Split BKE_sequencer.h intern/extern definitions
Intern definitions are moved to sequencer/intern/sequencer.h

BKE_sequencer.h was also cleaned up a bit to make sure that functions
and structs are in correct category.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9259
2020-10-26 00:47:06 +01:00
bf10a56eea Merge branch 'blender-v2.91-release' 2020-10-26 00:39:30 +01:00
8eb7344731 Fix Recursion when rendering scene strip
Recursion happens in case when scene strip point to it's own scene
indirectly by using SEQ_SCENE_STRIPS option.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9264
2020-10-26 00:31:49 +01:00
3deb4f4cb8 Fix T81426: Infinite loop building VSE relations
It is possible to create scene strips pointing to each other. This is
sanitized when rendering, but in dependency graph such setup will cause
infinite loop.

This patch fixes loop in dependency graph, but same problem exists in
audaspace

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9262
2020-10-26 00:30:27 +01:00
8d1978a8e0 Fix T81250: Crash after undoing with prefetching
Main DB and it's structs can point to different address after undoing.

In this case problem was that bmain was not updated. Same fix was
done for scene as well.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9240
2020-10-26 00:28:54 +01:00
e661df71e6 Merge branch 'blender-v2.91-release' 2020-10-25 23:07:25 +01:00
31629c1363 Fix T81904: Cloth brush simulation failing with local area and mirror
When using local area, all nodes need to build their constraints first
before activating them for simulation. THis ensures that nodes get their
structural constraints from the initial location of each symmetry pass.

Reviewed By: sergey

Maniphest Tasks: T81904

Differential Revision: https://developer.blender.org/D9303
2020-10-25 23:06:16 +01:00
c53b6067fa Sculpt: Implement plane deformation falloff for Grab
The plane deformation falloff was introduced in the first version of the
cloth brush, but due to the lack of all the new features and fixes in the
solver it was causing a lot of artifacts for deformation brushes. In
order to avoid that, the cloth brush was always using radial falloff for
the grab brush.

Now the plane falloff is properly implemented using the deformation
constraints.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9320
2020-10-25 22:59:01 +01:00
0eee384a8d Sculpt: Option to limit the action of line gestures to the segment
This adds a tool property for sculpt line gesture tools (line and
project) to limits its effect to the segment of the gesture instead of
using the infinite line to bisect the mesh in two parts.

To achieve that, the line gesture now has two extra side planes that can
be enabled/disabled for getting the nodes from the PBVH and to test the
vertices.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9307
2020-10-25 22:55:48 +01:00
c15bd1c4e6 Sculpt: Face Set Edit delete Geometry operation
This adds an operation mode to the Face Set Edit tool which deletes the
geometry of a Face Set by clicking on it.
The operator also checks for the mesh having a single Face Set to avoid
deleting the entire object by accident.
This is also disabled for Multires to avoid modifying the limit surface
without control (it is not an important limitation as base meshes for
multires are usually final, but maybe it can be supported in the future).

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8938
2020-10-25 22:52:07 +01:00
1d9499bbbc UI Code Quality: Cleanup ui_but_update_from_old_block
This commit contains some improvements to this function to make this
function more purposeful and readable.
  - Split updating information of the old button to a new function.
  - Remove some 7 year old code disabled with `#if 0`.
  - Add comments explaining some of the less obvious aspects.

Differential Revision: https://developer.blender.org/D9117
2020-10-24 23:58:32 -05:00
76fd84f209 Cleanup: Use LISTBASE_FOREACH in curve code
This is a followup to rBa308607a533, using the macro in a few places
that were missed.
2020-10-24 23:32:11 -05:00
05129bc821 Fix T81999, Boolean Exact+Self Difference fails.
A cell with winding number > 1 for the second operand was incorrectly
included in the output.
2020-10-24 17:44:59 -04:00
1c653a0315 Fix T81999, Boolean Exact+Self Difference fails.
A cell with winding number > 1 for the second operand was incorrectly
included in the output.
2020-10-24 17:36:38 -04:00
2f9068449f Fix T81884, clamping with percent, addendum.
The previous fix forgot the case where there is an intermediate
edge and everything isn't in one plane.
2020-10-24 15:10:19 -04:00
574d711008 Fix T81884, clamping with percent, addendum.
The previous fix forgot the case where there is an intermediate
edge and everything isn't in one plane.

Differential Revision: https://developer.blender.org/D9336
2020-10-24 14:44:28 -04:00
Yevgeny Makarov
622b30225a UI: Capitalization Corrections
Approximately 141 changes of capitalization to conform to MLA title style.

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

Reviewed by Julian Eisel
2020-10-24 11:42:17 -07:00
ca83649b7d Fix T82019 Crash loading 2.78 splash demo.
The versioning code to default to old booleans for old files was
faulty because really old files had a 'solver' field (later removed,
but then added back for new booleans).
2020-10-24 14:07:05 -04:00
bc0a33a812 GPU: Debug: Trim shader stats from output log
We don't make use of it anyway.
2020-10-24 14:07:05 -04:00
0d1f65e516 GPU: Use CLOG to for debug output
This removes the escape color control caracters when the output
does not supports it (i.e: file output, windows cmd).
2020-10-24 14:07:05 -04:00
e856443c99 CLOG: Add getter to know if output supports coloring 2020-10-24 14:07:05 -04:00
b37c40a575 Fix Cycles unnecessary overhead cancelling finished task pool 2020-10-24 14:07:05 -04:00
d65e5e8bc5 Fix T82019 Crash loading 2.78 splash demo.
The versioning code to default to old booleans for old files was
faulty because really old files had a 'solver' field (later removed,
but then added back for new booleans).
2020-10-24 13:53:16 -04:00
594f47ecd2 Cleanup: Return early in some curve functions
This commit uses continue in loops and returning early to reduce
indentation in long functions, only where this results in a significant
improvement. Also includes a few LISTBASE_FOREACH macros.
2020-10-23 23:29:52 -05:00
f32ab724eb Fix for T80679: Incorrect Translation of File Manager System List
Changing language could sometimes leave File Browser System list showing incorrect text until restart.

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

Reviewed by Brecht Van Lommel
2020-10-23 19:07:14 -07:00
3c42892610 GPencil: Minor changes in parameter order
This is related to D9330
2020-10-23 19:44:38 +02:00
69a22afdb6 GPencil: Remove unneeded python for calling Bake Animation
The operator was using a secondary python operator to ask parameters before running, but this can be done in invoke.

Differential Revision: https://developer.blender.org/D9330
2020-10-23 19:39:55 +02:00
70cc0d7121 GPU: Debug: Trim shader stats from output log
We don't make use of it anyway.
2020-10-23 19:33:51 +02:00
a4f883268b GPU: Use CLOG to for debug output
This removes the escape color control caracters when the output
does not supports it (i.e: file output, windows cmd).
2020-10-23 19:33:51 +02:00
8442d6ca8a CLOG: Add getter to know if output supports coloring 2020-10-23 19:33:51 +02:00
23eaf3117c Fix Cycles unnecessary overhead cancelling finished task pool 2020-10-23 19:07:34 +02:00
390b28e338 Merge branch 'blender-v2.91-release' 2020-10-23 18:37:22 +02:00
6d8e03ddd9 Fix T81102: Cycles crashes in interactive 3D viewport rendering after Embree
Don't allocate a new buffer for refitting meshes, but update the existing one.
It's not clear from the API docs if this is required, but it appears to solve
the issue and should be more efficient.
2020-10-23 18:32:22 +02:00
83ddd658a6 Fix T81890: Active keyframe changes on deselect of keyframe
Activate an FCurve only on selecting, and not on deselecting a keyframe
or a handle.

Reviewed By: HooglyBoogly, Severin, looch, #animation_rigging

Differential Revision: https://developer.blender.org/D9328
2020-10-23 17:47:54 +02:00
Olivier Maury
559e87ad08 Fix T81976: Cycles crash after recent geometry sync multithreading change
Avoid accessing mesh emitter and hair at the same time. This is not ideal for
performance, but once we have a dedicated hair object this will resolve itself.

Differential Revision: https://developer.blender.org/D9322
2020-10-23 17:45:11 +02:00
0d1b1c341f Fix: Animation, Draw active keyframe handles only when Bézier
Draw the handles for the active keyframe only when the interpolation type
is set to Bézier. This now matches the behaviour of handles of regular
(non-active) keyframes.
2020-10-23 16:46:19 +02:00
87681f9b5f Cleanup: remove redundant assignment in previous bugfix 2020-10-23 16:32:29 +02:00
50c475e534 Multires: Cleanup, better function naming
Hopefully it makes it more clear, and also allows to introduce
initialization from pre-created Subdiv descriptor.
2020-10-23 16:30:13 +02:00
8186b96753 Fix use of uninitialized line/polygon smooth variables in GPU state
Found by valgrind, unclear if this caused an actual bug.
2020-10-23 15:27:47 +02:00
e4728d0a16 Fluid: Possible fix for T79799
This issue is specific to Windows and should be resolved with the extra checks (untested).
2020-10-23 13:34:02 +02:00
56a3566e64 Merge branch 'blender-v2.91-release' 2020-10-23 09:53:50 +02:00
9441c640c8 Fix T81934: Painting/Sculpting in ortho fails to let strokes pass through clipped geometry
Caused by rB7878adf49cff.

When getting the stroke location via raycast in ortho view, the above
commit flipped the condition of the check to perform adjustments on the
rays start/end. This would thus happen (even though it shouldnt),
resulting in wrong depth and stroke location.

Now just flip the condition back, so adjustments only happen when
clipping is OFF.

Maniphest Tasks: T81934

Differential Revision: https://developer.blender.org/D9318
2020-10-23 09:44:38 +02:00
af661ad75b RNA Manual Map: Update mappings for latest manual 2020-10-23 00:48:24 -04:00
0b4991f5a7 Fix unreported: unmatching shortcut between gp modes
GPencil: Change Interpolate shortcut to Ctrl+E

Before the shortcut was Ctrl+Alt+E, but it's more logic remove the Alt.

This was missed in rBee49ce482a797a5937829de497abd69bcd1edb48
2020-10-22 23:15:46 -04:00
06e6068902 Merge branch 'blender-v2.91-release' 2020-10-23 14:00:28 +11:00
67c7fe6ad6 Fix T80165: Separate by loose parts breaks custom normals
- Add NULL check for BKE_lnor_spacearr_clear
- Remove unnecessary 'use_toolflags' with BMesh creation.
2020-10-23 13:56:55 +11:00
3f12f02bea Merge branch 'blender-v2.91-release' 2020-10-22 22:32:09 -04:00
14a4961490 Fix unreported: unmatching shortcut between gp modes
GPencil: Change Interpolate shortcut to Ctrl+E

Before the shortcut was Ctrl+Alt+E, but it's more logic remove the Alt.

This was missed in rBee49ce482a797a5937829de497abd69bcd1edb48
2020-10-22 22:31:20 -04:00
36e8561298 Fix T81969 VSE: Wrong UI colorspace after scene strip update
This regression was caused by rB57de5686048f which disabled srgb
transform after the python callback.

The right thing to do is to only rebind the framebuffer once to
reset the no-srgb override.
2020-10-23 03:32:51 +02:00
3cc2dc40b3 Fix T81942 EEVEE: Reflection Plane glitch with low clip distances
This was happening because the raytrace was not even being performed
due to the tracing line being too small after frustum clipping.
2020-10-23 02:02:41 +02:00
e58285dc1d Fix T73793 Walk navigation crosshair gets hidden behind objects
This was reintroduced by the wide line emulation workaround.
2020-10-23 02:02:41 +02:00
c6281d5dc7 Cleanup: Use DNA deprecated guards around old flags
These flags shouldn't be used except in versioning code.
2020-10-22 18:37:52 -05:00
165b4f85ec Merge branch 'blender-v2.91-release' 2020-10-22 18:14:14 -05:00
8e060b44da Fix T81818: Outliner mode column crashes with shared object data
For objects with shared data, it makes sense to show the mode icon for
every object sharing the same data if one of them is in edit mode.

This also disables the "extend" functionality in this case, because
being in edit mode for multiple objects with the same data isn't
supported.

Differential Revision: https://developer.blender.org/D9273
2020-10-22 18:13:30 -05:00
ff8ecf105c Merge branch 'blender-v2.91-release' 2020-10-22 17:34:48 -04:00
Aaron Carlisle
baa24f1c91 Pydoc: Fix sphinx compile warnings about freestyle
Sphinx expects functions and methods with the same name and different
parameters to be written using one directive. See:
https://www.sphinx-doc.org/en/master/usage/restructuredtext/domains.html#basic-markup

Unfortunately this makes giving different descriptions for each harder.
This was already a request for better support for this in sphinx, see:
https://github.com/sphinx-doc/sphinx/issues/7787

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D9170
2020-10-22 17:22:05 -04:00
a3f5154448 Cleanup: make format 2020-10-22 17:08:37 -04:00
956af16189 Fix Unreported: Missing box mask in sculpt
There was a weird bug in the API where a value of 0 gave a mask value of 
1. I am not sure why this is but the current code works as desirable.

This was missed in rB6faa765af8954948de3cec75a2261a5aa139b4e5
2020-10-22 16:57:56 -04:00
9b46d3cc80 Merge branch 'blender-v2.91-release' 2020-10-22 16:52:28 -04:00
2261da2897 Fix Unreported: Missing box mask in sculpt
There was a weird bug in the API where a value of 0 gave a mask value of 
1. I am not sure why this is but the current code works as desirable.

This was missed in rB6faa765af8954948de3cec75a2261a5aa139b4e5
2020-10-22 16:51:07 -04:00
7863ded680 Merge branch 'blender-v2.91-release' 2020-10-22 15:47:03 -05:00
3d916c0a96 Cleanup: Simplify outliner mode column drawing function
Move the checks for whether to draw the button to the beginning of the
function and return early. Also use a shorthand variable for ob_active.

Committing to 2.91 as a patch for an upcoming bug fix depends on these
changes.

Differential Revision: https://developer.blender.org/D9272
2020-10-22 15:46:35 -05:00
d453bbbd26 Merge branch 'blender-v2.91-release' 2020-10-22 20:02:09 +02:00
8432452f6f GPencil: Fix unreported crash using layer solo mode and masked layers
The solo mode was skipping the layer creation data and the loop of masks expect to have all layers in the array or the loop crash.

The solution is just create the layer array data for the layer, but don't draw any stroke.
2020-10-22 20:01:39 +02:00
3953833b60 Fix T81967: Crash when using extrude on a text object
Caused by rBa308607a5334, which mistakenly removed these lines.
2020-10-22 12:20:34 -05:00
Pablo Dobarro
383c20a6ab Sculpt: Grab silhouette option
This adds a property to the grab that masks vertices based on its
original normal and grab delta. When used on thin meshes, it allows to
grab the silhouette from one side of the object without affecting the
shape of the other side.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9205
2020-10-22 19:17:07 +02:00
b5169cd230 Fix T81932: Dyntopo crashing with sculpt vertex colors brush tools
Paint and smear tools are only implemented for regular mesh PBVH,
meaning they are not supported by the dynamic topology and multires
sculpting.

These tools are to be ignored for an unsupported sculpt modes, regardless
of state of user preferences.

Reviewed By: sergey

Maniphest Tasks: T81932

Differential Revision: https://developer.blender.org/D9308
2020-10-22 18:22:15 +02:00
e79154de73 Fix build error Python module build and Embree on macOS
Setting the stack size only works for executables, for shared libraries
the host application controls it.
2020-10-22 18:03:18 +02:00
2985a745bb GPencil: Add new parameter to set caps in Cutter
The new parameter allows to define if after cutting the stroke the cap of the cut side will be set as flat. 

Before, the cap shape of the cut side always was equal to the original stroke, and in some situations, the rounded cap was visible.

Note: If the angle of the join is very extreme,  it's still possible to view some sections of the cut stroke.,
2020-10-22 17:44:17 +02:00
90eab4a25d Merge branch 'blender-v2.91-release' 2020-10-22 10:25:44 -05:00
6180ecaea5 Fix T81909: Translation missing for some labels in modifier panels
Every label string in uiItem* calls needs an IFACE_ call.
2020-10-22 10:25:08 -05:00
a8837c6cb0 Merge branch 'blender-v2.91-release' 2020-10-22 17:05:47 +02:00
5b35f1ed2b GPencil: Fix unreported mistake in material index for trace imagens
The material index was not used and only worked with new objects.
2020-10-22 17:05:10 +02:00
cd7354f9f5 Merge branch 'blender-v2.91-release' 2020-10-22 17:02:59 +02:00
73ba3e2a9e Sculpt: Remove tools with missing icons experimental option
All tools planned for 2.91 now have icons, so this option can be
removed.

Reviewed By: dfelinto, Severin

Differential Revision: https://developer.blender.org/D9299
2020-10-22 17:01:16 +02:00
f73dad211b Potential fix for T81963: Random crashes in liboverride code.
From the backtrace it looks like in some cases file save (which triggers
a general override updates) is done before other code has a chance to
re-generate pose data, leading to rna accessing freed memory.

I was never able to reproduce that here, so this is a tentative fix in
master, if it proves to be working for the studio it will be
cherry-picked into 2.91 release branch later.
2020-10-22 15:22:56 +02:00
992a88b38b Pose: Add a 'pose_ensure' new utils that only rebuilds if needed.
Avoids having to spread the check logic everywhere in the code.
2020-10-22 15:22:56 +02:00
658370e9e1 Merge branch 'blender-v2.91-release' 2020-10-22 15:12:30 +02:00
c9550cb120 Fix T81953: Python error in UV Editor Overlay popup
Leftover from rBe05ce1ea2029, 'use_image_editor_legacy_drawing' was
removed.

Maniphest Tasks: T81953

Differential Revision: https://developer.blender.org/D9310
2020-10-22 15:09:32 +02:00
dea3b8d984 Multires: Remove legacy subdivision code
Is no longer used, fully replaced with more powerful algorithm.
2020-10-22 12:41:18 +02:00
107199426c Multires: Cleanup, unused code 2020-10-22 12:28:31 +02:00
d11e357824 Multires: Remove legacy compatibility code
It was rather a huge chunk of code, which started to become
more harder to maintain with the transition to OpenSubdiv based
implementation. Because of this transition, the compatibility was
also rather on a poor side.

Remove compatibility support for pre-2.50.9 multires.

Ref T77107

Reviewed By: brecht, mont29

Differential Revision: https://developer.blender.org/D9238
2020-10-22 12:15:57 +02:00
f68c3d557a Compositor: Ensure keying node result is pre-multiplied
Historically the result of the keying node was violating alpha
pre-multiplication rules in Blender: it was simply overriding
the alpha channel of input.

This change makes it so keying node mixes alpha into the input,
which solves the following issues:

- The result is properly pre-multiplied, no need in separate
  alpha-convert node anymore.

- Allows to more easily stack keying nodes.
  This usecase was never really investigated, but since previously
  alpha is always overwritten it was never possible to easily stack
  nodes. Now it is at something to be tried.

Unfortunately, this breaks compatibility with existing files, where
alpha-convert node is to be manually removed.

From implementation side this is done as a dedicated operation since
there was no ready-to-use operation. Maybe in the future it might
be replaced with some sort of vector math node.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D9211
2020-10-22 11:57:01 +02:00
92571abf56 GPU: Memory leak when scaling buffers
`imb_gpu_get_data` could reuse `data_rect` when it was already in used (double alloc).
making the first use leak. This was detected after enabling OpenGL Texture
Limit.

Reviewed By: Clément Foucault

Differential Revision: https://developer.blender.org/D9280
2020-10-22 10:30:04 +02:00
6c178bf439 Merge branch 'blender-v2.91-release' 2020-10-22 18:48:00 +11:00
cf8642d9fa Fix T81949: Child Of Constraint can't assign inverse matrix
Caused by ad70d4b095, assigning the matrix now
clears the flag that would reset it.
2020-10-22 18:46:31 +11:00
36653a92fa Cleanup: centralize BLF default functions in the header 2020-10-22 17:30:52 +11:00
cf5ae6718c Cleanup: split BLF default into own file
This avoids accidents using user-preferences in the main BLF API,
which could cause preferences to be used unintentionally
(such as stamping into renders or creating generated images).

As well as uses of BLF when preferences aren't loaded
such as animation playback.
2020-10-22 17:24:19 +11:00
fe963b5a41 Merge branch 'blender-v2.91-release' 2020-10-22 17:13:04 +11:00
9ea345d1cf Fix animation player initialization
Updates from 9d30fade3e weren't applied to the animation player
causing an assert and missing call to IMB_init.
2020-10-22 17:07:56 +11:00
d00b1f6313 Merge branch 'blender-v2.91-release' 2020-10-22 16:00:52 +11:00
0c36255c48 Merge branch 'blender-v2.91-release' 2020-10-22 16:00:48 +11:00
ef969fb85f Cleanup: remove '_' prefix from used argument 2020-10-22 15:58:25 +11:00
7ddc49ad34 Fix T81905: Active keyframe unavailable when handle selected
Selecting an F-Curve handle caused an assertion as well as treating
the key-frame as inactive.

Allow active the keyframe to be active when it's handle is selected,
as is done with bezier curves.
2020-10-22 15:55:30 +11:00
a308607a53 Cleanup: Use LISTBASE_FOREACH macro in curve code
These changes should result in more readable and undestandable code,
especially where while loops were use instead of for loops. They are
not comprehensive, and I skipped wherever the change was not obvious.
2020-10-21 23:52:29 -05:00
6ebb2e5e2b Merge branch 'blender-v2.91-release' 2020-10-22 15:28:27 +11:00
c53ac5e1c4 Fix T81939: crash calling bmesh.utils.vert_separate()
Missing NULL check in bmesh_kernel_vert_separate.
2020-10-22 15:26:22 +11:00
608243c79c Merge branch 'blender-v2.91-release' 2020-10-22 14:08:07 +11:00
c70650785b Fix out of bounds array access in mathutils.noise
Regression in 0b2d1badec.
2020-10-22 14:03:00 +11:00
f5080c82dd Keymap: disable 'repeat' by default for keymap items
In practice, there are only a limited number of operations we need to
use repeat such as navigation, stepping operations that cycle states
and text input.

Now we don't need to disable repeat explicitly when a modal operator
uses checks for a key being held as was needed for 17cb2a6da0.

Repeat is now included in exported keymaps.

Use versioning so existing exported keymaps are loaded properly.
2020-10-22 12:29:45 +11:00
358a584985 Keymap: add support for versioning keymaps
Write the Blender version into the keymap
so we can change defaults without breaking existing keymaps.

Based on patch by @erik85 with own additions.
2020-10-22 12:29:42 +11:00
b9c8eb3b0c PyAPI: expose the file version via bpy.app.version_file
This exposes the version saved to the file,
compatible with `bpy.data.version`.

This is needed to write out version information into key-maps.
2020-10-22 12:29:38 +11:00
e9ae8148ae Merge branch 'blender-v2.91-release' 2020-10-22 12:03:53 +11:00
899d6d4db9 Merge branch 'blender-v2.91-release' 2020-10-22 12:03:50 +11:00
37df2ebaa9 Merge branch 'blender-v2.91-release' 2020-10-22 12:03:46 +11:00
cee35b2ca5 Merge branch 'blender-v2.91-release' 2020-10-22 12:03:41 +11:00
d6a43abc3a Merge branch 'blender-v2.91-release' 2020-10-22 12:03:36 +11:00
b632c1e90d Merge branch 'blender-v2.91-release' 2020-10-22 12:03:33 +11:00
ca87f4c45d Merge branch 'blender-v2.91-release' 2020-10-22 12:03:29 +11:00
8da5599003 WM: warn when event's have repeat set for non keyboard events
Also add docs to event and keymap item flag.
2020-10-22 11:59:37 +11:00
88660d67a4 WM: ensure is_repeat isn't set for mouse-move events
Follow up to d782bad62d

Also clear this for simulated events.
2020-10-22 11:59:37 +11:00
cc3fdffbbe DRW: Fix custom engine not being BGL safe
This was caused by unprotected drawing callbacks.
As of 2.91, we require that all python callbacks used for
drawing needs to be safeguarded by `GPU_bgl_end()` to end the
state tracking override.
2020-10-22 01:19:10 +02:00
5a65305f89 Fix T81784 BGL: Gizmo glitch when using glEnable/glDisable
This was caused by unprotected drawing callbacks.
From 2.91, we now require that all python callbacks used for
drawing needs to be safeguarded by `GPU_bgl_end()` to end the
state tracking override.
2020-10-22 01:10:46 +02:00
b0f34eee30 EEVEE: Principle BSDF: Use multi-scatter switch for the glass variant
This avoid strange discrepency between the general purpose variant and
the specialized glass variant which did not have a way to turn
multi-scatter off.
2020-10-22 00:57:29 +02:00
091b433677 Fix T77658 EEVEE: Reflection Plane partially missing reflections
The degenerate line workaround was ill defined.
2020-10-22 00:57:29 +02:00
Robert Guetzkow
e1eaf9e2b4 Fix T81925: incorrectly skipped string copy in test_env_path
Regression in 6f3a9031f7

Ref D9306
2020-10-22 09:54:35 +11:00
Robert Guetzkow
ef5d6e9c45 Fix T81925: incorrectly skipped string copy in test_env_path
Regression in 6f3a9031f7
2020-10-22 09:51:51 +11:00
8a22b76988 Merge branch 'blender-v2.91-release' into master 2020-10-21 22:57:15 +02:00
27137c479c EEVEE: Screen Space Reflection: Improve contact reflections
This patch helps the case of intricate reflections where the
ray does not travel far before intersecting the geometry.

In these cases there could be false negative exclusion of the ray
caused by the backface rejection threshold.
2020-10-21 22:56:06 +02:00
0cbe6387e9 EEVEE: Screen Space Raytrace: Fix unreported banding artifacts
The artifact manifested as lines of different values caused by faillure to
trace the depth buffer correctly.

Adding a ad-hoc value to the step size to mitigate the issue.
2020-10-21 22:55:56 +02:00
d7e3b3aed0 Merge branch 'blender-v2.91-release' 2020-10-21 21:21:32 +02:00
23ec1f90e7 Fix T81896: Outliner missing redraw after "Set Parent (Without Inverse)"
Outliners listener (outliner_main_region_listener) needs ND_PARENT
notifier to redraw, the parenting operator only spawned ND_TRANSFORM
(which doesnt do a redraw).

Maniphest Tasks: T81896

Differential Revision: https://developer.blender.org/D9295
2020-10-21 21:15:32 +02:00
0b3cb54887 Merge branch 'blender-v2.91-release' 2020-10-21 21:05:53 +02:00
9daf668991 Fix T81926: Sculpt: Box Mask operator (from menu and shortcut) does
nothing

Caused by rB6faa765af895.

Since above commit, we have to use paint.mask_box_gesture instead now.

Maniphest Tasks: T81926

Differential Revision: https://developer.blender.org/D9300
2020-10-21 20:51:54 +02:00
0da8eb7bd0 Merge branch 'blender-v2.91-release' 2020-10-21 20:43:01 +02:00
d2f52dccd3 Fix T81929: Sculpt: Mask operators missing drawing update on meshes with
shapekeys/modifiers

This was failing for all mask filters (sharpen, grow, invert, clear,
shrink, contrast, smooth) and mask gestures (box, lasso).
Also have to recalc shading, use SCULPT_tag_update_overlays for this.

ref D8956

Maniphest Tasks: T81929

Differential Revision: https://developer.blender.org/D9302
2020-10-21 20:37:18 +02:00
e296d58cf2 GPencil: Subdivide Cyclic section of strokes in modifier
When use subdivision modifier, the close section of the stroke must be subdivided too.
2020-10-21 19:24:12 +02:00
657e344351 GPencil: Bake mesh animation for selected keyframes only
This new option allows to bake the animation of the selected frames and not the full range of keyframes.
2020-10-21 19:15:26 +02:00
Jagannadhan Ravi
bb49aa0d69 Cycles: multithreaded export of geometry
This improves performance in scene synchronization when there are many
mesh, hair and volume objects. Sync time speedups in benchmarks:

barbershop   5.2x
bmw          1.3x
fishycat     1.5x
koro         1.0x
sponza       3.0x
victor       1.4x
wdas_cloud   0.9x

Implementation by Nicolas Lelong, and Jagannadhan Ravi (AMD).

Differential Revision: https://developer.blender.org/D9258
2020-10-21 18:54:12 +02:00
b5803c0a24 Revert "2.91 splashscreen"
In master Blender still uses the dev fund splashscreen
This reverts commit 1b577d0d6d.
2020-10-21 18:18:12 +02:00
7ff6bfd1e0 UI: Allow changing the active side of line gestures
Line gesture use always the right side of the line as active (the area
of the mesh that is going to be modified) by default.
This adds the ability to change the active side when the line gesture is
active by pressing the F key.
This allows more freedom to position the line after starting the
gestures, as it won't be required to cancel the operation or undo if the
line was used in the wrong direction.

Reviewed By: Severin

Differential Revision: https://developer.blender.org/D9301
2020-10-21 18:17:36 +02:00
ce76f2db94 Merge branch 'blender-v2.91-release' 2020-10-21 18:16:46 +02:00
1b577d0d6d 2.91 splashscreen
To bring more attention for beta we now change the splashscreen during
bcon3.

Credit: Robin Tran - artstation.com/robin_tran
2020-10-21 18:14:26 +02:00
b6e0661e9e Merge branch 'blender-v2.91-release' 2020-10-21 18:12:50 +02:00
fd96b29dcc Bump subversion to 2.91.9 for bcon3 BETA 2020-10-21 18:11:30 +02:00
f2d454c829 Bump version to 2.92 alpha 2020-10-21 18:09:44 +02:00
9216b8d6cb UI: Allow changing the active side of line gestures
Line gesture use always the right side of the line as active (the area
of the mesh that is going to be modified) by default.
This adds the ability to change the active side when the line gesture is
active by pressing the F key.
This allows more freedom to position the line after starting the
gestures, as it won't be required to cancel the operation or undo if the
line was used in the wrong direction.

Reviewed By: Severin

Differential Revision: https://developer.blender.org/D9301
2020-10-21 17:55:17 +02:00
15cebd8565 Fix T81901: Use the 2.90 scrape brush preset as default
The new preset I made for 2.91 is way more controllable with lower
strength values and does not have the accumulate bug, but until the
brush management is in place to ship multiple versions of the brush,
probably most people expect something closer to the old version to be
the default.

Reviewed By: sergey

Maniphest Tasks: T81901

Differential Revision: https://developer.blender.org/D9289
2020-10-21 17:51:23 +02:00
3601cdd27b UI: Swap order of increment and decrement file name icon in File Browser
Swaps the order of the '+' and '-' button in the File Browser file name field,
so that '-' comes first.

For increasing or decreasing a value it makes more sense to have decreasing
first, increasing last. Consistent to how you press on the left side of a
number button for decrease, and right to increase.

However this is inconsistent in another way: Usually we have a '+' button
before a '-' button, but that refers to adding and removing items, not
increasing or decreasing. The icons are also placed in their own buttons then,
making them look more separate.
So the UI Team agreed on accepting that trade-off, see today's meeting notes:
https://devtalk.blender.org/t/2020-10-21-ui-team-upcoming/15849
2020-10-21 17:34:53 +02:00
876f78cbbb UI: Better center-align Properties search button in header
For some reason the layout code doesn't center the search button properly. Add
a blank icon button to add some padding, dynamically resized as the region size
changes. This is quite finicky and not at all perfect. But it makes the search
button look far less off-place.
2020-10-21 17:25:37 +02:00
187cc5e26d UI: Move Properties path pin button next to the data-path
The pin button should be next to the data-path, which is what it belongs to.

Note that this makes the placement of the search button in the header look
quite off. That is because it's centered to the absolute header width, not the
width of the main region (which is smaller because of the tab region on the
left).
Technically it's correct that way, visually it looks wrong. This will be
addressed in a followup commit.
2020-10-21 17:25:37 +02:00
dd82a0d623 GPencil: Fix unreported problem with strokes bounding box that makes impossible sculpt
When the stroke was not flat, the bounding box projected could not be right and the strokes could not be painted or sculpted.

Now, the 2D bounding box is calculated using the extremes of the 2D bounding box and not the original 3D min and max values.
2020-10-21 17:23:55 +02:00
62528677bf Fix 'Make Local' operation to support liboverrides.
One can now use 'make local' from the Outliner or the 3DView to also
fully localize overrides of linked data.
2020-10-21 16:59:11 +02:00
959a06b8ff UI: Fix typo in sculpt trim tool description 2020-10-21 09:54:22 -05:00
47a84bb338 Fix (studio-reported) Armature: bug in handling of custom bone transform.
This specific pose channel pointer was not handled at all during
rebuilding of poses, meaning that it could end up pointing at some freed
pchan.
2020-10-21 15:52:41 +02:00
ba718c1513 Cleanup: Improve function and variable name
"pt" is unecessarily cryptic, and the funciton name wasn't very clear.
2020-10-21 08:38:26 -05:00
810f5b82ce GPencil: Sculpt 'Inverse Cursor Color' Label to "Inverse Color"
This changes is related to commit c0a0789af5
2020-10-21 15:28:09 +02:00
35e50c170c Fix panel type use after free when reloading scripts
In order to prevent the panel code from using the type after it is freed,
the field needs to be set to NULL. This needs to be done recursively
for subpanels as well as top-level panels.
2020-10-21 08:25:46 -05:00
d782bad62d WM: ensure is_repeat isn't copied from the last event
This means if a keymap item is set to ignore repeat events,
it may do so accidentally from this setting being copied.
2020-10-21 23:35:46 +11:00
b4017ccb64 Cleanup: keep comment block at bottom of versioning
The intention of this block is to have all logic that will
be wrapped in a version check next subversion bump.
2020-10-21 23:33:50 +11:00
8738a668d8 Preferences: separate feature flags for geometry nodes and point cloud type
Those two features are not directly related and one might be activated
in master earlier than the other.

WITH_PARTICLE_NODES was removed, because we continue the project
under the name "Geometry Nodes".
2020-10-21 13:47:50 +02:00
819b1a7f9d Cleanup: Move scenes' foreach_id handling of toolsettings into own func. 2020-10-21 11:38:32 +02:00
22ceb4a752 Fluid: Fix in addition to new obstacle distance parameter
The obstacle distance value should only be used when using second order boundaries.
2020-10-21 10:52:30 +02:00
fc2a83d95b Cleanup: rename some functions with more relevant prefix. 2020-10-21 10:23:48 +02:00
afd13710b8 Cleanup: Clang-tidy readability-named-parameter
No functional change.
2020-10-21 13:21:00 +05:30
7ac6f4d26c Cleanup: Clang-tidy readability-redundant-string-init
No functional change.
2020-10-21 13:15:17 +05:30
Ankit Meel
ee90effd3a Clang-tidy: disable new warnings.
Until it is decided whether to work on, or ignore these
warning, disable them. See T78535 

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9281
2020-10-21 12:58:39 +05:30
a8f44a4799 Cleanup: early return from animation step, reduce indentation level 2020-10-21 18:07:24 +11:00
Jeroen Bakker
e60bc528f0 DrawManager: Adding Custom Render Passes
Currently render passes in the draw manager (eevee) must be predefined
in the render result. This patch would ask the render engine for the
render passes it needs, and create these as a preparation step during
rendering. This allows any draw engine to define more complex render
passes setup.

Render passes can only be added before the call to `RE_engine_begin_result`.
`RE_engine_begin_result` makes a full copy of the render passes. During
rendering the render engines renders to the duplicated passes.
`RE_engine_end_result` syncs the data back to the original render passes,
but only if the passes existed in the original render result.
Currently we work-around this issue by registering the passes in
`render_result_new`. This is legacy blender internal structure and should
be avoided.

With upcoming projects (AOV/Cryptomatte) it becomes a bit of a mess as we
are extending legacy code to support new features. This patch allows us to
let each draw engine register their own render passes at render time
(similar to cycles and other render engines). In the future we could get
rid of legacy render passes registration in render_result_new.

Reviewed By: Clément Foucault

Differential Revision: https://developer.blender.org/D9088
2020-10-21 08:14:21 +02:00
1ad100d556 Fix T81079: Switch object ignoring visibility settings
Replace ED_transform_snap_object_context_create with
ED_view3d_give_base_under_cursor & ED_view3d_autodist_simple so object
visibility is respected and non-geometry objects can be supported.

Ref D9255
2020-10-21 13:53:03 +11:00
4bf6ffc022 Fix for T81757: Incorrect Overlay Line Height
Fixes error in determining 3DView Overlay Line Height. Do not base on current default font height.

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

Reviewed by Campbell Barton
2020-10-20 19:11:36 -07:00
a80c1fc011 Cleanup: simplify lasso transform from 17cb2a6da0
Access as 2D array, loop forwards over the pointer since it's
more common and simpler to read.
2020-10-21 13:03:53 +11:00
4e90dff60f Cleanup: avoid error prone nested switch statements (missing break)
17cb2a6da0 missed a break statement after a nested switch,
while it didn't cause a bug nesting switch doesn't read well
and is prone to errors like this.

Split modal-keymap checks into their own branch to avoid this happening,
also use matching event checks for all gesture operators.
2020-10-21 12:54:35 +11:00
7167a57197 Fluid: Added obstacle fluid distance parameter
Being able to adjust the distance between fluid and obstacles comes in handy when trying to achieve a fluid motion over inclined obstacles.

Depending on the slope of such obstacles, already small adjustments of this value can help when particles stick to obstacle surfaces (i.e. make particles not stick to obstacles).
2020-10-20 23:07:53 +02:00
14d56b4217 UI: Add angle snapping to line gesture tools
This adds support for snapping for line gesture tool. It is implemented
in the modal keymap as Snap, which is a toggle (similar to how snapping
in the transform operator works).

Right now it snaps the angle of the line to 15 degree increments, which
is defined in code. This should be easy to expose in the UI in the future
if we need to.

Reviewed By: Severin

Differential Revision: https://developer.blender.org/D9115
2020-10-20 22:52:12 +02:00
cf8aa20967 Fix error in the last commit
I accidentally commited a file without saving it
2020-10-20 22:33:26 +02:00
17cb2a6da0 UI: Move gesture selection with spacebar
This patch adds a modal key to move the selection box/lasso/line while
drawing it. It also sets "repeat": False on the animation playback key
to prevent accidental playback if the spacebar is released after the
mouse button.

Reviewed By: #user_interface, pablovazquez, Severin

Differential Revision: https://developer.blender.org/D9227
2020-10-20 22:18:01 +02:00
b55c44e3ed EEVEE: Screen Space Reflection: Improve self intersection cases.
This patch fix most self intersection comming from reflection rays.
We regenerate the ray if it goes below the shading normal (should be the
geometric normal but we have no access to it here).

Also add the same precision based bias we use for contact shadows.

This fix T81105 Eevee SSR quality regression in 2.91 alpha
2020-10-20 22:06:43 +02:00
65a3195781 EEVEE: Screen Space Reflection: Fix undefined behavior with invalid LOD
Some issues happened because the lod can become negative in some cases.
Also avoid sampling LOD with interpolation (floor).
2020-10-20 22:06:43 +02:00
3e5a354333 Fix sculpt pen tilt support changing the brush strength
SCULPT_tilt_apply_to_normal expects a normal, and offset was already
scaled by radius. The funcion returns a normalized vector, so the
strength of the brush was changed.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9275
2020-10-20 21:41:32 +02:00
98540511b1 Cleanup: Clang-tidy -readability-inconsistent-declaration-parameter-name
Changes in source/blender/makesrna only.

No functional change.
2020-10-21 01:09:31 +05:30
f76d9de7ed Cleanup: Clang-tidy bugprone-redundant-branch-condition
No functional change.
2020-10-21 01:08:26 +05:30
10e2b77121 Cleanup: makesrna, Clang-tidy else-after-return-fixes.
It got left out of {rBc04088fed1b8faea6b2928bb5e09ab3}.

No functional change.
2020-10-21 01:08:26 +05:30
6c2bea6492 Cleanup: Clang-tidy silence readability-non-const-parameter
This is a false alarm, `getFileSystemRepresentation` changes the
return value argument.
So used `NOLINTNEXTLINE`.
2020-10-21 01:02:16 +05:30
43e4d6e5b1 CMake/Windows: Compile GMP library as fat library 2020-10-20 13:04:53 -06:00
Rahul Chaudhary
0c1c6e7ecf UI:Add icon for Displacement Eraser brush
This patch adds icons for the multires displacement
eraser tool in sculpt mode

Reviewed By: HooglyBoogly

Differential Revision: https://developer.blender.org/D9286
2020-10-20 20:59:29 +02:00
Rahul Chaudhary
e74b7e1615 UI: Add icons for line genture tools
This patch adds icons for line gesture tools
Line mask and line project

Reviewed By: HooglyBoogly

Differential Revision: https://developer.blender.org/D9285
2020-10-20 20:55:48 +02:00
Rahul Chaudhary
a264b1f710 UI: Add icon for boundary brush
This patch adds icon for the boundary brush in sculpt mode

Reviewed By: HooglyBoogly

Differential Revision: https://developer.blender.org/D9284
2020-10-20 20:52:36 +02:00
3d78e98d52 Ocean Modifier: allow spray maps to be baked
In comments made by a tester on rB17b89f6dacba007bf, it seems that baking
of the spray maps would be useful. This commit adds that capability. Both
the spray map and its inverse are baked out in this change, for maximum
convenience and to avoid assuming what the user wants.

Differential Revision: https://developer.blender.org/D8470
2020-10-20 12:47:58 -05:00
de77aa337c Cleanup: warning on windows 2020-10-20 17:50:22 +02:00
c0a0789af5 UI: Sculpt 'Inverse Cursor Color' Label
Shorten name of 'Inverse Cursor Color' to 'Inverse Color' so that it does not overflow its popover.

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

Reviewed by Brecht Van Lommel
2020-10-20 08:25:28 -07:00
Jeroen Bakker
e05ce1ea20 UV/Image: Remove Legacy Drawing
With D8234 a new drawing method for UV/Image editor was introduced. For debugging
reasons we left the old drawing method in the code base. This patch will remove
the old drawing method.

Reviewed By: Clément Foucault

Differential Revision: https://developer.blender.org/D9011
2020-10-20 17:06:13 +02:00
239eb95ef8 Fix T81865, T81860: CustomData Correction can fail on non standard names
Caused by rBaafd71a8a160.

In the process of CustomData Correction, we need to make sure we also
have matching layer names [as was done before above commit], otherwise
this will create layers with default names, applying
(mesh_customdatacorrect_apply and friends) will fail then.

Maniphest Tasks: T81865

Differential Revision: https://developer.blender.org/D9278
2020-10-20 16:22:36 +02:00
1c08ab4535 CMake: Compile GMP library as fat library
The idea behind this is to compile all versions of functions,
and let the library to pick the best at runtime.

Attempting to fix T81835
2020-10-20 16:18:59 +02:00
8319279fdb Cleanup: remove dead code 2020-10-20 15:23:15 +02:00
Jeroen Bakker
7320ecee9b EEVEE: ShaderToRGB alpha inversed
The alpha out socket output the average transmittance, not the alpha.
This patch will convert the transmittance to alpha.

Found during research of T80919; Issue introduced when `Closure.opacity` was migrated to `Closure.transmittance`.

Reviewed By: Clément Foucault

Differential Revision: https://developer.blender.org/D9010
2020-10-20 15:17:03 +02:00
257fe5a6e7 Volumes: Fix compilation when building without openVDB
And remove a warning.
2020-10-20 15:08:25 +02:00
360282cf1f Libmv: Refactor camera intrinsics parameter block
Use the newly introduced packed intrinsics, which allows to remove
code which was initializing parameters block based on distortion
model type.

Now such initialization is done by a particular implementation of
a distortion model.

Differential Revision: https://developer.blender.org/D9192
2020-10-20 15:02:50 +02:00
549841bbc0 Libmv: Add generic class for packed intrinsics
This is a common class which can be used in all sort of minimization
problems which needs camera intrinsics as a parameter block.

Currently unused, but will replace a lot of hard-coded logic in the
bundle adjustment code.
2020-10-20 15:02:50 +02:00
151173fefe Libmv: Add array<type, size> to libmv namespace 2020-10-20 15:02:50 +02:00
abc017ae0b GLTexture: Fix Anisotropic filtering affecting the standard mipmap samplers
Everything's in the title...
2020-10-20 14:55:18 +02:00
45400b32d0 DRW: Disable anisotropic filtering on utility textures
Anisotropic filter may result in incorrect algorithm. This only
affects util textures (not Image datablocks gpu textures).
2020-10-20 14:55:18 +02:00
711b55b527 Fix libmv test on windows
There is no point in testing std::vector capacity as it can differ
between std implementations.
2020-10-20 14:46:48 +02:00
b3d469e78d Fix compile error
Haven't tested on windows, hope that works.
2020-10-20 14:16:42 +02:00
5bd7eda093 Fluid: Add missing versioning for new options in 'Viewport Display' panel
Files created before D8705 was merged need to get initial values for the new viewport display fields.
2020-10-20 14:06:43 +02:00
14c0897671 Fix T81076: Crash on switch object operator undo
This fixes the crash and the assert, but undo is done in multiple steps

Reviewed By: campbellbarton

Maniphest Tasks: T81076

Differential Revision: https://developer.blender.org/D9256
2020-10-20 13:22:43 +02:00
0105f146bb Cleanup: General comment style clean up of graph_edit.c and fcurve.c
No functional changes.

Reviewed By: Sybren A. Stüvel

Differential Revision: http://developer.blender.org/D7850
2020-10-20 13:04:02 +02:00
580fe9f5f8 Fix (unreported) install_deps: wrong version number for llvm in some cases.
Version reported by package manager is not always satisfying (on Debian
testing currently e.g. `llvm-dev` is reported as `9.0`, when exact one
is actually `9.0.1`, this break CMake build of Blender then).

Just use version reported by `llvm-config` instead, when using
distribution packages.
2020-10-20 12:52:17 +02:00
89eef19171 Fix T81776: Sculpt line gestures not working with transformed objects
The line gesture plane should be in object space, not in world space.
2020-10-20 12:14:28 +02:00
6ced026ae1 Simulation: remove particle nodes with outdated design
The design for how we approach the "Everything Nodes" project
has changed. We will focus on a different part of the project initially.

While future me will likely refer back to some of the code I remove here,
there is no point in keeping this code around in master currently.
It would just confuse other developers working on the project.

This does not remove the simulation modifier and data block. Those are
just cleaned up, so that the boilerplate code can be reused in the future.
2020-10-20 12:07:42 +02:00
63a9f24b55 Volumes: simplify volumes in modifiers or on load
This changes how the simplify volumes setting works. Before, it only
affeted viewport rendering. This was an issue, because all internal
computations would still have to happen on the high resolution volumes.
With this patch, the simplify setting already affects file loading and
procedural generation of volumes.

Rendering does not have to care about the simplify option anymore,
it just gets the correct simplified version from the depsgraph.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D9176
2020-10-20 11:00:16 +02:00
f3ecb4c91e Fix T81684: node location not handled correctly
Reviewers: ISS

Differential Revision: https://developer.blender.org/D9236
2020-10-20 10:51:19 +02:00
efc2edc47f Fix T81190: Merge by Distance marks edges sharp
Make calculating edges sharp optional since it marks nearly all edges
sharp when the normals have been manually rotated.
2020-10-20 14:39:15 +11:00
c4668b72e0 Cleanup: use BLI_listbase_is_single instead of counting 2020-10-20 14:16:47 +11:00
74d1fba1de Fix Boundary brush not working when the whole mesh is inside the brush radius
When creating the boundary edit data, the loop can stop because a new
vertex was found further from the boundary than the brush radius or
because all vertices of the mesh were already processed. In this second
case, the max_propagation_step was not set, so the code that laters
calculates the falloff was not working, preventing the mesh from
deforming.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9215
2020-10-20 01:59:53 +02:00
2b2f3da721 Sculpt: Smooth deform type for Boundary Brush
This adds a smooth deformation type to the boundary brush, which smooths
the boundary and has a regular falloff towards the inside of the mesh.
For smoothing, only vertices parallel to the boundary are taken into
account, creating this effect.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9204
2020-10-20 01:52:53 +02:00
f780bfafcf Fix missing Sculpt Overlays updates when using modifiers
Now that sculpt mask and face sets can also be drawn without using the
PBVH, these operators need these extra updates when the data changes.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8956
2020-10-20 01:32:02 +02:00
48fd10a77d Sculpt: Reduce the displacement step in the cloth solver
Previously the base displacement for solving the constraints was always
using 0.5, which may introduce artifacts when multiple constraints of
different types are computed for the same vertex. This introduces a
factor that reduces the base displacement of the solver, reducing the
artifacts.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9202
2020-10-20 01:27:44 +02:00
ea4d28aea0 UI: In-line layout for Empty Image Transparency
No need for a sub-panel with a single property (same as mesh
normals auto-smooth, camera passepartout, etc).
2020-10-20 00:48:11 +02:00
31108f9359 UI: Sort "Volume to Mesh" and "Mesh to Volume" in alphabetical order 2020-10-20 00:12:45 +02:00
c6c4925771 Fluid: Added domain check for new OpenVDB precision 'Mini' type
Precision 'Mini' should only be available for liquids domains.
2020-10-19 21:40:17 +02:00
aa244a7a68 UI: Simplified Categorized Menus
Menus with categories gain a dividing line and omit the title.

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

Reviewed by Brecht Van Lommel
2020-10-19 11:28:38 -07:00
1e3742749e UI: 3DView Popover Adjustments
Slight adjustments to widths, and adds gaps below titles, of 'Viewport Gizmos' and 'Object Types Visibility' popovers.

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

Reviewed by Pablo Vazquez
2020-10-19 10:55:05 -07:00
3d26cd01b9 Spelling: Apart Versus A Part
Corrects incorrect usages of the fragment 'apart of' when 'a part of' was required.

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

Reviewed by Campbell Barton
2020-10-19 09:47:19 -07:00
4fb67ae809 CMake/macOS: use system OpenAL for the time being.
Revert part of {rB83124856d05ee4da605ab247e6}
2020-10-19 22:05:56 +05:30
c0a6bc1979 Spelling: Loose Versus Lose
Corrects incorrect usages of the word 'loose' when 'lose' was required.

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

Reviewed by Campbell Barton
2020-10-19 09:15:34 -07:00
84ef3b80de Spelling: Miscellaneous
Corrects 34 miscellaneous misspelled words.

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

Reviewed by Campbell Barton
2020-10-19 09:11:00 -07:00
a9f2641cb6 Fix build error with WITH_CYCLES_NATIVE_ONLY and AVX tests on macOS
Only build avx/avx2 unit tests if supported by the compiler and
WITH_CYCLES_NATIVE_ONLY is off, otherwise the appropriate compiler flags
are not available.
2020-10-19 17:55:00 +02:00
d1eefc4215 Spelling: Then Versus Than
Corrects incorrect usages of the words 'then' and 'than'.

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

Reviewed by Campbell Barton
2020-10-19 08:43:08 -07:00
3a7fd309fc Spelling: It's Versus Its
Corrects incorrect usage of contraction for 'it is', when possessive 'its' was required.

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

Reviewed by Campbell Barton
2020-10-19 08:12:33 -07:00
d2bf71b412 Fix use of uninitialized variable 2020-10-19 09:19:13 -05:00
7ef3a63480 Cleanup: Use BLI string functions
It's better not to assume that strings passed as arguments
will have the proper size.
2020-10-19 09:17:41 -05:00
9bf1bf599b Cleanup: Missing parentheses around macro in versioning
Although the `ELEM` macro wraps logic into parentheses, it's not intended to be
used that way. Unexpanded macros should still follow regular coding style for
readability and for tools parsing the code (it confused clang-format for
example).
2020-10-19 15:38:55 +02:00
Ankit Meel
83124856d0 Cmake/macOS: strictly disallow searching in frameworks
This is a stricter version of the change made in
{rBbb872b25f219d1a9bc2446228b6dc}

Cmake must never look into Frameworks when the system
library guards (`without_system_libs_begin`/`without_system_libs_end`)
are present.

OpenAL didn't follow this and OpenAL.framework in Xcode would be used.
The Cmake's `FindOpenAL.cmake` looks for both library (in this case,
the .framework file), and include dir.
Precompiled libraries don't contain the former. So `find_package`
cannot be used, or it becomes the hack that {rBb2c707747da9} removed.
So hardcode the include dir path, and other variables.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D9267
2020-10-19 18:47:35 +05:30
4d9f357bf6 Fix T81806: Cycles error when GPU device_type is NONE
Own regression in 4bea4702d5
2020-10-20 00:09:51 +11:00
29dbe00719 Fix T81484: Weight/Vertex paint with mirror and viewport clipping does not update stroke on initial side
Issue introduced in rB4f616c93f7cb.

Issue here is that the the `StrokeCache` `mirror_symmetry_pass` is still
in its previous state when entering
`wpaint_do_symmetrical_brush_actions`.
For the initial stroke this means that the (wrong) cache
`mirror_symmetry_pass` ends up in SculptBrushTest `mirror_symmetry_pass`
as well and thus the clipping test in `sculpt_brush_test_clipping` will
fail.
[ This one flips the coords to test against clipping according to (now
wrong) `mirror_symmetry_pass` ]

Solution seems simple: just ensure we start of with a
`mirror_symmetry_pass` of zero in `wpaint_do_symmetrical_brush_actions`
for the initial stroke.
Same thing is done for vertex paint as well.

Maniphest Tasks: T81484

Differential Revision: https://developer.blender.org/D9268
2020-10-19 15:01:38 +02:00
477d983c2e Animation: Improve labels on Snap menu in graph editor
Add "Selection to" as prefix for those menu items that move the selected
keyframes to something, for both the Key → Snap menu and the Shift+S pie
menu.

No functional changes.
2020-10-19 14:02:53 +02:00
e3c76f7937 Fix libmv eigen alignment issues when compiling with AVX support
There would be eigen alignment issues with the custom libmv vector
class when compiling with AVX optimizations. This would lead to
segfaults.

Simply use the std::vector base class as suggested by the old TODO in
the class header.

Reviewed By: Sergey

Differential Revision: http://developer.blender.org/D8968
2020-10-19 13:06:38 +02:00
b17ad27adc Silence an unused variable warning in bmesh_bevel.c. 2020-10-19 06:54:24 -04:00
e49ee5a808 Fix (unreported) crash when unlinking a brush from a tool.
Cursor drawing code was not checking for potential NULL pointers.
2020-10-19 12:50:01 +02:00
93887d1096 Fix: skip drawing input sockets that do not have a draw method
Contributed by @povmaniaco with minor changes by me.

Differential Revision: https://developer.blender.org/D9263
2020-10-19 12:28:44 +02:00
f7832b1583 Volumes: new Volume to Mesh modifier
This modifier is the opposite of the recently added Mesh to Volume modifier.
It converts the "surface" of a volume into a mesh. The "surface" is defined
by a threshold value. All voxels with a density higher than the threshold
are considered to be inside the volume, while all others will be outside.

By default, the resolution of the generated mesh depends on the voxel
size of the volume grid. The resolution can be customized. It should be
noted that a lower resolution might not make this modifier faster. This
is because we have to downsample the openvdb grid, which isn't a cheap
operation.

Converting a mesh to a volume and then back to a mesh is possible,
but it does require two separate mesh objects for now.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D9141
2020-10-19 12:12:44 +02:00
bd15efefd2 Cleanup: clang tidy 2020-10-19 11:35:23 +02:00
850944e6cd Image: Export emissive colors in 3 channel PNG images
Related to T81199. When saving a rendered image with transparency (RGBA)
to a 3 channel PNG image the emissive colors were not exported. This
change adds the emissive colors to the written file.

NOTE: this does not fix the limitation of writing emissive colors to a 4
channel PNG file as the file format does not support this.
2020-10-19 11:29:47 +02:00
Alistair Sealy
f52f51aef2 Cleanup: spelling in comments
Fixed a couple of typos in comments in CMakeLists.txt and GNUmakefile

Reviewed By: #platforms_builds_tests, mont29

Differential Revision: https://developer.blender.org/D9261
2020-10-19 09:27:32 +02:00
Jeroen Bakker
1ceb91d1b3 Fix T81167: Texture Painting with Paint mask enabled, (de)selecting faces causes a mess with texture slots
Issue caused by {9582797d4b50} in b2.90. The surface per material used
an index buffer owned by the batch. These index buffers are created at
the same time the surface tris index buffer was created. When a material
per batch buffer was invalidated it used the surface tris index buffer
rendering all materials on all surfaces making the last draw command
render succeed.

This patch stores the surface tris per material in the cache so they can
be reused. There is also no need to use the `saved_elem_ranges` anymore as they are
now part of the cache.

The ugly bit of the implementation is that in `extract_tris_finish` the
MeshBufferCache is retrieved. But as this part was already documented as
a hack and it is something that is only used for final meshes. Other
solutions would impact performance or made the fix not condensed
(passing parameters that shouldn't be used).

Reviewed By: Clément Foucault

Differential Revision: https://developer.blender.org/D9136
2020-10-19 08:14:07 +02:00
b2e067d98c Fix T68343: Rendered video plays at 600fps
Field time_base of video stream must be set for some containers,
otherwise avformat_write_header() will set it to default values.
Rendered file in such case won't be played at desired frame rate.

See init_muxer() in mux.c in ffpmeg sources.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9213
2020-10-19 07:17:13 +02:00
94364be80a Fix ASAN warning after recent cleanup
rB78a5895c96 introduced a "use after scope" warning, where a buffer
from a lower scope was used later. The solution is to only use one
variable and store whether to use it more explicitely with a bool.
2020-10-18 22:18:31 -05:00
48c484a22e Fix Bevel percent mode, and clamping for it too (T79898).
The code for Bevel's percent (and absolute) modes were pretty bogus.
It assumed, like the rest of the modes, that the offset lines are
parallel to the beveled edge. Which is not true for these modes,
though it accidentally works sometimes if the legs are equilength.
Also the clamping code for those modes was completey wrong.
It is too hard to really fix the clamping code for absolute mode,
but it is a little better now. Percent mode clamping is fixed.
2020-10-18 16:27:07 -04:00
663e047102 Fluid: Fix for issues with external forces
A general refactor / fix commit that should clear out the issues that have been reported on external forces and moving effectors (e.g. T79537, T81660, T80088).
2020-10-18 20:35:02 +02:00
1f046e05b6 Fluid: Add versioning for fluid particle physics type
Setting this type is required to prevent fluid particles from being treated like physics particles. The actual fix for this was made in rB11a8a6d0e6b5.
2020-10-18 20:35:02 +02:00
bdad412fa7 Fix for T81400: Block Width Corrections
Scale widths of popovers and dialogs with Text Style font point changes.

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

Reviewed by Hans Goudey
2020-10-18 10:31:55 -07:00
78a5895c96 Fix T81800: Datablock pin not working for bones in pose mode
The "active_pose_bone" context variable isn't accessed from
`buttons_context`, it uses `screen_context` instead. This means
it can't account for pinning in the property editor.

Using "pose_bone" context variable first means the property
editor context will be used and the pinning will work.

Differential Revision: https://developer.blender.org/D9242
2020-10-18 10:57:14 -05:00
806a561e23 Sculpt: Fix (unreported) assert getting trimming cursor depth option
It is a boolean, not an enum.
2020-10-18 15:06:27 +02:00
e1cd6fae34 Avoid Assert in BKE_mesh_calc_loop_tangent_ex
Code could call CustomData_get_layer_index_n with a negative index (if
no active and/or render UV layers are found). This would assert since
rBe86785c51445.

Spotted while looking into T81398.

Differential Revision: https://developer.blender.org/D9212
2020-10-18 10:56:39 +02:00
9c7fda6de3 Fix T81729: Cycles object color not updating for instancers
Caused by rBe65c78cd43aa.

Since above commit, only geometry and lights received the update,
previous to this check an instancer would receive that is well (in case
of 'is_updated_shading').

Now check for an instancer (checking OB_DUPLI via ob.is_instancer()) and
do an update then as well.

Reviewers: brecht

Maniphest Tasks: T81729

Differential Revision: https://developer.blender.org/D9222
2020-10-18 10:42:17 +02:00
f425f40c4e Cleanup: More miscellaneous code quality changes in wm directory
- Declare variables where initialized.
  - Use LISTBASE_FOREACH macro.
  - Reduce variable scope.
  - Return early or reduce indentation in some cases.
2020-10-17 16:36:02 -05:00
85e78fa17c Cleanup: Declare variables where initialized in context.c 2020-10-17 16:30:56 -05:00
d48d8b3456 Fix T81761: EEVEE enabled AO pass affects render result
This was a regression introduced on 68651534c2.
2020-10-17 13:10:13 +02:00
7447eb7e74 Cleanup: Miscellaneous improvements in wm directory
- Reduce variable scope.
  - Use LISTBASE_FOREACH macros.
  - Return early in some cases to reduce to reduce indentation.
2020-10-17 01:28:34 -05:00
2c14a950a7 Fix T81594: Unable to reassign effect inputs
This was caused by canceling operator if strip has more than 0 inputs.
Logic should be reversed - cancel only if strip has 0 inputs.

BKE_sequencer_render_loop_check() arguments had to be sanitized because
seq_effect_find_selected() can set seq1,2,3 to NULL

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9197
2020-10-17 07:01:12 +02:00
e2c5439cb4 Cleanup: Reduce variable scope in screen directory
Also return early and use LISTBASE_FOREACH in a few places
2020-10-16 21:56:58 -05:00
20276e4b00 Cleanup: Reduce variable scope in area.c 2020-10-16 20:49:47 -05:00
3bc808ebcb UI: Tweak decimate modifier layout
- Expand the "Type" toggle at the top. This is consistent with other
  modifiers where there is a "Type" option at the top. It conveys the
  property's importance and makes it faster to switch it.
- Expand the "Delimit" option vertically so the text isn't squashed.
  There isn't enough space on one line for this, and is has to be
  expanded because more than one option can be selected. This is also
  consistent with how "multi-select" enums are often displayed, like
  the 3D view snapping settings.

|   Before   |   After    |
| {F9000996} | {F9000985} |
2020-10-16 16:03:45 -05:00
c275a00a72 UI: Align related properties
The start and end frame properties are generally aligned in one block.
2020-10-16 15:50:15 -05:00
54da72d3cd Property Search: Reset panel expansion when exiting search
This patch implements panel expansion saving and resetting for property
search. While search is active, the panel expansion is based on whether
or not it has a search result. When the search finishes, the panel
expansion returns to its state before the search started. However, any
panels interacted with during the search won't reset their expansion.

This requires adding a new runtime flag for panels to store whether to
use search result status as expansion. It also requires better handling
for animation when panel expansion changes with another new runtime flag.
`UI_panel_is_closed` gets the search-dependent expansion, but it is
intentionally not used to access expansion in every case-- sometimes it's
necessary to use `PNL_CLOSED` directly.

Differential Revision: https://developer.blender.org/D8984
2020-10-16 15:16:44 -05:00
77aef03d8a Cleanup: reduce variable scopes 2020-10-16 18:06:30 +02:00
00ee3960e0 Cleanup: reduce variable scopes 2020-10-16 17:30:12 +02:00
89ffdad0f3 Fix misuse of alloc inside a loop
Alloc will only free its memory when the function is returned.

Issue introduced in c866075dfb. Thanks Sergey for spotting this.
2020-10-16 17:18:23 +02:00
5ebdbcafcb Animation: Snap Cursor Value operator
Add operator to snap the 2D Cursor value to selected keyframes. This is
doing almost the same as the "Cursor to Selected" operator, except that
it doesn't affect the current frame, just the Y-coordinate (the value)
of the 2D cursor.

The "snap cursor" operators are added to the Key → Snap menu and to the
Snap pie menu. This means that these menus are now extended in meaning,
to not only mean "snap the selected keyframes to the cursor", but also
for some options "snap the cursor to selected keyframes".

This fixes T76596.
2020-10-16 16:44:06 +02:00
df4a93aca0 Cleanup: Animation, split up frame jump operator
Split up `GRAPH_OT_frame_jump` exec function and added some local variables
to give names to the cryptic `ked.f1`, `ked.f2`, and `ked.i1`.

No functional changes.
2020-10-16 16:09:20 +02:00
342be27daa Cleanup: clang-tidy 2020-10-16 15:33:00 +02:00
5b9296f0d6 Fix (reported by studio team) crash in relocate lib code.
We do not always find a matching ID in new library.
2020-10-16 15:22:20 +02:00
6430849366 Fix T81027: Multires objects in sculpt mode can't be linked via collections.
Just clear all non-object mode flags from linked objects at read time.

Reviewers: brecht

Subscribers:
2020-10-16 14:04:17 +02:00
4475c49e2f Fix T81591: Align view to active is not working in sculpt mode
Remove sculpt/paint checks in getTransformOrientation_ex
This code goes back a long time (early 2.5x). I couldn't find any
reason why sculpt/paint checks were being made.

This makes the following changes:

- When in object mode, the object must be selected.
  Since this function typically operates on the selected items.

- When in paint/particle modes, the objects matrix is always
  used regardless of selection, since object selection can't be
  controlled in these modes.

- When there is no active object, the first selected object is no
  longer used as it's quite an arbitrary decision & not something
  done elsewhere with objects in Blender.
2020-10-16 22:16:53 +11:00
3b84dce969 Fix T54526: Data Transfer modifier's Max Distance field working strangely.
Based on investigation by Philipp Oeser (@lichtwerk) and solution by
Alexander Gavrilov (@angavrilov) in D5206, thanks!
2020-10-16 13:00:40 +02:00
14f490b932 EEVEE: SSR: Fix unreported smoothstep instability when border factor is 0
From the GLSL documentation: `Results are undefined if edge0 ≥ edge1.`
This is the case without this patch.
2020-10-16 12:56:57 +02:00
eb55ca72f4 UI: Make node theme settings to conform to UI rules
Basically first letter of (most) words is to be capitalized.

These settings (Noodle curving and Grid levels) had this wrong since
their first commit (2011 and 2020 respectively).
2020-10-16 12:10:18 +02:00
5d92fd8a90 Correct last commit 2020-10-16 20:51:58 +11:00
b002fdc4bf PyDoc: update to account for new context member 2020-10-16 20:29:55 +11:00
491d777efc Cleanup: remove debug printf()
No functional changes.
2020-10-16 10:59:43 +02:00
c5bdbc340a Fix T62463: unable to select anim channel for unselected node
Remove the code that synchronises selection state of shader node animation
channels. This code is only used in a few cases where selection of these
animation channels is changed, and then potentially does the wrong thing
and disallows selection of animation channels altogether.

This removal is meant to be a temporary situation, to unblock animation
channel selection. See T74159 for the overall effort to improve selection
sync.
2020-10-16 10:21:36 +02:00
5722de6098 Cleanup: Animation, remove unused parameters
No functional changes.
2020-10-16 10:17:10 +02:00
bb872b25f2 CMake/macOS: Search for headers in Frameworks last.
https://devtalk.blender.org/t/libpng-version-mismatch/15799/

By default, `CMAKE_FIND_FRAMEWORK` is `FIRST`.

CMake searches headers and libraries separately. So library is found
in LIBDIR, and headers like those in Mono are detected before the
headers in LIBDIR, and we get a version mismatch.

So set the priority of Frameworks to `LAST`.

https://gitlab.kitware.com/cmake/cmake/-/issues/18921
https://gitlab.kitware.com/cmake/cmake/-/issues/16427

{rBbac91956ae97} tried to fix the same issue, but it didn't work.
It's fine to keep the changes made there, just removing the comment
that may give false sense of security.
2020-10-16 13:41:29 +05:30
3ffe65a7fb CMake/macOS: Restore TIFF's optional status.
{rB1f6b7387ad01}
2020-10-16 13:41:26 +05:30
fa566157a5 PyAPI: unregister add-ons when exiting
This lets add-on authors avoid false positive leaks when exiting.
In particular GPUShaders's although it applies to any PyObject that
stores memory allocated by guarded-alloc.

While this does add overhead on exit, on my system it's
under 1/100th of a second with all addons enabled.

See: T71362
2020-10-16 16:34:29 +11:00
f40294b2d6 Fix syntax error in IC-Keymap
Regression in e936f04258
2020-10-16 16:20:44 +11:00
0a2ae7f220 RNA: support building WITH_PYTHON=OFF 2020-10-16 15:56:26 +11:00
9fb2ce70d6 Cleanup: remove f-string use 2020-10-16 14:06:47 +11:00
507e7bcbdb Cleanup: assign variables for re-used context members 2020-10-16 14:00:15 +11:00
fa0ceb4959 Cleanup: spelling 2020-10-16 11:46:48 +11:00
00f7b572d9 Windows: Fix build issue on windows
TBB includes Windows.h which defines a min/max macro
leading to issues when you want to use std::min and
std::max.

This change prevents Windows.h from defining them
sidestepping the issue.
2020-10-15 17:14:57 -06:00
ba8233174c Fix build error with clean builds
Needed after d1b3439b80. Think the error only happened with fresh builds,
where dna_type_offsets.h didn't already exist.

We have to do the same in other places too, see 8594cdb456.
2020-10-15 23:02:16 +02:00
e936f04258 Outliner: Use operator option to decide which item to rename
The `outliner.item_rename` operator needs to decide if it should rename the
active or the hovered item. Previously it checked if the event is a press
event, which is a hacky way of doing this and limit how the operator can be
used in the keymap.
Now use a operator option to let this be controlled on the keymap level.

Doesn't change any default behavior.
2020-10-15 21:31:43 +02:00
5167 changed files with 288335 additions and 160724 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,6 @@ ForEachMacros:
- SCULPT_VERTEX_DUPLICATES_AND_NEIGHBORS_ITER_BEGIN
- SCULPT_VERTEX_NEIGHBORS_ITER_BEGIN
- SEQ_ALL_BEGIN
- SEQ_CURRENT_BEGIN
- SURFACE_QUAD_ITER_BEGIN
- foreach
- ED_screen_areas_iter
@@ -263,8 +263,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

@@ -15,9 +15,10 @@ Checks: >
-readability-misleading-indentation,
-readability-redundant-member-init,
-readability-use-anyofallof,
-readability-function-cognitive-complexity,
bugprone-*,
-bugprone-narrowing-conversions,
-bugprone-unhandled-self-assignment,
@@ -28,4 +29,19 @@ Checks: >
-bugprone-sizeof-expression,
-bugprone-integer-division,
WarningsAsErrors: '*'
-bugprone-redundant-branch-condition,
modernize-*,
-modernize-use-auto,
-modernize-use-trailing-return-type,
-modernize-avoid-c-arrays,
-modernize-use-nodiscard,
-modernize-loop-convert,
-modernize-pass-by-value,
# Cannot be enabled yet, because using raw string literals in tests breaks
# the windows compiler currently.
-modernize-raw-string-literal
CheckOptions:
- key: modernize-use-default-member-init.UseAssignment
value: 1

104
.git-blame-ignore-revs Normal file
View File

@@ -0,0 +1,104 @@
# git config blame.ignoreRevsFile .git-blame-ignore-revs
#
# After running the above, commits listed in this file will be
# ignored by git blame. The blame will be shifted to the person
# who edited the line(s) before the ignored commit.
#
# To disable this ignorance for a command, run as follows
# git blame --ignore-revs-file="" <other options>
#
# Changes that belong here:
# - Massive comment, doxy-sections, or spelling corrections.
# - Clang-format, PEP8 or other automated changes which are *strictly* "no functional change".
# - Several commits should be added to this list at once, because adding
# one extra commit (to edit this file) after every cleanup is noisy.
# - No clang-tidy changes.
#
# Note:
# - The comment above the SHA should be the first line of the commit.
# - It is fine to pack together similar commits if they have the same explanatory comment.
# - Use only 40 character git SHAs; not smaller ones, not prefixed with rB.
#
# https://git-scm.com/docs/git-blame/2.23.0
# white space commit. (2 spaces -> tab).
0a3694cd6ebec710da7110e9f168a72d47c71ee0
# Cycles: Cleanup, spacing after preprocessor
cb4b5e12abf1fc6cf9ffc0944e0a1bc406286c63
# ClangFormat: apply to source, most of intern
e12c08e8d170b7ca40f204a5b0423c23a9fbc2c1
# Code Style: use "#pragma once" in source directory
91694b9b58ab953f3b313be9389cc1303e472fc2
# Code Style: use "#pragma once" in some newer headers
8198dbb888856b8c11757586df02aca15f132f90
# Code Style: use "#pragma once" in intern/ghost
1b1129f82a9cf316b54fbc025f8cfcc1a74b8589
# Cleanup: mostly comments, use doxy syntax & typos
e0cb02587012b4b2f4b18363dc7d0a7da2c02093
# Cleanup: use C comments for descriptive text
2abfcebb0eb7989e3d1e7d03f37ecf5c088210af
# use lowercase for cmake builtin names and macros, remove contents in else() and endif() which is no longer needed.
afacd184982e58a9c830a3d5366e25983939a7ba
# Spelling: It's Versus Its
3a7fd309fce89213b0224b3c6807adb2d1fe7ca8
# Spelling: Then Versus Than
d1eefc421544e2ea632fb35cb6bcaade4c39ce6b
# Spelling: Miscellaneous
84ef3b80de4915a24a9fd2fd214d0fa44e59b854
# Spelling: Loose Versus Lose
c0a6bc19794c69843c38451c762e91bc10136e0f
# Spelling: Apart Versus A Part
3d26cd01b9ba6381eb165e11536345ae652dfb41
# Cleanup: use 2 space indentation for CMake
3076d95ba441cd32706a27d18922a30f8fd28b8a
# Cleanup: use over-line for doxy comments
4b188bb08cf5aaae3c68ab57bbcfa037eef1ac10
# Cleanup: General comment style clean up of graph_edit.c and fcurve.c
0105f146bb40bd609ccbda3d3f6aeb8e14ad3f9e
# Cleanup: pep8 (indentation, spacing, long lines)
41d2d6da0c96d351b47acb64d3e0decdba16cb16
# Cleanup: pep8, blank lines
bab9de2a52929fe2b45ecddb1eb09da3378e303b
# Cleanup: PEP8 for python changes
1e7e94588daa66483190f45a9de5e98228f80e05
# GPencil: Cleanup pep8
a09cc3ee1a99f2cd5040bbf30c8ab8c588bb2bb1
# Cleanup: trailing space, remove tabs, pep8
c42a6b77b52560d257279de2cb624b4ef2c0d24c
# Cleanup: use C style doxygen comments
8c1726918374e1d2d2123e17bae8db5aadde3433
# Cleanup: use doxy sections for imbuf
c207f7c22e1439e0b285fba5d2c072bdae23f981
# Cleanup: clang-format
c4d8f6a4a8ddc29ed27311ed7578b3c8c31399d2
b5d310b569e07a937798a2d38539cfd290149f1c
8c846cccd6bdfd3e90a695fabbf05f53e5466a57
4eac03d821fa17546f562485f7d073813a5e5943
1166110a9d66af9c5a47cee2be591f50fdc445e8
# Cleanup: clang-format.
40d4a4cb1a6b4c3c2a486e8f2868f547530e0811

3
.gitignore vendored
View File

@@ -46,3 +46,6 @@ Desktop.ini
# smoke simulation noise tile (generated)
waveletNoiseTile.bin
# testing environment
/Testing

View File

@@ -43,8 +43,8 @@ endif()
cmake_minimum_required(VERSION 3.10)
# Prever LEGACY OpenGL to eb compatible with all the existing releases and
# platforms which don't hare GLVND yet. Only do it if preference was not set
# Prefer LEGACY OpenGL to be compatible with all the existing releases and
# platforms which don't have GLVND yet. Only do it if preference was not set
# externally.
if(NOT DEFINED OpenGL_GL_PREFERENCE)
set(OpenGL_GL_PREFERENCE "LEGACY")
@@ -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)")
@@ -178,6 +177,7 @@ mark_as_advanced(BUILDINFO_OVERRIDE_TIME)
option(WITH_IK_ITASC "Enable ITASC IK solver (only disable for development & for incompatible C++ compilers)" ON)
option(WITH_IK_SOLVER "Enable Legacy IK solver (only disable for development)" ON)
option(WITH_FFTW3 "Enable FFTW3 support (Used for smoke, ocean sim, and audio effects)" ON)
option(WITH_PUGIXML "Enable PugiXML support (Used for OpenImageIO, Grease Pencil SVG export)" ON)
option(WITH_BULLET "Enable Bullet (Physics Engine)" ON)
option(WITH_SYSTEM_BULLET "Use the systems bullet library (currently unsupported due to missing features in upstream!)" )
mark_as_advanced(WITH_SYSTEM_BULLET)
@@ -203,7 +203,8 @@ option(WITH_OPENVDB "Enable features relying on OpenVDB" ON)
option(WITH_OPENVDB_BLOSC "Enable blosc compression for OpenVDB, only enable if OpenVDB was built with blosc support" ON)
option(WITH_OPENVDB_3_ABI_COMPATIBLE "Assume OpenVDB library has been compiled with version 3 ABI compatibility" OFF)
mark_as_advanced(WITH_OPENVDB_3_ABI_COMPATIBLE)
option(WITH_NANOVDB "Enable usage of NanoVDB data structure for accelerated rendering on the GPU" OFF)
option(WITH_NANOVDB "Enable usage of NanoVDB data structure for rendering on the GPU" ON)
option(WITH_HARU "Enable features relying on Libharu (Grease pencil PDF export)" ON)
# GHOST Windowing Library Options
option(WITH_GHOST_DEBUG "Enable debugging output for the GHOST library" OFF)
@@ -235,9 +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)
@@ -299,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)
@@ -346,16 +363,21 @@ if(UNIX AND NOT APPLE)
endif()
option(WITH_PYTHON_INSTALL "Copy system python into the blender install folder" ON)
if((WITH_AUDASPACE AND NOT WITH_SYSTEM_AUDASPACE) OR WITH_MOD_FLUID)
option(WITH_PYTHON_NUMPY "Include NumPy in Blender (used by Audaspace and Mantaflow)" ON)
endif()
if(WIN32 OR APPLE)
# Windows and macOS have this bundled with Python libraries.
elseif(WITH_PYTHON_INSTALL OR (WITH_AUDASPACE AND NOT WITH_SYSTEM_AUDASPACE))
elseif(WITH_PYTHON_INSTALL OR WITH_PYTHON_NUMPY)
set(PYTHON_NUMPY_PATH "" CACHE PATH "Path to python site-packages or dist-packages containing 'numpy' module")
mark_as_advanced(PYTHON_NUMPY_PATH)
set(PYTHON_NUMPY_INCLUDE_DIRS ${PYTHON_NUMPY_PATH}/numpy/core/include CACHE PATH "Path to the include directory of the numpy module")
set(PYTHON_NUMPY_INCLUDE_DIRS "" CACHE PATH "Path to the include directory of the NumPy module")
mark_as_advanced(PYTHON_NUMPY_INCLUDE_DIRS)
endif()
if(WITH_PYTHON_INSTALL)
option(WITH_PYTHON_INSTALL_NUMPY "Copy system numpy into the blender install folder" ON)
option(WITH_PYTHON_INSTALL_NUMPY "Copy system NumPy into the blender install folder" ON)
if(UNIX AND NOT APPLE)
option(WITH_PYTHON_INSTALL_REQUESTS "Copy system requests into the blender install folder" ON)
@@ -364,8 +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)
@@ -377,6 +399,7 @@ option(WITH_CYCLES_CUDA_BINARIES "Build Cycles CUDA binaries" OFF)
option(WITH_CYCLES_CUBIN_COMPILER "Build cubins with nvrtc based compiler instead of nvcc" OFF)
option(WITH_CYCLES_CUDA_BUILD_SERIAL "Build cubins one after another (useful on machines with limited RAM)" OFF)
mark_as_advanced(WITH_CYCLES_CUDA_BUILD_SERIAL)
set(CYCLES_TEST_DEVICES CPU CACHE STRING "Run regression tests on the specified device types (CPU CUDA OPTIX OPENCL)" )
set(CYCLES_CUDA_BINARIES_ARCH sm_30 sm_35 sm_37 sm_50 sm_52 sm_60 sm_61 sm_70 sm_75 sm_86 compute_75 CACHE STRING "CUDA architectures to build binaries for")
mark_as_advanced(CYCLES_CUDA_BINARIES_ARCH)
unset(PLATFORM_DEFAULT)
@@ -409,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)
@@ -425,8 +449,8 @@ mark_as_advanced(WITH_CXX_GUARDEDALLOC)
option(WITH_ASSERT_ABORT "Call abort() when raising an assertion through BLI_assert()" ON)
mark_as_advanced(WITH_ASSERT_ABORT)
if(UNIX AND NOT APPLE)
option(WITH_CLANG_TIDY "Use Clang Tidy to analyze the source code (only enable for development on Linux using Clang)" OFF)
if((UNIX AND NOT APPLE) OR (CMAKE_GENERATOR MATCHES "^Visual Studio.+"))
option(WITH_CLANG_TIDY "Use Clang Tidy to analyze the source code (only enable for development on Linux using Clang, or Windows using the Visual Studio IDE)" OFF)
mark_as_advanced(WITH_CLANG_TIDY)
endif()
@@ -496,10 +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 \
@@ -526,10 +550,10 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
# Silence the warning that object-size is not effective in -O0.
set(_asan_defaults "${_asan_defaults}")
else()
set(_asan_defaults "${_asan_defaults} -fsanitize=object-size")
string(APPEND _asan_defaults " -fsanitize=object-size")
endif()
else()
set(_asan_defaults "${_asan_defaults} -fsanitize=leak -fsanitize=object-size")
string(APPEND _asan_defaults " -fsanitize=leak -fsanitize=object-size")
endif()
set(COMPILER_ASAN_CFLAGS "${_asan_defaults}" CACHE STRING "C flags for address sanitizer")
@@ -570,6 +594,11 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
endif()
endif()
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
option(WITH_COMPILER_SHORT_FILE_MACRO "Make paths in macros like __FILE__ relative to top level source and build directories." ON)
mark_as_advanced(WITH_COMPILER_SHORT_FILE_MACRO)
endif()
if(WIN32)
# Use hardcoded paths or find_package to find externals
option(WITH_WINDOWS_FIND_MODULES "Use find_package to locate libraries" OFF)
@@ -598,6 +627,12 @@ if(WIN32)
endif()
if(UNIX)
# See WITH_WINDOWS_SCCACHE for Windows.
option(WITH_COMPILER_CCACHE "Use ccache to improve rebuild times (Works with Ninja, Makefiles and Xcode)" OFF)
mark_as_advanced(WITH_COMPILER_CCACHE)
endif()
# The following only works with the Ninja generator in CMake >= 3.0.
if("${CMAKE_GENERATOR}" MATCHES "Ninja")
option(WITH_NINJA_POOL_JOBS
@@ -652,16 +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")
@@ -672,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")
@@ -692,6 +720,8 @@ set_and_warn_dependency(WITH_BOOST WITH_OPENCOLORIO OFF)
set_and_warn_dependency(WITH_BOOST WITH_QUADRIFLOW OFF)
set_and_warn_dependency(WITH_BOOST WITH_USD OFF)
set_and_warn_dependency(WITH_BOOST WITH_ALEMBIC OFF)
set_and_warn_dependency(WITH_PUGIXML WITH_CYCLES_OSL OFF)
set_and_warn_dependency(WITH_PUGIXML WITH_OPENIMAGEIO OFF)
if(WITH_BOOST AND NOT (WITH_CYCLES OR WITH_OPENIMAGEIO OR WITH_INTERNATIONAL OR
WITH_OPENVDB OR WITH_OPENCOLORIO OR WITH_USD OR WITH_ALEMBIC))
@@ -708,8 +738,12 @@ set_and_warn_dependency(WITH_TBB WITH_MOD_FLUID OFF)
# NanoVDB requires OpenVDB to convert the data structure
set_and_warn_dependency(WITH_OPENVDB WITH_NANOVDB OFF)
# OpenVDB uses 'half' type from OpenEXR & fails to link without OpenEXR enabled.
# OpenVDB and OpenColorIO uses 'half' type from OpenEXR
set_and_warn_dependency(WITH_IMAGE_OPENEXR WITH_OPENVDB OFF)
set_and_warn_dependency(WITH_IMAGE_OPENEXR WITH_OPENCOLORIO OFF)
# Haru needs `TIFFFaxBlackCodes` & `TIFFFaxWhiteCodes` symbols from TIFF.
set_and_warn_dependency(WITH_IMAGE_TIFF WITH_HARU OFF)
# auto enable openimageio for cycles
if(WITH_CYCLES)
@@ -718,6 +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)
@@ -740,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)
@@ -751,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)
@@ -778,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()
@@ -807,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")
@@ -858,11 +886,11 @@ if(NOT CMAKE_BUILD_TYPE MATCHES "Release")
# Since linker flags are not set, all compiler checks and `find_package`
# calls that rely on `try_compile` will fail.
# See CMP0066 also.
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${COMPILER_ASAN_CFLAGS}")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} ${COMPILER_ASAN_CFLAGS}")
string(APPEND CMAKE_C_FLAGS_DEBUG " ${COMPILER_ASAN_CFLAGS}")
string(APPEND CMAKE_C_FLAGS_RELWITHDEBINFO " ${COMPILER_ASAN_CFLAGS}")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${COMPILER_ASAN_CXXFLAGS}")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${COMPILER_ASAN_CXXFLAGS}")
string(APPEND CMAKE_CXX_FLAGS_DEBUG " ${COMPILER_ASAN_CXXFLAGS}")
string(APPEND CMAKE_CXX_FLAGS_RELWITHDEBINFO " ${COMPILER_ASAN_CXXFLAGS}")
endif()
if(MSVC)
set(COMPILER_ASAN_LINKER_FLAGS "/FUNCTIONPADMIN:6")
@@ -870,9 +898,11 @@ if(NOT CMAKE_BUILD_TYPE MATCHES "Release")
if(APPLE AND COMPILER_ASAN_LIBRARY)
string(REPLACE " " ";" _list_COMPILER_ASAN_CFLAGS ${COMPILER_ASAN_CFLAGS})
add_compile_options("$<$<NOT:$<CONFIG:Release>>:${_list_COMPILER_ASAN_CFLAGS}>")
add_link_options("$<$<NOT:$<CONFIG:Release>>:-fno-omit-frame-pointer;-fsanitize=address>")
set(_is_CONFIG_DEBUG "$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>")
add_compile_options("$<${_is_CONFIG_DEBUG}:${_list_COMPILER_ASAN_CFLAGS}>")
add_link_options("$<${_is_CONFIG_DEBUG}:-fno-omit-frame-pointer;-fsanitize=address>")
unset(_list_COMPILER_ASAN_CFLAGS)
unset(_is_CONFIG_DEBUG)
elseif(COMPILER_ASAN_LIBRARY)
set(PLATFORM_LINKLIBS "${PLATFORM_LINKLIBS};${COMPILER_ASAN_LIBRARY}")
set(PLATFORM_LINKFLAGS "${COMPILER_ASAN_LIBRARY} ${COMPILER_ASAN_LINKER_FLAGS}")
@@ -881,6 +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
#
@@ -936,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)
set(PLATFORM_CFLAGS " ${COMPILER_SSE_FLAG} ${PLATFORM_CFLAGS}")
add_definitions(-D__SSE__ -D__MMX__)
endif()
if(SUPPORT_SSE2_BUILD)
set(PLATFORM_CFLAGS " ${PLATFORM_CFLAGS} ${COMPILER_SSE2_FLAG}")
add_definitions(-D__SSE2__)
if(NOT SUPPORT_SSE_BUILD) # don't double up
add_definitions(-D__MMX__)
# Enable SIMD support if detected by TEST_SSE_SUPPORT() or TEST_NEON_SUPPORT().
#
# This is done globally, so that all modules can use it if available, and
# because these are used in headers used by many modules.
if(WITH_CPU_SIMD)
if(SUPPORT_NEON_BUILD)
# Neon
if(SSE2NEON_FOUND)
blender_include_dirs_sys("${SSE2NEON_INCLUDE_DIRS}")
add_definitions(-DWITH_SSE2NEON)
endif()
else()
# SSE
if(SUPPORT_SSE_BUILD)
string(PREPEND PLATFORM_CFLAGS "${COMPILER_SSE_FLAG} ")
add_definitions(-D__SSE__ -D__MMX__)
endif()
if(SUPPORT_SSE2_BUILD)
string(APPEND PLATFORM_CFLAGS " ${COMPILER_SSE2_FLAG}")
add_definitions(-D__SSE2__)
if(NOT SUPPORT_SSE_BUILD) # don't double up
add_definitions(-D__MMX__)
endif()
endif()
endif()
endif()
# Print instructions used
if(SUPPORT_NEON_BUILD)
if(SSE2NEON_FOUND)
message(STATUS "Neon SIMD instructions enabled")
else()
message(STATUS "Neon SIMD instructions detected but unused, requires sse2neon")
endif()
elseif(SUPPORT_SSE2_BUILD)
message(STATUS "SSE2 SIMD instructions enabled")
elseif(SUPPORT_SSE_BUILD)
message(STATUS "SSE SIMD instructions enabled")
else()
message(STATUS "No SIMD instructions detected")
endif()
else()
message(STATUS "SIMD instructions disabled")
endif()
# set the endian define
if(MSVC)
@@ -997,6 +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}
@@ -1157,8 +1229,10 @@ if(WITH_OPENMP)
if(OPENMP_FOUND)
if(NOT WITH_OPENMP_STATIC)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
string(APPEND CMAKE_C_FLAGS " ${OpenMP_C_FLAGS}")
string(APPEND CMAKE_CXX_FLAGS " ${OpenMP_CXX_FLAGS}")
string(APPEND CMAKE_EXE_LINKER_FLAGS " ${OpenMP_LINKER_FLAGS}")
string(APPEND CMAKE_MODULE_LINKER_FLAGS " ${OpenMP_LINKER_FLAGS}")
else()
# Typically avoid adding flags as defines but we can't
# pass OpenMP flags to the linker for static builds, meaning
@@ -1169,6 +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()
@@ -1244,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()
@@ -1412,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
@@ -1449,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")
@@ -1475,10 +1553,14 @@ if(CMAKE_COMPILER_IS_GNUCC)
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_INT_IN_BOOL_CONTEXT -Wno-int-in-bool-context)
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_FORMAT -Wno-format)
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_SWITCH -Wno-switch)
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_VARIABLE -Wno-unused-variable)
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_VARIABLE -Wno-uninitialized)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_REMOVE_STRICT_FLAGS CXX_WARN_NO_CLASS_MEMACCESS -Wno-class-memaccess)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_REMOVE_STRICT_FLAGS CXX_WARN_NO_COMMENT -Wno-comment)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_REMOVE_STRICT_FLAGS CXX_WARN_NO_UNUSED_TYPEDEFS -Wno-unused-local-typedefs)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_REMOVE_STRICT_FLAGS CXX_WARN_NO_UNUSED_VARIABLE -Wno-unused-variable)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_REMOVE_STRICT_FLAGS CXX_WARN_NO_UNUSED_VARIABLE -Wno-uninitialized)
if(CMAKE_COMPILER_IS_GNUCC AND (NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "7.0"))
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_IMPLICIT_FALLTHROUGH -Wno-implicit-fallthrough)
@@ -1508,6 +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)
@@ -1517,6 +1601,7 @@ elseif(CMAKE_C_COMPILER_ID MATCHES "Clang")
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_PARAMETER -Wno-unused-parameter)
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_VARIABLE -Wno-unused-variable)
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_MACROS -Wno-unused-macros)
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_MISLEADING_INDENTATION -Wno-misleading-indentation)
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_MISSING_VARIABLE_DECLARATIONS -Wno-missing-variable-declarations)
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_INCOMPAT_PTR_DISCARD_QUAL -Wno-incompatible-pointer-types-discards-qualifiers)
@@ -1527,15 +1612,18 @@ elseif(CMAKE_C_COMPILER_ID MATCHES "Clang")
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_UNDEF -Wno-undef)
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_MISSING_NORETURN -Wno-missing-noreturn)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_REMOVE_STRICT_FLAGS CXX_WARN_NO_UNUSED_PARAMETER -Wno-unused-parameter)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_REMOVE_STRICT_FLAGS CXX_WARN_NO_UNUSED_PRIVATE_FIELD -Wno-unused-private-field)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_REMOVE_STRICT_FLAGS CXX_WARN_NO_CXX11_NARROWING -Wno-c++11-narrowing)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_REMOVE_STRICT_FLAGS CXX_WARN_NO_NON_VIRTUAL_DTOR -Wno-non-virtual-dtor)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_REMOVE_STRICT_FLAGS CXX_WARN_NO_UNUSED_MACROS -Wno-unused-macros)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_REMOVE_STRICT_FLAGS CXX_WARN_NO_UNUSED_VARIABLE -Wno-unused-variable)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_REMOVE_STRICT_FLAGS CXX_WARN_NO_REORDER -Wno-reorder)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_REMOVE_STRICT_FLAGS CXX_WARN_NO_COMMENT -Wno-comment)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_REMOVE_STRICT_FLAGS CXX_WARN_NO_UNUSED_TYPEDEFS -Wno-unused-local-typedefs)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_REMOVE_STRICT_FLAGS CXX_WARN_NO_UNDEFINED_VAR_TEMPLATE -Wno-undefined-var-template)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_REMOVE_STRICT_FLAGS CXX_WARN_NO_INSTANTIATION_AFTER_SPECIALIZATION -Wno-instantiation-after-specialization)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_REMOVE_STRICT_FLAGS CXX_WARN_NO_MISLEADING_INDENTATION -Wno-misleading-indentation)
elseif(CMAKE_C_COMPILER_ID MATCHES "Intel")
@@ -1548,8 +1636,8 @@ elseif(CMAKE_C_COMPILER_ID MATCHES "Intel")
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_SIGN_COMPARE -Wno-sign-compare)
# disable numbered, false positives
set(C_WARNINGS "${C_WARNINGS} -wd188,186,144,913,556,858,597,177,1292,167,279,592,94,2722,3199")
set(CXX_WARNINGS "${CXX_WARNINGS} -wd188,186,144,913,556,858,597,177,1292,167,279,592,94,2722,3199")
string(APPEND C_WARNINGS " -wd188,186,144,913,556,858,597,177,1292,167,279,592,94,2722,3199")
string(APPEND CXX_WARNINGS " -wd188,186,144,913,556,858,597,177,1292,167,279,592,94,2722,3199")
elseif(CMAKE_C_COMPILER_ID MATCHES "MSVC")
# most msvc warnings are C & C++
set(_WARNINGS
@@ -1580,7 +1668,7 @@ elseif(CMAKE_C_COMPILER_ID MATCHES "MSVC")
if(MSVC_VERSION GREATER_EQUAL 1911)
# see https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/c5038?view=vs-2017
set(_WARNINGS "${_WARNINGS} /w35038") # order of initialization in c++ constructors
string(APPEND _WARNINGS " /w35038") # order of initialization in c++ constructors
endif()
string(REPLACE ";" " " _WARNINGS "${_WARNINGS}")
@@ -1604,36 +1692,33 @@ if(WITH_PYTHON)
if(WIN32 OR APPLE)
# Windows and macOS have this bundled with Python libraries.
elseif((WITH_PYTHON_INSTALL AND WITH_PYTHON_INSTALL_NUMPY) OR (WITH_AUDASPACE AND NOT WITH_SYSTEM_AUDASPACE))
elseif((WITH_PYTHON_INSTALL AND WITH_PYTHON_INSTALL_NUMPY) OR WITH_PYTHON_NUMPY)
if(("${PYTHON_NUMPY_PATH}" STREQUAL "") OR (${PYTHON_NUMPY_PATH} MATCHES NOTFOUND))
find_python_package(numpy)
unset(PYTHON_NUMPY_INCLUDE_DIRS CACHE)
set(PYTHON_NUMPY_INCLUDE_DIRS ${PYTHON_NUMPY_PATH}/numpy/core/include CACHE PATH "Path to the include directory of the numpy module")
mark_as_advanced(PYTHON_NUMPY_INCLUDE_DIRS)
find_python_package(numpy "core/include")
endif()
endif()
if(WIN32 OR APPLE)
# pass, we have this in lib/python/site-packages
elseif(WITH_PYTHON_INSTALL_REQUESTS)
find_python_package(requests)
find_python_package(requests "")
endif()
endif()
if(MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++17")
string(APPEND CMAKE_CXX_FLAGS " /std:c++17")
# Make MSVC properly report the value of the __cplusplus preprocessor macro
# Available MSVC 15.7 (1914) and up, without this it reports 199711L regardless
# of the C++ standard chosen above
if(MSVC_VERSION GREATER 1913)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zc:__cplusplus")
string(APPEND CMAKE_CXX_FLAGS " /Zc:__cplusplus")
endif()
elseif(
CMAKE_COMPILER_IS_GNUCC OR
CMAKE_C_COMPILER_ID MATCHES "Clang" OR
CMAKE_C_COMPILER_ID MATCHES "Intel"
)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
string(APPEND CMAKE_CXX_FLAGS " -std=c++17")
else()
message(FATAL_ERROR "Unknown compiler ${CMAKE_C_COMPILER_ID}, can't enable C++17 build")
endif()
@@ -1646,12 +1731,47 @@ if(
(CMAKE_C_COMPILER_ID MATCHES "Intel")
)
# Use C11 + GNU extensions, works with GCC, Clang, ICC
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu11")
string(APPEND CMAKE_C_FLAGS " -std=gnu11")
endif()
if(UNIX AND NOT APPLE)
if(NOT WITH_CXX11_ABI)
set(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -D_GLIBCXX_USE_CXX11_ABI=0")
string(APPEND PLATFORM_CFLAGS " -D_GLIBCXX_USE_CXX11_ABI=0")
endif()
endif()
if(WITH_COMPILER_SHORT_FILE_MACRO)
# Use '-fmacro-prefix-map' for Clang and GCC (MSVC doesn't support this).
ADD_CHECK_C_COMPILER_FLAG(C_PREFIX_MAP_FLAGS C_MACRO_PREFIX_MAP -fmacro-prefix-map=foo=bar)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_PREFIX_MAP_FLAGS CXX_MACRO_PREFIX_MAP -fmacro-prefix-map=foo=bar)
if(C_MACRO_PREFIX_MAP AND CXX_MACRO_PREFIX_MAP)
if(APPLE)
if(XCODE AND ${XCODE_VERSION} VERSION_LESS 12.0)
# Developers may have say LLVM Clang-10.0.1 toolchain (which supports the flag)
# with Xcode-11 (the Clang of which doesn't support the flag).
message(WARNING
"-fmacro-prefix-map flag is NOT supported by Clang shipped with Xcode-${XCODE_VERSION}."
" Some Xcode functionality in Product menu may not work. Disabling WITH_COMPILER_SHORT_FILE_MACRO."
)
set(WITH_COMPILER_SHORT_FILE_MACRO OFF)
endif()
endif()
if(WITH_COMPILER_SHORT_FILE_MACRO)
path_ensure_trailing_slash(_src_dir "${CMAKE_SOURCE_DIR}")
path_ensure_trailing_slash(_bin_dir "${CMAKE_BINARY_DIR}")
# Keep this variable so it can be stripped from build-info.
set(PLATFORM_CFLAGS_FMACRO_PREFIX_MAP
"-fmacro-prefix-map=\"${_src_dir}\"=\"\" -fmacro-prefix-map=\"${_bin_dir}\"=\"\"")
string(APPEND PLATFORM_CFLAGS " ${PLATFORM_CFLAGS_FMACRO_PREFIX_MAP}")
unset(_src_dir)
unset(_bin_dir)
endif()
else()
message(WARNING
"-fmacro-prefix-map flag is NOT supported by C/C++ compiler."
" Disabling WITH_COMPILER_SHORT_FILE_MACRO."
)
set(WITH_COMPILER_SHORT_FILE_MACRO OFF)
endif()
endif()
@@ -1704,8 +1824,20 @@ if(WITH_BLENDER)
# internal and external library information first, for test linking
add_subdirectory(source)
elseif(WITH_CYCLES_STANDALONE)
add_subdirectory(intern/glew-mx)
add_subdirectory(intern/guardedalloc)
add_subdirectory(intern/libc_compat)
add_subdirectory(intern/numaapi)
add_subdirectory(intern/sky)
add_subdirectory(intern/cycles)
add_subdirectory(extern/clew)
if(WITH_CYCLES_LOGGING)
if(NOT WITH_SYSTEM_GFLAGS)
add_subdirectory(extern/gflags)
endif()
add_subdirectory(extern/glog)
endif()
if(WITH_CUDA_DYNLOAD)
add_subdirectory(extern/cuew)
endif()
@@ -1714,6 +1846,10 @@ elseif(WITH_CYCLES_STANDALONE)
endif()
endif()
#-----------------------------------------------------------------------------
# Testing
add_subdirectory(tests)
#-----------------------------------------------------------------------------
# Blender Application
if(WITH_BLENDER)
@@ -1721,11 +1857,6 @@ if(WITH_BLENDER)
endif()
#-----------------------------------------------------------------------------
# Testing
add_subdirectory(tests)
#-----------------------------------------------------------------------------
# Define 'heavy' submodules (for Ninja builder when using pools).
setup_heavy_lib_pool()
@@ -1755,7 +1886,7 @@ if(FIRST_RUN)
set(_msg " - ${_setting}")
string(LENGTH "${_msg}" _len)
while("32" GREATER "${_len}")
set(_msg "${_msg} ")
string(APPEND _msg " ")
math(EXPR _len "${_len} + 1")
endwhile()
@@ -1773,24 +1904,28 @@ if(FIRST_RUN)
message(STATUS "C++ Compiler: \"${CMAKE_CXX_COMPILER_ID}\"")
info_cfg_text("Build Options:")
info_cfg_option(WITH_ALEMBIC)
info_cfg_option(WITH_BULLET)
info_cfg_option(WITH_IK_SOLVER)
info_cfg_option(WITH_IK_ITASC)
info_cfg_option(WITH_OPENCOLLADA)
info_cfg_option(WITH_FFTW3)
info_cfg_option(WITH_INTERNATIONAL)
info_cfg_option(WITH_INPUT_NDOF)
info_cfg_option(WITH_CLANG)
info_cfg_option(WITH_CYCLES)
info_cfg_option(WITH_FFTW3)
info_cfg_option(WITH_FREESTYLE)
info_cfg_option(WITH_GMP)
info_cfg_option(WITH_HARU)
info_cfg_option(WITH_IK_ITASC)
info_cfg_option(WITH_IK_SOLVER)
info_cfg_option(WITH_INPUT_NDOF)
info_cfg_option(WITH_INTERNATIONAL)
info_cfg_option(WITH_OPENCOLLADA)
info_cfg_option(WITH_OPENCOLORIO)
info_cfg_option(WITH_XR_OPENXR)
info_cfg_option(WITH_OPENIMAGEDENOISE)
info_cfg_option(WITH_OPENVDB)
info_cfg_option(WITH_ALEMBIC)
info_cfg_option(WITH_POTRACE)
info_cfg_option(WITH_PUGIXML)
info_cfg_option(WITH_QUADRIFLOW)
info_cfg_option(WITH_USD)
info_cfg_option(WITH_TBB)
info_cfg_option(WITH_GMP)
info_cfg_option(WITH_USD)
info_cfg_option(WITH_XR_OPENXR)
info_cfg_text("Compiler Options:")
info_cfg_option(WITH_BUILDINFO)
@@ -1798,58 +1933,62 @@ if(FIRST_RUN)
info_cfg_text("System Options:")
info_cfg_option(WITH_INSTALL_PORTABLE)
info_cfg_option(WITH_MEM_JEMALLOC)
info_cfg_option(WITH_MEM_VALGRIND)
info_cfg_option(WITH_SYSTEM_GLEW)
info_cfg_option(WITH_X11_ALPHA)
info_cfg_option(WITH_X11_XF86VMODE)
info_cfg_option(WITH_X11_XFIXES)
info_cfg_option(WITH_X11_XINPUT)
info_cfg_option(WITH_MEM_JEMALLOC)
info_cfg_option(WITH_MEM_VALGRIND)
info_cfg_option(WITH_SYSTEM_GLEW)
info_cfg_text("Image Formats:")
info_cfg_option(WITH_OPENIMAGEIO)
info_cfg_option(WITH_IMAGE_CINEON)
info_cfg_option(WITH_IMAGE_DDS)
info_cfg_option(WITH_IMAGE_HDR)
info_cfg_option(WITH_IMAGE_OPENEXR)
info_cfg_option(WITH_IMAGE_OPENJPEG)
info_cfg_option(WITH_IMAGE_TIFF)
info_cfg_option(WITH_OPENIMAGEIO)
info_cfg_text("Audio:")
info_cfg_option(WITH_OPENAL)
info_cfg_option(WITH_SDL)
info_cfg_option(WITH_SDL_DYNLOAD)
info_cfg_option(WITH_JACK)
info_cfg_option(WITH_JACK_DYNLOAD)
info_cfg_option(WITH_CODEC_AVI)
info_cfg_option(WITH_CODEC_FFMPEG)
info_cfg_option(WITH_CODEC_SNDFILE)
info_cfg_option(WITH_COREAUDIO)
info_cfg_option(WITH_JACK)
info_cfg_option(WITH_JACK_DYNLOAD)
info_cfg_option(WITH_OPENAL)
info_cfg_option(WITH_PULSEAUDIO)
info_cfg_option(WITH_PULSEAUDIO_DYNLOAD)
info_cfg_option(WITH_SDL)
info_cfg_option(WITH_SDL_DYNLOAD)
info_cfg_option(WITH_WASAPI)
info_cfg_text("Compression:")
info_cfg_option(WITH_LZMA)
info_cfg_option(WITH_LZO)
info_cfg_text("Python:")
if(APPLE)
info_cfg_option(WITH_PYTHON_FRAMEWORK)
endif()
info_cfg_option(WITH_PYTHON_INSTALL)
info_cfg_option(WITH_PYTHON_INSTALL_NUMPY)
info_cfg_option(WITH_PYTHON_MODULE)
info_cfg_option(WITH_PYTHON_SAFETY)
if(APPLE)
info_cfg_option(WITH_PYTHON_FRAMEWORK)
endif()
info_cfg_text("Modifiers:")
info_cfg_option(WITH_MOD_REMESH)
info_cfg_option(WITH_MOD_FLUID)
info_cfg_option(WITH_MOD_OCEANSIM)
info_cfg_option(WITH_MOD_REMESH)
info_cfg_text("OpenGL:")
info_cfg_option(WITH_GLEW_ES)
info_cfg_option(WITH_GL_EGL)
info_cfg_option(WITH_GL_PROFILE_ES20)
if(WIN32)
info_cfg_option(WITH_GL_ANGLE)
endif()
info_cfg_option(WITH_GL_EGL)
info_cfg_option(WITH_GL_PROFILE_ES20)
info_cfg_option(WITH_GLEW_ES)
info_cfg_text("")

View File

@@ -26,25 +26,31 @@
define HELP_TEXT
Convenience Targets
Blender Convenience Targets
Provided for building Blender, (multiple at once can be used).
* debug: Build a debug binary.
* full: Enable all supported dependencies & options.
* lite: Disable non essential features for a smaller binary and faster build.
* release Complete build with all options enabled including CUDA and Optix, matching the releases on blender.org
* release: Complete build with all options enabled including CUDA and Optix, matching the releases on blender.org
* headless: Build without an interface (renderfarm or server automation).
* cycles: Build Cycles standalone only, without Blender.
* bpy: Build as a python module which can be loaded from python directly.
* deps: Build library dependencies (intended only for platform maintainers).
* developer: Enable faster builds, error checking and tests, recommended for developers.
* config: Run cmake configuration tool to set build options.
* ninja: Use ninja build tool for faster builds.
* ccache: Use ccache for faster rebuilds.
Note: passing the argument 'BUILD_DIR=path' when calling make will override the default build dir.
Note: passing the argument 'BUILD_CMAKE_ARGS=args' lets you add cmake arguments.
Other Convenience Targets
Provided for other building operations.
* config: Run cmake configuration tool to set build options.
* deps: Build library dependencies (intended only for platform maintainers).
The existance of locally build dependancies overrides the pre-built dependencies from subversion.
These must be manually removed from '../lib/' to go back to using the pre-compiled libraries.
Project Files
Generate project files for development environments.
@@ -84,12 +90,15 @@ Static Source Code Checking
* check_descriptions: Check for duplicate/invalid descriptions.
Spell Checkers
This runs the spell checker from the developer tools repositor.
* check_spelling_c: Check for spelling errors (C/C++ only),
* check_spelling_osl: Check for spelling errors (OSL only).
* check_spelling_py: Check for spelling errors (Python only).
Note that spell checkers can tak a 'CHECK_SPELLING_CACHE' filepath argument,
Note: an additional word-list is maintained at: 'source/tools/check_source/check_spelling_c_config.py'
Note: that spell checkers can take a 'CHECK_SPELLING_CACHE' filepath argument,
so re-running does not need to re-check unchanged files.
Example:
@@ -119,10 +128,16 @@ Utilities
* source_archive:
Create a compressed archive of the source code.
* update:
updates git and all submodules
* source_archive_complete:
Create a compressed archive of the source code and all the libraries of dependencies.
* format
* update:
Updates git and all submodules and svn.
* update_code:
Updates git and all submodules but not svn.
* format:
Format source code using clang (uses PATHS if passed in). For example::
make format PATHS="source/blender/blenlib source/blender/blenkernel"
@@ -182,8 +197,13 @@ endif
ifndef DEPS_INSTALL_DIR
DEPS_INSTALL_DIR:=$(shell dirname "$(BLENDER_DIR)")/lib/$(OS_NCASE)
ifneq ($(OS_NCASE),darwin)
# Add processor type to directory name
# Add processor type to directory name, except for darwin x86_64
# which by convention does not have it.
ifeq ($(OS_NCASE),darwin)
ifneq ($(CPU),x86_64)
DEPS_INSTALL_DIR:=$(DEPS_INSTALL_DIR)_$(CPU)
endif
else
DEPS_INSTALL_DIR:=$(DEPS_INSTALL_DIR)_$(CPU)
endif
endif
@@ -197,7 +217,7 @@ endif
# in libraries, or python 2 for running make update to get it.
ifeq ($(OS_NCASE),darwin)
ifeq (, $(shell command -v $(PYTHON)))
PYTHON:=../lib/darwin/python/bin/python3.7m
PYTHON:=$(DEPS_INSTALL_DIR)/python/bin/python3.7m
ifeq (, $(shell command -v $(PYTHON)))
PYTHON:=python
endif
@@ -241,6 +261,10 @@ ifneq "$(findstring developer, $(MAKECMDGOALS))" ""
CMAKE_CONFIG_ARGS:=-C"$(BLENDER_DIR)/build_files/cmake/config/blender_developer.cmake" $(CMAKE_CONFIG_ARGS)
endif
ifneq "$(findstring ccache, $(MAKECMDGOALS))" ""
CMAKE_CONFIG_ARGS:=-DWITH_COMPILER_CCACHE=YES $(CMAKE_CONFIG_ARGS)
endif
# -----------------------------------------------------------------------------
# build tool
@@ -340,6 +364,7 @@ headless: all
bpy: all
developer: all
ninja: all
ccache: all
# -----------------------------------------------------------------------------
# Build dependencies
@@ -455,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) \
@@ -487,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
@@ -503,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)
@@ -514,7 +552,7 @@ format: .FORCE
# Simple version of ./doc/python_api/sphinx_doc_gen.sh with no PDF generation.
doc_py: .FORCE
ASAN_OPTIONS=halt_on_error=0 \
ASAN_OPTIONS=halt_on_error=0:${ASAN_OPTIONS} \
$(BLENDER_BIN) --background -noaudio --factory-startup \
--python doc/python_api/sphinx_doc_gen.py
sphinx-build -b html -j $(NPROCS) doc/python_api/sphinx-in doc/python_api/sphinx-out

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()
@@ -85,38 +85,42 @@ include(cmake/flexbison.cmake)
include(cmake/osl.cmake)
include(cmake/tbb.cmake)
include(cmake/openvdb.cmake)
include(cmake/nanovdb.cmake)
include(cmake/python.cmake)
option(USE_PIP_NUMPY "Install NumPy using pip wheel instead of building from source" OFF)
if(APPLE AND ("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "x86_64"))
set(USE_PIP_NUMPY ON)
else()
include(cmake/numpy.cmake)
endif()
include(cmake/python_site_packages.cmake)
include(cmake/package_python.cmake)
include(cmake/numpy.cmake)
include(cmake/usd.cmake)
include(cmake/potrace.cmake)
include(cmake/haru.cmake)
# Boost needs to be included after python.cmake due to the PYTHON_BINARY variable being needed.
include(cmake/boost.cmake)
if(UNIX)
# Rely on PugiXML compiled with OpenImageIO
else()
include(cmake/pugixml.cmake)
endif()
if((NOT APPLE) OR ("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "x86_64"))
include(cmake/ispc.cmake)
include(cmake/openimagedenoise.cmake)
include(cmake/embree.cmake)
endif()
include(cmake/pugixml.cmake)
include(cmake/ispc.cmake)
include(cmake/openimagedenoise.cmake)
include(cmake/embree.cmake)
include(cmake/xml2.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(APPLE AND ("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "arm64"))
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)
@@ -142,7 +146,6 @@ if(NOT WIN32 OR ENABLE_MINGW64)
endif()
if(UNIX)
include(cmake/flac.cmake)
include(cmake/xml2.cmake)
if(NOT APPLE)
include(cmake/spnav.cmake)
include(cmake/jemalloc.cmake)
@@ -165,3 +168,4 @@ if(UNIX AND NOT APPLE)
endif()
include(cmake/harvest.cmake)
include(cmake/cve_check.cmake)

View File

@@ -19,16 +19,6 @@
set(ALEMBIC_EXTRA_ARGS
-DBUILDSTATIC=ON
-DLINKSTATIC=ON
-DALEMBIC_LIB_USES_BOOST=ON
-DBoost_COMPILER:STRING=${BOOST_COMPILER_STRING}
-DBoost_USE_MULTITHREADED=ON
-DUSE_STATIC_BOOST=On
-DBoost_USE_STATIC_LIBS=ON
-DBoost_USE_STATIC_RUNTIME=OFF
-DBoost_DEBUG=ON
-DBOOST_ROOT=${LIBDIR}/boost
-DBoost_NO_SYSTEM_PATHS=ON
-DBoost_NO_BOOST_CMAKE=ON
-DILMBASE_ROOT=${LIBDIR}/openexr
-DALEMBIC_ILMBASE_INCLUDE_DIRECTORY=${LIBDIR}/openexr/include/OpenEXR
-DALEMBIC_ILMBASE_HALF_LIB=${LIBDIR}/openexr/lib/${LIBPREFIX}Half${OPENEXR_VERSION_POSTFIX}${LIBEXT}
@@ -54,9 +44,9 @@ set(ALEMBIC_EXTRA_ARGS
)
ExternalProject_Add(external_alembic
URL ${ALEMBIC_URI}
URL file://${PACKAGE_DIR}/${ALEMBIC_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${ALEMBIC_MD5}
URL_HASH ${ALEMBIC_HASH_TYPE}=${ALEMBIC_HASH}
PREFIX ${BUILD_DIR}/alembic
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/alembic -Wno-dev ${DEFAULT_CMAKE_FLAGS} ${ALEMBIC_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/alembic
@@ -81,7 +71,6 @@ endif()
add_dependencies(
external_alembic
external_boost
external_zlib
external_openexr
)

View File

@@ -36,9 +36,9 @@ set(BLOSC_EXTRA_ARGS ${BLOSC_EXTRA_ARGS}
)
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

@@ -23,7 +23,7 @@ if(WIN32)
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)
@@ -86,9 +86,9 @@ 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}

View File

@@ -30,9 +30,9 @@ else()
endif()
ExternalProject_Add(external_bzip2
URL ${BZIP2_URI}
URL file://${PACKAGE_DIR}/${BZIP2_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH SHA256=${BZIP2_HASH}
URL_HASH ${BZIP2_HASH_TYPE}=${BZIP2_HASH}
PREFIX ${BUILD_DIR}/bzip2
CONFIGURE_COMMAND echo .
BUILD_COMMAND ${BZIP2_CONFIGURE_ENV} && cd ${BUILD_DIR}/bzip2/src/external_bzip2/ && make CFLAGS=${BZIP2_CFLAGS} LDFLAGS=${BZIP2_LDFLAGS} -j${MAKE_THREADS}

View File

@@ -33,6 +33,16 @@ if(UNIX)
yasm
)
if(NOT APPLE)
set(_required_software
${_required_software}
# Needed for Mesa.
meson
ninja
)
endif()
foreach(_software ${_required_software})
find_program(_software_find NAMES ${_software})
if(NOT _software_find)
@@ -42,8 +52,14 @@ if(UNIX)
endforeach()
if(APPLE)
if(NOT EXISTS "/usr/local/opt/bison/bin/bison")
set(_software_missing "${_software_missing} bison")
# Homebrew has different default locations for ARM and Intel macOS.
if("${CMAKE_HOST_SYSTEM_PROCESSOR}" STREQUAL "arm64")
set(HOMEBREW_LOCATION "/opt/homebrew")
else()
set(HOMEBREW_LOCATION "/usr/local")
endif()
if(NOT EXISTS "${HOMEBREW_LOCATION}/opt/bison/bin/bison")
string(APPEND _software_missing " bison")
endif()
endif()
@@ -54,11 +70,14 @@ if(UNIX)
" ${_software_missing}\n"
"\n"
"On Debian and Ubuntu:\n"
" apt install autoconf automake libtool yasm tcl\n"
" apt install autoconf automake libtool yasm tcl ninja-build meson python3-mako\n"
"\n"
"On macOS (with homebrew):\n"
"On macOS Intel (with homebrew):\n"
" brew install autoconf automake bison libtool pkg-config yasm\n"
"\n"
"On macOS ARM (with homebrew):\n"
" brew install autoconf automake bison flex libtool pkg-config yasm\n"
"\n"
"Other platforms:\n"
" Install equivalent packages.\n")
message(FATAL_ERROR "Install missing software before continuing")

View File

@@ -1,74 +0,0 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(CLANG_EXTRA_ARGS
-DCLANG_PATH_TO_LLVM_SOURCE=${BUILD_DIR}/ll/src/ll
-DCLANG_PATH_TO_LLVM_BUILD=${LIBDIR}/llvm
-DLLVM_USE_CRT_RELEASE=MD
-DLLVM_USE_CRT_DEBUG=MDd
-DLLVM_CONFIG=${LIBDIR}/llvm/bin/llvm-config
)
if(WIN32)
set(CLANG_GENERATOR "Ninja")
else()
set(CLANG_GENERATOR "Unix Makefiles")
endif()
if(APPLE)
set(CLANG_EXTRA_ARGS ${CLANG_EXTRA_ARGS}
-DLIBXML2_LIBRARY=${LIBDIR}/xml2/lib/libxml2.a
)
endif()
ExternalProject_Add(external_clang
URL ${CLANG_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${CLANG_HASH}
PREFIX ${BUILD_DIR}/clang
CMAKE_GENERATOR ${CLANG_GENERATOR}
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/clang ${DEFAULT_CMAKE_FLAGS} ${CLANG_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/clang
)
if(MSVC)
if(BUILD_MODE STREQUAL Release)
set(CLANG_HARVEST_COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/clang/ ${HARVEST_TARGET}/llvm/)
else()
set(CLANG_HARVEST_COMMAND
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/clang/lib/ ${HARVEST_TARGET}/llvm/debug/lib/
)
endif()
ExternalProject_Add_Step(external_clang after_install
COMMAND ${CLANG_HARVEST_COMMAND}
DEPENDEES mkdir update patch download configure build install
)
endif()
add_dependencies(
external_clang
ll
)
# We currently do not build libxml2 on Windows.
if(NOT WIN32)
add_dependencies(
external_clang
external_xml2
)
endif()

View File

@@ -19,9 +19,9 @@
set(CLEW_EXTRA_ARGS)
ExternalProject_Add(external_clew
URL ${CLEW_URI}
URL file://${PACKAGE_DIR}/${CLEW_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${CLEW_HASH}
URL_HASH ${CLEW_HASH_TYPE}=${CLEW_HASH}
PREFIX ${BUILD_DIR}/clew
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/clew -Wno-dev ${DEFAULT_CMAKE_FLAGS} ${CLEW_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/clew

View File

@@ -19,9 +19,9 @@
set(CUEW_EXTRA_ARGS)
ExternalProject_Add(external_cuew
URL ${CUEW_URI}
URL file://${PACKAGE_DIR}/${CUEW_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${CUEW_HASH}
URL_HASH ${CUEW_HASH_TYPE}=${CUEW_HASH}
PREFIX ${BUILD_DIR}/cuew
PATCH_COMMAND ${PATCH_CMD} --verbose -p 0 -N -d ${BUILD_DIR}/cuew/src/external_cuew < ${PATCH_DIR}/cuew.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/cuew -Wno-dev ${DEFAULT_CMAKE_FLAGS} ${CUEW_EXTRA_ARGS}

View File

@@ -0,0 +1,75 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# CVE Check requirements
#
# - A working installation of intels cve-bin-tool [1] has to be available in
# your path
#
# - Not strictly required, but highly recommended is obtaining a NVD key from
# nist since it significantly speeds up downloading/updating the required
# databases one can request a key on the following website:
# https://nvd.nist.gov/developers/request-an-api-key
# Bill of Materials construction
#
# This constructs a CSV cve-bin-tool [1] can read and process. Sadly
# cve-bin-tool at this point does not take a list of CPE's and output a check
# based on that list. so we need to pick apart the CPE retrieve the vendor,
# product and version tokens and generate a CSV.
#
# [1] https://github.com/intel/cve-bin-tool
# Because not all deps are downloaded (ie python packages) but can still have a
# xxx_CPE declared loop over all variables and look for variables ending in CPE.
set(SBOMCONTENTS)
get_cmake_property(_variableNames VARIABLES)
foreach (_variableName ${_variableNames})
if(_variableName MATCHES "CPE$")
string(REPLACE ":" ";" CPE_LIST ${${_variableName}})
string(REPLACE "_CPE" "_ID" CPE_DEPNAME ${_variableName})
list(GET CPE_LIST 3 CPE_VENDOR)
list(GET CPE_LIST 4 CPE_NAME)
list(GET CPE_LIST 5 CPE_VERSION)
set(${CPE_DEPNAME} "${CPE_VENDOR},${CPE_NAME},${CPE_VERSION}")
set(SBOMCONTENTS "${SBOMCONTENTS}${CPE_VENDOR},${CPE_NAME},${CPE_VERSION},,,\n")
endif()
endforeach()
configure_file(${CMAKE_SOURCE_DIR}/cmake/cve_check.csv.in ${CMAKE_CURRENT_BINARY_DIR}/cve_check.csv @ONLY)
# Custom Targets
#
# This defines two new custom targets one could run in the build folder
# `cve_check` which will output the report to the console, and `cve_check_html`
# which will write out blender_dependencies.html in the build folder that one
# could share with other people or be used to get more information on the
# reported CVE's.
#
# cve-bin-tool takes data from the nist nvd database which rate limits
# unauthenticated requests to 1 requests per 6 seconds making the database
# download take "quite a bit" of time.
#
# When adding -DCVE_CHECK_NVD_KEY=your_api_key_here to your cmake invocation
# this key will be passed on to cve-bin-tool speeding up the process.
#
if(DEFINED CVE_CHECK_NVD_KEY)
set(NVD_ARGS --nvd-api-key ${CVE_CHECK_NVD_KEY})
endif()
# This will just report to the console
add_custom_target(cve_check
COMMAND cve-bin-tool
${NVD_ARGS}
-i ${CMAKE_CURRENT_BINARY_DIR}/cve_check.csv
--affected-versions
SOURCES ${CMAKE_CURRENT_BINARY_DIR}/cve_check.csv
)
# This will write out blender_dependencies.html
add_custom_target(cve_check_html
COMMAND cve-bin-tool
${NVD_ARGS}
-i ${CMAKE_CURRENT_BINARY_DIR}/cve_check.csv
-f html
SOURCES ${CMAKE_CURRENT_BINARY_DIR}/cve_check.csv
)

View File

@@ -0,0 +1,29 @@
vendor,product,version,cve_number,remarks,comment
@OPENJPEG_ID@,CVE-2016-9675,Ignored,issue in convert command line tool not used by blender
@PYTHON_ID@,CVE-2009-2940,Ignored,issue in pygresql not used by blender
@PYTHON_ID@,CVE-2020-29396,Ignored,issue in odoo not used by blender
@PYTHON_ID@,CVE-2021-32052,Ignored,issue in django not used by blender
@PYTHON_ID@,CVE-2009-3720,Ignored,already fixed in libexpat version used
@SSL_ID@,CVE-2009-1390,Ignored,issue in mutt not used by blender
@SSL_ID@,CVE-2009-3765,Ignored,issue in mutt not used by blender
@SSL_ID@,CVE-2009-3766,Ignored,issue in mutt not used by blender
@SSL_ID@,CVE-2009-3767,Ignored,issue in ldap not used by blender
@SSL_ID@,CVE-2019-0190,Ignored,issue in apache not used by blender
@TIFF_ID@,CVE-2022-2056,Ignored,issue in tiff command line tool not used by blender
@TIFF_ID@,CVE-2022-2057,Ignored,issue in tiff command line tool not used by blender
@TIFF_ID@,CVE-2022-2058,Ignored,issue in tiff command line tool not used by blender
@TIFF_ID@,CVE-2022-2519,Ignored,issue in tiff command line tool not used by blender
@TIFF_ID@,CVE-2022-2520,Ignored,issue in tiff command line tool not used by blender
@TIFF_ID@,CVE-2022-2521,Ignored,issue in tiff command line tool not used by blender
@TIFF_ID@,CVE-2022-2953,Ignored,issue in tiff command line tool not used by blender
@TIFF_ID@,CVE-2022-34526,Ignored,issue in tiff command line tool not used by blender
@TIFF_ID@,CVE-2022-3570,Ignored,issue in tiff command line tool not used by blender
@TIFF_ID@,CVE-2022-3597,Ignored,issue in tiff command line tool not used by blender
@TIFF_ID@,CVE-2022-3598,Ignored,issue in tiff command line tool not used by blender
@TIFF_ID@,CVE-2022-3599,Ignored,issue in tiff command line tool not used by blender
@TIFF_ID@,CVE-2022-3626,Ignored,issue in tiff command line tool not used by blender
@TIFF_ID@,CVE-2022-3627,Ignored,issue in tiff command line tool not used by blender
@XML2_ID@,CVE-2016-3709,Ignored,not affecting blender and not considered a security issue upstream
@GMP_ID@,CVE-2021-43618,Mitigated,patched using upstream commit 561a9c25298e
@SQLITE_ID@,CVE-2022-35737,Ignored,only affects SQLITE_ENABLE_STAT4 compile option not used by blender or python
@SBOMCONTENTS@

View File

@@ -0,0 +1,135 @@
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()
# Validate all required variables are set and give an explicit error message
# rather than CMake erroring out later on with a more ambigious error.
if (NOT DEFINED TARGET_FILE)
message(FATAL_ERROR "${dep}_FILE variable not set")
endif()
if (NOT DEFINED TARGET_HASH)
message(FATAL_ERROR "${dep}_HASH variable not set")
endif()
if (NOT DEFINED TARGET_HASH_TYPE)
message(FATAL_ERROR "${dep}_HASH_TYPE variable not set")
endif()
if (NOT DEFINED TARGET_URI)
message(FATAL_ERROR "${dep}_URI variable not set")
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()
if(EXISTS ${TARGET_FILE})
# Sometimes the download fails, but that is not a
# fail condition for "file(DOWNLOAD" it will warn about
# a crc mismatch and just carry on, we need to explicitly
# catch this and remove the bogus 0 byte file so we can
# retry without having to go find the file and manually
# delete it.
file (SIZE ${TARGET_FILE} TARGET_SIZE)
if(${TARGET_SIZE} EQUAL 0)
file(REMOVE ${TARGET_FILE})
message(FATAL_ERROR "for ${TARGET_FILE} file size 0, download likely failed, deleted...")
endif()
# If we are using sources from the blender repo also
# validate that the hashes match, this takes a
# little more time, but protects us when we are
# building a release package and one of the packages
# is missing or incorrect.
#
# For regular platform maintenaince this is not needed
# since the actual build of the dep will notify the
# platform maintainer if there is a problem with the
# source package and refuse to build.
if(NOT PACKAGE_USE_UPSTREAM_SOURCES OR FORCE_CHECK_HASH)
file(${TARGET_HASH_TYPE} ${TARGET_FILE} LOCAL_HASH)
if(NOT ${TARGET_HASH} STREQUAL ${LOCAL_HASH})
message(FATAL_ERROR "${TARGET_FILE} ${TARGET_HASH_TYPE} mismatch\nExpected\t: ${TARGET_HASH}\nActual\t: ${LOCAL_HASH}")
endif()
endif()
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(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(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(APPLE AND ("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "arm64"))
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

@@ -31,12 +31,6 @@ if(WIN32)
--disable-pthreads
--enable-libopenjpeg
)
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "4")
set(FFMPEG_EXTRA_FLAGS
${FFMPEG_EXTRA_FLAGS}
--x86asmexe=yasm
)
endif()
else()
set(FFMPEG_EXTRA_FLAGS
${FFMPEG_EXTRA_FLAGS}
@@ -60,9 +54,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

@@ -19,23 +19,29 @@
set(FREETYPE_EXTRA_ARGS
-DCMAKE_RELEASE_POSTFIX:STRING=2ST
-DCMAKE_DEBUG_POSTFIX:STRING=2ST_d
-DWITH_BZip2=OFF
-DWITH_HarfBuzz=OFF
-DFT_WITH_HARFBUZZ=OFF
-DFT_WITH_BZIP2=OFF
-DCMAKE_DISABLE_FIND_PACKAGE_HarfBuzz=TRUE
-DCMAKE_DISABLE_FIND_PACKAGE_BZip2=TRUE
-DCMAKE_DISABLE_FIND_PACKAGE_BrotliDec=TRUE)
-DFT_DISABLE_BZIP2=ON
-DFT_DISABLE_HARFBUZZ=ON
-DFT_DISABLE_PNG=ON
-DFT_REQUIRE_BROTLI=OFF
-DFT_REQUIRE_ZLIB=ON
-DZLIB_LIBRARY=${LIBDIR}/zlib/lib/${ZLIB_LIBRARY}
-DZLIB_INCLUDE_DIR=${LIBDIR}/zlib/include
)
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
)
add_dependencies(
external_freetype
external_zlib
)
if(BUILD_MODE STREQUAL Release AND WIN32)
ExternalProject_Add_Step(external_freetype after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/freetype ${HARVEST_TARGET}/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

@@ -20,7 +20,7 @@ set(GMP_EXTRA_ARGS -enable-cxx)
if(WIN32)
# Shared for windows because static libs will drag in a libgcc dependency.
set(GMP_OPTIONS --disable-static --enable-shared --host=x86_64-w64-mingw32 --build=x86_64-w64-mingw32)
set(GMP_OPTIONS --disable-static --enable-shared --enable-fat --host=x86_64-w64-mingw32 --build=x86_64-w64-mingw32)
else()
set(GMP_OPTIONS --enable-static --disable-shared )
endif()
@@ -41,14 +41,16 @@ elseif(UNIX)
set(GMP_OPTIONS
${GMP_OPTIONS}
--with-pic
--enable-fat
)
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
PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/gmp/src/external_gmp < ${PATCH_DIR}/gmp.diff
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}
INSTALL_COMMAND ${CONFIGURE_ENV_NO_PERL} && cd ${BUILD_DIR}/gmp/src/external_gmp/ && make install
@@ -83,9 +85,9 @@ if(WIN32)
# given the C++ ABI between MSVC and mingw is not compatible, we need to build the bindings
# with MSVC, while GMP can only be build with mingw.
ExternalProject_Add(external_gmpxx
URL ${GMP_URI}
URL file://${PACKAGE_DIR}/${GMP_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${GMP_HASH}
URL_HASH ${GMP_HASH_TYPE}=${GMP_HASH}
PREFIX ${BUILD_DIR}/gmpxx
PATCH_COMMAND COMMAND ${CMAKE_COMMAND} -E copy ${PATCH_DIR}/cmakelists_gmpxx.txt ${BUILD_DIR}/gmpxx/src/external_gmpxx/CMakeLists.txt &&
${CMAKE_COMMAND} -E copy ${PATCH_DIR}/config_gmpxx.h ${BUILD_DIR}/gmpxx/src/external_gmpxx/config.h

View File

@@ -0,0 +1,46 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(HARU_EXTRA_ARGS
-DLIBHPDF_SHARED=OFF
-DLIBHPDF_STATIC=ON
-DLIBHPDF_EXAMPLES=OFF
-DLIBHPDF_ENABLE_EXCEPTIONS=ON
)
ExternalProject_Add(external_haru
URL file://${PACKAGE_DIR}/${HARU_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${HARU_HASH_TYPE}=${HARU_HASH}
PREFIX ${BUILD_DIR}/haru
PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/haru/src/external_haru < ${PATCH_DIR}/haru.diff
CMAKE_ARGS
-DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_INSTALL_PREFIX=${LIBDIR}/haru
${DEFAULT_CMAKE_FLAGS} ${HARU_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/haru
)
if(WIN32)
if(BUILD_MODE STREQUAL Release)
ExternalProject_Add_Step(external_haru after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/haru/include ${HARVEST_TARGET}/haru/include
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/haru/lib/libhpdfs.lib ${HARVEST_TARGET}/haru/lib/libhpdfs.lib
DEPENDEES install
)
endif()
endif()

View File

@@ -26,167 +26,172 @@ endif()
message("HARVEST_TARGET = ${HARVEST_TARGET}")
if(WIN32)
if(BUILD_MODE STREQUAL Release)
add_custom_target(Harvest_Release_Results
COMMAND # jpeg rename libfile + copy include
${CMAKE_COMMAND} -E copy ${LIBDIR}/jpg/lib/jpeg-static.lib ${HARVEST_TARGET}/jpeg/lib/libjpeg.lib &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/jpg/include/ ${HARVEST_TARGET}/jpeg/include/ &&
# png
${CMAKE_COMMAND} -E copy ${LIBDIR}/png/lib/libpng16_static.lib ${HARVEST_TARGET}/png/lib/libpng.lib &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/png/include/ ${HARVEST_TARGET}/png/include/ &&
# freeglut-> opengl
${CMAKE_COMMAND} -E copy ${LIBDIR}/freeglut/lib/freeglut_static.lib ${HARVEST_TARGET}/opengl/lib/freeglut_static.lib &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/freeglut/include/ ${HARVEST_TARGET}/opengl/include/ &&
# glew-> opengl
${CMAKE_COMMAND} -E copy ${LIBDIR}/glew/lib/libglew32.lib ${HARVEST_TARGET}/opengl/lib/glew.lib &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/glew/include/ ${HARVEST_TARGET}/opengl/include/ &&
# tiff
${CMAKE_COMMAND} -E copy ${LIBDIR}/tiff/lib/tiff.lib ${HARVEST_TARGET}/tiff/lib/libtiff.lib &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/tiff/include/ ${HARVEST_TARGET}/tiff/include/
DEPENDS
)
endif()
else(WIN32)
function(harvest from to)
set(pattern "")
foreach(f ${ARGN})
set(pattern ${f})
endforeach()
if(pattern STREQUAL "")
get_filename_component(dirpath ${to} DIRECTORY)
get_filename_component(filename ${to} NAME)
install(
FILES ${LIBDIR}/${from}
DESTINATION ${HARVEST_TARGET}/${dirpath}
RENAME ${filename})
else()
install(
DIRECTORY ${LIBDIR}/${from}/
DESTINATION ${HARVEST_TARGET}/${to}
USE_SOURCE_PERMISSIONS
FILES_MATCHING PATTERN ${pattern}
PATTERN "pkgconfig" EXCLUDE
PATTERN "cmake" EXCLUDE
PATTERN "__pycache__" EXCLUDE
PATTERN "tests" EXCLUDE)
if(BUILD_MODE STREQUAL Release)
add_custom_target(Harvest_Release_Results
COMMAND # jpeg rename libfile + copy include
${CMAKE_COMMAND} -E copy ${LIBDIR}/jpg/lib/jpeg-static.lib ${HARVEST_TARGET}/jpeg/lib/libjpeg.lib &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/jpg/include/ ${HARVEST_TARGET}/jpeg/include/ &&
# png
${CMAKE_COMMAND} -E copy ${LIBDIR}/png/lib/libpng16_static.lib ${HARVEST_TARGET}/png/lib/libpng.lib &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/png/include/ ${HARVEST_TARGET}/png/include/ &&
# freeglut-> opengl
${CMAKE_COMMAND} -E copy ${LIBDIR}/freeglut/lib/freeglut_static.lib ${HARVEST_TARGET}/opengl/lib/freeglut_static.lib &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/freeglut/include/ ${HARVEST_TARGET}/opengl/include/ &&
# glew-> opengl
${CMAKE_COMMAND} -E copy ${LIBDIR}/glew/lib/libglew32.lib ${HARVEST_TARGET}/opengl/lib/glew.lib &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/glew/include/ ${HARVEST_TARGET}/opengl/include/ &&
# tiff
${CMAKE_COMMAND} -E copy ${LIBDIR}/tiff/lib/tiff.lib ${HARVEST_TARGET}/tiff/lib/libtiff.lib &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/tiff/include/ ${HARVEST_TARGET}/tiff/include/
DEPENDS
)
endif()
endfunction()
harvest(alembic/include alembic/include "*.h")
harvest(alembic/lib/libAlembic.a alembic/lib/libAlembic.a)
harvest(alembic/bin alembic/bin "*")
harvest(boost/include boost/include "*")
harvest(boost/lib boost/lib "*.a")
harvest(ffmpeg/include ffmpeg/include "*.h")
harvest(ffmpeg/lib ffmpeg/lib "*.a")
harvest(fftw3/include fftw3/include "*.h")
harvest(fftw3/lib fftw3/lib "*.a")
harvest(flac/lib sndfile/lib "libFLAC.a")
harvest(freetype/include freetype/include "*.h")
harvest(freetype/lib/libfreetype2ST.a freetype/lib/libfreetype.a)
harvest(glew/include glew/include "*.h")
harvest(glew/lib glew/lib "*.a")
harvest(gmp/include gmp/include "*.h")
harvest(gmp/lib gmp/lib "*.a")
harvest(jemalloc/include jemalloc/include "*.h")
harvest(jemalloc/lib jemalloc/lib "*.a")
harvest(jpg/include jpeg/include "*.h")
harvest(jpg/lib jpeg/lib "libjpeg.a")
harvest(lame/lib ffmpeg/lib "*.a")
harvest(clang/bin llvm/bin "clang-format")
harvest(clang/include llvm/include "*")
harvest(llvm/include llvm/include "*")
harvest(llvm/bin llvm/bin "llvm-config")
harvest(llvm/lib llvm/lib "libLLVM*.a")
if(APPLE)
harvest(openmp/lib openmp/lib "*")
harvest(openmp/include openmp/include "*.h")
endif()
harvest(ogg/lib ffmpeg/lib "*.a")
harvest(openal/include openal/include "*.h")
if(UNIX AND NOT APPLE)
harvest(openal/lib openal/lib "*.a")
harvest(blosc/include blosc/include "*.h")
harvest(blosc/lib blosc/lib "*.a")
harvest(zlib/include zlib/include "*.h")
harvest(zlib/lib zlib/lib "*.a")
harvest(xml2/include xml2/include "*.h")
harvest(xml2/lib xml2/lib "*.a")
else()
harvest(blosc/lib openvdb/lib "*.a")
harvest(xml2/lib opencollada/lib "*.a")
endif()
harvest(opencollada/include/opencollada opencollada/include "*.h")
harvest(opencollada/lib/opencollada opencollada/lib "*.a")
harvest(opencolorio/include opencolorio/include "*.h")
harvest(opencolorio/lib opencolorio/lib "*.a")
harvest(opencolorio/lib/static opencolorio/lib "*.a")
harvest(openexr/include openexr/include "*.h")
harvest(openexr/lib openexr/lib "*.a")
harvest(openimageio/bin openimageio/bin "idiff")
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"))
function(harvest from to)
set(pattern "")
foreach(f ${ARGN})
set(pattern ${f})
endforeach()
if(pattern STREQUAL "")
get_filename_component(dirpath ${to} DIRECTORY)
get_filename_component(filename ${to} NAME)
install(
FILES ${LIBDIR}/${from}
DESTINATION ${HARVEST_TARGET}/${dirpath}
RENAME ${filename})
else()
install(
DIRECTORY ${LIBDIR}/${from}/
DESTINATION ${HARVEST_TARGET}/${to}
USE_SOURCE_PERMISSIONS
FILES_MATCHING PATTERN ${pattern}
PATTERN "pkgconfig" EXCLUDE
PATTERN "cmake" EXCLUDE
PATTERN "__pycache__" EXCLUDE
PATTERN "tests" EXCLUDE)
endif()
endfunction()
harvest(alembic/include alembic/include "*.h")
harvest(alembic/lib/libAlembic.a alembic/lib/libAlembic.a)
harvest(alembic/bin alembic/bin "*")
harvest(boost/include boost/include "*")
harvest(boost/lib boost/lib "*.a")
harvest(ffmpeg/include ffmpeg/include "*.h")
harvest(ffmpeg/lib ffmpeg/lib "*.a")
harvest(fftw3/include fftw3/include "*.h")
harvest(fftw3/lib fftw3/lib "*.a")
harvest(flac/lib sndfile/lib "libFLAC.a")
harvest(freetype/include freetype/include "*.h")
harvest(freetype/lib/libfreetype2ST.a freetype/lib/libfreetype.a)
harvest(glew/include glew/include "*.h")
harvest(glew/lib glew/lib "*.a")
harvest(gmp/include gmp/include "*.h")
harvest(gmp/lib gmp/lib "*.a")
harvest(jemalloc/include jemalloc/include "*.h")
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(llvm/bin llvm/bin "clang-format")
if(BUILD_CLANG_TOOLS)
harvest(llvm/bin llvm/bin "clang-tidy")
harvest(llvm/share/clang llvm/share "run-clang-tidy.py")
endif()
harvest(llvm/include llvm/include "*")
harvest(llvm/bin llvm/bin "llvm-config")
harvest(llvm/lib llvm/lib "libLLVM*.a")
harvest(llvm/lib llvm/lib "libclang*.a")
if(APPLE)
harvest(openmp/lib openmp/lib "*")
harvest(openmp/include openmp/include "*.h")
if("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "arm64")
harvest(sse2neon sse2neon "*.h")
endif()
endif()
harvest(ogg/lib ffmpeg/lib "*.a")
harvest(openal/include openal/include "*.h")
if(UNIX AND NOT APPLE)
harvest(openal/lib openal/lib "*.a")
harvest(blosc/include blosc/include "*.h")
harvest(blosc/lib blosc/lib "*.a")
harvest(zlib/include zlib/include "*.h")
harvest(zlib/lib zlib/lib "*.a")
harvest(xml2/include xml2/include "*.h")
harvest(xml2/lib xml2/lib "*.a")
else()
harvest(blosc/lib openvdb/lib "*.a")
harvest(xml2/lib opencollada/lib "*.a")
endif()
harvest(opencollada/include/opencollada opencollada/include "*.h")
harvest(opencollada/lib/opencollada opencollada/lib "*.a")
harvest(opencolorio/include opencolorio/include "*.h")
harvest(opencolorio/lib opencolorio/lib "*.a")
harvest(opencolorio/lib/static opencolorio/lib "*.a")
harvest(openexr/include openexr/include "*.h")
harvest(openexr/lib openexr/lib "*.a")
harvest(openimageio/bin openimageio/bin "idiff")
harvest(openimageio/bin openimageio/bin "maketx")
harvest(openimageio/bin openimageio/bin "oiiotool")
harvest(openimageio/include openimageio/include "*")
harvest(openimageio/lib openimageio/lib "*.a")
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(openjpeg/include/openjpeg-2.3 openjpeg/include "*.h")
harvest(openjpeg/lib openjpeg/lib "*.a")
harvest(opensubdiv/include opensubdiv/include "*.h")
harvest(opensubdiv/lib opensubdiv/lib "*.a")
harvest(openvdb/include/openvdb openvdb/include/openvdb "*.h")
if(WITH_NANOVDB)
harvest(openvdb/nanovdb nanovdb/include/nanovdb "*.h")
endif()
harvest(openvdb/lib openvdb/lib "*.a")
harvest(xr_openxr_sdk/include/openxr xr_openxr_sdk/include/openxr "*.h")
harvest(xr_openxr_sdk/lib xr_openxr_sdk/lib "*.a")
harvest(osl/bin osl/bin "oslc")
harvest(osl/include osl/include "*.h")
harvest(osl/lib osl/lib "*.a")
harvest(osl/shaders osl/shaders "*.h")
harvest(png/include png/include "*.h")
harvest(png/lib png/lib "*.a")
harvest(python/bin python/bin "python${PYTHON_SHORT_VERSION}m")
harvest(python/include python/include "*h")
harvest(python/lib python/lib "*")
harvest(sdl/include/SDL2 sdl/include "*.h")
harvest(sdl/lib sdl/lib "libSDL2.a")
harvest(sndfile/include sndfile/include "*.h")
harvest(sndfile/lib sndfile/lib "*.a")
harvest(spnav/include spnav/include "*.h")
harvest(spnav/lib spnav/lib "*.a")
harvest(tbb/include tbb/include "*.h")
harvest(tbb/lib/libtbb_static.a tbb/lib/libtbb.a)
harvest(theora/lib ffmpeg/lib "*.a")
harvest(tiff/include tiff/include "*.h")
harvest(tiff/lib tiff/lib "*.a")
harvest(vorbis/lib ffmpeg/lib "*.a")
harvest(opus/lib ffmpeg/lib "*.a")
harvest(vpx/lib ffmpeg/lib "*.a")
harvest(webp/lib ffmpeg/lib "*.a")
harvest(x264/lib ffmpeg/lib "*.a")
harvest(xvidcore/lib ffmpeg/lib "*.a")
harvest(usd/include usd/include "*.h")
harvest(usd/lib/usd usd/lib/usd "*")
harvest(usd/plugin usd/plugin "*")
harvest(potrace/include potrace/include "*.h")
harvest(potrace/lib potrace/lib "*.a")
if(UNIX AND NOT APPLE)
harvest(libglu/lib mesa/lib "*.so*")
harvest(mesa/lib mesa/lib "*.so*")
endif()
harvest(openjpeg/include/openjpeg-2.3 openjpeg/include "*.h")
harvest(openjpeg/lib openjpeg/lib "*.a")
harvest(opensubdiv/include opensubdiv/include "*.h")
harvest(opensubdiv/lib opensubdiv/lib "*.a")
harvest(openvdb/include/openvdb openvdb/include/openvdb "*.h")
harvest(openvdb/lib openvdb/lib "*.a")
harvest(nanovdb/nanovdb nanovdb/include/nanovdb "*.h")
harvest(xr_openxr_sdk/include/openxr xr_openxr_sdk/include/openxr "*.h")
harvest(xr_openxr_sdk/lib xr_openxr_sdk/lib "*.a")
harvest(osl/bin osl/bin "oslc")
harvest(osl/include osl/include "*.h")
harvest(osl/lib osl/lib "*.a")
harvest(osl/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}")
harvest(python/include python/include "*h")
harvest(python/lib python/lib "*")
harvest(sdl/include/SDL2 sdl/include "*.h")
harvest(sdl/lib sdl/lib "libSDL2.a")
harvest(sndfile/include sndfile/include "*.h")
harvest(sndfile/lib sndfile/lib "*.a")
harvest(spnav/include spnav/include "*.h")
harvest(spnav/lib spnav/lib "*.a")
harvest(tbb/include tbb/include "*.h")
harvest(tbb/lib/libtbb_static.a tbb/lib/libtbb.a)
harvest(theora/lib ffmpeg/lib "*.a")
harvest(tiff/include tiff/include "*.h")
harvest(tiff/lib tiff/lib "*.a")
harvest(vorbis/lib ffmpeg/lib "*.a")
harvest(opus/lib ffmpeg/lib "*.a")
harvest(vpx/lib ffmpeg/lib "*.a")
harvest(webp/lib ffmpeg/lib "*.a")
harvest(x264/lib ffmpeg/lib "*.a")
harvest(xvidcore/lib ffmpeg/lib "*.a")
harvest(usd/include usd/include "*.h")
harvest(usd/lib/usd usd/lib/usd "*")
harvest(usd/plugin usd/plugin "*")
harvest(potrace/include potrace/include "*.h")
harvest(potrace/lib potrace/lib "*.a")
harvest(haru/include haru/include "*.h")
harvest(haru/lib haru/lib "*.a")
if(UNIX AND NOT APPLE)
harvest(libglu/lib mesa/lib "*.so*")
harvest(mesa/lib64 mesa/lib "*.so*")
endif()
endif()

View File

@@ -19,9 +19,9 @@
set(ICONV_EXTRA_ARGS)
ExternalProject_Add(external_iconv
URL ${ICONV_URI}
URL file://${PACKAGE_DIR}/${ICONV_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${ICONV_HASH}
URL_HASH ${ICONV_HASH_TYPE}=${ICONV_HASH}
PREFIX ${BUILD_DIR}/iconv
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/iconv/src/external_iconv/ && ${CONFIGURE_COMMAND} --enable-static --prefix=${mingw_LIBDIR}/iconv
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/iconv/src/external_iconv/ && make -j${MAKE_THREADS}

View File

@@ -21,41 +21,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.
set(ISPC_EXTRA_ARGS_APPLE
-DBISON_EXECUTABLE=/usr/local/opt/bison/bin/bison
)
# Use bison and flex installed via Homebrew.
# The ones that come with Xcode toolset are too old.
if("${CMAKE_HOST_SYSTEM_PROCESSOR}" STREQUAL "arm64")
set(ISPC_EXTRA_ARGS_APPLE
-DBISON_EXECUTABLE=/opt/homebrew/opt/bison/bin/bison
-DFLEX_EXECUTABLE=/opt/homebrew/opt/flex/bin/flex
-DARM_ENABLED=On
)
else()
set(ISPC_EXTRA_ARGS_APPLE
-DBISON_EXECUTABLE=/usr/local/opt/bison/bin/bison
-DARM_ENABLED=Off
)
endif()
elseif(UNIX)
set(ISPC_EXTRA_ARGS_UNIX
-DCMAKE_C_COMPILER=${LIBDIR}/clang/bin/clang
-DCMAKE_CXX_COMPILER=${LIBDIR}/clang/bin/clang++
-DCMAKE_C_COMPILER=${LIBDIR}/llvm/bin/clang
-DCMAKE_CXX_COMPILER=${LIBDIR}/llvm/bin/clang++
-DARM_ENABLED=Off
)
endif()
set(ISPC_EXTRA_ARGS
-DARM_ENABLED=Off
-DISPC_NO_DUMPS=On
-DISPC_INCLUDE_EXAMPLES=Off
-DISPC_INCLUDE_TESTS=Off
-DLLVM_ROOT=${LIBDIR}/llvm/lib/cmake/llvm
-DLLVM_LIBRARY_DIR=${LIBDIR}/llvm/lib
-DCLANG_EXECUTABLE=${LIBDIR}/clang/bin/clang
-DCLANGPP_EXECUTABLE=${LIBDIR}/clang/bin/clang++
-DCLANG_EXECUTABLE=${LIBDIR}/llvm/bin/clang
-DCLANGPP_EXECUTABLE=${LIBDIR}/llvm/bin/clang++
-DISPC_INCLUDE_TESTS=Off
-DCLANG_LIBRARY_DIR=${LIBDIR}/clang/lib
-DCLANG_INCLUDE_DIRS=${LIBDIR}/clang/include
-DCLANG_LIBRARY_DIR=${LIBDIR}/llvm/lib
-DCLANG_INCLUDE_DIRS=${LIBDIR}/llvm/include
${ISPC_EXTRA_ARGS_WIN}
${ISPC_EXTRA_ARGS_APPLE}
${ISPC_EXTRA_ARGS_UNIX}
)
ExternalProject_Add(external_ispc
URL ${ISPC_URI}
URL file://${PACKAGE_DIR}/${ISPC_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${ISPC_HASH}
URL_HASH ${ISPC_HASH_TYPE}=${ISPC_HASH}
PREFIX ${BUILD_DIR}/ispc
PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/ispc/src/external_ispc < ${PATCH_DIR}/ispc.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/ispc -Wno-dev ${DEFAULT_CMAKE_FLAGS} ${ISPC_EXTRA_ARGS} ${BUILD_DIR}/ispc/src/external_ispc
@@ -65,7 +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
@@ -41,7 +41,7 @@ if(WIN32)
else()
set(JPEG_LIBRARY jpeg-staticd${LIBEXT})
endif()
else(WIN32)
else()
# cmake for unix
set(JPEG_EXTRA_ARGS
-DWITH_JPEG8=ON
@@ -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

@@ -17,11 +17,21 @@
# ***** END GPL LICENSE BLOCK *****
if(APPLE AND "${CMAKE_OSX_ARCHITECTURES}" STREQUAL "arm64")
set(LLVM_TARGETS AArch64)
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
-DLIBXML2_INCLUDE_DIR=${LIBDIR}/xml2/include/libxml2
)
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 +41,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 +53,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 +79,11 @@ if(MSVC)
DEPENDEES mkdir update patch download configure build install
)
endif()
# We currently do not build libxml2 on Windows.
if(APPLE)
add_dependencies(
ll
external_xml2
)
endif()

View File

@@ -19,9 +19,9 @@
set(LZMA_PATCH_CMD echo .)
ExternalProject_Add(external_lzma
URL ${LZMA_URI}
URL file://${PACKAGE_DIR}/${LZMA_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH SHA256=${LZMA_HASH}
URL_HASH ${LZMA_HASH_TYPE}=${LZMA_HASH}
PREFIX ${BUILD_DIR}/lzma
PATCH_COMMAND ${LZMA_PATCH_CMD}
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/lzma/src/external_lzma/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/lzma

View File

@@ -20,31 +20,48 @@ set(MESA_CFLAGS "-static-libgcc")
set(MESA_CXXFLAGS "-static-libgcc -static-libstdc++ -Bstatic -lstdc++ -Bdynamic -l:libstdc++.a")
set(MESA_LDFLAGS "-L${LIBDIR}/zlib/lib -pthread -static-libgcc -static-libstdc++ -Bstatic -lstdc++ -Bdynamic -l:libstdc++.a -l:libz_pic.a")
# The 'native-file', used for overrides with the meson build system.
# meson does not provide a way to do this using command line arguments.
#
# Note that we can't output to "${BUILD_DIR}/mesa/src/external_mesa" as
# it doesn't exist when CMake first executes.
file(WRITE ${BUILD_DIR}/mesa/tmp/native-file.ini "\
[binaries]
llvm-config = '${LIBDIR}/llvm/bin/llvm-config'"
)
set(MESA_EXTRA_FLAGS
CFLAGS=${MESA_CFLAGS}
CXXFLAGS=${MESA_CXXFLAGS}
LDFLAGS=${MESA_LDFLAGS}
--enable-glx=gallium-xlib
--with-gallium-drivers=swrast
--disable-dri
--disable-gbm
--disable-egl
--disable-gles1
--disable-gles2
--disable-llvm-shared-libs
--with-llvm-prefix=${LIBDIR}/llvm
-Dbuildtype=release
-Dc_args=${MESA_CFLAGS}
-Dcpp_args=${MESA_CXXFLAGS}
-Dc_link_args=${MESA_LDFLAGS}
-Dcpp_link_args=${MESA_LDFLAGS}
-Dglx=gallium-xlib
-Dgallium-drivers=swrast
-Ddri-drivers=
-Dvulkan-drivers=
-Dgbm=disabled
-Degl=disabled
-Dgles1=disabled
-Dgles2=disabled
-Dshared-llvm=disabled
# Without this, the build fails when: `wayland-scanner` is not found.
# At some point we will likely want to support Wayland.
# Disable for now since it's not officially supported.
-Dplatforms=x11
--native-file ${BUILD_DIR}/mesa/tmp/native-file.ini
)
ExternalProject_Add(external_mesa
URL ${MESA_URI}
URL file://${PACKAGE_DIR}/${MESA_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${MESA_HASH}
URL_HASH ${MESA_HASH_TYPE}=${MESA_HASH}
PREFIX ${BUILD_DIR}/mesa
CONFIGURE_COMMAND ${CONFIGURE_ENV} &&
cd ${BUILD_DIR}/mesa/src/external_mesa/ &&
${CONFIGURE_COMMAND_NO_TARGET} --prefix=${LIBDIR}/mesa ${MESA_EXTRA_FLAGS}
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/mesa/src/external_mesa/ && make -j${MAKE_THREADS}
INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/mesa/src/external_mesa/ && make install
meson ${BUILD_DIR}/mesa/src/external_mesa-build --prefix=${LIBDIR}/mesa ${MESA_EXTRA_FLAGS}
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/mesa/src/external_mesa-build && ninja -j${MAKE_THREADS}
INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/mesa/src/external_mesa-build && ninja install
INSTALL_DIR ${LIBDIR}/mesa
)

View File

@@ -0,0 +1,54 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(NANOVDB_EXTRA_ARGS
# NanoVDB is header-only, so only need the install target
-DNANOVDB_BUILD_UNITTESTS=OFF
-DNANOVDB_BUILD_EXAMPLES=OFF
-DNANOVDB_BUILD_BENCHMARK=OFF
-DNANOVDB_BUILD_DOCS=OFF
-DNANOVDB_BUILD_TOOLS=OFF
-DNANOVDB_CUDA_KEEP_PTX=OFF
# Do not need to include any of the dependencies because of this
-DNANOVDB_USE_OPENVDB=OFF
-DNANOVDB_USE_OPENGL=OFF
-DNANOVDB_USE_OPENCL=OFF
-DNANOVDB_USE_CUDA=OFF
-DNANOVDB_USE_TBB=OFF
-DNANOVDB_USE_BLOSC=OFF
-DNANOVDB_USE_ZLIB=OFF
-DNANOVDB_USE_OPTIX=OFF
-DNANOVDB_ALLOW_FETCHCONTENT=OFF
)
ExternalProject_Add(nanovdb
URL file://${PACKAGE_DIR}/${NANOVDB_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${NANOVDB_HASH_TYPE}=${NANOVDB_HASH}
PREFIX ${BUILD_DIR}/nanovdb
SOURCE_SUBDIR nanovdb
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/nanovdb ${DEFAULT_CMAKE_FLAGS} ${NANOVDB_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/nanovdb
)
if(WIN32)
ExternalProject_Add_Step(nanovdb after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/nanovdb/nanovdb ${HARVEST_TARGET}/nanovdb/include/nanovdb
DEPENDEES install
)
endif()

View File

@@ -17,13 +17,22 @@
# ***** END GPL LICENSE BLOCK *****
ExternalProject_Add(external_nasm
URL ${NASM_URI}
URL file://${PACKAGE_DIR}/${NASM_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH SHA256=${NASM_HASH}
URL_HASH ${NASM_HASH_TYPE}=${NASM_HASH}
PREFIX ${BUILD_DIR}/nasm
PATCH_COMMAND ${PATCH_CMD} --verbose -p 1 -N -d ${BUILD_DIR}/nasm/src/external_nasm < ${PATCH_DIR}/nasm.diff
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/nasm/src/external_nasm/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/nasm
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/nasm/src/external_nasm/ && make -j${MAKE_THREADS}
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/nasm/src/external_nasm/ && ./autogen.sh && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/nasm
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/nasm/src/external_nasm/ && make -j${MAKE_THREADS} && make manpages
INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/nasm/src/external_nasm/ && make install
INSTALL_DIR ${LIBDIR}/nasm
)
if(UNIX)
# `touch nasm.1 ndisasm.1` helps to create the manual pages files, even when
# local `asciidoc` and `xmlto` packages are not installed.
ExternalProject_Add_Step(external_nasm after_configure
COMMAND ${CMAKE_COMMAND} -E touch ${BUILD_DIR}/nasm/src/external_nasm/nasm.1 ${BUILD_DIR}/nasm/src/external_nasm/ndisasm.1
DEPENDEES configure
)
endif()

View File

@@ -32,9 +32,9 @@ endif()
set(NUMPY_POSTFIX)
ExternalProject_Add(external_numpy
URL ${NUMPY_URI}
URL file://${PACKAGE_DIR}/${NUMPY_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${NUMPY_HASH}
URL_HASH ${NUMPY_HASH_TYPE}=${NUMPY_HASH}
PREFIX ${BUILD_DIR}/numpy
PATCH_COMMAND ${NUMPY_PATCH}
CONFIGURE_COMMAND ""
@@ -47,4 +47,5 @@ ExternalProject_Add(external_numpy
add_dependencies(
external_numpy
external_python
external_python_site_packages
)

View File

@@ -17,9 +17,9 @@
# ***** END GPL LICENSE BLOCK *****
ExternalProject_Add(external_ogg
URL ${OGG_URI}
URL file://${PACKAGE_DIR}/${OGG_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH SHA256=${OGG_HASH}
URL_HASH ${OGG_HASH_TYPE}=${OGG_HASH}
PREFIX ${BUILD_DIR}/ogg
PATCH_COMMAND ${PATCH_CMD} --verbose -p 1 -N -d ${BUILD_DIR}/ogg/src/external_ogg < ${PATCH_DIR}/ogg.diff
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/ogg/src/external_ogg/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/ogg --disable-shared --enable-static

View File

@@ -46,9 +46,9 @@ if(BUILD_MODE STREQUAL Release)
endif()
ExternalProject_Add(external_openal
URL ${OPENAL_URI}
URL file://${PACKAGE_DIR}/${OPENAL_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${OPENAL_HASH}
URL_HASH ${OPENAL_HASH_TYPE}=${OPENAL_HASH}
PREFIX ${BUILD_DIR}/openal
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openal ${DEFAULT_CMAKE_FLAGS} ${OPENAL_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/openal

View File

@@ -20,24 +20,49 @@ if(UNIX)
set(OPENCOLLADA_EXTRA_ARGS
-DLIBXML2_INCLUDE_DIR=${LIBDIR}/xml2/include/libxml2
-DLIBXML2_LIBRARIES=${LIBDIR}/xml2/lib/libxml2.a)
# WARNING: the patch contains mixed UNIX and DOS line endings
# as does the OPENCOLLADA package, if this can be corrected upstream that would be better.
# For now use `sed` to force UNIX line endings so the patch applies.
# Needed as neither ignoring white-space or applying as a binary resolve this problem.
set(PATCH_MAYBE_DOS2UNIX_CMD
sed -i "s/\\r//"
${PATCH_DIR}/opencollada.diff
${BUILD_DIR}/opencollada/src/external_opencollada/CMakeLists.txt
${BUILD_DIR}/opencollada/src/external_opencollada/Externals/LibXML/CMakeLists.txt &&
)
else()
set(OPENCOLLADA_EXTRA_ARGS
-DCMAKE_DEBUG_POSTFIX=_d
-DLIBXML2_INCLUDE_DIR=${LIBDIR}/xml2/include/libxml2
)
if(BUILD_MODE STREQUAL Release)
list(APPEND OPENCOLLADA_EXTRA_ARGS -DLIBXML2_LIBRARIES=${LIBDIR}/xml2/lib/libxml2s.lib)
else()
list(APPEND OPENCOLLADA_EXTRA_ARGS -DLIBXML2_LIBRARIES=${LIBDIR}/xml2/lib/libxml2sd.lib)
endif()
set(PATCH_MAYBE_DOS2UNIX_CMD)
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
PATCH_COMMAND
${PATCH_MAYBE_DOS2UNIX_CMD}
${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}
INSTALL_DIR ${LIBDIR}/opencollada
)
if(UNIX)
add_dependencies(
external_opencollada
external_xml2
)
endif()
unset(PATCH_MAYBE_DOS2UNIX_CMD)
add_dependencies(
external_opencollada
external_xml2
)
if(WIN32)
if(BUILD_MODE STREQUAL Release)
@@ -48,17 +73,7 @@ if(WIN32)
endif()
if(BUILD_MODE STREQUAL Debug)
ExternalProject_Add_Step(external_opencollada after_install
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/opencollada/lib/opencollada/buffer.lib ${HARVEST_TARGET}/opencollada/lib/opencollada/buffer_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/opencollada/lib/opencollada/ftoa.lib ${HARVEST_TARGET}/opencollada/lib/opencollada/ftoa_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/opencollada/lib/opencollada/GeneratedSaxParser.lib ${HARVEST_TARGET}/opencollada/lib/opencollada/GeneratedSaxParser_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/opencollada/lib/opencollada/MathMLSolver.lib ${HARVEST_TARGET}/opencollada/lib/opencollada/MathMLSolver_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/opencollada/lib/opencollada/OpenCOLLADABaseUtils.lib ${HARVEST_TARGET}/opencollada/lib/opencollada/OpenCOLLADABaseUtils_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/opencollada/lib/opencollada/OpenCOLLADAFramework.lib ${HARVEST_TARGET}/opencollada/lib/opencollada/OpenCOLLADAFramework_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/opencollada/lib/opencollada/OpenCOLLADASaxFrameworkLoader.lib ${HARVEST_TARGET}/opencollada/lib/opencollada/OpenCOLLADASaxFrameworkLoader_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/opencollada/lib/opencollada/OpenCOLLADAStreamWriter.lib ${HARVEST_TARGET}/opencollada/lib/opencollada/OpenCOLLADAStreamWriter_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/opencollada/lib/opencollada/pcre.lib ${HARVEST_TARGET}/opencollada/lib/opencollada/pcre_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/opencollada/lib/opencollada/UTF.lib ${HARVEST_TARGET}/opencollada/lib/opencollada/UTF_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/opencollada/lib/opencollada/xml.lib ${HARVEST_TARGET}/opencollada/lib/opencollada/xml_d.lib
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/opencollada/lib ${HARVEST_TARGET}/opencollada/lib
DEPENDEES install
)
endif()

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"))
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
@@ -112,14 +111,17 @@ set(OPENIMAGEIO_EXTRA_ARGS
-DOPENEXR_IEX_LIBRARY=${LIBDIR}/openexr/lib/${LIBPREFIX}Iex${OPENEXR_VERSION_POSTFIX}${LIBEXT}
-DOPENEXR_ILMIMF_LIBRARY=${LIBDIR}/openexr/lib/${LIBPREFIX}IlmImf${OPENEXR_VERSION_POSTFIX}${LIBEXT}
-DSTOP_ON_WARNING=OFF
-DUSE_EXTERNAL_PUGIXML=ON
-DPUGIXML_LIBRARY=${LIBDIR}/pugixml/lib/${LIBPREFIX}pugixml${LIBEXT}
-DPUGIXML_INCLUDE_DIR=${LIBDIR}/pugixml/include/
${WEBP_FLAGS}
${OIIO_SIMD_FLAGS}
)
ExternalProject_Add(external_openimageio
URL ${OPENIMAGEIO_URI}
URL file://${PACKAGE_DIR}/${OPENIMAGEIO_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${OPENIMAGEIO_HASH}
URL_HASH ${OPENIMAGEIO_HASH_TYPE}=${OPENIMAGEIO_HASH}
PREFIX ${BUILD_DIR}/openimageio
PATCH_COMMAND ${PATCH_CMD} -p 1 -N -d ${BUILD_DIR}/openimageio/src/external_openimageio/ < ${PATCH_DIR}/openimageio.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openimageio ${DEFAULT_CMAKE_FLAGS} ${OPENIMAGEIO_EXTRA_ARGS}
@@ -134,6 +136,7 @@ add_dependencies(
external_jpeg
external_boost
external_tiff
external_pugixml
external_openjpeg${OPENJPEG_POSTFIX}
${WEBP_DEP}
)

View File

@@ -28,9 +28,9 @@ else()
endif()
ExternalProject_Add(external_openjpeg
URL ${OPENJPEG_URI}
URL file://${PACKAGE_DIR}/${OPENJPEG_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH SHA256=${OPENJPEG_HASH}
URL_HASH ${OPENJPEG_HASH_TYPE}=${OPENJPEG_HASH}
PREFIX ${BUILD_DIR}/openjpeg
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/openjpeg/src/external_openjpeg-build && ${CMAKE_COMMAND} ${OPENJPEG_EXTRA_ARGS} -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openjpeg -DBUILD_SHARED_LIBS=Off -DBUILD_THIRDPARTY=OFF ${BUILD_DIR}/openjpeg/src/external_openjpeg
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/openjpeg/src/external_openjpeg-build/ && make -j${MAKE_THREADS}
@@ -42,9 +42,9 @@ ExternalProject_Add(external_openjpeg
if(MSVC)
set(OPENJPEG_EXTRA_ARGS ${DEFAULT_CMAKE_FLAGS})
ExternalProject_Add(external_openjpeg_msvc
URL ${OPENJPEG_URI}
URL file://${PACKAGE_DIR}/${OPENJPEG_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH SHA256=${OPENJPEG_HASH}
URL_HASH ${OPENJPEG_HASH_TYPE}=${OPENJPEG_HASH}
PREFIX ${BUILD_DIR}/openjpeg_msvc
CMAKE_ARGS ${OPENJPEG_EXTRA_ARGS} -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openjpeg_msvc -DBUILD_SHARED_LIBS=Off -DBUILD_THIRDPARTY=OFF
INSTALL_DIR ${LIBDIR}/openjpeg_msvc

View File

@@ -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,20 +54,8 @@ set(OPENVDB_EXTRA_ARGS
-DOPENVDB_CORE_STATIC=${OPENVDB_STATIC}
-DOPENVDB_BUILD_BINARIES=Off
-DCMAKE_DEBUG_POSTFIX=_d
# NanoVDB is header-only, so only need the install target
-DNANOVDB_BUILD_UNITTESTS=OFF
-DNANOVDB_BUILD_EXAMPLES=OFF
-DNANOVDB_BUILD_BENCHMARK=OFF
-DNANOVDB_BUILD_DOCS=OFF
-DNANOVDB_BUILD_TOOLS=OFF
-DNANOVDB_CUDA_KEEP_PTX=OFF
-DNANOVDB_USE_OPENGL=OFF
-DNANOVDB_USE_OPENGL=OFF
-DNANOVDB_USE_CUDA=OFF
-DNANOVDB_USE_TBB=OFF
-DNANOVDB_USE_OPTIX=OFF
-DNANOVDB_USE_OPENVDB=OFF
-DNANOVDB_ALLOW_FETCHCONTENT=OFF
-DILMBASE_USE_STATIC_LIBS=On
-DOPENEXR_USE_STATIC_LIBS=On
)
if(WIN32)
@@ -88,18 +76,12 @@ else()
)
endif()
if(WITH_NANOVDB)
set(OPENVDB_PATCH_FILE openvdb_nanovdb.diff)
else()
set(OPENVDB_PATCH_FILE openvdb.diff)
endif()
ExternalProject_Add(openvdb
URL ${OPENVDB_URI}
URL file://${PACKAGE_DIR}/${OPENVDB_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${OPENVDB_HASH}
URL_HASH ${OPENVDB_HASH_TYPE}=${OPENVDB_HASH}
PREFIX ${BUILD_DIR}/openvdb
PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/openvdb/src/openvdb < ${PATCH_DIR}/${OPENVDB_PATCH_FILE}
PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/openvdb/src/openvdb < ${PATCH_DIR}/openvdb.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openvdb ${DEFAULT_CMAKE_FLAGS} ${OPENVDB_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/openvdb
)
@@ -121,12 +103,6 @@ if(WIN32)
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/openvdb/bin/openvdb.dll ${HARVEST_TARGET}/openvdb/bin/openvdb.dll
DEPENDEES install
)
if(WITH_NANOVDB)
ExternalProject_Add_Step(openvdb nanovdb_install
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/openvdb/nanovdb ${HARVEST_TARGET}/nanovdb/include/nanovdb
DEPENDEES after_install
)
endif()
endif()
if(BUILD_MODE STREQUAL Debug)
ExternalProject_Add_Step(openvdb after_install

View File

@@ -21,8 +21,8 @@ if(WIN32)
endif()
option(WITH_WEBP "Enable building of oiio with webp support" OFF)
option(WITH_BOOST_PYTHON "Enable building of boost with python support" OFF)
option(WITH_NANOVDB "Enable building of OpenVDB with NanoVDB included" OFF)
set(MAKE_THREADS 1 CACHE STRING "Number of threads to run make with")
cmake_host_system_information(RESULT NUM_CORES QUERY NUMBER_OF_LOGICAL_CORES)
set(MAKE_THREADS ${NUM_CORES} CACHE STRING "Number of threads to run make with")
if(NOT BUILD_MODE)
set(BUILD_MODE "Release")
@@ -32,17 +32,23 @@ message("BuildMode = ${BUILD_MODE}")
if(BUILD_MODE STREQUAL "Debug")
set(LIBDIR ${CMAKE_CURRENT_BINARY_DIR}/Debug)
else(BUILD_MODE STREQUAL "Debug")
else()
set(LIBDIR ${CMAKE_CURRENT_BINARY_DIR}/Release)
endif()
option(DOWNLOAD_DIR "Path for downloaded files" ${CMAKE_CURRENT_SOURCE_DIR}/downloads)
set(DOWNLOAD_DIR "${CMAKE_CURRENT_BINARY_DIR}/downloads" CACHE STRING "Path for downloaded files")
# This path must be hard-coded like this, so that the GNUmakefile knows where it is and can pass it to make_source_archive.py:
set(PACKAGE_DIR "${CMAKE_CURRENT_BINARY_DIR}/packages")
option(PACKAGE_USE_UPSTREAM_SOURCES "Use soures upstream to download the package sources, when OFF the blender mirror will be used" ON)
file(TO_CMAKE_PATH ${DOWNLOAD_DIR} DOWNLOAD_DIR)
file(TO_CMAKE_PATH ${PACKAGE_DIR} PACKAGE_DIR)
set(PATCH_DIR ${CMAKE_CURRENT_SOURCE_DIR}/patches)
set(BUILD_DIR ${CMAKE_CURRENT_BINARY_DIR}/build)
message("LIBDIR = ${LIBDIR}")
message("DOWNLOAD_DIR = ${DOWNLOAD_DIR}")
message("PACKAGE_DIR = ${PACKAGE_DIR}")
message("PATCH_DIR = ${PATCH_DIR}")
message("BUILD_DIR = ${BUILD_DIR}")
@@ -57,7 +63,7 @@ if(WIN32)
if(MSVC_VERSION GREATER 1909)
set(COMMON_MSVC_FLAGS "/Wv:18") #some deps with warnings as error aren't quite ready for dealing with the new 2017 warnings.
endif()
set(COMMON_MSVC_FLAGS "${COMMON_MSVC_FLAGS} /bigobj")
string(APPEND COMMON_MSVC_FLAGS " /bigobj")
if(WITH_OPTIMIZED_DEBUG)
set(BLENDER_CMAKE_C_FLAGS_DEBUG "/MDd ${COMMON_MSVC_FLAGS} /O2 /Ob2 /DNDEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
else()
@@ -110,30 +116,16 @@ else()
set(LIBPREFIX "lib")
if(APPLE)
# Let's get the current Xcode dir, to support xcode-select
execute_process(
COMMAND xcode-select --print-path
OUTPUT_VARIABLE XCODE_DEV_PATH OUTPUT_STRIP_TRAILING_WHITESPACE
)
execute_process(
COMMAND xcodebuild -version -sdk macosx SDKVersion
OUTPUT_VARIABLE MACOSX_SDK_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
# Use same Xcode detection as Blender itself.
include(../cmake/platform/platform_apple_xcode.cmake)
if(NOT CMAKE_OSX_ARCHITECTURES)
execute_process(COMMAND uname -m OUTPUT_VARIABLE ARCHITECTURE OUTPUT_STRIP_TRAILING_WHITESPACE)
message(STATUS "Detected native architecture ${ARCHITECTURE}.")
set(CMAKE_OSX_ARCHITECTURES "${ARCHITECTURE}")
if("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "arm64")
set(BLENDER_PLATFORM_ARM ON)
endif()
if("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "x86_64")
set(OSX_DEPLOYMENT_TARGET 10.13)
else()
set(OSX_DEPLOYMENT_TARGET 11.00)
endif()
set(OSX_SYSROOT ${XCODE_DEV_PATH}/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk)
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}")
set(PLATFORM_CFLAGS "-isysroot ${CMAKE_OSX_SYSROOT} -mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET} -arch ${CMAKE_OSX_ARCHITECTURES}")
set(PLATFORM_CXXFLAGS "-isysroot ${CMAKE_OSX_SYSROOT} -mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET} -std=c++11 -stdlib=libc++ -arch ${CMAKE_OSX_ARCHITECTURES}")
set(PLATFORM_LDFLAGS "-isysroot ${CMAKE_OSX_SYSROOT} -mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET} -arch ${CMAKE_OSX_ARCHITECTURES}")
if("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "x86_64")
set(PLATFORM_BUILD_TARGET --build=x86_64-apple-darwin17.0.0) # OS X 10.13
else()
@@ -141,8 +133,8 @@ else()
endif()
set(PLATFORM_CMAKE_FLAGS
-DCMAKE_OSX_ARCHITECTURES:STRING=${CMAKE_OSX_ARCHITECTURES}
-DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=${OSX_DEPLOYMENT_TARGET}
-DCMAKE_OSX_SYSROOT:PATH=${OSX_SYSROOT}
-DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=${CMAKE_OSX_DEPLOYMENT_TARGET}
-DCMAKE_OSX_SYSROOT:PATH=${CMAKE_OSX_SYSROOT}
)
else()
set(PLATFORM_CFLAGS "-fPIC")
@@ -172,8 +164,8 @@ else()
set(BLENDER_CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g -DNDEBUG ${PLATFORM_CXXFLAGS}")
set(CONFIGURE_ENV
export MACOSX_DEPLOYMENT_TARGET=${OSX_DEPLOYMENT_TARGET} &&
export MACOSX_SDK_VERSION=${OSX_DEPLOYMENT_TARGET} &&
export MACOSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET} &&
export MACOSX_SDK_VERSION=${CMAKE_OSX_DEPLOYMENT_TARGET} &&
export CFLAGS=${PLATFORM_CFLAGS} &&
export CXXFLAGS=${PLATFORM_CXXFLAGS} &&
export LDFLAGS=${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,46 +48,41 @@ 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_ROOT=${LIBDIR}/pugixml
-DTIFF_ROOT=${LIBDIR}/tiff
-DJPEG_ROOT=${LIBDIR}/jpeg
-DUSE_PYTHON=OFF
)
if(WIN32)
set(OSL_EXTRA_ARGS
${OSL_EXTRA_ARGS}
-DPUGIXML_HOME=${LIBDIR}/pugixml
)
elseif(APPLE)
# Make symbol hiding consistent with OIIO which defaults to OFF,
# avoids linker warnings on macOS
set(OSL_EXTRA_ARGS
${OSL_EXTRA_ARGS}
-DHIDE_SYMBOLS=OFF
)
# 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}
@@ -109,22 +93,13 @@ add_dependencies(
external_osl
external_boost
ll
external_clang
external_openexr
external_zlib
external_flexbison
external_openimageio
external_pugixml
)
if(UNIX)
# Rely on PugiXML compiled with OpenImageIO
else()
add_dependencies(
external_osl
external_pugixml
)
endif()
if(WIN32)
if(BUILD_MODE STREQUAL Release)
ExternalProject_Add_Step(external_osl after_install

View File

@@ -27,9 +27,9 @@ if(APPLE AND ("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "arm64"))
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
@@ -40,6 +40,14 @@ add_dependencies(
external_zlib
)
if(WIN32 AND BUILD_MODE STREQUAL Release)
ExternalProject_Add_Step(external_png after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/png/include/ ${HARVEST_TARGET}/png/include/
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/png/lib/libpng16_static${LIBEXT} ${HARVEST_TARGET}/png/lib/libpng${LIBEXT}
DEPENDEES install
)
endif()
if(WIN32 AND BUILD_MODE STREQUAL Debug)
ExternalProject_Add_Step(external_png after_install
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/png/lib/libpng16_staticd${LIBEXT} ${LIBDIR}/png/lib/libpng16${LIBEXT}

View File

@@ -21,9 +21,9 @@ set(POTRACE_EXTRA_ARGS
if((WIN32 AND BUILD_MODE STREQUAL Release) OR UNIX)
ExternalProject_Add(external_potrace
URL ${POTRACE_URI}
URL file://${PACKAGE_DIR}/${POTRACE_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${POTRACE_HASH}
URL_HASH ${POTRACE_HASH_TYPE}=${POTRACE_HASH}
PREFIX ${BUILD_DIR}/potrace
PATCH_COMMAND ${CMAKE_COMMAND} -E copy ${PATCH_DIR}/cmakelists_potrace.txt ${BUILD_DIR}/potrace/src/external_potrace/CMakeLists.txt
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/potrace ${DEFAULT_CMAKE_FLAGS} ${POTRACE_EXTRA_ARGS}

View File

@@ -27,9 +27,9 @@ if(WIN32)
set(PTHREADS_BUILD cd ${BUILD_DIR}/pthreads/src/external_pthreads/ && cd && nmake VC-static /e CPPFLAGS=${PTHREAD_CPPFLAGS})
ExternalProject_Add(external_pthreads
URL ${PTHREADS_URI}
URL file://${PACKAGE_DIR}/${PTHREADS_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${PTHREADS_HASH}
URL_HASH ${PTHREADS_HASH_TYPE}=${PTHREADS_HASH}
PREFIX ${BUILD_DIR}/pthreads
CONFIGURE_COMMAND echo .
PATCH_COMMAND COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/pthreads/src/external_pthreads < ${PATCH_DIR}/pthreads.diff

View File

@@ -20,9 +20,9 @@ set(PUGIXML_EXTRA_ARGS
)
ExternalProject_Add(external_pugixml
URL ${PUGIXML_URI}
URL file://${PACKAGE_DIR}/${PUGIXML_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${PUGIXML_HASH}
URL_HASH ${PUGIXML_HASH_TYPE}=${PUGIXML_HASH}
PREFIX ${BUILD_DIR}/pugixml
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/pugixml ${DEFAULT_CMAKE_FLAGS} ${PUGIXML_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/pugixml
@@ -30,13 +30,13 @@ ExternalProject_Add(external_pugixml
if(WIN32)
if(BUILD_MODE STREQUAL Release)
ExternalProject_Add_Step(external_pugixml after_install
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/pugixml/lib/pugixml.lib ${HARVEST_TARGET}/osl/lib/pugixml.lib
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/pugixml ${HARVEST_TARGET}/pugixml
DEPENDEES install
)
endif()
if(BUILD_MODE STREQUAL Debug)
ExternalProject_Add_Step(external_pugixml after_install
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/pugixml/lib/pugixml.lib ${HARVEST_TARGET}/osl/lib/pugixml_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/pugixml/lib/pugixml.lib ${HARVEST_TARGET}/pugixml/lib/pugixml_d.lib
DEPENDEES install
)
endif()

View File

@@ -31,21 +31,33 @@ if(WIN32)
endmacro()
set(PYTHON_EXTERNALS_FOLDER ${BUILD_DIR}/python/src/external_python/externals)
set(ZLIB_SOURCE_FOLDER ${BUILD_DIR}/zlib/src/external_zlib)
set(DOWNLOADS_EXTERNALS_FOLDER ${DOWNLOAD_DIR}/externals)
cmake_to_dos_path(${PYTHON_EXTERNALS_FOLDER} PYTHON_EXTERNALS_FOLDER_DOS)
cmake_to_dos_path(${ZLIB_SOURCE_FOLDER} ZLIB_SOURCE_FOLDER_DOS)
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 ""
# Python will download its own deps and there's very little we can do about
# that beyond placing some code in their externals dir before it tries.
# the foldernames *HAVE* to match the ones inside pythons get_externals.cmd.
# python 3.10.8 still ships zlib 1.2.12, replace it with our 1.2.13
# copy until they update.
CONFIGURE_COMMAND mkdir ${PYTHON_EXTERNALS_FOLDER_DOS} &&
mklink /J ${PYTHON_EXTERNALS_FOLDER_DOS}\\zlib-1.2.12 ${ZLIB_SOURCE_FOLDER_DOS} &&
${CMAKE_COMMAND} -E copy ${ZLIB_SOURCE_FOLDER}/../external_zlib-build/zconf.h ${PYTHON_EXTERNALS_FOLDER}/zlib-1.2.12/zconf.h
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
)
add_dependencies(
external_python
external_zlib
)
else()
if(APPLE)
# Disable functions that can be in 10.13 sdk but aren't available on 10.9 target.
@@ -74,16 +86,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 +102,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

@@ -27,18 +27,11 @@ else()
set(SNDFILE_OPTIONS --enable-static --disable-shared )
endif()
if(UNIX)
set(SNDFILE_PATCH_CMD ${PATCH_CMD} --verbose -p 0 -d ${BUILD_DIR}/sndfile/src/external_sndfile < ${PATCH_DIR}/sndfile.diff)
else()
set(SNDFILE_PATCH_CMD)
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
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/sndfile/src/external_sndfile/ && make -j${MAKE_THREADS}
INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/sndfile/src/external_sndfile/ && make install

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,16 +42,28 @@ if(UNIX)
-DSQLITE_MAX_VARIABLE_NUMBER=250000 \
-fPIC")
set(SQLITE_CONFIGURE_ENV ${SQLITE_CONFIGURE_ENV} && export LDFLAGS=${SQLITE_LDFLAGS} && export CFLAGS=${SQLITE_CFLAGS})
set(SQLITE_CONFIGURATION_ARGS ${SQLITE_CONFIGURATION_ARGS} --enable-threadsafe --enable-load-extension --enable-json1 --enable-fts4 --enable-fts5
--enable-shared=no)
set(SQLITE_CONFIGURATION_ARGS
${SQLITE_CONFIGURATION_ARGS}
--enable-threadsafe
--enable-load-extension
--enable-json1
--enable-fts4
--enable-fts5
# While building `tcl` is harmless, it causes problems when the install step
# tries to copy the files into the system path.
# Since this isn't required by Python or Blender this can be disabled.
# Note that Debian (for example), splits this off into a separate package,
# so it's safe to turn off.
--disable-tcl
--enable-shared=no
)
endif()
ExternalProject_Add(external_sqlite
URL ${SQLITE_URI}
URL file://${PACKAGE_DIR}/${SQLITE_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH SHA1=${SQLITE_HASH}
URL_HASH ${SQLITE_HASH_TYPE}=${SQLITE_HASH}
PREFIX ${BUILD_DIR}/sqlite
PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/sqlite/src/external_sqlite < ${PATCH_DIR}/sqlite.diff
CONFIGURE_COMMAND ${SQLITE_CONFIGURE_ENV} && cd ${BUILD_DIR}/sqlite/src/external_sqlite/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/sqlite ${SQLITE_CONFIGURATION_ARGS}
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/sqlite/src/external_sqlite/ && make -j${MAKE_THREADS}
INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/sqlite/src/external_sqlite/ && make install

View File

@@ -0,0 +1,30 @@
# ***** 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 *****
if(APPLE AND ("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "arm64"))
ExternalProject_Add(external_sse2neon
GIT_REPOSITORY ${SSE2NEON_GIT}
GIT_TAG ${SSE2NEON_GIT_HASH}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
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
)
endif()

View File

@@ -20,7 +20,8 @@ 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}")
set(SSL_PATCH_CMD ${PATCH_CMD} --verbose -p 0 -d ${BUILD_DIR}/ssl/src/external_ssl < ${PATCH_DIR}/ssl.diff)
else()
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
set(SSL_EXTRA_ARGS enable-ec_nistp_64_gcc_128)
@@ -31,9 +32,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

@@ -37,12 +37,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/src/tbb/version_string.ver &&
${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
@@ -45,6 +45,7 @@ ExternalProject_Add(external_tiff
add_dependencies(
external_tiff
external_zlib
external_jpeg
)
if(WIN32 AND BUILD_MODE STREQUAL Debug)

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

@@ -16,40 +16,71 @@
#
# ***** END GPL LICENSE BLOCK *****
set(ZLIB_VERSION 1.2.11)
# CPE's are used to identify dependencies, for more information on what they
# are please see https://nvd.nist.gov/products/cpe
#
# We use them in combination with cve-bin-tool to scan for known security issues.
#
# Not all of our dependencies are currently in the nvd database so not all
# dependencies have one assigned.
set(ZLIB_VERSION 1.2.13)
set(ZLIB_URI https://zlib.net/zlib-${ZLIB_VERSION}.tar.gz)
set(ZLIB_HASH 1c9f62f0778697a09d36121ead88e08e)
set(ZLIB_HASH 9b8aa094c4e5765dabf4da391f00d15c)
set(ZLIB_HASH_TYPE MD5)
set(ZLIB_FILE zlib-${ZLIB_VERSION}.tar.gz)
set(ZLIB_CPE "cpe:2.3:a:zlib:zlib:${ZLIB_VERSION}:*:*:*:*:*:*:*")
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(PNG_CPE "cpe:2.3:a:libpng:libpng:${PNG_VERSION}:*:*:*:*:*:*:*")
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(JPEG_CPE "cpe:2.3:a:d.r.commander:libjpeg-turbo:${JPEG_VERSION}:*:*:*:*:*:*:*")
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)
set(BOOST_CPE "cpe:2.3:a:boost:boost:${BOOST_VERSION}:*:*:*:*:*:*:*")
# 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(BLOSC_CPE "cpe:2.3:a:c-blosc2_project:c-blosc2:${BLOSC_VERSION}:*:*:*:*:*:*:*")
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.8)
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)
set(OPENEXR_CPE "cpe:2.3:a:openexr:openexr:${OPENEXR_VERSION}:*:*:*:*:*:*:*")
if(WIN32)
# Openexr started appending _d on its own so now
# we need to tell the build the postfix is _s while
@@ -66,267 +97,445 @@ else()
set(OPENEXR_VERSION_POSTFIX)
endif()
set(FREETYPE_VERSION 2.10.2)
set(FREETYPE_VERSION 2.12.1)
set(FREETYPE_URI http://prdownloads.sourceforge.net/freetype/freetype-${FREETYPE_VERSION}.tar.gz)
set(FREETYPE_HASH b1cb620e4c875cd4d1bfa04945400945)
set(FREETYPE_HASH 8bc5c9c9df7ac12c504f8918552a7cf2)
set(FREETYPE_HASH_TYPE MD5)
set(FREETYPE_FILE freetype-${FREETYPE_VERSION}.tar.gz)
SET(FREETYPE_CPE "cpe:2.3:a:freetype:freetype:${FREETYPE_VERSION}:*:*:*:*:*:*:*")
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)
SET(FREETYPE_CPE "cpe:2.3:a:freetype:freetype:${FREETYPE_VERSION}:*:*:*:*:*:*:*")
# 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(SDL_CPE "cpe:2.3:a:libsdl:sdl:${SDL_VERSION}:*:*:*:*:*:*:*")
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(APPLE AND ("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "arm64"))
# 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(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(LLVM_CPE "cpe:2.3:a:llvm:compiler:${LLVM_VERSION}:*:*:*:*:*:*:*")
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_VERSION 4.4.0)
set(TIFF_URI http://download.osgeo.org/libtiff/tiff-${TIFF_VERSION}.tar.gz)
set(TIFF_HASH 2165e7aba557463acc0664e71a3ed424)
set(TIFF_HASH 376f17f189e9d02280dfe709b2b2bbea)
set(TIFF_HASH_TYPE MD5)
set(TIFF_FILE tiff-${TIFF_VERSION}.tar.gz)
set(TIFF_CPE "cpe:2.3:a:libtiff:libtiff:${TIFF_VERSION}:*:*:*:*:*:*:*")
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.15)
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(PYTHON_CPE "cpe:2.3:a:python:python:${PYTHON_VERSION}:-:*:*:*:*:*:*")
set(TBB_VERSION 2019_U9)
set(TBB_YEAR 2020)
set(TBB_VERSION ${TBB_YEAR}_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(TBB_CPE "cpe:2.3:a:intel:threading_building_blocks:${TBB_YEAR}:*:*:*:*:*:*:*")
if(WITH_NANOVDB)
set(OPENVDB_GIT_UID e62f7a0bf1e27397223c61ddeaaf57edf111b77f)
set(OPENVDB_URI https://github.com/AcademySoftwareFoundation/openvdb/archive/${OPENVDB_GIT_UID}.tar.gz)
set(OPENVDB_HASH 90919510bc6ccd630fedc56f748cb199)
else()
set(OPENVDB_VERSION 7.0.0)
set(OPENVDB_URI https://github.com/AcademySoftwareFoundation/openvdb/archive/v${OPENVDB_VERSION}.tar.gz)
set(OPENVDB_HASH fd6c4f168282f7e0e494d290cd531fa8)
endif()
set(OPENVDB_VERSION 8.0.1)
set(OPENVDB_URI https://github.com/AcademySoftwareFoundation/openvdb/archive/v${OPENVDB_VERSION}.tar.gz)
set(OPENVDB_HASH 01b490be16cc0e15c690f9a153c21461)
set(OPENVDB_HASH_TYPE MD5)
set(OPENVDB_FILE openvdb-${OPENVDB_VERSION}.tar.gz)
set(IDNA_VERSION 2.9)
set(CHARDET_VERSION 3.0.4)
set(URLLIB3_VERSION 1.25.9)
set(CERTIFI_VERSION 2020.4.5.2)
set(REQUESTS_VERSION 2.23.0)
set(NANOVDB_GIT_UID 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(NUMPY_VERSION 1.17.5)
set(NUMPY_SHORT_VERSION 1.17)
set(IDNA_VERSION 2.10)
set(CHARDET_VERSION 4.0.0)
set(URLLIB3_VERSION 1.26.3)
set(URLLIB3_CPE "cpe:2.3:a:urllib3:urllib3:${URLLIB3_VERSION}:*:*:*:*:*:*:*")
set(CERTIFI_VERSION 2020.12.5)
set(REQUESTS_VERSION 2.25.1)
set(CYTHON_VERSION 0.29.21)
set(NUMPY_VERSION 1.22.0)
set(NUMPY_SHORT_VERSION 1.22)
set(NUMPY_URI https://github.com/numpy/numpy/releases/download/v${NUMPY_VERSION}/numpy-${NUMPY_VERSION}.zip)
set(NUMPY_HASH 763a5646fa6eef7a22f4895bca0524f2)
set(NUMPY_HASH 252de134862a27bd66705d29622edbfe)
set(NUMPY_HASH_TYPE MD5)
set(NUMPY_FILE numpy-${NUMPY_VERSION}.zip)
set(NUMPY_CPE "cpe:2.3:a:numpy:numpy:${NUMPY_VERSION}:*:*:*:*:*:*:*")
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(LAME_CPE "cpe:2.3:a:lame_project:lame:${LAME_VERSION}:*:*:*:*:*:*:*")
set(OGG_VERSION 1.3.4)
set(OGG_VERSION 1.3.5)
set(OGG_URI http://downloads.xiph.org/releases/ogg/libogg-${OGG_VERSION}.tar.gz)
set(OGG_HASH fe5670640bd49e828d64d2879c31cb4dde9758681bb664f9bdbf159a01b0c76e)
set(OGG_HASH 0eb4b4b9420a0f51db142ba3f9c64b333f826532dc0f48c6410ae51f4799b664)
set(OGG_HASH_TYPE SHA256)
set(OGG_FILE libogg-${OGG_VERSION}.tar.gz)
set(VORBIS_VERSION 1.3.6)
set(VORBIS_VERSION 1.3.7)
set(VORBIS_URI http://downloads.xiph.org/releases/vorbis/libvorbis-${VORBIS_VERSION}.tar.gz)
set(VORBIS_HASH 6ed40e0241089a42c48604dc00e362beee00036af2d8b3f46338031c9e0351cb)
set(VORBIS_HASH 0e982409a9c3fc82ee06e08205b1355e5c6aa4c36bca58146ef399621b0ce5ab)
set(VORBIS_HASH_TYPE SHA256)
set(VORBIS_FILE libvorbis-${VORBIS_VERSION}.tar.gz)
set(VORBIS_CPE "cpe:2.3:a:xiph.org:libvorbis:${VORBIS_VERSION}:*:*:*:*:*:*:*")
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_VERSION 1.3.4)
set(FLAC_URI http://downloads.xiph.org/releases/flac/flac-${FLAC_VERSION}.tar.xz)
set(FLAC_HASH 213e82bd716c9de6db2f98bcadbc4c24c7e2efe8c75939a1a84e28539c4e1748)
set(FLAC_HASH 8ff0607e75a322dd7cd6ec48f4f225471404ae2730d0ea945127b1355155e737 )
set(FLAC_HASH_TYPE SHA256)
set(FLAC_FILE flac-${FLAC_VERSION}.tar.xz)
set(FLAC_CPE "cpe:2.3:a:flac_project:flac:${FLAC_VERSION}:*:*:*:*:*:*:*")
set(VPX_VERSION 1.8.2)
set(VPX_VERSION 1.11.0)
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 965e51c91ad9851e2337aebcc0f517440c637c506f3a03948062e3d5ea129a83)
set(VPX_HASH_TYPE SHA256)
set(VPX_FILE libvpx-v${VPX_VERSION}.tar.gz)
set(VPX_CPE "cpe:2.3:a:webmproject:libvpx:${VPX_VERSION}:*:*:*:*:*:*:*")
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_VERSION 2.5.0)
set(OPENJPEG_SHORT_VERSION 2.5)
set(OPENJPEG_URI https://github.com/uclouvain/openjpeg/archive/v${OPENJPEG_VERSION}.tar.gz)
set(OPENJPEG_HASH 63f5a4713ecafc86de51bfad89cc07bb788e9bba24ebbf0c4ca637621aadb6a9)
set(OPENJPEG_HASH 0333806d6adecc6f7a91243b2b839ff4d2053823634d4f6ed7a59bc87409122a)
set(OPENJPEG_HASH_TYPE SHA256)
set(OPENJPEG_FILE openjpeg-v${OPENJPEG_VERSION}.tar.gz)
set(OPENJPEG_CPE "cpe:2.3:a:uclouvain:openjpeg:${OPENJPEG_VERSION}:*:*:*:*:*:*:*")
set(FFMPEG_VERSION 4.2.3)
set(FFMPEG_VERSION 4.4.3)
set(FFMPEG_URI http://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.bz2)
set(FFMPEG_HASH 695fad11f3baf27784e24cb0e977b65a)
set(FFMPEG_HASH_TYPE MD5)
set(FFMPEG_FILE ffmpeg-${FFMPEG_VERSION}.tar.bz2)
set(FFMPEG_CPE "cpe:2.3:a:ffmpeg:ffmpeg:${FFMPEG_VERSION}:*:*:*:*:*:*:*")
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(SNDFILE_VERSION 1.1.0)
set(SNDFILE_URI https://github.com/libsndfile/libsndfile/releases/download/1.1.0/libsndfile-${SNDFILE_VERSION}.tar.xz)
set(SNDFILE_HASH e63dead2b4f0aaf323687619d007ee6a)
set(SNDFILE_HASH_TYPE MD5)
set(SNDFILE_FILE libsndfile-${SNDFILE_VERSION}.tar.gz)
set(SNDFILE_CPE "cpe:2.3:a:libsndfile_project:libsndfile:${SNDFILE_VERSION}:*:*:*:*:*:*:*")
# 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(WEBP_VERSION 0.6.1)
set(WEBP_VERSION 1.2.2)
set(WEBP_URI https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-${WEBP_VERSION}.tar.gz)
set(WEBP_HASH b49ce9c3e3e9acae4d91bca44bb85a72)
set(WEBP_HASH b5e2e414a8adee4c25fe56b18dd9c549)
set(WEBP_HASH_TYPE MD5)
set(WEBP_FILE libwebp-${WEBP_VERSION}.tar.gz)
set(WEBP_CPE "cpe:2.3:a:webmproject:libwebp:${WEBP_VERSION}:*:*:*:*:*:*:*")
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(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(XML2_VERSION 2.10.3)
set(XML2_URI https://download.gnome.org/sources/libxml2/2.10/libxml2-${XML2_VERSION}.tar.xz)
set(XML2_HASH f9edac7fac232b3657a003fd9a5bbe42)
set(XML2_HASH_TYPE MD5)
set(XML2_FILE libxml2-${XML2_VERSION}.tar.xz)
set(XML2_CPE "cpe:2.3:a:xmlsoft:libxml2:${XML2_VERSION}:*:*:*:*:*:*:*")
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(YAMLCPP "cpe:2.3:a:yaml-cpp_project:yaml-cpp:${YAMLCPP_VERSION}:*:*:*:*:*:*:*")
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_5_0)
set(EXPAT_VERSION_DOTS 2.5.0)
set(EXPAT_URI https://github.com/libexpat/libexpat/archive/R_${EXPAT_VERSION}.tar.gz)
set(EXPAT_HASH d375fa3571c0abb945873f5061a8f2e2)
set(EXPAT_HASH_TYPE MD5)
set(EXPAT_FILE libexpat-${EXPAT_VERSION}.tar.gz)
set(EXPAT_CPE "cpe:2.3:a:libexpat_project:libexpat:${EXPAT_VERSION_DOTS}:*:*:*:*:*:*:*")
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(PUGIXML_CPE "cpe:2.3:a:pugixml_project:pugixml:${PUGIXML_VERSION}:*:*:*:*:*:*:*")
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.
# NOTE: bzip.org domain does no longer belong to BZip 2 project, so we download
# sources from Debian packaging.
#
# NOTE 2: This will *HAVE* to match the version python ships on windows which
# is hardcoded in pythons PCbuild/get_externals.bat. For compliance reasons there
# can be no exceptions to this.
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(BZIP2_CPE "cpe:2.3:a:bzip:bzip2:${BZIP2_VERSION}:*:*:*:*:*:*:*")
# NOTE: This will *HAVE* to match the version python ships on windows which
# is hardcoded in pythons PCbuild/get_externals.bat. For compliance reasons there
# can be no exceptions to this.
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(FFI_CPE "cpe:2.3:a:libffi_project:libffi:${FFI_VERSION}:*:*:*:*:*:*:*")
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)
# NOTE: This will *HAVE* to match the version python ships on windows which
# is hardcoded in pythons PCbuild/get_externals.bat. For compliance reasons there
# can be no exceptions to this.
set(SSL_VERSION 1.1.1q)
set(SSL_URI https://www.openssl.org/source/openssl-${SSL_VERSION}.tar.gz)
set(SSL_HASH ddb04774f1e32f0c49751e21b67216ac87852ceb056b75209af2443400636d46)
set(SSL_HASH d7939ce614029cdff0b6c20f0e2e5703158a489a72b2507b8bd51bf8c8fd10ca)
set(SSL_HASH_TYPE SHA256)
set(SSL_FILE openssl-${SSL_VERSION}.tar.gz)
set(SSL_CPE "cpe:2.3:a:openssl:openssl:${SSL_VERSION}:*:*:*:*:*:*:*")
set(SQLITE_VERSION 3.31.1)
set(SQLITE_URI https://www.sqlite.org/2018/sqlite-src-3240000.zip)
set(SQLITE_HASH fb558c49ee21a837713c4f1e7e413309aabdd9c7)
# Note: This will *HAVE* to match the version python ships on windows which
# is hardcoded in pythons PCbuild/get_externals.bat for compliance reasons there
# can be no exceptions to this.
set(SQLITE_VERSION 3.37.2)
set(SQLLITE_LONG_VERSION 3370200)
set(SQLITE_URI https://www.sqlite.org/2022/sqlite-autoconf-${SQLLITE_LONG_VERSION}.tar.gz)
set(SQLITE_HASH e56faacadfb4154f8fbd0f2a3f827d13706b70a1)
set(SQLITE_HASH_TYPE SHA1)
set(SQLITE_FILE sqlite-autoconf-${SQLLITE_LONG_VERSION}.tar.gz)
set(SQLITE_CPE "cpe:2.3:a:sqlite:sqlite:${SQLITE_VERSION}:*:*:*:*:*:*:*")
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(MESA_CPE "cpe:2.3:a:mesa3d:mesa:${MESA_VERSION}:*:*:*:*:*:*:*")
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(NASM_PCE "cpe:2.3:a:nasm:nasm:${NASM_VERSION}:*:*:*:*:*:*:*")
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(APPLE AND ("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "arm64"))
# 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(GMP_CPE "cpe:2.3:a:gmplib:gmp:${GMP_VERSION}:*:*:*:*:*:*:*")
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(POTRACE_CPE "cpe:2.3:a:icoasoft:potrace:${POTRACE_VERSION}:*:*:*:*:*:*:*")
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

@@ -41,9 +41,9 @@ if(UNIX AND NOT APPLE)
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

@@ -16,21 +16,49 @@
#
# ***** END GPL LICENSE BLOCK *****
ExternalProject_Add(external_xml2
URL ${XML2_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${XML2_HASH}
PREFIX ${BUILD_DIR}/xml2
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/xml2/src/external_xml2/ && ${CONFIGURE_COMMAND}
--prefix=${LIBDIR}/xml2
--disable-shared
--enable-static
--with-pic
--with-python=no
--with-lzma=no
--with-zlib=no
--with-iconv=no
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/xml2/src/external_xml2/ && make -j${MAKE_THREADS}
INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/xml2/src/external_xml2/ && make install
INSTALL_DIR ${LIBDIR}/xml2
)
if(WIN32)
set(XML2_EXTRA_ARGS
-DLIBXML2_WITH_ZLIB=OFF
-DLIBXML2_WITH_LZMA=OFF
-DLIBXML2_WITH_PYTHON=OFF
-DLIBXML2_WITH_ICONV=OFF
-DLIBXML2_WITH_TESTS=OFF
-DLIBXML2_WITH_PROGRAMS=OFF
-DBUILD_SHARED_LIBS=OFF
)
ExternalProject_Add(external_xml2
URL file://${PACKAGE_DIR}/${XML2_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${XML2_HASH_TYPE}=${XML2_HASH}
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/xml2 ${DEFAULT_CMAKE_FLAGS} ${XML2_EXTRA_ARGS}
PREFIX ${BUILD_DIR}/xml2
INSTALL_DIR ${LIBDIR}/xml2
)
else()
ExternalProject_Add(external_xml2
URL file://${PACKAGE_DIR}/${XML2_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
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
--disable-shared
--enable-static
--with-pic
--with-python=no
--with-lzma=no
--with-zlib=no
--with-iconv=no
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/xml2/src/external_xml2/ && make -j${MAKE_THREADS}
INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/xml2/src/external_xml2/ && make install
INSTALL_DIR ${LIBDIR}/xml2
)
endif()
if(WIN32 AND BUILD_MODE STREQUAL Release)
ExternalProject_Add_Step(external_xml2 after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/xml2/include ${HARVEST_TARGET}/xml2/include
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/xml2/lib/libxml2s.lib ${HARVEST_TARGET}/xml2/lib/libxml2s.lib
DEPENDEES install
)
endif()

View File

@@ -35,9 +35,9 @@ if(UNIX AND NOT APPLE)
endif()
ExternalProject_Add(external_xr_openxr_sdk
URL ${XR_OPENXR_SDK_URI}
URL file://${PACKAGE_DIR}/${XR_OPENXR_SDK_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${XR_OPENXR_SDK_HASH}
URL_HASH ${XR_OPENXR_SDK_HASH_TYPE}=${XR_OPENXR_SDK_HASH}
PREFIX ${BUILD_DIR}/xr_openxr_sdk
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/xr_openxr_sdk ${DEFAULT_CMAKE_FLAGS} ${XR_OPENXR_SDK_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/xr_openxr_sdk
@@ -53,7 +53,7 @@ if(WIN32)
endif()
if(BUILD_MODE STREQUAL Debug)
ExternalProject_Add_Step(external_xr_openxr_sdk after_install
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/xr_openxr_sdk/lib/openxr_loader.lib ${HARVEST_TARGET}/xr_openxr_sdk/lib/openxr_loader_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/xr_openxr_sdk/lib/openxr_loaderd.lib ${HARVEST_TARGET}/xr_openxr_sdk/lib/openxr_loaderd.lib
DEPENDEES install
)
endif()

View File

@@ -21,9 +21,9 @@ if(WIN32)
endif()
ExternalProject_Add(external_xvidcore
URL ${XVIDCORE_URI}
URL file://${PACKAGE_DIR}/${XVIDCORE_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH SHA256=${XVIDCORE_HASH}
URL_HASH ${XVIDCORE_HASH_TYPE}=${XVIDCORE_HASH}
PREFIX ${BUILD_DIR}/xvidcore
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/xvidcore/src/external_xvidcore/build/generic && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/xvidcore ${XVIDCORE_EXTRA_ARGS}
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/xvidcore/src/external_xvidcore/build/generic && make -j${MAKE_THREADS}

View File

@@ -17,17 +17,22 @@
# ***** END GPL LICENSE BLOCK *****
set(YAMLCPP_EXTRA_ARGS
-DBUILD_GMOCK=OFF
-DYAML_CPP_BUILD_TESTS=OFF
-DYAML_CPP_BUILD_TOOLS=OFF
-DYAML_CPP_BUILD_CONTRIB=OFF
-DYAML_MSVC_SHARED_RT=ON
)
if(WIN32)
set(YAMLCPP_EXTRA_ARGS
${YAMLCPP_EXTRA_ARGS}
-DBUILD_GMOCK=OFF
-DYAML_MSVC_SHARED_RT=ON)
endif()
ExternalProject_Add(external_yamlcpp
URL ${YAMLCPP_URI}
URL file://${PACKAGE_DIR}/${YAMLCPP_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${YAMLCPP_HASH}
URL_HASH ${YAMLCPP_HASH_TYPE}=${YAMLCPP_HASH}
PREFIX ${BUILD_DIR}/yamlcpp
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/yamlcpp ${DEFAULT_CMAKE_FLAGS} ${YAMLCPP_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/yamlcpp

View File

@@ -17,9 +17,8 @@
# ***** END GPL LICENSE BLOCK *****
ExternalProject_Add(external_zlib
URL ${ZLIB_URI}
URL_HASH MD5=${ZLIB_HASH}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL file://${PACKAGE_DIR}/${ZLIB_FILE}
URL_HASH ${ZLIB_HASH_TYPE}=${ZLIB_HASH}
PREFIX ${BUILD_DIR}/zlib
CMAKE_ARGS -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_INSTALL_PREFIX=${LIBDIR}/zlib ${DEFAULT_CMAKE_FLAGS}
INSTALL_DIR ${LIBDIR}/zlib

View File

@@ -17,8 +17,8 @@
# ***** END GPL LICENSE BLOCK *****
ExternalProject_Add(external_zlib_mingw
URL ${ZLIB_URI}
URL_HASH MD5=${ZLIB_HASH}
URL file://${PACKAGE_DIR}/${ZLIB_FILE}
URL_HASH ${ZLIB_HASH_TYPE}=${ZLIB_HASH}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
PREFIX ${BUILD_DIR}/zlib_mingw
CONFIGURE_COMMAND echo .

View File

@@ -1,38 +1,76 @@
strict graph {
graph[autosize = false, size = "25.7,8.3!", resolution = 300, overlap = false, splines = false, outputorder=edgesfirst ];
node [style=filled fillcolor=white];
external_alembic -- external_boost;
external_alembic -- external_zlib;
graph[autosize = false, size = "25.7,8.3!", resolution = 300];
external_alembic -- external_openexr;
external_alembic -- external_imath;
external_blosc -- external_zlib;
external_blosc -- external_pthreads;
external_boost -- Make_Python_Environment;
external_clang -- ll;
external_boost -- external_python;
external_boost -- external_numpy;
external_dpcpp -- external_python;
external_dpcpp -- external_python_site_packages;
external_dpcpp -- external_vcintrinsics;
external_dpcpp -- external_openclheaders;
external_dpcpp -- external_icdloader;
external_dpcpp -- external_mp11;
external_dpcpp -- external_level_zero;
external_dpcpp -- external_spirvheaders;
external_embree -- external_tbb;
external_ffmpeg -- external_zlib;
external_ffmpeg -- external_faad;
external_ffmpeg -- external_openjpeg;
external_ffmpeg -- external_xvidcore;
external_ffmpeg -- external_x264;
external_ffmpeg -- external_opus;
external_ffmpeg -- external_vpx;
external_ffmpeg -- external_theora;
external_ffmpeg -- external_vorbis;
external_ffmpeg -- external_ogg;
external_ffmpeg -- external_lame;
external_ffmpeg -- external_aom;
external_ffmpeg -- external_zlib_mingw;
external_numpy -- Make_Python_Environment;
external_ffmpeg -- external_nasm;
external_freetype -- external_brotli;
external_freetype -- external_zlib;
external_gmpxx -- external_gmp;
external_igc_llvm -- external_igc_opencl_clang;
external_igc_spirv_translator -- external_igc_opencl_clang;
external_igc -- external_igc_vcintrinsics;
external_igc -- external_igc_llvm;
external_igc -- external_igc_opencl_clang;
external_igc -- external_igc_vcintrinsics;
external_igc -- external_igc_spirv_headers;
external_igc -- external_igc_spirv_tools;
external_igc -- external_igc_spirv_translator;
external_igc -- external_flex;
external_ispc -- ll;
external_ispc -- external_python;
external_ispc -- external_flexbison;
external_ispc -- external_flex;
ll -- external_xml2;
ll -- external_python;
external_mesa -- ll;
external_numpy -- external_python;
external_numpy -- external_python_site_packages;
external_ocloc -- external_igc;
external_ocloc -- external_gmmlib;
external_opencollada -- external_xml2;
external_opencolorio -- external_boost;
external_opencolorio -- external_tinyxml;
external_opencolorio -- external_yamlcpp;
external_opencolorio -- external_expat;
external_opencolorio -- external_imath;
external_opencolorio -- external_pystring;
external_openexr -- external_zlib;
external_openimagedenoise -- external_tbb;
external_openimagedenoise -- external_ispc;
external_openimagedenoise -- external_python;
external_openimageio -- external_png;
external_openimageio -- external_zlib;
external_openimageio -- external_openexr;
external_openimageio -- external_openexr;
external_openimageio -- external_imath;
external_openimageio -- external_jpeg;
external_openimageio -- external_boost;
external_openimageio -- external_tiff;
external_openimageio -- external_opencolorio;
external_openimageio -- external_pugixml;
external_openimageio -- external_fmt;
external_openimageio -- external_robinmap;
external_openimageio -- external_openjpeg;
external_openimageio -- external_webp;
external_openimageio -- external_opencolorio_extra;
@@ -44,57 +82,37 @@ graph[autosize = false, size = "25.7,8.3!", resolution = 300, overlap = false, s
external_opensubdiv -- external_tbb;
openvdb -- external_tbb;
openvdb -- external_boost;
openvdb -- external_openexr;
openvdb -- external_openexr;
openvdb -- external_zlib;
openvdb -- external_blosc;
external_osl -- external_boost;
external_osl -- ll;
external_osl -- external_clang;
external_osl -- external_openexr;
external_osl -- external_openexr;
external_osl -- external_zlib;
external_osl -- external_flexbison;
external_osl -- external_openimageio;
external_osl -- external_pugixml;
external_osl -- external_flexbison;
external_osl -- external_flex;
external_png -- external_zlib;
external_python_site_packages -- Make_Python_Environment;
external_python -- external_bzip2;
external_python -- external_ffi;
external_python -- external_lzma;
external_python -- external_ssl;
external_python -- external_sqlite;
external_python -- external_zlib;
external_python_site_packages -- external_python;
external_sndfile -- external_ogg;
external_sndfile -- external_vorbis;
external_sndfile -- external_flac;
external_theora -- external_vorbis;
external_theora -- external_ogg;
external_tiff -- external_zlib;
external_usd -- external_tbb;
external_usd -- external_boost;
external_usd -- external_opensubdiv;
external_vorbis -- external_ogg;
blender-- external_ffmpeg;
blender-- external_alembic;
blender-- external_openjpeg;
blender-- external_opencolorio;
blender-- external_openexr;
blender-- external_opensubdiv;
blender-- openvdb;
blender-- external_osl;
blender-- external_boost;
blender-- external_jpeg;
blender-- external_png;
blender-- external_python;
blender-- external_sndfile;
blender-- external_iconv;
blender-- external_fftw3;
external_python-- external_python_site_packages;
external_python_site_packages-- requests;
external_python_site_packages-- idna;
external_python_site_packages-- chardet;
external_python_site_packages-- urllib3;
external_python_site_packages-- certifi;
external_python-- external_numpy;
external_usd-- external_boost;
external_usd-- external_tbb;
blender-- external_opencollada;
blender-- external_sdl;
blender-- external_freetype;
blender-- external_pthreads;
blender-- external_zlib;
blender-- external_openal;
blender-- external_usd;
external_wayland -- external_expat;
external_wayland -- external_xml2;
external_wayland -- external_ffi;
external_wayland_protocols -- external_wayland;
external_x264 -- external_nasm;
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,18 @@
diff -Naur libaom-3.4.0/build/cmake/aom_configure.cmake external_aom/build/cmake/aom_configure.cmake
--- libaom-3.4.0/build/cmake/aom_configure.cmake 2022-06-17 11:46:18 -0600
+++ external_aom/build/cmake/aom_configure.cmake 2022-10-16 15:35:54 -0600
@@ -15,8 +15,12 @@
include(FindGit)
include(FindPerl)
-include(FindThreads)
-
+# Blender: This will drag in a dep on libwinpthreads which we prefer
+# not to have, aom will fallback on a native win32 thread wrapper
+# if pthreads are not found.
+if(NOT WIN32)
+ include(FindThreads)
+endif()
include("${AOM_ROOT}/build/cmake/aom_config_defaults.cmake")
include("${AOM_ROOT}/build/cmake/aom_experiment_deps.cmake")
include("${AOM_ROOT}/build/cmake/aom_optimization.cmake")

View File

@@ -20,6 +20,7 @@ if(APPLE)
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})

View File

@@ -68,3 +68,18 @@
+
return ret;
}
diff --git a/libavcodec/x86/simple_idct.asm b/libavcodec/x86/simple_idct.asm
index dcf0da6df121..982b2f0bbba1 100644
--- a/libavcodec/x86/simple_idct.asm
+++ b/libavcodec/x86/simple_idct.asm
@@ -25,9 +25,9 @@
%include "libavutil/x86/x86util.asm"
-%if ARCH_X86_32
SECTION_RODATA
+%if ARCH_X86_32
cextern pb_80
wm1010: dw 0, 0xffff, 0, 0xffff

View File

@@ -0,0 +1,15 @@
--- a/mpz/inp_raw.c Tue Dec 22 23:49:51 2020 +0100
+++ b/mpz/inp_raw.c Thu Oct 21 19:06:49 2021 +0200
@@ -88,8 +88,11 @@
abs_csize = ABS (csize);
+ if (UNLIKELY (abs_csize > ~(mp_bitcnt_t) 0 / 8))
+ return 0; /* Bit size overflows */
+
/* round up to a multiple of limbs */
- abs_xsize = BITS_TO_LIMBS (abs_csize*8);
+ abs_xsize = BITS_TO_LIMBS ((mp_bitcnt_t) abs_csize * 8);
if (abs_xsize != 0)
{

View File

@@ -0,0 +1,12 @@
diff --git a/src/hpdf_image_ccitt.c b/src/hpdf_image_ccitt.c
index 8672763..9be531a 100644
--- a/src/hpdf_image_ccitt.c
+++ b/src/hpdf_image_ccitt.c
@@ -21,7 +21,6 @@
#include <memory.h>
#include <assert.h>
-#define G3CODES
#include "t4.h"
typedef unsigned int uint32;

View File

@@ -1,5 +1,5 @@
--- a/lib/Support/Unix/Path.inc 2020-02-17 09:24:26.000000000 +0100
+++ b/lib/Support/Unix/Path.inc 2020-02-17 09:26:25.000000000 +0100
--- a/llvm/lib/Support/Unix/Path.inc 2020-02-17 09:24:26.000000000 +0100
+++ b/llvm/lib/Support/Unix/Path.inc 2020-02-17 09:26:25.000000000 +0100
@@ -1200,7 +1200,9 @@
/// implementation.
std::error_code copy_file(const Twine &From, const Twine &To) {

View File

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

@@ -130,3 +130,28 @@ index 715d903..24423ce 100644
{
string id = node.attribute("id").value();
size_t line = node.line();
diff -Naur a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -274,7 +274,7 @@
add_subdirectory(${EXTERNAL_LIBRARIES}/UTF)
add_subdirectory(common/libBuffer)
add_subdirectory(${EXTERNAL_LIBRARIES}/MathMLSolver)
-add_subdirectory(${EXTERNAL_LIBRARIES}/zlib)
+#add_subdirectory(${EXTERNAL_LIBRARIES}/zlib)
# building OpenCOLLADA libs
add_subdirectory(COLLADABaseUtils)
@@ -284,10 +284,10 @@
add_subdirectory(COLLADAStreamWriter)
# building COLLADAValidator app
-add_subdirectory(COLLADAValidator)
+#add_subdirectory(COLLADAValidator)
# DAE validator app
-add_subdirectory(DAEValidator)
+#add_subdirectory(DAEValidator)
# Library export
install(EXPORT LibraryExport DESTINATION ${OPENCOLLADA_INST_CMAKECONFIG} FILE OpenCOLLADATargets.cmake)

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

@@ -34,3 +34,24 @@ diff -Naur orig/src/include/OpenImageIO/platform.h external_openimageio/src/incl
# include <windows.h>
#endif
diff -Naur orig/src/libutil/ustring.cpp external_openimageio/src/libutil/ustring.cpp
--- orig/src/libutil/ustring.cpp 2020-05-11 05:43:52.000000000 +0200
+++ external_openimageio/src/libutil/ustring.cpp 2020-11-26 12:06:08.000000000 +0100
@@ -337,6 +337,8 @@
// the std::string to make it point to our chars! In such a case, the
// destructor will be careful not to allow a deallocation.
+ // Disable internal std::string for Apple silicon based Macs
+#if !(defined(__APPLE__) && defined(__arm64__))
#if defined(__GNUC__) && !defined(_LIBCPP_VERSION) \
&& defined(_GLIBCXX_USE_CXX11_ABI) && _GLIBCXX_USE_CXX11_ABI
// NEW gcc ABI
@@ -382,7 +384,7 @@
return;
}
#endif
-
+#endif
// Remaining cases - just assign the internal string. This may result
// in double allocation for the chars. If you care about that, do
// something special for your platform, much like we did for gcc and

View File

@@ -1,10 +1,10 @@
diff -Naur orig/cmake/FindIlmBase.cmake openvdb/cmake/FindIlmBase.cmake
--- orig/cmake/FindIlmBase.cmake 2019-12-06 12:11:33 -0700
+++ openvdb/cmake/FindIlmBase.cmake 2020-08-12 12:48:44 -0600
@@ -225,6 +225,12 @@
list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES
"-${IlmBase_VERSION_MAJOR}_${IlmBase_VERSION_MINOR}.lib"
)
diff -Naur openvdb-8.0.0/cmake/FindIlmBase.cmake openvdb/cmake/FindIlmBase.cmake
--- openvdb-8.0.0/cmake/FindIlmBase.cmake 2020-12-24 10:13:14 -0700
+++ openvdb/cmake/FindIlmBase.cmake 2021-02-05 12:07:49 -0700
@@ -217,6 +217,12 @@
set(CMAKE_FIND_LIBRARY_SUFFIXES ".lib")
endif()
list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES "${_IlmBase_Version_Suffix}.lib")
+ list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES
+ "_s.lib"
+ )
@@ -13,14 +13,14 @@ diff -Naur orig/cmake/FindIlmBase.cmake openvdb/cmake/FindIlmBase.cmake
+ )
else()
if(ILMBASE_USE_STATIC_LIBS)
list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES
diff -Naur orig/cmake/FindOpenEXR.cmake openvdb/cmake/FindOpenEXR.cmake
--- orig/cmake/FindOpenEXR.cmake 2019-12-06 12:11:33 -0700
+++ openvdb/cmake/FindOpenEXR.cmake 2020-08-12 12:48:44 -0600
@@ -218,6 +218,12 @@
list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES
"-${OpenEXR_VERSION_MAJOR}_${OpenEXR_VERSION_MINOR}.lib"
)
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
diff -Naur openvdb-8.0.0/cmake/FindOpenEXR.cmake openvdb/cmake/FindOpenEXR.cmake
--- openvdb-8.0.0/cmake/FindOpenEXR.cmake 2020-12-24 10:13:14 -0700
+++ openvdb/cmake/FindOpenEXR.cmake 2021-02-05 12:23:39 -0700
@@ -210,6 +210,12 @@
set(CMAKE_FIND_LIBRARY_SUFFIXES ".lib")
endif()
list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES "${_OpenEXR_Version_Suffix}.lib")
+ list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES
+ "_s.lib"
+ )
@@ -29,11 +29,11 @@ diff -Naur orig/cmake/FindOpenEXR.cmake openvdb/cmake/FindOpenEXR.cmake
+ )
else()
if(OPENEXR_USE_STATIC_LIBS)
list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES
diff -Naur orig/openvdb/CMakeLists.txt openvdb/openvdb/CMakeLists.txt
--- orig/openvdb/CMakeLists.txt 2019-12-06 12:11:33 -0700
+++ openvdb/openvdb/CMakeLists.txt 2020-08-12 14:12:26 -0600
@@ -105,7 +105,9 @@
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
diff -Naur openvdb-8.0.0/openvdb/openvdb/CMakeLists.txt openvdb/openvdb/openvdb/CMakeLists.txt
--- openvdb-8.0.0/openvdb/openvdb/CMakeLists.txt 2020-12-24 10:13:14 -0700
+++ openvdb/openvdb/openvdb/CMakeLists.txt 2021-02-05 11:18:33 -0700
@@ -107,7 +107,9 @@
# http://boost.2283326.n4.nabble.com/CMake-config-scripts-broken-in-1-70-td4708957.html
# https://github.com/boostorg/boost_install/commit/160c7cb2b2c720e74463865ef0454d4c4cd9ae7c
set(BUILD_SHARED_LIBS ON)
@@ -44,15 +44,15 @@ diff -Naur orig/openvdb/CMakeLists.txt openvdb/openvdb/CMakeLists.txt
endif()
find_package(Boost ${MINIMUM_BOOST_VERSION} REQUIRED COMPONENTS iostreams system)
@@ -193,6 +195,7 @@
if(OPENVDB_DISABLE_BOOST_IMPLICIT_LINKING)
add_definitions(-DBOOST_ALL_NO_LIB)
@@ -146,6 +148,7 @@
Boost::disable_autolinking # add -DBOOST_ALL_NO_LIB
)
endif()
+ add_definitions(-D__TBB_NO_IMPLICIT_LINKAGE -DOPENVDB_OPENEXR_STATICLIB)
endif()
# @todo Should be target definitions
@@ -383,7 +386,12 @@
if(USE_EXR)
@@ -379,7 +382,12 @@
# imported targets.
if(OPENVDB_CORE_SHARED)
@@ -66,9 +66,9 @@ diff -Naur orig/openvdb/CMakeLists.txt openvdb/openvdb/CMakeLists.txt
endif()
if(OPENVDB_CORE_STATIC)
diff -Naur orig/openvdb/version.rc.in openvdb/openvdb/version.rc.in
--- orig/openvdb/version.rc.in 1969-12-31 17:00:00 -0700
+++ openvdb/openvdb/version.rc.in 2020-08-12 14:15:01 -0600
diff -Naur openvdb-8.0.0/openvdb/openvdb/version.rc.in openvdb/openvdb/openvdb/version.rc.in
--- openvdb-8.0.0/openvdb/openvdb/version.rc.in 1969-12-31 17:00:00 -0700
+++ openvdb/openvdb/openvdb/version.rc.in 2021-02-05 11:18:33 -0700
@@ -0,0 +1,48 @@
+#include <winver.h>
+

View File

@@ -1,135 +0,0 @@
diff -Naur orig/cmake/FindIlmBase.cmake openvdb/cmake/FindIlmBase.cmake
--- orig/cmake/FindIlmBase.cmake 2019-12-06 12:11:33 -0700
+++ openvdb/cmake/FindIlmBase.cmake 2020-08-12 12:48:44 -0600
@@ -217,6 +217,8 @@
set(CMAKE_FIND_LIBRARY_SUFFIXES ".lib")
endif()
list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES "${_IlmBase_Version_Suffix}.lib")
+ list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES "_s.lib")
+ list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES "_s_d.lib")
else()
if(ILMBASE_USE_STATIC_LIBS)
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
diff -Naur orig/cmake/FindOpenEXR.cmake openvdb/cmake/FindOpenEXR.cmake
--- orig/cmake/FindOpenEXR.cmake 2019-12-06 12:11:33 -0700
+++ openvdb/cmake/FindOpenEXR.cmake 2020-08-12 12:48:44 -0600
@@ -210,6 +210,8 @@
set(CMAKE_FIND_LIBRARY_SUFFIXES ".lib")
endif()
list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES "${_OpenEXR_Version_Suffix}.lib")
+ list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES "_s.lib")
+ list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES "_s_d.lib")
else()
if(OPENEXR_USE_STATIC_LIBS)
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
diff -Naur orig/openvdb/openvdb/CMakeLists.txt openvdb/openvdb/openvdb/CMakeLists.txt
--- orig/openvdb/openvdb/CMakeLists.txt 2019-12-06 12:11:33 -0700
+++ openvdb/openvdb/openvdb/CMakeLists.txt 2020-08-12 14:12:26 -0600
@@ -105,7 +105,9 @@
# http://boost.2283326.n4.nabble.com/CMake-config-scripts-broken-in-1-70-td4708957.html
# https://github.com/boostorg/boost_install/commit/160c7cb2b2c720e74463865ef0454d4c4cd9ae7c
set(BUILD_SHARED_LIBS ON)
- set(Boost_USE_STATIC_LIBS OFF)
+ if(NOT WIN32) # blender links boost statically on windows
+ set(Boost_USE_STATIC_LIBS OFF)
+ endif()
endif()
find_package(Boost ${MINIMUM_BOOST_VERSION} REQUIRED COMPONENTS iostreams system)
@@ -193,6 +195,7 @@
if(OPENVDB_DISABLE_BOOST_IMPLICIT_LINKING)
add_definitions(-DBOOST_ALL_NO_LIB)
endif()
+ add_definitions(-D__TBB_NO_IMPLICIT_LINKAGE -DOPENVDB_OPENEXR_STATICLIB)
endif()
# @todo Should be target definitions
@@ -383,7 +386,12 @@
# imported targets.
if(OPENVDB_CORE_SHARED)
- add_library(openvdb_shared SHARED ${OPENVDB_LIBRARY_SOURCE_FILES})
+ if(WIN32)
+ configure_file(version.rc.in ${CMAKE_CURRENT_BINARY_DIR}/version.rc @ONLY)
+ add_library(openvdb_shared SHARED ${OPENVDB_LIBRARY_SOURCE_FILES} ${CMAKE_CURRENT_BINARY_DIR}/version.rc)
+ else()
+ add_library(openvdb_shared SHARED ${OPENVDB_LIBRARY_SOURCE_FILES})
+ endif()
endif()
if(OPENVDB_CORE_STATIC)
diff -Naur orig/openvdb/openvdb/version.rc.in openvdb/openvdb/openvdb/version.rc.in
--- orig/openvdb/openvdb/version.rc.in 1969-12-31 17:00:00 -0700
+++ openvdb/openvdb/openvdb/version.rc.in 2020-08-12 14:15:01 -0600
@@ -0,0 +1,48 @@
+#include <winver.h>
+
+#define VER_FILEVERSION @OpenVDB_MAJOR_VERSION@,@OpenVDB_MINOR_VERSION@,@OpenVDB_PATCH_VERSION@,0
+#define VER_FILEVERSION_STR "@OpenVDB_MAJOR_VERSION@.@OpenVDB_MINOR_VERSION@.@OpenVDB_PATCH_VERSION@.0\0"
+
+#define VER_PRODUCTVERSION @OpenVDB_MAJOR_VERSION@,@OpenVDB_MINOR_VERSION@,@OpenVDB_PATCH_VERSION@,0
+#define VER_PRODUCTVERSION_STR "@OpenVDB_MAJOR_VERSION@.@OpenVDB_MINOR_VERSION@\0"
+
+#ifndef DEBUG
+#define VER_DEBUG 0
+#else
+#define VER_DEBUG VS_FF_DEBUG
+#endif
+
+VS_VERSION_INFO VERSIONINFO
+FILEVERSION VER_FILEVERSION
+PRODUCTVERSION VER_PRODUCTVERSION
+FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
+FILEFLAGS (VER_DEBUG)
+FILEOS VOS__WINDOWS32
+FILETYPE VFT_DLL
+FILESUBTYPE VFT2_UNKNOWN
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904E4"
+ BEGIN
+ VALUE "FileDescription", "OpenVDB"
+ VALUE "FileVersion", VER_FILEVERSION_STR
+ VALUE "InternalName", "OpenVDB"
+ VALUE "ProductName", "OpenVDB"
+ VALUE "ProductVersion", VER_PRODUCTVERSION_STR
+ END
+ END
+
+ BLOCK "VarFileInfo"
+ BEGIN
+ /* The following line should only be modified for localized versions. */
+ /* It consists of any number of WORD,WORD pairs, with each pair */
+ /* describing a language,codepage combination supported by the file. */
+ /* */
+ /* For example, a file might have values "0x409,1252" indicating that it */
+ /* supports English language (0x409) in the Windows ANSI codepage (1252). */
+
+ VALUE "Translation", 0x409, 1252
+
+ END
+END
diff -Naur openvdb-original/CMakeLists.txt openvdb/CMakeLists.txt
--- openvdb-original/CMakeLists.txt 2020-08-27 03:34:02.000000000 +0200
+++ openvdb/CMakeLists.txt 2020-09-02 10:56:21.665735244 +0200
@@ -68,6 +68,7 @@
option(OPENVDB_INSTALL_HOUDINI_PYTHONRC [=[Install a Houdini startup script that sets
the visibilty of OpenVDB nodes and their native equivalents.]=] OFF)
option(OPENVDB_BUILD_MAYA_PLUGIN "Build the Maya plugin" OFF)
+option(OPENVDB_BUILD_NANOVDB "Build nanovdb" ON)
option(OPENVDB_ENABLE_RPATH "Build with RPATH information" ON)
option(OPENVDB_CXX_STRICT "Enable or disable pre-defined compiler warnings" OFF)
option(OPENVDB_CODE_COVERAGE "Enable code coverage. This also overrides CMAKE_BUILD_TYPE to Debug" OFF)
@@ -740,6 +741,10 @@
add_subdirectory(openvdb_maya)
endif()
+if(OPENVDB_BUILD_NANOVDB)
+ add_subdirectory(nanovdb)
+endif()
+
##########################################################################
add_custom_target(uninstall

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